/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./js/app.js":
/*!*******************!*\
  !*** ./js/app.js ***!
  \*******************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _fortawesome_fontawesome_free_webfonts_fa_solid_900_woff2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 */ \"./node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2\");\n/* harmony import */ var plotly_js_cartesian_dist__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plotly.js-cartesian-dist */ \"./node_modules/plotly.js-cartesian-dist/plotly-cartesian.js\");\n/* harmony import */ var plotly_js_cartesian_dist__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(plotly_js_cartesian_dist__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _controllers_OverviewController__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./controllers/OverviewController */ \"./js/controllers/OverviewController.js\");\n/* harmony import */ var _controllers_hourlyLoad__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./controllers/hourlyLoad */ \"./js/controllers/hourlyLoad.js\");\n/* harmony import */ var _controllers_multiVersion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./controllers/multiVersion */ \"./js/controllers/multiVersion.js\");\n/* harmony import */ var _controllers_dailyUtilization__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./controllers/dailyUtilization */ \"./js/controllers/dailyUtilization.js\");\n/* harmony import */ var _controllers_apiPerformance__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./controllers/apiPerformance */ \"./js/controllers/apiPerformance.js\");\n/* harmony import */ var _controllers_reporting__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./controllers/reporting */ \"./js/controllers/reporting.js\");\n/* harmony import */ var _controllers_endpointHourlyLoad__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./controllers/endpointHourlyLoad */ \"./js/controllers/endpointHourlyLoad.js\");\n/* harmony import */ var _controllers_endpointVersionUser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./controllers/endpointVersionUser */ \"./js/controllers/endpointVersionUser.js\");\n/* harmony import */ var _controllers_endpointUsers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./controllers/endpointUsers */ \"./js/controllers/endpointUsers.js\");\n/* harmony import */ var _controllers_endpointProfiler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./controllers/endpointProfiler */ \"./js/controllers/endpointProfiler.js\");\n/* harmony import */ var _controllers_endpointGroupedProfiler__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./controllers/endpointGroupedProfiler */ \"./js/controllers/endpointGroupedProfiler.js\");\n/* harmony import */ var _controllers_endpointOutlier__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./controllers/endpointOutlier */ \"./js/controllers/endpointOutlier.js\");\n/* harmony import */ var _controllers_statusCodeDistribution__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./controllers/statusCodeDistribution */ \"./js/controllers/statusCodeDistribution.js\");\n/* harmony import */ var _controllers_customGraph__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./controllers/customGraph */ \"./js/controllers/customGraph.js\");\n/* harmony import */ var _controllers_configuration__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./controllers/configuration */ \"./js/controllers/configuration.js\");\n/* harmony import */ var _controllers_endpointVersionIP__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./controllers/endpointVersionIP */ \"./js/controllers/endpointVersionIP.js\");\n/* harmony import */ var _controllers_endpointVersion__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./controllers/endpointVersion */ \"./js/controllers/endpointVersion.js\");\n/* harmony import */ var _controllers_monitorLevel__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./controllers/monitorLevel */ \"./js/controllers/monitorLevel.js\");\n/* harmony import */ var _controllers_surveyController__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./controllers/surveyController */ \"./js/controllers/surveyController.js\");\n/* harmony import */ var _controllers_telemetryController__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./controllers/telemetryController */ \"./js/controllers/telemetryController.js\");\n/* harmony import */ var _services_form__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./services/form */ \"./js/services/form.js\");\n/* harmony import */ var _services_info__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./services/info */ \"./js/services/info.js\");\n/* harmony import */ var _services_endpoint__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./services/endpoint */ \"./js/services/endpoint.js\");\n/* harmony import */ var _services_menu__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./services/menu */ \"./js/services/menu.js\");\n/* harmony import */ var _services_pagination__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./services/pagination */ \"./js/services/pagination.js\");\n/* harmony import */ var _services_plotly__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./services/plotly */ \"./js/services/plotly.js\");\n/* harmony import */ var _services_modal__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./services/modal */ \"./js/services/modal.js\");\n/* harmony import */ var _controllers_util__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./controllers/util */ \"./js/controllers/util.js\");\n/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./filters */ \"./js/filters.js\");\n/* harmony import */ var _directives__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./directives */ \"./js/directives.js\");\n// Importing this font here will make it pass through the file loader, moving it to fonts/ directory\r\n\r\n\r\n// Plotly\r\n\r\n\r\nwindow.Plotly = (plotly_js_cartesian_dist__WEBPACK_IMPORTED_MODULE_1___default());\r\n\r\n// jQuery\r\n\r\n\r\nwindow.$ = window.jQuery = (jquery__WEBPACK_IMPORTED_MODULE_2___default());\r\n\r\n// Popper.js\r\n\r\n\r\n\r\n__webpack_require__(/*! bootstrap */ \"./node_modules/bootstrap/dist/js/bootstrap.esm.js\");\r\n\r\n// Moment\r\n\r\n\r\nwindow.moment = (moment__WEBPACK_IMPORTED_MODULE_3___default());\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nlet app = angular.module('fmdApp', ['ngRoute']);\r\n(0,_filters__WEBPACK_IMPORTED_MODULE_32__.applyFilters)(app);\r\n(0,_directives__WEBPACK_IMPORTED_MODULE_33__[\"default\"])(app);\r\n\r\napp.service('formService', ['$http', 'endpointService', '$filter', _services_form__WEBPACK_IMPORTED_MODULE_24__[\"default\"]]);\r\napp.service('infoService', _services_info__WEBPACK_IMPORTED_MODULE_25__[\"default\"]);\r\napp.service('endpointService', ['$http', '$routeParams', _services_endpoint__WEBPACK_IMPORTED_MODULE_26__[\"default\"]]);\r\napp.service('menuService', ['$http', 'endpointService', _services_menu__WEBPACK_IMPORTED_MODULE_27__[\"default\"]]);\r\napp.service('paginationService', ['$http', 'endpointService', _services_menu__WEBPACK_IMPORTED_MODULE_27__[\"default\"]]);\r\napp.service('paginationService', _services_pagination__WEBPACK_IMPORTED_MODULE_28__[\"default\"]);\r\napp.service('plotlyService', ['formService', _services_plotly__WEBPACK_IMPORTED_MODULE_29__[\"default\"]]);\r\napp.service('modalService', _services_modal__WEBPACK_IMPORTED_MODULE_30__[\"default\"]);\r\n\r\napp.controller('MonitorLevelController', ['$scope', '$http', _controllers_monitorLevel__WEBPACK_IMPORTED_MODULE_21__.MonitorLevelController]);\r\n\r\napp.controller('MenuController', ['$scope', 'menuService', _controllers_util__WEBPACK_IMPORTED_MODULE_31__.MenuController]);\r\napp.controller('InfoController', ['$scope', 'infoService', _controllers_util__WEBPACK_IMPORTED_MODULE_31__.InfoController]);\r\napp.controller('FormController', ['$scope', 'formService', _controllers_util__WEBPACK_IMPORTED_MODULE_31__.FormController]);\r\napp.controller('EndpointController', ['$scope', 'endpointService', _controllers_util__WEBPACK_IMPORTED_MODULE_31__.EndpointController]);\r\napp.controller('PaginationController', ['$scope', 'paginationService', _controllers_util__WEBPACK_IMPORTED_MODULE_31__.PaginationController]);\r\napp.controller('ModalController', ['$scope', '$window', '$browser', 'modalService', _controllers_util__WEBPACK_IMPORTED_MODULE_31__.ModalController]);\r\n\r\napp.component('surveyComponent', {\r\n    templateUrl: 'static/pages/survey.html',\r\n    controller: _controllers_surveyController__WEBPACK_IMPORTED_MODULE_22__.SurveyController\r\n  });\r\napp.component('telemetryComponent', {\r\n    templateUrl: 'static/pages/telemetry.html',\r\n    controller: _controllers_telemetryController__WEBPACK_IMPORTED_MODULE_23__.TelemetryController\r\n  });\r\n\r\napp.config(['$locationProvider', '$routeProvider', function ($locationProvider, $routeProvider) {\r\n    $routeProvider\r\n        .when('/overview', {\r\n            templateUrl: 'static/pages/overview.html',\r\n            controller: ['$scope', '$http', '$location', 'menuService', 'endpointService', _controllers_OverviewController__WEBPACK_IMPORTED_MODULE_4__.OverviewController]\r\n        })\r\n        .when('/hourly_load', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: ['$scope', '$http', 'menuService', 'plotlyService', 'infoService',\r\n                'formService', 'endpointService', '$filter', _controllers_hourlyLoad__WEBPACK_IMPORTED_MODULE_5__.HourlyLoadController]\r\n        })\r\n        .when('/multi_version', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: ['$scope', '$http', 'menuService', 'formService', 'infoService', 'plotlyService', 'endpointService', _controllers_multiVersion__WEBPACK_IMPORTED_MODULE_6__.MultiVersionController]\r\n        })\r\n        .when('/daily_utilization', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: ['$scope', '$http', 'menuService', 'formService', 'infoService',\r\n                'plotlyService', 'endpointService', _controllers_dailyUtilization__WEBPACK_IMPORTED_MODULE_7__.DailyUtilizationController]\r\n        })\r\n        .when('/api_performance', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: ['$scope', '$http', 'menuService', 'formService', 'infoService',\r\n                'plotlyService', 'endpointService', _controllers_apiPerformance__WEBPACK_IMPORTED_MODULE_8__.ApiPerformanceController]\r\n        })\r\n        .when('/reporting', {\r\n            templateUrl: 'static/pages/reporting.html',\r\n            controller: ['$scope', '$http', 'menuService', 'endpointService', 'plotlyService', _controllers_reporting__WEBPACK_IMPORTED_MODULE_9__.ReportingController]\r\n        })\r\n        .when('/endpoint/:endpointId/hourly_load', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: ['$scope', '$http', 'menuService', 'endpointService',\r\n                'infoService', 'formService', 'plotlyService', '$filter', _controllers_endpointHourlyLoad__WEBPACK_IMPORTED_MODULE_10__.EndpointHourlyLoadController]\r\n        })\r\n        .when('/endpoint/:endpointId/version_user', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: [\r\n                '$scope', '$http', 'infoService', 'endpointService',\r\n                'menuService', 'formService', 'plotlyService', '$filter', _controllers_endpointVersionUser__WEBPACK_IMPORTED_MODULE_11__.EndpointVersionUserController]\r\n        })\r\n        .when('/endpoint/:endpointId/version_ip', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: [\r\n                '$scope', '$http', 'infoService', 'endpointService',\r\n                'menuService', 'formService', 'plotlyService', '$filter', _controllers_endpointVersionIP__WEBPACK_IMPORTED_MODULE_19__.EndpointVersionIPController]\r\n        })\r\n        .when('/endpoint/:endpointId/versions', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: ['$scope', '$http', 'infoService', 'endpointService',\r\n                'menuService', 'formService', 'plotlyService', '$filter', _controllers_endpointVersion__WEBPACK_IMPORTED_MODULE_20__.EndpointVersionController]\r\n        })\r\n        .when('/endpoint/:endpointId/users', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: ['$scope', '$http', 'infoService', 'endpointService',\r\n                'menuService', 'formService', 'plotlyService', _controllers_endpointUsers__WEBPACK_IMPORTED_MODULE_12__.EndpointUsersController]\r\n        })\r\n        .when('/endpoint/:endpointId/profiler', {\r\n            templateUrl: 'static/pages/profiler.html',\r\n            controller: ['$scope', '$http', 'menuService', 'endpointService',\r\n                'paginationService', 'formService', _controllers_endpointProfiler__WEBPACK_IMPORTED_MODULE_13__.EndpointProfilerController]\r\n        })\r\n        .when('/endpoint/:endpointId/grouped-profiler', {\r\n            templateUrl: 'static/pages/grouped_profiler.html',\r\n            controller: ['$scope', '$http', 'menuService',\r\n                'endpointService', 'formService', _controllers_endpointGroupedProfiler__WEBPACK_IMPORTED_MODULE_14__.EndpointGroupedProfilerController]\r\n        })\r\n        .when('/endpoint/:endpointId/outliers', {\r\n            templateUrl: 'static/pages/outliers.html',\r\n            controller: ['$scope', '$http', 'endpointService', 'menuService',\r\n                'paginationService', 'plotlyService', _controllers_endpointOutlier__WEBPACK_IMPORTED_MODULE_15__.OutlierController]\r\n        })\r\n        .when('/endpoint/:endpointId/status_code_distribution', {\r\n            templateUrl: 'static/pages/status_code_distribution.html',\r\n            controller: [\r\n                '$scope', '$http', 'infoService', 'endpointService', 'menuService', 'formService', 'plotlyService', _controllers_statusCodeDistribution__WEBPACK_IMPORTED_MODULE_16__.StatusCodeDistributionController],\r\n        })\r\n        .when('/custom_graph/:graphId', {\r\n            templateUrl: 'static/pages/plotly_graph.html',\r\n            controller: ['$scope', '$http', 'infoService', 'endpointService',\r\n                'menuService', 'formService', 'plotlyService', _controllers_customGraph__WEBPACK_IMPORTED_MODULE_17__.CustomGraphController]\r\n        })\r\n        .when('/configuration', {\r\n            templateUrl: 'static/pages/configuration.html',\r\n            controller: ['$scope', '$http', 'menuService', 'endpointService', 'modalService', _controllers_configuration__WEBPACK_IMPORTED_MODULE_18__.ConfigurationController]\r\n        })\r\n        .otherwise({\r\n            redirectTo: '/overview'\r\n        });\r\n\r\n    $locationProvider.html5Mode({\r\n        enabled: true,\r\n        requireBase: true\r\n    });\r\n}]);\r\n\r\n// Toggle the side navigation\r\njquery__WEBPACK_IMPORTED_MODULE_2___default()(\"#sidenavToggler\").click(function (e) {\r\n    e.preventDefault();\r\n    jquery__WEBPACK_IMPORTED_MODULE_2___default()(\"body\").toggleClass(\"sidenav-toggled\");\r\n    jquery__WEBPACK_IMPORTED_MODULE_2___default()(\".navbar-sidenav .nav-link-collapse\").addClass(\"collapsed\");\r\n    jquery__WEBPACK_IMPORTED_MODULE_2___default()(\".navbar-sidenav .sidenav-second-level, .navbar-sidenav .sidenav-third-level\").removeClass(\"show\");\r\n});\r\n// Force the toggled class to be removed when a collapsible nav link is clicked\r\njquery__WEBPACK_IMPORTED_MODULE_2___default()(\".navbar-sidenav .nav-link-collapse\").click(function (e) {\r\n    e.preventDefault();\r\n    jquery__WEBPACK_IMPORTED_MODULE_2___default()(\"body\").removeClass(\"sidenav-toggled\");\r\n});\r\n\r\n\r\nwindow.app = app;\n\n//# sourceURL=webpack://frontend/./js/app.js?");

/***/ }),

/***/ "./js/controllers/OverviewController.js":
/*!**********************************************!*\
  !*** ./js/controllers/OverviewController.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   OverviewController: () => (/* binding */ OverviewController)\n/* harmony export */ });\nfunction OverviewController($scope, $http, $location, menuService, endpointService) {\r\n    endpointService.reset();\r\n    menuService.reset('overview');\r\n    $scope.alertShow = false;\r\n    $scope.pypi_version = '';\r\n    $scope.dashboard_version = '';\r\n    $scope.isHits = true;\r\n\r\n    $scope.table = [];\r\n    $scope.selectedItem = 2;\r\n\r\n    $scope.searchQuery = '';\r\n    $scope.pageSize = '10';\r\n    $scope.currentPage = 0;\r\n    $scope.blueprints = [''];\r\n    $scope.slectedBlueprint = '';\r\n\r\n    $scope.toggleHits = function () {\r\n        $scope.isHits = !$scope.isHits;\r\n    };\r\n\r\n    $http.get('api/overview').then(function (response) {\r\n        response.data.forEach((endpoint) => {\r\n            if (!$scope.blueprints.includes(endpoint.blueprint)) {\r\n                $scope.blueprints.push(endpoint.blueprint)\r\n            }\r\n        })\r\n        $scope.table = response.data;\r\n    });\r\n\r\n    function getItemsForPage(pageNumber) {\r\n        const start = Number(pageNumber) * $scope.pageSize;\r\n        const end = (Number(pageNumber) + 1) * Number($scope.pageSize);\r\n\r\n        let items = $scope.table\r\n            .filter(item => item.name.includes($scope.searchQuery))\r\n        if ($scope.slectedBlueprint) {\r\n            items = items.filter(item => item.blueprint===$scope.slectedBlueprint)\r\n        }\r\n\r\n        return items.slice(start, end);\r\n    }\r\n\r\n    $scope.getFilteredItems = function () {\r\n        return getItemsForPage($scope.currentPage);\r\n    }\r\n\r\n    $scope.canGoBack = function () {\r\n        return $scope.currentPage > 0;\r\n    }\r\n\r\n    $scope.canGoForward = function () {\r\n        return getItemsForPage($scope.currentPage + 1).length > 0;\r\n    }\r\n\r\n    $scope.nextPage = function () {\r\n        $scope.currentPage++;\r\n    }\r\n\r\n    $scope.previousPage = function () {\r\n        $scope.currentPage--;\r\n    }\r\n\r\n\r\n    $scope.go = function (path) {\r\n        $location.path(path);\r\n    };\r\n\r\n    $http.get('https://pypi.org/pypi/Flask-MonitoringDashboard/json').then(function (response) {\r\n        $scope.pypi_version = response.data['info']['version'];\r\n\r\n        $http.get('api/deploy_details').then(function (response) {\r\n            $scope.dashboard_version = response.data['dashboard-version'];\r\n            $scope.alertShow = !isNewestVersion($scope.pypi_version, $scope.dashboard_version);\r\n        })\r\n    });\r\n}\r\n\r\nfunction isNewestVersion(pypi_version, dashboard_version) {\r\n    let pypi_version_array = pypi_version.split('.');\r\n    let dashboard_version_array = dashboard_version.split('.');\r\n    for (let i = 0; i < 3; i++) {\r\n        if (pypi_version_array[i] > dashboard_version_array[i]) {\r\n            return false;  // using an older version.\r\n        } else if (pypi_version_array[i] < dashboard_version_array[i]){\r\n            return true;  // using a newer version.\r\n        }\r\n    }\r\n    return true;  // using the same version.\r\n}\r\n\n\n//# sourceURL=webpack://frontend/./js/controllers/OverviewController.js?");

/***/ }),

/***/ "./js/controllers/apiPerformance.js":
/*!******************************************!*\
  !*** ./js/controllers/apiPerformance.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   ApiPerformanceController: () => (/* binding */ ApiPerformanceController)\n/* harmony export */ });\nfunction ApiPerformanceController($scope, $http, menuService, formService, infoService,\r\n                                  plotlyService, endpointService) {\r\n    endpointService.reset();\r\n    menuService.reset('api_performance');\r\n    $scope.title = 'API Performance';\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'The X-axis presents the execution time in ms. The Y-axis presents every endpoint of ' +\r\n        'the Flask application.';\r\n    infoService.contentText = 'In this graph, it is easy to compare the execution times of different endpoints. ' +\r\n        'This information can be used to discover which endpoints need to be improved in terms ' +\r\n        'of response times.';\r\n\r\n    // Set the form handler\r\n    formService.clear();\r\n    formService.addEndpoints();\r\n\r\n    formService.setReload(function () {\r\n        $http.post('api/api_performance', {\r\n            data: {\r\n                endpoints: formService.getMultiSelection('endpoints')\r\n            }\r\n        }).then(function (response) {\r\n            let data = response.data.map(obj => {\r\n                return {\r\n                    x: obj.values,\r\n                    type: 'box',\r\n                    name: obj.name,\r\n                };\r\n            });\r\n\r\n            plotlyService.chart(data, {\r\n                xaxis: {\r\n                    title: 'Execution time (ms)',\r\n                },\r\n                yaxis: {\r\n                    type: 'category'\r\n                }\r\n            });\r\n        });\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/apiPerformance.js?");

/***/ }),

/***/ "./js/controllers/configuration.js":
/*!*****************************************!*\
  !*** ./js/controllers/configuration.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   ConfigurationController: () => (/* binding */ ConfigurationController)\n/* harmony export */ });\nconst HEADERS = {\r\n    headers: {\r\n        'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'\r\n    }\r\n}\r\n\r\nfunction ConfigurationController($scope, $http, menuService, endpointService, modalService) {\r\n    endpointService.reset();\r\n    menuService.reset('configuration');\r\n    modalService.setConfirm('delete', () => deleteUser($scope.user));\r\n    modalService.setConfirm('edit', () => editUser($scope.user));\r\n    modalService.setConfirm('create', createUser);\r\n\r\n    $scope.details = {};\r\n    $scope.config = {};\r\n    $scope.error = {};\r\n    $scope.userData = [];\r\n\r\n    $http.get('api/users').then(function (response) {\r\n        $scope.userData = response.data;\r\n    });\r\n\r\n    $http.get('api/deploy_details').then(function (response) {\r\n        $scope.details = response.data;\r\n    });\r\n    $http.get('api/deploy_config').then(function (response) {\r\n        $scope.config = response.data;\r\n    });\r\n\r\n    $scope.openModal = function (name, user) {\r\n        $scope.user = user;\r\n        $(`#${name}Modal`).modal();\r\n    }\r\n\r\n    function fetchUsers() {\r\n        $http.get('api/users').then(function (response) {\r\n            $scope.userData = response.data;  // reload user data\r\n        });\r\n    }\r\n\r\n    function createUser() {\r\n        $http.post(\r\n            'api/user/create',\r\n            $.param({\r\n                'username': $('#create-username')[0].value,\r\n                'password': $('#create-pwd')[0].value,\r\n                'password2': $('#create-pwd2')[0].value,\r\n                'is_admin': $('#create-admin')[0].checked,\r\n            }),\r\n            HEADERS\r\n        ).then(function (successResponse) {\r\n            fetchUsers();\r\n            $('#createModal').modal('hide');\r\n            modalService.setErrorMessage('create', null); // remove error message.\r\n        }, function (errorResponse) {\r\n            modalService.setErrorMessage('create', errorResponse.data.message);\r\n        });\r\n    }\r\n\r\n    function editUser() {\r\n        $http.post(\r\n            'api/user/edit',\r\n            $.param({\r\n                'user_id': $scope.user.id,\r\n                'old_password': $('#edit-old-pwd')[0].value,\r\n                'new_password': $('#edit-new-pwd')[0].value,\r\n                'new_password2': $('#edit-new-pwd2')[0].value,\r\n                'is_admin': $('#edit-admin')[0].checked,\r\n            }),\r\n            HEADERS\r\n        ).then(function (successResponse) {\r\n            fetchUsers();\r\n            $('#editModal').modal('hide');\r\n            modalService.setErrorMessage('edit', null); // remove error message.\r\n        }, function (errorResponse) {\r\n            modalService.setErrorMessage('edit', errorResponse.data.message);\r\n        });\r\n    }\r\n\r\n    function deleteUser(user) {\r\n        $http.post(\r\n            'api/user/delete',\r\n            $.param({\r\n                'user_id': user.id\r\n            }),\r\n            HEADERS\r\n        ).then(function (successResponse) {\r\n            fetchUsers();\r\n            $('#deleteModal').modal('hide');\r\n            modalService.setErrorMessage('delete', null); // remove error message.\r\n        }, function (errorResponse) {\r\n            modalService.setErrorMessage('delete', errorResponse.data.message);\r\n        });\r\n    }\r\n\r\n    $scope.telemetryConsent;\r\n\r\n    $scope.fetchTelemetryConsent = function () {\r\n        $http.get('/dashboard/get_is_telemetry_answered')\r\n            .then(function (response) {\r\n                $scope.telemetryConsent = response.data;\r\n            }, function (error) {\r\n                console.error('Error fetching telemetry consent:', error);\r\n            });\r\n    };\r\n\r\n    $scope.handleTelemetry = function (consent) {\r\n        $http.post('/dashboard/telemetry/accept_telemetry_consent', { 'consent': consent })\r\n            .then(function (response) {\r\n            }, function (error) {\r\n                console.error('Error updating telemetry consent:', error);\r\n            });\r\n    };\r\n\r\n    $scope.fetchTelemetryConsent();\r\n\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/configuration.js?");

/***/ }),

/***/ "./js/controllers/customGraph.js":
/*!***************************************!*\
  !*** ./js/controllers/customGraph.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   CustomGraphController: () => (/* binding */ CustomGraphController)\n/* harmony export */ });\nfunction CustomGraphController($scope, $http, infoService, endpointService,\r\n                               menuService, formService, plotlyService) {\r\n    endpointService.reset();\r\n    menuService.reset('custom_graph' + endpointService.graphId);\r\n    $scope.title = endpointService.getGraphTitle();\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = name;\r\n    };\r\n\r\n    // Set the information box\r\n    infoService.axesText = '';\r\n    infoService.contentText = '';\r\n\r\n    formService.clear();\r\n    let startDate = formService.addDate('Start date');\r\n    startDate.value.setDate(startDate.value.getDate() - 14);\r\n    formService.addDate('End date');\r\n\r\n    formService.setReload(function () {\r\n        let start = formService.getDate('Start date');\r\n        let end = formService.getDate('End date');\r\n\r\n        $http.get('api/custom_graph/' + endpointService.graphId + '/' + start + '/' + end)\r\n            .then(function (response) {\r\n                let values = response.data.map(o => o.value);\r\n                let times = response.data.map(o => o.time);\r\n                plotlyService.chart([{\r\n                    x: times,\r\n                    y: values,\r\n                    type: 'bar',\r\n                    name: $scope.title\r\n                }], {\r\n                    yaxis: {\r\n                        title: 'Values',\r\n                    },\r\n                    margin: {\r\n                        l: 100\r\n                    }\r\n                });\r\n            });\r\n    });\r\n    formService.reload();\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/customGraph.js?");

/***/ }),

/***/ "./js/controllers/dailyUtilization.js":
/*!********************************************!*\
  !*** ./js/controllers/dailyUtilization.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   DailyUtilizationController: () => (/* binding */ DailyUtilizationController)\n/* harmony export */ });\nfunction DailyUtilizationController($scope, $http, menuService, formService, infoService,\r\n                                    plotlyService, endpointService) {\r\n    endpointService.reset();\r\n    menuService.reset('daily_load');\r\n    $scope.title = 'Daily API Utilization';\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'The X-axis presents the amount of requests. The Y-axis presents a number of days.';\r\n    infoService.contentText = 'This graph presents a horizontal stacked barplot. Each endpoint is represented ' +\r\n        'by a color. In the legend on the right, you can disable a certain endpoint by clicking on it. You can ' +\r\n        'also show in the information of a single endpoint by double clicking that endpoint in the legend. The ' +\r\n        'information from this graph can be used to see on which days (a subset of) the endpoints are used the most.';\r\n\r\n    // Set the form handler\r\n    formService.clear();\r\n    let start = formService.addDate('Start date');\r\n    start.value.setDate(start.value.getDate() - 10);\r\n    formService.addDate('End date');\r\n\r\n    formService.setReload(function () {\r\n        let start = formService.getDate('Start date');\r\n        let end = formService.getDate('End date');\r\n\r\n        $http.get('api/requests/' + start + '/' + end).then(function (response) {\r\n            let data = response.data.data.map(obj => {\r\n                return {\r\n                    x: obj.values,\r\n                    y: response.data.days,\r\n                    name: obj.name,\r\n                    type: 'bar',\r\n                    orientation: 'h'\r\n                };\r\n            });\r\n\r\n            plotlyService.chart(data, {\r\n                barmode: 'stack',\r\n                xaxis: {\r\n                    title: 'Number of requests',\r\n                },\r\n                yaxis: {\r\n                    type: 'category',\r\n                    autorange: 'reversed'\r\n                }\r\n            });\r\n        });\r\n    });\r\n    formService.reload();\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/dailyUtilization.js?");

/***/ }),

/***/ "./js/controllers/endpointGroupedProfiler.js":
/*!***************************************************!*\
  !*** ./js/controllers/endpointGroupedProfiler.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EndpointGroupedProfilerController: () => (/* binding */ EndpointGroupedProfilerController)\n/* harmony export */ });\nfunction EndpointGroupedProfilerController($scope, $http, menuService,\r\n                                           endpointService, formService) {\r\n    endpointService.reset();\r\n    $scope.table = [];\r\n\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = 'Grouped profiler for ' + name;\r\n    };\r\n    menuService.reset('endpoint_grouped_profiler');\r\n\r\n    $http.get('api/grouped_profiler/' + endpointService.info.id).then(function (response) {\r\n        formService.isLoading = false;\r\n        $scope.table = response.data;\r\n        for (let i = 0; i < $scope.table.length; i++) {\r\n            let row = $scope.table[i];\r\n            row.min = parseInt(row.indent) === 0;     // show min- or plus-button\r\n            row.showRow = parseInt(row.indent) < 2; // completely show or hide the row\r\n            row.body = getBody($scope.table, i); // lines that must be minimized\r\n        }\r\n\r\n        let sunburst = makeSunburst($scope.table, 0);\r\n        const color = d3.scaleOrdinal(d3.schemeCategory20);\r\n\r\n        Sunburst()\r\n            .data(sunburst)\r\n            .label('name')\r\n            .size('size')\r\n            .color((d, parent) => color(parent ? parent.data.name : null))\r\n            .tooltipContent((d, node) => {\r\n                return 'Size: <i>' + node.value + '</i>';\r\n            })\r\n            (document.getElementById('sunburst'));\r\n    });\r\n\r\n    let makeSunburst = function (data, indent) {\r\n        if (indent === 0) {\r\n            let i = 0;\r\n            while (i + 1 < data.length && parseInt(data[i + 1].indent) === 0) {\r\n                i++;\r\n            }\r\n            return {\r\n                name: data[i].code,\r\n                children: makeSunburst(data[i].body.map(i => $scope.table[i]), 1)\r\n            };\r\n        } else {\r\n            let children = [];\r\n            for (let row of data) {\r\n                if (parseInt(row.indent) === indent) {\r\n                    if (row.body.length > 0) {\r\n                        children.push({\r\n                            name: row.code,\r\n                            children: makeSunburst(row.body.map(i => $scope.table[i]), indent + 1)\r\n                        });\r\n                    } else {\r\n                        children.push({\r\n                            name: row.code,\r\n                            size: Math.max(row.duration, 1)\r\n                        })\r\n                    }\r\n                }\r\n            }\r\n            return children\r\n        }\r\n    };\r\n    $scope.buttonText = function () {\r\n        return $scope.table.every(i => i.showRow) ? 'Hide all' : 'Expand all';\r\n    };\r\n\r\n    $scope.toggleButton = function () {\r\n        if ($scope.table.every(i => i.showRow)) { // hide\r\n            for (let row of $scope.table) {\r\n                row.min = parseInt(row.indent) === 0;\r\n                row.showRow = parseInt(row.indent) < 2;\r\n            }\r\n        } else { // show\r\n            for (let row of $scope.table) {\r\n                row.showRow = true;\r\n                row.min = true;\r\n            }\r\n        }\r\n    };\r\n\r\n    $scope.toggleRows = function (row) {\r\n        if (row.min) { // minimize\r\n            for (let i of row.body) {\r\n                $scope.table[i].min = false;\r\n                $scope.table[i].showRow = false;\r\n            }\r\n        } else { // maximize\r\n            for (let i of row.body) {\r\n                $scope.table[i].showRow =\r\n                    parseInt($scope.table[i].indent) === parseInt(row.indent) + 1;\r\n            }\r\n        }\r\n\r\n        row.min = !row.min;\r\n    };\r\n\r\n    let getBody = function (rows, j) {\r\n        let body = [];\r\n        let index = j + 1;\r\n        while (index < rows.length && parseInt(rows[index].indent) > parseInt(rows[j].indent)) {\r\n            body.push(index);\r\n            index += 1;\r\n        }\r\n        return body;\r\n    };\r\n\r\n    $scope.computeColor = function (percentage) {\r\n        let red = [230, 74, 54];\r\n        let green = [198, 220, 0];\r\n\r\n        let r = red[0] * percentage + green[0] * (1 - percentage);\r\n        let g = red[1] * percentage + green[1] * (1 - percentage);\r\n        let b = red[2] * percentage + green[2] * (1 - percentage);\r\n        return 'rgb(' + r + ', ' + g + ', ' + b + ')';\r\n    };\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/endpointGroupedProfiler.js?");

/***/ }),

/***/ "./js/controllers/endpointHourlyLoad.js":
/*!**********************************************!*\
  !*** ./js/controllers/endpointHourlyLoad.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EndpointHourlyLoadController: () => (/* binding */ EndpointHourlyLoadController)\n/* harmony export */ });\nfunction EndpointHourlyLoadController($scope, $http, menuService, endpointService,\r\n                                      infoService, formService, plotlyService, $filter) {\r\n    endpointService.reset();\r\n    menuService.reset('endpoint_hourly');\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = 'Hourly API Utilization for ' + name;\r\n    };\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'The X-axis represents the dates. The Y-axis presents the hours of the day.';\r\n    infoService.contentText = 'The cell color represents the number of requests that the application ' +\r\n        'received in a single hour for this endpoint. The darker the cell, the more requests it has processed.' +\r\n        ' This information can be used to discover the peak usage hours of this endpoint.';\r\n\r\n    // Set the form handler\r\n    formService.clear();\r\n    let start = formService.addDate('Start date');\r\n    formService.addDate('End date');\r\n    start.value.setDate(start.value.getDate() - 14);\r\n\r\n    formService.setReload(function () {\r\n        let start = formService.getDate('Start date');\r\n        let end = formService.getDate('End date');\r\n        let times = [...Array(24).keys()].map(d => d + \":00 \");\r\n\r\n        $http.get('api/hourly_load/' + start + '/' + end + '/' + endpointService.info.id)\r\n            .then(function (response) {\r\n                let x = response.data.days;\r\n                let y = times;\r\n                let z = response.data.data;\r\n                let hover_text = z.map((row, i) => row.map((item, j) => {\r\n                  return `Date: ${$filter('dateShort')(x[j])}<br>Time: ${i + ':00'}<br>Requests: ${item}`\r\n                }));\r\n                plotlyService.heatmap(x, y, z, {\r\n\r\n                    xaxis: {\r\n                        type: 'category',\r\n                        title: 'Versions'\r\n                    },\r\n                    yaxis: {\r\n                        type: 'category',\r\n                        autorange: 'reversed'\r\n                    },\r\n                    margin: {l: 50}\r\n                }, hover_text);\r\n            });\r\n    });\r\n    formService.reload();\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/endpointHourlyLoad.js?");

/***/ }),

/***/ "./js/controllers/endpointOutlier.js":
/*!*******************************************!*\
  !*** ./js/controllers/endpointOutlier.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   OutlierController: () => (/* binding */ OutlierController)\n/* harmony export */ });\nfunction OutlierController($scope, $http, endpointService, menuService,\r\n                           paginationService, plotlyService) {\r\n    $scope.table = [];\r\n\r\n    endpointService.reset();\r\n    menuService.reset('endpoint_outlier');\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = 'Outliers for ' + name;\r\n    };\r\n\r\n    // Pagination\r\n    paginationService.init('outliers');\r\n    $http.get('api/num_outliers/' + endpointService.info.id).then(function (response) {\r\n        paginationService.setTotal(response.data);\r\n    });\r\n    paginationService.onReload = function () {\r\n        $http.get('api/outlier_table/' + endpointService.info.id + '/' +\r\n            paginationService.getLeft() + '/' + paginationService.perPage).then(function (response) {\r\n            $scope.table = response.data;\r\n        });\r\n    };\r\n\r\n    $http.get('api/outlier_graph/' + endpointService.info.id).then(function (response) {\r\n        plotlyService.chart(response.data.map(row => {\r\n            return {\r\n                x: row.values,\r\n                type: 'box',\r\n                name: row.name,\r\n                marker: {color: row.color}\r\n            };\r\n        }), {\r\n            xaxis: {\r\n                title: 'CPU loads (%)',\r\n            },\r\n            yaxis: {\r\n                type: 'category',\r\n                autorange: 'reversed'\r\n            }\r\n        });\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/endpointOutlier.js?");

/***/ }),

/***/ "./js/controllers/endpointProfiler.js":
/*!********************************************!*\
  !*** ./js/controllers/endpointProfiler.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EndpointProfilerController: () => (/* binding */ EndpointProfilerController)\n/* harmony export */ });\nfunction EndpointProfilerController($scope, $http, menuService, endpointService,\r\n                                    paginationService, formService) {\r\n    endpointService.reset();\r\n\r\n    // TODO: refactor endpointProfiler and endpointGroupedProfiler\r\n\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = 'Profiler for ' + name;\r\n    };\r\n    menuService.reset('endpoint_profiler');\r\n\r\n    paginationService.init('requests');\r\n    $http.get('api/num_profiled/' + endpointService.info.id).then(function (response) {\r\n        paginationService.setTotal(response.data);\r\n    });\r\n    paginationService.onReload = function () {\r\n        formService.isLoading = true;\r\n        $http.get('api/profiler_table/' + endpointService.info.id + '/' +\r\n            paginationService.getLeft() + '/' + paginationService.perPage).then(function (response) {\r\n            $scope.table = response.data;\r\n            formService.isLoading = false;\r\n            // Add more properties\r\n            for (let req of $scope.table) {\r\n                let rows = req.stack_lines;\r\n                for (let row of rows) {\r\n                    row.min = parseInt(row.indent) === 0;     // show min- or plus-button\r\n                    row.showRow = parseInt(row.indent) < 2; // completely show or hide the row\r\n                    row.body = getBody(rows, parseInt(row.position)); // lines that must be minimized\r\n                }\r\n            }\r\n        });\r\n    };\r\n\r\n    $scope.buttonText = function (request) {\r\n        return request.stack_lines.every(i => i.showRow) ? 'Hide all' : 'Expand all';\r\n    };\r\n\r\n    $scope.toggleButton = function (request) {\r\n        if (request.stack_lines.every(i => i.showRow)) { // hide\r\n            for (let row of request.stack_lines) {\r\n                row.min = parseInt(row.indent) === 0;\r\n                row.showRow = parseInt(row.indent) < 2;\r\n            }\r\n        } else { // show\r\n            for (let row of request.stack_lines) {\r\n                row.showRow = true;\r\n                row.min = true;\r\n            }\r\n        }\r\n    };\r\n\r\n    $scope.toggleRows = function (request, row) {\r\n        if (row.min) { // minimize\r\n            for (let i of row.body) {\r\n                request.stack_lines[i].min = false;\r\n                request.stack_lines[i].showRow = false;\r\n            }\r\n        } else { // maximize\r\n            for (let i of row.body) {\r\n                request.stack_lines[i].showRow =\r\n                    parseInt(request.stack_lines[i].indent) === parseInt(row.indent) + 1;\r\n            }\r\n        }\r\n\r\n        row.min = !row.min;\r\n    };\r\n\r\n    let getBody = function (rows, j) {\r\n        let body = [];\r\n        let index = j + 1;\r\n        while (index < rows.length && parseInt(rows[index].indent) > parseInt(rows[j].indent)) {\r\n            body.push(index);\r\n            index += 1;\r\n        }\r\n        return body;\r\n    };\r\n\r\n    $scope.computeColor = function (percentage) {\r\n        let red = [230, 74, 54];\r\n        let green = [198, 220, 0];\r\n\r\n        let r = red[0] * percentage + green[0] * (1 - percentage);\r\n        let g = red[1] * percentage + green[1] * (1 - percentage);\r\n        let b = red[2] * percentage + green[2] * (1 - percentage);\r\n        return 'rgb(' + r + ', ' + g + ', ' + b + ')';\r\n    };\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/endpointProfiler.js?");

/***/ }),

/***/ "./js/controllers/endpointUsers.js":
/*!*****************************************!*\
  !*** ./js/controllers/endpointUsers.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EndpointUsersController: () => (/* binding */ EndpointUsersController)\n/* harmony export */ });\nfunction EndpointUsersController($scope, $http, infoService, endpointService,\r\n                                 menuService, formService, plotlyService) {\r\n    endpointService.reset();\r\n    menuService.reset('endpoint_user');\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = 'Per-User Performance for ' + name;\r\n    };\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'The X-axis presents the execution time in ms. The Y-axis presents the versions that are used.';\r\n    infoService.contentText = 'This graph shows a horizontal boxplot for the versions that are used. With this ' +\r\n        'graph you can found out whether the performance changes across different versions.';\r\n\r\n    formService.clear();\r\n    formService.addUsers();\r\n\r\n    formService.setReload(function () {\r\n        $http.post('api/endpoint_users/' + endpointService.info.id, {\r\n            data: {\r\n                users: formService.getMultiSelection('users'),\r\n            }\r\n        }).then(function (response) {\r\n            plotlyService.chart(response.data.map(row => {\r\n                return {\r\n                    x: row.values,\r\n                    type: 'box',\r\n                    name: row.user,\r\n                    marker: {color: row.color}\r\n                };\r\n            }), {\r\n                xaxis: {\r\n                    title: 'Execution time (ms)',\r\n                },\r\n                yaxis: {\r\n                    type: 'category',\r\n                    autorange: 'reversed'\r\n                },\r\n                margin: {\r\n                    l: 200\r\n                }\r\n            });\r\n        });\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/endpointUsers.js?");

/***/ }),

/***/ "./js/controllers/endpointVersion.js":
/*!*******************************************!*\
  !*** ./js/controllers/endpointVersion.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EndpointVersionController: () => (/* binding */ EndpointVersionController)\n/* harmony export */ });\nfunction EndpointVersionController($scope, $http, infoService, endpointService,\r\n                                   menuService, formService, plotlyService, $filter) {\r\n    endpointService.reset();\r\n    menuService.reset('endpoint_version');\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = 'Per-Version Performance for ' + name;\r\n    };\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'The X-axis presents the execution time in ms. The Y-axis presents the versions that are used.';\r\n    infoService.contentText = 'This graph shows a horizontal boxplot for the versions that are used. With this ' +\r\n        'graph you can found out whether the performance changes across different versions.';\r\n\r\n    formService.clear();\r\n    formService.addVersions(endpointService.info.id);\r\n\r\n    formService.setReload(function () {\r\n        $http.post('api/endpoint_versions/' + endpointService.info.id, {\r\n            data: {\r\n                versions: formService.getMultiSelection('versions'),\r\n            }\r\n        }).then(function (response) {\r\n            plotlyService.chart(response.data.map(row => {\r\n                return {\r\n                    x: row.values,\r\n                    type: 'box',\r\n                    name: row.version + '<br>' + ($filter('dateLayout')(row.date)),\r\n                    marker: {color: row.color}\r\n                };\r\n            }), {\r\n                xaxis: {\r\n                    title: 'Execution time (ms)',\r\n                },\r\n                yaxis: {\r\n                    type: 'category',\r\n                    autorange: 'reversed'\r\n                },\r\n                margin: {\r\n                    l: 200\r\n                }\r\n            });\r\n        });\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/endpointVersion.js?");

/***/ }),

/***/ "./js/controllers/endpointVersionIP.js":
/*!*********************************************!*\
  !*** ./js/controllers/endpointVersionIP.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EndpointVersionIPController: () => (/* binding */ EndpointVersionIPController)\n/* harmony export */ });\nfunction EndpointVersionIPController($scope, $http, infoService, endpointService,\r\n                                     menuService, formService, plotlyService, $filter) {\r\n    endpointService.reset();\r\n    menuService.reset('endpoint_ip');\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = 'IP-Focused Multi-Version Performance for ' + name;\r\n    };\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'In this graph, the X-axis presents the versions that are used. The Y-axis presents ' +\r\n        '(a subset of) all IP-addresses. You can use the slider to select a subset of the all IP-addresses.';\r\n    infoService.contentText = 'The cell color represents the average response time (expressed in ms) of this endpoint ' +\r\n        'per IP per version.';\r\n\r\n    formService.clear();\r\n    formService.addIP();\r\n    formService.addVersions(endpointService.info.id);\r\n\r\n    formService.setReload(function () {\r\n        $http.post('api/version_ip/' + endpointService.info.id, {\r\n            data: {\r\n                versions: formService.getMultiSelection('versions'),\r\n                ip: formService.getMultiSelection('IP-addresses')\r\n            }\r\n        }).then(function (response) {\r\n            let versions = response.data.versions.map(\r\n                obj => obj.version + '<br>' + $filter('dateLayout')(obj.date)\r\n            );\r\n            plotlyService.heatmap(versions,\r\n                formService.getMultiSelection('IP-addresses'), response.data.data, {\r\n                    xaxis: {\r\n                        type: 'category',\r\n                        title: 'Versions'\r\n                    },\r\n                    yaxis: {\r\n                        type: 'category',\r\n                        title: 'IP-addresses'\r\n                    }\r\n                });\r\n        });\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/endpointVersionIP.js?");

/***/ }),

/***/ "./js/controllers/endpointVersionUser.js":
/*!***********************************************!*\
  !*** ./js/controllers/endpointVersionUser.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EndpointVersionUserController: () => (/* binding */ EndpointVersionUserController)\n/* harmony export */ });\nfunction EndpointVersionUserController($scope, $http, infoService, endpointService,\r\n                                       menuService, formService, plotlyService, $filter) {\r\n    endpointService.reset();\r\n    menuService.reset('endpoint_user_version');\r\n    endpointService.onNameChanged = function (name) {\r\n        $scope.title = 'User-Focused Multi-Version Performance for ' + name;\r\n    };\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'In this graph, the X-axis presents the versions that are used. The Y-axis ' +\r\n        'presents (a subset of) all unique users, as specified by \"dashboard.config.group_by\". You can ' +\r\n        'use the slider to select a subset of the all unique users.';\r\n    infoService.contentText = 'The cell color represents the average response time (expressed in ms) of this endpoint ' +\r\n        'per user per version.';\r\n\r\n    formService.clear();\r\n    formService.addUsers();\r\n    formService.addVersions(endpointService.info.id);\r\n\r\n    formService.setReload(function () {\r\n        $http.post('api/version_user/' + endpointService.info.id, {\r\n            data: {\r\n                versions: formService.getMultiSelection('versions'),\r\n                users: formService.getMultiSelection('users')\r\n            }\r\n        }).then(function (response) {\r\n            let versions = response.data.versions.map(\r\n                obj => obj.version + '<br>' + $filter('dateLayout')(obj.date)\r\n            );\r\n            plotlyService.heatmap(versions,\r\n                formService.getMultiSelection('users'),\r\n                response.data.data, {\r\n                    xaxis: {\r\n                        type: 'category',\r\n                        title: 'Versions'\r\n                    },\r\n                    yaxis: {\r\n                        type: 'category',\r\n                        title: 'Users',\r\n                        autorange: 'reversed'\r\n                    }\r\n                });\r\n        });\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/endpointVersionUser.js?");

/***/ }),

/***/ "./js/controllers/hourlyLoad.js":
/*!**************************************!*\
  !*** ./js/controllers/hourlyLoad.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   HourlyLoadController: () => (/* binding */ HourlyLoadController)\n/* harmony export */ });\nfunction HourlyLoadController($scope, $http, menuService, plotlyService, infoService,\r\n                              formService, endpointService, $filter) {\r\n    endpointService.reset();\r\n    menuService.reset('hourly_load');\r\n    $scope.title = 'Hourly API Utilization';\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'The X-axis represents the dates. The Y-axis presents the hours of the day.';\r\n    infoService.contentText = 'The cell color represents the number of requests that the application ' +\r\n        'received in a single hour. The darker the cell, the more requests it has processed. This information ' +\r\n        'can be used to to discover the peak usage hours of the Flask application.';\r\n\r\n    // Set the form handler\r\n    formService.clear();\r\n    let start = formService.addDate('Start date');\r\n    formService.addDate('End date');\r\n    start.value.setDate(start.value.getDate() - 14);\r\n\r\n    formService.setReload(function () {\r\n        let start = formService.getDate('Start date');\r\n        let end = formService.getDate('End date');\r\n        let times = [...Array(24).keys()].map(d => d + \":00\");\r\n        $http.get('api/hourly_load/' + start + '/' + end).then(function (response) {\r\n            let x = response.data.days;\r\n            let y = times;\r\n            let z = response.data.data;\r\n            let hover_text = z.map((row, i) => row.map((item, j) => {\r\n              return `Date: ${$filter('dateShort')(x[j])}<br>Time: ${i + ':00'}<br>Requests: ${item}`\r\n            }));\r\n\r\n            plotlyService.heatmap(x, y, z, {\r\n                yaxis: {\r\n                    autorange: 'reversed'\r\n                },\r\n                margin: {l: 50}\r\n            }, hover_text);\r\n        });\r\n    });\r\n    formService.reload();\r\n}\r\n\n\n//# sourceURL=webpack://frontend/./js/controllers/hourlyLoad.js?");

/***/ }),

/***/ "./js/controllers/monitorLevel.js":
/*!****************************************!*\
  !*** ./js/controllers/monitorLevel.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   MonitorLevelController: () => (/* binding */ MonitorLevelController)\n/* harmony export */ });\nfunction MonitorLevelController($scope, $http) {\r\n\r\n    $scope.sendForm = function (value) {\r\n        $scope.value = value;\r\n        $http.post('api/set_rule',\r\n            $.param({\r\n                'name': $scope.name,\r\n                'value': value\r\n            }),\r\n            {\r\n                headers: {\r\n                    'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'\r\n                }\r\n            });\r\n    };\r\n\r\n    $scope.computeColor = function (level) {\r\n        let a = 0.2;\r\n        if ($scope.value === level) {\r\n            a = 1;\r\n        }\r\n\r\n        let red = [230, 74, 54];\r\n        let green = [237, 255, 77];\r\n\r\n        // level 0 = total green, level 3 = total red\r\n        let percentage = level / 3.0;\r\n        let r = red[0] * percentage + green[0] * (1 - percentage);\r\n        let g = red[1] * percentage + green[1] * (1 - percentage);\r\n        let b = red[2] * percentage + green[2] * (1 - percentage);\r\n\r\n        return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + a + ')';\r\n    };\r\n}\r\n\r\n\n\n//# sourceURL=webpack://frontend/./js/controllers/monitorLevel.js?");

/***/ }),

/***/ "./js/controllers/multiVersion.js":
/*!****************************************!*\
  !*** ./js/controllers/multiVersion.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   MultiVersionController: () => (/* binding */ MultiVersionController)\n/* harmony export */ });\nfunction MultiVersionController($scope, $http, menuService, formService, infoService,\r\n                                plotlyService, endpointService) {\r\n    endpointService.reset();\r\n    menuService.reset('multi_version');\r\n    $scope.title = 'Multi version API Utilization';\r\n\r\n    // Set the information box\r\n    infoService.axesText = 'The X-axis presents the versions that are used. The Y-axis presents the' +\r\n        'endpoints that are found in the Flask application.';\r\n    infoService.contentText = 'The color of the cell presents the distribution of the amount of requests ' +\r\n        'that the application received in a single version for a single endpoint. The darker the cell, ' +\r\n        'the more requests a certain endpoint has processed in that version. Since it displays the ' +\r\n        'distribution of the load, each column sums up to 100%. This information can be used to discover ' +\r\n        'which endpoints process the most requests.';\r\n\r\n    // Set the form handler\r\n    formService.clear();\r\n    formService.addVersions();\r\n    formService.addEndpoints();\r\n\r\n    formService.setReload(function () {\r\n        let versions = formService.getMultiSelection('versions');\r\n        let endpoints = formService.getMultiSelection('endpoints');\r\n        $http.post('api/multi_version', {\r\n            data: {\r\n                versions: versions,\r\n                endpoints: endpoints\r\n            }\r\n        }).then(function (response) {\r\n            plotlyService.heatmap(versions, endpoints,\r\n                response.data.map(l => l.map(i => i == 0 ? 'NaN' : i)), {\r\n                    xaxis: {\r\n                        type: 'category',\r\n                        title: 'Versions'\r\n                    },\r\n                    yaxis: {\r\n                        type: 'category'\r\n                    }\r\n                });\r\n        });\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/multiVersion.js?");

/***/ }),

/***/ "./js/controllers/reporting.js":
/*!*************************************!*\
  !*** ./js/controllers/reporting.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   ReportingController: () => (/* binding */ ReportingController)\n/* harmony export */ });\nfunction ReportingController($scope, $http, menuService, endpointService, plotlyService) {\r\n    endpointService.reset();\r\n    menuService.reset('reporting');\r\n\r\n    $scope.reports = {};\r\n\r\n    $scope.activeSection = 'week';\r\n\r\n    $scope.monthName = moment().format('MMMM');\r\n    $scope.previousMonthName = moment().subtract(1, 'months').format('MMMM');\r\n\r\n    $scope.currentDay = moment().format('MMM DD');\r\n    $scope.yesterday = moment().subtract(1, 'days').format('MMM DD');\r\n\r\n    $scope.currentWeekNumber = moment().isoWeek();\r\n    $scope.previousWeekNumber = moment().subtract(1, 'weeks').isoWeek();\r\n\r\n    $scope.generating = false;\r\n    $scope.onlyShowInteresting = true;\r\n\r\n\r\n    $scope.activeSection = 'custom';\r\n    $scope.intervals = intervals(1, 'months');\r\n\r\n\r\n    function intervals(q, units) {\r\n        const t1 = moment()\r\n            .subtract(q, units)\r\n            .startOf(units);\r\n\r\n        const t2 = moment().subtract(q, units).endOf(units);\r\n        const t3 = moment().startOf(units);\r\n        const t4 = moment().endOf(units);\r\n\r\n        return {\r\n            \"comparison\": {\r\n                \"from\": t3.toDate(),\r\n                \"to\": t4.toDate()\r\n            },\r\n            \"baseline\": {\r\n                \"from\": t1.toDate(),\r\n                \"to\": t2.toDate()\r\n            }\r\n        }\r\n    }\r\n\r\n    $scope.versions = [];\r\n\r\n    $scope.commitVersion = null;\r\n    $scope.baseLineCommitVersion = null;\r\n\r\n    $scope.selectSection = function (section) {\r\n        if (section === 'commits') {\r\n            $http.get('api/versions').then(function (response) {\r\n                $scope.versions = response.data;\r\n            })\r\n        }\r\n        $scope.activeSection = section;\r\n\r\n        const INTERVAL_SIZES = {\r\n            day: [1, 'days'],\r\n            week: [1, 'isoWeeks'],\r\n            month: [1, 'months'],\r\n            custom: [1, 'isoWeeks'],\r\n        };\r\n\r\n        const intervalSize = INTERVAL_SIZES[$scope.activeSection];\r\n\r\n        $scope.intervals = intervals(intervalSize[0], intervalSize[1])\r\n    };\r\n\r\n    $scope.selectEntry = function (summary, answer) {\r\n        $scope.selectedSummary = summary;\r\n        $scope.selectedAnswer = answer;\r\n\r\n        const {comparison, baseline} = answer.latencies_samples;\r\n\r\n        const data = [\r\n            {\r\n                name: `Comparison (N=${comparison.length})`,\r\n                type: 'violin',\r\n                y: comparison\r\n            },\r\n            {\r\n                name: `Baseline (N=${baseline.length})`,\r\n                type: 'violin',\r\n                y: baseline,\r\n            }\r\n        ];\r\n\r\n\r\n        plotlyService.chart(data, {\r\n            yaxis: {\r\n                title: 'Execution time (ms)',\r\n                rangemode: \"nonnegative\"\r\n            }\r\n        });\r\n    };\r\n\r\n    $scope.generateReport = function () {\r\n        $scope.generating = true;\r\n        $scope.error = '';\r\n\r\n        let promise;\r\n        if ($scope.activeSection === 'commits') {\r\n            promise = $http.post('api/reporting/make_report/commits', {\r\n                commit_version: $scope.commitVersion,\r\n                baseline_commit_version: $scope.baseLineCommitVersion,\r\n            })\r\n        } else {\r\n            promise = $http.post(`api/reporting/make_report/intervals`, {\r\n                interval: {\r\n                    to: parseInt(`${$scope.intervals.comparison.to.getTime() / 1000}`),\r\n                    from: parseInt(`${$scope.intervals.comparison.from.getTime() / 1000}`),\r\n                },\r\n                baseline_interval: {\r\n                    to: parseInt(`${$scope.intervals.baseline.to.getTime() / 1000}`),\r\n                    from: parseInt(`${$scope.intervals.baseline.from.getTime() / 1000}`),\r\n                }\r\n            })\r\n        }\r\n\r\n        promise.then(response => {\r\n            $scope.reports[$scope.activeSection] = response.data;\r\n            $scope.generating = false;\r\n        })\r\n\r\n        promise.catch(response => {\r\n            $scope.error = response.data.message || 'An unknown error occurred!';\r\n            $scope.generating = false;\r\n        })\r\n    };\r\n}\r\n\n\n//# sourceURL=webpack://frontend/./js/controllers/reporting.js?");

/***/ }),

/***/ "./js/controllers/statusCodeDistribution.js":
/*!**************************************************!*\
  !*** ./js/controllers/statusCodeDistribution.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   StatusCodeDistributionController: () => (/* binding */ StatusCodeDistributionController)\n/* harmony export */ });\nfunction StatusCodeDistributionController($scope, $http, infoService, endpointService, menuService, formService, plotlyService) {\r\n    menuService.reset('status_code_distribution');\r\n    endpointService.reset();\r\n\r\n    formService.setReload(function () {\r\n        const endpointId = endpointService.info.id;\r\n\r\n        $http.get('api/endpoint_status_code_summary/' + endpointId).then(function (response) {\r\n\r\n            const layout = {\r\n                height: 400,\r\n                width: 500,\r\n            };\r\n\r\n            const distribution = response.data.distribution;\r\n\r\n            const statusCodes = Object.keys(distribution);\r\n\r\n            const data = [{\r\n                values: statusCodes.map(statusCode => distribution[statusCode]),\r\n                labels: statusCodes,\r\n                type: 'pie'\r\n            }];\r\n\r\n            $scope.error_requests = response.data.error_requests;\r\n\r\n            plotlyService.chart(data, layout);\r\n        });\r\n    });\r\n\r\n    formService.reload();\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/statusCodeDistribution.js?");

/***/ }),

/***/ "./js/controllers/surveyController.js":
/*!********************************************!*\
  !*** ./js/controllers/surveyController.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   SurveyController: () => (/* binding */ SurveyController)\n/* harmony export */ });\nfunction SurveyController($scope, $http, $sce) {\r\n    $scope.surveyShow = false;\r\n    $scope.surveyCompleted = false;\r\n\r\n    // Fetch local storage variation index\r\n    const storedIndex = localStorage.getItem('surveyVariationIndex');\r\n    $scope.surveyVariationIndex = storedIndex && !isNaN(parseInt(storedIndex)) ? parseInt(storedIndex) : 0;\r\n\r\n    // Variations of the survey prompt\r\n    $scope.surveyVariations = [\r\n        'Please take a moment to <a href=\"https://forms.gle/kWD5mqcibS2V5f3Y6\" target=\"_blank\">fill out our survey</a>.',\r\n        'Your feedback is valuable! <a href=\"https://forms.gle/kWD5mqcibS2V5f3Y6\" target=\"_blank\">Take our quick survey.</a>',\r\n        'We value your opinion! Click <a href=\"https://forms.gle/kWD5mqcibS2V5f3Y6\" target=\"_blank\">here</a> to share your thoughts.',\r\n        'Help us improve! Participate in our <a href=\"https://forms.gle/kWD5mqcibS2V5f3Y6\" target=\"_blank\">short survey</a>.'\r\n    ];\r\n\r\n    // Mark as trusted HTML\r\n    $scope.surveyVariations = $scope.surveyVariations.map(variation =>\r\n        $sce.trustAsHtml(variation)\r\n    );\r\n\r\n    // Fetches to check if the survey is filled from database\r\n    $scope.fetchSurveyFilled = function () {\r\n        $http.get('/dashboard/telemetry/get_is_survey_filled')\r\n            .then(function (response) {\r\n                $scope.surveyCompleted = response.data.is_survey_filled;\r\n                $scope.surveyShow = !$scope.surveyCompleted && ($scope.surveyVariationIndex < $scope.surveyVariations.length);\r\n            }, function (error) {\r\n                console.error('Error fetching survey status:', error);\r\n            });\r\n    };\r\n    $scope.fetchSurveyFilled();\r\n\r\n    // Increment surveyVariation in localStorage\r\n    $scope.closeSurvey = function () {\r\n        if (!$scope.surveyCompleted) {\r\n            $scope.surveyVariationIndex++;\r\n            localStorage.setItem('surveyVariationIndex', $scope.surveyVariationIndex.toString());\r\n        }\r\n    };\r\n\r\n    // Mark survey as filled in database\r\n    $scope.surveyFilled = function () {\r\n        $http.get('/dashboard/telemetry/survey_has_been_filled')\r\n            .then(function (response) {\r\n            }, function (error) {\r\n                console.error('Error:', error);\r\n            });\r\n        $scope.surveyCompleted = true;\r\n        $scope.surveyShow = false;\r\n    };\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/surveyController.js?");

/***/ }),

/***/ "./js/controllers/telemetryController.js":
/*!***********************************************!*\
  !*** ./js/controllers/telemetryController.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   TelemetryController: () => (/* binding */ TelemetryController)\n/* harmony export */ });\nfunction TelemetryController($scope, $http, $window) {\r\n\r\n    // Check if telemetry response is already stored in local storage\r\n    const telemetryAnswered = $window.localStorage.getItem('telemetryAnswered') === 'true';\r\n\r\n    // Control the visibility of the telemetry prompt based on previous response\r\n    $scope.telemetryShow = !telemetryAnswered;\r\n    $scope.followUpShow = false;\r\n\r\n    // Function to fetch telemetry consent status from database \r\n    $scope.fetchTelemetryConsent = function () {\r\n        $http.get(`/dashboard/telemetry/get_is_telemetry_answered`)\r\n            .then(function (response) {\r\n                $scope.telemetryShow = !response.data.is_telemetry_answered;\r\n            }, function (error) {\r\n                console.error('Error fetching telemetry consent:', error);\r\n            });\r\n    };\r\n    $scope.fetchTelemetryConsent();\r\n\r\n    // Function to handle user response to telemetry prompt\r\n    $scope.handleTelemetry = function (consent) {\r\n        $scope.telemetryShow = false;\r\n        $scope.followUpShow = !consent;\r\n\r\n        $http.post('/dashboard/telemetry/accept_telemetry_consent', { 'consent': consent })\r\n            .then(function (response) {\r\n                $scope.telemetryShow = false;\r\n                $window.localStorage.setItem('telemetryAnswered', 'true');\r\n            }, function (error) {\r\n                console.error('Error updating telemetry consent:', error);\r\n            });\r\n    };\r\n\r\n    // Object to track reasons for declining telemetry\r\n    $scope.reasons = {\r\n        privacy: false,\r\n        performance: false,\r\n        trust: false,\r\n        other: false\r\n    };\r\n    $scope.customReason = '';\r\n\r\n    // Configuration for HTTP requests to Back4App\r\n    var config = {\r\n        headers: {\r\n            'X-Parse-Application-Id': '4nHPABwkHqOZzNrFduzNyKH8q7wmPFdOWvajfWU2',\r\n            'X-Parse-REST-API-Key': 'zjv0WLI2K3UvpfzrfG4sPA6EykYyzZM4KxQk07Hs',\r\n            'Content-Type': 'application/json'\r\n        }\r\n    };\r\n\r\n    // Function to submit follow-up feedback\r\n    $scope.submitFollowUp = function () {\r\n        $scope.followUpShow = false;\r\n\r\n        var feedback = [];\r\n        for (var key in $scope.reasons) {\r\n            if ($scope.reasons[key]) {\r\n                if (key === 'other') {\r\n                    feedback.push(key);\r\n                    if ($scope.customReason.trim() !== '') {\r\n                        feedback.push({ other: $scope.customReason });\r\n                    }\r\n                } else {\r\n                    feedback.push(key);\r\n                }\r\n            }\r\n        }\r\n\r\n        $http.post('https://parseapi.back4app.com/classes/FollowUp', { reasons: feedback }, config)\r\n            .then(function (response) {\r\n            }, function (error) {\r\n                console.error('Error sending feedback:', error);\r\n            });\r\n    };\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/telemetryController.js?");

/***/ }),

/***/ "./js/controllers/util.js":
/*!********************************!*\
  !*** ./js/controllers/util.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EndpointController: () => (/* binding */ EndpointController),\n/* harmony export */   FormController: () => (/* binding */ FormController),\n/* harmony export */   InfoController: () => (/* binding */ InfoController),\n/* harmony export */   MenuController: () => (/* binding */ MenuController),\n/* harmony export */   ModalController: () => (/* binding */ ModalController),\n/* harmony export */   PaginationController: () => (/* binding */ PaginationController)\n/* harmony export */ });\nfunction MenuController($scope, menuService) {\r\n    $scope.menu = menuService;\r\n}\r\n\r\nfunction InfoController($scope, infoService) {\r\n    $scope.info = infoService;\r\n}\r\n\r\nfunction FormController($scope, formService) {\r\n    $scope.handler = formService;\r\n}\r\n\r\nfunction EndpointController($scope, endpointService) {\r\n    $scope.endpoint = endpointService;\r\n}\r\n\r\nfunction PaginationController($scope, paginationService) {\r\n    $scope.pagination = paginationService;\r\n}\r\n\r\nfunction ModalController($scope, $window, $browser, modalService){\r\n    modalService.setConfirm('logout', function(){\r\n        $window.location.href = $browser.baseHref() + 'logout';\r\n    });\r\n\r\n    $scope.modal = modalService;\r\n}\n\n//# sourceURL=webpack://frontend/./js/controllers/util.js?");

/***/ }),

/***/ "./js/directives.js":
/*!**************************!*\
  !*** ./js/directives.js ***!
  \**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ applyDirectives)\n/* harmony export */ });\nfunction applyDirectives(app) {\r\n    app.directive('pagination', function () {\r\n        return {\r\n            templateUrl: 'static/elements/pagination.html',\r\n            controller: 'PaginationController'\r\n        }\r\n    });\r\n\r\n    app.directive('menu', function () {\r\n        return {\r\n            templateUrl: 'static/elements/menu.html',\r\n            controller: 'MenuController'\r\n        }\r\n    });\r\n\r\n    app.directive('monitorlevel', function () {\r\n        return {\r\n            templateUrl: 'static/elements/monitorLevel.html',\r\n            controller: 'MonitorLevelController',\r\n            scope: {\r\n                name: '=',\r\n                value: '='\r\n            }\r\n        }\r\n    });\r\n\r\n    app.directive('endpointdetails', function () {\r\n        return {\r\n            templateUrl: 'static/elements/endpointDetails.html',\r\n            controller: 'EndpointController',\r\n        }\r\n    });\r\n\r\n    app.directive('modal', function () {\r\n        return {\r\n            transclude: true,\r\n            templateUrl: 'static/elements/modal.html',\r\n            controller: 'ModalController',\r\n            scope: {\r\n                name: '=',\r\n                title: '=',\r\n                yes: '=?',\r\n                no: '=?'\r\n            },\r\n        }\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/directives.js?");

/***/ }),

/***/ "./js/filters.js":
/*!***********************!*\
  !*** ./js/filters.js ***!
  \***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   applyFilters: () => (/* binding */ applyFilters)\n/* harmony export */ });\nfunction applyFilters(app) {\r\n\r\n    app.filter('duration_ms', function () {\r\n        return function (time) {\r\n            return Math.round(parseFloat(time) * 10) / 10;\r\n        }\r\n    });\r\n\r\n    app.filter('duration', function () {\r\n        return function (time) {\r\n            let ms = Math.round(parseFloat(time) * 10) / 10;\r\n            let s = ms / 1000;\r\n            let min = Math.floor(s / 60);\r\n            let hr = Math.floor(s / 3600);\r\n            let day = Math.floor(hr / 24);\r\n            let value = \"\";\r\n            if (ms < 100.5) {\r\n                value = ms + \" ms\";\r\n            } else if (ms < 999.5) {\r\n                value = Math.round(ms) + \" ms\";\r\n            } else if (s < 60) {\r\n                s = Math.round(ms / 100) / 10;\r\n                value = s + \" sec\";\r\n            } else if (hr === 0) {\r\n                s = Math.round(s % 60);\r\n                value = min + \" min\";\r\n                if (s > 0) {\r\n                    value += \", \" + s + \" sec\";\r\n                }\r\n            } else if (day === 0) {\r\n                value = hr + \" hr\";\r\n                min = Math.round(min % 60);\r\n                if (min > 0) {\r\n                    value += \", \" + min + \" min\";\r\n                }\r\n            } else {\r\n                value = day + \" d\";\r\n                hr = Math.round(hr % 24);\r\n                if (hr > 0) {\r\n                    value += \", \" + hr + \" hr\";\r\n                }\r\n            }\r\n            return value;\r\n        }\r\n    });\r\n\r\n// to parse the date and reformat\r\n\r\n    app.filter('dateLayout', function () {\r\n        return date => {\r\n            let d = new Date(date);\r\n            return (\"0\" + d.getDate()).slice(-2) + \"-\" + (\"0\" + (d.getMonth() + 1)).slice(-2) + \"-\" +\r\n                d.getFullYear() + \" \" + (\"0\" + d.getHours()).slice(-2) + \":\" + (\"0\" + d.getMinutes()).slice(-2);\r\n        }\r\n    });\r\n\r\n\r\n    app.filter('dateShort', function () {\r\n        return date => {\r\n            let monthNames = [\r\n                \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\r\n                \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"\r\n            ];\r\n            let d = new Date(date);\r\n            let day = d.getDate();\r\n            let monthIndex = d.getMonth();\r\n            let year = d.getFullYear();\r\n\r\n            return monthNames[monthIndex] + ' ' + day + ', ' + year;\r\n        }\r\n    });\r\n\r\n\r\n    app.filter('dateDifference', function () {\r\n\r\n        return function (date) {\r\n            if (date === null) {\r\n                return '';\r\n            }\r\n\r\n            let utc = new Date().getTime();\r\n            let parsed = Date.parse(date);\r\n            let diff = utc - parsed;\r\n\r\n            let sec = Math.round(diff / 1000);\r\n            let min = Math.round(sec / 60);\r\n            let hour = Math.round(min / 60);\r\n            let day = Math.round(hour / 24);\r\n            let week = Math.round(day / 7);\r\n            let month = Math.round(day / 30);\r\n            let year = Math.round(day / 365);\r\n\r\n            function s(number) {\r\n                if (number !== 1) {\r\n                    return \"s\";\r\n                }\r\n                return \"\";\r\n            }\r\n\r\n            if (sec < 60) {\r\n                return sec + \" second\" + s(sec) + \" ago\";\r\n            } else if (min < 60) {\r\n                return min + \" minute\" + s(min) + \" ago\";\r\n            } else if (hour < 24) {\r\n                return hour + \" hour\" + s(hour) + \" ago\";\r\n            } else if (day < 7) {\r\n                return day + \" day\" + s(day) + \" ago\";\r\n            } else if (week < 5) {\r\n                return week + \" week\" + s(week) + \" ago\";\r\n            } else if (month < 12) {\r\n                return month + \" month\" + s(month) + \" ago\";\r\n            }\r\n            return year + \" year\" + s(year) + \" ago\";\r\n        }\r\n    });\r\n\r\n    app.filter('abs', function () {\r\n        return function (num) {\r\n            return Math.abs(num);\r\n        }\r\n    });\r\n}\n\n//# sourceURL=webpack://frontend/./js/filters.js?");

/***/ }),

/***/ "./js/services/endpoint.js":
/*!*********************************!*\
  !*** ./js/services/endpoint.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__($http, $routeParams) {\r\n    let that = this;\r\n    this.info = {\r\n        id: 0,\r\n        endpoint: ''\r\n    };\r\n    this.graphId = 0;\r\n\r\n    this.customGraphs = [];\r\n    this.getGraph = function () {\r\n        return this.customGraphs.find(o => o.graph_id === that.graphId);\r\n    };\r\n\r\n    this.getGraphTitle = function () {\r\n        let graph = this.getGraph();\r\n        if (typeof graph !== 'undefined') {\r\n            return graph.title;\r\n        }\r\n        return '';\r\n    };\r\n\r\n    $http.get('api/custom_graphs').then(function (response) {\r\n        that.customGraphs = response.data;\r\n        if (that.graphId !== 0) {\r\n            that.onNameChanged(that.getGraphTitle())\r\n        }\r\n    });\r\n\r\n    this.reset = function () {\r\n        if (typeof $routeParams.endpointId !== 'undefined') {\r\n            this.info.id = $routeParams.endpointId;\r\n            this.getInfo();\r\n        } else if (typeof $routeParams.graphId !== 'undefined') {\r\n            this.graphId = $routeParams.graphId;\r\n        } else {\r\n            this.info.id = 0;\r\n        }\r\n    };\r\n\r\n    this.onNameChanged = function (name) {\r\n    };\r\n\r\n    this.getInfo = function () {\r\n        $http.get('api/endpoint_info/' + this.info.id).then(function (response) {\r\n            that.info = response.data;\r\n            that.onNameChanged(that.info.endpoint);\r\n        });\r\n    };\r\n};\n\n//# sourceURL=webpack://frontend/./js/services/endpoint.js?");

/***/ }),

/***/ "./js/services/form.js":
/*!*****************************!*\
  !*** ./js/services/form.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ formService)\n/* harmony export */ });\nfunction formService($http, endpointService, $filter) {\r\n    const SLICE = 10;\r\n\r\n    let that = this;\r\n\r\n    this.dateFields = [];\r\n    this.multiFields = [];\r\n    this.isLoading = true;\r\n\r\n    this.clear = function () {\r\n        that.multiFields = [];\r\n        that.dateFields = [];\r\n    };\r\n\r\n    function addMultiSelect(name) {\r\n        let obj = {\r\n            'name': name,\r\n            'values': [], // list of {id: , text: }\r\n            'selected': [], // subset of 'items'\r\n            'initialized': false\r\n        };\r\n        that.multiFields.push(obj);\r\n        return obj;\r\n    }\r\n\r\n    this.initialize = function (obj) {\r\n        obj.initialized = true;\r\n        if (that.multiFields.every(o => o.initialized)) {\r\n            that.reload();\r\n        }\r\n    };\r\n\r\n    this.getMultiSelection = function (name) {\r\n\r\n        return that.multiFields.find(o => o.name == name).selected.map(d => d.id);\r\n    };\r\n\r\n    this.addDate = function (name) {\r\n        let obj = {\r\n            'name': name,\r\n            'value': new Date(),\r\n        };\r\n        that.dateFields.push(obj);\r\n        return obj;\r\n    };\r\n\r\n    this.getDate = function (name) {\r\n        return parseDate(that.dateFields.find(o => o.name == name).value);\r\n    };\r\n\r\n    this.addVersions = function (endpoint_id) {\r\n        let obj = addMultiSelect('versions');\r\n        let url = 'api/versions';\r\n        if (typeof endpoint_id !== \"undefined\") {\r\n            url += '/' + endpoint_id;\r\n        }\r\n        $http.get(url).then(function (response) {\r\n            obj.values = response.data.map(d => {\r\n                    return {\r\n                        id: d.version,\r\n                        text: d.version + ' : ' + $filter('dateLayout')(d.date)\r\n                    }\r\n                }\r\n            );\r\n            obj.selected = obj.values.slice(-SLICE);\r\n            that.initialize(obj);\r\n        });\r\n    };\r\n\r\n    this.addEndpoints = function () {\r\n        let obj = addMultiSelect('endpoints');\r\n        $http.get('api/endpoints_hits').then(function (response) {\r\n            obj.values = response.data.map(d => {\r\n                return {\r\n                    id: d.name,\r\n                    text: d.name + ' : ' + d.hits + ' requests'\r\n                }\r\n            });\r\n            obj.selected = obj.values.slice(0, SLICE);\r\n            that.initialize(obj);\r\n        });\r\n    };\r\n\r\n    this.addUsers = function () {\r\n        let obj = addMultiSelect('users');\r\n        $http.get('api/users/' + endpointService.info.id).then(function (response) {\r\n            obj.values = response.data.map(d => {\r\n                return {\r\n                    id: d.user,\r\n                    text: d.user + ' : ' + d.hits + ' requests'\r\n                }\r\n            });\r\n            obj.selected = obj.values.slice(0, SLICE);\r\n            that.initialize(obj);\r\n        });\r\n    };\r\n\r\n    this.addIP = function () {\r\n        let obj = addMultiSelect('IP-addresses');\r\n        $http.get('api/ip/' + endpointService.info.id).then(function (response) {\r\n            obj.values = response.data.map(d => {\r\n                return {\r\n                    id: d.ip,\r\n                    text: d.ip + ' : ' + d.hits + ' requests'\r\n                }\r\n            });\r\n            obj.selected = obj.values.slice(0, SLICE);\r\n            that.initialize(obj);\r\n        });\r\n    };\r\n\r\n    let parseDate = function (date) {\r\n        return date.getFullYear() + \"-\" + (\"0\" + (date.getMonth() + 1)).slice(-2)\r\n            + \"-\" + (\"0\" + date.getDate()).slice(-2);\r\n    };\r\n\r\n    this.reload = function () {\r\n    };\r\n    this.setReload = function (f) {\r\n        this.reload = function () {\r\n            that.isLoading = true;\r\n            f();\r\n        };\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://frontend/./js/services/form.js?");

/***/ }),

/***/ "./js/services/info.js":
/*!*****************************!*\
  !*** ./js/services/info.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__() {\r\n    this.graphText = 'You can hover the graph with your mouse to see the actual values. You can also use the ' +\r\n        'buttons at the top of the graph to select a subset of graph, scale it accordingly, or save the graph ' +\r\n        'as a PNG image.';\r\n    this.axesText = '';\r\n    this.contentText = '';\r\n}\n\n//# sourceURL=webpack://frontend/./js/services/info.js?");

/***/ }),

/***/ "./js/services/menu.js":
/*!*****************************!*\
  !*** ./js/services/menu.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__($http, endpointService) {\r\n    this.page = '';\r\n    this.endpoint = endpointService;\r\n\r\n    this.reset = function (page) {\r\n        if (this.page !== page) {\r\n            this.page = page;\r\n        }\r\n        if (page.substr(0, 'custom_graph'.length) === 'custom_graph') {\r\n            $('#collapseCustomGraphs').collapse('show');\r\n        } else {\r\n            $('#collapseCustomGraphs').collapse('hide');\r\n        }\r\n\r\n        var dashboardPages = ['overview', 'hourly_load', 'multi_version', 'daily_load', 'api_performance', 'reporting'];\r\n\r\n        if (dashboardPages.includes(page)) {\r\n            $('#collapseDashboard').collapse('show');\r\n        } else {\r\n            $('#collapseDashboard').collapse('hide');\r\n        }\r\n\r\n        var endpointPages = [\r\n            'endpoint_hourly', 'endpoint_user_version', 'endpoint_ip', 'endpoint_version', 'endpoint_user',\r\n            'endpoint_profiler', 'endpoint_grouped_profiler', 'endpoint_outlier', 'status_code_distribution'\r\n        ];\r\n\r\n        if (endpointPages.includes(page)) {\r\n            $('#collapseEndpoint').collapse('show');\r\n        } else {\r\n            $('#collapseEndpoint').collapse('hide');\r\n        }\r\n    }\r\n}\n\n//# sourceURL=webpack://frontend/./js/services/menu.js?");

/***/ }),

/***/ "./js/services/modal.js":
/*!******************************!*\
  !*** ./js/services/modal.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__() {\r\n    this.action = {};\r\n    this.error = {};\r\n\r\n    this.setConfirm = function(name, action){\r\n        this.action[name] = action;\r\n    }\r\n\r\n    this.setErrorMessage = function(name, message){\r\n        this.error[name] = message;\r\n    }\r\n\r\n    this.confirm = function(name){\r\n        this.action[name]();\r\n    }\r\n}\n\n//# sourceURL=webpack://frontend/./js/services/modal.js?");

/***/ }),

/***/ "./js/services/pagination.js":
/*!***********************************!*\
  !*** ./js/services/pagination.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__() {\r\n\r\n    this.init = function (name) {\r\n        this.page = 1;\r\n        this.perPage = 5;\r\n        this.total = 0;\r\n        this.name = name;\r\n    };\r\n\r\n    this.maxPages = function () {\r\n        return Math.ceil(this.total / this.perPage);\r\n    };\r\n\r\n    this.onReload = function () {\r\n    };\r\n\r\n    this.getLeft = function () {\r\n        return (this.page - 1) * this.perPage;\r\n    };\r\n\r\n    this.getRight = function () {\r\n        return Math.min(this.total, this.getLeft() + this.perPage);\r\n    };\r\n\r\n    this.getFirstPage = function () {\r\n        let pages = this.getPages();\r\n        return pages.length > 0 ? pages[0] : this.page;\r\n    };\r\n\r\n    this.getLastPage = function () {\r\n        let pages = this.getPages();\r\n        return pages.length > 0 ? pages[pages.length - 1] : this.page;\r\n    };\r\n\r\n    this.goto = function (p) {\r\n        this.page = p;\r\n        this.onReload();\r\n    };\r\n\r\n    this.setTotal = function (t) {\r\n        this.total = t;\r\n        this.onReload();\r\n    };\r\n\r\n    this.getPages = function () {\r\n        let left = this.page - 1;\r\n        let right = this.page + 1;\r\n        let range = [];\r\n\r\n        if (left <= 0) {\r\n            right -= left - 1;\r\n            left = 1;\r\n        }\r\n        if (right > this.maxPages()) {\r\n            right = this.maxPages();\r\n        }\r\n\r\n        if (left == 2) {\r\n            range.push(1);\r\n        } else if (left == 3) {\r\n            range.push(1, 2);\r\n        } else if (left > 3) {\r\n            range.push(1, '...');\r\n        }\r\n\r\n        for (let i = left; i <= right; i++) {\r\n            range.push(i);\r\n        }\r\n        if (this.maxPages() - right > 2) {\r\n            range.push('...', this.maxPages());\r\n        } else if (this.maxPages() - right == 2) {\r\n            range.push(this.maxPages() - 1, this.maxPages());\r\n        } else if (this.maxPages() - right == 1) {\r\n            range.push(this.maxPages());\r\n        }\r\n        return range;\r\n    }\r\n};\n\n//# sourceURL=webpack://frontend/./js/services/pagination.js?");

/***/ }),

/***/ "./js/services/plotly.js":
/*!*******************************!*\
  !*** ./js/services/plotly.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(formService) {\r\n    let layout = {\r\n        height: 600,\r\n        margin: {l: 200}\r\n    };\r\n    let options = {\r\n        displaylogo: false,\r\n        responsive: true\r\n    };\r\n\r\n    this.heatmap = function (x, y, z, layout_ext, hover_text) {\r\n        this.chart([{\r\n            x: x,\r\n            y: y,\r\n            z: z.map(l => l.map(i => i === 0 ? NaN : i)),\r\n            colorscale: 'YIOrRd',\r\n            reversescale: true,\r\n            type: 'heatmap',\r\n            text: hover_text,\r\n            hoverinfo: (hover_text === undefined ? undefined : 'text')\r\n        }], $.extend({}, layout, layout_ext));\r\n    };\r\n\r\n    this.chart = function (data, layout_ext) {\r\n        formService.isLoading = false;\r\n        Plotly.newPlot('chart', data, $.extend({}, layout, layout_ext), options);\r\n    }\r\n};\n\n//# sourceURL=webpack://frontend/./js/services/plotly.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/createPopper.js":
/*!*********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/createPopper.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   createPopper: () => (/* binding */ createPopper),\n/* harmony export */   detectOverflow: () => (/* reexport safe */ _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */   popperGenerator: () => (/* binding */ popperGenerator)\n/* harmony export */ });\n/* harmony import */ var _dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dom-utils/getCompositeRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js\");\n/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dom-utils/getLayoutRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js\");\n/* harmony import */ var _dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom-utils/listScrollParents.js */ \"./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/orderModifiers.js */ \"./node_modules/@popperjs/core/lib/utils/orderModifiers.js\");\n/* harmony import */ var _utils_debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/debounce.js */ \"./node_modules/@popperjs/core/lib/utils/debounce.js\");\n/* harmony import */ var _utils_mergeByName_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/mergeByName.js */ \"./node_modules/@popperjs/core/lib/utils/mergeByName.js\");\n/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/detectOverflow.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom-utils/instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n\n\n\n\n\n\n\n\n\nvar DEFAULT_OPTIONS = {\n  placement: 'bottom',\n  modifiers: [],\n  strategy: 'absolute'\n};\n\nfunction areValidElements() {\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n\n  return !args.some(function (element) {\n    return !(element && typeof element.getBoundingClientRect === 'function');\n  });\n}\n\nfunction popperGenerator(generatorOptions) {\n  if (generatorOptions === void 0) {\n    generatorOptions = {};\n  }\n\n  var _generatorOptions = generatorOptions,\n      _generatorOptions$def = _generatorOptions.defaultModifiers,\n      defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n      _generatorOptions$def2 = _generatorOptions.defaultOptions,\n      defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n  return function createPopper(reference, popper, options) {\n    if (options === void 0) {\n      options = defaultOptions;\n    }\n\n    var state = {\n      placement: 'bottom',\n      orderedModifiers: [],\n      options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n      modifiersData: {},\n      elements: {\n        reference: reference,\n        popper: popper\n      },\n      attributes: {},\n      styles: {}\n    };\n    var effectCleanupFns = [];\n    var isDestroyed = false;\n    var instance = {\n      state: state,\n      setOptions: function setOptions(setOptionsAction) {\n        var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n        cleanupModifierEffects();\n        state.options = Object.assign({}, defaultOptions, state.options, options);\n        state.scrollParents = {\n          reference: (0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(reference) ? (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(reference) : reference.contextElement ? (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(reference.contextElement) : [],\n          popper: (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(popper)\n        }; // Orders the modifiers based on their dependencies and `phase`\n        // properties\n\n        var orderedModifiers = (0,_utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])((0,_utils_mergeByName_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n        state.orderedModifiers = orderedModifiers.filter(function (m) {\n          return m.enabled;\n        });\n        runModifierEffects();\n        return instance.update();\n      },\n      // Sync update – it will always be executed, even if not necessary. This\n      // is useful for low frequency updates where sync behavior simplifies the\n      // logic.\n      // For high frequency updates (e.g. `resize` and `scroll` events), always\n      // prefer the async Popper#update method\n      forceUpdate: function forceUpdate() {\n        if (isDestroyed) {\n          return;\n        }\n\n        var _state$elements = state.elements,\n            reference = _state$elements.reference,\n            popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n        // anymore\n\n        if (!areValidElements(reference, popper)) {\n          return;\n        } // Store the reference and popper rects to be read by modifiers\n\n\n        state.rects = {\n          reference: (0,_dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(reference, (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(popper), state.options.strategy === 'fixed'),\n          popper: (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(popper)\n        }; // Modifiers have the ability to reset the current update cycle. The\n        // most common use case for this is the `flip` modifier changing the\n        // placement, which then needs to re-run all the modifiers, because the\n        // logic was previously ran for the previous placement and is therefore\n        // stale/incorrect\n\n        state.reset = false;\n        state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n        // is filled with the initial data specified by the modifier. This means\n        // it doesn't persist and is fresh on each update.\n        // To ensure persistent data, use `${name}#persistent`\n\n        state.orderedModifiers.forEach(function (modifier) {\n          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n        });\n\n        for (var index = 0; index < state.orderedModifiers.length; index++) {\n          if (state.reset === true) {\n            state.reset = false;\n            index = -1;\n            continue;\n          }\n\n          var _state$orderedModifie = state.orderedModifiers[index],\n              fn = _state$orderedModifie.fn,\n              _state$orderedModifie2 = _state$orderedModifie.options,\n              _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n              name = _state$orderedModifie.name;\n\n          if (typeof fn === 'function') {\n            state = fn({\n              state: state,\n              options: _options,\n              name: name,\n              instance: instance\n            }) || state;\n          }\n        }\n      },\n      // Async and optimistically optimized update – it will not be executed if\n      // not necessary (debounced to run at most once-per-tick)\n      update: (0,_utils_debounce_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(function () {\n        return new Promise(function (resolve) {\n          instance.forceUpdate();\n          resolve(state);\n        });\n      }),\n      destroy: function destroy() {\n        cleanupModifierEffects();\n        isDestroyed = true;\n      }\n    };\n\n    if (!areValidElements(reference, popper)) {\n      return instance;\n    }\n\n    instance.setOptions(options).then(function (state) {\n      if (!isDestroyed && options.onFirstUpdate) {\n        options.onFirstUpdate(state);\n      }\n    }); // Modifiers have the ability to execute arbitrary code before the first\n    // update cycle runs. They will be executed in the same order as the update\n    // cycle. This is useful when a modifier adds some persistent data that\n    // other modifiers need to use, but the modifier is run after the dependent\n    // one.\n\n    function runModifierEffects() {\n      state.orderedModifiers.forEach(function (_ref) {\n        var name = _ref.name,\n            _ref$options = _ref.options,\n            options = _ref$options === void 0 ? {} : _ref$options,\n            effect = _ref.effect;\n\n        if (typeof effect === 'function') {\n          var cleanupFn = effect({\n            state: state,\n            name: name,\n            instance: instance,\n            options: options\n          });\n\n          var noopFn = function noopFn() {};\n\n          effectCleanupFns.push(cleanupFn || noopFn);\n        }\n      });\n    }\n\n    function cleanupModifierEffects() {\n      effectCleanupFns.forEach(function (fn) {\n        return fn();\n      });\n      effectCleanupFns = [];\n    }\n\n    return instance;\n  };\n}\nvar createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\n\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/createPopper.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/contains.js":
/*!***************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/contains.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ contains)\n/* harmony export */ });\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n\nfunction contains(parent, child) {\n  var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n  if (parent.contains(child)) {\n    return true;\n  } // then fallback to custom implementation with Shadow DOM support\n  else if (rootNode && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isShadowRoot)(rootNode)) {\n      var next = child;\n\n      do {\n        if (next && parent.isSameNode(next)) {\n          return true;\n        } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n        next = next.parentNode || next.host;\n      } while (next);\n    } // Give up, the result is false\n\n\n  return false;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/contains.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js":
/*!****************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getBoundingClientRect)\n/* harmony export */ });\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n/* harmony import */ var _isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isLayoutViewport.js */ \"./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js\");\n\n\n\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy) {\n  if (includeScale === void 0) {\n    includeScale = false;\n  }\n\n  if (isFixedStrategy === void 0) {\n    isFixedStrategy = false;\n  }\n\n  var clientRect = element.getBoundingClientRect();\n  var scaleX = 1;\n  var scaleY = 1;\n\n  if (includeScale && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) {\n    scaleX = element.offsetWidth > 0 ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.round)(clientRect.width) / element.offsetWidth || 1 : 1;\n    scaleY = element.offsetHeight > 0 ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.round)(clientRect.height) / element.offsetHeight || 1 : 1;\n  }\n\n  var _ref = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element) : window,\n      visualViewport = _ref.visualViewport;\n\n  var addVisualOffsets = !(0,_isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])() && isFixedStrategy;\n  var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n  var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n  var width = clientRect.width / scaleX;\n  var height = clientRect.height / scaleY;\n  return {\n    width: width,\n    height: height,\n    top: y,\n    right: x + width,\n    bottom: y + height,\n    left: x,\n    x: x,\n    y: y\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getClippingRect)\n/* harmony export */ });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _getViewportRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getViewportRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js\");\n/* harmony import */ var _getDocumentRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getDocumentRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js\");\n/* harmony import */ var _listScrollParents_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./listScrollParents.js */ \"./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js\");\n/* harmony import */ var _getOffsetParent_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getParentNode.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js\");\n/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./contains.js */ \"./node_modules/@popperjs/core/lib/dom-utils/contains.js\");\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/rectToClientRect.js */ \"./node_modules/@popperjs/core/lib/utils/rectToClientRect.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction getInnerBoundingClientRect(element, strategy) {\n  var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element, false, strategy === 'fixed');\n  rect.top = rect.top + element.clientTop;\n  rect.left = rect.left + element.clientLeft;\n  rect.bottom = rect.top + element.clientHeight;\n  rect.right = rect.left + element.clientWidth;\n  rect.width = element.clientWidth;\n  rect.height = element.clientHeight;\n  rect.x = rect.left;\n  rect.y = rect.top;\n  return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n  return clippingParent === _enums_js__WEBPACK_IMPORTED_MODULE_1__.viewport ? (0,_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])((0,_getViewportRect_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(element, strategy)) : (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : (0,_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])((0,_getDocumentRect_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])((0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n  var clippingParents = (0,_listScrollParents_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(element));\n  var canEscapeClipping = ['absolute', 'fixed'].indexOf((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(element).position) >= 0;\n  var clipperElement = canEscapeClipping && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isHTMLElement)(element) ? (0,_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(element) : element;\n\n  if (!(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clipperElement)) {\n    return [];\n  } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n  return clippingParents.filter(function (clippingParent) {\n    return (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clippingParent) && (0,_contains_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"])(clippingParent, clipperElement) && (0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(clippingParent) !== 'body';\n  });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nfunction getClippingRect(element, boundary, rootBoundary, strategy) {\n  var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n  var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n  var firstClippingParent = clippingParents[0];\n  var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n    var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n    accRect.top = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.max)(rect.top, accRect.top);\n    accRect.right = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.min)(rect.right, accRect.right);\n    accRect.bottom = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.min)(rect.bottom, accRect.bottom);\n    accRect.left = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.max)(rect.left, accRect.left);\n    return accRect;\n  }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n  clippingRect.width = clippingRect.right - clippingRect.left;\n  clippingRect.height = clippingRect.bottom - clippingRect.top;\n  clippingRect.x = clippingRect.left;\n  clippingRect.y = clippingRect.top;\n  return clippingRect;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getCompositeRect)\n/* harmony export */ });\n/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n/* harmony import */ var _getNodeScroll_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getNodeScroll.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js\");\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isScrollParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n\n\nfunction isElementScaled(element) {\n  var rect = element.getBoundingClientRect();\n  var scaleX = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(rect.width) / element.offsetWidth || 1;\n  var scaleY = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(rect.height) / element.offsetHeight || 1;\n  return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nfunction getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n  if (isFixed === void 0) {\n    isFixed = false;\n  }\n\n  var isOffsetParentAnElement = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent);\n  var offsetParentIsScaled = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent) && isElementScaled(offsetParent);\n  var documentElement = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent);\n  var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n  var scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  var offsets = {\n    x: 0,\n    y: 0\n  };\n\n  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n    if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n    (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(documentElement)) {\n      scroll = (0,_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(offsetParent);\n    }\n\n    if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent)) {\n      offsets = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(offsetParent, true);\n      offsets.x += offsetParent.clientLeft;\n      offsets.y += offsetParent.clientTop;\n    } else if (documentElement) {\n      offsets.x = (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(documentElement);\n    }\n  }\n\n  return {\n    x: rect.left + scroll.scrollLeft - offsets.x,\n    y: rect.top + scroll.scrollTop - offsets.y,\n    width: rect.width,\n    height: rect.height\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getComputedStyle)\n/* harmony export */ });\n/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n\nfunction getComputedStyle(element) {\n  return (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element).getComputedStyle(element);\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js":
/*!*************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getDocumentElement)\n/* harmony export */ });\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n\nfunction getDocumentElement(element) {\n  // $FlowFixMe[incompatible-return]: assume body is always available\n  return (((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n  element.document) || window.document).documentElement;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getDocumentRect)\n/* harmony export */ });\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js\");\n/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getWindowScroll.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n // Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\nfunction getDocumentRect(element) {\n  var _element$ownerDocumen;\n\n  var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n  var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element);\n  var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n  var width = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n  var height = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n  var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(element);\n  var y = -winScroll.scrollTop;\n\n  if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(body || html).direction === 'rtl') {\n    x += (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.clientWidth, body ? body.clientWidth : 0) - width;\n  }\n\n  return {\n    width: width,\n    height: height,\n    x: x,\n    y: y\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js":
/*!***************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getHTMLElementScroll)\n/* harmony export */ });\nfunction getHTMLElementScroll(element) {\n  return {\n    scrollLeft: element.scrollLeft,\n    scrollTop: element.scrollTop\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getLayoutRect)\n/* harmony export */ });\n/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nfunction getLayoutRect(element) {\n  var clientRect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element); // Use the clientRect sizes if it's not been transformed.\n  // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n  var width = element.offsetWidth;\n  var height = element.offsetHeight;\n\n  if (Math.abs(clientRect.width - width) <= 1) {\n    width = clientRect.width;\n  }\n\n  if (Math.abs(clientRect.height - height) <= 1) {\n    height = clientRect.height;\n  }\n\n  return {\n    x: element.offsetLeft,\n    y: element.offsetTop,\n    width: width,\n    height: height\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js":
/*!******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getNodeName)\n/* harmony export */ });\nfunction getNodeName(element) {\n  return element ? (element.nodeName || '').toLowerCase() : null;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getNodeScroll)\n/* harmony export */ });\n/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindowScroll.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js\");\n/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _getHTMLElementScroll_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getHTMLElementScroll.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js\");\n\n\n\n\nfunction getNodeScroll(node) {\n  if (node === (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node) || !(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(node)) {\n    return (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(node);\n  } else {\n    return (0,_getHTMLElementScroll_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(node);\n  }\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getOffsetParent)\n/* harmony export */ });\n/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _isTableElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isTableElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js\");\n/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js\");\n/* harmony import */ var _utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/userAgent.js */ \"./node_modules/@popperjs/core/lib/utils/userAgent.js\");\n\n\n\n\n\n\n\n\nfunction getTrueOffsetParent(element) {\n  if (!(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || // https://github.com/popperjs/popper-core/issues/837\n  (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element).position === 'fixed') {\n    return null;\n  }\n\n  return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n  var isFirefox = /firefox/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])());\n  var isIE = /Trident/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])());\n\n  if (isIE && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) {\n    // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n    var elementCss = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element);\n\n    if (elementCss.position === 'fixed') {\n      return null;\n    }\n  }\n\n  var currentNode = (0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(element);\n\n  if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isShadowRoot)(currentNode)) {\n    currentNode = currentNode.host;\n  }\n\n  while ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(currentNode) && ['html', 'body'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(currentNode)) < 0) {\n    var css = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n    // create a containing block.\n    // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n    if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n      return currentNode;\n    } else {\n      currentNode = currentNode.parentNode;\n    }\n  }\n\n  return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nfunction getOffsetParent(element) {\n  var window = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(element);\n  var offsetParent = getTrueOffsetParent(element);\n\n  while (offsetParent && (0,_isTableElement_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(offsetParent) && (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent).position === 'static') {\n    offsetParent = getTrueOffsetParent(offsetParent);\n  }\n\n  if (offsetParent && ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(offsetParent) === 'html' || (0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(offsetParent) === 'body' && (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent).position === 'static')) {\n    return window;\n  }\n\n  return offsetParent || getContainingBlock(element) || window;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getParentNode)\n/* harmony export */ });\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n\n\n\nfunction getParentNode(element) {\n  if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element) === 'html') {\n    return element;\n  }\n\n  return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n    // $FlowFixMe[incompatible-return]\n    // $FlowFixMe[prop-missing]\n    element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n    element.parentNode || ( // DOM Element detected\n    (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isShadowRoot)(element) ? element.host : null) || // ShadowRoot detected\n    // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n    (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element) // fallback\n\n  );\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getScrollParent)\n/* harmony export */ });\n/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js\");\n/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isScrollParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js\");\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n\n\n\n\nfunction getScrollParent(node) {\n  if (['html', 'body', '#document'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node)) >= 0) {\n    // $FlowFixMe[incompatible-return]: assume body is always available\n    return node.ownerDocument.body;\n  }\n\n  if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(node) && (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(node)) {\n    return node;\n  }\n\n  return getScrollParent((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(node));\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getViewportRect)\n/* harmony export */ });\n/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js\");\n/* harmony import */ var _isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isLayoutViewport.js */ \"./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js\");\n\n\n\n\nfunction getViewportRect(element, strategy) {\n  var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n  var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element);\n  var visualViewport = win.visualViewport;\n  var width = html.clientWidth;\n  var height = html.clientHeight;\n  var x = 0;\n  var y = 0;\n\n  if (visualViewport) {\n    width = visualViewport.width;\n    height = visualViewport.height;\n    var layoutViewport = (0,_isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n\n    if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n      x = visualViewport.offsetLeft;\n      y = visualViewport.offsetTop;\n    }\n  }\n\n  return {\n    width: width,\n    height: height,\n    x: x + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(element),\n    y: y\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js":
/*!****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getWindow)\n/* harmony export */ });\nfunction getWindow(node) {\n  if (node == null) {\n    return window;\n  }\n\n  if (node.toString() !== '[object Window]') {\n    var ownerDocument = node.ownerDocument;\n    return ownerDocument ? ownerDocument.defaultView || window : window;\n  }\n\n  return node;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getWindow.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getWindowScroll)\n/* harmony export */ });\n/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n\nfunction getWindowScroll(node) {\n  var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node);\n  var scrollLeft = win.pageXOffset;\n  var scrollTop = win.pageYOffset;\n  return {\n    scrollLeft: scrollLeft,\n    scrollTop: scrollTop\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js":
/*!**************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getWindowScrollBarX)\n/* harmony export */ });\n/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindowScroll.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js\");\n\n\n\nfunction getWindowScrollBarX(element) {\n  // If <html> has a CSS width greater than the viewport, then this will be\n  // incorrect for RTL.\n  // Popper 1 is broken in this case and never had a bug report so let's assume\n  // it's not an issue. I don't think anyone ever specifies width on <html>\n  // anyway.\n  // Browsers where the left scrollbar doesn't cause an issue report `0` for\n  // this (e.g. Edge 2019, IE11, Safari)\n  return (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])((0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element)).left + (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element).scrollLeft;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   isElement: () => (/* binding */ isElement),\n/* harmony export */   isHTMLElement: () => (/* binding */ isHTMLElement),\n/* harmony export */   isShadowRoot: () => (/* binding */ isShadowRoot)\n/* harmony export */ });\n/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n\n\nfunction isElement(node) {\n  var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node).Element;\n  return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n  var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node).HTMLElement;\n  return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n  // IE 11 has no ShadowRoot\n  if (typeof ShadowRoot === 'undefined') {\n    return false;\n  }\n\n  var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node).ShadowRoot;\n  return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\n\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ isLayoutViewport)\n/* harmony export */ });\n/* harmony import */ var _utils_userAgent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/userAgent.js */ \"./node_modules/@popperjs/core/lib/utils/userAgent.js\");\n\nfunction isLayoutViewport() {\n  return !/^((?!chrome|android).)*safari/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])());\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ isScrollParent)\n/* harmony export */ });\n/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n\nfunction isScrollParent(element) {\n  // Firefox wants us to check `-x` and `-y` variations as well\n  var _getComputedStyle = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element),\n      overflow = _getComputedStyle.overflow,\n      overflowX = _getComputedStyle.overflowX,\n      overflowY = _getComputedStyle.overflowY;\n\n  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ isTableElement)\n/* harmony export */ });\n/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n\nfunction isTableElement(element) {\n  return ['table', 'td', 'th'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) >= 0;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js":
/*!************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ listScrollParents)\n/* harmony export */ });\n/* harmony import */ var _getScrollParent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getScrollParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js\");\n/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js\");\n/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isScrollParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js\");\n\n\n\n\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nfunction listScrollParents(element, list) {\n  var _element$ownerDocumen;\n\n  if (list === void 0) {\n    list = [];\n  }\n\n  var scrollParent = (0,_getScrollParent_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n  var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(scrollParent);\n  var target = isBody ? [win].concat(win.visualViewport || [], (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(scrollParent) ? scrollParent : []) : scrollParent;\n  var updatedList = list.concat(target);\n  return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n  updatedList.concat(listScrollParents((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(target)));\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/enums.js":
/*!**************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/enums.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   afterMain: () => (/* binding */ afterMain),\n/* harmony export */   afterRead: () => (/* binding */ afterRead),\n/* harmony export */   afterWrite: () => (/* binding */ afterWrite),\n/* harmony export */   auto: () => (/* binding */ auto),\n/* harmony export */   basePlacements: () => (/* binding */ basePlacements),\n/* harmony export */   beforeMain: () => (/* binding */ beforeMain),\n/* harmony export */   beforeRead: () => (/* binding */ beforeRead),\n/* harmony export */   beforeWrite: () => (/* binding */ beforeWrite),\n/* harmony export */   bottom: () => (/* binding */ bottom),\n/* harmony export */   clippingParents: () => (/* binding */ clippingParents),\n/* harmony export */   end: () => (/* binding */ end),\n/* harmony export */   left: () => (/* binding */ left),\n/* harmony export */   main: () => (/* binding */ main),\n/* harmony export */   modifierPhases: () => (/* binding */ modifierPhases),\n/* harmony export */   placements: () => (/* binding */ placements),\n/* harmony export */   popper: () => (/* binding */ popper),\n/* harmony export */   read: () => (/* binding */ read),\n/* harmony export */   reference: () => (/* binding */ reference),\n/* harmony export */   right: () => (/* binding */ right),\n/* harmony export */   start: () => (/* binding */ start),\n/* harmony export */   top: () => (/* binding */ top),\n/* harmony export */   variationPlacements: () => (/* binding */ variationPlacements),\n/* harmony export */   viewport: () => (/* binding */ viewport),\n/* harmony export */   write: () => (/* binding */ write)\n/* harmony export */ });\nvar top = 'top';\nvar bottom = 'bottom';\nvar right = 'right';\nvar left = 'left';\nvar auto = 'auto';\nvar basePlacements = [top, bottom, right, left];\nvar start = 'start';\nvar end = 'end';\nvar clippingParents = 'clippingParents';\nvar viewport = 'viewport';\nvar popper = 'popper';\nvar reference = 'reference';\nvar variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n  return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nvar placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n  return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nvar beforeRead = 'beforeRead';\nvar read = 'read';\nvar afterRead = 'afterRead'; // pure-logic modifiers\n\nvar beforeMain = 'beforeMain';\nvar main = 'main';\nvar afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nvar beforeWrite = 'beforeWrite';\nvar write = 'write';\nvar afterWrite = 'afterWrite';\nvar modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/enums.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/index.js":
/*!**************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   afterMain: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.afterMain),\n/* harmony export */   afterRead: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.afterRead),\n/* harmony export */   afterWrite: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.afterWrite),\n/* harmony export */   applyStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.applyStyles),\n/* harmony export */   arrow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.arrow),\n/* harmony export */   auto: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.auto),\n/* harmony export */   basePlacements: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements),\n/* harmony export */   beforeMain: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.beforeMain),\n/* harmony export */   beforeRead: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.beforeRead),\n/* harmony export */   beforeWrite: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.beforeWrite),\n/* harmony export */   bottom: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom),\n/* harmony export */   clippingParents: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.clippingParents),\n/* harmony export */   computeStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.computeStyles),\n/* harmony export */   createPopper: () => (/* reexport safe */ _popper_js__WEBPACK_IMPORTED_MODULE_4__.createPopper),\n/* harmony export */   createPopperBase: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_2__.createPopper),\n/* harmony export */   createPopperLite: () => (/* reexport safe */ _popper_lite_js__WEBPACK_IMPORTED_MODULE_5__.createPopper),\n/* harmony export */   detectOverflow: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */   end: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.end),\n/* harmony export */   eventListeners: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.eventListeners),\n/* harmony export */   flip: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.flip),\n/* harmony export */   hide: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.hide),\n/* harmony export */   left: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.left),\n/* harmony export */   main: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.main),\n/* harmony export */   modifierPhases: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.modifierPhases),\n/* harmony export */   offset: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.offset),\n/* harmony export */   placements: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.placements),\n/* harmony export */   popper: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper),\n/* harmony export */   popperGenerator: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_2__.popperGenerator),\n/* harmony export */   popperOffsets: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.popperOffsets),\n/* harmony export */   preventOverflow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.preventOverflow),\n/* harmony export */   read: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.read),\n/* harmony export */   reference: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.reference),\n/* harmony export */   right: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.right),\n/* harmony export */   start: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.start),\n/* harmony export */   top: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.top),\n/* harmony export */   variationPlacements: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements),\n/* harmony export */   viewport: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.viewport),\n/* harmony export */   write: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.write)\n/* harmony export */ });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modifiers/index.js */ \"./node_modules/@popperjs/core/lib/modifiers/index.js\");\n/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createPopper.js */ \"./node_modules/@popperjs/core/lib/createPopper.js\");\n/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./createPopper.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _popper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./popper.js */ \"./node_modules/@popperjs/core/lib/popper.js\");\n/* harmony import */ var _popper_lite_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./popper-lite.js */ \"./node_modules/@popperjs/core/lib/popper-lite.js\");\n\n // eslint-disable-next-line import/no-unused-modules\n\n // eslint-disable-next-line import/no-unused-modules\n\n // eslint-disable-next-line import/no-unused-modules\n\n\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/index.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js":
/*!******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-utils/getNodeName.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\");\n/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n\n // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n  var state = _ref.state;\n  Object.keys(state.elements).forEach(function (name) {\n    var style = state.styles[name] || {};\n    var attributes = state.attributes[name] || {};\n    var element = state.elements[name]; // arrow is optional + virtual elements\n\n    if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element)) {\n      return;\n    } // Flow doesn't support to extend this property, but it's the most\n    // effective way to apply styles to an HTMLElement\n    // $FlowFixMe[cannot-write]\n\n\n    Object.assign(element.style, style);\n    Object.keys(attributes).forEach(function (name) {\n      var value = attributes[name];\n\n      if (value === false) {\n        element.removeAttribute(name);\n      } else {\n        element.setAttribute(name, value === true ? '' : value);\n      }\n    });\n  });\n}\n\nfunction effect(_ref2) {\n  var state = _ref2.state;\n  var initialStyles = {\n    popper: {\n      position: state.options.strategy,\n      left: '0',\n      top: '0',\n      margin: '0'\n    },\n    arrow: {\n      position: 'absolute'\n    },\n    reference: {}\n  };\n  Object.assign(state.elements.popper.style, initialStyles.popper);\n  state.styles = initialStyles;\n\n  if (state.elements.arrow) {\n    Object.assign(state.elements.arrow.style, initialStyles.arrow);\n  }\n\n  return function () {\n    Object.keys(state.elements).forEach(function (name) {\n      var element = state.elements[name];\n      var attributes = state.attributes[name] || {};\n      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n      var style = styleProperties.reduce(function (style, property) {\n        style[property] = '';\n        return style;\n      }, {}); // arrow is optional + virtual elements\n\n      if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(element)) {\n        return;\n      }\n\n      Object.assign(element.style, style);\n      Object.keys(attributes).forEach(function (attribute) {\n        element.removeAttribute(attribute);\n      });\n    });\n  };\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'applyStyles',\n  enabled: true,\n  phase: 'write',\n  fn: applyStyles,\n  effect: effect,\n  requires: ['computeStyles']\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/applyStyles.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/arrow.js":
/*!************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/arrow.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js\");\n/* harmony import */ var _dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dom-utils/contains.js */ \"./node_modules/@popperjs/core/lib/dom-utils/contains.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js\");\n/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/within.js */ \"./node_modules/@popperjs/core/lib/utils/within.js\");\n/* harmony import */ var _utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/mergePaddingObject.js */ \"./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js\");\n/* harmony import */ var _utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/expandToHashMap.js */ \"./node_modules/@popperjs/core/lib/utils/expandToHashMap.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n\n\n\n\n\n\n\n\n // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n  padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n    placement: state.placement\n  })) : padding;\n  return (0,_utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(typeof padding !== 'number' ? padding : (0,_utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_2__.basePlacements));\n};\n\nfunction arrow(_ref) {\n  var _state$modifiersData$;\n\n  var state = _ref.state,\n      name = _ref.name,\n      options = _ref.options;\n  var arrowElement = state.elements.arrow;\n  var popperOffsets = state.modifiersData.popperOffsets;\n  var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state.placement);\n  var axis = (0,_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(basePlacement);\n  var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_2__.left, _enums_js__WEBPACK_IMPORTED_MODULE_2__.right].indexOf(basePlacement) >= 0;\n  var len = isVertical ? 'height' : 'width';\n\n  if (!arrowElement || !popperOffsets) {\n    return;\n  }\n\n  var paddingObject = toPaddingObject(options.padding, state);\n  var arrowRect = (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(arrowElement);\n  var minProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_2__.top : _enums_js__WEBPACK_IMPORTED_MODULE_2__.left;\n  var maxProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_2__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_2__.right;\n  var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n  var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n  var arrowOffsetParent = (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(arrowElement);\n  var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n  var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n  // outside of the popper bounds\n\n  var min = paddingObject[minProp];\n  var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n  var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n  var offset = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_7__.within)(min, center, max); // Prevents breaking syntax highlighting...\n\n  var axisProp = axis;\n  state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n  var state = _ref2.state,\n      options = _ref2.options;\n  var _options$element = options.element,\n      arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n  if (arrowElement == null) {\n    return;\n  } // CSS selector\n\n\n  if (typeof arrowElement === 'string') {\n    arrowElement = state.elements.popper.querySelector(arrowElement);\n\n    if (!arrowElement) {\n      return;\n    }\n  }\n\n  if (!(0,_dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(state.elements.popper, arrowElement)) {\n    return;\n  }\n\n  state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'arrow',\n  enabled: true,\n  phase: 'main',\n  fn: arrow,\n  effect: effect,\n  requires: ['popperOffsets'],\n  requiresIfExists: ['preventOverflow']\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/arrow.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */   mapToStyles: () => (/* binding */ mapToStyles)\n/* harmony export */ });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getComputedStyle.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\");\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n  top: 'auto',\n  right: 'auto',\n  bottom: 'auto',\n  left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n  var x = _ref.x,\n      y = _ref.y;\n  var dpr = win.devicePixelRatio || 1;\n  return {\n    x: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(x * dpr) / dpr || 0,\n    y: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(y * dpr) / dpr || 0\n  };\n}\n\nfunction mapToStyles(_ref2) {\n  var _Object$assign2;\n\n  var popper = _ref2.popper,\n      popperRect = _ref2.popperRect,\n      placement = _ref2.placement,\n      variation = _ref2.variation,\n      offsets = _ref2.offsets,\n      position = _ref2.position,\n      gpuAcceleration = _ref2.gpuAcceleration,\n      adaptive = _ref2.adaptive,\n      roundOffsets = _ref2.roundOffsets,\n      isFixed = _ref2.isFixed;\n  var _offsets$x = offsets.x,\n      x = _offsets$x === void 0 ? 0 : _offsets$x,\n      _offsets$y = offsets.y,\n      y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n  var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n    x: x,\n    y: y\n  }) : {\n    x: x,\n    y: y\n  };\n\n  x = _ref3.x;\n  y = _ref3.y;\n  var hasX = offsets.hasOwnProperty('x');\n  var hasY = offsets.hasOwnProperty('y');\n  var sideX = _enums_js__WEBPACK_IMPORTED_MODULE_1__.left;\n  var sideY = _enums_js__WEBPACK_IMPORTED_MODULE_1__.top;\n  var win = window;\n\n  if (adaptive) {\n    var offsetParent = (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(popper);\n    var heightProp = 'clientHeight';\n    var widthProp = 'clientWidth';\n\n    if (offsetParent === (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(popper)) {\n      offsetParent = (0,_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(popper);\n\n      if ((0,_dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(offsetParent).position !== 'static' && position === 'absolute') {\n        heightProp = 'scrollHeight';\n        widthProp = 'scrollWidth';\n      }\n    } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n    offsetParent = offsetParent;\n\n    if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.top || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.left || placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.right) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_1__.end) {\n      sideY = _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom;\n      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n      offsetParent[heightProp];\n      y -= offsetY - popperRect.height;\n      y *= gpuAcceleration ? 1 : -1;\n    }\n\n    if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.left || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.top || placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_1__.end) {\n      sideX = _enums_js__WEBPACK_IMPORTED_MODULE_1__.right;\n      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n      offsetParent[widthProp];\n      x -= offsetX - popperRect.width;\n      x *= gpuAcceleration ? 1 : -1;\n    }\n  }\n\n  var commonStyles = Object.assign({\n    position: position\n  }, adaptive && unsetSides);\n\n  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n    x: x,\n    y: y\n  }, (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(popper)) : {\n    x: x,\n    y: y\n  };\n\n  x = _ref4.x;\n  y = _ref4.y;\n\n  if (gpuAcceleration) {\n    var _Object$assign;\n\n    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n  }\n\n  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n  var state = _ref5.state,\n      options = _ref5.options;\n  var _options$gpuAccelerat = options.gpuAcceleration,\n      gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n      _options$adaptive = options.adaptive,\n      adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n      _options$roundOffsets = options.roundOffsets,\n      roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n  var commonStyles = {\n    placement: (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(state.placement),\n    variation: (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(state.placement),\n    popper: state.elements.popper,\n    popperRect: state.rects.popper,\n    gpuAcceleration: gpuAcceleration,\n    isFixed: state.options.strategy === 'fixed'\n  };\n\n  if (state.modifiersData.popperOffsets != null) {\n    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n      offsets: state.modifiersData.popperOffsets,\n      position: state.options.strategy,\n      adaptive: adaptive,\n      roundOffsets: roundOffsets\n    })));\n  }\n\n  if (state.modifiersData.arrow != null) {\n    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n      offsets: state.modifiersData.arrow,\n      position: 'absolute',\n      adaptive: false,\n      roundOffsets: roundOffsets\n    })));\n  }\n\n  state.attributes.popper = Object.assign({}, state.attributes.popper, {\n    'data-popper-placement': state.placement\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'computeStyles',\n  enabled: true,\n  phase: 'beforeWrite',\n  fn: computeStyles,\n  data: {}\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/computeStyles.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getWindow.js\");\n // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n  passive: true\n};\n\nfunction effect(_ref) {\n  var state = _ref.state,\n      instance = _ref.instance,\n      options = _ref.options;\n  var _options$scroll = options.scroll,\n      scroll = _options$scroll === void 0 ? true : _options$scroll,\n      _options$resize = options.resize,\n      resize = _options$resize === void 0 ? true : _options$resize;\n  var window = (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(state.elements.popper);\n  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n  if (scroll) {\n    scrollParents.forEach(function (scrollParent) {\n      scrollParent.addEventListener('scroll', instance.update, passive);\n    });\n  }\n\n  if (resize) {\n    window.addEventListener('resize', instance.update, passive);\n  }\n\n  return function () {\n    if (scroll) {\n      scrollParents.forEach(function (scrollParent) {\n        scrollParent.removeEventListener('scroll', instance.update, passive);\n      });\n    }\n\n    if (resize) {\n      window.removeEventListener('resize', instance.update, passive);\n    }\n  };\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'eventListeners',\n  enabled: true,\n  phase: 'write',\n  fn: function fn() {},\n  effect: effect,\n  data: {}\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/eventListeners.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/flip.js":
/*!***********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/flip.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getOppositePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js\");\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getOppositeVariationPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js\");\n/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/detectOverflow.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _utils_computeAutoPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/computeAutoPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n\n\n\n\n\n\n // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n  if ((0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.auto) {\n    return [];\n  }\n\n  var oppositePlacement = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(placement);\n  return [(0,_utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(placement), oppositePlacement, (0,_utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n  var state = _ref.state,\n      options = _ref.options,\n      name = _ref.name;\n\n  if (state.modifiersData[name]._skip) {\n    return;\n  }\n\n  var _options$mainAxis = options.mainAxis,\n      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n      _options$altAxis = options.altAxis,\n      checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n      specifiedFallbackPlacements = options.fallbackPlacements,\n      padding = options.padding,\n      boundary = options.boundary,\n      rootBoundary = options.rootBoundary,\n      altBoundary = options.altBoundary,\n      _options$flipVariatio = options.flipVariations,\n      flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n      allowedAutoPlacements = options.allowedAutoPlacements;\n  var preferredPlacement = state.options.placement;\n  var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(preferredPlacement);\n  var isBasePlacement = basePlacement === preferredPlacement;\n  var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [(0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n  var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n    return acc.concat((0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.auto ? (0,_utils_computeAutoPlacement_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      padding: padding,\n      flipVariations: flipVariations,\n      allowedAutoPlacements: allowedAutoPlacements\n    }) : placement);\n  }, []);\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var checksMap = new Map();\n  var makeFallbackChecks = true;\n  var firstFittingPlacement = placements[0];\n\n  for (var i = 0; i < placements.length; i++) {\n    var placement = placements[i];\n\n    var _basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(placement);\n\n    var isStartVariation = (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.start;\n    var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_1__.top, _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom].indexOf(_basePlacement) >= 0;\n    var len = isVertical ? 'width' : 'height';\n    var overflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      altBoundary: altBoundary,\n      padding: padding\n    });\n    var mainVariationSide = isVertical ? isStartVariation ? _enums_js__WEBPACK_IMPORTED_MODULE_1__.right : _enums_js__WEBPACK_IMPORTED_MODULE_1__.left : isStartVariation ? _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_1__.top;\n\n    if (referenceRect[len] > popperRect[len]) {\n      mainVariationSide = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(mainVariationSide);\n    }\n\n    var altVariationSide = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(mainVariationSide);\n    var checks = [];\n\n    if (checkMainAxis) {\n      checks.push(overflow[_basePlacement] <= 0);\n    }\n\n    if (checkAltAxis) {\n      checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n    }\n\n    if (checks.every(function (check) {\n      return check;\n    })) {\n      firstFittingPlacement = placement;\n      makeFallbackChecks = false;\n      break;\n    }\n\n    checksMap.set(placement, checks);\n  }\n\n  if (makeFallbackChecks) {\n    // `2` may be desired in some cases – research later\n    var numberOfChecks = flipVariations ? 3 : 1;\n\n    var _loop = function _loop(_i) {\n      var fittingPlacement = placements.find(function (placement) {\n        var checks = checksMap.get(placement);\n\n        if (checks) {\n          return checks.slice(0, _i).every(function (check) {\n            return check;\n          });\n        }\n      });\n\n      if (fittingPlacement) {\n        firstFittingPlacement = fittingPlacement;\n        return \"break\";\n      }\n    };\n\n    for (var _i = numberOfChecks; _i > 0; _i--) {\n      var _ret = _loop(_i);\n\n      if (_ret === \"break\") break;\n    }\n  }\n\n  if (state.placement !== firstFittingPlacement) {\n    state.modifiersData[name]._skip = true;\n    state.placement = firstFittingPlacement;\n    state.reset = true;\n  }\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'flip',\n  enabled: true,\n  phase: 'main',\n  fn: flip,\n  requiresIfExists: ['offset'],\n  data: {\n    _skip: false\n  }\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/flip.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/hide.js":
/*!***********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/hide.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/detectOverflow.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n\n\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n  if (preventedOffsets === void 0) {\n    preventedOffsets = {\n      x: 0,\n      y: 0\n    };\n  }\n\n  return {\n    top: overflow.top - rect.height - preventedOffsets.y,\n    right: overflow.right - rect.width + preventedOffsets.x,\n    bottom: overflow.bottom - rect.height + preventedOffsets.y,\n    left: overflow.left - rect.width - preventedOffsets.x\n  };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n  return [_enums_js__WEBPACK_IMPORTED_MODULE_0__.top, _enums_js__WEBPACK_IMPORTED_MODULE_0__.right, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom, _enums_js__WEBPACK_IMPORTED_MODULE_0__.left].some(function (side) {\n    return overflow[side] >= 0;\n  });\n}\n\nfunction hide(_ref) {\n  var state = _ref.state,\n      name = _ref.name;\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var preventedOffsets = state.modifiersData.preventOverflow;\n  var referenceOverflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(state, {\n    elementContext: 'reference'\n  });\n  var popperAltOverflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(state, {\n    altBoundary: true\n  });\n  var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n  var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n  var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n  var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n  state.modifiersData[name] = {\n    referenceClippingOffsets: referenceClippingOffsets,\n    popperEscapeOffsets: popperEscapeOffsets,\n    isReferenceHidden: isReferenceHidden,\n    hasPopperEscaped: hasPopperEscaped\n  };\n  state.attributes.popper = Object.assign({}, state.attributes.popper, {\n    'data-popper-reference-hidden': isReferenceHidden,\n    'data-popper-escaped': hasPopperEscaped\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'hide',\n  enabled: true,\n  phase: 'main',\n  requiresIfExists: ['preventOverflow'],\n  fn: hide\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/hide.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/index.js":
/*!************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/index.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   applyStyles: () => (/* reexport safe */ _applyStyles_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */   arrow: () => (/* reexport safe */ _arrow_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */   computeStyles: () => (/* reexport safe */ _computeStyles_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */   eventListeners: () => (/* reexport safe */ _eventListeners_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */   flip: () => (/* reexport safe */ _flip_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */   hide: () => (/* reexport safe */ _hide_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\n/* harmony export */   offset: () => (/* reexport safe */ _offset_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */   popperOffsets: () => (/* reexport safe */ _popperOffsets_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */   preventOverflow: () => (/* reexport safe */ _preventOverflow_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _applyStyles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./applyStyles.js */ \"./node_modules/@popperjs/core/lib/modifiers/applyStyles.js\");\n/* harmony import */ var _arrow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./arrow.js */ \"./node_modules/@popperjs/core/lib/modifiers/arrow.js\");\n/* harmony import */ var _computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeStyles.js */ \"./node_modules/@popperjs/core/lib/modifiers/computeStyles.js\");\n/* harmony import */ var _eventListeners_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./eventListeners.js */ \"./node_modules/@popperjs/core/lib/modifiers/eventListeners.js\");\n/* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flip.js */ \"./node_modules/@popperjs/core/lib/modifiers/flip.js\");\n/* harmony import */ var _hide_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hide.js */ \"./node_modules/@popperjs/core/lib/modifiers/hide.js\");\n/* harmony import */ var _offset_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./offset.js */ \"./node_modules/@popperjs/core/lib/modifiers/offset.js\");\n/* harmony import */ var _popperOffsets_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./popperOffsets.js */ \"./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js\");\n/* harmony import */ var _preventOverflow_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./preventOverflow.js */ \"./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js\");\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/index.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/offset.js":
/*!*************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/offset.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */   distanceAndSkiddingToXY: () => (/* binding */ distanceAndSkiddingToXY)\n/* harmony export */ });\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n\n // eslint-disable-next-line import/no-unused-modules\n\nfunction distanceAndSkiddingToXY(placement, rects, offset) {\n  var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(placement);\n  var invertDistance = [_enums_js__WEBPACK_IMPORTED_MODULE_1__.left, _enums_js__WEBPACK_IMPORTED_MODULE_1__.top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n  var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n    placement: placement\n  })) : offset,\n      skidding = _ref[0],\n      distance = _ref[1];\n\n  skidding = skidding || 0;\n  distance = (distance || 0) * invertDistance;\n  return [_enums_js__WEBPACK_IMPORTED_MODULE_1__.left, _enums_js__WEBPACK_IMPORTED_MODULE_1__.right].indexOf(basePlacement) >= 0 ? {\n    x: distance,\n    y: skidding\n  } : {\n    x: skidding,\n    y: distance\n  };\n}\n\nfunction offset(_ref2) {\n  var state = _ref2.state,\n      options = _ref2.options,\n      name = _ref2.name;\n  var _options$offset = options.offset,\n      offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n  var data = _enums_js__WEBPACK_IMPORTED_MODULE_1__.placements.reduce(function (acc, placement) {\n    acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n    return acc;\n  }, {});\n  var _data$state$placement = data[state.placement],\n      x = _data$state$placement.x,\n      y = _data$state$placement.y;\n\n  if (state.modifiersData.popperOffsets != null) {\n    state.modifiersData.popperOffsets.x += x;\n    state.modifiersData.popperOffsets.y += y;\n  }\n\n  state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'offset',\n  enabled: true,\n  phase: 'main',\n  requires: ['popperOffsets'],\n  fn: offset\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/offset.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_computeOffsets_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/computeOffsets.js */ \"./node_modules/@popperjs/core/lib/utils/computeOffsets.js\");\n\n\nfunction popperOffsets(_ref) {\n  var state = _ref.state,\n      name = _ref.name;\n  // Offsets are the actual position the popper needs to have to be\n  // properly positioned near its reference element\n  // This is the most basic placement, and will be adjusted by\n  // the modifiers in the next step\n  state.modifiersData[name] = (0,_utils_computeOffsets_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n    reference: state.rects.reference,\n    element: state.rects.popper,\n    strategy: 'absolute',\n    placement: state.placement\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'popperOffsets',\n  enabled: true,\n  phase: 'read',\n  fn: popperOffsets,\n  data: {}\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js\");\n/* harmony import */ var _utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getAltAxis.js */ \"./node_modules/@popperjs/core/lib/utils/getAltAxis.js\");\n/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/within.js */ \"./node_modules/@popperjs/core/lib/utils/within.js\");\n/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js\");\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\");\n/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/detectOverflow.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n/* harmony import */ var _utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/getFreshSideObject.js */ \"./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js\");\n/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\n\n\n\n\n\n\n\n\n\n\n\nfunction preventOverflow(_ref) {\n  var state = _ref.state,\n      options = _ref.options,\n      name = _ref.name;\n  var _options$mainAxis = options.mainAxis,\n      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n      _options$altAxis = options.altAxis,\n      checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n      boundary = options.boundary,\n      rootBoundary = options.rootBoundary,\n      altBoundary = options.altBoundary,\n      padding = options.padding,\n      _options$tether = options.tether,\n      tether = _options$tether === void 0 ? true : _options$tether,\n      _options$tetherOffset = options.tetherOffset,\n      tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n  var overflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(state, {\n    boundary: boundary,\n    rootBoundary: rootBoundary,\n    padding: padding,\n    altBoundary: altBoundary\n  });\n  var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(state.placement);\n  var variation = (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(state.placement);\n  var isBasePlacement = !variation;\n  var mainAxis = (0,_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(basePlacement);\n  var altAxis = (0,_utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(mainAxis);\n  var popperOffsets = state.modifiersData.popperOffsets;\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n    placement: state.placement\n  })) : tetherOffset;\n  var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n    mainAxis: tetherOffsetValue,\n    altAxis: tetherOffsetValue\n  } : Object.assign({\n    mainAxis: 0,\n    altAxis: 0\n  }, tetherOffsetValue);\n  var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n  var data = {\n    x: 0,\n    y: 0\n  };\n\n  if (!popperOffsets) {\n    return;\n  }\n\n  if (checkMainAxis) {\n    var _offsetModifierState$;\n\n    var mainSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.top : _enums_js__WEBPACK_IMPORTED_MODULE_5__.left;\n    var altSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_5__.right;\n    var len = mainAxis === 'y' ? 'height' : 'width';\n    var offset = popperOffsets[mainAxis];\n    var min = offset + overflow[mainSide];\n    var max = offset - overflow[altSide];\n    var additive = tether ? -popperRect[len] / 2 : 0;\n    var minLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_5__.start ? referenceRect[len] : popperRect[len];\n    var maxLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_5__.start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n    // outside the reference bounds\n\n    var arrowElement = state.elements.arrow;\n    var arrowRect = tether && arrowElement ? (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(arrowElement) : {\n      width: 0,\n      height: 0\n    };\n    var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : (0,_utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])();\n    var arrowPaddingMin = arrowPaddingObject[mainSide];\n    var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n    // to include its full size in the calculation. If the reference is small\n    // and near the edge of a boundary, the popper can overflow even if the\n    // reference is not overflowing as well (e.g. virtual elements with no\n    // width or height)\n\n    var arrowLen = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(0, referenceRect[len], arrowRect[len]);\n    var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n    var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n    var arrowOffsetParent = state.elements.arrow && (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(state.elements.arrow);\n    var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n    var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n    var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n    var tetherMax = offset + maxOffset - offsetModifierValue;\n    var preventedOffset = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(tether ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_10__.min)(min, tetherMin) : min, offset, tether ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_10__.max)(max, tetherMax) : max);\n    popperOffsets[mainAxis] = preventedOffset;\n    data[mainAxis] = preventedOffset - offset;\n  }\n\n  if (checkAltAxis) {\n    var _offsetModifierState$2;\n\n    var _mainSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.top : _enums_js__WEBPACK_IMPORTED_MODULE_5__.left;\n\n    var _altSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_5__.right;\n\n    var _offset = popperOffsets[altAxis];\n\n    var _len = altAxis === 'y' ? 'height' : 'width';\n\n    var _min = _offset + overflow[_mainSide];\n\n    var _max = _offset - overflow[_altSide];\n\n    var isOriginSide = [_enums_js__WEBPACK_IMPORTED_MODULE_5__.top, _enums_js__WEBPACK_IMPORTED_MODULE_5__.left].indexOf(basePlacement) !== -1;\n\n    var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n    var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n    var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n    var _preventedOffset = tether && isOriginSide ? (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.withinMaxClamp)(_tetherMin, _offset, _tetherMax) : (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n    popperOffsets[altAxis] = _preventedOffset;\n    data[altAxis] = _preventedOffset - _offset;\n  }\n\n  state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  name: 'preventOverflow',\n  enabled: true,\n  phase: 'main',\n  fn: preventOverflow,\n  requiresIfExists: ['offset']\n});\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/popper-lite.js":
/*!********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/popper-lite.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   createPopper: () => (/* binding */ createPopper),\n/* harmony export */   defaultModifiers: () => (/* binding */ defaultModifiers),\n/* harmony export */   detectOverflow: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\n/* harmony export */   popperGenerator: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_4__.popperGenerator)\n/* harmony export */ });\n/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createPopper.js */ \"./node_modules/@popperjs/core/lib/createPopper.js\");\n/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createPopper.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modifiers/eventListeners.js */ \"./node_modules/@popperjs/core/lib/modifiers/eventListeners.js\");\n/* harmony import */ var _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modifiers/popperOffsets.js */ \"./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js\");\n/* harmony import */ var _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modifiers/computeStyles.js */ \"./node_modules/@popperjs/core/lib/modifiers/computeStyles.js\");\n/* harmony import */ var _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/applyStyles.js */ \"./node_modules/@popperjs/core/lib/modifiers/applyStyles.js\");\n\n\n\n\n\nvar defaultModifiers = [_modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"], _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]];\nvar createPopper = /*#__PURE__*/(0,_createPopper_js__WEBPACK_IMPORTED_MODULE_4__.popperGenerator)({\n  defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\n\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/popper-lite.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/popper.js":
/*!***************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/popper.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   applyStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.applyStyles),\n/* harmony export */   arrow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.arrow),\n/* harmony export */   computeStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.computeStyles),\n/* harmony export */   createPopper: () => (/* binding */ createPopper),\n/* harmony export */   createPopperLite: () => (/* reexport safe */ _popper_lite_js__WEBPACK_IMPORTED_MODULE_11__.createPopper),\n/* harmony export */   defaultModifiers: () => (/* binding */ defaultModifiers),\n/* harmony export */   detectOverflow: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */   eventListeners: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.eventListeners),\n/* harmony export */   flip: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.flip),\n/* harmony export */   hide: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.hide),\n/* harmony export */   offset: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.offset),\n/* harmony export */   popperGenerator: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_9__.popperGenerator),\n/* harmony export */   popperOffsets: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.popperOffsets),\n/* harmony export */   preventOverflow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.preventOverflow)\n/* harmony export */ });\n/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./createPopper.js */ \"./node_modules/@popperjs/core/lib/createPopper.js\");\n/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./createPopper.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modifiers/eventListeners.js */ \"./node_modules/@popperjs/core/lib/modifiers/eventListeners.js\");\n/* harmony import */ var _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modifiers/popperOffsets.js */ \"./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js\");\n/* harmony import */ var _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modifiers/computeStyles.js */ \"./node_modules/@popperjs/core/lib/modifiers/computeStyles.js\");\n/* harmony import */ var _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/applyStyles.js */ \"./node_modules/@popperjs/core/lib/modifiers/applyStyles.js\");\n/* harmony import */ var _modifiers_offset_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modifiers/offset.js */ \"./node_modules/@popperjs/core/lib/modifiers/offset.js\");\n/* harmony import */ var _modifiers_flip_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modifiers/flip.js */ \"./node_modules/@popperjs/core/lib/modifiers/flip.js\");\n/* harmony import */ var _modifiers_preventOverflow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modifiers/preventOverflow.js */ \"./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js\");\n/* harmony import */ var _modifiers_arrow_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modifiers/arrow.js */ \"./node_modules/@popperjs/core/lib/modifiers/arrow.js\");\n/* harmony import */ var _modifiers_hide_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modifiers/hide.js */ \"./node_modules/@popperjs/core/lib/modifiers/hide.js\");\n/* harmony import */ var _popper_lite_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./popper-lite.js */ \"./node_modules/@popperjs/core/lib/popper-lite.js\");\n/* harmony import */ var _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modifiers/index.js */ \"./node_modules/@popperjs/core/lib/modifiers/index.js\");\n\n\n\n\n\n\n\n\n\n\nvar defaultModifiers = [_modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"], _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _modifiers_offset_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _modifiers_flip_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _modifiers_preventOverflow_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _modifiers_arrow_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"], _modifiers_hide_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]];\nvar createPopper = /*#__PURE__*/(0,_createPopper_js__WEBPACK_IMPORTED_MODULE_9__.popperGenerator)({\n  defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\n // eslint-disable-next-line import/no-unused-modules\n\n // eslint-disable-next-line import/no-unused-modules\n\n\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/popper.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ computeAutoPlacement)\n/* harmony export */ });\n/* harmony import */ var _getVariation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _detectOverflow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./detectOverflow.js */ \"./node_modules/@popperjs/core/lib/utils/detectOverflow.js\");\n/* harmony import */ var _getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n\n\n\n\nfunction computeAutoPlacement(state, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      placement = _options.placement,\n      boundary = _options.boundary,\n      rootBoundary = _options.rootBoundary,\n      padding = _options.padding,\n      flipVariations = _options.flipVariations,\n      _options$allowedAutoP = _options.allowedAutoPlacements,\n      allowedAutoPlacements = _options$allowedAutoP === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.placements : _options$allowedAutoP;\n  var variation = (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(placement);\n  var placements = variation ? flipVariations ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements : _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements.filter(function (placement) {\n    return (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(placement) === variation;\n  }) : _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements;\n  var allowedPlacements = placements.filter(function (placement) {\n    return allowedAutoPlacements.indexOf(placement) >= 0;\n  });\n\n  if (allowedPlacements.length === 0) {\n    allowedPlacements = placements;\n  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n  var overflows = allowedPlacements.reduce(function (acc, placement) {\n    acc[placement] = (0,_detectOverflow_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      padding: padding\n    })[(0,_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(placement)];\n    return acc;\n  }, {});\n  return Object.keys(overflows).sort(function (a, b) {\n    return overflows[a] - overflows[b];\n  });\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/computeOffsets.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ computeOffsets)\n/* harmony export */ });\n/* harmony import */ var _getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBasePlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getBasePlacement.js\");\n/* harmony import */ var _getVariation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVariation.js */ \"./node_modules/@popperjs/core/lib/utils/getVariation.js\");\n/* harmony import */ var _getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getMainAxisFromPlacement.js */ \"./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n\n\n\n\nfunction computeOffsets(_ref) {\n  var reference = _ref.reference,\n      element = _ref.element,\n      placement = _ref.placement;\n  var basePlacement = placement ? (0,_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(placement) : null;\n  var variation = placement ? (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(placement) : null;\n  var commonX = reference.x + reference.width / 2 - element.width / 2;\n  var commonY = reference.y + reference.height / 2 - element.height / 2;\n  var offsets;\n\n  switch (basePlacement) {\n    case _enums_js__WEBPACK_IMPORTED_MODULE_2__.top:\n      offsets = {\n        x: commonX,\n        y: reference.y - element.height\n      };\n      break;\n\n    case _enums_js__WEBPACK_IMPORTED_MODULE_2__.bottom:\n      offsets = {\n        x: commonX,\n        y: reference.y + reference.height\n      };\n      break;\n\n    case _enums_js__WEBPACK_IMPORTED_MODULE_2__.right:\n      offsets = {\n        x: reference.x + reference.width,\n        y: commonY\n      };\n      break;\n\n    case _enums_js__WEBPACK_IMPORTED_MODULE_2__.left:\n      offsets = {\n        x: reference.x - element.width,\n        y: commonY\n      };\n      break;\n\n    default:\n      offsets = {\n        x: reference.x,\n        y: reference.y\n      };\n  }\n\n  var mainAxis = basePlacement ? (0,_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(basePlacement) : null;\n\n  if (mainAxis != null) {\n    var len = mainAxis === 'y' ? 'height' : 'width';\n\n    switch (variation) {\n      case _enums_js__WEBPACK_IMPORTED_MODULE_2__.start:\n        offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n        break;\n\n      case _enums_js__WEBPACK_IMPORTED_MODULE_2__.end:\n        offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n        break;\n\n      default:\n    }\n  }\n\n  return offsets;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/computeOffsets.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/debounce.js":
/*!***********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/debounce.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ debounce)\n/* harmony export */ });\nfunction debounce(fn) {\n  var pending;\n  return function () {\n    if (!pending) {\n      pending = new Promise(function (resolve) {\n        Promise.resolve().then(function () {\n          pending = undefined;\n          resolve(fn());\n        });\n      });\n    }\n\n    return pending;\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/debounce.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/detectOverflow.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ detectOverflow)\n/* harmony export */ });\n/* harmony import */ var _dom_utils_getClippingRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getClippingRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js\");\n/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\");\n/* harmony import */ var _dom_utils_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getBoundingClientRect.js */ \"./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\");\n/* harmony import */ var _computeOffsets_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./computeOffsets.js */ \"./node_modules/@popperjs/core/lib/utils/computeOffsets.js\");\n/* harmony import */ var _rectToClientRect_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rectToClientRect.js */ \"./node_modules/@popperjs/core/lib/utils/rectToClientRect.js\");\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ \"./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\");\n/* harmony import */ var _mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergePaddingObject.js */ \"./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js\");\n/* harmony import */ var _expandToHashMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./expandToHashMap.js */ \"./node_modules/@popperjs/core/lib/utils/expandToHashMap.js\");\n\n\n\n\n\n\n\n\n // eslint-disable-next-line import/no-unused-modules\n\nfunction detectOverflow(state, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      _options$placement = _options.placement,\n      placement = _options$placement === void 0 ? state.placement : _options$placement,\n      _options$strategy = _options.strategy,\n      strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n      _options$boundary = _options.boundary,\n      boundary = _options$boundary === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.clippingParents : _options$boundary,\n      _options$rootBoundary = _options.rootBoundary,\n      rootBoundary = _options$rootBoundary === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.viewport : _options$rootBoundary,\n      _options$elementConte = _options.elementContext,\n      elementContext = _options$elementConte === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper : _options$elementConte,\n      _options$altBoundary = _options.altBoundary,\n      altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n      _options$padding = _options.padding,\n      padding = _options$padding === void 0 ? 0 : _options$padding;\n  var paddingObject = (0,_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeof padding !== 'number' ? padding : (0,_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements));\n  var altContext = elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.reference : _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper;\n  var popperRect = state.rects.popper;\n  var element = state.elements[altBoundary ? altContext : elementContext];\n  var clippingClientRect = (0,_dom_utils_getClippingRect_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])((0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(element) ? element : element.contextElement || (0,_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(state.elements.popper), boundary, rootBoundary, strategy);\n  var referenceClientRect = (0,_dom_utils_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(state.elements.reference);\n  var popperOffsets = (0,_computeOffsets_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n    reference: referenceClientRect,\n    element: popperRect,\n    strategy: 'absolute',\n    placement: placement\n  });\n  var popperClientRect = (0,_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(Object.assign({}, popperRect, popperOffsets));\n  var elementClientRect = elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n  // 0 or negative = within the clipping rect\n\n  var overflowOffsets = {\n    top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n    bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n    left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n    right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n  };\n  var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n  if (elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper && offsetData) {\n    var offset = offsetData[placement];\n    Object.keys(overflowOffsets).forEach(function (key) {\n      var multiply = [_enums_js__WEBPACK_IMPORTED_MODULE_0__.right, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom].indexOf(key) >= 0 ? 1 : -1;\n      var axis = [_enums_js__WEBPACK_IMPORTED_MODULE_0__.top, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom].indexOf(key) >= 0 ? 'y' : 'x';\n      overflowOffsets[key] += offset[axis] * multiply;\n    });\n  }\n\n  return overflowOffsets;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/detectOverflow.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js":
/*!******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ expandToHashMap)\n/* harmony export */ });\nfunction expandToHashMap(value, keys) {\n  return keys.reduce(function (hashMap, key) {\n    hashMap[key] = value;\n    return hashMap;\n  }, {});\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/expandToHashMap.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getAltAxis.js":
/*!*************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getAltAxis.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getAltAxis)\n/* harmony export */ });\nfunction getAltAxis(axis) {\n  return axis === 'x' ? 'y' : 'x';\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/getAltAxis.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js":
/*!*******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getBasePlacement)\n/* harmony export */ });\n\nfunction getBasePlacement(placement) {\n  return placement.split('-')[0];\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/getBasePlacement.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getFreshSideObject)\n/* harmony export */ });\nfunction getFreshSideObject() {\n  return {\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0\n  };\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js":
/*!***************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getMainAxisFromPlacement)\n/* harmony export */ });\nfunction getMainAxisFromPlacement(placement) {\n  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getOppositePlacement)\n/* harmony export */ });\nvar hash = {\n  left: 'right',\n  right: 'left',\n  bottom: 'top',\n  top: 'bottom'\n};\nfunction getOppositePlacement(placement) {\n  return placement.replace(/left|right|bottom|top/g, function (matched) {\n    return hash[matched];\n  });\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js":
/*!********************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getOppositeVariationPlacement)\n/* harmony export */ });\nvar hash = {\n  start: 'end',\n  end: 'start'\n};\nfunction getOppositeVariationPlacement(placement) {\n  return placement.replace(/start|end/g, function (matched) {\n    return hash[matched];\n  });\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getVariation.js":
/*!***************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getVariation.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getVariation)\n/* harmony export */ });\nfunction getVariation(placement) {\n  return placement.split('-')[1];\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/getVariation.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/math.js":
/*!*******************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/math.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   max: () => (/* binding */ max),\n/* harmony export */   min: () => (/* binding */ min),\n/* harmony export */   round: () => (/* binding */ round)\n/* harmony export */ });\nvar max = Math.max;\nvar min = Math.min;\nvar round = Math.round;\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/math.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/mergeByName.js":
/*!**************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/mergeByName.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ mergeByName)\n/* harmony export */ });\nfunction mergeByName(modifiers) {\n  var merged = modifiers.reduce(function (merged, current) {\n    var existing = merged[current.name];\n    merged[current.name] = existing ? Object.assign({}, existing, current, {\n      options: Object.assign({}, existing.options, current.options),\n      data: Object.assign({}, existing.data, current.data)\n    }) : current;\n    return merged;\n  }, {}); // IE11 does not support Object.values\n\n  return Object.keys(merged).map(function (key) {\n    return merged[key];\n  });\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/mergeByName.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ mergePaddingObject)\n/* harmony export */ });\n/* harmony import */ var _getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getFreshSideObject.js */ \"./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js\");\n\nfunction mergePaddingObject(paddingObject) {\n  return Object.assign({}, (0,_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(), paddingObject);\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/orderModifiers.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/orderModifiers.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ orderModifiers)\n/* harmony export */ });\n/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ \"./node_modules/@popperjs/core/lib/enums.js\");\n // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n  var map = new Map();\n  var visited = new Set();\n  var result = [];\n  modifiers.forEach(function (modifier) {\n    map.set(modifier.name, modifier);\n  }); // On visiting object, check for its dependencies and visit them recursively\n\n  function sort(modifier) {\n    visited.add(modifier.name);\n    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n    requires.forEach(function (dep) {\n      if (!visited.has(dep)) {\n        var depModifier = map.get(dep);\n\n        if (depModifier) {\n          sort(depModifier);\n        }\n      }\n    });\n    result.push(modifier);\n  }\n\n  modifiers.forEach(function (modifier) {\n    if (!visited.has(modifier.name)) {\n      // check for visited object\n      sort(modifier);\n    }\n  });\n  return result;\n}\n\nfunction orderModifiers(modifiers) {\n  // order based on dependencies\n  var orderedModifiers = order(modifiers); // order based on phase\n\n  return _enums_js__WEBPACK_IMPORTED_MODULE_0__.modifierPhases.reduce(function (acc, phase) {\n    return acc.concat(orderedModifiers.filter(function (modifier) {\n      return modifier.phase === phase;\n    }));\n  }, []);\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/orderModifiers.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js":
/*!*******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ rectToClientRect)\n/* harmony export */ });\nfunction rectToClientRect(rect) {\n  return Object.assign({}, rect, {\n    left: rect.x,\n    top: rect.y,\n    right: rect.x + rect.width,\n    bottom: rect.y + rect.height\n  });\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/rectToClientRect.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/userAgent.js":
/*!************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/userAgent.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ getUAString)\n/* harmony export */ });\nfunction getUAString() {\n  var uaData = navigator.userAgentData;\n\n  if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n    return uaData.brands.map(function (item) {\n      return item.brand + \"/\" + item.version;\n    }).join(' ');\n  }\n\n  return navigator.userAgent;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/userAgent.js?");

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/within.js":
/*!*********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/within.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   within: () => (/* binding */ within),\n/* harmony export */   withinMaxClamp: () => (/* binding */ withinMaxClamp)\n/* harmony export */ });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/@popperjs/core/lib/utils/math.js\");\n\nfunction within(min, value, max) {\n  return (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.max)(min, (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.min)(value, max));\n}\nfunction withinMaxClamp(min, value, max) {\n  var v = within(min, value, max);\n  return v > max ? max : v;\n}\n\n//# sourceURL=webpack://frontend/./node_modules/@popperjs/core/lib/utils/within.js?");

/***/ }),

/***/ "./node_modules/bootstrap/dist/js/bootstrap.esm.js":
/*!*********************************************************!*\
  !*** ./node_modules/bootstrap/dist/js/bootstrap.esm.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   Alert: () => (/* binding */ Alert),\n/* harmony export */   Button: () => (/* binding */ Button),\n/* harmony export */   Carousel: () => (/* binding */ Carousel),\n/* harmony export */   Collapse: () => (/* binding */ Collapse),\n/* harmony export */   Dropdown: () => (/* binding */ Dropdown),\n/* harmony export */   Modal: () => (/* binding */ Modal),\n/* harmony export */   Offcanvas: () => (/* binding */ Offcanvas),\n/* harmony export */   Popover: () => (/* binding */ Popover),\n/* harmony export */   ScrollSpy: () => (/* binding */ ScrollSpy),\n/* harmony export */   Tab: () => (/* binding */ Tab),\n/* harmony export */   Toast: () => (/* binding */ Toast),\n/* harmony export */   Tooltip: () => (/* binding */ Tooltip)\n/* harmony export */ });\n/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @popperjs/core */ \"./node_modules/@popperjs/core/lib/index.js\");\n/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @popperjs/core */ \"./node_modules/@popperjs/core/lib/popper.js\");\n/*!\n  * Bootstrap v5.3.2 (https://getbootstrap.com/)\n  * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n  */\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map();\nconst Data = {\n  set(element, key, instance) {\n    if (!elementMap.has(element)) {\n      elementMap.set(element, new Map());\n    }\n    const instanceMap = elementMap.get(element);\n\n    // make it clear we only want one instance per element\n    // can be removed later when multiple key/instances are fine to be used\n    if (!instanceMap.has(key) && instanceMap.size !== 0) {\n      // eslint-disable-next-line no-console\n      console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);\n      return;\n    }\n    instanceMap.set(key, instance);\n  },\n  get(element, key) {\n    if (elementMap.has(element)) {\n      return elementMap.get(element).get(key) || null;\n    }\n    return null;\n  },\n  remove(element, key) {\n    if (!elementMap.has(element)) {\n      return;\n    }\n    const instanceMap = elementMap.get(element);\n    instanceMap.delete(key);\n\n    // free up element references if there are no instances left for an element\n    if (instanceMap.size === 0) {\n      elementMap.delete(element);\n    }\n  }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000;\nconst MILLISECONDS_MULTIPLIER = 1000;\nconst TRANSITION_END = 'transitionend';\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n  if (selector && window.CSS && window.CSS.escape) {\n    // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n    selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`);\n  }\n  return selector;\n};\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n  if (object === null || object === undefined) {\n    return `${object}`;\n  }\n  return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase();\n};\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n  do {\n    prefix += Math.floor(Math.random() * MAX_UID);\n  } while (document.getElementById(prefix));\n  return prefix;\n};\nconst getTransitionDurationFromElement = element => {\n  if (!element) {\n    return 0;\n  }\n\n  // Get transition-duration of the element\n  let {\n    transitionDuration,\n    transitionDelay\n  } = window.getComputedStyle(element);\n  const floatTransitionDuration = Number.parseFloat(transitionDuration);\n  const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n  // Return 0 if element or transition duration is not found\n  if (!floatTransitionDuration && !floatTransitionDelay) {\n    return 0;\n  }\n\n  // If multiple durations are defined, take the first\n  transitionDuration = transitionDuration.split(',')[0];\n  transitionDelay = transitionDelay.split(',')[0];\n  return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n};\nconst triggerTransitionEnd = element => {\n  element.dispatchEvent(new Event(TRANSITION_END));\n};\nconst isElement = object => {\n  if (!object || typeof object !== 'object') {\n    return false;\n  }\n  if (typeof object.jquery !== 'undefined') {\n    object = object[0];\n  }\n  return typeof object.nodeType !== 'undefined';\n};\nconst getElement = object => {\n  // it's a jQuery object or a node element\n  if (isElement(object)) {\n    return object.jquery ? object[0] : object;\n  }\n  if (typeof object === 'string' && object.length > 0) {\n    return document.querySelector(parseSelector(object));\n  }\n  return null;\n};\nconst isVisible = element => {\n  if (!isElement(element) || element.getClientRects().length === 0) {\n    return false;\n  }\n  const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';\n  // Handle `details` element as its content may falsie appear visible when it is closed\n  const closedDetails = element.closest('details:not([open])');\n  if (!closedDetails) {\n    return elementIsVisible;\n  }\n  if (closedDetails !== element) {\n    const summary = element.closest('summary');\n    if (summary && summary.parentNode !== closedDetails) {\n      return false;\n    }\n    if (summary === null) {\n      return false;\n    }\n  }\n  return elementIsVisible;\n};\nconst isDisabled = element => {\n  if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n    return true;\n  }\n  if (element.classList.contains('disabled')) {\n    return true;\n  }\n  if (typeof element.disabled !== 'undefined') {\n    return element.disabled;\n  }\n  return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';\n};\nconst findShadowRoot = element => {\n  if (!document.documentElement.attachShadow) {\n    return null;\n  }\n\n  // Can find the shadow root otherwise it'll return the document\n  if (typeof element.getRootNode === 'function') {\n    const root = element.getRootNode();\n    return root instanceof ShadowRoot ? root : null;\n  }\n  if (element instanceof ShadowRoot) {\n    return element;\n  }\n\n  // when we don't find a shadow root\n  if (!element.parentNode) {\n    return null;\n  }\n  return findShadowRoot(element.parentNode);\n};\nconst noop = () => {};\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n  element.offsetHeight; // eslint-disable-line no-unused-expressions\n};\n\nconst getjQuery = () => {\n  if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n    return window.jQuery;\n  }\n  return null;\n};\nconst DOMContentLoadedCallbacks = [];\nconst onDOMContentLoaded = callback => {\n  if (document.readyState === 'loading') {\n    // add listener on the first call when the document is in loading state\n    if (!DOMContentLoadedCallbacks.length) {\n      document.addEventListener('DOMContentLoaded', () => {\n        for (const callback of DOMContentLoadedCallbacks) {\n          callback();\n        }\n      });\n    }\n    DOMContentLoadedCallbacks.push(callback);\n  } else {\n    callback();\n  }\n};\nconst isRTL = () => document.documentElement.dir === 'rtl';\nconst defineJQueryPlugin = plugin => {\n  onDOMContentLoaded(() => {\n    const $ = getjQuery();\n    /* istanbul ignore if */\n    if ($) {\n      const name = plugin.NAME;\n      const JQUERY_NO_CONFLICT = $.fn[name];\n      $.fn[name] = plugin.jQueryInterface;\n      $.fn[name].Constructor = plugin;\n      $.fn[name].noConflict = () => {\n        $.fn[name] = JQUERY_NO_CONFLICT;\n        return plugin.jQueryInterface;\n      };\n    }\n  });\n};\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n  return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;\n};\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n  if (!waitForTransition) {\n    execute(callback);\n    return;\n  }\n  const durationPadding = 5;\n  const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;\n  let called = false;\n  const handler = ({\n    target\n  }) => {\n    if (target !== transitionElement) {\n      return;\n    }\n    called = true;\n    transitionElement.removeEventListener(TRANSITION_END, handler);\n    execute(callback);\n  };\n  transitionElement.addEventListener(TRANSITION_END, handler);\n  setTimeout(() => {\n    if (!called) {\n      triggerTransitionEnd(transitionElement);\n    }\n  }, emulatedDuration);\n};\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list    The list of elements\n * @param activeElement   The active element\n * @param shouldGetNext   Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n  const listLength = list.length;\n  let index = list.indexOf(activeElement);\n\n  // if the element does not exist in the list return an element\n  // depending on the direction and if cycle is allowed\n  if (index === -1) {\n    return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];\n  }\n  index += shouldGetNext ? 1 : -1;\n  if (isCycleAllowed) {\n    index = (index + listLength) % listLength;\n  }\n  return list[Math.max(0, Math.min(index, listLength - 1))];\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/;\nconst stripNameRegex = /\\..*/;\nconst stripUidRegex = /::\\d+$/;\nconst eventRegistry = {}; // Events storage\nlet uidEvent = 1;\nconst customEvents = {\n  mouseenter: 'mouseover',\n  mouseleave: 'mouseout'\n};\nconst nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n  return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;\n}\nfunction getElementEvents(element) {\n  const uid = makeEventUid(element);\n  element.uidEvent = uid;\n  eventRegistry[uid] = eventRegistry[uid] || {};\n  return eventRegistry[uid];\n}\nfunction bootstrapHandler(element, fn) {\n  return function handler(event) {\n    hydrateObj(event, {\n      delegateTarget: element\n    });\n    if (handler.oneOff) {\n      EventHandler.off(element, event.type, fn);\n    }\n    return fn.apply(element, [event]);\n  };\n}\nfunction bootstrapDelegationHandler(element, selector, fn) {\n  return function handler(event) {\n    const domElements = element.querySelectorAll(selector);\n    for (let {\n      target\n    } = event; target && target !== this; target = target.parentNode) {\n      for (const domElement of domElements) {\n        if (domElement !== target) {\n          continue;\n        }\n        hydrateObj(event, {\n          delegateTarget: target\n        });\n        if (handler.oneOff) {\n          EventHandler.off(element, event.type, selector, fn);\n        }\n        return fn.apply(target, [event]);\n      }\n    }\n  };\n}\nfunction findHandler(events, callable, delegationSelector = null) {\n  return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);\n}\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n  const isDelegated = typeof handler === 'string';\n  // TODO: tooltip passes `false` instead of selector, so we need to check\n  const callable = isDelegated ? delegationFunction : handler || delegationFunction;\n  let typeEvent = getTypeEvent(originalTypeEvent);\n  if (!nativeEvents.has(typeEvent)) {\n    typeEvent = originalTypeEvent;\n  }\n  return [isDelegated, callable, typeEvent];\n}\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n  if (typeof originalTypeEvent !== 'string' || !element) {\n    return;\n  }\n  let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);\n\n  // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n  // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n  if (originalTypeEvent in customEvents) {\n    const wrapFunction = fn => {\n      return function (event) {\n        if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {\n          return fn.call(this, event);\n        }\n      };\n    };\n    callable = wrapFunction(callable);\n  }\n  const events = getElementEvents(element);\n  const handlers = events[typeEvent] || (events[typeEvent] = {});\n  const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);\n  if (previousFunction) {\n    previousFunction.oneOff = previousFunction.oneOff && oneOff;\n    return;\n  }\n  const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));\n  const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);\n  fn.delegationSelector = isDelegated ? handler : null;\n  fn.callable = callable;\n  fn.oneOff = oneOff;\n  fn.uidEvent = uid;\n  handlers[uid] = fn;\n  element.addEventListener(typeEvent, fn, isDelegated);\n}\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n  const fn = findHandler(events[typeEvent], handler, delegationSelector);\n  if (!fn) {\n    return;\n  }\n  element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));\n  delete events[typeEvent][fn.uidEvent];\n}\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n  const storeElementEvent = events[typeEvent] || {};\n  for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n    if (handlerKey.includes(namespace)) {\n      removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);\n    }\n  }\n}\nfunction getTypeEvent(event) {\n  // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n  event = event.replace(stripNameRegex, '');\n  return customEvents[event] || event;\n}\nconst EventHandler = {\n  on(element, event, handler, delegationFunction) {\n    addHandler(element, event, handler, delegationFunction, false);\n  },\n  one(element, event, handler, delegationFunction) {\n    addHandler(element, event, handler, delegationFunction, true);\n  },\n  off(element, originalTypeEvent, handler, delegationFunction) {\n    if (typeof originalTypeEvent !== 'string' || !element) {\n      return;\n    }\n    const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);\n    const inNamespace = typeEvent !== originalTypeEvent;\n    const events = getElementEvents(element);\n    const storeElementEvent = events[typeEvent] || {};\n    const isNamespace = originalTypeEvent.startsWith('.');\n    if (typeof callable !== 'undefined') {\n      // Simplest case: handler is passed, remove that listener ONLY.\n      if (!Object.keys(storeElementEvent).length) {\n        return;\n      }\n      removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);\n      return;\n    }\n    if (isNamespace) {\n      for (const elementEvent of Object.keys(events)) {\n        removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));\n      }\n    }\n    for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n      const handlerKey = keyHandlers.replace(stripUidRegex, '');\n      if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n        removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);\n      }\n    }\n  },\n  trigger(element, event, args) {\n    if (typeof event !== 'string' || !element) {\n      return null;\n    }\n    const $ = getjQuery();\n    const typeEvent = getTypeEvent(event);\n    const inNamespace = event !== typeEvent;\n    let jQueryEvent = null;\n    let bubbles = true;\n    let nativeDispatch = true;\n    let defaultPrevented = false;\n    if (inNamespace && $) {\n      jQueryEvent = $.Event(event, args);\n      $(element).trigger(jQueryEvent);\n      bubbles = !jQueryEvent.isPropagationStopped();\n      nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();\n      defaultPrevented = jQueryEvent.isDefaultPrevented();\n    }\n    const evt = hydrateObj(new Event(event, {\n      bubbles,\n      cancelable: true\n    }), args);\n    if (defaultPrevented) {\n      evt.preventDefault();\n    }\n    if (nativeDispatch) {\n      element.dispatchEvent(evt);\n    }\n    if (evt.defaultPrevented && jQueryEvent) {\n      jQueryEvent.preventDefault();\n    }\n    return evt;\n  }\n};\nfunction hydrateObj(obj, meta = {}) {\n  for (const [key, value] of Object.entries(meta)) {\n    try {\n      obj[key] = value;\n    } catch (_unused) {\n      Object.defineProperty(obj, key, {\n        configurable: true,\n        get() {\n          return value;\n        }\n      });\n    }\n  }\n  return obj;\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n  if (value === 'true') {\n    return true;\n  }\n  if (value === 'false') {\n    return false;\n  }\n  if (value === Number(value).toString()) {\n    return Number(value);\n  }\n  if (value === '' || value === 'null') {\n    return null;\n  }\n  if (typeof value !== 'string') {\n    return value;\n  }\n  try {\n    return JSON.parse(decodeURIComponent(value));\n  } catch (_unused) {\n    return value;\n  }\n}\nfunction normalizeDataKey(key) {\n  return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);\n}\nconst Manipulator = {\n  setDataAttribute(element, key, value) {\n    element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);\n  },\n  removeDataAttribute(element, key) {\n    element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);\n  },\n  getDataAttributes(element) {\n    if (!element) {\n      return {};\n    }\n    const attributes = {};\n    const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));\n    for (const key of bsKeys) {\n      let pureKey = key.replace(/^bs/, '');\n      pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);\n      attributes[pureKey] = normalizeData(element.dataset[key]);\n    }\n    return attributes;\n  },\n  getDataAttribute(element, key) {\n    return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));\n  }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Class definition\n */\n\nclass Config {\n  // Getters\n  static get Default() {\n    return {};\n  }\n  static get DefaultType() {\n    return {};\n  }\n  static get NAME() {\n    throw new Error('You have to implement the static method \"NAME\", for each component!');\n  }\n  _getConfig(config) {\n    config = this._mergeConfigObj(config);\n    config = this._configAfterMerge(config);\n    this._typeCheckConfig(config);\n    return config;\n  }\n  _configAfterMerge(config) {\n    return config;\n  }\n  _mergeConfigObj(config, element) {\n    const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse\n\n    return {\n      ...this.constructor.Default,\n      ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n      ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n      ...(typeof config === 'object' ? config : {})\n    };\n  }\n  _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n    for (const [property, expectedTypes] of Object.entries(configTypes)) {\n      const value = config[property];\n      const valueType = isElement(value) ? 'element' : toType(value);\n      if (!new RegExp(expectedTypes).test(valueType)) {\n        throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`);\n      }\n    }\n  }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.2';\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n  constructor(element, config) {\n    super();\n    element = getElement(element);\n    if (!element) {\n      return;\n    }\n    this._element = element;\n    this._config = this._getConfig(config);\n    Data.set(this._element, this.constructor.DATA_KEY, this);\n  }\n\n  // Public\n  dispose() {\n    Data.remove(this._element, this.constructor.DATA_KEY);\n    EventHandler.off(this._element, this.constructor.EVENT_KEY);\n    for (const propertyName of Object.getOwnPropertyNames(this)) {\n      this[propertyName] = null;\n    }\n  }\n  _queueCallback(callback, element, isAnimated = true) {\n    executeAfterTransition(callback, element, isAnimated);\n  }\n  _getConfig(config) {\n    config = this._mergeConfigObj(config, this._element);\n    config = this._configAfterMerge(config);\n    this._typeCheckConfig(config);\n    return config;\n  }\n\n  // Static\n  static getInstance(element) {\n    return Data.get(getElement(element), this.DATA_KEY);\n  }\n  static getOrCreateInstance(element, config = {}) {\n    return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);\n  }\n  static get VERSION() {\n    return VERSION;\n  }\n  static get DATA_KEY() {\n    return `bs.${this.NAME}`;\n  }\n  static get EVENT_KEY() {\n    return `.${this.DATA_KEY}`;\n  }\n  static eventName(name) {\n    return `${name}${this.EVENT_KEY}`;\n  }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst getSelector = element => {\n  let selector = element.getAttribute('data-bs-target');\n  if (!selector || selector === '#') {\n    let hrefAttribute = element.getAttribute('href');\n\n    // The only valid content that could double as a selector are IDs or classes,\n    // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n    // `document.querySelector` will rightfully complain it is invalid.\n    // See https://github.com/twbs/bootstrap/issues/32273\n    if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {\n      return null;\n    }\n\n    // Just in case some CMS puts out a full URL with the anchor appended\n    if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n      hrefAttribute = `#${hrefAttribute.split('#')[1]}`;\n    }\n    selector = hrefAttribute && hrefAttribute !== '#' ? parseSelector(hrefAttribute.trim()) : null;\n  }\n  return selector;\n};\nconst SelectorEngine = {\n  find(selector, element = document.documentElement) {\n    return [].concat(...Element.prototype.querySelectorAll.call(element, selector));\n  },\n  findOne(selector, element = document.documentElement) {\n    return Element.prototype.querySelector.call(element, selector);\n  },\n  children(element, selector) {\n    return [].concat(...element.children).filter(child => child.matches(selector));\n  },\n  parents(element, selector) {\n    const parents = [];\n    let ancestor = element.parentNode.closest(selector);\n    while (ancestor) {\n      parents.push(ancestor);\n      ancestor = ancestor.parentNode.closest(selector);\n    }\n    return parents;\n  },\n  prev(element, selector) {\n    let previous = element.previousElementSibling;\n    while (previous) {\n      if (previous.matches(selector)) {\n        return [previous];\n      }\n      previous = previous.previousElementSibling;\n    }\n    return [];\n  },\n  // TODO: this is now unused; remove later along with prev()\n  next(element, selector) {\n    let next = element.nextElementSibling;\n    while (next) {\n      if (next.matches(selector)) {\n        return [next];\n      }\n      next = next.nextElementSibling;\n    }\n    return [];\n  },\n  focusableChildren(element) {\n    const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable=\"true\"]'].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',');\n    return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));\n  },\n  getSelectorFromElement(element) {\n    const selector = getSelector(element);\n    if (selector) {\n      return SelectorEngine.findOne(selector) ? selector : null;\n    }\n    return null;\n  },\n  getElementFromSelector(element) {\n    const selector = getSelector(element);\n    return selector ? SelectorEngine.findOne(selector) : null;\n  },\n  getMultipleElementsFromSelector(element) {\n    const selector = getSelector(element);\n    return selector ? SelectorEngine.find(selector) : [];\n  }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n  const clickEvent = `click.dismiss${component.EVENT_KEY}`;\n  const name = component.NAME;\n  EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n    if (['A', 'AREA'].includes(this.tagName)) {\n      event.preventDefault();\n    }\n    if (isDisabled(this)) {\n      return;\n    }\n    const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);\n    const instance = component.getOrCreateInstance(target);\n\n    // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n    instance[method]();\n  });\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$f = 'alert';\nconst DATA_KEY$a = 'bs.alert';\nconst EVENT_KEY$b = `.${DATA_KEY$a}`;\nconst EVENT_CLOSE = `close${EVENT_KEY$b}`;\nconst EVENT_CLOSED = `closed${EVENT_KEY$b}`;\nconst CLASS_NAME_FADE$5 = 'fade';\nconst CLASS_NAME_SHOW$8 = 'show';\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n  // Getters\n  static get NAME() {\n    return NAME$f;\n  }\n\n  // Public\n  close() {\n    const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);\n    if (closeEvent.defaultPrevented) {\n      return;\n    }\n    this._element.classList.remove(CLASS_NAME_SHOW$8);\n    const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);\n    this._queueCallback(() => this._destroyElement(), this._element, isAnimated);\n  }\n\n  // Private\n  _destroyElement() {\n    this._element.remove();\n    EventHandler.trigger(this._element, EVENT_CLOSED);\n    this.dispose();\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Alert.getOrCreateInstance(this);\n      if (typeof config !== 'string') {\n        return;\n      }\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`);\n      }\n      data[config](this);\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close');\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$e = 'button';\nconst DATA_KEY$9 = 'bs.button';\nconst EVENT_KEY$a = `.${DATA_KEY$9}`;\nconst DATA_API_KEY$6 = '.data-api';\nconst CLASS_NAME_ACTIVE$3 = 'active';\nconst SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle=\"button\"]';\nconst EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n  // Getters\n  static get NAME() {\n    return NAME$e;\n  }\n\n  // Public\n  toggle() {\n    // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n    this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Button.getOrCreateInstance(this);\n      if (config === 'toggle') {\n        data[config]();\n      }\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {\n  event.preventDefault();\n  const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);\n  const data = Button.getOrCreateInstance(button);\n  data.toggle();\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$d = 'swipe';\nconst EVENT_KEY$9 = '.bs.swipe';\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`;\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`;\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`;\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`;\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`;\nconst POINTER_TYPE_TOUCH = 'touch';\nconst POINTER_TYPE_PEN = 'pen';\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event';\nconst SWIPE_THRESHOLD = 40;\nconst Default$c = {\n  endCallback: null,\n  leftCallback: null,\n  rightCallback: null\n};\nconst DefaultType$c = {\n  endCallback: '(function|null)',\n  leftCallback: '(function|null)',\n  rightCallback: '(function|null)'\n};\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n  constructor(element, config) {\n    super();\n    this._element = element;\n    if (!element || !Swipe.isSupported()) {\n      return;\n    }\n    this._config = this._getConfig(config);\n    this._deltaX = 0;\n    this._supportPointerEvents = Boolean(window.PointerEvent);\n    this._initEvents();\n  }\n\n  // Getters\n  static get Default() {\n    return Default$c;\n  }\n  static get DefaultType() {\n    return DefaultType$c;\n  }\n  static get NAME() {\n    return NAME$d;\n  }\n\n  // Public\n  dispose() {\n    EventHandler.off(this._element, EVENT_KEY$9);\n  }\n\n  // Private\n  _start(event) {\n    if (!this._supportPointerEvents) {\n      this._deltaX = event.touches[0].clientX;\n      return;\n    }\n    if (this._eventIsPointerPenTouch(event)) {\n      this._deltaX = event.clientX;\n    }\n  }\n  _end(event) {\n    if (this._eventIsPointerPenTouch(event)) {\n      this._deltaX = event.clientX - this._deltaX;\n    }\n    this._handleSwipe();\n    execute(this._config.endCallback);\n  }\n  _move(event) {\n    this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX;\n  }\n  _handleSwipe() {\n    const absDeltaX = Math.abs(this._deltaX);\n    if (absDeltaX <= SWIPE_THRESHOLD) {\n      return;\n    }\n    const direction = absDeltaX / this._deltaX;\n    this._deltaX = 0;\n    if (!direction) {\n      return;\n    }\n    execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);\n  }\n  _initEvents() {\n    if (this._supportPointerEvents) {\n      EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event));\n      EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event));\n      this._element.classList.add(CLASS_NAME_POINTER_EVENT);\n    } else {\n      EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event));\n      EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event));\n      EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event));\n    }\n  }\n  _eventIsPointerPenTouch(event) {\n    return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);\n  }\n\n  // Static\n  static isSupported() {\n    return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n  }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$c = 'carousel';\nconst DATA_KEY$8 = 'bs.carousel';\nconst EVENT_KEY$8 = `.${DATA_KEY$8}`;\nconst DATA_API_KEY$5 = '.data-api';\nconst ARROW_LEFT_KEY$1 = 'ArrowLeft';\nconst ARROW_RIGHT_KEY$1 = 'ArrowRight';\nconst TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next';\nconst ORDER_PREV = 'prev';\nconst DIRECTION_LEFT = 'left';\nconst DIRECTION_RIGHT = 'right';\nconst EVENT_SLIDE = `slide${EVENT_KEY$8}`;\nconst EVENT_SLID = `slid${EVENT_KEY$8}`;\nconst EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`;\nconst EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`;\nconst EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`;\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`;\nconst EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`;\nconst EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;\nconst CLASS_NAME_CAROUSEL = 'carousel';\nconst CLASS_NAME_ACTIVE$2 = 'active';\nconst CLASS_NAME_SLIDE = 'slide';\nconst CLASS_NAME_END = 'carousel-item-end';\nconst CLASS_NAME_START = 'carousel-item-start';\nconst CLASS_NAME_NEXT = 'carousel-item-next';\nconst CLASS_NAME_PREV = 'carousel-item-prev';\nconst SELECTOR_ACTIVE = '.active';\nconst SELECTOR_ITEM = '.carousel-item';\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM;\nconst SELECTOR_ITEM_IMG = '.carousel-item img';\nconst SELECTOR_INDICATORS = '.carousel-indicators';\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]';\nconst KEY_TO_DIRECTION = {\n  [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT,\n  [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT\n};\nconst Default$b = {\n  interval: 5000,\n  keyboard: true,\n  pause: 'hover',\n  ride: false,\n  touch: true,\n  wrap: true\n};\nconst DefaultType$b = {\n  interval: '(number|boolean)',\n  // TODO:v6 remove boolean support\n  keyboard: 'boolean',\n  pause: '(string|boolean)',\n  ride: '(boolean|string)',\n  touch: 'boolean',\n  wrap: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n  constructor(element, config) {\n    super(element, config);\n    this._interval = null;\n    this._activeElement = null;\n    this._isSliding = false;\n    this.touchTimeout = null;\n    this._swipeHelper = null;\n    this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);\n    this._addEventListeners();\n    if (this._config.ride === CLASS_NAME_CAROUSEL) {\n      this.cycle();\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default$b;\n  }\n  static get DefaultType() {\n    return DefaultType$b;\n  }\n  static get NAME() {\n    return NAME$c;\n  }\n\n  // Public\n  next() {\n    this._slide(ORDER_NEXT);\n  }\n  nextWhenVisible() {\n    // FIXME TODO use `document.visibilityState`\n    // Don't call next when the page isn't visible\n    // or the carousel or its parent isn't visible\n    if (!document.hidden && isVisible(this._element)) {\n      this.next();\n    }\n  }\n  prev() {\n    this._slide(ORDER_PREV);\n  }\n  pause() {\n    if (this._isSliding) {\n      triggerTransitionEnd(this._element);\n    }\n    this._clearInterval();\n  }\n  cycle() {\n    this._clearInterval();\n    this._updateInterval();\n    this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval);\n  }\n  _maybeEnableCycle() {\n    if (!this._config.ride) {\n      return;\n    }\n    if (this._isSliding) {\n      EventHandler.one(this._element, EVENT_SLID, () => this.cycle());\n      return;\n    }\n    this.cycle();\n  }\n  to(index) {\n    const items = this._getItems();\n    if (index > items.length - 1 || index < 0) {\n      return;\n    }\n    if (this._isSliding) {\n      EventHandler.one(this._element, EVENT_SLID, () => this.to(index));\n      return;\n    }\n    const activeIndex = this._getItemIndex(this._getActive());\n    if (activeIndex === index) {\n      return;\n    }\n    const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;\n    this._slide(order, items[index]);\n  }\n  dispose() {\n    if (this._swipeHelper) {\n      this._swipeHelper.dispose();\n    }\n    super.dispose();\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    config.defaultInterval = config.interval;\n    return config;\n  }\n  _addEventListeners() {\n    if (this._config.keyboard) {\n      EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event));\n    }\n    if (this._config.pause === 'hover') {\n      EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause());\n      EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle());\n    }\n    if (this._config.touch && Swipe.isSupported()) {\n      this._addTouchEventListeners();\n    }\n  }\n  _addTouchEventListeners() {\n    for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n      EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault());\n    }\n    const endCallBack = () => {\n      if (this._config.pause !== 'hover') {\n        return;\n      }\n\n      // If it's a touch-enabled device, mouseenter/leave are fired as\n      // part of the mouse compatibility events on first tap - the carousel\n      // would stop cycling until user tapped out of it;\n      // here, we listen for touchend, explicitly pause the carousel\n      // (as if it's the second time we tap on it, mouseenter compat event\n      // is NOT fired) and after a timeout (to allow for mouse compatibility\n      // events to fire) we explicitly restart cycling\n\n      this.pause();\n      if (this.touchTimeout) {\n        clearTimeout(this.touchTimeout);\n      }\n      this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval);\n    };\n    const swipeConfig = {\n      leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n      rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n      endCallback: endCallBack\n    };\n    this._swipeHelper = new Swipe(this._element, swipeConfig);\n  }\n  _keydown(event) {\n    if (/input|textarea/i.test(event.target.tagName)) {\n      return;\n    }\n    const direction = KEY_TO_DIRECTION[event.key];\n    if (direction) {\n      event.preventDefault();\n      this._slide(this._directionToOrder(direction));\n    }\n  }\n  _getItemIndex(element) {\n    return this._getItems().indexOf(element);\n  }\n  _setActiveIndicatorElement(index) {\n    if (!this._indicatorsElement) {\n      return;\n    }\n    const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);\n    activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);\n    activeIndicator.removeAttribute('aria-current');\n    const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement);\n    if (newActiveIndicator) {\n      newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2);\n      newActiveIndicator.setAttribute('aria-current', 'true');\n    }\n  }\n  _updateInterval() {\n    const element = this._activeElement || this._getActive();\n    if (!element) {\n      return;\n    }\n    const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);\n    this._config.interval = elementInterval || this._config.defaultInterval;\n  }\n  _slide(order, element = null) {\n    if (this._isSliding) {\n      return;\n    }\n    const activeElement = this._getActive();\n    const isNext = order === ORDER_NEXT;\n    const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap);\n    if (nextElement === activeElement) {\n      return;\n    }\n    const nextElementIndex = this._getItemIndex(nextElement);\n    const triggerEvent = eventName => {\n      return EventHandler.trigger(this._element, eventName, {\n        relatedTarget: nextElement,\n        direction: this._orderToDirection(order),\n        from: this._getItemIndex(activeElement),\n        to: nextElementIndex\n      });\n    };\n    const slideEvent = triggerEvent(EVENT_SLIDE);\n    if (slideEvent.defaultPrevented) {\n      return;\n    }\n    if (!activeElement || !nextElement) {\n      // Some weirdness is happening, so we bail\n      // TODO: change tests that use empty divs to avoid this check\n      return;\n    }\n    const isCycling = Boolean(this._interval);\n    this.pause();\n    this._isSliding = true;\n    this._setActiveIndicatorElement(nextElementIndex);\n    this._activeElement = nextElement;\n    const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;\n    const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;\n    nextElement.classList.add(orderClassName);\n    reflow(nextElement);\n    activeElement.classList.add(directionalClassName);\n    nextElement.classList.add(directionalClassName);\n    const completeCallBack = () => {\n      nextElement.classList.remove(directionalClassName, orderClassName);\n      nextElement.classList.add(CLASS_NAME_ACTIVE$2);\n      activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);\n      this._isSliding = false;\n      triggerEvent(EVENT_SLID);\n    };\n    this._queueCallback(completeCallBack, activeElement, this._isAnimated());\n    if (isCycling) {\n      this.cycle();\n    }\n  }\n  _isAnimated() {\n    return this._element.classList.contains(CLASS_NAME_SLIDE);\n  }\n  _getActive() {\n    return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n  }\n  _getItems() {\n    return SelectorEngine.find(SELECTOR_ITEM, this._element);\n  }\n  _clearInterval() {\n    if (this._interval) {\n      clearInterval(this._interval);\n      this._interval = null;\n    }\n  }\n  _directionToOrder(direction) {\n    if (isRTL()) {\n      return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;\n    }\n    return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;\n  }\n  _orderToDirection(order) {\n    if (isRTL()) {\n      return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;\n    }\n    return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Carousel.getOrCreateInstance(this, config);\n      if (typeof config === 'number') {\n        data.to(config);\n        return;\n      }\n      if (typeof config === 'string') {\n        if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n          throw new TypeError(`No method named \"${config}\"`);\n        }\n        data[config]();\n      }\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this);\n  if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n    return;\n  }\n  event.preventDefault();\n  const carousel = Carousel.getOrCreateInstance(target);\n  const slideIndex = this.getAttribute('data-bs-slide-to');\n  if (slideIndex) {\n    carousel.to(slideIndex);\n    carousel._maybeEnableCycle();\n    return;\n  }\n  if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n    carousel.next();\n    carousel._maybeEnableCycle();\n    return;\n  }\n  carousel.prev();\n  carousel._maybeEnableCycle();\n});\nEventHandler.on(window, EVENT_LOAD_DATA_API$3, () => {\n  const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);\n  for (const carousel of carousels) {\n    Carousel.getOrCreateInstance(carousel);\n  }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$b = 'collapse';\nconst DATA_KEY$7 = 'bs.collapse';\nconst EVENT_KEY$7 = `.${DATA_KEY$7}`;\nconst DATA_API_KEY$4 = '.data-api';\nconst EVENT_SHOW$6 = `show${EVENT_KEY$7}`;\nconst EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`;\nconst EVENT_HIDE$6 = `hide${EVENT_KEY$7}`;\nconst EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`;\nconst EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;\nconst CLASS_NAME_SHOW$7 = 'show';\nconst CLASS_NAME_COLLAPSE = 'collapse';\nconst CLASS_NAME_COLLAPSING = 'collapsing';\nconst CLASS_NAME_COLLAPSED = 'collapsed';\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal';\nconst WIDTH = 'width';\nconst HEIGHT = 'height';\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';\nconst SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle=\"collapse\"]';\nconst Default$a = {\n  parent: null,\n  toggle: true\n};\nconst DefaultType$a = {\n  parent: '(null|element)',\n  toggle: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n  constructor(element, config) {\n    super(element, config);\n    this._isTransitioning = false;\n    this._triggerArray = [];\n    const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);\n    for (const elem of toggleList) {\n      const selector = SelectorEngine.getSelectorFromElement(elem);\n      const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);\n      if (selector !== null && filterElement.length) {\n        this._triggerArray.push(elem);\n      }\n    }\n    this._initializeChildren();\n    if (!this._config.parent) {\n      this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());\n    }\n    if (this._config.toggle) {\n      this.toggle();\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default$a;\n  }\n  static get DefaultType() {\n    return DefaultType$a;\n  }\n  static get NAME() {\n    return NAME$b;\n  }\n\n  // Public\n  toggle() {\n    if (this._isShown()) {\n      this.hide();\n    } else {\n      this.show();\n    }\n  }\n  show() {\n    if (this._isTransitioning || this._isShown()) {\n      return;\n    }\n    let activeChildren = [];\n\n    // find active children\n    if (this._config.parent) {\n      activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, {\n        toggle: false\n      }));\n    }\n    if (activeChildren.length && activeChildren[0]._isTransitioning) {\n      return;\n    }\n    const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6);\n    if (startEvent.defaultPrevented) {\n      return;\n    }\n    for (const activeInstance of activeChildren) {\n      activeInstance.hide();\n    }\n    const dimension = this._getDimension();\n    this._element.classList.remove(CLASS_NAME_COLLAPSE);\n    this._element.classList.add(CLASS_NAME_COLLAPSING);\n    this._element.style[dimension] = 0;\n    this._addAriaAndCollapsedClass(this._triggerArray, true);\n    this._isTransitioning = true;\n    const complete = () => {\n      this._isTransitioning = false;\n      this._element.classList.remove(CLASS_NAME_COLLAPSING);\n      this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n      this._element.style[dimension] = '';\n      EventHandler.trigger(this._element, EVENT_SHOWN$6);\n    };\n    const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n    const scrollSize = `scroll${capitalizedDimension}`;\n    this._queueCallback(complete, this._element, true);\n    this._element.style[dimension] = `${this._element[scrollSize]}px`;\n  }\n  hide() {\n    if (this._isTransitioning || !this._isShown()) {\n      return;\n    }\n    const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6);\n    if (startEvent.defaultPrevented) {\n      return;\n    }\n    const dimension = this._getDimension();\n    this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;\n    reflow(this._element);\n    this._element.classList.add(CLASS_NAME_COLLAPSING);\n    this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n    for (const trigger of this._triggerArray) {\n      const element = SelectorEngine.getElementFromSelector(trigger);\n      if (element && !this._isShown(element)) {\n        this._addAriaAndCollapsedClass([trigger], false);\n      }\n    }\n    this._isTransitioning = true;\n    const complete = () => {\n      this._isTransitioning = false;\n      this._element.classList.remove(CLASS_NAME_COLLAPSING);\n      this._element.classList.add(CLASS_NAME_COLLAPSE);\n      EventHandler.trigger(this._element, EVENT_HIDDEN$6);\n    };\n    this._element.style[dimension] = '';\n    this._queueCallback(complete, this._element, true);\n  }\n  _isShown(element = this._element) {\n    return element.classList.contains(CLASS_NAME_SHOW$7);\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    config.toggle = Boolean(config.toggle); // Coerce string values\n    config.parent = getElement(config.parent);\n    return config;\n  }\n  _getDimension() {\n    return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;\n  }\n  _initializeChildren() {\n    if (!this._config.parent) {\n      return;\n    }\n    const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);\n    for (const element of children) {\n      const selected = SelectorEngine.getElementFromSelector(element);\n      if (selected) {\n        this._addAriaAndCollapsedClass([element], this._isShown(selected));\n      }\n    }\n  }\n  _getFirstLevelChildren(selector) {\n    const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);\n    // remove children if greater depth\n    return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element));\n  }\n  _addAriaAndCollapsedClass(triggerArray, isOpen) {\n    if (!triggerArray.length) {\n      return;\n    }\n    for (const element of triggerArray) {\n      element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen);\n      element.setAttribute('aria-expanded', isOpen);\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    const _config = {};\n    if (typeof config === 'string' && /show|hide/.test(config)) {\n      _config.toggle = false;\n    }\n    return this.each(function () {\n      const data = Collapse.getOrCreateInstance(this, _config);\n      if (typeof config === 'string') {\n        if (typeof data[config] === 'undefined') {\n          throw new TypeError(`No method named \"${config}\"`);\n        }\n        data[config]();\n      }\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) {\n  // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n  if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {\n    event.preventDefault();\n  }\n  for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n    Collapse.getOrCreateInstance(element, {\n      toggle: false\n    }).toggle();\n  }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$a = 'dropdown';\nconst DATA_KEY$6 = 'bs.dropdown';\nconst EVENT_KEY$6 = `.${DATA_KEY$6}`;\nconst DATA_API_KEY$3 = '.data-api';\nconst ESCAPE_KEY$2 = 'Escape';\nconst TAB_KEY$1 = 'Tab';\nconst ARROW_UP_KEY$1 = 'ArrowUp';\nconst ARROW_DOWN_KEY$1 = 'ArrowDown';\nconst RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE$5 = `hide${EVENT_KEY$6}`;\nconst EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`;\nconst EVENT_SHOW$5 = `show${EVENT_KEY$6}`;\nconst EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`;\nconst EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst CLASS_NAME_SHOW$6 = 'show';\nconst CLASS_NAME_DROPUP = 'dropup';\nconst CLASS_NAME_DROPEND = 'dropend';\nconst CLASS_NAME_DROPSTART = 'dropstart';\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center';\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';\nconst SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)';\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`;\nconst SELECTOR_MENU = '.dropdown-menu';\nconst SELECTOR_NAVBAR = '.navbar';\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav';\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';\nconst PLACEMENT_TOPCENTER = 'top';\nconst PLACEMENT_BOTTOMCENTER = 'bottom';\nconst Default$9 = {\n  autoClose: true,\n  boundary: 'clippingParents',\n  display: 'dynamic',\n  offset: [0, 2],\n  popperConfig: null,\n  reference: 'toggle'\n};\nconst DefaultType$9 = {\n  autoClose: '(boolean|string)',\n  boundary: '(string|element)',\n  display: 'string',\n  offset: '(array|string|function)',\n  popperConfig: '(null|object|function)',\n  reference: '(string|element|object)'\n};\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n  constructor(element, config) {\n    super(element, config);\n    this._popper = null;\n    this._parent = this._element.parentNode; // dropdown wrapper\n    // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n    this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);\n    this._inNavbar = this._detectNavbar();\n  }\n\n  // Getters\n  static get Default() {\n    return Default$9;\n  }\n  static get DefaultType() {\n    return DefaultType$9;\n  }\n  static get NAME() {\n    return NAME$a;\n  }\n\n  // Public\n  toggle() {\n    return this._isShown() ? this.hide() : this.show();\n  }\n  show() {\n    if (isDisabled(this._element) || this._isShown()) {\n      return;\n    }\n    const relatedTarget = {\n      relatedTarget: this._element\n    };\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget);\n    if (showEvent.defaultPrevented) {\n      return;\n    }\n    this._createPopper();\n\n    // If this is a touch-enabled device we add extra\n    // empty mouseover listeners to the body's immediate children;\n    // only needed because of broken event delegation on iOS\n    // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n    if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.on(element, 'mouseover', noop);\n      }\n    }\n    this._element.focus();\n    this._element.setAttribute('aria-expanded', true);\n    this._menu.classList.add(CLASS_NAME_SHOW$6);\n    this._element.classList.add(CLASS_NAME_SHOW$6);\n    EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);\n  }\n  hide() {\n    if (isDisabled(this._element) || !this._isShown()) {\n      return;\n    }\n    const relatedTarget = {\n      relatedTarget: this._element\n    };\n    this._completeHide(relatedTarget);\n  }\n  dispose() {\n    if (this._popper) {\n      this._popper.destroy();\n    }\n    super.dispose();\n  }\n  update() {\n    this._inNavbar = this._detectNavbar();\n    if (this._popper) {\n      this._popper.update();\n    }\n  }\n\n  // Private\n  _completeHide(relatedTarget) {\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);\n    if (hideEvent.defaultPrevented) {\n      return;\n    }\n\n    // If this is a touch-enabled device we remove the extra\n    // empty mouseover listeners we added for iOS support\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.off(element, 'mouseover', noop);\n      }\n    }\n    if (this._popper) {\n      this._popper.destroy();\n    }\n    this._menu.classList.remove(CLASS_NAME_SHOW$6);\n    this._element.classList.remove(CLASS_NAME_SHOW$6);\n    this._element.setAttribute('aria-expanded', 'false');\n    Manipulator.removeDataAttribute(this._menu, 'popper');\n    EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget);\n  }\n  _getConfig(config) {\n    config = super._getConfig(config);\n    if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {\n      // Popper virtual elements require a getBoundingClientRect method\n      throw new TypeError(`${NAME$a.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`);\n    }\n    return config;\n  }\n  _createPopper() {\n    if (typeof _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ === 'undefined') {\n      throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)');\n    }\n    let referenceElement = this._element;\n    if (this._config.reference === 'parent') {\n      referenceElement = this._parent;\n    } else if (isElement(this._config.reference)) {\n      referenceElement = getElement(this._config.reference);\n    } else if (typeof this._config.reference === 'object') {\n      referenceElement = this._config.reference;\n    }\n    const popperConfig = this._getPopperConfig();\n    this._popper = _popperjs_core__WEBPACK_IMPORTED_MODULE_1__.createPopper(referenceElement, this._menu, popperConfig);\n  }\n  _isShown() {\n    return this._menu.classList.contains(CLASS_NAME_SHOW$6);\n  }\n  _getPlacement() {\n    const parentDropdown = this._parent;\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n      return PLACEMENT_RIGHT;\n    }\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n      return PLACEMENT_LEFT;\n    }\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n      return PLACEMENT_TOPCENTER;\n    }\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n      return PLACEMENT_BOTTOMCENTER;\n    }\n\n    // We need to trim the value because custom properties can also include spaces\n    const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n      return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;\n    }\n    return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;\n  }\n  _detectNavbar() {\n    return this._element.closest(SELECTOR_NAVBAR) !== null;\n  }\n  _getOffset() {\n    const {\n      offset\n    } = this._config;\n    if (typeof offset === 'string') {\n      return offset.split(',').map(value => Number.parseInt(value, 10));\n    }\n    if (typeof offset === 'function') {\n      return popperData => offset(popperData, this._element);\n    }\n    return offset;\n  }\n  _getPopperConfig() {\n    const defaultBsPopperConfig = {\n      placement: this._getPlacement(),\n      modifiers: [{\n        name: 'preventOverflow',\n        options: {\n          boundary: this._config.boundary\n        }\n      }, {\n        name: 'offset',\n        options: {\n          offset: this._getOffset()\n        }\n      }]\n    };\n\n    // Disable Popper if we have a static display or Dropdown is in Navbar\n    if (this._inNavbar || this._config.display === 'static') {\n      Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove\n      defaultBsPopperConfig.modifiers = [{\n        name: 'applyStyles',\n        enabled: false\n      }];\n    }\n    return {\n      ...defaultBsPopperConfig,\n      ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n    };\n  }\n  _selectMenuItem({\n    key,\n    target\n  }) {\n    const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element));\n    if (!items.length) {\n      return;\n    }\n\n    // if target isn't included in items (e.g. when expanding the dropdown)\n    // allow cycling to get the last item in case key equals ARROW_UP_KEY\n    getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus();\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Dropdown.getOrCreateInstance(this, config);\n      if (typeof config !== 'string') {\n        return;\n      }\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`);\n      }\n      data[config]();\n    });\n  }\n  static clearMenus(event) {\n    if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) {\n      return;\n    }\n    const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);\n    for (const toggle of openToggles) {\n      const context = Dropdown.getInstance(toggle);\n      if (!context || context._config.autoClose === false) {\n        continue;\n      }\n      const composedPath = event.composedPath();\n      const isMenuTarget = composedPath.includes(context._menu);\n      if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {\n        continue;\n      }\n\n      // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n      if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n        continue;\n      }\n      const relatedTarget = {\n        relatedTarget: context._element\n      };\n      if (event.type === 'click') {\n        relatedTarget.clickEvent = event;\n      }\n      context._completeHide(relatedTarget);\n    }\n  }\n  static dataApiKeydownHandler(event) {\n    // If not an UP | DOWN | ESCAPE key => not a dropdown command\n    // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n    const isInput = /input|textarea/i.test(event.target.tagName);\n    const isEscapeEvent = event.key === ESCAPE_KEY$2;\n    const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key);\n    if (!isUpOrDownEvent && !isEscapeEvent) {\n      return;\n    }\n    if (isInput && !isEscapeEvent) {\n      return;\n    }\n    event.preventDefault();\n\n    // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n    const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);\n    const instance = Dropdown.getOrCreateInstance(getToggleButton);\n    if (isUpOrDownEvent) {\n      event.stopPropagation();\n      instance.show();\n      instance._selectMenuItem(event);\n      return;\n    }\n    if (instance._isShown()) {\n      // else is escape and we check if it is shown\n      event.stopPropagation();\n      instance.hide();\n      getToggleButton.focus();\n    }\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler);\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);\nEventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus);\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);\nEventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {\n  event.preventDefault();\n  Dropdown.getOrCreateInstance(this).toggle();\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$9 = 'backdrop';\nconst CLASS_NAME_FADE$4 = 'fade';\nconst CLASS_NAME_SHOW$5 = 'show';\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`;\nconst Default$8 = {\n  className: 'modal-backdrop',\n  clickCallback: null,\n  isAnimated: false,\n  isVisible: true,\n  // if false, we use the backdrop helper without adding any element to the dom\n  rootElement: 'body' // give the choice to place backdrop under different elements\n};\n\nconst DefaultType$8 = {\n  className: 'string',\n  clickCallback: '(function|null)',\n  isAnimated: 'boolean',\n  isVisible: 'boolean',\n  rootElement: '(element|string)'\n};\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n  constructor(config) {\n    super();\n    this._config = this._getConfig(config);\n    this._isAppended = false;\n    this._element = null;\n  }\n\n  // Getters\n  static get Default() {\n    return Default$8;\n  }\n  static get DefaultType() {\n    return DefaultType$8;\n  }\n  static get NAME() {\n    return NAME$9;\n  }\n\n  // Public\n  show(callback) {\n    if (!this._config.isVisible) {\n      execute(callback);\n      return;\n    }\n    this._append();\n    const element = this._getElement();\n    if (this._config.isAnimated) {\n      reflow(element);\n    }\n    element.classList.add(CLASS_NAME_SHOW$5);\n    this._emulateAnimation(() => {\n      execute(callback);\n    });\n  }\n  hide(callback) {\n    if (!this._config.isVisible) {\n      execute(callback);\n      return;\n    }\n    this._getElement().classList.remove(CLASS_NAME_SHOW$5);\n    this._emulateAnimation(() => {\n      this.dispose();\n      execute(callback);\n    });\n  }\n  dispose() {\n    if (!this._isAppended) {\n      return;\n    }\n    EventHandler.off(this._element, EVENT_MOUSEDOWN);\n    this._element.remove();\n    this._isAppended = false;\n  }\n\n  // Private\n  _getElement() {\n    if (!this._element) {\n      const backdrop = document.createElement('div');\n      backdrop.className = this._config.className;\n      if (this._config.isAnimated) {\n        backdrop.classList.add(CLASS_NAME_FADE$4);\n      }\n      this._element = backdrop;\n    }\n    return this._element;\n  }\n  _configAfterMerge(config) {\n    // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n    config.rootElement = getElement(config.rootElement);\n    return config;\n  }\n  _append() {\n    if (this._isAppended) {\n      return;\n    }\n    const element = this._getElement();\n    this._config.rootElement.append(element);\n    EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n      execute(this._config.clickCallback);\n    });\n    this._isAppended = true;\n  }\n  _emulateAnimation(callback) {\n    executeAfterTransition(callback, this._getElement(), this._config.isAnimated);\n  }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$8 = 'focustrap';\nconst DATA_KEY$5 = 'bs.focustrap';\nconst EVENT_KEY$5 = `.${DATA_KEY$5}`;\nconst EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`;\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`;\nconst TAB_KEY = 'Tab';\nconst TAB_NAV_FORWARD = 'forward';\nconst TAB_NAV_BACKWARD = 'backward';\nconst Default$7 = {\n  autofocus: true,\n  trapElement: null // The element to trap focus inside of\n};\n\nconst DefaultType$7 = {\n  autofocus: 'boolean',\n  trapElement: 'element'\n};\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n  constructor(config) {\n    super();\n    this._config = this._getConfig(config);\n    this._isActive = false;\n    this._lastTabNavDirection = null;\n  }\n\n  // Getters\n  static get Default() {\n    return Default$7;\n  }\n  static get DefaultType() {\n    return DefaultType$7;\n  }\n  static get NAME() {\n    return NAME$8;\n  }\n\n  // Public\n  activate() {\n    if (this._isActive) {\n      return;\n    }\n    if (this._config.autofocus) {\n      this._config.trapElement.focus();\n    }\n    EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop\n    EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event));\n    EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));\n    this._isActive = true;\n  }\n  deactivate() {\n    if (!this._isActive) {\n      return;\n    }\n    this._isActive = false;\n    EventHandler.off(document, EVENT_KEY$5);\n  }\n\n  // Private\n  _handleFocusin(event) {\n    const {\n      trapElement\n    } = this._config;\n    if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n      return;\n    }\n    const elements = SelectorEngine.focusableChildren(trapElement);\n    if (elements.length === 0) {\n      trapElement.focus();\n    } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n      elements[elements.length - 1].focus();\n    } else {\n      elements[0].focus();\n    }\n  }\n  _handleKeydown(event) {\n    if (event.key !== TAB_KEY) {\n      return;\n    }\n    this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;\n  }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';\nconst SELECTOR_STICKY_CONTENT = '.sticky-top';\nconst PROPERTY_PADDING = 'padding-right';\nconst PROPERTY_MARGIN = 'margin-right';\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n  constructor() {\n    this._element = document.body;\n  }\n\n  // Public\n  getWidth() {\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n    const documentWidth = document.documentElement.clientWidth;\n    return Math.abs(window.innerWidth - documentWidth);\n  }\n  hide() {\n    const width = this.getWidth();\n    this._disableOverFlow();\n    // give padding to element to balance the hidden scrollbar width\n    this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);\n    // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n    this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);\n    this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);\n  }\n  reset() {\n    this._resetElementAttributes(this._element, 'overflow');\n    this._resetElementAttributes(this._element, PROPERTY_PADDING);\n    this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);\n    this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);\n  }\n  isOverflowing() {\n    return this.getWidth() > 0;\n  }\n\n  // Private\n  _disableOverFlow() {\n    this._saveInitialAttribute(this._element, 'overflow');\n    this._element.style.overflow = 'hidden';\n  }\n  _setElementAttributes(selector, styleProperty, callback) {\n    const scrollbarWidth = this.getWidth();\n    const manipulationCallBack = element => {\n      if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n        return;\n      }\n      this._saveInitialAttribute(element, styleProperty);\n      const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);\n      element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);\n    };\n    this._applyManipulationCallback(selector, manipulationCallBack);\n  }\n  _saveInitialAttribute(element, styleProperty) {\n    const actualValue = element.style.getPropertyValue(styleProperty);\n    if (actualValue) {\n      Manipulator.setDataAttribute(element, styleProperty, actualValue);\n    }\n  }\n  _resetElementAttributes(selector, styleProperty) {\n    const manipulationCallBack = element => {\n      const value = Manipulator.getDataAttribute(element, styleProperty);\n      // We only want to remove the property if the value is `null`; the value can also be zero\n      if (value === null) {\n        element.style.removeProperty(styleProperty);\n        return;\n      }\n      Manipulator.removeDataAttribute(element, styleProperty);\n      element.style.setProperty(styleProperty, value);\n    };\n    this._applyManipulationCallback(selector, manipulationCallBack);\n  }\n  _applyManipulationCallback(selector, callBack) {\n    if (isElement(selector)) {\n      callBack(selector);\n      return;\n    }\n    for (const sel of SelectorEngine.find(selector, this._element)) {\n      callBack(sel);\n    }\n  }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$7 = 'modal';\nconst DATA_KEY$4 = 'bs.modal';\nconst EVENT_KEY$4 = `.${DATA_KEY$4}`;\nconst DATA_API_KEY$2 = '.data-api';\nconst ESCAPE_KEY$1 = 'Escape';\nconst EVENT_HIDE$4 = `hide${EVENT_KEY$4}`;\nconst EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`;\nconst EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`;\nconst EVENT_SHOW$4 = `show${EVENT_KEY$4}`;\nconst EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`;\nconst EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`;\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`;\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`;\nconst EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`;\nconst EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`;\nconst CLASS_NAME_OPEN = 'modal-open';\nconst CLASS_NAME_FADE$3 = 'fade';\nconst CLASS_NAME_SHOW$4 = 'show';\nconst CLASS_NAME_STATIC = 'modal-static';\nconst OPEN_SELECTOR$1 = '.modal.show';\nconst SELECTOR_DIALOG = '.modal-dialog';\nconst SELECTOR_MODAL_BODY = '.modal-body';\nconst SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle=\"modal\"]';\nconst Default$6 = {\n  backdrop: true,\n  focus: true,\n  keyboard: true\n};\nconst DefaultType$6 = {\n  backdrop: '(boolean|string)',\n  focus: 'boolean',\n  keyboard: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n  constructor(element, config) {\n    super(element, config);\n    this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);\n    this._backdrop = this._initializeBackDrop();\n    this._focustrap = this._initializeFocusTrap();\n    this._isShown = false;\n    this._isTransitioning = false;\n    this._scrollBar = new ScrollBarHelper();\n    this._addEventListeners();\n  }\n\n  // Getters\n  static get Default() {\n    return Default$6;\n  }\n  static get DefaultType() {\n    return DefaultType$6;\n  }\n  static get NAME() {\n    return NAME$7;\n  }\n\n  // Public\n  toggle(relatedTarget) {\n    return this._isShown ? this.hide() : this.show(relatedTarget);\n  }\n  show(relatedTarget) {\n    if (this._isShown || this._isTransitioning) {\n      return;\n    }\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, {\n      relatedTarget\n    });\n    if (showEvent.defaultPrevented) {\n      return;\n    }\n    this._isShown = true;\n    this._isTransitioning = true;\n    this._scrollBar.hide();\n    document.body.classList.add(CLASS_NAME_OPEN);\n    this._adjustDialog();\n    this._backdrop.show(() => this._showElement(relatedTarget));\n  }\n  hide() {\n    if (!this._isShown || this._isTransitioning) {\n      return;\n    }\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);\n    if (hideEvent.defaultPrevented) {\n      return;\n    }\n    this._isShown = false;\n    this._isTransitioning = true;\n    this._focustrap.deactivate();\n    this._element.classList.remove(CLASS_NAME_SHOW$4);\n    this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());\n  }\n  dispose() {\n    EventHandler.off(window, EVENT_KEY$4);\n    EventHandler.off(this._dialog, EVENT_KEY$4);\n    this._backdrop.dispose();\n    this._focustrap.deactivate();\n    super.dispose();\n  }\n  handleUpdate() {\n    this._adjustDialog();\n  }\n\n  // Private\n  _initializeBackDrop() {\n    return new Backdrop({\n      isVisible: Boolean(this._config.backdrop),\n      // 'static' option will be translated to true, and booleans will keep their value,\n      isAnimated: this._isAnimated()\n    });\n  }\n  _initializeFocusTrap() {\n    return new FocusTrap({\n      trapElement: this._element\n    });\n  }\n  _showElement(relatedTarget) {\n    // try to append dynamic modal\n    if (!document.body.contains(this._element)) {\n      document.body.append(this._element);\n    }\n    this._element.style.display = 'block';\n    this._element.removeAttribute('aria-hidden');\n    this._element.setAttribute('aria-modal', true);\n    this._element.setAttribute('role', 'dialog');\n    this._element.scrollTop = 0;\n    const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);\n    if (modalBody) {\n      modalBody.scrollTop = 0;\n    }\n    reflow(this._element);\n    this._element.classList.add(CLASS_NAME_SHOW$4);\n    const transitionComplete = () => {\n      if (this._config.focus) {\n        this._focustrap.activate();\n      }\n      this._isTransitioning = false;\n      EventHandler.trigger(this._element, EVENT_SHOWN$4, {\n        relatedTarget\n      });\n    };\n    this._queueCallback(transitionComplete, this._dialog, this._isAnimated());\n  }\n  _addEventListeners() {\n    EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {\n      if (event.key !== ESCAPE_KEY$1) {\n        return;\n      }\n      if (this._config.keyboard) {\n        this.hide();\n        return;\n      }\n      this._triggerBackdropTransition();\n    });\n    EventHandler.on(window, EVENT_RESIZE$1, () => {\n      if (this._isShown && !this._isTransitioning) {\n        this._adjustDialog();\n      }\n    });\n    EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n      // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n      EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n        if (this._element !== event.target || this._element !== event2.target) {\n          return;\n        }\n        if (this._config.backdrop === 'static') {\n          this._triggerBackdropTransition();\n          return;\n        }\n        if (this._config.backdrop) {\n          this.hide();\n        }\n      });\n    });\n  }\n  _hideModal() {\n    this._element.style.display = 'none';\n    this._element.setAttribute('aria-hidden', true);\n    this._element.removeAttribute('aria-modal');\n    this._element.removeAttribute('role');\n    this._isTransitioning = false;\n    this._backdrop.hide(() => {\n      document.body.classList.remove(CLASS_NAME_OPEN);\n      this._resetAdjustments();\n      this._scrollBar.reset();\n      EventHandler.trigger(this._element, EVENT_HIDDEN$4);\n    });\n  }\n  _isAnimated() {\n    return this._element.classList.contains(CLASS_NAME_FADE$3);\n  }\n  _triggerBackdropTransition() {\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1);\n    if (hideEvent.defaultPrevented) {\n      return;\n    }\n    const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n    const initialOverflowY = this._element.style.overflowY;\n    // return if the following background transition hasn't yet completed\n    if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n      return;\n    }\n    if (!isModalOverflowing) {\n      this._element.style.overflowY = 'hidden';\n    }\n    this._element.classList.add(CLASS_NAME_STATIC);\n    this._queueCallback(() => {\n      this._element.classList.remove(CLASS_NAME_STATIC);\n      this._queueCallback(() => {\n        this._element.style.overflowY = initialOverflowY;\n      }, this._dialog);\n    }, this._dialog);\n    this._element.focus();\n  }\n\n  /**\n   * The following methods are used to handle overflowing modals\n   */\n\n  _adjustDialog() {\n    const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n    const scrollbarWidth = this._scrollBar.getWidth();\n    const isBodyOverflowing = scrollbarWidth > 0;\n    if (isBodyOverflowing && !isModalOverflowing) {\n      const property = isRTL() ? 'paddingLeft' : 'paddingRight';\n      this._element.style[property] = `${scrollbarWidth}px`;\n    }\n    if (!isBodyOverflowing && isModalOverflowing) {\n      const property = isRTL() ? 'paddingRight' : 'paddingLeft';\n      this._element.style[property] = `${scrollbarWidth}px`;\n    }\n  }\n  _resetAdjustments() {\n    this._element.style.paddingLeft = '';\n    this._element.style.paddingRight = '';\n  }\n\n  // Static\n  static jQueryInterface(config, relatedTarget) {\n    return this.each(function () {\n      const data = Modal.getOrCreateInstance(this, config);\n      if (typeof config !== 'string') {\n        return;\n      }\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`);\n      }\n      data[config](relatedTarget);\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this);\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault();\n  }\n  EventHandler.one(target, EVENT_SHOW$4, showEvent => {\n    if (showEvent.defaultPrevented) {\n      // only register focus restorer if modal will actually get shown\n      return;\n    }\n    EventHandler.one(target, EVENT_HIDDEN$4, () => {\n      if (isVisible(this)) {\n        this.focus();\n      }\n    });\n  });\n\n  // avoid conflict when clicking modal toggler while another one is open\n  const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);\n  if (alreadyOpen) {\n    Modal.getInstance(alreadyOpen).hide();\n  }\n  const data = Modal.getOrCreateInstance(target);\n  data.toggle(this);\n});\nenableDismissTrigger(Modal);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$6 = 'offcanvas';\nconst DATA_KEY$3 = 'bs.offcanvas';\nconst EVENT_KEY$3 = `.${DATA_KEY$3}`;\nconst DATA_API_KEY$1 = '.data-api';\nconst EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`;\nconst ESCAPE_KEY = 'Escape';\nconst CLASS_NAME_SHOW$3 = 'show';\nconst CLASS_NAME_SHOWING$1 = 'showing';\nconst CLASS_NAME_HIDING = 'hiding';\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop';\nconst OPEN_SELECTOR = '.offcanvas.show';\nconst EVENT_SHOW$3 = `show${EVENT_KEY$3}`;\nconst EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`;\nconst EVENT_HIDE$3 = `hide${EVENT_KEY$3}`;\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`;\nconst EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`;\nconst EVENT_RESIZE = `resize${EVENT_KEY$3}`;\nconst EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`;\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`;\nconst SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle=\"offcanvas\"]';\nconst Default$5 = {\n  backdrop: true,\n  keyboard: true,\n  scroll: false\n};\nconst DefaultType$5 = {\n  backdrop: '(boolean|string)',\n  keyboard: 'boolean',\n  scroll: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n  constructor(element, config) {\n    super(element, config);\n    this._isShown = false;\n    this._backdrop = this._initializeBackDrop();\n    this._focustrap = this._initializeFocusTrap();\n    this._addEventListeners();\n  }\n\n  // Getters\n  static get Default() {\n    return Default$5;\n  }\n  static get DefaultType() {\n    return DefaultType$5;\n  }\n  static get NAME() {\n    return NAME$6;\n  }\n\n  // Public\n  toggle(relatedTarget) {\n    return this._isShown ? this.hide() : this.show(relatedTarget);\n  }\n  show(relatedTarget) {\n    if (this._isShown) {\n      return;\n    }\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {\n      relatedTarget\n    });\n    if (showEvent.defaultPrevented) {\n      return;\n    }\n    this._isShown = true;\n    this._backdrop.show();\n    if (!this._config.scroll) {\n      new ScrollBarHelper().hide();\n    }\n    this._element.setAttribute('aria-modal', true);\n    this._element.setAttribute('role', 'dialog');\n    this._element.classList.add(CLASS_NAME_SHOWING$1);\n    const completeCallBack = () => {\n      if (!this._config.scroll || this._config.backdrop) {\n        this._focustrap.activate();\n      }\n      this._element.classList.add(CLASS_NAME_SHOW$3);\n      this._element.classList.remove(CLASS_NAME_SHOWING$1);\n      EventHandler.trigger(this._element, EVENT_SHOWN$3, {\n        relatedTarget\n      });\n    };\n    this._queueCallback(completeCallBack, this._element, true);\n  }\n  hide() {\n    if (!this._isShown) {\n      return;\n    }\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);\n    if (hideEvent.defaultPrevented) {\n      return;\n    }\n    this._focustrap.deactivate();\n    this._element.blur();\n    this._isShown = false;\n    this._element.classList.add(CLASS_NAME_HIDING);\n    this._backdrop.hide();\n    const completeCallback = () => {\n      this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING);\n      this._element.removeAttribute('aria-modal');\n      this._element.removeAttribute('role');\n      if (!this._config.scroll) {\n        new ScrollBarHelper().reset();\n      }\n      EventHandler.trigger(this._element, EVENT_HIDDEN$3);\n    };\n    this._queueCallback(completeCallback, this._element, true);\n  }\n  dispose() {\n    this._backdrop.dispose();\n    this._focustrap.deactivate();\n    super.dispose();\n  }\n\n  // Private\n  _initializeBackDrop() {\n    const clickCallback = () => {\n      if (this._config.backdrop === 'static') {\n        EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n        return;\n      }\n      this.hide();\n    };\n\n    // 'static' option will be translated to true, and booleans will keep their value\n    const isVisible = Boolean(this._config.backdrop);\n    return new Backdrop({\n      className: CLASS_NAME_BACKDROP,\n      isVisible,\n      isAnimated: true,\n      rootElement: this._element.parentNode,\n      clickCallback: isVisible ? clickCallback : null\n    });\n  }\n  _initializeFocusTrap() {\n    return new FocusTrap({\n      trapElement: this._element\n    });\n  }\n  _addEventListeners() {\n    EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n      if (event.key !== ESCAPE_KEY) {\n        return;\n      }\n      if (this._config.keyboard) {\n        this.hide();\n        return;\n      }\n      EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n    });\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Offcanvas.getOrCreateInstance(this, config);\n      if (typeof config !== 'string') {\n        return;\n      }\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`);\n      }\n      data[config](this);\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this);\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault();\n  }\n  if (isDisabled(this)) {\n    return;\n  }\n  EventHandler.one(target, EVENT_HIDDEN$3, () => {\n    // focus on trigger when it is closed\n    if (isVisible(this)) {\n      this.focus();\n    }\n  });\n\n  // avoid conflict when clicking a toggler of an offcanvas, while another is open\n  const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);\n  if (alreadyOpen && alreadyOpen !== target) {\n    Offcanvas.getInstance(alreadyOpen).hide();\n  }\n  const data = Offcanvas.getOrCreateInstance(target);\n  data.toggle(this);\n});\nEventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {\n  for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n    Offcanvas.getOrCreateInstance(selector).show();\n  }\n});\nEventHandler.on(window, EVENT_RESIZE, () => {\n  for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n    if (getComputedStyle(element).position !== 'fixed') {\n      Offcanvas.getOrCreateInstance(element).hide();\n    }\n  }\n});\nenableDismissTrigger(Offcanvas);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\nconst DefaultAllowlist = {\n  // Global attributes allowed on any supplied element below.\n  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n  a: ['target', 'href', 'title', 'rel'],\n  area: [],\n  b: [],\n  br: [],\n  col: [],\n  code: [],\n  div: [],\n  em: [],\n  hr: [],\n  h1: [],\n  h2: [],\n  h3: [],\n  h4: [],\n  h5: [],\n  h6: [],\n  i: [],\n  img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n  li: [],\n  ol: [],\n  p: [],\n  pre: [],\n  s: [],\n  small: [],\n  span: [],\n  sub: [],\n  sup: [],\n  strong: [],\n  u: [],\n  ul: []\n};\n// js-docs-end allow-list\n\nconst uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\n// eslint-disable-next-line unicorn/better-regex\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n  const attributeName = attribute.nodeName.toLowerCase();\n  if (allowedAttributeList.includes(attributeName)) {\n    if (uriAttributes.has(attributeName)) {\n      return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));\n    }\n    return true;\n  }\n\n  // Check if a regular expression validates the attribute.\n  return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));\n};\nfunction sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n  if (!unsafeHtml.length) {\n    return unsafeHtml;\n  }\n  if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n    return sanitizeFunction(unsafeHtml);\n  }\n  const domParser = new window.DOMParser();\n  const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n  const elements = [].concat(...createdDocument.body.querySelectorAll('*'));\n  for (const element of elements) {\n    const elementName = element.nodeName.toLowerCase();\n    if (!Object.keys(allowList).includes(elementName)) {\n      element.remove();\n      continue;\n    }\n    const attributeList = [].concat(...element.attributes);\n    const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);\n    for (const attribute of attributeList) {\n      if (!allowedAttribute(attribute, allowedAttributes)) {\n        element.removeAttribute(attribute.nodeName);\n      }\n    }\n  }\n  return createdDocument.body.innerHTML;\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$5 = 'TemplateFactory';\nconst Default$4 = {\n  allowList: DefaultAllowlist,\n  content: {},\n  // { selector : text ,  selector2 : text2 , }\n  extraClass: '',\n  html: false,\n  sanitize: true,\n  sanitizeFn: null,\n  template: '<div></div>'\n};\nconst DefaultType$4 = {\n  allowList: 'object',\n  content: 'object',\n  extraClass: '(string|function)',\n  html: 'boolean',\n  sanitize: 'boolean',\n  sanitizeFn: '(null|function)',\n  template: 'string'\n};\nconst DefaultContentType = {\n  entry: '(string|element|function|null)',\n  selector: '(string|element)'\n};\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n  constructor(config) {\n    super();\n    this._config = this._getConfig(config);\n  }\n\n  // Getters\n  static get Default() {\n    return Default$4;\n  }\n  static get DefaultType() {\n    return DefaultType$4;\n  }\n  static get NAME() {\n    return NAME$5;\n  }\n\n  // Public\n  getContent() {\n    return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean);\n  }\n  hasContent() {\n    return this.getContent().length > 0;\n  }\n  changeContent(content) {\n    this._checkContent(content);\n    this._config.content = {\n      ...this._config.content,\n      ...content\n    };\n    return this;\n  }\n  toHtml() {\n    const templateWrapper = document.createElement('div');\n    templateWrapper.innerHTML = this._maybeSanitize(this._config.template);\n    for (const [selector, text] of Object.entries(this._config.content)) {\n      this._setContent(templateWrapper, text, selector);\n    }\n    const template = templateWrapper.children[0];\n    const extraClass = this._resolvePossibleFunction(this._config.extraClass);\n    if (extraClass) {\n      template.classList.add(...extraClass.split(' '));\n    }\n    return template;\n  }\n\n  // Private\n  _typeCheckConfig(config) {\n    super._typeCheckConfig(config);\n    this._checkContent(config.content);\n  }\n  _checkContent(arg) {\n    for (const [selector, content] of Object.entries(arg)) {\n      super._typeCheckConfig({\n        selector,\n        entry: content\n      }, DefaultContentType);\n    }\n  }\n  _setContent(template, content, selector) {\n    const templateElement = SelectorEngine.findOne(selector, template);\n    if (!templateElement) {\n      return;\n    }\n    content = this._resolvePossibleFunction(content);\n    if (!content) {\n      templateElement.remove();\n      return;\n    }\n    if (isElement(content)) {\n      this._putElementInTemplate(getElement(content), templateElement);\n      return;\n    }\n    if (this._config.html) {\n      templateElement.innerHTML = this._maybeSanitize(content);\n      return;\n    }\n    templateElement.textContent = content;\n  }\n  _maybeSanitize(arg) {\n    return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;\n  }\n  _resolvePossibleFunction(arg) {\n    return execute(arg, [this]);\n  }\n  _putElementInTemplate(element, templateElement) {\n    if (this._config.html) {\n      templateElement.innerHTML = '';\n      templateElement.append(element);\n      return;\n    }\n    templateElement.textContent = element.textContent;\n  }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$4 = 'tooltip';\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);\nconst CLASS_NAME_FADE$2 = 'fade';\nconst CLASS_NAME_MODAL = 'modal';\nconst CLASS_NAME_SHOW$2 = 'show';\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner';\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;\nconst EVENT_MODAL_HIDE = 'hide.bs.modal';\nconst TRIGGER_HOVER = 'hover';\nconst TRIGGER_FOCUS = 'focus';\nconst TRIGGER_CLICK = 'click';\nconst TRIGGER_MANUAL = 'manual';\nconst EVENT_HIDE$2 = 'hide';\nconst EVENT_HIDDEN$2 = 'hidden';\nconst EVENT_SHOW$2 = 'show';\nconst EVENT_SHOWN$2 = 'shown';\nconst EVENT_INSERTED = 'inserted';\nconst EVENT_CLICK$1 = 'click';\nconst EVENT_FOCUSIN$1 = 'focusin';\nconst EVENT_FOCUSOUT$1 = 'focusout';\nconst EVENT_MOUSEENTER = 'mouseenter';\nconst EVENT_MOUSELEAVE = 'mouseleave';\nconst AttachmentMap = {\n  AUTO: 'auto',\n  TOP: 'top',\n  RIGHT: isRTL() ? 'left' : 'right',\n  BOTTOM: 'bottom',\n  LEFT: isRTL() ? 'right' : 'left'\n};\nconst Default$3 = {\n  allowList: DefaultAllowlist,\n  animation: true,\n  boundary: 'clippingParents',\n  container: false,\n  customClass: '',\n  delay: 0,\n  fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n  html: false,\n  offset: [0, 6],\n  placement: 'top',\n  popperConfig: null,\n  sanitize: true,\n  sanitizeFn: null,\n  selector: false,\n  template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"tooltip-arrow\"></div>' + '<div class=\"tooltip-inner\"></div>' + '</div>',\n  title: '',\n  trigger: 'hover focus'\n};\nconst DefaultType$3 = {\n  allowList: 'object',\n  animation: 'boolean',\n  boundary: '(string|element)',\n  container: '(string|element|boolean)',\n  customClass: '(string|function)',\n  delay: '(number|object)',\n  fallbackPlacements: 'array',\n  html: 'boolean',\n  offset: '(array|string|function)',\n  placement: '(string|function)',\n  popperConfig: '(null|object|function)',\n  sanitize: 'boolean',\n  sanitizeFn: '(null|function)',\n  selector: '(string|boolean)',\n  template: 'string',\n  title: '(string|element|function)',\n  trigger: 'string'\n};\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n  constructor(element, config) {\n    if (typeof _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ === 'undefined') {\n      throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)');\n    }\n    super(element, config);\n\n    // Private\n    this._isEnabled = true;\n    this._timeout = 0;\n    this._isHovered = null;\n    this._activeTrigger = {};\n    this._popper = null;\n    this._templateFactory = null;\n    this._newContent = null;\n\n    // Protected\n    this.tip = null;\n    this._setListeners();\n    if (!this._config.selector) {\n      this._fixTitle();\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default$3;\n  }\n  static get DefaultType() {\n    return DefaultType$3;\n  }\n  static get NAME() {\n    return NAME$4;\n  }\n\n  // Public\n  enable() {\n    this._isEnabled = true;\n  }\n  disable() {\n    this._isEnabled = false;\n  }\n  toggleEnabled() {\n    this._isEnabled = !this._isEnabled;\n  }\n  toggle() {\n    if (!this._isEnabled) {\n      return;\n    }\n    this._activeTrigger.click = !this._activeTrigger.click;\n    if (this._isShown()) {\n      this._leave();\n      return;\n    }\n    this._enter();\n  }\n  dispose() {\n    clearTimeout(this._timeout);\n    EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n    if (this._element.getAttribute('data-bs-original-title')) {\n      this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));\n    }\n    this._disposePopper();\n    super.dispose();\n  }\n  show() {\n    if (this._element.style.display === 'none') {\n      throw new Error('Please use show on visible elements');\n    }\n    if (!(this._isWithContent() && this._isEnabled)) {\n      return;\n    }\n    const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2));\n    const shadowRoot = findShadowRoot(this._element);\n    const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);\n    if (showEvent.defaultPrevented || !isInTheDom) {\n      return;\n    }\n\n    // TODO: v6 remove this or make it optional\n    this._disposePopper();\n    const tip = this._getTipElement();\n    this._element.setAttribute('aria-describedby', tip.getAttribute('id'));\n    const {\n      container\n    } = this._config;\n    if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n      container.append(tip);\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED));\n    }\n    this._popper = this._createPopper(tip);\n    tip.classList.add(CLASS_NAME_SHOW$2);\n\n    // If this is a touch-enabled device we add extra\n    // empty mouseover listeners to the body's immediate children;\n    // only needed because of broken event delegation on iOS\n    // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.on(element, 'mouseover', noop);\n      }\n    }\n    const complete = () => {\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2));\n      if (this._isHovered === false) {\n        this._leave();\n      }\n      this._isHovered = false;\n    };\n    this._queueCallback(complete, this.tip, this._isAnimated());\n  }\n  hide() {\n    if (!this._isShown()) {\n      return;\n    }\n    const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2));\n    if (hideEvent.defaultPrevented) {\n      return;\n    }\n    const tip = this._getTipElement();\n    tip.classList.remove(CLASS_NAME_SHOW$2);\n\n    // If this is a touch-enabled device we remove the extra\n    // empty mouseover listeners we added for iOS support\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.off(element, 'mouseover', noop);\n      }\n    }\n    this._activeTrigger[TRIGGER_CLICK] = false;\n    this._activeTrigger[TRIGGER_FOCUS] = false;\n    this._activeTrigger[TRIGGER_HOVER] = false;\n    this._isHovered = null; // it is a trick to support manual triggering\n\n    const complete = () => {\n      if (this._isWithActiveTrigger()) {\n        return;\n      }\n      if (!this._isHovered) {\n        this._disposePopper();\n      }\n      this._element.removeAttribute('aria-describedby');\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2));\n    };\n    this._queueCallback(complete, this.tip, this._isAnimated());\n  }\n  update() {\n    if (this._popper) {\n      this._popper.update();\n    }\n  }\n\n  // Protected\n  _isWithContent() {\n    return Boolean(this._getTitle());\n  }\n  _getTipElement() {\n    if (!this.tip) {\n      this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());\n    }\n    return this.tip;\n  }\n  _createTipElement(content) {\n    const tip = this._getTemplateFactory(content).toHtml();\n\n    // TODO: remove this check in v6\n    if (!tip) {\n      return null;\n    }\n    tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);\n    // TODO: v6 the following can be achieved with CSS only\n    tip.classList.add(`bs-${this.constructor.NAME}-auto`);\n    const tipId = getUID(this.constructor.NAME).toString();\n    tip.setAttribute('id', tipId);\n    if (this._isAnimated()) {\n      tip.classList.add(CLASS_NAME_FADE$2);\n    }\n    return tip;\n  }\n  setContent(content) {\n    this._newContent = content;\n    if (this._isShown()) {\n      this._disposePopper();\n      this.show();\n    }\n  }\n  _getTemplateFactory(content) {\n    if (this._templateFactory) {\n      this._templateFactory.changeContent(content);\n    } else {\n      this._templateFactory = new TemplateFactory({\n        ...this._config,\n        // the `content` var has to be after `this._config`\n        // to override config.content in case of popover\n        content,\n        extraClass: this._resolvePossibleFunction(this._config.customClass)\n      });\n    }\n    return this._templateFactory;\n  }\n  _getContentForTemplate() {\n    return {\n      [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n    };\n  }\n  _getTitle() {\n    return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title');\n  }\n\n  // Private\n  _initializeOnDelegatedTarget(event) {\n    return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());\n  }\n  _isAnimated() {\n    return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2);\n  }\n  _isShown() {\n    return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2);\n  }\n  _createPopper(tip) {\n    const placement = execute(this._config.placement, [this, tip, this._element]);\n    const attachment = AttachmentMap[placement.toUpperCase()];\n    return _popperjs_core__WEBPACK_IMPORTED_MODULE_1__.createPopper(this._element, tip, this._getPopperConfig(attachment));\n  }\n  _getOffset() {\n    const {\n      offset\n    } = this._config;\n    if (typeof offset === 'string') {\n      return offset.split(',').map(value => Number.parseInt(value, 10));\n    }\n    if (typeof offset === 'function') {\n      return popperData => offset(popperData, this._element);\n    }\n    return offset;\n  }\n  _resolvePossibleFunction(arg) {\n    return execute(arg, [this._element]);\n  }\n  _getPopperConfig(attachment) {\n    const defaultBsPopperConfig = {\n      placement: attachment,\n      modifiers: [{\n        name: 'flip',\n        options: {\n          fallbackPlacements: this._config.fallbackPlacements\n        }\n      }, {\n        name: 'offset',\n        options: {\n          offset: this._getOffset()\n        }\n      }, {\n        name: 'preventOverflow',\n        options: {\n          boundary: this._config.boundary\n        }\n      }, {\n        name: 'arrow',\n        options: {\n          element: `.${this.constructor.NAME}-arrow`\n        }\n      }, {\n        name: 'preSetPlacement',\n        enabled: true,\n        phase: 'beforeMain',\n        fn: data => {\n          // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n          // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n          this._getTipElement().setAttribute('data-popper-placement', data.state.placement);\n        }\n      }]\n    };\n    return {\n      ...defaultBsPopperConfig,\n      ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n    };\n  }\n  _setListeners() {\n    const triggers = this._config.trigger.split(' ');\n    for (const trigger of triggers) {\n      if (trigger === 'click') {\n        EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event);\n          context.toggle();\n        });\n      } else if (trigger !== TRIGGER_MANUAL) {\n        const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1);\n        const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1);\n        EventHandler.on(this._element, eventIn, this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event);\n          context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;\n          context._enter();\n        });\n        EventHandler.on(this._element, eventOut, this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event);\n          context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);\n          context._leave();\n        });\n      }\n    }\n    this._hideModalHandler = () => {\n      if (this._element) {\n        this.hide();\n      }\n    };\n    EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n  }\n  _fixTitle() {\n    const title = this._element.getAttribute('title');\n    if (!title) {\n      return;\n    }\n    if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n      this._element.setAttribute('aria-label', title);\n    }\n    this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility\n    this._element.removeAttribute('title');\n  }\n  _enter() {\n    if (this._isShown() || this._isHovered) {\n      this._isHovered = true;\n      return;\n    }\n    this._isHovered = true;\n    this._setTimeout(() => {\n      if (this._isHovered) {\n        this.show();\n      }\n    }, this._config.delay.show);\n  }\n  _leave() {\n    if (this._isWithActiveTrigger()) {\n      return;\n    }\n    this._isHovered = false;\n    this._setTimeout(() => {\n      if (!this._isHovered) {\n        this.hide();\n      }\n    }, this._config.delay.hide);\n  }\n  _setTimeout(handler, timeout) {\n    clearTimeout(this._timeout);\n    this._timeout = setTimeout(handler, timeout);\n  }\n  _isWithActiveTrigger() {\n    return Object.values(this._activeTrigger).includes(true);\n  }\n  _getConfig(config) {\n    const dataAttributes = Manipulator.getDataAttributes(this._element);\n    for (const dataAttribute of Object.keys(dataAttributes)) {\n      if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n        delete dataAttributes[dataAttribute];\n      }\n    }\n    config = {\n      ...dataAttributes,\n      ...(typeof config === 'object' && config ? config : {})\n    };\n    config = this._mergeConfigObj(config);\n    config = this._configAfterMerge(config);\n    this._typeCheckConfig(config);\n    return config;\n  }\n  _configAfterMerge(config) {\n    config.container = config.container === false ? document.body : getElement(config.container);\n    if (typeof config.delay === 'number') {\n      config.delay = {\n        show: config.delay,\n        hide: config.delay\n      };\n    }\n    if (typeof config.title === 'number') {\n      config.title = config.title.toString();\n    }\n    if (typeof config.content === 'number') {\n      config.content = config.content.toString();\n    }\n    return config;\n  }\n  _getDelegateConfig() {\n    const config = {};\n    for (const [key, value] of Object.entries(this._config)) {\n      if (this.constructor.Default[key] !== value) {\n        config[key] = value;\n      }\n    }\n    config.selector = false;\n    config.trigger = 'manual';\n\n    // In the future can be replaced with:\n    // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n    // `Object.fromEntries(keysWithDifferentValues)`\n    return config;\n  }\n  _disposePopper() {\n    if (this._popper) {\n      this._popper.destroy();\n      this._popper = null;\n    }\n    if (this.tip) {\n      this.tip.remove();\n      this.tip = null;\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tooltip.getOrCreateInstance(this, config);\n      if (typeof config !== 'string') {\n        return;\n      }\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`);\n      }\n      data[config]();\n    });\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$3 = 'popover';\nconst SELECTOR_TITLE = '.popover-header';\nconst SELECTOR_CONTENT = '.popover-body';\nconst Default$2 = {\n  ...Tooltip.Default,\n  content: '',\n  offset: [0, 8],\n  placement: 'right',\n  template: '<div class=\"popover\" role=\"tooltip\">' + '<div class=\"popover-arrow\"></div>' + '<h3 class=\"popover-header\"></h3>' + '<div class=\"popover-body\"></div>' + '</div>',\n  trigger: 'click'\n};\nconst DefaultType$2 = {\n  ...Tooltip.DefaultType,\n  content: '(null|string|element|function)'\n};\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n  // Getters\n  static get Default() {\n    return Default$2;\n  }\n  static get DefaultType() {\n    return DefaultType$2;\n  }\n  static get NAME() {\n    return NAME$3;\n  }\n\n  // Overrides\n  _isWithContent() {\n    return this._getTitle() || this._getContent();\n  }\n\n  // Private\n  _getContentForTemplate() {\n    return {\n      [SELECTOR_TITLE]: this._getTitle(),\n      [SELECTOR_CONTENT]: this._getContent()\n    };\n  }\n  _getContent() {\n    return this._resolvePossibleFunction(this._config.content);\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Popover.getOrCreateInstance(this, config);\n      if (typeof config !== 'string') {\n        return;\n      }\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`);\n      }\n      data[config]();\n    });\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$2 = 'scrollspy';\nconst DATA_KEY$2 = 'bs.scrollspy';\nconst EVENT_KEY$2 = `.${DATA_KEY$2}`;\nconst DATA_API_KEY = '.data-api';\nconst EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;\nconst EVENT_CLICK = `click${EVENT_KEY$2}`;\nconst EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`;\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';\nconst CLASS_NAME_ACTIVE$1 = 'active';\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]';\nconst SELECTOR_TARGET_LINKS = '[href]';\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';\nconst SELECTOR_NAV_LINKS = '.nav-link';\nconst SELECTOR_NAV_ITEMS = '.nav-item';\nconst SELECTOR_LIST_ITEMS = '.list-group-item';\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`;\nconst SELECTOR_DROPDOWN = '.dropdown';\nconst SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';\nconst Default$1 = {\n  offset: null,\n  // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n  rootMargin: '0px 0px -25%',\n  smoothScroll: false,\n  target: null,\n  threshold: [0.1, 0.5, 1]\n};\nconst DefaultType$1 = {\n  offset: '(number|null)',\n  // TODO v6 @deprecated, keep it for backwards compatibility reasons\n  rootMargin: 'string',\n  smoothScroll: 'boolean',\n  target: 'element',\n  threshold: 'array'\n};\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n  constructor(element, config) {\n    super(element, config);\n\n    // this._element is the observablesContainer and config.target the menu links wrapper\n    this._targetLinks = new Map();\n    this._observableSections = new Map();\n    this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element;\n    this._activeTarget = null;\n    this._observer = null;\n    this._previousScrollData = {\n      visibleEntryTop: 0,\n      parentScrollTop: 0\n    };\n    this.refresh(); // initialize\n  }\n\n  // Getters\n  static get Default() {\n    return Default$1;\n  }\n  static get DefaultType() {\n    return DefaultType$1;\n  }\n  static get NAME() {\n    return NAME$2;\n  }\n\n  // Public\n  refresh() {\n    this._initializeTargetsAndObservables();\n    this._maybeEnableSmoothScroll();\n    if (this._observer) {\n      this._observer.disconnect();\n    } else {\n      this._observer = this._getNewObserver();\n    }\n    for (const section of this._observableSections.values()) {\n      this._observer.observe(section);\n    }\n  }\n  dispose() {\n    this._observer.disconnect();\n    super.dispose();\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n    config.target = getElement(config.target) || document.body;\n\n    // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n    config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;\n    if (typeof config.threshold === 'string') {\n      config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value));\n    }\n    return config;\n  }\n  _maybeEnableSmoothScroll() {\n    if (!this._config.smoothScroll) {\n      return;\n    }\n\n    // unregister any previous listeners\n    EventHandler.off(this._config.target, EVENT_CLICK);\n    EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n      const observableSection = this._observableSections.get(event.target.hash);\n      if (observableSection) {\n        event.preventDefault();\n        const root = this._rootElement || window;\n        const height = observableSection.offsetTop - this._element.offsetTop;\n        if (root.scrollTo) {\n          root.scrollTo({\n            top: height,\n            behavior: 'smooth'\n          });\n          return;\n        }\n\n        // Chrome 60 doesn't support `scrollTo`\n        root.scrollTop = height;\n      }\n    });\n  }\n  _getNewObserver() {\n    const options = {\n      root: this._rootElement,\n      threshold: this._config.threshold,\n      rootMargin: this._config.rootMargin\n    };\n    return new IntersectionObserver(entries => this._observerCallback(entries), options);\n  }\n\n  // The logic of selection\n  _observerCallback(entries) {\n    const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`);\n    const activate = entry => {\n      this._previousScrollData.visibleEntryTop = entry.target.offsetTop;\n      this._process(targetElement(entry));\n    };\n    const parentScrollTop = (this._rootElement || document.documentElement).scrollTop;\n    const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop;\n    this._previousScrollData.parentScrollTop = parentScrollTop;\n    for (const entry of entries) {\n      if (!entry.isIntersecting) {\n        this._activeTarget = null;\n        this._clearActiveClass(targetElement(entry));\n        continue;\n      }\n      const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop;\n      // if we are scrolling down, pick the bigger offsetTop\n      if (userScrollsDown && entryIsLowerThanPrevious) {\n        activate(entry);\n        // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n        if (!parentScrollTop) {\n          return;\n        }\n        continue;\n      }\n\n      // if we are scrolling up, pick the smallest offsetTop\n      if (!userScrollsDown && !entryIsLowerThanPrevious) {\n        activate(entry);\n      }\n    }\n  }\n  _initializeTargetsAndObservables() {\n    this._targetLinks = new Map();\n    this._observableSections = new Map();\n    const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target);\n    for (const anchor of targetLinks) {\n      // ensure that the anchor has an id and is not disabled\n      if (!anchor.hash || isDisabled(anchor)) {\n        continue;\n      }\n      const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);\n\n      // ensure that the observableSection exists & is visible\n      if (isVisible(observableSection)) {\n        this._targetLinks.set(decodeURI(anchor.hash), anchor);\n        this._observableSections.set(anchor.hash, observableSection);\n      }\n    }\n  }\n  _process(target) {\n    if (this._activeTarget === target) {\n      return;\n    }\n    this._clearActiveClass(this._config.target);\n    this._activeTarget = target;\n    target.classList.add(CLASS_NAME_ACTIVE$1);\n    this._activateParents(target);\n    EventHandler.trigger(this._element, EVENT_ACTIVATE, {\n      relatedTarget: target\n    });\n  }\n  _activateParents(target) {\n    // Activate dropdown parents\n    if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n      SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1);\n      return;\n    }\n    for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n      // Set triggered links parents as active\n      // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n      for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) {\n        item.classList.add(CLASS_NAME_ACTIVE$1);\n      }\n    }\n  }\n  _clearActiveClass(parent) {\n    parent.classList.remove(CLASS_NAME_ACTIVE$1);\n    const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`, parent);\n    for (const node of activeNodes) {\n      node.classList.remove(CLASS_NAME_ACTIVE$1);\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = ScrollSpy.getOrCreateInstance(this, config);\n      if (typeof config !== 'string') {\n        return;\n      }\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`);\n      }\n      data[config]();\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(window, EVENT_LOAD_DATA_API$1, () => {\n  for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) {\n    ScrollSpy.getOrCreateInstance(spy);\n  }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(ScrollSpy);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$1 = 'tab';\nconst DATA_KEY$1 = 'bs.tab';\nconst EVENT_KEY$1 = `.${DATA_KEY$1}`;\nconst EVENT_HIDE$1 = `hide${EVENT_KEY$1}`;\nconst EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`;\nconst EVENT_SHOW$1 = `show${EVENT_KEY$1}`;\nconst EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`;\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`;\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`;\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`;\nconst ARROW_LEFT_KEY = 'ArrowLeft';\nconst ARROW_RIGHT_KEY = 'ArrowRight';\nconst ARROW_UP_KEY = 'ArrowUp';\nconst ARROW_DOWN_KEY = 'ArrowDown';\nconst HOME_KEY = 'Home';\nconst END_KEY = 'End';\nconst CLASS_NAME_ACTIVE = 'active';\nconst CLASS_NAME_FADE$1 = 'fade';\nconst CLASS_NAME_SHOW$1 = 'show';\nconst CLASS_DROPDOWN = 'dropdown';\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';\nconst SELECTOR_DROPDOWN_MENU = '.dropdown-menu';\nconst NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`;\nconst SELECTOR_TAB_PANEL = '.list-group, .nav, [role=\"tablist\"]';\nconst SELECTOR_OUTER = '.nav-item, .list-group-item';\nconst SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role=\"tab\"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]'; // TODO: could only be `tab` in v6\nconst SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;\nconst SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle=\"tab\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"pill\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"list\"]`;\n\n/**\n * Class definition\n */\n\nclass Tab extends BaseComponent {\n  constructor(element) {\n    super(element);\n    this._parent = this._element.closest(SELECTOR_TAB_PANEL);\n    if (!this._parent) {\n      return;\n      // TODO: should throw exception in v6\n      // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)\n    }\n\n    // Set up initial aria attributes\n    this._setInitialAttributes(this._parent, this._getChildren());\n    EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));\n  }\n\n  // Getters\n  static get NAME() {\n    return NAME$1;\n  }\n\n  // Public\n  show() {\n    // Shows this elem and deactivate the active sibling if exists\n    const innerElem = this._element;\n    if (this._elemIsActive(innerElem)) {\n      return;\n    }\n\n    // Search for active tab on same parent to deactivate it\n    const active = this._getActiveElem();\n    const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE$1, {\n      relatedTarget: innerElem\n    }) : null;\n    const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW$1, {\n      relatedTarget: active\n    });\n    if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) {\n      return;\n    }\n    this._deactivate(active, innerElem);\n    this._activate(innerElem, active);\n  }\n\n  // Private\n  _activate(element, relatedElem) {\n    if (!element) {\n      return;\n    }\n    element.classList.add(CLASS_NAME_ACTIVE);\n    this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section\n\n    const complete = () => {\n      if (element.getAttribute('role') !== 'tab') {\n        element.classList.add(CLASS_NAME_SHOW$1);\n        return;\n      }\n      element.removeAttribute('tabindex');\n      element.setAttribute('aria-selected', true);\n      this._toggleDropDown(element, true);\n      EventHandler.trigger(element, EVENT_SHOWN$1, {\n        relatedTarget: relatedElem\n      });\n    };\n    this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));\n  }\n  _deactivate(element, relatedElem) {\n    if (!element) {\n      return;\n    }\n    element.classList.remove(CLASS_NAME_ACTIVE);\n    element.blur();\n    this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too\n\n    const complete = () => {\n      if (element.getAttribute('role') !== 'tab') {\n        element.classList.remove(CLASS_NAME_SHOW$1);\n        return;\n      }\n      element.setAttribute('aria-selected', false);\n      element.setAttribute('tabindex', '-1');\n      this._toggleDropDown(element, false);\n      EventHandler.trigger(element, EVENT_HIDDEN$1, {\n        relatedTarget: relatedElem\n      });\n    };\n    this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));\n  }\n  _keydown(event) {\n    if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) {\n      return;\n    }\n    event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page\n    event.preventDefault();\n    const children = this._getChildren().filter(element => !isDisabled(element));\n    let nextActiveElement;\n    if ([HOME_KEY, END_KEY].includes(event.key)) {\n      nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1];\n    } else {\n      const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);\n      nextActiveElement = getNextActiveElement(children, event.target, isNext, true);\n    }\n    if (nextActiveElement) {\n      nextActiveElement.focus({\n        preventScroll: true\n      });\n      Tab.getOrCreateInstance(nextActiveElement).show();\n    }\n  }\n  _getChildren() {\n    // collection of inner elements\n    return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent);\n  }\n  _getActiveElem() {\n    return this._getChildren().find(child => this._elemIsActive(child)) || null;\n  }\n  _setInitialAttributes(parent, children) {\n    this._setAttributeIfNotExists(parent, 'role', 'tablist');\n    for (const child of children) {\n      this._setInitialAttributesOnChild(child);\n    }\n  }\n  _setInitialAttributesOnChild(child) {\n    child = this._getInnerElement(child);\n    const isActive = this._elemIsActive(child);\n    const outerElem = this._getOuterElement(child);\n    child.setAttribute('aria-selected', isActive);\n    if (outerElem !== child) {\n      this._setAttributeIfNotExists(outerElem, 'role', 'presentation');\n    }\n    if (!isActive) {\n      child.setAttribute('tabindex', '-1');\n    }\n    this._setAttributeIfNotExists(child, 'role', 'tab');\n\n    // set attributes to the related panel too\n    this._setInitialAttributesOnTargetPanel(child);\n  }\n  _setInitialAttributesOnTargetPanel(child) {\n    const target = SelectorEngine.getElementFromSelector(child);\n    if (!target) {\n      return;\n    }\n    this._setAttributeIfNotExists(target, 'role', 'tabpanel');\n    if (child.id) {\n      this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);\n    }\n  }\n  _toggleDropDown(element, open) {\n    const outerElem = this._getOuterElement(element);\n    if (!outerElem.classList.contains(CLASS_DROPDOWN)) {\n      return;\n    }\n    const toggle = (selector, className) => {\n      const element = SelectorEngine.findOne(selector, outerElem);\n      if (element) {\n        element.classList.toggle(className, open);\n      }\n    };\n    toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE);\n    toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1);\n    outerElem.setAttribute('aria-expanded', open);\n  }\n  _setAttributeIfNotExists(element, attribute, value) {\n    if (!element.hasAttribute(attribute)) {\n      element.setAttribute(attribute, value);\n    }\n  }\n  _elemIsActive(elem) {\n    return elem.classList.contains(CLASS_NAME_ACTIVE);\n  }\n\n  // Try to get the inner element (usually the .nav-link)\n  _getInnerElement(elem) {\n    return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem);\n  }\n\n  // Try to get the outer element (usually the .nav-item)\n  _getOuterElement(elem) {\n    return elem.closest(SELECTOR_OUTER) || elem;\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tab.getOrCreateInstance(this);\n      if (typeof config !== 'string') {\n        return;\n      }\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`);\n      }\n      data[config]();\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault();\n  }\n  if (isDisabled(this)) {\n    return;\n  }\n  Tab.getOrCreateInstance(this).show();\n});\n\n/**\n * Initialize on focus\n */\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) {\n    Tab.getOrCreateInstance(element);\n  }\n});\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tab);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME = 'toast';\nconst DATA_KEY = 'bs.toast';\nconst EVENT_KEY = `.${DATA_KEY}`;\nconst EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;\nconst EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`;\nconst EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;\nconst EVENT_HIDE = `hide${EVENT_KEY}`;\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`;\nconst EVENT_SHOW = `show${EVENT_KEY}`;\nconst EVENT_SHOWN = `shown${EVENT_KEY}`;\nconst CLASS_NAME_FADE = 'fade';\nconst CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility\nconst CLASS_NAME_SHOW = 'show';\nconst CLASS_NAME_SHOWING = 'showing';\nconst DefaultType = {\n  animation: 'boolean',\n  autohide: 'boolean',\n  delay: 'number'\n};\nconst Default = {\n  animation: true,\n  autohide: true,\n  delay: 5000\n};\n\n/**\n * Class definition\n */\n\nclass Toast extends BaseComponent {\n  constructor(element, config) {\n    super(element, config);\n    this._timeout = null;\n    this._hasMouseInteraction = false;\n    this._hasKeyboardInteraction = false;\n    this._setListeners();\n  }\n\n  // Getters\n  static get Default() {\n    return Default;\n  }\n  static get DefaultType() {\n    return DefaultType;\n  }\n  static get NAME() {\n    return NAME;\n  }\n\n  // Public\n  show() {\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW);\n    if (showEvent.defaultPrevented) {\n      return;\n    }\n    this._clearTimeout();\n    if (this._config.animation) {\n      this._element.classList.add(CLASS_NAME_FADE);\n    }\n    const complete = () => {\n      this._element.classList.remove(CLASS_NAME_SHOWING);\n      EventHandler.trigger(this._element, EVENT_SHOWN);\n      this._maybeScheduleHide();\n    };\n    this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated\n    reflow(this._element);\n    this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING);\n    this._queueCallback(complete, this._element, this._config.animation);\n  }\n  hide() {\n    if (!this.isShown()) {\n      return;\n    }\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);\n    if (hideEvent.defaultPrevented) {\n      return;\n    }\n    const complete = () => {\n      this._element.classList.add(CLASS_NAME_HIDE); // @deprecated\n      this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW);\n      EventHandler.trigger(this._element, EVENT_HIDDEN);\n    };\n    this._element.classList.add(CLASS_NAME_SHOWING);\n    this._queueCallback(complete, this._element, this._config.animation);\n  }\n  dispose() {\n    this._clearTimeout();\n    if (this.isShown()) {\n      this._element.classList.remove(CLASS_NAME_SHOW);\n    }\n    super.dispose();\n  }\n  isShown() {\n    return this._element.classList.contains(CLASS_NAME_SHOW);\n  }\n\n  // Private\n\n  _maybeScheduleHide() {\n    if (!this._config.autohide) {\n      return;\n    }\n    if (this._hasMouseInteraction || this._hasKeyboardInteraction) {\n      return;\n    }\n    this._timeout = setTimeout(() => {\n      this.hide();\n    }, this._config.delay);\n  }\n  _onInteraction(event, isInteracting) {\n    switch (event.type) {\n      case 'mouseover':\n      case 'mouseout':\n        {\n          this._hasMouseInteraction = isInteracting;\n          break;\n        }\n      case 'focusin':\n      case 'focusout':\n        {\n          this._hasKeyboardInteraction = isInteracting;\n          break;\n        }\n    }\n    if (isInteracting) {\n      this._clearTimeout();\n      return;\n    }\n    const nextElement = event.relatedTarget;\n    if (this._element === nextElement || this._element.contains(nextElement)) {\n      return;\n    }\n    this._maybeScheduleHide();\n  }\n  _setListeners() {\n    EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));\n    EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));\n    EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));\n    EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));\n  }\n  _clearTimeout() {\n    clearTimeout(this._timeout);\n    this._timeout = null;\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Toast.getOrCreateInstance(this, config);\n      if (typeof config === 'string') {\n        if (typeof data[config] === 'undefined') {\n          throw new TypeError(`No method named \"${config}\"`);\n        }\n        data[config](this);\n      }\n    });\n  }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Toast);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Toast);\n\n\n//# sourceMappingURL=bootstrap.esm.js.map\n\n\n//# sourceURL=webpack://frontend/./node_modules/bootstrap/dist/js/bootstrap.esm.js?");

/***/ }),

/***/ "./node_modules/jquery/dist/jquery.js":
/*!********************************************!*\
  !*** ./node_modules/jquery/dist/jquery.js ***!
  \********************************************/
/***/ (function(module, exports) {

eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * jQuery JavaScript Library v3.5.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2020-05-04T22:49Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif (  true && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n      // Support: Chrome <=57, Firefox <=52\n      // In some browsers, typeof returns \"function\" for HTML <object> elements\n      // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n      // We don't want to classify *any* DOM node as a function.\n      return typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n  };\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = \"3.5.1\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( _i, name ) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.5\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2020-03-14\n */\n( function( window ) {\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ( {} ).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpushNative = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\n\t// Use a stripped-down indexOf as it's faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[ i ] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|\" +\n\t\t\"ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\n\t\t// \"Attribute values must be CSS identifiers [capture 5]\n\t\t// or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" +\n\t\twhitespace + \"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" +\n\t\twhitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace +\n\t\t\"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" +\n\t\t\twhitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" +\n\t\t\twhitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace +\n\t\t\t\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace +\n\t\t\t\"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = \"0x\" + escape.slice( 1 ) - 0x10000;\n\n\t\treturn nonHex ?\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\tnonHex :\n\n\t\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t\t// Support: IE <=11+\n\t\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t\t// surrogate pair\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === \"\\0\" ) {\n\t\t\t\treturn \"\\uFFFD\";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + \"\\\\\" +\n\t\t\t\tch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn \"\\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === \"fieldset\";\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( ( target[ j++ ] = els[ i++ ] ) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t( nodeType !== 1 || context.nodeName.toLowerCase() !== \"object\" ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we're not changing the context.\n\t\t\t\t\tif ( newContext !== context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( \"id\" ) ) ) {\n\t\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( \"id\", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? \"#\" + nid : \":scope\" ) + \" \" +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( \"fieldset\" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split( \"|\" ),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[ i ] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( ( cur = cur.nextSibling ) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn ( name === \"input\" || name === \"button\" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem.namespaceURI,\n\t\tdocElem = ( elem.ownerDocument || elem ).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( preferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\n\t// Safari 4 - 5 only, Opera <=11.6 - 12.x only\n\t// IE/Edge & older browsers don't support the :scope pseudo-class.\n\t// Support: Safari 6.0 only\n\t// Safari 6.0 supports :scope but it's an alias of :root there.\n\tsupport.scope = assert( function( el ) {\n\t\tdocElem.appendChild( el ).appendChild( document.createElement( \"div\" ) );\n\t\treturn typeof el.querySelectorAll !== \"undefined\" &&\n\t\t\t!el.querySelectorAll( \":scope fieldset div\" ).length;\n\t} );\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert( function( el ) {\n\t\tel.className = \"i\";\n\t\treturn !el.getAttribute( \"className\" );\n\t} );\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert( function( el ) {\n\t\tel.appendChild( document.createComment( \"\" ) );\n\t\treturn !el.getElementsByTagName( \"*\" ).length;\n\t} );\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[ \"ID\" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"id\" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[ \"ID\" ] =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode( \"id\" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[ \"TAG\" ] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[ \"CLASS\" ] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {\n\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert( function( el ) {\n\n\t\t\tvar input;\n\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n\t\t\t\t\"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n\t\t\t\t\"<option selected=''></option></select>\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll( \"[msallowcapture^='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !el.querySelectorAll( \"[selected]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"~=\" );\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t\t// IE 11/Edge don't find elements on a `[name='']` query in some cases.\n\t\t\t// Adding a temporary attribute to the document before the selection works\n\t\t\t// around the issue.\n\t\t\t// Interestingly, IE 10 & older don't seem to have the issue.\n\t\t\tinput = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"name\", \"\" );\n\t\t\tel.appendChild( input );\n\t\t\tif ( !el.querySelectorAll( \"[name='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" +\n\t\t\t\t\twhitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll( \":checked\" ).length ) {\n\t\t\t\trbuggyQSA.push( \":checked\" );\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push( \".#.+[+~]\" );\n\t\t\t}\n\n\t\t\t// Support: Firefox <=3.6 - 5 only\n\t\t\t// Old Firefox doesn't throw on a badly-escaped identifier.\n\t\t\tel.querySelectorAll( \"\\\\\\f\" );\n\t\t\trbuggyQSA.push( \"[\\\\r\\\\n\\\\f]\" );\n\t\t} );\n\n\t\tassert( function( el ) {\n\t\t\tel.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n\t\t\t\t\"<select disabled='disabled'><option/></select>\";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll( \"[name=d]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll( \":enabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll( \":disabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: Opera 10 - 11 only\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll( \"*,:x\" );\n\t\t\trbuggyQSA.push( \",.*:\" );\n\t\t} );\n\t}\n\n\tif ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector ) ) ) ) {\n\n\t\tassert( function( el ) {\n\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, \"*\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t} );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( \"|\" ) );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( \"|\" ) );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t) );\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( ( b = b.parentNode ) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a == document || a.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b == document || b.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\treturn a == document ? -1 :\n\t\t\t\tb == document ? 1 :\n\t\t\t\t/* eslint-enable eqeqeq */\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[ i ] === bp[ i ] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[ i ], bp[ i ] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\tap[ i ] == preferredDoc ? -1 :\n\t\t\tbp[ i ] == preferredDoc ? 1 :\n\t\t\t/* eslint-enable eqeqeq */\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t// fragment in IE 9\n\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn ( sel + \"\" ).replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] ||\n\t\t\t\tmatch[ 5 ] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === \"~=\" ) {\n\t\t\t\tmatch[ 3 ] = \" \" + match[ 3 ] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === \"nth\" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === \"even\" || match[ 3 ] === \"odd\" ) );\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === \"odd\" );\n\n\t\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr[ \"CHILD\" ].test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( \"(^|\" + whitespace +\n\t\t\t\t\t\")\" + className + \"(\" + whitespace + \"|$)\" ) ) && classCache(\n\t\t\t\t\t\tclassName, function( elem ) {\n\t\t\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\t\t\ttypeof elem.className === \"string\" && elem.className ||\n\t\t\t\t\t\t\t\ttypeof elem.getAttribute !== \"undefined\" &&\n\t\t\t\t\t\t\t\t\telem.getAttribute( \"class\" ) ||\n\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\t/* eslint-disable max-len */\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t\t/* eslint-enable max-len */\n\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\t\"has\": markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\t\"contains\": markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || \"\" ) ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( \"xml:lang\" ) || elem.getAttribute( \"lang\" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement &&\n\t\t\t\t( !document.hasFocus || document.hasFocus() ) &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": createDisabledPseudo( false ),\n\t\t\"disabled\": createDisabledPseudo( true ),\n\n\t\t\"checked\": function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn ( nodeName === \"input\" && !!elem.checked ) ||\n\t\t\t\t( nodeName === \"option\" && !!elem.selected );\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t//   but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[ \"empty\" ]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( ( attr = elem.getAttribute( \"type\" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\t\"last\": createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\t\"eq\": createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\t\"even\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"odd\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"lt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ?\n\t\t\t\targument + length :\n\t\t\t\targument > length ?\n\t\t\t\t\tlength :\n\t\t\t\t\targument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"gt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos[ \"nth\" ] = Expr.pseudos[ \"eq\" ];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rcombinators.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrim, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] ||\n\t\t\t\t\t\t\t( outerCache[ elem.uniqueID ] = {} );\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = uniqueCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts(\n\t\t\t\tselector || \"*\",\n\t\t\t\tcontext.nodeType ? [ context ] : context,\n\t\t\t\t[]\n\t\t\t),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ \" \" ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\ttokens\n\t\t\t\t\t\t.slice( 0, i - 1 )\n\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" } )\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[ \"TAG\" ]( \"*\", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache(\n\t\t\tselector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers )\n\t\t);\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === \"ID\" &&\n\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find[ \"ID\" ]( token.matches[ 0 ]\n\t\t\t\t.replace( runescape, funescape ), context ) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[ \"needsContext\" ].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split( \"\" ).sort( sortOrder ).join( \"\" ) === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( \"fieldset\" ) ) & 1;\n} );\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert( function( el ) {\n\tel.innerHTML = \"<a href='#'></a>\";\n\treturn el.firstChild.getAttribute( \"href\" ) === \"#\";\n} ) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert( function( el ) {\n\tel.innerHTML = \"<input/>\";\n\tel.firstChild.setAttribute( \"value\", \"\" );\n\treturn el.firstChild.getAttribute( \"value\" ) === \"\";\n} ) ) {\n\taddHandle( \"value\", function( elem, _name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert( function( el ) {\n\treturn el.getAttribute( \"disabled\" ) == null;\n} ) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\t\tnull;\n\t\t}\n\t} );\n}\n\nreturn Sizzle;\n\n} )( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n  return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n};\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// <object> elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the master Deferred\n\t\t\tmaster = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tmaster.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( master.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn master.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n\t\t}\n\n\t\treturn master.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\tvalue :\n\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (#9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces <option> tags with their contents when inserted outside of\n\t// the select element.\n\tdiv.innerHTML = \"<option></option>\";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, \"<select multiple='multiple'>\", \"</select>\" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 - 11+\n// focus() and blur() are asynchronous, except when they are no-op.\n// So expect focus to be synchronous when the element is already active,\n// and blur to be synchronous when the element is not already active.\n// (focus and blur are always synchronous in other supported browsers,\n// this just defines when we can count on it).\nfunction expectSync( elem, type ) {\n\treturn ( elem === safeActiveElement() ) === ( type === \"focus\" );\n}\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\t\tdataPriv.get( this, \"events\" ) || Object.create( null )\n\t\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", returnTrue );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, expectSync ) {\n\n\t// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !expectSync ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar notAsync, result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\t// Saved data should be false in such cases, but might be a leftover capture object\n\t\t\t\t// from an async native handler (gh-4350)\n\t\t\t\tif ( !saved.length ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t// focus() and blur() are asynchronous\n\t\t\t\t\tnotAsync = expectSync( this, type );\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tif ( saved !== result || notAsync ) {\n\t\t\t\t\t\tdataPriv.set( this, type, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t}\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn result.value;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering the\n\t\t\t\t// native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved.length ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, {\n\t\t\t\t\tvalue: jQuery.event.trigger(\n\n\t\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t\t// Extend with the prototype to reset the above stopImmediatePropagation()\n\t\t\t\t\t\tjQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\n\t\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\t\tthis\n\t\t\t\t\t)\n\t\t\t\t} );\n\n\t\t\t\t// Abort handling of the native event\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (#504, #13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\n\twhich: function( event ) {\n\t\tvar button = event.button;\n\n\t\t// Add which for key events\n\t\tif ( event.which == null && rkeyEvent.test( event.type ) ) {\n\t\t\treturn event.charCode != null ? event.charCode : event.keyCode;\n\t\t}\n\n\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\tif ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n\t\t\tif ( button & 1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif ( button & 2 ) {\n\t\t\t\treturn 3;\n\t\t\t}\n\n\t\t\tif ( button & 4 ) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn event.which;\n\t}\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, expectSync );\n\n\t\t\t// Return false to allow normal processing in the caller\n\t\t\treturn false;\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, \"handle events\" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase()  !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( \"table\" );\n\t\t\t\ttr = document.createElement( \"tr\" );\n\t\t\t\ttrChild = document.createElement( \"div\" );\n\n\t\t\t\ttable.style.cssText = \"position:absolute;left:-11111px\";\n\t\t\t\ttr.style.height = \"1px\";\n\t\t\t\ttrChild.style.height = \"9px\";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = parseInt( trStyle.height ) > 3;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t//   .css('filter') (IE 9 only, #12537)\n\t//   .css('--customProperty) (#3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trcustomProp = /^--/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === \"margin\" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn't suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, \"tr\" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === \"auto\" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"animationIterationCount\": true,\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"gridArea\": true,\n\t\t\"gridColumn\": true,\n\t\t\"gridColumnEnd\": true,\n\t\t\"gridColumnStart\": true,\n\t\t\"gridRow\": true,\n\t\t\"gridRowEnd\": true,\n\t\t\"gridRowStart\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t\t} ) :\n\t\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\t// Use proper attribute retrieval(#12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar className, i, self, classNames;\n\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\ti = 0;\n\t\t\t\tself = jQuery( this );\n\t\t\t\tclassNames = classesToArray( value );\n\n\t\t\t\twhile ( ( className = classNames[ i++ ] ) ) {\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = (\n\t\t\t\t\tdataPriv.get( cur, \"events\" ) || Object.create( null )\n\t\t\t\t)[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\n\t\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {\n\t\txml = undefined;\n\t}\n\n\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\tjQuery.error( \"Invalid XML: \" + data );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} )\n\t\t.filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} )\n\t\t.map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\toriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script\n\t\t\tif ( !isSuccess && jQuery.inArray( \"script\", s.dataTypes ) > -1 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === \"content-type\" ) {\n\t\t\ts.contentType = s.headers[ i ] || \"\";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (#11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\"  ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( \"load error\", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce.guid++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tif ( typeof props.top === \"number\" ) {\n\t\t\t\tprops.top += \"px\";\n\t\t\t}\n\t\t\tif ( typeof props.left === \"number\" ) {\n\t\t\t\tprops.left += \"px\";\n\t\t\t}\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t//    documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( _i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name },\n\t\tfunction( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( _i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t},\n\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t}\n} );\n\njQuery.each( ( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( _i, name ) {\n\n\t\t// Handle event binding\n\t\tjQuery.fn[ name ] = function( data, fn ) {\n\t\t\treturn arguments.length > 0 ?\n\t\t\t\tthis.on( name, null, data, fn ) :\n\t\t\t\tthis.trigger( name );\n\t\t};\n\t} );\n\n\n\n\n// Support: Android <=4.0 only\n// Make sure we trim BOM and NBSP\nvar rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\njQuery.trim = function( text ) {\n\treturn text == null ?\n\t\t\"\" :\n\t\t( text + \"\" ).replace( rtrim, \"\" );\n};\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( true ) {\n\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n\t\treturn jQuery;\n\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( typeof noGlobal === \"undefined\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n\n\n//# sourceURL=webpack://frontend/./node_modules/jquery/dist/jquery.js?");

/***/ }),

/***/ "./sass/app.scss":
/*!***********************!*\
  !*** ./sass/app.scss ***!
  \***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://frontend/./sass/app.scss?");

/***/ }),

/***/ "./node_modules/moment/locale/af.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/af.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Afrikaans [af]\n//! author : Werner Mollentze : https://github.com/wernerm\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var af = moment.defineLocale('af', {\n        months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),\n        weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split(\n            '_'\n        ),\n        weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),\n        weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),\n        meridiemParse: /vm|nm/i,\n        isPM: function (input) {\n            return /^nm$/i.test(input);\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'vm' : 'VM';\n            } else {\n                return isLower ? 'nm' : 'NM';\n            }\n        },\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Vandag om] LT',\n            nextDay: '[Môre om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[Gister om] LT',\n            lastWeek: '[Laas] dddd [om] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'oor %s',\n            past: '%s gelede',\n            s: \"'n paar sekondes\",\n            ss: '%d sekondes',\n            m: \"'n minuut\",\n            mm: '%d minute',\n            h: \"'n uur\",\n            hh: '%d ure',\n            d: \"'n dag\",\n            dd: '%d dae',\n            M: \"'n maand\",\n            MM: '%d maande',\n            y: \"'n jaar\",\n            yy: '%d jaar',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n        ordinal: function (number) {\n            return (\n                number +\n                (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n            ); // Thanks to Joris Röling : https://github.com/jjupiter\n        },\n        week: {\n            dow: 1, // Maandag is die eerste dag van die week.\n            doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar.\n        },\n    });\n\n    return af;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/af.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ar-dz.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/ar-dz.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Arabic (Algeria) [ar-dz]\n//! author : Amine Roukh: https://github.com/Amine27\n//! author : Abdel Said: https://github.com/abdelsaid\n//! author : Ahmed Elkhatib\n//! author : forabi https://github.com/forabi\n//! author : Noureddine LOUAHEDJ : https://github.com/noureddinem\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var pluralForm = function (n) {\n            return n === 0\n                ? 0\n                : n === 1\n                ? 1\n                : n === 2\n                ? 2\n                : n % 100 >= 3 && n % 100 <= 10\n                ? 3\n                : n % 100 >= 11\n                ? 4\n                : 5;\n        },\n        plurals = {\n            s: [\n                'أقل من ثانية',\n                'ثانية واحدة',\n                ['ثانيتان', 'ثانيتين'],\n                '%d ثوان',\n                '%d ثانية',\n                '%d ثانية',\n            ],\n            m: [\n                'أقل من دقيقة',\n                'دقيقة واحدة',\n                ['دقيقتان', 'دقيقتين'],\n                '%d دقائق',\n                '%d دقيقة',\n                '%d دقيقة',\n            ],\n            h: [\n                'أقل من ساعة',\n                'ساعة واحدة',\n                ['ساعتان', 'ساعتين'],\n                '%d ساعات',\n                '%d ساعة',\n                '%d ساعة',\n            ],\n            d: [\n                'أقل من يوم',\n                'يوم واحد',\n                ['يومان', 'يومين'],\n                '%d أيام',\n                '%d يومًا',\n                '%d يوم',\n            ],\n            M: [\n                'أقل من شهر',\n                'شهر واحد',\n                ['شهران', 'شهرين'],\n                '%d أشهر',\n                '%d شهرا',\n                '%d شهر',\n            ],\n            y: [\n                'أقل من عام',\n                'عام واحد',\n                ['عامان', 'عامين'],\n                '%d أعوام',\n                '%d عامًا',\n                '%d عام',\n            ],\n        },\n        pluralize = function (u) {\n            return function (number, withoutSuffix, string, isFuture) {\n                var f = pluralForm(number),\n                    str = plurals[u][pluralForm(number)];\n                if (f === 2) {\n                    str = str[withoutSuffix ? 0 : 1];\n                }\n                return str.replace(/%d/i, number);\n            };\n        },\n        months = [\n            'جانفي',\n            'فيفري',\n            'مارس',\n            'أفريل',\n            'ماي',\n            'جوان',\n            'جويلية',\n            'أوت',\n            'سبتمبر',\n            'أكتوبر',\n            'نوفمبر',\n            'ديسمبر',\n        ];\n\n    var arDz = moment.defineLocale('ar-dz', {\n        months: months,\n        monthsShort: months,\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'D/\\u200FM/\\u200FYYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ص|م/,\n        isPM: function (input) {\n            return 'م' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar: {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'بعد %s',\n            past: 'منذ %s',\n            s: pluralize('s'),\n            ss: pluralize('s'),\n            m: pluralize('m'),\n            mm: pluralize('m'),\n            h: pluralize('h'),\n            hh: pluralize('h'),\n            d: pluralize('d'),\n            dd: pluralize('d'),\n            M: pluralize('M'),\n            MM: pluralize('M'),\n            y: pluralize('y'),\n            yy: pluralize('y'),\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return arDz;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ar-dz.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ar-kw.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/ar-kw.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Arabic (Kuwait) [ar-kw]\n//! author : Nusret Parlak: https://github.com/nusretparlak\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var arKw = moment.defineLocale('ar-kw', {\n        months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(\n                '_'\n            ),\n        weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            ss: '%d ثانية',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات',\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return arKw;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ar-kw.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ar-ly.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/ar-ly.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Arabic (Libya) [ar-ly]\n//! author : Ali Hmer: https://github.com/kikoanis\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '1',\n            2: '2',\n            3: '3',\n            4: '4',\n            5: '5',\n            6: '6',\n            7: '7',\n            8: '8',\n            9: '9',\n            0: '0',\n        },\n        pluralForm = function (n) {\n            return n === 0\n                ? 0\n                : n === 1\n                ? 1\n                : n === 2\n                ? 2\n                : n % 100 >= 3 && n % 100 <= 10\n                ? 3\n                : n % 100 >= 11\n                ? 4\n                : 5;\n        },\n        plurals = {\n            s: [\n                'أقل من ثانية',\n                'ثانية واحدة',\n                ['ثانيتان', 'ثانيتين'],\n                '%d ثوان',\n                '%d ثانية',\n                '%d ثانية',\n            ],\n            m: [\n                'أقل من دقيقة',\n                'دقيقة واحدة',\n                ['دقيقتان', 'دقيقتين'],\n                '%d دقائق',\n                '%d دقيقة',\n                '%d دقيقة',\n            ],\n            h: [\n                'أقل من ساعة',\n                'ساعة واحدة',\n                ['ساعتان', 'ساعتين'],\n                '%d ساعات',\n                '%d ساعة',\n                '%d ساعة',\n            ],\n            d: [\n                'أقل من يوم',\n                'يوم واحد',\n                ['يومان', 'يومين'],\n                '%d أيام',\n                '%d يومًا',\n                '%d يوم',\n            ],\n            M: [\n                'أقل من شهر',\n                'شهر واحد',\n                ['شهران', 'شهرين'],\n                '%d أشهر',\n                '%d شهرا',\n                '%d شهر',\n            ],\n            y: [\n                'أقل من عام',\n                'عام واحد',\n                ['عامان', 'عامين'],\n                '%d أعوام',\n                '%d عامًا',\n                '%d عام',\n            ],\n        },\n        pluralize = function (u) {\n            return function (number, withoutSuffix, string, isFuture) {\n                var f = pluralForm(number),\n                    str = plurals[u][pluralForm(number)];\n                if (f === 2) {\n                    str = str[withoutSuffix ? 0 : 1];\n                }\n                return str.replace(/%d/i, number);\n            };\n        },\n        months = [\n            'يناير',\n            'فبراير',\n            'مارس',\n            'أبريل',\n            'مايو',\n            'يونيو',\n            'يوليو',\n            'أغسطس',\n            'سبتمبر',\n            'أكتوبر',\n            'نوفمبر',\n            'ديسمبر',\n        ];\n\n    var arLy = moment.defineLocale('ar-ly', {\n        months: months,\n        monthsShort: months,\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'D/\\u200FM/\\u200FYYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ص|م/,\n        isPM: function (input) {\n            return 'م' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar: {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'بعد %s',\n            past: 'منذ %s',\n            s: pluralize('s'),\n            ss: pluralize('s'),\n            m: pluralize('m'),\n            mm: pluralize('m'),\n            h: pluralize('h'),\n            hh: pluralize('h'),\n            d: pluralize('d'),\n            dd: pluralize('d'),\n            M: pluralize('M'),\n            MM: pluralize('M'),\n            y: pluralize('y'),\n            yy: pluralize('y'),\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return arLy;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ar-ly.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ar-ma.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/ar-ma.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Arabic (Morocco) [ar-ma]\n//! author : ElFadili Yassine : https://github.com/ElFadiliY\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var arMa = moment.defineLocale('ar-ma', {\n        months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(\n                '_'\n            ),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            ss: '%d ثانية',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return arMa;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ar-ma.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ar-sa.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/ar-sa.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Arabic (Saudi Arabia) [ar-sa]\n//! author : Suhail Alkowaileet : https://github.com/xsoh\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '١',\n            2: '٢',\n            3: '٣',\n            4: '٤',\n            5: '٥',\n            6: '٦',\n            7: '٧',\n            8: '٨',\n            9: '٩',\n            0: '٠',\n        },\n        numberMap = {\n            '١': '1',\n            '٢': '2',\n            '٣': '3',\n            '٤': '4',\n            '٥': '5',\n            '٦': '6',\n            '٧': '7',\n            '٨': '8',\n            '٩': '9',\n            '٠': '0',\n        };\n\n    var arSa = moment.defineLocale('ar-sa', {\n        months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n                '_'\n            ),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ص|م/,\n        isPM: function (input) {\n            return 'م' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            ss: '%d ثانية',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات',\n        },\n        preparse: function (string) {\n            return string\n                .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                    return numberMap[match];\n                })\n                .replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return arSa;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ar-sa.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ar-tn.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/ar-tn.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale  :  Arabic (Tunisia) [ar-tn]\n//! author : Nader Toukabri : https://github.com/naderio\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var arTn = moment.defineLocale('ar-tn', {\n        months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n                '_'\n            ),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            ss: '%d ثانية',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return arTn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ar-tn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ar.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ar.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Arabic [ar]\n//! author : Abdel Said: https://github.com/abdelsaid\n//! author : Ahmed Elkhatib\n//! author : forabi https://github.com/forabi\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '١',\n            2: '٢',\n            3: '٣',\n            4: '٤',\n            5: '٥',\n            6: '٦',\n            7: '٧',\n            8: '٨',\n            9: '٩',\n            0: '٠',\n        },\n        numberMap = {\n            '١': '1',\n            '٢': '2',\n            '٣': '3',\n            '٤': '4',\n            '٥': '5',\n            '٦': '6',\n            '٧': '7',\n            '٨': '8',\n            '٩': '9',\n            '٠': '0',\n        },\n        pluralForm = function (n) {\n            return n === 0\n                ? 0\n                : n === 1\n                ? 1\n                : n === 2\n                ? 2\n                : n % 100 >= 3 && n % 100 <= 10\n                ? 3\n                : n % 100 >= 11\n                ? 4\n                : 5;\n        },\n        plurals = {\n            s: [\n                'أقل من ثانية',\n                'ثانية واحدة',\n                ['ثانيتان', 'ثانيتين'],\n                '%d ثوان',\n                '%d ثانية',\n                '%d ثانية',\n            ],\n            m: [\n                'أقل من دقيقة',\n                'دقيقة واحدة',\n                ['دقيقتان', 'دقيقتين'],\n                '%d دقائق',\n                '%d دقيقة',\n                '%d دقيقة',\n            ],\n            h: [\n                'أقل من ساعة',\n                'ساعة واحدة',\n                ['ساعتان', 'ساعتين'],\n                '%d ساعات',\n                '%d ساعة',\n                '%d ساعة',\n            ],\n            d: [\n                'أقل من يوم',\n                'يوم واحد',\n                ['يومان', 'يومين'],\n                '%d أيام',\n                '%d يومًا',\n                '%d يوم',\n            ],\n            M: [\n                'أقل من شهر',\n                'شهر واحد',\n                ['شهران', 'شهرين'],\n                '%d أشهر',\n                '%d شهرا',\n                '%d شهر',\n            ],\n            y: [\n                'أقل من عام',\n                'عام واحد',\n                ['عامان', 'عامين'],\n                '%d أعوام',\n                '%d عامًا',\n                '%d عام',\n            ],\n        },\n        pluralize = function (u) {\n            return function (number, withoutSuffix, string, isFuture) {\n                var f = pluralForm(number),\n                    str = plurals[u][pluralForm(number)];\n                if (f === 2) {\n                    str = str[withoutSuffix ? 0 : 1];\n                }\n                return str.replace(/%d/i, number);\n            };\n        },\n        months = [\n            'يناير',\n            'فبراير',\n            'مارس',\n            'أبريل',\n            'مايو',\n            'يونيو',\n            'يوليو',\n            'أغسطس',\n            'سبتمبر',\n            'أكتوبر',\n            'نوفمبر',\n            'ديسمبر',\n        ];\n\n    var ar = moment.defineLocale('ar', {\n        months: months,\n        monthsShort: months,\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'D/\\u200FM/\\u200FYYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ص|م/,\n        isPM: function (input) {\n            return 'م' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar: {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'بعد %s',\n            past: 'منذ %s',\n            s: pluralize('s'),\n            ss: pluralize('s'),\n            m: pluralize('m'),\n            mm: pluralize('m'),\n            h: pluralize('h'),\n            hh: pluralize('h'),\n            d: pluralize('d'),\n            dd: pluralize('d'),\n            M: pluralize('M'),\n            MM: pluralize('M'),\n            y: pluralize('y'),\n            yy: pluralize('y'),\n        },\n        preparse: function (string) {\n            return string\n                .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                    return numberMap[match];\n                })\n                .replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return ar;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ar.js?");

/***/ }),

/***/ "./node_modules/moment/locale/az.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/az.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Azerbaijani [az]\n//! author : topchiyev : https://github.com/topchiyev\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        1: '-inci',\n        5: '-inci',\n        8: '-inci',\n        70: '-inci',\n        80: '-inci',\n        2: '-nci',\n        7: '-nci',\n        20: '-nci',\n        50: '-nci',\n        3: '-üncü',\n        4: '-üncü',\n        100: '-üncü',\n        6: '-ncı',\n        9: '-uncu',\n        10: '-uncu',\n        30: '-uncu',\n        60: '-ıncı',\n        90: '-ıncı',\n    };\n\n    var az = moment.defineLocale('az', {\n        months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split(\n            '_'\n        ),\n        monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),\n        weekdays:\n            'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(\n                '_'\n            ),\n        weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),\n        weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[bugün saat] LT',\n            nextDay: '[sabah saat] LT',\n            nextWeek: '[gələn həftə] dddd [saat] LT',\n            lastDay: '[dünən] LT',\n            lastWeek: '[keçən həftə] dddd [saat] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s sonra',\n            past: '%s əvvəl',\n            s: 'bir neçə saniyə',\n            ss: '%d saniyə',\n            m: 'bir dəqiqə',\n            mm: '%d dəqiqə',\n            h: 'bir saat',\n            hh: '%d saat',\n            d: 'bir gün',\n            dd: '%d gün',\n            M: 'bir ay',\n            MM: '%d ay',\n            y: 'bir il',\n            yy: '%d il',\n        },\n        meridiemParse: /gecə|səhər|gündüz|axşam/,\n        isPM: function (input) {\n            return /^(gündüz|axşam)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'gecə';\n            } else if (hour < 12) {\n                return 'səhər';\n            } else if (hour < 17) {\n                return 'gündüz';\n            } else {\n                return 'axşam';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,\n        ordinal: function (number) {\n            if (number === 0) {\n                // special case for zero\n                return number + '-ıncı';\n            }\n            var a = number % 10,\n                b = (number % 100) - a,\n                c = number >= 100 ? 100 : null;\n            return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return az;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/az.js?");

/***/ }),

/***/ "./node_modules/moment/locale/be.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/be.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Belarusian [be]\n//! author : Dmitry Demidov : https://github.com/demidov91\n//! author: Praleska: http://praleska.pro/\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11\n            ? forms[0]\n            : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)\n            ? forms[1]\n            : forms[2];\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',\n            mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',\n            hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',\n            dd: 'дзень_дні_дзён',\n            MM: 'месяц_месяцы_месяцаў',\n            yy: 'год_гады_гадоў',\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвіліна' : 'хвіліну';\n        } else if (key === 'h') {\n            return withoutSuffix ? 'гадзіна' : 'гадзіну';\n        } else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n\n    var be = moment.defineLocale('be', {\n        months: {\n            format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(\n                '_'\n            ),\n            standalone:\n                'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(\n                    '_'\n                ),\n        },\n        monthsShort:\n            'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),\n        weekdays: {\n            format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(\n                '_'\n            ),\n            standalone:\n                'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(\n                    '_'\n                ),\n            isFormat: /\\[ ?[Ууў] ?(?:мінулую|наступную)? ?\\] ?dddd/,\n        },\n        weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY г.',\n            LLL: 'D MMMM YYYY г., HH:mm',\n            LLLL: 'dddd, D MMMM YYYY г., HH:mm',\n        },\n        calendar: {\n            sameDay: '[Сёння ў] LT',\n            nextDay: '[Заўтра ў] LT',\n            lastDay: '[Учора ў] LT',\n            nextWeek: function () {\n                return '[У] dddd [ў] LT';\n            },\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                    case 5:\n                    case 6:\n                        return '[У мінулую] dddd [ў] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                        return '[У мінулы] dddd [ў] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'праз %s',\n            past: '%s таму',\n            s: 'некалькі секунд',\n            m: relativeTimeWithPlural,\n            mm: relativeTimeWithPlural,\n            h: relativeTimeWithPlural,\n            hh: relativeTimeWithPlural,\n            d: 'дзень',\n            dd: relativeTimeWithPlural,\n            M: 'месяц',\n            MM: relativeTimeWithPlural,\n            y: 'год',\n            yy: relativeTimeWithPlural,\n        },\n        meridiemParse: /ночы|раніцы|дня|вечара/,\n        isPM: function (input) {\n            return /^(дня|вечара)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночы';\n            } else if (hour < 12) {\n                return 'раніцы';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечара';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(і|ы|га)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'M':\n                case 'd':\n                case 'DDD':\n                case 'w':\n                case 'W':\n                    return (number % 10 === 2 || number % 10 === 3) &&\n                        number % 100 !== 12 &&\n                        number % 100 !== 13\n                        ? number + '-і'\n                        : number + '-ы';\n                case 'D':\n                    return number + '-га';\n                default:\n                    return number;\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return be;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/be.js?");

/***/ }),

/***/ "./node_modules/moment/locale/bg.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/bg.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Bulgarian [bg]\n//! author : Krasen Borisov : https://github.com/kraz\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var bg = moment.defineLocale('bg', {\n        months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split(\n            '_'\n        ),\n        monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split(\n            '_'\n        ),\n        weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),\n        weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'D.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY H:mm',\n            LLLL: 'dddd, D MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[Днес в] LT',\n            nextDay: '[Утре в] LT',\n            nextWeek: 'dddd [в] LT',\n            lastDay: '[Вчера в] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                    case 6:\n                        return '[Миналата] dddd [в] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[Миналия] dddd [в] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'след %s',\n            past: 'преди %s',\n            s: 'няколко секунди',\n            ss: '%d секунди',\n            m: 'минута',\n            mm: '%d минути',\n            h: 'час',\n            hh: '%d часа',\n            d: 'ден',\n            dd: '%d дена',\n            w: 'седмица',\n            ww: '%d седмици',\n            M: 'месец',\n            MM: '%d месеца',\n            y: 'година',\n            yy: '%d години',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal: function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return bg;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/bg.js?");

/***/ }),

/***/ "./node_modules/moment/locale/bm.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/bm.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Bambara [bm]\n//! author : Estelle Comment : https://github.com/estellecomment\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var bm = moment.defineLocale('bm', {\n        months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split(\n            '_'\n        ),\n        monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),\n        weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),\n        weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),\n        weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'MMMM [tile] D [san] YYYY',\n            LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',\n            LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',\n        },\n        calendar: {\n            sameDay: '[Bi lɛrɛ] LT',\n            nextDay: '[Sini lɛrɛ] LT',\n            nextWeek: 'dddd [don lɛrɛ] LT',\n            lastDay: '[Kunu lɛrɛ] LT',\n            lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s kɔnɔ',\n            past: 'a bɛ %s bɔ',\n            s: 'sanga dama dama',\n            ss: 'sekondi %d',\n            m: 'miniti kelen',\n            mm: 'miniti %d',\n            h: 'lɛrɛ kelen',\n            hh: 'lɛrɛ %d',\n            d: 'tile kelen',\n            dd: 'tile %d',\n            M: 'kalo kelen',\n            MM: 'kalo %d',\n            y: 'san kelen',\n            yy: 'san %d',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return bm;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/bm.js?");

/***/ }),

/***/ "./node_modules/moment/locale/bn-bd.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/bn-bd.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Bengali (Bangladesh) [bn-bd]\n//! author : Asraf Hossain Patoary : https://github.com/ashwoolford\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '১',\n            2: '২',\n            3: '৩',\n            4: '৪',\n            5: '৫',\n            6: '৬',\n            7: '৭',\n            8: '৮',\n            9: '৯',\n            0: '০',\n        },\n        numberMap = {\n            '১': '1',\n            '২': '2',\n            '৩': '3',\n            '৪': '4',\n            '৫': '5',\n            '৬': '6',\n            '৭': '7',\n            '৮': '8',\n            '৯': '9',\n            '০': '0',\n        };\n\n    var bnBd = moment.defineLocale('bn-bd', {\n        months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(\n            '_'\n        ),\n        monthsShort:\n            'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(\n                '_'\n            ),\n        weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(\n            '_'\n        ),\n        weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),\n        weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm সময়',\n            LTS: 'A h:mm:ss সময়',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm সময়',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',\n        },\n        calendar: {\n            sameDay: '[আজ] LT',\n            nextDay: '[আগামীকাল] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[গতকাল] LT',\n            lastWeek: '[গত] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s পরে',\n            past: '%s আগে',\n            s: 'কয়েক সেকেন্ড',\n            ss: '%d সেকেন্ড',\n            m: 'এক মিনিট',\n            mm: '%d মিনিট',\n            h: 'এক ঘন্টা',\n            hh: '%d ঘন্টা',\n            d: 'এক দিন',\n            dd: '%d দিন',\n            M: 'এক মাস',\n            MM: '%d মাস',\n            y: 'এক বছর',\n            yy: '%d বছর',\n        },\n        preparse: function (string) {\n            return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n\n        meridiemParse: /রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'রাত') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'ভোর') {\n                return hour;\n            } else if (meridiem === 'সকাল') {\n                return hour;\n            } else if (meridiem === 'দুপুর') {\n                return hour >= 3 ? hour : hour + 12;\n            } else if (meridiem === 'বিকাল') {\n                return hour + 12;\n            } else if (meridiem === 'সন্ধ্যা') {\n                return hour + 12;\n            }\n        },\n\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'রাত';\n            } else if (hour < 6) {\n                return 'ভোর';\n            } else if (hour < 12) {\n                return 'সকাল';\n            } else if (hour < 15) {\n                return 'দুপুর';\n            } else if (hour < 18) {\n                return 'বিকাল';\n            } else if (hour < 20) {\n                return 'সন্ধ্যা';\n            } else {\n                return 'রাত';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return bnBd;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/bn-bd.js?");

/***/ }),

/***/ "./node_modules/moment/locale/bn.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/bn.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Bengali [bn]\n//! author : Kaushik Gandhi : https://github.com/kaushikgandhi\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '১',\n            2: '২',\n            3: '৩',\n            4: '৪',\n            5: '৫',\n            6: '৬',\n            7: '৭',\n            8: '৮',\n            9: '৯',\n            0: '০',\n        },\n        numberMap = {\n            '১': '1',\n            '২': '2',\n            '৩': '3',\n            '৪': '4',\n            '৫': '5',\n            '৬': '6',\n            '৭': '7',\n            '৮': '8',\n            '৯': '9',\n            '০': '0',\n        };\n\n    var bn = moment.defineLocale('bn', {\n        months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(\n            '_'\n        ),\n        monthsShort:\n            'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(\n                '_'\n            ),\n        weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(\n            '_'\n        ),\n        weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),\n        weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm সময়',\n            LTS: 'A h:mm:ss সময়',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm সময়',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',\n        },\n        calendar: {\n            sameDay: '[আজ] LT',\n            nextDay: '[আগামীকাল] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[গতকাল] LT',\n            lastWeek: '[গত] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s পরে',\n            past: '%s আগে',\n            s: 'কয়েক সেকেন্ড',\n            ss: '%d সেকেন্ড',\n            m: 'এক মিনিট',\n            mm: '%d মিনিট',\n            h: 'এক ঘন্টা',\n            hh: '%d ঘন্টা',\n            d: 'এক দিন',\n            dd: '%d দিন',\n            M: 'এক মাস',\n            MM: '%d মাস',\n            y: 'এক বছর',\n            yy: '%d বছর',\n        },\n        preparse: function (string) {\n            return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (\n                (meridiem === 'রাত' && hour >= 4) ||\n                (meridiem === 'দুপুর' && hour < 5) ||\n                meridiem === 'বিকাল'\n            ) {\n                return hour + 12;\n            } else {\n                return hour;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'রাত';\n            } else if (hour < 10) {\n                return 'সকাল';\n            } else if (hour < 17) {\n                return 'দুপুর';\n            } else if (hour < 20) {\n                return 'বিকাল';\n            } else {\n                return 'রাত';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return bn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/bn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/bo.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/bo.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Tibetan [bo]\n//! author : Thupten N. Chakrishar : https://github.com/vajradog\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '༡',\n            2: '༢',\n            3: '༣',\n            4: '༤',\n            5: '༥',\n            6: '༦',\n            7: '༧',\n            8: '༨',\n            9: '༩',\n            0: '༠',\n        },\n        numberMap = {\n            '༡': '1',\n            '༢': '2',\n            '༣': '3',\n            '༤': '4',\n            '༥': '5',\n            '༦': '6',\n            '༧': '7',\n            '༨': '8',\n            '༩': '9',\n            '༠': '0',\n        };\n\n    var bo = moment.defineLocale('bo', {\n        months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(\n                '_'\n            ),\n        monthsShortRegex: /^(ཟླ་\\d{1,2})/,\n        monthsParseExact: true,\n        weekdays:\n            'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(\n                '_'\n            ),\n        weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split(\n            '_'\n        ),\n        weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm',\n            LTS: 'A h:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm',\n        },\n        calendar: {\n            sameDay: '[དི་རིང] LT',\n            nextDay: '[སང་ཉིན] LT',\n            nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT',\n            lastDay: '[ཁ་སང] LT',\n            lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ལ་',\n            past: '%s སྔན་ལ',\n            s: 'ལམ་སང',\n            ss: '%d སྐར་ཆ།',\n            m: 'སྐར་མ་གཅིག',\n            mm: '%d སྐར་མ',\n            h: 'ཆུ་ཚོད་གཅིག',\n            hh: '%d ཆུ་ཚོད',\n            d: 'ཉིན་གཅིག',\n            dd: '%d ཉིན་',\n            M: 'ཟླ་བ་གཅིག',\n            MM: '%d ཟླ་བ',\n            y: 'ལོ་གཅིག',\n            yy: '%d ལོ',\n        },\n        preparse: function (string) {\n            return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (\n                (meridiem === 'མཚན་མོ' && hour >= 4) ||\n                (meridiem === 'ཉིན་གུང' && hour < 5) ||\n                meridiem === 'དགོང་དག'\n            ) {\n                return hour + 12;\n            } else {\n                return hour;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'མཚན་མོ';\n            } else if (hour < 10) {\n                return 'ཞོགས་ཀས';\n            } else if (hour < 17) {\n                return 'ཉིན་གུང';\n            } else if (hour < 20) {\n                return 'དགོང་དག';\n            } else {\n                return 'མཚན་མོ';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return bo;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/bo.js?");

/***/ }),

/***/ "./node_modules/moment/locale/br.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/br.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Breton [br]\n//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function relativeTimeWithMutation(number, withoutSuffix, key) {\n        var format = {\n            mm: 'munutenn',\n            MM: 'miz',\n            dd: 'devezh',\n        };\n        return number + ' ' + mutation(format[key], number);\n    }\n    function specialMutationForYears(number) {\n        switch (lastNumber(number)) {\n            case 1:\n            case 3:\n            case 4:\n            case 5:\n            case 9:\n                return number + ' bloaz';\n            default:\n                return number + ' vloaz';\n        }\n    }\n    function lastNumber(number) {\n        if (number > 9) {\n            return lastNumber(number % 10);\n        }\n        return number;\n    }\n    function mutation(text, number) {\n        if (number === 2) {\n            return softMutation(text);\n        }\n        return text;\n    }\n    function softMutation(text) {\n        var mutationTable = {\n            m: 'v',\n            b: 'v',\n            d: 'z',\n        };\n        if (mutationTable[text.charAt(0)] === undefined) {\n            return text;\n        }\n        return mutationTable[text.charAt(0)] + text.substring(1);\n    }\n\n    var monthsParse = [\n            /^gen/i,\n            /^c[ʼ\\']hwe/i,\n            /^meu/i,\n            /^ebr/i,\n            /^mae/i,\n            /^(mez|eve)/i,\n            /^gou/i,\n            /^eos/i,\n            /^gwe/i,\n            /^her/i,\n            /^du/i,\n            /^ker/i,\n        ],\n        monthsRegex =\n            /^(genver|c[ʼ\\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,\n        monthsStrictRegex =\n            /^(genver|c[ʼ\\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,\n        monthsShortStrictRegex =\n            /^(gen|c[ʼ\\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,\n        fullWeekdaysParse = [\n            /^sul/i,\n            /^lun/i,\n            /^meurzh/i,\n            /^merc[ʼ\\']her/i,\n            /^yaou/i,\n            /^gwener/i,\n            /^sadorn/i,\n        ],\n        shortWeekdaysParse = [\n            /^Sul/i,\n            /^Lun/i,\n            /^Meu/i,\n            /^Mer/i,\n            /^Yao/i,\n            /^Gwe/i,\n            /^Sad/i,\n        ],\n        minWeekdaysParse = [\n            /^Su/i,\n            /^Lu/i,\n            /^Me([^r]|$)/i,\n            /^Mer/i,\n            /^Ya/i,\n            /^Gw/i,\n            /^Sa/i,\n        ];\n\n    var br = moment.defineLocale('br', {\n        months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split(\n            '_'\n        ),\n        monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),\n        weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),\n        weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),\n        weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),\n        weekdaysParse: minWeekdaysParse,\n        fullWeekdaysParse: fullWeekdaysParse,\n        shortWeekdaysParse: shortWeekdaysParse,\n        minWeekdaysParse: minWeekdaysParse,\n\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex: monthsStrictRegex,\n        monthsShortStrictRegex: monthsShortStrictRegex,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [a viz] MMMM YYYY',\n            LLL: 'D [a viz] MMMM YYYY HH:mm',\n            LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Hiziv da] LT',\n            nextDay: '[Warcʼhoazh da] LT',\n            nextWeek: 'dddd [da] LT',\n            lastDay: '[Decʼh da] LT',\n            lastWeek: 'dddd [paset da] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'a-benn %s',\n            past: '%s ʼzo',\n            s: 'un nebeud segondennoù',\n            ss: '%d eilenn',\n            m: 'ur vunutenn',\n            mm: relativeTimeWithMutation,\n            h: 'un eur',\n            hh: '%d eur',\n            d: 'un devezh',\n            dd: relativeTimeWithMutation,\n            M: 'ur miz',\n            MM: relativeTimeWithMutation,\n            y: 'ur bloaz',\n            yy: specialMutationForYears,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(añ|vet)/,\n        ordinal: function (number) {\n            var output = number === 1 ? 'añ' : 'vet';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n        meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn\n        isPM: function (token) {\n            return token === 'g.m.';\n        },\n        meridiem: function (hour, minute, isLower) {\n            return hour < 12 ? 'a.m.' : 'g.m.';\n        },\n    });\n\n    return br;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/br.js?");

/***/ }),

/***/ "./node_modules/moment/locale/bs.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/bs.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Bosnian [bs]\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n            case 'ss':\n                if (number === 1) {\n                    result += 'sekunda';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'sekunde';\n                } else {\n                    result += 'sekundi';\n                }\n                return result;\n            case 'm':\n                return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n            case 'mm':\n                if (number === 1) {\n                    result += 'minuta';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'minute';\n                } else {\n                    result += 'minuta';\n                }\n                return result;\n            case 'h':\n                return withoutSuffix ? 'jedan sat' : 'jednog sata';\n            case 'hh':\n                if (number === 1) {\n                    result += 'sat';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'sata';\n                } else {\n                    result += 'sati';\n                }\n                return result;\n            case 'dd':\n                if (number === 1) {\n                    result += 'dan';\n                } else {\n                    result += 'dana';\n                }\n                return result;\n            case 'MM':\n                if (number === 1) {\n                    result += 'mjesec';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'mjeseca';\n                } else {\n                    result += 'mjeseci';\n                }\n                return result;\n            case 'yy':\n                if (number === 1) {\n                    result += 'godina';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'godine';\n                } else {\n                    result += 'godina';\n                }\n                return result;\n        }\n    }\n\n    var bs = moment.defineLocale('bs', {\n        months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(\n            '_'\n        ),\n        weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd, D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[u] [nedjelju] [u] LT';\n                    case 3:\n                        return '[u] [srijedu] [u] LT';\n                    case 6:\n                        return '[u] [subotu] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[u] dddd [u] LT';\n                }\n            },\n            lastDay: '[jučer u] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                        return '[prošlu] dddd [u] LT';\n                    case 6:\n                        return '[prošle] [subote] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'prije %s',\n            s: 'par sekundi',\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: 'dan',\n            dd: translate,\n            M: 'mjesec',\n            MM: translate,\n            y: 'godinu',\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return bs;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/bs.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ca.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ca.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Catalan [ca]\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ca = moment.defineLocale('ca', {\n        months: {\n            standalone:\n                'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(\n                    '_'\n                ),\n            format: \"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre\".split(\n                '_'\n            ),\n            isFormat: /D[oD]?(\\s)+MMMM/,\n        },\n        monthsShort:\n            'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split(\n                '_'\n            ),\n        weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),\n        weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM [de] YYYY',\n            ll: 'D MMM YYYY',\n            LLL: 'D MMMM [de] YYYY [a les] H:mm',\n            lll: 'D MMM YYYY, H:mm',\n            LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',\n            llll: 'ddd D MMM YYYY, H:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';\n            },\n            nextDay: function () {\n                return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';\n            },\n            lastDay: function () {\n                return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [passat a ' +\n                    (this.hours() !== 1 ? 'les' : 'la') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: \"d'aquí %s\",\n            past: 'fa %s',\n            s: 'uns segons',\n            ss: '%d segons',\n            m: 'un minut',\n            mm: '%d minuts',\n            h: 'una hora',\n            hh: '%d hores',\n            d: 'un dia',\n            dd: '%d dies',\n            M: 'un mes',\n            MM: '%d mesos',\n            y: 'un any',\n            yy: '%d anys',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(r|n|t|è|a)/,\n        ordinal: function (number, period) {\n            var output =\n                number === 1\n                    ? 'r'\n                    : number === 2\n                    ? 'n'\n                    : number === 3\n                    ? 'r'\n                    : number === 4\n                    ? 't'\n                    : 'è';\n            if (period === 'w' || period === 'W') {\n                output = 'a';\n            }\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ca;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ca.js?");

/***/ }),

/***/ "./node_modules/moment/locale/cs.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/cs.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Czech [cs]\n//! author : petrbela : https://github.com/petrbela\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = {\n            format: 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(\n                '_'\n            ),\n            standalone:\n                'ledna_února_března_dubna_května_června_července_srpna_září_října_listopadu_prosince'.split(\n                    '_'\n                ),\n        },\n        monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),\n        monthsParse = [\n            /^led/i,\n            /^úno/i,\n            /^bře/i,\n            /^dub/i,\n            /^kvě/i,\n            /^(čvn|červen$|června)/i,\n            /^(čvc|červenec|července)/i,\n            /^srp/i,\n            /^zář/i,\n            /^říj/i,\n            /^lis/i,\n            /^pro/i,\n        ],\n        // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.\n        // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.\n        monthsRegex =\n            /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;\n\n    function plural(n) {\n        return n > 1 && n < 5 && ~~(n / 10) !== 1;\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n            case 's': // a few seconds / in a few seconds / a few seconds ago\n                return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';\n            case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'sekundy' : 'sekund');\n                } else {\n                    return result + 'sekundami';\n                }\n            case 'm': // a minute / in a minute / a minute ago\n                return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';\n            case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'minuty' : 'minut');\n                } else {\n                    return result + 'minutami';\n                }\n            case 'h': // an hour / in an hour / an hour ago\n                return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';\n            case 'hh': // 9 hours / in 9 hours / 9 hours ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'hodiny' : 'hodin');\n                } else {\n                    return result + 'hodinami';\n                }\n            case 'd': // a day / in a day / a day ago\n                return withoutSuffix || isFuture ? 'den' : 'dnem';\n            case 'dd': // 9 days / in 9 days / 9 days ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'dny' : 'dní');\n                } else {\n                    return result + 'dny';\n                }\n            case 'M': // a month / in a month / a month ago\n                return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';\n            case 'MM': // 9 months / in 9 months / 9 months ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'měsíce' : 'měsíců');\n                } else {\n                    return result + 'měsíci';\n                }\n            case 'y': // a year / in a year / a year ago\n                return withoutSuffix || isFuture ? 'rok' : 'rokem';\n            case 'yy': // 9 years / in 9 years / 9 years ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'roky' : 'let');\n                } else {\n                    return result + 'lety';\n                }\n        }\n    }\n\n    var cs = moment.defineLocale('cs', {\n        months: months,\n        monthsShort: monthsShort,\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.\n        // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.\n        monthsStrictRegex:\n            /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,\n        monthsShortStrictRegex:\n            /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),\n        weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),\n        weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd D. MMMM YYYY H:mm',\n            l: 'D. M. YYYY',\n        },\n        calendar: {\n            sameDay: '[dnes v] LT',\n            nextDay: '[zítra v] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[v neděli v] LT';\n                    case 1:\n                    case 2:\n                        return '[v] dddd [v] LT';\n                    case 3:\n                        return '[ve středu v] LT';\n                    case 4:\n                        return '[ve čtvrtek v] LT';\n                    case 5:\n                        return '[v pátek v] LT';\n                    case 6:\n                        return '[v sobotu v] LT';\n                }\n            },\n            lastDay: '[včera v] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[minulou neděli v] LT';\n                    case 1:\n                    case 2:\n                        return '[minulé] dddd [v] LT';\n                    case 3:\n                        return '[minulou středu v] LT';\n                    case 4:\n                    case 5:\n                        return '[minulý] dddd [v] LT';\n                    case 6:\n                        return '[minulou sobotu v] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'před %s',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return cs;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/cs.js?");

/***/ }),

/***/ "./node_modules/moment/locale/cv.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/cv.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Chuvash [cv]\n//! author : Anatoly Mironov : https://github.com/mirontoli\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var cv = moment.defineLocale('cv', {\n        months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split(\n            '_'\n        ),\n        monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),\n        weekdays:\n            'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split(\n                '_'\n            ),\n        weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),\n        weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD-MM-YYYY',\n            LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',\n            LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',\n            LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',\n        },\n        calendar: {\n            sameDay: '[Паян] LT [сехетре]',\n            nextDay: '[Ыран] LT [сехетре]',\n            lastDay: '[Ӗнер] LT [сехетре]',\n            nextWeek: '[Ҫитес] dddd LT [сехетре]',\n            lastWeek: '[Иртнӗ] dddd LT [сехетре]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: function (output) {\n                var affix = /сехет$/i.exec(output)\n                    ? 'рен'\n                    : /ҫул$/i.exec(output)\n                    ? 'тан'\n                    : 'ран';\n                return output + affix;\n            },\n            past: '%s каялла',\n            s: 'пӗр-ик ҫеккунт',\n            ss: '%d ҫеккунт',\n            m: 'пӗр минут',\n            mm: '%d минут',\n            h: 'пӗр сехет',\n            hh: '%d сехет',\n            d: 'пӗр кун',\n            dd: '%d кун',\n            M: 'пӗр уйӑх',\n            MM: '%d уйӑх',\n            y: 'пӗр ҫул',\n            yy: '%d ҫул',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-мӗш/,\n        ordinal: '%d-мӗш',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return cv;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/cv.js?");

/***/ }),

/***/ "./node_modules/moment/locale/cy.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/cy.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Welsh [cy]\n//! author : Robert Allen : https://github.com/robgallen\n//! author : https://github.com/ryangreaves\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var cy = moment.defineLocale('cy', {\n        months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split(\n            '_'\n        ),\n        monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split(\n            '_'\n        ),\n        weekdays:\n            'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split(\n                '_'\n            ),\n        weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),\n        weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),\n        weekdaysParseExact: true,\n        // time formats are the same as en-gb\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Heddiw am] LT',\n            nextDay: '[Yfory am] LT',\n            nextWeek: 'dddd [am] LT',\n            lastDay: '[Ddoe am] LT',\n            lastWeek: 'dddd [diwethaf am] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'mewn %s',\n            past: '%s yn ôl',\n            s: 'ychydig eiliadau',\n            ss: '%d eiliad',\n            m: 'munud',\n            mm: '%d munud',\n            h: 'awr',\n            hh: '%d awr',\n            d: 'diwrnod',\n            dd: '%d diwrnod',\n            M: 'mis',\n            MM: '%d mis',\n            y: 'blwyddyn',\n            yy: '%d flynedd',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,\n        // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh\n        ordinal: function (number) {\n            var b = number,\n                output = '',\n                lookup = [\n                    '',\n                    'af',\n                    'il',\n                    'ydd',\n                    'ydd',\n                    'ed',\n                    'ed',\n                    'ed',\n                    'fed',\n                    'fed',\n                    'fed', // 1af to 10fed\n                    'eg',\n                    'fed',\n                    'eg',\n                    'eg',\n                    'fed',\n                    'eg',\n                    'eg',\n                    'fed',\n                    'eg',\n                    'fed', // 11eg to 20fed\n                ];\n            if (b > 20) {\n                if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {\n                    output = 'fed'; // not 30ain, 70ain or 90ain\n                } else {\n                    output = 'ain';\n                }\n            } else if (b > 0) {\n                output = lookup[b];\n            }\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return cy;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/cy.js?");

/***/ }),

/***/ "./node_modules/moment/locale/da.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/da.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Danish [da]\n//! author : Ulrik Nielsen : https://github.com/mrbase\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var da = moment.defineLocale('da', {\n        months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'),\n        weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY HH:mm',\n            LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm',\n        },\n        calendar: {\n            sameDay: '[i dag kl.] LT',\n            nextDay: '[i morgen kl.] LT',\n            nextWeek: 'på dddd [kl.] LT',\n            lastDay: '[i går kl.] LT',\n            lastWeek: '[i] dddd[s kl.] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'om %s',\n            past: '%s siden',\n            s: 'få sekunder',\n            ss: '%d sekunder',\n            m: 'et minut',\n            mm: '%d minutter',\n            h: 'en time',\n            hh: '%d timer',\n            d: 'en dag',\n            dd: '%d dage',\n            M: 'en måned',\n            MM: '%d måneder',\n            y: 'et år',\n            yy: '%d år',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return da;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/da.js?");

/***/ }),

/***/ "./node_modules/moment/locale/de-at.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/de-at.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : German (Austria) [de-at]\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Martin Groller : https://github.com/MadMG\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            m: ['eine Minute', 'einer Minute'],\n            h: ['eine Stunde', 'einer Stunde'],\n            d: ['ein Tag', 'einem Tag'],\n            dd: [number + ' Tage', number + ' Tagen'],\n            w: ['eine Woche', 'einer Woche'],\n            M: ['ein Monat', 'einem Monat'],\n            MM: [number + ' Monate', number + ' Monaten'],\n            y: ['ein Jahr', 'einem Jahr'],\n            yy: [number + ' Jahre', number + ' Jahren'],\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var deAt = moment.defineLocale('de-at', {\n        months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n            '_'\n        ),\n        monthsShort:\n            'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),\n        monthsParseExact: true,\n        weekdays:\n            'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n                '_'\n            ),\n        weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY HH:mm',\n            LLLL: 'dddd, D. MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: 'vor %s',\n            s: 'ein paar Sekunden',\n            ss: '%d Sekunden',\n            m: processRelativeTime,\n            mm: '%d Minuten',\n            h: processRelativeTime,\n            hh: '%d Stunden',\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            w: processRelativeTime,\n            ww: '%d Wochen',\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return deAt;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/de-at.js?");

/***/ }),

/***/ "./node_modules/moment/locale/de-ch.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/de-ch.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : German (Switzerland) [de-ch]\n//! author : sschueller : https://github.com/sschueller\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            m: ['eine Minute', 'einer Minute'],\n            h: ['eine Stunde', 'einer Stunde'],\n            d: ['ein Tag', 'einem Tag'],\n            dd: [number + ' Tage', number + ' Tagen'],\n            w: ['eine Woche', 'einer Woche'],\n            M: ['ein Monat', 'einem Monat'],\n            MM: [number + ' Monate', number + ' Monaten'],\n            y: ['ein Jahr', 'einem Jahr'],\n            yy: [number + ' Jahre', number + ' Jahren'],\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var deCh = moment.defineLocale('de-ch', {\n        months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n            '_'\n        ),\n        monthsShort:\n            'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),\n        monthsParseExact: true,\n        weekdays:\n            'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n                '_'\n            ),\n        weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY HH:mm',\n            LLLL: 'dddd, D. MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: 'vor %s',\n            s: 'ein paar Sekunden',\n            ss: '%d Sekunden',\n            m: processRelativeTime,\n            mm: '%d Minuten',\n            h: processRelativeTime,\n            hh: '%d Stunden',\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            w: processRelativeTime,\n            ww: '%d Wochen',\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return deCh;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/de-ch.js?");

/***/ }),

/***/ "./node_modules/moment/locale/de.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/de.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : German [de]\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            m: ['eine Minute', 'einer Minute'],\n            h: ['eine Stunde', 'einer Stunde'],\n            d: ['ein Tag', 'einem Tag'],\n            dd: [number + ' Tage', number + ' Tagen'],\n            w: ['eine Woche', 'einer Woche'],\n            M: ['ein Monat', 'einem Monat'],\n            MM: [number + ' Monate', number + ' Monaten'],\n            y: ['ein Jahr', 'einem Jahr'],\n            yy: [number + ' Jahre', number + ' Jahren'],\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var de = moment.defineLocale('de', {\n        months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n            '_'\n        ),\n        monthsShort:\n            'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),\n        monthsParseExact: true,\n        weekdays:\n            'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n                '_'\n            ),\n        weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY HH:mm',\n            LLLL: 'dddd, D. MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: 'vor %s',\n            s: 'ein paar Sekunden',\n            ss: '%d Sekunden',\n            m: processRelativeTime,\n            mm: '%d Minuten',\n            h: processRelativeTime,\n            hh: '%d Stunden',\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            w: processRelativeTime,\n            ww: '%d Wochen',\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return de;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/de.js?");

/***/ }),

/***/ "./node_modules/moment/locale/dv.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/dv.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Maldivian [dv]\n//! author : Jawish Hameed : https://github.com/jawish\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'ޖެނުއަރީ',\n            'ފެބްރުއަރީ',\n            'މާރިޗު',\n            'އޭޕްރީލު',\n            'މޭ',\n            'ޖޫން',\n            'ޖުލައި',\n            'އޯގަސްޓު',\n            'ސެޕްޓެމްބަރު',\n            'އޮކްޓޯބަރު',\n            'ނޮވެމްބަރު',\n            'ޑިސެމްބަރު',\n        ],\n        weekdays = [\n            'އާދިއްތަ',\n            'ހޯމަ',\n            'އަންގާރަ',\n            'ބުދަ',\n            'ބުރާސްފަތި',\n            'ހުކުރު',\n            'ހޮނިހިރު',\n        ];\n\n    var dv = moment.defineLocale('dv', {\n        months: months,\n        monthsShort: months,\n        weekdays: weekdays,\n        weekdaysShort: weekdays,\n        weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'D/M/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /މކ|މފ/,\n        isPM: function (input) {\n            return 'މފ' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'މކ';\n            } else {\n                return 'މފ';\n            }\n        },\n        calendar: {\n            sameDay: '[މިއަދު] LT',\n            nextDay: '[މާދަމާ] LT',\n            nextWeek: 'dddd LT',\n            lastDay: '[އިއްޔެ] LT',\n            lastWeek: '[ފާއިތުވި] dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ތެރޭގައި %s',\n            past: 'ކުރިން %s',\n            s: 'ސިކުންތުކޮޅެއް',\n            ss: 'd% ސިކުންތު',\n            m: 'މިނިޓެއް',\n            mm: 'މިނިޓު %d',\n            h: 'ގަޑިއިރެއް',\n            hh: 'ގަޑިއިރު %d',\n            d: 'ދުވަހެއް',\n            dd: 'ދުވަސް %d',\n            M: 'މަހެއް',\n            MM: 'މަސް %d',\n            y: 'އަހަރެއް',\n            yy: 'އަހަރު %d',\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            dow: 7, // Sunday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return dv;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/dv.js?");

/***/ }),

/***/ "./node_modules/moment/locale/el.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/el.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Greek [el]\n//! author : Aggelos Karalias : https://github.com/mehiel\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function isFunction(input) {\n        return (\n            (typeof Function !== 'undefined' && input instanceof Function) ||\n            Object.prototype.toString.call(input) === '[object Function]'\n        );\n    }\n\n    var el = moment.defineLocale('el', {\n        monthsNominativeEl:\n            'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split(\n                '_'\n            ),\n        monthsGenitiveEl:\n            'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split(\n                '_'\n            ),\n        months: function (momentToFormat, format) {\n            if (!momentToFormat) {\n                return this._monthsNominativeEl;\n            } else if (\n                typeof format === 'string' &&\n                /D/.test(format.substring(0, format.indexOf('MMMM')))\n            ) {\n                // if there is a day number before 'MMMM'\n                return this._monthsGenitiveEl[momentToFormat.month()];\n            } else {\n                return this._monthsNominativeEl[momentToFormat.month()];\n            }\n        },\n        monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),\n        weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split(\n            '_'\n        ),\n        weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),\n        weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),\n        meridiem: function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'μμ' : 'ΜΜ';\n            } else {\n                return isLower ? 'πμ' : 'ΠΜ';\n            }\n        },\n        isPM: function (input) {\n            return (input + '').toLowerCase()[0] === 'μ';\n        },\n        meridiemParse: /[ΠΜ]\\.?Μ?\\.?/i,\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendarEl: {\n            sameDay: '[Σήμερα {}] LT',\n            nextDay: '[Αύριο {}] LT',\n            nextWeek: 'dddd [{}] LT',\n            lastDay: '[Χθες {}] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 6:\n                        return '[το προηγούμενο] dddd [{}] LT';\n                    default:\n                        return '[την προηγούμενη] dddd [{}] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        calendar: function (key, mom) {\n            var output = this._calendarEl[key],\n                hours = mom && mom.hours();\n            if (isFunction(output)) {\n                output = output.apply(mom);\n            }\n            return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');\n        },\n        relativeTime: {\n            future: 'σε %s',\n            past: '%s πριν',\n            s: 'λίγα δευτερόλεπτα',\n            ss: '%d δευτερόλεπτα',\n            m: 'ένα λεπτό',\n            mm: '%d λεπτά',\n            h: 'μία ώρα',\n            hh: '%d ώρες',\n            d: 'μία μέρα',\n            dd: '%d μέρες',\n            M: 'ένας μήνας',\n            MM: '%d μήνες',\n            y: 'ένας χρόνος',\n            yy: '%d χρόνια',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}η/,\n        ordinal: '%dη',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4st is the first week of the year.\n        },\n    });\n\n    return el;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/el.js?");

/***/ }),

/***/ "./node_modules/moment/locale/en-au.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/en-au.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : English (Australia) [en-au]\n//! author : Jared Morse : https://github.com/jarcoal\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enAu = moment.defineLocale('en-au', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enAu;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/en-au.js?");

/***/ }),

/***/ "./node_modules/moment/locale/en-ca.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/en-ca.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : English (Canada) [en-ca]\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enCa = moment.defineLocale('en-ca', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'YYYY-MM-DD',\n            LL: 'MMMM D, YYYY',\n            LLL: 'MMMM D, YYYY h:mm A',\n            LLLL: 'dddd, MMMM D, YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n    });\n\n    return enCa;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/en-ca.js?");

/***/ }),

/***/ "./node_modules/moment/locale/en-gb.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/en-gb.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : English (United Kingdom) [en-gb]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enGb = moment.defineLocale('en-gb', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enGb;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/en-gb.js?");

/***/ }),

/***/ "./node_modules/moment/locale/en-ie.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/en-ie.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : English (Ireland) [en-ie]\n//! author : Chris Cartlidge : https://github.com/chriscartlidge\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enIe = moment.defineLocale('en-ie', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enIe;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/en-ie.js?");

/***/ }),

/***/ "./node_modules/moment/locale/en-il.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/en-il.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : English (Israel) [en-il]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enIl = moment.defineLocale('en-il', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n    });\n\n    return enIl;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/en-il.js?");

/***/ }),

/***/ "./node_modules/moment/locale/en-in.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/en-in.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : English (India) [en-in]\n//! author : Jatin Agrawal : https://github.com/jatinag22\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enIn = moment.defineLocale('en-in', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 1st is the first week of the year.\n        },\n    });\n\n    return enIn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/en-in.js?");

/***/ }),

/***/ "./node_modules/moment/locale/en-nz.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/en-nz.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : English (New Zealand) [en-nz]\n//! author : Luke McGregor : https://github.com/lukemcgregor\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enNz = moment.defineLocale('en-nz', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enNz;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/en-nz.js?");

/***/ }),

/***/ "./node_modules/moment/locale/en-sg.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/en-sg.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : English (Singapore) [en-sg]\n//! author : Matthew Castrillon-Madrigal : https://github.com/techdimension\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enSg = moment.defineLocale('en-sg', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enSg;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/en-sg.js?");

/***/ }),

/***/ "./node_modules/moment/locale/eo.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/eo.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Esperanto [eo]\n//! author : Colin Dean : https://github.com/colindean\n//! author : Mia Nordentoft Imperatori : https://github.com/miestasmia\n//! comment : miestasmia corrected the translation by colindean\n//! comment : Vivakvo corrected the translation by colindean and miestasmia\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var eo = moment.defineLocale('eo', {\n        months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec'.split('_'),\n        weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),\n        weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),\n        weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: '[la] D[-an de] MMMM, YYYY',\n            LLL: '[la] D[-an de] MMMM, YYYY HH:mm',\n            LLLL: 'dddd[n], [la] D[-an de] MMMM, YYYY HH:mm',\n            llll: 'ddd, [la] D[-an de] MMM, YYYY HH:mm',\n        },\n        meridiemParse: /[ap]\\.t\\.m/i,\n        isPM: function (input) {\n            return input.charAt(0).toLowerCase() === 'p';\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'p.t.m.' : 'P.T.M.';\n            } else {\n                return isLower ? 'a.t.m.' : 'A.T.M.';\n            }\n        },\n        calendar: {\n            sameDay: '[Hodiaŭ je] LT',\n            nextDay: '[Morgaŭ je] LT',\n            nextWeek: 'dddd[n je] LT',\n            lastDay: '[Hieraŭ je] LT',\n            lastWeek: '[pasintan] dddd[n je] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'post %s',\n            past: 'antaŭ %s',\n            s: 'kelkaj sekundoj',\n            ss: '%d sekundoj',\n            m: 'unu minuto',\n            mm: '%d minutoj',\n            h: 'unu horo',\n            hh: '%d horoj',\n            d: 'unu tago', //ne 'diurno', ĉar estas uzita por proksimumo\n            dd: '%d tagoj',\n            M: 'unu monato',\n            MM: '%d monatoj',\n            y: 'unu jaro',\n            yy: '%d jaroj',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}a/,\n        ordinal: '%da',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return eo;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/eo.js?");

/***/ }),

/***/ "./node_modules/moment/locale/es-do.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/es-do.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Spanish (Dominican Republic) [es-do]\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortDot =\n            'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n                '_'\n            ),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n        monthsParse = [\n            /^ene/i,\n            /^feb/i,\n            /^mar/i,\n            /^abr/i,\n            /^may/i,\n            /^jun/i,\n            /^jul/i,\n            /^ago/i,\n            /^sep/i,\n            /^oct/i,\n            /^nov/i,\n            /^dic/i,\n        ],\n        monthsRegex =\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n    var esDo = moment.defineLocale('es-do', {\n        months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortDot;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n        monthsShortStrictRegex:\n            /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY h:mm A',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastDay: function () {\n                return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [pasado a la' +\n                    (this.hours() !== 1 ? 's' : '') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'en %s',\n            past: 'hace %s',\n            s: 'unos segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'una hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            w: 'una semana',\n            ww: '%d semanas',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un año',\n            yy: '%d años',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return esDo;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/es-do.js?");

/***/ }),

/***/ "./node_modules/moment/locale/es-mx.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/es-mx.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Spanish (Mexico) [es-mx]\n//! author : JC Franco : https://github.com/jcfranco\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortDot =\n            'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n                '_'\n            ),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n        monthsParse = [\n            /^ene/i,\n            /^feb/i,\n            /^mar/i,\n            /^abr/i,\n            /^may/i,\n            /^jun/i,\n            /^jul/i,\n            /^ago/i,\n            /^sep/i,\n            /^oct/i,\n            /^nov/i,\n            /^dic/i,\n        ],\n        monthsRegex =\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n    var esMx = moment.defineLocale('es-mx', {\n        months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortDot;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n        monthsShortStrictRegex:\n            /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY H:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastDay: function () {\n                return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [pasado a la' +\n                    (this.hours() !== 1 ? 's' : '') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'en %s',\n            past: 'hace %s',\n            s: 'unos segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'una hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            w: 'una semana',\n            ww: '%d semanas',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un año',\n            yy: '%d años',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n        invalidDate: 'Fecha inválida',\n    });\n\n    return esMx;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/es-mx.js?");

/***/ }),

/***/ "./node_modules/moment/locale/es-us.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/es-us.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Spanish (United States) [es-us]\n//! author : bustta : https://github.com/bustta\n//! author : chrisrodz : https://github.com/chrisrodz\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortDot =\n            'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n                '_'\n            ),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n        monthsParse = [\n            /^ene/i,\n            /^feb/i,\n            /^mar/i,\n            /^abr/i,\n            /^may/i,\n            /^jun/i,\n            /^jul/i,\n            /^ago/i,\n            /^sep/i,\n            /^oct/i,\n            /^nov/i,\n            /^dic/i,\n        ],\n        monthsRegex =\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n    var esUs = moment.defineLocale('es-us', {\n        months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortDot;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n        monthsShortStrictRegex:\n            /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'MM/DD/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY h:mm A',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastDay: function () {\n                return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [pasado a la' +\n                    (this.hours() !== 1 ? 's' : '') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'en %s',\n            past: 'hace %s',\n            s: 'unos segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'una hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            w: 'una semana',\n            ww: '%d semanas',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un año',\n            yy: '%d años',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return esUs;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/es-us.js?");

/***/ }),

/***/ "./node_modules/moment/locale/es.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/es.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Spanish [es]\n//! author : Julio Napurí : https://github.com/julionc\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortDot =\n            'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n                '_'\n            ),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n        monthsParse = [\n            /^ene/i,\n            /^feb/i,\n            /^mar/i,\n            /^abr/i,\n            /^may/i,\n            /^jun/i,\n            /^jul/i,\n            /^ago/i,\n            /^sep/i,\n            /^oct/i,\n            /^nov/i,\n            /^dic/i,\n        ],\n        monthsRegex =\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n    var es = moment.defineLocale('es', {\n        months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortDot;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n        monthsShortStrictRegex:\n            /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY H:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastDay: function () {\n                return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [pasado a la' +\n                    (this.hours() !== 1 ? 's' : '') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'en %s',\n            past: 'hace %s',\n            s: 'unos segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'una hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            w: 'una semana',\n            ww: '%d semanas',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un año',\n            yy: '%d años',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n        invalidDate: 'Fecha inválida',\n    });\n\n    return es;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/es.js?");

/***/ }),

/***/ "./node_modules/moment/locale/et.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/et.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Estonian [et]\n//! author : Henry Kehlmann : https://github.com/madhenry\n//! improvements : Illimar Tambek : https://github.com/ragulka\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],\n            ss: [number + 'sekundi', number + 'sekundit'],\n            m: ['ühe minuti', 'üks minut'],\n            mm: [number + ' minuti', number + ' minutit'],\n            h: ['ühe tunni', 'tund aega', 'üks tund'],\n            hh: [number + ' tunni', number + ' tundi'],\n            d: ['ühe päeva', 'üks päev'],\n            M: ['kuu aja', 'kuu aega', 'üks kuu'],\n            MM: [number + ' kuu', number + ' kuud'],\n            y: ['ühe aasta', 'aasta', 'üks aasta'],\n            yy: [number + ' aasta', number + ' aastat'],\n        };\n        if (withoutSuffix) {\n            return format[key][2] ? format[key][2] : format[key][1];\n        }\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var et = moment.defineLocale('et', {\n        months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split(\n            '_'\n        ),\n        monthsShort:\n            'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),\n        weekdays:\n            'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split(\n                '_'\n            ),\n        weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),\n        weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd, D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[Täna,] LT',\n            nextDay: '[Homme,] LT',\n            nextWeek: '[Järgmine] dddd LT',\n            lastDay: '[Eile,] LT',\n            lastWeek: '[Eelmine] dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s pärast',\n            past: '%s tagasi',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: '%d päeva',\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return et;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/et.js?");

/***/ }),

/***/ "./node_modules/moment/locale/eu.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/eu.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Basque [eu]\n//! author : Eneko Illarramendi : https://github.com/eillarra\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var eu = moment.defineLocale('eu', {\n        months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split(\n            '_'\n        ),\n        monthsShort:\n            'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split(\n                '_'\n            ),\n        weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),\n        weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'YYYY[ko] MMMM[ren] D[a]',\n            LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',\n            LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',\n            l: 'YYYY-M-D',\n            ll: 'YYYY[ko] MMM D[a]',\n            lll: 'YYYY[ko] MMM D[a] HH:mm',\n            llll: 'ddd, YYYY[ko] MMM D[a] HH:mm',\n        },\n        calendar: {\n            sameDay: '[gaur] LT[etan]',\n            nextDay: '[bihar] LT[etan]',\n            nextWeek: 'dddd LT[etan]',\n            lastDay: '[atzo] LT[etan]',\n            lastWeek: '[aurreko] dddd LT[etan]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s barru',\n            past: 'duela %s',\n            s: 'segundo batzuk',\n            ss: '%d segundo',\n            m: 'minutu bat',\n            mm: '%d minutu',\n            h: 'ordu bat',\n            hh: '%d ordu',\n            d: 'egun bat',\n            dd: '%d egun',\n            M: 'hilabete bat',\n            MM: '%d hilabete',\n            y: 'urte bat',\n            yy: '%d urte',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return eu;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/eu.js?");

/***/ }),

/***/ "./node_modules/moment/locale/fa.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/fa.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Persian [fa]\n//! author : Ebrahim Byagowi : https://github.com/ebraminio\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '۱',\n            2: '۲',\n            3: '۳',\n            4: '۴',\n            5: '۵',\n            6: '۶',\n            7: '۷',\n            8: '۸',\n            9: '۹',\n            0: '۰',\n        },\n        numberMap = {\n            '۱': '1',\n            '۲': '2',\n            '۳': '3',\n            '۴': '4',\n            '۵': '5',\n            '۶': '6',\n            '۷': '7',\n            '۸': '8',\n            '۹': '9',\n            '۰': '0',\n        };\n\n    var fa = moment.defineLocale('fa', {\n        months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(\n                '_'\n            ),\n        weekdays:\n            'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split(\n                '_'\n            ),\n        weekdaysShort:\n            'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split(\n                '_'\n            ),\n        weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /قبل از ظهر|بعد از ظهر/,\n        isPM: function (input) {\n            return /بعد از ظهر/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'قبل از ظهر';\n            } else {\n                return 'بعد از ظهر';\n            }\n        },\n        calendar: {\n            sameDay: '[امروز ساعت] LT',\n            nextDay: '[فردا ساعت] LT',\n            nextWeek: 'dddd [ساعت] LT',\n            lastDay: '[دیروز ساعت] LT',\n            lastWeek: 'dddd [پیش] [ساعت] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'در %s',\n            past: '%s پیش',\n            s: 'چند ثانیه',\n            ss: '%d ثانیه',\n            m: 'یک دقیقه',\n            mm: '%d دقیقه',\n            h: 'یک ساعت',\n            hh: '%d ساعت',\n            d: 'یک روز',\n            dd: '%d روز',\n            M: 'یک ماه',\n            MM: '%d ماه',\n            y: 'یک سال',\n            yy: '%d سال',\n        },\n        preparse: function (string) {\n            return string\n                .replace(/[۰-۹]/g, function (match) {\n                    return numberMap[match];\n                })\n                .replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}م/,\n        ordinal: '%dم',\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return fa;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/fa.js?");

/***/ }),

/***/ "./node_modules/moment/locale/fi.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/fi.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Finnish [fi]\n//! author : Tarmo Aidantausta : https://github.com/bleadof\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var numbersPast =\n            'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(\n                ' '\n            ),\n        numbersFuture = [\n            'nolla',\n            'yhden',\n            'kahden',\n            'kolmen',\n            'neljän',\n            'viiden',\n            'kuuden',\n            numbersPast[7],\n            numbersPast[8],\n            numbersPast[9],\n        ];\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = '';\n        switch (key) {\n            case 's':\n                return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n            case 'ss':\n                result = isFuture ? 'sekunnin' : 'sekuntia';\n                break;\n            case 'm':\n                return isFuture ? 'minuutin' : 'minuutti';\n            case 'mm':\n                result = isFuture ? 'minuutin' : 'minuuttia';\n                break;\n            case 'h':\n                return isFuture ? 'tunnin' : 'tunti';\n            case 'hh':\n                result = isFuture ? 'tunnin' : 'tuntia';\n                break;\n            case 'd':\n                return isFuture ? 'päivän' : 'päivä';\n            case 'dd':\n                result = isFuture ? 'päivän' : 'päivää';\n                break;\n            case 'M':\n                return isFuture ? 'kuukauden' : 'kuukausi';\n            case 'MM':\n                result = isFuture ? 'kuukauden' : 'kuukautta';\n                break;\n            case 'y':\n                return isFuture ? 'vuoden' : 'vuosi';\n            case 'yy':\n                result = isFuture ? 'vuoden' : 'vuotta';\n                break;\n        }\n        result = verbalNumber(number, isFuture) + ' ' + result;\n        return result;\n    }\n    function verbalNumber(number, isFuture) {\n        return number < 10\n            ? isFuture\n                ? numbersFuture[number]\n                : numbersPast[number]\n            : number;\n    }\n\n    var fi = moment.defineLocale('fi', {\n        months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split(\n            '_'\n        ),\n        monthsShort:\n            'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split(\n                '_'\n            ),\n        weekdays:\n            'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split(\n                '_'\n            ),\n        weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),\n        weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD.MM.YYYY',\n            LL: 'Do MMMM[ta] YYYY',\n            LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',\n            LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',\n            l: 'D.M.YYYY',\n            ll: 'Do MMM YYYY',\n            lll: 'Do MMM YYYY, [klo] HH.mm',\n            llll: 'ddd, Do MMM YYYY, [klo] HH.mm',\n        },\n        calendar: {\n            sameDay: '[tänään] [klo] LT',\n            nextDay: '[huomenna] [klo] LT',\n            nextWeek: 'dddd [klo] LT',\n            lastDay: '[eilen] [klo] LT',\n            lastWeek: '[viime] dddd[na] [klo] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s päästä',\n            past: '%s sitten',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fi;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/fi.js?");

/***/ }),

/***/ "./node_modules/moment/locale/fil.js":
/*!*******************************************!*\
  !*** ./node_modules/moment/locale/fil.js ***!
  \*******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Filipino [fil]\n//! author : Dan Hagman : https://github.com/hagmandan\n//! author : Matthew Co : https://github.com/matthewdeeco\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var fil = moment.defineLocale('fil', {\n        months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(\n            '_'\n        ),\n        monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n        weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(\n            '_'\n        ),\n        weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n        weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'MM/D/YYYY',\n            LL: 'MMMM D, YYYY',\n            LLL: 'MMMM D, YYYY HH:mm',\n            LLLL: 'dddd, MMMM DD, YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: 'LT [ngayong araw]',\n            nextDay: '[Bukas ng] LT',\n            nextWeek: 'LT [sa susunod na] dddd',\n            lastDay: 'LT [kahapon]',\n            lastWeek: 'LT [noong nakaraang] dddd',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'sa loob ng %s',\n            past: '%s ang nakalipas',\n            s: 'ilang segundo',\n            ss: '%d segundo',\n            m: 'isang minuto',\n            mm: '%d minuto',\n            h: 'isang oras',\n            hh: '%d oras',\n            d: 'isang araw',\n            dd: '%d araw',\n            M: 'isang buwan',\n            MM: '%d buwan',\n            y: 'isang taon',\n            yy: '%d taon',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}/,\n        ordinal: function (number) {\n            return number;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fil;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/fil.js?");

/***/ }),

/***/ "./node_modules/moment/locale/fo.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/fo.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Faroese [fo]\n//! author : Ragnar Johannesen : https://github.com/ragnar123\n//! author : Kristian Sakarisson : https://github.com/sakarisson\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var fo = moment.defineLocale('fo', {\n        months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays:\n            'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split(\n                '_'\n            ),\n        weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),\n        weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D. MMMM, YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Í dag kl.] LT',\n            nextDay: '[Í morgin kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[Í gjár kl.] LT',\n            lastWeek: '[síðstu] dddd [kl] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'um %s',\n            past: '%s síðani',\n            s: 'fá sekund',\n            ss: '%d sekundir',\n            m: 'ein minuttur',\n            mm: '%d minuttir',\n            h: 'ein tími',\n            hh: '%d tímar',\n            d: 'ein dagur',\n            dd: '%d dagar',\n            M: 'ein mánaður',\n            MM: '%d mánaðir',\n            y: 'eitt ár',\n            yy: '%d ár',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fo;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/fo.js?");

/***/ }),

/***/ "./node_modules/moment/locale/fr-ca.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/fr-ca.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : French (Canada) [fr-ca]\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var frCa = moment.defineLocale('fr-ca', {\n        months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n            '_'\n        ),\n        monthsShort:\n            'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Aujourd’hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dans %s',\n            past: 'il y a %s',\n            s: 'quelques secondes',\n            ss: '%d secondes',\n            m: 'une minute',\n            mm: '%d minutes',\n            h: 'une heure',\n            hh: '%d heures',\n            d: 'un jour',\n            dd: '%d jours',\n            M: 'un mois',\n            MM: '%d mois',\n            y: 'un an',\n            yy: '%d ans',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(er|e)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // Words with masculine grammatical gender: mois, trimestre, jour\n                default:\n                case 'M':\n                case 'Q':\n                case 'D':\n                case 'DDD':\n                case 'd':\n                    return number + (number === 1 ? 'er' : 'e');\n\n                // Words with feminine grammatical gender: semaine\n                case 'w':\n                case 'W':\n                    return number + (number === 1 ? 're' : 'e');\n            }\n        },\n    });\n\n    return frCa;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/fr-ca.js?");

/***/ }),

/***/ "./node_modules/moment/locale/fr-ch.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/fr-ch.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : French (Switzerland) [fr-ch]\n//! author : Gaspard Bucher : https://github.com/gaspard\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var frCh = moment.defineLocale('fr-ch', {\n        months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n            '_'\n        ),\n        monthsShort:\n            'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Aujourd’hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dans %s',\n            past: 'il y a %s',\n            s: 'quelques secondes',\n            ss: '%d secondes',\n            m: 'une minute',\n            mm: '%d minutes',\n            h: 'une heure',\n            hh: '%d heures',\n            d: 'un jour',\n            dd: '%d jours',\n            M: 'un mois',\n            MM: '%d mois',\n            y: 'un an',\n            yy: '%d ans',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(er|e)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // Words with masculine grammatical gender: mois, trimestre, jour\n                default:\n                case 'M':\n                case 'Q':\n                case 'D':\n                case 'DDD':\n                case 'd':\n                    return number + (number === 1 ? 'er' : 'e');\n\n                // Words with feminine grammatical gender: semaine\n                case 'w':\n                case 'W':\n                    return number + (number === 1 ? 're' : 'e');\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return frCh;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/fr-ch.js?");

/***/ }),

/***/ "./node_modules/moment/locale/fr.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/fr.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : French [fr]\n//! author : John Fischer : https://github.com/jfroffice\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsStrictRegex =\n            /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n        monthsShortStrictRegex =\n            /(janv\\.?|févr\\.?|mars|avr\\.?|mai|juin|juil\\.?|août|sept\\.?|oct\\.?|nov\\.?|déc\\.?)/i,\n        monthsRegex =\n            /(janv\\.?|févr\\.?|mars|avr\\.?|mai|juin|juil\\.?|août|sept\\.?|oct\\.?|nov\\.?|déc\\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n        monthsParse = [\n            /^janv/i,\n            /^févr/i,\n            /^mars/i,\n            /^avr/i,\n            /^mai/i,\n            /^juin/i,\n            /^juil/i,\n            /^août/i,\n            /^sept/i,\n            /^oct/i,\n            /^nov/i,\n            /^déc/i,\n        ];\n\n    var fr = moment.defineLocale('fr', {\n        months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n            '_'\n        ),\n        monthsShort:\n            'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n                '_'\n            ),\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex: monthsStrictRegex,\n        monthsShortStrictRegex: monthsShortStrictRegex,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Aujourd’hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dans %s',\n            past: 'il y a %s',\n            s: 'quelques secondes',\n            ss: '%d secondes',\n            m: 'une minute',\n            mm: '%d minutes',\n            h: 'une heure',\n            hh: '%d heures',\n            d: 'un jour',\n            dd: '%d jours',\n            w: 'une semaine',\n            ww: '%d semaines',\n            M: 'un mois',\n            MM: '%d mois',\n            y: 'un an',\n            yy: '%d ans',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(er|)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // TODO: Return 'e' when day of month > 1. Move this case inside\n                // block for masculine words below.\n                // See https://github.com/moment/moment/issues/3375\n                case 'D':\n                    return number + (number === 1 ? 'er' : '');\n\n                // Words with masculine grammatical gender: mois, trimestre, jour\n                default:\n                case 'M':\n                case 'Q':\n                case 'DDD':\n                case 'd':\n                    return number + (number === 1 ? 'er' : 'e');\n\n                // Words with feminine grammatical gender: semaine\n                case 'w':\n                case 'W':\n                    return number + (number === 1 ? 're' : 'e');\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fr;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/fr.js?");

/***/ }),

/***/ "./node_modules/moment/locale/fy.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/fy.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Frisian [fy]\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortWithDots =\n            'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),\n        monthsShortWithoutDots =\n            'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');\n\n    var fy = moment.defineLocale('fy', {\n        months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortWithDots;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShortWithoutDots[m.month()];\n            } else {\n                return monthsShortWithDots[m.month()];\n            }\n        },\n        monthsParseExact: true,\n        weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split(\n            '_'\n        ),\n        weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),\n        weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD-MM-YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[hjoed om] LT',\n            nextDay: '[moarn om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[juster om] LT',\n            lastWeek: '[ôfrûne] dddd [om] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'oer %s',\n            past: '%s lyn',\n            s: 'in pear sekonden',\n            ss: '%d sekonden',\n            m: 'ien minút',\n            mm: '%d minuten',\n            h: 'ien oere',\n            hh: '%d oeren',\n            d: 'ien dei',\n            dd: '%d dagen',\n            M: 'ien moanne',\n            MM: '%d moannen',\n            y: 'ien jier',\n            yy: '%d jierren',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n        ordinal: function (number) {\n            return (\n                number +\n                (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n            );\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fy;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/fy.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ga.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ga.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Irish or Irish Gaelic [ga]\n//! author : André Silva : https://github.com/askpt\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'Eanáir',\n            'Feabhra',\n            'Márta',\n            'Aibreán',\n            'Bealtaine',\n            'Meitheamh',\n            'Iúil',\n            'Lúnasa',\n            'Meán Fómhair',\n            'Deireadh Fómhair',\n            'Samhain',\n            'Nollaig',\n        ],\n        monthsShort = [\n            'Ean',\n            'Feabh',\n            'Márt',\n            'Aib',\n            'Beal',\n            'Meith',\n            'Iúil',\n            'Lún',\n            'M.F.',\n            'D.F.',\n            'Samh',\n            'Noll',\n        ],\n        weekdays = [\n            'Dé Domhnaigh',\n            'Dé Luain',\n            'Dé Máirt',\n            'Dé Céadaoin',\n            'Déardaoin',\n            'Dé hAoine',\n            'Dé Sathairn',\n        ],\n        weekdaysShort = ['Domh', 'Luan', 'Máirt', 'Céad', 'Déar', 'Aoine', 'Sath'],\n        weekdaysMin = ['Do', 'Lu', 'Má', 'Cé', 'Dé', 'A', 'Sa'];\n\n    var ga = moment.defineLocale('ga', {\n        months: months,\n        monthsShort: monthsShort,\n        monthsParseExact: true,\n        weekdays: weekdays,\n        weekdaysShort: weekdaysShort,\n        weekdaysMin: weekdaysMin,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Inniu ag] LT',\n            nextDay: '[Amárach ag] LT',\n            nextWeek: 'dddd [ag] LT',\n            lastDay: '[Inné ag] LT',\n            lastWeek: 'dddd [seo caite] [ag] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'i %s',\n            past: '%s ó shin',\n            s: 'cúpla soicind',\n            ss: '%d soicind',\n            m: 'nóiméad',\n            mm: '%d nóiméad',\n            h: 'uair an chloig',\n            hh: '%d uair an chloig',\n            d: 'lá',\n            dd: '%d lá',\n            M: 'mí',\n            MM: '%d míonna',\n            y: 'bliain',\n            yy: '%d bliain',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(d|na|mh)/,\n        ordinal: function (number) {\n            var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ga;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ga.js?");

/***/ }),

/***/ "./node_modules/moment/locale/gd.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/gd.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Scottish Gaelic [gd]\n//! author : Jon Ashdown : https://github.com/jonashdown\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'Am Faoilleach',\n            'An Gearran',\n            'Am Màrt',\n            'An Giblean',\n            'An Cèitean',\n            'An t-Ògmhios',\n            'An t-Iuchar',\n            'An Lùnastal',\n            'An t-Sultain',\n            'An Dàmhair',\n            'An t-Samhain',\n            'An Dùbhlachd',\n        ],\n        monthsShort = [\n            'Faoi',\n            'Gear',\n            'Màrt',\n            'Gibl',\n            'Cèit',\n            'Ògmh',\n            'Iuch',\n            'Lùn',\n            'Sult',\n            'Dàmh',\n            'Samh',\n            'Dùbh',\n        ],\n        weekdays = [\n            'Didòmhnaich',\n            'Diluain',\n            'Dimàirt',\n            'Diciadain',\n            'Diardaoin',\n            'Dihaoine',\n            'Disathairne',\n        ],\n        weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],\n        weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];\n\n    var gd = moment.defineLocale('gd', {\n        months: months,\n        monthsShort: monthsShort,\n        monthsParseExact: true,\n        weekdays: weekdays,\n        weekdaysShort: weekdaysShort,\n        weekdaysMin: weekdaysMin,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[An-diugh aig] LT',\n            nextDay: '[A-màireach aig] LT',\n            nextWeek: 'dddd [aig] LT',\n            lastDay: '[An-dè aig] LT',\n            lastWeek: 'dddd [seo chaidh] [aig] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ann an %s',\n            past: 'bho chionn %s',\n            s: 'beagan diogan',\n            ss: '%d diogan',\n            m: 'mionaid',\n            mm: '%d mionaidean',\n            h: 'uair',\n            hh: '%d uairean',\n            d: 'latha',\n            dd: '%d latha',\n            M: 'mìos',\n            MM: '%d mìosan',\n            y: 'bliadhna',\n            yy: '%d bliadhna',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(d|na|mh)/,\n        ordinal: function (number) {\n            var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return gd;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/gd.js?");

/***/ }),

/***/ "./node_modules/moment/locale/gl.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/gl.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Galician [gl]\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var gl = moment.defineLocale('gl', {\n        months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split(\n            '_'\n        ),\n        monthsShort:\n            'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY H:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';\n            },\n            lastDay: function () {\n                return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: function (str) {\n                if (str.indexOf('un') === 0) {\n                    return 'n' + str;\n                }\n                return 'en ' + str;\n            },\n            past: 'hai %s',\n            s: 'uns segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'unha hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un ano',\n            yy: '%d anos',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return gl;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/gl.js?");

/***/ }),

/***/ "./node_modules/moment/locale/gom-deva.js":
/*!************************************************!*\
  !*** ./node_modules/moment/locale/gom-deva.js ***!
  \************************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Konkani Devanagari script [gom-deva]\n//! author : The Discoverer : https://github.com/WikiDiscoverer\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'],\n            ss: [number + ' सॅकंडांनी', number + ' सॅकंड'],\n            m: ['एका मिणटान', 'एक मिनूट'],\n            mm: [number + ' मिणटांनी', number + ' मिणटां'],\n            h: ['एका वरान', 'एक वर'],\n            hh: [number + ' वरांनी', number + ' वरां'],\n            d: ['एका दिसान', 'एक दीस'],\n            dd: [number + ' दिसांनी', number + ' दीस'],\n            M: ['एका म्हयन्यान', 'एक म्हयनो'],\n            MM: [number + ' म्हयन्यानी', number + ' म्हयने'],\n            y: ['एका वर्सान', 'एक वर्स'],\n            yy: [number + ' वर्सांनी', number + ' वर्सां'],\n        };\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var gomDeva = moment.defineLocale('gom-deva', {\n        months: {\n            standalone:\n                'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(\n                    '_'\n                ),\n            format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split(\n                '_'\n            ),\n            isFormat: /MMMM(\\s)+D[oD]?/,\n        },\n        monthsShort:\n            'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'),\n        weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'),\n        weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'A h:mm [वाजतां]',\n            LTS: 'A h:mm:ss [वाजतां]',\n            L: 'DD-MM-YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY A h:mm [वाजतां]',\n            LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]',\n            llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]',\n        },\n        calendar: {\n            sameDay: '[आयज] LT',\n            nextDay: '[फाल्यां] LT',\n            nextWeek: '[फुडलो] dddd[,] LT',\n            lastDay: '[काल] LT',\n            lastWeek: '[फाटलो] dddd[,] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s',\n            past: '%s आदीं',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(वेर)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // the ordinal 'वेर' only applies to day of the month\n                case 'D':\n                    return number + 'वेर';\n                default:\n                case 'M':\n                case 'Q':\n                case 'DDD':\n                case 'd':\n                case 'w':\n                case 'W':\n                    return number;\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week\n            doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)\n        },\n        meridiemParse: /राती|सकाळीं|दनपारां|सांजे/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'राती') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सकाळीं') {\n                return hour;\n            } else if (meridiem === 'दनपारां') {\n                return hour > 12 ? hour : hour + 12;\n            } else if (meridiem === 'सांजे') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'राती';\n            } else if (hour < 12) {\n                return 'सकाळीं';\n            } else if (hour < 16) {\n                return 'दनपारां';\n            } else if (hour < 20) {\n                return 'सांजे';\n            } else {\n                return 'राती';\n            }\n        },\n    });\n\n    return gomDeva;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/gom-deva.js?");

/***/ }),

/***/ "./node_modules/moment/locale/gom-latn.js":
/*!************************************************!*\
  !*** ./node_modules/moment/locale/gom-latn.js ***!
  \************************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Konkani Latin script [gom-latn]\n//! author : The Discoverer : https://github.com/WikiDiscoverer\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            s: ['thoddea sekondamni', 'thodde sekond'],\n            ss: [number + ' sekondamni', number + ' sekond'],\n            m: ['eka mintan', 'ek minut'],\n            mm: [number + ' mintamni', number + ' mintam'],\n            h: ['eka voran', 'ek vor'],\n            hh: [number + ' voramni', number + ' voram'],\n            d: ['eka disan', 'ek dis'],\n            dd: [number + ' disamni', number + ' dis'],\n            M: ['eka mhoinean', 'ek mhoino'],\n            MM: [number + ' mhoineamni', number + ' mhoine'],\n            y: ['eka vorsan', 'ek voros'],\n            yy: [number + ' vorsamni', number + ' vorsam'],\n        };\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var gomLatn = moment.defineLocale('gom-latn', {\n        months: {\n            standalone:\n                'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split(\n                    '_'\n                ),\n            format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split(\n                '_'\n            ),\n            isFormat: /MMMM(\\s)+D[oD]?/,\n        },\n        monthsShort:\n            'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),\n        monthsParseExact: true,\n        weekdays: \"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var\".split('_'),\n        weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),\n        weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'A h:mm [vazta]',\n            LTS: 'A h:mm:ss [vazta]',\n            L: 'DD-MM-YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY A h:mm [vazta]',\n            LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]',\n            llll: 'ddd, D MMM YYYY, A h:mm [vazta]',\n        },\n        calendar: {\n            sameDay: '[Aiz] LT',\n            nextDay: '[Faleam] LT',\n            nextWeek: '[Fuddlo] dddd[,] LT',\n            lastDay: '[Kal] LT',\n            lastWeek: '[Fattlo] dddd[,] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s',\n            past: '%s adim',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(er)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // the ordinal 'er' only applies to day of the month\n                case 'D':\n                    return number + 'er';\n                default:\n                case 'M':\n                case 'Q':\n                case 'DDD':\n                case 'd':\n                case 'w':\n                case 'W':\n                    return number;\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week\n            doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)\n        },\n        meridiemParse: /rati|sokallim|donparam|sanje/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'rati') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'sokallim') {\n                return hour;\n            } else if (meridiem === 'donparam') {\n                return hour > 12 ? hour : hour + 12;\n            } else if (meridiem === 'sanje') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'rati';\n            } else if (hour < 12) {\n                return 'sokallim';\n            } else if (hour < 16) {\n                return 'donparam';\n            } else if (hour < 20) {\n                return 'sanje';\n            } else {\n                return 'rati';\n            }\n        },\n    });\n\n    return gomLatn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/gom-latn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/gu.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/gu.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Gujarati [gu]\n//! author : Kaushik Thanki : https://github.com/Kaushik1987\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '૧',\n            2: '૨',\n            3: '૩',\n            4: '૪',\n            5: '૫',\n            6: '૬',\n            7: '૭',\n            8: '૮',\n            9: '૯',\n            0: '૦',\n        },\n        numberMap = {\n            '૧': '1',\n            '૨': '2',\n            '૩': '3',\n            '૪': '4',\n            '૫': '5',\n            '૬': '6',\n            '૭': '7',\n            '૮': '8',\n            '૯': '9',\n            '૦': '0',\n        };\n\n    var gu = moment.defineLocale('gu', {\n        months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split(\n            '_'\n        ),\n        monthsShort:\n            'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split(\n            '_'\n        ),\n        weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),\n        weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm વાગ્યે',\n            LTS: 'A h:mm:ss વાગ્યે',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm વાગ્યે',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે',\n        },\n        calendar: {\n            sameDay: '[આજ] LT',\n            nextDay: '[કાલે] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[ગઇકાલે] LT',\n            lastWeek: '[પાછલા] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s મા',\n            past: '%s પહેલા',\n            s: 'અમુક પળો',\n            ss: '%d સેકંડ',\n            m: 'એક મિનિટ',\n            mm: '%d મિનિટ',\n            h: 'એક કલાક',\n            hh: '%d કલાક',\n            d: 'એક દિવસ',\n            dd: '%d દિવસ',\n            M: 'એક મહિનો',\n            MM: '%d મહિનો',\n            y: 'એક વર્ષ',\n            yy: '%d વર્ષ',\n        },\n        preparse: function (string) {\n            return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // Gujarati notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.\n        meridiemParse: /રાત|બપોર|સવાર|સાંજ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'રાત') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'સવાર') {\n                return hour;\n            } else if (meridiem === 'બપોર') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'સાંજ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'રાત';\n            } else if (hour < 10) {\n                return 'સવાર';\n            } else if (hour < 17) {\n                return 'બપોર';\n            } else if (hour < 20) {\n                return 'સાંજ';\n            } else {\n                return 'રાત';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return gu;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/gu.js?");

/***/ }),

/***/ "./node_modules/moment/locale/he.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/he.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Hebrew [he]\n//! author : Tomer Cohen : https://github.com/tomer\n//! author : Moshe Simantov : https://github.com/DevelopmentIL\n//! author : Tal Ater : https://github.com/TalAter\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var he = moment.defineLocale('he', {\n        months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split(\n            '_'\n        ),\n        monthsShort:\n            'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),\n        weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),\n        weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),\n        weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [ב]MMMM YYYY',\n            LLL: 'D [ב]MMMM YYYY HH:mm',\n            LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',\n            l: 'D/M/YYYY',\n            ll: 'D MMM YYYY',\n            lll: 'D MMM YYYY HH:mm',\n            llll: 'ddd, D MMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[היום ב־]LT',\n            nextDay: '[מחר ב־]LT',\n            nextWeek: 'dddd [בשעה] LT',\n            lastDay: '[אתמול ב־]LT',\n            lastWeek: '[ביום] dddd [האחרון בשעה] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'בעוד %s',\n            past: 'לפני %s',\n            s: 'מספר שניות',\n            ss: '%d שניות',\n            m: 'דקה',\n            mm: '%d דקות',\n            h: 'שעה',\n            hh: function (number) {\n                if (number === 2) {\n                    return 'שעתיים';\n                }\n                return number + ' שעות';\n            },\n            d: 'יום',\n            dd: function (number) {\n                if (number === 2) {\n                    return 'יומיים';\n                }\n                return number + ' ימים';\n            },\n            M: 'חודש',\n            MM: function (number) {\n                if (number === 2) {\n                    return 'חודשיים';\n                }\n                return number + ' חודשים';\n            },\n            y: 'שנה',\n            yy: function (number) {\n                if (number === 2) {\n                    return 'שנתיים';\n                } else if (number % 10 === 0 && number !== 10) {\n                    return number + ' שנה';\n                }\n                return number + ' שנים';\n            },\n        },\n        meridiemParse:\n            /אחה\"צ|לפנה\"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,\n        isPM: function (input) {\n            return /^(אחה\"צ|אחרי הצהריים|בערב)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 5) {\n                return 'לפנות בוקר';\n            } else if (hour < 10) {\n                return 'בבוקר';\n            } else if (hour < 12) {\n                return isLower ? 'לפנה\"צ' : 'לפני הצהריים';\n            } else if (hour < 18) {\n                return isLower ? 'אחה\"צ' : 'אחרי הצהריים';\n            } else {\n                return 'בערב';\n            }\n        },\n    });\n\n    return he;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/he.js?");

/***/ }),

/***/ "./node_modules/moment/locale/hi.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/hi.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Hindi [hi]\n//! author : Mayank Singhal : https://github.com/mayanksinghal\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '१',\n            2: '२',\n            3: '३',\n            4: '४',\n            5: '५',\n            6: '६',\n            7: '७',\n            8: '८',\n            9: '९',\n            0: '०',\n        },\n        numberMap = {\n            '१': '1',\n            '२': '2',\n            '३': '3',\n            '४': '4',\n            '५': '5',\n            '६': '6',\n            '७': '7',\n            '८': '8',\n            '९': '9',\n            '०': '0',\n        },\n        monthsParse = [\n            /^जन/i,\n            /^फ़र|फर/i,\n            /^मार्च/i,\n            /^अप्रै/i,\n            /^मई/i,\n            /^जून/i,\n            /^जुल/i,\n            /^अग/i,\n            /^सितं|सित/i,\n            /^अक्टू/i,\n            /^नव|नवं/i,\n            /^दिसं|दिस/i,\n        ],\n        shortMonthsParse = [\n            /^जन/i,\n            /^फ़र/i,\n            /^मार्च/i,\n            /^अप्रै/i,\n            /^मई/i,\n            /^जून/i,\n            /^जुल/i,\n            /^अग/i,\n            /^सित/i,\n            /^अक्टू/i,\n            /^नव/i,\n            /^दिस/i,\n        ];\n\n    var hi = moment.defineLocale('hi', {\n        months: {\n            format: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split(\n                '_'\n            ),\n            standalone:\n                'जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर'.split(\n                    '_'\n                ),\n        },\n        monthsShort:\n            'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),\n        weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm बजे',\n            LTS: 'A h:mm:ss बजे',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm बजे',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm बजे',\n        },\n\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: shortMonthsParse,\n\n        monthsRegex:\n            /^(जनवरी|जन\\.?|फ़रवरी|फरवरी|फ़र\\.?|मार्च?|अप्रैल|अप्रै\\.?|मई?|जून?|जुलाई|जुल\\.?|अगस्त|अग\\.?|सितम्बर|सितंबर|सित\\.?|अक्टूबर|अक्टू\\.?|नवम्बर|नवंबर|नव\\.?|दिसम्बर|दिसंबर|दिस\\.?)/i,\n\n        monthsShortRegex:\n            /^(जनवरी|जन\\.?|फ़रवरी|फरवरी|फ़र\\.?|मार्च?|अप्रैल|अप्रै\\.?|मई?|जून?|जुलाई|जुल\\.?|अगस्त|अग\\.?|सितम्बर|सितंबर|सित\\.?|अक्टूबर|अक्टू\\.?|नवम्बर|नवंबर|नव\\.?|दिसम्बर|दिसंबर|दिस\\.?)/i,\n\n        monthsStrictRegex:\n            /^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\\.?|अक्टूबर|अक्टू\\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,\n\n        monthsShortStrictRegex:\n            /^(जन\\.?|फ़र\\.?|मार्च?|अप्रै\\.?|मई?|जून?|जुल\\.?|अग\\.?|सित\\.?|अक्टू\\.?|नव\\.?|दिस\\.?)/i,\n\n        calendar: {\n            sameDay: '[आज] LT',\n            nextDay: '[कल] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[कल] LT',\n            lastWeek: '[पिछले] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s में',\n            past: '%s पहले',\n            s: 'कुछ ही क्षण',\n            ss: '%d सेकंड',\n            m: 'एक मिनट',\n            mm: '%d मिनट',\n            h: 'एक घंटा',\n            hh: '%d घंटे',\n            d: 'एक दिन',\n            dd: '%d दिन',\n            M: 'एक महीने',\n            MM: '%d महीने',\n            y: 'एक वर्ष',\n            yy: '%d वर्ष',\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n        meridiemParse: /रात|सुबह|दोपहर|शाम/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'रात') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सुबह') {\n                return hour;\n            } else if (meridiem === 'दोपहर') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'शाम') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'रात';\n            } else if (hour < 10) {\n                return 'सुबह';\n            } else if (hour < 17) {\n                return 'दोपहर';\n            } else if (hour < 20) {\n                return 'शाम';\n            } else {\n                return 'रात';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return hi;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/hi.js?");

/***/ }),

/***/ "./node_modules/moment/locale/hr.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/hr.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Croatian [hr]\n//! author : Bojan Marković : https://github.com/bmarkovic\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n            case 'ss':\n                if (number === 1) {\n                    result += 'sekunda';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'sekunde';\n                } else {\n                    result += 'sekundi';\n                }\n                return result;\n            case 'm':\n                return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n            case 'mm':\n                if (number === 1) {\n                    result += 'minuta';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'minute';\n                } else {\n                    result += 'minuta';\n                }\n                return result;\n            case 'h':\n                return withoutSuffix ? 'jedan sat' : 'jednog sata';\n            case 'hh':\n                if (number === 1) {\n                    result += 'sat';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'sata';\n                } else {\n                    result += 'sati';\n                }\n                return result;\n            case 'dd':\n                if (number === 1) {\n                    result += 'dan';\n                } else {\n                    result += 'dana';\n                }\n                return result;\n            case 'MM':\n                if (number === 1) {\n                    result += 'mjesec';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'mjeseca';\n                } else {\n                    result += 'mjeseci';\n                }\n                return result;\n            case 'yy':\n                if (number === 1) {\n                    result += 'godina';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'godine';\n                } else {\n                    result += 'godina';\n                }\n                return result;\n        }\n    }\n\n    var hr = moment.defineLocale('hr', {\n        months: {\n            format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split(\n                '_'\n            ),\n            standalone:\n                'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split(\n                    '_'\n                ),\n        },\n        monthsShort:\n            'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(\n            '_'\n        ),\n        weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'Do MMMM YYYY',\n            LLL: 'Do MMMM YYYY H:mm',\n            LLLL: 'dddd, Do MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[u] [nedjelju] [u] LT';\n                    case 3:\n                        return '[u] [srijedu] [u] LT';\n                    case 6:\n                        return '[u] [subotu] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[u] dddd [u] LT';\n                }\n            },\n            lastDay: '[jučer u] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[prošlu] [nedjelju] [u] LT';\n                    case 3:\n                        return '[prošlu] [srijedu] [u] LT';\n                    case 6:\n                        return '[prošle] [subote] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'prije %s',\n            s: 'par sekundi',\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: 'dan',\n            dd: translate,\n            M: 'mjesec',\n            MM: translate,\n            y: 'godinu',\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return hr;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/hr.js?");

/***/ }),

/***/ "./node_modules/moment/locale/hu.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/hu.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Hungarian [hu]\n//! author : Adam Brunner : https://github.com/adambrunner\n//! author : Peter Viszt  : https://github.com/passatgt\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var weekEndings =\n        'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');\n    function translate(number, withoutSuffix, key, isFuture) {\n        var num = number;\n        switch (key) {\n            case 's':\n                return isFuture || withoutSuffix\n                    ? 'néhány másodperc'\n                    : 'néhány másodperce';\n            case 'ss':\n                return num + (isFuture || withoutSuffix)\n                    ? ' másodperc'\n                    : ' másodperce';\n            case 'm':\n                return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');\n            case 'mm':\n                return num + (isFuture || withoutSuffix ? ' perc' : ' perce');\n            case 'h':\n                return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');\n            case 'hh':\n                return num + (isFuture || withoutSuffix ? ' óra' : ' órája');\n            case 'd':\n                return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');\n            case 'dd':\n                return num + (isFuture || withoutSuffix ? ' nap' : ' napja');\n            case 'M':\n                return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n            case 'MM':\n                return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n            case 'y':\n                return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');\n            case 'yy':\n                return num + (isFuture || withoutSuffix ? ' év' : ' éve');\n        }\n        return '';\n    }\n    function week(isFuture) {\n        return (\n            (isFuture ? '' : '[múlt] ') +\n            '[' +\n            weekEndings[this.day()] +\n            '] LT[-kor]'\n        );\n    }\n\n    var hu = moment.defineLocale('hu', {\n        months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),\n        weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),\n        weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'YYYY.MM.DD.',\n            LL: 'YYYY. MMMM D.',\n            LLL: 'YYYY. MMMM D. H:mm',\n            LLLL: 'YYYY. MMMM D., dddd H:mm',\n        },\n        meridiemParse: /de|du/i,\n        isPM: function (input) {\n            return input.charAt(1).toLowerCase() === 'u';\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower === true ? 'de' : 'DE';\n            } else {\n                return isLower === true ? 'du' : 'DU';\n            }\n        },\n        calendar: {\n            sameDay: '[ma] LT[-kor]',\n            nextDay: '[holnap] LT[-kor]',\n            nextWeek: function () {\n                return week.call(this, true);\n            },\n            lastDay: '[tegnap] LT[-kor]',\n            lastWeek: function () {\n                return week.call(this, false);\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s múlva',\n            past: '%s',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return hu;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/hu.js?");

/***/ }),

/***/ "./node_modules/moment/locale/hy-am.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/hy-am.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Armenian [hy-am]\n//! author : Armendarabyan : https://github.com/armendarabyan\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var hyAm = moment.defineLocale('hy-am', {\n        months: {\n            format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split(\n                '_'\n            ),\n            standalone:\n                'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split(\n                    '_'\n                ),\n        },\n        monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),\n        weekdays:\n            'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split(\n                '_'\n            ),\n        weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY թ.',\n            LLL: 'D MMMM YYYY թ., HH:mm',\n            LLLL: 'dddd, D MMMM YYYY թ., HH:mm',\n        },\n        calendar: {\n            sameDay: '[այսօր] LT',\n            nextDay: '[վաղը] LT',\n            lastDay: '[երեկ] LT',\n            nextWeek: function () {\n                return 'dddd [օրը ժամը] LT';\n            },\n            lastWeek: function () {\n                return '[անցած] dddd [օրը ժամը] LT';\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s հետո',\n            past: '%s առաջ',\n            s: 'մի քանի վայրկյան',\n            ss: '%d վայրկյան',\n            m: 'րոպե',\n            mm: '%d րոպե',\n            h: 'ժամ',\n            hh: '%d ժամ',\n            d: 'օր',\n            dd: '%d օր',\n            M: 'ամիս',\n            MM: '%d ամիս',\n            y: 'տարի',\n            yy: '%d տարի',\n        },\n        meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,\n        isPM: function (input) {\n            return /^(ցերեկվա|երեկոյան)$/.test(input);\n        },\n        meridiem: function (hour) {\n            if (hour < 4) {\n                return 'գիշերվա';\n            } else if (hour < 12) {\n                return 'առավոտվա';\n            } else if (hour < 17) {\n                return 'ցերեկվա';\n            } else {\n                return 'երեկոյան';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}|\\d{1,2}-(ին|րդ)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'DDD':\n                case 'w':\n                case 'W':\n                case 'DDDo':\n                    if (number === 1) {\n                        return number + '-ին';\n                    }\n                    return number + '-րդ';\n                default:\n                    return number;\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return hyAm;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/hy-am.js?");

/***/ }),

/***/ "./node_modules/moment/locale/id.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/id.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Indonesian [id]\n//! author : Mohammad Satrio Utomo : https://github.com/tyok\n//! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var id = moment.defineLocale('id', {\n        months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),\n        weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),\n        weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),\n        weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [pukul] HH.mm',\n            LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',\n        },\n        meridiemParse: /pagi|siang|sore|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'siang') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'sore' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'siang';\n            } else if (hours < 19) {\n                return 'sore';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar: {\n            sameDay: '[Hari ini pukul] LT',\n            nextDay: '[Besok pukul] LT',\n            nextWeek: 'dddd [pukul] LT',\n            lastDay: '[Kemarin pukul] LT',\n            lastWeek: 'dddd [lalu pukul] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dalam %s',\n            past: '%s yang lalu',\n            s: 'beberapa detik',\n            ss: '%d detik',\n            m: 'semenit',\n            mm: '%d menit',\n            h: 'sejam',\n            hh: '%d jam',\n            d: 'sehari',\n            dd: '%d hari',\n            M: 'sebulan',\n            MM: '%d bulan',\n            y: 'setahun',\n            yy: '%d tahun',\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return id;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/id.js?");

/***/ }),

/***/ "./node_modules/moment/locale/is.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/is.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Icelandic [is]\n//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function plural(n) {\n        if (n % 100 === 11) {\n            return true;\n        } else if (n % 10 === 1) {\n            return false;\n        }\n        return true;\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n            case 's':\n                return withoutSuffix || isFuture\n                    ? 'nokkrar sekúndur'\n                    : 'nokkrum sekúndum';\n            case 'ss':\n                if (plural(number)) {\n                    return (\n                        result +\n                        (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum')\n                    );\n                }\n                return result + 'sekúnda';\n            case 'm':\n                return withoutSuffix ? 'mínúta' : 'mínútu';\n            case 'mm':\n                if (plural(number)) {\n                    return (\n                        result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum')\n                    );\n                } else if (withoutSuffix) {\n                    return result + 'mínúta';\n                }\n                return result + 'mínútu';\n            case 'hh':\n                if (plural(number)) {\n                    return (\n                        result +\n                        (withoutSuffix || isFuture\n                            ? 'klukkustundir'\n                            : 'klukkustundum')\n                    );\n                }\n                return result + 'klukkustund';\n            case 'd':\n                if (withoutSuffix) {\n                    return 'dagur';\n                }\n                return isFuture ? 'dag' : 'degi';\n            case 'dd':\n                if (plural(number)) {\n                    if (withoutSuffix) {\n                        return result + 'dagar';\n                    }\n                    return result + (isFuture ? 'daga' : 'dögum');\n                } else if (withoutSuffix) {\n                    return result + 'dagur';\n                }\n                return result + (isFuture ? 'dag' : 'degi');\n            case 'M':\n                if (withoutSuffix) {\n                    return 'mánuður';\n                }\n                return isFuture ? 'mánuð' : 'mánuði';\n            case 'MM':\n                if (plural(number)) {\n                    if (withoutSuffix) {\n                        return result + 'mánuðir';\n                    }\n                    return result + (isFuture ? 'mánuði' : 'mánuðum');\n                } else if (withoutSuffix) {\n                    return result + 'mánuður';\n                }\n                return result + (isFuture ? 'mánuð' : 'mánuði');\n            case 'y':\n                return withoutSuffix || isFuture ? 'ár' : 'ári';\n            case 'yy':\n                if (plural(number)) {\n                    return result + (withoutSuffix || isFuture ? 'ár' : 'árum');\n                }\n                return result + (withoutSuffix || isFuture ? 'ár' : 'ári');\n        }\n    }\n\n    var is = moment.defineLocale('is', {\n        months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),\n        weekdays:\n            'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split(\n                '_'\n            ),\n        weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),\n        weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY [kl.] H:mm',\n            LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm',\n        },\n        calendar: {\n            sameDay: '[í dag kl.] LT',\n            nextDay: '[á morgun kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[í gær kl.] LT',\n            lastWeek: '[síðasta] dddd [kl.] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'eftir %s',\n            past: 'fyrir %s síðan',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: 'klukkustund',\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return is;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/is.js?");

/***/ }),

/***/ "./node_modules/moment/locale/it-ch.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/it-ch.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Italian (Switzerland) [it-ch]\n//! author : xfh : https://github.com/xfh\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var itCh = moment.defineLocale('it-ch', {\n        months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(\n            '_'\n        ),\n        monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n        weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(\n            '_'\n        ),\n        weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),\n        weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Oggi alle] LT',\n            nextDay: '[Domani alle] LT',\n            nextWeek: 'dddd [alle] LT',\n            lastDay: '[Ieri alle] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[la scorsa] dddd [alle] LT';\n                    default:\n                        return '[lo scorso] dddd [alle] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: function (s) {\n                return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;\n            },\n            past: '%s fa',\n            s: 'alcuni secondi',\n            ss: '%d secondi',\n            m: 'un minuto',\n            mm: '%d minuti',\n            h: \"un'ora\",\n            hh: '%d ore',\n            d: 'un giorno',\n            dd: '%d giorni',\n            M: 'un mese',\n            MM: '%d mesi',\n            y: 'un anno',\n            yy: '%d anni',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return itCh;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/it-ch.js?");

/***/ }),

/***/ "./node_modules/moment/locale/it.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/it.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Italian [it]\n//! author : Lorenzo : https://github.com/aliem\n//! author: Mattia Larentis: https://github.com/nostalgiaz\n//! author: Marco : https://github.com/Manfre98\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var it = moment.defineLocale('it', {\n        months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(\n            '_'\n        ),\n        monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n        weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(\n            '_'\n        ),\n        weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),\n        weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return (\n                    '[Oggi a' +\n                    (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n                    ']LT'\n                );\n            },\n            nextDay: function () {\n                return (\n                    '[Domani a' +\n                    (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n                    ']LT'\n                );\n            },\n            nextWeek: function () {\n                return (\n                    'dddd [a' +\n                    (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n                    ']LT'\n                );\n            },\n            lastDay: function () {\n                return (\n                    '[Ieri a' +\n                    (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n                    ']LT'\n                );\n            },\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return (\n                            '[La scorsa] dddd [a' +\n                            (this.hours() > 1\n                                ? 'lle '\n                                : this.hours() === 0\n                                ? ' '\n                                : \"ll'\") +\n                            ']LT'\n                        );\n                    default:\n                        return (\n                            '[Lo scorso] dddd [a' +\n                            (this.hours() > 1\n                                ? 'lle '\n                                : this.hours() === 0\n                                ? ' '\n                                : \"ll'\") +\n                            ']LT'\n                        );\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'tra %s',\n            past: '%s fa',\n            s: 'alcuni secondi',\n            ss: '%d secondi',\n            m: 'un minuto',\n            mm: '%d minuti',\n            h: \"un'ora\",\n            hh: '%d ore',\n            d: 'un giorno',\n            dd: '%d giorni',\n            w: 'una settimana',\n            ww: '%d settimane',\n            M: 'un mese',\n            MM: '%d mesi',\n            y: 'un anno',\n            yy: '%d anni',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return it;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/it.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ja.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ja.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Japanese [ja]\n//! author : LI Long : https://github.com/baryon\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ja = moment.defineLocale('ja', {\n        eras: [\n            {\n                since: '2019-05-01',\n                offset: 1,\n                name: '令和',\n                narrow: '㋿',\n                abbr: 'R',\n            },\n            {\n                since: '1989-01-08',\n                until: '2019-04-30',\n                offset: 1,\n                name: '平成',\n                narrow: '㍻',\n                abbr: 'H',\n            },\n            {\n                since: '1926-12-25',\n                until: '1989-01-07',\n                offset: 1,\n                name: '昭和',\n                narrow: '㍼',\n                abbr: 'S',\n            },\n            {\n                since: '1912-07-30',\n                until: '1926-12-24',\n                offset: 1,\n                name: '大正',\n                narrow: '㍽',\n                abbr: 'T',\n            },\n            {\n                since: '1873-01-01',\n                until: '1912-07-29',\n                offset: 6,\n                name: '明治',\n                narrow: '㍾',\n                abbr: 'M',\n            },\n            {\n                since: '0001-01-01',\n                until: '1873-12-31',\n                offset: 1,\n                name: '西暦',\n                narrow: 'AD',\n                abbr: 'AD',\n            },\n            {\n                since: '0000-12-31',\n                until: -Infinity,\n                offset: 1,\n                name: '紀元前',\n                narrow: 'BC',\n                abbr: 'BC',\n            },\n        ],\n        eraYearOrdinalRegex: /(元|\\d+)年/,\n        eraYearOrdinalParse: function (input, match) {\n            return match[1] === '元' ? 1 : parseInt(match[1] || input, 10);\n        },\n        months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n        weekdaysShort: '日_月_火_水_木_金_土'.split('_'),\n        weekdaysMin: '日_月_火_水_木_金_土'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日 HH:mm',\n            LLLL: 'YYYY年M月D日 dddd HH:mm',\n            l: 'YYYY/MM/DD',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日(ddd) HH:mm',\n        },\n        meridiemParse: /午前|午後/i,\n        isPM: function (input) {\n            return input === '午後';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return '午前';\n            } else {\n                return '午後';\n            }\n        },\n        calendar: {\n            sameDay: '[今日] LT',\n            nextDay: '[明日] LT',\n            nextWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    return '[来週]dddd LT';\n                } else {\n                    return 'dddd LT';\n                }\n            },\n            lastDay: '[昨日] LT',\n            lastWeek: function (now) {\n                if (this.week() !== now.week()) {\n                    return '[先週]dddd LT';\n                } else {\n                    return 'dddd LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}日/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'y':\n                    return number === 1 ? '元年' : number + '年';\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s後',\n            past: '%s前',\n            s: '数秒',\n            ss: '%d秒',\n            m: '1分',\n            mm: '%d分',\n            h: '1時間',\n            hh: '%d時間',\n            d: '1日',\n            dd: '%d日',\n            M: '1ヶ月',\n            MM: '%dヶ月',\n            y: '1年',\n            yy: '%d年',\n        },\n    });\n\n    return ja;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ja.js?");

/***/ }),

/***/ "./node_modules/moment/locale/jv.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/jv.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Javanese [jv]\n//! author : Rony Lantip : https://github.com/lantip\n//! reference: http://jv.wikipedia.org/wiki/Basa_Jawa\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var jv = moment.defineLocale('jv', {\n        months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),\n        weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),\n        weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),\n        weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [pukul] HH.mm',\n            LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',\n        },\n        meridiemParse: /enjing|siyang|sonten|ndalu/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'enjing') {\n                return hour;\n            } else if (meridiem === 'siyang') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'sonten' || meridiem === 'ndalu') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'enjing';\n            } else if (hours < 15) {\n                return 'siyang';\n            } else if (hours < 19) {\n                return 'sonten';\n            } else {\n                return 'ndalu';\n            }\n        },\n        calendar: {\n            sameDay: '[Dinten puniko pukul] LT',\n            nextDay: '[Mbenjang pukul] LT',\n            nextWeek: 'dddd [pukul] LT',\n            lastDay: '[Kala wingi pukul] LT',\n            lastWeek: 'dddd [kepengker pukul] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'wonten ing %s',\n            past: '%s ingkang kepengker',\n            s: 'sawetawis detik',\n            ss: '%d detik',\n            m: 'setunggal menit',\n            mm: '%d menit',\n            h: 'setunggal jam',\n            hh: '%d jam',\n            d: 'sedinten',\n            dd: '%d dinten',\n            M: 'sewulan',\n            MM: '%d wulan',\n            y: 'setaun',\n            yy: '%d taun',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return jv;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/jv.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ka.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ka.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Georgian [ka]\n//! author : Irakli Janiashvili : https://github.com/IrakliJani\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ka = moment.defineLocale('ka', {\n        months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split(\n            '_'\n        ),\n        monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),\n        weekdays: {\n            standalone:\n                'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split(\n                    '_'\n                ),\n            format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split(\n                '_'\n            ),\n            isFormat: /(წინა|შემდეგ)/,\n        },\n        weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),\n        weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[დღეს] LT[-ზე]',\n            nextDay: '[ხვალ] LT[-ზე]',\n            lastDay: '[გუშინ] LT[-ზე]',\n            nextWeek: '[შემდეგ] dddd LT[-ზე]',\n            lastWeek: '[წინა] dddd LT-ზე',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: function (s) {\n                return s.replace(\n                    /(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,\n                    function ($0, $1, $2) {\n                        return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';\n                    }\n                );\n            },\n            past: function (s) {\n                if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {\n                    return s.replace(/(ი|ე)$/, 'ის წინ');\n                }\n                if (/წელი/.test(s)) {\n                    return s.replace(/წელი$/, 'წლის წინ');\n                }\n                return s;\n            },\n            s: 'რამდენიმე წამი',\n            ss: '%d წამი',\n            m: 'წუთი',\n            mm: '%d წუთი',\n            h: 'საათი',\n            hh: '%d საათი',\n            d: 'დღე',\n            dd: '%d დღე',\n            M: 'თვე',\n            MM: '%d თვე',\n            y: 'წელი',\n            yy: '%d წელი',\n        },\n        dayOfMonthOrdinalParse: /0|1-ლი|მე-\\d{1,2}|\\d{1,2}-ე/,\n        ordinal: function (number) {\n            if (number === 0) {\n                return number;\n            }\n            if (number === 1) {\n                return number + '-ლი';\n            }\n            if (\n                number < 20 ||\n                (number <= 100 && number % 20 === 0) ||\n                number % 100 === 0\n            ) {\n                return 'მე-' + number;\n            }\n            return number + '-ე';\n        },\n        week: {\n            dow: 1,\n            doy: 7,\n        },\n    });\n\n    return ka;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ka.js?");

/***/ }),

/***/ "./node_modules/moment/locale/kk.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/kk.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Kazakh [kk]\n//! authors : Nurlan Rakhimzhanov : https://github.com/nurlan\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        0: '-ші',\n        1: '-ші',\n        2: '-ші',\n        3: '-ші',\n        4: '-ші',\n        5: '-ші',\n        6: '-шы',\n        7: '-ші',\n        8: '-ші',\n        9: '-шы',\n        10: '-шы',\n        20: '-шы',\n        30: '-шы',\n        40: '-шы',\n        50: '-ші',\n        60: '-шы',\n        70: '-ші',\n        80: '-ші',\n        90: '-шы',\n        100: '-ші',\n    };\n\n    var kk = moment.defineLocale('kk', {\n        months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split(\n            '_'\n        ),\n        monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),\n        weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split(\n            '_'\n        ),\n        weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),\n        weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Бүгін сағат] LT',\n            nextDay: '[Ертең сағат] LT',\n            nextWeek: 'dddd [сағат] LT',\n            lastDay: '[Кеше сағат] LT',\n            lastWeek: '[Өткен аптаның] dddd [сағат] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ішінде',\n            past: '%s бұрын',\n            s: 'бірнеше секунд',\n            ss: '%d секунд',\n            m: 'бір минут',\n            mm: '%d минут',\n            h: 'бір сағат',\n            hh: '%d сағат',\n            d: 'бір күн',\n            dd: '%d күн',\n            M: 'бір ай',\n            MM: '%d ай',\n            y: 'бір жыл',\n            yy: '%d жыл',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ші|шы)/,\n        ordinal: function (number) {\n            var a = number % 10,\n                b = number >= 100 ? 100 : null;\n            return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return kk;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/kk.js?");

/***/ }),

/***/ "./node_modules/moment/locale/km.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/km.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Cambodian [km]\n//! author : Kruy Vanna : https://github.com/kruyvanna\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '១',\n            2: '២',\n            3: '៣',\n            4: '៤',\n            5: '៥',\n            6: '៦',\n            7: '៧',\n            8: '៨',\n            9: '៩',\n            0: '០',\n        },\n        numberMap = {\n            '១': '1',\n            '២': '2',\n            '៣': '3',\n            '៤': '4',\n            '៥': '5',\n            '៦': '6',\n            '៧': '7',\n            '៨': '8',\n            '៩': '9',\n            '០': '0',\n        };\n\n    var km = moment.defineLocale('km', {\n        months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(\n            '_'\n        ),\n        monthsShort:\n            'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(\n                '_'\n            ),\n        weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),\n        weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ព្រឹក|ល្ងាច/,\n        isPM: function (input) {\n            return input === 'ល្ងាច';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ព្រឹក';\n            } else {\n                return 'ល្ងាច';\n            }\n        },\n        calendar: {\n            sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',\n            nextDay: '[ស្អែក ម៉ោង] LT',\n            nextWeek: 'dddd [ម៉ោង] LT',\n            lastDay: '[ម្សិលមិញ ម៉ោង] LT',\n            lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%sទៀត',\n            past: '%sមុន',\n            s: 'ប៉ុន្មានវិនាទី',\n            ss: '%d វិនាទី',\n            m: 'មួយនាទី',\n            mm: '%d នាទី',\n            h: 'មួយម៉ោង',\n            hh: '%d ម៉ោង',\n            d: 'មួយថ្ងៃ',\n            dd: '%d ថ្ងៃ',\n            M: 'មួយខែ',\n            MM: '%d ខែ',\n            y: 'មួយឆ្នាំ',\n            yy: '%d ឆ្នាំ',\n        },\n        dayOfMonthOrdinalParse: /ទី\\d{1,2}/,\n        ordinal: 'ទី%d',\n        preparse: function (string) {\n            return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return km;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/km.js?");

/***/ }),

/***/ "./node_modules/moment/locale/kn.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/kn.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Kannada [kn]\n//! author : Rajeev Naik : https://github.com/rajeevnaikte\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '೧',\n            2: '೨',\n            3: '೩',\n            4: '೪',\n            5: '೫',\n            6: '೬',\n            7: '೭',\n            8: '೮',\n            9: '೯',\n            0: '೦',\n        },\n        numberMap = {\n            '೧': '1',\n            '೨': '2',\n            '೩': '3',\n            '೪': '4',\n            '೫': '5',\n            '೬': '6',\n            '೭': '7',\n            '೮': '8',\n            '೯': '9',\n            '೦': '0',\n        };\n\n    var kn = moment.defineLocale('kn', {\n        months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split(\n            '_'\n        ),\n        monthsShort:\n            'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split(\n            '_'\n        ),\n        weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),\n        weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm',\n            LTS: 'A h:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm',\n        },\n        calendar: {\n            sameDay: '[ಇಂದು] LT',\n            nextDay: '[ನಾಳೆ] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[ನಿನ್ನೆ] LT',\n            lastWeek: '[ಕೊನೆಯ] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ನಂತರ',\n            past: '%s ಹಿಂದೆ',\n            s: 'ಕೆಲವು ಕ್ಷಣಗಳು',\n            ss: '%d ಸೆಕೆಂಡುಗಳು',\n            m: 'ಒಂದು ನಿಮಿಷ',\n            mm: '%d ನಿಮಿಷ',\n            h: 'ಒಂದು ಗಂಟೆ',\n            hh: '%d ಗಂಟೆ',\n            d: 'ಒಂದು ದಿನ',\n            dd: '%d ದಿನ',\n            M: 'ಒಂದು ತಿಂಗಳು',\n            MM: '%d ತಿಂಗಳು',\n            y: 'ಒಂದು ವರ್ಷ',\n            yy: '%d ವರ್ಷ',\n        },\n        preparse: function (string) {\n            return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'ರಾತ್ರಿ') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {\n                return hour;\n            } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'ಸಂಜೆ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ರಾತ್ರಿ';\n            } else if (hour < 10) {\n                return 'ಬೆಳಿಗ್ಗೆ';\n            } else if (hour < 17) {\n                return 'ಮಧ್ಯಾಹ್ನ';\n            } else if (hour < 20) {\n                return 'ಸಂಜೆ';\n            } else {\n                return 'ರಾತ್ರಿ';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ನೇ)/,\n        ordinal: function (number) {\n            return number + 'ನೇ';\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return kn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/kn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ko.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ko.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Korean [ko]\n//! author : Kyungwook, Park : https://github.com/kyungw00k\n//! author : Jeeeyul Lee <jeeeyul@gmail.com>\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ko = moment.defineLocale('ko', {\n        months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n        monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split(\n            '_'\n        ),\n        weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),\n        weekdaysShort: '일_월_화_수_목_금_토'.split('_'),\n        weekdaysMin: '일_월_화_수_목_금_토'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm',\n            LTS: 'A h:mm:ss',\n            L: 'YYYY.MM.DD.',\n            LL: 'YYYY년 MMMM D일',\n            LLL: 'YYYY년 MMMM D일 A h:mm',\n            LLLL: 'YYYY년 MMMM D일 dddd A h:mm',\n            l: 'YYYY.MM.DD.',\n            ll: 'YYYY년 MMMM D일',\n            lll: 'YYYY년 MMMM D일 A h:mm',\n            llll: 'YYYY년 MMMM D일 dddd A h:mm',\n        },\n        calendar: {\n            sameDay: '오늘 LT',\n            nextDay: '내일 LT',\n            nextWeek: 'dddd LT',\n            lastDay: '어제 LT',\n            lastWeek: '지난주 dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s 후',\n            past: '%s 전',\n            s: '몇 초',\n            ss: '%d초',\n            m: '1분',\n            mm: '%d분',\n            h: '한 시간',\n            hh: '%d시간',\n            d: '하루',\n            dd: '%d일',\n            M: '한 달',\n            MM: '%d달',\n            y: '일 년',\n            yy: '%d년',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(일|월|주)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '일';\n                case 'M':\n                    return number + '월';\n                case 'w':\n                case 'W':\n                    return number + '주';\n                default:\n                    return number;\n            }\n        },\n        meridiemParse: /오전|오후/,\n        isPM: function (token) {\n            return token === '오후';\n        },\n        meridiem: function (hour, minute, isUpper) {\n            return hour < 12 ? '오전' : '오후';\n        },\n    });\n\n    return ko;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ko.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ku.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ku.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Kurdish [ku]\n//! author : Shahram Mebashar : https://github.com/ShahramMebashar\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '١',\n            2: '٢',\n            3: '٣',\n            4: '٤',\n            5: '٥',\n            6: '٦',\n            7: '٧',\n            8: '٨',\n            9: '٩',\n            0: '٠',\n        },\n        numberMap = {\n            '١': '1',\n            '٢': '2',\n            '٣': '3',\n            '٤': '4',\n            '٥': '5',\n            '٦': '6',\n            '٧': '7',\n            '٨': '8',\n            '٩': '9',\n            '٠': '0',\n        },\n        months = [\n            'کانونی دووەم',\n            'شوبات',\n            'ئازار',\n            'نیسان',\n            'ئایار',\n            'حوزەیران',\n            'تەمموز',\n            'ئاب',\n            'ئەیلوول',\n            'تشرینی یەكەم',\n            'تشرینی دووەم',\n            'كانونی یەکەم',\n        ];\n\n    var ku = moment.defineLocale('ku', {\n        months: months,\n        monthsShort: months,\n        weekdays:\n            'یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌'.split(\n                '_'\n            ),\n        weekdaysShort:\n            'یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌'.split('_'),\n        weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ئێواره‌|به‌یانی/,\n        isPM: function (input) {\n            return /ئێواره‌/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'به‌یانی';\n            } else {\n                return 'ئێواره‌';\n            }\n        },\n        calendar: {\n            sameDay: '[ئه‌مرۆ كاتژمێر] LT',\n            nextDay: '[به‌یانی كاتژمێر] LT',\n            nextWeek: 'dddd [كاتژمێر] LT',\n            lastDay: '[دوێنێ كاتژمێر] LT',\n            lastWeek: 'dddd [كاتژمێر] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'له‌ %s',\n            past: '%s',\n            s: 'چه‌ند چركه‌یه‌ك',\n            ss: 'چركه‌ %d',\n            m: 'یه‌ك خوله‌ك',\n            mm: '%d خوله‌ك',\n            h: 'یه‌ك كاتژمێر',\n            hh: '%d كاتژمێر',\n            d: 'یه‌ك ڕۆژ',\n            dd: '%d ڕۆژ',\n            M: 'یه‌ك مانگ',\n            MM: '%d مانگ',\n            y: 'یه‌ك ساڵ',\n            yy: '%d ساڵ',\n        },\n        preparse: function (string) {\n            return string\n                .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                    return numberMap[match];\n                })\n                .replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return ku;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ku.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ky.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ky.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Kyrgyz [ky]\n//! author : Chyngyz Arystan uulu : https://github.com/chyngyz\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        0: '-чү',\n        1: '-чи',\n        2: '-чи',\n        3: '-чү',\n        4: '-чү',\n        5: '-чи',\n        6: '-чы',\n        7: '-чи',\n        8: '-чи',\n        9: '-чу',\n        10: '-чу',\n        20: '-чы',\n        30: '-чу',\n        40: '-чы',\n        50: '-чү',\n        60: '-чы',\n        70: '-чи',\n        80: '-чи',\n        90: '-чу',\n        100: '-чү',\n    };\n\n    var ky = moment.defineLocale('ky', {\n        months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(\n            '_'\n        ),\n        monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split(\n            '_'\n        ),\n        weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split(\n            '_'\n        ),\n        weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),\n        weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Бүгүн саат] LT',\n            nextDay: '[Эртең саат] LT',\n            nextWeek: 'dddd [саат] LT',\n            lastDay: '[Кечээ саат] LT',\n            lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ичинде',\n            past: '%s мурун',\n            s: 'бирнече секунд',\n            ss: '%d секунд',\n            m: 'бир мүнөт',\n            mm: '%d мүнөт',\n            h: 'бир саат',\n            hh: '%d саат',\n            d: 'бир күн',\n            dd: '%d күн',\n            M: 'бир ай',\n            MM: '%d ай',\n            y: 'бир жыл',\n            yy: '%d жыл',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(чи|чы|чү|чу)/,\n        ordinal: function (number) {\n            var a = number % 10,\n                b = number >= 100 ? 100 : null;\n            return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return ky;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ky.js?");

/***/ }),

/***/ "./node_modules/moment/locale/lb.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/lb.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Luxembourgish [lb]\n//! author : mweimerskirch : https://github.com/mweimerskirch\n//! author : David Raison : https://github.com/kwisatz\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            m: ['eng Minutt', 'enger Minutt'],\n            h: ['eng Stonn', 'enger Stonn'],\n            d: ['een Dag', 'engem Dag'],\n            M: ['ee Mount', 'engem Mount'],\n            y: ['ee Joer', 'engem Joer'],\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n    function processFutureTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'a ' + string;\n        }\n        return 'an ' + string;\n    }\n    function processPastTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'viru ' + string;\n        }\n        return 'virun ' + string;\n    }\n    /**\n     * Returns true if the word before the given number loses the '-n' ending.\n     * e.g. 'an 10 Deeg' but 'a 5 Deeg'\n     *\n     * @param number {integer}\n     * @returns {boolean}\n     */\n    function eifelerRegelAppliesToNumber(number) {\n        number = parseInt(number, 10);\n        if (isNaN(number)) {\n            return false;\n        }\n        if (number < 0) {\n            // Negative Number --> always true\n            return true;\n        } else if (number < 10) {\n            // Only 1 digit\n            if (4 <= number && number <= 7) {\n                return true;\n            }\n            return false;\n        } else if (number < 100) {\n            // 2 digits\n            var lastDigit = number % 10,\n                firstDigit = number / 10;\n            if (lastDigit === 0) {\n                return eifelerRegelAppliesToNumber(firstDigit);\n            }\n            return eifelerRegelAppliesToNumber(lastDigit);\n        } else if (number < 10000) {\n            // 3 or 4 digits --> recursively check first digit\n            while (number >= 10) {\n                number = number / 10;\n            }\n            return eifelerRegelAppliesToNumber(number);\n        } else {\n            // Anything larger than 4 digits: recursively check first n-3 digits\n            number = number / 1000;\n            return eifelerRegelAppliesToNumber(number);\n        }\n    }\n\n    var lb = moment.defineLocale('lb', {\n        months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n            '_'\n        ),\n        monthsShort:\n            'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(\n                '_'\n            ),\n        weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm [Auer]',\n            LTS: 'H:mm:ss [Auer]',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm [Auer]',\n            LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',\n        },\n        calendar: {\n            sameDay: '[Haut um] LT',\n            sameElse: 'L',\n            nextDay: '[Muer um] LT',\n            nextWeek: 'dddd [um] LT',\n            lastDay: '[Gëschter um] LT',\n            lastWeek: function () {\n                // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule\n                switch (this.day()) {\n                    case 2:\n                    case 4:\n                        return '[Leschten] dddd [um] LT';\n                    default:\n                        return '[Leschte] dddd [um] LT';\n                }\n            },\n        },\n        relativeTime: {\n            future: processFutureTime,\n            past: processPastTime,\n            s: 'e puer Sekonnen',\n            ss: '%d Sekonnen',\n            m: processRelativeTime,\n            mm: '%d Minutten',\n            h: processRelativeTime,\n            hh: '%d Stonnen',\n            d: processRelativeTime,\n            dd: '%d Deeg',\n            M: processRelativeTime,\n            MM: '%d Méint',\n            y: processRelativeTime,\n            yy: '%d Joer',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return lb;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/lb.js?");

/***/ }),

/***/ "./node_modules/moment/locale/lo.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/lo.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Lao [lo]\n//! author : Ryan Hart : https://github.com/ryanhart2\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var lo = moment.defineLocale('lo', {\n        months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(\n                '_'\n            ),\n        weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),\n        weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),\n        weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'ວັນdddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,\n        isPM: function (input) {\n            return input === 'ຕອນແລງ';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ຕອນເຊົ້າ';\n            } else {\n                return 'ຕອນແລງ';\n            }\n        },\n        calendar: {\n            sameDay: '[ມື້ນີ້ເວລາ] LT',\n            nextDay: '[ມື້ອື່ນເວລາ] LT',\n            nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT',\n            lastDay: '[ມື້ວານນີ້ເວລາ] LT',\n            lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ອີກ %s',\n            past: '%sຜ່ານມາ',\n            s: 'ບໍ່ເທົ່າໃດວິນາທີ',\n            ss: '%d ວິນາທີ',\n            m: '1 ນາທີ',\n            mm: '%d ນາທີ',\n            h: '1 ຊົ່ວໂມງ',\n            hh: '%d ຊົ່ວໂມງ',\n            d: '1 ມື້',\n            dd: '%d ມື້',\n            M: '1 ເດືອນ',\n            MM: '%d ເດືອນ',\n            y: '1 ປີ',\n            yy: '%d ປີ',\n        },\n        dayOfMonthOrdinalParse: /(ທີ່)\\d{1,2}/,\n        ordinal: function (number) {\n            return 'ທີ່' + number;\n        },\n    });\n\n    return lo;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/lo.js?");

/***/ }),

/***/ "./node_modules/moment/locale/lt.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/lt.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Lithuanian [lt]\n//! author : Mindaugas Mozūras : https://github.com/mmozuras\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var units = {\n        ss: 'sekundė_sekundžių_sekundes',\n        m: 'minutė_minutės_minutę',\n        mm: 'minutės_minučių_minutes',\n        h: 'valanda_valandos_valandą',\n        hh: 'valandos_valandų_valandas',\n        d: 'diena_dienos_dieną',\n        dd: 'dienos_dienų_dienas',\n        M: 'mėnuo_mėnesio_mėnesį',\n        MM: 'mėnesiai_mėnesių_mėnesius',\n        y: 'metai_metų_metus',\n        yy: 'metai_metų_metus',\n    };\n    function translateSeconds(number, withoutSuffix, key, isFuture) {\n        if (withoutSuffix) {\n            return 'kelios sekundės';\n        } else {\n            return isFuture ? 'kelių sekundžių' : 'kelias sekundes';\n        }\n    }\n    function translateSingular(number, withoutSuffix, key, isFuture) {\n        return withoutSuffix\n            ? forms(key)[0]\n            : isFuture\n            ? forms(key)[1]\n            : forms(key)[2];\n    }\n    function special(number) {\n        return number % 10 === 0 || (number > 10 && number < 20);\n    }\n    function forms(key) {\n        return units[key].split('_');\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        if (number === 1) {\n            return (\n                result + translateSingular(number, withoutSuffix, key[0], isFuture)\n            );\n        } else if (withoutSuffix) {\n            return result + (special(number) ? forms(key)[1] : forms(key)[0]);\n        } else {\n            if (isFuture) {\n                return result + forms(key)[1];\n            } else {\n                return result + (special(number) ? forms(key)[1] : forms(key)[2]);\n            }\n        }\n    }\n    var lt = moment.defineLocale('lt', {\n        months: {\n            format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split(\n                '_'\n            ),\n            standalone:\n                'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split(\n                    '_'\n                ),\n            isFormat: /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?|MMMM?(\\[[^\\[\\]]*\\]|\\s)+D[oD]?/,\n        },\n        monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),\n        weekdays: {\n            format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split(\n                '_'\n            ),\n            standalone:\n                'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split(\n                    '_'\n                ),\n            isFormat: /dddd HH:mm/,\n        },\n        weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),\n        weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'YYYY [m.] MMMM D [d.]',\n            LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',\n            LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',\n            l: 'YYYY-MM-DD',\n            ll: 'YYYY [m.] MMMM D [d.]',\n            lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',\n            llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]',\n        },\n        calendar: {\n            sameDay: '[Šiandien] LT',\n            nextDay: '[Rytoj] LT',\n            nextWeek: 'dddd LT',\n            lastDay: '[Vakar] LT',\n            lastWeek: '[Praėjusį] dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'po %s',\n            past: 'prieš %s',\n            s: translateSeconds,\n            ss: translate,\n            m: translateSingular,\n            mm: translate,\n            h: translateSingular,\n            hh: translate,\n            d: translateSingular,\n            dd: translate,\n            M: translateSingular,\n            MM: translate,\n            y: translateSingular,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-oji/,\n        ordinal: function (number) {\n            return number + '-oji';\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return lt;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/lt.js?");

/***/ }),

/***/ "./node_modules/moment/locale/lv.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/lv.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Latvian [lv]\n//! author : Kristaps Karlsons : https://github.com/skakri\n//! author : Jānis Elmeris : https://github.com/JanisE\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var units = {\n        ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'),\n        m: 'minūtes_minūtēm_minūte_minūtes'.split('_'),\n        mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'),\n        h: 'stundas_stundām_stunda_stundas'.split('_'),\n        hh: 'stundas_stundām_stunda_stundas'.split('_'),\n        d: 'dienas_dienām_diena_dienas'.split('_'),\n        dd: 'dienas_dienām_diena_dienas'.split('_'),\n        M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),\n        MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),\n        y: 'gada_gadiem_gads_gadi'.split('_'),\n        yy: 'gada_gadiem_gads_gadi'.split('_'),\n    };\n    /**\n     * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.\n     */\n    function format(forms, number, withoutSuffix) {\n        if (withoutSuffix) {\n            // E.g. \"21 minūte\", \"3 minūtes\".\n            return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];\n        } else {\n            // E.g. \"21 minūtes\" as in \"pēc 21 minūtes\".\n            // E.g. \"3 minūtēm\" as in \"pēc 3 minūtēm\".\n            return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];\n        }\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        return number + ' ' + format(units[key], number, withoutSuffix);\n    }\n    function relativeTimeWithSingular(number, withoutSuffix, key) {\n        return format(units[key], number, withoutSuffix);\n    }\n    function relativeSeconds(number, withoutSuffix) {\n        return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';\n    }\n\n    var lv = moment.defineLocale('lv', {\n        months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),\n        weekdays:\n            'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split(\n                '_'\n            ),\n        weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),\n        weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY.',\n            LL: 'YYYY. [gada] D. MMMM',\n            LLL: 'YYYY. [gada] D. MMMM, HH:mm',\n            LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm',\n        },\n        calendar: {\n            sameDay: '[Šodien pulksten] LT',\n            nextDay: '[Rīt pulksten] LT',\n            nextWeek: 'dddd [pulksten] LT',\n            lastDay: '[Vakar pulksten] LT',\n            lastWeek: '[Pagājušā] dddd [pulksten] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'pēc %s',\n            past: 'pirms %s',\n            s: relativeSeconds,\n            ss: relativeTimeWithPlural,\n            m: relativeTimeWithSingular,\n            mm: relativeTimeWithPlural,\n            h: relativeTimeWithSingular,\n            hh: relativeTimeWithPlural,\n            d: relativeTimeWithSingular,\n            dd: relativeTimeWithPlural,\n            M: relativeTimeWithSingular,\n            MM: relativeTimeWithPlural,\n            y: relativeTimeWithSingular,\n            yy: relativeTimeWithPlural,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return lv;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/lv.js?");

/***/ }),

/***/ "./node_modules/moment/locale/me.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/me.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Montenegrin [me]\n//! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var translator = {\n        words: {\n            //Different grammatical cases\n            ss: ['sekund', 'sekunda', 'sekundi'],\n            m: ['jedan minut', 'jednog minuta'],\n            mm: ['minut', 'minuta', 'minuta'],\n            h: ['jedan sat', 'jednog sata'],\n            hh: ['sat', 'sata', 'sati'],\n            dd: ['dan', 'dana', 'dana'],\n            MM: ['mjesec', 'mjeseca', 'mjeseci'],\n            yy: ['godina', 'godine', 'godina'],\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            return number === 1\n                ? wordKey[0]\n                : number >= 2 && number <= 4\n                ? wordKey[1]\n                : wordKey[2];\n        },\n        translate: function (number, withoutSuffix, key) {\n            var wordKey = translator.words[key];\n            if (key.length === 1) {\n                return withoutSuffix ? wordKey[0] : wordKey[1];\n            } else {\n                return (\n                    number +\n                    ' ' +\n                    translator.correctGrammaticalCase(number, wordKey)\n                );\n            }\n        },\n    };\n\n    var me = moment.defineLocale('me', {\n        months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(\n            '_'\n        ),\n        weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd, D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sjutra u] LT',\n\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[u] [nedjelju] [u] LT';\n                    case 3:\n                        return '[u] [srijedu] [u] LT';\n                    case 6:\n                        return '[u] [subotu] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[u] dddd [u] LT';\n                }\n            },\n            lastDay: '[juče u] LT',\n            lastWeek: function () {\n                var lastWeekDays = [\n                    '[prošle] [nedjelje] [u] LT',\n                    '[prošlog] [ponedjeljka] [u] LT',\n                    '[prošlog] [utorka] [u] LT',\n                    '[prošle] [srijede] [u] LT',\n                    '[prošlog] [četvrtka] [u] LT',\n                    '[prošlog] [petka] [u] LT',\n                    '[prošle] [subote] [u] LT',\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'prije %s',\n            s: 'nekoliko sekundi',\n            ss: translator.translate,\n            m: translator.translate,\n            mm: translator.translate,\n            h: translator.translate,\n            hh: translator.translate,\n            d: 'dan',\n            dd: translator.translate,\n            M: 'mjesec',\n            MM: translator.translate,\n            y: 'godinu',\n            yy: translator.translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return me;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/me.js?");

/***/ }),

/***/ "./node_modules/moment/locale/mi.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/mi.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Maori [mi]\n//! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var mi = moment.defineLocale('mi', {\n        months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split(\n            '_'\n        ),\n        monthsShort:\n            'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split(\n                '_'\n            ),\n        monthsRegex: /(?:['a-z\\u0101\\u014D\\u016B]+\\-?){1,3}/i,\n        monthsStrictRegex: /(?:['a-z\\u0101\\u014D\\u016B]+\\-?){1,3}/i,\n        monthsShortRegex: /(?:['a-z\\u0101\\u014D\\u016B]+\\-?){1,3}/i,\n        monthsShortStrictRegex: /(?:['a-z\\u0101\\u014D\\u016B]+\\-?){1,2}/i,\n        weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),\n        weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),\n        weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [i] HH:mm',\n            LLLL: 'dddd, D MMMM YYYY [i] HH:mm',\n        },\n        calendar: {\n            sameDay: '[i teie mahana, i] LT',\n            nextDay: '[apopo i] LT',\n            nextWeek: 'dddd [i] LT',\n            lastDay: '[inanahi i] LT',\n            lastWeek: 'dddd [whakamutunga i] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'i roto i %s',\n            past: '%s i mua',\n            s: 'te hēkona ruarua',\n            ss: '%d hēkona',\n            m: 'he meneti',\n            mm: '%d meneti',\n            h: 'te haora',\n            hh: '%d haora',\n            d: 'he ra',\n            dd: '%d ra',\n            M: 'he marama',\n            MM: '%d marama',\n            y: 'he tau',\n            yy: '%d tau',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return mi;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/mi.js?");

/***/ }),

/***/ "./node_modules/moment/locale/mk.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/mk.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Macedonian [mk]\n//! author : Borislav Mickov : https://github.com/B0k0\n//! author : Sashko Todorov : https://github.com/bkyceh\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var mk = moment.defineLocale('mk', {\n        months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split(\n            '_'\n        ),\n        monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split(\n            '_'\n        ),\n        weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),\n        weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'D.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY H:mm',\n            LLLL: 'dddd, D MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[Денес во] LT',\n            nextDay: '[Утре во] LT',\n            nextWeek: '[Во] dddd [во] LT',\n            lastDay: '[Вчера во] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                    case 6:\n                        return '[Изминатата] dddd [во] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[Изминатиот] dddd [во] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'за %s',\n            past: 'пред %s',\n            s: 'неколку секунди',\n            ss: '%d секунди',\n            m: 'една минута',\n            mm: '%d минути',\n            h: 'еден час',\n            hh: '%d часа',\n            d: 'еден ден',\n            dd: '%d дена',\n            M: 'еден месец',\n            MM: '%d месеци',\n            y: 'една година',\n            yy: '%d години',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal: function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return mk;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/mk.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ml.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ml.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Malayalam [ml]\n//! author : Floyd Pink : https://github.com/floydpink\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ml = moment.defineLocale('ml', {\n        months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split(\n                '_'\n            ),\n        weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),\n        weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm -നു',\n            LTS: 'A h:mm:ss -നു',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm -നു',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm -നു',\n        },\n        calendar: {\n            sameDay: '[ഇന്ന്] LT',\n            nextDay: '[നാളെ] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[ഇന്നലെ] LT',\n            lastWeek: '[കഴിഞ്ഞ] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s കഴിഞ്ഞ്',\n            past: '%s മുൻപ്',\n            s: 'അൽപ നിമിഷങ്ങൾ',\n            ss: '%d സെക്കൻഡ്',\n            m: 'ഒരു മിനിറ്റ്',\n            mm: '%d മിനിറ്റ്',\n            h: 'ഒരു മണിക്കൂർ',\n            hh: '%d മണിക്കൂർ',\n            d: 'ഒരു ദിവസം',\n            dd: '%d ദിവസം',\n            M: 'ഒരു മാസം',\n            MM: '%d മാസം',\n            y: 'ഒരു വർഷം',\n            yy: '%d വർഷം',\n        },\n        meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (\n                (meridiem === 'രാത്രി' && hour >= 4) ||\n                meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||\n                meridiem === 'വൈകുന്നേരം'\n            ) {\n                return hour + 12;\n            } else {\n                return hour;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'രാത്രി';\n            } else if (hour < 12) {\n                return 'രാവിലെ';\n            } else if (hour < 17) {\n                return 'ഉച്ച കഴിഞ്ഞ്';\n            } else if (hour < 20) {\n                return 'വൈകുന്നേരം';\n            } else {\n                return 'രാത്രി';\n            }\n        },\n    });\n\n    return ml;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ml.js?");

/***/ }),

/***/ "./node_modules/moment/locale/mn.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/mn.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Mongolian [mn]\n//! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function translate(number, withoutSuffix, key, isFuture) {\n        switch (key) {\n            case 's':\n                return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';\n            case 'ss':\n                return number + (withoutSuffix ? ' секунд' : ' секундын');\n            case 'm':\n            case 'mm':\n                return number + (withoutSuffix ? ' минут' : ' минутын');\n            case 'h':\n            case 'hh':\n                return number + (withoutSuffix ? ' цаг' : ' цагийн');\n            case 'd':\n            case 'dd':\n                return number + (withoutSuffix ? ' өдөр' : ' өдрийн');\n            case 'M':\n            case 'MM':\n                return number + (withoutSuffix ? ' сар' : ' сарын');\n            case 'y':\n            case 'yy':\n                return number + (withoutSuffix ? ' жил' : ' жилийн');\n            default:\n                return number;\n        }\n    }\n\n    var mn = moment.defineLocale('mn', {\n        months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split(\n            '_'\n        ),\n        monthsShort:\n            '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),\n        weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),\n        weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'YYYY оны MMMMын D',\n            LLL: 'YYYY оны MMMMын D HH:mm',\n            LLLL: 'dddd, YYYY оны MMMMын D HH:mm',\n        },\n        meridiemParse: /ҮӨ|ҮХ/i,\n        isPM: function (input) {\n            return input === 'ҮХ';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ҮӨ';\n            } else {\n                return 'ҮХ';\n            }\n        },\n        calendar: {\n            sameDay: '[Өнөөдөр] LT',\n            nextDay: '[Маргааш] LT',\n            nextWeek: '[Ирэх] dddd LT',\n            lastDay: '[Өчигдөр] LT',\n            lastWeek: '[Өнгөрсөн] dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s дараа',\n            past: '%s өмнө',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2} өдөр/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + ' өдөр';\n                default:\n                    return number;\n            }\n        },\n    });\n\n    return mn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/mn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/mr.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/mr.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Marathi [mr]\n//! author : Harshad Kale : https://github.com/kalehv\n//! author : Vivek Athalye : https://github.com/vnathalye\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '१',\n            2: '२',\n            3: '३',\n            4: '४',\n            5: '५',\n            6: '६',\n            7: '७',\n            8: '८',\n            9: '९',\n            0: '०',\n        },\n        numberMap = {\n            '१': '1',\n            '२': '2',\n            '३': '3',\n            '४': '4',\n            '५': '5',\n            '६': '6',\n            '७': '7',\n            '८': '8',\n            '९': '9',\n            '०': '0',\n        };\n\n    function relativeTimeMr(number, withoutSuffix, string, isFuture) {\n        var output = '';\n        if (withoutSuffix) {\n            switch (string) {\n                case 's':\n                    output = 'काही सेकंद';\n                    break;\n                case 'ss':\n                    output = '%d सेकंद';\n                    break;\n                case 'm':\n                    output = 'एक मिनिट';\n                    break;\n                case 'mm':\n                    output = '%d मिनिटे';\n                    break;\n                case 'h':\n                    output = 'एक तास';\n                    break;\n                case 'hh':\n                    output = '%d तास';\n                    break;\n                case 'd':\n                    output = 'एक दिवस';\n                    break;\n                case 'dd':\n                    output = '%d दिवस';\n                    break;\n                case 'M':\n                    output = 'एक महिना';\n                    break;\n                case 'MM':\n                    output = '%d महिने';\n                    break;\n                case 'y':\n                    output = 'एक वर्ष';\n                    break;\n                case 'yy':\n                    output = '%d वर्षे';\n                    break;\n            }\n        } else {\n            switch (string) {\n                case 's':\n                    output = 'काही सेकंदां';\n                    break;\n                case 'ss':\n                    output = '%d सेकंदां';\n                    break;\n                case 'm':\n                    output = 'एका मिनिटा';\n                    break;\n                case 'mm':\n                    output = '%d मिनिटां';\n                    break;\n                case 'h':\n                    output = 'एका तासा';\n                    break;\n                case 'hh':\n                    output = '%d तासां';\n                    break;\n                case 'd':\n                    output = 'एका दिवसा';\n                    break;\n                case 'dd':\n                    output = '%d दिवसां';\n                    break;\n                case 'M':\n                    output = 'एका महिन्या';\n                    break;\n                case 'MM':\n                    output = '%d महिन्यां';\n                    break;\n                case 'y':\n                    output = 'एका वर्षा';\n                    break;\n                case 'yy':\n                    output = '%d वर्षां';\n                    break;\n            }\n        }\n        return output.replace(/%d/i, number);\n    }\n\n    var mr = moment.defineLocale('mr', {\n        months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(\n            '_'\n        ),\n        monthsShort:\n            'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm वाजता',\n            LTS: 'A h:mm:ss वाजता',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm वाजता',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता',\n        },\n        calendar: {\n            sameDay: '[आज] LT',\n            nextDay: '[उद्या] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[काल] LT',\n            lastWeek: '[मागील] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%sमध्ये',\n            past: '%sपूर्वी',\n            s: relativeTimeMr,\n            ss: relativeTimeMr,\n            m: relativeTimeMr,\n            mm: relativeTimeMr,\n            h: relativeTimeMr,\n            hh: relativeTimeMr,\n            d: relativeTimeMr,\n            dd: relativeTimeMr,\n            M: relativeTimeMr,\n            MM: relativeTimeMr,\n            y: relativeTimeMr,\n            yy: relativeTimeMr,\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'पहाटे' || meridiem === 'सकाळी') {\n                return hour;\n            } else if (\n                meridiem === 'दुपारी' ||\n                meridiem === 'सायंकाळी' ||\n                meridiem === 'रात्री'\n            ) {\n                return hour >= 12 ? hour : hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour >= 0 && hour < 6) {\n                return 'पहाटे';\n            } else if (hour < 12) {\n                return 'सकाळी';\n            } else if (hour < 17) {\n                return 'दुपारी';\n            } else if (hour < 20) {\n                return 'सायंकाळी';\n            } else {\n                return 'रात्री';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return mr;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/mr.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ms-my.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/ms-my.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Malay [ms-my]\n//! note : DEPRECATED, the correct one is [ms]\n//! author : Weldan Jamili : https://github.com/weldan\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var msMy = moment.defineLocale('ms-my', {\n        months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n        weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n        weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n        weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [pukul] HH.mm',\n            LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',\n        },\n        meridiemParse: /pagi|tengahari|petang|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'tengahari') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'petang' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'tengahari';\n            } else if (hours < 19) {\n                return 'petang';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar: {\n            sameDay: '[Hari ini pukul] LT',\n            nextDay: '[Esok pukul] LT',\n            nextWeek: 'dddd [pukul] LT',\n            lastDay: '[Kelmarin pukul] LT',\n            lastWeek: 'dddd [lepas pukul] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dalam %s',\n            past: '%s yang lepas',\n            s: 'beberapa saat',\n            ss: '%d saat',\n            m: 'seminit',\n            mm: '%d minit',\n            h: 'sejam',\n            hh: '%d jam',\n            d: 'sehari',\n            dd: '%d hari',\n            M: 'sebulan',\n            MM: '%d bulan',\n            y: 'setahun',\n            yy: '%d tahun',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return msMy;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ms-my.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ms.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ms.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Malay [ms]\n//! author : Weldan Jamili : https://github.com/weldan\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ms = moment.defineLocale('ms', {\n        months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n        weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n        weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n        weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [pukul] HH.mm',\n            LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',\n        },\n        meridiemParse: /pagi|tengahari|petang|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'tengahari') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'petang' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'tengahari';\n            } else if (hours < 19) {\n                return 'petang';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar: {\n            sameDay: '[Hari ini pukul] LT',\n            nextDay: '[Esok pukul] LT',\n            nextWeek: 'dddd [pukul] LT',\n            lastDay: '[Kelmarin pukul] LT',\n            lastWeek: 'dddd [lepas pukul] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dalam %s',\n            past: '%s yang lepas',\n            s: 'beberapa saat',\n            ss: '%d saat',\n            m: 'seminit',\n            mm: '%d minit',\n            h: 'sejam',\n            hh: '%d jam',\n            d: 'sehari',\n            dd: '%d hari',\n            M: 'sebulan',\n            MM: '%d bulan',\n            y: 'setahun',\n            yy: '%d tahun',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return ms;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ms.js?");

/***/ }),

/***/ "./node_modules/moment/locale/mt.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/mt.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Maltese (Malta) [mt]\n//! author : Alessandro Maruccia : https://github.com/alesma\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var mt = moment.defineLocale('mt', {\n        months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),\n        weekdays:\n            'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split(\n                '_'\n            ),\n        weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),\n        weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Illum fil-]LT',\n            nextDay: '[Għada fil-]LT',\n            nextWeek: 'dddd [fil-]LT',\n            lastDay: '[Il-bieraħ fil-]LT',\n            lastWeek: 'dddd [li għadda] [fil-]LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'f’ %s',\n            past: '%s ilu',\n            s: 'ftit sekondi',\n            ss: '%d sekondi',\n            m: 'minuta',\n            mm: '%d minuti',\n            h: 'siegħa',\n            hh: '%d siegħat',\n            d: 'ġurnata',\n            dd: '%d ġranet',\n            M: 'xahar',\n            MM: '%d xhur',\n            y: 'sena',\n            yy: '%d sni',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return mt;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/mt.js?");

/***/ }),

/***/ "./node_modules/moment/locale/my.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/my.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Burmese [my]\n//! author : Squar team, mysquar.com\n//! author : David Rossellat : https://github.com/gholadr\n//! author : Tin Aung Lin : https://github.com/thanyawzinmin\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '၁',\n            2: '၂',\n            3: '၃',\n            4: '၄',\n            5: '၅',\n            6: '၆',\n            7: '၇',\n            8: '၈',\n            9: '၉',\n            0: '၀',\n        },\n        numberMap = {\n            '၁': '1',\n            '၂': '2',\n            '၃': '3',\n            '၄': '4',\n            '၅': '5',\n            '၆': '6',\n            '၇': '7',\n            '၈': '8',\n            '၉': '9',\n            '၀': '0',\n        };\n\n    var my = moment.defineLocale('my', {\n        months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split(\n            '_'\n        ),\n        monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),\n        weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split(\n            '_'\n        ),\n        weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n        weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[ယနေ.] LT [မှာ]',\n            nextDay: '[မနက်ဖြန်] LT [မှာ]',\n            nextWeek: 'dddd LT [မှာ]',\n            lastDay: '[မနေ.က] LT [မှာ]',\n            lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'လာမည့် %s မှာ',\n            past: 'လွန်ခဲ့သော %s က',\n            s: 'စက္ကန်.အနည်းငယ်',\n            ss: '%d စက္ကန့်',\n            m: 'တစ်မိနစ်',\n            mm: '%d မိနစ်',\n            h: 'တစ်နာရီ',\n            hh: '%d နာရီ',\n            d: 'တစ်ရက်',\n            dd: '%d ရက်',\n            M: 'တစ်လ',\n            MM: '%d လ',\n            y: 'တစ်နှစ်',\n            yy: '%d နှစ်',\n        },\n        preparse: function (string) {\n            return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return my;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/my.js?");

/***/ }),

/***/ "./node_modules/moment/locale/nb.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/nb.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Norwegian Bokmål [nb]\n//! authors : Espen Hovlandsdal : https://github.com/rexxars\n//!           Sigurd Gartmann : https://github.com/sigurdga\n//!           Stephen Ramthun : https://github.com/stephenramthun\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var nb = moment.defineLocale('nb', {\n        months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),\n        weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY [kl.] HH:mm',\n            LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',\n        },\n        calendar: {\n            sameDay: '[i dag kl.] LT',\n            nextDay: '[i morgen kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[i går kl.] LT',\n            lastWeek: '[forrige] dddd [kl.] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'om %s',\n            past: '%s siden',\n            s: 'noen sekunder',\n            ss: '%d sekunder',\n            m: 'ett minutt',\n            mm: '%d minutter',\n            h: 'en time',\n            hh: '%d timer',\n            d: 'en dag',\n            dd: '%d dager',\n            w: 'en uke',\n            ww: '%d uker',\n            M: 'en måned',\n            MM: '%d måneder',\n            y: 'ett år',\n            yy: '%d år',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return nb;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/nb.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ne.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ne.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Nepalese [ne]\n//! author : suvash : https://github.com/suvash\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '१',\n            2: '२',\n            3: '३',\n            4: '४',\n            5: '५',\n            6: '६',\n            7: '७',\n            8: '८',\n            9: '९',\n            0: '०',\n        },\n        numberMap = {\n            '१': '1',\n            '२': '2',\n            '३': '3',\n            '४': '4',\n            '५': '5',\n            '६': '6',\n            '७': '7',\n            '८': '8',\n            '९': '9',\n            '०': '0',\n        };\n\n    var ne = moment.defineLocale('ne', {\n        months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split(\n            '_'\n        ),\n        monthsShort:\n            'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split(\n            '_'\n        ),\n        weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),\n        weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'Aको h:mm बजे',\n            LTS: 'Aको h:mm:ss बजे',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, Aको h:mm बजे',\n            LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे',\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /राति|बिहान|दिउँसो|साँझ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'राति') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'बिहान') {\n                return hour;\n            } else if (meridiem === 'दिउँसो') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'साँझ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 3) {\n                return 'राति';\n            } else if (hour < 12) {\n                return 'बिहान';\n            } else if (hour < 16) {\n                return 'दिउँसो';\n            } else if (hour < 20) {\n                return 'साँझ';\n            } else {\n                return 'राति';\n            }\n        },\n        calendar: {\n            sameDay: '[आज] LT',\n            nextDay: '[भोलि] LT',\n            nextWeek: '[आउँदो] dddd[,] LT',\n            lastDay: '[हिजो] LT',\n            lastWeek: '[गएको] dddd[,] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%sमा',\n            past: '%s अगाडि',\n            s: 'केही क्षण',\n            ss: '%d सेकेण्ड',\n            m: 'एक मिनेट',\n            mm: '%d मिनेट',\n            h: 'एक घण्टा',\n            hh: '%d घण्टा',\n            d: 'एक दिन',\n            dd: '%d दिन',\n            M: 'एक महिना',\n            MM: '%d महिना',\n            y: 'एक बर्ष',\n            yy: '%d बर्ष',\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return ne;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ne.js?");

/***/ }),

/***/ "./node_modules/moment/locale/nl-be.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/nl-be.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Dutch (Belgium) [nl-be]\n//! author : Joris Röling : https://github.com/jorisroling\n//! author : Jacob Middag : https://github.com/middagj\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortWithDots =\n            'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        monthsShortWithoutDots =\n            'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        monthsParse = [\n            /^jan/i,\n            /^feb/i,\n            /^maart|mrt.?$/i,\n            /^apr/i,\n            /^mei$/i,\n            /^jun[i.]?$/i,\n            /^jul[i.]?$/i,\n            /^aug/i,\n            /^sep/i,\n            /^okt/i,\n            /^nov/i,\n            /^dec/i,\n        ],\n        monthsRegex =\n            /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\\.?|feb\\.?|mrt\\.?|apr\\.?|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i;\n\n    var nlBe = moment.defineLocale('nl-be', {\n        months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortWithDots;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShortWithoutDots[m.month()];\n            } else {\n                return monthsShortWithDots[m.month()];\n            }\n        },\n\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,\n        monthsShortStrictRegex:\n            /^(jan\\.?|feb\\.?|mrt\\.?|apr\\.?|mei|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i,\n\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n\n        weekdays:\n            'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n        weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),\n        weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[vandaag om] LT',\n            nextDay: '[morgen om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[gisteren om] LT',\n            lastWeek: '[afgelopen] dddd [om] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'over %s',\n            past: '%s geleden',\n            s: 'een paar seconden',\n            ss: '%d seconden',\n            m: 'één minuut',\n            mm: '%d minuten',\n            h: 'één uur',\n            hh: '%d uur',\n            d: 'één dag',\n            dd: '%d dagen',\n            M: 'één maand',\n            MM: '%d maanden',\n            y: 'één jaar',\n            yy: '%d jaar',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n        ordinal: function (number) {\n            return (\n                number +\n                (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n            );\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return nlBe;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/nl-be.js?");

/***/ }),

/***/ "./node_modules/moment/locale/nl.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/nl.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Dutch [nl]\n//! author : Joris Röling : https://github.com/jorisroling\n//! author : Jacob Middag : https://github.com/middagj\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortWithDots =\n            'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        monthsShortWithoutDots =\n            'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        monthsParse = [\n            /^jan/i,\n            /^feb/i,\n            /^maart|mrt.?$/i,\n            /^apr/i,\n            /^mei$/i,\n            /^jun[i.]?$/i,\n            /^jul[i.]?$/i,\n            /^aug/i,\n            /^sep/i,\n            /^okt/i,\n            /^nov/i,\n            /^dec/i,\n        ],\n        monthsRegex =\n            /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\\.?|feb\\.?|mrt\\.?|apr\\.?|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i;\n\n    var nl = moment.defineLocale('nl', {\n        months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortWithDots;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShortWithoutDots[m.month()];\n            } else {\n                return monthsShortWithDots[m.month()];\n            }\n        },\n\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,\n        monthsShortStrictRegex:\n            /^(jan\\.?|feb\\.?|mrt\\.?|apr\\.?|mei|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i,\n\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n\n        weekdays:\n            'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n        weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),\n        weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD-MM-YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[vandaag om] LT',\n            nextDay: '[morgen om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[gisteren om] LT',\n            lastWeek: '[afgelopen] dddd [om] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'over %s',\n            past: '%s geleden',\n            s: 'een paar seconden',\n            ss: '%d seconden',\n            m: 'één minuut',\n            mm: '%d minuten',\n            h: 'één uur',\n            hh: '%d uur',\n            d: 'één dag',\n            dd: '%d dagen',\n            w: 'één week',\n            ww: '%d weken',\n            M: 'één maand',\n            MM: '%d maanden',\n            y: 'één jaar',\n            yy: '%d jaar',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n        ordinal: function (number) {\n            return (\n                number +\n                (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n            );\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return nl;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/nl.js?");

/***/ }),

/***/ "./node_modules/moment/locale/nn.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/nn.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Nynorsk [nn]\n//! authors : https://github.com/mechuwind\n//!           Stephen Ramthun : https://github.com/stephenramthun\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var nn = moment.defineLocale('nn', {\n        months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),\n        weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'),\n        weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY [kl.] H:mm',\n            LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',\n        },\n        calendar: {\n            sameDay: '[I dag klokka] LT',\n            nextDay: '[I morgon klokka] LT',\n            nextWeek: 'dddd [klokka] LT',\n            lastDay: '[I går klokka] LT',\n            lastWeek: '[Føregåande] dddd [klokka] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'om %s',\n            past: '%s sidan',\n            s: 'nokre sekund',\n            ss: '%d sekund',\n            m: 'eit minutt',\n            mm: '%d minutt',\n            h: 'ein time',\n            hh: '%d timar',\n            d: 'ein dag',\n            dd: '%d dagar',\n            w: 'ei veke',\n            ww: '%d veker',\n            M: 'ein månad',\n            MM: '%d månader',\n            y: 'eit år',\n            yy: '%d år',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return nn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/nn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/oc-lnc.js":
/*!**********************************************!*\
  !*** ./node_modules/moment/locale/oc-lnc.js ***!
  \**********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Occitan, lengadocian dialecte [oc-lnc]\n//! author : Quentin PAGÈS : https://github.com/Quenty31\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ocLnc = moment.defineLocale('oc-lnc', {\n        months: {\n            standalone:\n                'genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split(\n                    '_'\n                ),\n            format: \"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre\".split(\n                '_'\n            ),\n            isFormat: /D[oD]?(\\s)+MMMM/,\n        },\n        monthsShort:\n            'gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split(\n            '_'\n        ),\n        weekdaysShort: 'dg._dl._dm._dc._dj._dv._ds.'.split('_'),\n        weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM [de] YYYY',\n            ll: 'D MMM YYYY',\n            LLL: 'D MMMM [de] YYYY [a] H:mm',\n            lll: 'D MMM YYYY, H:mm',\n            LLLL: 'dddd D MMMM [de] YYYY [a] H:mm',\n            llll: 'ddd D MMM YYYY, H:mm',\n        },\n        calendar: {\n            sameDay: '[uèi a] LT',\n            nextDay: '[deman a] LT',\n            nextWeek: 'dddd [a] LT',\n            lastDay: '[ièr a] LT',\n            lastWeek: 'dddd [passat a] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: \"d'aquí %s\",\n            past: 'fa %s',\n            s: 'unas segondas',\n            ss: '%d segondas',\n            m: 'una minuta',\n            mm: '%d minutas',\n            h: 'una ora',\n            hh: '%d oras',\n            d: 'un jorn',\n            dd: '%d jorns',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un an',\n            yy: '%d ans',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(r|n|t|è|a)/,\n        ordinal: function (number, period) {\n            var output =\n                number === 1\n                    ? 'r'\n                    : number === 2\n                    ? 'n'\n                    : number === 3\n                    ? 'r'\n                    : number === 4\n                    ? 't'\n                    : 'è';\n            if (period === 'w' || period === 'W') {\n                output = 'a';\n            }\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4,\n        },\n    });\n\n    return ocLnc;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/oc-lnc.js?");

/***/ }),

/***/ "./node_modules/moment/locale/pa-in.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/pa-in.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Punjabi (India) [pa-in]\n//! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '੧',\n            2: '੨',\n            3: '੩',\n            4: '੪',\n            5: '੫',\n            6: '੬',\n            7: '੭',\n            8: '੮',\n            9: '੯',\n            0: '੦',\n        },\n        numberMap = {\n            '੧': '1',\n            '੨': '2',\n            '੩': '3',\n            '੪': '4',\n            '੫': '5',\n            '੬': '6',\n            '੭': '7',\n            '੮': '8',\n            '੯': '9',\n            '੦': '0',\n        };\n\n    var paIn = moment.defineLocale('pa-in', {\n        // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi.\n        months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(\n                '_'\n            ),\n        weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split(\n            '_'\n        ),\n        weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),\n        weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm ਵਜੇ',\n            LTS: 'A h:mm:ss ਵਜੇ',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ',\n        },\n        calendar: {\n            sameDay: '[ਅਜ] LT',\n            nextDay: '[ਕਲ] LT',\n            nextWeek: '[ਅਗਲਾ] dddd, LT',\n            lastDay: '[ਕਲ] LT',\n            lastWeek: '[ਪਿਛਲੇ] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ਵਿੱਚ',\n            past: '%s ਪਿਛਲੇ',\n            s: 'ਕੁਝ ਸਕਿੰਟ',\n            ss: '%d ਸਕਿੰਟ',\n            m: 'ਇਕ ਮਿੰਟ',\n            mm: '%d ਮਿੰਟ',\n            h: 'ਇੱਕ ਘੰਟਾ',\n            hh: '%d ਘੰਟੇ',\n            d: 'ਇੱਕ ਦਿਨ',\n            dd: '%d ਦਿਨ',\n            M: 'ਇੱਕ ਮਹੀਨਾ',\n            MM: '%d ਮਹੀਨੇ',\n            y: 'ਇੱਕ ਸਾਲ',\n            yy: '%d ਸਾਲ',\n        },\n        preparse: function (string) {\n            return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // Punjabi notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.\n        meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'ਰਾਤ') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'ਸਵੇਰ') {\n                return hour;\n            } else if (meridiem === 'ਦੁਪਹਿਰ') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'ਸ਼ਾਮ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ਰਾਤ';\n            } else if (hour < 10) {\n                return 'ਸਵੇਰ';\n            } else if (hour < 17) {\n                return 'ਦੁਪਹਿਰ';\n            } else if (hour < 20) {\n                return 'ਸ਼ਾਮ';\n            } else {\n                return 'ਰਾਤ';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return paIn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/pa-in.js?");

/***/ }),

/***/ "./node_modules/moment/locale/pl.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/pl.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Polish [pl]\n//! author : Rafal Hirsz : https://github.com/evoL\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsNominative =\n            'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(\n                '_'\n            ),\n        monthsSubjective =\n            'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(\n                '_'\n            ),\n        monthsParse = [\n            /^sty/i,\n            /^lut/i,\n            /^mar/i,\n            /^kwi/i,\n            /^maj/i,\n            /^cze/i,\n            /^lip/i,\n            /^sie/i,\n            /^wrz/i,\n            /^paź/i,\n            /^lis/i,\n            /^gru/i,\n        ];\n    function plural(n) {\n        return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;\n    }\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n            case 'ss':\n                return result + (plural(number) ? 'sekundy' : 'sekund');\n            case 'm':\n                return withoutSuffix ? 'minuta' : 'minutę';\n            case 'mm':\n                return result + (plural(number) ? 'minuty' : 'minut');\n            case 'h':\n                return withoutSuffix ? 'godzina' : 'godzinę';\n            case 'hh':\n                return result + (plural(number) ? 'godziny' : 'godzin');\n            case 'ww':\n                return result + (plural(number) ? 'tygodnie' : 'tygodni');\n            case 'MM':\n                return result + (plural(number) ? 'miesiące' : 'miesięcy');\n            case 'yy':\n                return result + (plural(number) ? 'lata' : 'lat');\n        }\n    }\n\n    var pl = moment.defineLocale('pl', {\n        months: function (momentToFormat, format) {\n            if (!momentToFormat) {\n                return monthsNominative;\n            } else if (/D MMMM/.test(format)) {\n                return monthsSubjective[momentToFormat.month()];\n            } else {\n                return monthsNominative[momentToFormat.month()];\n            }\n        },\n        monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays:\n            'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),\n        weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),\n        weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Dziś o] LT',\n            nextDay: '[Jutro o] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[W niedzielę o] LT';\n\n                    case 2:\n                        return '[We wtorek o] LT';\n\n                    case 3:\n                        return '[W środę o] LT';\n\n                    case 6:\n                        return '[W sobotę o] LT';\n\n                    default:\n                        return '[W] dddd [o] LT';\n                }\n            },\n            lastDay: '[Wczoraj o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[W zeszłą niedzielę o] LT';\n                    case 3:\n                        return '[W zeszłą środę o] LT';\n                    case 6:\n                        return '[W zeszłą sobotę o] LT';\n                    default:\n                        return '[W zeszły] dddd [o] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: '%s temu',\n            s: 'kilka sekund',\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: '1 dzień',\n            dd: '%d dni',\n            w: 'tydzień',\n            ww: translate,\n            M: 'miesiąc',\n            MM: translate,\n            y: 'rok',\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return pl;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/pl.js?");

/***/ }),

/***/ "./node_modules/moment/locale/pt-br.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/pt-br.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Portuguese (Brazil) [pt-br]\n//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ptBr = moment.defineLocale('pt-br', {\n        months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(\n            '_'\n        ),\n        monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays:\n            'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(\n                '_'\n            ),\n        weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n        weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',\n        },\n        calendar: {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return this.day() === 0 || this.day() === 6\n                    ? '[Último] dddd [às] LT' // Saturday + Sunday\n                    : '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'em %s',\n            past: 'há %s',\n            s: 'poucos segundos',\n            ss: '%d segundos',\n            m: 'um minuto',\n            mm: '%d minutos',\n            h: 'uma hora',\n            hh: '%d horas',\n            d: 'um dia',\n            dd: '%d dias',\n            M: 'um mês',\n            MM: '%d meses',\n            y: 'um ano',\n            yy: '%d anos',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        invalidDate: 'Data inválida',\n    });\n\n    return ptBr;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/pt-br.js?");

/***/ }),

/***/ "./node_modules/moment/locale/pt.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/pt.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Portuguese [pt]\n//! author : Jefferson : https://github.com/jalex79\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var pt = moment.defineLocale('pt', {\n        months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(\n            '_'\n        ),\n        monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays:\n            'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split(\n                '_'\n            ),\n        weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),\n        weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY HH:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return this.day() === 0 || this.day() === 6\n                    ? '[Último] dddd [às] LT' // Saturday + Sunday\n                    : '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'em %s',\n            past: 'há %s',\n            s: 'segundos',\n            ss: '%d segundos',\n            m: 'um minuto',\n            mm: '%d minutos',\n            h: 'uma hora',\n            hh: '%d horas',\n            d: 'um dia',\n            dd: '%d dias',\n            w: 'uma semana',\n            ww: '%d semanas',\n            M: 'um mês',\n            MM: '%d meses',\n            y: 'um ano',\n            yy: '%d anos',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return pt;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/pt.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ro.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ro.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Romanian [ro]\n//! author : Vlad Gurdiga : https://github.com/gurdiga\n//! author : Valentin Agachi : https://github.com/avaly\n//! author : Emanuel Cepoi : https://github.com/cepem\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n                ss: 'secunde',\n                mm: 'minute',\n                hh: 'ore',\n                dd: 'zile',\n                ww: 'săptămâni',\n                MM: 'luni',\n                yy: 'ani',\n            },\n            separator = ' ';\n        if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n            separator = ' de ';\n        }\n        return number + separator + format[key];\n    }\n\n    var ro = moment.defineLocale('ro', {\n        months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(\n            '_'\n        ),\n        monthsShort:\n            'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n        weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n        weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY H:mm',\n            LLLL: 'dddd, D MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[azi la] LT',\n            nextDay: '[mâine la] LT',\n            nextWeek: 'dddd [la] LT',\n            lastDay: '[ieri la] LT',\n            lastWeek: '[fosta] dddd [la] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'peste %s',\n            past: '%s în urmă',\n            s: 'câteva secunde',\n            ss: relativeTimeWithPlural,\n            m: 'un minut',\n            mm: relativeTimeWithPlural,\n            h: 'o oră',\n            hh: relativeTimeWithPlural,\n            d: 'o zi',\n            dd: relativeTimeWithPlural,\n            w: 'o săptămână',\n            ww: relativeTimeWithPlural,\n            M: 'o lună',\n            MM: relativeTimeWithPlural,\n            y: 'un an',\n            yy: relativeTimeWithPlural,\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return ro;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ro.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ru.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ru.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11\n            ? forms[0]\n            : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)\n            ? forms[1]\n            : forms[2];\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',\n            mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n            hh: 'час_часа_часов',\n            dd: 'день_дня_дней',\n            ww: 'неделя_недели_недель',\n            MM: 'месяц_месяца_месяцев',\n            yy: 'год_года_лет',\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'минута' : 'минуту';\n        } else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n    var monthsParse = [\n        /^янв/i,\n        /^фев/i,\n        /^мар/i,\n        /^апр/i,\n        /^ма[йя]/i,\n        /^июн/i,\n        /^июл/i,\n        /^авг/i,\n        /^сен/i,\n        /^окт/i,\n        /^ноя/i,\n        /^дек/i,\n    ];\n\n    // http://new.gramota.ru/spravka/rules/139-prop : § 103\n    // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637\n    // CLDR data:          http://www.unicode.org/cldr/charts/28/summary/ru.html#1753\n    var ru = moment.defineLocale('ru', {\n        months: {\n            format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split(\n                '_'\n            ),\n            standalone:\n                'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(\n                    '_'\n                ),\n        },\n        monthsShort: {\n            // по CLDR именно \"июл.\" и \"июн.\", но какой смысл менять букву на точку?\n            format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split(\n                '_'\n            ),\n            standalone:\n                'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split(\n                    '_'\n                ),\n        },\n        weekdays: {\n            standalone:\n                'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split(\n                    '_'\n                ),\n            format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split(\n                '_'\n            ),\n            isFormat: /\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/,\n        },\n        weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n\n        // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки\n        monthsRegex:\n            /^(январ[ья]|янв\\.?|феврал[ья]|февр?\\.?|марта?|мар\\.?|апрел[ья]|апр\\.?|ма[йя]|июн[ья]|июн\\.?|июл[ья]|июл\\.?|августа?|авг\\.?|сентябр[ья]|сент?\\.?|октябр[ья]|окт\\.?|ноябр[ья]|нояб?\\.?|декабр[ья]|дек\\.?)/i,\n\n        // копия предыдущего\n        monthsShortRegex:\n            /^(январ[ья]|янв\\.?|феврал[ья]|февр?\\.?|марта?|мар\\.?|апрел[ья]|апр\\.?|ма[йя]|июн[ья]|июн\\.?|июл[ья]|июл\\.?|августа?|авг\\.?|сентябр[ья]|сент?\\.?|октябр[ья]|окт\\.?|ноябр[ья]|нояб?\\.?|декабр[ья]|дек\\.?)/i,\n\n        // полные названия с падежами\n        monthsStrictRegex:\n            /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,\n\n        // Выражение, которое соответствует только сокращённым формам\n        monthsShortStrictRegex:\n            /^(янв\\.|февр?\\.|мар[т.]|апр\\.|ма[яй]|июн[ья.]|июл[ья.]|авг\\.|сент?\\.|окт\\.|нояб?\\.|дек\\.)/i,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY г.',\n            LLL: 'D MMMM YYYY г., H:mm',\n            LLLL: 'dddd, D MMMM YYYY г., H:mm',\n        },\n        calendar: {\n            sameDay: '[Сегодня, в] LT',\n            nextDay: '[Завтра, в] LT',\n            lastDay: '[Вчера, в] LT',\n            nextWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    switch (this.day()) {\n                        case 0:\n                            return '[В следующее] dddd, [в] LT';\n                        case 1:\n                        case 2:\n                        case 4:\n                            return '[В следующий] dddd, [в] LT';\n                        case 3:\n                        case 5:\n                        case 6:\n                            return '[В следующую] dddd, [в] LT';\n                    }\n                } else {\n                    if (this.day() === 2) {\n                        return '[Во] dddd, [в] LT';\n                    } else {\n                        return '[В] dddd, [в] LT';\n                    }\n                }\n            },\n            lastWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    switch (this.day()) {\n                        case 0:\n                            return '[В прошлое] dddd, [в] LT';\n                        case 1:\n                        case 2:\n                        case 4:\n                            return '[В прошлый] dddd, [в] LT';\n                        case 3:\n                        case 5:\n                        case 6:\n                            return '[В прошлую] dddd, [в] LT';\n                    }\n                } else {\n                    if (this.day() === 2) {\n                        return '[Во] dddd, [в] LT';\n                    } else {\n                        return '[В] dddd, [в] LT';\n                    }\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'через %s',\n            past: '%s назад',\n            s: 'несколько секунд',\n            ss: relativeTimeWithPlural,\n            m: relativeTimeWithPlural,\n            mm: relativeTimeWithPlural,\n            h: 'час',\n            hh: relativeTimeWithPlural,\n            d: 'день',\n            dd: relativeTimeWithPlural,\n            w: 'неделя',\n            ww: relativeTimeWithPlural,\n            M: 'месяц',\n            MM: relativeTimeWithPlural,\n            y: 'год',\n            yy: relativeTimeWithPlural,\n        },\n        meridiemParse: /ночи|утра|дня|вечера/i,\n        isPM: function (input) {\n            return /^(дня|вечера)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночи';\n            } else if (hour < 12) {\n                return 'утра';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечера';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(й|го|я)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'M':\n                case 'd':\n                case 'DDD':\n                    return number + '-й';\n                case 'D':\n                    return number + '-го';\n                case 'w':\n                case 'W':\n                    return number + '-я';\n                default:\n                    return number;\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ru;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ru.js?");

/***/ }),

/***/ "./node_modules/moment/locale/sd.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/sd.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Sindhi [sd]\n//! author : Narain Sagar : https://github.com/narainsagar\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'جنوري',\n            'فيبروري',\n            'مارچ',\n            'اپريل',\n            'مئي',\n            'جون',\n            'جولاءِ',\n            'آگسٽ',\n            'سيپٽمبر',\n            'آڪٽوبر',\n            'نومبر',\n            'ڊسمبر',\n        ],\n        days = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر'];\n\n    var sd = moment.defineLocale('sd', {\n        months: months,\n        monthsShort: months,\n        weekdays: days,\n        weekdaysShort: days,\n        weekdaysMin: days,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd، D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /صبح|شام/,\n        isPM: function (input) {\n            return 'شام' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'صبح';\n            }\n            return 'شام';\n        },\n        calendar: {\n            sameDay: '[اڄ] LT',\n            nextDay: '[سڀاڻي] LT',\n            nextWeek: 'dddd [اڳين هفتي تي] LT',\n            lastDay: '[ڪالهه] LT',\n            lastWeek: '[گزريل هفتي] dddd [تي] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s پوء',\n            past: '%s اڳ',\n            s: 'چند سيڪنڊ',\n            ss: '%d سيڪنڊ',\n            m: 'هڪ منٽ',\n            mm: '%d منٽ',\n            h: 'هڪ ڪلاڪ',\n            hh: '%d ڪلاڪ',\n            d: 'هڪ ڏينهن',\n            dd: '%d ڏينهن',\n            M: 'هڪ مهينو',\n            MM: '%d مهينا',\n            y: 'هڪ سال',\n            yy: '%d سال',\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return sd;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/sd.js?");

/***/ }),

/***/ "./node_modules/moment/locale/se.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/se.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Northern Sami [se]\n//! authors : Bård Rolstad Henriksen : https://github.com/karamell\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var se = moment.defineLocale('se', {\n        months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split(\n            '_'\n        ),\n        monthsShort:\n            'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),\n        weekdays:\n            'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split(\n                '_'\n            ),\n        weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),\n        weekdaysMin: 's_v_m_g_d_b_L'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'MMMM D. [b.] YYYY',\n            LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',\n            LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm',\n        },\n        calendar: {\n            sameDay: '[otne ti] LT',\n            nextDay: '[ihttin ti] LT',\n            nextWeek: 'dddd [ti] LT',\n            lastDay: '[ikte ti] LT',\n            lastWeek: '[ovddit] dddd [ti] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s geažes',\n            past: 'maŋit %s',\n            s: 'moadde sekunddat',\n            ss: '%d sekunddat',\n            m: 'okta minuhta',\n            mm: '%d minuhtat',\n            h: 'okta diimmu',\n            hh: '%d diimmut',\n            d: 'okta beaivi',\n            dd: '%d beaivvit',\n            M: 'okta mánnu',\n            MM: '%d mánut',\n            y: 'okta jahki',\n            yy: '%d jagit',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return se;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/se.js?");

/***/ }),

/***/ "./node_modules/moment/locale/si.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/si.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Sinhalese [si]\n//! author : Sampath Sitinamaluwa : https://github.com/sampathsris\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    /*jshint -W100*/\n    var si = moment.defineLocale('si', {\n        months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split(\n            '_'\n        ),\n        monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split(\n            '_'\n        ),\n        weekdays:\n            'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split(\n                '_'\n            ),\n        weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),\n        weekdaysMin: 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'a h:mm',\n            LTS: 'a h:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY MMMM D',\n            LLL: 'YYYY MMMM D, a h:mm',\n            LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss',\n        },\n        calendar: {\n            sameDay: '[අද] LT[ට]',\n            nextDay: '[හෙට] LT[ට]',\n            nextWeek: 'dddd LT[ට]',\n            lastDay: '[ඊයේ] LT[ට]',\n            lastWeek: '[පසුගිය] dddd LT[ට]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%sකින්',\n            past: '%sකට පෙර',\n            s: 'තත්පර කිහිපය',\n            ss: 'තත්පර %d',\n            m: 'මිනිත්තුව',\n            mm: 'මිනිත්තු %d',\n            h: 'පැය',\n            hh: 'පැය %d',\n            d: 'දිනය',\n            dd: 'දින %d',\n            M: 'මාසය',\n            MM: 'මාස %d',\n            y: 'වසර',\n            yy: 'වසර %d',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2} වැනි/,\n        ordinal: function (number) {\n            return number + ' වැනි';\n        },\n        meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,\n        isPM: function (input) {\n            return input === 'ප.ව.' || input === 'පස් වරු';\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'ප.ව.' : 'පස් වරු';\n            } else {\n                return isLower ? 'පෙ.ව.' : 'පෙර වරු';\n            }\n        },\n    });\n\n    return si;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/si.js?");

/***/ }),

/***/ "./node_modules/moment/locale/sk.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/sk.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Slovak [sk]\n//! author : Martin Minka : https://github.com/k2s\n//! based on work of petrbela : https://github.com/petrbela\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months =\n            'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(\n                '_'\n            ),\n        monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\n    function plural(n) {\n        return n > 1 && n < 5;\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n            case 's': // a few seconds / in a few seconds / a few seconds ago\n                return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';\n            case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'sekundy' : 'sekúnd');\n                } else {\n                    return result + 'sekundami';\n                }\n            case 'm': // a minute / in a minute / a minute ago\n                return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';\n            case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'minúty' : 'minút');\n                } else {\n                    return result + 'minútami';\n                }\n            case 'h': // an hour / in an hour / an hour ago\n                return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';\n            case 'hh': // 9 hours / in 9 hours / 9 hours ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'hodiny' : 'hodín');\n                } else {\n                    return result + 'hodinami';\n                }\n            case 'd': // a day / in a day / a day ago\n                return withoutSuffix || isFuture ? 'deň' : 'dňom';\n            case 'dd': // 9 days / in 9 days / 9 days ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'dni' : 'dní');\n                } else {\n                    return result + 'dňami';\n                }\n            case 'M': // a month / in a month / a month ago\n                return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';\n            case 'MM': // 9 months / in 9 months / 9 months ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'mesiace' : 'mesiacov');\n                } else {\n                    return result + 'mesiacmi';\n                }\n            case 'y': // a year / in a year / a year ago\n                return withoutSuffix || isFuture ? 'rok' : 'rokom';\n            case 'yy': // 9 years / in 9 years / 9 years ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'roky' : 'rokov');\n                } else {\n                    return result + 'rokmi';\n                }\n        }\n    }\n\n    var sk = moment.defineLocale('sk', {\n        months: months,\n        monthsShort: monthsShort,\n        weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),\n        weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),\n        weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[dnes o] LT',\n            nextDay: '[zajtra o] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[v nedeľu o] LT';\n                    case 1:\n                    case 2:\n                        return '[v] dddd [o] LT';\n                    case 3:\n                        return '[v stredu o] LT';\n                    case 4:\n                        return '[vo štvrtok o] LT';\n                    case 5:\n                        return '[v piatok o] LT';\n                    case 6:\n                        return '[v sobotu o] LT';\n                }\n            },\n            lastDay: '[včera o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[minulú nedeľu o] LT';\n                    case 1:\n                    case 2:\n                        return '[minulý] dddd [o] LT';\n                    case 3:\n                        return '[minulú stredu o] LT';\n                    case 4:\n                    case 5:\n                        return '[minulý] dddd [o] LT';\n                    case 6:\n                        return '[minulú sobotu o] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'pred %s',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return sk;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/sk.js?");

/***/ }),

/***/ "./node_modules/moment/locale/sl.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/sl.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Slovenian [sl]\n//! author : Robert Sedovšek : https://github.com/sedovsek\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n            case 's':\n                return withoutSuffix || isFuture\n                    ? 'nekaj sekund'\n                    : 'nekaj sekundami';\n            case 'ss':\n                if (number === 1) {\n                    result += withoutSuffix ? 'sekundo' : 'sekundi';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n                } else {\n                    result += 'sekund';\n                }\n                return result;\n            case 'm':\n                return withoutSuffix ? 'ena minuta' : 'eno minuto';\n            case 'mm':\n                if (number === 1) {\n                    result += withoutSuffix ? 'minuta' : 'minuto';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n                } else {\n                    result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n                }\n                return result;\n            case 'h':\n                return withoutSuffix ? 'ena ura' : 'eno uro';\n            case 'hh':\n                if (number === 1) {\n                    result += withoutSuffix ? 'ura' : 'uro';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'uri' : 'urama';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'ure' : 'urami';\n                } else {\n                    result += withoutSuffix || isFuture ? 'ur' : 'urami';\n                }\n                return result;\n            case 'd':\n                return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n            case 'dd':\n                if (number === 1) {\n                    result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n                } else {\n                    result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n                }\n                return result;\n            case 'M':\n                return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n            case 'MM':\n                if (number === 1) {\n                    result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n                } else {\n                    result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n                }\n                return result;\n            case 'y':\n                return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n            case 'yy':\n                if (number === 1) {\n                    result += withoutSuffix || isFuture ? 'leto' : 'letom';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'leta' : 'leti';\n                } else {\n                    result += withoutSuffix || isFuture ? 'let' : 'leti';\n                }\n                return result;\n        }\n    }\n\n    var sl = moment.defineLocale('sl', {\n        months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),\n        weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),\n        weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD. MM. YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd, D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[danes ob] LT',\n            nextDay: '[jutri ob] LT',\n\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[v] [nedeljo] [ob] LT';\n                    case 3:\n                        return '[v] [sredo] [ob] LT';\n                    case 6:\n                        return '[v] [soboto] [ob] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[v] dddd [ob] LT';\n                }\n            },\n            lastDay: '[včeraj ob] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[prejšnjo] [nedeljo] [ob] LT';\n                    case 3:\n                        return '[prejšnjo] [sredo] [ob] LT';\n                    case 6:\n                        return '[prejšnjo] [soboto] [ob] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[prejšnji] dddd [ob] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'čez %s',\n            past: 'pred %s',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return sl;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/sl.js?");

/***/ }),

/***/ "./node_modules/moment/locale/sq.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/sq.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Albanian [sq]\n//! author : Flakërim Ismani : https://github.com/flakerimi\n//! author : Menelion Elensúle : https://github.com/Oire\n//! author : Oerd Cukalla : https://github.com/oerd\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var sq = moment.defineLocale('sq', {\n        months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),\n        weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split(\n            '_'\n        ),\n        weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),\n        weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),\n        weekdaysParseExact: true,\n        meridiemParse: /PD|MD/,\n        isPM: function (input) {\n            return input.charAt(0) === 'M';\n        },\n        meridiem: function (hours, minutes, isLower) {\n            return hours < 12 ? 'PD' : 'MD';\n        },\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Sot në] LT',\n            nextDay: '[Nesër në] LT',\n            nextWeek: 'dddd [në] LT',\n            lastDay: '[Dje në] LT',\n            lastWeek: 'dddd [e kaluar në] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'në %s',\n            past: '%s më parë',\n            s: 'disa sekonda',\n            ss: '%d sekonda',\n            m: 'një minutë',\n            mm: '%d minuta',\n            h: 'një orë',\n            hh: '%d orë',\n            d: 'një ditë',\n            dd: '%d ditë',\n            M: 'një muaj',\n            MM: '%d muaj',\n            y: 'një vit',\n            yy: '%d vite',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return sq;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/sq.js?");

/***/ }),

/***/ "./node_modules/moment/locale/sr-cyrl.js":
/*!***********************************************!*\
  !*** ./node_modules/moment/locale/sr-cyrl.js ***!
  \***********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Serbian Cyrillic [sr-cyrl]\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n//! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var translator = {\n        words: {\n            //Different grammatical cases\n            ss: ['секунда', 'секунде', 'секунди'],\n            m: ['један минут', 'једног минута'],\n            mm: ['минут', 'минута', 'минута'],\n            h: ['један сат', 'једног сата'],\n            hh: ['сат', 'сата', 'сати'],\n            d: ['један дан', 'једног дана'],\n            dd: ['дан', 'дана', 'дана'],\n            M: ['један месец', 'једног месеца'],\n            MM: ['месец', 'месеца', 'месеци'],\n            y: ['једну годину', 'једне године'],\n            yy: ['годину', 'године', 'година'],\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            if (\n                number % 10 >= 1 &&\n                number % 10 <= 4 &&\n                (number % 100 < 10 || number % 100 >= 20)\n            ) {\n                return number % 10 === 1 ? wordKey[0] : wordKey[1];\n            }\n            return wordKey[2];\n        },\n        translate: function (number, withoutSuffix, key, isFuture) {\n            var wordKey = translator.words[key],\n                word;\n\n            if (key.length === 1) {\n                // Nominativ\n                if (key === 'y' && withoutSuffix) return 'једна година';\n                return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];\n            }\n\n            word = translator.correctGrammaticalCase(number, wordKey);\n            // Nominativ\n            if (key === 'yy' && withoutSuffix && word === 'годину') {\n                return number + ' година';\n            }\n\n            return number + ' ' + word;\n        },\n    };\n\n    var srCyrl = moment.defineLocale('sr-cyrl', {\n        months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(\n            '_'\n        ),\n        monthsShort:\n            'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),\n        weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),\n        weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'D. M. YYYY.',\n            LL: 'D. MMMM YYYY.',\n            LLL: 'D. MMMM YYYY. H:mm',\n            LLLL: 'dddd, D. MMMM YYYY. H:mm',\n        },\n        calendar: {\n            sameDay: '[данас у] LT',\n            nextDay: '[сутра у] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[у] [недељу] [у] LT';\n                    case 3:\n                        return '[у] [среду] [у] LT';\n                    case 6:\n                        return '[у] [суботу] [у] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[у] dddd [у] LT';\n                }\n            },\n            lastDay: '[јуче у] LT',\n            lastWeek: function () {\n                var lastWeekDays = [\n                    '[прошле] [недеље] [у] LT',\n                    '[прошлог] [понедељка] [у] LT',\n                    '[прошлог] [уторка] [у] LT',\n                    '[прошле] [среде] [у] LT',\n                    '[прошлог] [четвртка] [у] LT',\n                    '[прошлог] [петка] [у] LT',\n                    '[прошле] [суботе] [у] LT',\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'за %s',\n            past: 'пре %s',\n            s: 'неколико секунди',\n            ss: translator.translate,\n            m: translator.translate,\n            mm: translator.translate,\n            h: translator.translate,\n            hh: translator.translate,\n            d: translator.translate,\n            dd: translator.translate,\n            M: translator.translate,\n            MM: translator.translate,\n            y: translator.translate,\n            yy: translator.translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 1st is the first week of the year.\n        },\n    });\n\n    return srCyrl;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/sr-cyrl.js?");

/***/ }),

/***/ "./node_modules/moment/locale/sr.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/sr.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Serbian [sr]\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n//! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var translator = {\n        words: {\n            //Different grammatical cases\n            ss: ['sekunda', 'sekunde', 'sekundi'],\n            m: ['jedan minut', 'jednog minuta'],\n            mm: ['minut', 'minuta', 'minuta'],\n            h: ['jedan sat', 'jednog sata'],\n            hh: ['sat', 'sata', 'sati'],\n            d: ['jedan dan', 'jednog dana'],\n            dd: ['dan', 'dana', 'dana'],\n            M: ['jedan mesec', 'jednog meseca'],\n            MM: ['mesec', 'meseca', 'meseci'],\n            y: ['jednu godinu', 'jedne godine'],\n            yy: ['godinu', 'godine', 'godina'],\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            if (\n                number % 10 >= 1 &&\n                number % 10 <= 4 &&\n                (number % 100 < 10 || number % 100 >= 20)\n            ) {\n                return number % 10 === 1 ? wordKey[0] : wordKey[1];\n            }\n            return wordKey[2];\n        },\n        translate: function (number, withoutSuffix, key, isFuture) {\n            var wordKey = translator.words[key],\n                word;\n\n            if (key.length === 1) {\n                // Nominativ\n                if (key === 'y' && withoutSuffix) return 'jedna godina';\n                return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];\n            }\n\n            word = translator.correctGrammaticalCase(number, wordKey);\n            // Nominativ\n            if (key === 'yy' && withoutSuffix && word === 'godinu') {\n                return number + ' godina';\n            }\n\n            return number + ' ' + word;\n        },\n    };\n\n    var sr = moment.defineLocale('sr', {\n        months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(\n            '_'\n        ),\n        weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),\n        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'D. M. YYYY.',\n            LL: 'D. MMMM YYYY.',\n            LLL: 'D. MMMM YYYY. H:mm',\n            LLLL: 'dddd, D. MMMM YYYY. H:mm',\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[u] [nedelju] [u] LT';\n                    case 3:\n                        return '[u] [sredu] [u] LT';\n                    case 6:\n                        return '[u] [subotu] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[u] dddd [u] LT';\n                }\n            },\n            lastDay: '[juče u] LT',\n            lastWeek: function () {\n                var lastWeekDays = [\n                    '[prošle] [nedelje] [u] LT',\n                    '[prošlog] [ponedeljka] [u] LT',\n                    '[prošlog] [utorka] [u] LT',\n                    '[prošle] [srede] [u] LT',\n                    '[prošlog] [četvrtka] [u] LT',\n                    '[prošlog] [petka] [u] LT',\n                    '[prošle] [subote] [u] LT',\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'pre %s',\n            s: 'nekoliko sekundi',\n            ss: translator.translate,\n            m: translator.translate,\n            mm: translator.translate,\n            h: translator.translate,\n            hh: translator.translate,\n            d: translator.translate,\n            dd: translator.translate,\n            M: translator.translate,\n            MM: translator.translate,\n            y: translator.translate,\n            yy: translator.translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return sr;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/sr.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ss.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ss.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : siSwati [ss]\n//! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ss = moment.defineLocale('ss', {\n        months: \"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni\".split(\n            '_'\n        ),\n        monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),\n        weekdays:\n            'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split(\n                '_'\n            ),\n        weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),\n        weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Namuhla nga] LT',\n            nextDay: '[Kusasa nga] LT',\n            nextWeek: 'dddd [nga] LT',\n            lastDay: '[Itolo nga] LT',\n            lastWeek: 'dddd [leliphelile] [nga] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'nga %s',\n            past: 'wenteka nga %s',\n            s: 'emizuzwana lomcane',\n            ss: '%d mzuzwana',\n            m: 'umzuzu',\n            mm: '%d emizuzu',\n            h: 'lihora',\n            hh: '%d emahora',\n            d: 'lilanga',\n            dd: '%d emalanga',\n            M: 'inyanga',\n            MM: '%d tinyanga',\n            y: 'umnyaka',\n            yy: '%d iminyaka',\n        },\n        meridiemParse: /ekuseni|emini|entsambama|ebusuku/,\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'ekuseni';\n            } else if (hours < 15) {\n                return 'emini';\n            } else if (hours < 19) {\n                return 'entsambama';\n            } else {\n                return 'ebusuku';\n            }\n        },\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'ekuseni') {\n                return hour;\n            } else if (meridiem === 'emini') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {\n                if (hour === 0) {\n                    return 0;\n                }\n                return hour + 12;\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}/,\n        ordinal: '%d',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ss;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ss.js?");

/***/ }),

/***/ "./node_modules/moment/locale/sv.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/sv.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Swedish [sv]\n//! author : Jens Alm : https://github.com/ulmus\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var sv = moment.defineLocale('sv', {\n        months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),\n        weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),\n        weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [kl.] HH:mm',\n            LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',\n            lll: 'D MMM YYYY HH:mm',\n            llll: 'ddd D MMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Idag] LT',\n            nextDay: '[Imorgon] LT',\n            lastDay: '[Igår] LT',\n            nextWeek: '[På] dddd LT',\n            lastWeek: '[I] dddd[s] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'om %s',\n            past: 'för %s sedan',\n            s: 'några sekunder',\n            ss: '%d sekunder',\n            m: 'en minut',\n            mm: '%d minuter',\n            h: 'en timme',\n            hh: '%d timmar',\n            d: 'en dag',\n            dd: '%d dagar',\n            M: 'en månad',\n            MM: '%d månader',\n            y: 'ett år',\n            yy: '%d år',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(\\:e|\\:a)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? ':e'\n                        : b === 1\n                        ? ':a'\n                        : b === 2\n                        ? ':a'\n                        : b === 3\n                        ? ':e'\n                        : ':e';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return sv;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/sv.js?");

/***/ }),

/***/ "./node_modules/moment/locale/sw.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/sw.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Swahili [sw]\n//! author : Fahad Kassim : https://github.com/fadsel\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var sw = moment.defineLocale('sw', {\n        months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),\n        weekdays:\n            'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split(\n                '_'\n            ),\n        weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),\n        weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'hh:mm A',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[leo saa] LT',\n            nextDay: '[kesho saa] LT',\n            nextWeek: '[wiki ijayo] dddd [saat] LT',\n            lastDay: '[jana] LT',\n            lastWeek: '[wiki iliyopita] dddd [saat] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s baadaye',\n            past: 'tokea %s',\n            s: 'hivi punde',\n            ss: 'sekunde %d',\n            m: 'dakika moja',\n            mm: 'dakika %d',\n            h: 'saa limoja',\n            hh: 'masaa %d',\n            d: 'siku moja',\n            dd: 'siku %d',\n            M: 'mwezi mmoja',\n            MM: 'miezi %d',\n            y: 'mwaka mmoja',\n            yy: 'miaka %d',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return sw;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/sw.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ta.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ta.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Tamil [ta]\n//! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '௧',\n            2: '௨',\n            3: '௩',\n            4: '௪',\n            5: '௫',\n            6: '௬',\n            7: '௭',\n            8: '௮',\n            9: '௯',\n            0: '௦',\n        },\n        numberMap = {\n            '௧': '1',\n            '௨': '2',\n            '௩': '3',\n            '௪': '4',\n            '௫': '5',\n            '௬': '6',\n            '௭': '7',\n            '௮': '8',\n            '௯': '9',\n            '௦': '0',\n        };\n\n    var ta = moment.defineLocale('ta', {\n        months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(\n            '_'\n        ),\n        monthsShort:\n            'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(\n                '_'\n            ),\n        weekdays:\n            'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split(\n                '_'\n            ),\n        weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split(\n            '_'\n        ),\n        weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, HH:mm',\n            LLLL: 'dddd, D MMMM YYYY, HH:mm',\n        },\n        calendar: {\n            sameDay: '[இன்று] LT',\n            nextDay: '[நாளை] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[நேற்று] LT',\n            lastWeek: '[கடந்த வாரம்] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s இல்',\n            past: '%s முன்',\n            s: 'ஒரு சில விநாடிகள்',\n            ss: '%d விநாடிகள்',\n            m: 'ஒரு நிமிடம்',\n            mm: '%d நிமிடங்கள்',\n            h: 'ஒரு மணி நேரம்',\n            hh: '%d மணி நேரம்',\n            d: 'ஒரு நாள்',\n            dd: '%d நாட்கள்',\n            M: 'ஒரு மாதம்',\n            MM: '%d மாதங்கள்',\n            y: 'ஒரு வருடம்',\n            yy: '%d ஆண்டுகள்',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}வது/,\n        ordinal: function (number) {\n            return number + 'வது';\n        },\n        preparse: function (string) {\n            return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // refer http://ta.wikipedia.org/s/1er1\n        meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 2) {\n                return ' யாமம்';\n            } else if (hour < 6) {\n                return ' வைகறை'; // வைகறை\n            } else if (hour < 10) {\n                return ' காலை'; // காலை\n            } else if (hour < 14) {\n                return ' நண்பகல்'; // நண்பகல்\n            } else if (hour < 18) {\n                return ' எற்பாடு'; // எற்பாடு\n            } else if (hour < 22) {\n                return ' மாலை'; // மாலை\n            } else {\n                return ' யாமம்';\n            }\n        },\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'யாமம்') {\n                return hour < 2 ? hour : hour + 12;\n            } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {\n                return hour;\n            } else if (meridiem === 'நண்பகல்') {\n                return hour >= 10 ? hour : hour + 12;\n            } else {\n                return hour + 12;\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return ta;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ta.js?");

/***/ }),

/***/ "./node_modules/moment/locale/te.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/te.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Telugu [te]\n//! author : Krishna Chaitanya Thota : https://github.com/kcthota\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var te = moment.defineLocale('te', {\n        months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split(\n            '_'\n        ),\n        monthsShort:\n            'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split(\n                '_'\n            ),\n        weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),\n        weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm',\n            LTS: 'A h:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm',\n        },\n        calendar: {\n            sameDay: '[నేడు] LT',\n            nextDay: '[రేపు] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[నిన్న] LT',\n            lastWeek: '[గత] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s లో',\n            past: '%s క్రితం',\n            s: 'కొన్ని క్షణాలు',\n            ss: '%d సెకన్లు',\n            m: 'ఒక నిమిషం',\n            mm: '%d నిమిషాలు',\n            h: 'ఒక గంట',\n            hh: '%d గంటలు',\n            d: 'ఒక రోజు',\n            dd: '%d రోజులు',\n            M: 'ఒక నెల',\n            MM: '%d నెలలు',\n            y: 'ఒక సంవత్సరం',\n            yy: '%d సంవత్సరాలు',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}వ/,\n        ordinal: '%dవ',\n        meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'రాత్రి') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'ఉదయం') {\n                return hour;\n            } else if (meridiem === 'మధ్యాహ్నం') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'సాయంత్రం') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'రాత్రి';\n            } else if (hour < 10) {\n                return 'ఉదయం';\n            } else if (hour < 17) {\n                return 'మధ్యాహ్నం';\n            } else if (hour < 20) {\n                return 'సాయంత్రం';\n            } else {\n                return 'రాత్రి';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return te;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/te.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tet.js":
/*!*******************************************!*\
  !*** ./node_modules/moment/locale/tet.js ***!
  \*******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Tetun Dili (East Timor) [tet]\n//! author : Joshua Brooks : https://github.com/joshbrooks\n//! author : Onorio De J. Afonso : https://github.com/marobo\n//! author : Sonia Simoes : https://github.com/soniasimoes\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var tet = moment.defineLocale('tet', {\n        months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),\n        weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),\n        weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),\n        weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Ohin iha] LT',\n            nextDay: '[Aban iha] LT',\n            nextWeek: 'dddd [iha] LT',\n            lastDay: '[Horiseik iha] LT',\n            lastWeek: 'dddd [semana kotuk] [iha] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'iha %s',\n            past: '%s liuba',\n            s: 'segundu balun',\n            ss: 'segundu %d',\n            m: 'minutu ida',\n            mm: 'minutu %d',\n            h: 'oras ida',\n            hh: 'oras %d',\n            d: 'loron ida',\n            dd: 'loron %d',\n            M: 'fulan ida',\n            MM: 'fulan %d',\n            y: 'tinan ida',\n            yy: 'tinan %d',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return tet;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tet.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tg.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/tg.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Tajik [tg]\n//! author : Orif N. Jr. : https://github.com/orif-jr\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        0: '-ум',\n        1: '-ум',\n        2: '-юм',\n        3: '-юм',\n        4: '-ум',\n        5: '-ум',\n        6: '-ум',\n        7: '-ум',\n        8: '-ум',\n        9: '-ум',\n        10: '-ум',\n        12: '-ум',\n        13: '-ум',\n        20: '-ум',\n        30: '-юм',\n        40: '-ум',\n        50: '-ум',\n        60: '-ум',\n        70: '-ум',\n        80: '-ум',\n        90: '-ум',\n        100: '-ум',\n    };\n\n    var tg = moment.defineLocale('tg', {\n        months: {\n            format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split(\n                '_'\n            ),\n            standalone:\n                'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(\n                    '_'\n                ),\n        },\n        monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n        weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split(\n            '_'\n        ),\n        weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),\n        weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Имрӯз соати] LT',\n            nextDay: '[Фардо соати] LT',\n            lastDay: '[Дирӯз соати] LT',\n            nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT',\n            lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'баъди %s',\n            past: '%s пеш',\n            s: 'якчанд сония',\n            m: 'як дақиқа',\n            mm: '%d дақиқа',\n            h: 'як соат',\n            hh: '%d соат',\n            d: 'як рӯз',\n            dd: '%d рӯз',\n            M: 'як моҳ',\n            MM: '%d моҳ',\n            y: 'як сол',\n            yy: '%d сол',\n        },\n        meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'шаб') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'субҳ') {\n                return hour;\n            } else if (meridiem === 'рӯз') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'бегоҳ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'шаб';\n            } else if (hour < 11) {\n                return 'субҳ';\n            } else if (hour < 16) {\n                return 'рӯз';\n            } else if (hour < 19) {\n                return 'бегоҳ';\n            } else {\n                return 'шаб';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ум|юм)/,\n        ordinal: function (number) {\n            var a = number % 10,\n                b = number >= 100 ? 100 : null;\n            return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 1th is the first week of the year.\n        },\n    });\n\n    return tg;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tg.js?");

/***/ }),

/***/ "./node_modules/moment/locale/th.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/th.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Thai [th]\n//! author : Kridsada Thanabulpong : https://github.com/sirn\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var th = moment.defineLocale('th', {\n        months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split(\n            '_'\n        ),\n        monthsShort:\n            'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),\n        weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference\n        weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY เวลา H:mm',\n            LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm',\n        },\n        meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,\n        isPM: function (input) {\n            return input === 'หลังเที่ยง';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ก่อนเที่ยง';\n            } else {\n                return 'หลังเที่ยง';\n            }\n        },\n        calendar: {\n            sameDay: '[วันนี้ เวลา] LT',\n            nextDay: '[พรุ่งนี้ เวลา] LT',\n            nextWeek: 'dddd[หน้า เวลา] LT',\n            lastDay: '[เมื่อวานนี้ เวลา] LT',\n            lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'อีก %s',\n            past: '%sที่แล้ว',\n            s: 'ไม่กี่วินาที',\n            ss: '%d วินาที',\n            m: '1 นาที',\n            mm: '%d นาที',\n            h: '1 ชั่วโมง',\n            hh: '%d ชั่วโมง',\n            d: '1 วัน',\n            dd: '%d วัน',\n            w: '1 สัปดาห์',\n            ww: '%d สัปดาห์',\n            M: '1 เดือน',\n            MM: '%d เดือน',\n            y: '1 ปี',\n            yy: '%d ปี',\n        },\n    });\n\n    return th;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/th.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tk.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/tk.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Turkmen [tk]\n//! author : Atamyrat Abdyrahmanov : https://github.com/atamyratabdy\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        1: \"'inji\",\n        5: \"'inji\",\n        8: \"'inji\",\n        70: \"'inji\",\n        80: \"'inji\",\n        2: \"'nji\",\n        7: \"'nji\",\n        20: \"'nji\",\n        50: \"'nji\",\n        3: \"'ünji\",\n        4: \"'ünji\",\n        100: \"'ünji\",\n        6: \"'njy\",\n        9: \"'unjy\",\n        10: \"'unjy\",\n        30: \"'unjy\",\n        60: \"'ynjy\",\n        90: \"'ynjy\",\n    };\n\n    var tk = moment.defineLocale('tk', {\n        months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(\n            '_'\n        ),\n        monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'),\n        weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split(\n            '_'\n        ),\n        weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'),\n        weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[bugün sagat] LT',\n            nextDay: '[ertir sagat] LT',\n            nextWeek: '[indiki] dddd [sagat] LT',\n            lastDay: '[düýn] LT',\n            lastWeek: '[geçen] dddd [sagat] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s soň',\n            past: '%s öň',\n            s: 'birnäçe sekunt',\n            m: 'bir minut',\n            mm: '%d minut',\n            h: 'bir sagat',\n            hh: '%d sagat',\n            d: 'bir gün',\n            dd: '%d gün',\n            M: 'bir aý',\n            MM: '%d aý',\n            y: 'bir ýyl',\n            yy: '%d ýyl',\n        },\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'Do':\n                case 'DD':\n                    return number;\n                default:\n                    if (number === 0) {\n                        // special case for zero\n                        return number + \"'unjy\";\n                    }\n                    var a = number % 10,\n                        b = (number % 100) - a,\n                        c = number >= 100 ? 100 : null;\n                    return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return tk;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tk.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tl-ph.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/tl-ph.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Tagalog (Philippines) [tl-ph]\n//! author : Dan Hagman : https://github.com/hagmandan\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var tlPh = moment.defineLocale('tl-ph', {\n        months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(\n            '_'\n        ),\n        monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n        weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(\n            '_'\n        ),\n        weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n        weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'MM/D/YYYY',\n            LL: 'MMMM D, YYYY',\n            LLL: 'MMMM D, YYYY HH:mm',\n            LLLL: 'dddd, MMMM DD, YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: 'LT [ngayong araw]',\n            nextDay: '[Bukas ng] LT',\n            nextWeek: 'LT [sa susunod na] dddd',\n            lastDay: 'LT [kahapon]',\n            lastWeek: 'LT [noong nakaraang] dddd',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'sa loob ng %s',\n            past: '%s ang nakalipas',\n            s: 'ilang segundo',\n            ss: '%d segundo',\n            m: 'isang minuto',\n            mm: '%d minuto',\n            h: 'isang oras',\n            hh: '%d oras',\n            d: 'isang araw',\n            dd: '%d araw',\n            M: 'isang buwan',\n            MM: '%d buwan',\n            y: 'isang taon',\n            yy: '%d taon',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}/,\n        ordinal: function (number) {\n            return number;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return tlPh;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tl-ph.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tlh.js":
/*!*******************************************!*\
  !*** ./node_modules/moment/locale/tlh.js ***!
  \*******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Klingon [tlh]\n//! author : Dominika Kruk : https://github.com/amaranthrose\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');\n\n    function translateFuture(output) {\n        var time = output;\n        time =\n            output.indexOf('jaj') !== -1\n                ? time.slice(0, -3) + 'leS'\n                : output.indexOf('jar') !== -1\n                ? time.slice(0, -3) + 'waQ'\n                : output.indexOf('DIS') !== -1\n                ? time.slice(0, -3) + 'nem'\n                : time + ' pIq';\n        return time;\n    }\n\n    function translatePast(output) {\n        var time = output;\n        time =\n            output.indexOf('jaj') !== -1\n                ? time.slice(0, -3) + 'Hu’'\n                : output.indexOf('jar') !== -1\n                ? time.slice(0, -3) + 'wen'\n                : output.indexOf('DIS') !== -1\n                ? time.slice(0, -3) + 'ben'\n                : time + ' ret';\n        return time;\n    }\n\n    function translate(number, withoutSuffix, string, isFuture) {\n        var numberNoun = numberAsNoun(number);\n        switch (string) {\n            case 'ss':\n                return numberNoun + ' lup';\n            case 'mm':\n                return numberNoun + ' tup';\n            case 'hh':\n                return numberNoun + ' rep';\n            case 'dd':\n                return numberNoun + ' jaj';\n            case 'MM':\n                return numberNoun + ' jar';\n            case 'yy':\n                return numberNoun + ' DIS';\n        }\n    }\n\n    function numberAsNoun(number) {\n        var hundred = Math.floor((number % 1000) / 100),\n            ten = Math.floor((number % 100) / 10),\n            one = number % 10,\n            word = '';\n        if (hundred > 0) {\n            word += numbersNouns[hundred] + 'vatlh';\n        }\n        if (ten > 0) {\n            word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';\n        }\n        if (one > 0) {\n            word += (word !== '' ? ' ' : '') + numbersNouns[one];\n        }\n        return word === '' ? 'pagh' : word;\n    }\n\n    var tlh = moment.defineLocale('tlh', {\n        months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split(\n            '_'\n        ),\n        monthsShort:\n            'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(\n            '_'\n        ),\n        weekdaysShort:\n            'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),\n        weekdaysMin:\n            'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[DaHjaj] LT',\n            nextDay: '[wa’leS] LT',\n            nextWeek: 'LLL',\n            lastDay: '[wa’Hu’] LT',\n            lastWeek: 'LLL',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: translateFuture,\n            past: translatePast,\n            s: 'puS lup',\n            ss: translate,\n            m: 'wa’ tup',\n            mm: translate,\n            h: 'wa’ rep',\n            hh: translate,\n            d: 'wa’ jaj',\n            dd: translate,\n            M: 'wa’ jar',\n            MM: translate,\n            y: 'wa’ DIS',\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return tlh;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tlh.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tr.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/tr.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Turkish [tr]\n//! authors : Erhan Gundogan : https://github.com/erhangundogan,\n//!           Burak Yiğit Kaya: https://github.com/BYK\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        1: \"'inci\",\n        5: \"'inci\",\n        8: \"'inci\",\n        70: \"'inci\",\n        80: \"'inci\",\n        2: \"'nci\",\n        7: \"'nci\",\n        20: \"'nci\",\n        50: \"'nci\",\n        3: \"'üncü\",\n        4: \"'üncü\",\n        100: \"'üncü\",\n        6: \"'ncı\",\n        9: \"'uncu\",\n        10: \"'uncu\",\n        30: \"'uncu\",\n        60: \"'ıncı\",\n        90: \"'ıncı\",\n    };\n\n    var tr = moment.defineLocale('tr', {\n        months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split(\n            '_'\n        ),\n        monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),\n        weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split(\n            '_'\n        ),\n        weekdaysShort: 'Paz_Pzt_Sal_Çar_Per_Cum_Cmt'.split('_'),\n        weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'öö' : 'ÖÖ';\n            } else {\n                return isLower ? 'ös' : 'ÖS';\n            }\n        },\n        meridiemParse: /öö|ÖÖ|ös|ÖS/,\n        isPM: function (input) {\n            return input === 'ös' || input === 'ÖS';\n        },\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[bugün saat] LT',\n            nextDay: '[yarın saat] LT',\n            nextWeek: '[gelecek] dddd [saat] LT',\n            lastDay: '[dün] LT',\n            lastWeek: '[geçen] dddd [saat] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s sonra',\n            past: '%s önce',\n            s: 'birkaç saniye',\n            ss: '%d saniye',\n            m: 'bir dakika',\n            mm: '%d dakika',\n            h: 'bir saat',\n            hh: '%d saat',\n            d: 'bir gün',\n            dd: '%d gün',\n            w: 'bir hafta',\n            ww: '%d hafta',\n            M: 'bir ay',\n            MM: '%d ay',\n            y: 'bir yıl',\n            yy: '%d yıl',\n        },\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'Do':\n                case 'DD':\n                    return number;\n                default:\n                    if (number === 0) {\n                        // special case for zero\n                        return number + \"'ıncı\";\n                    }\n                    var a = number % 10,\n                        b = (number % 100) - a,\n                        c = number >= 100 ? 100 : null;\n                    return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return tr;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tr.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tzl.js":
/*!*******************************************!*\
  !*** ./node_modules/moment/locale/tzl.js ***!
  \*******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Talossan [tzl]\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v\n//! author : Iustì Canun\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.\n    // This is currently too difficult (maybe even impossible) to add.\n    var tzl = moment.defineLocale('tzl', {\n        months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),\n        weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),\n        weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),\n        weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM [dallas] YYYY',\n            LLL: 'D. MMMM [dallas] YYYY HH.mm',\n            LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm',\n        },\n        meridiemParse: /d\\'o|d\\'a/i,\n        isPM: function (input) {\n            return \"d'o\" === input.toLowerCase();\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? \"d'o\" : \"D'O\";\n            } else {\n                return isLower ? \"d'a\" : \"D'A\";\n            }\n        },\n        calendar: {\n            sameDay: '[oxhi à] LT',\n            nextDay: '[demà à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[ieiri à] LT',\n            lastWeek: '[sür el] dddd [lasteu à] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'osprei %s',\n            past: 'ja%s',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            s: ['viensas secunds', \"'iensas secunds\"],\n            ss: [number + ' secunds', '' + number + ' secunds'],\n            m: [\"'n míut\", \"'iens míut\"],\n            mm: [number + ' míuts', '' + number + ' míuts'],\n            h: [\"'n þora\", \"'iensa þora\"],\n            hh: [number + ' þoras', '' + number + ' þoras'],\n            d: [\"'n ziua\", \"'iensa ziua\"],\n            dd: [number + ' ziuas', '' + number + ' ziuas'],\n            M: [\"'n mes\", \"'iens mes\"],\n            MM: [number + ' mesen', '' + number + ' mesen'],\n            y: [\"'n ar\", \"'iens ar\"],\n            yy: [number + ' ars', '' + number + ' ars'],\n        };\n        return isFuture\n            ? format[key][0]\n            : withoutSuffix\n            ? format[key][0]\n            : format[key][1];\n    }\n\n    return tzl;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tzl.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tzm-latn.js":
/*!************************************************!*\
  !*** ./node_modules/moment/locale/tzm-latn.js ***!
  \************************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Central Atlas Tamazight Latin [tzm-latn]\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var tzmLatn = moment.defineLocale('tzm-latn', {\n        months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(\n            '_'\n        ),\n        monthsShort:\n            'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(\n                '_'\n            ),\n        weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[asdkh g] LT',\n            nextDay: '[aska g] LT',\n            nextWeek: 'dddd [g] LT',\n            lastDay: '[assant g] LT',\n            lastWeek: 'dddd [g] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dadkh s yan %s',\n            past: 'yan %s',\n            s: 'imik',\n            ss: '%d imik',\n            m: 'minuḍ',\n            mm: '%d minuḍ',\n            h: 'saɛa',\n            hh: '%d tassaɛin',\n            d: 'ass',\n            dd: '%d ossan',\n            M: 'ayowr',\n            MM: '%d iyyirn',\n            y: 'asgas',\n            yy: '%d isgasn',\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return tzmLatn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tzm-latn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/tzm.js":
/*!*******************************************!*\
  !*** ./node_modules/moment/locale/tzm.js ***!
  \*******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Central Atlas Tamazight [tzm]\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var tzm = moment.defineLocale('tzm', {\n        months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(\n                '_'\n            ),\n        weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',\n            nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',\n            nextWeek: 'dddd [ⴴ] LT',\n            lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',\n            lastWeek: 'dddd [ⴴ] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',\n            past: 'ⵢⴰⵏ %s',\n            s: 'ⵉⵎⵉⴽ',\n            ss: '%d ⵉⵎⵉⴽ',\n            m: 'ⵎⵉⵏⵓⴺ',\n            mm: '%d ⵎⵉⵏⵓⴺ',\n            h: 'ⵙⴰⵄⴰ',\n            hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',\n            d: 'ⴰⵙⵙ',\n            dd: '%d oⵙⵙⴰⵏ',\n            M: 'ⴰⵢoⵓⵔ',\n            MM: '%d ⵉⵢⵢⵉⵔⵏ',\n            y: 'ⴰⵙⴳⴰⵙ',\n            yy: '%d ⵉⵙⴳⴰⵙⵏ',\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return tzm;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/tzm.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ug-cn.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/ug-cn.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Uyghur (China) [ug-cn]\n//! author: boyaq : https://github.com/boyaq\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ugCn = moment.defineLocale('ug-cn', {\n        months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(\n            '_'\n        ),\n        monthsShort:\n            'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(\n                '_'\n            ),\n        weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split(\n            '_'\n        ),\n        weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),\n        weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',\n            LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',\n            LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',\n        },\n        meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (\n                meridiem === 'يېرىم كېچە' ||\n                meridiem === 'سەھەر' ||\n                meridiem === 'چۈشتىن بۇرۇن'\n            ) {\n                return hour;\n            } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {\n                return hour + 12;\n            } else {\n                return hour >= 11 ? hour : hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return 'يېرىم كېچە';\n            } else if (hm < 900) {\n                return 'سەھەر';\n            } else if (hm < 1130) {\n                return 'چۈشتىن بۇرۇن';\n            } else if (hm < 1230) {\n                return 'چۈش';\n            } else if (hm < 1800) {\n                return 'چۈشتىن كېيىن';\n            } else {\n                return 'كەچ';\n            }\n        },\n        calendar: {\n            sameDay: '[بۈگۈن سائەت] LT',\n            nextDay: '[ئەتە سائەت] LT',\n            nextWeek: '[كېلەركى] dddd [سائەت] LT',\n            lastDay: '[تۆنۈگۈن] LT',\n            lastWeek: '[ئالدىنقى] dddd [سائەت] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s كېيىن',\n            past: '%s بۇرۇن',\n            s: 'نەچچە سېكونت',\n            ss: '%d سېكونت',\n            m: 'بىر مىنۇت',\n            mm: '%d مىنۇت',\n            h: 'بىر سائەت',\n            hh: '%d سائەت',\n            d: 'بىر كۈن',\n            dd: '%d كۈن',\n            M: 'بىر ئاي',\n            MM: '%d ئاي',\n            y: 'بىر يىل',\n            yy: '%d يىل',\n        },\n\n        dayOfMonthOrdinalParse: /\\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '-كۈنى';\n                case 'w':\n                case 'W':\n                    return number + '-ھەپتە';\n                default:\n                    return number;\n            }\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 1st is the first week of the year.\n        },\n    });\n\n    return ugCn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ug-cn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/uk.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/uk.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Ukrainian [uk]\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11\n            ? forms[0]\n            : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)\n            ? forms[1]\n            : forms[2];\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',\n            mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',\n            hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',\n            dd: 'день_дні_днів',\n            MM: 'місяць_місяці_місяців',\n            yy: 'рік_роки_років',\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвилина' : 'хвилину';\n        } else if (key === 'h') {\n            return withoutSuffix ? 'година' : 'годину';\n        } else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n    function weekdaysCaseReplace(m, format) {\n        var weekdays = {\n                nominative:\n                    'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split(\n                        '_'\n                    ),\n                accusative:\n                    'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split(\n                        '_'\n                    ),\n                genitive:\n                    'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split(\n                        '_'\n                    ),\n            },\n            nounCase;\n\n        if (m === true) {\n            return weekdays['nominative']\n                .slice(1, 7)\n                .concat(weekdays['nominative'].slice(0, 1));\n        }\n        if (!m) {\n            return weekdays['nominative'];\n        }\n\n        nounCase = /(\\[[ВвУу]\\]) ?dddd/.test(format)\n            ? 'accusative'\n            : /\\[?(?:минулої|наступної)? ?\\] ?dddd/.test(format)\n            ? 'genitive'\n            : 'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n    function processHoursFunction(str) {\n        return function () {\n            return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';\n        };\n    }\n\n    var uk = moment.defineLocale('uk', {\n        months: {\n            format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split(\n                '_'\n            ),\n            standalone:\n                'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split(\n                    '_'\n                ),\n        },\n        monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split(\n            '_'\n        ),\n        weekdays: weekdaysCaseReplace,\n        weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY р.',\n            LLL: 'D MMMM YYYY р., HH:mm',\n            LLLL: 'dddd, D MMMM YYYY р., HH:mm',\n        },\n        calendar: {\n            sameDay: processHoursFunction('[Сьогодні '),\n            nextDay: processHoursFunction('[Завтра '),\n            lastDay: processHoursFunction('[Вчора '),\n            nextWeek: processHoursFunction('[У] dddd ['),\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                    case 5:\n                    case 6:\n                        return processHoursFunction('[Минулої] dddd [').call(this);\n                    case 1:\n                    case 2:\n                    case 4:\n                        return processHoursFunction('[Минулого] dddd [').call(this);\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'за %s',\n            past: '%s тому',\n            s: 'декілька секунд',\n            ss: relativeTimeWithPlural,\n            m: relativeTimeWithPlural,\n            mm: relativeTimeWithPlural,\n            h: 'годину',\n            hh: relativeTimeWithPlural,\n            d: 'день',\n            dd: relativeTimeWithPlural,\n            M: 'місяць',\n            MM: relativeTimeWithPlural,\n            y: 'рік',\n            yy: relativeTimeWithPlural,\n        },\n        // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n        meridiemParse: /ночі|ранку|дня|вечора/,\n        isPM: function (input) {\n            return /^(дня|вечора)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночі';\n            } else if (hour < 12) {\n                return 'ранку';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечора';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(й|го)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'M':\n                case 'd':\n                case 'DDD':\n                case 'w':\n                case 'W':\n                    return number + '-й';\n                case 'D':\n                    return number + '-го';\n                default:\n                    return number;\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return uk;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/uk.js?");

/***/ }),

/***/ "./node_modules/moment/locale/ur.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/ur.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Urdu [ur]\n//! author : Sawood Alam : https://github.com/ibnesayeed\n//! author : Zack : https://github.com/ZackVision\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'جنوری',\n            'فروری',\n            'مارچ',\n            'اپریل',\n            'مئی',\n            'جون',\n            'جولائی',\n            'اگست',\n            'ستمبر',\n            'اکتوبر',\n            'نومبر',\n            'دسمبر',\n        ],\n        days = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'];\n\n    var ur = moment.defineLocale('ur', {\n        months: months,\n        monthsShort: months,\n        weekdays: days,\n        weekdaysShort: days,\n        weekdaysMin: days,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd، D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /صبح|شام/,\n        isPM: function (input) {\n            return 'شام' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'صبح';\n            }\n            return 'شام';\n        },\n        calendar: {\n            sameDay: '[آج بوقت] LT',\n            nextDay: '[کل بوقت] LT',\n            nextWeek: 'dddd [بوقت] LT',\n            lastDay: '[گذشتہ روز بوقت] LT',\n            lastWeek: '[گذشتہ] dddd [بوقت] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s بعد',\n            past: '%s قبل',\n            s: 'چند سیکنڈ',\n            ss: '%d سیکنڈ',\n            m: 'ایک منٹ',\n            mm: '%d منٹ',\n            h: 'ایک گھنٹہ',\n            hh: '%d گھنٹے',\n            d: 'ایک دن',\n            dd: '%d دن',\n            M: 'ایک ماہ',\n            MM: '%d ماہ',\n            y: 'ایک سال',\n            yy: '%d سال',\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ur;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/ur.js?");

/***/ }),

/***/ "./node_modules/moment/locale/uz-latn.js":
/*!***********************************************!*\
  !*** ./node_modules/moment/locale/uz-latn.js ***!
  \***********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Uzbek Latin [uz-latn]\n//! author : Rasulbek Mirzayev : github.com/Rasulbeeek\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var uzLatn = moment.defineLocale('uz-latn', {\n        months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split(\n            '_'\n        ),\n        monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),\n        weekdays:\n            'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split(\n                '_'\n            ),\n        weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),\n        weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'D MMMM YYYY, dddd HH:mm',\n        },\n        calendar: {\n            sameDay: '[Bugun soat] LT [da]',\n            nextDay: '[Ertaga] LT [da]',\n            nextWeek: 'dddd [kuni soat] LT [da]',\n            lastDay: '[Kecha soat] LT [da]',\n            lastWeek: \"[O'tgan] dddd [kuni soat] LT [da]\",\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'Yaqin %s ichida',\n            past: 'Bir necha %s oldin',\n            s: 'soniya',\n            ss: '%d soniya',\n            m: 'bir daqiqa',\n            mm: '%d daqiqa',\n            h: 'bir soat',\n            hh: '%d soat',\n            d: 'bir kun',\n            dd: '%d kun',\n            M: 'bir oy',\n            MM: '%d oy',\n            y: 'bir yil',\n            yy: '%d yil',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return uzLatn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/uz-latn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/uz.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/uz.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Uzbek [uz]\n//! author : Sardor Muminov : https://github.com/muminoff\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var uz = moment.defineLocale('uz', {\n        months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(\n            '_'\n        ),\n        monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n        weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),\n        weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),\n        weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'D MMMM YYYY, dddd HH:mm',\n        },\n        calendar: {\n            sameDay: '[Бугун соат] LT [да]',\n            nextDay: '[Эртага] LT [да]',\n            nextWeek: 'dddd [куни соат] LT [да]',\n            lastDay: '[Кеча соат] LT [да]',\n            lastWeek: '[Утган] dddd [куни соат] LT [да]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'Якин %s ичида',\n            past: 'Бир неча %s олдин',\n            s: 'фурсат',\n            ss: '%d фурсат',\n            m: 'бир дакика',\n            mm: '%d дакика',\n            h: 'бир соат',\n            hh: '%d соат',\n            d: 'бир кун',\n            dd: '%d кун',\n            M: 'бир ой',\n            MM: '%d ой',\n            y: 'бир йил',\n            yy: '%d йил',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return uz;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/uz.js?");

/***/ }),

/***/ "./node_modules/moment/locale/vi.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/vi.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Vietnamese [vi]\n//! author : Bang Nguyen : https://github.com/bangnk\n//! author : Chien Kira : https://github.com/chienkira\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var vi = moment.defineLocale('vi', {\n        months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split(\n            '_'\n        ),\n        monthsShort:\n            'Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split(\n            '_'\n        ),\n        weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        weekdaysParseExact: true,\n        meridiemParse: /sa|ch/i,\n        isPM: function (input) {\n            return /^ch$/i.test(input);\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'sa' : 'SA';\n            } else {\n                return isLower ? 'ch' : 'CH';\n            }\n        },\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM [năm] YYYY',\n            LLL: 'D MMMM [năm] YYYY HH:mm',\n            LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',\n            l: 'DD/M/YYYY',\n            ll: 'D MMM YYYY',\n            lll: 'D MMM YYYY HH:mm',\n            llll: 'ddd, D MMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Hôm nay lúc] LT',\n            nextDay: '[Ngày mai lúc] LT',\n            nextWeek: 'dddd [tuần tới lúc] LT',\n            lastDay: '[Hôm qua lúc] LT',\n            lastWeek: 'dddd [tuần trước lúc] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s tới',\n            past: '%s trước',\n            s: 'vài giây',\n            ss: '%d giây',\n            m: 'một phút',\n            mm: '%d phút',\n            h: 'một giờ',\n            hh: '%d giờ',\n            d: 'một ngày',\n            dd: '%d ngày',\n            w: 'một tuần',\n            ww: '%d tuần',\n            M: 'một tháng',\n            MM: '%d tháng',\n            y: 'một năm',\n            yy: '%d năm',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}/,\n        ordinal: function (number) {\n            return number;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return vi;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/vi.js?");

/***/ }),

/***/ "./node_modules/moment/locale/x-pseudo.js":
/*!************************************************!*\
  !*** ./node_modules/moment/locale/x-pseudo.js ***!
  \************************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Pseudo [x-pseudo]\n//! author : Andrew Hood : https://github.com/andrewhood125\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var xPseudo = moment.defineLocale('x-pseudo', {\n        months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split(\n            '_'\n        ),\n        monthsShort:\n            'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split(\n                '_'\n            ),\n        weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),\n        weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[T~ódá~ý át] LT',\n            nextDay: '[T~ómó~rró~w át] LT',\n            nextWeek: 'dddd [át] LT',\n            lastDay: '[Ý~ést~érdá~ý át] LT',\n            lastWeek: '[L~ást] dddd [át] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'í~ñ %s',\n            past: '%s á~gó',\n            s: 'á ~féw ~sécó~ñds',\n            ss: '%d s~écóñ~ds',\n            m: 'á ~míñ~úté',\n            mm: '%d m~íñú~tés',\n            h: 'á~ñ hó~úr',\n            hh: '%d h~óúrs',\n            d: 'á ~dáý',\n            dd: '%d d~áýs',\n            M: 'á ~móñ~th',\n            MM: '%d m~óñt~hs',\n            y: 'á ~ýéár',\n            yy: '%d ý~éárs',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return xPseudo;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/x-pseudo.js?");

/***/ }),

/***/ "./node_modules/moment/locale/yo.js":
/*!******************************************!*\
  !*** ./node_modules/moment/locale/yo.js ***!
  \******************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Yoruba Nigeria [yo]\n//! author : Atolagbe Abisoye : https://github.com/andela-batolagbe\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var yo = moment.defineLocale('yo', {\n        months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split(\n            '_'\n        ),\n        monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),\n        weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),\n        weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),\n        weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Ònì ni] LT',\n            nextDay: '[Ọ̀la ni] LT',\n            nextWeek: \"dddd [Ọsẹ̀ tón'bọ] [ni] LT\",\n            lastDay: '[Àna ni] LT',\n            lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ní %s',\n            past: '%s kọjá',\n            s: 'ìsẹjú aayá die',\n            ss: 'aayá %d',\n            m: 'ìsẹjú kan',\n            mm: 'ìsẹjú %d',\n            h: 'wákati kan',\n            hh: 'wákati %d',\n            d: 'ọjọ́ kan',\n            dd: 'ọjọ́ %d',\n            M: 'osù kan',\n            MM: 'osù %d',\n            y: 'ọdún kan',\n            yy: 'ọdún %d',\n        },\n        dayOfMonthOrdinalParse: /ọjọ́\\s\\d{1,2}/,\n        ordinal: 'ọjọ́ %d',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return yo;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/yo.js?");

/***/ }),

/***/ "./node_modules/moment/locale/zh-cn.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/zh-cn.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Chinese (China) [zh-cn]\n//! author : suupic : https://github.com/suupic\n//! author : Zeno Zeng : https://github.com/zenozeng\n//! author : uu109 : https://github.com/uu109\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var zhCn = moment.defineLocale('zh-cn', {\n        months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n            '_'\n        ),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),\n        weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日Ah点mm分',\n            LLLL: 'YYYY年M月D日ddddAh点mm分',\n            l: 'YYYY/M/D',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日dddd HH:mm',\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            } else {\n                // '中午'\n                return hour >= 11 ? hour : hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar: {\n            sameDay: '[今天]LT',\n            nextDay: '[明天]LT',\n            nextWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    return '[下]dddLT';\n                } else {\n                    return '[本]dddLT';\n                }\n            },\n            lastDay: '[昨天]LT',\n            lastWeek: function (now) {\n                if (this.week() !== now.week()) {\n                    return '[上]dddLT';\n                } else {\n                    return '[本]dddLT';\n                }\n            },\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(日|月|周)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                case 'M':\n                    return number + '月';\n                case 'w':\n                case 'W':\n                    return number + '周';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s后',\n            past: '%s前',\n            s: '几秒',\n            ss: '%d 秒',\n            m: '1 分钟',\n            mm: '%d 分钟',\n            h: '1 小时',\n            hh: '%d 小时',\n            d: '1 天',\n            dd: '%d 天',\n            w: '1 周',\n            ww: '%d 周',\n            M: '1 个月',\n            MM: '%d 个月',\n            y: '1 年',\n            yy: '%d 年',\n        },\n        week: {\n            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return zhCn;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/zh-cn.js?");

/***/ }),

/***/ "./node_modules/moment/locale/zh-hk.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/zh-hk.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Chinese (Hong Kong) [zh-hk]\n//! author : Ben : https://github.com/ben-lin\n//! author : Chris Lam : https://github.com/hehachris\n//! author : Konstantin : https://github.com/skfd\n//! author : Anthony : https://github.com/anthonylau\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var zhHk = moment.defineLocale('zh-hk', {\n        months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n            '_'\n        ),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日 HH:mm',\n            LLLL: 'YYYY年M月D日dddd HH:mm',\n            l: 'YYYY/M/D',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日dddd HH:mm',\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1200) {\n                return '上午';\n            } else if (hm === 1200) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar: {\n            sameDay: '[今天]LT',\n            nextDay: '[明天]LT',\n            nextWeek: '[下]ddddLT',\n            lastDay: '[昨天]LT',\n            lastWeek: '[上]ddddLT',\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                case 'M':\n                    return number + '月';\n                case 'w':\n                case 'W':\n                    return number + '週';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s後',\n            past: '%s前',\n            s: '幾秒',\n            ss: '%d 秒',\n            m: '1 分鐘',\n            mm: '%d 分鐘',\n            h: '1 小時',\n            hh: '%d 小時',\n            d: '1 天',\n            dd: '%d 天',\n            M: '1 個月',\n            MM: '%d 個月',\n            y: '1 年',\n            yy: '%d 年',\n        },\n    });\n\n    return zhHk;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/zh-hk.js?");

/***/ }),

/***/ "./node_modules/moment/locale/zh-mo.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/zh-mo.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Chinese (Macau) [zh-mo]\n//! author : Ben : https://github.com/ben-lin\n//! author : Chris Lam : https://github.com/hehachris\n//! author : Tan Yuanhong : https://github.com/le0tan\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var zhMo = moment.defineLocale('zh-mo', {\n        months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n            '_'\n        ),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日 HH:mm',\n            LLLL: 'YYYY年M月D日dddd HH:mm',\n            l: 'D/M/YYYY',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日dddd HH:mm',\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar: {\n            sameDay: '[今天] LT',\n            nextDay: '[明天] LT',\n            nextWeek: '[下]dddd LT',\n            lastDay: '[昨天] LT',\n            lastWeek: '[上]dddd LT',\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                case 'M':\n                    return number + '月';\n                case 'w':\n                case 'W':\n                    return number + '週';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s內',\n            past: '%s前',\n            s: '幾秒',\n            ss: '%d 秒',\n            m: '1 分鐘',\n            mm: '%d 分鐘',\n            h: '1 小時',\n            hh: '%d 小時',\n            d: '1 天',\n            dd: '%d 天',\n            M: '1 個月',\n            MM: '%d 個月',\n            y: '1 年',\n            yy: '%d 年',\n        },\n    });\n\n    return zhMo;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/zh-mo.js?");

/***/ }),

/***/ "./node_modules/moment/locale/zh-tw.js":
/*!*********************************************!*\
  !*** ./node_modules/moment/locale/zh-tw.js ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("//! moment.js locale configuration\n//! locale : Chinese (Taiwan) [zh-tw]\n//! author : Ben : https://github.com/ben-lin\n//! author : Chris Lam : https://github.com/hehachris\n\n;(function (global, factory) {\n    true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/moment/moment.js\")) :\n   0\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var zhTw = moment.defineLocale('zh-tw', {\n        months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n            '_'\n        ),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日 HH:mm',\n            LLLL: 'YYYY年M月D日dddd HH:mm',\n            l: 'YYYY/M/D',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日dddd HH:mm',\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar: {\n            sameDay: '[今天] LT',\n            nextDay: '[明天] LT',\n            nextWeek: '[下]dddd LT',\n            lastDay: '[昨天] LT',\n            lastWeek: '[上]dddd LT',\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                case 'M':\n                    return number + '月';\n                case 'w':\n                case 'W':\n                    return number + '週';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s後',\n            past: '%s前',\n            s: '幾秒',\n            ss: '%d 秒',\n            m: '1 分鐘',\n            mm: '%d 分鐘',\n            h: '1 小時',\n            hh: '%d 小時',\n            d: '1 天',\n            dd: '%d 天',\n            M: '1 個月',\n            MM: '%d 個月',\n            y: '1 年',\n            yy: '%d 年',\n        },\n    });\n\n    return zhTw;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/zh-tw.js?");

/***/ }),

/***/ "./node_modules/moment/locale sync recursive ^\\.\\/.*$":
/*!***************************************************!*\
  !*** ./node_modules/moment/locale/ sync ^\.\/.*$ ***!
  \***************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("var map = {\n\t\"./af\": \"./node_modules/moment/locale/af.js\",\n\t\"./af.js\": \"./node_modules/moment/locale/af.js\",\n\t\"./ar\": \"./node_modules/moment/locale/ar.js\",\n\t\"./ar-dz\": \"./node_modules/moment/locale/ar-dz.js\",\n\t\"./ar-dz.js\": \"./node_modules/moment/locale/ar-dz.js\",\n\t\"./ar-kw\": \"./node_modules/moment/locale/ar-kw.js\",\n\t\"./ar-kw.js\": \"./node_modules/moment/locale/ar-kw.js\",\n\t\"./ar-ly\": \"./node_modules/moment/locale/ar-ly.js\",\n\t\"./ar-ly.js\": \"./node_modules/moment/locale/ar-ly.js\",\n\t\"./ar-ma\": \"./node_modules/moment/locale/ar-ma.js\",\n\t\"./ar-ma.js\": \"./node_modules/moment/locale/ar-ma.js\",\n\t\"./ar-sa\": \"./node_modules/moment/locale/ar-sa.js\",\n\t\"./ar-sa.js\": \"./node_modules/moment/locale/ar-sa.js\",\n\t\"./ar-tn\": \"./node_modules/moment/locale/ar-tn.js\",\n\t\"./ar-tn.js\": \"./node_modules/moment/locale/ar-tn.js\",\n\t\"./ar.js\": \"./node_modules/moment/locale/ar.js\",\n\t\"./az\": \"./node_modules/moment/locale/az.js\",\n\t\"./az.js\": \"./node_modules/moment/locale/az.js\",\n\t\"./be\": \"./node_modules/moment/locale/be.js\",\n\t\"./be.js\": \"./node_modules/moment/locale/be.js\",\n\t\"./bg\": \"./node_modules/moment/locale/bg.js\",\n\t\"./bg.js\": \"./node_modules/moment/locale/bg.js\",\n\t\"./bm\": \"./node_modules/moment/locale/bm.js\",\n\t\"./bm.js\": \"./node_modules/moment/locale/bm.js\",\n\t\"./bn\": \"./node_modules/moment/locale/bn.js\",\n\t\"./bn-bd\": \"./node_modules/moment/locale/bn-bd.js\",\n\t\"./bn-bd.js\": \"./node_modules/moment/locale/bn-bd.js\",\n\t\"./bn.js\": \"./node_modules/moment/locale/bn.js\",\n\t\"./bo\": \"./node_modules/moment/locale/bo.js\",\n\t\"./bo.js\": \"./node_modules/moment/locale/bo.js\",\n\t\"./br\": \"./node_modules/moment/locale/br.js\",\n\t\"./br.js\": \"./node_modules/moment/locale/br.js\",\n\t\"./bs\": \"./node_modules/moment/locale/bs.js\",\n\t\"./bs.js\": \"./node_modules/moment/locale/bs.js\",\n\t\"./ca\": \"./node_modules/moment/locale/ca.js\",\n\t\"./ca.js\": \"./node_modules/moment/locale/ca.js\",\n\t\"./cs\": \"./node_modules/moment/locale/cs.js\",\n\t\"./cs.js\": \"./node_modules/moment/locale/cs.js\",\n\t\"./cv\": \"./node_modules/moment/locale/cv.js\",\n\t\"./cv.js\": \"./node_modules/moment/locale/cv.js\",\n\t\"./cy\": \"./node_modules/moment/locale/cy.js\",\n\t\"./cy.js\": \"./node_modules/moment/locale/cy.js\",\n\t\"./da\": \"./node_modules/moment/locale/da.js\",\n\t\"./da.js\": \"./node_modules/moment/locale/da.js\",\n\t\"./de\": \"./node_modules/moment/locale/de.js\",\n\t\"./de-at\": \"./node_modules/moment/locale/de-at.js\",\n\t\"./de-at.js\": \"./node_modules/moment/locale/de-at.js\",\n\t\"./de-ch\": \"./node_modules/moment/locale/de-ch.js\",\n\t\"./de-ch.js\": \"./node_modules/moment/locale/de-ch.js\",\n\t\"./de.js\": \"./node_modules/moment/locale/de.js\",\n\t\"./dv\": \"./node_modules/moment/locale/dv.js\",\n\t\"./dv.js\": \"./node_modules/moment/locale/dv.js\",\n\t\"./el\": \"./node_modules/moment/locale/el.js\",\n\t\"./el.js\": \"./node_modules/moment/locale/el.js\",\n\t\"./en-au\": \"./node_modules/moment/locale/en-au.js\",\n\t\"./en-au.js\": \"./node_modules/moment/locale/en-au.js\",\n\t\"./en-ca\": \"./node_modules/moment/locale/en-ca.js\",\n\t\"./en-ca.js\": \"./node_modules/moment/locale/en-ca.js\",\n\t\"./en-gb\": \"./node_modules/moment/locale/en-gb.js\",\n\t\"./en-gb.js\": \"./node_modules/moment/locale/en-gb.js\",\n\t\"./en-ie\": \"./node_modules/moment/locale/en-ie.js\",\n\t\"./en-ie.js\": \"./node_modules/moment/locale/en-ie.js\",\n\t\"./en-il\": \"./node_modules/moment/locale/en-il.js\",\n\t\"./en-il.js\": \"./node_modules/moment/locale/en-il.js\",\n\t\"./en-in\": \"./node_modules/moment/locale/en-in.js\",\n\t\"./en-in.js\": \"./node_modules/moment/locale/en-in.js\",\n\t\"./en-nz\": \"./node_modules/moment/locale/en-nz.js\",\n\t\"./en-nz.js\": \"./node_modules/moment/locale/en-nz.js\",\n\t\"./en-sg\": \"./node_modules/moment/locale/en-sg.js\",\n\t\"./en-sg.js\": \"./node_modules/moment/locale/en-sg.js\",\n\t\"./eo\": \"./node_modules/moment/locale/eo.js\",\n\t\"./eo.js\": \"./node_modules/moment/locale/eo.js\",\n\t\"./es\": \"./node_modules/moment/locale/es.js\",\n\t\"./es-do\": \"./node_modules/moment/locale/es-do.js\",\n\t\"./es-do.js\": \"./node_modules/moment/locale/es-do.js\",\n\t\"./es-mx\": \"./node_modules/moment/locale/es-mx.js\",\n\t\"./es-mx.js\": \"./node_modules/moment/locale/es-mx.js\",\n\t\"./es-us\": \"./node_modules/moment/locale/es-us.js\",\n\t\"./es-us.js\": \"./node_modules/moment/locale/es-us.js\",\n\t\"./es.js\": \"./node_modules/moment/locale/es.js\",\n\t\"./et\": \"./node_modules/moment/locale/et.js\",\n\t\"./et.js\": \"./node_modules/moment/locale/et.js\",\n\t\"./eu\": \"./node_modules/moment/locale/eu.js\",\n\t\"./eu.js\": \"./node_modules/moment/locale/eu.js\",\n\t\"./fa\": \"./node_modules/moment/locale/fa.js\",\n\t\"./fa.js\": \"./node_modules/moment/locale/fa.js\",\n\t\"./fi\": \"./node_modules/moment/locale/fi.js\",\n\t\"./fi.js\": \"./node_modules/moment/locale/fi.js\",\n\t\"./fil\": \"./node_modules/moment/locale/fil.js\",\n\t\"./fil.js\": \"./node_modules/moment/locale/fil.js\",\n\t\"./fo\": \"./node_modules/moment/locale/fo.js\",\n\t\"./fo.js\": \"./node_modules/moment/locale/fo.js\",\n\t\"./fr\": \"./node_modules/moment/locale/fr.js\",\n\t\"./fr-ca\": \"./node_modules/moment/locale/fr-ca.js\",\n\t\"./fr-ca.js\": \"./node_modules/moment/locale/fr-ca.js\",\n\t\"./fr-ch\": \"./node_modules/moment/locale/fr-ch.js\",\n\t\"./fr-ch.js\": \"./node_modules/moment/locale/fr-ch.js\",\n\t\"./fr.js\": \"./node_modules/moment/locale/fr.js\",\n\t\"./fy\": \"./node_modules/moment/locale/fy.js\",\n\t\"./fy.js\": \"./node_modules/moment/locale/fy.js\",\n\t\"./ga\": \"./node_modules/moment/locale/ga.js\",\n\t\"./ga.js\": \"./node_modules/moment/locale/ga.js\",\n\t\"./gd\": \"./node_modules/moment/locale/gd.js\",\n\t\"./gd.js\": \"./node_modules/moment/locale/gd.js\",\n\t\"./gl\": \"./node_modules/moment/locale/gl.js\",\n\t\"./gl.js\": \"./node_modules/moment/locale/gl.js\",\n\t\"./gom-deva\": \"./node_modules/moment/locale/gom-deva.js\",\n\t\"./gom-deva.js\": \"./node_modules/moment/locale/gom-deva.js\",\n\t\"./gom-latn\": \"./node_modules/moment/locale/gom-latn.js\",\n\t\"./gom-latn.js\": \"./node_modules/moment/locale/gom-latn.js\",\n\t\"./gu\": \"./node_modules/moment/locale/gu.js\",\n\t\"./gu.js\": \"./node_modules/moment/locale/gu.js\",\n\t\"./he\": \"./node_modules/moment/locale/he.js\",\n\t\"./he.js\": \"./node_modules/moment/locale/he.js\",\n\t\"./hi\": \"./node_modules/moment/locale/hi.js\",\n\t\"./hi.js\": \"./node_modules/moment/locale/hi.js\",\n\t\"./hr\": \"./node_modules/moment/locale/hr.js\",\n\t\"./hr.js\": \"./node_modules/moment/locale/hr.js\",\n\t\"./hu\": \"./node_modules/moment/locale/hu.js\",\n\t\"./hu.js\": \"./node_modules/moment/locale/hu.js\",\n\t\"./hy-am\": \"./node_modules/moment/locale/hy-am.js\",\n\t\"./hy-am.js\": \"./node_modules/moment/locale/hy-am.js\",\n\t\"./id\": \"./node_modules/moment/locale/id.js\",\n\t\"./id.js\": \"./node_modules/moment/locale/id.js\",\n\t\"./is\": \"./node_modules/moment/locale/is.js\",\n\t\"./is.js\": \"./node_modules/moment/locale/is.js\",\n\t\"./it\": \"./node_modules/moment/locale/it.js\",\n\t\"./it-ch\": \"./node_modules/moment/locale/it-ch.js\",\n\t\"./it-ch.js\": \"./node_modules/moment/locale/it-ch.js\",\n\t\"./it.js\": \"./node_modules/moment/locale/it.js\",\n\t\"./ja\": \"./node_modules/moment/locale/ja.js\",\n\t\"./ja.js\": \"./node_modules/moment/locale/ja.js\",\n\t\"./jv\": \"./node_modules/moment/locale/jv.js\",\n\t\"./jv.js\": \"./node_modules/moment/locale/jv.js\",\n\t\"./ka\": \"./node_modules/moment/locale/ka.js\",\n\t\"./ka.js\": \"./node_modules/moment/locale/ka.js\",\n\t\"./kk\": \"./node_modules/moment/locale/kk.js\",\n\t\"./kk.js\": \"./node_modules/moment/locale/kk.js\",\n\t\"./km\": \"./node_modules/moment/locale/km.js\",\n\t\"./km.js\": \"./node_modules/moment/locale/km.js\",\n\t\"./kn\": \"./node_modules/moment/locale/kn.js\",\n\t\"./kn.js\": \"./node_modules/moment/locale/kn.js\",\n\t\"./ko\": \"./node_modules/moment/locale/ko.js\",\n\t\"./ko.js\": \"./node_modules/moment/locale/ko.js\",\n\t\"./ku\": \"./node_modules/moment/locale/ku.js\",\n\t\"./ku.js\": \"./node_modules/moment/locale/ku.js\",\n\t\"./ky\": \"./node_modules/moment/locale/ky.js\",\n\t\"./ky.js\": \"./node_modules/moment/locale/ky.js\",\n\t\"./lb\": \"./node_modules/moment/locale/lb.js\",\n\t\"./lb.js\": \"./node_modules/moment/locale/lb.js\",\n\t\"./lo\": \"./node_modules/moment/locale/lo.js\",\n\t\"./lo.js\": \"./node_modules/moment/locale/lo.js\",\n\t\"./lt\": \"./node_modules/moment/locale/lt.js\",\n\t\"./lt.js\": \"./node_modules/moment/locale/lt.js\",\n\t\"./lv\": \"./node_modules/moment/locale/lv.js\",\n\t\"./lv.js\": \"./node_modules/moment/locale/lv.js\",\n\t\"./me\": \"./node_modules/moment/locale/me.js\",\n\t\"./me.js\": \"./node_modules/moment/locale/me.js\",\n\t\"./mi\": \"./node_modules/moment/locale/mi.js\",\n\t\"./mi.js\": \"./node_modules/moment/locale/mi.js\",\n\t\"./mk\": \"./node_modules/moment/locale/mk.js\",\n\t\"./mk.js\": \"./node_modules/moment/locale/mk.js\",\n\t\"./ml\": \"./node_modules/moment/locale/ml.js\",\n\t\"./ml.js\": \"./node_modules/moment/locale/ml.js\",\n\t\"./mn\": \"./node_modules/moment/locale/mn.js\",\n\t\"./mn.js\": \"./node_modules/moment/locale/mn.js\",\n\t\"./mr\": \"./node_modules/moment/locale/mr.js\",\n\t\"./mr.js\": \"./node_modules/moment/locale/mr.js\",\n\t\"./ms\": \"./node_modules/moment/locale/ms.js\",\n\t\"./ms-my\": \"./node_modules/moment/locale/ms-my.js\",\n\t\"./ms-my.js\": \"./node_modules/moment/locale/ms-my.js\",\n\t\"./ms.js\": \"./node_modules/moment/locale/ms.js\",\n\t\"./mt\": \"./node_modules/moment/locale/mt.js\",\n\t\"./mt.js\": \"./node_modules/moment/locale/mt.js\",\n\t\"./my\": \"./node_modules/moment/locale/my.js\",\n\t\"./my.js\": \"./node_modules/moment/locale/my.js\",\n\t\"./nb\": \"./node_modules/moment/locale/nb.js\",\n\t\"./nb.js\": \"./node_modules/moment/locale/nb.js\",\n\t\"./ne\": \"./node_modules/moment/locale/ne.js\",\n\t\"./ne.js\": \"./node_modules/moment/locale/ne.js\",\n\t\"./nl\": \"./node_modules/moment/locale/nl.js\",\n\t\"./nl-be\": \"./node_modules/moment/locale/nl-be.js\",\n\t\"./nl-be.js\": \"./node_modules/moment/locale/nl-be.js\",\n\t\"./nl.js\": \"./node_modules/moment/locale/nl.js\",\n\t\"./nn\": \"./node_modules/moment/locale/nn.js\",\n\t\"./nn.js\": \"./node_modules/moment/locale/nn.js\",\n\t\"./oc-lnc\": \"./node_modules/moment/locale/oc-lnc.js\",\n\t\"./oc-lnc.js\": \"./node_modules/moment/locale/oc-lnc.js\",\n\t\"./pa-in\": \"./node_modules/moment/locale/pa-in.js\",\n\t\"./pa-in.js\": \"./node_modules/moment/locale/pa-in.js\",\n\t\"./pl\": \"./node_modules/moment/locale/pl.js\",\n\t\"./pl.js\": \"./node_modules/moment/locale/pl.js\",\n\t\"./pt\": \"./node_modules/moment/locale/pt.js\",\n\t\"./pt-br\": \"./node_modules/moment/locale/pt-br.js\",\n\t\"./pt-br.js\": \"./node_modules/moment/locale/pt-br.js\",\n\t\"./pt.js\": \"./node_modules/moment/locale/pt.js\",\n\t\"./ro\": \"./node_modules/moment/locale/ro.js\",\n\t\"./ro.js\": \"./node_modules/moment/locale/ro.js\",\n\t\"./ru\": \"./node_modules/moment/locale/ru.js\",\n\t\"./ru.js\": \"./node_modules/moment/locale/ru.js\",\n\t\"./sd\": \"./node_modules/moment/locale/sd.js\",\n\t\"./sd.js\": \"./node_modules/moment/locale/sd.js\",\n\t\"./se\": \"./node_modules/moment/locale/se.js\",\n\t\"./se.js\": \"./node_modules/moment/locale/se.js\",\n\t\"./si\": \"./node_modules/moment/locale/si.js\",\n\t\"./si.js\": \"./node_modules/moment/locale/si.js\",\n\t\"./sk\": \"./node_modules/moment/locale/sk.js\",\n\t\"./sk.js\": \"./node_modules/moment/locale/sk.js\",\n\t\"./sl\": \"./node_modules/moment/locale/sl.js\",\n\t\"./sl.js\": \"./node_modules/moment/locale/sl.js\",\n\t\"./sq\": \"./node_modules/moment/locale/sq.js\",\n\t\"./sq.js\": \"./node_modules/moment/locale/sq.js\",\n\t\"./sr\": \"./node_modules/moment/locale/sr.js\",\n\t\"./sr-cyrl\": \"./node_modules/moment/locale/sr-cyrl.js\",\n\t\"./sr-cyrl.js\": \"./node_modules/moment/locale/sr-cyrl.js\",\n\t\"./sr.js\": \"./node_modules/moment/locale/sr.js\",\n\t\"./ss\": \"./node_modules/moment/locale/ss.js\",\n\t\"./ss.js\": \"./node_modules/moment/locale/ss.js\",\n\t\"./sv\": \"./node_modules/moment/locale/sv.js\",\n\t\"./sv.js\": \"./node_modules/moment/locale/sv.js\",\n\t\"./sw\": \"./node_modules/moment/locale/sw.js\",\n\t\"./sw.js\": \"./node_modules/moment/locale/sw.js\",\n\t\"./ta\": \"./node_modules/moment/locale/ta.js\",\n\t\"./ta.js\": \"./node_modules/moment/locale/ta.js\",\n\t\"./te\": \"./node_modules/moment/locale/te.js\",\n\t\"./te.js\": \"./node_modules/moment/locale/te.js\",\n\t\"./tet\": \"./node_modules/moment/locale/tet.js\",\n\t\"./tet.js\": \"./node_modules/moment/locale/tet.js\",\n\t\"./tg\": \"./node_modules/moment/locale/tg.js\",\n\t\"./tg.js\": \"./node_modules/moment/locale/tg.js\",\n\t\"./th\": \"./node_modules/moment/locale/th.js\",\n\t\"./th.js\": \"./node_modules/moment/locale/th.js\",\n\t\"./tk\": \"./node_modules/moment/locale/tk.js\",\n\t\"./tk.js\": \"./node_modules/moment/locale/tk.js\",\n\t\"./tl-ph\": \"./node_modules/moment/locale/tl-ph.js\",\n\t\"./tl-ph.js\": \"./node_modules/moment/locale/tl-ph.js\",\n\t\"./tlh\": \"./node_modules/moment/locale/tlh.js\",\n\t\"./tlh.js\": \"./node_modules/moment/locale/tlh.js\",\n\t\"./tr\": \"./node_modules/moment/locale/tr.js\",\n\t\"./tr.js\": \"./node_modules/moment/locale/tr.js\",\n\t\"./tzl\": \"./node_modules/moment/locale/tzl.js\",\n\t\"./tzl.js\": \"./node_modules/moment/locale/tzl.js\",\n\t\"./tzm\": \"./node_modules/moment/locale/tzm.js\",\n\t\"./tzm-latn\": \"./node_modules/moment/locale/tzm-latn.js\",\n\t\"./tzm-latn.js\": \"./node_modules/moment/locale/tzm-latn.js\",\n\t\"./tzm.js\": \"./node_modules/moment/locale/tzm.js\",\n\t\"./ug-cn\": \"./node_modules/moment/locale/ug-cn.js\",\n\t\"./ug-cn.js\": \"./node_modules/moment/locale/ug-cn.js\",\n\t\"./uk\": \"./node_modules/moment/locale/uk.js\",\n\t\"./uk.js\": \"./node_modules/moment/locale/uk.js\",\n\t\"./ur\": \"./node_modules/moment/locale/ur.js\",\n\t\"./ur.js\": \"./node_modules/moment/locale/ur.js\",\n\t\"./uz\": \"./node_modules/moment/locale/uz.js\",\n\t\"./uz-latn\": \"./node_modules/moment/locale/uz-latn.js\",\n\t\"./uz-latn.js\": \"./node_modules/moment/locale/uz-latn.js\",\n\t\"./uz.js\": \"./node_modules/moment/locale/uz.js\",\n\t\"./vi\": \"./node_modules/moment/locale/vi.js\",\n\t\"./vi.js\": \"./node_modules/moment/locale/vi.js\",\n\t\"./x-pseudo\": \"./node_modules/moment/locale/x-pseudo.js\",\n\t\"./x-pseudo.js\": \"./node_modules/moment/locale/x-pseudo.js\",\n\t\"./yo\": \"./node_modules/moment/locale/yo.js\",\n\t\"./yo.js\": \"./node_modules/moment/locale/yo.js\",\n\t\"./zh-cn\": \"./node_modules/moment/locale/zh-cn.js\",\n\t\"./zh-cn.js\": \"./node_modules/moment/locale/zh-cn.js\",\n\t\"./zh-hk\": \"./node_modules/moment/locale/zh-hk.js\",\n\t\"./zh-hk.js\": \"./node_modules/moment/locale/zh-hk.js\",\n\t\"./zh-mo\": \"./node_modules/moment/locale/zh-mo.js\",\n\t\"./zh-mo.js\": \"./node_modules/moment/locale/zh-mo.js\",\n\t\"./zh-tw\": \"./node_modules/moment/locale/zh-tw.js\",\n\t\"./zh-tw.js\": \"./node_modules/moment/locale/zh-tw.js\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./node_modules/moment/locale sync recursive ^\\\\.\\\\/.*$\";\n\n//# sourceURL=webpack://frontend/./node_modules/moment/locale/_sync_^\\.\\/.*$?");

/***/ }),

/***/ "./node_modules/moment/moment.js":
/*!***************************************!*\
  !*** ./node_modules/moment/moment.js ***!
  \***************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

eval("/* module decorator */ module = __webpack_require__.nmd(module);\n//! moment.js\n//! version : 2.29.4\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n     true ? module.exports = factory() :\n    0\n}(this, (function () { 'use strict';\n\n    var hookCallback;\n\n    function hooks() {\n        return hookCallback.apply(null, arguments);\n    }\n\n    // This is done to register the method called with moment()\n    // without creating circular dependencies.\n    function setHookCallback(callback) {\n        hookCallback = callback;\n    }\n\n    function isArray(input) {\n        return (\n            input instanceof Array ||\n            Object.prototype.toString.call(input) === '[object Array]'\n        );\n    }\n\n    function isObject(input) {\n        // IE8 will treat undefined and null as object if it wasn't for\n        // input != null\n        return (\n            input != null &&\n            Object.prototype.toString.call(input) === '[object Object]'\n        );\n    }\n\n    function hasOwnProp(a, b) {\n        return Object.prototype.hasOwnProperty.call(a, b);\n    }\n\n    function isObjectEmpty(obj) {\n        if (Object.getOwnPropertyNames) {\n            return Object.getOwnPropertyNames(obj).length === 0;\n        } else {\n            var k;\n            for (k in obj) {\n                if (hasOwnProp(obj, k)) {\n                    return false;\n                }\n            }\n            return true;\n        }\n    }\n\n    function isUndefined(input) {\n        return input === void 0;\n    }\n\n    function isNumber(input) {\n        return (\n            typeof input === 'number' ||\n            Object.prototype.toString.call(input) === '[object Number]'\n        );\n    }\n\n    function isDate(input) {\n        return (\n            input instanceof Date ||\n            Object.prototype.toString.call(input) === '[object Date]'\n        );\n    }\n\n    function map(arr, fn) {\n        var res = [],\n            i,\n            arrLen = arr.length;\n        for (i = 0; i < arrLen; ++i) {\n            res.push(fn(arr[i], i));\n        }\n        return res;\n    }\n\n    function extend(a, b) {\n        for (var i in b) {\n            if (hasOwnProp(b, i)) {\n                a[i] = b[i];\n            }\n        }\n\n        if (hasOwnProp(b, 'toString')) {\n            a.toString = b.toString;\n        }\n\n        if (hasOwnProp(b, 'valueOf')) {\n            a.valueOf = b.valueOf;\n        }\n\n        return a;\n    }\n\n    function createUTC(input, format, locale, strict) {\n        return createLocalOrUTC(input, format, locale, strict, true).utc();\n    }\n\n    function defaultParsingFlags() {\n        // We need to deep clone this object.\n        return {\n            empty: false,\n            unusedTokens: [],\n            unusedInput: [],\n            overflow: -2,\n            charsLeftOver: 0,\n            nullInput: false,\n            invalidEra: null,\n            invalidMonth: null,\n            invalidFormat: false,\n            userInvalidated: false,\n            iso: false,\n            parsedDateParts: [],\n            era: null,\n            meridiem: null,\n            rfc2822: false,\n            weekdayMismatch: false,\n        };\n    }\n\n    function getParsingFlags(m) {\n        if (m._pf == null) {\n            m._pf = defaultParsingFlags();\n        }\n        return m._pf;\n    }\n\n    var some;\n    if (Array.prototype.some) {\n        some = Array.prototype.some;\n    } else {\n        some = function (fun) {\n            var t = Object(this),\n                len = t.length >>> 0,\n                i;\n\n            for (i = 0; i < len; i++) {\n                if (i in t && fun.call(this, t[i], i, t)) {\n                    return true;\n                }\n            }\n\n            return false;\n        };\n    }\n\n    function isValid(m) {\n        if (m._isValid == null) {\n            var flags = getParsingFlags(m),\n                parsedParts = some.call(flags.parsedDateParts, function (i) {\n                    return i != null;\n                }),\n                isNowValid =\n                    !isNaN(m._d.getTime()) &&\n                    flags.overflow < 0 &&\n                    !flags.empty &&\n                    !flags.invalidEra &&\n                    !flags.invalidMonth &&\n                    !flags.invalidWeekday &&\n                    !flags.weekdayMismatch &&\n                    !flags.nullInput &&\n                    !flags.invalidFormat &&\n                    !flags.userInvalidated &&\n                    (!flags.meridiem || (flags.meridiem && parsedParts));\n\n            if (m._strict) {\n                isNowValid =\n                    isNowValid &&\n                    flags.charsLeftOver === 0 &&\n                    flags.unusedTokens.length === 0 &&\n                    flags.bigHour === undefined;\n            }\n\n            if (Object.isFrozen == null || !Object.isFrozen(m)) {\n                m._isValid = isNowValid;\n            } else {\n                return isNowValid;\n            }\n        }\n        return m._isValid;\n    }\n\n    function createInvalid(flags) {\n        var m = createUTC(NaN);\n        if (flags != null) {\n            extend(getParsingFlags(m), flags);\n        } else {\n            getParsingFlags(m).userInvalidated = true;\n        }\n\n        return m;\n    }\n\n    // Plugins that add properties should also add the key here (null value),\n    // so we can properly clone ourselves.\n    var momentProperties = (hooks.momentProperties = []),\n        updateInProgress = false;\n\n    function copyConfig(to, from) {\n        var i,\n            prop,\n            val,\n            momentPropertiesLen = momentProperties.length;\n\n        if (!isUndefined(from._isAMomentObject)) {\n            to._isAMomentObject = from._isAMomentObject;\n        }\n        if (!isUndefined(from._i)) {\n            to._i = from._i;\n        }\n        if (!isUndefined(from._f)) {\n            to._f = from._f;\n        }\n        if (!isUndefined(from._l)) {\n            to._l = from._l;\n        }\n        if (!isUndefined(from._strict)) {\n            to._strict = from._strict;\n        }\n        if (!isUndefined(from._tzm)) {\n            to._tzm = from._tzm;\n        }\n        if (!isUndefined(from._isUTC)) {\n            to._isUTC = from._isUTC;\n        }\n        if (!isUndefined(from._offset)) {\n            to._offset = from._offset;\n        }\n        if (!isUndefined(from._pf)) {\n            to._pf = getParsingFlags(from);\n        }\n        if (!isUndefined(from._locale)) {\n            to._locale = from._locale;\n        }\n\n        if (momentPropertiesLen > 0) {\n            for (i = 0; i < momentPropertiesLen; i++) {\n                prop = momentProperties[i];\n                val = from[prop];\n                if (!isUndefined(val)) {\n                    to[prop] = val;\n                }\n            }\n        }\n\n        return to;\n    }\n\n    // Moment prototype object\n    function Moment(config) {\n        copyConfig(this, config);\n        this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n        if (!this.isValid()) {\n            this._d = new Date(NaN);\n        }\n        // Prevent infinite loop in case updateOffset creates new moment\n        // objects.\n        if (updateInProgress === false) {\n            updateInProgress = true;\n            hooks.updateOffset(this);\n            updateInProgress = false;\n        }\n    }\n\n    function isMoment(obj) {\n        return (\n            obj instanceof Moment || (obj != null && obj._isAMomentObject != null)\n        );\n    }\n\n    function warn(msg) {\n        if (\n            hooks.suppressDeprecationWarnings === false &&\n            typeof console !== 'undefined' &&\n            console.warn\n        ) {\n            console.warn('Deprecation warning: ' + msg);\n        }\n    }\n\n    function deprecate(msg, fn) {\n        var firstTime = true;\n\n        return extend(function () {\n            if (hooks.deprecationHandler != null) {\n                hooks.deprecationHandler(null, msg);\n            }\n            if (firstTime) {\n                var args = [],\n                    arg,\n                    i,\n                    key,\n                    argLen = arguments.length;\n                for (i = 0; i < argLen; i++) {\n                    arg = '';\n                    if (typeof arguments[i] === 'object') {\n                        arg += '\\n[' + i + '] ';\n                        for (key in arguments[0]) {\n                            if (hasOwnProp(arguments[0], key)) {\n                                arg += key + ': ' + arguments[0][key] + ', ';\n                            }\n                        }\n                        arg = arg.slice(0, -2); // Remove trailing comma and space\n                    } else {\n                        arg = arguments[i];\n                    }\n                    args.push(arg);\n                }\n                warn(\n                    msg +\n                        '\\nArguments: ' +\n                        Array.prototype.slice.call(args).join('') +\n                        '\\n' +\n                        new Error().stack\n                );\n                firstTime = false;\n            }\n            return fn.apply(this, arguments);\n        }, fn);\n    }\n\n    var deprecations = {};\n\n    function deprecateSimple(name, msg) {\n        if (hooks.deprecationHandler != null) {\n            hooks.deprecationHandler(name, msg);\n        }\n        if (!deprecations[name]) {\n            warn(msg);\n            deprecations[name] = true;\n        }\n    }\n\n    hooks.suppressDeprecationWarnings = false;\n    hooks.deprecationHandler = null;\n\n    function isFunction(input) {\n        return (\n            (typeof Function !== 'undefined' && input instanceof Function) ||\n            Object.prototype.toString.call(input) === '[object Function]'\n        );\n    }\n\n    function set(config) {\n        var prop, i;\n        for (i in config) {\n            if (hasOwnProp(config, i)) {\n                prop = config[i];\n                if (isFunction(prop)) {\n                    this[i] = prop;\n                } else {\n                    this['_' + i] = prop;\n                }\n            }\n        }\n        this._config = config;\n        // Lenient ordinal parsing accepts just a number in addition to\n        // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n        // TODO: Remove \"ordinalParse\" fallback in next major release.\n        this._dayOfMonthOrdinalParseLenient = new RegExp(\n            (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n                '|' +\n                /\\d{1,2}/.source\n        );\n    }\n\n    function mergeConfigs(parentConfig, childConfig) {\n        var res = extend({}, parentConfig),\n            prop;\n        for (prop in childConfig) {\n            if (hasOwnProp(childConfig, prop)) {\n                if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n                    res[prop] = {};\n                    extend(res[prop], parentConfig[prop]);\n                    extend(res[prop], childConfig[prop]);\n                } else if (childConfig[prop] != null) {\n                    res[prop] = childConfig[prop];\n                } else {\n                    delete res[prop];\n                }\n            }\n        }\n        for (prop in parentConfig) {\n            if (\n                hasOwnProp(parentConfig, prop) &&\n                !hasOwnProp(childConfig, prop) &&\n                isObject(parentConfig[prop])\n            ) {\n                // make sure changes to properties don't modify parent config\n                res[prop] = extend({}, res[prop]);\n            }\n        }\n        return res;\n    }\n\n    function Locale(config) {\n        if (config != null) {\n            this.set(config);\n        }\n    }\n\n    var keys;\n\n    if (Object.keys) {\n        keys = Object.keys;\n    } else {\n        keys = function (obj) {\n            var i,\n                res = [];\n            for (i in obj) {\n                if (hasOwnProp(obj, i)) {\n                    res.push(i);\n                }\n            }\n            return res;\n        };\n    }\n\n    var defaultCalendar = {\n        sameDay: '[Today at] LT',\n        nextDay: '[Tomorrow at] LT',\n        nextWeek: 'dddd [at] LT',\n        lastDay: '[Yesterday at] LT',\n        lastWeek: '[Last] dddd [at] LT',\n        sameElse: 'L',\n    };\n\n    function calendar(key, mom, now) {\n        var output = this._calendar[key] || this._calendar['sameElse'];\n        return isFunction(output) ? output.call(mom, now) : output;\n    }\n\n    function zeroFill(number, targetLength, forceSign) {\n        var absNumber = '' + Math.abs(number),\n            zerosToFill = targetLength - absNumber.length,\n            sign = number >= 0;\n        return (\n            (sign ? (forceSign ? '+' : '') : '-') +\n            Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +\n            absNumber\n        );\n    }\n\n    var formattingTokens =\n            /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n        localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n        formatFunctions = {},\n        formatTokenFunctions = {};\n\n    // token:    'M'\n    // padded:   ['MM', 2]\n    // ordinal:  'Mo'\n    // callback: function () { this.month() + 1 }\n    function addFormatToken(token, padded, ordinal, callback) {\n        var func = callback;\n        if (typeof callback === 'string') {\n            func = function () {\n                return this[callback]();\n            };\n        }\n        if (token) {\n            formatTokenFunctions[token] = func;\n        }\n        if (padded) {\n            formatTokenFunctions[padded[0]] = function () {\n                return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n            };\n        }\n        if (ordinal) {\n            formatTokenFunctions[ordinal] = function () {\n                return this.localeData().ordinal(\n                    func.apply(this, arguments),\n                    token\n                );\n            };\n        }\n    }\n\n    function removeFormattingTokens(input) {\n        if (input.match(/\\[[\\s\\S]/)) {\n            return input.replace(/^\\[|\\]$/g, '');\n        }\n        return input.replace(/\\\\/g, '');\n    }\n\n    function makeFormatFunction(format) {\n        var array = format.match(formattingTokens),\n            i,\n            length;\n\n        for (i = 0, length = array.length; i < length; i++) {\n            if (formatTokenFunctions[array[i]]) {\n                array[i] = formatTokenFunctions[array[i]];\n            } else {\n                array[i] = removeFormattingTokens(array[i]);\n            }\n        }\n\n        return function (mom) {\n            var output = '',\n                i;\n            for (i = 0; i < length; i++) {\n                output += isFunction(array[i])\n                    ? array[i].call(mom, format)\n                    : array[i];\n            }\n            return output;\n        };\n    }\n\n    // format date using native date object\n    function formatMoment(m, format) {\n        if (!m.isValid()) {\n            return m.localeData().invalidDate();\n        }\n\n        format = expandFormat(format, m.localeData());\n        formatFunctions[format] =\n            formatFunctions[format] || makeFormatFunction(format);\n\n        return formatFunctions[format](m);\n    }\n\n    function expandFormat(format, locale) {\n        var i = 5;\n\n        function replaceLongDateFormatTokens(input) {\n            return locale.longDateFormat(input) || input;\n        }\n\n        localFormattingTokens.lastIndex = 0;\n        while (i >= 0 && localFormattingTokens.test(format)) {\n            format = format.replace(\n                localFormattingTokens,\n                replaceLongDateFormatTokens\n            );\n            localFormattingTokens.lastIndex = 0;\n            i -= 1;\n        }\n\n        return format;\n    }\n\n    var defaultLongDateFormat = {\n        LTS: 'h:mm:ss A',\n        LT: 'h:mm A',\n        L: 'MM/DD/YYYY',\n        LL: 'MMMM D, YYYY',\n        LLL: 'MMMM D, YYYY h:mm A',\n        LLLL: 'dddd, MMMM D, YYYY h:mm A',\n    };\n\n    function longDateFormat(key) {\n        var format = this._longDateFormat[key],\n            formatUpper = this._longDateFormat[key.toUpperCase()];\n\n        if (format || !formatUpper) {\n            return format;\n        }\n\n        this._longDateFormat[key] = formatUpper\n            .match(formattingTokens)\n            .map(function (tok) {\n                if (\n                    tok === 'MMMM' ||\n                    tok === 'MM' ||\n                    tok === 'DD' ||\n                    tok === 'dddd'\n                ) {\n                    return tok.slice(1);\n                }\n                return tok;\n            })\n            .join('');\n\n        return this._longDateFormat[key];\n    }\n\n    var defaultInvalidDate = 'Invalid date';\n\n    function invalidDate() {\n        return this._invalidDate;\n    }\n\n    var defaultOrdinal = '%d',\n        defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n    function ordinal(number) {\n        return this._ordinal.replace('%d', number);\n    }\n\n    var defaultRelativeTime = {\n        future: 'in %s',\n        past: '%s ago',\n        s: 'a few seconds',\n        ss: '%d seconds',\n        m: 'a minute',\n        mm: '%d minutes',\n        h: 'an hour',\n        hh: '%d hours',\n        d: 'a day',\n        dd: '%d days',\n        w: 'a week',\n        ww: '%d weeks',\n        M: 'a month',\n        MM: '%d months',\n        y: 'a year',\n        yy: '%d years',\n    };\n\n    function relativeTime(number, withoutSuffix, string, isFuture) {\n        var output = this._relativeTime[string];\n        return isFunction(output)\n            ? output(number, withoutSuffix, string, isFuture)\n            : output.replace(/%d/i, number);\n    }\n\n    function pastFuture(diff, output) {\n        var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n        return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n    }\n\n    var aliases = {};\n\n    function addUnitAlias(unit, shorthand) {\n        var lowerCase = unit.toLowerCase();\n        aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n    }\n\n    function normalizeUnits(units) {\n        return typeof units === 'string'\n            ? aliases[units] || aliases[units.toLowerCase()]\n            : undefined;\n    }\n\n    function normalizeObjectUnits(inputObject) {\n        var normalizedInput = {},\n            normalizedProp,\n            prop;\n\n        for (prop in inputObject) {\n            if (hasOwnProp(inputObject, prop)) {\n                normalizedProp = normalizeUnits(prop);\n                if (normalizedProp) {\n                    normalizedInput[normalizedProp] = inputObject[prop];\n                }\n            }\n        }\n\n        return normalizedInput;\n    }\n\n    var priorities = {};\n\n    function addUnitPriority(unit, priority) {\n        priorities[unit] = priority;\n    }\n\n    function getPrioritizedUnits(unitsObj) {\n        var units = [],\n            u;\n        for (u in unitsObj) {\n            if (hasOwnProp(unitsObj, u)) {\n                units.push({ unit: u, priority: priorities[u] });\n            }\n        }\n        units.sort(function (a, b) {\n            return a.priority - b.priority;\n        });\n        return units;\n    }\n\n    function isLeapYear(year) {\n        return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n    }\n\n    function absFloor(number) {\n        if (number < 0) {\n            // -0 -> 0\n            return Math.ceil(number) || 0;\n        } else {\n            return Math.floor(number);\n        }\n    }\n\n    function toInt(argumentForCoercion) {\n        var coercedNumber = +argumentForCoercion,\n            value = 0;\n\n        if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n            value = absFloor(coercedNumber);\n        }\n\n        return value;\n    }\n\n    function makeGetSet(unit, keepTime) {\n        return function (value) {\n            if (value != null) {\n                set$1(this, unit, value);\n                hooks.updateOffset(this, keepTime);\n                return this;\n            } else {\n                return get(this, unit);\n            }\n        };\n    }\n\n    function get(mom, unit) {\n        return mom.isValid()\n            ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()\n            : NaN;\n    }\n\n    function set$1(mom, unit, value) {\n        if (mom.isValid() && !isNaN(value)) {\n            if (\n                unit === 'FullYear' &&\n                isLeapYear(mom.year()) &&\n                mom.month() === 1 &&\n                mom.date() === 29\n            ) {\n                value = toInt(value);\n                mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](\n                    value,\n                    mom.month(),\n                    daysInMonth(value, mom.month())\n                );\n            } else {\n                mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function stringGet(units) {\n        units = normalizeUnits(units);\n        if (isFunction(this[units])) {\n            return this[units]();\n        }\n        return this;\n    }\n\n    function stringSet(units, value) {\n        if (typeof units === 'object') {\n            units = normalizeObjectUnits(units);\n            var prioritized = getPrioritizedUnits(units),\n                i,\n                prioritizedLen = prioritized.length;\n            for (i = 0; i < prioritizedLen; i++) {\n                this[prioritized[i].unit](units[prioritized[i].unit]);\n            }\n        } else {\n            units = normalizeUnits(units);\n            if (isFunction(this[units])) {\n                return this[units](value);\n            }\n        }\n        return this;\n    }\n\n    var match1 = /\\d/, //       0 - 9\n        match2 = /\\d\\d/, //      00 - 99\n        match3 = /\\d{3}/, //     000 - 999\n        match4 = /\\d{4}/, //    0000 - 9999\n        match6 = /[+-]?\\d{6}/, // -999999 - 999999\n        match1to2 = /\\d\\d?/, //       0 - 99\n        match3to4 = /\\d\\d\\d\\d?/, //     999 - 9999\n        match5to6 = /\\d\\d\\d\\d\\d\\d?/, //   99999 - 999999\n        match1to3 = /\\d{1,3}/, //       0 - 999\n        match1to4 = /\\d{1,4}/, //       0 - 9999\n        match1to6 = /[+-]?\\d{1,6}/, // -999999 - 999999\n        matchUnsigned = /\\d+/, //       0 - inf\n        matchSigned = /[+-]?\\d+/, //    -inf - inf\n        matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi, // +00:00 -00:00 +0000 -0000 or Z\n        matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n        matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/, // 123456789 123456789.123\n        // any word (or two) characters or numbers including two/three word month in arabic.\n        // includes scottish gaelic two word and hyphenated months\n        matchWord =\n            /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n        regexes;\n\n    regexes = {};\n\n    function addRegexToken(token, regex, strictRegex) {\n        regexes[token] = isFunction(regex)\n            ? regex\n            : function (isStrict, localeData) {\n                  return isStrict && strictRegex ? strictRegex : regex;\n              };\n    }\n\n    function getParseRegexForToken(token, config) {\n        if (!hasOwnProp(regexes, token)) {\n            return new RegExp(unescapeFormat(token));\n        }\n\n        return regexes[token](config._strict, config._locale);\n    }\n\n    // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n    function unescapeFormat(s) {\n        return regexEscape(\n            s\n                .replace('\\\\', '')\n                .replace(\n                    /\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,\n                    function (matched, p1, p2, p3, p4) {\n                        return p1 || p2 || p3 || p4;\n                    }\n                )\n        );\n    }\n\n    function regexEscape(s) {\n        return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n    }\n\n    var tokens = {};\n\n    function addParseToken(token, callback) {\n        var i,\n            func = callback,\n            tokenLen;\n        if (typeof token === 'string') {\n            token = [token];\n        }\n        if (isNumber(callback)) {\n            func = function (input, array) {\n                array[callback] = toInt(input);\n            };\n        }\n        tokenLen = token.length;\n        for (i = 0; i < tokenLen; i++) {\n            tokens[token[i]] = func;\n        }\n    }\n\n    function addWeekParseToken(token, callback) {\n        addParseToken(token, function (input, array, config, token) {\n            config._w = config._w || {};\n            callback(input, config._w, config, token);\n        });\n    }\n\n    function addTimeToArrayFromToken(token, input, config) {\n        if (input != null && hasOwnProp(tokens, token)) {\n            tokens[token](input, config._a, config, token);\n        }\n    }\n\n    var YEAR = 0,\n        MONTH = 1,\n        DATE = 2,\n        HOUR = 3,\n        MINUTE = 4,\n        SECOND = 5,\n        MILLISECOND = 6,\n        WEEK = 7,\n        WEEKDAY = 8;\n\n    function mod(n, x) {\n        return ((n % x) + x) % x;\n    }\n\n    var indexOf;\n\n    if (Array.prototype.indexOf) {\n        indexOf = Array.prototype.indexOf;\n    } else {\n        indexOf = function (o) {\n            // I know\n            var i;\n            for (i = 0; i < this.length; ++i) {\n                if (this[i] === o) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n    }\n\n    function daysInMonth(year, month) {\n        if (isNaN(year) || isNaN(month)) {\n            return NaN;\n        }\n        var modMonth = mod(month, 12);\n        year += (month - modMonth) / 12;\n        return modMonth === 1\n            ? isLeapYear(year)\n                ? 29\n                : 28\n            : 31 - ((modMonth % 7) % 2);\n    }\n\n    // FORMATTING\n\n    addFormatToken('M', ['MM', 2], 'Mo', function () {\n        return this.month() + 1;\n    });\n\n    addFormatToken('MMM', 0, 0, function (format) {\n        return this.localeData().monthsShort(this, format);\n    });\n\n    addFormatToken('MMMM', 0, 0, function (format) {\n        return this.localeData().months(this, format);\n    });\n\n    // ALIASES\n\n    addUnitAlias('month', 'M');\n\n    // PRIORITY\n\n    addUnitPriority('month', 8);\n\n    // PARSING\n\n    addRegexToken('M', match1to2);\n    addRegexToken('MM', match1to2, match2);\n    addRegexToken('MMM', function (isStrict, locale) {\n        return locale.monthsShortRegex(isStrict);\n    });\n    addRegexToken('MMMM', function (isStrict, locale) {\n        return locale.monthsRegex(isStrict);\n    });\n\n    addParseToken(['M', 'MM'], function (input, array) {\n        array[MONTH] = toInt(input) - 1;\n    });\n\n    addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n        var month = config._locale.monthsParse(input, token, config._strict);\n        // if we didn't find a month name, mark the date as invalid.\n        if (month != null) {\n            array[MONTH] = month;\n        } else {\n            getParsingFlags(config).invalidMonth = input;\n        }\n    });\n\n    // LOCALES\n\n    var defaultLocaleMonths =\n            'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n                '_'\n            ),\n        defaultLocaleMonthsShort =\n            'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n        defaultMonthsShortRegex = matchWord,\n        defaultMonthsRegex = matchWord;\n\n    function localeMonths(m, format) {\n        if (!m) {\n            return isArray(this._months)\n                ? this._months\n                : this._months['standalone'];\n        }\n        return isArray(this._months)\n            ? this._months[m.month()]\n            : this._months[\n                  (this._months.isFormat || MONTHS_IN_FORMAT).test(format)\n                      ? 'format'\n                      : 'standalone'\n              ][m.month()];\n    }\n\n    function localeMonthsShort(m, format) {\n        if (!m) {\n            return isArray(this._monthsShort)\n                ? this._monthsShort\n                : this._monthsShort['standalone'];\n        }\n        return isArray(this._monthsShort)\n            ? this._monthsShort[m.month()]\n            : this._monthsShort[\n                  MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'\n              ][m.month()];\n    }\n\n    function handleStrictParse(monthName, format, strict) {\n        var i,\n            ii,\n            mom,\n            llc = monthName.toLocaleLowerCase();\n        if (!this._monthsParse) {\n            // this is not used\n            this._monthsParse = [];\n            this._longMonthsParse = [];\n            this._shortMonthsParse = [];\n            for (i = 0; i < 12; ++i) {\n                mom = createUTC([2000, i]);\n                this._shortMonthsParse[i] = this.monthsShort(\n                    mom,\n                    ''\n                ).toLocaleLowerCase();\n                this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n            }\n        }\n\n        if (strict) {\n            if (format === 'MMM') {\n                ii = indexOf.call(this._shortMonthsParse, llc);\n                return ii !== -1 ? ii : null;\n            } else {\n                ii = indexOf.call(this._longMonthsParse, llc);\n                return ii !== -1 ? ii : null;\n            }\n        } else {\n            if (format === 'MMM') {\n                ii = indexOf.call(this._shortMonthsParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._longMonthsParse, llc);\n                return ii !== -1 ? ii : null;\n            } else {\n                ii = indexOf.call(this._longMonthsParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._shortMonthsParse, llc);\n                return ii !== -1 ? ii : null;\n            }\n        }\n    }\n\n    function localeMonthsParse(monthName, format, strict) {\n        var i, mom, regex;\n\n        if (this._monthsParseExact) {\n            return handleStrictParse.call(this, monthName, format, strict);\n        }\n\n        if (!this._monthsParse) {\n            this._monthsParse = [];\n            this._longMonthsParse = [];\n            this._shortMonthsParse = [];\n        }\n\n        // TODO: add sorting\n        // Sorting makes sure if one month (or abbr) is a prefix of another\n        // see sorting in computeMonthsParse\n        for (i = 0; i < 12; i++) {\n            // make the regex if we don't have it already\n            mom = createUTC([2000, i]);\n            if (strict && !this._longMonthsParse[i]) {\n                this._longMonthsParse[i] = new RegExp(\n                    '^' + this.months(mom, '').replace('.', '') + '$',\n                    'i'\n                );\n                this._shortMonthsParse[i] = new RegExp(\n                    '^' + this.monthsShort(mom, '').replace('.', '') + '$',\n                    'i'\n                );\n            }\n            if (!strict && !this._monthsParse[i]) {\n                regex =\n                    '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n                this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n            }\n            // test the regex\n            if (\n                strict &&\n                format === 'MMMM' &&\n                this._longMonthsParse[i].test(monthName)\n            ) {\n                return i;\n            } else if (\n                strict &&\n                format === 'MMM' &&\n                this._shortMonthsParse[i].test(monthName)\n            ) {\n                return i;\n            } else if (!strict && this._monthsParse[i].test(monthName)) {\n                return i;\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function setMonth(mom, value) {\n        var dayOfMonth;\n\n        if (!mom.isValid()) {\n            // No op\n            return mom;\n        }\n\n        if (typeof value === 'string') {\n            if (/^\\d+$/.test(value)) {\n                value = toInt(value);\n            } else {\n                value = mom.localeData().monthsParse(value);\n                // TODO: Another silent failure?\n                if (!isNumber(value)) {\n                    return mom;\n                }\n            }\n        }\n\n        dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n        mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n        return mom;\n    }\n\n    function getSetMonth(value) {\n        if (value != null) {\n            setMonth(this, value);\n            hooks.updateOffset(this, true);\n            return this;\n        } else {\n            return get(this, 'Month');\n        }\n    }\n\n    function getDaysInMonth() {\n        return daysInMonth(this.year(), this.month());\n    }\n\n    function monthsShortRegex(isStrict) {\n        if (this._monthsParseExact) {\n            if (!hasOwnProp(this, '_monthsRegex')) {\n                computeMonthsParse.call(this);\n            }\n            if (isStrict) {\n                return this._monthsShortStrictRegex;\n            } else {\n                return this._monthsShortRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_monthsShortRegex')) {\n                this._monthsShortRegex = defaultMonthsShortRegex;\n            }\n            return this._monthsShortStrictRegex && isStrict\n                ? this._monthsShortStrictRegex\n                : this._monthsShortRegex;\n        }\n    }\n\n    function monthsRegex(isStrict) {\n        if (this._monthsParseExact) {\n            if (!hasOwnProp(this, '_monthsRegex')) {\n                computeMonthsParse.call(this);\n            }\n            if (isStrict) {\n                return this._monthsStrictRegex;\n            } else {\n                return this._monthsRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_monthsRegex')) {\n                this._monthsRegex = defaultMonthsRegex;\n            }\n            return this._monthsStrictRegex && isStrict\n                ? this._monthsStrictRegex\n                : this._monthsRegex;\n        }\n    }\n\n    function computeMonthsParse() {\n        function cmpLenRev(a, b) {\n            return b.length - a.length;\n        }\n\n        var shortPieces = [],\n            longPieces = [],\n            mixedPieces = [],\n            i,\n            mom;\n        for (i = 0; i < 12; i++) {\n            // make the regex if we don't have it already\n            mom = createUTC([2000, i]);\n            shortPieces.push(this.monthsShort(mom, ''));\n            longPieces.push(this.months(mom, ''));\n            mixedPieces.push(this.months(mom, ''));\n            mixedPieces.push(this.monthsShort(mom, ''));\n        }\n        // Sorting makes sure if one month (or abbr) is a prefix of another it\n        // will match the longer piece.\n        shortPieces.sort(cmpLenRev);\n        longPieces.sort(cmpLenRev);\n        mixedPieces.sort(cmpLenRev);\n        for (i = 0; i < 12; i++) {\n            shortPieces[i] = regexEscape(shortPieces[i]);\n            longPieces[i] = regexEscape(longPieces[i]);\n        }\n        for (i = 0; i < 24; i++) {\n            mixedPieces[i] = regexEscape(mixedPieces[i]);\n        }\n\n        this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n        this._monthsShortRegex = this._monthsRegex;\n        this._monthsStrictRegex = new RegExp(\n            '^(' + longPieces.join('|') + ')',\n            'i'\n        );\n        this._monthsShortStrictRegex = new RegExp(\n            '^(' + shortPieces.join('|') + ')',\n            'i'\n        );\n    }\n\n    // FORMATTING\n\n    addFormatToken('Y', 0, 0, function () {\n        var y = this.year();\n        return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n    });\n\n    addFormatToken(0, ['YY', 2], 0, function () {\n        return this.year() % 100;\n    });\n\n    addFormatToken(0, ['YYYY', 4], 0, 'year');\n    addFormatToken(0, ['YYYYY', 5], 0, 'year');\n    addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n    // ALIASES\n\n    addUnitAlias('year', 'y');\n\n    // PRIORITIES\n\n    addUnitPriority('year', 1);\n\n    // PARSING\n\n    addRegexToken('Y', matchSigned);\n    addRegexToken('YY', match1to2, match2);\n    addRegexToken('YYYY', match1to4, match4);\n    addRegexToken('YYYYY', match1to6, match6);\n    addRegexToken('YYYYYY', match1to6, match6);\n\n    addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n    addParseToken('YYYY', function (input, array) {\n        array[YEAR] =\n            input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n    });\n    addParseToken('YY', function (input, array) {\n        array[YEAR] = hooks.parseTwoDigitYear(input);\n    });\n    addParseToken('Y', function (input, array) {\n        array[YEAR] = parseInt(input, 10);\n    });\n\n    // HELPERS\n\n    function daysInYear(year) {\n        return isLeapYear(year) ? 366 : 365;\n    }\n\n    // HOOKS\n\n    hooks.parseTwoDigitYear = function (input) {\n        return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n    };\n\n    // MOMENTS\n\n    var getSetYear = makeGetSet('FullYear', true);\n\n    function getIsLeapYear() {\n        return isLeapYear(this.year());\n    }\n\n    function createDate(y, m, d, h, M, s, ms) {\n        // can't just apply() to create a date:\n        // https://stackoverflow.com/q/181348\n        var date;\n        // the date constructor remaps years 0-99 to 1900-1999\n        if (y < 100 && y >= 0) {\n            // preserve leap years using a full 400 year cycle, then reset\n            date = new Date(y + 400, m, d, h, M, s, ms);\n            if (isFinite(date.getFullYear())) {\n                date.setFullYear(y);\n            }\n        } else {\n            date = new Date(y, m, d, h, M, s, ms);\n        }\n\n        return date;\n    }\n\n    function createUTCDate(y) {\n        var date, args;\n        // the Date.UTC function remaps years 0-99 to 1900-1999\n        if (y < 100 && y >= 0) {\n            args = Array.prototype.slice.call(arguments);\n            // preserve leap years using a full 400 year cycle, then reset\n            args[0] = y + 400;\n            date = new Date(Date.UTC.apply(null, args));\n            if (isFinite(date.getUTCFullYear())) {\n                date.setUTCFullYear(y);\n            }\n        } else {\n            date = new Date(Date.UTC.apply(null, arguments));\n        }\n\n        return date;\n    }\n\n    // start-of-first-week - start-of-year\n    function firstWeekOffset(year, dow, doy) {\n        var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n            fwd = 7 + dow - doy,\n            // first-week day local weekday -- which local weekday is fwd\n            fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n        return -fwdlw + fwd - 1;\n    }\n\n    // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n    function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n        var localWeekday = (7 + weekday - dow) % 7,\n            weekOffset = firstWeekOffset(year, dow, doy),\n            dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n            resYear,\n            resDayOfYear;\n\n        if (dayOfYear <= 0) {\n            resYear = year - 1;\n            resDayOfYear = daysInYear(resYear) + dayOfYear;\n        } else if (dayOfYear > daysInYear(year)) {\n            resYear = year + 1;\n            resDayOfYear = dayOfYear - daysInYear(year);\n        } else {\n            resYear = year;\n            resDayOfYear = dayOfYear;\n        }\n\n        return {\n            year: resYear,\n            dayOfYear: resDayOfYear,\n        };\n    }\n\n    function weekOfYear(mom, dow, doy) {\n        var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n            week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n            resWeek,\n            resYear;\n\n        if (week < 1) {\n            resYear = mom.year() - 1;\n            resWeek = week + weeksInYear(resYear, dow, doy);\n        } else if (week > weeksInYear(mom.year(), dow, doy)) {\n            resWeek = week - weeksInYear(mom.year(), dow, doy);\n            resYear = mom.year() + 1;\n        } else {\n            resYear = mom.year();\n            resWeek = week;\n        }\n\n        return {\n            week: resWeek,\n            year: resYear,\n        };\n    }\n\n    function weeksInYear(year, dow, doy) {\n        var weekOffset = firstWeekOffset(year, dow, doy),\n            weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n        return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n    }\n\n    // FORMATTING\n\n    addFormatToken('w', ['ww', 2], 'wo', 'week');\n    addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n    // ALIASES\n\n    addUnitAlias('week', 'w');\n    addUnitAlias('isoWeek', 'W');\n\n    // PRIORITIES\n\n    addUnitPriority('week', 5);\n    addUnitPriority('isoWeek', 5);\n\n    // PARSING\n\n    addRegexToken('w', match1to2);\n    addRegexToken('ww', match1to2, match2);\n    addRegexToken('W', match1to2);\n    addRegexToken('WW', match1to2, match2);\n\n    addWeekParseToken(\n        ['w', 'ww', 'W', 'WW'],\n        function (input, week, config, token) {\n            week[token.substr(0, 1)] = toInt(input);\n        }\n    );\n\n    // HELPERS\n\n    // LOCALES\n\n    function localeWeek(mom) {\n        return weekOfYear(mom, this._week.dow, this._week.doy).week;\n    }\n\n    var defaultLocaleWeek = {\n        dow: 0, // Sunday is the first day of the week.\n        doy: 6, // The week that contains Jan 6th is the first week of the year.\n    };\n\n    function localeFirstDayOfWeek() {\n        return this._week.dow;\n    }\n\n    function localeFirstDayOfYear() {\n        return this._week.doy;\n    }\n\n    // MOMENTS\n\n    function getSetWeek(input) {\n        var week = this.localeData().week(this);\n        return input == null ? week : this.add((input - week) * 7, 'd');\n    }\n\n    function getSetISOWeek(input) {\n        var week = weekOfYear(this, 1, 4).week;\n        return input == null ? week : this.add((input - week) * 7, 'd');\n    }\n\n    // FORMATTING\n\n    addFormatToken('d', 0, 'do', 'day');\n\n    addFormatToken('dd', 0, 0, function (format) {\n        return this.localeData().weekdaysMin(this, format);\n    });\n\n    addFormatToken('ddd', 0, 0, function (format) {\n        return this.localeData().weekdaysShort(this, format);\n    });\n\n    addFormatToken('dddd', 0, 0, function (format) {\n        return this.localeData().weekdays(this, format);\n    });\n\n    addFormatToken('e', 0, 0, 'weekday');\n    addFormatToken('E', 0, 0, 'isoWeekday');\n\n    // ALIASES\n\n    addUnitAlias('day', 'd');\n    addUnitAlias('weekday', 'e');\n    addUnitAlias('isoWeekday', 'E');\n\n    // PRIORITY\n    addUnitPriority('day', 11);\n    addUnitPriority('weekday', 11);\n    addUnitPriority('isoWeekday', 11);\n\n    // PARSING\n\n    addRegexToken('d', match1to2);\n    addRegexToken('e', match1to2);\n    addRegexToken('E', match1to2);\n    addRegexToken('dd', function (isStrict, locale) {\n        return locale.weekdaysMinRegex(isStrict);\n    });\n    addRegexToken('ddd', function (isStrict, locale) {\n        return locale.weekdaysShortRegex(isStrict);\n    });\n    addRegexToken('dddd', function (isStrict, locale) {\n        return locale.weekdaysRegex(isStrict);\n    });\n\n    addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n        var weekday = config._locale.weekdaysParse(input, token, config._strict);\n        // if we didn't get a weekday name, mark the date as invalid\n        if (weekday != null) {\n            week.d = weekday;\n        } else {\n            getParsingFlags(config).invalidWeekday = input;\n        }\n    });\n\n    addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n        week[token] = toInt(input);\n    });\n\n    // HELPERS\n\n    function parseWeekday(input, locale) {\n        if (typeof input !== 'string') {\n            return input;\n        }\n\n        if (!isNaN(input)) {\n            return parseInt(input, 10);\n        }\n\n        input = locale.weekdaysParse(input);\n        if (typeof input === 'number') {\n            return input;\n        }\n\n        return null;\n    }\n\n    function parseIsoWeekday(input, locale) {\n        if (typeof input === 'string') {\n            return locale.weekdaysParse(input) % 7 || 7;\n        }\n        return isNaN(input) ? null : input;\n    }\n\n    // LOCALES\n    function shiftWeekdays(ws, n) {\n        return ws.slice(n, 7).concat(ws.slice(0, n));\n    }\n\n    var defaultLocaleWeekdays =\n            'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        defaultWeekdaysRegex = matchWord,\n        defaultWeekdaysShortRegex = matchWord,\n        defaultWeekdaysMinRegex = matchWord;\n\n    function localeWeekdays(m, format) {\n        var weekdays = isArray(this._weekdays)\n            ? this._weekdays\n            : this._weekdays[\n                  m && m !== true && this._weekdays.isFormat.test(format)\n                      ? 'format'\n                      : 'standalone'\n              ];\n        return m === true\n            ? shiftWeekdays(weekdays, this._week.dow)\n            : m\n            ? weekdays[m.day()]\n            : weekdays;\n    }\n\n    function localeWeekdaysShort(m) {\n        return m === true\n            ? shiftWeekdays(this._weekdaysShort, this._week.dow)\n            : m\n            ? this._weekdaysShort[m.day()]\n            : this._weekdaysShort;\n    }\n\n    function localeWeekdaysMin(m) {\n        return m === true\n            ? shiftWeekdays(this._weekdaysMin, this._week.dow)\n            : m\n            ? this._weekdaysMin[m.day()]\n            : this._weekdaysMin;\n    }\n\n    function handleStrictParse$1(weekdayName, format, strict) {\n        var i,\n            ii,\n            mom,\n            llc = weekdayName.toLocaleLowerCase();\n        if (!this._weekdaysParse) {\n            this._weekdaysParse = [];\n            this._shortWeekdaysParse = [];\n            this._minWeekdaysParse = [];\n\n            for (i = 0; i < 7; ++i) {\n                mom = createUTC([2000, 1]).day(i);\n                this._minWeekdaysParse[i] = this.weekdaysMin(\n                    mom,\n                    ''\n                ).toLocaleLowerCase();\n                this._shortWeekdaysParse[i] = this.weekdaysShort(\n                    mom,\n                    ''\n                ).toLocaleLowerCase();\n                this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n            }\n        }\n\n        if (strict) {\n            if (format === 'dddd') {\n                ii = indexOf.call(this._weekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            } else if (format === 'ddd') {\n                ii = indexOf.call(this._shortWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            } else {\n                ii = indexOf.call(this._minWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            }\n        } else {\n            if (format === 'dddd') {\n                ii = indexOf.call(this._weekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._shortWeekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._minWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            } else if (format === 'ddd') {\n                ii = indexOf.call(this._shortWeekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._weekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._minWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            } else {\n                ii = indexOf.call(this._minWeekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._weekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._shortWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            }\n        }\n    }\n\n    function localeWeekdaysParse(weekdayName, format, strict) {\n        var i, mom, regex;\n\n        if (this._weekdaysParseExact) {\n            return handleStrictParse$1.call(this, weekdayName, format, strict);\n        }\n\n        if (!this._weekdaysParse) {\n            this._weekdaysParse = [];\n            this._minWeekdaysParse = [];\n            this._shortWeekdaysParse = [];\n            this._fullWeekdaysParse = [];\n        }\n\n        for (i = 0; i < 7; i++) {\n            // make the regex if we don't have it already\n\n            mom = createUTC([2000, 1]).day(i);\n            if (strict && !this._fullWeekdaysParse[i]) {\n                this._fullWeekdaysParse[i] = new RegExp(\n                    '^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$',\n                    'i'\n                );\n                this._shortWeekdaysParse[i] = new RegExp(\n                    '^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$',\n                    'i'\n                );\n                this._minWeekdaysParse[i] = new RegExp(\n                    '^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$',\n                    'i'\n                );\n            }\n            if (!this._weekdaysParse[i]) {\n                regex =\n                    '^' +\n                    this.weekdays(mom, '') +\n                    '|^' +\n                    this.weekdaysShort(mom, '') +\n                    '|^' +\n                    this.weekdaysMin(mom, '');\n                this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n            }\n            // test the regex\n            if (\n                strict &&\n                format === 'dddd' &&\n                this._fullWeekdaysParse[i].test(weekdayName)\n            ) {\n                return i;\n            } else if (\n                strict &&\n                format === 'ddd' &&\n                this._shortWeekdaysParse[i].test(weekdayName)\n            ) {\n                return i;\n            } else if (\n                strict &&\n                format === 'dd' &&\n                this._minWeekdaysParse[i].test(weekdayName)\n            ) {\n                return i;\n            } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n                return i;\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function getSetDayOfWeek(input) {\n        if (!this.isValid()) {\n            return input != null ? this : NaN;\n        }\n        var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n        if (input != null) {\n            input = parseWeekday(input, this.localeData());\n            return this.add(input - day, 'd');\n        } else {\n            return day;\n        }\n    }\n\n    function getSetLocaleDayOfWeek(input) {\n        if (!this.isValid()) {\n            return input != null ? this : NaN;\n        }\n        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n        return input == null ? weekday : this.add(input - weekday, 'd');\n    }\n\n    function getSetISODayOfWeek(input) {\n        if (!this.isValid()) {\n            return input != null ? this : NaN;\n        }\n\n        // behaves the same as moment#day except\n        // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n        // as a setter, sunday should belong to the previous week.\n\n        if (input != null) {\n            var weekday = parseIsoWeekday(input, this.localeData());\n            return this.day(this.day() % 7 ? weekday : weekday - 7);\n        } else {\n            return this.day() || 7;\n        }\n    }\n\n    function weekdaysRegex(isStrict) {\n        if (this._weekdaysParseExact) {\n            if (!hasOwnProp(this, '_weekdaysRegex')) {\n                computeWeekdaysParse.call(this);\n            }\n            if (isStrict) {\n                return this._weekdaysStrictRegex;\n            } else {\n                return this._weekdaysRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_weekdaysRegex')) {\n                this._weekdaysRegex = defaultWeekdaysRegex;\n            }\n            return this._weekdaysStrictRegex && isStrict\n                ? this._weekdaysStrictRegex\n                : this._weekdaysRegex;\n        }\n    }\n\n    function weekdaysShortRegex(isStrict) {\n        if (this._weekdaysParseExact) {\n            if (!hasOwnProp(this, '_weekdaysRegex')) {\n                computeWeekdaysParse.call(this);\n            }\n            if (isStrict) {\n                return this._weekdaysShortStrictRegex;\n            } else {\n                return this._weekdaysShortRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n                this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n            }\n            return this._weekdaysShortStrictRegex && isStrict\n                ? this._weekdaysShortStrictRegex\n                : this._weekdaysShortRegex;\n        }\n    }\n\n    function weekdaysMinRegex(isStrict) {\n        if (this._weekdaysParseExact) {\n            if (!hasOwnProp(this, '_weekdaysRegex')) {\n                computeWeekdaysParse.call(this);\n            }\n            if (isStrict) {\n                return this._weekdaysMinStrictRegex;\n            } else {\n                return this._weekdaysMinRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n                this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n            }\n            return this._weekdaysMinStrictRegex && isStrict\n                ? this._weekdaysMinStrictRegex\n                : this._weekdaysMinRegex;\n        }\n    }\n\n    function computeWeekdaysParse() {\n        function cmpLenRev(a, b) {\n            return b.length - a.length;\n        }\n\n        var minPieces = [],\n            shortPieces = [],\n            longPieces = [],\n            mixedPieces = [],\n            i,\n            mom,\n            minp,\n            shortp,\n            longp;\n        for (i = 0; i < 7; i++) {\n            // make the regex if we don't have it already\n            mom = createUTC([2000, 1]).day(i);\n            minp = regexEscape(this.weekdaysMin(mom, ''));\n            shortp = regexEscape(this.weekdaysShort(mom, ''));\n            longp = regexEscape(this.weekdays(mom, ''));\n            minPieces.push(minp);\n            shortPieces.push(shortp);\n            longPieces.push(longp);\n            mixedPieces.push(minp);\n            mixedPieces.push(shortp);\n            mixedPieces.push(longp);\n        }\n        // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n        // will match the longer piece.\n        minPieces.sort(cmpLenRev);\n        shortPieces.sort(cmpLenRev);\n        longPieces.sort(cmpLenRev);\n        mixedPieces.sort(cmpLenRev);\n\n        this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n        this._weekdaysShortRegex = this._weekdaysRegex;\n        this._weekdaysMinRegex = this._weekdaysRegex;\n\n        this._weekdaysStrictRegex = new RegExp(\n            '^(' + longPieces.join('|') + ')',\n            'i'\n        );\n        this._weekdaysShortStrictRegex = new RegExp(\n            '^(' + shortPieces.join('|') + ')',\n            'i'\n        );\n        this._weekdaysMinStrictRegex = new RegExp(\n            '^(' + minPieces.join('|') + ')',\n            'i'\n        );\n    }\n\n    // FORMATTING\n\n    function hFormat() {\n        return this.hours() % 12 || 12;\n    }\n\n    function kFormat() {\n        return this.hours() || 24;\n    }\n\n    addFormatToken('H', ['HH', 2], 0, 'hour');\n    addFormatToken('h', ['hh', 2], 0, hFormat);\n    addFormatToken('k', ['kk', 2], 0, kFormat);\n\n    addFormatToken('hmm', 0, 0, function () {\n        return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n    });\n\n    addFormatToken('hmmss', 0, 0, function () {\n        return (\n            '' +\n            hFormat.apply(this) +\n            zeroFill(this.minutes(), 2) +\n            zeroFill(this.seconds(), 2)\n        );\n    });\n\n    addFormatToken('Hmm', 0, 0, function () {\n        return '' + this.hours() + zeroFill(this.minutes(), 2);\n    });\n\n    addFormatToken('Hmmss', 0, 0, function () {\n        return (\n            '' +\n            this.hours() +\n            zeroFill(this.minutes(), 2) +\n            zeroFill(this.seconds(), 2)\n        );\n    });\n\n    function meridiem(token, lowercase) {\n        addFormatToken(token, 0, 0, function () {\n            return this.localeData().meridiem(\n                this.hours(),\n                this.minutes(),\n                lowercase\n            );\n        });\n    }\n\n    meridiem('a', true);\n    meridiem('A', false);\n\n    // ALIASES\n\n    addUnitAlias('hour', 'h');\n\n    // PRIORITY\n    addUnitPriority('hour', 13);\n\n    // PARSING\n\n    function matchMeridiem(isStrict, locale) {\n        return locale._meridiemParse;\n    }\n\n    addRegexToken('a', matchMeridiem);\n    addRegexToken('A', matchMeridiem);\n    addRegexToken('H', match1to2);\n    addRegexToken('h', match1to2);\n    addRegexToken('k', match1to2);\n    addRegexToken('HH', match1to2, match2);\n    addRegexToken('hh', match1to2, match2);\n    addRegexToken('kk', match1to2, match2);\n\n    addRegexToken('hmm', match3to4);\n    addRegexToken('hmmss', match5to6);\n    addRegexToken('Hmm', match3to4);\n    addRegexToken('Hmmss', match5to6);\n\n    addParseToken(['H', 'HH'], HOUR);\n    addParseToken(['k', 'kk'], function (input, array, config) {\n        var kInput = toInt(input);\n        array[HOUR] = kInput === 24 ? 0 : kInput;\n    });\n    addParseToken(['a', 'A'], function (input, array, config) {\n        config._isPm = config._locale.isPM(input);\n        config._meridiem = input;\n    });\n    addParseToken(['h', 'hh'], function (input, array, config) {\n        array[HOUR] = toInt(input);\n        getParsingFlags(config).bigHour = true;\n    });\n    addParseToken('hmm', function (input, array, config) {\n        var pos = input.length - 2;\n        array[HOUR] = toInt(input.substr(0, pos));\n        array[MINUTE] = toInt(input.substr(pos));\n        getParsingFlags(config).bigHour = true;\n    });\n    addParseToken('hmmss', function (input, array, config) {\n        var pos1 = input.length - 4,\n            pos2 = input.length - 2;\n        array[HOUR] = toInt(input.substr(0, pos1));\n        array[MINUTE] = toInt(input.substr(pos1, 2));\n        array[SECOND] = toInt(input.substr(pos2));\n        getParsingFlags(config).bigHour = true;\n    });\n    addParseToken('Hmm', function (input, array, config) {\n        var pos = input.length - 2;\n        array[HOUR] = toInt(input.substr(0, pos));\n        array[MINUTE] = toInt(input.substr(pos));\n    });\n    addParseToken('Hmmss', function (input, array, config) {\n        var pos1 = input.length - 4,\n            pos2 = input.length - 2;\n        array[HOUR] = toInt(input.substr(0, pos1));\n        array[MINUTE] = toInt(input.substr(pos1, 2));\n        array[SECOND] = toInt(input.substr(pos2));\n    });\n\n    // LOCALES\n\n    function localeIsPM(input) {\n        // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n        // Using charAt should be more compatible.\n        return (input + '').toLowerCase().charAt(0) === 'p';\n    }\n\n    var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n        // Setting the hour should keep the time, because the user explicitly\n        // specified which hour they want. So trying to maintain the same hour (in\n        // a new timezone) makes sense. Adding/subtracting hours does not follow\n        // this rule.\n        getSetHour = makeGetSet('Hours', true);\n\n    function localeMeridiem(hours, minutes, isLower) {\n        if (hours > 11) {\n            return isLower ? 'pm' : 'PM';\n        } else {\n            return isLower ? 'am' : 'AM';\n        }\n    }\n\n    var baseConfig = {\n        calendar: defaultCalendar,\n        longDateFormat: defaultLongDateFormat,\n        invalidDate: defaultInvalidDate,\n        ordinal: defaultOrdinal,\n        dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n        relativeTime: defaultRelativeTime,\n\n        months: defaultLocaleMonths,\n        monthsShort: defaultLocaleMonthsShort,\n\n        week: defaultLocaleWeek,\n\n        weekdays: defaultLocaleWeekdays,\n        weekdaysMin: defaultLocaleWeekdaysMin,\n        weekdaysShort: defaultLocaleWeekdaysShort,\n\n        meridiemParse: defaultLocaleMeridiemParse,\n    };\n\n    // internal storage for locale config files\n    var locales = {},\n        localeFamilies = {},\n        globalLocale;\n\n    function commonPrefix(arr1, arr2) {\n        var i,\n            minl = Math.min(arr1.length, arr2.length);\n        for (i = 0; i < minl; i += 1) {\n            if (arr1[i] !== arr2[i]) {\n                return i;\n            }\n        }\n        return minl;\n    }\n\n    function normalizeLocale(key) {\n        return key ? key.toLowerCase().replace('_', '-') : key;\n    }\n\n    // pick the locale from the array\n    // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n    // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n    function chooseLocale(names) {\n        var i = 0,\n            j,\n            next,\n            locale,\n            split;\n\n        while (i < names.length) {\n            split = normalizeLocale(names[i]).split('-');\n            j = split.length;\n            next = normalizeLocale(names[i + 1]);\n            next = next ? next.split('-') : null;\n            while (j > 0) {\n                locale = loadLocale(split.slice(0, j).join('-'));\n                if (locale) {\n                    return locale;\n                }\n                if (\n                    next &&\n                    next.length >= j &&\n                    commonPrefix(split, next) >= j - 1\n                ) {\n                    //the next array item is better than a shallower substring of this one\n                    break;\n                }\n                j--;\n            }\n            i++;\n        }\n        return globalLocale;\n    }\n\n    function isLocaleNameSane(name) {\n        // Prevent names that look like filesystem paths, i.e contain '/' or '\\'\n        return name.match('^[^/\\\\\\\\]*$') != null;\n    }\n\n    function loadLocale(name) {\n        var oldLocale = null,\n            aliasedRequire;\n        // TODO: Find a better way to register and load all the locales in Node\n        if (\n            locales[name] === undefined &&\n            \"object\" !== 'undefined' &&\n            module &&\n            module.exports &&\n            isLocaleNameSane(name)\n        ) {\n            try {\n                oldLocale = globalLocale._abbr;\n                aliasedRequire = undefined;\n                __webpack_require__(\"./node_modules/moment/locale sync recursive ^\\\\.\\\\/.*$\")(\"./\" + name);\n                getSetGlobalLocale(oldLocale);\n            } catch (e) {\n                // mark as not found to avoid repeating expensive file require call causing high CPU\n                // when trying to find en-US, en_US, en-us for every format call\n                locales[name] = null; // null means not found\n            }\n        }\n        return locales[name];\n    }\n\n    // This function will load locale and then set the global locale.  If\n    // no arguments are passed in, it will simply return the current global\n    // locale key.\n    function getSetGlobalLocale(key, values) {\n        var data;\n        if (key) {\n            if (isUndefined(values)) {\n                data = getLocale(key);\n            } else {\n                data = defineLocale(key, values);\n            }\n\n            if (data) {\n                // moment.duration._locale = moment._locale = data;\n                globalLocale = data;\n            } else {\n                if (typeof console !== 'undefined' && console.warn) {\n                    //warn user if arguments are passed but the locale could not be set\n                    console.warn(\n                        'Locale ' + key + ' not found. Did you forget to load it?'\n                    );\n                }\n            }\n        }\n\n        return globalLocale._abbr;\n    }\n\n    function defineLocale(name, config) {\n        if (config !== null) {\n            var locale,\n                parentConfig = baseConfig;\n            config.abbr = name;\n            if (locales[name] != null) {\n                deprecateSimple(\n                    'defineLocaleOverride',\n                    'use moment.updateLocale(localeName, config) to change ' +\n                        'an existing locale. moment.defineLocale(localeName, ' +\n                        'config) should only be used for creating a new locale ' +\n                        'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'\n                );\n                parentConfig = locales[name]._config;\n            } else if (config.parentLocale != null) {\n                if (locales[config.parentLocale] != null) {\n                    parentConfig = locales[config.parentLocale]._config;\n                } else {\n                    locale = loadLocale(config.parentLocale);\n                    if (locale != null) {\n                        parentConfig = locale._config;\n                    } else {\n                        if (!localeFamilies[config.parentLocale]) {\n                            localeFamilies[config.parentLocale] = [];\n                        }\n                        localeFamilies[config.parentLocale].push({\n                            name: name,\n                            config: config,\n                        });\n                        return null;\n                    }\n                }\n            }\n            locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n            if (localeFamilies[name]) {\n                localeFamilies[name].forEach(function (x) {\n                    defineLocale(x.name, x.config);\n                });\n            }\n\n            // backwards compat for now: also set the locale\n            // make sure we set the locale AFTER all child locales have been\n            // created, so we won't end up with the child locale set.\n            getSetGlobalLocale(name);\n\n            return locales[name];\n        } else {\n            // useful for testing\n            delete locales[name];\n            return null;\n        }\n    }\n\n    function updateLocale(name, config) {\n        if (config != null) {\n            var locale,\n                tmpLocale,\n                parentConfig = baseConfig;\n\n            if (locales[name] != null && locales[name].parentLocale != null) {\n                // Update existing child locale in-place to avoid memory-leaks\n                locales[name].set(mergeConfigs(locales[name]._config, config));\n            } else {\n                // MERGE\n                tmpLocale = loadLocale(name);\n                if (tmpLocale != null) {\n                    parentConfig = tmpLocale._config;\n                }\n                config = mergeConfigs(parentConfig, config);\n                if (tmpLocale == null) {\n                    // updateLocale is called for creating a new locale\n                    // Set abbr so it will have a name (getters return\n                    // undefined otherwise).\n                    config.abbr = name;\n                }\n                locale = new Locale(config);\n                locale.parentLocale = locales[name];\n                locales[name] = locale;\n            }\n\n            // backwards compat for now: also set the locale\n            getSetGlobalLocale(name);\n        } else {\n            // pass null for config to unupdate, useful for tests\n            if (locales[name] != null) {\n                if (locales[name].parentLocale != null) {\n                    locales[name] = locales[name].parentLocale;\n                    if (name === getSetGlobalLocale()) {\n                        getSetGlobalLocale(name);\n                    }\n                } else if (locales[name] != null) {\n                    delete locales[name];\n                }\n            }\n        }\n        return locales[name];\n    }\n\n    // returns locale data\n    function getLocale(key) {\n        var locale;\n\n        if (key && key._locale && key._locale._abbr) {\n            key = key._locale._abbr;\n        }\n\n        if (!key) {\n            return globalLocale;\n        }\n\n        if (!isArray(key)) {\n            //short-circuit everything else\n            locale = loadLocale(key);\n            if (locale) {\n                return locale;\n            }\n            key = [key];\n        }\n\n        return chooseLocale(key);\n    }\n\n    function listLocales() {\n        return keys(locales);\n    }\n\n    function checkOverflow(m) {\n        var overflow,\n            a = m._a;\n\n        if (a && getParsingFlags(m).overflow === -2) {\n            overflow =\n                a[MONTH] < 0 || a[MONTH] > 11\n                    ? MONTH\n                    : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])\n                    ? DATE\n                    : a[HOUR] < 0 ||\n                      a[HOUR] > 24 ||\n                      (a[HOUR] === 24 &&\n                          (a[MINUTE] !== 0 ||\n                              a[SECOND] !== 0 ||\n                              a[MILLISECOND] !== 0))\n                    ? HOUR\n                    : a[MINUTE] < 0 || a[MINUTE] > 59\n                    ? MINUTE\n                    : a[SECOND] < 0 || a[SECOND] > 59\n                    ? SECOND\n                    : a[MILLISECOND] < 0 || a[MILLISECOND] > 999\n                    ? MILLISECOND\n                    : -1;\n\n            if (\n                getParsingFlags(m)._overflowDayOfYear &&\n                (overflow < YEAR || overflow > DATE)\n            ) {\n                overflow = DATE;\n            }\n            if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n                overflow = WEEK;\n            }\n            if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n                overflow = WEEKDAY;\n            }\n\n            getParsingFlags(m).overflow = overflow;\n        }\n\n        return m;\n    }\n\n    // iso 8601 regex\n    // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n    var extendedIsoRegex =\n            /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n        basicIsoRegex =\n            /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n        tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n        isoDates = [\n            ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n            ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n            ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n            ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n            ['YYYY-DDD', /\\d{4}-\\d{3}/],\n            ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n            ['YYYYYYMMDD', /[+-]\\d{10}/],\n            ['YYYYMMDD', /\\d{8}/],\n            ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n            ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n            ['YYYYDDD', /\\d{7}/],\n            ['YYYYMM', /\\d{6}/, false],\n            ['YYYY', /\\d{4}/, false],\n        ],\n        // iso time formats and regexes\n        isoTimes = [\n            ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n            ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n            ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n            ['HH:mm', /\\d\\d:\\d\\d/],\n            ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n            ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n            ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n            ['HHmm', /\\d\\d\\d\\d/],\n            ['HH', /\\d\\d/],\n        ],\n        aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n        // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n        rfc2822 =\n            /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n        obsOffsets = {\n            UT: 0,\n            GMT: 0,\n            EDT: -4 * 60,\n            EST: -5 * 60,\n            CDT: -5 * 60,\n            CST: -6 * 60,\n            MDT: -6 * 60,\n            MST: -7 * 60,\n            PDT: -7 * 60,\n            PST: -8 * 60,\n        };\n\n    // date from iso format\n    function configFromISO(config) {\n        var i,\n            l,\n            string = config._i,\n            match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n            allowTime,\n            dateFormat,\n            timeFormat,\n            tzFormat,\n            isoDatesLen = isoDates.length,\n            isoTimesLen = isoTimes.length;\n\n        if (match) {\n            getParsingFlags(config).iso = true;\n            for (i = 0, l = isoDatesLen; i < l; i++) {\n                if (isoDates[i][1].exec(match[1])) {\n                    dateFormat = isoDates[i][0];\n                    allowTime = isoDates[i][2] !== false;\n                    break;\n                }\n            }\n            if (dateFormat == null) {\n                config._isValid = false;\n                return;\n            }\n            if (match[3]) {\n                for (i = 0, l = isoTimesLen; i < l; i++) {\n                    if (isoTimes[i][1].exec(match[3])) {\n                        // match[2] should be 'T' or space\n                        timeFormat = (match[2] || ' ') + isoTimes[i][0];\n                        break;\n                    }\n                }\n                if (timeFormat == null) {\n                    config._isValid = false;\n                    return;\n                }\n            }\n            if (!allowTime && timeFormat != null) {\n                config._isValid = false;\n                return;\n            }\n            if (match[4]) {\n                if (tzRegex.exec(match[4])) {\n                    tzFormat = 'Z';\n                } else {\n                    config._isValid = false;\n                    return;\n                }\n            }\n            config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n            configFromStringAndFormat(config);\n        } else {\n            config._isValid = false;\n        }\n    }\n\n    function extractFromRFC2822Strings(\n        yearStr,\n        monthStr,\n        dayStr,\n        hourStr,\n        minuteStr,\n        secondStr\n    ) {\n        var result = [\n            untruncateYear(yearStr),\n            defaultLocaleMonthsShort.indexOf(monthStr),\n            parseInt(dayStr, 10),\n            parseInt(hourStr, 10),\n            parseInt(minuteStr, 10),\n        ];\n\n        if (secondStr) {\n            result.push(parseInt(secondStr, 10));\n        }\n\n        return result;\n    }\n\n    function untruncateYear(yearStr) {\n        var year = parseInt(yearStr, 10);\n        if (year <= 49) {\n            return 2000 + year;\n        } else if (year <= 999) {\n            return 1900 + year;\n        }\n        return year;\n    }\n\n    function preprocessRFC2822(s) {\n        // Remove comments and folding whitespace and replace multiple-spaces with a single space\n        return s\n            .replace(/\\([^()]*\\)|[\\n\\t]/g, ' ')\n            .replace(/(\\s\\s+)/g, ' ')\n            .replace(/^\\s\\s*/, '')\n            .replace(/\\s\\s*$/, '');\n    }\n\n    function checkWeekday(weekdayStr, parsedInput, config) {\n        if (weekdayStr) {\n            // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n            var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n                weekdayActual = new Date(\n                    parsedInput[0],\n                    parsedInput[1],\n                    parsedInput[2]\n                ).getDay();\n            if (weekdayProvided !== weekdayActual) {\n                getParsingFlags(config).weekdayMismatch = true;\n                config._isValid = false;\n                return false;\n            }\n        }\n        return true;\n    }\n\n    function calculateOffset(obsOffset, militaryOffset, numOffset) {\n        if (obsOffset) {\n            return obsOffsets[obsOffset];\n        } else if (militaryOffset) {\n            // the only allowed military tz is Z\n            return 0;\n        } else {\n            var hm = parseInt(numOffset, 10),\n                m = hm % 100,\n                h = (hm - m) / 100;\n            return h * 60 + m;\n        }\n    }\n\n    // date and time from ref 2822 format\n    function configFromRFC2822(config) {\n        var match = rfc2822.exec(preprocessRFC2822(config._i)),\n            parsedArray;\n        if (match) {\n            parsedArray = extractFromRFC2822Strings(\n                match[4],\n                match[3],\n                match[2],\n                match[5],\n                match[6],\n                match[7]\n            );\n            if (!checkWeekday(match[1], parsedArray, config)) {\n                return;\n            }\n\n            config._a = parsedArray;\n            config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n            config._d = createUTCDate.apply(null, config._a);\n            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n            getParsingFlags(config).rfc2822 = true;\n        } else {\n            config._isValid = false;\n        }\n    }\n\n    // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\n    function configFromString(config) {\n        var matched = aspNetJsonRegex.exec(config._i);\n        if (matched !== null) {\n            config._d = new Date(+matched[1]);\n            return;\n        }\n\n        configFromISO(config);\n        if (config._isValid === false) {\n            delete config._isValid;\n        } else {\n            return;\n        }\n\n        configFromRFC2822(config);\n        if (config._isValid === false) {\n            delete config._isValid;\n        } else {\n            return;\n        }\n\n        if (config._strict) {\n            config._isValid = false;\n        } else {\n            // Final attempt, use Input Fallback\n            hooks.createFromInputFallback(config);\n        }\n    }\n\n    hooks.createFromInputFallback = deprecate(\n        'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n            'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n            'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n        function (config) {\n            config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n        }\n    );\n\n    // Pick the first defined of two or three arguments.\n    function defaults(a, b, c) {\n        if (a != null) {\n            return a;\n        }\n        if (b != null) {\n            return b;\n        }\n        return c;\n    }\n\n    function currentDateArray(config) {\n        // hooks is actually the exported moment object\n        var nowValue = new Date(hooks.now());\n        if (config._useUTC) {\n            return [\n                nowValue.getUTCFullYear(),\n                nowValue.getUTCMonth(),\n                nowValue.getUTCDate(),\n            ];\n        }\n        return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n    }\n\n    // convert an array to a date.\n    // the array should mirror the parameters below\n    // note: all values past the year are optional and will default to the lowest possible value.\n    // [year, month, day , hour, minute, second, millisecond]\n    function configFromArray(config) {\n        var i,\n            date,\n            input = [],\n            currentDate,\n            expectedWeekday,\n            yearToUse;\n\n        if (config._d) {\n            return;\n        }\n\n        currentDate = currentDateArray(config);\n\n        //compute day of the year from weeks and weekdays\n        if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n            dayOfYearFromWeekInfo(config);\n        }\n\n        //if the day of the year is set, figure out what it is\n        if (config._dayOfYear != null) {\n            yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n            if (\n                config._dayOfYear > daysInYear(yearToUse) ||\n                config._dayOfYear === 0\n            ) {\n                getParsingFlags(config)._overflowDayOfYear = true;\n            }\n\n            date = createUTCDate(yearToUse, 0, config._dayOfYear);\n            config._a[MONTH] = date.getUTCMonth();\n            config._a[DATE] = date.getUTCDate();\n        }\n\n        // Default to current date.\n        // * if no year, month, day of month are given, default to today\n        // * if day of month is given, default month and year\n        // * if month is given, default only year\n        // * if year is given, don't default anything\n        for (i = 0; i < 3 && config._a[i] == null; ++i) {\n            config._a[i] = input[i] = currentDate[i];\n        }\n\n        // Zero out whatever was not defaulted, including time\n        for (; i < 7; i++) {\n            config._a[i] = input[i] =\n                config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];\n        }\n\n        // Check for 24:00:00.000\n        if (\n            config._a[HOUR] === 24 &&\n            config._a[MINUTE] === 0 &&\n            config._a[SECOND] === 0 &&\n            config._a[MILLISECOND] === 0\n        ) {\n            config._nextDay = true;\n            config._a[HOUR] = 0;\n        }\n\n        config._d = (config._useUTC ? createUTCDate : createDate).apply(\n            null,\n            input\n        );\n        expectedWeekday = config._useUTC\n            ? config._d.getUTCDay()\n            : config._d.getDay();\n\n        // Apply timezone offset from input. The actual utcOffset can be changed\n        // with parseZone.\n        if (config._tzm != null) {\n            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n        }\n\n        if (config._nextDay) {\n            config._a[HOUR] = 24;\n        }\n\n        // check for mismatching day of week\n        if (\n            config._w &&\n            typeof config._w.d !== 'undefined' &&\n            config._w.d !== expectedWeekday\n        ) {\n            getParsingFlags(config).weekdayMismatch = true;\n        }\n    }\n\n    function dayOfYearFromWeekInfo(config) {\n        var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n\n        w = config._w;\n        if (w.GG != null || w.W != null || w.E != null) {\n            dow = 1;\n            doy = 4;\n\n            // TODO: We need to take the current isoWeekYear, but that depends on\n            // how we interpret now (local, utc, fixed offset). So create\n            // a now version of current config (take local/utc/offset flags, and\n            // create now).\n            weekYear = defaults(\n                w.GG,\n                config._a[YEAR],\n                weekOfYear(createLocal(), 1, 4).year\n            );\n            week = defaults(w.W, 1);\n            weekday = defaults(w.E, 1);\n            if (weekday < 1 || weekday > 7) {\n                weekdayOverflow = true;\n            }\n        } else {\n            dow = config._locale._week.dow;\n            doy = config._locale._week.doy;\n\n            curWeek = weekOfYear(createLocal(), dow, doy);\n\n            weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n            // Default to current week.\n            week = defaults(w.w, curWeek.week);\n\n            if (w.d != null) {\n                // weekday -- low day numbers are considered next week\n                weekday = w.d;\n                if (weekday < 0 || weekday > 6) {\n                    weekdayOverflow = true;\n                }\n            } else if (w.e != null) {\n                // local weekday -- counting starts from beginning of week\n                weekday = w.e + dow;\n                if (w.e < 0 || w.e > 6) {\n                    weekdayOverflow = true;\n                }\n            } else {\n                // default to beginning of week\n                weekday = dow;\n            }\n        }\n        if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n            getParsingFlags(config)._overflowWeeks = true;\n        } else if (weekdayOverflow != null) {\n            getParsingFlags(config)._overflowWeekday = true;\n        } else {\n            temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n            config._a[YEAR] = temp.year;\n            config._dayOfYear = temp.dayOfYear;\n        }\n    }\n\n    // constant that refers to the ISO standard\n    hooks.ISO_8601 = function () {};\n\n    // constant that refers to the RFC 2822 form\n    hooks.RFC_2822 = function () {};\n\n    // date from string and format string\n    function configFromStringAndFormat(config) {\n        // TODO: Move this to another part of the creation flow to prevent circular deps\n        if (config._f === hooks.ISO_8601) {\n            configFromISO(config);\n            return;\n        }\n        if (config._f === hooks.RFC_2822) {\n            configFromRFC2822(config);\n            return;\n        }\n        config._a = [];\n        getParsingFlags(config).empty = true;\n\n        // This array is used to make a Date, either with `new Date` or `Date.UTC`\n        var string = '' + config._i,\n            i,\n            parsedInput,\n            tokens,\n            token,\n            skipped,\n            stringLength = string.length,\n            totalParsedInputLength = 0,\n            era,\n            tokenLen;\n\n        tokens =\n            expandFormat(config._f, config._locale).match(formattingTokens) || [];\n        tokenLen = tokens.length;\n        for (i = 0; i < tokenLen; i++) {\n            token = tokens[i];\n            parsedInput = (string.match(getParseRegexForToken(token, config)) ||\n                [])[0];\n            if (parsedInput) {\n                skipped = string.substr(0, string.indexOf(parsedInput));\n                if (skipped.length > 0) {\n                    getParsingFlags(config).unusedInput.push(skipped);\n                }\n                string = string.slice(\n                    string.indexOf(parsedInput) + parsedInput.length\n                );\n                totalParsedInputLength += parsedInput.length;\n            }\n            // don't parse if it's not a known token\n            if (formatTokenFunctions[token]) {\n                if (parsedInput) {\n                    getParsingFlags(config).empty = false;\n                } else {\n                    getParsingFlags(config).unusedTokens.push(token);\n                }\n                addTimeToArrayFromToken(token, parsedInput, config);\n            } else if (config._strict && !parsedInput) {\n                getParsingFlags(config).unusedTokens.push(token);\n            }\n        }\n\n        // add remaining unparsed input length to the string\n        getParsingFlags(config).charsLeftOver =\n            stringLength - totalParsedInputLength;\n        if (string.length > 0) {\n            getParsingFlags(config).unusedInput.push(string);\n        }\n\n        // clear _12h flag if hour is <= 12\n        if (\n            config._a[HOUR] <= 12 &&\n            getParsingFlags(config).bigHour === true &&\n            config._a[HOUR] > 0\n        ) {\n            getParsingFlags(config).bigHour = undefined;\n        }\n\n        getParsingFlags(config).parsedDateParts = config._a.slice(0);\n        getParsingFlags(config).meridiem = config._meridiem;\n        // handle meridiem\n        config._a[HOUR] = meridiemFixWrap(\n            config._locale,\n            config._a[HOUR],\n            config._meridiem\n        );\n\n        // handle era\n        era = getParsingFlags(config).era;\n        if (era !== null) {\n            config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n        }\n\n        configFromArray(config);\n        checkOverflow(config);\n    }\n\n    function meridiemFixWrap(locale, hour, meridiem) {\n        var isPm;\n\n        if (meridiem == null) {\n            // nothing to do\n            return hour;\n        }\n        if (locale.meridiemHour != null) {\n            return locale.meridiemHour(hour, meridiem);\n        } else if (locale.isPM != null) {\n            // Fallback\n            isPm = locale.isPM(meridiem);\n            if (isPm && hour < 12) {\n                hour += 12;\n            }\n            if (!isPm && hour === 12) {\n                hour = 0;\n            }\n            return hour;\n        } else {\n            // this is not supposed to happen\n            return hour;\n        }\n    }\n\n    // date from string and array of format strings\n    function configFromStringAndArray(config) {\n        var tempConfig,\n            bestMoment,\n            scoreToBeat,\n            i,\n            currentScore,\n            validFormatFound,\n            bestFormatIsValid = false,\n            configfLen = config._f.length;\n\n        if (configfLen === 0) {\n            getParsingFlags(config).invalidFormat = true;\n            config._d = new Date(NaN);\n            return;\n        }\n\n        for (i = 0; i < configfLen; i++) {\n            currentScore = 0;\n            validFormatFound = false;\n            tempConfig = copyConfig({}, config);\n            if (config._useUTC != null) {\n                tempConfig._useUTC = config._useUTC;\n            }\n            tempConfig._f = config._f[i];\n            configFromStringAndFormat(tempConfig);\n\n            if (isValid(tempConfig)) {\n                validFormatFound = true;\n            }\n\n            // if there is any input that was not parsed add a penalty for that format\n            currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n            //or tokens\n            currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n            getParsingFlags(tempConfig).score = currentScore;\n\n            if (!bestFormatIsValid) {\n                if (\n                    scoreToBeat == null ||\n                    currentScore < scoreToBeat ||\n                    validFormatFound\n                ) {\n                    scoreToBeat = currentScore;\n                    bestMoment = tempConfig;\n                    if (validFormatFound) {\n                        bestFormatIsValid = true;\n                    }\n                }\n            } else {\n                if (currentScore < scoreToBeat) {\n                    scoreToBeat = currentScore;\n                    bestMoment = tempConfig;\n                }\n            }\n        }\n\n        extend(config, bestMoment || tempConfig);\n    }\n\n    function configFromObject(config) {\n        if (config._d) {\n            return;\n        }\n\n        var i = normalizeObjectUnits(config._i),\n            dayOrDate = i.day === undefined ? i.date : i.day;\n        config._a = map(\n            [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],\n            function (obj) {\n                return obj && parseInt(obj, 10);\n            }\n        );\n\n        configFromArray(config);\n    }\n\n    function createFromConfig(config) {\n        var res = new Moment(checkOverflow(prepareConfig(config)));\n        if (res._nextDay) {\n            // Adding is smart enough around DST\n            res.add(1, 'd');\n            res._nextDay = undefined;\n        }\n\n        return res;\n    }\n\n    function prepareConfig(config) {\n        var input = config._i,\n            format = config._f;\n\n        config._locale = config._locale || getLocale(config._l);\n\n        if (input === null || (format === undefined && input === '')) {\n            return createInvalid({ nullInput: true });\n        }\n\n        if (typeof input === 'string') {\n            config._i = input = config._locale.preparse(input);\n        }\n\n        if (isMoment(input)) {\n            return new Moment(checkOverflow(input));\n        } else if (isDate(input)) {\n            config._d = input;\n        } else if (isArray(format)) {\n            configFromStringAndArray(config);\n        } else if (format) {\n            configFromStringAndFormat(config);\n        } else {\n            configFromInput(config);\n        }\n\n        if (!isValid(config)) {\n            config._d = null;\n        }\n\n        return config;\n    }\n\n    function configFromInput(config) {\n        var input = config._i;\n        if (isUndefined(input)) {\n            config._d = new Date(hooks.now());\n        } else if (isDate(input)) {\n            config._d = new Date(input.valueOf());\n        } else if (typeof input === 'string') {\n            configFromString(config);\n        } else if (isArray(input)) {\n            config._a = map(input.slice(0), function (obj) {\n                return parseInt(obj, 10);\n            });\n            configFromArray(config);\n        } else if (isObject(input)) {\n            configFromObject(config);\n        } else if (isNumber(input)) {\n            // from milliseconds\n            config._d = new Date(input);\n        } else {\n            hooks.createFromInputFallback(config);\n        }\n    }\n\n    function createLocalOrUTC(input, format, locale, strict, isUTC) {\n        var c = {};\n\n        if (format === true || format === false) {\n            strict = format;\n            format = undefined;\n        }\n\n        if (locale === true || locale === false) {\n            strict = locale;\n            locale = undefined;\n        }\n\n        if (\n            (isObject(input) && isObjectEmpty(input)) ||\n            (isArray(input) && input.length === 0)\n        ) {\n            input = undefined;\n        }\n        // object construction must be done this way.\n        // https://github.com/moment/moment/issues/1423\n        c._isAMomentObject = true;\n        c._useUTC = c._isUTC = isUTC;\n        c._l = locale;\n        c._i = input;\n        c._f = format;\n        c._strict = strict;\n\n        return createFromConfig(c);\n    }\n\n    function createLocal(input, format, locale, strict) {\n        return createLocalOrUTC(input, format, locale, strict, false);\n    }\n\n    var prototypeMin = deprecate(\n            'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n            function () {\n                var other = createLocal.apply(null, arguments);\n                if (this.isValid() && other.isValid()) {\n                    return other < this ? this : other;\n                } else {\n                    return createInvalid();\n                }\n            }\n        ),\n        prototypeMax = deprecate(\n            'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n            function () {\n                var other = createLocal.apply(null, arguments);\n                if (this.isValid() && other.isValid()) {\n                    return other > this ? this : other;\n                } else {\n                    return createInvalid();\n                }\n            }\n        );\n\n    // Pick a moment m from moments so that m[fn](other) is true for all\n    // other. This relies on the function fn to be transitive.\n    //\n    // moments should either be an array of moment objects or an array, whose\n    // first element is an array of moment objects.\n    function pickBy(fn, moments) {\n        var res, i;\n        if (moments.length === 1 && isArray(moments[0])) {\n            moments = moments[0];\n        }\n        if (!moments.length) {\n            return createLocal();\n        }\n        res = moments[0];\n        for (i = 1; i < moments.length; ++i) {\n            if (!moments[i].isValid() || moments[i][fn](res)) {\n                res = moments[i];\n            }\n        }\n        return res;\n    }\n\n    // TODO: Use [].sort instead?\n    function min() {\n        var args = [].slice.call(arguments, 0);\n\n        return pickBy('isBefore', args);\n    }\n\n    function max() {\n        var args = [].slice.call(arguments, 0);\n\n        return pickBy('isAfter', args);\n    }\n\n    var now = function () {\n        return Date.now ? Date.now() : +new Date();\n    };\n\n    var ordering = [\n        'year',\n        'quarter',\n        'month',\n        'week',\n        'day',\n        'hour',\n        'minute',\n        'second',\n        'millisecond',\n    ];\n\n    function isDurationValid(m) {\n        var key,\n            unitHasDecimal = false,\n            i,\n            orderLen = ordering.length;\n        for (key in m) {\n            if (\n                hasOwnProp(m, key) &&\n                !(\n                    indexOf.call(ordering, key) !== -1 &&\n                    (m[key] == null || !isNaN(m[key]))\n                )\n            ) {\n                return false;\n            }\n        }\n\n        for (i = 0; i < orderLen; ++i) {\n            if (m[ordering[i]]) {\n                if (unitHasDecimal) {\n                    return false; // only allow non-integers for smallest unit\n                }\n                if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n                    unitHasDecimal = true;\n                }\n            }\n        }\n\n        return true;\n    }\n\n    function isValid$1() {\n        return this._isValid;\n    }\n\n    function createInvalid$1() {\n        return createDuration(NaN);\n    }\n\n    function Duration(duration) {\n        var normalizedInput = normalizeObjectUnits(duration),\n            years = normalizedInput.year || 0,\n            quarters = normalizedInput.quarter || 0,\n            months = normalizedInput.month || 0,\n            weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n            days = normalizedInput.day || 0,\n            hours = normalizedInput.hour || 0,\n            minutes = normalizedInput.minute || 0,\n            seconds = normalizedInput.second || 0,\n            milliseconds = normalizedInput.millisecond || 0;\n\n        this._isValid = isDurationValid(normalizedInput);\n\n        // representation for dateAddRemove\n        this._milliseconds =\n            +milliseconds +\n            seconds * 1e3 + // 1000\n            minutes * 6e4 + // 1000 * 60\n            hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n        // Because of dateAddRemove treats 24 hours as different from a\n        // day when working around DST, we need to store them separately\n        this._days = +days + weeks * 7;\n        // It is impossible to translate months into days without knowing\n        // which months you are are talking about, so we have to store\n        // it separately.\n        this._months = +months + quarters * 3 + years * 12;\n\n        this._data = {};\n\n        this._locale = getLocale();\n\n        this._bubble();\n    }\n\n    function isDuration(obj) {\n        return obj instanceof Duration;\n    }\n\n    function absRound(number) {\n        if (number < 0) {\n            return Math.round(-1 * number) * -1;\n        } else {\n            return Math.round(number);\n        }\n    }\n\n    // compare two arrays, return the number of differences\n    function compareArrays(array1, array2, dontConvert) {\n        var len = Math.min(array1.length, array2.length),\n            lengthDiff = Math.abs(array1.length - array2.length),\n            diffs = 0,\n            i;\n        for (i = 0; i < len; i++) {\n            if (\n                (dontConvert && array1[i] !== array2[i]) ||\n                (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n            ) {\n                diffs++;\n            }\n        }\n        return diffs + lengthDiff;\n    }\n\n    // FORMATTING\n\n    function offset(token, separator) {\n        addFormatToken(token, 0, 0, function () {\n            var offset = this.utcOffset(),\n                sign = '+';\n            if (offset < 0) {\n                offset = -offset;\n                sign = '-';\n            }\n            return (\n                sign +\n                zeroFill(~~(offset / 60), 2) +\n                separator +\n                zeroFill(~~offset % 60, 2)\n            );\n        });\n    }\n\n    offset('Z', ':');\n    offset('ZZ', '');\n\n    // PARSING\n\n    addRegexToken('Z', matchShortOffset);\n    addRegexToken('ZZ', matchShortOffset);\n    addParseToken(['Z', 'ZZ'], function (input, array, config) {\n        config._useUTC = true;\n        config._tzm = offsetFromString(matchShortOffset, input);\n    });\n\n    // HELPERS\n\n    // timezone chunker\n    // '+10:00' > ['10',  '00']\n    // '-1530'  > ['-15', '30']\n    var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n    function offsetFromString(matcher, string) {\n        var matches = (string || '').match(matcher),\n            chunk,\n            parts,\n            minutes;\n\n        if (matches === null) {\n            return null;\n        }\n\n        chunk = matches[matches.length - 1] || [];\n        parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n        minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n        return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n    }\n\n    // Return a moment from input, that is local/utc/zone equivalent to model.\n    function cloneWithOffset(input, model) {\n        var res, diff;\n        if (model._isUTC) {\n            res = model.clone();\n            diff =\n                (isMoment(input) || isDate(input)\n                    ? input.valueOf()\n                    : createLocal(input).valueOf()) - res.valueOf();\n            // Use low-level api, because this fn is low-level api.\n            res._d.setTime(res._d.valueOf() + diff);\n            hooks.updateOffset(res, false);\n            return res;\n        } else {\n            return createLocal(input).local();\n        }\n    }\n\n    function getDateOffset(m) {\n        // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n        // https://github.com/moment/moment/pull/1871\n        return -Math.round(m._d.getTimezoneOffset());\n    }\n\n    // HOOKS\n\n    // This function will be called whenever a moment is mutated.\n    // It is intended to keep the offset in sync with the timezone.\n    hooks.updateOffset = function () {};\n\n    // MOMENTS\n\n    // keepLocalTime = true means only change the timezone, without\n    // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n    // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n    // +0200, so we adjust the time as needed, to be valid.\n    //\n    // Keeping the time actually adds/subtracts (one hour)\n    // from the actual represented time. That is why we call updateOffset\n    // a second time. In case it wants us to change the offset again\n    // _changeInProgress == true case, then we have to adjust, because\n    // there is no such time in the given timezone.\n    function getSetOffset(input, keepLocalTime, keepMinutes) {\n        var offset = this._offset || 0,\n            localAdjust;\n        if (!this.isValid()) {\n            return input != null ? this : NaN;\n        }\n        if (input != null) {\n            if (typeof input === 'string') {\n                input = offsetFromString(matchShortOffset, input);\n                if (input === null) {\n                    return this;\n                }\n            } else if (Math.abs(input) < 16 && !keepMinutes) {\n                input = input * 60;\n            }\n            if (!this._isUTC && keepLocalTime) {\n                localAdjust = getDateOffset(this);\n            }\n            this._offset = input;\n            this._isUTC = true;\n            if (localAdjust != null) {\n                this.add(localAdjust, 'm');\n            }\n            if (offset !== input) {\n                if (!keepLocalTime || this._changeInProgress) {\n                    addSubtract(\n                        this,\n                        createDuration(input - offset, 'm'),\n                        1,\n                        false\n                    );\n                } else if (!this._changeInProgress) {\n                    this._changeInProgress = true;\n                    hooks.updateOffset(this, true);\n                    this._changeInProgress = null;\n                }\n            }\n            return this;\n        } else {\n            return this._isUTC ? offset : getDateOffset(this);\n        }\n    }\n\n    function getSetZone(input, keepLocalTime) {\n        if (input != null) {\n            if (typeof input !== 'string') {\n                input = -input;\n            }\n\n            this.utcOffset(input, keepLocalTime);\n\n            return this;\n        } else {\n            return -this.utcOffset();\n        }\n    }\n\n    function setOffsetToUTC(keepLocalTime) {\n        return this.utcOffset(0, keepLocalTime);\n    }\n\n    function setOffsetToLocal(keepLocalTime) {\n        if (this._isUTC) {\n            this.utcOffset(0, keepLocalTime);\n            this._isUTC = false;\n\n            if (keepLocalTime) {\n                this.subtract(getDateOffset(this), 'm');\n            }\n        }\n        return this;\n    }\n\n    function setOffsetToParsedOffset() {\n        if (this._tzm != null) {\n            this.utcOffset(this._tzm, false, true);\n        } else if (typeof this._i === 'string') {\n            var tZone = offsetFromString(matchOffset, this._i);\n            if (tZone != null) {\n                this.utcOffset(tZone);\n            } else {\n                this.utcOffset(0, true);\n            }\n        }\n        return this;\n    }\n\n    function hasAlignedHourOffset(input) {\n        if (!this.isValid()) {\n            return false;\n        }\n        input = input ? createLocal(input).utcOffset() : 0;\n\n        return (this.utcOffset() - input) % 60 === 0;\n    }\n\n    function isDaylightSavingTime() {\n        return (\n            this.utcOffset() > this.clone().month(0).utcOffset() ||\n            this.utcOffset() > this.clone().month(5).utcOffset()\n        );\n    }\n\n    function isDaylightSavingTimeShifted() {\n        if (!isUndefined(this._isDSTShifted)) {\n            return this._isDSTShifted;\n        }\n\n        var c = {},\n            other;\n\n        copyConfig(c, this);\n        c = prepareConfig(c);\n\n        if (c._a) {\n            other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n            this._isDSTShifted =\n                this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n        } else {\n            this._isDSTShifted = false;\n        }\n\n        return this._isDSTShifted;\n    }\n\n    function isLocal() {\n        return this.isValid() ? !this._isUTC : false;\n    }\n\n    function isUtcOffset() {\n        return this.isValid() ? this._isUTC : false;\n    }\n\n    function isUtc() {\n        return this.isValid() ? this._isUTC && this._offset === 0 : false;\n    }\n\n    // ASP.NET json date format regex\n    var aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n        // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n        // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n        // and further modified to allow for strings containing both week and day\n        isoRegex =\n            /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\n    function createDuration(input, key) {\n        var duration = input,\n            // matching against regexp is expensive, do it on demand\n            match = null,\n            sign,\n            ret,\n            diffRes;\n\n        if (isDuration(input)) {\n            duration = {\n                ms: input._milliseconds,\n                d: input._days,\n                M: input._months,\n            };\n        } else if (isNumber(input) || !isNaN(+input)) {\n            duration = {};\n            if (key) {\n                duration[key] = +input;\n            } else {\n                duration.milliseconds = +input;\n            }\n        } else if ((match = aspNetRegex.exec(input))) {\n            sign = match[1] === '-' ? -1 : 1;\n            duration = {\n                y: 0,\n                d: toInt(match[DATE]) * sign,\n                h: toInt(match[HOUR]) * sign,\n                m: toInt(match[MINUTE]) * sign,\n                s: toInt(match[SECOND]) * sign,\n                ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match\n            };\n        } else if ((match = isoRegex.exec(input))) {\n            sign = match[1] === '-' ? -1 : 1;\n            duration = {\n                y: parseIso(match[2], sign),\n                M: parseIso(match[3], sign),\n                w: parseIso(match[4], sign),\n                d: parseIso(match[5], sign),\n                h: parseIso(match[6], sign),\n                m: parseIso(match[7], sign),\n                s: parseIso(match[8], sign),\n            };\n        } else if (duration == null) {\n            // checks for null or undefined\n            duration = {};\n        } else if (\n            typeof duration === 'object' &&\n            ('from' in duration || 'to' in duration)\n        ) {\n            diffRes = momentsDifference(\n                createLocal(duration.from),\n                createLocal(duration.to)\n            );\n\n            duration = {};\n            duration.ms = diffRes.milliseconds;\n            duration.M = diffRes.months;\n        }\n\n        ret = new Duration(duration);\n\n        if (isDuration(input) && hasOwnProp(input, '_locale')) {\n            ret._locale = input._locale;\n        }\n\n        if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n            ret._isValid = input._isValid;\n        }\n\n        return ret;\n    }\n\n    createDuration.fn = Duration.prototype;\n    createDuration.invalid = createInvalid$1;\n\n    function parseIso(inp, sign) {\n        // We'd normally use ~~inp for this, but unfortunately it also\n        // converts floats to ints.\n        // inp may be undefined, so careful calling replace on it.\n        var res = inp && parseFloat(inp.replace(',', '.'));\n        // apply sign while we're at it\n        return (isNaN(res) ? 0 : res) * sign;\n    }\n\n    function positiveMomentsDifference(base, other) {\n        var res = {};\n\n        res.months =\n            other.month() - base.month() + (other.year() - base.year()) * 12;\n        if (base.clone().add(res.months, 'M').isAfter(other)) {\n            --res.months;\n        }\n\n        res.milliseconds = +other - +base.clone().add(res.months, 'M');\n\n        return res;\n    }\n\n    function momentsDifference(base, other) {\n        var res;\n        if (!(base.isValid() && other.isValid())) {\n            return { milliseconds: 0, months: 0 };\n        }\n\n        other = cloneWithOffset(other, base);\n        if (base.isBefore(other)) {\n            res = positiveMomentsDifference(base, other);\n        } else {\n            res = positiveMomentsDifference(other, base);\n            res.milliseconds = -res.milliseconds;\n            res.months = -res.months;\n        }\n\n        return res;\n    }\n\n    // TODO: remove 'name' arg after deprecation is removed\n    function createAdder(direction, name) {\n        return function (val, period) {\n            var dur, tmp;\n            //invert the arguments, but complain about it\n            if (period !== null && !isNaN(+period)) {\n                deprecateSimple(\n                    name,\n                    'moment().' +\n                        name +\n                        '(period, number) is deprecated. Please use moment().' +\n                        name +\n                        '(number, period). ' +\n                        'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n                );\n                tmp = val;\n                val = period;\n                period = tmp;\n            }\n\n            dur = createDuration(val, period);\n            addSubtract(this, dur, direction);\n            return this;\n        };\n    }\n\n    function addSubtract(mom, duration, isAdding, updateOffset) {\n        var milliseconds = duration._milliseconds,\n            days = absRound(duration._days),\n            months = absRound(duration._months);\n\n        if (!mom.isValid()) {\n            // No op\n            return;\n        }\n\n        updateOffset = updateOffset == null ? true : updateOffset;\n\n        if (months) {\n            setMonth(mom, get(mom, 'Month') + months * isAdding);\n        }\n        if (days) {\n            set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n        }\n        if (milliseconds) {\n            mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n        }\n        if (updateOffset) {\n            hooks.updateOffset(mom, days || months);\n        }\n    }\n\n    var add = createAdder(1, 'add'),\n        subtract = createAdder(-1, 'subtract');\n\n    function isString(input) {\n        return typeof input === 'string' || input instanceof String;\n    }\n\n    // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\n    function isMomentInput(input) {\n        return (\n            isMoment(input) ||\n            isDate(input) ||\n            isString(input) ||\n            isNumber(input) ||\n            isNumberOrStringArray(input) ||\n            isMomentInputObject(input) ||\n            input === null ||\n            input === undefined\n        );\n    }\n\n    function isMomentInputObject(input) {\n        var objectTest = isObject(input) && !isObjectEmpty(input),\n            propertyTest = false,\n            properties = [\n                'years',\n                'year',\n                'y',\n                'months',\n                'month',\n                'M',\n                'days',\n                'day',\n                'd',\n                'dates',\n                'date',\n                'D',\n                'hours',\n                'hour',\n                'h',\n                'minutes',\n                'minute',\n                'm',\n                'seconds',\n                'second',\n                's',\n                'milliseconds',\n                'millisecond',\n                'ms',\n            ],\n            i,\n            property,\n            propertyLen = properties.length;\n\n        for (i = 0; i < propertyLen; i += 1) {\n            property = properties[i];\n            propertyTest = propertyTest || hasOwnProp(input, property);\n        }\n\n        return objectTest && propertyTest;\n    }\n\n    function isNumberOrStringArray(input) {\n        var arrayTest = isArray(input),\n            dataTypeTest = false;\n        if (arrayTest) {\n            dataTypeTest =\n                input.filter(function (item) {\n                    return !isNumber(item) && isString(input);\n                }).length === 0;\n        }\n        return arrayTest && dataTypeTest;\n    }\n\n    function isCalendarSpec(input) {\n        var objectTest = isObject(input) && !isObjectEmpty(input),\n            propertyTest = false,\n            properties = [\n                'sameDay',\n                'nextDay',\n                'lastDay',\n                'nextWeek',\n                'lastWeek',\n                'sameElse',\n            ],\n            i,\n            property;\n\n        for (i = 0; i < properties.length; i += 1) {\n            property = properties[i];\n            propertyTest = propertyTest || hasOwnProp(input, property);\n        }\n\n        return objectTest && propertyTest;\n    }\n\n    function getCalendarFormat(myMoment, now) {\n        var diff = myMoment.diff(now, 'days', true);\n        return diff < -6\n            ? 'sameElse'\n            : diff < -1\n            ? 'lastWeek'\n            : diff < 0\n            ? 'lastDay'\n            : diff < 1\n            ? 'sameDay'\n            : diff < 2\n            ? 'nextDay'\n            : diff < 7\n            ? 'nextWeek'\n            : 'sameElse';\n    }\n\n    function calendar$1(time, formats) {\n        // Support for single parameter, formats only overload to the calendar function\n        if (arguments.length === 1) {\n            if (!arguments[0]) {\n                time = undefined;\n                formats = undefined;\n            } else if (isMomentInput(arguments[0])) {\n                time = arguments[0];\n                formats = undefined;\n            } else if (isCalendarSpec(arguments[0])) {\n                formats = arguments[0];\n                time = undefined;\n            }\n        }\n        // We want to compare the start of today, vs this.\n        // Getting start-of-today depends on whether we're local/utc/offset or not.\n        var now = time || createLocal(),\n            sod = cloneWithOffset(now, this).startOf('day'),\n            format = hooks.calendarFormat(this, sod) || 'sameElse',\n            output =\n                formats &&\n                (isFunction(formats[format])\n                    ? formats[format].call(this, now)\n                    : formats[format]);\n\n        return this.format(\n            output || this.localeData().calendar(format, this, createLocal(now))\n        );\n    }\n\n    function clone() {\n        return new Moment(this);\n    }\n\n    function isAfter(input, units) {\n        var localInput = isMoment(input) ? input : createLocal(input);\n        if (!(this.isValid() && localInput.isValid())) {\n            return false;\n        }\n        units = normalizeUnits(units) || 'millisecond';\n        if (units === 'millisecond') {\n            return this.valueOf() > localInput.valueOf();\n        } else {\n            return localInput.valueOf() < this.clone().startOf(units).valueOf();\n        }\n    }\n\n    function isBefore(input, units) {\n        var localInput = isMoment(input) ? input : createLocal(input);\n        if (!(this.isValid() && localInput.isValid())) {\n            return false;\n        }\n        units = normalizeUnits(units) || 'millisecond';\n        if (units === 'millisecond') {\n            return this.valueOf() < localInput.valueOf();\n        } else {\n            return this.clone().endOf(units).valueOf() < localInput.valueOf();\n        }\n    }\n\n    function isBetween(from, to, units, inclusivity) {\n        var localFrom = isMoment(from) ? from : createLocal(from),\n            localTo = isMoment(to) ? to : createLocal(to);\n        if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n            return false;\n        }\n        inclusivity = inclusivity || '()';\n        return (\n            (inclusivity[0] === '('\n                ? this.isAfter(localFrom, units)\n                : !this.isBefore(localFrom, units)) &&\n            (inclusivity[1] === ')'\n                ? this.isBefore(localTo, units)\n                : !this.isAfter(localTo, units))\n        );\n    }\n\n    function isSame(input, units) {\n        var localInput = isMoment(input) ? input : createLocal(input),\n            inputMs;\n        if (!(this.isValid() && localInput.isValid())) {\n            return false;\n        }\n        units = normalizeUnits(units) || 'millisecond';\n        if (units === 'millisecond') {\n            return this.valueOf() === localInput.valueOf();\n        } else {\n            inputMs = localInput.valueOf();\n            return (\n                this.clone().startOf(units).valueOf() <= inputMs &&\n                inputMs <= this.clone().endOf(units).valueOf()\n            );\n        }\n    }\n\n    function isSameOrAfter(input, units) {\n        return this.isSame(input, units) || this.isAfter(input, units);\n    }\n\n    function isSameOrBefore(input, units) {\n        return this.isSame(input, units) || this.isBefore(input, units);\n    }\n\n    function diff(input, units, asFloat) {\n        var that, zoneDelta, output;\n\n        if (!this.isValid()) {\n            return NaN;\n        }\n\n        that = cloneWithOffset(input, this);\n\n        if (!that.isValid()) {\n            return NaN;\n        }\n\n        zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n        units = normalizeUnits(units);\n\n        switch (units) {\n            case 'year':\n                output = monthDiff(this, that) / 12;\n                break;\n            case 'month':\n                output = monthDiff(this, that);\n                break;\n            case 'quarter':\n                output = monthDiff(this, that) / 3;\n                break;\n            case 'second':\n                output = (this - that) / 1e3;\n                break; // 1000\n            case 'minute':\n                output = (this - that) / 6e4;\n                break; // 1000 * 60\n            case 'hour':\n                output = (this - that) / 36e5;\n                break; // 1000 * 60 * 60\n            case 'day':\n                output = (this - that - zoneDelta) / 864e5;\n                break; // 1000 * 60 * 60 * 24, negate dst\n            case 'week':\n                output = (this - that - zoneDelta) / 6048e5;\n                break; // 1000 * 60 * 60 * 24 * 7, negate dst\n            default:\n                output = this - that;\n        }\n\n        return asFloat ? output : absFloor(output);\n    }\n\n    function monthDiff(a, b) {\n        if (a.date() < b.date()) {\n            // end-of-month calculations work correct when the start month has more\n            // days than the end month.\n            return -monthDiff(b, a);\n        }\n        // difference in months\n        var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n            // b is in (anchor - 1 month, anchor + 1 month)\n            anchor = a.clone().add(wholeMonthDiff, 'months'),\n            anchor2,\n            adjust;\n\n        if (b - anchor < 0) {\n            anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n            // linear across the month\n            adjust = (b - anchor) / (anchor - anchor2);\n        } else {\n            anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n            // linear across the month\n            adjust = (b - anchor) / (anchor2 - anchor);\n        }\n\n        //check for negative zero, return zero if negative zero\n        return -(wholeMonthDiff + adjust) || 0;\n    }\n\n    hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n    hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n    function toString() {\n        return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n    }\n\n    function toISOString(keepOffset) {\n        if (!this.isValid()) {\n            return null;\n        }\n        var utc = keepOffset !== true,\n            m = utc ? this.clone().utc() : this;\n        if (m.year() < 0 || m.year() > 9999) {\n            return formatMoment(\n                m,\n                utc\n                    ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'\n                    : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'\n            );\n        }\n        if (isFunction(Date.prototype.toISOString)) {\n            // native implementation is ~50x faster, use it when we can\n            if (utc) {\n                return this.toDate().toISOString();\n            } else {\n                return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)\n                    .toISOString()\n                    .replace('Z', formatMoment(m, 'Z'));\n            }\n        }\n        return formatMoment(\n            m,\n            utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'\n        );\n    }\n\n    /**\n     * Return a human readable representation of a moment that can\n     * also be evaluated to get a new moment which is the same\n     *\n     * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n     */\n    function inspect() {\n        if (!this.isValid()) {\n            return 'moment.invalid(/* ' + this._i + ' */)';\n        }\n        var func = 'moment',\n            zone = '',\n            prefix,\n            year,\n            datetime,\n            suffix;\n        if (!this.isLocal()) {\n            func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n            zone = 'Z';\n        }\n        prefix = '[' + func + '(\"]';\n        year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n        datetime = '-MM-DD[T]HH:mm:ss.SSS';\n        suffix = zone + '[\")]';\n\n        return this.format(prefix + year + datetime + suffix);\n    }\n\n    function format(inputString) {\n        if (!inputString) {\n            inputString = this.isUtc()\n                ? hooks.defaultFormatUtc\n                : hooks.defaultFormat;\n        }\n        var output = formatMoment(this, inputString);\n        return this.localeData().postformat(output);\n    }\n\n    function from(time, withoutSuffix) {\n        if (\n            this.isValid() &&\n            ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n        ) {\n            return createDuration({ to: this, from: time })\n                .locale(this.locale())\n                .humanize(!withoutSuffix);\n        } else {\n            return this.localeData().invalidDate();\n        }\n    }\n\n    function fromNow(withoutSuffix) {\n        return this.from(createLocal(), withoutSuffix);\n    }\n\n    function to(time, withoutSuffix) {\n        if (\n            this.isValid() &&\n            ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n        ) {\n            return createDuration({ from: this, to: time })\n                .locale(this.locale())\n                .humanize(!withoutSuffix);\n        } else {\n            return this.localeData().invalidDate();\n        }\n    }\n\n    function toNow(withoutSuffix) {\n        return this.to(createLocal(), withoutSuffix);\n    }\n\n    // If passed a locale key, it will set the locale for this\n    // instance.  Otherwise, it will return the locale configuration\n    // variables for this instance.\n    function locale(key) {\n        var newLocaleData;\n\n        if (key === undefined) {\n            return this._locale._abbr;\n        } else {\n            newLocaleData = getLocale(key);\n            if (newLocaleData != null) {\n                this._locale = newLocaleData;\n            }\n            return this;\n        }\n    }\n\n    var lang = deprecate(\n        'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n        function (key) {\n            if (key === undefined) {\n                return this.localeData();\n            } else {\n                return this.locale(key);\n            }\n        }\n    );\n\n    function localeData() {\n        return this._locale;\n    }\n\n    var MS_PER_SECOND = 1000,\n        MS_PER_MINUTE = 60 * MS_PER_SECOND,\n        MS_PER_HOUR = 60 * MS_PER_MINUTE,\n        MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n    // actual modulo - handles negative numbers (for dates before 1970):\n    function mod$1(dividend, divisor) {\n        return ((dividend % divisor) + divisor) % divisor;\n    }\n\n    function localStartOfDate(y, m, d) {\n        // the date constructor remaps years 0-99 to 1900-1999\n        if (y < 100 && y >= 0) {\n            // preserve leap years using a full 400 year cycle, then reset\n            return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n        } else {\n            return new Date(y, m, d).valueOf();\n        }\n    }\n\n    function utcStartOfDate(y, m, d) {\n        // Date.UTC remaps years 0-99 to 1900-1999\n        if (y < 100 && y >= 0) {\n            // preserve leap years using a full 400 year cycle, then reset\n            return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n        } else {\n            return Date.UTC(y, m, d);\n        }\n    }\n\n    function startOf(units) {\n        var time, startOfDate;\n        units = normalizeUnits(units);\n        if (units === undefined || units === 'millisecond' || !this.isValid()) {\n            return this;\n        }\n\n        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n        switch (units) {\n            case 'year':\n                time = startOfDate(this.year(), 0, 1);\n                break;\n            case 'quarter':\n                time = startOfDate(\n                    this.year(),\n                    this.month() - (this.month() % 3),\n                    1\n                );\n                break;\n            case 'month':\n                time = startOfDate(this.year(), this.month(), 1);\n                break;\n            case 'week':\n                time = startOfDate(\n                    this.year(),\n                    this.month(),\n                    this.date() - this.weekday()\n                );\n                break;\n            case 'isoWeek':\n                time = startOfDate(\n                    this.year(),\n                    this.month(),\n                    this.date() - (this.isoWeekday() - 1)\n                );\n                break;\n            case 'day':\n            case 'date':\n                time = startOfDate(this.year(), this.month(), this.date());\n                break;\n            case 'hour':\n                time = this._d.valueOf();\n                time -= mod$1(\n                    time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n                    MS_PER_HOUR\n                );\n                break;\n            case 'minute':\n                time = this._d.valueOf();\n                time -= mod$1(time, MS_PER_MINUTE);\n                break;\n            case 'second':\n                time = this._d.valueOf();\n                time -= mod$1(time, MS_PER_SECOND);\n                break;\n        }\n\n        this._d.setTime(time);\n        hooks.updateOffset(this, true);\n        return this;\n    }\n\n    function endOf(units) {\n        var time, startOfDate;\n        units = normalizeUnits(units);\n        if (units === undefined || units === 'millisecond' || !this.isValid()) {\n            return this;\n        }\n\n        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n        switch (units) {\n            case 'year':\n                time = startOfDate(this.year() + 1, 0, 1) - 1;\n                break;\n            case 'quarter':\n                time =\n                    startOfDate(\n                        this.year(),\n                        this.month() - (this.month() % 3) + 3,\n                        1\n                    ) - 1;\n                break;\n            case 'month':\n                time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n                break;\n            case 'week':\n                time =\n                    startOfDate(\n                        this.year(),\n                        this.month(),\n                        this.date() - this.weekday() + 7\n                    ) - 1;\n                break;\n            case 'isoWeek':\n                time =\n                    startOfDate(\n                        this.year(),\n                        this.month(),\n                        this.date() - (this.isoWeekday() - 1) + 7\n                    ) - 1;\n                break;\n            case 'day':\n            case 'date':\n                time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n                break;\n            case 'hour':\n                time = this._d.valueOf();\n                time +=\n                    MS_PER_HOUR -\n                    mod$1(\n                        time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n                        MS_PER_HOUR\n                    ) -\n                    1;\n                break;\n            case 'minute':\n                time = this._d.valueOf();\n                time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n                break;\n            case 'second':\n                time = this._d.valueOf();\n                time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n                break;\n        }\n\n        this._d.setTime(time);\n        hooks.updateOffset(this, true);\n        return this;\n    }\n\n    function valueOf() {\n        return this._d.valueOf() - (this._offset || 0) * 60000;\n    }\n\n    function unix() {\n        return Math.floor(this.valueOf() / 1000);\n    }\n\n    function toDate() {\n        return new Date(this.valueOf());\n    }\n\n    function toArray() {\n        var m = this;\n        return [\n            m.year(),\n            m.month(),\n            m.date(),\n            m.hour(),\n            m.minute(),\n            m.second(),\n            m.millisecond(),\n        ];\n    }\n\n    function toObject() {\n        var m = this;\n        return {\n            years: m.year(),\n            months: m.month(),\n            date: m.date(),\n            hours: m.hours(),\n            minutes: m.minutes(),\n            seconds: m.seconds(),\n            milliseconds: m.milliseconds(),\n        };\n    }\n\n    function toJSON() {\n        // new Date(NaN).toJSON() === null\n        return this.isValid() ? this.toISOString() : null;\n    }\n\n    function isValid$2() {\n        return isValid(this);\n    }\n\n    function parsingFlags() {\n        return extend({}, getParsingFlags(this));\n    }\n\n    function invalidAt() {\n        return getParsingFlags(this).overflow;\n    }\n\n    function creationData() {\n        return {\n            input: this._i,\n            format: this._f,\n            locale: this._locale,\n            isUTC: this._isUTC,\n            strict: this._strict,\n        };\n    }\n\n    addFormatToken('N', 0, 0, 'eraAbbr');\n    addFormatToken('NN', 0, 0, 'eraAbbr');\n    addFormatToken('NNN', 0, 0, 'eraAbbr');\n    addFormatToken('NNNN', 0, 0, 'eraName');\n    addFormatToken('NNNNN', 0, 0, 'eraNarrow');\n\n    addFormatToken('y', ['y', 1], 'yo', 'eraYear');\n    addFormatToken('y', ['yy', 2], 0, 'eraYear');\n    addFormatToken('y', ['yyy', 3], 0, 'eraYear');\n    addFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n\n    addRegexToken('N', matchEraAbbr);\n    addRegexToken('NN', matchEraAbbr);\n    addRegexToken('NNN', matchEraAbbr);\n    addRegexToken('NNNN', matchEraName);\n    addRegexToken('NNNNN', matchEraNarrow);\n\n    addParseToken(\n        ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],\n        function (input, array, config, token) {\n            var era = config._locale.erasParse(input, token, config._strict);\n            if (era) {\n                getParsingFlags(config).era = era;\n            } else {\n                getParsingFlags(config).invalidEra = input;\n            }\n        }\n    );\n\n    addRegexToken('y', matchUnsigned);\n    addRegexToken('yy', matchUnsigned);\n    addRegexToken('yyy', matchUnsigned);\n    addRegexToken('yyyy', matchUnsigned);\n    addRegexToken('yo', matchEraYearOrdinal);\n\n    addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\n    addParseToken(['yo'], function (input, array, config, token) {\n        var match;\n        if (config._locale._eraYearOrdinalRegex) {\n            match = input.match(config._locale._eraYearOrdinalRegex);\n        }\n\n        if (config._locale.eraYearOrdinalParse) {\n            array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n        } else {\n            array[YEAR] = parseInt(input, 10);\n        }\n    });\n\n    function localeEras(m, format) {\n        var i,\n            l,\n            date,\n            eras = this._eras || getLocale('en')._eras;\n        for (i = 0, l = eras.length; i < l; ++i) {\n            switch (typeof eras[i].since) {\n                case 'string':\n                    // truncate time\n                    date = hooks(eras[i].since).startOf('day');\n                    eras[i].since = date.valueOf();\n                    break;\n            }\n\n            switch (typeof eras[i].until) {\n                case 'undefined':\n                    eras[i].until = +Infinity;\n                    break;\n                case 'string':\n                    // truncate time\n                    date = hooks(eras[i].until).startOf('day').valueOf();\n                    eras[i].until = date.valueOf();\n                    break;\n            }\n        }\n        return eras;\n    }\n\n    function localeErasParse(eraName, format, strict) {\n        var i,\n            l,\n            eras = this.eras(),\n            name,\n            abbr,\n            narrow;\n        eraName = eraName.toUpperCase();\n\n        for (i = 0, l = eras.length; i < l; ++i) {\n            name = eras[i].name.toUpperCase();\n            abbr = eras[i].abbr.toUpperCase();\n            narrow = eras[i].narrow.toUpperCase();\n\n            if (strict) {\n                switch (format) {\n                    case 'N':\n                    case 'NN':\n                    case 'NNN':\n                        if (abbr === eraName) {\n                            return eras[i];\n                        }\n                        break;\n\n                    case 'NNNN':\n                        if (name === eraName) {\n                            return eras[i];\n                        }\n                        break;\n\n                    case 'NNNNN':\n                        if (narrow === eraName) {\n                            return eras[i];\n                        }\n                        break;\n                }\n            } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n                return eras[i];\n            }\n        }\n    }\n\n    function localeErasConvertYear(era, year) {\n        var dir = era.since <= era.until ? +1 : -1;\n        if (year === undefined) {\n            return hooks(era.since).year();\n        } else {\n            return hooks(era.since).year() + (year - era.offset) * dir;\n        }\n    }\n\n    function getEraName() {\n        var i,\n            l,\n            val,\n            eras = this.localeData().eras();\n        for (i = 0, l = eras.length; i < l; ++i) {\n            // truncate time\n            val = this.clone().startOf('day').valueOf();\n\n            if (eras[i].since <= val && val <= eras[i].until) {\n                return eras[i].name;\n            }\n            if (eras[i].until <= val && val <= eras[i].since) {\n                return eras[i].name;\n            }\n        }\n\n        return '';\n    }\n\n    function getEraNarrow() {\n        var i,\n            l,\n            val,\n            eras = this.localeData().eras();\n        for (i = 0, l = eras.length; i < l; ++i) {\n            // truncate time\n            val = this.clone().startOf('day').valueOf();\n\n            if (eras[i].since <= val && val <= eras[i].until) {\n                return eras[i].narrow;\n            }\n            if (eras[i].until <= val && val <= eras[i].since) {\n                return eras[i].narrow;\n            }\n        }\n\n        return '';\n    }\n\n    function getEraAbbr() {\n        var i,\n            l,\n            val,\n            eras = this.localeData().eras();\n        for (i = 0, l = eras.length; i < l; ++i) {\n            // truncate time\n            val = this.clone().startOf('day').valueOf();\n\n            if (eras[i].since <= val && val <= eras[i].until) {\n                return eras[i].abbr;\n            }\n            if (eras[i].until <= val && val <= eras[i].since) {\n                return eras[i].abbr;\n            }\n        }\n\n        return '';\n    }\n\n    function getEraYear() {\n        var i,\n            l,\n            dir,\n            val,\n            eras = this.localeData().eras();\n        for (i = 0, l = eras.length; i < l; ++i) {\n            dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n            // truncate time\n            val = this.clone().startOf('day').valueOf();\n\n            if (\n                (eras[i].since <= val && val <= eras[i].until) ||\n                (eras[i].until <= val && val <= eras[i].since)\n            ) {\n                return (\n                    (this.year() - hooks(eras[i].since).year()) * dir +\n                    eras[i].offset\n                );\n            }\n        }\n\n        return this.year();\n    }\n\n    function erasNameRegex(isStrict) {\n        if (!hasOwnProp(this, '_erasNameRegex')) {\n            computeErasParse.call(this);\n        }\n        return isStrict ? this._erasNameRegex : this._erasRegex;\n    }\n\n    function erasAbbrRegex(isStrict) {\n        if (!hasOwnProp(this, '_erasAbbrRegex')) {\n            computeErasParse.call(this);\n        }\n        return isStrict ? this._erasAbbrRegex : this._erasRegex;\n    }\n\n    function erasNarrowRegex(isStrict) {\n        if (!hasOwnProp(this, '_erasNarrowRegex')) {\n            computeErasParse.call(this);\n        }\n        return isStrict ? this._erasNarrowRegex : this._erasRegex;\n    }\n\n    function matchEraAbbr(isStrict, locale) {\n        return locale.erasAbbrRegex(isStrict);\n    }\n\n    function matchEraName(isStrict, locale) {\n        return locale.erasNameRegex(isStrict);\n    }\n\n    function matchEraNarrow(isStrict, locale) {\n        return locale.erasNarrowRegex(isStrict);\n    }\n\n    function matchEraYearOrdinal(isStrict, locale) {\n        return locale._eraYearOrdinalRegex || matchUnsigned;\n    }\n\n    function computeErasParse() {\n        var abbrPieces = [],\n            namePieces = [],\n            narrowPieces = [],\n            mixedPieces = [],\n            i,\n            l,\n            eras = this.eras();\n\n        for (i = 0, l = eras.length; i < l; ++i) {\n            namePieces.push(regexEscape(eras[i].name));\n            abbrPieces.push(regexEscape(eras[i].abbr));\n            narrowPieces.push(regexEscape(eras[i].narrow));\n\n            mixedPieces.push(regexEscape(eras[i].name));\n            mixedPieces.push(regexEscape(eras[i].abbr));\n            mixedPieces.push(regexEscape(eras[i].narrow));\n        }\n\n        this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n        this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n        this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n        this._erasNarrowRegex = new RegExp(\n            '^(' + narrowPieces.join('|') + ')',\n            'i'\n        );\n    }\n\n    // FORMATTING\n\n    addFormatToken(0, ['gg', 2], 0, function () {\n        return this.weekYear() % 100;\n    });\n\n    addFormatToken(0, ['GG', 2], 0, function () {\n        return this.isoWeekYear() % 100;\n    });\n\n    function addWeekYearFormatToken(token, getter) {\n        addFormatToken(0, [token, token.length], 0, getter);\n    }\n\n    addWeekYearFormatToken('gggg', 'weekYear');\n    addWeekYearFormatToken('ggggg', 'weekYear');\n    addWeekYearFormatToken('GGGG', 'isoWeekYear');\n    addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n    // ALIASES\n\n    addUnitAlias('weekYear', 'gg');\n    addUnitAlias('isoWeekYear', 'GG');\n\n    // PRIORITY\n\n    addUnitPriority('weekYear', 1);\n    addUnitPriority('isoWeekYear', 1);\n\n    // PARSING\n\n    addRegexToken('G', matchSigned);\n    addRegexToken('g', matchSigned);\n    addRegexToken('GG', match1to2, match2);\n    addRegexToken('gg', match1to2, match2);\n    addRegexToken('GGGG', match1to4, match4);\n    addRegexToken('gggg', match1to4, match4);\n    addRegexToken('GGGGG', match1to6, match6);\n    addRegexToken('ggggg', match1to6, match6);\n\n    addWeekParseToken(\n        ['gggg', 'ggggg', 'GGGG', 'GGGGG'],\n        function (input, week, config, token) {\n            week[token.substr(0, 2)] = toInt(input);\n        }\n    );\n\n    addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n        week[token] = hooks.parseTwoDigitYear(input);\n    });\n\n    // MOMENTS\n\n    function getSetWeekYear(input) {\n        return getSetWeekYearHelper.call(\n            this,\n            input,\n            this.week(),\n            this.weekday(),\n            this.localeData()._week.dow,\n            this.localeData()._week.doy\n        );\n    }\n\n    function getSetISOWeekYear(input) {\n        return getSetWeekYearHelper.call(\n            this,\n            input,\n            this.isoWeek(),\n            this.isoWeekday(),\n            1,\n            4\n        );\n    }\n\n    function getISOWeeksInYear() {\n        return weeksInYear(this.year(), 1, 4);\n    }\n\n    function getISOWeeksInISOWeekYear() {\n        return weeksInYear(this.isoWeekYear(), 1, 4);\n    }\n\n    function getWeeksInYear() {\n        var weekInfo = this.localeData()._week;\n        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n    }\n\n    function getWeeksInWeekYear() {\n        var weekInfo = this.localeData()._week;\n        return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n    }\n\n    function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n        var weeksTarget;\n        if (input == null) {\n            return weekOfYear(this, dow, doy).year;\n        } else {\n            weeksTarget = weeksInYear(input, dow, doy);\n            if (week > weeksTarget) {\n                week = weeksTarget;\n            }\n            return setWeekAll.call(this, input, week, weekday, dow, doy);\n        }\n    }\n\n    function setWeekAll(weekYear, week, weekday, dow, doy) {\n        var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n            date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n        this.year(date.getUTCFullYear());\n        this.month(date.getUTCMonth());\n        this.date(date.getUTCDate());\n        return this;\n    }\n\n    // FORMATTING\n\n    addFormatToken('Q', 0, 'Qo', 'quarter');\n\n    // ALIASES\n\n    addUnitAlias('quarter', 'Q');\n\n    // PRIORITY\n\n    addUnitPriority('quarter', 7);\n\n    // PARSING\n\n    addRegexToken('Q', match1);\n    addParseToken('Q', function (input, array) {\n        array[MONTH] = (toInt(input) - 1) * 3;\n    });\n\n    // MOMENTS\n\n    function getSetQuarter(input) {\n        return input == null\n            ? Math.ceil((this.month() + 1) / 3)\n            : this.month((input - 1) * 3 + (this.month() % 3));\n    }\n\n    // FORMATTING\n\n    addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n    // ALIASES\n\n    addUnitAlias('date', 'D');\n\n    // PRIORITY\n    addUnitPriority('date', 9);\n\n    // PARSING\n\n    addRegexToken('D', match1to2);\n    addRegexToken('DD', match1to2, match2);\n    addRegexToken('Do', function (isStrict, locale) {\n        // TODO: Remove \"ordinalParse\" fallback in next major release.\n        return isStrict\n            ? locale._dayOfMonthOrdinalParse || locale._ordinalParse\n            : locale._dayOfMonthOrdinalParseLenient;\n    });\n\n    addParseToken(['D', 'DD'], DATE);\n    addParseToken('Do', function (input, array) {\n        array[DATE] = toInt(input.match(match1to2)[0]);\n    });\n\n    // MOMENTS\n\n    var getSetDayOfMonth = makeGetSet('Date', true);\n\n    // FORMATTING\n\n    addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n    // ALIASES\n\n    addUnitAlias('dayOfYear', 'DDD');\n\n    // PRIORITY\n    addUnitPriority('dayOfYear', 4);\n\n    // PARSING\n\n    addRegexToken('DDD', match1to3);\n    addRegexToken('DDDD', match3);\n    addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n        config._dayOfYear = toInt(input);\n    });\n\n    // HELPERS\n\n    // MOMENTS\n\n    function getSetDayOfYear(input) {\n        var dayOfYear =\n            Math.round(\n                (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5\n            ) + 1;\n        return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n    }\n\n    // FORMATTING\n\n    addFormatToken('m', ['mm', 2], 0, 'minute');\n\n    // ALIASES\n\n    addUnitAlias('minute', 'm');\n\n    // PRIORITY\n\n    addUnitPriority('minute', 14);\n\n    // PARSING\n\n    addRegexToken('m', match1to2);\n    addRegexToken('mm', match1to2, match2);\n    addParseToken(['m', 'mm'], MINUTE);\n\n    // MOMENTS\n\n    var getSetMinute = makeGetSet('Minutes', false);\n\n    // FORMATTING\n\n    addFormatToken('s', ['ss', 2], 0, 'second');\n\n    // ALIASES\n\n    addUnitAlias('second', 's');\n\n    // PRIORITY\n\n    addUnitPriority('second', 15);\n\n    // PARSING\n\n    addRegexToken('s', match1to2);\n    addRegexToken('ss', match1to2, match2);\n    addParseToken(['s', 'ss'], SECOND);\n\n    // MOMENTS\n\n    var getSetSecond = makeGetSet('Seconds', false);\n\n    // FORMATTING\n\n    addFormatToken('S', 0, 0, function () {\n        return ~~(this.millisecond() / 100);\n    });\n\n    addFormatToken(0, ['SS', 2], 0, function () {\n        return ~~(this.millisecond() / 10);\n    });\n\n    addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n    addFormatToken(0, ['SSSS', 4], 0, function () {\n        return this.millisecond() * 10;\n    });\n    addFormatToken(0, ['SSSSS', 5], 0, function () {\n        return this.millisecond() * 100;\n    });\n    addFormatToken(0, ['SSSSSS', 6], 0, function () {\n        return this.millisecond() * 1000;\n    });\n    addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n        return this.millisecond() * 10000;\n    });\n    addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n        return this.millisecond() * 100000;\n    });\n    addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n        return this.millisecond() * 1000000;\n    });\n\n    // ALIASES\n\n    addUnitAlias('millisecond', 'ms');\n\n    // PRIORITY\n\n    addUnitPriority('millisecond', 16);\n\n    // PARSING\n\n    addRegexToken('S', match1to3, match1);\n    addRegexToken('SS', match1to3, match2);\n    addRegexToken('SSS', match1to3, match3);\n\n    var token, getSetMillisecond;\n    for (token = 'SSSS'; token.length <= 9; token += 'S') {\n        addRegexToken(token, matchUnsigned);\n    }\n\n    function parseMs(input, array) {\n        array[MILLISECOND] = toInt(('0.' + input) * 1000);\n    }\n\n    for (token = 'S'; token.length <= 9; token += 'S') {\n        addParseToken(token, parseMs);\n    }\n\n    getSetMillisecond = makeGetSet('Milliseconds', false);\n\n    // FORMATTING\n\n    addFormatToken('z', 0, 0, 'zoneAbbr');\n    addFormatToken('zz', 0, 0, 'zoneName');\n\n    // MOMENTS\n\n    function getZoneAbbr() {\n        return this._isUTC ? 'UTC' : '';\n    }\n\n    function getZoneName() {\n        return this._isUTC ? 'Coordinated Universal Time' : '';\n    }\n\n    var proto = Moment.prototype;\n\n    proto.add = add;\n    proto.calendar = calendar$1;\n    proto.clone = clone;\n    proto.diff = diff;\n    proto.endOf = endOf;\n    proto.format = format;\n    proto.from = from;\n    proto.fromNow = fromNow;\n    proto.to = to;\n    proto.toNow = toNow;\n    proto.get = stringGet;\n    proto.invalidAt = invalidAt;\n    proto.isAfter = isAfter;\n    proto.isBefore = isBefore;\n    proto.isBetween = isBetween;\n    proto.isSame = isSame;\n    proto.isSameOrAfter = isSameOrAfter;\n    proto.isSameOrBefore = isSameOrBefore;\n    proto.isValid = isValid$2;\n    proto.lang = lang;\n    proto.locale = locale;\n    proto.localeData = localeData;\n    proto.max = prototypeMax;\n    proto.min = prototypeMin;\n    proto.parsingFlags = parsingFlags;\n    proto.set = stringSet;\n    proto.startOf = startOf;\n    proto.subtract = subtract;\n    proto.toArray = toArray;\n    proto.toObject = toObject;\n    proto.toDate = toDate;\n    proto.toISOString = toISOString;\n    proto.inspect = inspect;\n    if (typeof Symbol !== 'undefined' && Symbol.for != null) {\n        proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n            return 'Moment<' + this.format() + '>';\n        };\n    }\n    proto.toJSON = toJSON;\n    proto.toString = toString;\n    proto.unix = unix;\n    proto.valueOf = valueOf;\n    proto.creationData = creationData;\n    proto.eraName = getEraName;\n    proto.eraNarrow = getEraNarrow;\n    proto.eraAbbr = getEraAbbr;\n    proto.eraYear = getEraYear;\n    proto.year = getSetYear;\n    proto.isLeapYear = getIsLeapYear;\n    proto.weekYear = getSetWeekYear;\n    proto.isoWeekYear = getSetISOWeekYear;\n    proto.quarter = proto.quarters = getSetQuarter;\n    proto.month = getSetMonth;\n    proto.daysInMonth = getDaysInMonth;\n    proto.week = proto.weeks = getSetWeek;\n    proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n    proto.weeksInYear = getWeeksInYear;\n    proto.weeksInWeekYear = getWeeksInWeekYear;\n    proto.isoWeeksInYear = getISOWeeksInYear;\n    proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\n    proto.date = getSetDayOfMonth;\n    proto.day = proto.days = getSetDayOfWeek;\n    proto.weekday = getSetLocaleDayOfWeek;\n    proto.isoWeekday = getSetISODayOfWeek;\n    proto.dayOfYear = getSetDayOfYear;\n    proto.hour = proto.hours = getSetHour;\n    proto.minute = proto.minutes = getSetMinute;\n    proto.second = proto.seconds = getSetSecond;\n    proto.millisecond = proto.milliseconds = getSetMillisecond;\n    proto.utcOffset = getSetOffset;\n    proto.utc = setOffsetToUTC;\n    proto.local = setOffsetToLocal;\n    proto.parseZone = setOffsetToParsedOffset;\n    proto.hasAlignedHourOffset = hasAlignedHourOffset;\n    proto.isDST = isDaylightSavingTime;\n    proto.isLocal = isLocal;\n    proto.isUtcOffset = isUtcOffset;\n    proto.isUtc = isUtc;\n    proto.isUTC = isUtc;\n    proto.zoneAbbr = getZoneAbbr;\n    proto.zoneName = getZoneName;\n    proto.dates = deprecate(\n        'dates accessor is deprecated. Use date instead.',\n        getSetDayOfMonth\n    );\n    proto.months = deprecate(\n        'months accessor is deprecated. Use month instead',\n        getSetMonth\n    );\n    proto.years = deprecate(\n        'years accessor is deprecated. Use year instead',\n        getSetYear\n    );\n    proto.zone = deprecate(\n        'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',\n        getSetZone\n    );\n    proto.isDSTShifted = deprecate(\n        'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',\n        isDaylightSavingTimeShifted\n    );\n\n    function createUnix(input) {\n        return createLocal(input * 1000);\n    }\n\n    function createInZone() {\n        return createLocal.apply(null, arguments).parseZone();\n    }\n\n    function preParsePostFormat(string) {\n        return string;\n    }\n\n    var proto$1 = Locale.prototype;\n\n    proto$1.calendar = calendar;\n    proto$1.longDateFormat = longDateFormat;\n    proto$1.invalidDate = invalidDate;\n    proto$1.ordinal = ordinal;\n    proto$1.preparse = preParsePostFormat;\n    proto$1.postformat = preParsePostFormat;\n    proto$1.relativeTime = relativeTime;\n    proto$1.pastFuture = pastFuture;\n    proto$1.set = set;\n    proto$1.eras = localeEras;\n    proto$1.erasParse = localeErasParse;\n    proto$1.erasConvertYear = localeErasConvertYear;\n    proto$1.erasAbbrRegex = erasAbbrRegex;\n    proto$1.erasNameRegex = erasNameRegex;\n    proto$1.erasNarrowRegex = erasNarrowRegex;\n\n    proto$1.months = localeMonths;\n    proto$1.monthsShort = localeMonthsShort;\n    proto$1.monthsParse = localeMonthsParse;\n    proto$1.monthsRegex = monthsRegex;\n    proto$1.monthsShortRegex = monthsShortRegex;\n    proto$1.week = localeWeek;\n    proto$1.firstDayOfYear = localeFirstDayOfYear;\n    proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n    proto$1.weekdays = localeWeekdays;\n    proto$1.weekdaysMin = localeWeekdaysMin;\n    proto$1.weekdaysShort = localeWeekdaysShort;\n    proto$1.weekdaysParse = localeWeekdaysParse;\n\n    proto$1.weekdaysRegex = weekdaysRegex;\n    proto$1.weekdaysShortRegex = weekdaysShortRegex;\n    proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n    proto$1.isPM = localeIsPM;\n    proto$1.meridiem = localeMeridiem;\n\n    function get$1(format, index, field, setter) {\n        var locale = getLocale(),\n            utc = createUTC().set(setter, index);\n        return locale[field](utc, format);\n    }\n\n    function listMonthsImpl(format, index, field) {\n        if (isNumber(format)) {\n            index = format;\n            format = undefined;\n        }\n\n        format = format || '';\n\n        if (index != null) {\n            return get$1(format, index, field, 'month');\n        }\n\n        var i,\n            out = [];\n        for (i = 0; i < 12; i++) {\n            out[i] = get$1(format, i, field, 'month');\n        }\n        return out;\n    }\n\n    // ()\n    // (5)\n    // (fmt, 5)\n    // (fmt)\n    // (true)\n    // (true, 5)\n    // (true, fmt, 5)\n    // (true, fmt)\n    function listWeekdaysImpl(localeSorted, format, index, field) {\n        if (typeof localeSorted === 'boolean') {\n            if (isNumber(format)) {\n                index = format;\n                format = undefined;\n            }\n\n            format = format || '';\n        } else {\n            format = localeSorted;\n            index = format;\n            localeSorted = false;\n\n            if (isNumber(format)) {\n                index = format;\n                format = undefined;\n            }\n\n            format = format || '';\n        }\n\n        var locale = getLocale(),\n            shift = localeSorted ? locale._week.dow : 0,\n            i,\n            out = [];\n\n        if (index != null) {\n            return get$1(format, (index + shift) % 7, field, 'day');\n        }\n\n        for (i = 0; i < 7; i++) {\n            out[i] = get$1(format, (i + shift) % 7, field, 'day');\n        }\n        return out;\n    }\n\n    function listMonths(format, index) {\n        return listMonthsImpl(format, index, 'months');\n    }\n\n    function listMonthsShort(format, index) {\n        return listMonthsImpl(format, index, 'monthsShort');\n    }\n\n    function listWeekdays(localeSorted, format, index) {\n        return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n    }\n\n    function listWeekdaysShort(localeSorted, format, index) {\n        return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n    }\n\n    function listWeekdaysMin(localeSorted, format, index) {\n        return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n    }\n\n    getSetGlobalLocale('en', {\n        eras: [\n            {\n                since: '0001-01-01',\n                until: +Infinity,\n                offset: 1,\n                name: 'Anno Domini',\n                narrow: 'AD',\n                abbr: 'AD',\n            },\n            {\n                since: '0000-12-31',\n                until: -Infinity,\n                offset: 1,\n                name: 'Before Christ',\n                narrow: 'BC',\n                abbr: 'BC',\n            },\n        ],\n        dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    toInt((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n    });\n\n    // Side effect imports\n\n    hooks.lang = deprecate(\n        'moment.lang is deprecated. Use moment.locale instead.',\n        getSetGlobalLocale\n    );\n    hooks.langData = deprecate(\n        'moment.langData is deprecated. Use moment.localeData instead.',\n        getLocale\n    );\n\n    var mathAbs = Math.abs;\n\n    function abs() {\n        var data = this._data;\n\n        this._milliseconds = mathAbs(this._milliseconds);\n        this._days = mathAbs(this._days);\n        this._months = mathAbs(this._months);\n\n        data.milliseconds = mathAbs(data.milliseconds);\n        data.seconds = mathAbs(data.seconds);\n        data.minutes = mathAbs(data.minutes);\n        data.hours = mathAbs(data.hours);\n        data.months = mathAbs(data.months);\n        data.years = mathAbs(data.years);\n\n        return this;\n    }\n\n    function addSubtract$1(duration, input, value, direction) {\n        var other = createDuration(input, value);\n\n        duration._milliseconds += direction * other._milliseconds;\n        duration._days += direction * other._days;\n        duration._months += direction * other._months;\n\n        return duration._bubble();\n    }\n\n    // supports only 2.0-style add(1, 's') or add(duration)\n    function add$1(input, value) {\n        return addSubtract$1(this, input, value, 1);\n    }\n\n    // supports only 2.0-style subtract(1, 's') or subtract(duration)\n    function subtract$1(input, value) {\n        return addSubtract$1(this, input, value, -1);\n    }\n\n    function absCeil(number) {\n        if (number < 0) {\n            return Math.floor(number);\n        } else {\n            return Math.ceil(number);\n        }\n    }\n\n    function bubble() {\n        var milliseconds = this._milliseconds,\n            days = this._days,\n            months = this._months,\n            data = this._data,\n            seconds,\n            minutes,\n            hours,\n            years,\n            monthsFromDays;\n\n        // if we have a mix of positive and negative values, bubble down first\n        // check: https://github.com/moment/moment/issues/2166\n        if (\n            !(\n                (milliseconds >= 0 && days >= 0 && months >= 0) ||\n                (milliseconds <= 0 && days <= 0 && months <= 0)\n            )\n        ) {\n            milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n            days = 0;\n            months = 0;\n        }\n\n        // The following code bubbles up values, see the tests for\n        // examples of what that means.\n        data.milliseconds = milliseconds % 1000;\n\n        seconds = absFloor(milliseconds / 1000);\n        data.seconds = seconds % 60;\n\n        minutes = absFloor(seconds / 60);\n        data.minutes = minutes % 60;\n\n        hours = absFloor(minutes / 60);\n        data.hours = hours % 24;\n\n        days += absFloor(hours / 24);\n\n        // convert days to months\n        monthsFromDays = absFloor(daysToMonths(days));\n        months += monthsFromDays;\n        days -= absCeil(monthsToDays(monthsFromDays));\n\n        // 12 months -> 1 year\n        years = absFloor(months / 12);\n        months %= 12;\n\n        data.days = days;\n        data.months = months;\n        data.years = years;\n\n        return this;\n    }\n\n    function daysToMonths(days) {\n        // 400 years have 146097 days (taking into account leap year rules)\n        // 400 years have 12 months === 4800\n        return (days * 4800) / 146097;\n    }\n\n    function monthsToDays(months) {\n        // the reverse of daysToMonths\n        return (months * 146097) / 4800;\n    }\n\n    function as(units) {\n        if (!this.isValid()) {\n            return NaN;\n        }\n        var days,\n            months,\n            milliseconds = this._milliseconds;\n\n        units = normalizeUnits(units);\n\n        if (units === 'month' || units === 'quarter' || units === 'year') {\n            days = this._days + milliseconds / 864e5;\n            months = this._months + daysToMonths(days);\n            switch (units) {\n                case 'month':\n                    return months;\n                case 'quarter':\n                    return months / 3;\n                case 'year':\n                    return months / 12;\n            }\n        } else {\n            // handle milliseconds separately because of floating point math errors (issue #1867)\n            days = this._days + Math.round(monthsToDays(this._months));\n            switch (units) {\n                case 'week':\n                    return days / 7 + milliseconds / 6048e5;\n                case 'day':\n                    return days + milliseconds / 864e5;\n                case 'hour':\n                    return days * 24 + milliseconds / 36e5;\n                case 'minute':\n                    return days * 1440 + milliseconds / 6e4;\n                case 'second':\n                    return days * 86400 + milliseconds / 1000;\n                // Math.floor prevents floating point math errors here\n                case 'millisecond':\n                    return Math.floor(days * 864e5) + milliseconds;\n                default:\n                    throw new Error('Unknown unit ' + units);\n            }\n        }\n    }\n\n    // TODO: Use this.as('ms')?\n    function valueOf$1() {\n        if (!this.isValid()) {\n            return NaN;\n        }\n        return (\n            this._milliseconds +\n            this._days * 864e5 +\n            (this._months % 12) * 2592e6 +\n            toInt(this._months / 12) * 31536e6\n        );\n    }\n\n    function makeAs(alias) {\n        return function () {\n            return this.as(alias);\n        };\n    }\n\n    var asMilliseconds = makeAs('ms'),\n        asSeconds = makeAs('s'),\n        asMinutes = makeAs('m'),\n        asHours = makeAs('h'),\n        asDays = makeAs('d'),\n        asWeeks = makeAs('w'),\n        asMonths = makeAs('M'),\n        asQuarters = makeAs('Q'),\n        asYears = makeAs('y');\n\n    function clone$1() {\n        return createDuration(this);\n    }\n\n    function get$2(units) {\n        units = normalizeUnits(units);\n        return this.isValid() ? this[units + 's']() : NaN;\n    }\n\n    function makeGetter(name) {\n        return function () {\n            return this.isValid() ? this._data[name] : NaN;\n        };\n    }\n\n    var milliseconds = makeGetter('milliseconds'),\n        seconds = makeGetter('seconds'),\n        minutes = makeGetter('minutes'),\n        hours = makeGetter('hours'),\n        days = makeGetter('days'),\n        months = makeGetter('months'),\n        years = makeGetter('years');\n\n    function weeks() {\n        return absFloor(this.days() / 7);\n    }\n\n    var round = Math.round,\n        thresholds = {\n            ss: 44, // a few seconds to seconds\n            s: 45, // seconds to minute\n            m: 45, // minutes to hour\n            h: 22, // hours to day\n            d: 26, // days to month/week\n            w: null, // weeks to month\n            M: 11, // months to year\n        };\n\n    // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n    function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n        return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n    }\n\n    function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n        var duration = createDuration(posNegDuration).abs(),\n            seconds = round(duration.as('s')),\n            minutes = round(duration.as('m')),\n            hours = round(duration.as('h')),\n            days = round(duration.as('d')),\n            months = round(duration.as('M')),\n            weeks = round(duration.as('w')),\n            years = round(duration.as('y')),\n            a =\n                (seconds <= thresholds.ss && ['s', seconds]) ||\n                (seconds < thresholds.s && ['ss', seconds]) ||\n                (minutes <= 1 && ['m']) ||\n                (minutes < thresholds.m && ['mm', minutes]) ||\n                (hours <= 1 && ['h']) ||\n                (hours < thresholds.h && ['hh', hours]) ||\n                (days <= 1 && ['d']) ||\n                (days < thresholds.d && ['dd', days]);\n\n        if (thresholds.w != null) {\n            a =\n                a ||\n                (weeks <= 1 && ['w']) ||\n                (weeks < thresholds.w && ['ww', weeks]);\n        }\n        a = a ||\n            (months <= 1 && ['M']) ||\n            (months < thresholds.M && ['MM', months]) ||\n            (years <= 1 && ['y']) || ['yy', years];\n\n        a[2] = withoutSuffix;\n        a[3] = +posNegDuration > 0;\n        a[4] = locale;\n        return substituteTimeAgo.apply(null, a);\n    }\n\n    // This function allows you to set the rounding function for relative time strings\n    function getSetRelativeTimeRounding(roundingFunction) {\n        if (roundingFunction === undefined) {\n            return round;\n        }\n        if (typeof roundingFunction === 'function') {\n            round = roundingFunction;\n            return true;\n        }\n        return false;\n    }\n\n    // This function allows you to set a threshold for relative time strings\n    function getSetRelativeTimeThreshold(threshold, limit) {\n        if (thresholds[threshold] === undefined) {\n            return false;\n        }\n        if (limit === undefined) {\n            return thresholds[threshold];\n        }\n        thresholds[threshold] = limit;\n        if (threshold === 's') {\n            thresholds.ss = limit - 1;\n        }\n        return true;\n    }\n\n    function humanize(argWithSuffix, argThresholds) {\n        if (!this.isValid()) {\n            return this.localeData().invalidDate();\n        }\n\n        var withSuffix = false,\n            th = thresholds,\n            locale,\n            output;\n\n        if (typeof argWithSuffix === 'object') {\n            argThresholds = argWithSuffix;\n            argWithSuffix = false;\n        }\n        if (typeof argWithSuffix === 'boolean') {\n            withSuffix = argWithSuffix;\n        }\n        if (typeof argThresholds === 'object') {\n            th = Object.assign({}, thresholds, argThresholds);\n            if (argThresholds.s != null && argThresholds.ss == null) {\n                th.ss = argThresholds.s - 1;\n            }\n        }\n\n        locale = this.localeData();\n        output = relativeTime$1(this, !withSuffix, th, locale);\n\n        if (withSuffix) {\n            output = locale.pastFuture(+this, output);\n        }\n\n        return locale.postformat(output);\n    }\n\n    var abs$1 = Math.abs;\n\n    function sign(x) {\n        return (x > 0) - (x < 0) || +x;\n    }\n\n    function toISOString$1() {\n        // for ISO strings we do not use the normal bubbling rules:\n        //  * milliseconds bubble up until they become hours\n        //  * days do not bubble at all\n        //  * months bubble up until they become years\n        // This is because there is no context-free conversion between hours and days\n        // (think of clock changes)\n        // and also not between days and months (28-31 days per month)\n        if (!this.isValid()) {\n            return this.localeData().invalidDate();\n        }\n\n        var seconds = abs$1(this._milliseconds) / 1000,\n            days = abs$1(this._days),\n            months = abs$1(this._months),\n            minutes,\n            hours,\n            years,\n            s,\n            total = this.asSeconds(),\n            totalSign,\n            ymSign,\n            daysSign,\n            hmsSign;\n\n        if (!total) {\n            // this is the same as C#'s (Noda) and python (isodate)...\n            // but not other JS (goog.date)\n            return 'P0D';\n        }\n\n        // 3600 seconds -> 60 minutes -> 1 hour\n        minutes = absFloor(seconds / 60);\n        hours = absFloor(minutes / 60);\n        seconds %= 60;\n        minutes %= 60;\n\n        // 12 months -> 1 year\n        years = absFloor(months / 12);\n        months %= 12;\n\n        // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n        s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n\n        totalSign = total < 0 ? '-' : '';\n        ymSign = sign(this._months) !== sign(total) ? '-' : '';\n        daysSign = sign(this._days) !== sign(total) ? '-' : '';\n        hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n\n        return (\n            totalSign +\n            'P' +\n            (years ? ymSign + years + 'Y' : '') +\n            (months ? ymSign + months + 'M' : '') +\n            (days ? daysSign + days + 'D' : '') +\n            (hours || minutes || seconds ? 'T' : '') +\n            (hours ? hmsSign + hours + 'H' : '') +\n            (minutes ? hmsSign + minutes + 'M' : '') +\n            (seconds ? hmsSign + s + 'S' : '')\n        );\n    }\n\n    var proto$2 = Duration.prototype;\n\n    proto$2.isValid = isValid$1;\n    proto$2.abs = abs;\n    proto$2.add = add$1;\n    proto$2.subtract = subtract$1;\n    proto$2.as = as;\n    proto$2.asMilliseconds = asMilliseconds;\n    proto$2.asSeconds = asSeconds;\n    proto$2.asMinutes = asMinutes;\n    proto$2.asHours = asHours;\n    proto$2.asDays = asDays;\n    proto$2.asWeeks = asWeeks;\n    proto$2.asMonths = asMonths;\n    proto$2.asQuarters = asQuarters;\n    proto$2.asYears = asYears;\n    proto$2.valueOf = valueOf$1;\n    proto$2._bubble = bubble;\n    proto$2.clone = clone$1;\n    proto$2.get = get$2;\n    proto$2.milliseconds = milliseconds;\n    proto$2.seconds = seconds;\n    proto$2.minutes = minutes;\n    proto$2.hours = hours;\n    proto$2.days = days;\n    proto$2.weeks = weeks;\n    proto$2.months = months;\n    proto$2.years = years;\n    proto$2.humanize = humanize;\n    proto$2.toISOString = toISOString$1;\n    proto$2.toString = toISOString$1;\n    proto$2.toJSON = toISOString$1;\n    proto$2.locale = locale;\n    proto$2.localeData = localeData;\n\n    proto$2.toIsoString = deprecate(\n        'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',\n        toISOString$1\n    );\n    proto$2.lang = lang;\n\n    // FORMATTING\n\n    addFormatToken('X', 0, 0, 'unix');\n    addFormatToken('x', 0, 0, 'valueOf');\n\n    // PARSING\n\n    addRegexToken('x', matchSigned);\n    addRegexToken('X', matchTimestamp);\n    addParseToken('X', function (input, array, config) {\n        config._d = new Date(parseFloat(input) * 1000);\n    });\n    addParseToken('x', function (input, array, config) {\n        config._d = new Date(toInt(input));\n    });\n\n    //! moment.js\n\n    hooks.version = '2.29.4';\n\n    setHookCallback(createLocal);\n\n    hooks.fn = proto;\n    hooks.min = min;\n    hooks.max = max;\n    hooks.now = now;\n    hooks.utc = createUTC;\n    hooks.unix = createUnix;\n    hooks.months = listMonths;\n    hooks.isDate = isDate;\n    hooks.locale = getSetGlobalLocale;\n    hooks.invalid = createInvalid;\n    hooks.duration = createDuration;\n    hooks.isMoment = isMoment;\n    hooks.weekdays = listWeekdays;\n    hooks.parseZone = createInZone;\n    hooks.localeData = getLocale;\n    hooks.isDuration = isDuration;\n    hooks.monthsShort = listMonthsShort;\n    hooks.weekdaysMin = listWeekdaysMin;\n    hooks.defineLocale = defineLocale;\n    hooks.updateLocale = updateLocale;\n    hooks.locales = listLocales;\n    hooks.weekdaysShort = listWeekdaysShort;\n    hooks.normalizeUnits = normalizeUnits;\n    hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n    hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n    hooks.calendarFormat = getCalendarFormat;\n    hooks.prototype = proto;\n\n    // currently HTML5 input type only supports 24-hour formats\n    hooks.HTML5_FMT = {\n        DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type=\"datetime-local\" />\n        DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type=\"datetime-local\" step=\"1\" />\n        DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type=\"datetime-local\" step=\"0.001\" />\n        DATE: 'YYYY-MM-DD', // <input type=\"date\" />\n        TIME: 'HH:mm', // <input type=\"time\" />\n        TIME_SECONDS: 'HH:mm:ss', // <input type=\"time\" step=\"1\" />\n        TIME_MS: 'HH:mm:ss.SSS', // <input type=\"time\" step=\"0.001\" />\n        WEEK: 'GGGG-[W]WW', // <input type=\"week\" />\n        MONTH: 'YYYY-MM', // <input type=\"month\" />\n    };\n\n    return hooks;\n\n})));\n\n\n//# sourceURL=webpack://frontend/./node_modules/moment/moment.js?");

/***/ }),

/***/ "./node_modules/plotly.js-cartesian-dist/plotly-cartesian.js":
/*!*******************************************************************!*\
  !*** ./node_modules/plotly.js-cartesian-dist/plotly-cartesian.js ***!
  \*******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("/**\n* plotly.js (cartesian) v1.54.6\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n* Licensed under the MIT license\n*/\n(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=undefined;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=undefined,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){\n'use strict';\n\nvar Lib = _dereq_('../src/lib');\nvar rules = {\n    \"X,X div\": \"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;\",\n    \"X input,X button\": \"font-family:'Open Sans', verdana, arial, sans-serif;\",\n    \"X input:focus,X button:focus\": \"outline:none;\",\n    \"X a\": \"text-decoration:none;\",\n    \"X a:hover\": \"text-decoration:none;\",\n    \"X .crisp\": \"shape-rendering:crispEdges;\",\n    \"X .user-select-none\": \"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\n    \"X svg\": \"overflow:hidden;\",\n    \"X svg a\": \"fill:#447adb;\",\n    \"X svg a:hover\": \"fill:#3c6dc5;\",\n    \"X .main-svg\": \"position:absolute;top:0;left:0;pointer-events:none;\",\n    \"X .main-svg .draglayer\": \"pointer-events:all;\",\n    \"X .cursor-default\": \"cursor:default;\",\n    \"X .cursor-pointer\": \"cursor:pointer;\",\n    \"X .cursor-crosshair\": \"cursor:crosshair;\",\n    \"X .cursor-move\": \"cursor:move;\",\n    \"X .cursor-col-resize\": \"cursor:col-resize;\",\n    \"X .cursor-row-resize\": \"cursor:row-resize;\",\n    \"X .cursor-ns-resize\": \"cursor:ns-resize;\",\n    \"X .cursor-ew-resize\": \"cursor:ew-resize;\",\n    \"X .cursor-sw-resize\": \"cursor:sw-resize;\",\n    \"X .cursor-s-resize\": \"cursor:s-resize;\",\n    \"X .cursor-se-resize\": \"cursor:se-resize;\",\n    \"X .cursor-w-resize\": \"cursor:w-resize;\",\n    \"X .cursor-e-resize\": \"cursor:e-resize;\",\n    \"X .cursor-nw-resize\": \"cursor:nw-resize;\",\n    \"X .cursor-n-resize\": \"cursor:n-resize;\",\n    \"X .cursor-ne-resize\": \"cursor:ne-resize;\",\n    \"X .cursor-grab\": \"cursor:-webkit-grab;cursor:grab;\",\n    \"X .modebar\": \"position:absolute;top:2px;right:2px;\",\n    \"X .ease-bg\": \"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;\",\n    \"X .modebar--hover>:not(.watermark)\": \"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;\",\n    \"X:hover .modebar--hover .modebar-group\": \"opacity:1;\",\n    \"X .modebar-group\": \"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\n    \"X .modebar-btn\": \"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\n    \"X .modebar-btn svg\": \"position:relative;top:2px;\",\n    \"X .modebar.vertical\": \"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;\",\n    \"X .modebar.vertical svg\": \"top:-1px;\",\n    \"X .modebar.vertical .modebar-group\": \"display:block;float:none;padding-left:0px;padding-bottom:8px;\",\n    \"X .modebar.vertical .modebar-group .modebar-btn\": \"display:block;text-align:center;\",\n    \"X [data-title]:before,X [data-title]:after\": \"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\n    \"X [data-title]:hover:before,X [data-title]:hover:after\": \"display:block;opacity:1;\",\n    \"X [data-title]:before\": \"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;\",\n    \"X [data-title]:after\": \"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;\",\n    \"X .vertical [data-title]:before,X .vertical [data-title]:after\": \"top:0%;right:200%;\",\n    \"X .vertical [data-title]:before\": \"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;\",\n    \"X .select-outline\": \"fill:none;stroke-width:1;shape-rendering:crispEdges;\",\n    \"X .select-outline-1\": \"stroke:white;\",\n    \"X .select-outline-2\": \"stroke:black;stroke-dasharray:2px 2px;\",\n    Y: \"font-family:'Open Sans', verdana, arial, sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;\",\n    \"Y p\": \"margin:0;\",\n    \"Y .notifier-note\": \"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;\",\n    \"Y .notifier-close\": \"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;\",\n    \"Y .notifier-close:hover\": \"color:#444;text-decoration:none;cursor:pointer;\"\n};\n\nfor(var selector in rules) {\n    var fullSelector = selector.replace(/^,/,' ,')\n        .replace(/X/g, '.js-plotly-plot .plotly')\n        .replace(/Y/g, '.plotly-notifier');\n    Lib.addStyleRule(fullSelector, rules[selector]);\n}\n\n},{\"../src/lib\":178}],2:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/bar');\n\n},{\"../src/traces/bar\":287}],3:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/box');\n\n},{\"../src/traces/box\":302}],4:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/contour');\n\n},{\"../src/traces/contour\":322}],5:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/core');\n\n},{\"../src/core\":160}],6:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/heatmap');\n\n},{\"../src/traces/heatmap\":338}],7:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/histogram');\n\n},{\"../src/traces/histogram\":356}],8:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/histogram2d');\n\n},{\"../src/traces/histogram2d\":362}],9:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/histogram2dcontour');\n\n},{\"../src/traces/histogram2dcontour\":366}],10:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/image');\n\n},{\"../src/traces/image\":373}],11:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Plotly = _dereq_('./core');\n\nPlotly.register([\n    _dereq_('./bar'),\n    _dereq_('./box'),\n    _dereq_('./heatmap'),\n    _dereq_('./histogram'),\n    _dereq_('./histogram2d'),\n    _dereq_('./histogram2dcontour'),\n    _dereq_('./image'),\n    _dereq_('./pie'),\n    _dereq_('./contour'),\n    _dereq_('./scatterternary'),\n    _dereq_('./violin')\n]);\n\nmodule.exports = Plotly;\n\n},{\"./bar\":2,\"./box\":3,\"./contour\":4,\"./core\":5,\"./heatmap\":6,\"./histogram\":7,\"./histogram2d\":8,\"./histogram2dcontour\":9,\"./image\":10,\"./pie\":12,\"./scatterternary\":13,\"./violin\":14}],12:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/pie');\n\n},{\"../src/traces/pie\":382}],13:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/scatterternary');\n\n},{\"../src/traces/scatterternary\":422}],14:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = _dereq_('../src/traces/violin');\n\n},{\"../src/traces/violin\":430}],15:[function(_dereq_,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar objectCreate = Object.create || objectCreatePolyfill\nvar objectKeys = Object.keys || objectKeysPolyfill\nvar bind = Function.prototype.bind || functionBindPolyfill\n\nfunction EventEmitter() {\n  if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) {\n    this._events = objectCreate(null);\n    this._eventsCount = 0;\n  }\n\n  this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nvar hasDefineProperty;\ntry {\n  var o = {};\n  if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 });\n  hasDefineProperty = o.x === 0;\n} catch (err) { hasDefineProperty = false }\nif (hasDefineProperty) {\n  Object.defineProperty(EventEmitter, 'defaultMaxListeners', {\n    enumerable: true,\n    get: function() {\n      return defaultMaxListeners;\n    },\n    set: function(arg) {\n      // check whether the input is a positive number (whose value is zero or\n      // greater and not a NaN).\n      if (typeof arg !== 'number' || arg < 0 || arg !== arg)\n        throw new TypeError('\"defaultMaxListeners\" must be a positive number');\n      defaultMaxListeners = arg;\n    }\n  });\n} else {\n  EventEmitter.defaultMaxListeners = defaultMaxListeners;\n}\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n  if (typeof n !== 'number' || n < 0 || isNaN(n))\n    throw new TypeError('\"n\" argument must be a positive number');\n  this._maxListeners = n;\n  return this;\n};\n\nfunction $getMaxListeners(that) {\n  if (that._maxListeners === undefined)\n    return EventEmitter.defaultMaxListeners;\n  return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n  return $getMaxListeners(this);\n};\n\n// These standalone emit* functions are used to optimize calling of event\n// handlers for fast cases because emit() itself often has a variable number of\n// arguments and can be deoptimized because of that. These functions always have\n// the same number of arguments and thus do not get deoptimized, so the code\n// inside them can execute faster.\nfunction emitNone(handler, isFn, self) {\n  if (isFn)\n    handler.call(self);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].call(self);\n  }\n}\nfunction emitOne(handler, isFn, self, arg1) {\n  if (isFn)\n    handler.call(self, arg1);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].call(self, arg1);\n  }\n}\nfunction emitTwo(handler, isFn, self, arg1, arg2) {\n  if (isFn)\n    handler.call(self, arg1, arg2);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].call(self, arg1, arg2);\n  }\n}\nfunction emitThree(handler, isFn, self, arg1, arg2, arg3) {\n  if (isFn)\n    handler.call(self, arg1, arg2, arg3);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].call(self, arg1, arg2, arg3);\n  }\n}\n\nfunction emitMany(handler, isFn, self, args) {\n  if (isFn)\n    handler.apply(self, args);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].apply(self, args);\n  }\n}\n\nEventEmitter.prototype.emit = function emit(type) {\n  var er, handler, len, args, i, events;\n  var doError = (type === 'error');\n\n  events = this._events;\n  if (events)\n    doError = (doError && events.error == null);\n  else if (!doError)\n    return false;\n\n  // If there is no 'error' event listener then throw.\n  if (doError) {\n    if (arguments.length > 1)\n      er = arguments[1];\n    if (er instanceof Error) {\n      throw er; // Unhandled 'error' event\n    } else {\n      // At least give some kind of context to the user\n      var err = new Error('Unhandled \"error\" event. (' + er + ')');\n      err.context = er;\n      throw err;\n    }\n    return false;\n  }\n\n  handler = events[type];\n\n  if (!handler)\n    return false;\n\n  var isFn = typeof handler === 'function';\n  len = arguments.length;\n  switch (len) {\n      // fast cases\n    case 1:\n      emitNone(handler, isFn, this);\n      break;\n    case 2:\n      emitOne(handler, isFn, this, arguments[1]);\n      break;\n    case 3:\n      emitTwo(handler, isFn, this, arguments[1], arguments[2]);\n      break;\n    case 4:\n      emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);\n      break;\n      // slower\n    default:\n      args = new Array(len - 1);\n      for (i = 1; i < len; i++)\n        args[i - 1] = arguments[i];\n      emitMany(handler, isFn, this, args);\n  }\n\n  return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n  var m;\n  var events;\n  var existing;\n\n  if (typeof listener !== 'function')\n    throw new TypeError('\"listener\" argument must be a function');\n\n  events = target._events;\n  if (!events) {\n    events = target._events = objectCreate(null);\n    target._eventsCount = 0;\n  } else {\n    // To avoid recursion in the case that type === \"newListener\"! Before\n    // adding it to the listeners, first emit \"newListener\".\n    if (events.newListener) {\n      target.emit('newListener', type,\n          listener.listener ? listener.listener : listener);\n\n      // Re-assign `events` because a newListener handler could have caused the\n      // this._events to be assigned to a new object\n      events = target._events;\n    }\n    existing = events[type];\n  }\n\n  if (!existing) {\n    // Optimize the case of one listener. Don't need the extra array object.\n    existing = events[type] = listener;\n    ++target._eventsCount;\n  } else {\n    if (typeof existing === 'function') {\n      // Adding the second element, need to change to array.\n      existing = events[type] =\n          prepend ? [listener, existing] : [existing, listener];\n    } else {\n      // If we've already got an array, just append.\n      if (prepend) {\n        existing.unshift(listener);\n      } else {\n        existing.push(listener);\n      }\n    }\n\n    // Check for listener leak\n    if (!existing.warned) {\n      m = $getMaxListeners(target);\n      if (m && m > 0 && existing.length > m) {\n        existing.warned = true;\n        var w = new Error('Possible EventEmitter memory leak detected. ' +\n            existing.length + ' \"' + String(type) + '\" listeners ' +\n            'added. Use emitter.setMaxListeners() to ' +\n            'increase limit.');\n        w.name = 'MaxListenersExceededWarning';\n        w.emitter = target;\n        w.type = type;\n        w.count = existing.length;\n        if (typeof console === 'object' && console.warn) {\n          console.warn('%s: %s', w.name, w.message);\n        }\n      }\n    }\n  }\n\n  return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n  return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n    function prependListener(type, listener) {\n      return _addListener(this, type, listener, true);\n    };\n\nfunction onceWrapper() {\n  if (!this.fired) {\n    this.target.removeListener(this.type, this.wrapFn);\n    this.fired = true;\n    switch (arguments.length) {\n      case 0:\n        return this.listener.call(this.target);\n      case 1:\n        return this.listener.call(this.target, arguments[0]);\n      case 2:\n        return this.listener.call(this.target, arguments[0], arguments[1]);\n      case 3:\n        return this.listener.call(this.target, arguments[0], arguments[1],\n            arguments[2]);\n      default:\n        var args = new Array(arguments.length);\n        for (var i = 0; i < args.length; ++i)\n          args[i] = arguments[i];\n        this.listener.apply(this.target, args);\n    }\n  }\n}\n\nfunction _onceWrap(target, type, listener) {\n  var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n  var wrapped = bind.call(onceWrapper, state);\n  wrapped.listener = listener;\n  state.wrapFn = wrapped;\n  return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n  if (typeof listener !== 'function')\n    throw new TypeError('\"listener\" argument must be a function');\n  this.on(type, _onceWrap(this, type, listener));\n  return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n    function prependOnceListener(type, listener) {\n      if (typeof listener !== 'function')\n        throw new TypeError('\"listener\" argument must be a function');\n      this.prependListener(type, _onceWrap(this, type, listener));\n      return this;\n    };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n    function removeListener(type, listener) {\n      var list, events, position, i, originalListener;\n\n      if (typeof listener !== 'function')\n        throw new TypeError('\"listener\" argument must be a function');\n\n      events = this._events;\n      if (!events)\n        return this;\n\n      list = events[type];\n      if (!list)\n        return this;\n\n      if (list === listener || list.listener === listener) {\n        if (--this._eventsCount === 0)\n          this._events = objectCreate(null);\n        else {\n          delete events[type];\n          if (events.removeListener)\n            this.emit('removeListener', type, list.listener || listener);\n        }\n      } else if (typeof list !== 'function') {\n        position = -1;\n\n        for (i = list.length - 1; i >= 0; i--) {\n          if (list[i] === listener || list[i].listener === listener) {\n            originalListener = list[i].listener;\n            position = i;\n            break;\n          }\n        }\n\n        if (position < 0)\n          return this;\n\n        if (position === 0)\n          list.shift();\n        else\n          spliceOne(list, position);\n\n        if (list.length === 1)\n          events[type] = list[0];\n\n        if (events.removeListener)\n          this.emit('removeListener', type, originalListener || listener);\n      }\n\n      return this;\n    };\n\nEventEmitter.prototype.removeAllListeners =\n    function removeAllListeners(type) {\n      var listeners, events, i;\n\n      events = this._events;\n      if (!events)\n        return this;\n\n      // not listening for removeListener, no need to emit\n      if (!events.removeListener) {\n        if (arguments.length === 0) {\n          this._events = objectCreate(null);\n          this._eventsCount = 0;\n        } else if (events[type]) {\n          if (--this._eventsCount === 0)\n            this._events = objectCreate(null);\n          else\n            delete events[type];\n        }\n        return this;\n      }\n\n      // emit removeListener for all listeners on all events\n      if (arguments.length === 0) {\n        var keys = objectKeys(events);\n        var key;\n        for (i = 0; i < keys.length; ++i) {\n          key = keys[i];\n          if (key === 'removeListener') continue;\n          this.removeAllListeners(key);\n        }\n        this.removeAllListeners('removeListener');\n        this._events = objectCreate(null);\n        this._eventsCount = 0;\n        return this;\n      }\n\n      listeners = events[type];\n\n      if (typeof listeners === 'function') {\n        this.removeListener(type, listeners);\n      } else if (listeners) {\n        // LIFO order\n        for (i = listeners.length - 1; i >= 0; i--) {\n          this.removeListener(type, listeners[i]);\n        }\n      }\n\n      return this;\n    };\n\nfunction _listeners(target, type, unwrap) {\n  var events = target._events;\n\n  if (!events)\n    return [];\n\n  var evlistener = events[type];\n  if (!evlistener)\n    return [];\n\n  if (typeof evlistener === 'function')\n    return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n  return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n  return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n  return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n  if (typeof emitter.listenerCount === 'function') {\n    return emitter.listenerCount(type);\n  } else {\n    return listenerCount.call(emitter, type);\n  }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n  var events = this._events;\n\n  if (events) {\n    var evlistener = events[type];\n\n    if (typeof evlistener === 'function') {\n      return 1;\n    } else if (evlistener) {\n      return evlistener.length;\n    }\n  }\n\n  return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n  return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];\n};\n\n// About 1.5x faster than the two-arg version of Array#splice().\nfunction spliceOne(list, index) {\n  for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)\n    list[i] = list[k];\n  list.pop();\n}\n\nfunction arrayClone(arr, n) {\n  var copy = new Array(n);\n  for (var i = 0; i < n; ++i)\n    copy[i] = arr[i];\n  return copy;\n}\n\nfunction unwrapListeners(arr) {\n  var ret = new Array(arr.length);\n  for (var i = 0; i < ret.length; ++i) {\n    ret[i] = arr[i].listener || arr[i];\n  }\n  return ret;\n}\n\nfunction objectCreatePolyfill(proto) {\n  var F = function() {};\n  F.prototype = proto;\n  return new F;\n}\nfunction objectKeysPolyfill(obj) {\n  var keys = [];\n  for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) {\n    keys.push(k);\n  }\n  return k;\n}\nfunction functionBindPolyfill(context) {\n  var fn = this;\n  return function () {\n    return fn.apply(context, arguments);\n  };\n}\n\n},{}],16:[function(_dereq_,module,exports){\n!function() {\n  var d3 = {\n    version: \"3.5.17\"\n  };\n  var d3_arraySlice = [].slice, d3_array = function(list) {\n    return d3_arraySlice.call(list);\n  };\n  var d3_document = this.document;\n  function d3_documentElement(node) {\n    return node && (node.ownerDocument || node.document || node).documentElement;\n  }\n  function d3_window(node) {\n    return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView);\n  }\n  if (d3_document) {\n    try {\n      d3_array(d3_document.documentElement.childNodes)[0].nodeType;\n    } catch (e) {\n      d3_array = function(list) {\n        var i = list.length, array = new Array(i);\n        while (i--) array[i] = list[i];\n        return array;\n      };\n    }\n  }\n  if (!Date.now) Date.now = function() {\n    return +new Date();\n  };\n  if (d3_document) {\n    try {\n      d3_document.createElement(\"DIV\").style.setProperty(\"opacity\", 0, \"\");\n    } catch (error) {\n      var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;\n      d3_element_prototype.setAttribute = function(name, value) {\n        d3_element_setAttribute.call(this, name, value + \"\");\n      };\n      d3_element_prototype.setAttributeNS = function(space, local, value) {\n        d3_element_setAttributeNS.call(this, space, local, value + \"\");\n      };\n      d3_style_prototype.setProperty = function(name, value, priority) {\n        d3_style_setProperty.call(this, name, value + \"\", priority);\n      };\n    }\n  }\n  d3.ascending = d3_ascending;\n  function d3_ascending(a, b) {\n    return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n  }\n  d3.descending = function(a, b) {\n    return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n  };\n  d3.min = function(array, f) {\n    var i = -1, n = array.length, a, b;\n    if (arguments.length === 1) {\n      while (++i < n) if ((b = array[i]) != null && b >= b) {\n        a = b;\n        break;\n      }\n      while (++i < n) if ((b = array[i]) != null && a > b) a = b;\n    } else {\n      while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {\n        a = b;\n        break;\n      }\n      while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;\n    }\n    return a;\n  };\n  d3.max = function(array, f) {\n    var i = -1, n = array.length, a, b;\n    if (arguments.length === 1) {\n      while (++i < n) if ((b = array[i]) != null && b >= b) {\n        a = b;\n        break;\n      }\n      while (++i < n) if ((b = array[i]) != null && b > a) a = b;\n    } else {\n      while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {\n        a = b;\n        break;\n      }\n      while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;\n    }\n    return a;\n  };\n  d3.extent = function(array, f) {\n    var i = -1, n = array.length, a, b, c;\n    if (arguments.length === 1) {\n      while (++i < n) if ((b = array[i]) != null && b >= b) {\n        a = c = b;\n        break;\n      }\n      while (++i < n) if ((b = array[i]) != null) {\n        if (a > b) a = b;\n        if (c < b) c = b;\n      }\n    } else {\n      while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {\n        a = c = b;\n        break;\n      }\n      while (++i < n) if ((b = f.call(array, array[i], i)) != null) {\n        if (a > b) a = b;\n        if (c < b) c = b;\n      }\n    }\n    return [ a, c ];\n  };\n  function d3_number(x) {\n    return x === null ? NaN : +x;\n  }\n  function d3_numeric(x) {\n    return !isNaN(x);\n  }\n  d3.sum = function(array, f) {\n    var s = 0, n = array.length, a, i = -1;\n    if (arguments.length === 1) {\n      while (++i < n) if (d3_numeric(a = +array[i])) s += a;\n    } else {\n      while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;\n    }\n    return s;\n  };\n  d3.mean = function(array, f) {\n    var s = 0, n = array.length, a, i = -1, j = n;\n    if (arguments.length === 1) {\n      while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;\n    } else {\n      while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;\n    }\n    if (j) return s / j;\n  };\n  d3.quantile = function(values, p) {\n    var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;\n    return e ? v + e * (values[h] - v) : v;\n  };\n  d3.median = function(array, f) {\n    var numbers = [], n = array.length, a, i = -1;\n    if (arguments.length === 1) {\n      while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a);\n    } else {\n      while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a);\n    }\n    if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5);\n  };\n  d3.variance = function(array, f) {\n    var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0;\n    if (arguments.length === 1) {\n      while (++i < n) {\n        if (d3_numeric(a = d3_number(array[i]))) {\n          d = a - m;\n          m += d / ++j;\n          s += d * (a - m);\n        }\n      }\n    } else {\n      while (++i < n) {\n        if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) {\n          d = a - m;\n          m += d / ++j;\n          s += d * (a - m);\n        }\n      }\n    }\n    if (j > 1) return s / (j - 1);\n  };\n  d3.deviation = function() {\n    var v = d3.variance.apply(this, arguments);\n    return v ? Math.sqrt(v) : v;\n  };\n  function d3_bisector(compare) {\n    return {\n      left: function(a, x, lo, hi) {\n        if (arguments.length < 3) lo = 0;\n        if (arguments.length < 4) hi = a.length;\n        while (lo < hi) {\n          var mid = lo + hi >>> 1;\n          if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;\n        }\n        return lo;\n      },\n      right: function(a, x, lo, hi) {\n        if (arguments.length < 3) lo = 0;\n        if (arguments.length < 4) hi = a.length;\n        while (lo < hi) {\n          var mid = lo + hi >>> 1;\n          if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;\n        }\n        return lo;\n      }\n    };\n  }\n  var d3_bisect = d3_bisector(d3_ascending);\n  d3.bisectLeft = d3_bisect.left;\n  d3.bisect = d3.bisectRight = d3_bisect.right;\n  d3.bisector = function(f) {\n    return d3_bisector(f.length === 1 ? function(d, x) {\n      return d3_ascending(f(d), x);\n    } : f);\n  };\n  d3.shuffle = function(array, i0, i1) {\n    if ((m = arguments.length) < 3) {\n      i1 = array.length;\n      if (m < 2) i0 = 0;\n    }\n    var m = i1 - i0, t, i;\n    while (m) {\n      i = Math.random() * m-- | 0;\n      t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t;\n    }\n    return array;\n  };\n  d3.permute = function(array, indexes) {\n    var i = indexes.length, permutes = new Array(i);\n    while (i--) permutes[i] = array[indexes[i]];\n    return permutes;\n  };\n  d3.pairs = function(array) {\n    var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);\n    while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];\n    return pairs;\n  };\n  d3.transpose = function(matrix) {\n    if (!(n = matrix.length)) return [];\n    for (var i = -1, m = d3.min(matrix, d3_transposeLength), transpose = new Array(m); ++i < m; ) {\n      for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n; ) {\n        row[j] = matrix[j][i];\n      }\n    }\n    return transpose;\n  };\n  function d3_transposeLength(d) {\n    return d.length;\n  }\n  d3.zip = function() {\n    return d3.transpose(arguments);\n  };\n  d3.keys = function(map) {\n    var keys = [];\n    for (var key in map) keys.push(key);\n    return keys;\n  };\n  d3.values = function(map) {\n    var values = [];\n    for (var key in map) values.push(map[key]);\n    return values;\n  };\n  d3.entries = function(map) {\n    var entries = [];\n    for (var key in map) entries.push({\n      key: key,\n      value: map[key]\n    });\n    return entries;\n  };\n  d3.merge = function(arrays) {\n    var n = arrays.length, m, i = -1, j = 0, merged, array;\n    while (++i < n) j += arrays[i].length;\n    merged = new Array(j);\n    while (--n >= 0) {\n      array = arrays[n];\n      m = array.length;\n      while (--m >= 0) {\n        merged[--j] = array[m];\n      }\n    }\n    return merged;\n  };\n  var abs = Math.abs;\n  d3.range = function(start, stop, step) {\n    if (arguments.length < 3) {\n      step = 1;\n      if (arguments.length < 2) {\n        stop = start;\n        start = 0;\n      }\n    }\n    if ((stop - start) / step === Infinity) throw new Error(\"infinite range\");\n    var range = [], k = d3_range_integerScale(abs(step)), i = -1, j;\n    start *= k, stop *= k, step *= k;\n    if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k);\n    return range;\n  };\n  function d3_range_integerScale(x) {\n    var k = 1;\n    while (x * k % 1) k *= 10;\n    return k;\n  }\n  function d3_class(ctor, properties) {\n    for (var key in properties) {\n      Object.defineProperty(ctor.prototype, key, {\n        value: properties[key],\n        enumerable: false\n      });\n    }\n  }\n  d3.map = function(object, f) {\n    var map = new d3_Map();\n    if (object instanceof d3_Map) {\n      object.forEach(function(key, value) {\n        map.set(key, value);\n      });\n    } else if (Array.isArray(object)) {\n      var i = -1, n = object.length, o;\n      if (arguments.length === 1) while (++i < n) map.set(i, object[i]); else while (++i < n) map.set(f.call(object, o = object[i], i), o);\n    } else {\n      for (var key in object) map.set(key, object[key]);\n    }\n    return map;\n  };\n  function d3_Map() {\n    this._ = Object.create(null);\n  }\n  var d3_map_proto = \"__proto__\", d3_map_zero = \"\\x00\";\n  d3_class(d3_Map, {\n    has: d3_map_has,\n    get: function(key) {\n      return this._[d3_map_escape(key)];\n    },\n    set: function(key, value) {\n      return this._[d3_map_escape(key)] = value;\n    },\n    remove: d3_map_remove,\n    keys: d3_map_keys,\n    values: function() {\n      var values = [];\n      for (var key in this._) values.push(this._[key]);\n      return values;\n    },\n    entries: function() {\n      var entries = [];\n      for (var key in this._) entries.push({\n        key: d3_map_unescape(key),\n        value: this._[key]\n      });\n      return entries;\n    },\n    size: d3_map_size,\n    empty: d3_map_empty,\n    forEach: function(f) {\n      for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]);\n    }\n  });\n  function d3_map_escape(key) {\n    return (key += \"\") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key;\n  }\n  function d3_map_unescape(key) {\n    return (key += \"\")[0] === d3_map_zero ? key.slice(1) : key;\n  }\n  function d3_map_has(key) {\n    return d3_map_escape(key) in this._;\n  }\n  function d3_map_remove(key) {\n    return (key = d3_map_escape(key)) in this._ && delete this._[key];\n  }\n  function d3_map_keys() {\n    var keys = [];\n    for (var key in this._) keys.push(d3_map_unescape(key));\n    return keys;\n  }\n  function d3_map_size() {\n    var size = 0;\n    for (var key in this._) ++size;\n    return size;\n  }\n  function d3_map_empty() {\n    for (var key in this._) return false;\n    return true;\n  }\n  d3.nest = function() {\n    var nest = {}, keys = [], sortKeys = [], sortValues, rollup;\n    function map(mapType, array, depth) {\n      if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;\n      var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;\n      while (++i < n) {\n        if (values = valuesByKey.get(keyValue = key(object = array[i]))) {\n          values.push(object);\n        } else {\n          valuesByKey.set(keyValue, [ object ]);\n        }\n      }\n      if (mapType) {\n        object = mapType();\n        setter = function(keyValue, values) {\n          object.set(keyValue, map(mapType, values, depth));\n        };\n      } else {\n        object = {};\n        setter = function(keyValue, values) {\n          object[keyValue] = map(mapType, values, depth);\n        };\n      }\n      valuesByKey.forEach(setter);\n      return object;\n    }\n    function entries(map, depth) {\n      if (depth >= keys.length) return map;\n      var array = [], sortKey = sortKeys[depth++];\n      map.forEach(function(key, keyMap) {\n        array.push({\n          key: key,\n          values: entries(keyMap, depth)\n        });\n      });\n      return sortKey ? array.sort(function(a, b) {\n        return sortKey(a.key, b.key);\n      }) : array;\n    }\n    nest.map = function(array, mapType) {\n      return map(mapType, array, 0);\n    };\n    nest.entries = function(array) {\n      return entries(map(d3.map, array, 0), 0);\n    };\n    nest.key = function(d) {\n      keys.push(d);\n      return nest;\n    };\n    nest.sortKeys = function(order) {\n      sortKeys[keys.length - 1] = order;\n      return nest;\n    };\n    nest.sortValues = function(order) {\n      sortValues = order;\n      return nest;\n    };\n    nest.rollup = function(f) {\n      rollup = f;\n      return nest;\n    };\n    return nest;\n  };\n  d3.set = function(array) {\n    var set = new d3_Set();\n    if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);\n    return set;\n  };\n  function d3_Set() {\n    this._ = Object.create(null);\n  }\n  d3_class(d3_Set, {\n    has: d3_map_has,\n    add: function(key) {\n      this._[d3_map_escape(key += \"\")] = true;\n      return key;\n    },\n    remove: d3_map_remove,\n    values: d3_map_keys,\n    size: d3_map_size,\n    empty: d3_map_empty,\n    forEach: function(f) {\n      for (var key in this._) f.call(this, d3_map_unescape(key));\n    }\n  });\n  d3.behavior = {};\n  function d3_identity(d) {\n    return d;\n  }\n  d3.rebind = function(target, source) {\n    var i = 1, n = arguments.length, method;\n    while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);\n    return target;\n  };\n  function d3_rebind(target, source, method) {\n    return function() {\n      var value = method.apply(source, arguments);\n      return value === source ? target : value;\n    };\n  }\n  function d3_vendorSymbol(object, name) {\n    if (name in object) return name;\n    name = name.charAt(0).toUpperCase() + name.slice(1);\n    for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {\n      var prefixName = d3_vendorPrefixes[i] + name;\n      if (prefixName in object) return prefixName;\n    }\n  }\n  var d3_vendorPrefixes = [ \"webkit\", \"ms\", \"moz\", \"Moz\", \"o\", \"O\" ];\n  function d3_noop() {}\n  d3.dispatch = function() {\n    var dispatch = new d3_dispatch(), i = -1, n = arguments.length;\n    while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);\n    return dispatch;\n  };\n  function d3_dispatch() {}\n  d3_dispatch.prototype.on = function(type, listener) {\n    var i = type.indexOf(\".\"), name = \"\";\n    if (i >= 0) {\n      name = type.slice(i + 1);\n      type = type.slice(0, i);\n    }\n    if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener);\n    if (arguments.length === 2) {\n      if (listener == null) for (type in this) {\n        if (this.hasOwnProperty(type)) this[type].on(name, null);\n      }\n      return this;\n    }\n  };\n  function d3_dispatch_event(dispatch) {\n    var listeners = [], listenerByName = new d3_Map();\n    function event() {\n      var z = listeners, i = -1, n = z.length, l;\n      while (++i < n) if (l = z[i].on) l.apply(this, arguments);\n      return dispatch;\n    }\n    event.on = function(name, listener) {\n      var l = listenerByName.get(name), i;\n      if (arguments.length < 2) return l && l.on;\n      if (l) {\n        l.on = null;\n        listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));\n        listenerByName.remove(name);\n      }\n      if (listener) listeners.push(listenerByName.set(name, {\n        on: listener\n      }));\n      return dispatch;\n    };\n    return event;\n  }\n  d3.event = null;\n  function d3_eventPreventDefault() {\n    d3.event.preventDefault();\n  }\n  function d3_eventSource() {\n    var e = d3.event, s;\n    while (s = e.sourceEvent) e = s;\n    return e;\n  }\n  function d3_eventDispatch(target) {\n    var dispatch = new d3_dispatch(), i = 0, n = arguments.length;\n    while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);\n    dispatch.of = function(thiz, argumentz) {\n      return function(e1) {\n        try {\n          var e0 = e1.sourceEvent = d3.event;\n          e1.target = target;\n          d3.event = e1;\n          dispatch[e1.type].apply(thiz, argumentz);\n        } finally {\n          d3.event = e0;\n        }\n      };\n    };\n    return dispatch;\n  }\n  d3.requote = function(s) {\n    return s.replace(d3_requote_re, \"\\\\$&\");\n  };\n  var d3_requote_re = /[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g;\n  var d3_subclass = {}.__proto__ ? function(object, prototype) {\n    object.__proto__ = prototype;\n  } : function(object, prototype) {\n    for (var property in prototype) object[property] = prototype[property];\n  };\n  function d3_selection(groups) {\n    d3_subclass(groups, d3_selectionPrototype);\n    return groups;\n  }\n  var d3_select = function(s, n) {\n    return n.querySelector(s);\n  }, d3_selectAll = function(s, n) {\n    return n.querySelectorAll(s);\n  }, d3_selectMatches = function(n, s) {\n    var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, \"matchesSelector\")];\n    d3_selectMatches = function(n, s) {\n      return d3_selectMatcher.call(n, s);\n    };\n    return d3_selectMatches(n, s);\n  };\n  if (typeof Sizzle === \"function\") {\n    d3_select = function(s, n) {\n      return Sizzle(s, n)[0] || null;\n    };\n    d3_selectAll = Sizzle;\n    d3_selectMatches = Sizzle.matchesSelector;\n  }\n  d3.selection = function() {\n    return d3.select(d3_document.documentElement);\n  };\n  var d3_selectionPrototype = d3.selection.prototype = [];\n  d3_selectionPrototype.select = function(selector) {\n    var subgroups = [], subgroup, subnode, group, node;\n    selector = d3_selection_selector(selector);\n    for (var j = -1, m = this.length; ++j < m; ) {\n      subgroups.push(subgroup = []);\n      subgroup.parentNode = (group = this[j]).parentNode;\n      for (var i = -1, n = group.length; ++i < n; ) {\n        if (node = group[i]) {\n          subgroup.push(subnode = selector.call(node, node.__data__, i, j));\n          if (subnode && \"__data__\" in node) subnode.__data__ = node.__data__;\n        } else {\n          subgroup.push(null);\n        }\n      }\n    }\n    return d3_selection(subgroups);\n  };\n  function d3_selection_selector(selector) {\n    return typeof selector === \"function\" ? selector : function() {\n      return d3_select(selector, this);\n    };\n  }\n  d3_selectionPrototype.selectAll = function(selector) {\n    var subgroups = [], subgroup, node;\n    selector = d3_selection_selectorAll(selector);\n    for (var j = -1, m = this.length; ++j < m; ) {\n      for (var group = this[j], i = -1, n = group.length; ++i < n; ) {\n        if (node = group[i]) {\n          subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));\n          subgroup.parentNode = node;\n        }\n      }\n    }\n    return d3_selection(subgroups);\n  };\n  function d3_selection_selectorAll(selector) {\n    return typeof selector === \"function\" ? selector : function() {\n      return d3_selectAll(selector, this);\n    };\n  }\n  var d3_nsXhtml = \"http://www.w3.org/1999/xhtml\";\n  var d3_nsPrefix = {\n    svg: \"http://www.w3.org/2000/svg\",\n    xhtml: d3_nsXhtml,\n    xlink: \"http://www.w3.org/1999/xlink\",\n    xml: \"http://www.w3.org/XML/1998/namespace\",\n    xmlns: \"http://www.w3.org/2000/xmlns/\"\n  };\n  d3.ns = {\n    prefix: d3_nsPrefix,\n    qualify: function(name) {\n      var i = name.indexOf(\":\"), prefix = name;\n      if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n      return d3_nsPrefix.hasOwnProperty(prefix) ? {\n        space: d3_nsPrefix[prefix],\n        local: name\n      } : name;\n    }\n  };\n  d3_selectionPrototype.attr = function(name, value) {\n    if (arguments.length < 2) {\n      if (typeof name === \"string\") {\n        var node = this.node();\n        name = d3.ns.qualify(name);\n        return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name);\n      }\n      for (value in name) this.each(d3_selection_attr(value, name[value]));\n      return this;\n    }\n    return this.each(d3_selection_attr(name, value));\n  };\n  function d3_selection_attr(name, value) {\n    name = d3.ns.qualify(name);\n    function attrNull() {\n      this.removeAttribute(name);\n    }\n    function attrNullNS() {\n      this.removeAttributeNS(name.space, name.local);\n    }\n    function attrConstant() {\n      this.setAttribute(name, value);\n    }\n    function attrConstantNS() {\n      this.setAttributeNS(name.space, name.local, value);\n    }\n    function attrFunction() {\n      var x = value.apply(this, arguments);\n      if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);\n    }\n    function attrFunctionNS() {\n      var x = value.apply(this, arguments);\n      if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);\n    }\n    return value == null ? name.local ? attrNullNS : attrNull : typeof value === \"function\" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;\n  }\n  function d3_collapse(s) {\n    return s.trim().replace(/\\s+/g, \" \");\n  }\n  d3_selectionPrototype.classed = function(name, value) {\n    if (arguments.length < 2) {\n      if (typeof name === \"string\") {\n        var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1;\n        if (value = node.classList) {\n          while (++i < n) if (!value.contains(name[i])) return false;\n        } else {\n          value = node.getAttribute(\"class\");\n          while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;\n        }\n        return true;\n      }\n      for (value in name) this.each(d3_selection_classed(value, name[value]));\n      return this;\n    }\n    return this.each(d3_selection_classed(name, value));\n  };\n  function d3_selection_classedRe(name) {\n    return new RegExp(\"(?:^|\\\\s+)\" + d3.requote(name) + \"(?:\\\\s+|$)\", \"g\");\n  }\n  function d3_selection_classes(name) {\n    return (name + \"\").trim().split(/^|\\s+/);\n  }\n  function d3_selection_classed(name, value) {\n    name = d3_selection_classes(name).map(d3_selection_classedName);\n    var n = name.length;\n    function classedConstant() {\n      var i = -1;\n      while (++i < n) name[i](this, value);\n    }\n    function classedFunction() {\n      var i = -1, x = value.apply(this, arguments);\n      while (++i < n) name[i](this, x);\n    }\n    return typeof value === \"function\" ? classedFunction : classedConstant;\n  }\n  function d3_selection_classedName(name) {\n    var re = d3_selection_classedRe(name);\n    return function(node, value) {\n      if (c = node.classList) return value ? c.add(name) : c.remove(name);\n      var c = node.getAttribute(\"class\") || \"\";\n      if (value) {\n        re.lastIndex = 0;\n        if (!re.test(c)) node.setAttribute(\"class\", d3_collapse(c + \" \" + name));\n      } else {\n        node.setAttribute(\"class\", d3_collapse(c.replace(re, \" \")));\n      }\n    };\n  }\n  d3_selectionPrototype.style = function(name, value, priority) {\n    var n = arguments.length;\n    if (n < 3) {\n      if (typeof name !== \"string\") {\n        if (n < 2) value = \"\";\n        for (priority in name) this.each(d3_selection_style(priority, name[priority], value));\n        return this;\n      }\n      if (n < 2) {\n        var node = this.node();\n        return d3_window(node).getComputedStyle(node, null).getPropertyValue(name);\n      }\n      priority = \"\";\n    }\n    return this.each(d3_selection_style(name, value, priority));\n  };\n  function d3_selection_style(name, value, priority) {\n    function styleNull() {\n      this.style.removeProperty(name);\n    }\n    function styleConstant() {\n      this.style.setProperty(name, value, priority);\n    }\n    function styleFunction() {\n      var x = value.apply(this, arguments);\n      if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority);\n    }\n    return value == null ? styleNull : typeof value === \"function\" ? styleFunction : styleConstant;\n  }\n  d3_selectionPrototype.property = function(name, value) {\n    if (arguments.length < 2) {\n      if (typeof name === \"string\") return this.node()[name];\n      for (value in name) this.each(d3_selection_property(value, name[value]));\n      return this;\n    }\n    return this.each(d3_selection_property(name, value));\n  };\n  function d3_selection_property(name, value) {\n    function propertyNull() {\n      delete this[name];\n    }\n    function propertyConstant() {\n      this[name] = value;\n    }\n    function propertyFunction() {\n      var x = value.apply(this, arguments);\n      if (x == null) delete this[name]; else this[name] = x;\n    }\n    return value == null ? propertyNull : typeof value === \"function\" ? propertyFunction : propertyConstant;\n  }\n  d3_selectionPrototype.text = function(value) {\n    return arguments.length ? this.each(typeof value === \"function\" ? function() {\n      var v = value.apply(this, arguments);\n      this.textContent = v == null ? \"\" : v;\n    } : value == null ? function() {\n      this.textContent = \"\";\n    } : function() {\n      this.textContent = value;\n    }) : this.node().textContent;\n  };\n  d3_selectionPrototype.html = function(value) {\n    return arguments.length ? this.each(typeof value === \"function\" ? function() {\n      var v = value.apply(this, arguments);\n      this.innerHTML = v == null ? \"\" : v;\n    } : value == null ? function() {\n      this.innerHTML = \"\";\n    } : function() {\n      this.innerHTML = value;\n    }) : this.node().innerHTML;\n  };\n  d3_selectionPrototype.append = function(name) {\n    name = d3_selection_creator(name);\n    return this.select(function() {\n      return this.appendChild(name.apply(this, arguments));\n    });\n  };\n  function d3_selection_creator(name) {\n    function create() {\n      var document = this.ownerDocument, namespace = this.namespaceURI;\n      return namespace === d3_nsXhtml && document.documentElement.namespaceURI === d3_nsXhtml ? document.createElement(name) : document.createElementNS(namespace, name);\n    }\n    function createNS() {\n      return this.ownerDocument.createElementNS(name.space, name.local);\n    }\n    return typeof name === \"function\" ? name : (name = d3.ns.qualify(name)).local ? createNS : create;\n  }\n  d3_selectionPrototype.insert = function(name, before) {\n    name = d3_selection_creator(name);\n    before = d3_selection_selector(before);\n    return this.select(function() {\n      return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);\n    });\n  };\n  d3_selectionPrototype.remove = function() {\n    return this.each(d3_selectionRemove);\n  };\n  function d3_selectionRemove() {\n    var parent = this.parentNode;\n    if (parent) parent.removeChild(this);\n  }\n  d3_selectionPrototype.data = function(value, key) {\n    var i = -1, n = this.length, group, node;\n    if (!arguments.length) {\n      value = new Array(n = (group = this[0]).length);\n      while (++i < n) {\n        if (node = group[i]) {\n          value[i] = node.__data__;\n        }\n      }\n      return value;\n    }\n    function bind(group, groupData) {\n      var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;\n      if (key) {\n        var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;\n        for (i = -1; ++i < n; ) {\n          if (node = group[i]) {\n            if (nodeByKeyValue.has(keyValue = key.call(node, node.__data__, i))) {\n              exitNodes[i] = node;\n            } else {\n              nodeByKeyValue.set(keyValue, node);\n            }\n            keyValues[i] = keyValue;\n          }\n        }\n        for (i = -1; ++i < m; ) {\n          if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) {\n            enterNodes[i] = d3_selection_dataNode(nodeData);\n          } else if (node !== true) {\n            updateNodes[i] = node;\n            node.__data__ = nodeData;\n          }\n          nodeByKeyValue.set(keyValue, true);\n        }\n        for (i = -1; ++i < n; ) {\n          if (i in keyValues && nodeByKeyValue.get(keyValues[i]) !== true) {\n            exitNodes[i] = group[i];\n          }\n        }\n      } else {\n        for (i = -1; ++i < n0; ) {\n          node = group[i];\n          nodeData = groupData[i];\n          if (node) {\n            node.__data__ = nodeData;\n            updateNodes[i] = node;\n          } else {\n            enterNodes[i] = d3_selection_dataNode(nodeData);\n          }\n        }\n        for (;i < m; ++i) {\n          enterNodes[i] = d3_selection_dataNode(groupData[i]);\n        }\n        for (;i < n; ++i) {\n          exitNodes[i] = group[i];\n        }\n      }\n      enterNodes.update = updateNodes;\n      enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode;\n      enter.push(enterNodes);\n      update.push(updateNodes);\n      exit.push(exitNodes);\n    }\n    var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]);\n    if (typeof value === \"function\") {\n      while (++i < n) {\n        bind(group = this[i], value.call(group, group.parentNode.__data__, i));\n      }\n    } else {\n      while (++i < n) {\n        bind(group = this[i], value);\n      }\n    }\n    update.enter = function() {\n      return enter;\n    };\n    update.exit = function() {\n      return exit;\n    };\n    return update;\n  };\n  function d3_selection_dataNode(data) {\n    return {\n      __data__: data\n    };\n  }\n  d3_selectionPrototype.datum = function(value) {\n    return arguments.length ? this.property(\"__data__\", value) : this.property(\"__data__\");\n  };\n  d3_selectionPrototype.filter = function(filter) {\n    var subgroups = [], subgroup, group, node;\n    if (typeof filter !== \"function\") filter = d3_selection_filter(filter);\n    for (var j = 0, m = this.length; j < m; j++) {\n      subgroups.push(subgroup = []);\n      subgroup.parentNode = (group = this[j]).parentNode;\n      for (var i = 0, n = group.length; i < n; i++) {\n        if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {\n          subgroup.push(node);\n        }\n      }\n    }\n    return d3_selection(subgroups);\n  };\n  function d3_selection_filter(selector) {\n    return function() {\n      return d3_selectMatches(this, selector);\n    };\n  }\n  d3_selectionPrototype.order = function() {\n    for (var j = -1, m = this.length; ++j < m; ) {\n      for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {\n        if (node = group[i]) {\n          if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);\n          next = node;\n        }\n      }\n    }\n    return this;\n  };\n  d3_selectionPrototype.sort = function(comparator) {\n    comparator = d3_selection_sortComparator.apply(this, arguments);\n    for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator);\n    return this.order();\n  };\n  function d3_selection_sortComparator(comparator) {\n    if (!arguments.length) comparator = d3_ascending;\n    return function(a, b) {\n      return a && b ? comparator(a.__data__, b.__data__) : !a - !b;\n    };\n  }\n  d3_selectionPrototype.each = function(callback) {\n    return d3_selection_each(this, function(node, i, j) {\n      callback.call(node, node.__data__, i, j);\n    });\n  };\n  function d3_selection_each(groups, callback) {\n    for (var j = 0, m = groups.length; j < m; j++) {\n      for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {\n        if (node = group[i]) callback(node, i, j);\n      }\n    }\n    return groups;\n  }\n  d3_selectionPrototype.call = function(callback) {\n    var args = d3_array(arguments);\n    callback.apply(args[0] = this, args);\n    return this;\n  };\n  d3_selectionPrototype.empty = function() {\n    return !this.node();\n  };\n  d3_selectionPrototype.node = function() {\n    for (var j = 0, m = this.length; j < m; j++) {\n      for (var group = this[j], i = 0, n = group.length; i < n; i++) {\n        var node = group[i];\n        if (node) return node;\n      }\n    }\n    return null;\n  };\n  d3_selectionPrototype.size = function() {\n    var n = 0;\n    d3_selection_each(this, function() {\n      ++n;\n    });\n    return n;\n  };\n  function d3_selection_enter(selection) {\n    d3_subclass(selection, d3_selection_enterPrototype);\n    return selection;\n  }\n  var d3_selection_enterPrototype = [];\n  d3.selection.enter = d3_selection_enter;\n  d3.selection.enter.prototype = d3_selection_enterPrototype;\n  d3_selection_enterPrototype.append = d3_selectionPrototype.append;\n  d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;\n  d3_selection_enterPrototype.node = d3_selectionPrototype.node;\n  d3_selection_enterPrototype.call = d3_selectionPrototype.call;\n  d3_selection_enterPrototype.size = d3_selectionPrototype.size;\n  d3_selection_enterPrototype.select = function(selector) {\n    var subgroups = [], subgroup, subnode, upgroup, group, node;\n    for (var j = -1, m = this.length; ++j < m; ) {\n      upgroup = (group = this[j]).update;\n      subgroups.push(subgroup = []);\n      subgroup.parentNode = group.parentNode;\n      for (var i = -1, n = group.length; ++i < n; ) {\n        if (node = group[i]) {\n          subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j));\n          subnode.__data__ = node.__data__;\n        } else {\n          subgroup.push(null);\n        }\n      }\n    }\n    return d3_selection(subgroups);\n  };\n  d3_selection_enterPrototype.insert = function(name, before) {\n    if (arguments.length < 2) before = d3_selection_enterInsertBefore(this);\n    return d3_selectionPrototype.insert.call(this, name, before);\n  };\n  function d3_selection_enterInsertBefore(enter) {\n    var i0, j0;\n    return function(d, i, j) {\n      var group = enter[j].update, n = group.length, node;\n      if (j != j0) j0 = j, i0 = 0;\n      if (i >= i0) i0 = i + 1;\n      while (!(node = group[i0]) && ++i0 < n) ;\n      return node;\n    };\n  }\n  d3.select = function(node) {\n    var group;\n    if (typeof node === \"string\") {\n      group = [ d3_select(node, d3_document) ];\n      group.parentNode = d3_document.documentElement;\n    } else {\n      group = [ node ];\n      group.parentNode = d3_documentElement(node);\n    }\n    return d3_selection([ group ]);\n  };\n  d3.selectAll = function(nodes) {\n    var group;\n    if (typeof nodes === \"string\") {\n      group = d3_array(d3_selectAll(nodes, d3_document));\n      group.parentNode = d3_document.documentElement;\n    } else {\n      group = d3_array(nodes);\n      group.parentNode = null;\n    }\n    return d3_selection([ group ]);\n  };\n  d3_selectionPrototype.on = function(type, listener, capture) {\n    var n = arguments.length;\n    if (n < 3) {\n      if (typeof type !== \"string\") {\n        if (n < 2) listener = false;\n        for (capture in type) this.each(d3_selection_on(capture, type[capture], listener));\n        return this;\n      }\n      if (n < 2) return (n = this.node()[\"__on\" + type]) && n._;\n      capture = false;\n    }\n    return this.each(d3_selection_on(type, listener, capture));\n  };\n  function d3_selection_on(type, listener, capture) {\n    var name = \"__on\" + type, i = type.indexOf(\".\"), wrap = d3_selection_onListener;\n    if (i > 0) type = type.slice(0, i);\n    var filter = d3_selection_onFilters.get(type);\n    if (filter) type = filter, wrap = d3_selection_onFilter;\n    function onRemove() {\n      var l = this[name];\n      if (l) {\n        this.removeEventListener(type, l, l.$);\n        delete this[name];\n      }\n    }\n    function onAdd() {\n      var l = wrap(listener, d3_array(arguments));\n      onRemove.call(this);\n      this.addEventListener(type, this[name] = l, l.$ = capture);\n      l._ = listener;\n    }\n    function removeAll() {\n      var re = new RegExp(\"^__on([^.]+)\" + d3.requote(type) + \"$\"), match;\n      for (var name in this) {\n        if (match = name.match(re)) {\n          var l = this[name];\n          this.removeEventListener(match[1], l, l.$);\n          delete this[name];\n        }\n      }\n    }\n    return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll;\n  }\n  var d3_selection_onFilters = d3.map({\n    mouseenter: \"mouseover\",\n    mouseleave: \"mouseout\"\n  });\n  if (d3_document) {\n    d3_selection_onFilters.forEach(function(k) {\n      if (\"on\" + k in d3_document) d3_selection_onFilters.remove(k);\n    });\n  }\n  function d3_selection_onListener(listener, argumentz) {\n    return function(e) {\n      var o = d3.event;\n      d3.event = e;\n      argumentz[0] = this.__data__;\n      try {\n        listener.apply(this, argumentz);\n      } finally {\n        d3.event = o;\n      }\n    };\n  }\n  function d3_selection_onFilter(listener, argumentz) {\n    var l = d3_selection_onListener(listener, argumentz);\n    return function(e) {\n      var target = this, related = e.relatedTarget;\n      if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) {\n        l.call(target, e);\n      }\n    };\n  }\n  var d3_event_dragSelect, d3_event_dragId = 0;\n  function d3_event_dragSuppress(node) {\n    var name = \".dragsuppress-\" + ++d3_event_dragId, click = \"click\" + name, w = d3.select(d3_window(node)).on(\"touchmove\" + name, d3_eventPreventDefault).on(\"dragstart\" + name, d3_eventPreventDefault).on(\"selectstart\" + name, d3_eventPreventDefault);\n    if (d3_event_dragSelect == null) {\n      d3_event_dragSelect = \"onselectstart\" in node ? false : d3_vendorSymbol(node.style, \"userSelect\");\n    }\n    if (d3_event_dragSelect) {\n      var style = d3_documentElement(node).style, select = style[d3_event_dragSelect];\n      style[d3_event_dragSelect] = \"none\";\n    }\n    return function(suppressClick) {\n      w.on(name, null);\n      if (d3_event_dragSelect) style[d3_event_dragSelect] = select;\n      if (suppressClick) {\n        var off = function() {\n          w.on(click, null);\n        };\n        w.on(click, function() {\n          d3_eventPreventDefault();\n          off();\n        }, true);\n        setTimeout(off, 0);\n      }\n    };\n  }\n  d3.mouse = function(container) {\n    return d3_mousePoint(container, d3_eventSource());\n  };\n  var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;\n  function d3_mousePoint(container, e) {\n    if (e.changedTouches) e = e.changedTouches[0];\n    var svg = container.ownerSVGElement || container;\n    if (svg.createSVGPoint) {\n      var point = svg.createSVGPoint();\n      if (d3_mouse_bug44083 < 0) {\n        var window = d3_window(container);\n        if (window.scrollX || window.scrollY) {\n          svg = d3.select(\"body\").append(\"svg\").style({\n            position: \"absolute\",\n            top: 0,\n            left: 0,\n            margin: 0,\n            padding: 0,\n            border: \"none\"\n          }, \"important\");\n          var ctm = svg[0][0].getScreenCTM();\n          d3_mouse_bug44083 = !(ctm.f || ctm.e);\n          svg.remove();\n        }\n      }\n      if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, \n      point.y = e.clientY;\n      point = point.matrixTransform(container.getScreenCTM().inverse());\n      return [ point.x, point.y ];\n    }\n    var rect = container.getBoundingClientRect();\n    return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];\n  }\n  d3.touch = function(container, touches, identifier) {\n    if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;\n    if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {\n      if ((touch = touches[i]).identifier === identifier) {\n        return d3_mousePoint(container, touch);\n      }\n    }\n  };\n  d3.behavior.drag = function() {\n    var event = d3_eventDispatch(drag, \"drag\", \"dragstart\", \"dragend\"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, \"mousemove\", \"mouseup\"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, \"touchmove\", \"touchend\");\n    function drag() {\n      this.on(\"mousedown.drag\", mousedown).on(\"touchstart.drag\", touchstart);\n    }\n    function dragstart(id, position, subject, move, end) {\n      return function() {\n        var that = this, target = d3.event.target.correspondingElement || d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = \".drag\" + (dragId == null ? \"\" : \"-\" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);\n        if (origin) {\n          dragOffset = origin.apply(that, arguments);\n          dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];\n        } else {\n          dragOffset = [ 0, 0 ];\n        }\n        dispatch({\n          type: \"dragstart\"\n        });\n        function moved() {\n          var position1 = position(parent, dragId), dx, dy;\n          if (!position1) return;\n          dx = position1[0] - position0[0];\n          dy = position1[1] - position0[1];\n          dragged |= dx | dy;\n          position0 = position1;\n          dispatch({\n            type: \"drag\",\n            x: position1[0] + dragOffset[0],\n            y: position1[1] + dragOffset[1],\n            dx: dx,\n            dy: dy\n          });\n        }\n        function ended() {\n          if (!position(parent, dragId)) return;\n          dragSubject.on(move + dragName, null).on(end + dragName, null);\n          dragRestore(dragged);\n          dispatch({\n            type: \"dragend\"\n          });\n        }\n      };\n    }\n    drag.origin = function(x) {\n      if (!arguments.length) return origin;\n      origin = x;\n      return drag;\n    };\n    return d3.rebind(drag, event, \"on\");\n  };\n  function d3_behavior_dragTouchId() {\n    return d3.event.changedTouches[0].identifier;\n  }\n  d3.touches = function(container, touches) {\n    if (arguments.length < 2) touches = d3_eventSource().touches;\n    return touches ? d3_array(touches).map(function(touch) {\n      var point = d3_mousePoint(container, touch);\n      point.identifier = touch.identifier;\n      return point;\n    }) : [];\n  };\n  var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;\n  function d3_sgn(x) {\n    return x > 0 ? 1 : x < 0 ? -1 : 0;\n  }\n  function d3_cross2d(a, b, c) {\n    return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);\n  }\n  function d3_acos(x) {\n    return x > 1 ? 0 : x < -1 ? π : Math.acos(x);\n  }\n  function d3_asin(x) {\n    return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);\n  }\n  function d3_sinh(x) {\n    return ((x = Math.exp(x)) - 1 / x) / 2;\n  }\n  function d3_cosh(x) {\n    return ((x = Math.exp(x)) + 1 / x) / 2;\n  }\n  function d3_tanh(x) {\n    return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n  }\n  function d3_haversin(x) {\n    return (x = Math.sin(x / 2)) * x;\n  }\n  var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4;\n  d3.interpolateZoom = function(p0, p1) {\n    var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;\n    if (d2 < ε2) {\n      S = Math.log(w1 / w0) / ρ;\n      i = function(t) {\n        return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * t * S) ];\n      };\n    } else {\n      var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n      S = (r1 - r0) / ρ;\n      i = function(t) {\n        var s = t * S, coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));\n        return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ];\n      };\n    }\n    i.duration = S * 1e3;\n    return i;\n  };\n  d3.behavior.zoom = function() {\n    var view = {\n      x: 0,\n      y: 0,\n      k: 1\n    }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = \"mousedown.zoom\", mousemove = \"mousemove.zoom\", mouseup = \"mouseup.zoom\", mousewheelTimer, touchstart = \"touchstart.zoom\", touchtime, event = d3_eventDispatch(zoom, \"zoomstart\", \"zoom\", \"zoomend\"), x0, x1, y0, y1;\n    if (!d3_behavior_zoomWheel) {\n      d3_behavior_zoomWheel = \"onwheel\" in d3_document ? (d3_behavior_zoomDelta = function() {\n        return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);\n      }, \"wheel\") : \"onmousewheel\" in d3_document ? (d3_behavior_zoomDelta = function() {\n        return d3.event.wheelDelta;\n      }, \"mousewheel\") : (d3_behavior_zoomDelta = function() {\n        return -d3.event.detail;\n      }, \"MozMousePixelScroll\");\n    }\n    function zoom(g) {\n      g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + \".zoom\", mousewheeled).on(\"dblclick.zoom\", dblclicked).on(touchstart, touchstarted);\n    }\n    zoom.event = function(g) {\n      g.each(function() {\n        var dispatch = event.of(this, arguments), view1 = view;\n        if (d3_transitionInheritId) {\n          d3.select(this).transition().each(\"start.zoom\", function() {\n            view = this.__chart__ || {\n              x: 0,\n              y: 0,\n              k: 1\n            };\n            zoomstarted(dispatch);\n          }).tween(\"zoom:zoom\", function() {\n            var dx = size[0], dy = size[1], cx = center0 ? center0[0] : dx / 2, cy = center0 ? center0[1] : dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);\n            return function(t) {\n              var l = i(t), k = dx / l[2];\n              this.__chart__ = view = {\n                x: cx - l[0] * k,\n                y: cy - l[1] * k,\n                k: k\n              };\n              zoomed(dispatch);\n            };\n          }).each(\"interrupt.zoom\", function() {\n            zoomended(dispatch);\n          }).each(\"end.zoom\", function() {\n            zoomended(dispatch);\n          });\n        } else {\n          this.__chart__ = view;\n          zoomstarted(dispatch);\n          zoomed(dispatch);\n          zoomended(dispatch);\n        }\n      });\n    };\n    zoom.translate = function(_) {\n      if (!arguments.length) return [ view.x, view.y ];\n      view = {\n        x: +_[0],\n        y: +_[1],\n        k: view.k\n      };\n      rescale();\n      return zoom;\n    };\n    zoom.scale = function(_) {\n      if (!arguments.length) return view.k;\n      view = {\n        x: view.x,\n        y: view.y,\n        k: null\n      };\n      scaleTo(+_);\n      rescale();\n      return zoom;\n    };\n    zoom.scaleExtent = function(_) {\n      if (!arguments.length) return scaleExtent;\n      scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ];\n      return zoom;\n    };\n    zoom.center = function(_) {\n      if (!arguments.length) return center;\n      center = _ && [ +_[0], +_[1] ];\n      return zoom;\n    };\n    zoom.size = function(_) {\n      if (!arguments.length) return size;\n      size = _ && [ +_[0], +_[1] ];\n      return zoom;\n    };\n    zoom.duration = function(_) {\n      if (!arguments.length) return duration;\n      duration = +_;\n      return zoom;\n    };\n    zoom.x = function(z) {\n      if (!arguments.length) return x1;\n      x1 = z;\n      x0 = z.copy();\n      view = {\n        x: 0,\n        y: 0,\n        k: 1\n      };\n      return zoom;\n    };\n    zoom.y = function(z) {\n      if (!arguments.length) return y1;\n      y1 = z;\n      y0 = z.copy();\n      view = {\n        x: 0,\n        y: 0,\n        k: 1\n      };\n      return zoom;\n    };\n    function location(p) {\n      return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ];\n    }\n    function point(l) {\n      return [ l[0] * view.k + view.x, l[1] * view.k + view.y ];\n    }\n    function scaleTo(s) {\n      view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s));\n    }\n    function translateTo(p, l) {\n      l = point(l);\n      view.x += p[0] - l[0];\n      view.y += p[1] - l[1];\n    }\n    function zoomTo(that, p, l, k) {\n      that.__chart__ = {\n        x: view.x,\n        y: view.y,\n        k: view.k\n      };\n      scaleTo(Math.pow(2, k));\n      translateTo(center0 = p, l);\n      that = d3.select(that);\n      if (duration > 0) that = that.transition().duration(duration);\n      that.call(zoom.event);\n    }\n    function rescale() {\n      if (x1) x1.domain(x0.range().map(function(x) {\n        return (x - view.x) / view.k;\n      }).map(x0.invert));\n      if (y1) y1.domain(y0.range().map(function(y) {\n        return (y - view.y) / view.k;\n      }).map(y0.invert));\n    }\n    function zoomstarted(dispatch) {\n      if (!zooming++) dispatch({\n        type: \"zoomstart\"\n      });\n    }\n    function zoomed(dispatch) {\n      rescale();\n      dispatch({\n        type: \"zoom\",\n        scale: view.k,\n        translate: [ view.x, view.y ]\n      });\n    }\n    function zoomended(dispatch) {\n      if (!--zooming) dispatch({\n        type: \"zoomend\"\n      }), center0 = null;\n    }\n    function mousedowned() {\n      var that = this, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);\n      d3_selection_interrupt.call(that);\n      zoomstarted(dispatch);\n      function moved() {\n        dragged = 1;\n        translateTo(d3.mouse(that), location0);\n        zoomed(dispatch);\n      }\n      function ended() {\n        subject.on(mousemove, null).on(mouseup, null);\n        dragRestore(dragged);\n        zoomended(dispatch);\n      }\n    }\n    function touchstarted() {\n      var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = \".zoom-\" + d3.event.changedTouches[0].identifier, touchmove = \"touchmove\" + zoomName, touchend = \"touchend\" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that);\n      started();\n      zoomstarted(dispatch);\n      subject.on(mousedown, null).on(touchstart, started);\n      function relocate() {\n        var touches = d3.touches(that);\n        scale0 = view.k;\n        touches.forEach(function(t) {\n          if (t.identifier in locations0) locations0[t.identifier] = location(t);\n        });\n        return touches;\n      }\n      function started() {\n        var target = d3.event.target;\n        d3.select(target).on(touchmove, moved).on(touchend, ended);\n        targets.push(target);\n        var changed = d3.event.changedTouches;\n        for (var i = 0, n = changed.length; i < n; ++i) {\n          locations0[changed[i].identifier] = null;\n        }\n        var touches = relocate(), now = Date.now();\n        if (touches.length === 1) {\n          if (now - touchtime < 500) {\n            var p = touches[0];\n            zoomTo(that, p, locations0[p.identifier], Math.floor(Math.log(view.k) / Math.LN2) + 1);\n            d3_eventPreventDefault();\n          }\n          touchtime = now;\n        } else if (touches.length > 1) {\n          var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1];\n          distance0 = dx * dx + dy * dy;\n        }\n      }\n      function moved() {\n        var touches = d3.touches(that), p0, l0, p1, l1;\n        d3_selection_interrupt.call(that);\n        for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {\n          p1 = touches[i];\n          if (l1 = locations0[p1.identifier]) {\n            if (l0) break;\n            p0 = p1, l0 = l1;\n          }\n        }\n        if (l1) {\n          var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0);\n          p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ];\n          l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ];\n          scaleTo(scale1 * scale0);\n        }\n        touchtime = null;\n        translateTo(p0, l0);\n        zoomed(dispatch);\n      }\n      function ended() {\n        if (d3.event.touches.length) {\n          var changed = d3.event.changedTouches;\n          for (var i = 0, n = changed.length; i < n; ++i) {\n            delete locations0[changed[i].identifier];\n          }\n          for (var identifier in locations0) {\n            return void relocate();\n          }\n        }\n        d3.selectAll(targets).on(zoomName, null);\n        subject.on(mousedown, mousedowned).on(touchstart, touchstarted);\n        dragRestore();\n        zoomended(dispatch);\n      }\n    }\n    function mousewheeled() {\n      var dispatch = event.of(this, arguments);\n      if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), \n      translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch);\n      mousewheelTimer = setTimeout(function() {\n        mousewheelTimer = null;\n        zoomended(dispatch);\n      }, 50);\n      d3_eventPreventDefault();\n      scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);\n      translateTo(center0, translate0);\n      zoomed(dispatch);\n    }\n    function dblclicked() {\n      var p = d3.mouse(this), k = Math.log(view.k) / Math.LN2;\n      zoomTo(this, p, location(p), d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1);\n    }\n    return d3.rebind(zoom, event, \"on\");\n  };\n  var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel;\n  d3.color = d3_color;\n  function d3_color() {}\n  d3_color.prototype.toString = function() {\n    return this.rgb() + \"\";\n  };\n  d3.hsl = d3_hsl;\n  function d3_hsl(h, s, l) {\n    return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse(\"\" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);\n  }\n  var d3_hslPrototype = d3_hsl.prototype = new d3_color();\n  d3_hslPrototype.brighter = function(k) {\n    k = Math.pow(.7, arguments.length ? k : 1);\n    return new d3_hsl(this.h, this.s, this.l / k);\n  };\n  d3_hslPrototype.darker = function(k) {\n    k = Math.pow(.7, arguments.length ? k : 1);\n    return new d3_hsl(this.h, this.s, k * this.l);\n  };\n  d3_hslPrototype.rgb = function() {\n    return d3_hsl_rgb(this.h, this.s, this.l);\n  };\n  function d3_hsl_rgb(h, s, l) {\n    var m1, m2;\n    h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h;\n    s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s;\n    l = l < 0 ? 0 : l > 1 ? 1 : l;\n    m2 = l <= .5 ? l * (1 + s) : l + s - l * s;\n    m1 = 2 * l - m2;\n    function v(h) {\n      if (h > 360) h -= 360; else if (h < 0) h += 360;\n      if (h < 60) return m1 + (m2 - m1) * h / 60;\n      if (h < 180) return m2;\n      if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;\n      return m1;\n    }\n    function vv(h) {\n      return Math.round(v(h) * 255);\n    }\n    return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));\n  }\n  d3.hcl = d3_hcl;\n  function d3_hcl(h, c, l) {\n    return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);\n  }\n  var d3_hclPrototype = d3_hcl.prototype = new d3_color();\n  d3_hclPrototype.brighter = function(k) {\n    return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));\n  };\n  d3_hclPrototype.darker = function(k) {\n    return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));\n  };\n  d3_hclPrototype.rgb = function() {\n    return d3_hcl_lab(this.h, this.c, this.l).rgb();\n  };\n  function d3_hcl_lab(h, c, l) {\n    if (isNaN(h)) h = 0;\n    if (isNaN(c)) c = 0;\n    return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);\n  }\n  d3.lab = d3_lab;\n  function d3_lab(l, a, b) {\n    return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);\n  }\n  var d3_lab_K = 18;\n  var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;\n  var d3_labPrototype = d3_lab.prototype = new d3_color();\n  d3_labPrototype.brighter = function(k) {\n    return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);\n  };\n  d3_labPrototype.darker = function(k) {\n    return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);\n  };\n  d3_labPrototype.rgb = function() {\n    return d3_lab_rgb(this.l, this.a, this.b);\n  };\n  function d3_lab_rgb(l, a, b) {\n    var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;\n    x = d3_lab_xyz(x) * d3_lab_X;\n    y = d3_lab_xyz(y) * d3_lab_Y;\n    z = d3_lab_xyz(z) * d3_lab_Z;\n    return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));\n  }\n  function d3_lab_hcl(l, a, b) {\n    return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);\n  }\n  function d3_lab_xyz(x) {\n    return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;\n  }\n  function d3_xyz_lab(x) {\n    return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;\n  }\n  function d3_xyz_rgb(r) {\n    return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));\n  }\n  d3.rgb = d3_rgb;\n  function d3_rgb(r, g, b) {\n    return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse(\"\" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);\n  }\n  function d3_rgbNumber(value) {\n    return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);\n  }\n  function d3_rgbString(value) {\n    return d3_rgbNumber(value) + \"\";\n  }\n  var d3_rgbPrototype = d3_rgb.prototype = new d3_color();\n  d3_rgbPrototype.brighter = function(k) {\n    k = Math.pow(.7, arguments.length ? k : 1);\n    var r = this.r, g = this.g, b = this.b, i = 30;\n    if (!r && !g && !b) return new d3_rgb(i, i, i);\n    if (r && r < i) r = i;\n    if (g && g < i) g = i;\n    if (b && b < i) b = i;\n    return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));\n  };\n  d3_rgbPrototype.darker = function(k) {\n    k = Math.pow(.7, arguments.length ? k : 1);\n    return new d3_rgb(k * this.r, k * this.g, k * this.b);\n  };\n  d3_rgbPrototype.hsl = function() {\n    return d3_rgb_hsl(this.r, this.g, this.b);\n  };\n  d3_rgbPrototype.toString = function() {\n    return \"#\" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);\n  };\n  function d3_rgb_hex(v) {\n    return v < 16 ? \"0\" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);\n  }\n  function d3_rgb_parse(format, rgb, hsl) {\n    var r = 0, g = 0, b = 0, m1, m2, color;\n    m1 = /([a-z]+)\\((.*)\\)/.exec(format = format.toLowerCase());\n    if (m1) {\n      m2 = m1[2].split(\",\");\n      switch (m1[1]) {\n       case \"hsl\":\n        {\n          return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100);\n        }\n\n       case \"rgb\":\n        {\n          return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2]));\n        }\n      }\n    }\n    if (color = d3_rgb_names.get(format)) {\n      return rgb(color.r, color.g, color.b);\n    }\n    if (format != null && format.charAt(0) === \"#\" && !isNaN(color = parseInt(format.slice(1), 16))) {\n      if (format.length === 4) {\n        r = (color & 3840) >> 4;\n        r = r >> 4 | r;\n        g = color & 240;\n        g = g >> 4 | g;\n        b = color & 15;\n        b = b << 4 | b;\n      } else if (format.length === 7) {\n        r = (color & 16711680) >> 16;\n        g = (color & 65280) >> 8;\n        b = color & 255;\n      }\n    }\n    return rgb(r, g, b);\n  }\n  function d3_rgb_hsl(r, g, b) {\n    var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2;\n    if (d) {\n      s = l < .5 ? d / (max + min) : d / (2 - max - min);\n      if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4;\n      h *= 60;\n    } else {\n      h = NaN;\n      s = l > 0 && l < 1 ? 0 : h;\n    }\n    return new d3_hsl(h, s, l);\n  }\n  function d3_rgb_lab(r, g, b) {\n    r = d3_rgb_xyz(r);\n    g = d3_rgb_xyz(g);\n    b = d3_rgb_xyz(b);\n    var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z);\n    return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z));\n  }\n  function d3_rgb_xyz(r) {\n    return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4);\n  }\n  function d3_rgb_parseNumber(c) {\n    var f = parseFloat(c);\n    return c.charAt(c.length - 1) === \"%\" ? Math.round(f * 2.55) : f;\n  }\n  var d3_rgb_names = d3.map({\n    aliceblue: 15792383,\n    antiquewhite: 16444375,\n    aqua: 65535,\n    aquamarine: 8388564,\n    azure: 15794175,\n    beige: 16119260,\n    bisque: 16770244,\n    black: 0,\n    blanchedalmond: 16772045,\n    blue: 255,\n    blueviolet: 9055202,\n    brown: 10824234,\n    burlywood: 14596231,\n    cadetblue: 6266528,\n    chartreuse: 8388352,\n    chocolate: 13789470,\n    coral: 16744272,\n    cornflowerblue: 6591981,\n    cornsilk: 16775388,\n    crimson: 14423100,\n    cyan: 65535,\n    darkblue: 139,\n    darkcyan: 35723,\n    darkgoldenrod: 12092939,\n    darkgray: 11119017,\n    darkgreen: 25600,\n    darkgrey: 11119017,\n    darkkhaki: 12433259,\n    darkmagenta: 9109643,\n    darkolivegreen: 5597999,\n    darkorange: 16747520,\n    darkorchid: 10040012,\n    darkred: 9109504,\n    darksalmon: 15308410,\n    darkseagreen: 9419919,\n    darkslateblue: 4734347,\n    darkslategray: 3100495,\n    darkslategrey: 3100495,\n    darkturquoise: 52945,\n    darkviolet: 9699539,\n    deeppink: 16716947,\n    deepskyblue: 49151,\n    dimgray: 6908265,\n    dimgrey: 6908265,\n    dodgerblue: 2003199,\n    firebrick: 11674146,\n    floralwhite: 16775920,\n    forestgreen: 2263842,\n    fuchsia: 16711935,\n    gainsboro: 14474460,\n    ghostwhite: 16316671,\n    gold: 16766720,\n    goldenrod: 14329120,\n    gray: 8421504,\n    green: 32768,\n    greenyellow: 11403055,\n    grey: 8421504,\n    honeydew: 15794160,\n    hotpink: 16738740,\n    indianred: 13458524,\n    indigo: 4915330,\n    ivory: 16777200,\n    khaki: 15787660,\n    lavender: 15132410,\n    lavenderblush: 16773365,\n    lawngreen: 8190976,\n    lemonchiffon: 16775885,\n    lightblue: 11393254,\n    lightcoral: 15761536,\n    lightcyan: 14745599,\n    lightgoldenrodyellow: 16448210,\n    lightgray: 13882323,\n    lightgreen: 9498256,\n    lightgrey: 13882323,\n    lightpink: 16758465,\n    lightsalmon: 16752762,\n    lightseagreen: 2142890,\n    lightskyblue: 8900346,\n    lightslategray: 7833753,\n    lightslategrey: 7833753,\n    lightsteelblue: 11584734,\n    lightyellow: 16777184,\n    lime: 65280,\n    limegreen: 3329330,\n    linen: 16445670,\n    magenta: 16711935,\n    maroon: 8388608,\n    mediumaquamarine: 6737322,\n    mediumblue: 205,\n    mediumorchid: 12211667,\n    mediumpurple: 9662683,\n    mediumseagreen: 3978097,\n    mediumslateblue: 8087790,\n    mediumspringgreen: 64154,\n    mediumturquoise: 4772300,\n    mediumvioletred: 13047173,\n    midnightblue: 1644912,\n    mintcream: 16121850,\n    mistyrose: 16770273,\n    moccasin: 16770229,\n    navajowhite: 16768685,\n    navy: 128,\n    oldlace: 16643558,\n    olive: 8421376,\n    olivedrab: 7048739,\n    orange: 16753920,\n    orangered: 16729344,\n    orchid: 14315734,\n    palegoldenrod: 15657130,\n    palegreen: 10025880,\n    paleturquoise: 11529966,\n    palevioletred: 14381203,\n    papayawhip: 16773077,\n    peachpuff: 16767673,\n    peru: 13468991,\n    pink: 16761035,\n    plum: 14524637,\n    powderblue: 11591910,\n    purple: 8388736,\n    rebeccapurple: 6697881,\n    red: 16711680,\n    rosybrown: 12357519,\n    royalblue: 4286945,\n    saddlebrown: 9127187,\n    salmon: 16416882,\n    sandybrown: 16032864,\n    seagreen: 3050327,\n    seashell: 16774638,\n    sienna: 10506797,\n    silver: 12632256,\n    skyblue: 8900331,\n    slateblue: 6970061,\n    slategray: 7372944,\n    slategrey: 7372944,\n    snow: 16775930,\n    springgreen: 65407,\n    steelblue: 4620980,\n    tan: 13808780,\n    teal: 32896,\n    thistle: 14204888,\n    tomato: 16737095,\n    turquoise: 4251856,\n    violet: 15631086,\n    wheat: 16113331,\n    white: 16777215,\n    whitesmoke: 16119285,\n    yellow: 16776960,\n    yellowgreen: 10145074\n  });\n  d3_rgb_names.forEach(function(key, value) {\n    d3_rgb_names.set(key, d3_rgbNumber(value));\n  });\n  function d3_functor(v) {\n    return typeof v === \"function\" ? v : function() {\n      return v;\n    };\n  }\n  d3.functor = d3_functor;\n  d3.xhr = d3_xhrType(d3_identity);\n  function d3_xhrType(response) {\n    return function(url, mimeType, callback) {\n      if (arguments.length === 2 && typeof mimeType === \"function\") callback = mimeType, \n      mimeType = null;\n      return d3_xhr(url, mimeType, response, callback);\n    };\n  }\n  function d3_xhr(url, mimeType, response, callback) {\n    var xhr = {}, dispatch = d3.dispatch(\"beforesend\", \"progress\", \"load\", \"error\"), headers = {}, request = new XMLHttpRequest(), responseType = null;\n    if (this.XDomainRequest && !(\"withCredentials\" in request) && /^(http(s)?:)?\\/\\//.test(url)) request = new XDomainRequest();\n    \"onload\" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {\n      request.readyState > 3 && respond();\n    };\n    function respond() {\n      var status = request.status, result;\n      if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {\n        try {\n          result = response.call(xhr, request);\n        } catch (e) {\n          dispatch.error.call(xhr, e);\n          return;\n        }\n        dispatch.load.call(xhr, result);\n      } else {\n        dispatch.error.call(xhr, request);\n      }\n    }\n    request.onprogress = function(event) {\n      var o = d3.event;\n      d3.event = event;\n      try {\n        dispatch.progress.call(xhr, request);\n      } finally {\n        d3.event = o;\n      }\n    };\n    xhr.header = function(name, value) {\n      name = (name + \"\").toLowerCase();\n      if (arguments.length < 2) return headers[name];\n      if (value == null) delete headers[name]; else headers[name] = value + \"\";\n      return xhr;\n    };\n    xhr.mimeType = function(value) {\n      if (!arguments.length) return mimeType;\n      mimeType = value == null ? null : value + \"\";\n      return xhr;\n    };\n    xhr.responseType = function(value) {\n      if (!arguments.length) return responseType;\n      responseType = value;\n      return xhr;\n    };\n    xhr.response = function(value) {\n      response = value;\n      return xhr;\n    };\n    [ \"get\", \"post\" ].forEach(function(method) {\n      xhr[method] = function() {\n        return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));\n      };\n    });\n    xhr.send = function(method, data, callback) {\n      if (arguments.length === 2 && typeof data === \"function\") callback = data, data = null;\n      request.open(method, url, true);\n      if (mimeType != null && !(\"accept\" in headers)) headers[\"accept\"] = mimeType + \",*/*\";\n      if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]);\n      if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType);\n      if (responseType != null) request.responseType = responseType;\n      if (callback != null) xhr.on(\"error\", callback).on(\"load\", function(request) {\n        callback(null, request);\n      });\n      dispatch.beforesend.call(xhr, request);\n      request.send(data == null ? null : data);\n      return xhr;\n    };\n    xhr.abort = function() {\n      request.abort();\n      return xhr;\n    };\n    d3.rebind(xhr, dispatch, \"on\");\n    return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback));\n  }\n  function d3_xhr_fixCallback(callback) {\n    return callback.length === 1 ? function(error, request) {\n      callback(error == null ? request : null);\n    } : callback;\n  }\n  function d3_xhrHasResponse(request) {\n    var type = request.responseType;\n    return type && type !== \"text\" ? request.response : request.responseText;\n  }\n  d3.dsv = function(delimiter, mimeType) {\n    var reFormat = new RegExp('[\"' + delimiter + \"\\n]\"), delimiterCode = delimiter.charCodeAt(0);\n    function dsv(url, row, callback) {\n      if (arguments.length < 3) callback = row, row = null;\n      var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);\n      xhr.row = function(_) {\n        return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;\n      };\n      return xhr;\n    }\n    function response(request) {\n      return dsv.parse(request.responseText);\n    }\n    function typedResponse(f) {\n      return function(request) {\n        return dsv.parse(request.responseText, f);\n      };\n    }\n    dsv.parse = function(text, f) {\n      var o;\n      return dsv.parseRows(text, function(row, i) {\n        if (o) return o(row, i - 1);\n        var a = new Function(\"d\", \"return {\" + row.map(function(name, i) {\n          return JSON.stringify(name) + \": d[\" + i + \"]\";\n        }).join(\",\") + \"}\");\n        o = f ? function(row, i) {\n          return f(a(row), i);\n        } : a;\n      });\n    };\n    dsv.parseRows = function(text, f) {\n      var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol;\n      function token() {\n        if (I >= N) return EOF;\n        if (eol) return eol = false, EOL;\n        var j = I;\n        if (text.charCodeAt(j) === 34) {\n          var i = j;\n          while (i++ < N) {\n            if (text.charCodeAt(i) === 34) {\n              if (text.charCodeAt(i + 1) !== 34) break;\n              ++i;\n            }\n          }\n          I = i + 2;\n          var c = text.charCodeAt(i + 1);\n          if (c === 13) {\n            eol = true;\n            if (text.charCodeAt(i + 2) === 10) ++I;\n          } else if (c === 10) {\n            eol = true;\n          }\n          return text.slice(j + 1, i).replace(/\"\"/g, '\"');\n        }\n        while (I < N) {\n          var c = text.charCodeAt(I++), k = 1;\n          if (c === 10) eol = true; else if (c === 13) {\n            eol = true;\n            if (text.charCodeAt(I) === 10) ++I, ++k;\n          } else if (c !== delimiterCode) continue;\n          return text.slice(j, I - k);\n        }\n        return text.slice(j);\n      }\n      while ((t = token()) !== EOF) {\n        var a = [];\n        while (t !== EOL && t !== EOF) {\n          a.push(t);\n          t = token();\n        }\n        if (f && (a = f(a, n++)) == null) continue;\n        rows.push(a);\n      }\n      return rows;\n    };\n    dsv.format = function(rows) {\n      if (Array.isArray(rows[0])) return dsv.formatRows(rows);\n      var fieldSet = new d3_Set(), fields = [];\n      rows.forEach(function(row) {\n        for (var field in row) {\n          if (!fieldSet.has(field)) {\n            fields.push(fieldSet.add(field));\n          }\n        }\n      });\n      return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) {\n        return fields.map(function(field) {\n          return formatValue(row[field]);\n        }).join(delimiter);\n      })).join(\"\\n\");\n    };\n    dsv.formatRows = function(rows) {\n      return rows.map(formatRow).join(\"\\n\");\n    };\n    function formatRow(row) {\n      return row.map(formatValue).join(delimiter);\n    }\n    function formatValue(text) {\n      return reFormat.test(text) ? '\"' + text.replace(/\\\"/g, '\"\"') + '\"' : text;\n    }\n    return dsv;\n  };\n  d3.csv = d3.dsv(\",\", \"text/csv\");\n  d3.tsv = d3.dsv(\"\t\", \"text/tab-separated-values\");\n  var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_frame = this[d3_vendorSymbol(this, \"requestAnimationFrame\")] || function(callback) {\n    setTimeout(callback, 17);\n  };\n  d3.timer = function() {\n    d3_timer.apply(this, arguments);\n  };\n  function d3_timer(callback, delay, then) {\n    var n = arguments.length;\n    if (n < 2) delay = 0;\n    if (n < 3) then = Date.now();\n    var time = then + delay, timer = {\n      c: callback,\n      t: time,\n      n: null\n    };\n    if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer;\n    d3_timer_queueTail = timer;\n    if (!d3_timer_interval) {\n      d3_timer_timeout = clearTimeout(d3_timer_timeout);\n      d3_timer_interval = 1;\n      d3_timer_frame(d3_timer_step);\n    }\n    return timer;\n  }\n  function d3_timer_step() {\n    var now = d3_timer_mark(), delay = d3_timer_sweep() - now;\n    if (delay > 24) {\n      if (isFinite(delay)) {\n        clearTimeout(d3_timer_timeout);\n        d3_timer_timeout = setTimeout(d3_timer_step, delay);\n      }\n      d3_timer_interval = 0;\n    } else {\n      d3_timer_interval = 1;\n      d3_timer_frame(d3_timer_step);\n    }\n  }\n  d3.timer.flush = function() {\n    d3_timer_mark();\n    d3_timer_sweep();\n  };\n  function d3_timer_mark() {\n    var now = Date.now(), timer = d3_timer_queueHead;\n    while (timer) {\n      if (now >= timer.t && timer.c(now - timer.t)) timer.c = null;\n      timer = timer.n;\n    }\n    return now;\n  }\n  function d3_timer_sweep() {\n    var t0, t1 = d3_timer_queueHead, time = Infinity;\n    while (t1) {\n      if (t1.c) {\n        if (t1.t < time) time = t1.t;\n        t1 = (t0 = t1).n;\n      } else {\n        t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;\n      }\n    }\n    d3_timer_queueTail = t0;\n    return time;\n  }\n  function d3_format_precision(x, p) {\n    return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1);\n  }\n  d3.round = function(x, n) {\n    return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);\n  };\n  var d3_formatPrefixes = [ \"y\", \"z\", \"a\", \"f\", \"p\", \"n\", \"µ\", \"m\", \"\", \"k\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\", \"Y\" ].map(d3_formatPrefix);\n  d3.formatPrefix = function(value, precision) {\n    var i = 0;\n    if (value = +value) {\n      if (value < 0) value *= -1;\n      if (precision) value = d3.round(value, d3_format_precision(value, precision));\n      i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);\n      i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));\n    }\n    return d3_formatPrefixes[8 + i / 3];\n  };\n  function d3_formatPrefix(d, i) {\n    var k = Math.pow(10, abs(8 - i) * 3);\n    return {\n      scale: i > 8 ? function(d) {\n        return d / k;\n      } : function(d) {\n        return d * k;\n      },\n      symbol: d\n    };\n  }\n  function d3_locale_numberFormat(locale) {\n    var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) {\n      var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0;\n      while (i > 0 && g > 0) {\n        if (length + g + 1 > width) g = Math.max(1, width - length);\n        t.push(value.substring(i -= g, i + g));\n        if ((length += g + 1) > width) break;\n        g = locale_grouping[j = (j + 1) % locale_grouping.length];\n      }\n      return t.reverse().join(locale_thousands);\n    } : d3_identity;\n    return function(specifier) {\n      var match = d3_format_re.exec(specifier), fill = match[1] || \" \", align = match[2] || \">\", sign = match[3] || \"-\", symbol = match[4] || \"\", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = \"\", suffix = \"\", integer = false, exponent = true;\n      if (precision) precision = +precision.substring(1);\n      if (zfill || fill === \"0\" && align === \"=\") {\n        zfill = fill = \"0\";\n        align = \"=\";\n      }\n      switch (type) {\n       case \"n\":\n        comma = true;\n        type = \"g\";\n        break;\n\n       case \"%\":\n        scale = 100;\n        suffix = \"%\";\n        type = \"f\";\n        break;\n\n       case \"p\":\n        scale = 100;\n        suffix = \"%\";\n        type = \"r\";\n        break;\n\n       case \"b\":\n       case \"o\":\n       case \"x\":\n       case \"X\":\n        if (symbol === \"#\") prefix = \"0\" + type.toLowerCase();\n\n       case \"c\":\n        exponent = false;\n\n       case \"d\":\n        integer = true;\n        precision = 0;\n        break;\n\n       case \"s\":\n        scale = -1;\n        type = \"r\";\n        break;\n      }\n      if (symbol === \"$\") prefix = locale_currency[0], suffix = locale_currency[1];\n      if (type == \"r\" && !precision) type = \"g\";\n      if (precision != null) {\n        if (type == \"g\") precision = Math.max(1, Math.min(21, precision)); else if (type == \"e\" || type == \"f\") precision = Math.max(0, Math.min(20, precision));\n      }\n      type = d3_format_types.get(type) || d3_format_typeDefault;\n      var zcomma = zfill && comma;\n      return function(value) {\n        var fullSuffix = suffix;\n        if (integer && value % 1) return \"\";\n        var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, \"-\") : sign === \"-\" ? \"\" : sign;\n        if (scale < 0) {\n          var unit = d3.formatPrefix(value, precision);\n          value = unit.scale(value);\n          fullSuffix = unit.symbol + suffix;\n        } else {\n          value *= scale;\n        }\n        value = type(value, precision);\n        var i = value.lastIndexOf(\".\"), before, after;\n        if (i < 0) {\n          var j = exponent ? value.lastIndexOf(\"e\") : -1;\n          if (j < 0) before = value, after = \"\"; else before = value.substring(0, j), after = value.substring(j);\n        } else {\n          before = value.substring(0, i);\n          after = locale_decimal + value.substring(i + 1);\n        }\n        if (!zfill && comma) before = formatGroup(before, Infinity);\n        var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : \"\";\n        if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity);\n        negative += prefix;\n        value = before + after;\n        return (align === \"<\" ? negative + value + padding : align === \">\" ? padding + negative + value : align === \"^\" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix;\n      };\n    };\n  }\n  var d3_format_re = /(?:([^{])?([<>=^]))?([+\\- ])?([$#])?(0)?(\\d+)?(,)?(\\.-?\\d+)?([a-z%])?/i;\n  var d3_format_types = d3.map({\n    b: function(x) {\n      return x.toString(2);\n    },\n    c: function(x) {\n      return String.fromCharCode(x);\n    },\n    o: function(x) {\n      return x.toString(8);\n    },\n    x: function(x) {\n      return x.toString(16);\n    },\n    X: function(x) {\n      return x.toString(16).toUpperCase();\n    },\n    g: function(x, p) {\n      return x.toPrecision(p);\n    },\n    e: function(x, p) {\n      return x.toExponential(p);\n    },\n    f: function(x, p) {\n      return x.toFixed(p);\n    },\n    r: function(x, p) {\n      return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p))));\n    }\n  });\n  function d3_format_typeDefault(x) {\n    return x + \"\";\n  }\n  var d3_time = d3.time = {}, d3_date = Date;\n  function d3_date_utc() {\n    this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);\n  }\n  d3_date_utc.prototype = {\n    getDate: function() {\n      return this._.getUTCDate();\n    },\n    getDay: function() {\n      return this._.getUTCDay();\n    },\n    getFullYear: function() {\n      return this._.getUTCFullYear();\n    },\n    getHours: function() {\n      return this._.getUTCHours();\n    },\n    getMilliseconds: function() {\n      return this._.getUTCMilliseconds();\n    },\n    getMinutes: function() {\n      return this._.getUTCMinutes();\n    },\n    getMonth: function() {\n      return this._.getUTCMonth();\n    },\n    getSeconds: function() {\n      return this._.getUTCSeconds();\n    },\n    getTime: function() {\n      return this._.getTime();\n    },\n    getTimezoneOffset: function() {\n      return 0;\n    },\n    valueOf: function() {\n      return this._.valueOf();\n    },\n    setDate: function() {\n      d3_time_prototype.setUTCDate.apply(this._, arguments);\n    },\n    setDay: function() {\n      d3_time_prototype.setUTCDay.apply(this._, arguments);\n    },\n    setFullYear: function() {\n      d3_time_prototype.setUTCFullYear.apply(this._, arguments);\n    },\n    setHours: function() {\n      d3_time_prototype.setUTCHours.apply(this._, arguments);\n    },\n    setMilliseconds: function() {\n      d3_time_prototype.setUTCMilliseconds.apply(this._, arguments);\n    },\n    setMinutes: function() {\n      d3_time_prototype.setUTCMinutes.apply(this._, arguments);\n    },\n    setMonth: function() {\n      d3_time_prototype.setUTCMonth.apply(this._, arguments);\n    },\n    setSeconds: function() {\n      d3_time_prototype.setUTCSeconds.apply(this._, arguments);\n    },\n    setTime: function() {\n      d3_time_prototype.setTime.apply(this._, arguments);\n    }\n  };\n  var d3_time_prototype = Date.prototype;\n  function d3_time_interval(local, step, number) {\n    function round(date) {\n      var d0 = local(date), d1 = offset(d0, 1);\n      return date - d0 < d1 - date ? d0 : d1;\n    }\n    function ceil(date) {\n      step(date = local(new d3_date(date - 1)), 1);\n      return date;\n    }\n    function offset(date, k) {\n      step(date = new d3_date(+date), k);\n      return date;\n    }\n    function range(t0, t1, dt) {\n      var time = ceil(t0), times = [];\n      if (dt > 1) {\n        while (time < t1) {\n          if (!(number(time) % dt)) times.push(new Date(+time));\n          step(time, 1);\n        }\n      } else {\n        while (time < t1) times.push(new Date(+time)), step(time, 1);\n      }\n      return times;\n    }\n    function range_utc(t0, t1, dt) {\n      try {\n        d3_date = d3_date_utc;\n        var utc = new d3_date_utc();\n        utc._ = t0;\n        return range(utc, t1, dt);\n      } finally {\n        d3_date = Date;\n      }\n    }\n    local.floor = local;\n    local.round = round;\n    local.ceil = ceil;\n    local.offset = offset;\n    local.range = range;\n    var utc = local.utc = d3_time_interval_utc(local);\n    utc.floor = utc;\n    utc.round = d3_time_interval_utc(round);\n    utc.ceil = d3_time_interval_utc(ceil);\n    utc.offset = d3_time_interval_utc(offset);\n    utc.range = range_utc;\n    return local;\n  }\n  function d3_time_interval_utc(method) {\n    return function(date, k) {\n      try {\n        d3_date = d3_date_utc;\n        var utc = new d3_date_utc();\n        utc._ = date;\n        return method(utc, k)._;\n      } finally {\n        d3_date = Date;\n      }\n    };\n  }\n  d3_time.year = d3_time_interval(function(date) {\n    date = d3_time.day(date);\n    date.setMonth(0, 1);\n    return date;\n  }, function(date, offset) {\n    date.setFullYear(date.getFullYear() + offset);\n  }, function(date) {\n    return date.getFullYear();\n  });\n  d3_time.years = d3_time.year.range;\n  d3_time.years.utc = d3_time.year.utc.range;\n  d3_time.day = d3_time_interval(function(date) {\n    var day = new d3_date(2e3, 0);\n    day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n    return day;\n  }, function(date, offset) {\n    date.setDate(date.getDate() + offset);\n  }, function(date) {\n    return date.getDate() - 1;\n  });\n  d3_time.days = d3_time.day.range;\n  d3_time.days.utc = d3_time.day.utc.range;\n  d3_time.dayOfYear = function(date) {\n    var year = d3_time.year(date);\n    return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);\n  };\n  [ \"sunday\", \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\" ].forEach(function(day, i) {\n    i = 7 - i;\n    var interval = d3_time[day] = d3_time_interval(function(date) {\n      (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);\n      return date;\n    }, function(date, offset) {\n      date.setDate(date.getDate() + Math.floor(offset) * 7);\n    }, function(date) {\n      var day = d3_time.year(date).getDay();\n      return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i);\n    });\n    d3_time[day + \"s\"] = interval.range;\n    d3_time[day + \"s\"].utc = interval.utc.range;\n    d3_time[day + \"OfYear\"] = function(date) {\n      var day = d3_time.year(date).getDay();\n      return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7);\n    };\n  });\n  d3_time.week = d3_time.sunday;\n  d3_time.weeks = d3_time.sunday.range;\n  d3_time.weeks.utc = d3_time.sunday.utc.range;\n  d3_time.weekOfYear = d3_time.sundayOfYear;\n  function d3_locale_timeFormat(locale) {\n    var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;\n    function d3_time_format(template) {\n      var n = template.length;\n      function format(date) {\n        var string = [], i = -1, j = 0, c, p, f;\n        while (++i < n) {\n          if (template.charCodeAt(i) === 37) {\n            string.push(template.slice(j, i));\n            if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);\n            if (f = d3_time_formats[c]) c = f(date, p == null ? c === \"e\" ? \" \" : \"0\" : p);\n            string.push(c);\n            j = i + 1;\n          }\n        }\n        string.push(template.slice(j, i));\n        return string.join(\"\");\n      }\n      format.parse = function(string) {\n        var d = {\n          y: 1900,\n          m: 0,\n          d: 1,\n          H: 0,\n          M: 0,\n          S: 0,\n          L: 0,\n          Z: null\n        }, i = d3_time_parse(d, template, string, 0);\n        if (i != string.length) return null;\n        if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n        var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();\n        if (\"j\" in d) date.setFullYear(d.y, 0, d.j); else if (\"W\" in d || \"U\" in d) {\n          if (!(\"w\" in d)) d.w = \"W\" in d ? 1 : 0;\n          date.setFullYear(d.y, 0, 1);\n          date.setFullYear(d.y, 0, \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);\n        } else date.setFullYear(d.y, d.m, d.d);\n        date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L);\n        return localZ ? date._ : date;\n      };\n      format.toString = function() {\n        return template;\n      };\n      return format;\n    }\n    function d3_time_parse(date, template, string, j) {\n      var c, p, t, i = 0, n = template.length, m = string.length;\n      while (i < n) {\n        if (j >= m) return -1;\n        c = template.charCodeAt(i++);\n        if (c === 37) {\n          t = template.charAt(i++);\n          p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t];\n          if (!p || (j = p(date, string, j)) < 0) return -1;\n        } else if (c != string.charCodeAt(j++)) {\n          return -1;\n        }\n      }\n      return j;\n    }\n    d3_time_format.utc = function(template) {\n      var local = d3_time_format(template);\n      function format(date) {\n        try {\n          d3_date = d3_date_utc;\n          var utc = new d3_date();\n          utc._ = date;\n          return local(utc);\n        } finally {\n          d3_date = Date;\n        }\n      }\n      format.parse = function(string) {\n        try {\n          d3_date = d3_date_utc;\n          var date = local.parse(string);\n          return date && date._;\n        } finally {\n          d3_date = Date;\n        }\n      };\n      format.toString = local.toString;\n      return format;\n    };\n    d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti;\n    var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths);\n    locale_periods.forEach(function(p, i) {\n      d3_time_periodLookup.set(p.toLowerCase(), i);\n    });\n    var d3_time_formats = {\n      a: function(d) {\n        return locale_shortDays[d.getDay()];\n      },\n      A: function(d) {\n        return locale_days[d.getDay()];\n      },\n      b: function(d) {\n        return locale_shortMonths[d.getMonth()];\n      },\n      B: function(d) {\n        return locale_months[d.getMonth()];\n      },\n      c: d3_time_format(locale_dateTime),\n      d: function(d, p) {\n        return d3_time_formatPad(d.getDate(), p, 2);\n      },\n      e: function(d, p) {\n        return d3_time_formatPad(d.getDate(), p, 2);\n      },\n      H: function(d, p) {\n        return d3_time_formatPad(d.getHours(), p, 2);\n      },\n      I: function(d, p) {\n        return d3_time_formatPad(d.getHours() % 12 || 12, p, 2);\n      },\n      j: function(d, p) {\n        return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3);\n      },\n      L: function(d, p) {\n        return d3_time_formatPad(d.getMilliseconds(), p, 3);\n      },\n      m: function(d, p) {\n        return d3_time_formatPad(d.getMonth() + 1, p, 2);\n      },\n      M: function(d, p) {\n        return d3_time_formatPad(d.getMinutes(), p, 2);\n      },\n      p: function(d) {\n        return locale_periods[+(d.getHours() >= 12)];\n      },\n      S: function(d, p) {\n        return d3_time_formatPad(d.getSeconds(), p, 2);\n      },\n      U: function(d, p) {\n        return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2);\n      },\n      w: function(d) {\n        return d.getDay();\n      },\n      W: function(d, p) {\n        return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2);\n      },\n      x: d3_time_format(locale_date),\n      X: d3_time_format(locale_time),\n      y: function(d, p) {\n        return d3_time_formatPad(d.getFullYear() % 100, p, 2);\n      },\n      Y: function(d, p) {\n        return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);\n      },\n      Z: d3_time_zone,\n      \"%\": function() {\n        return \"%\";\n      }\n    };\n    var d3_time_parsers = {\n      a: d3_time_parseWeekdayAbbrev,\n      A: d3_time_parseWeekday,\n      b: d3_time_parseMonthAbbrev,\n      B: d3_time_parseMonth,\n      c: d3_time_parseLocaleFull,\n      d: d3_time_parseDay,\n      e: d3_time_parseDay,\n      H: d3_time_parseHour24,\n      I: d3_time_parseHour24,\n      j: d3_time_parseDayOfYear,\n      L: d3_time_parseMilliseconds,\n      m: d3_time_parseMonthNumber,\n      M: d3_time_parseMinutes,\n      p: d3_time_parseAmPm,\n      S: d3_time_parseSeconds,\n      U: d3_time_parseWeekNumberSunday,\n      w: d3_time_parseWeekdayNumber,\n      W: d3_time_parseWeekNumberMonday,\n      x: d3_time_parseLocaleDate,\n      X: d3_time_parseLocaleTime,\n      y: d3_time_parseYear,\n      Y: d3_time_parseFullYear,\n      Z: d3_time_parseZone,\n      \"%\": d3_time_parseLiteralPercent\n    };\n    function d3_time_parseWeekdayAbbrev(date, string, i) {\n      d3_time_dayAbbrevRe.lastIndex = 0;\n      var n = d3_time_dayAbbrevRe.exec(string.slice(i));\n      return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n    }\n    function d3_time_parseWeekday(date, string, i) {\n      d3_time_dayRe.lastIndex = 0;\n      var n = d3_time_dayRe.exec(string.slice(i));\n      return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n    }\n    function d3_time_parseMonthAbbrev(date, string, i) {\n      d3_time_monthAbbrevRe.lastIndex = 0;\n      var n = d3_time_monthAbbrevRe.exec(string.slice(i));\n      return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n    }\n    function d3_time_parseMonth(date, string, i) {\n      d3_time_monthRe.lastIndex = 0;\n      var n = d3_time_monthRe.exec(string.slice(i));\n      return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n    }\n    function d3_time_parseLocaleFull(date, string, i) {\n      return d3_time_parse(date, d3_time_formats.c.toString(), string, i);\n    }\n    function d3_time_parseLocaleDate(date, string, i) {\n      return d3_time_parse(date, d3_time_formats.x.toString(), string, i);\n    }\n    function d3_time_parseLocaleTime(date, string, i) {\n      return d3_time_parse(date, d3_time_formats.X.toString(), string, i);\n    }\n    function d3_time_parseAmPm(date, string, i) {\n      var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase());\n      return n == null ? -1 : (date.p = n, i);\n    }\n    return d3_time_format;\n  }\n  var d3_time_formatPads = {\n    \"-\": \"\",\n    _: \" \",\n    \"0\": \"0\"\n  }, d3_time_numberRe = /^\\s*\\d+/, d3_time_percentRe = /^%/;\n  function d3_time_formatPad(value, fill, width) {\n    var sign = value < 0 ? \"-\" : \"\", string = (sign ? -value : value) + \"\", length = string.length;\n    return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n  }\n  function d3_time_formatRe(names) {\n    return new RegExp(\"^(?:\" + names.map(d3.requote).join(\"|\") + \")\", \"i\");\n  }\n  function d3_time_formatLookup(names) {\n    var map = new d3_Map(), i = -1, n = names.length;\n    while (++i < n) map.set(names[i].toLowerCase(), i);\n    return map;\n  }\n  function d3_time_parseWeekdayNumber(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 1));\n    return n ? (date.w = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseWeekNumberSunday(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i));\n    return n ? (date.U = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseWeekNumberMonday(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i));\n    return n ? (date.W = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseFullYear(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 4));\n    return n ? (date.y = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseYear(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n    return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;\n  }\n  function d3_time_parseZone(date, string, i) {\n    return /^[+-]\\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, \n    i + 5) : -1;\n  }\n  function d3_time_expandYear(d) {\n    return d + (d > 68 ? 1900 : 2e3);\n  }\n  function d3_time_parseMonthNumber(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n    return n ? (date.m = n[0] - 1, i + n[0].length) : -1;\n  }\n  function d3_time_parseDay(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n    return n ? (date.d = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseDayOfYear(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 3));\n    return n ? (date.j = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseHour24(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n    return n ? (date.H = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseMinutes(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n    return n ? (date.M = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseSeconds(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 2));\n    return n ? (date.S = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_parseMilliseconds(date, string, i) {\n    d3_time_numberRe.lastIndex = 0;\n    var n = d3_time_numberRe.exec(string.slice(i, i + 3));\n    return n ? (date.L = +n[0], i + n[0].length) : -1;\n  }\n  function d3_time_zone(d) {\n    var z = d.getTimezoneOffset(), zs = z > 0 ? \"-\" : \"+\", zh = abs(z) / 60 | 0, zm = abs(z) % 60;\n    return zs + d3_time_formatPad(zh, \"0\", 2) + d3_time_formatPad(zm, \"0\", 2);\n  }\n  function d3_time_parseLiteralPercent(date, string, i) {\n    d3_time_percentRe.lastIndex = 0;\n    var n = d3_time_percentRe.exec(string.slice(i, i + 1));\n    return n ? i + n[0].length : -1;\n  }\n  function d3_time_formatMulti(formats) {\n    var n = formats.length, i = -1;\n    while (++i < n) formats[i][0] = this(formats[i][0]);\n    return function(date) {\n      var i = 0, f = formats[i];\n      while (!f[1](date)) f = formats[++i];\n      return f[0](date);\n    };\n  }\n  d3.locale = function(locale) {\n    return {\n      numberFormat: d3_locale_numberFormat(locale),\n      timeFormat: d3_locale_timeFormat(locale)\n    };\n  };\n  var d3_locale_enUS = d3.locale({\n    decimal: \".\",\n    thousands: \",\",\n    grouping: [ 3 ],\n    currency: [ \"$\", \"\" ],\n    dateTime: \"%a %b %e %X %Y\",\n    date: \"%m/%d/%Y\",\n    time: \"%H:%M:%S\",\n    periods: [ \"AM\", \"PM\" ],\n    days: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ],\n    shortDays: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ],\n    months: [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n    shortMonths: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ]\n  });\n  d3.format = d3_locale_enUS.numberFormat;\n  d3.geo = {};\n  function d3_adder() {}\n  d3_adder.prototype = {\n    s: 0,\n    t: 0,\n    add: function(y) {\n      d3_adderSum(y, this.t, d3_adderTemp);\n      d3_adderSum(d3_adderTemp.s, this.s, this);\n      if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t;\n    },\n    reset: function() {\n      this.s = this.t = 0;\n    },\n    valueOf: function() {\n      return this.s;\n    }\n  };\n  var d3_adderTemp = new d3_adder();\n  function d3_adderSum(a, b, o) {\n    var x = o.s = a + b, bv = x - a, av = x - bv;\n    o.t = a - av + (b - bv);\n  }\n  d3.geo.stream = function(object, listener) {\n    if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) {\n      d3_geo_streamObjectType[object.type](object, listener);\n    } else {\n      d3_geo_streamGeometry(object, listener);\n    }\n  };\n  function d3_geo_streamGeometry(geometry, listener) {\n    if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) {\n      d3_geo_streamGeometryType[geometry.type](geometry, listener);\n    }\n  }\n  var d3_geo_streamObjectType = {\n    Feature: function(feature, listener) {\n      d3_geo_streamGeometry(feature.geometry, listener);\n    },\n    FeatureCollection: function(object, listener) {\n      var features = object.features, i = -1, n = features.length;\n      while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);\n    }\n  };\n  var d3_geo_streamGeometryType = {\n    Sphere: function(object, listener) {\n      listener.sphere();\n    },\n    Point: function(object, listener) {\n      object = object.coordinates;\n      listener.point(object[0], object[1], object[2]);\n    },\n    MultiPoint: function(object, listener) {\n      var coordinates = object.coordinates, i = -1, n = coordinates.length;\n      while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]);\n    },\n    LineString: function(object, listener) {\n      d3_geo_streamLine(object.coordinates, listener, 0);\n    },\n    MultiLineString: function(object, listener) {\n      var coordinates = object.coordinates, i = -1, n = coordinates.length;\n      while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0);\n    },\n    Polygon: function(object, listener) {\n      d3_geo_streamPolygon(object.coordinates, listener);\n    },\n    MultiPolygon: function(object, listener) {\n      var coordinates = object.coordinates, i = -1, n = coordinates.length;\n      while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);\n    },\n    GeometryCollection: function(object, listener) {\n      var geometries = object.geometries, i = -1, n = geometries.length;\n      while (++i < n) d3_geo_streamGeometry(geometries[i], listener);\n    }\n  };\n  function d3_geo_streamLine(coordinates, listener, closed) {\n    var i = -1, n = coordinates.length - closed, coordinate;\n    listener.lineStart();\n    while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]);\n    listener.lineEnd();\n  }\n  function d3_geo_streamPolygon(coordinates, listener) {\n    var i = -1, n = coordinates.length;\n    listener.polygonStart();\n    while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1);\n    listener.polygonEnd();\n  }\n  d3.geo.area = function(object) {\n    d3_geo_areaSum = 0;\n    d3.geo.stream(object, d3_geo_area);\n    return d3_geo_areaSum;\n  };\n  var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder();\n  var d3_geo_area = {\n    sphere: function() {\n      d3_geo_areaSum += 4 * π;\n    },\n    point: d3_noop,\n    lineStart: d3_noop,\n    lineEnd: d3_noop,\n    polygonStart: function() {\n      d3_geo_areaRingSum.reset();\n      d3_geo_area.lineStart = d3_geo_areaRingStart;\n    },\n    polygonEnd: function() {\n      var area = 2 * d3_geo_areaRingSum;\n      d3_geo_areaSum += area < 0 ? 4 * π + area : area;\n      d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop;\n    }\n  };\n  function d3_geo_areaRingStart() {\n    var λ00, φ00, λ0, cosφ0, sinφ0;\n    d3_geo_area.point = function(λ, φ) {\n      d3_geo_area.point = nextPoint;\n      λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), \n      sinφ0 = Math.sin(φ);\n    };\n    function nextPoint(λ, φ) {\n      λ *= d3_radians;\n      φ = φ * d3_radians / 2 + π / 4;\n      var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ);\n      d3_geo_areaRingSum.add(Math.atan2(v, u));\n      λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;\n    }\n    d3_geo_area.lineEnd = function() {\n      nextPoint(λ00, φ00);\n    };\n  }\n  function d3_geo_cartesian(spherical) {\n    var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);\n    return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ];\n  }\n  function d3_geo_cartesianDot(a, b) {\n    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n  }\n  function d3_geo_cartesianCross(a, b) {\n    return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ];\n  }\n  function d3_geo_cartesianAdd(a, b) {\n    a[0] += b[0];\n    a[1] += b[1];\n    a[2] += b[2];\n  }\n  function d3_geo_cartesianScale(vector, k) {\n    return [ vector[0] * k, vector[1] * k, vector[2] * k ];\n  }\n  function d3_geo_cartesianNormalize(d) {\n    var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n    d[0] /= l;\n    d[1] /= l;\n    d[2] /= l;\n  }\n  function d3_geo_spherical(cartesian) {\n    return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ];\n  }\n  function d3_geo_sphericalEqual(a, b) {\n    return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε;\n  }\n  d3.geo.bounds = function() {\n    var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;\n    var bound = {\n      point: point,\n      lineStart: lineStart,\n      lineEnd: lineEnd,\n      polygonStart: function() {\n        bound.point = ringPoint;\n        bound.lineStart = ringStart;\n        bound.lineEnd = ringEnd;\n        dλSum = 0;\n        d3_geo_area.polygonStart();\n      },\n      polygonEnd: function() {\n        d3_geo_area.polygonEnd();\n        bound.point = point;\n        bound.lineStart = lineStart;\n        bound.lineEnd = lineEnd;\n        if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90;\n        range[0] = λ0, range[1] = λ1;\n      }\n    };\n    function point(λ, φ) {\n      ranges.push(range = [ λ0 = λ, λ1 = λ ]);\n      if (φ < φ0) φ0 = φ;\n      if (φ > φ1) φ1 = φ;\n    }\n    function linePoint(λ, φ) {\n      var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);\n      if (p0) {\n        var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);\n        d3_geo_cartesianNormalize(inflection);\n        inflection = d3_geo_spherical(inflection);\n        var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180;\n        if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) {\n          var φi = inflection[1] * d3_degrees;\n          if (φi > φ1) φ1 = φi;\n        } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) {\n          var φi = -inflection[1] * d3_degrees;\n          if (φi < φ0) φ0 = φi;\n        } else {\n          if (φ < φ0) φ0 = φ;\n          if (φ > φ1) φ1 = φ;\n        }\n        if (antimeridian) {\n          if (λ < λ_) {\n            if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;\n          } else {\n            if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;\n          }\n        } else {\n          if (λ1 >= λ0) {\n            if (λ < λ0) λ0 = λ;\n            if (λ > λ1) λ1 = λ;\n          } else {\n            if (λ > λ_) {\n              if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;\n            } else {\n              if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;\n            }\n          }\n        }\n      } else {\n        point(λ, φ);\n      }\n      p0 = p, λ_ = λ;\n    }\n    function lineStart() {\n      bound.point = linePoint;\n    }\n    function lineEnd() {\n      range[0] = λ0, range[1] = λ1;\n      bound.point = point;\n      p0 = null;\n    }\n    function ringPoint(λ, φ) {\n      if (p0) {\n        var dλ = λ - λ_;\n        dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ;\n      } else λ__ = λ, φ__ = φ;\n      d3_geo_area.point(λ, φ);\n      linePoint(λ, φ);\n    }\n    function ringStart() {\n      d3_geo_area.lineStart();\n    }\n    function ringEnd() {\n      ringPoint(λ__, φ__);\n      d3_geo_area.lineEnd();\n      if (abs(dλSum) > ε) λ0 = -(λ1 = 180);\n      range[0] = λ0, range[1] = λ1;\n      p0 = null;\n    }\n    function angle(λ0, λ1) {\n      return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1;\n    }\n    function compareRanges(a, b) {\n      return a[0] - b[0];\n    }\n    function withinRange(x, range) {\n      return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n    }\n    return function(feature) {\n      φ1 = λ1 = -(λ0 = φ0 = Infinity);\n      ranges = [];\n      d3.geo.stream(feature, bound);\n      var n = ranges.length;\n      if (n) {\n        ranges.sort(compareRanges);\n        for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) {\n          b = ranges[i];\n          if (withinRange(b[0], a) || withinRange(b[1], a)) {\n            if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n            if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n          } else {\n            merged.push(a = b);\n          }\n        }\n        var best = -Infinity, dλ;\n        for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) {\n          b = merged[i];\n          if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1];\n        }\n      }\n      ranges = range = null;\n      return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ];\n    };\n  }();\n  d3.geo.centroid = function(object) {\n    d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;\n    d3.geo.stream(object, d3_geo_centroid);\n    var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z;\n    if (m < ε2) {\n      x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1;\n      if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0;\n      m = x * x + y * y + z * z;\n      if (m < ε2) return [ NaN, NaN ];\n    }\n    return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ];\n  };\n  var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2;\n  var d3_geo_centroid = {\n    sphere: d3_noop,\n    point: d3_geo_centroidPoint,\n    lineStart: d3_geo_centroidLineStart,\n    lineEnd: d3_geo_centroidLineEnd,\n    polygonStart: function() {\n      d3_geo_centroid.lineStart = d3_geo_centroidRingStart;\n    },\n    polygonEnd: function() {\n      d3_geo_centroid.lineStart = d3_geo_centroidLineStart;\n    }\n  };\n  function d3_geo_centroidPoint(λ, φ) {\n    λ *= d3_radians;\n    var cosφ = Math.cos(φ *= d3_radians);\n    d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ));\n  }\n  function d3_geo_centroidPointXYZ(x, y, z) {\n    ++d3_geo_centroidW0;\n    d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0;\n    d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0;\n    d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0;\n  }\n  function d3_geo_centroidLineStart() {\n    var x0, y0, z0;\n    d3_geo_centroid.point = function(λ, φ) {\n      λ *= d3_radians;\n      var cosφ = Math.cos(φ *= d3_radians);\n      x0 = cosφ * Math.cos(λ);\n      y0 = cosφ * Math.sin(λ);\n      z0 = Math.sin(φ);\n      d3_geo_centroid.point = nextPoint;\n      d3_geo_centroidPointXYZ(x0, y0, z0);\n    };\n    function nextPoint(λ, φ) {\n      λ *= d3_radians;\n      var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n      d3_geo_centroidW1 += w;\n      d3_geo_centroidX1 += w * (x0 + (x0 = x));\n      d3_geo_centroidY1 += w * (y0 + (y0 = y));\n      d3_geo_centroidZ1 += w * (z0 + (z0 = z));\n      d3_geo_centroidPointXYZ(x0, y0, z0);\n    }\n  }\n  function d3_geo_centroidLineEnd() {\n    d3_geo_centroid.point = d3_geo_centroidPoint;\n  }\n  function d3_geo_centroidRingStart() {\n    var λ00, φ00, x0, y0, z0;\n    d3_geo_centroid.point = function(λ, φ) {\n      λ00 = λ, φ00 = φ;\n      d3_geo_centroid.point = nextPoint;\n      λ *= d3_radians;\n      var cosφ = Math.cos(φ *= d3_radians);\n      x0 = cosφ * Math.cos(λ);\n      y0 = cosφ * Math.sin(λ);\n      z0 = Math.sin(φ);\n      d3_geo_centroidPointXYZ(x0, y0, z0);\n    };\n    d3_geo_centroid.lineEnd = function() {\n      nextPoint(λ00, φ00);\n      d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd;\n      d3_geo_centroid.point = d3_geo_centroidPoint;\n    };\n    function nextPoint(λ, φ) {\n      λ *= d3_radians;\n      var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u);\n      d3_geo_centroidX2 += v * cx;\n      d3_geo_centroidY2 += v * cy;\n      d3_geo_centroidZ2 += v * cz;\n      d3_geo_centroidW1 += w;\n      d3_geo_centroidX1 += w * (x0 + (x0 = x));\n      d3_geo_centroidY1 += w * (y0 + (y0 = y));\n      d3_geo_centroidZ1 += w * (z0 + (z0 = z));\n      d3_geo_centroidPointXYZ(x0, y0, z0);\n    }\n  }\n  function d3_geo_compose(a, b) {\n    function compose(x, y) {\n      return x = a(x, y), b(x[0], x[1]);\n    }\n    if (a.invert && b.invert) compose.invert = function(x, y) {\n      return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n    };\n    return compose;\n  }\n  function d3_true() {\n    return true;\n  }\n  function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {\n    var subject = [], clip = [];\n    segments.forEach(function(segment) {\n      if ((n = segment.length - 1) <= 0) return;\n      var n, p0 = segment[0], p1 = segment[n];\n      if (d3_geo_sphericalEqual(p0, p1)) {\n        listener.lineStart();\n        for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]);\n        listener.lineEnd();\n        return;\n      }\n      var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false);\n      a.o = b;\n      subject.push(a);\n      clip.push(b);\n      a = new d3_geo_clipPolygonIntersection(p1, segment, null, false);\n      b = new d3_geo_clipPolygonIntersection(p1, null, a, true);\n      a.o = b;\n      subject.push(a);\n      clip.push(b);\n    });\n    clip.sort(compare);\n    d3_geo_clipPolygonLinkCircular(subject);\n    d3_geo_clipPolygonLinkCircular(clip);\n    if (!subject.length) return;\n    for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {\n      clip[i].e = entry = !entry;\n    }\n    var start = subject[0], points, point;\n    while (1) {\n      var current = start, isSubject = true;\n      while (current.v) if ((current = current.n) === start) return;\n      points = current.z;\n      listener.lineStart();\n      do {\n        current.v = current.o.v = true;\n        if (current.e) {\n          if (isSubject) {\n            for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);\n          } else {\n            interpolate(current.x, current.n.x, 1, listener);\n          }\n          current = current.n;\n        } else {\n          if (isSubject) {\n            points = current.p.z;\n            for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);\n          } else {\n            interpolate(current.x, current.p.x, -1, listener);\n          }\n          current = current.p;\n        }\n        current = current.o;\n        points = current.z;\n        isSubject = !isSubject;\n      } while (!current.v);\n      listener.lineEnd();\n    }\n  }\n  function d3_geo_clipPolygonLinkCircular(array) {\n    if (!(n = array.length)) return;\n    var n, i = 0, a = array[0], b;\n    while (++i < n) {\n      a.n = b = array[i];\n      b.p = a;\n      a = b;\n    }\n    a.n = b = array[0];\n    b.p = a;\n  }\n  function d3_geo_clipPolygonIntersection(point, points, other, entry) {\n    this.x = point;\n    this.z = points;\n    this.o = other;\n    this.e = entry;\n    this.v = false;\n    this.n = this.p = null;\n  }\n  function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {\n    return function(rotate, listener) {\n      var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);\n      var clip = {\n        point: point,\n        lineStart: lineStart,\n        lineEnd: lineEnd,\n        polygonStart: function() {\n          clip.point = pointRing;\n          clip.lineStart = ringStart;\n          clip.lineEnd = ringEnd;\n          segments = [];\n          polygon = [];\n        },\n        polygonEnd: function() {\n          clip.point = point;\n          clip.lineStart = lineStart;\n          clip.lineEnd = lineEnd;\n          segments = d3.merge(segments);\n          var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);\n          if (segments.length) {\n            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;\n            d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);\n          } else if (clipStartInside) {\n            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;\n            listener.lineStart();\n            interpolate(null, null, 1, listener);\n            listener.lineEnd();\n          }\n          if (polygonStarted) listener.polygonEnd(), polygonStarted = false;\n          segments = polygon = null;\n        },\n        sphere: function() {\n          listener.polygonStart();\n          listener.lineStart();\n          interpolate(null, null, 1, listener);\n          listener.lineEnd();\n          listener.polygonEnd();\n        }\n      };\n      function point(λ, φ) {\n        var point = rotate(λ, φ);\n        if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);\n      }\n      function pointLine(λ, φ) {\n        var point = rotate(λ, φ);\n        line.point(point[0], point[1]);\n      }\n      function lineStart() {\n        clip.point = pointLine;\n        line.lineStart();\n      }\n      function lineEnd() {\n        clip.point = point;\n        line.lineEnd();\n      }\n      var segments;\n      var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;\n      function pointRing(λ, φ) {\n        ring.push([ λ, φ ]);\n        var point = rotate(λ, φ);\n        ringListener.point(point[0], point[1]);\n      }\n      function ringStart() {\n        ringListener.lineStart();\n        ring = [];\n      }\n      function ringEnd() {\n        pointRing(ring[0][0], ring[0][1]);\n        ringListener.lineEnd();\n        var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length;\n        ring.pop();\n        polygon.push(ring);\n        ring = null;\n        if (!n) return;\n        if (clean & 1) {\n          segment = ringSegments[0];\n          var n = segment.length - 1, i = -1, point;\n          if (n > 0) {\n            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;\n            listener.lineStart();\n            while (++i < n) listener.point((point = segment[i])[0], point[1]);\n            listener.lineEnd();\n          }\n          return;\n        }\n        if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n        segments.push(ringSegments.filter(d3_geo_clipSegmentLength1));\n      }\n      return clip;\n    };\n  }\n  function d3_geo_clipSegmentLength1(segment) {\n    return segment.length > 1;\n  }\n  function d3_geo_clipBufferListener() {\n    var lines = [], line;\n    return {\n      lineStart: function() {\n        lines.push(line = []);\n      },\n      point: function(λ, φ) {\n        line.push([ λ, φ ]);\n      },\n      lineEnd: d3_noop,\n      buffer: function() {\n        var buffer = lines;\n        lines = [];\n        line = null;\n        return buffer;\n      },\n      rejoin: function() {\n        if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n      }\n    };\n  }\n  function d3_geo_clipSort(a, b) {\n    return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);\n  }\n  var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);\n  function d3_geo_clipAntimeridianLine(listener) {\n    var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;\n    return {\n      lineStart: function() {\n        listener.lineStart();\n        clean = 1;\n      },\n      point: function(λ1, φ1) {\n        var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0);\n        if (abs(dλ - π) < ε) {\n          listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);\n          listener.point(sλ0, φ0);\n          listener.lineEnd();\n          listener.lineStart();\n          listener.point(sλ1, φ0);\n          listener.point(λ1, φ0);\n          clean = 0;\n        } else if (sλ0 !== sλ1 && dλ >= π) {\n          if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε;\n          if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε;\n          φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1);\n          listener.point(sλ0, φ0);\n          listener.lineEnd();\n          listener.lineStart();\n          listener.point(sλ1, φ0);\n          clean = 0;\n        }\n        listener.point(λ0 = λ1, φ0 = φ1);\n        sλ0 = sλ1;\n      },\n      lineEnd: function() {\n        listener.lineEnd();\n        λ0 = φ0 = NaN;\n      },\n      clean: function() {\n        return 2 - clean;\n      }\n    };\n  }\n  function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) {\n    var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1);\n    return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2;\n  }\n  function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {\n    var φ;\n    if (from == null) {\n      φ = direction * halfπ;\n      listener.point(-π, φ);\n      listener.point(0, φ);\n      listener.point(π, φ);\n      listener.point(π, 0);\n      listener.point(π, -φ);\n      listener.point(0, -φ);\n      listener.point(-π, -φ);\n      listener.point(-π, 0);\n      listener.point(-π, φ);\n    } else if (abs(from[0] - to[0]) > ε) {\n      var s = from[0] < to[0] ? π : -π;\n      φ = direction * s / 2;\n      listener.point(-s, φ);\n      listener.point(0, φ);\n      listener.point(s, φ);\n    } else {\n      listener.point(to[0], to[1]);\n    }\n  }\n  function d3_geo_pointInPolygon(point, polygon) {\n    var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;\n    d3_geo_areaRingSum.reset();\n    for (var i = 0, n = polygon.length; i < n; ++i) {\n      var ring = polygon[i], m = ring.length;\n      if (!m) continue;\n      var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;\n      while (true) {\n        if (j === m) j = 0;\n        point = ring[j];\n        var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ;\n        d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));\n        polarAngle += antimeridian ? dλ + sdλ * τ : dλ;\n        if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {\n          var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));\n          d3_geo_cartesianNormalize(arc);\n          var intersection = d3_geo_cartesianCross(meridianNormal, arc);\n          d3_geo_cartesianNormalize(intersection);\n          var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);\n          if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {\n            winding += antimeridian ^ dλ >= 0 ? 1 : -1;\n          }\n        }\n        if (!j++) break;\n        λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;\n      }\n    }\n    return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < -ε) ^ winding & 1;\n  }\n  function d3_geo_clipCircle(radius) {\n    var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);\n    return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);\n    function visible(λ, φ) {\n      return Math.cos(λ) * Math.cos(φ) > cr;\n    }\n    function clipLine(listener) {\n      var point0, c0, v0, v00, clean;\n      return {\n        lineStart: function() {\n          v00 = v0 = false;\n          clean = 1;\n        },\n        point: function(λ, φ) {\n          var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;\n          if (!point0 && (v00 = v0 = v)) listener.lineStart();\n          if (v !== v0) {\n            point2 = intersect(point0, point1);\n            if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {\n              point1[0] += ε;\n              point1[1] += ε;\n              v = visible(point1[0], point1[1]);\n            }\n          }\n          if (v !== v0) {\n            clean = 0;\n            if (v) {\n              listener.lineStart();\n              point2 = intersect(point1, point0);\n              listener.point(point2[0], point2[1]);\n            } else {\n              point2 = intersect(point0, point1);\n              listener.point(point2[0], point2[1]);\n              listener.lineEnd();\n            }\n            point0 = point2;\n          } else if (notHemisphere && point0 && smallRadius ^ v) {\n            var t;\n            if (!(c & c0) && (t = intersect(point1, point0, true))) {\n              clean = 0;\n              if (smallRadius) {\n                listener.lineStart();\n                listener.point(t[0][0], t[0][1]);\n                listener.point(t[1][0], t[1][1]);\n                listener.lineEnd();\n              } else {\n                listener.point(t[1][0], t[1][1]);\n                listener.lineEnd();\n                listener.lineStart();\n                listener.point(t[0][0], t[0][1]);\n              }\n            }\n          }\n          if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {\n            listener.point(point1[0], point1[1]);\n          }\n          point0 = point1, v0 = v, c0 = c;\n        },\n        lineEnd: function() {\n          if (v0) listener.lineEnd();\n          point0 = null;\n        },\n        clean: function() {\n          return clean | (v00 && v0) << 1;\n        }\n      };\n    }\n    function intersect(a, b, two) {\n      var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b);\n      var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;\n      if (!determinant) return !two && a;\n      var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2);\n      d3_geo_cartesianAdd(A, B);\n      var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1);\n      if (t2 < 0) return;\n      var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu);\n      d3_geo_cartesianAdd(q, A);\n      q = d3_geo_spherical(q);\n      if (!two) return q;\n      var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z;\n      if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;\n      var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε;\n      if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;\n      if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {\n        var q1 = d3_geo_cartesianScale(u, (-w + t) / uu);\n        d3_geo_cartesianAdd(q1, A);\n        return [ q, d3_geo_spherical(q1) ];\n      }\n    }\n    function code(λ, φ) {\n      var r = smallRadius ? radius : π - radius, code = 0;\n      if (λ < -r) code |= 1; else if (λ > r) code |= 2;\n      if (φ < -r) code |= 4; else if (φ > r) code |= 8;\n      return code;\n    }\n  }\n  function d3_geom_clipLine(x0, y0, x1, y1) {\n    return function(line) {\n      var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;\n      r = x0 - ax;\n      if (!dx && r > 0) return;\n      r /= dx;\n      if (dx < 0) {\n        if (r < t0) return;\n        if (r < t1) t1 = r;\n      } else if (dx > 0) {\n        if (r > t1) return;\n        if (r > t0) t0 = r;\n      }\n      r = x1 - ax;\n      if (!dx && r < 0) return;\n      r /= dx;\n      if (dx < 0) {\n        if (r > t1) return;\n        if (r > t0) t0 = r;\n      } else if (dx > 0) {\n        if (r < t0) return;\n        if (r < t1) t1 = r;\n      }\n      r = y0 - ay;\n      if (!dy && r > 0) return;\n      r /= dy;\n      if (dy < 0) {\n        if (r < t0) return;\n        if (r < t1) t1 = r;\n      } else if (dy > 0) {\n        if (r > t1) return;\n        if (r > t0) t0 = r;\n      }\n      r = y1 - ay;\n      if (!dy && r < 0) return;\n      r /= dy;\n      if (dy < 0) {\n        if (r > t1) return;\n        if (r > t0) t0 = r;\n      } else if (dy > 0) {\n        if (r < t0) return;\n        if (r < t1) t1 = r;\n      }\n      if (t0 > 0) line.a = {\n        x: ax + t0 * dx,\n        y: ay + t0 * dy\n      };\n      if (t1 < 1) line.b = {\n        x: ax + t1 * dx,\n        y: ay + t1 * dy\n      };\n      return line;\n    };\n  }\n  var d3_geo_clipExtentMAX = 1e9;\n  d3.geo.clipExtent = function() {\n    var x0, y0, x1, y1, stream, clip, clipExtent = {\n      stream: function(output) {\n        if (stream) stream.valid = false;\n        stream = clip(output);\n        stream.valid = true;\n        return stream;\n      },\n      extent: function(_) {\n        if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];\n        clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]);\n        if (stream) stream.valid = false, stream = null;\n        return clipExtent;\n      }\n    };\n    return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]);\n  };\n  function d3_geo_clipExtent(x0, y0, x1, y1) {\n    return function(listener) {\n      var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;\n      var clip = {\n        point: point,\n        lineStart: lineStart,\n        lineEnd: lineEnd,\n        polygonStart: function() {\n          listener = bufferListener;\n          segments = [];\n          polygon = [];\n          clean = true;\n        },\n        polygonEnd: function() {\n          listener = listener_;\n          segments = d3.merge(segments);\n          var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;\n          if (inside || visible) {\n            listener.polygonStart();\n            if (inside) {\n              listener.lineStart();\n              interpolate(null, null, 1, listener);\n              listener.lineEnd();\n            }\n            if (visible) {\n              d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);\n            }\n            listener.polygonEnd();\n          }\n          segments = polygon = ring = null;\n        }\n      };\n      function insidePolygon(p) {\n        var wn = 0, n = polygon.length, y = p[1];\n        for (var i = 0; i < n; ++i) {\n          for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) {\n            b = v[j];\n            if (a[1] <= y) {\n              if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn;\n            } else {\n              if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn;\n            }\n            a = b;\n          }\n        }\n        return wn !== 0;\n      }\n      function interpolate(from, to, direction, listener) {\n        var a = 0, a1 = 0;\n        if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) {\n          do {\n            listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n          } while ((a = (a + direction + 4) % 4) !== a1);\n        } else {\n          listener.point(to[0], to[1]);\n        }\n      }\n      function pointVisible(x, y) {\n        return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n      }\n      function point(x, y) {\n        if (pointVisible(x, y)) listener.point(x, y);\n      }\n      var x__, y__, v__, x_, y_, v_, first, clean;\n      function lineStart() {\n        clip.point = linePoint;\n        if (polygon) polygon.push(ring = []);\n        first = true;\n        v_ = false;\n        x_ = y_ = NaN;\n      }\n      function lineEnd() {\n        if (segments) {\n          linePoint(x__, y__);\n          if (v__ && v_) bufferListener.rejoin();\n          segments.push(bufferListener.buffer());\n        }\n        clip.point = point;\n        if (v_) listener.lineEnd();\n      }\n      function linePoint(x, y) {\n        x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));\n        y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));\n        var v = pointVisible(x, y);\n        if (polygon) ring.push([ x, y ]);\n        if (first) {\n          x__ = x, y__ = y, v__ = v;\n          first = false;\n          if (v) {\n            listener.lineStart();\n            listener.point(x, y);\n          }\n        } else {\n          if (v && v_) listener.point(x, y); else {\n            var l = {\n              a: {\n                x: x_,\n                y: y_\n              },\n              b: {\n                x: x,\n                y: y\n              }\n            };\n            if (clipLine(l)) {\n              if (!v_) {\n                listener.lineStart();\n                listener.point(l.a.x, l.a.y);\n              }\n              listener.point(l.b.x, l.b.y);\n              if (!v) listener.lineEnd();\n              clean = false;\n            } else if (v) {\n              listener.lineStart();\n              listener.point(x, y);\n              clean = false;\n            }\n          }\n        }\n        x_ = x, y_ = y, v_ = v;\n      }\n      return clip;\n    };\n    function corner(p, direction) {\n      return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;\n    }\n    function compare(a, b) {\n      return comparePoints(a.x, b.x);\n    }\n    function comparePoints(a, b) {\n      var ca = corner(a, 1), cb = corner(b, 1);\n      return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];\n    }\n  }\n  function d3_geo_conic(projectAt) {\n    var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1);\n    p.parallels = function(_) {\n      if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ];\n      return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);\n    };\n    return p;\n  }\n  function d3_geo_conicEqualArea(φ0, φ1) {\n    var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n;\n    function forward(λ, φ) {\n      var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n;\n      return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ];\n    }\n    forward.invert = function(x, y) {\n      var ρ0_y = ρ0 - y;\n      return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ];\n    };\n    return forward;\n  }\n  (d3.geo.conicEqualArea = function() {\n    return d3_geo_conic(d3_geo_conicEqualArea);\n  }).raw = d3_geo_conicEqualArea;\n  d3.geo.albers = function() {\n    return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);\n  };\n  d3.geo.albersUsa = function() {\n    var lower48 = d3.geo.albers();\n    var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);\n    var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);\n    var point, pointStream = {\n      point: function(x, y) {\n        point = [ x, y ];\n      }\n    }, lower48Point, alaskaPoint, hawaiiPoint;\n    function albersUsa(coordinates) {\n      var x = coordinates[0], y = coordinates[1];\n      point = null;\n      (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y);\n      return point;\n    }\n    albersUsa.invert = function(coordinates) {\n      var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;\n      return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates);\n    };\n    albersUsa.stream = function(stream) {\n      var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream);\n      return {\n        point: function(x, y) {\n          lower48Stream.point(x, y);\n          alaskaStream.point(x, y);\n          hawaiiStream.point(x, y);\n        },\n        sphere: function() {\n          lower48Stream.sphere();\n          alaskaStream.sphere();\n          hawaiiStream.sphere();\n        },\n        lineStart: function() {\n          lower48Stream.lineStart();\n          alaskaStream.lineStart();\n          hawaiiStream.lineStart();\n        },\n        lineEnd: function() {\n          lower48Stream.lineEnd();\n          alaskaStream.lineEnd();\n          hawaiiStream.lineEnd();\n        },\n        polygonStart: function() {\n          lower48Stream.polygonStart();\n          alaskaStream.polygonStart();\n          hawaiiStream.polygonStart();\n        },\n        polygonEnd: function() {\n          lower48Stream.polygonEnd();\n          alaskaStream.polygonEnd();\n          hawaiiStream.polygonEnd();\n        }\n      };\n    };\n    albersUsa.precision = function(_) {\n      if (!arguments.length) return lower48.precision();\n      lower48.precision(_);\n      alaska.precision(_);\n      hawaii.precision(_);\n      return albersUsa;\n    };\n    albersUsa.scale = function(_) {\n      if (!arguments.length) return lower48.scale();\n      lower48.scale(_);\n      alaska.scale(_ * .35);\n      hawaii.scale(_);\n      return albersUsa.translate(lower48.translate());\n    };\n    albersUsa.translate = function(_) {\n      if (!arguments.length) return lower48.translate();\n      var k = lower48.scale(), x = +_[0], y = +_[1];\n      lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point;\n      alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;\n      hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;\n      return albersUsa;\n    };\n    return albersUsa.scale(1070);\n  };\n  var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {\n    point: d3_noop,\n    lineStart: d3_noop,\n    lineEnd: d3_noop,\n    polygonStart: function() {\n      d3_geo_pathAreaPolygon = 0;\n      d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;\n    },\n    polygonEnd: function() {\n      d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;\n      d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);\n    }\n  };\n  function d3_geo_pathAreaRingStart() {\n    var x00, y00, x0, y0;\n    d3_geo_pathArea.point = function(x, y) {\n      d3_geo_pathArea.point = nextPoint;\n      x00 = x0 = x, y00 = y0 = y;\n    };\n    function nextPoint(x, y) {\n      d3_geo_pathAreaPolygon += y0 * x - x0 * y;\n      x0 = x, y0 = y;\n    }\n    d3_geo_pathArea.lineEnd = function() {\n      nextPoint(x00, y00);\n    };\n  }\n  var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;\n  var d3_geo_pathBounds = {\n    point: d3_geo_pathBoundsPoint,\n    lineStart: d3_noop,\n    lineEnd: d3_noop,\n    polygonStart: d3_noop,\n    polygonEnd: d3_noop\n  };\n  function d3_geo_pathBoundsPoint(x, y) {\n    if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;\n    if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;\n    if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;\n    if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;\n  }\n  function d3_geo_pathBuffer() {\n    var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];\n    var stream = {\n      point: point,\n      lineStart: function() {\n        stream.point = pointLineStart;\n      },\n      lineEnd: lineEnd,\n      polygonStart: function() {\n        stream.lineEnd = lineEndPolygon;\n      },\n      polygonEnd: function() {\n        stream.lineEnd = lineEnd;\n        stream.point = point;\n      },\n      pointRadius: function(_) {\n        pointCircle = d3_geo_pathBufferCircle(_);\n        return stream;\n      },\n      result: function() {\n        if (buffer.length) {\n          var result = buffer.join(\"\");\n          buffer = [];\n          return result;\n        }\n      }\n    };\n    function point(x, y) {\n      buffer.push(\"M\", x, \",\", y, pointCircle);\n    }\n    function pointLineStart(x, y) {\n      buffer.push(\"M\", x, \",\", y);\n      stream.point = pointLine;\n    }\n    function pointLine(x, y) {\n      buffer.push(\"L\", x, \",\", y);\n    }\n    function lineEnd() {\n      stream.point = point;\n    }\n    function lineEndPolygon() {\n      buffer.push(\"Z\");\n    }\n    return stream;\n  }\n  function d3_geo_pathBufferCircle(radius) {\n    return \"m0,\" + radius + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius + \"z\";\n  }\n  var d3_geo_pathCentroid = {\n    point: d3_geo_pathCentroidPoint,\n    lineStart: d3_geo_pathCentroidLineStart,\n    lineEnd: d3_geo_pathCentroidLineEnd,\n    polygonStart: function() {\n      d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;\n    },\n    polygonEnd: function() {\n      d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;\n      d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;\n      d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;\n    }\n  };\n  function d3_geo_pathCentroidPoint(x, y) {\n    d3_geo_centroidX0 += x;\n    d3_geo_centroidY0 += y;\n    ++d3_geo_centroidZ0;\n  }\n  function d3_geo_pathCentroidLineStart() {\n    var x0, y0;\n    d3_geo_pathCentroid.point = function(x, y) {\n      d3_geo_pathCentroid.point = nextPoint;\n      d3_geo_pathCentroidPoint(x0 = x, y0 = y);\n    };\n    function nextPoint(x, y) {\n      var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);\n      d3_geo_centroidX1 += z * (x0 + x) / 2;\n      d3_geo_centroidY1 += z * (y0 + y) / 2;\n      d3_geo_centroidZ1 += z;\n      d3_geo_pathCentroidPoint(x0 = x, y0 = y);\n    }\n  }\n  function d3_geo_pathCentroidLineEnd() {\n    d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;\n  }\n  function d3_geo_pathCentroidRingStart() {\n    var x00, y00, x0, y0;\n    d3_geo_pathCentroid.point = function(x, y) {\n      d3_geo_pathCentroid.point = nextPoint;\n      d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);\n    };\n    function nextPoint(x, y) {\n      var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);\n      d3_geo_centroidX1 += z * (x0 + x) / 2;\n      d3_geo_centroidY1 += z * (y0 + y) / 2;\n      d3_geo_centroidZ1 += z;\n      z = y0 * x - x0 * y;\n      d3_geo_centroidX2 += z * (x0 + x);\n      d3_geo_centroidY2 += z * (y0 + y);\n      d3_geo_centroidZ2 += z * 3;\n      d3_geo_pathCentroidPoint(x0 = x, y0 = y);\n    }\n    d3_geo_pathCentroid.lineEnd = function() {\n      nextPoint(x00, y00);\n    };\n  }\n  function d3_geo_pathContext(context) {\n    var pointRadius = 4.5;\n    var stream = {\n      point: point,\n      lineStart: function() {\n        stream.point = pointLineStart;\n      },\n      lineEnd: lineEnd,\n      polygonStart: function() {\n        stream.lineEnd = lineEndPolygon;\n      },\n      polygonEnd: function() {\n        stream.lineEnd = lineEnd;\n        stream.point = point;\n      },\n      pointRadius: function(_) {\n        pointRadius = _;\n        return stream;\n      },\n      result: d3_noop\n    };\n    function point(x, y) {\n      context.moveTo(x + pointRadius, y);\n      context.arc(x, y, pointRadius, 0, τ);\n    }\n    function pointLineStart(x, y) {\n      context.moveTo(x, y);\n      stream.point = pointLine;\n    }\n    function pointLine(x, y) {\n      context.lineTo(x, y);\n    }\n    function lineEnd() {\n      stream.point = point;\n    }\n    function lineEndPolygon() {\n      context.closePath();\n    }\n    return stream;\n  }\n  function d3_geo_resample(project) {\n    var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;\n    function resample(stream) {\n      return (maxDepth ? resampleRecursive : resampleNone)(stream);\n    }\n    function resampleNone(stream) {\n      return d3_geo_transformPoint(stream, function(x, y) {\n        x = project(x, y);\n        stream.point(x[0], x[1]);\n      });\n    }\n    function resampleRecursive(stream) {\n      var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0;\n      var resample = {\n        point: point,\n        lineStart: lineStart,\n        lineEnd: lineEnd,\n        polygonStart: function() {\n          stream.polygonStart();\n          resample.lineStart = ringStart;\n        },\n        polygonEnd: function() {\n          stream.polygonEnd();\n          resample.lineStart = lineStart;\n        }\n      };\n      function point(x, y) {\n        x = project(x, y);\n        stream.point(x[0], x[1]);\n      }\n      function lineStart() {\n        x0 = NaN;\n        resample.point = linePoint;\n        stream.lineStart();\n      }\n      function linePoint(λ, φ) {\n        var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ);\n        resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n        stream.point(x0, y0);\n      }\n      function lineEnd() {\n        resample.point = point;\n        stream.lineEnd();\n      }\n      function ringStart() {\n        lineStart();\n        resample.point = ringPoint;\n        resample.lineEnd = ringEnd;\n      }\n      function ringPoint(λ, φ) {\n        linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n        resample.point = linePoint;\n      }\n      function ringEnd() {\n        resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream);\n        resample.lineEnd = lineEnd;\n        lineEnd();\n      }\n      return resample;\n    }\n    function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) {\n      var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy;\n      if (d2 > 4 * δ2 && depth--) {\n        var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2;\n        if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {\n          resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream);\n          stream.point(x2, y2);\n          resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream);\n        }\n      }\n    }\n    resample.precision = function(_) {\n      if (!arguments.length) return Math.sqrt(δ2);\n      maxDepth = (δ2 = _ * _) > 0 && 16;\n      return resample;\n    };\n    return resample;\n  }\n  d3.geo.path = function() {\n    var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream;\n    function path(object) {\n      if (object) {\n        if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n        if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream);\n        d3.geo.stream(object, cacheStream);\n      }\n      return contextStream.result();\n    }\n    path.area = function(object) {\n      d3_geo_pathAreaSum = 0;\n      d3.geo.stream(object, projectStream(d3_geo_pathArea));\n      return d3_geo_pathAreaSum;\n    };\n    path.centroid = function(object) {\n      d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;\n      d3.geo.stream(object, projectStream(d3_geo_pathCentroid));\n      return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ];\n    };\n    path.bounds = function(object) {\n      d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity);\n      d3.geo.stream(object, projectStream(d3_geo_pathBounds));\n      return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ];\n    };\n    path.projection = function(_) {\n      if (!arguments.length) return projection;\n      projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity;\n      return reset();\n    };\n    path.context = function(_) {\n      if (!arguments.length) return context;\n      contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_);\n      if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n      return reset();\n    };\n    path.pointRadius = function(_) {\n      if (!arguments.length) return pointRadius;\n      pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n      return path;\n    };\n    function reset() {\n      cacheStream = null;\n      return path;\n    }\n    return path.projection(d3.geo.albersUsa()).context(null);\n  };\n  function d3_geo_pathProjectStream(project) {\n    var resample = d3_geo_resample(function(x, y) {\n      return project([ x * d3_degrees, y * d3_degrees ]);\n    });\n    return function(stream) {\n      return d3_geo_projectionRadians(resample(stream));\n    };\n  }\n  d3.geo.transform = function(methods) {\n    return {\n      stream: function(stream) {\n        var transform = new d3_geo_transform(stream);\n        for (var k in methods) transform[k] = methods[k];\n        return transform;\n      }\n    };\n  };\n  function d3_geo_transform(stream) {\n    this.stream = stream;\n  }\n  d3_geo_transform.prototype = {\n    point: function(x, y) {\n      this.stream.point(x, y);\n    },\n    sphere: function() {\n      this.stream.sphere();\n    },\n    lineStart: function() {\n      this.stream.lineStart();\n    },\n    lineEnd: function() {\n      this.stream.lineEnd();\n    },\n    polygonStart: function() {\n      this.stream.polygonStart();\n    },\n    polygonEnd: function() {\n      this.stream.polygonEnd();\n    }\n  };\n  function d3_geo_transformPoint(stream, point) {\n    return {\n      point: point,\n      sphere: function() {\n        stream.sphere();\n      },\n      lineStart: function() {\n        stream.lineStart();\n      },\n      lineEnd: function() {\n        stream.lineEnd();\n      },\n      polygonStart: function() {\n        stream.polygonStart();\n      },\n      polygonEnd: function() {\n        stream.polygonEnd();\n      }\n    };\n  }\n  d3.geo.projection = d3_geo_projection;\n  d3.geo.projectionMutator = d3_geo_projectionMutator;\n  function d3_geo_projection(project) {\n    return d3_geo_projectionMutator(function() {\n      return project;\n    })();\n  }\n  function d3_geo_projectionMutator(projectAt) {\n    var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {\n      x = project(x, y);\n      return [ x[0] * k + δx, δy - x[1] * k ];\n    }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;\n    function projection(point) {\n      point = projectRotate(point[0] * d3_radians, point[1] * d3_radians);\n      return [ point[0] * k + δx, δy - point[1] * k ];\n    }\n    function invert(point) {\n      point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k);\n      return point && [ point[0] * d3_degrees, point[1] * d3_degrees ];\n    }\n    projection.stream = function(output) {\n      if (stream) stream.valid = false;\n      stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));\n      stream.valid = true;\n      return stream;\n    };\n    projection.clipAngle = function(_) {\n      if (!arguments.length) return clipAngle;\n      preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians);\n      return invalidate();\n    };\n    projection.clipExtent = function(_) {\n      if (!arguments.length) return clipExtent;\n      clipExtent = _;\n      postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity;\n      return invalidate();\n    };\n    projection.scale = function(_) {\n      if (!arguments.length) return k;\n      k = +_;\n      return reset();\n    };\n    projection.translate = function(_) {\n      if (!arguments.length) return [ x, y ];\n      x = +_[0];\n      y = +_[1];\n      return reset();\n    };\n    projection.center = function(_) {\n      if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ];\n      λ = _[0] % 360 * d3_radians;\n      φ = _[1] % 360 * d3_radians;\n      return reset();\n    };\n    projection.rotate = function(_) {\n      if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ];\n      δλ = _[0] % 360 * d3_radians;\n      δφ = _[1] % 360 * d3_radians;\n      δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0;\n      return reset();\n    };\n    d3.rebind(projection, projectResample, \"precision\");\n    function reset() {\n      projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project);\n      var center = project(λ, φ);\n      δx = x - center[0] * k;\n      δy = y + center[1] * k;\n      return invalidate();\n    }\n    function invalidate() {\n      if (stream) stream.valid = false, stream = null;\n      return projection;\n    }\n    return function() {\n      project = projectAt.apply(this, arguments);\n      projection.invert = project.invert && invert;\n      return reset();\n    };\n  }\n  function d3_geo_projectionRadians(stream) {\n    return d3_geo_transformPoint(stream, function(x, y) {\n      stream.point(x * d3_radians, y * d3_radians);\n    });\n  }\n  function d3_geo_equirectangular(λ, φ) {\n    return [ λ, φ ];\n  }\n  (d3.geo.equirectangular = function() {\n    return d3_geo_projection(d3_geo_equirectangular);\n  }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;\n  d3.geo.rotation = function(rotate) {\n    rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0);\n    function forward(coordinates) {\n      coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);\n      return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;\n    }\n    forward.invert = function(coordinates) {\n      coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians);\n      return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;\n    };\n    return forward;\n  };\n  function d3_geo_identityRotation(λ, φ) {\n    return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];\n  }\n  d3_geo_identityRotation.invert = d3_geo_equirectangular;\n  function d3_geo_rotation(δλ, δφ, δγ) {\n    return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;\n  }\n  function d3_geo_forwardRotationλ(δλ) {\n    return function(λ, φ) {\n      return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];\n    };\n  }\n  function d3_geo_rotationλ(δλ) {\n    var rotation = d3_geo_forwardRotationλ(δλ);\n    rotation.invert = d3_geo_forwardRotationλ(-δλ);\n    return rotation;\n  }\n  function d3_geo_rotationφγ(δφ, δγ) {\n    var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);\n    function rotation(λ, φ) {\n      var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;\n      return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];\n    }\n    rotation.invert = function(λ, φ) {\n      var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;\n      return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];\n    };\n    return rotation;\n  }\n  d3.geo.circle = function() {\n    var origin = [ 0, 0 ], angle, precision = 6, interpolate;\n    function circle() {\n      var center = typeof origin === \"function\" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = [];\n      interpolate(null, null, 1, {\n        point: function(x, y) {\n          ring.push(x = rotate(x, y));\n          x[0] *= d3_degrees, x[1] *= d3_degrees;\n        }\n      });\n      return {\n        type: \"Polygon\",\n        coordinates: [ ring ]\n      };\n    }\n    circle.origin = function(x) {\n      if (!arguments.length) return origin;\n      origin = x;\n      return circle;\n    };\n    circle.angle = function(x) {\n      if (!arguments.length) return angle;\n      interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians);\n      return circle;\n    };\n    circle.precision = function(_) {\n      if (!arguments.length) return precision;\n      interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians);\n      return circle;\n    };\n    return circle.angle(90);\n  };\n  function d3_geo_circleInterpolate(radius, precision) {\n    var cr = Math.cos(radius), sr = Math.sin(radius);\n    return function(from, to, direction, listener) {\n      var step = direction * precision;\n      if (from != null) {\n        from = d3_geo_circleAngle(cr, from);\n        to = d3_geo_circleAngle(cr, to);\n        if (direction > 0 ? from < to : from > to) from += direction * τ;\n      } else {\n        from = radius + direction * τ;\n        to = radius - .5 * step;\n      }\n      for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {\n        listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]);\n      }\n    };\n  }\n  function d3_geo_circleAngle(cr, point) {\n    var a = d3_geo_cartesian(point);\n    a[0] -= cr;\n    d3_geo_cartesianNormalize(a);\n    var angle = d3_acos(-a[1]);\n    return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);\n  }\n  d3.geo.distance = function(a, b) {\n    var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;\n    return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);\n  };\n  d3.geo.graticule = function() {\n    var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;\n    function graticule() {\n      return {\n        type: \"MultiLineString\",\n        coordinates: lines()\n      };\n    }\n    function lines() {\n      return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) {\n        return abs(x % DX) > ε;\n      }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) {\n        return abs(y % DY) > ε;\n      }).map(y));\n    }\n    graticule.lines = function() {\n      return lines().map(function(coordinates) {\n        return {\n          type: \"LineString\",\n          coordinates: coordinates\n        };\n      });\n    };\n    graticule.outline = function() {\n      return {\n        type: \"Polygon\",\n        coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ]\n      };\n    };\n    graticule.extent = function(_) {\n      if (!arguments.length) return graticule.minorExtent();\n      return graticule.majorExtent(_).minorExtent(_);\n    };\n    graticule.majorExtent = function(_) {\n      if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];\n      X0 = +_[0][0], X1 = +_[1][0];\n      Y0 = +_[0][1], Y1 = +_[1][1];\n      if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n      if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n      return graticule.precision(precision);\n    };\n    graticule.minorExtent = function(_) {\n      if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];\n      x0 = +_[0][0], x1 = +_[1][0];\n      y0 = +_[0][1], y1 = +_[1][1];\n      if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n      if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n      return graticule.precision(precision);\n    };\n    graticule.step = function(_) {\n      if (!arguments.length) return graticule.minorStep();\n      return graticule.majorStep(_).minorStep(_);\n    };\n    graticule.majorStep = function(_) {\n      if (!arguments.length) return [ DX, DY ];\n      DX = +_[0], DY = +_[1];\n      return graticule;\n    };\n    graticule.minorStep = function(_) {\n      if (!arguments.length) return [ dx, dy ];\n      dx = +_[0], dy = +_[1];\n      return graticule;\n    };\n    graticule.precision = function(_) {\n      if (!arguments.length) return precision;\n      precision = +_;\n      x = d3_geo_graticuleX(y0, y1, 90);\n      y = d3_geo_graticuleY(x0, x1, precision);\n      X = d3_geo_graticuleX(Y0, Y1, 90);\n      Y = d3_geo_graticuleY(X0, X1, precision);\n      return graticule;\n    };\n    return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]);\n  };\n  function d3_geo_graticuleX(y0, y1, dy) {\n    var y = d3.range(y0, y1 - ε, dy).concat(y1);\n    return function(x) {\n      return y.map(function(y) {\n        return [ x, y ];\n      });\n    };\n  }\n  function d3_geo_graticuleY(x0, x1, dx) {\n    var x = d3.range(x0, x1 - ε, dx).concat(x1);\n    return function(y) {\n      return x.map(function(x) {\n        return [ x, y ];\n      });\n    };\n  }\n  function d3_source(d) {\n    return d.source;\n  }\n  function d3_target(d) {\n    return d.target;\n  }\n  d3.geo.greatArc = function() {\n    var source = d3_source, source_, target = d3_target, target_;\n    function greatArc() {\n      return {\n        type: \"LineString\",\n        coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ]\n      };\n    }\n    greatArc.distance = function() {\n      return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments));\n    };\n    greatArc.source = function(_) {\n      if (!arguments.length) return source;\n      source = _, source_ = typeof _ === \"function\" ? null : _;\n      return greatArc;\n    };\n    greatArc.target = function(_) {\n      if (!arguments.length) return target;\n      target = _, target_ = typeof _ === \"function\" ? null : _;\n      return greatArc;\n    };\n    greatArc.precision = function() {\n      return arguments.length ? greatArc : 0;\n    };\n    return greatArc;\n  };\n  d3.geo.interpolate = function(source, target) {\n    return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians);\n  };\n  function d3_geo_interpolate(x0, y0, x1, y1) {\n    var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d);\n    var interpolate = d ? function(t) {\n      var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;\n      return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ];\n    } : function() {\n      return [ x0 * d3_degrees, y0 * d3_degrees ];\n    };\n    interpolate.distance = d;\n    return interpolate;\n  }\n  d3.geo.length = function(object) {\n    d3_geo_lengthSum = 0;\n    d3.geo.stream(object, d3_geo_length);\n    return d3_geo_lengthSum;\n  };\n  var d3_geo_lengthSum;\n  var d3_geo_length = {\n    sphere: d3_noop,\n    point: d3_noop,\n    lineStart: d3_geo_lengthLineStart,\n    lineEnd: d3_noop,\n    polygonStart: d3_noop,\n    polygonEnd: d3_noop\n  };\n  function d3_geo_lengthLineStart() {\n    var λ0, sinφ0, cosφ0;\n    d3_geo_length.point = function(λ, φ) {\n      λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ);\n      d3_geo_length.point = nextPoint;\n    };\n    d3_geo_length.lineEnd = function() {\n      d3_geo_length.point = d3_geo_length.lineEnd = d3_noop;\n    };\n    function nextPoint(λ, φ) {\n      var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t);\n      d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ);\n      λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ;\n    }\n  }\n  function d3_geo_azimuthal(scale, angle) {\n    function azimuthal(λ, φ) {\n      var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);\n      return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ];\n    }\n    azimuthal.invert = function(x, y) {\n      var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c);\n      return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ];\n    };\n    return azimuthal;\n  }\n  var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) {\n    return Math.sqrt(2 / (1 + cosλcosφ));\n  }, function(ρ) {\n    return 2 * Math.asin(ρ / 2);\n  });\n  (d3.geo.azimuthalEqualArea = function() {\n    return d3_geo_projection(d3_geo_azimuthalEqualArea);\n  }).raw = d3_geo_azimuthalEqualArea;\n  var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) {\n    var c = Math.acos(cosλcosφ);\n    return c && c / Math.sin(c);\n  }, d3_identity);\n  (d3.geo.azimuthalEquidistant = function() {\n    return d3_geo_projection(d3_geo_azimuthalEquidistant);\n  }).raw = d3_geo_azimuthalEquidistant;\n  function d3_geo_conicConformal(φ0, φ1) {\n    var cosφ0 = Math.cos(φ0), t = function(φ) {\n      return Math.tan(π / 4 + φ / 2);\n    }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;\n    if (!n) return d3_geo_mercator;\n    function forward(λ, φ) {\n      if (F > 0) {\n        if (φ < -halfπ + ε) φ = -halfπ + ε;\n      } else {\n        if (φ > halfπ - ε) φ = halfπ - ε;\n      }\n      var ρ = F / Math.pow(t(φ), n);\n      return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];\n    }\n    forward.invert = function(x, y) {\n      var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y);\n      return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ];\n    };\n    return forward;\n  }\n  (d3.geo.conicConformal = function() {\n    return d3_geo_conic(d3_geo_conicConformal);\n  }).raw = d3_geo_conicConformal;\n  function d3_geo_conicEquidistant(φ0, φ1) {\n    var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0;\n    if (abs(n) < ε) return d3_geo_equirectangular;\n    function forward(λ, φ) {\n      var ρ = G - φ;\n      return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ];\n    }\n    forward.invert = function(x, y) {\n      var ρ0_y = G - y;\n      return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ];\n    };\n    return forward;\n  }\n  (d3.geo.conicEquidistant = function() {\n    return d3_geo_conic(d3_geo_conicEquidistant);\n  }).raw = d3_geo_conicEquidistant;\n  var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) {\n    return 1 / cosλcosφ;\n  }, Math.atan);\n  (d3.geo.gnomonic = function() {\n    return d3_geo_projection(d3_geo_gnomonic);\n  }).raw = d3_geo_gnomonic;\n  function d3_geo_mercator(λ, φ) {\n    return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];\n  }\n  d3_geo_mercator.invert = function(x, y) {\n    return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];\n  };\n  function d3_geo_mercatorProjection(project) {\n    var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;\n    m.scale = function() {\n      var v = scale.apply(m, arguments);\n      return v === m ? clipAuto ? m.clipExtent(null) : m : v;\n    };\n    m.translate = function() {\n      var v = translate.apply(m, arguments);\n      return v === m ? clipAuto ? m.clipExtent(null) : m : v;\n    };\n    m.clipExtent = function(_) {\n      var v = clipExtent.apply(m, arguments);\n      if (v === m) {\n        if (clipAuto = _ == null) {\n          var k = π * scale(), t = translate();\n          clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]);\n        }\n      } else if (clipAuto) {\n        v = null;\n      }\n      return v;\n    };\n    return m.clipExtent(null);\n  }\n  (d3.geo.mercator = function() {\n    return d3_geo_mercatorProjection(d3_geo_mercator);\n  }).raw = d3_geo_mercator;\n  var d3_geo_orthographic = d3_geo_azimuthal(function() {\n    return 1;\n  }, Math.asin);\n  (d3.geo.orthographic = function() {\n    return d3_geo_projection(d3_geo_orthographic);\n  }).raw = d3_geo_orthographic;\n  var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) {\n    return 1 / (1 + cosλcosφ);\n  }, function(ρ) {\n    return 2 * Math.atan(ρ);\n  });\n  (d3.geo.stereographic = function() {\n    return d3_geo_projection(d3_geo_stereographic);\n  }).raw = d3_geo_stereographic;\n  function d3_geo_transverseMercator(λ, φ) {\n    return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ];\n  }\n  d3_geo_transverseMercator.invert = function(x, y) {\n    return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ];\n  };\n  (d3.geo.transverseMercator = function() {\n    var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;\n    projection.center = function(_) {\n      return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);\n    };\n    projection.rotate = function(_) {\n      return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), \n      [ _[0], _[1], _[2] - 90 ]);\n    };\n    return rotate([ 0, 0, 90 ]);\n  }).raw = d3_geo_transverseMercator;\n  d3.geom = {};\n  function d3_geom_pointX(d) {\n    return d[0];\n  }\n  function d3_geom_pointY(d) {\n    return d[1];\n  }\n  d3.geom.hull = function(vertices) {\n    var x = d3_geom_pointX, y = d3_geom_pointY;\n    if (arguments.length) return hull(vertices);\n    function hull(data) {\n      if (data.length < 3) return [];\n      var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = [];\n      for (i = 0; i < n; i++) {\n        points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]);\n      }\n      points.sort(d3_geom_hullOrder);\n      for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]);\n      var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints);\n      var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = [];\n      for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]);\n      for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]);\n      return polygon;\n    }\n    hull.x = function(_) {\n      return arguments.length ? (x = _, hull) : x;\n    };\n    hull.y = function(_) {\n      return arguments.length ? (y = _, hull) : y;\n    };\n    return hull;\n  };\n  function d3_geom_hullUpper(points) {\n    var n = points.length, hull = [ 0, 1 ], hs = 2;\n    for (var i = 2; i < n; i++) {\n      while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs;\n      hull[hs++] = i;\n    }\n    return hull.slice(0, hs);\n  }\n  function d3_geom_hullOrder(a, b) {\n    return a[0] - b[0] || a[1] - b[1];\n  }\n  d3.geom.polygon = function(coordinates) {\n    d3_subclass(coordinates, d3_geom_polygonPrototype);\n    return coordinates;\n  };\n  var d3_geom_polygonPrototype = d3.geom.polygon.prototype = [];\n  d3_geom_polygonPrototype.area = function() {\n    var i = -1, n = this.length, a, b = this[n - 1], area = 0;\n    while (++i < n) {\n      a = b;\n      b = this[i];\n      area += a[1] * b[0] - a[0] * b[1];\n    }\n    return area * .5;\n  };\n  d3_geom_polygonPrototype.centroid = function(k) {\n    var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c;\n    if (!arguments.length) k = -1 / (6 * this.area());\n    while (++i < n) {\n      a = b;\n      b = this[i];\n      c = a[0] * b[1] - b[0] * a[1];\n      x += (a[0] + b[0]) * c;\n      y += (a[1] + b[1]) * c;\n    }\n    return [ x * k, y * k ];\n  };\n  d3_geom_polygonPrototype.clip = function(subject) {\n    var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d;\n    while (++i < n) {\n      input = subject.slice();\n      subject.length = 0;\n      b = this[i];\n      c = input[(m = input.length - closed) - 1];\n      j = -1;\n      while (++j < m) {\n        d = input[j];\n        if (d3_geom_polygonInside(d, a, b)) {\n          if (!d3_geom_polygonInside(c, a, b)) {\n            subject.push(d3_geom_polygonIntersect(c, d, a, b));\n          }\n          subject.push(d);\n        } else if (d3_geom_polygonInside(c, a, b)) {\n          subject.push(d3_geom_polygonIntersect(c, d, a, b));\n        }\n        c = d;\n      }\n      if (closed) subject.push(subject[0]);\n      a = b;\n    }\n    return subject;\n  };\n  function d3_geom_polygonInside(p, a, b) {\n    return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);\n  }\n  function d3_geom_polygonIntersect(c, d, a, b) {\n    var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21);\n    return [ x1 + ua * x21, y1 + ua * y21 ];\n  }\n  function d3_geom_polygonClosed(coordinates) {\n    var a = coordinates[0], b = coordinates[coordinates.length - 1];\n    return !(a[0] - b[0] || a[1] - b[1]);\n  }\n  var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = [];\n  function d3_geom_voronoiBeach() {\n    d3_geom_voronoiRedBlackNode(this);\n    this.edge = this.site = this.circle = null;\n  }\n  function d3_geom_voronoiCreateBeach(site) {\n    var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach();\n    beach.site = site;\n    return beach;\n  }\n  function d3_geom_voronoiDetachBeach(beach) {\n    d3_geom_voronoiDetachCircle(beach);\n    d3_geom_voronoiBeaches.remove(beach);\n    d3_geom_voronoiBeachPool.push(beach);\n    d3_geom_voronoiRedBlackNode(beach);\n  }\n  function d3_geom_voronoiRemoveBeach(beach) {\n    var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {\n      x: x,\n      y: y\n    }, previous = beach.P, next = beach.N, disappearing = [ beach ];\n    d3_geom_voronoiDetachBeach(beach);\n    var lArc = previous;\n    while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {\n      previous = lArc.P;\n      disappearing.unshift(lArc);\n      d3_geom_voronoiDetachBeach(lArc);\n      lArc = previous;\n    }\n    disappearing.unshift(lArc);\n    d3_geom_voronoiDetachCircle(lArc);\n    var rArc = next;\n    while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {\n      next = rArc.N;\n      disappearing.push(rArc);\n      d3_geom_voronoiDetachBeach(rArc);\n      rArc = next;\n    }\n    disappearing.push(rArc);\n    d3_geom_voronoiDetachCircle(rArc);\n    var nArcs = disappearing.length, iArc;\n    for (iArc = 1; iArc < nArcs; ++iArc) {\n      rArc = disappearing[iArc];\n      lArc = disappearing[iArc - 1];\n      d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);\n    }\n    lArc = disappearing[0];\n    rArc = disappearing[nArcs - 1];\n    rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex);\n    d3_geom_voronoiAttachCircle(lArc);\n    d3_geom_voronoiAttachCircle(rArc);\n  }\n  function d3_geom_voronoiAddBeach(site) {\n    var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._;\n    while (node) {\n      dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x;\n      if (dxl > ε) node = node.L; else {\n        dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix);\n        if (dxr > ε) {\n          if (!node.R) {\n            lArc = node;\n            break;\n          }\n          node = node.R;\n        } else {\n          if (dxl > -ε) {\n            lArc = node.P;\n            rArc = node;\n          } else if (dxr > -ε) {\n            lArc = node;\n            rArc = node.N;\n          } else {\n            lArc = rArc = node;\n          }\n          break;\n        }\n      }\n    }\n    var newArc = d3_geom_voronoiCreateBeach(site);\n    d3_geom_voronoiBeaches.insert(lArc, newArc);\n    if (!lArc && !rArc) return;\n    if (lArc === rArc) {\n      d3_geom_voronoiDetachCircle(lArc);\n      rArc = d3_geom_voronoiCreateBeach(lArc.site);\n      d3_geom_voronoiBeaches.insert(newArc, rArc);\n      newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);\n      d3_geom_voronoiAttachCircle(lArc);\n      d3_geom_voronoiAttachCircle(rArc);\n      return;\n    }\n    if (!rArc) {\n      newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);\n      return;\n    }\n    d3_geom_voronoiDetachCircle(lArc);\n    d3_geom_voronoiDetachCircle(rArc);\n    var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = {\n      x: (cy * hb - by * hc) / d + ax,\n      y: (bx * hc - cx * hb) / d + ay\n    };\n    d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex);\n    newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex);\n    rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex);\n    d3_geom_voronoiAttachCircle(lArc);\n    d3_geom_voronoiAttachCircle(rArc);\n  }\n  function d3_geom_voronoiLeftBreakPoint(arc, directrix) {\n    var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix;\n    if (!pby2) return rfocx;\n    var lArc = arc.P;\n    if (!lArc) return -Infinity;\n    site = lArc.site;\n    var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix;\n    if (!plby2) return lfocx;\n    var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2;\n    if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;\n    return (rfocx + lfocx) / 2;\n  }\n  function d3_geom_voronoiRightBreakPoint(arc, directrix) {\n    var rArc = arc.N;\n    if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix);\n    var site = arc.site;\n    return site.y === directrix ? site.x : Infinity;\n  }\n  function d3_geom_voronoiCell(site) {\n    this.site = site;\n    this.edges = [];\n  }\n  d3_geom_voronoiCell.prototype.prepare = function() {\n    var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge;\n    while (iHalfEdge--) {\n      edge = halfEdges[iHalfEdge].edge;\n      if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1);\n    }\n    halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);\n    return halfEdges.length;\n  };\n  function d3_geom_voronoiCloseCells(extent) {\n    var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end;\n    while (iCell--) {\n      cell = cells[iCell];\n      if (!cell || !cell.prepare()) continue;\n      halfEdges = cell.edges;\n      nHalfEdges = halfEdges.length;\n      iHalfEdge = 0;\n      while (iHalfEdge < nHalfEdges) {\n        end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y;\n        start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y;\n        if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {\n          halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {\n            x: x0,\n            y: abs(x2 - x0) < ε ? y2 : y1\n          } : abs(y3 - y1) < ε && x1 - x3 > ε ? {\n            x: abs(y2 - y1) < ε ? x2 : x1,\n            y: y1\n          } : abs(x3 - x1) < ε && y3 - y0 > ε ? {\n            x: x1,\n            y: abs(x2 - x1) < ε ? y2 : y0\n          } : abs(y3 - y0) < ε && x3 - x0 > ε ? {\n            x: abs(y2 - y0) < ε ? x2 : x0,\n            y: y0\n          } : null), cell.site, null));\n          ++nHalfEdges;\n        }\n      }\n    }\n  }\n  function d3_geom_voronoiHalfEdgeOrder(a, b) {\n    return b.angle - a.angle;\n  }\n  function d3_geom_voronoiCircle() {\n    d3_geom_voronoiRedBlackNode(this);\n    this.x = this.y = this.arc = this.site = this.cy = null;\n  }\n  function d3_geom_voronoiAttachCircle(arc) {\n    var lArc = arc.P, rArc = arc.N;\n    if (!lArc || !rArc) return;\n    var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;\n    if (lSite === rSite) return;\n    var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by;\n    var d = 2 * (ax * cy - ay * cx);\n    if (d >= -ε2) return;\n    var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by;\n    var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle();\n    circle.arc = arc;\n    circle.site = cSite;\n    circle.x = x + bx;\n    circle.y = cy + Math.sqrt(x * x + y * y);\n    circle.cy = cy;\n    arc.circle = circle;\n    var before = null, node = d3_geom_voronoiCircles._;\n    while (node) {\n      if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) {\n        if (node.L) node = node.L; else {\n          before = node.P;\n          break;\n        }\n      } else {\n        if (node.R) node = node.R; else {\n          before = node;\n          break;\n        }\n      }\n    }\n    d3_geom_voronoiCircles.insert(before, circle);\n    if (!before) d3_geom_voronoiFirstCircle = circle;\n  }\n  function d3_geom_voronoiDetachCircle(arc) {\n    var circle = arc.circle;\n    if (circle) {\n      if (!circle.P) d3_geom_voronoiFirstCircle = circle.N;\n      d3_geom_voronoiCircles.remove(circle);\n      d3_geom_voronoiCirclePool.push(circle);\n      d3_geom_voronoiRedBlackNode(circle);\n      arc.circle = null;\n    }\n  }\n  function d3_geom_voronoiClipEdges(extent) {\n    var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e;\n    while (i--) {\n      e = edges[i];\n      if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) {\n        e.a = e.b = null;\n        edges.splice(i, 1);\n      }\n    }\n  }\n  function d3_geom_voronoiConnectEdge(edge, extent) {\n    var vb = edge.b;\n    if (vb) return true;\n    var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;\n    if (ry === ly) {\n      if (fx < x0 || fx >= x1) return;\n      if (lx > rx) {\n        if (!va) va = {\n          x: fx,\n          y: y0\n        }; else if (va.y >= y1) return;\n        vb = {\n          x: fx,\n          y: y1\n        };\n      } else {\n        if (!va) va = {\n          x: fx,\n          y: y1\n        }; else if (va.y < y0) return;\n        vb = {\n          x: fx,\n          y: y0\n        };\n      }\n    } else {\n      fm = (lx - rx) / (ry - ly);\n      fb = fy - fm * fx;\n      if (fm < -1 || fm > 1) {\n        if (lx > rx) {\n          if (!va) va = {\n            x: (y0 - fb) / fm,\n            y: y0\n          }; else if (va.y >= y1) return;\n          vb = {\n            x: (y1 - fb) / fm,\n            y: y1\n          };\n        } else {\n          if (!va) va = {\n            x: (y1 - fb) / fm,\n            y: y1\n          }; else if (va.y < y0) return;\n          vb = {\n            x: (y0 - fb) / fm,\n            y: y0\n          };\n        }\n      } else {\n        if (ly < ry) {\n          if (!va) va = {\n            x: x0,\n            y: fm * x0 + fb\n          }; else if (va.x >= x1) return;\n          vb = {\n            x: x1,\n            y: fm * x1 + fb\n          };\n        } else {\n          if (!va) va = {\n            x: x1,\n            y: fm * x1 + fb\n          }; else if (va.x < x0) return;\n          vb = {\n            x: x0,\n            y: fm * x0 + fb\n          };\n        }\n      }\n    }\n    edge.a = va;\n    edge.b = vb;\n    return true;\n  }\n  function d3_geom_voronoiEdge(lSite, rSite) {\n    this.l = lSite;\n    this.r = rSite;\n    this.a = this.b = null;\n  }\n  function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) {\n    var edge = new d3_geom_voronoiEdge(lSite, rSite);\n    d3_geom_voronoiEdges.push(edge);\n    if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va);\n    if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb);\n    d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite));\n    d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite));\n    return edge;\n  }\n  function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) {\n    var edge = new d3_geom_voronoiEdge(lSite, null);\n    edge.a = va;\n    edge.b = vb;\n    d3_geom_voronoiEdges.push(edge);\n    return edge;\n  }\n  function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) {\n    if (!edge.a && !edge.b) {\n      edge.a = vertex;\n      edge.l = lSite;\n      edge.r = rSite;\n    } else if (edge.l === rSite) {\n      edge.b = vertex;\n    } else {\n      edge.a = vertex;\n    }\n  }\n  function d3_geom_voronoiHalfEdge(edge, lSite, rSite) {\n    var va = edge.a, vb = edge.b;\n    this.edge = edge;\n    this.site = lSite;\n    this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y);\n  }\n  d3_geom_voronoiHalfEdge.prototype = {\n    start: function() {\n      return this.edge.l === this.site ? this.edge.a : this.edge.b;\n    },\n    end: function() {\n      return this.edge.l === this.site ? this.edge.b : this.edge.a;\n    }\n  };\n  function d3_geom_voronoiRedBlackTree() {\n    this._ = null;\n  }\n  function d3_geom_voronoiRedBlackNode(node) {\n    node.U = node.C = node.L = node.R = node.P = node.N = null;\n  }\n  d3_geom_voronoiRedBlackTree.prototype = {\n    insert: function(after, node) {\n      var parent, grandpa, uncle;\n      if (after) {\n        node.P = after;\n        node.N = after.N;\n        if (after.N) after.N.P = node;\n        after.N = node;\n        if (after.R) {\n          after = after.R;\n          while (after.L) after = after.L;\n          after.L = node;\n        } else {\n          after.R = node;\n        }\n        parent = after;\n      } else if (this._) {\n        after = d3_geom_voronoiRedBlackFirst(this._);\n        node.P = null;\n        node.N = after;\n        after.P = after.L = node;\n        parent = after;\n      } else {\n        node.P = node.N = null;\n        this._ = node;\n        parent = null;\n      }\n      node.L = node.R = null;\n      node.U = parent;\n      node.C = true;\n      after = node;\n      while (parent && parent.C) {\n        grandpa = parent.U;\n        if (parent === grandpa.L) {\n          uncle = grandpa.R;\n          if (uncle && uncle.C) {\n            parent.C = uncle.C = false;\n            grandpa.C = true;\n            after = grandpa;\n          } else {\n            if (after === parent.R) {\n              d3_geom_voronoiRedBlackRotateLeft(this, parent);\n              after = parent;\n              parent = after.U;\n            }\n            parent.C = false;\n            grandpa.C = true;\n            d3_geom_voronoiRedBlackRotateRight(this, grandpa);\n          }\n        } else {\n          uncle = grandpa.L;\n          if (uncle && uncle.C) {\n            parent.C = uncle.C = false;\n            grandpa.C = true;\n            after = grandpa;\n          } else {\n            if (after === parent.L) {\n              d3_geom_voronoiRedBlackRotateRight(this, parent);\n              after = parent;\n              parent = after.U;\n            }\n            parent.C = false;\n            grandpa.C = true;\n            d3_geom_voronoiRedBlackRotateLeft(this, grandpa);\n          }\n        }\n        parent = after.U;\n      }\n      this._.C = false;\n    },\n    remove: function(node) {\n      if (node.N) node.N.P = node.P;\n      if (node.P) node.P.N = node.N;\n      node.N = node.P = null;\n      var parent = node.U, sibling, left = node.L, right = node.R, next, red;\n      if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right);\n      if (parent) {\n        if (parent.L === node) parent.L = next; else parent.R = next;\n      } else {\n        this._ = next;\n      }\n      if (left && right) {\n        red = next.C;\n        next.C = node.C;\n        next.L = left;\n        left.U = next;\n        if (next !== right) {\n          parent = next.U;\n          next.U = node.U;\n          node = next.R;\n          parent.L = node;\n          next.R = right;\n          right.U = next;\n        } else {\n          next.U = parent;\n          parent = next;\n          node = next.R;\n        }\n      } else {\n        red = node.C;\n        node = next;\n      }\n      if (node) node.U = parent;\n      if (red) return;\n      if (node && node.C) {\n        node.C = false;\n        return;\n      }\n      do {\n        if (node === this._) break;\n        if (node === parent.L) {\n          sibling = parent.R;\n          if (sibling.C) {\n            sibling.C = false;\n            parent.C = true;\n            d3_geom_voronoiRedBlackRotateLeft(this, parent);\n            sibling = parent.R;\n          }\n          if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {\n            if (!sibling.R || !sibling.R.C) {\n              sibling.L.C = false;\n              sibling.C = true;\n              d3_geom_voronoiRedBlackRotateRight(this, sibling);\n              sibling = parent.R;\n            }\n            sibling.C = parent.C;\n            parent.C = sibling.R.C = false;\n            d3_geom_voronoiRedBlackRotateLeft(this, parent);\n            node = this._;\n            break;\n          }\n        } else {\n          sibling = parent.L;\n          if (sibling.C) {\n            sibling.C = false;\n            parent.C = true;\n            d3_geom_voronoiRedBlackRotateRight(this, parent);\n            sibling = parent.L;\n          }\n          if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {\n            if (!sibling.L || !sibling.L.C) {\n              sibling.R.C = false;\n              sibling.C = true;\n              d3_geom_voronoiRedBlackRotateLeft(this, sibling);\n              sibling = parent.L;\n            }\n            sibling.C = parent.C;\n            parent.C = sibling.L.C = false;\n            d3_geom_voronoiRedBlackRotateRight(this, parent);\n            node = this._;\n            break;\n          }\n        }\n        sibling.C = true;\n        node = parent;\n        parent = parent.U;\n      } while (!node.C);\n      if (node) node.C = false;\n    }\n  };\n  function d3_geom_voronoiRedBlackRotateLeft(tree, node) {\n    var p = node, q = node.R, parent = p.U;\n    if (parent) {\n      if (parent.L === p) parent.L = q; else parent.R = q;\n    } else {\n      tree._ = q;\n    }\n    q.U = parent;\n    p.U = q;\n    p.R = q.L;\n    if (p.R) p.R.U = p;\n    q.L = p;\n  }\n  function d3_geom_voronoiRedBlackRotateRight(tree, node) {\n    var p = node, q = node.L, parent = p.U;\n    if (parent) {\n      if (parent.L === p) parent.L = q; else parent.R = q;\n    } else {\n      tree._ = q;\n    }\n    q.U = parent;\n    p.U = q;\n    p.L = q.R;\n    if (p.L) p.L.U = p;\n    q.R = p;\n  }\n  function d3_geom_voronoiRedBlackFirst(node) {\n    while (node.L) node = node.L;\n    return node;\n  }\n  function d3_geom_voronoi(sites, bbox) {\n    var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;\n    d3_geom_voronoiEdges = [];\n    d3_geom_voronoiCells = new Array(sites.length);\n    d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();\n    d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree();\n    while (true) {\n      circle = d3_geom_voronoiFirstCircle;\n      if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) {\n        if (site.x !== x0 || site.y !== y0) {\n          d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site);\n          d3_geom_voronoiAddBeach(site);\n          x0 = site.x, y0 = site.y;\n        }\n        site = sites.pop();\n      } else if (circle) {\n        d3_geom_voronoiRemoveBeach(circle.arc);\n      } else {\n        break;\n      }\n    }\n    if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox);\n    var diagram = {\n      cells: d3_geom_voronoiCells,\n      edges: d3_geom_voronoiEdges\n    };\n    d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null;\n    return diagram;\n  }\n  function d3_geom_voronoiVertexOrder(a, b) {\n    return b.y - a.y || b.x - a.x;\n  }\n  d3.geom.voronoi = function(points) {\n    var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;\n    if (points) return voronoi(points);\n    function voronoi(data) {\n      var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];\n      d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) {\n        var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) {\n          var s = e.start();\n          return [ s.x, s.y ];\n        }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : [];\n        polygon.point = data[i];\n      });\n      return polygons;\n    }\n    function sites(data) {\n      return data.map(function(d, i) {\n        return {\n          x: Math.round(fx(d, i) / ε) * ε,\n          y: Math.round(fy(d, i) / ε) * ε,\n          i: i\n        };\n      });\n    }\n    voronoi.links = function(data) {\n      return d3_geom_voronoi(sites(data)).edges.filter(function(edge) {\n        return edge.l && edge.r;\n      }).map(function(edge) {\n        return {\n          source: data[edge.l.i],\n          target: data[edge.r.i]\n        };\n      });\n    };\n    voronoi.triangles = function(data) {\n      var triangles = [];\n      d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) {\n        var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l;\n        while (++j < m) {\n          e0 = e1;\n          s0 = s1;\n          e1 = edges[j].edge;\n          s1 = e1.l === site ? e1.r : e1.l;\n          if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) {\n            triangles.push([ data[i], data[s0.i], data[s1.i] ]);\n          }\n        }\n      });\n      return triangles;\n    };\n    voronoi.x = function(_) {\n      return arguments.length ? (fx = d3_functor(x = _), voronoi) : x;\n    };\n    voronoi.y = function(_) {\n      return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;\n    };\n    voronoi.clipExtent = function(_) {\n      if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent;\n      clipExtent = _ == null ? d3_geom_voronoiClipExtent : _;\n      return voronoi;\n    };\n    voronoi.size = function(_) {\n      if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1];\n      return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]);\n    };\n    return voronoi;\n  };\n  var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ];\n  function d3_geom_voronoiTriangleArea(a, b, c) {\n    return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y);\n  }\n  d3.geom.delaunay = function(vertices) {\n    return d3.geom.voronoi().triangles(vertices);\n  };\n  d3.geom.quadtree = function(points, x1, y1, x2, y2) {\n    var x = d3_geom_pointX, y = d3_geom_pointY, compat;\n    if (compat = arguments.length) {\n      x = d3_geom_quadtreeCompatX;\n      y = d3_geom_quadtreeCompatY;\n      if (compat === 3) {\n        y2 = y1;\n        x2 = x1;\n        y1 = x1 = 0;\n      }\n      return quadtree(points);\n    }\n    function quadtree(data) {\n      var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;\n      if (x1 != null) {\n        x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;\n      } else {\n        x2_ = y2_ = -(x1_ = y1_ = Infinity);\n        xs = [], ys = [];\n        n = data.length;\n        if (compat) for (i = 0; i < n; ++i) {\n          d = data[i];\n          if (d.x < x1_) x1_ = d.x;\n          if (d.y < y1_) y1_ = d.y;\n          if (d.x > x2_) x2_ = d.x;\n          if (d.y > y2_) y2_ = d.y;\n          xs.push(d.x);\n          ys.push(d.y);\n        } else for (i = 0; i < n; ++i) {\n          var x_ = +fx(d = data[i], i), y_ = +fy(d, i);\n          if (x_ < x1_) x1_ = x_;\n          if (y_ < y1_) y1_ = y_;\n          if (x_ > x2_) x2_ = x_;\n          if (y_ > y2_) y2_ = y_;\n          xs.push(x_);\n          ys.push(y_);\n        }\n      }\n      var dx = x2_ - x1_, dy = y2_ - y1_;\n      if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy;\n      function insert(n, d, x, y, x1, y1, x2, y2) {\n        if (isNaN(x) || isNaN(y)) return;\n        if (n.leaf) {\n          var nx = n.x, ny = n.y;\n          if (nx != null) {\n            if (abs(nx - x) + abs(ny - y) < .01) {\n              insertChild(n, d, x, y, x1, y1, x2, y2);\n            } else {\n              var nPoint = n.point;\n              n.x = n.y = n.point = null;\n              insertChild(n, nPoint, nx, ny, x1, y1, x2, y2);\n              insertChild(n, d, x, y, x1, y1, x2, y2);\n            }\n          } else {\n            n.x = x, n.y = y, n.point = d;\n          }\n        } else {\n          insertChild(n, d, x, y, x1, y1, x2, y2);\n        }\n      }\n      function insertChild(n, d, x, y, x1, y1, x2, y2) {\n        var xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym, i = below << 1 | right;\n        n.leaf = false;\n        n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());\n        if (right) x1 = xm; else x2 = xm;\n        if (below) y1 = ym; else y2 = ym;\n        insert(n, d, x, y, x1, y1, x2, y2);\n      }\n      var root = d3_geom_quadtreeNode();\n      root.add = function(d) {\n        insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);\n      };\n      root.visit = function(f) {\n        d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_);\n      };\n      root.find = function(point) {\n        return d3_geom_quadtreeFind(root, point[0], point[1], x1_, y1_, x2_, y2_);\n      };\n      i = -1;\n      if (x1 == null) {\n        while (++i < n) {\n          insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_);\n        }\n        --i;\n      } else data.forEach(root.add);\n      xs = ys = data = d = null;\n      return root;\n    }\n    quadtree.x = function(_) {\n      return arguments.length ? (x = _, quadtree) : x;\n    };\n    quadtree.y = function(_) {\n      return arguments.length ? (y = _, quadtree) : y;\n    };\n    quadtree.extent = function(_) {\n      if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];\n      if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], \n      y2 = +_[1][1];\n      return quadtree;\n    };\n    quadtree.size = function(_) {\n      if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ];\n      if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1];\n      return quadtree;\n    };\n    return quadtree;\n  };\n  function d3_geom_quadtreeCompatX(d) {\n    return d.x;\n  }\n  function d3_geom_quadtreeCompatY(d) {\n    return d.y;\n  }\n  function d3_geom_quadtreeNode() {\n    return {\n      leaf: true,\n      nodes: [],\n      point: null,\n      x: null,\n      y: null\n    };\n  }\n  function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {\n    if (!f(node, x1, y1, x2, y2)) {\n      var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes;\n      if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);\n      if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);\n      if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);\n      if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);\n    }\n  }\n  function d3_geom_quadtreeFind(root, x, y, x0, y0, x3, y3) {\n    var minDistance2 = Infinity, closestPoint;\n    (function find(node, x1, y1, x2, y2) {\n      if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return;\n      if (point = node.point) {\n        var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy;\n        if (distance2 < minDistance2) {\n          var distance = Math.sqrt(minDistance2 = distance2);\n          x0 = x - distance, y0 = y - distance;\n          x3 = x + distance, y3 = y + distance;\n          closestPoint = point;\n        }\n      }\n      var children = node.nodes, xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym;\n      for (var i = below << 1 | right, j = i + 4; i < j; ++i) {\n        if (node = children[i & 3]) switch (i & 3) {\n         case 0:\n          find(node, x1, y1, xm, ym);\n          break;\n\n         case 1:\n          find(node, xm, y1, x2, ym);\n          break;\n\n         case 2:\n          find(node, x1, ym, xm, y2);\n          break;\n\n         case 3:\n          find(node, xm, ym, x2, y2);\n          break;\n        }\n      }\n    })(root, x0, y0, x3, y3);\n    return closestPoint;\n  }\n  d3.interpolateRgb = d3_interpolateRgb;\n  function d3_interpolateRgb(a, b) {\n    a = d3.rgb(a);\n    b = d3.rgb(b);\n    var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab;\n    return function(t) {\n      return \"#\" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t));\n    };\n  }\n  d3.interpolateObject = d3_interpolateObject;\n  function d3_interpolateObject(a, b) {\n    var i = {}, c = {}, k;\n    for (k in a) {\n      if (k in b) {\n        i[k] = d3_interpolate(a[k], b[k]);\n      } else {\n        c[k] = a[k];\n      }\n    }\n    for (k in b) {\n      if (!(k in a)) {\n        c[k] = b[k];\n      }\n    }\n    return function(t) {\n      for (k in i) c[k] = i[k](t);\n      return c;\n    };\n  }\n  d3.interpolateNumber = d3_interpolateNumber;\n  function d3_interpolateNumber(a, b) {\n    a = +a, b = +b;\n    return function(t) {\n      return a * (1 - t) + b * t;\n    };\n  }\n  d3.interpolateString = d3_interpolateString;\n  function d3_interpolateString(a, b) {\n    var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];\n    a = a + \"\", b = b + \"\";\n    while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {\n      if ((bs = bm.index) > bi) {\n        bs = b.slice(bi, bs);\n        if (s[i]) s[i] += bs; else s[++i] = bs;\n      }\n      if ((am = am[0]) === (bm = bm[0])) {\n        if (s[i]) s[i] += bm; else s[++i] = bm;\n      } else {\n        s[++i] = null;\n        q.push({\n          i: i,\n          x: d3_interpolateNumber(am, bm)\n        });\n      }\n      bi = d3_interpolate_numberB.lastIndex;\n    }\n    if (bi < b.length) {\n      bs = b.slice(bi);\n      if (s[i]) s[i] += bs; else s[++i] = bs;\n    }\n    return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {\n      return b(t) + \"\";\n    }) : function() {\n      return b;\n    } : (b = q.length, function(t) {\n      for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n      return s.join(\"\");\n    });\n  }\n  var d3_interpolate_numberA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, \"g\");\n  d3.interpolate = d3_interpolate;\n  function d3_interpolate(a, b) {\n    var i = d3.interpolators.length, f;\n    while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ;\n    return f;\n  }\n  d3.interpolators = [ function(a, b) {\n    var t = typeof b;\n    return (t === \"string\" ? d3_rgb_names.has(b.toLowerCase()) || /^(#|rgb\\(|hsl\\()/i.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === \"object\" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);\n  } ];\n  d3.interpolateArray = d3_interpolateArray;\n  function d3_interpolateArray(a, b) {\n    var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i;\n    for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));\n    for (;i < na; ++i) c[i] = a[i];\n    for (;i < nb; ++i) c[i] = b[i];\n    return function(t) {\n      for (i = 0; i < n0; ++i) c[i] = x[i](t);\n      return c;\n    };\n  }\n  var d3_ease_default = function() {\n    return d3_identity;\n  };\n  var d3_ease = d3.map({\n    linear: d3_ease_default,\n    poly: d3_ease_poly,\n    quad: function() {\n      return d3_ease_quad;\n    },\n    cubic: function() {\n      return d3_ease_cubic;\n    },\n    sin: function() {\n      return d3_ease_sin;\n    },\n    exp: function() {\n      return d3_ease_exp;\n    },\n    circle: function() {\n      return d3_ease_circle;\n    },\n    elastic: d3_ease_elastic,\n    back: d3_ease_back,\n    bounce: function() {\n      return d3_ease_bounce;\n    }\n  });\n  var d3_ease_mode = d3.map({\n    \"in\": d3_identity,\n    out: d3_ease_reverse,\n    \"in-out\": d3_ease_reflect,\n    \"out-in\": function(f) {\n      return d3_ease_reflect(d3_ease_reverse(f));\n    }\n  });\n  d3.ease = function(name) {\n    var i = name.indexOf(\"-\"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : \"in\";\n    t = d3_ease.get(t) || d3_ease_default;\n    m = d3_ease_mode.get(m) || d3_identity;\n    return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));\n  };\n  function d3_ease_clamp(f) {\n    return function(t) {\n      return t <= 0 ? 0 : t >= 1 ? 1 : f(t);\n    };\n  }\n  function d3_ease_reverse(f) {\n    return function(t) {\n      return 1 - f(1 - t);\n    };\n  }\n  function d3_ease_reflect(f) {\n    return function(t) {\n      return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t));\n    };\n  }\n  function d3_ease_quad(t) {\n    return t * t;\n  }\n  function d3_ease_cubic(t) {\n    return t * t * t;\n  }\n  function d3_ease_cubicInOut(t) {\n    if (t <= 0) return 0;\n    if (t >= 1) return 1;\n    var t2 = t * t, t3 = t2 * t;\n    return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);\n  }\n  function d3_ease_poly(e) {\n    return function(t) {\n      return Math.pow(t, e);\n    };\n  }\n  function d3_ease_sin(t) {\n    return 1 - Math.cos(t * halfπ);\n  }\n  function d3_ease_exp(t) {\n    return Math.pow(2, 10 * (t - 1));\n  }\n  function d3_ease_circle(t) {\n    return 1 - Math.sqrt(1 - t * t);\n  }\n  function d3_ease_elastic(a, p) {\n    var s;\n    if (arguments.length < 2) p = .45;\n    if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4;\n    return function(t) {\n      return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p);\n    };\n  }\n  function d3_ease_back(s) {\n    if (!s) s = 1.70158;\n    return function(t) {\n      return t * t * ((s + 1) * t - s);\n    };\n  }\n  function d3_ease_bounce(t) {\n    return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;\n  }\n  d3.interpolateHcl = d3_interpolateHcl;\n  function d3_interpolateHcl(a, b) {\n    a = d3.hcl(a);\n    b = d3.hcl(b);\n    var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al;\n    if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;\n    if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;\n    return function(t) {\n      return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + \"\";\n    };\n  }\n  d3.interpolateHsl = d3_interpolateHsl;\n  function d3_interpolateHsl(a, b) {\n    a = d3.hsl(a);\n    b = d3.hsl(b);\n    var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al;\n    if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;\n    if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;\n    return function(t) {\n      return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + \"\";\n    };\n  }\n  d3.interpolateLab = d3_interpolateLab;\n  function d3_interpolateLab(a, b) {\n    a = d3.lab(a);\n    b = d3.lab(b);\n    var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab;\n    return function(t) {\n      return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + \"\";\n    };\n  }\n  d3.interpolateRound = d3_interpolateRound;\n  function d3_interpolateRound(a, b) {\n    b -= a;\n    return function(t) {\n      return Math.round(a + b * t);\n    };\n  }\n  d3.transform = function(string) {\n    var g = d3_document.createElementNS(d3.ns.prefix.svg, \"g\");\n    return (d3.transform = function(string) {\n      if (string != null) {\n        g.setAttribute(\"transform\", string);\n        var t = g.transform.baseVal.consolidate();\n      }\n      return new d3_transform(t ? t.matrix : d3_transformIdentity);\n    })(string);\n  };\n  function d3_transform(m) {\n    var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;\n    if (r0[0] * r1[1] < r1[0] * r0[1]) {\n      r0[0] *= -1;\n      r0[1] *= -1;\n      kx *= -1;\n      kz *= -1;\n    }\n    this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees;\n    this.translate = [ m.e, m.f ];\n    this.scale = [ kx, ky ];\n    this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0;\n  }\n  d3_transform.prototype.toString = function() {\n    return \"translate(\" + this.translate + \")rotate(\" + this.rotate + \")skewX(\" + this.skew + \")scale(\" + this.scale + \")\";\n  };\n  function d3_transformDot(a, b) {\n    return a[0] * b[0] + a[1] * b[1];\n  }\n  function d3_transformNormalize(a) {\n    var k = Math.sqrt(d3_transformDot(a, a));\n    if (k) {\n      a[0] /= k;\n      a[1] /= k;\n    }\n    return k;\n  }\n  function d3_transformCombine(a, b, k) {\n    a[0] += k * b[0];\n    a[1] += k * b[1];\n    return a;\n  }\n  var d3_transformIdentity = {\n    a: 1,\n    b: 0,\n    c: 0,\n    d: 1,\n    e: 0,\n    f: 0\n  };\n  d3.interpolateTransform = d3_interpolateTransform;\n  function d3_interpolateTransformPop(s) {\n    return s.length ? s.pop() + \",\" : \"\";\n  }\n  function d3_interpolateTranslate(ta, tb, s, q) {\n    if (ta[0] !== tb[0] || ta[1] !== tb[1]) {\n      var i = s.push(\"translate(\", null, \",\", null, \")\");\n      q.push({\n        i: i - 4,\n        x: d3_interpolateNumber(ta[0], tb[0])\n      }, {\n        i: i - 2,\n        x: d3_interpolateNumber(ta[1], tb[1])\n      });\n    } else if (tb[0] || tb[1]) {\n      s.push(\"translate(\" + tb + \")\");\n    }\n  }\n  function d3_interpolateRotate(ra, rb, s, q) {\n    if (ra !== rb) {\n      if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;\n      q.push({\n        i: s.push(d3_interpolateTransformPop(s) + \"rotate(\", null, \")\") - 2,\n        x: d3_interpolateNumber(ra, rb)\n      });\n    } else if (rb) {\n      s.push(d3_interpolateTransformPop(s) + \"rotate(\" + rb + \")\");\n    }\n  }\n  function d3_interpolateSkew(wa, wb, s, q) {\n    if (wa !== wb) {\n      q.push({\n        i: s.push(d3_interpolateTransformPop(s) + \"skewX(\", null, \")\") - 2,\n        x: d3_interpolateNumber(wa, wb)\n      });\n    } else if (wb) {\n      s.push(d3_interpolateTransformPop(s) + \"skewX(\" + wb + \")\");\n    }\n  }\n  function d3_interpolateScale(ka, kb, s, q) {\n    if (ka[0] !== kb[0] || ka[1] !== kb[1]) {\n      var i = s.push(d3_interpolateTransformPop(s) + \"scale(\", null, \",\", null, \")\");\n      q.push({\n        i: i - 4,\n        x: d3_interpolateNumber(ka[0], kb[0])\n      }, {\n        i: i - 2,\n        x: d3_interpolateNumber(ka[1], kb[1])\n      });\n    } else if (kb[0] !== 1 || kb[1] !== 1) {\n      s.push(d3_interpolateTransformPop(s) + \"scale(\" + kb + \")\");\n    }\n  }\n  function d3_interpolateTransform(a, b) {\n    var s = [], q = [];\n    a = d3.transform(a), b = d3.transform(b);\n    d3_interpolateTranslate(a.translate, b.translate, s, q);\n    d3_interpolateRotate(a.rotate, b.rotate, s, q);\n    d3_interpolateSkew(a.skew, b.skew, s, q);\n    d3_interpolateScale(a.scale, b.scale, s, q);\n    a = b = null;\n    return function(t) {\n      var i = -1, n = q.length, o;\n      while (++i < n) s[(o = q[i]).i] = o.x(t);\n      return s.join(\"\");\n    };\n  }\n  function d3_uninterpolateNumber(a, b) {\n    b = (b -= a = +a) || 1 / b;\n    return function(x) {\n      return (x - a) / b;\n    };\n  }\n  function d3_uninterpolateClamp(a, b) {\n    b = (b -= a = +a) || 1 / b;\n    return function(x) {\n      return Math.max(0, Math.min(1, (x - a) / b));\n    };\n  }\n  d3.layout = {};\n  d3.layout.bundle = function() {\n    return function(links) {\n      var paths = [], i = -1, n = links.length;\n      while (++i < n) paths.push(d3_layout_bundlePath(links[i]));\n      return paths;\n    };\n  };\n  function d3_layout_bundlePath(link) {\n    var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ];\n    while (start !== lca) {\n      start = start.parent;\n      points.push(start);\n    }\n    var k = points.length;\n    while (end !== lca) {\n      points.splice(k, 0, end);\n      end = end.parent;\n    }\n    return points;\n  }\n  function d3_layout_bundleAncestors(node) {\n    var ancestors = [], parent = node.parent;\n    while (parent != null) {\n      ancestors.push(node);\n      node = parent;\n      parent = parent.parent;\n    }\n    ancestors.push(node);\n    return ancestors;\n  }\n  function d3_layout_bundleLeastCommonAncestor(a, b) {\n    if (a === b) return a;\n    var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null;\n    while (aNode === bNode) {\n      sharedNode = aNode;\n      aNode = aNodes.pop();\n      bNode = bNodes.pop();\n    }\n    return sharedNode;\n  }\n  d3.layout.chord = function() {\n    var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;\n    function relayout() {\n      var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;\n      chords = [];\n      groups = [];\n      k = 0, i = -1;\n      while (++i < n) {\n        x = 0, j = -1;\n        while (++j < n) {\n          x += matrix[i][j];\n        }\n        groupSums.push(x);\n        subgroupIndex.push(d3.range(n));\n        k += x;\n      }\n      if (sortGroups) {\n        groupIndex.sort(function(a, b) {\n          return sortGroups(groupSums[a], groupSums[b]);\n        });\n      }\n      if (sortSubgroups) {\n        subgroupIndex.forEach(function(d, i) {\n          d.sort(function(a, b) {\n            return sortSubgroups(matrix[i][a], matrix[i][b]);\n          });\n        });\n      }\n      k = (τ - padding * n) / k;\n      x = 0, i = -1;\n      while (++i < n) {\n        x0 = x, j = -1;\n        while (++j < n) {\n          var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;\n          subgroups[di + \"-\" + dj] = {\n            index: di,\n            subindex: dj,\n            startAngle: a0,\n            endAngle: a1,\n            value: v\n          };\n        }\n        groups[di] = {\n          index: di,\n          startAngle: x0,\n          endAngle: x,\n          value: groupSums[di]\n        };\n        x += padding;\n      }\n      i = -1;\n      while (++i < n) {\n        j = i - 1;\n        while (++j < n) {\n          var source = subgroups[i + \"-\" + j], target = subgroups[j + \"-\" + i];\n          if (source.value || target.value) {\n            chords.push(source.value < target.value ? {\n              source: target,\n              target: source\n            } : {\n              source: source,\n              target: target\n            });\n          }\n        }\n      }\n      if (sortChords) resort();\n    }\n    function resort() {\n      chords.sort(function(a, b) {\n        return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2);\n      });\n    }\n    chord.matrix = function(x) {\n      if (!arguments.length) return matrix;\n      n = (matrix = x) && matrix.length;\n      chords = groups = null;\n      return chord;\n    };\n    chord.padding = function(x) {\n      if (!arguments.length) return padding;\n      padding = x;\n      chords = groups = null;\n      return chord;\n    };\n    chord.sortGroups = function(x) {\n      if (!arguments.length) return sortGroups;\n      sortGroups = x;\n      chords = groups = null;\n      return chord;\n    };\n    chord.sortSubgroups = function(x) {\n      if (!arguments.length) return sortSubgroups;\n      sortSubgroups = x;\n      chords = null;\n      return chord;\n    };\n    chord.sortChords = function(x) {\n      if (!arguments.length) return sortChords;\n      sortChords = x;\n      if (chords) resort();\n      return chord;\n    };\n    chord.chords = function() {\n      if (!chords) relayout();\n      return chords;\n    };\n    chord.groups = function() {\n      if (!groups) relayout();\n      return groups;\n    };\n    return chord;\n  };\n  d3.layout.force = function() {\n    var force = {}, event = d3.dispatch(\"start\", \"tick\", \"end\"), timer, size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;\n    function repulse(node) {\n      return function(quad, x1, _, x2) {\n        if (quad.point !== node) {\n          var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy;\n          if (dw * dw / theta2 < dn) {\n            if (dn < chargeDistance2) {\n              var k = quad.charge / dn;\n              node.px -= dx * k;\n              node.py -= dy * k;\n            }\n            return true;\n          }\n          if (quad.point && dn && dn < chargeDistance2) {\n            var k = quad.pointCharge / dn;\n            node.px -= dx * k;\n            node.py -= dy * k;\n          }\n        }\n        return !quad.charge;\n      };\n    }\n    force.tick = function() {\n      if ((alpha *= .99) < .005) {\n        timer = null;\n        event.end({\n          type: \"end\",\n          alpha: alpha = 0\n        });\n        return true;\n      }\n      var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y;\n      for (i = 0; i < m; ++i) {\n        o = links[i];\n        s = o.source;\n        t = o.target;\n        x = t.x - s.x;\n        y = t.y - s.y;\n        if (l = x * x + y * y) {\n          l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;\n          x *= l;\n          y *= l;\n          t.x -= x * (k = s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5);\n          t.y -= y * k;\n          s.x += x * (k = 1 - k);\n          s.y += y * k;\n        }\n      }\n      if (k = alpha * gravity) {\n        x = size[0] / 2;\n        y = size[1] / 2;\n        i = -1;\n        if (k) while (++i < n) {\n          o = nodes[i];\n          o.x += (x - o.x) * k;\n          o.y += (y - o.y) * k;\n        }\n      }\n      if (charge) {\n        d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);\n        i = -1;\n        while (++i < n) {\n          if (!(o = nodes[i]).fixed) {\n            q.visit(repulse(o));\n          }\n        }\n      }\n      i = -1;\n      while (++i < n) {\n        o = nodes[i];\n        if (o.fixed) {\n          o.x = o.px;\n          o.y = o.py;\n        } else {\n          o.x -= (o.px - (o.px = o.x)) * friction;\n          o.y -= (o.py - (o.py = o.y)) * friction;\n        }\n      }\n      event.tick({\n        type: \"tick\",\n        alpha: alpha\n      });\n    };\n    force.nodes = function(x) {\n      if (!arguments.length) return nodes;\n      nodes = x;\n      return force;\n    };\n    force.links = function(x) {\n      if (!arguments.length) return links;\n      links = x;\n      return force;\n    };\n    force.size = function(x) {\n      if (!arguments.length) return size;\n      size = x;\n      return force;\n    };\n    force.linkDistance = function(x) {\n      if (!arguments.length) return linkDistance;\n      linkDistance = typeof x === \"function\" ? x : +x;\n      return force;\n    };\n    force.distance = force.linkDistance;\n    force.linkStrength = function(x) {\n      if (!arguments.length) return linkStrength;\n      linkStrength = typeof x === \"function\" ? x : +x;\n      return force;\n    };\n    force.friction = function(x) {\n      if (!arguments.length) return friction;\n      friction = +x;\n      return force;\n    };\n    force.charge = function(x) {\n      if (!arguments.length) return charge;\n      charge = typeof x === \"function\" ? x : +x;\n      return force;\n    };\n    force.chargeDistance = function(x) {\n      if (!arguments.length) return Math.sqrt(chargeDistance2);\n      chargeDistance2 = x * x;\n      return force;\n    };\n    force.gravity = function(x) {\n      if (!arguments.length) return gravity;\n      gravity = +x;\n      return force;\n    };\n    force.theta = function(x) {\n      if (!arguments.length) return Math.sqrt(theta2);\n      theta2 = x * x;\n      return force;\n    };\n    force.alpha = function(x) {\n      if (!arguments.length) return alpha;\n      x = +x;\n      if (alpha) {\n        if (x > 0) {\n          alpha = x;\n        } else {\n          timer.c = null, timer.t = NaN, timer = null;\n          event.end({\n            type: \"end\",\n            alpha: alpha = 0\n          });\n        }\n      } else if (x > 0) {\n        event.start({\n          type: \"start\",\n          alpha: alpha = x\n        });\n        timer = d3_timer(force.tick);\n      }\n      return force;\n    };\n    force.start = function() {\n      var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o;\n      for (i = 0; i < n; ++i) {\n        (o = nodes[i]).index = i;\n        o.weight = 0;\n      }\n      for (i = 0; i < m; ++i) {\n        o = links[i];\n        if (typeof o.source == \"number\") o.source = nodes[o.source];\n        if (typeof o.target == \"number\") o.target = nodes[o.target];\n        ++o.source.weight;\n        ++o.target.weight;\n      }\n      for (i = 0; i < n; ++i) {\n        o = nodes[i];\n        if (isNaN(o.x)) o.x = position(\"x\", w);\n        if (isNaN(o.y)) o.y = position(\"y\", h);\n        if (isNaN(o.px)) o.px = o.x;\n        if (isNaN(o.py)) o.py = o.y;\n      }\n      distances = [];\n      if (typeof linkDistance === \"function\") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance;\n      strengths = [];\n      if (typeof linkStrength === \"function\") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength;\n      charges = [];\n      if (typeof charge === \"function\") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;\n      function position(dimension, size) {\n        if (!neighbors) {\n          neighbors = new Array(n);\n          for (j = 0; j < n; ++j) {\n            neighbors[j] = [];\n          }\n          for (j = 0; j < m; ++j) {\n            var o = links[j];\n            neighbors[o.source.index].push(o.target);\n            neighbors[o.target.index].push(o.source);\n          }\n        }\n        var candidates = neighbors[i], j = -1, l = candidates.length, x;\n        while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x;\n        return Math.random() * size;\n      }\n      return force.resume();\n    };\n    force.resume = function() {\n      return force.alpha(.1);\n    };\n    force.stop = function() {\n      return force.alpha(0);\n    };\n    force.drag = function() {\n      if (!drag) drag = d3.behavior.drag().origin(d3_identity).on(\"dragstart.force\", d3_layout_forceDragstart).on(\"drag.force\", dragmove).on(\"dragend.force\", d3_layout_forceDragend);\n      if (!arguments.length) return drag;\n      this.on(\"mouseover.force\", d3_layout_forceMouseover).on(\"mouseout.force\", d3_layout_forceMouseout).call(drag);\n    };\n    function dragmove(d) {\n      d.px = d3.event.x, d.py = d3.event.y;\n      force.resume();\n    }\n    return d3.rebind(force, event, \"on\");\n  };\n  function d3_layout_forceDragstart(d) {\n    d.fixed |= 2;\n  }\n  function d3_layout_forceDragend(d) {\n    d.fixed &= ~6;\n  }\n  function d3_layout_forceMouseover(d) {\n    d.fixed |= 4;\n    d.px = d.x, d.py = d.y;\n  }\n  function d3_layout_forceMouseout(d) {\n    d.fixed &= ~4;\n  }\n  function d3_layout_forceAccumulate(quad, alpha, charges) {\n    var cx = 0, cy = 0;\n    quad.charge = 0;\n    if (!quad.leaf) {\n      var nodes = quad.nodes, n = nodes.length, i = -1, c;\n      while (++i < n) {\n        c = nodes[i];\n        if (c == null) continue;\n        d3_layout_forceAccumulate(c, alpha, charges);\n        quad.charge += c.charge;\n        cx += c.charge * c.cx;\n        cy += c.charge * c.cy;\n      }\n    }\n    if (quad.point) {\n      if (!quad.leaf) {\n        quad.point.x += Math.random() - .5;\n        quad.point.y += Math.random() - .5;\n      }\n      var k = alpha * charges[quad.point.index];\n      quad.charge += quad.pointCharge = k;\n      cx += k * quad.point.x;\n      cy += k * quad.point.y;\n    }\n    quad.cx = cx / quad.charge;\n    quad.cy = cy / quad.charge;\n  }\n  var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;\n  d3.layout.hierarchy = function() {\n    var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;\n    function hierarchy(root) {\n      var stack = [ root ], nodes = [], node;\n      root.depth = 0;\n      while ((node = stack.pop()) != null) {\n        nodes.push(node);\n        if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {\n          var n, childs, child;\n          while (--n >= 0) {\n            stack.push(child = childs[n]);\n            child.parent = node;\n            child.depth = node.depth + 1;\n          }\n          if (value) node.value = 0;\n          node.children = childs;\n        } else {\n          if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;\n          delete node.children;\n        }\n      }\n      d3_layout_hierarchyVisitAfter(root, function(node) {\n        var childs, parent;\n        if (sort && (childs = node.children)) childs.sort(sort);\n        if (value && (parent = node.parent)) parent.value += node.value;\n      });\n      return nodes;\n    }\n    hierarchy.sort = function(x) {\n      if (!arguments.length) return sort;\n      sort = x;\n      return hierarchy;\n    };\n    hierarchy.children = function(x) {\n      if (!arguments.length) return children;\n      children = x;\n      return hierarchy;\n    };\n    hierarchy.value = function(x) {\n      if (!arguments.length) return value;\n      value = x;\n      return hierarchy;\n    };\n    hierarchy.revalue = function(root) {\n      if (value) {\n        d3_layout_hierarchyVisitBefore(root, function(node) {\n          if (node.children) node.value = 0;\n        });\n        d3_layout_hierarchyVisitAfter(root, function(node) {\n          var parent;\n          if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;\n          if (parent = node.parent) parent.value += node.value;\n        });\n      }\n      return root;\n    };\n    return hierarchy;\n  };\n  function d3_layout_hierarchyRebind(object, hierarchy) {\n    d3.rebind(object, hierarchy, \"sort\", \"children\", \"value\");\n    object.nodes = object;\n    object.links = d3_layout_hierarchyLinks;\n    return object;\n  }\n  function d3_layout_hierarchyVisitBefore(node, callback) {\n    var nodes = [ node ];\n    while ((node = nodes.pop()) != null) {\n      callback(node);\n      if ((children = node.children) && (n = children.length)) {\n        var n, children;\n        while (--n >= 0) nodes.push(children[n]);\n      }\n    }\n  }\n  function d3_layout_hierarchyVisitAfter(node, callback) {\n    var nodes = [ node ], nodes2 = [];\n    while ((node = nodes.pop()) != null) {\n      nodes2.push(node);\n      if ((children = node.children) && (n = children.length)) {\n        var i = -1, n, children;\n        while (++i < n) nodes.push(children[i]);\n      }\n    }\n    while ((node = nodes2.pop()) != null) {\n      callback(node);\n    }\n  }\n  function d3_layout_hierarchyChildren(d) {\n    return d.children;\n  }\n  function d3_layout_hierarchyValue(d) {\n    return d.value;\n  }\n  function d3_layout_hierarchySort(a, b) {\n    return b.value - a.value;\n  }\n  function d3_layout_hierarchyLinks(nodes) {\n    return d3.merge(nodes.map(function(parent) {\n      return (parent.children || []).map(function(child) {\n        return {\n          source: parent,\n          target: child\n        };\n      });\n    }));\n  }\n  d3.layout.partition = function() {\n    var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ];\n    function position(node, x, dx, dy) {\n      var children = node.children;\n      node.x = x;\n      node.y = node.depth * dy;\n      node.dx = dx;\n      node.dy = dy;\n      if (children && (n = children.length)) {\n        var i = -1, n, c, d;\n        dx = node.value ? dx / node.value : 0;\n        while (++i < n) {\n          position(c = children[i], x, d = c.value * dx, dy);\n          x += d;\n        }\n      }\n    }\n    function depth(node) {\n      var children = node.children, d = 0;\n      if (children && (n = children.length)) {\n        var i = -1, n;\n        while (++i < n) d = Math.max(d, depth(children[i]));\n      }\n      return 1 + d;\n    }\n    function partition(d, i) {\n      var nodes = hierarchy.call(this, d, i);\n      position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));\n      return nodes;\n    }\n    partition.size = function(x) {\n      if (!arguments.length) return size;\n      size = x;\n      return partition;\n    };\n    return d3_layout_hierarchyRebind(partition, hierarchy);\n  };\n  d3.layout.pie = function() {\n    var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ, padAngle = 0;\n    function pie(data) {\n      var n = data.length, values = data.map(function(d, i) {\n        return +value.call(pie, d, i);\n      }), a = +(typeof startAngle === \"function\" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === \"function\" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === \"function\" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), sum = d3.sum(values), k = sum ? (da - n * pa) / sum : 0, index = d3.range(n), arcs = [], v;\n      if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {\n        return values[j] - values[i];\n      } : function(i, j) {\n        return sort(data[i], data[j]);\n      });\n      index.forEach(function(i) {\n        arcs[i] = {\n          data: data[i],\n          value: v = values[i],\n          startAngle: a,\n          endAngle: a += v * k + pa,\n          padAngle: p\n        };\n      });\n      return arcs;\n    }\n    pie.value = function(_) {\n      if (!arguments.length) return value;\n      value = _;\n      return pie;\n    };\n    pie.sort = function(_) {\n      if (!arguments.length) return sort;\n      sort = _;\n      return pie;\n    };\n    pie.startAngle = function(_) {\n      if (!arguments.length) return startAngle;\n      startAngle = _;\n      return pie;\n    };\n    pie.endAngle = function(_) {\n      if (!arguments.length) return endAngle;\n      endAngle = _;\n      return pie;\n    };\n    pie.padAngle = function(_) {\n      if (!arguments.length) return padAngle;\n      padAngle = _;\n      return pie;\n    };\n    return pie;\n  };\n  var d3_layout_pieSortByValue = {};\n  d3.layout.stack = function() {\n    var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;\n    function stack(data, index) {\n      if (!(n = data.length)) return data;\n      var series = data.map(function(d, i) {\n        return values.call(stack, d, i);\n      });\n      var points = series.map(function(d) {\n        return d.map(function(v, i) {\n          return [ x.call(stack, v, i), y.call(stack, v, i) ];\n        });\n      });\n      var orders = order.call(stack, points, index);\n      series = d3.permute(series, orders);\n      points = d3.permute(points, orders);\n      var offsets = offset.call(stack, points, index);\n      var m = series[0].length, n, i, j, o;\n      for (j = 0; j < m; ++j) {\n        out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);\n        for (i = 1; i < n; ++i) {\n          out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);\n        }\n      }\n      return data;\n    }\n    stack.values = function(x) {\n      if (!arguments.length) return values;\n      values = x;\n      return stack;\n    };\n    stack.order = function(x) {\n      if (!arguments.length) return order;\n      order = typeof x === \"function\" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;\n      return stack;\n    };\n    stack.offset = function(x) {\n      if (!arguments.length) return offset;\n      offset = typeof x === \"function\" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;\n      return stack;\n    };\n    stack.x = function(z) {\n      if (!arguments.length) return x;\n      x = z;\n      return stack;\n    };\n    stack.y = function(z) {\n      if (!arguments.length) return y;\n      y = z;\n      return stack;\n    };\n    stack.out = function(z) {\n      if (!arguments.length) return out;\n      out = z;\n      return stack;\n    };\n    return stack;\n  };\n  function d3_layout_stackX(d) {\n    return d.x;\n  }\n  function d3_layout_stackY(d) {\n    return d.y;\n  }\n  function d3_layout_stackOut(d, y0, y) {\n    d.y0 = y0;\n    d.y = y;\n  }\n  var d3_layout_stackOrders = d3.map({\n    \"inside-out\": function(data) {\n      var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) {\n        return max[a] - max[b];\n      }), top = 0, bottom = 0, tops = [], bottoms = [];\n      for (i = 0; i < n; ++i) {\n        j = index[i];\n        if (top < bottom) {\n          top += sums[j];\n          tops.push(j);\n        } else {\n          bottom += sums[j];\n          bottoms.push(j);\n        }\n      }\n      return bottoms.reverse().concat(tops);\n    },\n    reverse: function(data) {\n      return d3.range(data.length).reverse();\n    },\n    \"default\": d3_layout_stackOrderDefault\n  });\n  var d3_layout_stackOffsets = d3.map({\n    silhouette: function(data) {\n      var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = [];\n      for (j = 0; j < m; ++j) {\n        for (i = 0, o = 0; i < n; i++) o += data[i][j][1];\n        if (o > max) max = o;\n        sums.push(o);\n      }\n      for (j = 0; j < m; ++j) {\n        y0[j] = (max - sums[j]) / 2;\n      }\n      return y0;\n    },\n    wiggle: function(data) {\n      var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];\n      y0[0] = o = o0 = 0;\n      for (j = 1; j < m; ++j) {\n        for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];\n        for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {\n          for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {\n            s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;\n          }\n          s2 += s3 * data[i][j][1];\n        }\n        y0[j] = o -= s1 ? s2 / s1 * dx : 0;\n        if (o < o0) o0 = o;\n      }\n      for (j = 0; j < m; ++j) y0[j] -= o0;\n      return y0;\n    },\n    expand: function(data) {\n      var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = [];\n      for (j = 0; j < m; ++j) {\n        for (i = 0, o = 0; i < n; i++) o += data[i][j][1];\n        if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k;\n      }\n      for (j = 0; j < m; ++j) y0[j] = 0;\n      return y0;\n    },\n    zero: d3_layout_stackOffsetZero\n  });\n  function d3_layout_stackOrderDefault(data) {\n    return d3.range(data.length);\n  }\n  function d3_layout_stackOffsetZero(data) {\n    var j = -1, m = data[0].length, y0 = [];\n    while (++j < m) y0[j] = 0;\n    return y0;\n  }\n  function d3_layout_stackMaxIndex(array) {\n    var i = 1, j = 0, v = array[0][1], k, n = array.length;\n    for (;i < n; ++i) {\n      if ((k = array[i][1]) > v) {\n        j = i;\n        v = k;\n      }\n    }\n    return j;\n  }\n  function d3_layout_stackReduceSum(d) {\n    return d.reduce(d3_layout_stackSum, 0);\n  }\n  function d3_layout_stackSum(p, d) {\n    return p + d[1];\n  }\n  d3.layout.histogram = function() {\n    var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges;\n    function histogram(data, i) {\n      var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x;\n      while (++i < m) {\n        bin = bins[i] = [];\n        bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);\n        bin.y = 0;\n      }\n      if (m > 0) {\n        i = -1;\n        while (++i < n) {\n          x = values[i];\n          if (x >= range[0] && x <= range[1]) {\n            bin = bins[d3.bisect(thresholds, x, 1, m) - 1];\n            bin.y += k;\n            bin.push(data[i]);\n          }\n        }\n      }\n      return bins;\n    }\n    histogram.value = function(x) {\n      if (!arguments.length) return valuer;\n      valuer = x;\n      return histogram;\n    };\n    histogram.range = function(x) {\n      if (!arguments.length) return ranger;\n      ranger = d3_functor(x);\n      return histogram;\n    };\n    histogram.bins = function(x) {\n      if (!arguments.length) return binner;\n      binner = typeof x === \"number\" ? function(range) {\n        return d3_layout_histogramBinFixed(range, x);\n      } : d3_functor(x);\n      return histogram;\n    };\n    histogram.frequency = function(x) {\n      if (!arguments.length) return frequency;\n      frequency = !!x;\n      return histogram;\n    };\n    return histogram;\n  };\n  function d3_layout_histogramBinSturges(range, values) {\n    return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));\n  }\n  function d3_layout_histogramBinFixed(range, n) {\n    var x = -1, b = +range[0], m = (range[1] - b) / n, f = [];\n    while (++x <= n) f[x] = m * x + b;\n    return f;\n  }\n  function d3_layout_histogramRange(values) {\n    return [ d3.min(values), d3.max(values) ];\n  }\n  d3.layout.pack = function() {\n    var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;\n    function pack(d, i) {\n      var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === \"function\" ? radius : function() {\n        return radius;\n      };\n      root.x = root.y = 0;\n      d3_layout_hierarchyVisitAfter(root, function(d) {\n        d.r = +r(d.value);\n      });\n      d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);\n      if (padding) {\n        var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;\n        d3_layout_hierarchyVisitAfter(root, function(d) {\n          d.r += dr;\n        });\n        d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);\n        d3_layout_hierarchyVisitAfter(root, function(d) {\n          d.r -= dr;\n        });\n      }\n      d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h));\n      return nodes;\n    }\n    pack.size = function(_) {\n      if (!arguments.length) return size;\n      size = _;\n      return pack;\n    };\n    pack.radius = function(_) {\n      if (!arguments.length) return radius;\n      radius = _ == null || typeof _ === \"function\" ? _ : +_;\n      return pack;\n    };\n    pack.padding = function(_) {\n      if (!arguments.length) return padding;\n      padding = +_;\n      return pack;\n    };\n    return d3_layout_hierarchyRebind(pack, hierarchy);\n  };\n  function d3_layout_packSort(a, b) {\n    return a.value - b.value;\n  }\n  function d3_layout_packInsert(a, b) {\n    var c = a._pack_next;\n    a._pack_next = b;\n    b._pack_prev = a;\n    b._pack_next = c;\n    c._pack_prev = b;\n  }\n  function d3_layout_packSplice(a, b) {\n    a._pack_next = b;\n    b._pack_prev = a;\n  }\n  function d3_layout_packIntersects(a, b) {\n    var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r;\n    return .999 * dr * dr > dx * dx + dy * dy;\n  }\n  function d3_layout_packSiblings(node) {\n    if (!(nodes = node.children) || !(n = nodes.length)) return;\n    var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;\n    function bound(node) {\n      xMin = Math.min(node.x - node.r, xMin);\n      xMax = Math.max(node.x + node.r, xMax);\n      yMin = Math.min(node.y - node.r, yMin);\n      yMax = Math.max(node.y + node.r, yMax);\n    }\n    nodes.forEach(d3_layout_packLink);\n    a = nodes[0];\n    a.x = -a.r;\n    a.y = 0;\n    bound(a);\n    if (n > 1) {\n      b = nodes[1];\n      b.x = b.r;\n      b.y = 0;\n      bound(b);\n      if (n > 2) {\n        c = nodes[2];\n        d3_layout_packPlace(a, b, c);\n        bound(c);\n        d3_layout_packInsert(a, c);\n        a._pack_prev = c;\n        d3_layout_packInsert(c, b);\n        b = a._pack_next;\n        for (i = 3; i < n; i++) {\n          d3_layout_packPlace(a, b, c = nodes[i]);\n          var isect = 0, s1 = 1, s2 = 1;\n          for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {\n            if (d3_layout_packIntersects(j, c)) {\n              isect = 1;\n              break;\n            }\n          }\n          if (isect == 1) {\n            for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {\n              if (d3_layout_packIntersects(k, c)) {\n                break;\n              }\n            }\n          }\n          if (isect) {\n            if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);\n            i--;\n          } else {\n            d3_layout_packInsert(a, c);\n            b = c;\n            bound(c);\n          }\n        }\n      }\n    }\n    var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0;\n    for (i = 0; i < n; i++) {\n      c = nodes[i];\n      c.x -= cx;\n      c.y -= cy;\n      cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y));\n    }\n    node.r = cr;\n    nodes.forEach(d3_layout_packUnlink);\n  }\n  function d3_layout_packLink(node) {\n    node._pack_next = node._pack_prev = node;\n  }\n  function d3_layout_packUnlink(node) {\n    delete node._pack_next;\n    delete node._pack_prev;\n  }\n  function d3_layout_packTransform(node, x, y, k) {\n    var children = node.children;\n    node.x = x += k * node.x;\n    node.y = y += k * node.y;\n    node.r *= k;\n    if (children) {\n      var i = -1, n = children.length;\n      while (++i < n) d3_layout_packTransform(children[i], x, y, k);\n    }\n  }\n  function d3_layout_packPlace(a, b, c) {\n    var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;\n    if (db && (dx || dy)) {\n      var da = b.r + c.r, dc = dx * dx + dy * dy;\n      da *= da;\n      db *= db;\n      var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);\n      c.x = a.x + x * dx + y * dy;\n      c.y = a.y + x * dy - y * dx;\n    } else {\n      c.x = a.x + db;\n      c.y = a.y;\n    }\n  }\n  d3.layout.tree = function() {\n    var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;\n    function tree(d, i) {\n      var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);\n      d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;\n      d3_layout_hierarchyVisitBefore(root1, secondWalk);\n      if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {\n        var left = root0, right = root0, bottom = root0;\n        d3_layout_hierarchyVisitBefore(root0, function(node) {\n          if (node.x < left.x) left = node;\n          if (node.x > right.x) right = node;\n          if (node.depth > bottom.depth) bottom = node;\n        });\n        var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);\n        d3_layout_hierarchyVisitBefore(root0, function(node) {\n          node.x = (node.x + tx) * kx;\n          node.y = node.depth * ky;\n        });\n      }\n      return nodes;\n    }\n    function wrapTree(root0) {\n      var root1 = {\n        A: null,\n        children: [ root0 ]\n      }, queue = [ root1 ], node1;\n      while ((node1 = queue.pop()) != null) {\n        for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {\n          queue.push((children[i] = child = {\n            _: children[i],\n            parent: node1,\n            children: (child = children[i].children) && child.slice() || [],\n            A: null,\n            a: null,\n            z: 0,\n            m: 0,\n            c: 0,\n            s: 0,\n            t: null,\n            i: i\n          }).a = child);\n        }\n      }\n      return root1.children[0];\n    }\n    function firstWalk(v) {\n      var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;\n      if (children.length) {\n        d3_layout_treeShift(v);\n        var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n        if (w) {\n          v.z = w.z + separation(v._, w._);\n          v.m = v.z - midpoint;\n        } else {\n          v.z = midpoint;\n        }\n      } else if (w) {\n        v.z = w.z + separation(v._, w._);\n      }\n      v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n    }\n    function secondWalk(v) {\n      v._.x = v.z + v.parent.m;\n      v.m += v.parent.m;\n    }\n    function apportion(v, w, ancestor) {\n      if (w) {\n        var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;\n        while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {\n          vom = d3_layout_treeLeft(vom);\n          vop = d3_layout_treeRight(vop);\n          vop.a = v;\n          shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n          if (shift > 0) {\n            d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);\n            sip += shift;\n            sop += shift;\n          }\n          sim += vim.m;\n          sip += vip.m;\n          som += vom.m;\n          sop += vop.m;\n        }\n        if (vim && !d3_layout_treeRight(vop)) {\n          vop.t = vim;\n          vop.m += sim - sop;\n        }\n        if (vip && !d3_layout_treeLeft(vom)) {\n          vom.t = vip;\n          vom.m += sip - som;\n          ancestor = v;\n        }\n      }\n      return ancestor;\n    }\n    function sizeNode(node) {\n      node.x *= size[0];\n      node.y = node.depth * size[1];\n    }\n    tree.separation = function(x) {\n      if (!arguments.length) return separation;\n      separation = x;\n      return tree;\n    };\n    tree.size = function(x) {\n      if (!arguments.length) return nodeSize ? null : size;\n      nodeSize = (size = x) == null ? sizeNode : null;\n      return tree;\n    };\n    tree.nodeSize = function(x) {\n      if (!arguments.length) return nodeSize ? size : null;\n      nodeSize = (size = x) == null ? null : sizeNode;\n      return tree;\n    };\n    return d3_layout_hierarchyRebind(tree, hierarchy);\n  };\n  function d3_layout_treeSeparation(a, b) {\n    return a.parent == b.parent ? 1 : 2;\n  }\n  function d3_layout_treeLeft(v) {\n    var children = v.children;\n    return children.length ? children[0] : v.t;\n  }\n  function d3_layout_treeRight(v) {\n    var children = v.children, n;\n    return (n = children.length) ? children[n - 1] : v.t;\n  }\n  function d3_layout_treeMove(wm, wp, shift) {\n    var change = shift / (wp.i - wm.i);\n    wp.c -= change;\n    wp.s += shift;\n    wm.c += change;\n    wp.z += shift;\n    wp.m += shift;\n  }\n  function d3_layout_treeShift(v) {\n    var shift = 0, change = 0, children = v.children, i = children.length, w;\n    while (--i >= 0) {\n      w = children[i];\n      w.z += shift;\n      w.m += shift;\n      shift += w.s + (change += w.c);\n    }\n  }\n  function d3_layout_treeAncestor(vim, v, ancestor) {\n    return vim.a.parent === v.parent ? vim.a : ancestor;\n  }\n  d3.layout.cluster = function() {\n    var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;\n    function cluster(d, i) {\n      var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;\n      d3_layout_hierarchyVisitAfter(root, function(node) {\n        var children = node.children;\n        if (children && children.length) {\n          node.x = d3_layout_clusterX(children);\n          node.y = d3_layout_clusterY(children);\n        } else {\n          node.x = previousNode ? x += separation(node, previousNode) : 0;\n          node.y = 0;\n          previousNode = node;\n        }\n      });\n      var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;\n      d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {\n        node.x = (node.x - root.x) * size[0];\n        node.y = (root.y - node.y) * size[1];\n      } : function(node) {\n        node.x = (node.x - x0) / (x1 - x0) * size[0];\n        node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1];\n      });\n      return nodes;\n    }\n    cluster.separation = function(x) {\n      if (!arguments.length) return separation;\n      separation = x;\n      return cluster;\n    };\n    cluster.size = function(x) {\n      if (!arguments.length) return nodeSize ? null : size;\n      nodeSize = (size = x) == null;\n      return cluster;\n    };\n    cluster.nodeSize = function(x) {\n      if (!arguments.length) return nodeSize ? size : null;\n      nodeSize = (size = x) != null;\n      return cluster;\n    };\n    return d3_layout_hierarchyRebind(cluster, hierarchy);\n  };\n  function d3_layout_clusterY(children) {\n    return 1 + d3.max(children, function(child) {\n      return child.y;\n    });\n  }\n  function d3_layout_clusterX(children) {\n    return children.reduce(function(x, child) {\n      return x + child.x;\n    }, 0) / children.length;\n  }\n  function d3_layout_clusterLeft(node) {\n    var children = node.children;\n    return children && children.length ? d3_layout_clusterLeft(children[0]) : node;\n  }\n  function d3_layout_clusterRight(node) {\n    var children = node.children, n;\n    return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;\n  }\n  d3.layout.treemap = function() {\n    var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = \"squarify\", ratio = .5 * (1 + Math.sqrt(5));\n    function scale(children, k) {\n      var i = -1, n = children.length, child, area;\n      while (++i < n) {\n        area = (child = children[i]).value * (k < 0 ? 0 : k);\n        child.area = isNaN(area) || area <= 0 ? 0 : area;\n      }\n    }\n    function squarify(node) {\n      var children = node.children;\n      if (children && children.length) {\n        var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === \"slice\" ? rect.dx : mode === \"dice\" ? rect.dy : mode === \"slice-dice\" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n;\n        scale(remaining, rect.dx * rect.dy / node.value);\n        row.area = 0;\n        while ((n = remaining.length) > 0) {\n          row.push(child = remaining[n - 1]);\n          row.area += child.area;\n          if (mode !== \"squarify\" || (score = worst(row, u)) <= best) {\n            remaining.pop();\n            best = score;\n          } else {\n            row.area -= row.pop().area;\n            position(row, u, rect, false);\n            u = Math.min(rect.dx, rect.dy);\n            row.length = row.area = 0;\n            best = Infinity;\n          }\n        }\n        if (row.length) {\n          position(row, u, rect, true);\n          row.length = row.area = 0;\n        }\n        children.forEach(squarify);\n      }\n    }\n    function stickify(node) {\n      var children = node.children;\n      if (children && children.length) {\n        var rect = pad(node), remaining = children.slice(), child, row = [];\n        scale(remaining, rect.dx * rect.dy / node.value);\n        row.area = 0;\n        while (child = remaining.pop()) {\n          row.push(child);\n          row.area += child.area;\n          if (child.z != null) {\n            position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);\n            row.length = row.area = 0;\n          }\n        }\n        children.forEach(stickify);\n      }\n    }\n    function worst(row, u) {\n      var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length;\n      while (++i < n) {\n        if (!(r = row[i].area)) continue;\n        if (r < rmin) rmin = r;\n        if (r > rmax) rmax = r;\n      }\n      s *= s;\n      u *= u;\n      return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity;\n    }\n    function position(row, u, rect, flush) {\n      var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;\n      if (u == rect.dx) {\n        if (flush || v > rect.dy) v = rect.dy;\n        while (++i < n) {\n          o = row[i];\n          o.x = x;\n          o.y = y;\n          o.dy = v;\n          x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);\n        }\n        o.z = true;\n        o.dx += rect.x + rect.dx - x;\n        rect.y += v;\n        rect.dy -= v;\n      } else {\n        if (flush || v > rect.dx) v = rect.dx;\n        while (++i < n) {\n          o = row[i];\n          o.x = x;\n          o.y = y;\n          o.dx = v;\n          y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);\n        }\n        o.z = false;\n        o.dy += rect.y + rect.dy - y;\n        rect.x += v;\n        rect.dx -= v;\n      }\n    }\n    function treemap(d) {\n      var nodes = stickies || hierarchy(d), root = nodes[0];\n      root.x = root.y = 0;\n      if (root.value) root.dx = size[0], root.dy = size[1]; else root.dx = root.dy = 0;\n      if (stickies) hierarchy.revalue(root);\n      scale([ root ], root.dx * root.dy / root.value);\n      (stickies ? stickify : squarify)(root);\n      if (sticky) stickies = nodes;\n      return nodes;\n    }\n    treemap.size = function(x) {\n      if (!arguments.length) return size;\n      size = x;\n      return treemap;\n    };\n    treemap.padding = function(x) {\n      if (!arguments.length) return padding;\n      function padFunction(node) {\n        var p = x.call(treemap, node, node.depth);\n        return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === \"number\" ? [ p, p, p, p ] : p);\n      }\n      function padConstant(node) {\n        return d3_layout_treemapPad(node, x);\n      }\n      var type;\n      pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === \"function\" ? padFunction : type === \"number\" ? (x = [ x, x, x, x ], \n      padConstant) : padConstant;\n      return treemap;\n    };\n    treemap.round = function(x) {\n      if (!arguments.length) return round != Number;\n      round = x ? Math.round : Number;\n      return treemap;\n    };\n    treemap.sticky = function(x) {\n      if (!arguments.length) return sticky;\n      sticky = x;\n      stickies = null;\n      return treemap;\n    };\n    treemap.ratio = function(x) {\n      if (!arguments.length) return ratio;\n      ratio = x;\n      return treemap;\n    };\n    treemap.mode = function(x) {\n      if (!arguments.length) return mode;\n      mode = x + \"\";\n      return treemap;\n    };\n    return d3_layout_hierarchyRebind(treemap, hierarchy);\n  };\n  function d3_layout_treemapPadNull(node) {\n    return {\n      x: node.x,\n      y: node.y,\n      dx: node.dx,\n      dy: node.dy\n    };\n  }\n  function d3_layout_treemapPad(node, padding) {\n    var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2];\n    if (dx < 0) {\n      x += dx / 2;\n      dx = 0;\n    }\n    if (dy < 0) {\n      y += dy / 2;\n      dy = 0;\n    }\n    return {\n      x: x,\n      y: y,\n      dx: dx,\n      dy: dy\n    };\n  }\n  d3.random = {\n    normal: function(µ, σ) {\n      var n = arguments.length;\n      if (n < 2) σ = 1;\n      if (n < 1) µ = 0;\n      return function() {\n        var x, y, r;\n        do {\n          x = Math.random() * 2 - 1;\n          y = Math.random() * 2 - 1;\n          r = x * x + y * y;\n        } while (!r || r > 1);\n        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);\n      };\n    },\n    logNormal: function() {\n      var random = d3.random.normal.apply(d3, arguments);\n      return function() {\n        return Math.exp(random());\n      };\n    },\n    bates: function(m) {\n      var random = d3.random.irwinHall(m);\n      return function() {\n        return random() / m;\n      };\n    },\n    irwinHall: function(m) {\n      return function() {\n        for (var s = 0, j = 0; j < m; j++) s += Math.random();\n        return s;\n      };\n    }\n  };\n  d3.scale = {};\n  function d3_scaleExtent(domain) {\n    var start = domain[0], stop = domain[domain.length - 1];\n    return start < stop ? [ start, stop ] : [ stop, start ];\n  }\n  function d3_scaleRange(scale) {\n    return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());\n  }\n  function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {\n    var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]);\n    return function(x) {\n      return i(u(x));\n    };\n  }\n  function d3_scale_nice(domain, nice) {\n    var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx;\n    if (x1 < x0) {\n      dx = i0, i0 = i1, i1 = dx;\n      dx = x0, x0 = x1, x1 = dx;\n    }\n    domain[i0] = nice.floor(x0);\n    domain[i1] = nice.ceil(x1);\n    return domain;\n  }\n  function d3_scale_niceStep(step) {\n    return step ? {\n      floor: function(x) {\n        return Math.floor(x / step) * step;\n      },\n      ceil: function(x) {\n        return Math.ceil(x / step) * step;\n      }\n    } : d3_scale_niceIdentity;\n  }\n  var d3_scale_niceIdentity = {\n    floor: d3_identity,\n    ceil: d3_identity\n  };\n  function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {\n    var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1;\n    if (domain[k] < domain[0]) {\n      domain = domain.slice().reverse();\n      range = range.slice().reverse();\n    }\n    while (++j <= k) {\n      u.push(uninterpolate(domain[j - 1], domain[j]));\n      i.push(interpolate(range[j - 1], range[j]));\n    }\n    return function(x) {\n      var j = d3.bisect(domain, x, 1, k) - 1;\n      return i[j](u[j](x));\n    };\n  }\n  d3.scale.linear = function() {\n    return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false);\n  };\n  function d3_scale_linear(domain, range, interpolate, clamp) {\n    var output, input;\n    function rescale() {\n      var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;\n      output = linear(domain, range, uninterpolate, interpolate);\n      input = linear(range, domain, uninterpolate, d3_interpolate);\n      return scale;\n    }\n    function scale(x) {\n      return output(x);\n    }\n    scale.invert = function(y) {\n      return input(y);\n    };\n    scale.domain = function(x) {\n      if (!arguments.length) return domain;\n      domain = x.map(Number);\n      return rescale();\n    };\n    scale.range = function(x) {\n      if (!arguments.length) return range;\n      range = x;\n      return rescale();\n    };\n    scale.rangeRound = function(x) {\n      return scale.range(x).interpolate(d3_interpolateRound);\n    };\n    scale.clamp = function(x) {\n      if (!arguments.length) return clamp;\n      clamp = x;\n      return rescale();\n    };\n    scale.interpolate = function(x) {\n      if (!arguments.length) return interpolate;\n      interpolate = x;\n      return rescale();\n    };\n    scale.ticks = function(m) {\n      return d3_scale_linearTicks(domain, m);\n    };\n    scale.tickFormat = function(m, format) {\n      return d3_scale_linearTickFormat(domain, m, format);\n    };\n    scale.nice = function(m) {\n      d3_scale_linearNice(domain, m);\n      return rescale();\n    };\n    scale.copy = function() {\n      return d3_scale_linear(domain, range, interpolate, clamp);\n    };\n    return rescale();\n  }\n  function d3_scale_linearRebind(scale, linear) {\n    return d3.rebind(scale, linear, \"range\", \"rangeRound\", \"interpolate\", \"clamp\");\n  }\n  function d3_scale_linearNice(domain, m) {\n    d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));\n    d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));\n    return domain;\n  }\n  function d3_scale_linearTickRange(domain, m) {\n    if (m == null) m = 10;\n    var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step;\n    if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2;\n    extent[0] = Math.ceil(extent[0] / step) * step;\n    extent[1] = Math.floor(extent[1] / step) * step + step * .5;\n    extent[2] = step;\n    return extent;\n  }\n  function d3_scale_linearTicks(domain, m) {\n    return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));\n  }\n  function d3_scale_linearTickFormat(domain, m, format) {\n    var range = d3_scale_linearTickRange(domain, m);\n    if (format) {\n      var match = d3_format_re.exec(format);\n      match.shift();\n      if (match[8] === \"s\") {\n        var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));\n        if (!match[7]) match[7] = \".\" + d3_scale_linearPrecision(prefix.scale(range[2]));\n        match[8] = \"f\";\n        format = d3.format(match.join(\"\"));\n        return function(d) {\n          return format(prefix.scale(d)) + prefix.symbol;\n        };\n      }\n      if (!match[7]) match[7] = \".\" + d3_scale_linearFormatPrecision(match[8], range);\n      format = match.join(\"\");\n    } else {\n      format = \",.\" + d3_scale_linearPrecision(range[2]) + \"f\";\n    }\n    return d3.format(format);\n  }\n  var d3_scale_linearFormatSignificant = {\n    s: 1,\n    g: 1,\n    p: 1,\n    r: 1,\n    e: 1\n  };\n  function d3_scale_linearPrecision(value) {\n    return -Math.floor(Math.log(value) / Math.LN10 + .01);\n  }\n  function d3_scale_linearFormatPrecision(type, range) {\n    var p = d3_scale_linearPrecision(range[2]);\n    return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== \"e\") : p - (type === \"%\") * 2;\n  }\n  d3.scale.log = function() {\n    return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);\n  };\n  function d3_scale_log(linear, base, positive, domain) {\n    function log(x) {\n      return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);\n    }\n    function pow(x) {\n      return positive ? Math.pow(base, x) : -Math.pow(base, -x);\n    }\n    function scale(x) {\n      return linear(log(x));\n    }\n    scale.invert = function(x) {\n      return pow(linear.invert(x));\n    };\n    scale.domain = function(x) {\n      if (!arguments.length) return domain;\n      positive = x[0] >= 0;\n      linear.domain((domain = x.map(Number)).map(log));\n      return scale;\n    };\n    scale.base = function(_) {\n      if (!arguments.length) return base;\n      base = +_;\n      linear.domain(domain.map(log));\n      return scale;\n    };\n    scale.nice = function() {\n      var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative);\n      linear.domain(niced);\n      domain = niced.map(pow);\n      return scale;\n    };\n    scale.ticks = function() {\n      var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base;\n      if (isFinite(j - i)) {\n        if (positive) {\n          for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k);\n          ticks.push(pow(i));\n        } else {\n          ticks.push(pow(i));\n          for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k);\n        }\n        for (i = 0; ticks[i] < u; i++) {}\n        for (j = ticks.length; ticks[j - 1] > v; j--) {}\n        ticks = ticks.slice(i, j);\n      }\n      return ticks;\n    };\n    scale.tickFormat = function(n, format) {\n      if (!arguments.length) return d3_scale_logFormat;\n      if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== \"function\") format = d3.format(format);\n      var k = Math.max(1, base * n / scale.ticks().length);\n      return function(d) {\n        var i = d / pow(Math.round(log(d)));\n        if (i * base < base - .5) i *= base;\n        return i <= k ? format(d) : \"\";\n      };\n    };\n    scale.copy = function() {\n      return d3_scale_log(linear.copy(), base, positive, domain);\n    };\n    return d3_scale_linearRebind(scale, linear);\n  }\n  var d3_scale_logFormat = d3.format(\".0e\"), d3_scale_logNiceNegative = {\n    floor: function(x) {\n      return -Math.ceil(-x);\n    },\n    ceil: function(x) {\n      return -Math.floor(-x);\n    }\n  };\n  d3.scale.pow = function() {\n    return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]);\n  };\n  function d3_scale_pow(linear, exponent, domain) {\n    var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent);\n    function scale(x) {\n      return linear(powp(x));\n    }\n    scale.invert = function(x) {\n      return powb(linear.invert(x));\n    };\n    scale.domain = function(x) {\n      if (!arguments.length) return domain;\n      linear.domain((domain = x.map(Number)).map(powp));\n      return scale;\n    };\n    scale.ticks = function(m) {\n      return d3_scale_linearTicks(domain, m);\n    };\n    scale.tickFormat = function(m, format) {\n      return d3_scale_linearTickFormat(domain, m, format);\n    };\n    scale.nice = function(m) {\n      return scale.domain(d3_scale_linearNice(domain, m));\n    };\n    scale.exponent = function(x) {\n      if (!arguments.length) return exponent;\n      powp = d3_scale_powPow(exponent = x);\n      powb = d3_scale_powPow(1 / exponent);\n      linear.domain(domain.map(powp));\n      return scale;\n    };\n    scale.copy = function() {\n      return d3_scale_pow(linear.copy(), exponent, domain);\n    };\n    return d3_scale_linearRebind(scale, linear);\n  }\n  function d3_scale_powPow(e) {\n    return function(x) {\n      return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);\n    };\n  }\n  d3.scale.sqrt = function() {\n    return d3.scale.pow().exponent(.5);\n  };\n  d3.scale.ordinal = function() {\n    return d3_scale_ordinal([], {\n      t: \"range\",\n      a: [ [] ]\n    });\n  };\n  function d3_scale_ordinal(domain, ranger) {\n    var index, range, rangeBand;\n    function scale(x) {\n      return range[((index.get(x) || (ranger.t === \"range\" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];\n    }\n    function steps(start, step) {\n      return d3.range(domain.length).map(function(i) {\n        return start + step * i;\n      });\n    }\n    scale.domain = function(x) {\n      if (!arguments.length) return domain;\n      domain = [];\n      index = new d3_Map();\n      var i = -1, n = x.length, xi;\n      while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));\n      return scale[ranger.t].apply(scale, ranger.a);\n    };\n    scale.range = function(x) {\n      if (!arguments.length) return range;\n      range = x;\n      rangeBand = 0;\n      ranger = {\n        t: \"range\",\n        a: arguments\n      };\n      return scale;\n    };\n    scale.rangePoints = function(x, padding) {\n      if (arguments.length < 2) padding = 0;\n      var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2, \n      0) : (stop - start) / (domain.length - 1 + padding);\n      range = steps(start + step * padding / 2, step);\n      rangeBand = 0;\n      ranger = {\n        t: \"rangePoints\",\n        a: arguments\n      };\n      return scale;\n    };\n    scale.rangeRoundPoints = function(x, padding) {\n      if (arguments.length < 2) padding = 0;\n      var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2), \n      0) : (stop - start) / (domain.length - 1 + padding) | 0;\n      range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step);\n      rangeBand = 0;\n      ranger = {\n        t: \"rangeRoundPoints\",\n        a: arguments\n      };\n      return scale;\n    };\n    scale.rangeBands = function(x, padding, outerPadding) {\n      if (arguments.length < 2) padding = 0;\n      if (arguments.length < 3) outerPadding = padding;\n      var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding);\n      range = steps(start + step * outerPadding, step);\n      if (reverse) range.reverse();\n      rangeBand = step * (1 - padding);\n      ranger = {\n        t: \"rangeBands\",\n        a: arguments\n      };\n      return scale;\n    };\n    scale.rangeRoundBands = function(x, padding, outerPadding) {\n      if (arguments.length < 2) padding = 0;\n      if (arguments.length < 3) outerPadding = padding;\n      var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding));\n      range = steps(start + Math.round((stop - start - (domain.length - padding) * step) / 2), step);\n      if (reverse) range.reverse();\n      rangeBand = Math.round(step * (1 - padding));\n      ranger = {\n        t: \"rangeRoundBands\",\n        a: arguments\n      };\n      return scale;\n    };\n    scale.rangeBand = function() {\n      return rangeBand;\n    };\n    scale.rangeExtent = function() {\n      return d3_scaleExtent(ranger.a[0]);\n    };\n    scale.copy = function() {\n      return d3_scale_ordinal(domain, ranger);\n    };\n    return scale.domain(domain);\n  }\n  d3.scale.category10 = function() {\n    return d3.scale.ordinal().range(d3_category10);\n  };\n  d3.scale.category20 = function() {\n    return d3.scale.ordinal().range(d3_category20);\n  };\n  d3.scale.category20b = function() {\n    return d3.scale.ordinal().range(d3_category20b);\n  };\n  d3.scale.category20c = function() {\n    return d3.scale.ordinal().range(d3_category20c);\n  };\n  var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString);\n  var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString);\n  var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString);\n  var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString);\n  d3.scale.quantile = function() {\n    return d3_scale_quantile([], []);\n  };\n  function d3_scale_quantile(domain, range) {\n    var thresholds;\n    function rescale() {\n      var k = 0, q = range.length;\n      thresholds = [];\n      while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);\n      return scale;\n    }\n    function scale(x) {\n      if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)];\n    }\n    scale.domain = function(x) {\n      if (!arguments.length) return domain;\n      domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending);\n      return rescale();\n    };\n    scale.range = function(x) {\n      if (!arguments.length) return range;\n      range = x;\n      return rescale();\n    };\n    scale.quantiles = function() {\n      return thresholds;\n    };\n    scale.invertExtent = function(y) {\n      y = range.indexOf(y);\n      return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ];\n    };\n    scale.copy = function() {\n      return d3_scale_quantile(domain, range);\n    };\n    return rescale();\n  }\n  d3.scale.quantize = function() {\n    return d3_scale_quantize(0, 1, [ 0, 1 ]);\n  };\n  function d3_scale_quantize(x0, x1, range) {\n    var kx, i;\n    function scale(x) {\n      return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];\n    }\n    function rescale() {\n      kx = range.length / (x1 - x0);\n      i = range.length - 1;\n      return scale;\n    }\n    scale.domain = function(x) {\n      if (!arguments.length) return [ x0, x1 ];\n      x0 = +x[0];\n      x1 = +x[x.length - 1];\n      return rescale();\n    };\n    scale.range = function(x) {\n      if (!arguments.length) return range;\n      range = x;\n      return rescale();\n    };\n    scale.invertExtent = function(y) {\n      y = range.indexOf(y);\n      y = y < 0 ? NaN : y / kx + x0;\n      return [ y, y + 1 / kx ];\n    };\n    scale.copy = function() {\n      return d3_scale_quantize(x0, x1, range);\n    };\n    return rescale();\n  }\n  d3.scale.threshold = function() {\n    return d3_scale_threshold([ .5 ], [ 0, 1 ]);\n  };\n  function d3_scale_threshold(domain, range) {\n    function scale(x) {\n      if (x <= x) return range[d3.bisect(domain, x)];\n    }\n    scale.domain = function(_) {\n      if (!arguments.length) return domain;\n      domain = _;\n      return scale;\n    };\n    scale.range = function(_) {\n      if (!arguments.length) return range;\n      range = _;\n      return scale;\n    };\n    scale.invertExtent = function(y) {\n      y = range.indexOf(y);\n      return [ domain[y - 1], domain[y] ];\n    };\n    scale.copy = function() {\n      return d3_scale_threshold(domain, range);\n    };\n    return scale;\n  }\n  d3.scale.identity = function() {\n    return d3_scale_identity([ 0, 1 ]);\n  };\n  function d3_scale_identity(domain) {\n    function identity(x) {\n      return +x;\n    }\n    identity.invert = identity;\n    identity.domain = identity.range = function(x) {\n      if (!arguments.length) return domain;\n      domain = x.map(identity);\n      return identity;\n    };\n    identity.ticks = function(m) {\n      return d3_scale_linearTicks(domain, m);\n    };\n    identity.tickFormat = function(m, format) {\n      return d3_scale_linearTickFormat(domain, m, format);\n    };\n    identity.copy = function() {\n      return d3_scale_identity(domain);\n    };\n    return identity;\n  }\n  d3.svg = {};\n  function d3_zero() {\n    return 0;\n  }\n  d3.svg.arc = function() {\n    var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle, padAngle = d3_svg_arcPadAngle;\n    function arc() {\n      var r0 = Math.max(0, +innerRadius.apply(this, arguments)), r1 = Math.max(0, +outerRadius.apply(this, arguments)), a0 = startAngle.apply(this, arguments) - halfπ, a1 = endAngle.apply(this, arguments) - halfπ, da = Math.abs(a1 - a0), cw = a0 > a1 ? 0 : 1;\n      if (r1 < r0) rc = r1, r1 = r0, r0 = rc;\n      if (da >= τε) return circleSegment(r1, cw) + (r0 ? circleSegment(r0, 1 - cw) : \"\") + \"Z\";\n      var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = [];\n      if (ap = (+padAngle.apply(this, arguments) || 0) / 2) {\n        rp = padRadius === d3_svg_arcAuto ? Math.sqrt(r0 * r0 + r1 * r1) : +padRadius.apply(this, arguments);\n        if (!cw) p1 *= -1;\n        if (r1) p1 = d3_asin(rp / r1 * Math.sin(ap));\n        if (r0) p0 = d3_asin(rp / r0 * Math.sin(ap));\n      }\n      if (r1) {\n        x0 = r1 * Math.cos(a0 + p1);\n        y0 = r1 * Math.sin(a0 + p1);\n        x1 = r1 * Math.cos(a1 - p1);\n        y1 = r1 * Math.sin(a1 - p1);\n        var l1 = Math.abs(a1 - a0 - 2 * p1) <= π ? 0 : 1;\n        if (p1 && d3_svg_arcSweep(x0, y0, x1, y1) === cw ^ l1) {\n          var h1 = (a0 + a1) / 2;\n          x0 = r1 * Math.cos(h1);\n          y0 = r1 * Math.sin(h1);\n          x1 = y1 = null;\n        }\n      } else {\n        x0 = y0 = 0;\n      }\n      if (r0) {\n        x2 = r0 * Math.cos(a1 - p0);\n        y2 = r0 * Math.sin(a1 - p0);\n        x3 = r0 * Math.cos(a0 + p0);\n        y3 = r0 * Math.sin(a0 + p0);\n        var l0 = Math.abs(a0 - a1 + 2 * p0) <= π ? 0 : 1;\n        if (p0 && d3_svg_arcSweep(x2, y2, x3, y3) === 1 - cw ^ l0) {\n          var h0 = (a0 + a1) / 2;\n          x2 = r0 * Math.cos(h0);\n          y2 = r0 * Math.sin(h0);\n          x3 = y3 = null;\n        }\n      } else {\n        x2 = y2 = 0;\n      }\n      if (da > ε && (rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) {\n        cr = r0 < r1 ^ cw ? 0 : 1;\n        var rc1 = rc, rc0 = rc;\n        if (da < π) {\n          var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n          rc0 = Math.min(rc, (r0 - lc) / (kc - 1));\n          rc1 = Math.min(rc, (r1 - lc) / (kc + 1));\n        }\n        if (x1 != null) {\n          var t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw);\n          if (rc === rc1) {\n            path.push(\"M\", t30[0], \"A\", rc1, \",\", rc1, \" 0 0,\", cr, \" \", t30[1], \"A\", r1, \",\", r1, \" 0 \", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), \",\", cw, \" \", t12[1], \"A\", rc1, \",\", rc1, \" 0 0,\", cr, \" \", t12[0]);\n          } else {\n            path.push(\"M\", t30[0], \"A\", rc1, \",\", rc1, \" 0 1,\", cr, \" \", t12[0]);\n          }\n        } else {\n          path.push(\"M\", x0, \",\", y0);\n        }\n        if (x3 != null) {\n          var t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw);\n          if (rc === rc0) {\n            path.push(\"L\", t21[0], \"A\", rc0, \",\", rc0, \" 0 0,\", cr, \" \", t21[1], \"A\", r0, \",\", r0, \" 0 \", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), \",\", 1 - cw, \" \", t03[1], \"A\", rc0, \",\", rc0, \" 0 0,\", cr, \" \", t03[0]);\n          } else {\n            path.push(\"L\", t21[0], \"A\", rc0, \",\", rc0, \" 0 0,\", cr, \" \", t03[0]);\n          }\n        } else {\n          path.push(\"L\", x2, \",\", y2);\n        }\n      } else {\n        path.push(\"M\", x0, \",\", y0);\n        if (x1 != null) path.push(\"A\", r1, \",\", r1, \" 0 \", l1, \",\", cw, \" \", x1, \",\", y1);\n        path.push(\"L\", x2, \",\", y2);\n        if (x3 != null) path.push(\"A\", r0, \",\", r0, \" 0 \", l0, \",\", 1 - cw, \" \", x3, \",\", y3);\n      }\n      path.push(\"Z\");\n      return path.join(\"\");\n    }\n    function circleSegment(r1, cw) {\n      return \"M0,\" + r1 + \"A\" + r1 + \",\" + r1 + \" 0 1,\" + cw + \" 0,\" + -r1 + \"A\" + r1 + \",\" + r1 + \" 0 1,\" + cw + \" 0,\" + r1;\n    }\n    arc.innerRadius = function(v) {\n      if (!arguments.length) return innerRadius;\n      innerRadius = d3_functor(v);\n      return arc;\n    };\n    arc.outerRadius = function(v) {\n      if (!arguments.length) return outerRadius;\n      outerRadius = d3_functor(v);\n      return arc;\n    };\n    arc.cornerRadius = function(v) {\n      if (!arguments.length) return cornerRadius;\n      cornerRadius = d3_functor(v);\n      return arc;\n    };\n    arc.padRadius = function(v) {\n      if (!arguments.length) return padRadius;\n      padRadius = v == d3_svg_arcAuto ? d3_svg_arcAuto : d3_functor(v);\n      return arc;\n    };\n    arc.startAngle = function(v) {\n      if (!arguments.length) return startAngle;\n      startAngle = d3_functor(v);\n      return arc;\n    };\n    arc.endAngle = function(v) {\n      if (!arguments.length) return endAngle;\n      endAngle = d3_functor(v);\n      return arc;\n    };\n    arc.padAngle = function(v) {\n      if (!arguments.length) return padAngle;\n      padAngle = d3_functor(v);\n      return arc;\n    };\n    arc.centroid = function() {\n      var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - halfπ;\n      return [ Math.cos(a) * r, Math.sin(a) * r ];\n    };\n    return arc;\n  };\n  var d3_svg_arcAuto = \"auto\";\n  function d3_svg_arcInnerRadius(d) {\n    return d.innerRadius;\n  }\n  function d3_svg_arcOuterRadius(d) {\n    return d.outerRadius;\n  }\n  function d3_svg_arcStartAngle(d) {\n    return d.startAngle;\n  }\n  function d3_svg_arcEndAngle(d) {\n    return d.endAngle;\n  }\n  function d3_svg_arcPadAngle(d) {\n    return d && d.padAngle;\n  }\n  function d3_svg_arcSweep(x0, y0, x1, y1) {\n    return (x0 - x1) * y0 - (y0 - y1) * x0 > 0 ? 0 : 1;\n  }\n  function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) {\n    var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3;\n    if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n    return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ];\n  }\n  function d3_svg_line(projection) {\n    var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;\n    function line(data) {\n      var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);\n      function segment() {\n        segments.push(\"M\", interpolate(projection(points), tension));\n      }\n      while (++i < n) {\n        if (defined.call(this, d = data[i], i)) {\n          points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);\n        } else if (points.length) {\n          segment();\n          points = [];\n        }\n      }\n      if (points.length) segment();\n      return segments.length ? segments.join(\"\") : null;\n    }\n    line.x = function(_) {\n      if (!arguments.length) return x;\n      x = _;\n      return line;\n    };\n    line.y = function(_) {\n      if (!arguments.length) return y;\n      y = _;\n      return line;\n    };\n    line.defined = function(_) {\n      if (!arguments.length) return defined;\n      defined = _;\n      return line;\n    };\n    line.interpolate = function(_) {\n      if (!arguments.length) return interpolateKey;\n      if (typeof _ === \"function\") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;\n      return line;\n    };\n    line.tension = function(_) {\n      if (!arguments.length) return tension;\n      tension = _;\n      return line;\n    };\n    return line;\n  }\n  d3.svg.line = function() {\n    return d3_svg_line(d3_identity);\n  };\n  var d3_svg_lineInterpolators = d3.map({\n    linear: d3_svg_lineLinear,\n    \"linear-closed\": d3_svg_lineLinearClosed,\n    step: d3_svg_lineStep,\n    \"step-before\": d3_svg_lineStepBefore,\n    \"step-after\": d3_svg_lineStepAfter,\n    basis: d3_svg_lineBasis,\n    \"basis-open\": d3_svg_lineBasisOpen,\n    \"basis-closed\": d3_svg_lineBasisClosed,\n    bundle: d3_svg_lineBundle,\n    cardinal: d3_svg_lineCardinal,\n    \"cardinal-open\": d3_svg_lineCardinalOpen,\n    \"cardinal-closed\": d3_svg_lineCardinalClosed,\n    monotone: d3_svg_lineMonotone\n  });\n  d3_svg_lineInterpolators.forEach(function(key, value) {\n    value.key = key;\n    value.closed = /-closed$/.test(key);\n  });\n  function d3_svg_lineLinear(points) {\n    return points.length > 1 ? points.join(\"L\") : points + \"Z\";\n  }\n  function d3_svg_lineLinearClosed(points) {\n    return points.join(\"L\") + \"Z\";\n  }\n  function d3_svg_lineStep(points) {\n    var i = 0, n = points.length, p = points[0], path = [ p[0], \",\", p[1] ];\n    while (++i < n) path.push(\"H\", (p[0] + (p = points[i])[0]) / 2, \"V\", p[1]);\n    if (n > 1) path.push(\"H\", p[0]);\n    return path.join(\"\");\n  }\n  function d3_svg_lineStepBefore(points) {\n    var i = 0, n = points.length, p = points[0], path = [ p[0], \",\", p[1] ];\n    while (++i < n) path.push(\"V\", (p = points[i])[1], \"H\", p[0]);\n    return path.join(\"\");\n  }\n  function d3_svg_lineStepAfter(points) {\n    var i = 0, n = points.length, p = points[0], path = [ p[0], \",\", p[1] ];\n    while (++i < n) path.push(\"H\", (p = points[i])[0], \"V\", p[1]);\n    return path.join(\"\");\n  }\n  function d3_svg_lineCardinalOpen(points, tension) {\n    return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension));\n  }\n  function d3_svg_lineCardinalClosed(points, tension) {\n    return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), \n    points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));\n  }\n  function d3_svg_lineCardinal(points, tension) {\n    return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));\n  }\n  function d3_svg_lineHermite(points, tangents) {\n    if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) {\n      return d3_svg_lineLinear(points);\n    }\n    var quad = points.length != tangents.length, path = \"\", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;\n    if (quad) {\n      path += \"Q\" + (p[0] - t0[0] * 2 / 3) + \",\" + (p[1] - t0[1] * 2 / 3) + \",\" + p[0] + \",\" + p[1];\n      p0 = points[1];\n      pi = 2;\n    }\n    if (tangents.length > 1) {\n      t = tangents[1];\n      p = points[pi];\n      pi++;\n      path += \"C\" + (p0[0] + t0[0]) + \",\" + (p0[1] + t0[1]) + \",\" + (p[0] - t[0]) + \",\" + (p[1] - t[1]) + \",\" + p[0] + \",\" + p[1];\n      for (var i = 2; i < tangents.length; i++, pi++) {\n        p = points[pi];\n        t = tangents[i];\n        path += \"S\" + (p[0] - t[0]) + \",\" + (p[1] - t[1]) + \",\" + p[0] + \",\" + p[1];\n      }\n    }\n    if (quad) {\n      var lp = points[pi];\n      path += \"Q\" + (p[0] + t[0] * 2 / 3) + \",\" + (p[1] + t[1] * 2 / 3) + \",\" + lp[0] + \",\" + lp[1];\n    }\n    return path;\n  }\n  function d3_svg_lineCardinalTangents(points, tension) {\n    var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length;\n    while (++i < n) {\n      p0 = p1;\n      p1 = p2;\n      p2 = points[i];\n      tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]);\n    }\n    return tangents;\n  }\n  function d3_svg_lineBasis(points) {\n    if (points.length < 3) return d3_svg_lineLinear(points);\n    var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, \",\", y0, \"L\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];\n    points.push(points[n - 1]);\n    while (++i <= n) {\n      pi = points[i];\n      px.shift();\n      px.push(pi[0]);\n      py.shift();\n      py.push(pi[1]);\n      d3_svg_lineBasisBezier(path, px, py);\n    }\n    points.pop();\n    path.push(\"L\", pi);\n    return path.join(\"\");\n  }\n  function d3_svg_lineBasisOpen(points) {\n    if (points.length < 4) return d3_svg_lineLinear(points);\n    var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];\n    while (++i < 3) {\n      pi = points[i];\n      px.push(pi[0]);\n      py.push(pi[1]);\n    }\n    path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + \",\" + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));\n    --i;\n    while (++i < n) {\n      pi = points[i];\n      px.shift();\n      px.push(pi[0]);\n      py.shift();\n      py.push(pi[1]);\n      d3_svg_lineBasisBezier(path, px, py);\n    }\n    return path.join(\"\");\n  }\n  function d3_svg_lineBasisClosed(points) {\n    var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];\n    while (++i < 4) {\n      pi = points[i % n];\n      px.push(pi[0]);\n      py.push(pi[1]);\n    }\n    path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];\n    --i;\n    while (++i < m) {\n      pi = points[i % n];\n      px.shift();\n      px.push(pi[0]);\n      py.shift();\n      py.push(pi[1]);\n      d3_svg_lineBasisBezier(path, px, py);\n    }\n    return path.join(\"\");\n  }\n  function d3_svg_lineBundle(points, tension) {\n    var n = points.length - 1;\n    if (n) {\n      var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t;\n      while (++i <= n) {\n        p = points[i];\n        t = i / n;\n        p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);\n        p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);\n      }\n    }\n    return d3_svg_lineBasis(points);\n  }\n  function d3_svg_lineDot4(a, b) {\n    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n  }\n  var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ];\n  function d3_svg_lineBasisBezier(path, x, y) {\n    path.push(\"C\", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), \",\", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));\n  }\n  function d3_svg_lineSlope(p0, p1) {\n    return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n  }\n  function d3_svg_lineFiniteDifferences(points) {\n    var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);\n    while (++i < j) {\n      m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;\n    }\n    m[i] = d;\n    return m;\n  }\n  function d3_svg_lineMonotoneTangents(points) {\n    var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;\n    while (++i < j) {\n      d = d3_svg_lineSlope(points[i], points[i + 1]);\n      if (abs(d) < ε) {\n        m[i] = m[i + 1] = 0;\n      } else {\n        a = m[i] / d;\n        b = m[i + 1] / d;\n        s = a * a + b * b;\n        if (s > 9) {\n          s = d * 3 / Math.sqrt(s);\n          m[i] = s * a;\n          m[i + 1] = s * b;\n        }\n      }\n    }\n    i = -1;\n    while (++i <= j) {\n      s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i]));\n      tangents.push([ s || 0, m[i] * s || 0 ]);\n    }\n    return tangents;\n  }\n  function d3_svg_lineMonotone(points) {\n    return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));\n  }\n  d3.svg.line.radial = function() {\n    var line = d3_svg_line(d3_svg_lineRadial);\n    line.radius = line.x, delete line.x;\n    line.angle = line.y, delete line.y;\n    return line;\n  };\n  function d3_svg_lineRadial(points) {\n    var point, i = -1, n = points.length, r, a;\n    while (++i < n) {\n      point = points[i];\n      r = point[0];\n      a = point[1] - halfπ;\n      point[0] = r * Math.cos(a);\n      point[1] = r * Math.sin(a);\n    }\n    return points;\n  }\n  function d3_svg_area(projection) {\n    var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = \"L\", tension = .7;\n    function area(data) {\n      var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {\n        return x;\n      } : d3_functor(x1), fy1 = y0 === y1 ? function() {\n        return y;\n      } : d3_functor(y1), x, y;\n      function segment() {\n        segments.push(\"M\", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), \"Z\");\n      }\n      while (++i < n) {\n        if (defined.call(this, d = data[i], i)) {\n          points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]);\n          points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]);\n        } else if (points0.length) {\n          segment();\n          points0 = [];\n          points1 = [];\n        }\n      }\n      if (points0.length) segment();\n      return segments.length ? segments.join(\"\") : null;\n    }\n    area.x = function(_) {\n      if (!arguments.length) return x1;\n      x0 = x1 = _;\n      return area;\n    };\n    area.x0 = function(_) {\n      if (!arguments.length) return x0;\n      x0 = _;\n      return area;\n    };\n    area.x1 = function(_) {\n      if (!arguments.length) return x1;\n      x1 = _;\n      return area;\n    };\n    area.y = function(_) {\n      if (!arguments.length) return y1;\n      y0 = y1 = _;\n      return area;\n    };\n    area.y0 = function(_) {\n      if (!arguments.length) return y0;\n      y0 = _;\n      return area;\n    };\n    area.y1 = function(_) {\n      if (!arguments.length) return y1;\n      y1 = _;\n      return area;\n    };\n    area.defined = function(_) {\n      if (!arguments.length) return defined;\n      defined = _;\n      return area;\n    };\n    area.interpolate = function(_) {\n      if (!arguments.length) return interpolateKey;\n      if (typeof _ === \"function\") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;\n      interpolateReverse = interpolate.reverse || interpolate;\n      L = interpolate.closed ? \"M\" : \"L\";\n      return area;\n    };\n    area.tension = function(_) {\n      if (!arguments.length) return tension;\n      tension = _;\n      return area;\n    };\n    return area;\n  }\n  d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;\n  d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;\n  d3.svg.area = function() {\n    return d3_svg_area(d3_identity);\n  };\n  d3.svg.area.radial = function() {\n    var area = d3_svg_area(d3_svg_lineRadial);\n    area.radius = area.x, delete area.x;\n    area.innerRadius = area.x0, delete area.x0;\n    area.outerRadius = area.x1, delete area.x1;\n    area.angle = area.y, delete area.y;\n    area.startAngle = area.y0, delete area.y0;\n    area.endAngle = area.y1, delete area.y1;\n    return area;\n  };\n  d3.svg.chord = function() {\n    var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;\n    function chord(d, i) {\n      var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);\n      return \"M\" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + \"Z\";\n    }\n    function subgroup(self, f, d, i) {\n      var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) - halfπ, a1 = endAngle.call(self, subgroup, i) - halfπ;\n      return {\n        r: r,\n        a0: a0,\n        a1: a1,\n        p0: [ r * Math.cos(a0), r * Math.sin(a0) ],\n        p1: [ r * Math.cos(a1), r * Math.sin(a1) ]\n      };\n    }\n    function equals(a, b) {\n      return a.a0 == b.a0 && a.a1 == b.a1;\n    }\n    function arc(r, p, a) {\n      return \"A\" + r + \",\" + r + \" 0 \" + +(a > π) + \",1 \" + p;\n    }\n    function curve(r0, p0, r1, p1) {\n      return \"Q 0,0 \" + p1;\n    }\n    chord.radius = function(v) {\n      if (!arguments.length) return radius;\n      radius = d3_functor(v);\n      return chord;\n    };\n    chord.source = function(v) {\n      if (!arguments.length) return source;\n      source = d3_functor(v);\n      return chord;\n    };\n    chord.target = function(v) {\n      if (!arguments.length) return target;\n      target = d3_functor(v);\n      return chord;\n    };\n    chord.startAngle = function(v) {\n      if (!arguments.length) return startAngle;\n      startAngle = d3_functor(v);\n      return chord;\n    };\n    chord.endAngle = function(v) {\n      if (!arguments.length) return endAngle;\n      endAngle = d3_functor(v);\n      return chord;\n    };\n    return chord;\n  };\n  function d3_svg_chordRadius(d) {\n    return d.radius;\n  }\n  d3.svg.diagonal = function() {\n    var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection;\n    function diagonal(d, i) {\n      var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {\n        x: p0.x,\n        y: m\n      }, {\n        x: p3.x,\n        y: m\n      }, p3 ];\n      p = p.map(projection);\n      return \"M\" + p[0] + \"C\" + p[1] + \" \" + p[2] + \" \" + p[3];\n    }\n    diagonal.source = function(x) {\n      if (!arguments.length) return source;\n      source = d3_functor(x);\n      return diagonal;\n    };\n    diagonal.target = function(x) {\n      if (!arguments.length) return target;\n      target = d3_functor(x);\n      return diagonal;\n    };\n    diagonal.projection = function(x) {\n      if (!arguments.length) return projection;\n      projection = x;\n      return diagonal;\n    };\n    return diagonal;\n  };\n  function d3_svg_diagonalProjection(d) {\n    return [ d.x, d.y ];\n  }\n  d3.svg.diagonal.radial = function() {\n    var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection;\n    diagonal.projection = function(x) {\n      return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection;\n    };\n    return diagonal;\n  };\n  function d3_svg_diagonalRadialProjection(projection) {\n    return function() {\n      var d = projection.apply(this, arguments), r = d[0], a = d[1] - halfπ;\n      return [ r * Math.cos(a), r * Math.sin(a) ];\n    };\n  }\n  d3.svg.symbol = function() {\n    var type = d3_svg_symbolType, size = d3_svg_symbolSize;\n    function symbol(d, i) {\n      return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i));\n    }\n    symbol.type = function(x) {\n      if (!arguments.length) return type;\n      type = d3_functor(x);\n      return symbol;\n    };\n    symbol.size = function(x) {\n      if (!arguments.length) return size;\n      size = d3_functor(x);\n      return symbol;\n    };\n    return symbol;\n  };\n  function d3_svg_symbolSize() {\n    return 64;\n  }\n  function d3_svg_symbolType() {\n    return \"circle\";\n  }\n  function d3_svg_symbolCircle(size) {\n    var r = Math.sqrt(size / π);\n    return \"M0,\" + r + \"A\" + r + \",\" + r + \" 0 1,1 0,\" + -r + \"A\" + r + \",\" + r + \" 0 1,1 0,\" + r + \"Z\";\n  }\n  var d3_svg_symbols = d3.map({\n    circle: d3_svg_symbolCircle,\n    cross: function(size) {\n      var r = Math.sqrt(size / 5) / 2;\n      return \"M\" + -3 * r + \",\" + -r + \"H\" + -r + \"V\" + -3 * r + \"H\" + r + \"V\" + -r + \"H\" + 3 * r + \"V\" + r + \"H\" + r + \"V\" + 3 * r + \"H\" + -r + \"V\" + r + \"H\" + -3 * r + \"Z\";\n    },\n    diamond: function(size) {\n      var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30;\n      return \"M0,\" + -ry + \"L\" + rx + \",0\" + \" 0,\" + ry + \" \" + -rx + \",0\" + \"Z\";\n    },\n    square: function(size) {\n      var r = Math.sqrt(size) / 2;\n      return \"M\" + -r + \",\" + -r + \"L\" + r + \",\" + -r + \" \" + r + \",\" + r + \" \" + -r + \",\" + r + \"Z\";\n    },\n    \"triangle-down\": function(size) {\n      var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;\n      return \"M0,\" + ry + \"L\" + rx + \",\" + -ry + \" \" + -rx + \",\" + -ry + \"Z\";\n    },\n    \"triangle-up\": function(size) {\n      var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;\n      return \"M0,\" + -ry + \"L\" + rx + \",\" + ry + \" \" + -rx + \",\" + ry + \"Z\";\n    }\n  });\n  d3.svg.symbolTypes = d3_svg_symbols.keys();\n  var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);\n  d3_selectionPrototype.transition = function(name) {\n    var id = d3_transitionInheritId || ++d3_transitionId, ns = d3_transitionNamespace(name), subgroups = [], subgroup, node, transition = d3_transitionInherit || {\n      time: Date.now(),\n      ease: d3_ease_cubicInOut,\n      delay: 0,\n      duration: 250\n    };\n    for (var j = -1, m = this.length; ++j < m; ) {\n      subgroups.push(subgroup = []);\n      for (var group = this[j], i = -1, n = group.length; ++i < n; ) {\n        if (node = group[i]) d3_transitionNode(node, i, ns, id, transition);\n        subgroup.push(node);\n      }\n    }\n    return d3_transition(subgroups, ns, id);\n  };\n  d3_selectionPrototype.interrupt = function(name) {\n    return this.each(name == null ? d3_selection_interrupt : d3_selection_interruptNS(d3_transitionNamespace(name)));\n  };\n  var d3_selection_interrupt = d3_selection_interruptNS(d3_transitionNamespace());\n  function d3_selection_interruptNS(ns) {\n    return function() {\n      var lock, activeId, active;\n      if ((lock = this[ns]) && (active = lock[activeId = lock.active])) {\n        active.timer.c = null;\n        active.timer.t = NaN;\n        if (--lock.count) delete lock[activeId]; else delete this[ns];\n        lock.active += .5;\n        active.event && active.event.interrupt.call(this, this.__data__, active.index);\n      }\n    };\n  }\n  function d3_transition(groups, ns, id) {\n    d3_subclass(groups, d3_transitionPrototype);\n    groups.namespace = ns;\n    groups.id = id;\n    return groups;\n  }\n  var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit;\n  d3_transitionPrototype.call = d3_selectionPrototype.call;\n  d3_transitionPrototype.empty = d3_selectionPrototype.empty;\n  d3_transitionPrototype.node = d3_selectionPrototype.node;\n  d3_transitionPrototype.size = d3_selectionPrototype.size;\n  d3.transition = function(selection, name) {\n    return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection);\n  };\n  d3.transition.prototype = d3_transitionPrototype;\n  d3_transitionPrototype.select = function(selector) {\n    var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnode, node;\n    selector = d3_selection_selector(selector);\n    for (var j = -1, m = this.length; ++j < m; ) {\n      subgroups.push(subgroup = []);\n      for (var group = this[j], i = -1, n = group.length; ++i < n; ) {\n        if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) {\n          if (\"__data__\" in node) subnode.__data__ = node.__data__;\n          d3_transitionNode(subnode, i, ns, id, node[ns][id]);\n          subgroup.push(subnode);\n        } else {\n          subgroup.push(null);\n        }\n      }\n    }\n    return d3_transition(subgroups, ns, id);\n  };\n  d3_transitionPrototype.selectAll = function(selector) {\n    var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnodes, node, subnode, transition;\n    selector = d3_selection_selectorAll(selector);\n    for (var j = -1, m = this.length; ++j < m; ) {\n      for (var group = this[j], i = -1, n = group.length; ++i < n; ) {\n        if (node = group[i]) {\n          transition = node[ns][id];\n          subnodes = selector.call(node, node.__data__, i, j);\n          subgroups.push(subgroup = []);\n          for (var k = -1, o = subnodes.length; ++k < o; ) {\n            if (subnode = subnodes[k]) d3_transitionNode(subnode, k, ns, id, transition);\n            subgroup.push(subnode);\n          }\n        }\n      }\n    }\n    return d3_transition(subgroups, ns, id);\n  };\n  d3_transitionPrototype.filter = function(filter) {\n    var subgroups = [], subgroup, group, node;\n    if (typeof filter !== \"function\") filter = d3_selection_filter(filter);\n    for (var j = 0, m = this.length; j < m; j++) {\n      subgroups.push(subgroup = []);\n      for (var group = this[j], i = 0, n = group.length; i < n; i++) {\n        if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {\n          subgroup.push(node);\n        }\n      }\n    }\n    return d3_transition(subgroups, this.namespace, this.id);\n  };\n  d3_transitionPrototype.tween = function(name, tween) {\n    var id = this.id, ns = this.namespace;\n    if (arguments.length < 2) return this.node()[ns][id].tween.get(name);\n    return d3_selection_each(this, tween == null ? function(node) {\n      node[ns][id].tween.remove(name);\n    } : function(node) {\n      node[ns][id].tween.set(name, tween);\n    });\n  };\n  function d3_transition_tween(groups, name, value, tween) {\n    var id = groups.id, ns = groups.namespace;\n    return d3_selection_each(groups, typeof value === \"function\" ? function(node, i, j) {\n      node[ns][id].tween.set(name, tween(value.call(node, node.__data__, i, j)));\n    } : (value = tween(value), function(node) {\n      node[ns][id].tween.set(name, value);\n    }));\n  }\n  d3_transitionPrototype.attr = function(nameNS, value) {\n    if (arguments.length < 2) {\n      for (value in nameNS) this.attr(value, nameNS[value]);\n      return this;\n    }\n    var interpolate = nameNS == \"transform\" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS);\n    function attrNull() {\n      this.removeAttribute(name);\n    }\n    function attrNullNS() {\n      this.removeAttributeNS(name.space, name.local);\n    }\n    function attrTween(b) {\n      return b == null ? attrNull : (b += \"\", function() {\n        var a = this.getAttribute(name), i;\n        return a !== b && (i = interpolate(a, b), function(t) {\n          this.setAttribute(name, i(t));\n        });\n      });\n    }\n    function attrTweenNS(b) {\n      return b == null ? attrNullNS : (b += \"\", function() {\n        var a = this.getAttributeNS(name.space, name.local), i;\n        return a !== b && (i = interpolate(a, b), function(t) {\n          this.setAttributeNS(name.space, name.local, i(t));\n        });\n      });\n    }\n    return d3_transition_tween(this, \"attr.\" + nameNS, value, name.local ? attrTweenNS : attrTween);\n  };\n  d3_transitionPrototype.attrTween = function(nameNS, tween) {\n    var name = d3.ns.qualify(nameNS);\n    function attrTween(d, i) {\n      var f = tween.call(this, d, i, this.getAttribute(name));\n      return f && function(t) {\n        this.setAttribute(name, f(t));\n      };\n    }\n    function attrTweenNS(d, i) {\n      var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));\n      return f && function(t) {\n        this.setAttributeNS(name.space, name.local, f(t));\n      };\n    }\n    return this.tween(\"attr.\" + nameNS, name.local ? attrTweenNS : attrTween);\n  };\n  d3_transitionPrototype.style = function(name, value, priority) {\n    var n = arguments.length;\n    if (n < 3) {\n      if (typeof name !== \"string\") {\n        if (n < 2) value = \"\";\n        for (priority in name) this.style(priority, name[priority], value);\n        return this;\n      }\n      priority = \"\";\n    }\n    function styleNull() {\n      this.style.removeProperty(name);\n    }\n    function styleString(b) {\n      return b == null ? styleNull : (b += \"\", function() {\n        var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i;\n        return a !== b && (i = d3_interpolate(a, b), function(t) {\n          this.style.setProperty(name, i(t), priority);\n        });\n      });\n    }\n    return d3_transition_tween(this, \"style.\" + name, value, styleString);\n  };\n  d3_transitionPrototype.styleTween = function(name, tween, priority) {\n    if (arguments.length < 3) priority = \"\";\n    function styleTween(d, i) {\n      var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));\n      return f && function(t) {\n        this.style.setProperty(name, f(t), priority);\n      };\n    }\n    return this.tween(\"style.\" + name, styleTween);\n  };\n  d3_transitionPrototype.text = function(value) {\n    return d3_transition_tween(this, \"text\", value, d3_transition_text);\n  };\n  function d3_transition_text(b) {\n    if (b == null) b = \"\";\n    return function() {\n      this.textContent = b;\n    };\n  }\n  d3_transitionPrototype.remove = function() {\n    var ns = this.namespace;\n    return this.each(\"end.transition\", function() {\n      var p;\n      if (this[ns].count < 2 && (p = this.parentNode)) p.removeChild(this);\n    });\n  };\n  d3_transitionPrototype.ease = function(value) {\n    var id = this.id, ns = this.namespace;\n    if (arguments.length < 1) return this.node()[ns][id].ease;\n    if (typeof value !== \"function\") value = d3.ease.apply(d3, arguments);\n    return d3_selection_each(this, function(node) {\n      node[ns][id].ease = value;\n    });\n  };\n  d3_transitionPrototype.delay = function(value) {\n    var id = this.id, ns = this.namespace;\n    if (arguments.length < 1) return this.node()[ns][id].delay;\n    return d3_selection_each(this, typeof value === \"function\" ? function(node, i, j) {\n      node[ns][id].delay = +value.call(node, node.__data__, i, j);\n    } : (value = +value, function(node) {\n      node[ns][id].delay = value;\n    }));\n  };\n  d3_transitionPrototype.duration = function(value) {\n    var id = this.id, ns = this.namespace;\n    if (arguments.length < 1) return this.node()[ns][id].duration;\n    return d3_selection_each(this, typeof value === \"function\" ? function(node, i, j) {\n      node[ns][id].duration = Math.max(1, value.call(node, node.__data__, i, j));\n    } : (value = Math.max(1, value), function(node) {\n      node[ns][id].duration = value;\n    }));\n  };\n  d3_transitionPrototype.each = function(type, listener) {\n    var id = this.id, ns = this.namespace;\n    if (arguments.length < 2) {\n      var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId;\n      try {\n        d3_transitionInheritId = id;\n        d3_selection_each(this, function(node, i, j) {\n          d3_transitionInherit = node[ns][id];\n          type.call(node, node.__data__, i, j);\n        });\n      } finally {\n        d3_transitionInherit = inherit;\n        d3_transitionInheritId = inheritId;\n      }\n    } else {\n      d3_selection_each(this, function(node) {\n        var transition = node[ns][id];\n        (transition.event || (transition.event = d3.dispatch(\"start\", \"end\", \"interrupt\"))).on(type, listener);\n      });\n    }\n    return this;\n  };\n  d3_transitionPrototype.transition = function() {\n    var id0 = this.id, id1 = ++d3_transitionId, ns = this.namespace, subgroups = [], subgroup, group, node, transition;\n    for (var j = 0, m = this.length; j < m; j++) {\n      subgroups.push(subgroup = []);\n      for (var group = this[j], i = 0, n = group.length; i < n; i++) {\n        if (node = group[i]) {\n          transition = node[ns][id0];\n          d3_transitionNode(node, i, ns, id1, {\n            time: transition.time,\n            ease: transition.ease,\n            delay: transition.delay + transition.duration,\n            duration: transition.duration\n          });\n        }\n        subgroup.push(node);\n      }\n    }\n    return d3_transition(subgroups, ns, id1);\n  };\n  function d3_transitionNamespace(name) {\n    return name == null ? \"__transition__\" : \"__transition_\" + name + \"__\";\n  }\n  function d3_transitionNode(node, i, ns, id, inherit) {\n    var lock = node[ns] || (node[ns] = {\n      active: 0,\n      count: 0\n    }), transition = lock[id], time, timer, duration, ease, tweens;\n    function schedule(elapsed) {\n      var delay = transition.delay;\n      timer.t = delay + time;\n      if (delay <= elapsed) return start(elapsed - delay);\n      timer.c = start;\n    }\n    function start(elapsed) {\n      var activeId = lock.active, active = lock[activeId];\n      if (active) {\n        active.timer.c = null;\n        active.timer.t = NaN;\n        --lock.count;\n        delete lock[activeId];\n        active.event && active.event.interrupt.call(node, node.__data__, active.index);\n      }\n      for (var cancelId in lock) {\n        if (+cancelId < id) {\n          var cancel = lock[cancelId];\n          cancel.timer.c = null;\n          cancel.timer.t = NaN;\n          --lock.count;\n          delete lock[cancelId];\n        }\n      }\n      timer.c = tick;\n      d3_timer(function() {\n        if (timer.c && tick(elapsed || 1)) {\n          timer.c = null;\n          timer.t = NaN;\n        }\n        return 1;\n      }, 0, time);\n      lock.active = id;\n      transition.event && transition.event.start.call(node, node.__data__, i);\n      tweens = [];\n      transition.tween.forEach(function(key, value) {\n        if (value = value.call(node, node.__data__, i)) {\n          tweens.push(value);\n        }\n      });\n      ease = transition.ease;\n      duration = transition.duration;\n    }\n    function tick(elapsed) {\n      var t = elapsed / duration, e = ease(t), n = tweens.length;\n      while (n > 0) {\n        tweens[--n].call(node, e);\n      }\n      if (t >= 1) {\n        transition.event && transition.event.end.call(node, node.__data__, i);\n        if (--lock.count) delete lock[id]; else delete node[ns];\n        return 1;\n      }\n    }\n    if (!transition) {\n      time = inherit.time;\n      timer = d3_timer(schedule, 0, time);\n      transition = lock[id] = {\n        tween: new d3_Map(),\n        time: time,\n        timer: timer,\n        delay: inherit.delay,\n        duration: inherit.duration,\n        ease: inherit.ease,\n        index: i\n      };\n      inherit = null;\n      ++lock.count;\n    }\n  }\n  d3.svg.axis = function() {\n    var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;\n    function axis(g) {\n      g.each(function() {\n        var g = d3.select(this);\n        var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();\n        var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(\".tick\").data(ticks, scale1), tickEnter = tick.enter().insert(\"g\", \".domain\").attr(\"class\", \"tick\").style(\"opacity\", ε), tickExit = d3.transition(tick.exit()).style(\"opacity\", ε).remove(), tickUpdate = d3.transition(tick.order()).style(\"opacity\", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform;\n        var range = d3_scaleRange(scale1), path = g.selectAll(\".domain\").data([ 0 ]), pathUpdate = (path.enter().append(\"path\").attr(\"class\", \"domain\"), \n        d3.transition(path));\n        tickEnter.append(\"line\");\n        tickEnter.append(\"text\");\n        var lineEnter = tickEnter.select(\"line\"), lineUpdate = tickUpdate.select(\"line\"), text = tick.select(\"text\").text(tickFormat), textEnter = tickEnter.select(\"text\"), textUpdate = tickUpdate.select(\"text\"), sign = orient === \"top\" || orient === \"left\" ? -1 : 1, x1, x2, y1, y2;\n        if (orient === \"bottom\" || orient === \"top\") {\n          tickTransform = d3_svg_axisX, x1 = \"x\", y1 = \"y\", x2 = \"x2\", y2 = \"y2\";\n          text.attr(\"dy\", sign < 0 ? \"0em\" : \".71em\").style(\"text-anchor\", \"middle\");\n          pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + sign * outerTickSize + \"V0H\" + range[1] + \"V\" + sign * outerTickSize);\n        } else {\n          tickTransform = d3_svg_axisY, x1 = \"y\", y1 = \"x\", x2 = \"y2\", y2 = \"x2\";\n          text.attr(\"dy\", \".32em\").style(\"text-anchor\", sign < 0 ? \"end\" : \"start\");\n          pathUpdate.attr(\"d\", \"M\" + sign * outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + sign * outerTickSize);\n        }\n        lineEnter.attr(y2, sign * innerTickSize);\n        textEnter.attr(y1, sign * tickSpacing);\n        lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize);\n        textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing);\n        if (scale1.rangeBand) {\n          var x = scale1, dx = x.rangeBand() / 2;\n          scale0 = scale1 = function(d) {\n            return x(d) + dx;\n          };\n        } else if (scale0.rangeBand) {\n          scale0 = scale1;\n        } else {\n          tickExit.call(tickTransform, scale1, scale0);\n        }\n        tickEnter.call(tickTransform, scale0, scale1);\n        tickUpdate.call(tickTransform, scale1, scale1);\n      });\n    }\n    axis.scale = function(x) {\n      if (!arguments.length) return scale;\n      scale = x;\n      return axis;\n    };\n    axis.orient = function(x) {\n      if (!arguments.length) return orient;\n      orient = x in d3_svg_axisOrients ? x + \"\" : d3_svg_axisDefaultOrient;\n      return axis;\n    };\n    axis.ticks = function() {\n      if (!arguments.length) return tickArguments_;\n      tickArguments_ = d3_array(arguments);\n      return axis;\n    };\n    axis.tickValues = function(x) {\n      if (!arguments.length) return tickValues;\n      tickValues = x;\n      return axis;\n    };\n    axis.tickFormat = function(x) {\n      if (!arguments.length) return tickFormat_;\n      tickFormat_ = x;\n      return axis;\n    };\n    axis.tickSize = function(x) {\n      var n = arguments.length;\n      if (!n) return innerTickSize;\n      innerTickSize = +x;\n      outerTickSize = +arguments[n - 1];\n      return axis;\n    };\n    axis.innerTickSize = function(x) {\n      if (!arguments.length) return innerTickSize;\n      innerTickSize = +x;\n      return axis;\n    };\n    axis.outerTickSize = function(x) {\n      if (!arguments.length) return outerTickSize;\n      outerTickSize = +x;\n      return axis;\n    };\n    axis.tickPadding = function(x) {\n      if (!arguments.length) return tickPadding;\n      tickPadding = +x;\n      return axis;\n    };\n    axis.tickSubdivide = function() {\n      return arguments.length && axis;\n    };\n    return axis;\n  };\n  var d3_svg_axisDefaultOrient = \"bottom\", d3_svg_axisOrients = {\n    top: 1,\n    right: 1,\n    bottom: 1,\n    left: 1\n  };\n  function d3_svg_axisX(selection, x0, x1) {\n    selection.attr(\"transform\", function(d) {\n      var v0 = x0(d);\n      return \"translate(\" + (isFinite(v0) ? v0 : x1(d)) + \",0)\";\n    });\n  }\n  function d3_svg_axisY(selection, y0, y1) {\n    selection.attr(\"transform\", function(d) {\n      var v0 = y0(d);\n      return \"translate(0,\" + (isFinite(v0) ? v0 : y1(d)) + \")\";\n    });\n  }\n  d3.svg.brush = function() {\n    var event = d3_eventDispatch(brush, \"brushstart\", \"brush\", \"brushend\"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0];\n    function brush(g) {\n      g.each(function() {\n        var g = d3.select(this).style(\"pointer-events\", \"all\").style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\").on(\"mousedown.brush\", brushstart).on(\"touchstart.brush\", brushstart);\n        var background = g.selectAll(\".background\").data([ 0 ]);\n        background.enter().append(\"rect\").attr(\"class\", \"background\").style(\"visibility\", \"hidden\").style(\"cursor\", \"crosshair\");\n        g.selectAll(\".extent\").data([ 0 ]).enter().append(\"rect\").attr(\"class\", \"extent\").style(\"cursor\", \"move\");\n        var resize = g.selectAll(\".resize\").data(resizes, d3_identity);\n        resize.exit().remove();\n        resize.enter().append(\"g\").attr(\"class\", function(d) {\n          return \"resize \" + d;\n        }).style(\"cursor\", function(d) {\n          return d3_svg_brushCursor[d];\n        }).append(\"rect\").attr(\"x\", function(d) {\n          return /[ew]$/.test(d) ? -3 : null;\n        }).attr(\"y\", function(d) {\n          return /^[ns]/.test(d) ? -3 : null;\n        }).attr(\"width\", 6).attr(\"height\", 6).style(\"visibility\", \"hidden\");\n        resize.style(\"display\", brush.empty() ? \"none\" : null);\n        var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range;\n        if (x) {\n          range = d3_scaleRange(x);\n          backgroundUpdate.attr(\"x\", range[0]).attr(\"width\", range[1] - range[0]);\n          redrawX(gUpdate);\n        }\n        if (y) {\n          range = d3_scaleRange(y);\n          backgroundUpdate.attr(\"y\", range[0]).attr(\"height\", range[1] - range[0]);\n          redrawY(gUpdate);\n        }\n        redraw(gUpdate);\n      });\n    }\n    brush.event = function(g) {\n      g.each(function() {\n        var event_ = event.of(this, arguments), extent1 = {\n          x: xExtent,\n          y: yExtent,\n          i: xExtentDomain,\n          j: yExtentDomain\n        }, extent0 = this.__chart__ || extent1;\n        this.__chart__ = extent1;\n        if (d3_transitionInheritId) {\n          d3.select(this).transition().each(\"start.brush\", function() {\n            xExtentDomain = extent0.i;\n            yExtentDomain = extent0.j;\n            xExtent = extent0.x;\n            yExtent = extent0.y;\n            event_({\n              type: \"brushstart\"\n            });\n          }).tween(\"brush:brush\", function() {\n            var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);\n            xExtentDomain = yExtentDomain = null;\n            return function(t) {\n              xExtent = extent1.x = xi(t);\n              yExtent = extent1.y = yi(t);\n              event_({\n                type: \"brush\",\n                mode: \"resize\"\n              });\n            };\n          }).each(\"end.brush\", function() {\n            xExtentDomain = extent1.i;\n            yExtentDomain = extent1.j;\n            event_({\n              type: \"brush\",\n              mode: \"resize\"\n            });\n            event_({\n              type: \"brushend\"\n            });\n          });\n        } else {\n          event_({\n            type: \"brushstart\"\n          });\n          event_({\n            type: \"brush\",\n            mode: \"resize\"\n          });\n          event_({\n            type: \"brushend\"\n          });\n        }\n      });\n    };\n    function redraw(g) {\n      g.selectAll(\".resize\").attr(\"transform\", function(d) {\n        return \"translate(\" + xExtent[+/e$/.test(d)] + \",\" + yExtent[+/^s/.test(d)] + \")\";\n      });\n    }\n    function redrawX(g) {\n      g.select(\".extent\").attr(\"x\", xExtent[0]);\n      g.selectAll(\".extent,.n>rect,.s>rect\").attr(\"width\", xExtent[1] - xExtent[0]);\n    }\n    function redrawY(g) {\n      g.select(\".extent\").attr(\"y\", yExtent[0]);\n      g.selectAll(\".extent,.e>rect,.w>rect\").attr(\"height\", yExtent[1] - yExtent[0]);\n    }\n    function brushstart() {\n      var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed(\"extent\"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset;\n      var w = d3.select(d3_window(target)).on(\"keydown.brush\", keydown).on(\"keyup.brush\", keyup);\n      if (d3.event.changedTouches) {\n        w.on(\"touchmove.brush\", brushmove).on(\"touchend.brush\", brushend);\n      } else {\n        w.on(\"mousemove.brush\", brushmove).on(\"mouseup.brush\", brushend);\n      }\n      g.interrupt().selectAll(\"*\").interrupt();\n      if (dragging) {\n        origin[0] = xExtent[0] - origin[0];\n        origin[1] = yExtent[0] - origin[1];\n      } else if (resizing) {\n        var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing);\n        offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ];\n        origin[0] = xExtent[ex];\n        origin[1] = yExtent[ey];\n      } else if (d3.event.altKey) center = origin.slice();\n      g.style(\"pointer-events\", \"none\").selectAll(\".resize\").style(\"display\", null);\n      d3.select(\"body\").style(\"cursor\", eventTarget.style(\"cursor\"));\n      event_({\n        type: \"brushstart\"\n      });\n      brushmove();\n      function keydown() {\n        if (d3.event.keyCode == 32) {\n          if (!dragging) {\n            center = null;\n            origin[0] -= xExtent[1];\n            origin[1] -= yExtent[1];\n            dragging = 2;\n          }\n          d3_eventPreventDefault();\n        }\n      }\n      function keyup() {\n        if (d3.event.keyCode == 32 && dragging == 2) {\n          origin[0] += xExtent[1];\n          origin[1] += yExtent[1];\n          dragging = 0;\n          d3_eventPreventDefault();\n        }\n      }\n      function brushmove() {\n        var point = d3.mouse(target), moved = false;\n        if (offset) {\n          point[0] += offset[0];\n          point[1] += offset[1];\n        }\n        if (!dragging) {\n          if (d3.event.altKey) {\n            if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ];\n            origin[0] = xExtent[+(point[0] < center[0])];\n            origin[1] = yExtent[+(point[1] < center[1])];\n          } else center = null;\n        }\n        if (resizingX && move1(point, x, 0)) {\n          redrawX(g);\n          moved = true;\n        }\n        if (resizingY && move1(point, y, 1)) {\n          redrawY(g);\n          moved = true;\n        }\n        if (moved) {\n          redraw(g);\n          event_({\n            type: \"brush\",\n            mode: dragging ? \"move\" : \"resize\"\n          });\n        }\n      }\n      function move1(point, scale, i) {\n        var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max;\n        if (dragging) {\n          r0 -= position;\n          r1 -= size + position;\n        }\n        min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i];\n        if (dragging) {\n          max = (min += position) + size;\n        } else {\n          if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));\n          if (position < min) {\n            max = min;\n            min = position;\n          } else {\n            max = position;\n          }\n        }\n        if (extent[0] != min || extent[1] != max) {\n          if (i) yExtentDomain = null; else xExtentDomain = null;\n          extent[0] = min;\n          extent[1] = max;\n          return true;\n        }\n      }\n      function brushend() {\n        brushmove();\n        g.style(\"pointer-events\", \"all\").selectAll(\".resize\").style(\"display\", brush.empty() ? \"none\" : null);\n        d3.select(\"body\").style(\"cursor\", null);\n        w.on(\"mousemove.brush\", null).on(\"mouseup.brush\", null).on(\"touchmove.brush\", null).on(\"touchend.brush\", null).on(\"keydown.brush\", null).on(\"keyup.brush\", null);\n        dragRestore();\n        event_({\n          type: \"brushend\"\n        });\n      }\n    }\n    brush.x = function(z) {\n      if (!arguments.length) return x;\n      x = z;\n      resizes = d3_svg_brushResizes[!x << 1 | !y];\n      return brush;\n    };\n    brush.y = function(z) {\n      if (!arguments.length) return y;\n      y = z;\n      resizes = d3_svg_brushResizes[!x << 1 | !y];\n      return brush;\n    };\n    brush.clamp = function(z) {\n      if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null;\n      if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z;\n      return brush;\n    };\n    brush.extent = function(z) {\n      var x0, x1, y0, y1, t;\n      if (!arguments.length) {\n        if (x) {\n          if (xExtentDomain) {\n            x0 = xExtentDomain[0], x1 = xExtentDomain[1];\n          } else {\n            x0 = xExtent[0], x1 = xExtent[1];\n            if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1);\n            if (x1 < x0) t = x0, x0 = x1, x1 = t;\n          }\n        }\n        if (y) {\n          if (yExtentDomain) {\n            y0 = yExtentDomain[0], y1 = yExtentDomain[1];\n          } else {\n            y0 = yExtent[0], y1 = yExtent[1];\n            if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1);\n            if (y1 < y0) t = y0, y0 = y1, y1 = t;\n          }\n        }\n        return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ];\n      }\n      if (x) {\n        x0 = z[0], x1 = z[1];\n        if (y) x0 = x0[0], x1 = x1[0];\n        xExtentDomain = [ x0, x1 ];\n        if (x.invert) x0 = x(x0), x1 = x(x1);\n        if (x1 < x0) t = x0, x0 = x1, x1 = t;\n        if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];\n      }\n      if (y) {\n        y0 = z[0], y1 = z[1];\n        if (x) y0 = y0[1], y1 = y1[1];\n        yExtentDomain = [ y0, y1 ];\n        if (y.invert) y0 = y(y0), y1 = y(y1);\n        if (y1 < y0) t = y0, y0 = y1, y1 = t;\n        if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];\n      }\n      return brush;\n    };\n    brush.clear = function() {\n      if (!brush.empty()) {\n        xExtent = [ 0, 0 ], yExtent = [ 0, 0 ];\n        xExtentDomain = yExtentDomain = null;\n      }\n      return brush;\n    };\n    brush.empty = function() {\n      return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];\n    };\n    return d3.rebind(brush, event, \"on\");\n  };\n  var d3_svg_brushCursor = {\n    n: \"ns-resize\",\n    e: \"ew-resize\",\n    s: \"ns-resize\",\n    w: \"ew-resize\",\n    nw: \"nwse-resize\",\n    ne: \"nesw-resize\",\n    se: \"nwse-resize\",\n    sw: \"nesw-resize\"\n  };\n  var d3_svg_brushResizes = [ [ \"n\", \"e\", \"s\", \"w\", \"nw\", \"ne\", \"se\", \"sw\" ], [ \"e\", \"w\" ], [ \"n\", \"s\" ], [] ];\n  var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat;\n  var d3_time_formatUtc = d3_time_format.utc;\n  var d3_time_formatIso = d3_time_formatUtc(\"%Y-%m-%dT%H:%M:%S.%LZ\");\n  d3_time_format.iso = Date.prototype.toISOString && +new Date(\"2000-01-01T00:00:00.000Z\") ? d3_time_formatIsoNative : d3_time_formatIso;\n  function d3_time_formatIsoNative(date) {\n    return date.toISOString();\n  }\n  d3_time_formatIsoNative.parse = function(string) {\n    var date = new Date(string);\n    return isNaN(date) ? null : date;\n  };\n  d3_time_formatIsoNative.toString = d3_time_formatIso.toString;\n  d3_time.second = d3_time_interval(function(date) {\n    return new d3_date(Math.floor(date / 1e3) * 1e3);\n  }, function(date, offset) {\n    date.setTime(date.getTime() + Math.floor(offset) * 1e3);\n  }, function(date) {\n    return date.getSeconds();\n  });\n  d3_time.seconds = d3_time.second.range;\n  d3_time.seconds.utc = d3_time.second.utc.range;\n  d3_time.minute = d3_time_interval(function(date) {\n    return new d3_date(Math.floor(date / 6e4) * 6e4);\n  }, function(date, offset) {\n    date.setTime(date.getTime() + Math.floor(offset) * 6e4);\n  }, function(date) {\n    return date.getMinutes();\n  });\n  d3_time.minutes = d3_time.minute.range;\n  d3_time.minutes.utc = d3_time.minute.utc.range;\n  d3_time.hour = d3_time_interval(function(date) {\n    var timezone = date.getTimezoneOffset() / 60;\n    return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);\n  }, function(date, offset) {\n    date.setTime(date.getTime() + Math.floor(offset) * 36e5);\n  }, function(date) {\n    return date.getHours();\n  });\n  d3_time.hours = d3_time.hour.range;\n  d3_time.hours.utc = d3_time.hour.utc.range;\n  d3_time.month = d3_time_interval(function(date) {\n    date = d3_time.day(date);\n    date.setDate(1);\n    return date;\n  }, function(date, offset) {\n    date.setMonth(date.getMonth() + offset);\n  }, function(date) {\n    return date.getMonth();\n  });\n  d3_time.months = d3_time.month.range;\n  d3_time.months.utc = d3_time.month.utc.range;\n  function d3_time_scale(linear, methods, format) {\n    function scale(x) {\n      return linear(x);\n    }\n    scale.invert = function(x) {\n      return d3_time_scaleDate(linear.invert(x));\n    };\n    scale.domain = function(x) {\n      if (!arguments.length) return linear.domain().map(d3_time_scaleDate);\n      linear.domain(x);\n      return scale;\n    };\n    function tickMethod(extent, count) {\n      var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target);\n      return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) {\n        return d / 31536e6;\n      }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i];\n    }\n    scale.nice = function(interval, skip) {\n      var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === \"number\" && tickMethod(extent, interval);\n      if (method) interval = method[0], skip = method[1];\n      function skipped(date) {\n        return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length;\n      }\n      return scale.domain(d3_scale_nice(domain, skip > 1 ? {\n        floor: function(date) {\n          while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1);\n          return date;\n        },\n        ceil: function(date) {\n          while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1);\n          return date;\n        }\n      } : interval));\n    };\n    scale.ticks = function(interval, skip) {\n      var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === \"number\" ? tickMethod(extent, interval) : !interval.range && [ {\n        range: interval\n      }, skip ];\n      if (method) interval = method[0], skip = method[1];\n      return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip);\n    };\n    scale.tickFormat = function() {\n      return format;\n    };\n    scale.copy = function() {\n      return d3_time_scale(linear.copy(), methods, format);\n    };\n    return d3_scale_linearRebind(scale, linear);\n  }\n  function d3_time_scaleDate(t) {\n    return new Date(t);\n  }\n  var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];\n  var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ];\n  var d3_time_scaleLocalFormat = d3_time_format.multi([ [ \".%L\", function(d) {\n    return d.getMilliseconds();\n  } ], [ \":%S\", function(d) {\n    return d.getSeconds();\n  } ], [ \"%I:%M\", function(d) {\n    return d.getMinutes();\n  } ], [ \"%I %p\", function(d) {\n    return d.getHours();\n  } ], [ \"%a %d\", function(d) {\n    return d.getDay() && d.getDate() != 1;\n  } ], [ \"%b %d\", function(d) {\n    return d.getDate() != 1;\n  } ], [ \"%B\", function(d) {\n    return d.getMonth();\n  } ], [ \"%Y\", d3_true ] ]);\n  var d3_time_scaleMilliseconds = {\n    range: function(start, stop, step) {\n      return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);\n    },\n    floor: d3_identity,\n    ceil: d3_identity\n  };\n  d3_time_scaleLocalMethods.year = d3_time.year;\n  d3_time.scale = function() {\n    return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat);\n  };\n  var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) {\n    return [ m[0].utc, m[1] ];\n  });\n  var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ \".%L\", function(d) {\n    return d.getUTCMilliseconds();\n  } ], [ \":%S\", function(d) {\n    return d.getUTCSeconds();\n  } ], [ \"%I:%M\", function(d) {\n    return d.getUTCMinutes();\n  } ], [ \"%I %p\", function(d) {\n    return d.getUTCHours();\n  } ], [ \"%a %d\", function(d) {\n    return d.getUTCDay() && d.getUTCDate() != 1;\n  } ], [ \"%b %d\", function(d) {\n    return d.getUTCDate() != 1;\n  } ], [ \"%B\", function(d) {\n    return d.getUTCMonth();\n  } ], [ \"%Y\", d3_true ] ]);\n  d3_time_scaleUtcMethods.year = d3_time.year.utc;\n  d3_time.scale.utc = function() {\n    return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat);\n  };\n  d3.text = d3_xhrType(function(request) {\n    return request.responseText;\n  });\n  d3.json = function(url, callback) {\n    return d3_xhr(url, \"application/json\", d3_json, callback);\n  };\n  function d3_json(request) {\n    return JSON.parse(request.responseText);\n  }\n  d3.html = function(url, callback) {\n    return d3_xhr(url, \"text/html\", d3_html, callback);\n  };\n  function d3_html(request) {\n    var range = d3_document.createRange();\n    range.selectNode(d3_document.body);\n    return range.createContextualFragment(request.responseText);\n  }\n  d3.xml = d3_xhrType(function(request) {\n    return request.responseXML;\n  });\n  if (typeof define === \"function\" && define.amd) this.d3 = d3, define(d3); else if (typeof module === \"object\" && module.exports) module.exports = d3; else this.d3 = d3;\n}();\n},{}],17:[function(_dereq_,module,exports){\n(function (process,global){\n/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license   Licensed under MIT license\n *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version   v4.2.8+1e68dce6\n */\n\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n  var type = typeof x;\n  return x !== null && (type === 'object' || type === 'function');\n}\n\nfunction isFunction(x) {\n  return typeof x === 'function';\n}\n\n\n\nvar _isArray = void 0;\nif (Array.isArray) {\n  _isArray = Array.isArray;\n} else {\n  _isArray = function (x) {\n    return Object.prototype.toString.call(x) === '[object Array]';\n  };\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = void 0;\nvar customSchedulerFn = void 0;\n\nvar asap = function asap(callback, arg) {\n  queue[len] = callback;\n  queue[len + 1] = arg;\n  len += 2;\n  if (len === 2) {\n    // If len is 2, that means that we need to schedule an async flush.\n    // If additional callbacks are queued before the queue is flushed, they\n    // will be processed by this flush that we are scheduling.\n    if (customSchedulerFn) {\n      customSchedulerFn(flush);\n    } else {\n      scheduleFlush();\n    }\n  }\n};\n\nfunction setScheduler(scheduleFn) {\n  customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n  asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n  // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n  // see https://github.com/cujojs/when/issues/410 for details\n  return function () {\n    return process.nextTick(flush);\n  };\n}\n\n// vertx\nfunction useVertxTimer() {\n  if (typeof vertxNext !== 'undefined') {\n    return function () {\n      vertxNext(flush);\n    };\n  }\n\n  return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n  var iterations = 0;\n  var observer = new BrowserMutationObserver(flush);\n  var node = document.createTextNode('');\n  observer.observe(node, { characterData: true });\n\n  return function () {\n    node.data = iterations = ++iterations % 2;\n  };\n}\n\n// web worker\nfunction useMessageChannel() {\n  var channel = new MessageChannel();\n  channel.port1.onmessage = flush;\n  return function () {\n    return channel.port2.postMessage(0);\n  };\n}\n\nfunction useSetTimeout() {\n  // Store setTimeout reference so es6-promise will be unaffected by\n  // other code modifying setTimeout (like sinon.useFakeTimers())\n  var globalSetTimeout = setTimeout;\n  return function () {\n    return globalSetTimeout(flush, 1);\n  };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n  for (var i = 0; i < len; i += 2) {\n    var callback = queue[i];\n    var arg = queue[i + 1];\n\n    callback(arg);\n\n    queue[i] = undefined;\n    queue[i + 1] = undefined;\n  }\n\n  len = 0;\n}\n\nfunction attemptVertx() {\n  try {\n    var vertx = Function('return this')().require('vertx');\n    vertxNext = vertx.runOnLoop || vertx.runOnContext;\n    return useVertxTimer();\n  } catch (e) {\n    return useSetTimeout();\n  }\n}\n\nvar scheduleFlush = void 0;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n  scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n  scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n  scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof _dereq_ === 'function') {\n  scheduleFlush = attemptVertx();\n} else {\n  scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n  var parent = this;\n\n  var child = new this.constructor(noop);\n\n  if (child[PROMISE_ID] === undefined) {\n    makePromise(child);\n  }\n\n  var _state = parent._state;\n\n\n  if (_state) {\n    var callback = arguments[_state - 1];\n    asap(function () {\n      return invokeCallback(_state, child, callback, parent._result);\n    });\n  } else {\n    subscribe(parent, child, onFulfillment, onRejection);\n  }\n\n  return child;\n}\n\n/**\n  `Promise.resolve` returns a promise that will become resolved with the\n  passed `value`. It is shorthand for the following:\n\n  ```javascript\n  let promise = new Promise(function(resolve, reject){\n    resolve(1);\n  });\n\n  promise.then(function(value){\n    // value === 1\n  });\n  ```\n\n  Instead of writing the above, your code now simply becomes the following:\n\n  ```javascript\n  let promise = Promise.resolve(1);\n\n  promise.then(function(value){\n    // value === 1\n  });\n  ```\n\n  @method resolve\n  @static\n  @param {Any} value value that the returned promise will be resolved with\n  Useful for tooling.\n  @return {Promise} a promise that will become fulfilled with the given\n  `value`\n*/\nfunction resolve$1(object) {\n  /*jshint validthis:true */\n  var Constructor = this;\n\n  if (object && typeof object === 'object' && object.constructor === Constructor) {\n    return object;\n  }\n\n  var promise = new Constructor(noop);\n  resolve(promise, object);\n  return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(2);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nfunction selfFulfillment() {\n  return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n  return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n  try {\n    then$$1.call(value, fulfillmentHandler, rejectionHandler);\n  } catch (e) {\n    return e;\n  }\n}\n\nfunction handleForeignThenable(promise, thenable, then$$1) {\n  asap(function (promise) {\n    var sealed = false;\n    var error = tryThen(then$$1, thenable, function (value) {\n      if (sealed) {\n        return;\n      }\n      sealed = true;\n      if (thenable !== value) {\n        resolve(promise, value);\n      } else {\n        fulfill(promise, value);\n      }\n    }, function (reason) {\n      if (sealed) {\n        return;\n      }\n      sealed = true;\n\n      reject(promise, reason);\n    }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n    if (!sealed && error) {\n      sealed = true;\n      reject(promise, error);\n    }\n  }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n  if (thenable._state === FULFILLED) {\n    fulfill(promise, thenable._result);\n  } else if (thenable._state === REJECTED) {\n    reject(promise, thenable._result);\n  } else {\n    subscribe(thenable, undefined, function (value) {\n      return resolve(promise, value);\n    }, function (reason) {\n      return reject(promise, reason);\n    });\n  }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$1) {\n  if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {\n    handleOwnThenable(promise, maybeThenable);\n  } else {\n    if (then$$1 === undefined) {\n      fulfill(promise, maybeThenable);\n    } else if (isFunction(then$$1)) {\n      handleForeignThenable(promise, maybeThenable, then$$1);\n    } else {\n      fulfill(promise, maybeThenable);\n    }\n  }\n}\n\nfunction resolve(promise, value) {\n  if (promise === value) {\n    reject(promise, selfFulfillment());\n  } else if (objectOrFunction(value)) {\n    var then$$1 = void 0;\n    try {\n      then$$1 = value.then;\n    } catch (error) {\n      reject(promise, error);\n      return;\n    }\n    handleMaybeThenable(promise, value, then$$1);\n  } else {\n    fulfill(promise, value);\n  }\n}\n\nfunction publishRejection(promise) {\n  if (promise._onerror) {\n    promise._onerror(promise._result);\n  }\n\n  publish(promise);\n}\n\nfunction fulfill(promise, value) {\n  if (promise._state !== PENDING) {\n    return;\n  }\n\n  promise._result = value;\n  promise._state = FULFILLED;\n\n  if (promise._subscribers.length !== 0) {\n    asap(publish, promise);\n  }\n}\n\nfunction reject(promise, reason) {\n  if (promise._state !== PENDING) {\n    return;\n  }\n  promise._state = REJECTED;\n  promise._result = reason;\n\n  asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n  var _subscribers = parent._subscribers;\n  var length = _subscribers.length;\n\n\n  parent._onerror = null;\n\n  _subscribers[length] = child;\n  _subscribers[length + FULFILLED] = onFulfillment;\n  _subscribers[length + REJECTED] = onRejection;\n\n  if (length === 0 && parent._state) {\n    asap(publish, parent);\n  }\n}\n\nfunction publish(promise) {\n  var subscribers = promise._subscribers;\n  var settled = promise._state;\n\n  if (subscribers.length === 0) {\n    return;\n  }\n\n  var child = void 0,\n      callback = void 0,\n      detail = promise._result;\n\n  for (var i = 0; i < subscribers.length; i += 3) {\n    child = subscribers[i];\n    callback = subscribers[i + settled];\n\n    if (child) {\n      invokeCallback(settled, child, callback, detail);\n    } else {\n      callback(detail);\n    }\n  }\n\n  promise._subscribers.length = 0;\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n  var hasCallback = isFunction(callback),\n      value = void 0,\n      error = void 0,\n      succeeded = true;\n\n  if (hasCallback) {\n    try {\n      value = callback(detail);\n    } catch (e) {\n      succeeded = false;\n      error = e;\n    }\n\n    if (promise === value) {\n      reject(promise, cannotReturnOwn());\n      return;\n    }\n  } else {\n    value = detail;\n  }\n\n  if (promise._state !== PENDING) {\n    // noop\n  } else if (hasCallback && succeeded) {\n    resolve(promise, value);\n  } else if (succeeded === false) {\n    reject(promise, error);\n  } else if (settled === FULFILLED) {\n    fulfill(promise, value);\n  } else if (settled === REJECTED) {\n    reject(promise, value);\n  }\n}\n\nfunction initializePromise(promise, resolver) {\n  try {\n    resolver(function resolvePromise(value) {\n      resolve(promise, value);\n    }, function rejectPromise(reason) {\n      reject(promise, reason);\n    });\n  } catch (e) {\n    reject(promise, e);\n  }\n}\n\nvar id = 0;\nfunction nextId() {\n  return id++;\n}\n\nfunction makePromise(promise) {\n  promise[PROMISE_ID] = id++;\n  promise._state = undefined;\n  promise._result = undefined;\n  promise._subscribers = [];\n}\n\nfunction validationError() {\n  return new Error('Array Methods must be provided an Array');\n}\n\nvar Enumerator = function () {\n  function Enumerator(Constructor, input) {\n    this._instanceConstructor = Constructor;\n    this.promise = new Constructor(noop);\n\n    if (!this.promise[PROMISE_ID]) {\n      makePromise(this.promise);\n    }\n\n    if (isArray(input)) {\n      this.length = input.length;\n      this._remaining = input.length;\n\n      this._result = new Array(this.length);\n\n      if (this.length === 0) {\n        fulfill(this.promise, this._result);\n      } else {\n        this.length = this.length || 0;\n        this._enumerate(input);\n        if (this._remaining === 0) {\n          fulfill(this.promise, this._result);\n        }\n      }\n    } else {\n      reject(this.promise, validationError());\n    }\n  }\n\n  Enumerator.prototype._enumerate = function _enumerate(input) {\n    for (var i = 0; this._state === PENDING && i < input.length; i++) {\n      this._eachEntry(input[i], i);\n    }\n  };\n\n  Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n    var c = this._instanceConstructor;\n    var resolve$$1 = c.resolve;\n\n\n    if (resolve$$1 === resolve$1) {\n      var _then = void 0;\n      var error = void 0;\n      var didError = false;\n      try {\n        _then = entry.then;\n      } catch (e) {\n        didError = true;\n        error = e;\n      }\n\n      if (_then === then && entry._state !== PENDING) {\n        this._settledAt(entry._state, i, entry._result);\n      } else if (typeof _then !== 'function') {\n        this._remaining--;\n        this._result[i] = entry;\n      } else if (c === Promise$1) {\n        var promise = new c(noop);\n        if (didError) {\n          reject(promise, error);\n        } else {\n          handleMaybeThenable(promise, entry, _then);\n        }\n        this._willSettleAt(promise, i);\n      } else {\n        this._willSettleAt(new c(function (resolve$$1) {\n          return resolve$$1(entry);\n        }), i);\n      }\n    } else {\n      this._willSettleAt(resolve$$1(entry), i);\n    }\n  };\n\n  Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n    var promise = this.promise;\n\n\n    if (promise._state === PENDING) {\n      this._remaining--;\n\n      if (state === REJECTED) {\n        reject(promise, value);\n      } else {\n        this._result[i] = value;\n      }\n    }\n\n    if (this._remaining === 0) {\n      fulfill(promise, this._result);\n    }\n  };\n\n  Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n    var enumerator = this;\n\n    subscribe(promise, undefined, function (value) {\n      return enumerator._settledAt(FULFILLED, i, value);\n    }, function (reason) {\n      return enumerator._settledAt(REJECTED, i, reason);\n    });\n  };\n\n  return Enumerator;\n}();\n\n/**\n  `Promise.all` accepts an array of promises, and returns a new promise which\n  is fulfilled with an array of fulfillment values for the passed promises, or\n  rejected with the reason of the first passed promise to be rejected. It casts all\n  elements of the passed iterable to promises as it runs this algorithm.\n\n  Example:\n\n  ```javascript\n  let promise1 = resolve(1);\n  let promise2 = resolve(2);\n  let promise3 = resolve(3);\n  let promises = [ promise1, promise2, promise3 ];\n\n  Promise.all(promises).then(function(array){\n    // The array here would be [ 1, 2, 3 ];\n  });\n  ```\n\n  If any of the `promises` given to `all` are rejected, the first promise\n  that is rejected will be given as an argument to the returned promises's\n  rejection handler. For example:\n\n  Example:\n\n  ```javascript\n  let promise1 = resolve(1);\n  let promise2 = reject(new Error(\"2\"));\n  let promise3 = reject(new Error(\"3\"));\n  let promises = [ promise1, promise2, promise3 ];\n\n  Promise.all(promises).then(function(array){\n    // Code here never runs because there are rejected promises!\n  }, function(error) {\n    // error.message === \"2\"\n  });\n  ```\n\n  @method all\n  @static\n  @param {Array} entries array of promises\n  @param {String} label optional string for labeling the promise.\n  Useful for tooling.\n  @return {Promise} promise that is fulfilled when all `promises` have been\n  fulfilled, or rejected if any of them become rejected.\n  @static\n*/\nfunction all(entries) {\n  return new Enumerator(this, entries).promise;\n}\n\n/**\n  `Promise.race` returns a new promise which is settled in the same way as the\n  first passed promise to settle.\n\n  Example:\n\n  ```javascript\n  let promise1 = new Promise(function(resolve, reject){\n    setTimeout(function(){\n      resolve('promise 1');\n    }, 200);\n  });\n\n  let promise2 = new Promise(function(resolve, reject){\n    setTimeout(function(){\n      resolve('promise 2');\n    }, 100);\n  });\n\n  Promise.race([promise1, promise2]).then(function(result){\n    // result === 'promise 2' because it was resolved before promise1\n    // was resolved.\n  });\n  ```\n\n  `Promise.race` is deterministic in that only the state of the first\n  settled promise matters. For example, even if other promises given to the\n  `promises` array argument are resolved, but the first settled promise has\n  become rejected before the other promises became fulfilled, the returned\n  promise will become rejected:\n\n  ```javascript\n  let promise1 = new Promise(function(resolve, reject){\n    setTimeout(function(){\n      resolve('promise 1');\n    }, 200);\n  });\n\n  let promise2 = new Promise(function(resolve, reject){\n    setTimeout(function(){\n      reject(new Error('promise 2'));\n    }, 100);\n  });\n\n  Promise.race([promise1, promise2]).then(function(result){\n    // Code here never runs\n  }, function(reason){\n    // reason.message === 'promise 2' because promise 2 became rejected before\n    // promise 1 became fulfilled\n  });\n  ```\n\n  An example real-world use case is implementing timeouts:\n\n  ```javascript\n  Promise.race([ajax('foo.json'), timeout(5000)])\n  ```\n\n  @method race\n  @static\n  @param {Array} promises array of promises to observe\n  Useful for tooling.\n  @return {Promise} a promise which settles in the same way as the first passed\n  promise to settle.\n*/\nfunction race(entries) {\n  /*jshint validthis:true */\n  var Constructor = this;\n\n  if (!isArray(entries)) {\n    return new Constructor(function (_, reject) {\n      return reject(new TypeError('You must pass an array to race.'));\n    });\n  } else {\n    return new Constructor(function (resolve, reject) {\n      var length = entries.length;\n      for (var i = 0; i < length; i++) {\n        Constructor.resolve(entries[i]).then(resolve, reject);\n      }\n    });\n  }\n}\n\n/**\n  `Promise.reject` returns a promise rejected with the passed `reason`.\n  It is shorthand for the following:\n\n  ```javascript\n  let promise = new Promise(function(resolve, reject){\n    reject(new Error('WHOOPS'));\n  });\n\n  promise.then(function(value){\n    // Code here doesn't run because the promise is rejected!\n  }, function(reason){\n    // reason.message === 'WHOOPS'\n  });\n  ```\n\n  Instead of writing the above, your code now simply becomes the following:\n\n  ```javascript\n  let promise = Promise.reject(new Error('WHOOPS'));\n\n  promise.then(function(value){\n    // Code here doesn't run because the promise is rejected!\n  }, function(reason){\n    // reason.message === 'WHOOPS'\n  });\n  ```\n\n  @method reject\n  @static\n  @param {Any} reason value that the returned promise will be rejected with.\n  Useful for tooling.\n  @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject$1(reason) {\n  /*jshint validthis:true */\n  var Constructor = this;\n  var promise = new Constructor(noop);\n  reject(promise, reason);\n  return promise;\n}\n\nfunction needsResolver() {\n  throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n  throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n  Promise objects represent the eventual result of an asynchronous operation. The\n  primary way of interacting with a promise is through its `then` method, which\n  registers callbacks to receive either a promise's eventual value or the reason\n  why the promise cannot be fulfilled.\n\n  Terminology\n  -----------\n\n  - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n  - `thenable` is an object or function that defines a `then` method.\n  - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n  - `exception` is a value that is thrown using the throw statement.\n  - `reason` is a value that indicates why a promise was rejected.\n  - `settled` the final resting state of a promise, fulfilled or rejected.\n\n  A promise can be in one of three states: pending, fulfilled, or rejected.\n\n  Promises that are fulfilled have a fulfillment value and are in the fulfilled\n  state.  Promises that are rejected have a rejection reason and are in the\n  rejected state.  A fulfillment value is never a thenable.\n\n  Promises can also be said to *resolve* a value.  If this value is also a\n  promise, then the original promise's settled state will match the value's\n  settled state.  So a promise that *resolves* a promise that rejects will\n  itself reject, and a promise that *resolves* a promise that fulfills will\n  itself fulfill.\n\n\n  Basic Usage:\n  ------------\n\n  ```js\n  let promise = new Promise(function(resolve, reject) {\n    // on success\n    resolve(value);\n\n    // on failure\n    reject(reason);\n  });\n\n  promise.then(function(value) {\n    // on fulfillment\n  }, function(reason) {\n    // on rejection\n  });\n  ```\n\n  Advanced Usage:\n  ---------------\n\n  Promises shine when abstracting away asynchronous interactions such as\n  `XMLHttpRequest`s.\n\n  ```js\n  function getJSON(url) {\n    return new Promise(function(resolve, reject){\n      let xhr = new XMLHttpRequest();\n\n      xhr.open('GET', url);\n      xhr.onreadystatechange = handler;\n      xhr.responseType = 'json';\n      xhr.setRequestHeader('Accept', 'application/json');\n      xhr.send();\n\n      function handler() {\n        if (this.readyState === this.DONE) {\n          if (this.status === 200) {\n            resolve(this.response);\n          } else {\n            reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n          }\n        }\n      };\n    });\n  }\n\n  getJSON('/posts.json').then(function(json) {\n    // on fulfillment\n  }, function(reason) {\n    // on rejection\n  });\n  ```\n\n  Unlike callbacks, promises are great composable primitives.\n\n  ```js\n  Promise.all([\n    getJSON('/posts'),\n    getJSON('/comments')\n  ]).then(function(values){\n    values[0] // => postsJSON\n    values[1] // => commentsJSON\n\n    return values;\n  });\n  ```\n\n  @class Promise\n  @param {Function} resolver\n  Useful for tooling.\n  @constructor\n*/\n\nvar Promise$1 = function () {\n  function Promise(resolver) {\n    this[PROMISE_ID] = nextId();\n    this._result = this._state = undefined;\n    this._subscribers = [];\n\n    if (noop !== resolver) {\n      typeof resolver !== 'function' && needsResolver();\n      this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n    }\n  }\n\n  /**\n  The primary way of interacting with a promise is through its `then` method,\n  which registers callbacks to receive either a promise's eventual value or the\n  reason why the promise cannot be fulfilled.\n   ```js\n  findUser().then(function(user){\n    // user is available\n  }, function(reason){\n    // user is unavailable, and you are given the reason why\n  });\n  ```\n   Chaining\n  --------\n   The return value of `then` is itself a promise.  This second, 'downstream'\n  promise is resolved with the return value of the first promise's fulfillment\n  or rejection handler, or rejected if the handler throws an exception.\n   ```js\n  findUser().then(function (user) {\n    return user.name;\n  }, function (reason) {\n    return 'default name';\n  }).then(function (userName) {\n    // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n    // will be `'default name'`\n  });\n   findUser().then(function (user) {\n    throw new Error('Found user, but still unhappy');\n  }, function (reason) {\n    throw new Error('`findUser` rejected and we're unhappy');\n  }).then(function (value) {\n    // never reached\n  }, function (reason) {\n    // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n    // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n  });\n  ```\n  If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n   ```js\n  findUser().then(function (user) {\n    throw new PedagogicalException('Upstream error');\n  }).then(function (value) {\n    // never reached\n  }).then(function (value) {\n    // never reached\n  }, function (reason) {\n    // The `PedgagocialException` is propagated all the way down to here\n  });\n  ```\n   Assimilation\n  ------------\n   Sometimes the value you want to propagate to a downstream promise can only be\n  retrieved asynchronously. This can be achieved by returning a promise in the\n  fulfillment or rejection handler. The downstream promise will then be pending\n  until the returned promise is settled. This is called *assimilation*.\n   ```js\n  findUser().then(function (user) {\n    return findCommentsByAuthor(user);\n  }).then(function (comments) {\n    // The user's comments are now available\n  });\n  ```\n   If the assimliated promise rejects, then the downstream promise will also reject.\n   ```js\n  findUser().then(function (user) {\n    return findCommentsByAuthor(user);\n  }).then(function (comments) {\n    // If `findCommentsByAuthor` fulfills, we'll have the value here\n  }, function (reason) {\n    // If `findCommentsByAuthor` rejects, we'll have the reason here\n  });\n  ```\n   Simple Example\n  --------------\n   Synchronous Example\n   ```javascript\n  let result;\n   try {\n    result = findResult();\n    // success\n  } catch(reason) {\n    // failure\n  }\n  ```\n   Errback Example\n   ```js\n  findResult(function(result, err){\n    if (err) {\n      // failure\n    } else {\n      // success\n    }\n  });\n  ```\n   Promise Example;\n   ```javascript\n  findResult().then(function(result){\n    // success\n  }, function(reason){\n    // failure\n  });\n  ```\n   Advanced Example\n  --------------\n   Synchronous Example\n   ```javascript\n  let author, books;\n   try {\n    author = findAuthor();\n    books  = findBooksByAuthor(author);\n    // success\n  } catch(reason) {\n    // failure\n  }\n  ```\n   Errback Example\n   ```js\n   function foundBooks(books) {\n   }\n   function failure(reason) {\n   }\n   findAuthor(function(author, err){\n    if (err) {\n      failure(err);\n      // failure\n    } else {\n      try {\n        findBoooksByAuthor(author, function(books, err) {\n          if (err) {\n            failure(err);\n          } else {\n            try {\n              foundBooks(books);\n            } catch(reason) {\n              failure(reason);\n            }\n          }\n        });\n      } catch(error) {\n        failure(err);\n      }\n      // success\n    }\n  });\n  ```\n   Promise Example;\n   ```javascript\n  findAuthor().\n    then(findBooksByAuthor).\n    then(function(books){\n      // found books\n  }).catch(function(reason){\n    // something went wrong\n  });\n  ```\n   @method then\n  @param {Function} onFulfilled\n  @param {Function} onRejected\n  Useful for tooling.\n  @return {Promise}\n  */\n\n  /**\n  `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n  as the catch block of a try/catch statement.\n  ```js\n  function findAuthor(){\n  throw new Error('couldn't find that author');\n  }\n  // synchronous\n  try {\n  findAuthor();\n  } catch(reason) {\n  // something went wrong\n  }\n  // async with promises\n  findAuthor().catch(function(reason){\n  // something went wrong\n  });\n  ```\n  @method catch\n  @param {Function} onRejection\n  Useful for tooling.\n  @return {Promise}\n  */\n\n\n  Promise.prototype.catch = function _catch(onRejection) {\n    return this.then(null, onRejection);\n  };\n\n  /**\n    `finally` will be invoked regardless of the promise's fate just as native\n    try/catch/finally behaves\n  \n    Synchronous example:\n  \n    ```js\n    findAuthor() {\n      if (Math.random() > 0.5) {\n        throw new Error();\n      }\n      return new Author();\n    }\n  \n    try {\n      return findAuthor(); // succeed or fail\n    } catch(error) {\n      return findOtherAuther();\n    } finally {\n      // always runs\n      // doesn't affect the return value\n    }\n    ```\n  \n    Asynchronous example:\n  \n    ```js\n    findAuthor().catch(function(reason){\n      return findOtherAuther();\n    }).finally(function(){\n      // author was either found, or not\n    });\n    ```\n  \n    @method finally\n    @param {Function} callback\n    @return {Promise}\n  */\n\n\n  Promise.prototype.finally = function _finally(callback) {\n    var promise = this;\n    var constructor = promise.constructor;\n\n    if (isFunction(callback)) {\n      return promise.then(function (value) {\n        return constructor.resolve(callback()).then(function () {\n          return value;\n        });\n      }, function (reason) {\n        return constructor.resolve(callback()).then(function () {\n          throw reason;\n        });\n      });\n    }\n\n    return promise.then(callback, callback);\n  };\n\n  return Promise;\n}();\n\nPromise$1.prototype.then = then;\nPromise$1.all = all;\nPromise$1.race = race;\nPromise$1.resolve = resolve$1;\nPromise$1.reject = reject$1;\nPromise$1._setScheduler = setScheduler;\nPromise$1._setAsap = setAsap;\nPromise$1._asap = asap;\n\n/*global self*/\nfunction polyfill() {\n  var local = void 0;\n\n  if (typeof global !== 'undefined') {\n    local = global;\n  } else if (typeof self !== 'undefined') {\n    local = self;\n  } else {\n    try {\n      local = Function('return this')();\n    } catch (e) {\n      throw new Error('polyfill failed because global object is unavailable in this environment');\n    }\n  }\n\n  var P = local.Promise;\n\n  if (P) {\n    var promiseToString = null;\n    try {\n      promiseToString = Object.prototype.toString.call(P.resolve());\n    } catch (e) {\n      // silently ignored\n    }\n\n    if (promiseToString === '[object Promise]' && !P.cast) {\n      return;\n    }\n  }\n\n  local.Promise = Promise$1;\n}\n\n// Strange compat..\nPromise$1.polyfill = polyfill;\nPromise$1.Promise = Promise$1;\n\nreturn Promise$1;\n\n})));\n\n\n\n\n\n}).call(this,_dereq_('_process'),typeof __webpack_require__.g !== \"undefined\" ? __webpack_require__.g : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"_process\":34}],18:[function(_dereq_,module,exports){\n/**\n * inspired by is-number <https://github.com/jonschlinkert/is-number>\n * but significantly simplified and sped up by ignoring number and string constructors\n * ie these return false:\n *   new Number(1)\n *   new String('1')\n */\n\n'use strict';\n\nvar allBlankCharCodes = _dereq_('is-string-blank');\n\nmodule.exports = function(n) {\n    var type = typeof n;\n    if(type === 'string') {\n        var original = n;\n        n = +n;\n        // whitespace strings cast to zero - filter them out\n        if(n===0 && allBlankCharCodes(original)) return false;\n    }\n    else if(type !== 'number') return false;\n\n    return n - n < 1;\n};\n\n},{\"is-string-blank\":23}],19:[function(_dereq_,module,exports){\nmodule.exports = fromQuat;\n\n/**\n * Creates a matrix from a quaternion rotation.\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @returns {mat4} out\n */\nfunction fromQuat(out, q) {\n    var x = q[0], y = q[1], z = q[2], w = q[3],\n        x2 = x + x,\n        y2 = y + y,\n        z2 = z + z,\n\n        xx = x * x2,\n        yx = y * x2,\n        yy = y * y2,\n        zx = z * x2,\n        zy = z * y2,\n        zz = z * z2,\n        wx = w * x2,\n        wy = w * y2,\n        wz = w * z2;\n\n    out[0] = 1 - yy - zz;\n    out[1] = yx + wz;\n    out[2] = zx - wy;\n    out[3] = 0;\n\n    out[4] = yx - wz;\n    out[5] = 1 - xx - zz;\n    out[6] = zy + wx;\n    out[7] = 0;\n\n    out[8] = zx + wy;\n    out[9] = zy - wx;\n    out[10] = 1 - xx - yy;\n    out[11] = 0;\n\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n\n    return out;\n};\n},{}],20:[function(_dereq_,module,exports){\n(function (global){\n'use strict'\r\n\r\nvar isBrowser = _dereq_('is-browser')\r\nvar hasHover\r\n\r\nif (typeof global.matchMedia === 'function') {\r\n\thasHover = !global.matchMedia('(hover: none)').matches\r\n}\r\nelse {\r\n\thasHover = isBrowser\r\n}\r\n\r\nmodule.exports = hasHover\r\n\n}).call(this,typeof __webpack_require__.g !== \"undefined\" ? __webpack_require__.g : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"is-browser\":22}],21:[function(_dereq_,module,exports){\n'use strict'\r\n\r\nvar isBrowser = _dereq_('is-browser')\r\n\r\nfunction detect() {\r\n\tvar supported = false\r\n\r\n\ttry {\r\n\t\tvar opts = Object.defineProperty({}, 'passive', {\r\n\t\t\tget: function() {\r\n\t\t\t\tsupported = true\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\twindow.addEventListener('test', null, opts)\r\n\t\twindow.removeEventListener('test', null, opts)\r\n\t} catch(e) {\r\n\t\tsupported = false\r\n\t}\r\n\r\n\treturn supported\r\n}\r\n\r\nmodule.exports = isBrowser && detect()\r\n\n},{\"is-browser\":22}],22:[function(_dereq_,module,exports){\nmodule.exports = true;\n},{}],23:[function(_dereq_,module,exports){\n'use strict';\r\n\r\n/**\r\n * Is this string all whitespace?\r\n * This solution kind of makes my brain hurt, but it's significantly faster\r\n * than !str.trim() or any other solution I could find.\r\n *\r\n * whitespace codes from: http://en.wikipedia.org/wiki/Whitespace_character\r\n * and verified with:\r\n *\r\n *  for(var i = 0; i < 65536; i++) {\r\n *      var s = String.fromCharCode(i);\r\n *      if(+s===0 && !s.trim()) console.log(i, s);\r\n *  }\r\n *\r\n * which counts a couple of these as *not* whitespace, but finds nothing else\r\n * that *is* whitespace. Note that charCodeAt stops at 16 bits, but it appears\r\n * that there are no whitespace characters above this, and code points above\r\n * this do not map onto white space characters.\r\n */\r\n\r\nmodule.exports = function(str){\r\n    var l = str.length,\r\n        a;\r\n    for(var i = 0; i < l; i++) {\r\n        a = str.charCodeAt(i);\r\n        if((a < 9 || a > 13) && (a !== 32) && (a !== 133) && (a !== 160) &&\r\n            (a !== 5760) && (a !== 6158) && (a < 8192 || a > 8205) &&\r\n            (a !== 8232) && (a !== 8233) && (a !== 8239) && (a !== 8287) &&\r\n            (a !== 8288) && (a !== 12288) && (a !== 65279)) {\r\n                return false;\r\n        }\r\n    }\r\n    return true;\r\n}\r\n\n},{}],24:[function(_dereq_,module,exports){\nvar rootPosition = { left: 0, top: 0 }\n\nmodule.exports = mouseEventOffset\nfunction mouseEventOffset (ev, target, out) {\n  target = target || ev.currentTarget || ev.srcElement\n  if (!Array.isArray(out)) {\n    out = [ 0, 0 ]\n  }\n  var cx = ev.clientX || 0\n  var cy = ev.clientY || 0\n  var rect = getBoundingClientOffset(target)\n  out[0] = cx - rect.left\n  out[1] = cy - rect.top\n  return out\n}\n\nfunction getBoundingClientOffset (element) {\n  if (element === window ||\n      element === document ||\n      element === document.body) {\n    return rootPosition\n  } else {\n    return element.getBoundingClientRect()\n  }\n}\n\n},{}],25:[function(_dereq_,module,exports){\n\nmodule.exports = parse\n\n/**\n * expected argument lengths\n * @type {Object}\n */\n\nvar length = {a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0}\n\n/**\n * segment pattern\n * @type {RegExp}\n */\n\nvar segment = /([astvzqmhlc])([^astvzqmhlc]*)/ig\n\n/**\n * parse an svg path data string. Generates an Array\n * of commands where each command is an Array of the\n * form `[command, arg1, arg2, ...]`\n *\n * @param {String} path\n * @return {Array}\n */\n\nfunction parse(path) {\n\tvar data = []\n\tpath.replace(segment, function(_, command, args){\n\t\tvar type = command.toLowerCase()\n\t\targs = parseValues(args)\n\n\t\t// overloaded moveTo\n\t\tif (type == 'm' && args.length > 2) {\n\t\t\tdata.push([command].concat(args.splice(0, 2)))\n\t\t\ttype = 'l'\n\t\t\tcommand = command == 'm' ? 'l' : 'L'\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (args.length == length[type]) {\n\t\t\t\targs.unshift(command)\n\t\t\t\treturn data.push(args)\n\t\t\t}\n\t\t\tif (args.length < length[type]) throw new Error('malformed path data')\n\t\t\tdata.push([command].concat(args.splice(0, length[type])))\n\t\t}\n\t})\n\treturn data\n}\n\nvar number = /-?[0-9]*\\.?[0-9]+(?:e[-+]?\\d+)?/ig\n\nfunction parseValues(args) {\n\tvar numbers = args.match(number)\n\treturn numbers ? numbers.map(Number) : []\n}\n\n},{}],26:[function(_dereq_,module,exports){\n/*\n * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc\n * @license MIT\n * @preserve Project Home: https://github.com/voidqk/polybooljs\n */\n\nvar BuildLog = _dereq_('./lib/build-log');\nvar Epsilon = _dereq_('./lib/epsilon');\nvar Intersecter = _dereq_('./lib/intersecter');\nvar SegmentChainer = _dereq_('./lib/segment-chainer');\nvar SegmentSelector = _dereq_('./lib/segment-selector');\nvar GeoJSON = _dereq_('./lib/geojson');\n\nvar buildLog = false;\nvar epsilon = Epsilon();\n\nvar PolyBool;\nPolyBool = {\n\t// getter/setter for buildLog\n\tbuildLog: function(bl){\n\t\tif (bl === true)\n\t\t\tbuildLog = BuildLog();\n\t\telse if (bl === false)\n\t\t\tbuildLog = false;\n\t\treturn buildLog === false ? false : buildLog.list;\n\t},\n\t// getter/setter for epsilon\n\tepsilon: function(v){\n\t\treturn epsilon.epsilon(v);\n\t},\n\n\t// core API\n\tsegments: function(poly){\n\t\tvar i = Intersecter(true, epsilon, buildLog);\n\t\tpoly.regions.forEach(i.addRegion);\n\t\treturn {\n\t\t\tsegments: i.calculate(poly.inverted),\n\t\t\tinverted: poly.inverted\n\t\t};\n\t},\n\tcombine: function(segments1, segments2){\n\t\tvar i3 = Intersecter(false, epsilon, buildLog);\n\t\treturn {\n\t\t\tcombined: i3.calculate(\n\t\t\t\tsegments1.segments, segments1.inverted,\n\t\t\t\tsegments2.segments, segments2.inverted\n\t\t\t),\n\t\t\tinverted1: segments1.inverted,\n\t\t\tinverted2: segments2.inverted\n\t\t};\n\t},\n\tselectUnion: function(combined){\n\t\treturn {\n\t\t\tsegments: SegmentSelector.union(combined.combined, buildLog),\n\t\t\tinverted: combined.inverted1 || combined.inverted2\n\t\t}\n\t},\n\tselectIntersect: function(combined){\n\t\treturn {\n\t\t\tsegments: SegmentSelector.intersect(combined.combined, buildLog),\n\t\t\tinverted: combined.inverted1 && combined.inverted2\n\t\t}\n\t},\n\tselectDifference: function(combined){\n\t\treturn {\n\t\t\tsegments: SegmentSelector.difference(combined.combined, buildLog),\n\t\t\tinverted: combined.inverted1 && !combined.inverted2\n\t\t}\n\t},\n\tselectDifferenceRev: function(combined){\n\t\treturn {\n\t\t\tsegments: SegmentSelector.differenceRev(combined.combined, buildLog),\n\t\t\tinverted: !combined.inverted1 && combined.inverted2\n\t\t}\n\t},\n\tselectXor: function(combined){\n\t\treturn {\n\t\t\tsegments: SegmentSelector.xor(combined.combined, buildLog),\n\t\t\tinverted: combined.inverted1 !== combined.inverted2\n\t\t}\n\t},\n\tpolygon: function(segments){\n\t\treturn {\n\t\t\tregions: SegmentChainer(segments.segments, epsilon, buildLog),\n\t\t\tinverted: segments.inverted\n\t\t};\n\t},\n\n\t// GeoJSON converters\n\tpolygonFromGeoJSON: function(geojson){\n\t\treturn GeoJSON.toPolygon(PolyBool, geojson);\n\t},\n\tpolygonToGeoJSON: function(poly){\n\t\treturn GeoJSON.fromPolygon(PolyBool, epsilon, poly);\n\t},\n\n\t// helper functions for common operations\n\tunion: function(poly1, poly2){\n\t\treturn operate(poly1, poly2, PolyBool.selectUnion);\n\t},\n\tintersect: function(poly1, poly2){\n\t\treturn operate(poly1, poly2, PolyBool.selectIntersect);\n\t},\n\tdifference: function(poly1, poly2){\n\t\treturn operate(poly1, poly2, PolyBool.selectDifference);\n\t},\n\tdifferenceRev: function(poly1, poly2){\n\t\treturn operate(poly1, poly2, PolyBool.selectDifferenceRev);\n\t},\n\txor: function(poly1, poly2){\n\t\treturn operate(poly1, poly2, PolyBool.selectXor);\n\t}\n};\n\nfunction operate(poly1, poly2, selector){\n\tvar seg1 = PolyBool.segments(poly1);\n\tvar seg2 = PolyBool.segments(poly2);\n\tvar comb = PolyBool.combine(seg1, seg2);\n\tvar seg3 = selector(comb);\n\treturn PolyBool.polygon(seg3);\n}\n\nif (typeof window === 'object')\n\twindow.PolyBool = PolyBool;\n\nmodule.exports = PolyBool;\n\n},{\"./lib/build-log\":27,\"./lib/epsilon\":28,\"./lib/geojson\":29,\"./lib/intersecter\":30,\"./lib/segment-chainer\":32,\"./lib/segment-selector\":33}],27:[function(_dereq_,module,exports){\n// (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc\n// MIT License\n// Project Home: https://github.com/voidqk/polybooljs\n\n//\n// used strictly for logging the processing of the algorithm... only useful if you intend on\n// looking under the covers (for pretty UI's or debugging)\n//\n\nfunction BuildLog(){\n\tvar my;\n\tvar nextSegmentId = 0;\n\tvar curVert = false;\n\n\tfunction push(type, data){\n\t\tmy.list.push({\n\t\t\ttype: type,\n\t\t\tdata: data ? JSON.parse(JSON.stringify(data)) : void 0\n\t\t});\n\t\treturn my;\n\t}\n\n\tmy = {\n\t\tlist: [],\n\t\tsegmentId: function(){\n\t\t\treturn nextSegmentId++;\n\t\t},\n\t\tcheckIntersection: function(seg1, seg2){\n\t\t\treturn push('check', { seg1: seg1, seg2: seg2 });\n\t\t},\n\t\tsegmentChop: function(seg, end){\n\t\t\tpush('div_seg', { seg: seg, pt: end });\n\t\t\treturn push('chop', { seg: seg, pt: end });\n\t\t},\n\t\tstatusRemove: function(seg){\n\t\t\treturn push('pop_seg', { seg: seg });\n\t\t},\n\t\tsegmentUpdate: function(seg){\n\t\t\treturn push('seg_update', { seg: seg });\n\t\t},\n\t\tsegmentNew: function(seg, primary){\n\t\t\treturn push('new_seg', { seg: seg, primary: primary });\n\t\t},\n\t\tsegmentRemove: function(seg){\n\t\t\treturn push('rem_seg', { seg: seg });\n\t\t},\n\t\ttempStatus: function(seg, above, below){\n\t\t\treturn push('temp_status', { seg: seg, above: above, below: below });\n\t\t},\n\t\trewind: function(seg){\n\t\t\treturn push('rewind', { seg: seg });\n\t\t},\n\t\tstatus: function(seg, above, below){\n\t\t\treturn push('status', { seg: seg, above: above, below: below });\n\t\t},\n\t\tvert: function(x){\n\t\t\tif (x === curVert)\n\t\t\t\treturn my;\n\t\t\tcurVert = x;\n\t\t\treturn push('vert', { x: x });\n\t\t},\n\t\tlog: function(data){\n\t\t\tif (typeof data !== 'string')\n\t\t\t\tdata = JSON.stringify(data, false, '  ');\n\t\t\treturn push('log', { txt: data });\n\t\t},\n\t\treset: function(){\n\t\t\treturn push('reset');\n\t\t},\n\t\tselected: function(segs){\n\t\t\treturn push('selected', { segs: segs });\n\t\t},\n\t\tchainStart: function(seg){\n\t\t\treturn push('chain_start', { seg: seg });\n\t\t},\n\t\tchainRemoveHead: function(index, pt){\n\t\t\treturn push('chain_rem_head', { index: index, pt: pt });\n\t\t},\n\t\tchainRemoveTail: function(index, pt){\n\t\t\treturn push('chain_rem_tail', { index: index, pt: pt });\n\t\t},\n\t\tchainNew: function(pt1, pt2){\n\t\t\treturn push('chain_new', { pt1: pt1, pt2: pt2 });\n\t\t},\n\t\tchainMatch: function(index){\n\t\t\treturn push('chain_match', { index: index });\n\t\t},\n\t\tchainClose: function(index){\n\t\t\treturn push('chain_close', { index: index });\n\t\t},\n\t\tchainAddHead: function(index, pt){\n\t\t\treturn push('chain_add_head', { index: index, pt: pt });\n\t\t},\n\t\tchainAddTail: function(index, pt){\n\t\t\treturn push('chain_add_tail', { index: index, pt: pt, });\n\t\t},\n\t\tchainConnect: function(index1, index2){\n\t\t\treturn push('chain_con', { index1: index1, index2: index2 });\n\t\t},\n\t\tchainReverse: function(index){\n\t\t\treturn push('chain_rev', { index: index });\n\t\t},\n\t\tchainJoin: function(index1, index2){\n\t\t\treturn push('chain_join', { index1: index1, index2: index2 });\n\t\t},\n\t\tdone: function(){\n\t\t\treturn push('done');\n\t\t}\n\t};\n\treturn my;\n}\n\nmodule.exports = BuildLog;\n\n},{}],28:[function(_dereq_,module,exports){\n// (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc\n// MIT License\n// Project Home: https://github.com/voidqk/polybooljs\n\n//\n// provides the raw computation functions that takes epsilon into account\n//\n// zero is defined to be between (-epsilon, epsilon) exclusive\n//\n\nfunction Epsilon(eps){\n\tif (typeof eps !== 'number')\n\t\teps = 0.0000000001; // sane default? sure why not\n\tvar my = {\n\t\tepsilon: function(v){\n\t\t\tif (typeof v === 'number')\n\t\t\t\teps = v;\n\t\t\treturn eps;\n\t\t},\n\t\tpointAboveOrOnLine: function(pt, left, right){\n\t\t\tvar Ax = left[0];\n\t\t\tvar Ay = left[1];\n\t\t\tvar Bx = right[0];\n\t\t\tvar By = right[1];\n\t\t\tvar Cx = pt[0];\n\t\t\tvar Cy = pt[1];\n\t\t\treturn (Bx - Ax) * (Cy - Ay) - (By - Ay) * (Cx - Ax) >= -eps;\n\t\t},\n\t\tpointBetween: function(p, left, right){\n\t\t\t// p must be collinear with left->right\n\t\t\t// returns false if p == left, p == right, or left == right\n\t\t\tvar d_py_ly = p[1] - left[1];\n\t\t\tvar d_rx_lx = right[0] - left[0];\n\t\t\tvar d_px_lx = p[0] - left[0];\n\t\t\tvar d_ry_ly = right[1] - left[1];\n\n\t\t\tvar dot = d_px_lx * d_rx_lx + d_py_ly * d_ry_ly;\n\t\t\t// if `dot` is 0, then `p` == `left` or `left` == `right` (reject)\n\t\t\t// if `dot` is less than 0, then `p` is to the left of `left` (reject)\n\t\t\tif (dot < eps)\n\t\t\t\treturn false;\n\n\t\t\tvar sqlen = d_rx_lx * d_rx_lx + d_ry_ly * d_ry_ly;\n\t\t\t// if `dot` > `sqlen`, then `p` is to the right of `right` (reject)\n\t\t\t// therefore, if `dot - sqlen` is greater than 0, then `p` is to the right of `right` (reject)\n\t\t\tif (dot - sqlen > -eps)\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t},\n\t\tpointsSameX: function(p1, p2){\n\t\t\treturn Math.abs(p1[0] - p2[0]) < eps;\n\t\t},\n\t\tpointsSameY: function(p1, p2){\n\t\t\treturn Math.abs(p1[1] - p2[1]) < eps;\n\t\t},\n\t\tpointsSame: function(p1, p2){\n\t\t\treturn my.pointsSameX(p1, p2) && my.pointsSameY(p1, p2);\n\t\t},\n\t\tpointsCompare: function(p1, p2){\n\t\t\t// returns -1 if p1 is smaller, 1 if p2 is smaller, 0 if equal\n\t\t\tif (my.pointsSameX(p1, p2))\n\t\t\t\treturn my.pointsSameY(p1, p2) ? 0 : (p1[1] < p2[1] ? -1 : 1);\n\t\t\treturn p1[0] < p2[0] ? -1 : 1;\n\t\t},\n\t\tpointsCollinear: function(pt1, pt2, pt3){\n\t\t\t// does pt1->pt2->pt3 make a straight line?\n\t\t\t// essentially this is just checking to see if the slope(pt1->pt2) === slope(pt2->pt3)\n\t\t\t// if slopes are equal, then they must be collinear, because they share pt2\n\t\t\tvar dx1 = pt1[0] - pt2[0];\n\t\t\tvar dy1 = pt1[1] - pt2[1];\n\t\t\tvar dx2 = pt2[0] - pt3[0];\n\t\t\tvar dy2 = pt2[1] - pt3[1];\n\t\t\treturn Math.abs(dx1 * dy2 - dx2 * dy1) < eps;\n\t\t},\n\t\tlinesIntersect: function(a0, a1, b0, b1){\n\t\t\t// returns false if the lines are coincident (e.g., parallel or on top of each other)\n\t\t\t//\n\t\t\t// returns an object if the lines intersect:\n\t\t\t//   {\n\t\t\t//     pt: [x, y],    where the intersection point is at\n\t\t\t//     alongA: where intersection point is along A,\n\t\t\t//     alongB: where intersection point is along B\n\t\t\t//   }\n\t\t\t//\n\t\t\t//  alongA and alongB will each be one of: -2, -1, 0, 1, 2\n\t\t\t//\n\t\t\t//  with the following meaning:\n\t\t\t//\n\t\t\t//    -2   intersection point is before segment's first point\n\t\t\t//    -1   intersection point is directly on segment's first point\n\t\t\t//     0   intersection point is between segment's first and second points (exclusive)\n\t\t\t//     1   intersection point is directly on segment's second point\n\t\t\t//     2   intersection point is after segment's second point\n\t\t\tvar adx = a1[0] - a0[0];\n\t\t\tvar ady = a1[1] - a0[1];\n\t\t\tvar bdx = b1[0] - b0[0];\n\t\t\tvar bdy = b1[1] - b0[1];\n\n\t\t\tvar axb = adx * bdy - ady * bdx;\n\t\t\tif (Math.abs(axb) < eps)\n\t\t\t\treturn false; // lines are coincident\n\n\t\t\tvar dx = a0[0] - b0[0];\n\t\t\tvar dy = a0[1] - b0[1];\n\n\t\t\tvar A = (bdx * dy - bdy * dx) / axb;\n\t\t\tvar B = (adx * dy - ady * dx) / axb;\n\n\t\t\tvar ret = {\n\t\t\t\talongA: 0,\n\t\t\t\talongB: 0,\n\t\t\t\tpt: [\n\t\t\t\t\ta0[0] + A * adx,\n\t\t\t\t\ta0[1] + A * ady\n\t\t\t\t]\n\t\t\t};\n\n\t\t\t// categorize where intersection point is along A and B\n\n\t\t\tif (A <= -eps)\n\t\t\t\tret.alongA = -2;\n\t\t\telse if (A < eps)\n\t\t\t\tret.alongA = -1;\n\t\t\telse if (A - 1 <= -eps)\n\t\t\t\tret.alongA = 0;\n\t\t\telse if (A - 1 < eps)\n\t\t\t\tret.alongA = 1;\n\t\t\telse\n\t\t\t\tret.alongA = 2;\n\n\t\t\tif (B <= -eps)\n\t\t\t\tret.alongB = -2;\n\t\t\telse if (B < eps)\n\t\t\t\tret.alongB = -1;\n\t\t\telse if (B - 1 <= -eps)\n\t\t\t\tret.alongB = 0;\n\t\t\telse if (B - 1 < eps)\n\t\t\t\tret.alongB = 1;\n\t\t\telse\n\t\t\t\tret.alongB = 2;\n\n\t\t\treturn ret;\n\t\t},\n\t\tpointInsideRegion: function(pt, region){\n\t\t\tvar x = pt[0];\n\t\t\tvar y = pt[1];\n\t\t\tvar last_x = region[region.length - 1][0];\n\t\t\tvar last_y = region[region.length - 1][1];\n\t\t\tvar inside = false;\n\t\t\tfor (var i = 0; i < region.length; i++){\n\t\t\t\tvar curr_x = region[i][0];\n\t\t\t\tvar curr_y = region[i][1];\n\n\t\t\t\t// if y is between curr_y and last_y, and\n\t\t\t\t// x is to the right of the boundary created by the line\n\t\t\t\tif ((curr_y - y > eps) != (last_y - y > eps) &&\n\t\t\t\t\t(last_x - curr_x) * (y - curr_y) / (last_y - curr_y) + curr_x - x > eps)\n\t\t\t\t\tinside = !inside\n\n\t\t\t\tlast_x = curr_x;\n\t\t\t\tlast_y = curr_y;\n\t\t\t}\n\t\t\treturn inside;\n\t\t}\n\t};\n\treturn my;\n}\n\nmodule.exports = Epsilon;\n\n},{}],29:[function(_dereq_,module,exports){\n// (c) Copyright 2017, Sean Connelly (@voidqk), http://syntheti.cc\n// MIT License\n// Project Home: https://github.com/voidqk/polybooljs\n\n//\n// convert between PolyBool polygon format and GeoJSON formats (Polygon and MultiPolygon)\n//\n\nvar GeoJSON = {\n\t// convert a GeoJSON object to a PolyBool polygon\n\ttoPolygon: function(PolyBool, geojson){\n\n\t\t// converts list of LineString's to segments\n\t\tfunction GeoPoly(coords){\n\t\t\t// check for empty coords\n\t\t\tif (coords.length <= 0)\n\t\t\t\treturn PolyBool.segments({ inverted: false, regions: [] });\n\n\t\t\t// convert LineString to segments\n\t\t\tfunction LineString(ls){\n\t\t\t\t// remove tail which should be the same as head\n\t\t\t\tvar reg = ls.slice(0, ls.length - 1);\n\t\t\t\treturn PolyBool.segments({ inverted: false, regions: [reg] });\n\t\t\t}\n\n\t\t\t// the first LineString is considered the outside\n\t\t\tvar out = LineString(coords[0]);\n\n\t\t\t// the rest of the LineStrings are considered interior holes, so subtract them from the\n\t\t\t// current result\n\t\t\tfor (var i = 1; i < coords.length; i++)\n\t\t\t\tout = PolyBool.selectDifference(PolyBool.combine(out, LineString(coords[i])));\n\n\t\t\treturn out;\n\t\t}\n\n\t\tif (geojson.type === 'Polygon'){\n\t\t\t// single polygon, so just convert it and we're done\n\t\t\treturn PolyBool.polygon(GeoPoly(geojson.coordinates));\n\t\t}\n\t\telse if (geojson.type === 'MultiPolygon'){\n\t\t\t// multiple polygons, so union all the polygons together\n\t\t\tvar out = PolyBool.segments({ inverted: false, regions: [] });\n\t\t\tfor (var i = 0; i < geojson.coordinates.length; i++)\n\t\t\t\tout = PolyBool.selectUnion(PolyBool.combine(out, GeoPoly(geojson.coordinates[i])));\n\t\t\treturn PolyBool.polygon(out);\n\t\t}\n\t\tthrow new Error('PolyBool: Cannot convert GeoJSON object to PolyBool polygon');\n\t},\n\n\t// convert a PolyBool polygon to a GeoJSON object\n\tfromPolygon: function(PolyBool, eps, poly){\n\t\t// make sure out polygon is clean\n\t\tpoly = PolyBool.polygon(PolyBool.segments(poly));\n\n\t\t// test if r1 is inside r2\n\t\tfunction regionInsideRegion(r1, r2){\n\t\t\t// we're guaranteed no lines intersect (because the polygon is clean), but a vertex\n\t\t\t// could be on the edge -- so we just average pt[0] and pt[1] to produce a point on the\n\t\t\t// edge of the first line, which cannot be on an edge\n\t\t\treturn eps.pointInsideRegion([\n\t\t\t\t(r1[0][0] + r1[1][0]) * 0.5,\n\t\t\t\t(r1[0][1] + r1[1][1]) * 0.5\n\t\t\t], r2);\n\t\t}\n\n\t\t// calculate inside heirarchy\n\t\t//\n\t\t//  _____________________   _______    roots -> A       -> F\n\t\t// |          A          | |   F   |            |          |\n\t\t// |  _______   _______  | |  ___  |            +-- B      +-- G\n\t\t// | |   B   | |   C   | | | |   | |            |   |\n\t\t// | |  ___  | |  ___  | | | |   | |            |   +-- D\n\t\t// | | | D | | | | E | | | | | G | |            |\n\t\t// | | |___| | | |___| | | | |   | |            +-- C\n\t\t// | |_______| |_______| | | |___| |                |\n\t\t// |_____________________| |_______|                +-- E\n\n\t\tfunction newNode(region){\n\t\t\treturn {\n\t\t\t\tregion: region,\n\t\t\t\tchildren: []\n\t\t\t};\n\t\t}\n\n\t\tvar roots = newNode(null);\n\n\t\tfunction addChild(root, region){\n\t\t\t// first check if we're inside any children\n\t\t\tfor (var i = 0; i < root.children.length; i++){\n\t\t\t\tvar child = root.children[i];\n\t\t\t\tif (regionInsideRegion(region, child.region)){\n\t\t\t\t\t// we are, so insert inside them instead\n\t\t\t\t\taddChild(child, region);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// not inside any children, so check to see if any children are inside us\n\t\t\tvar node = newNode(region);\n\t\t\tfor (var i = 0; i < root.children.length; i++){\n\t\t\t\tvar child = root.children[i];\n\t\t\t\tif (regionInsideRegion(child.region, region)){\n\t\t\t\t\t// oops... move the child beneath us, and remove them from root\n\t\t\t\t\tnode.children.push(child);\n\t\t\t\t\troot.children.splice(i, 1);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// now we can add ourselves\n\t\t\troot.children.push(node);\n\t\t}\n\n\t\t// add all regions to the root\n\t\tfor (var i = 0; i < poly.regions.length; i++){\n\t\t\tvar region = poly.regions[i];\n\t\t\tif (region.length < 3) // regions must have at least 3 points (sanity check)\n\t\t\t\tcontinue;\n\t\t\taddChild(roots, region);\n\t\t}\n\n\t\t// with our heirarchy, we can distinguish between exterior borders, and interior holes\n\t\t// the root nodes are exterior, children are interior, children's children are exterior,\n\t\t// children's children's children are interior, etc\n\n\t\t// while we're at it, exteriors are counter-clockwise, and interiors are clockwise\n\n\t\tfunction forceWinding(region, clockwise){\n\t\t\t// first, see if we're clockwise or counter-clockwise\n\t\t\t// https://en.wikipedia.org/wiki/Shoelace_formula\n\t\t\tvar winding = 0;\n\t\t\tvar last_x = region[region.length - 1][0];\n\t\t\tvar last_y = region[region.length - 1][1];\n\t\t\tvar copy = [];\n\t\t\tfor (var i = 0; i < region.length; i++){\n\t\t\t\tvar curr_x = region[i][0];\n\t\t\t\tvar curr_y = region[i][1];\n\t\t\t\tcopy.push([curr_x, curr_y]); // create a copy while we're at it\n\t\t\t\twinding += curr_y * last_x - curr_x * last_y;\n\t\t\t\tlast_x = curr_x;\n\t\t\t\tlast_y = curr_y;\n\t\t\t}\n\t\t\t// this assumes Cartesian coordinates (Y is positive going up)\n\t\t\tvar isclockwise = winding < 0;\n\t\t\tif (isclockwise !== clockwise)\n\t\t\t\tcopy.reverse();\n\t\t\t// while we're here, the last point must be the first point...\n\t\t\tcopy.push([copy[0][0], copy[0][1]]);\n\t\t\treturn copy;\n\t\t}\n\n\t\tvar geopolys = [];\n\n\t\tfunction addExterior(node){\n\t\t\tvar poly = [forceWinding(node.region, false)];\n\t\t\tgeopolys.push(poly);\n\t\t\t// children of exteriors are interior\n\t\t\tfor (var i = 0; i < node.children.length; i++)\n\t\t\t\tpoly.push(getInterior(node.children[i]));\n\t\t}\n\n\t\tfunction getInterior(node){\n\t\t\t// children of interiors are exterior\n\t\t\tfor (var i = 0; i < node.children.length; i++)\n\t\t\t\taddExterior(node.children[i]);\n\t\t\t// return the clockwise interior\n\t\t\treturn forceWinding(node.region, true);\n\t\t}\n\n\t\t// root nodes are exterior\n\t\tfor (var i = 0; i < roots.children.length; i++)\n\t\t\taddExterior(roots.children[i]);\n\n\t\t// lastly, construct the approrpriate GeoJSON object\n\n\t\tif (geopolys.length <= 0) // empty GeoJSON Polygon\n\t\t\treturn { type: 'Polygon', coordinates: [] };\n\t\tif (geopolys.length == 1) // use a GeoJSON Polygon\n\t\t\treturn { type: 'Polygon', coordinates: geopolys[0] };\n\t\treturn { // otherwise, use a GeoJSON MultiPolygon\n\t\t\ttype: 'MultiPolygon',\n\t\t\tcoordinates: geopolys\n\t\t};\n\t}\n};\n\nmodule.exports = GeoJSON;\n\n},{}],30:[function(_dereq_,module,exports){\n// (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc\n// MIT License\n// Project Home: https://github.com/voidqk/polybooljs\n\n//\n// this is the core work-horse\n//\n\nvar LinkedList = _dereq_('./linked-list');\n\nfunction Intersecter(selfIntersection, eps, buildLog){\n\t// selfIntersection is true/false depending on the phase of the overall algorithm\n\n\t//\n\t// segment creation\n\t//\n\n\tfunction segmentNew(start, end){\n\t\treturn {\n\t\t\tid: buildLog ? buildLog.segmentId() : -1,\n\t\t\tstart: start,\n\t\t\tend: end,\n\t\t\tmyFill: {\n\t\t\t\tabove: null, // is there fill above us?\n\t\t\t\tbelow: null  // is there fill below us?\n\t\t\t},\n\t\t\totherFill: null\n\t\t};\n\t}\n\n\tfunction segmentCopy(start, end, seg){\n\t\treturn {\n\t\t\tid: buildLog ? buildLog.segmentId() : -1,\n\t\t\tstart: start,\n\t\t\tend: end,\n\t\t\tmyFill: {\n\t\t\t\tabove: seg.myFill.above,\n\t\t\t\tbelow: seg.myFill.below\n\t\t\t},\n\t\t\totherFill: null\n\t\t};\n\t}\n\n\t//\n\t// event logic\n\t//\n\n\tvar event_root = LinkedList.create();\n\n\tfunction eventCompare(p1_isStart, p1_1, p1_2, p2_isStart, p2_1, p2_2){\n\t\t// compare the selected points first\n\t\tvar comp = eps.pointsCompare(p1_1, p2_1);\n\t\tif (comp !== 0)\n\t\t\treturn comp;\n\t\t// the selected points are the same\n\n\t\tif (eps.pointsSame(p1_2, p2_2)) // if the non-selected points are the same too...\n\t\t\treturn 0; // then the segments are equal\n\n\t\tif (p1_isStart !== p2_isStart) // if one is a start and the other isn't...\n\t\t\treturn p1_isStart ? 1 : -1; // favor the one that isn't the start\n\n\t\t// otherwise, we'll have to calculate which one is below the other manually\n\t\treturn eps.pointAboveOrOnLine(p1_2,\n\t\t\tp2_isStart ? p2_1 : p2_2, // order matters\n\t\t\tp2_isStart ? p2_2 : p2_1\n\t\t) ? 1 : -1;\n\t}\n\n\tfunction eventAdd(ev, other_pt){\n\t\tevent_root.insertBefore(ev, function(here){\n\t\t\t// should ev be inserted before here?\n\t\t\tvar comp = eventCompare(\n\t\t\t\tev  .isStart, ev  .pt,      other_pt,\n\t\t\t\there.isStart, here.pt, here.other.pt\n\t\t\t);\n\t\t\treturn comp < 0;\n\t\t});\n\t}\n\n\tfunction eventAddSegmentStart(seg, primary){\n\t\tvar ev_start = LinkedList.node({\n\t\t\tisStart: true,\n\t\t\tpt: seg.start,\n\t\t\tseg: seg,\n\t\t\tprimary: primary,\n\t\t\tother: null,\n\t\t\tstatus: null\n\t\t});\n\t\teventAdd(ev_start, seg.end);\n\t\treturn ev_start;\n\t}\n\n\tfunction eventAddSegmentEnd(ev_start, seg, primary){\n\t\tvar ev_end = LinkedList.node({\n\t\t\tisStart: false,\n\t\t\tpt: seg.end,\n\t\t\tseg: seg,\n\t\t\tprimary: primary,\n\t\t\tother: ev_start,\n\t\t\tstatus: null\n\t\t});\n\t\tev_start.other = ev_end;\n\t\teventAdd(ev_end, ev_start.pt);\n\t}\n\n\tfunction eventAddSegment(seg, primary){\n\t\tvar ev_start = eventAddSegmentStart(seg, primary);\n\t\teventAddSegmentEnd(ev_start, seg, primary);\n\t\treturn ev_start;\n\t}\n\n\tfunction eventUpdateEnd(ev, end){\n\t\t// slides an end backwards\n\t\t//   (start)------------(end)    to:\n\t\t//   (start)---(end)\n\n\t\tif (buildLog)\n\t\t\tbuildLog.segmentChop(ev.seg, end);\n\n\t\tev.other.remove();\n\t\tev.seg.end = end;\n\t\tev.other.pt = end;\n\t\teventAdd(ev.other, ev.pt);\n\t}\n\n\tfunction eventDivide(ev, pt){\n\t\tvar ns = segmentCopy(pt, ev.seg.end, ev.seg);\n\t\teventUpdateEnd(ev, pt);\n\t\treturn eventAddSegment(ns, ev.primary);\n\t}\n\n\tfunction calculate(primaryPolyInverted, secondaryPolyInverted){\n\t\t// if selfIntersection is true then there is no secondary polygon, so that isn't used\n\n\t\t//\n\t\t// status logic\n\t\t//\n\n\t\tvar status_root = LinkedList.create();\n\n\t\tfunction statusCompare(ev1, ev2){\n\t\t\tvar a1 = ev1.seg.start;\n\t\t\tvar a2 = ev1.seg.end;\n\t\t\tvar b1 = ev2.seg.start;\n\t\t\tvar b2 = ev2.seg.end;\n\n\t\t\tif (eps.pointsCollinear(a1, b1, b2)){\n\t\t\t\tif (eps.pointsCollinear(a2, b1, b2))\n\t\t\t\t\treturn 1;//eventCompare(true, a1, a2, true, b1, b2);\n\t\t\t\treturn eps.pointAboveOrOnLine(a2, b1, b2) ? 1 : -1;\n\t\t\t}\n\t\t\treturn eps.pointAboveOrOnLine(a1, b1, b2) ? 1 : -1;\n\t\t}\n\n\t\tfunction statusFindSurrounding(ev){\n\t\t\treturn status_root.findTransition(function(here){\n\t\t\t\tvar comp = statusCompare(ev, here.ev);\n\t\t\t\treturn comp > 0;\n\t\t\t});\n\t\t}\n\n\t\tfunction checkIntersection(ev1, ev2){\n\t\t\t// returns the segment equal to ev1, or false if nothing equal\n\n\t\t\tvar seg1 = ev1.seg;\n\t\t\tvar seg2 = ev2.seg;\n\t\t\tvar a1 = seg1.start;\n\t\t\tvar a2 = seg1.end;\n\t\t\tvar b1 = seg2.start;\n\t\t\tvar b2 = seg2.end;\n\n\t\t\tif (buildLog)\n\t\t\t\tbuildLog.checkIntersection(seg1, seg2);\n\n\t\t\tvar i = eps.linesIntersect(a1, a2, b1, b2);\n\n\t\t\tif (i === false){\n\t\t\t\t// segments are parallel or coincident\n\n\t\t\t\t// if points aren't collinear, then the segments are parallel, so no intersections\n\t\t\t\tif (!eps.pointsCollinear(a1, a2, b1))\n\t\t\t\t\treturn false;\n\t\t\t\t// otherwise, segments are on top of each other somehow (aka coincident)\n\n\t\t\t\tif (eps.pointsSame(a1, b2) || eps.pointsSame(a2, b1))\n\t\t\t\t\treturn false; // segments touch at endpoints... no intersection\n\n\t\t\t\tvar a1_equ_b1 = eps.pointsSame(a1, b1);\n\t\t\t\tvar a2_equ_b2 = eps.pointsSame(a2, b2);\n\n\t\t\t\tif (a1_equ_b1 && a2_equ_b2)\n\t\t\t\t\treturn ev2; // segments are exactly equal\n\n\t\t\t\tvar a1_between = !a1_equ_b1 && eps.pointBetween(a1, b1, b2);\n\t\t\t\tvar a2_between = !a2_equ_b2 && eps.pointBetween(a2, b1, b2);\n\n\t\t\t\t// handy for debugging:\n\t\t\t\t// buildLog.log({\n\t\t\t\t//\ta1_equ_b1: a1_equ_b1,\n\t\t\t\t//\ta2_equ_b2: a2_equ_b2,\n\t\t\t\t//\ta1_between: a1_between,\n\t\t\t\t//\ta2_between: a2_between\n\t\t\t\t// });\n\n\t\t\t\tif (a1_equ_b1){\n\t\t\t\t\tif (a2_between){\n\t\t\t\t\t\t//  (a1)---(a2)\n\t\t\t\t\t\t//  (b1)----------(b2)\n\t\t\t\t\t\teventDivide(ev2, a2);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t//  (a1)----------(a2)\n\t\t\t\t\t\t//  (b1)---(b2)\n\t\t\t\t\t\teventDivide(ev1, b2);\n\t\t\t\t\t}\n\t\t\t\t\treturn ev2;\n\t\t\t\t}\n\t\t\t\telse if (a1_between){\n\t\t\t\t\tif (!a2_equ_b2){\n\t\t\t\t\t\t// make a2 equal to b2\n\t\t\t\t\t\tif (a2_between){\n\t\t\t\t\t\t\t//         (a1)---(a2)\n\t\t\t\t\t\t\t//  (b1)-----------------(b2)\n\t\t\t\t\t\t\teventDivide(ev2, a2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t//         (a1)----------(a2)\n\t\t\t\t\t\t\t//  (b1)----------(b2)\n\t\t\t\t\t\t\teventDivide(ev1, b2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//         (a1)---(a2)\n\t\t\t\t\t//  (b1)----------(b2)\n\t\t\t\t\teventDivide(ev2, a1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// otherwise, lines intersect at i.pt, which may or may not be between the endpoints\n\n\t\t\t\t// is A divided between its endpoints? (exclusive)\n\t\t\t\tif (i.alongA === 0){\n\t\t\t\t\tif (i.alongB === -1) // yes, at exactly b1\n\t\t\t\t\t\teventDivide(ev1, b1);\n\t\t\t\t\telse if (i.alongB === 0) // yes, somewhere between B's endpoints\n\t\t\t\t\t\teventDivide(ev1, i.pt);\n\t\t\t\t\telse if (i.alongB === 1) // yes, at exactly b2\n\t\t\t\t\t\teventDivide(ev1, b2);\n\t\t\t\t}\n\n\t\t\t\t// is B divided between its endpoints? (exclusive)\n\t\t\t\tif (i.alongB === 0){\n\t\t\t\t\tif (i.alongA === -1) // yes, at exactly a1\n\t\t\t\t\t\teventDivide(ev2, a1);\n\t\t\t\t\telse if (i.alongA === 0) // yes, somewhere between A's endpoints (exclusive)\n\t\t\t\t\t\teventDivide(ev2, i.pt);\n\t\t\t\t\telse if (i.alongA === 1) // yes, at exactly a2\n\t\t\t\t\t\teventDivide(ev2, a2);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t//\n\t\t// main event loop\n\t\t//\n\t\tvar segments = [];\n\t\twhile (!event_root.isEmpty()){\n\t\t\tvar ev = event_root.getHead();\n\n\t\t\tif (buildLog)\n\t\t\t\tbuildLog.vert(ev.pt[0]);\n\n\t\t\tif (ev.isStart){\n\n\t\t\t\tif (buildLog)\n\t\t\t\t\tbuildLog.segmentNew(ev.seg, ev.primary);\n\n\t\t\t\tvar surrounding = statusFindSurrounding(ev);\n\t\t\t\tvar above = surrounding.before ? surrounding.before.ev : null;\n\t\t\t\tvar below = surrounding.after ? surrounding.after.ev : null;\n\n\t\t\t\tif (buildLog){\n\t\t\t\t\tbuildLog.tempStatus(\n\t\t\t\t\t\tev.seg,\n\t\t\t\t\t\tabove ? above.seg : false,\n\t\t\t\t\t\tbelow ? below.seg : false\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfunction checkBothIntersections(){\n\t\t\t\t\tif (above){\n\t\t\t\t\t\tvar eve = checkIntersection(ev, above);\n\t\t\t\t\t\tif (eve)\n\t\t\t\t\t\t\treturn eve;\n\t\t\t\t\t}\n\t\t\t\t\tif (below)\n\t\t\t\t\t\treturn checkIntersection(ev, below);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar eve = checkBothIntersections();\n\t\t\t\tif (eve){\n\t\t\t\t\t// ev and eve are equal\n\t\t\t\t\t// we'll keep eve and throw away ev\n\n\t\t\t\t\t// merge ev.seg's fill information into eve.seg\n\n\t\t\t\t\tif (selfIntersection){\n\t\t\t\t\t\tvar toggle; // are we a toggling edge?\n\t\t\t\t\t\tif (ev.seg.myFill.below === null)\n\t\t\t\t\t\t\ttoggle = true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ttoggle = ev.seg.myFill.above !== ev.seg.myFill.below;\n\n\t\t\t\t\t\t// merge two segments that belong to the same polygon\n\t\t\t\t\t\t// think of this as sandwiching two segments together, where `eve.seg` is\n\t\t\t\t\t\t// the bottom -- this will cause the above fill flag to toggle\n\t\t\t\t\t\tif (toggle)\n\t\t\t\t\t\t\teve.seg.myFill.above = !eve.seg.myFill.above;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t// merge two segments that belong to different polygons\n\t\t\t\t\t\t// each segment has distinct knowledge, so no special logic is needed\n\t\t\t\t\t\t// note that this can only happen once per segment in this phase, because we\n\t\t\t\t\t\t// are guaranteed that all self-intersections are gone\n\t\t\t\t\t\teve.seg.otherFill = ev.seg.myFill;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (buildLog)\n\t\t\t\t\t\tbuildLog.segmentUpdate(eve.seg);\n\n\t\t\t\t\tev.other.remove();\n\t\t\t\t\tev.remove();\n\t\t\t\t}\n\n\t\t\t\tif (event_root.getHead() !== ev){\n\t\t\t\t\t// something was inserted before us in the event queue, so loop back around and\n\t\t\t\t\t// process it before continuing\n\t\t\t\t\tif (buildLog)\n\t\t\t\t\t\tbuildLog.rewind(ev.seg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// calculate fill flags\n\t\t\t\t//\n\t\t\t\tif (selfIntersection){\n\t\t\t\t\tvar toggle; // are we a toggling edge?\n\t\t\t\t\tif (ev.seg.myFill.below === null) // if we are a new segment...\n\t\t\t\t\t\ttoggle = true; // then we toggle\n\t\t\t\t\telse // we are a segment that has previous knowledge from a division\n\t\t\t\t\t\ttoggle = ev.seg.myFill.above !== ev.seg.myFill.below; // calculate toggle\n\n\t\t\t\t\t// next, calculate whether we are filled below us\n\t\t\t\t\tif (!below){ // if nothing is below us...\n\t\t\t\t\t\t// we are filled below us if the polygon is inverted\n\t\t\t\t\t\tev.seg.myFill.below = primaryPolyInverted;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t// otherwise, we know the answer -- it's the same if whatever is below\n\t\t\t\t\t\t// us is filled above it\n\t\t\t\t\t\tev.seg.myFill.below = below.seg.myFill.above;\n\t\t\t\t\t}\n\n\t\t\t\t\t// since now we know if we're filled below us, we can calculate whether\n\t\t\t\t\t// we're filled above us by applying toggle to whatever is below us\n\t\t\t\t\tif (toggle)\n\t\t\t\t\t\tev.seg.myFill.above = !ev.seg.myFill.below;\n\t\t\t\t\telse\n\t\t\t\t\t\tev.seg.myFill.above = ev.seg.myFill.below;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t// now we fill in any missing transition information, since we are all-knowing\n\t\t\t\t\t// at this point\n\n\t\t\t\t\tif (ev.seg.otherFill === null){\n\t\t\t\t\t\t// if we don't have other information, then we need to figure out if we're\n\t\t\t\t\t\t// inside the other polygon\n\t\t\t\t\t\tvar inside;\n\t\t\t\t\t\tif (!below){\n\t\t\t\t\t\t\t// if nothing is below us, then we're inside if the other polygon is\n\t\t\t\t\t\t\t// inverted\n\t\t\t\t\t\t\tinside =\n\t\t\t\t\t\t\t\tev.primary ? secondaryPolyInverted : primaryPolyInverted;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{ // otherwise, something is below us\n\t\t\t\t\t\t\t// so copy the below segment's other polygon's above\n\t\t\t\t\t\t\tif (ev.primary === below.primary)\n\t\t\t\t\t\t\t\tinside = below.seg.otherFill.above;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tinside = below.seg.myFill.above;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tev.seg.otherFill = {\n\t\t\t\t\t\t\tabove: inside,\n\t\t\t\t\t\t\tbelow: inside\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (buildLog){\n\t\t\t\t\tbuildLog.status(\n\t\t\t\t\t\tev.seg,\n\t\t\t\t\t\tabove ? above.seg : false,\n\t\t\t\t\t\tbelow ? below.seg : false\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// insert the status and remember it for later removal\n\t\t\t\tev.other.status = surrounding.insert(LinkedList.node({ ev: ev }));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tvar st = ev.status;\n\n\t\t\t\tif (st === null){\n\t\t\t\t\tthrow new Error('PolyBool: Zero-length segment detected; your epsilon is ' +\n\t\t\t\t\t\t'probably too small or too large');\n\t\t\t\t}\n\n\t\t\t\t// removing the status will create two new adjacent edges, so we'll need to check\n\t\t\t\t// for those\n\t\t\t\tif (status_root.exists(st.prev) && status_root.exists(st.next))\n\t\t\t\t\tcheckIntersection(st.prev.ev, st.next.ev);\n\n\t\t\t\tif (buildLog)\n\t\t\t\t\tbuildLog.statusRemove(st.ev.seg);\n\n\t\t\t\t// remove the status\n\t\t\t\tst.remove();\n\n\t\t\t\t// if we've reached this point, we've calculated everything there is to know, so\n\t\t\t\t// save the segment for reporting\n\t\t\t\tif (!ev.primary){\n\t\t\t\t\t// make sure `seg.myFill` actually points to the primary polygon though\n\t\t\t\t\tvar s = ev.seg.myFill;\n\t\t\t\t\tev.seg.myFill = ev.seg.otherFill;\n\t\t\t\t\tev.seg.otherFill = s;\n\t\t\t\t}\n\t\t\t\tsegments.push(ev.seg);\n\t\t\t}\n\n\t\t\t// remove the event and continue\n\t\t\tevent_root.getHead().remove();\n\t\t}\n\n\t\tif (buildLog)\n\t\t\tbuildLog.done();\n\n\t\treturn segments;\n\t}\n\n\t// return the appropriate API depending on what we're doing\n\tif (!selfIntersection){\n\t\t// performing combination of polygons, so only deal with already-processed segments\n\t\treturn {\n\t\t\tcalculate: function(segments1, inverted1, segments2, inverted2){\n\t\t\t\t// segmentsX come from the self-intersection API, or this API\n\t\t\t\t// invertedX is whether we treat that list of segments as an inverted polygon or not\n\t\t\t\t// returns segments that can be used for further operations\n\t\t\t\tsegments1.forEach(function(seg){\n\t\t\t\t\teventAddSegment(segmentCopy(seg.start, seg.end, seg), true);\n\t\t\t\t});\n\t\t\t\tsegments2.forEach(function(seg){\n\t\t\t\t\teventAddSegment(segmentCopy(seg.start, seg.end, seg), false);\n\t\t\t\t});\n\t\t\t\treturn calculate(inverted1, inverted2);\n\t\t\t}\n\t\t};\n\t}\n\n\t// otherwise, performing self-intersection, so deal with regions\n\treturn {\n\t\taddRegion: function(region){\n\t\t\t// regions are a list of points:\n\t\t\t//  [ [0, 0], [100, 0], [50, 100] ]\n\t\t\t// you can add multiple regions before running calculate\n\t\t\tvar pt1;\n\t\t\tvar pt2 = region[region.length - 1];\n\t\t\tfor (var i = 0; i < region.length; i++){\n\t\t\t\tpt1 = pt2;\n\t\t\t\tpt2 = region[i];\n\n\t\t\t\tvar forward = eps.pointsCompare(pt1, pt2);\n\t\t\t\tif (forward === 0) // points are equal, so we have a zero-length segment\n\t\t\t\t\tcontinue; // just skip it\n\n\t\t\t\teventAddSegment(\n\t\t\t\t\tsegmentNew(\n\t\t\t\t\t\tforward < 0 ? pt1 : pt2,\n\t\t\t\t\t\tforward < 0 ? pt2 : pt1\n\t\t\t\t\t),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\tcalculate: function(inverted){\n\t\t\t// is the polygon inverted?\n\t\t\t// returns segments\n\t\t\treturn calculate(inverted, false);\n\t\t}\n\t};\n}\n\nmodule.exports = Intersecter;\n\n},{\"./linked-list\":31}],31:[function(_dereq_,module,exports){\n// (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc\n// MIT License\n// Project Home: https://github.com/voidqk/polybooljs\n\n//\n// simple linked list implementation that allows you to traverse down nodes and save positions\n//\n\nvar LinkedList = {\n\tcreate: function(){\n\t\tvar my = {\n\t\t\troot: { root: true, next: null },\n\t\t\texists: function(node){\n\t\t\t\tif (node === null || node === my.root)\n\t\t\t\t\treturn false;\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tisEmpty: function(){\n\t\t\t\treturn my.root.next === null;\n\t\t\t},\n\t\t\tgetHead: function(){\n\t\t\t\treturn my.root.next;\n\t\t\t},\n\t\t\tinsertBefore: function(node, check){\n\t\t\t\tvar last = my.root;\n\t\t\t\tvar here = my.root.next;\n\t\t\t\twhile (here !== null){\n\t\t\t\t\tif (check(here)){\n\t\t\t\t\t\tnode.prev = here.prev;\n\t\t\t\t\t\tnode.next = here;\n\t\t\t\t\t\there.prev.next = node;\n\t\t\t\t\t\there.prev = node;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlast = here;\n\t\t\t\t\there = here.next;\n\t\t\t\t}\n\t\t\t\tlast.next = node;\n\t\t\t\tnode.prev = last;\n\t\t\t\tnode.next = null;\n\t\t\t},\n\t\t\tfindTransition: function(check){\n\t\t\t\tvar prev = my.root;\n\t\t\t\tvar here = my.root.next;\n\t\t\t\twhile (here !== null){\n\t\t\t\t\tif (check(here))\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tprev = here;\n\t\t\t\t\there = here.next;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tbefore: prev === my.root ? null : prev,\n\t\t\t\t\tafter: here,\n\t\t\t\t\tinsert: function(node){\n\t\t\t\t\t\tnode.prev = prev;\n\t\t\t\t\t\tnode.next = here;\n\t\t\t\t\t\tprev.next = node;\n\t\t\t\t\t\tif (here !== null)\n\t\t\t\t\t\t\there.prev = node;\n\t\t\t\t\t\treturn node;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t\treturn my;\n\t},\n\tnode: function(data){\n\t\tdata.prev = null;\n\t\tdata.next = null;\n\t\tdata.remove = function(){\n\t\t\tdata.prev.next = data.next;\n\t\t\tif (data.next)\n\t\t\t\tdata.next.prev = data.prev;\n\t\t\tdata.prev = null;\n\t\t\tdata.next = null;\n\t\t};\n\t\treturn data;\n\t}\n};\n\nmodule.exports = LinkedList;\n\n},{}],32:[function(_dereq_,module,exports){\n// (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc\n// MIT License\n// Project Home: https://github.com/voidqk/polybooljs\n\n//\n// converts a list of segments into a list of regions, while also removing unnecessary verticies\n//\n\nfunction SegmentChainer(segments, eps, buildLog){\n\tvar chains = [];\n\tvar regions = [];\n\n\tsegments.forEach(function(seg){\n\t\tvar pt1 = seg.start;\n\t\tvar pt2 = seg.end;\n\t\tif (eps.pointsSame(pt1, pt2)){\n\t\t\tconsole.warn('PolyBool: Warning: Zero-length segment detected; your epsilon is ' +\n\t\t\t\t'probably too small or too large');\n\t\t\treturn;\n\t\t}\n\n\t\tif (buildLog)\n\t\t\tbuildLog.chainStart(seg);\n\n\t\t// search for two chains that this segment matches\n\t\tvar first_match = {\n\t\t\tindex: 0,\n\t\t\tmatches_head: false,\n\t\t\tmatches_pt1: false\n\t\t};\n\t\tvar second_match = {\n\t\t\tindex: 0,\n\t\t\tmatches_head: false,\n\t\t\tmatches_pt1: false\n\t\t};\n\t\tvar next_match = first_match;\n\t\tfunction setMatch(index, matches_head, matches_pt1){\n\t\t\t// return true if we've matched twice\n\t\t\tnext_match.index = index;\n\t\t\tnext_match.matches_head = matches_head;\n\t\t\tnext_match.matches_pt1 = matches_pt1;\n\t\t\tif (next_match === first_match){\n\t\t\t\tnext_match = second_match;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tnext_match = null;\n\t\t\treturn true; // we've matched twice, we're done here\n\t\t}\n\t\tfor (var i = 0; i < chains.length; i++){\n\t\t\tvar chain = chains[i];\n\t\t\tvar head  = chain[0];\n\t\t\tvar head2 = chain[1];\n\t\t\tvar tail  = chain[chain.length - 1];\n\t\t\tvar tail2 = chain[chain.length - 2];\n\t\t\tif (eps.pointsSame(head, pt1)){\n\t\t\t\tif (setMatch(i, true, true))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (eps.pointsSame(head, pt2)){\n\t\t\t\tif (setMatch(i, true, false))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (eps.pointsSame(tail, pt1)){\n\t\t\t\tif (setMatch(i, false, true))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (eps.pointsSame(tail, pt2)){\n\t\t\t\tif (setMatch(i, false, false))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (next_match === first_match){\n\t\t\t// we didn't match anything, so create a new chain\n\t\t\tchains.push([ pt1, pt2 ]);\n\t\t\tif (buildLog)\n\t\t\t\tbuildLog.chainNew(pt1, pt2);\n\t\t\treturn;\n\t\t}\n\n\t\tif (next_match === second_match){\n\t\t\t// we matched a single chain\n\n\t\t\tif (buildLog)\n\t\t\t\tbuildLog.chainMatch(first_match.index);\n\n\t\t\t// add the other point to the apporpriate end, and check to see if we've closed the\n\t\t\t// chain into a loop\n\n\t\t\tvar index = first_match.index;\n\t\t\tvar pt = first_match.matches_pt1 ? pt2 : pt1; // if we matched pt1, then we add pt2, etc\n\t\t\tvar addToHead = first_match.matches_head; // if we matched at head, then add to the head\n\n\t\t\tvar chain = chains[index];\n\t\t\tvar grow  = addToHead ? chain[0] : chain[chain.length - 1];\n\t\t\tvar grow2 = addToHead ? chain[1] : chain[chain.length - 2];\n\t\t\tvar oppo  = addToHead ? chain[chain.length - 1] : chain[0];\n\t\t\tvar oppo2 = addToHead ? chain[chain.length - 2] : chain[1];\n\n\t\t\tif (eps.pointsCollinear(grow2, grow, pt)){\n\t\t\t\t// grow isn't needed because it's directly between grow2 and pt:\n\t\t\t\t// grow2 ---grow---> pt\n\t\t\t\tif (addToHead){\n\t\t\t\t\tif (buildLog)\n\t\t\t\t\t\tbuildLog.chainRemoveHead(first_match.index, pt);\n\t\t\t\t\tchain.shift();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif (buildLog)\n\t\t\t\t\t\tbuildLog.chainRemoveTail(first_match.index, pt);\n\t\t\t\t\tchain.pop();\n\t\t\t\t}\n\t\t\t\tgrow = grow2; // old grow is gone... new grow is what grow2 was\n\t\t\t}\n\n\t\t\tif (eps.pointsSame(oppo, pt)){\n\t\t\t\t// we're closing the loop, so remove chain from chains\n\t\t\t\tchains.splice(index, 1);\n\n\t\t\t\tif (eps.pointsCollinear(oppo2, oppo, grow)){\n\t\t\t\t\t// oppo isn't needed because it's directly between oppo2 and grow:\n\t\t\t\t\t// oppo2 ---oppo--->grow\n\t\t\t\t\tif (addToHead){\n\t\t\t\t\t\tif (buildLog)\n\t\t\t\t\t\t\tbuildLog.chainRemoveTail(first_match.index, grow);\n\t\t\t\t\t\tchain.pop();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif (buildLog)\n\t\t\t\t\t\t\tbuildLog.chainRemoveHead(first_match.index, grow);\n\t\t\t\t\t\tchain.shift();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (buildLog)\n\t\t\t\t\tbuildLog.chainClose(first_match.index);\n\n\t\t\t\t// we have a closed chain!\n\t\t\t\tregions.push(chain);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// not closing a loop, so just add it to the apporpriate side\n\t\t\tif (addToHead){\n\t\t\t\tif (buildLog)\n\t\t\t\t\tbuildLog.chainAddHead(first_match.index, pt);\n\t\t\t\tchain.unshift(pt);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (buildLog)\n\t\t\t\t\tbuildLog.chainAddTail(first_match.index, pt);\n\t\t\t\tchain.push(pt);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// otherwise, we matched two chains, so we need to combine those chains together\n\n\t\tfunction reverseChain(index){\n\t\t\tif (buildLog)\n\t\t\t\tbuildLog.chainReverse(index);\n\t\t\tchains[index].reverse(); // gee, that's easy\n\t\t}\n\n\t\tfunction appendChain(index1, index2){\n\t\t\t// index1 gets index2 appended to it, and index2 is removed\n\t\t\tvar chain1 = chains[index1];\n\t\t\tvar chain2 = chains[index2];\n\t\t\tvar tail  = chain1[chain1.length - 1];\n\t\t\tvar tail2 = chain1[chain1.length - 2];\n\t\t\tvar head  = chain2[0];\n\t\t\tvar head2 = chain2[1];\n\n\t\t\tif (eps.pointsCollinear(tail2, tail, head)){\n\t\t\t\t// tail isn't needed because it's directly between tail2 and head\n\t\t\t\t// tail2 ---tail---> head\n\t\t\t\tif (buildLog)\n\t\t\t\t\tbuildLog.chainRemoveTail(index1, tail);\n\t\t\t\tchain1.pop();\n\t\t\t\ttail = tail2; // old tail is gone... new tail is what tail2 was\n\t\t\t}\n\n\t\t\tif (eps.pointsCollinear(tail, head, head2)){\n\t\t\t\t// head isn't needed because it's directly between tail and head2\n\t\t\t\t// tail ---head---> head2\n\t\t\t\tif (buildLog)\n\t\t\t\t\tbuildLog.chainRemoveHead(index2, head);\n\t\t\t\tchain2.shift();\n\t\t\t}\n\n\t\t\tif (buildLog)\n\t\t\t\tbuildLog.chainJoin(index1, index2);\n\t\t\tchains[index1] = chain1.concat(chain2);\n\t\t\tchains.splice(index2, 1);\n\t\t}\n\n\t\tvar F = first_match.index;\n\t\tvar S = second_match.index;\n\n\t\tif (buildLog)\n\t\t\tbuildLog.chainConnect(F, S);\n\n\t\tvar reverseF = chains[F].length < chains[S].length; // reverse the shorter chain, if needed\n\t\tif (first_match.matches_head){\n\t\t\tif (second_match.matches_head){\n\t\t\t\tif (reverseF){\n\t\t\t\t\t// <<<< F <<<< --- >>>> S >>>>\n\t\t\t\t\treverseChain(F);\n\t\t\t\t\t// >>>> F >>>> --- >>>> S >>>>\n\t\t\t\t\tappendChain(F, S);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t// <<<< F <<<< --- >>>> S >>>>\n\t\t\t\t\treverseChain(S);\n\t\t\t\t\t// <<<< F <<<< --- <<<< S <<<<   logically same as:\n\t\t\t\t\t// >>>> S >>>> --- >>>> F >>>>\n\t\t\t\t\tappendChain(S, F);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// <<<< F <<<< --- <<<< S <<<<   logically same as:\n\t\t\t\t// >>>> S >>>> --- >>>> F >>>>\n\t\t\t\tappendChain(S, F);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif (second_match.matches_head){\n\t\t\t\t// >>>> F >>>> --- >>>> S >>>>\n\t\t\t\tappendChain(F, S);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (reverseF){\n\t\t\t\t\t// >>>> F >>>> --- <<<< S <<<<\n\t\t\t\t\treverseChain(F);\n\t\t\t\t\t// <<<< F <<<< --- <<<< S <<<<   logically same as:\n\t\t\t\t\t// >>>> S >>>> --- >>>> F >>>>\n\t\t\t\t\tappendChain(S, F);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t// >>>> F >>>> --- <<<< S <<<<\n\t\t\t\t\treverseChain(S);\n\t\t\t\t\t// >>>> F >>>> --- >>>> S >>>>\n\t\t\t\t\tappendChain(F, S);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn regions;\n}\n\nmodule.exports = SegmentChainer;\n\n},{}],33:[function(_dereq_,module,exports){\n// (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc\n// MIT License\n// Project Home: https://github.com/voidqk/polybooljs\n\n//\n// filter a list of segments based on boolean operations\n//\n\nfunction select(segments, selection, buildLog){\n\tvar result = [];\n\tsegments.forEach(function(seg){\n\t\tvar index =\n\t\t\t(seg.myFill.above ? 8 : 0) +\n\t\t\t(seg.myFill.below ? 4 : 0) +\n\t\t\t((seg.otherFill && seg.otherFill.above) ? 2 : 0) +\n\t\t\t((seg.otherFill && seg.otherFill.below) ? 1 : 0);\n\t\tif (selection[index] !== 0){\n\t\t\t// copy the segment to the results, while also calculating the fill status\n\t\t\tresult.push({\n\t\t\t\tid: buildLog ? buildLog.segmentId() : -1,\n\t\t\t\tstart: seg.start,\n\t\t\t\tend: seg.end,\n\t\t\t\tmyFill: {\n\t\t\t\t\tabove: selection[index] === 1, // 1 if filled above\n\t\t\t\t\tbelow: selection[index] === 2  // 2 if filled below\n\t\t\t\t},\n\t\t\t\totherFill: null\n\t\t\t});\n\t\t}\n\t});\n\n\tif (buildLog)\n\t\tbuildLog.selected(result);\n\n\treturn result;\n}\n\nvar SegmentSelector = {\n\tunion: function(segments, buildLog){ // primary | secondary\n\t\t// above1 below1 above2 below2    Keep?               Value\n\t\t//    0      0      0      0   =>   no                  0\n\t\t//    0      0      0      1   =>   yes filled below    2\n\t\t//    0      0      1      0   =>   yes filled above    1\n\t\t//    0      0      1      1   =>   no                  0\n\t\t//    0      1      0      0   =>   yes filled below    2\n\t\t//    0      1      0      1   =>   yes filled below    2\n\t\t//    0      1      1      0   =>   no                  0\n\t\t//    0      1      1      1   =>   no                  0\n\t\t//    1      0      0      0   =>   yes filled above    1\n\t\t//    1      0      0      1   =>   no                  0\n\t\t//    1      0      1      0   =>   yes filled above    1\n\t\t//    1      0      1      1   =>   no                  0\n\t\t//    1      1      0      0   =>   no                  0\n\t\t//    1      1      0      1   =>   no                  0\n\t\t//    1      1      1      0   =>   no                  0\n\t\t//    1      1      1      1   =>   no                  0\n\t\treturn select(segments, [\n\t\t\t0, 2, 1, 0,\n\t\t\t2, 2, 0, 0,\n\t\t\t1, 0, 1, 0,\n\t\t\t0, 0, 0, 0\n\t\t], buildLog);\n\t},\n\tintersect: function(segments, buildLog){ // primary & secondary\n\t\t// above1 below1 above2 below2    Keep?               Value\n\t\t//    0      0      0      0   =>   no                  0\n\t\t//    0      0      0      1   =>   no                  0\n\t\t//    0      0      1      0   =>   no                  0\n\t\t//    0      0      1      1   =>   no                  0\n\t\t//    0      1      0      0   =>   no                  0\n\t\t//    0      1      0      1   =>   yes filled below    2\n\t\t//    0      1      1      0   =>   no                  0\n\t\t//    0      1      1      1   =>   yes filled below    2\n\t\t//    1      0      0      0   =>   no                  0\n\t\t//    1      0      0      1   =>   no                  0\n\t\t//    1      0      1      0   =>   yes filled above    1\n\t\t//    1      0      1      1   =>   yes filled above    1\n\t\t//    1      1      0      0   =>   no                  0\n\t\t//    1      1      0      1   =>   yes filled below    2\n\t\t//    1      1      1      0   =>   yes filled above    1\n\t\t//    1      1      1      1   =>   no                  0\n\t\treturn select(segments, [\n\t\t\t0, 0, 0, 0,\n\t\t\t0, 2, 0, 2,\n\t\t\t0, 0, 1, 1,\n\t\t\t0, 2, 1, 0\n\t\t], buildLog);\n\t},\n\tdifference: function(segments, buildLog){ // primary - secondary\n\t\t// above1 below1 above2 below2    Keep?               Value\n\t\t//    0      0      0      0   =>   no                  0\n\t\t//    0      0      0      1   =>   no                  0\n\t\t//    0      0      1      0   =>   no                  0\n\t\t//    0      0      1      1   =>   no                  0\n\t\t//    0      1      0      0   =>   yes filled below    2\n\t\t//    0      1      0      1   =>   no                  0\n\t\t//    0      1      1      0   =>   yes filled below    2\n\t\t//    0      1      1      1   =>   no                  0\n\t\t//    1      0      0      0   =>   yes filled above    1\n\t\t//    1      0      0      1   =>   yes filled above    1\n\t\t//    1      0      1      0   =>   no                  0\n\t\t//    1      0      1      1   =>   no                  0\n\t\t//    1      1      0      0   =>   no                  0\n\t\t//    1      1      0      1   =>   yes filled above    1\n\t\t//    1      1      1      0   =>   yes filled below    2\n\t\t//    1      1      1      1   =>   no                  0\n\t\treturn select(segments, [\n\t\t\t0, 0, 0, 0,\n\t\t\t2, 0, 2, 0,\n\t\t\t1, 1, 0, 0,\n\t\t\t0, 1, 2, 0\n\t\t], buildLog);\n\t},\n\tdifferenceRev: function(segments, buildLog){ // secondary - primary\n\t\t// above1 below1 above2 below2    Keep?               Value\n\t\t//    0      0      0      0   =>   no                  0\n\t\t//    0      0      0      1   =>   yes filled below    2\n\t\t//    0      0      1      0   =>   yes filled above    1\n\t\t//    0      0      1      1   =>   no                  0\n\t\t//    0      1      0      0   =>   no                  0\n\t\t//    0      1      0      1   =>   no                  0\n\t\t//    0      1      1      0   =>   yes filled above    1\n\t\t//    0      1      1      1   =>   yes filled above    1\n\t\t//    1      0      0      0   =>   no                  0\n\t\t//    1      0      0      1   =>   yes filled below    2\n\t\t//    1      0      1      0   =>   no                  0\n\t\t//    1      0      1      1   =>   yes filled below    2\n\t\t//    1      1      0      0   =>   no                  0\n\t\t//    1      1      0      1   =>   no                  0\n\t\t//    1      1      1      0   =>   no                  0\n\t\t//    1      1      1      1   =>   no                  0\n\t\treturn select(segments, [\n\t\t\t0, 2, 1, 0,\n\t\t\t0, 0, 1, 1,\n\t\t\t0, 2, 0, 2,\n\t\t\t0, 0, 0, 0\n\t\t], buildLog);\n\t},\n\txor: function(segments, buildLog){ // primary ^ secondary\n\t\t// above1 below1 above2 below2    Keep?               Value\n\t\t//    0      0      0      0   =>   no                  0\n\t\t//    0      0      0      1   =>   yes filled below    2\n\t\t//    0      0      1      0   =>   yes filled above    1\n\t\t//    0      0      1      1   =>   no                  0\n\t\t//    0      1      0      0   =>   yes filled below    2\n\t\t//    0      1      0      1   =>   no                  0\n\t\t//    0      1      1      0   =>   no                  0\n\t\t//    0      1      1      1   =>   yes filled above    1\n\t\t//    1      0      0      0   =>   yes filled above    1\n\t\t//    1      0      0      1   =>   no                  0\n\t\t//    1      0      1      0   =>   no                  0\n\t\t//    1      0      1      1   =>   yes filled below    2\n\t\t//    1      1      0      0   =>   no                  0\n\t\t//    1      1      0      1   =>   yes filled above    1\n\t\t//    1      1      1      0   =>   yes filled below    2\n\t\t//    1      1      1      1   =>   no                  0\n\t\treturn select(segments, [\n\t\t\t0, 2, 1, 0,\n\t\t\t2, 0, 0, 1,\n\t\t\t1, 0, 0, 2,\n\t\t\t0, 1, 2, 0\n\t\t], buildLog);\n\t}\n};\n\nmodule.exports = SegmentSelector;\n\n},{}],34:[function(_dereq_,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],35:[function(_dereq_,module,exports){\n// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n    trimRight = /\\s+$/,\n    tinyCounter = 0,\n    mathRound = Math.round,\n    mathMin = Math.min,\n    mathMax = Math.max,\n    mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n    color = (color) ? color : '';\n    opts = opts || { };\n\n    // If input is already a tinycolor, return itself\n    if (color instanceof tinycolor) {\n       return color;\n    }\n    // If we are called as a function, call using new instead\n    if (!(this instanceof tinycolor)) {\n        return new tinycolor(color, opts);\n    }\n\n    var rgb = inputToRGB(color);\n    this._originalInput = color,\n    this._r = rgb.r,\n    this._g = rgb.g,\n    this._b = rgb.b,\n    this._a = rgb.a,\n    this._roundA = mathRound(100*this._a) / 100,\n    this._format = opts.format || rgb.format;\n    this._gradientType = opts.gradientType;\n\n    // Don't let the range of [0,255] come back in [0,1].\n    // Potentially lose a little bit of precision here, but will fix issues where\n    // .5 gets interpreted as half of the total, instead of half of 1\n    // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n    if (this._r < 1) { this._r = mathRound(this._r); }\n    if (this._g < 1) { this._g = mathRound(this._g); }\n    if (this._b < 1) { this._b = mathRound(this._b); }\n\n    this._ok = rgb.ok;\n    this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n    isDark: function() {\n        return this.getBrightness() < 128;\n    },\n    isLight: function() {\n        return !this.isDark();\n    },\n    isValid: function() {\n        return this._ok;\n    },\n    getOriginalInput: function() {\n      return this._originalInput;\n    },\n    getFormat: function() {\n        return this._format;\n    },\n    getAlpha: function() {\n        return this._a;\n    },\n    getBrightness: function() {\n        //http://www.w3.org/TR/AERT#color-contrast\n        var rgb = this.toRgb();\n        return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n    },\n    getLuminance: function() {\n        //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n        var rgb = this.toRgb();\n        var RsRGB, GsRGB, BsRGB, R, G, B;\n        RsRGB = rgb.r/255;\n        GsRGB = rgb.g/255;\n        BsRGB = rgb.b/255;\n\n        if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n        if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n        if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n        return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n    },\n    setAlpha: function(value) {\n        this._a = boundAlpha(value);\n        this._roundA = mathRound(100*this._a) / 100;\n        return this;\n    },\n    toHsv: function() {\n        var hsv = rgbToHsv(this._r, this._g, this._b);\n        return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n    },\n    toHsvString: function() {\n        var hsv = rgbToHsv(this._r, this._g, this._b);\n        var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n        return (this._a == 1) ?\n          \"hsv(\"  + h + \", \" + s + \"%, \" + v + \"%)\" :\n          \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n    },\n    toHsl: function() {\n        var hsl = rgbToHsl(this._r, this._g, this._b);\n        return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n    },\n    toHslString: function() {\n        var hsl = rgbToHsl(this._r, this._g, this._b);\n        var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n        return (this._a == 1) ?\n          \"hsl(\"  + h + \", \" + s + \"%, \" + l + \"%)\" :\n          \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n    },\n    toHex: function(allow3Char) {\n        return rgbToHex(this._r, this._g, this._b, allow3Char);\n    },\n    toHexString: function(allow3Char) {\n        return '#' + this.toHex(allow3Char);\n    },\n    toHex8: function(allow4Char) {\n        return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n    },\n    toHex8String: function(allow4Char) {\n        return '#' + this.toHex8(allow4Char);\n    },\n    toRgb: function() {\n        return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n    },\n    toRgbString: function() {\n        return (this._a == 1) ?\n          \"rgb(\"  + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n          \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n    },\n    toPercentageRgb: function() {\n        return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n    },\n    toPercentageRgbString: function() {\n        return (this._a == 1) ?\n          \"rgb(\"  + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n          \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n    },\n    toName: function() {\n        if (this._a === 0) {\n            return \"transparent\";\n        }\n\n        if (this._a < 1) {\n            return false;\n        }\n\n        return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n    },\n    toFilter: function(secondColor) {\n        var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n        var secondHex8String = hex8String;\n        var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n        if (secondColor) {\n            var s = tinycolor(secondColor);\n            secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n        }\n\n        return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n    },\n    toString: function(format) {\n        var formatSet = !!format;\n        format = format || this._format;\n\n        var formattedString = false;\n        var hasAlpha = this._a < 1 && this._a >= 0;\n        var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n        if (needsAlphaFormat) {\n            // Special case for \"transparent\", all other non-alpha formats\n            // will return rgba when there is transparency.\n            if (format === \"name\" && this._a === 0) {\n                return this.toName();\n            }\n            return this.toRgbString();\n        }\n        if (format === \"rgb\") {\n            formattedString = this.toRgbString();\n        }\n        if (format === \"prgb\") {\n            formattedString = this.toPercentageRgbString();\n        }\n        if (format === \"hex\" || format === \"hex6\") {\n            formattedString = this.toHexString();\n        }\n        if (format === \"hex3\") {\n            formattedString = this.toHexString(true);\n        }\n        if (format === \"hex4\") {\n            formattedString = this.toHex8String(true);\n        }\n        if (format === \"hex8\") {\n            formattedString = this.toHex8String();\n        }\n        if (format === \"name\") {\n            formattedString = this.toName();\n        }\n        if (format === \"hsl\") {\n            formattedString = this.toHslString();\n        }\n        if (format === \"hsv\") {\n            formattedString = this.toHsvString();\n        }\n\n        return formattedString || this.toHexString();\n    },\n    clone: function() {\n        return tinycolor(this.toString());\n    },\n\n    _applyModification: function(fn, args) {\n        var color = fn.apply(null, [this].concat([].slice.call(args)));\n        this._r = color._r;\n        this._g = color._g;\n        this._b = color._b;\n        this.setAlpha(color._a);\n        return this;\n    },\n    lighten: function() {\n        return this._applyModification(lighten, arguments);\n    },\n    brighten: function() {\n        return this._applyModification(brighten, arguments);\n    },\n    darken: function() {\n        return this._applyModification(darken, arguments);\n    },\n    desaturate: function() {\n        return this._applyModification(desaturate, arguments);\n    },\n    saturate: function() {\n        return this._applyModification(saturate, arguments);\n    },\n    greyscale: function() {\n        return this._applyModification(greyscale, arguments);\n    },\n    spin: function() {\n        return this._applyModification(spin, arguments);\n    },\n\n    _applyCombination: function(fn, args) {\n        return fn.apply(null, [this].concat([].slice.call(args)));\n    },\n    analogous: function() {\n        return this._applyCombination(analogous, arguments);\n    },\n    complement: function() {\n        return this._applyCombination(complement, arguments);\n    },\n    monochromatic: function() {\n        return this._applyCombination(monochromatic, arguments);\n    },\n    splitcomplement: function() {\n        return this._applyCombination(splitcomplement, arguments);\n    },\n    triad: function() {\n        return this._applyCombination(triad, arguments);\n    },\n    tetrad: function() {\n        return this._applyCombination(tetrad, arguments);\n    }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n    if (typeof color == \"object\") {\n        var newColor = {};\n        for (var i in color) {\n            if (color.hasOwnProperty(i)) {\n                if (i === \"a\") {\n                    newColor[i] = color[i];\n                }\n                else {\n                    newColor[i] = convertToPercentage(color[i]);\n                }\n            }\n        }\n        color = newColor;\n    }\n\n    return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n//     \"red\"\n//     \"#f00\" or \"f00\"\n//     \"#ff0000\" or \"ff0000\"\n//     \"#ff000000\" or \"ff000000\"\n//     \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n//     \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n//     \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n//     \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n//     \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n//     \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n//     \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n    var rgb = { r: 0, g: 0, b: 0 };\n    var a = 1;\n    var s = null;\n    var v = null;\n    var l = null;\n    var ok = false;\n    var format = false;\n\n    if (typeof color == \"string\") {\n        color = stringInputToObject(color);\n    }\n\n    if (typeof color == \"object\") {\n        if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n            rgb = rgbToRgb(color.r, color.g, color.b);\n            ok = true;\n            format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n        }\n        else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n            s = convertToPercentage(color.s);\n            v = convertToPercentage(color.v);\n            rgb = hsvToRgb(color.h, s, v);\n            ok = true;\n            format = \"hsv\";\n        }\n        else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n            s = convertToPercentage(color.s);\n            l = convertToPercentage(color.l);\n            rgb = hslToRgb(color.h, s, l);\n            ok = true;\n            format = \"hsl\";\n        }\n\n        if (color.hasOwnProperty(\"a\")) {\n            a = color.a;\n        }\n    }\n\n    a = boundAlpha(a);\n\n    return {\n        ok: ok,\n        format: color.format || format,\n        r: mathMin(255, mathMax(rgb.r, 0)),\n        g: mathMin(255, mathMax(rgb.g, 0)),\n        b: mathMin(255, mathMax(rgb.b, 0)),\n        a: a\n    };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// <http://www.w3.org/TR/css3-color/>\n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n    return {\n        r: bound01(r, 255) * 255,\n        g: bound01(g, 255) * 255,\n        b: bound01(b, 255) * 255\n    };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n    r = bound01(r, 255);\n    g = bound01(g, 255);\n    b = bound01(b, 255);\n\n    var max = mathMax(r, g, b), min = mathMin(r, g, b);\n    var h, s, l = (max + min) / 2;\n\n    if(max == min) {\n        h = s = 0; // achromatic\n    }\n    else {\n        var d = max - min;\n        s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n        switch(max) {\n            case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n            case g: h = (b - r) / d + 2; break;\n            case b: h = (r - g) / d + 4; break;\n        }\n\n        h /= 6;\n    }\n\n    return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n    var r, g, b;\n\n    h = bound01(h, 360);\n    s = bound01(s, 100);\n    l = bound01(l, 100);\n\n    function hue2rgb(p, q, t) {\n        if(t < 0) t += 1;\n        if(t > 1) t -= 1;\n        if(t < 1/6) return p + (q - p) * 6 * t;\n        if(t < 1/2) return q;\n        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n        return p;\n    }\n\n    if(s === 0) {\n        r = g = b = l; // achromatic\n    }\n    else {\n        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n        var p = 2 * l - q;\n        r = hue2rgb(p, q, h + 1/3);\n        g = hue2rgb(p, q, h);\n        b = hue2rgb(p, q, h - 1/3);\n    }\n\n    return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n    r = bound01(r, 255);\n    g = bound01(g, 255);\n    b = bound01(b, 255);\n\n    var max = mathMax(r, g, b), min = mathMin(r, g, b);\n    var h, s, v = max;\n\n    var d = max - min;\n    s = max === 0 ? 0 : d / max;\n\n    if(max == min) {\n        h = 0; // achromatic\n    }\n    else {\n        switch(max) {\n            case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n            case g: h = (b - r) / d + 2; break;\n            case b: h = (r - g) / d + 4; break;\n        }\n        h /= 6;\n    }\n    return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n    h = bound01(h, 360) * 6;\n    s = bound01(s, 100);\n    v = bound01(v, 100);\n\n    var i = Math.floor(h),\n        f = h - i,\n        p = v * (1 - s),\n        q = v * (1 - f * s),\n        t = v * (1 - (1 - f) * s),\n        mod = i % 6,\n        r = [v, q, p, p, t, v][mod],\n        g = [t, v, v, q, p, p][mod],\n        b = [p, p, t, v, v, q][mod];\n\n    return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n    var hex = [\n        pad2(mathRound(r).toString(16)),\n        pad2(mathRound(g).toString(16)),\n        pad2(mathRound(b).toString(16))\n    ];\n\n    // Return a 3 character hex if possible\n    if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n        return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n    }\n\n    return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n    var hex = [\n        pad2(mathRound(r).toString(16)),\n        pad2(mathRound(g).toString(16)),\n        pad2(mathRound(b).toString(16)),\n        pad2(convertDecimalToHex(a))\n    ];\n\n    // Return a 4 character hex if possible\n    if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n        return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n    }\n\n    return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n    var hex = [\n        pad2(convertDecimalToHex(a)),\n        pad2(mathRound(r).toString(16)),\n        pad2(mathRound(g).toString(16)),\n        pad2(mathRound(b).toString(16))\n    ];\n\n    return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n    if (!color1 || !color2) { return false; }\n    return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n    return tinycolor.fromRatio({\n        r: mathRandom(),\n        g: mathRandom(),\n        b: mathRandom()\n    });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>\n\nfunction desaturate(color, amount) {\n    amount = (amount === 0) ? 0 : (amount || 10);\n    var hsl = tinycolor(color).toHsl();\n    hsl.s -= amount / 100;\n    hsl.s = clamp01(hsl.s);\n    return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n    amount = (amount === 0) ? 0 : (amount || 10);\n    var hsl = tinycolor(color).toHsl();\n    hsl.s += amount / 100;\n    hsl.s = clamp01(hsl.s);\n    return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n    return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n    amount = (amount === 0) ? 0 : (amount || 10);\n    var hsl = tinycolor(color).toHsl();\n    hsl.l += amount / 100;\n    hsl.l = clamp01(hsl.l);\n    return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n    amount = (amount === 0) ? 0 : (amount || 10);\n    var rgb = tinycolor(color).toRgb();\n    rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n    rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n    rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n    return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n    amount = (amount === 0) ? 0 : (amount || 10);\n    var hsl = tinycolor(color).toHsl();\n    hsl.l -= amount / 100;\n    hsl.l = clamp01(hsl.l);\n    return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n    var hsl = tinycolor(color).toHsl();\n    var hue = (hsl.h + amount) % 360;\n    hsl.h = hue < 0 ? 360 + hue : hue;\n    return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>\n\nfunction complement(color) {\n    var hsl = tinycolor(color).toHsl();\n    hsl.h = (hsl.h + 180) % 360;\n    return tinycolor(hsl);\n}\n\nfunction triad(color) {\n    var hsl = tinycolor(color).toHsl();\n    var h = hsl.h;\n    return [\n        tinycolor(color),\n        tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n        tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n    ];\n}\n\nfunction tetrad(color) {\n    var hsl = tinycolor(color).toHsl();\n    var h = hsl.h;\n    return [\n        tinycolor(color),\n        tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n        tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n        tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n    ];\n}\n\nfunction splitcomplement(color) {\n    var hsl = tinycolor(color).toHsl();\n    var h = hsl.h;\n    return [\n        tinycolor(color),\n        tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n        tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n    ];\n}\n\nfunction analogous(color, results, slices) {\n    results = results || 6;\n    slices = slices || 30;\n\n    var hsl = tinycolor(color).toHsl();\n    var part = 360 / slices;\n    var ret = [tinycolor(color)];\n\n    for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n        hsl.h = (hsl.h + part) % 360;\n        ret.push(tinycolor(hsl));\n    }\n    return ret;\n}\n\nfunction monochromatic(color, results) {\n    results = results || 6;\n    var hsv = tinycolor(color).toHsv();\n    var h = hsv.h, s = hsv.s, v = hsv.v;\n    var ret = [];\n    var modification = 1 / results;\n\n    while (results--) {\n        ret.push(tinycolor({ h: h, s: s, v: v}));\n        v = (v + modification) % 1;\n    }\n\n    return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n    amount = (amount === 0) ? 0 : (amount || 50);\n\n    var rgb1 = tinycolor(color1).toRgb();\n    var rgb2 = tinycolor(color2).toRgb();\n\n    var p = amount / 100;\n\n    var rgba = {\n        r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n        g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n        b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n        a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n    };\n\n    return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)\n\n// `contrast`\n// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)\ntinycolor.readability = function(color1, color2) {\n    var c1 = tinycolor(color1);\n    var c2 = tinycolor(color2);\n    return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);\n};\n\n// `isReadable`\n// Ensure that foreground and background color combinations meet WCAG2 guidelines.\n// The third argument is an optional Object.\n//      the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';\n//      the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.\n// If the entire object is absent, isReadable defaults to {level:\"AA\",size:\"small\"}.\n\n// *Example*\n//    tinycolor.isReadable(\"#000\", \"#111\") => false\n//    tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n    var readability = tinycolor.readability(color1, color2);\n    var wcag2Parms, out;\n\n    out = false;\n\n    wcag2Parms = validateWCAG2Parms(wcag2);\n    switch (wcag2Parms.level + wcag2Parms.size) {\n        case \"AAsmall\":\n        case \"AAAlarge\":\n            out = readability >= 4.5;\n            break;\n        case \"AAlarge\":\n            out = readability >= 3;\n            break;\n        case \"AAAsmall\":\n            out = readability >= 7;\n            break;\n    }\n    return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n//    tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n//    tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString();  // \"#ffffff\"\n//    tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n//    tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n    var bestColor = null;\n    var bestScore = 0;\n    var readability;\n    var includeFallbackColors, level, size ;\n    args = args || {};\n    includeFallbackColors = args.includeFallbackColors ;\n    level = args.level;\n    size = args.size;\n\n    for (var i= 0; i < colorList.length ; i++) {\n        readability = tinycolor.readability(baseColor, colorList[i]);\n        if (readability > bestScore) {\n            bestScore = readability;\n            bestColor = tinycolor(colorList[i]);\n        }\n    }\n\n    if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n        return bestColor;\n    }\n    else {\n        args.includeFallbackColors=false;\n        return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n    }\n};\n\n\n// Big List of Colors\n// ------------------\n// <http://www.w3.org/TR/css3-color/#svg-color>\nvar names = tinycolor.names = {\n    aliceblue: \"f0f8ff\",\n    antiquewhite: \"faebd7\",\n    aqua: \"0ff\",\n    aquamarine: \"7fffd4\",\n    azure: \"f0ffff\",\n    beige: \"f5f5dc\",\n    bisque: \"ffe4c4\",\n    black: \"000\",\n    blanchedalmond: \"ffebcd\",\n    blue: \"00f\",\n    blueviolet: \"8a2be2\",\n    brown: \"a52a2a\",\n    burlywood: \"deb887\",\n    burntsienna: \"ea7e5d\",\n    cadetblue: \"5f9ea0\",\n    chartreuse: \"7fff00\",\n    chocolate: \"d2691e\",\n    coral: \"ff7f50\",\n    cornflowerblue: \"6495ed\",\n    cornsilk: \"fff8dc\",\n    crimson: \"dc143c\",\n    cyan: \"0ff\",\n    darkblue: \"00008b\",\n    darkcyan: \"008b8b\",\n    darkgoldenrod: \"b8860b\",\n    darkgray: \"a9a9a9\",\n    darkgreen: \"006400\",\n    darkgrey: \"a9a9a9\",\n    darkkhaki: \"bdb76b\",\n    darkmagenta: \"8b008b\",\n    darkolivegreen: \"556b2f\",\n    darkorange: \"ff8c00\",\n    darkorchid: \"9932cc\",\n    darkred: \"8b0000\",\n    darksalmon: \"e9967a\",\n    darkseagreen: \"8fbc8f\",\n    darkslateblue: \"483d8b\",\n    darkslategray: \"2f4f4f\",\n    darkslategrey: \"2f4f4f\",\n    darkturquoise: \"00ced1\",\n    darkviolet: \"9400d3\",\n    deeppink: \"ff1493\",\n    deepskyblue: \"00bfff\",\n    dimgray: \"696969\",\n    dimgrey: \"696969\",\n    dodgerblue: \"1e90ff\",\n    firebrick: \"b22222\",\n    floralwhite: \"fffaf0\",\n    forestgreen: \"228b22\",\n    fuchsia: \"f0f\",\n    gainsboro: \"dcdcdc\",\n    ghostwhite: \"f8f8ff\",\n    gold: \"ffd700\",\n    goldenrod: \"daa520\",\n    gray: \"808080\",\n    green: \"008000\",\n    greenyellow: \"adff2f\",\n    grey: \"808080\",\n    honeydew: \"f0fff0\",\n    hotpink: \"ff69b4\",\n    indianred: \"cd5c5c\",\n    indigo: \"4b0082\",\n    ivory: \"fffff0\",\n    khaki: \"f0e68c\",\n    lavender: \"e6e6fa\",\n    lavenderblush: \"fff0f5\",\n    lawngreen: \"7cfc00\",\n    lemonchiffon: \"fffacd\",\n    lightblue: \"add8e6\",\n    lightcoral: \"f08080\",\n    lightcyan: \"e0ffff\",\n    lightgoldenrodyellow: \"fafad2\",\n    lightgray: \"d3d3d3\",\n    lightgreen: \"90ee90\",\n    lightgrey: \"d3d3d3\",\n    lightpink: \"ffb6c1\",\n    lightsalmon: \"ffa07a\",\n    lightseagreen: \"20b2aa\",\n    lightskyblue: \"87cefa\",\n    lightslategray: \"789\",\n    lightslategrey: \"789\",\n    lightsteelblue: \"b0c4de\",\n    lightyellow: \"ffffe0\",\n    lime: \"0f0\",\n    limegreen: \"32cd32\",\n    linen: \"faf0e6\",\n    magenta: \"f0f\",\n    maroon: \"800000\",\n    mediumaquamarine: \"66cdaa\",\n    mediumblue: \"0000cd\",\n    mediumorchid: \"ba55d3\",\n    mediumpurple: \"9370db\",\n    mediumseagreen: \"3cb371\",\n    mediumslateblue: \"7b68ee\",\n    mediumspringgreen: \"00fa9a\",\n    mediumturquoise: \"48d1cc\",\n    mediumvioletred: \"c71585\",\n    midnightblue: \"191970\",\n    mintcream: \"f5fffa\",\n    mistyrose: \"ffe4e1\",\n    moccasin: \"ffe4b5\",\n    navajowhite: \"ffdead\",\n    navy: \"000080\",\n    oldlace: \"fdf5e6\",\n    olive: \"808000\",\n    olivedrab: \"6b8e23\",\n    orange: \"ffa500\",\n    orangered: \"ff4500\",\n    orchid: \"da70d6\",\n    palegoldenrod: \"eee8aa\",\n    palegreen: \"98fb98\",\n    paleturquoise: \"afeeee\",\n    palevioletred: \"db7093\",\n    papayawhip: \"ffefd5\",\n    peachpuff: \"ffdab9\",\n    peru: \"cd853f\",\n    pink: \"ffc0cb\",\n    plum: \"dda0dd\",\n    powderblue: \"b0e0e6\",\n    purple: \"800080\",\n    rebeccapurple: \"663399\",\n    red: \"f00\",\n    rosybrown: \"bc8f8f\",\n    royalblue: \"4169e1\",\n    saddlebrown: \"8b4513\",\n    salmon: \"fa8072\",\n    sandybrown: \"f4a460\",\n    seagreen: \"2e8b57\",\n    seashell: \"fff5ee\",\n    sienna: \"a0522d\",\n    silver: \"c0c0c0\",\n    skyblue: \"87ceeb\",\n    slateblue: \"6a5acd\",\n    slategray: \"708090\",\n    slategrey: \"708090\",\n    snow: \"fffafa\",\n    springgreen: \"00ff7f\",\n    steelblue: \"4682b4\",\n    tan: \"d2b48c\",\n    teal: \"008080\",\n    thistle: \"d8bfd8\",\n    tomato: \"ff6347\",\n    turquoise: \"40e0d0\",\n    violet: \"ee82ee\",\n    wheat: \"f5deb3\",\n    white: \"fff\",\n    whitesmoke: \"f5f5f5\",\n    yellow: \"ff0\",\n    yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n    var flipped = { };\n    for (var i in o) {\n        if (o.hasOwnProperty(i)) {\n            flipped[o[i]] = i;\n        }\n    }\n    return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n    a = parseFloat(a);\n\n    if (isNaN(a) || a < 0 || a > 1) {\n        a = 1;\n    }\n\n    return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n    if (isOnePointZero(n)) { n = \"100%\"; }\n\n    var processPercent = isPercentage(n);\n    n = mathMin(max, mathMax(0, parseFloat(n)));\n\n    // Automatically convert percentage into number\n    if (processPercent) {\n        n = parseInt(n * max, 10) / 100;\n    }\n\n    // Handle floating point rounding errors\n    if ((Math.abs(n - max) < 0.000001)) {\n        return 1;\n    }\n\n    // Convert into [0, 1] range if it isn't already\n    return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n    return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n    return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>\nfunction isOnePointZero(n) {\n    return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n    return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n    return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n    if (n <= 1) {\n        n = (n * 100) + \"%\";\n    }\n\n    return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n    return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n    return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n    // <http://www.w3.org/TR/css3-values/#integers>\n    var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n    // <http://www.w3.org/TR/css3-values/#number-value>\n    var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n    // Allow positive/negative integer/number.  Don't capture the either/or, just the entire outcome.\n    var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n    // Actual matching.\n    // Parentheses and commas are optional, but not required.\n    // Whitespace can take the place of commas or opening paren\n    var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n    var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n    return {\n        CSS_UNIT: new RegExp(CSS_UNIT),\n        rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n        rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n        hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n        hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n        hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n        hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n        hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n        hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n        hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n        hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n    };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n    return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing.  Take in a number of formats, and output an object\n// based on detected format.  Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n    color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n    var named = false;\n    if (names[color]) {\n        color = names[color];\n        named = true;\n    }\n    else if (color == 'transparent') {\n        return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n    }\n\n    // Try to match string input using regular expressions.\n    // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n    // Just return an object and let the conversion functions handle that.\n    // This way the result will be the same whether the tinycolor is initialized with string or object.\n    var match;\n    if ((match = matchers.rgb.exec(color))) {\n        return { r: match[1], g: match[2], b: match[3] };\n    }\n    if ((match = matchers.rgba.exec(color))) {\n        return { r: match[1], g: match[2], b: match[3], a: match[4] };\n    }\n    if ((match = matchers.hsl.exec(color))) {\n        return { h: match[1], s: match[2], l: match[3] };\n    }\n    if ((match = matchers.hsla.exec(color))) {\n        return { h: match[1], s: match[2], l: match[3], a: match[4] };\n    }\n    if ((match = matchers.hsv.exec(color))) {\n        return { h: match[1], s: match[2], v: match[3] };\n    }\n    if ((match = matchers.hsva.exec(color))) {\n        return { h: match[1], s: match[2], v: match[3], a: match[4] };\n    }\n    if ((match = matchers.hex8.exec(color))) {\n        return {\n            r: parseIntFromHex(match[1]),\n            g: parseIntFromHex(match[2]),\n            b: parseIntFromHex(match[3]),\n            a: convertHexToDecimal(match[4]),\n            format: named ? \"name\" : \"hex8\"\n        };\n    }\n    if ((match = matchers.hex6.exec(color))) {\n        return {\n            r: parseIntFromHex(match[1]),\n            g: parseIntFromHex(match[2]),\n            b: parseIntFromHex(match[3]),\n            format: named ? \"name\" : \"hex\"\n        };\n    }\n    if ((match = matchers.hex4.exec(color))) {\n        return {\n            r: parseIntFromHex(match[1] + '' + match[1]),\n            g: parseIntFromHex(match[2] + '' + match[2]),\n            b: parseIntFromHex(match[3] + '' + match[3]),\n            a: convertHexToDecimal(match[4] + '' + match[4]),\n            format: named ? \"name\" : \"hex8\"\n        };\n    }\n    if ((match = matchers.hex3.exec(color))) {\n        return {\n            r: parseIntFromHex(match[1] + '' + match[1]),\n            g: parseIntFromHex(match[2] + '' + match[2]),\n            b: parseIntFromHex(match[3] + '' + match[3]),\n            format: named ? \"name\" : \"hex\"\n        };\n    }\n\n    return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n    // return valid WCAG2 parms for isReadable.\n    // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n    var level, size;\n    parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n    level = (parms.level || \"AA\").toUpperCase();\n    size = (parms.size || \"small\").toLowerCase();\n    if (level !== \"AA\" && level !== \"AAA\") {\n        level = \"AA\";\n    }\n    if (size !== \"small\" && size !== \"large\") {\n        size = \"small\";\n    }\n    return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif (typeof module !== \"undefined\" && module.exports) {\n    module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (typeof define === 'function' && define.amd) {\n    define(function () {return tinycolor;});\n}\n// Browser: Expose to window\nelse {\n    window.tinycolor = tinycolor;\n}\n\n})(Math);\n\n},{}],36:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * All paths are tuned for maximum scalability of the arrowhead,\n * ie throughout arrowwidth=0.3..3 the head is joined smoothly\n * to the line, with the line coming from the left and ending at (0, 0).\n *\n * `backoff` is the distance to move the arrowhead and the end of the line,\n * in order that the arrowhead points to the desired place, either at\n * the tip of the arrow or (in the case of circle or square)\n * the center of the symbol.\n *\n * `noRotate`, if truthy, says that this arrowhead should not rotate with the\n * arrow. That's the case for squares, which should always be straight, and\n * circles, for which it's irrelevant.\n */\n\nmodule.exports = [\n    // no arrow\n    {\n        path: '',\n        backoff: 0\n    },\n    // wide with flat back\n    {\n        path: 'M-2.4,-3V3L0.6,0Z',\n        backoff: 0.6\n    },\n    // narrower with flat back\n    {\n        path: 'M-3.7,-2.5V2.5L1.3,0Z',\n        backoff: 1.3\n    },\n    // barbed\n    {\n        path: 'M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z',\n        backoff: 1.55\n    },\n    // wide line-drawn\n    {\n        path: 'M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z',\n        backoff: 1.6\n    },\n    // narrower line-drawn\n    {\n        path: 'M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z',\n        backoff: 2\n    },\n    // circle\n    {\n        path: 'M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z',\n        backoff: 0,\n        noRotate: true\n    },\n    // square\n    {\n        path: 'M2,2V-2H-2V2Z',\n        backoff: 0,\n        noRotate: true\n    }\n];\n\n},{}],37:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar ARROWPATHS = _dereq_('./arrow_paths');\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar cartesianConstants = _dereq_('../../plots/cartesian/constants');\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\n\nmodule.exports = templatedArray('annotation', {\n    visible: {\n        valType: 'boolean',\n        \n        dflt: true,\n        editType: 'calc+arraydraw',\n        \n    },\n\n    text: {\n        valType: 'string',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    textangle: {\n        valType: 'angle',\n        dflt: 0,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    font: fontAttrs({\n        editType: 'calc+arraydraw',\n        colorEditType: 'arraydraw',\n        \n    }),\n    width: {\n        valType: 'number',\n        min: 1,\n        dflt: null,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    height: {\n        valType: 'number',\n        min: 1,\n        dflt: null,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    opacity: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        dflt: 1,\n        \n        editType: 'arraydraw',\n        \n    },\n    align: {\n        valType: 'enumerated',\n        values: ['left', 'center', 'right'],\n        dflt: 'center',\n        \n        editType: 'arraydraw',\n        \n    },\n    valign: {\n        valType: 'enumerated',\n        values: ['top', 'middle', 'bottom'],\n        dflt: 'middle',\n        \n        editType: 'arraydraw',\n        \n    },\n    bgcolor: {\n        valType: 'color',\n        dflt: 'rgba(0,0,0,0)',\n        \n        editType: 'arraydraw',\n        \n    },\n    bordercolor: {\n        valType: 'color',\n        dflt: 'rgba(0,0,0,0)',\n        \n        editType: 'arraydraw',\n        \n    },\n    borderpad: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    borderwidth: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    // arrow\n    showarrow: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    arrowcolor: {\n        valType: 'color',\n        \n        editType: 'arraydraw',\n        \n    },\n    arrowhead: {\n        valType: 'integer',\n        min: 0,\n        max: ARROWPATHS.length,\n        dflt: 1,\n        \n        editType: 'arraydraw',\n        \n    },\n    startarrowhead: {\n        valType: 'integer',\n        min: 0,\n        max: ARROWPATHS.length,\n        dflt: 1,\n        \n        editType: 'arraydraw',\n        \n    },\n    arrowside: {\n        valType: 'flaglist',\n        flags: ['end', 'start'],\n        extras: ['none'],\n        dflt: 'end',\n        \n        editType: 'arraydraw',\n        \n    },\n    arrowsize: {\n        valType: 'number',\n        min: 0.3,\n        dflt: 1,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    startarrowsize: {\n        valType: 'number',\n        min: 0.3,\n        dflt: 1,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    arrowwidth: {\n        valType: 'number',\n        min: 0.1,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    standoff: {\n        valType: 'number',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    startstandoff: {\n        valType: 'number',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    ax: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    ay: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    axref: {\n        valType: 'enumerated',\n        dflt: 'pixel',\n        values: [\n            'pixel',\n            cartesianConstants.idRegex.x.toString()\n        ],\n        \n        editType: 'calc',\n        \n    },\n    ayref: {\n        valType: 'enumerated',\n        dflt: 'pixel',\n        values: [\n            'pixel',\n            cartesianConstants.idRegex.y.toString()\n        ],\n        \n        editType: 'calc',\n        \n    },\n    // positioning\n    xref: {\n        valType: 'enumerated',\n        values: [\n            'paper',\n            cartesianConstants.idRegex.x.toString()\n        ],\n        \n        editType: 'calc',\n        \n    },\n    x: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    xanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'left', 'center', 'right'],\n        dflt: 'auto',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    xshift: {\n        valType: 'number',\n        dflt: 0,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    yref: {\n        valType: 'enumerated',\n        values: [\n            'paper',\n            cartesianConstants.idRegex.y.toString()\n        ],\n        \n        editType: 'calc',\n        \n    },\n    y: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    yanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'top', 'middle', 'bottom'],\n        dflt: 'auto',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    yshift: {\n        valType: 'number',\n        dflt: 0,\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    clicktoshow: {\n        valType: 'enumerated',\n        values: [false, 'onoff', 'onout'],\n        dflt: false,\n        \n        editType: 'arraydraw',\n        \n    },\n    xclick: {\n        valType: 'any',\n        \n        editType: 'arraydraw',\n        \n    },\n    yclick: {\n        valType: 'any',\n        \n        editType: 'arraydraw',\n        \n    },\n    hovertext: {\n        valType: 'string',\n        \n        editType: 'arraydraw',\n        \n    },\n    hoverlabel: {\n        bgcolor: {\n            valType: 'color',\n            \n            editType: 'arraydraw',\n            \n        },\n        bordercolor: {\n            valType: 'color',\n            \n            editType: 'arraydraw',\n            \n        },\n        font: fontAttrs({\n            editType: 'arraydraw',\n            \n        }),\n        editType: 'arraydraw'\n    },\n    captureevents: {\n        valType: 'boolean',\n        \n        editType: 'arraydraw',\n        \n    },\n    editType: 'calc',\n\n    _deprecated: {\n        ref: {\n            valType: 'string',\n            \n            editType: 'calc',\n            \n        }\n    }\n});\n\n},{\"../../plot_api/plot_template\":212,\"../../plots/cartesian/constants\":228,\"../../plots/font_attributes\":250,\"./arrow_paths\":36}],38:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar draw = _dereq_('./draw').draw;\n\n\nmodule.exports = function calcAutorange(gd) {\n    var fullLayout = gd._fullLayout;\n    var annotationList = Lib.filterVisible(fullLayout.annotations);\n\n    if(annotationList.length && gd._fullData.length) {\n        return Lib.syncOrAsync([draw, annAutorange], gd);\n    }\n};\n\nfunction annAutorange(gd) {\n    var fullLayout = gd._fullLayout;\n\n    // find the bounding boxes for each of these annotations'\n    // relative to their anchor points\n    // use the arrow and the text bg rectangle,\n    // as the whole anno may include hidden text in its bbox\n    Lib.filterVisible(fullLayout.annotations).forEach(function(ann) {\n        var xa = Axes.getFromId(gd, ann.xref);\n        var ya = Axes.getFromId(gd, ann.yref);\n\n        ann._extremes = {};\n        if(xa) calcAxisExpansion(ann, xa);\n        if(ya) calcAxisExpansion(ann, ya);\n    });\n}\n\nfunction calcAxisExpansion(ann, ax) {\n    var axId = ax._id;\n    var letter = axId.charAt(0);\n    var pos = ann[letter];\n    var apos = ann['a' + letter];\n    var ref = ann[letter + 'ref'];\n    var aref = ann['a' + letter + 'ref'];\n    var padplus = ann['_' + letter + 'padplus'];\n    var padminus = ann['_' + letter + 'padminus'];\n    var shift = {x: 1, y: -1}[letter] * ann[letter + 'shift'];\n    var headSize = 3 * ann.arrowsize * ann.arrowwidth || 0;\n    var headPlus = headSize + shift;\n    var headMinus = headSize - shift;\n    var startHeadSize = 3 * ann.startarrowsize * ann.arrowwidth || 0;\n    var startHeadPlus = startHeadSize + shift;\n    var startHeadMinus = startHeadSize - shift;\n    var extremes;\n\n    if(aref === ref) {\n        // expand for the arrowhead (padded by arrowhead)\n        var extremeArrowHead = Axes.findExtremes(ax, [ax.r2c(pos)], {\n            ppadplus: headPlus,\n            ppadminus: headMinus\n        });\n        // again for the textbox (padded by textbox)\n        var extremeText = Axes.findExtremes(ax, [ax.r2c(apos)], {\n            ppadplus: Math.max(padplus, startHeadPlus),\n            ppadminus: Math.max(padminus, startHeadMinus)\n        });\n        extremes = {\n            min: [extremeArrowHead.min[0], extremeText.min[0]],\n            max: [extremeArrowHead.max[0], extremeText.max[0]]\n        };\n    } else {\n        startHeadPlus = apos ? startHeadPlus + apos : startHeadPlus;\n        startHeadMinus = apos ? startHeadMinus - apos : startHeadMinus;\n        extremes = Axes.findExtremes(ax, [ax.r2c(pos)], {\n            ppadplus: Math.max(padplus, headPlus, startHeadPlus),\n            ppadminus: Math.max(padminus, headMinus, startHeadMinus)\n        });\n    }\n\n    ann._extremes[axId] = extremes;\n}\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"./draw\":43}],39:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\nvar arrayEditor = _dereq_('../../plot_api/plot_template').arrayEditor;\n\nmodule.exports = {\n    hasClickToShow: hasClickToShow,\n    onClick: onClick\n};\n\n/*\n * hasClickToShow: does the given hoverData have ANY annotations which will\n * turn ON if we click here? (used by hover events to set cursor)\n *\n * gd: graphDiv\n * hoverData: a hoverData array, as included with the *plotly_hover* or\n *     *plotly_click* events in the `points` attribute\n *\n * returns: boolean\n */\nfunction hasClickToShow(gd, hoverData) {\n    var sets = getToggleSets(gd, hoverData);\n    return sets.on.length > 0 || sets.explicitOff.length > 0;\n}\n\n/*\n * onClick: perform the toggling (via Plotly.update) implied by clicking\n * at this hoverData\n *\n * gd: graphDiv\n * hoverData: a hoverData array, as included with the *plotly_hover* or\n *     *plotly_click* events in the `points` attribute\n *\n * returns: Promise that the update is complete\n */\nfunction onClick(gd, hoverData) {\n    var toggleSets = getToggleSets(gd, hoverData);\n    var onSet = toggleSets.on;\n    var offSet = toggleSets.off.concat(toggleSets.explicitOff);\n    var update = {};\n    var annotationsOut = gd._fullLayout.annotations;\n    var i, editHelpers;\n\n    if(!(onSet.length || offSet.length)) return;\n\n    for(i = 0; i < onSet.length; i++) {\n        editHelpers = arrayEditor(gd.layout, 'annotations', annotationsOut[onSet[i]]);\n        editHelpers.modifyItem('visible', true);\n        Lib.extendFlat(update, editHelpers.getUpdateObj());\n    }\n\n    for(i = 0; i < offSet.length; i++) {\n        editHelpers = arrayEditor(gd.layout, 'annotations', annotationsOut[offSet[i]]);\n        editHelpers.modifyItem('visible', false);\n        Lib.extendFlat(update, editHelpers.getUpdateObj());\n    }\n\n    return Registry.call('update', gd, {}, update);\n}\n\n/*\n * getToggleSets: find the annotations which will turn on or off at this\n * hoverData\n *\n * gd: graphDiv\n * hoverData: a hoverData array, as included with the *plotly_hover* or\n *     *plotly_click* events in the `points` attribute\n *\n * returns: {\n *   on: Array (indices of annotations to turn on),\n *   off: Array (indices to turn off because you're not hovering on them),\n *   explicitOff: Array (indices to turn off because you *are* hovering on them)\n * }\n */\nfunction getToggleSets(gd, hoverData) {\n    var annotations = gd._fullLayout.annotations;\n    var onSet = [];\n    var offSet = [];\n    var explicitOffSet = [];\n    var hoverLen = (hoverData || []).length;\n\n    var i, j, anni, showMode, pointj, xa, ya, toggleType;\n\n    for(i = 0; i < annotations.length; i++) {\n        anni = annotations[i];\n        showMode = anni.clicktoshow;\n\n        if(showMode) {\n            for(j = 0; j < hoverLen; j++) {\n                pointj = hoverData[j];\n                xa = pointj.xaxis;\n                ya = pointj.yaxis;\n\n                if(xa._id === anni.xref &&\n                    ya._id === anni.yref &&\n                    xa.d2r(pointj.x) === clickData2r(anni._xclick, xa) &&\n                    ya.d2r(pointj.y) === clickData2r(anni._yclick, ya)\n                ) {\n                    // match! toggle this annotation\n                    // regardless of its clicktoshow mode\n                    // but if it's onout mode, off is implicit\n                    if(anni.visible) {\n                        if(showMode === 'onout') toggleType = offSet;\n                        else toggleType = explicitOffSet;\n                    } else {\n                        toggleType = onSet;\n                    }\n                    toggleType.push(i);\n                    break;\n                }\n            }\n\n            if(j === hoverLen) {\n                // no match - only turn this annotation OFF, and only if\n                // showmode is 'onout'\n                if(anni.visible && showMode === 'onout') offSet.push(i);\n            }\n        }\n    }\n\n    return {on: onSet, off: offSet, explicitOff: explicitOffSet};\n}\n\n// to handle log axes until v2\nfunction clickData2r(d, ax) {\n    return ax.type === 'log' ? ax.l2r(d) : ax.d2r(d);\n}\n\n},{\"../../lib\":178,\"../../plot_api/plot_template\":212,\"../../registry\":269}],40:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../color');\n\n// defaults common to 'annotations' and 'annotations3d'\nmodule.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayout, coerce) {\n    coerce('opacity');\n    var bgColor = coerce('bgcolor');\n\n    var borderColor = coerce('bordercolor');\n    var borderOpacity = Color.opacity(borderColor);\n\n    coerce('borderpad');\n\n    var borderWidth = coerce('borderwidth');\n    var showArrow = coerce('showarrow');\n\n    coerce('text', showArrow ? ' ' : fullLayout._dfltTitle.annotation);\n    coerce('textangle');\n    Lib.coerceFont(coerce, 'font', fullLayout.font);\n\n    coerce('width');\n    coerce('align');\n\n    var h = coerce('height');\n    if(h) coerce('valign');\n\n    if(showArrow) {\n        var arrowside = coerce('arrowside');\n        var arrowhead;\n        var arrowsize;\n\n        if(arrowside.indexOf('end') !== -1) {\n            arrowhead = coerce('arrowhead');\n            arrowsize = coerce('arrowsize');\n        }\n\n        if(arrowside.indexOf('start') !== -1) {\n            coerce('startarrowhead', arrowhead);\n            coerce('startarrowsize', arrowsize);\n        }\n        coerce('arrowcolor', borderOpacity ? annOut.bordercolor : Color.defaultLine);\n        coerce('arrowwidth', ((borderOpacity && borderWidth) || 1) * 2);\n        coerce('standoff');\n        coerce('startstandoff');\n    }\n\n    var hoverText = coerce('hovertext');\n    var globalHoverLabel = fullLayout.hoverlabel || {};\n\n    if(hoverText) {\n        var hoverBG = coerce('hoverlabel.bgcolor', globalHoverLabel.bgcolor ||\n            (Color.opacity(bgColor) ? Color.rgb(bgColor) : Color.defaultLine)\n        );\n\n        var hoverBorder = coerce('hoverlabel.bordercolor', globalHoverLabel.bordercolor ||\n            Color.contrast(hoverBG)\n        );\n\n        Lib.coerceFont(coerce, 'hoverlabel.font', {\n            family: globalHoverLabel.font.family,\n            size: globalHoverLabel.font.size,\n            color: globalHoverLabel.font.color || hoverBorder\n        });\n    }\n\n    coerce('captureevents', !!hoverText);\n};\n\n},{\"../../lib\":178,\"../color\":52}],41:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar toLogRange = _dereq_('../../lib/to_log_range');\n\n/*\n * convertCoords: when converting an axis between log and linear\n * you need to alter any annotations on that axis to keep them\n * pointing at the same data point.\n * In v2.0 this will become obsolete\n *\n * gd: the plot div\n * ax: the axis being changed\n * newType: the type it's getting\n * doExtra: function(attr, val) from inside relayout that sets the attribute.\n *     Use this to make the changes as it's aware if any other changes in the\n *     same relayout call should override this conversion.\n */\nmodule.exports = function convertCoords(gd, ax, newType, doExtra) {\n    ax = ax || {};\n\n    var toLog = (newType === 'log') && (ax.type === 'linear');\n    var fromLog = (newType === 'linear') && (ax.type === 'log');\n\n    if(!(toLog || fromLog)) return;\n\n    var annotations = gd._fullLayout.annotations;\n    var axLetter = ax._id.charAt(0);\n    var ann;\n    var attrPrefix;\n\n    function convert(attr) {\n        var currentVal = ann[attr];\n        var newVal = null;\n\n        if(toLog) newVal = toLogRange(currentVal, ax.range);\n        else newVal = Math.pow(10, currentVal);\n\n        // if conversion failed, delete the value so it gets a default value\n        if(!isNumeric(newVal)) newVal = null;\n\n        doExtra(attrPrefix + attr, newVal);\n    }\n\n    for(var i = 0; i < annotations.length; i++) {\n        ann = annotations[i];\n        attrPrefix = 'annotations[' + i + '].';\n\n        if(ann[axLetter + 'ref'] === ax._id) convert(axLetter);\n        if(ann['a' + axLetter + 'ref'] === ax._id) convert('a' + axLetter);\n    }\n};\n\n},{\"../../lib/to_log_range\":201,\"fast-isnumeric\":18}],42:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\n\nvar handleAnnotationCommonDefaults = _dereq_('./common_defaults');\nvar attributes = _dereq_('./attributes');\n\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n    handleArrayContainerDefaults(layoutIn, layoutOut, {\n        name: 'annotations',\n        handleItemDefaults: handleAnnotationDefaults\n    });\n};\n\nfunction handleAnnotationDefaults(annIn, annOut, fullLayout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(annIn, annOut, attributes, attr, dflt);\n    }\n\n    var visible = coerce('visible');\n    var clickToShow = coerce('clicktoshow');\n\n    if(!(visible || clickToShow)) return;\n\n    handleAnnotationCommonDefaults(annIn, annOut, fullLayout, coerce);\n\n    var showArrow = annOut.showarrow;\n\n    // positioning\n    var axLetters = ['x', 'y'];\n    var arrowPosDflt = [-10, -30];\n    var gdMock = {_fullLayout: fullLayout};\n\n    for(var i = 0; i < 2; i++) {\n        var axLetter = axLetters[i];\n\n        // xref, yref\n        var axRef = Axes.coerceRef(annIn, annOut, gdMock, axLetter, '', 'paper');\n\n        if(axRef !== 'paper') {\n            var ax = Axes.getFromId(gdMock, axRef);\n            ax._annIndices.push(annOut._index);\n        }\n\n        // x, y\n        Axes.coercePosition(annOut, gdMock, coerce, axRef, axLetter, 0.5);\n\n        if(showArrow) {\n            var arrowPosAttr = 'a' + axLetter;\n            // axref, ayref\n            var aaxRef = Axes.coerceRef(annIn, annOut, gdMock, arrowPosAttr, 'pixel');\n\n            // for now the arrow can only be on the same axis or specified as pixels\n            // TODO: sometime it might be interesting to allow it to be on *any* axis\n            // but that would require updates to drawing & autorange code and maybe more\n            if(aaxRef !== 'pixel' && aaxRef !== axRef) {\n                aaxRef = annOut[arrowPosAttr] = 'pixel';\n            }\n\n            // ax, ay\n            var aDflt = (aaxRef === 'pixel') ? arrowPosDflt[i] : 0.4;\n            Axes.coercePosition(annOut, gdMock, coerce, aaxRef, arrowPosAttr, aDflt);\n        }\n\n        // xanchor, yanchor\n        coerce(axLetter + 'anchor');\n\n        // xshift, yshift\n        coerce(axLetter + 'shift');\n    }\n\n    // if you have one coordinate you should have both\n    Lib.noneOrAll(annIn, annOut, ['x', 'y']);\n\n    // if you have one part of arrow length you should have both\n    if(showArrow) {\n        Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);\n    }\n\n    if(clickToShow) {\n        var xClick = coerce('xclick');\n        var yClick = coerce('yclick');\n\n        // put the actual click data to bind to into private attributes\n        // so we don't have to do this little bit of logic on every hover event\n        annOut._xclick = (xClick === undefined) ?\n            annOut.x :\n            Axes.cleanPosition(xClick, gdMock, annOut.xref);\n        annOut._yclick = (yClick === undefined) ?\n            annOut.y :\n            Axes.cleanPosition(yClick, gdMock, annOut.yref);\n    }\n}\n\n},{\"../../lib\":178,\"../../plots/array_container_defaults\":218,\"../../plots/cartesian/axes\":222,\"./attributes\":37,\"./common_defaults\":40}],43:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Plots = _dereq_('../../plots/plots');\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Color = _dereq_('../color');\nvar Drawing = _dereq_('../drawing');\nvar Fx = _dereq_('../fx');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar setCursor = _dereq_('../../lib/setcursor');\nvar dragElement = _dereq_('../dragelement');\nvar arrayEditor = _dereq_('../../plot_api/plot_template').arrayEditor;\n\nvar drawArrowHead = _dereq_('./draw_arrow_head');\n\n// Annotations are stored in gd.layout.annotations, an array of objects\n// index can point to one item in this array,\n//  or non-numeric to simply add a new one\n//  or -1 to modify all existing\n// opt can be the full options object, or one key (to be set to value)\n//  or undefined to simply redraw\n// if opt is blank, val can be 'add' or a full options object to add a new\n//  annotation at that point in the array, or 'remove' to delete this one\n\nmodule.exports = {\n    draw: draw,\n    drawOne: drawOne,\n    drawRaw: drawRaw\n};\n\n/*\n * draw: draw all annotations without any new modifications\n */\nfunction draw(gd) {\n    var fullLayout = gd._fullLayout;\n\n    fullLayout._infolayer.selectAll('.annotation').remove();\n\n    for(var i = 0; i < fullLayout.annotations.length; i++) {\n        if(fullLayout.annotations[i].visible) {\n            drawOne(gd, i);\n        }\n    }\n\n    return Plots.previousPromises(gd);\n}\n\n/*\n * drawOne: draw a single cartesian or paper-ref annotation, potentially with modifications\n *\n * index (int): the annotation to draw\n */\nfunction drawOne(gd, index) {\n    var fullLayout = gd._fullLayout;\n    var options = fullLayout.annotations[index] || {};\n    var xa = Axes.getFromId(gd, options.xref);\n    var ya = Axes.getFromId(gd, options.yref);\n\n    if(xa) xa.setScale();\n    if(ya) ya.setScale();\n\n    drawRaw(gd, options, index, false, xa, ya);\n}\n\n/**\n * drawRaw: draw a single annotation, potentially with modifications\n *\n * @param {DOM element} gd\n * @param {object} options : this annotation's fullLayout options\n * @param {integer} index : index in 'annotations' container of the annotation to draw\n * @param {string} subplotId : id of the annotation's subplot\n *  - use false for 2d (i.e. cartesian or paper-ref) annotations\n * @param {object | undefined} xa : full x-axis object to compute subplot pos-to-px\n * @param {object | undefined} ya : ... y-axis\n */\nfunction drawRaw(gd, options, index, subplotId, xa, ya) {\n    var fullLayout = gd._fullLayout;\n    var gs = gd._fullLayout._size;\n    var edits = gd._context.edits;\n\n    var className, containerStr;\n\n    if(subplotId) {\n        className = 'annotation-' + subplotId;\n        containerStr = subplotId + '.annotations';\n    } else {\n        className = 'annotation';\n        containerStr = 'annotations';\n    }\n\n    var editHelpers = arrayEditor(gd.layout, containerStr, options);\n    var modifyBase = editHelpers.modifyBase;\n    var modifyItem = editHelpers.modifyItem;\n    var getUpdateObj = editHelpers.getUpdateObj;\n\n    // remove the existing annotation if there is one\n    fullLayout._infolayer\n        .selectAll('.' + className + '[data-index=\"' + index + '\"]')\n        .remove();\n\n    var annClipID = 'clip' + fullLayout._uid + '_ann' + index;\n\n    // this annotation is gone - quit now after deleting it\n    // TODO: use d3 idioms instead of deleting and redrawing every time\n    if(!options._input || options.visible === false) {\n        d3.selectAll('#' + annClipID).remove();\n        return;\n    }\n\n    // calculated pixel positions\n    // x & y each will get text, head, and tail as appropriate\n    var annPosPx = {x: {}, y: {}};\n    var textangle = +options.textangle || 0;\n\n    // create the components\n    // made a single group to contain all, so opacity can work right\n    // with border/arrow together this could handle a whole bunch of\n    // cleanup at this point, but works for now\n    var annGroup = fullLayout._infolayer.append('g')\n        .classed(className, true)\n        .attr('data-index', String(index))\n        .style('opacity', options.opacity);\n\n    // another group for text+background so that they can rotate together\n    var annTextGroup = annGroup.append('g')\n        .classed('annotation-text-g', true);\n\n    var editTextPosition = edits[options.showarrow ? 'annotationTail' : 'annotationPosition'];\n    var textEvents = options.captureevents || edits.annotationText || editTextPosition;\n\n    function makeEventData(initialEvent) {\n        var eventData = {\n            index: index,\n            annotation: options._input,\n            fullAnnotation: options,\n            event: initialEvent\n        };\n        if(subplotId) {\n            eventData.subplotId = subplotId;\n        }\n        return eventData;\n    }\n\n    var annTextGroupInner = annTextGroup.append('g')\n        .style('pointer-events', textEvents ? 'all' : null)\n        .call(setCursor, 'pointer')\n        .on('click', function() {\n            gd._dragging = false;\n            gd.emit('plotly_clickannotation', makeEventData(d3.event));\n        });\n\n    if(options.hovertext) {\n        annTextGroupInner\n        .on('mouseover', function() {\n            var hoverOptions = options.hoverlabel;\n            var hoverFont = hoverOptions.font;\n            var bBox = this.getBoundingClientRect();\n            var bBoxRef = gd.getBoundingClientRect();\n\n            Fx.loneHover({\n                x0: bBox.left - bBoxRef.left,\n                x1: bBox.right - bBoxRef.left,\n                y: (bBox.top + bBox.bottom) / 2 - bBoxRef.top,\n                text: options.hovertext,\n                color: hoverOptions.bgcolor,\n                borderColor: hoverOptions.bordercolor,\n                fontFamily: hoverFont.family,\n                fontSize: hoverFont.size,\n                fontColor: hoverFont.color\n            }, {\n                container: fullLayout._hoverlayer.node(),\n                outerContainer: fullLayout._paper.node(),\n                gd: gd\n            });\n        })\n        .on('mouseout', function() {\n            Fx.loneUnhover(fullLayout._hoverlayer.node());\n        });\n    }\n\n    var borderwidth = options.borderwidth;\n    var borderpad = options.borderpad;\n    var borderfull = borderwidth + borderpad;\n\n    var annTextBG = annTextGroupInner.append('rect')\n        .attr('class', 'bg')\n        .style('stroke-width', borderwidth + 'px')\n        .call(Color.stroke, options.bordercolor)\n        .call(Color.fill, options.bgcolor);\n\n    var isSizeConstrained = options.width || options.height;\n\n    var annTextClip = fullLayout._topclips\n        .selectAll('#' + annClipID)\n        .data(isSizeConstrained ? [0] : []);\n\n    annTextClip.enter().append('clipPath')\n        .classed('annclip', true)\n        .attr('id', annClipID)\n      .append('rect');\n    annTextClip.exit().remove();\n\n    var font = options.font;\n\n    var text = fullLayout._meta ?\n        Lib.templateString(options.text, fullLayout._meta) :\n        options.text;\n\n    var annText = annTextGroupInner.append('text')\n        .classed('annotation-text', true)\n        .text(text);\n\n    function textLayout(s) {\n        s.call(Drawing.font, font)\n        .attr({\n            'text-anchor': {\n                left: 'start',\n                right: 'end'\n            }[options.align] || 'middle'\n        });\n\n        svgTextUtils.convertToTspans(s, gd, drawGraphicalElements);\n        return s;\n    }\n\n    function drawGraphicalElements() {\n        // if the text has *only* a link, make the whole box into a link\n        var anchor3 = annText.selectAll('a');\n        if(anchor3.size() === 1 && anchor3.text() === annText.text()) {\n            var wholeLink = annTextGroupInner.insert('a', ':first-child').attr({\n                'xlink:xlink:href': anchor3.attr('xlink:href'),\n                'xlink:xlink:show': anchor3.attr('xlink:show')\n            })\n            .style({cursor: 'pointer'});\n\n            wholeLink.node().appendChild(annTextBG.node());\n        }\n\n        var mathjaxGroup = annTextGroupInner.select('.annotation-text-math-group');\n        var hasMathjax = !mathjaxGroup.empty();\n        var anntextBB = Drawing.bBox(\n                (hasMathjax ? mathjaxGroup : annText).node());\n        var textWidth = anntextBB.width;\n        var textHeight = anntextBB.height;\n        var annWidth = options.width || textWidth;\n        var annHeight = options.height || textHeight;\n        var outerWidth = Math.round(annWidth + 2 * borderfull);\n        var outerHeight = Math.round(annHeight + 2 * borderfull);\n\n        function shiftFraction(v, anchor) {\n            if(anchor === 'auto') {\n                if(v < 1 / 3) anchor = 'left';\n                else if(v > 2 / 3) anchor = 'right';\n                else anchor = 'center';\n            }\n            return {\n                center: 0,\n                middle: 0,\n                left: 0.5,\n                bottom: -0.5,\n                right: -0.5,\n                top: 0.5\n            }[anchor];\n        }\n\n        var annotationIsOffscreen = false;\n        var letters = ['x', 'y'];\n\n        for(var i = 0; i < letters.length; i++) {\n            var axLetter = letters[i];\n            var axRef = options[axLetter + 'ref'] || axLetter;\n            var tailRef = options['a' + axLetter + 'ref'];\n            var ax = {x: xa, y: ya}[axLetter];\n            var dimAngle = (textangle + (axLetter === 'x' ? 0 : -90)) * Math.PI / 180;\n            // note that these two can be either positive or negative\n            var annSizeFromWidth = outerWidth * Math.cos(dimAngle);\n            var annSizeFromHeight = outerHeight * Math.sin(dimAngle);\n            // but this one is the positive total size\n            var annSize = Math.abs(annSizeFromWidth) + Math.abs(annSizeFromHeight);\n            var anchor = options[axLetter + 'anchor'];\n            var overallShift = options[axLetter + 'shift'] * (axLetter === 'x' ? 1 : -1);\n            var posPx = annPosPx[axLetter];\n            var basePx;\n            var textPadShift;\n            var alignPosition;\n            var autoAlignFraction;\n            var textShift;\n\n            /*\n             * calculate the *primary* pixel position\n             * which is the arrowhead if there is one,\n             * otherwise the text anchor point\n             */\n            if(ax) {\n                // check if annotation is off screen, to bypass DOM manipulations\n                var posFraction = ax.r2fraction(options[axLetter]);\n                if(posFraction < 0 || posFraction > 1) {\n                    if(tailRef === axRef) {\n                        posFraction = ax.r2fraction(options['a' + axLetter]);\n                        if(posFraction < 0 || posFraction > 1) {\n                            annotationIsOffscreen = true;\n                        }\n                    } else {\n                        annotationIsOffscreen = true;\n                    }\n                }\n                basePx = ax._offset + ax.r2p(options[axLetter]);\n                autoAlignFraction = 0.5;\n            } else {\n                if(axLetter === 'x') {\n                    alignPosition = options[axLetter];\n                    basePx = gs.l + gs.w * alignPosition;\n                } else {\n                    alignPosition = 1 - options[axLetter];\n                    basePx = gs.t + gs.h * alignPosition;\n                }\n                autoAlignFraction = options.showarrow ? 0.5 : alignPosition;\n            }\n\n            // now translate this into pixel positions of head, tail, and text\n            // as well as paddings for autorange\n            if(options.showarrow) {\n                posPx.head = basePx;\n\n                var arrowLength = options['a' + axLetter];\n\n                // with an arrow, the text rotates around the anchor point\n                textShift = annSizeFromWidth * shiftFraction(0.5, options.xanchor) -\n                    annSizeFromHeight * shiftFraction(0.5, options.yanchor);\n\n                if(tailRef === axRef) {\n                    posPx.tail = ax._offset + ax.r2p(arrowLength);\n                    // tail is data-referenced: autorange pads the text in px from the tail\n                    textPadShift = textShift;\n                } else {\n                    posPx.tail = basePx + arrowLength;\n                    // tail is specified in px from head, so autorange also pads vs head\n                    textPadShift = textShift + arrowLength;\n                }\n\n                posPx.text = posPx.tail + textShift;\n\n                // constrain pixel/paper referenced so the draggers are at least\n                // partially visible\n                var maxPx = fullLayout[(axLetter === 'x') ? 'width' : 'height'];\n                if(axRef === 'paper') {\n                    posPx.head = Lib.constrain(posPx.head, 1, maxPx - 1);\n                }\n                if(tailRef === 'pixel') {\n                    var shiftPlus = -Math.max(posPx.tail - 3, posPx.text);\n                    var shiftMinus = Math.min(posPx.tail + 3, posPx.text) - maxPx;\n                    if(shiftPlus > 0) {\n                        posPx.tail += shiftPlus;\n                        posPx.text += shiftPlus;\n                    } else if(shiftMinus > 0) {\n                        posPx.tail -= shiftMinus;\n                        posPx.text -= shiftMinus;\n                    }\n                }\n\n                posPx.tail += overallShift;\n                posPx.head += overallShift;\n            } else {\n                // with no arrow, the text rotates and *then* we put the anchor\n                // relative to the new bounding box\n                textShift = annSize * shiftFraction(autoAlignFraction, anchor);\n                textPadShift = textShift;\n                posPx.text = basePx + textShift;\n            }\n\n            posPx.text += overallShift;\n            textShift += overallShift;\n            textPadShift += overallShift;\n\n            // padplus/minus are used by autorange\n            options['_' + axLetter + 'padplus'] = (annSize / 2) + textPadShift;\n            options['_' + axLetter + 'padminus'] = (annSize / 2) - textPadShift;\n\n            // size/shift are used during dragging\n            options['_' + axLetter + 'size'] = annSize;\n            options['_' + axLetter + 'shift'] = textShift;\n        }\n\n        if(annotationIsOffscreen) {\n            annTextGroupInner.remove();\n            return;\n        }\n\n        var xShift = 0;\n        var yShift = 0;\n\n        if(options.align !== 'left') {\n            xShift = (annWidth - textWidth) * (options.align === 'center' ? 0.5 : 1);\n        }\n        if(options.valign !== 'top') {\n            yShift = (annHeight - textHeight) * (options.valign === 'middle' ? 0.5 : 1);\n        }\n\n        if(hasMathjax) {\n            mathjaxGroup.select('svg').attr({\n                x: borderfull + xShift - 1,\n                y: borderfull + yShift\n            })\n            .call(Drawing.setClipUrl, isSizeConstrained ? annClipID : null, gd);\n        } else {\n            var texty = borderfull + yShift - anntextBB.top;\n            var textx = borderfull + xShift - anntextBB.left;\n\n            annText.call(svgTextUtils.positionText, textx, texty)\n                .call(Drawing.setClipUrl, isSizeConstrained ? annClipID : null, gd);\n        }\n\n        annTextClip.select('rect').call(Drawing.setRect, borderfull, borderfull,\n            annWidth, annHeight);\n\n        annTextBG.call(Drawing.setRect, borderwidth / 2, borderwidth / 2,\n            outerWidth - borderwidth, outerHeight - borderwidth);\n\n        annTextGroupInner.call(Drawing.setTranslate,\n            Math.round(annPosPx.x.text - outerWidth / 2),\n            Math.round(annPosPx.y.text - outerHeight / 2));\n\n        /*\n         * rotate text and background\n         * we already calculated the text center position *as rotated*\n         * because we needed that for autoranging anyway, so now whether\n         * we have an arrow or not, we rotate about the text center.\n         */\n        annTextGroup.attr({transform: 'rotate(' + textangle + ',' +\n                            annPosPx.x.text + ',' + annPosPx.y.text + ')'});\n\n        /*\n         * add the arrow\n         * uses options[arrowwidth,arrowcolor,arrowhead] for styling\n         * dx and dy are normally zero, but when you are dragging the textbox\n         * while the head stays put, dx and dy are the pixel offsets\n         */\n        var drawArrow = function(dx, dy) {\n            annGroup\n                .selectAll('.annotation-arrow-g')\n                .remove();\n\n            var headX = annPosPx.x.head;\n            var headY = annPosPx.y.head;\n            var tailX = annPosPx.x.tail + dx;\n            var tailY = annPosPx.y.tail + dy;\n            var textX = annPosPx.x.text + dx;\n            var textY = annPosPx.y.text + dy;\n\n            // find the edge of the text box, where we'll start the arrow:\n            // create transform matrix to rotate the text box corners\n            var transform = Lib.rotationXYMatrix(textangle, textX, textY);\n            var applyTransform = Lib.apply2DTransform(transform);\n            var applyTransform2 = Lib.apply2DTransform2(transform);\n\n            // calculate and transform bounding box\n            var width = +annTextBG.attr('width');\n            var height = +annTextBG.attr('height');\n            var xLeft = textX - 0.5 * width;\n            var xRight = xLeft + width;\n            var yTop = textY - 0.5 * height;\n            var yBottom = yTop + height;\n            var edges = [\n                [xLeft, yTop, xLeft, yBottom],\n                [xLeft, yBottom, xRight, yBottom],\n                [xRight, yBottom, xRight, yTop],\n                [xRight, yTop, xLeft, yTop]\n            ].map(applyTransform2);\n\n            // Remove the line if it ends inside the box.  Use ray\n            // casting for rotated boxes: see which edges intersect a\n            // line from the arrowhead to far away and reduce with xor\n            // to get the parity of the number of intersections.\n            if(edges.reduce(function(a, x) {\n                return a ^\n                    !!Lib.segmentsIntersect(headX, headY, headX + 1e6, headY + 1e6,\n                            x[0], x[1], x[2], x[3]);\n            }, false)) {\n                // no line or arrow - so quit drawArrow now\n                return;\n            }\n\n            edges.forEach(function(x) {\n                var p = Lib.segmentsIntersect(tailX, tailY, headX, headY,\n                            x[0], x[1], x[2], x[3]);\n                if(p) {\n                    tailX = p.x;\n                    tailY = p.y;\n                }\n            });\n\n            var strokewidth = options.arrowwidth;\n            var arrowColor = options.arrowcolor;\n            var arrowSide = options.arrowside;\n\n            var arrowGroup = annGroup.append('g')\n                .style({opacity: Color.opacity(arrowColor)})\n                .classed('annotation-arrow-g', true);\n\n            var arrow = arrowGroup.append('path')\n                .attr('d', 'M' + tailX + ',' + tailY + 'L' + headX + ',' + headY)\n                .style('stroke-width', strokewidth + 'px')\n                .call(Color.stroke, Color.rgb(arrowColor));\n\n            drawArrowHead(arrow, arrowSide, options);\n\n            // the arrow dragger is a small square right at the head, then a line to the tail,\n            // all expanded by a stroke width of 6px plus the arrow line width\n            if(edits.annotationPosition && arrow.node().parentNode && !subplotId) {\n                var arrowDragHeadX = headX;\n                var arrowDragHeadY = headY;\n                if(options.standoff) {\n                    var arrowLength = Math.sqrt(Math.pow(headX - tailX, 2) + Math.pow(headY - tailY, 2));\n                    arrowDragHeadX += options.standoff * (tailX - headX) / arrowLength;\n                    arrowDragHeadY += options.standoff * (tailY - headY) / arrowLength;\n                }\n                var arrowDrag = arrowGroup.append('path')\n                    .classed('annotation-arrow', true)\n                    .classed('anndrag', true)\n                    .classed('cursor-move', true)\n                    .attr({\n                        d: 'M3,3H-3V-3H3ZM0,0L' + (tailX - arrowDragHeadX) + ',' + (tailY - arrowDragHeadY),\n                        transform: 'translate(' + arrowDragHeadX + ',' + arrowDragHeadY + ')'\n                    })\n                    .style('stroke-width', (strokewidth + 6) + 'px')\n                    .call(Color.stroke, 'rgba(0,0,0,0)')\n                    .call(Color.fill, 'rgba(0,0,0,0)');\n\n                var annx0, anny0;\n\n                // dragger for the arrow & head: translates the whole thing\n                // (head/tail/text) all together\n                dragElement.init({\n                    element: arrowDrag.node(),\n                    gd: gd,\n                    prepFn: function() {\n                        var pos = Drawing.getTranslate(annTextGroupInner);\n\n                        annx0 = pos.x;\n                        anny0 = pos.y;\n                        if(xa && xa.autorange) {\n                            modifyBase(xa._name + '.autorange', true);\n                        }\n                        if(ya && ya.autorange) {\n                            modifyBase(ya._name + '.autorange', true);\n                        }\n                    },\n                    moveFn: function(dx, dy) {\n                        var annxy0 = applyTransform(annx0, anny0);\n                        var xcenter = annxy0[0] + dx;\n                        var ycenter = annxy0[1] + dy;\n                        annTextGroupInner.call(Drawing.setTranslate, xcenter, ycenter);\n\n                        modifyItem('x', xa ?\n                            xa.p2r(xa.r2p(options.x) + dx) :\n                            (options.x + (dx / gs.w)));\n                        modifyItem('y', ya ?\n                            ya.p2r(ya.r2p(options.y) + dy) :\n                            (options.y - (dy / gs.h)));\n\n                        if(options.axref === options.xref) {\n                            modifyItem('ax', xa.p2r(xa.r2p(options.ax) + dx));\n                        }\n\n                        if(options.ayref === options.yref) {\n                            modifyItem('ay', ya.p2r(ya.r2p(options.ay) + dy));\n                        }\n\n                        arrowGroup.attr('transform', 'translate(' + dx + ',' + dy + ')');\n                        annTextGroup.attr({\n                            transform: 'rotate(' + textangle + ',' +\n                                   xcenter + ',' + ycenter + ')'\n                        });\n                    },\n                    doneFn: function() {\n                        Registry.call('_guiRelayout', gd, getUpdateObj());\n                        var notesBox = document.querySelector('.js-notes-box-panel');\n                        if(notesBox) notesBox.redraw(notesBox.selectedObj);\n                    }\n                });\n            }\n        };\n\n        if(options.showarrow) drawArrow(0, 0);\n\n        // user dragging the annotation (text, not arrow)\n        if(editTextPosition) {\n            var baseTextTransform;\n\n            // dragger for the textbox: if there's an arrow, just drag the\n            // textbox and tail, leave the head untouched\n            dragElement.init({\n                element: annTextGroupInner.node(),\n                gd: gd,\n                prepFn: function() {\n                    baseTextTransform = annTextGroup.attr('transform');\n                },\n                moveFn: function(dx, dy) {\n                    var csr = 'pointer';\n                    if(options.showarrow) {\n                        if(options.axref === options.xref) {\n                            modifyItem('ax', xa.p2r(xa.r2p(options.ax) + dx));\n                        } else {\n                            modifyItem('ax', options.ax + dx);\n                        }\n\n                        if(options.ayref === options.yref) {\n                            modifyItem('ay', ya.p2r(ya.r2p(options.ay) + dy));\n                        } else {\n                            modifyItem('ay', options.ay + dy);\n                        }\n\n                        drawArrow(dx, dy);\n                    } else if(!subplotId) {\n                        var xUpdate, yUpdate;\n                        if(xa) {\n                            xUpdate = xa.p2r(xa.r2p(options.x) + dx);\n                        } else {\n                            var widthFraction = options._xsize / gs.w;\n                            var xLeft = options.x + (options._xshift - options.xshift) / gs.w - widthFraction / 2;\n\n                            xUpdate = dragElement.align(xLeft + dx / gs.w,\n                                widthFraction, 0, 1, options.xanchor);\n                        }\n\n                        if(ya) {\n                            yUpdate = ya.p2r(ya.r2p(options.y) + dy);\n                        } else {\n                            var heightFraction = options._ysize / gs.h;\n                            var yBottom = options.y - (options._yshift + options.yshift) / gs.h - heightFraction / 2;\n\n                            yUpdate = dragElement.align(yBottom - dy / gs.h,\n                                heightFraction, 0, 1, options.yanchor);\n                        }\n                        modifyItem('x', xUpdate);\n                        modifyItem('y', yUpdate);\n                        if(!xa || !ya) {\n                            csr = dragElement.getCursor(\n                                xa ? 0.5 : xUpdate,\n                                ya ? 0.5 : yUpdate,\n                                options.xanchor, options.yanchor\n                            );\n                        }\n                    } else return;\n\n                    annTextGroup.attr({\n                        transform: 'translate(' + dx + ',' + dy + ')' + baseTextTransform\n                    });\n\n                    setCursor(annTextGroupInner, csr);\n                },\n                clickFn: function(_, initialEvent) {\n                    if(options.captureevents) {\n                        gd.emit('plotly_clickannotation', makeEventData(initialEvent));\n                    }\n                },\n                doneFn: function() {\n                    setCursor(annTextGroupInner);\n                    Registry.call('_guiRelayout', gd, getUpdateObj());\n                    var notesBox = document.querySelector('.js-notes-box-panel');\n                    if(notesBox) notesBox.redraw(notesBox.selectedObj);\n                }\n            });\n        }\n    }\n\n    if(edits.annotationText) {\n        annText.call(svgTextUtils.makeEditable, {delegate: annTextGroupInner, gd: gd})\n            .call(textLayout)\n            .on('edit', function(_text) {\n                options.text = _text;\n\n                this.call(textLayout);\n\n                modifyItem('text', _text);\n\n                if(xa && xa.autorange) {\n                    modifyBase(xa._name + '.autorange', true);\n                }\n                if(ya && ya.autorange) {\n                    modifyBase(ya._name + '.autorange', true);\n                }\n\n                Registry.call('_guiRelayout', gd, getUpdateObj());\n            });\n    } else annText.call(textLayout);\n}\n\n},{\"../../lib\":178,\"../../lib/setcursor\":197,\"../../lib/svg_text_utils\":199,\"../../plot_api/plot_template\":212,\"../../plots/cartesian/axes\":222,\"../../plots/plots\":256,\"../../registry\":269,\"../color\":52,\"../dragelement\":71,\"../drawing\":74,\"../fx\":92,\"./draw_arrow_head\":44,\"d3\":16}],44:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Color = _dereq_('../color');\n\nvar ARROWPATHS = _dereq_('./arrow_paths');\n\n/**\n * Add arrowhead(s) to a path or line element\n *\n * @param {d3.selection} el3: a d3-selected line or path element\n *\n * @param {string} ends: 'none', 'start', 'end', or 'start+end' for which ends get arrowheads\n *\n * @param {object} options: style information. Must have all the following:\n * @param {number} options.arrowhead: end head style - see ./arrow_paths\n * @param {number} options.startarrowhead: start head style - see ./arrow_paths\n * @param {number} options.arrowsize: relative size of the end head vs line width\n * @param {number} options.startarrowsize: relative size of the start head vs line width\n * @param {number} options.standoff: distance in px to move the end arrow point from its target\n * @param {number} options.startstandoff: distance in px to move the start arrow point from its target\n * @param {number} options.arrowwidth: width of the arrow line\n * @param {string} options.arrowcolor: color of the arrow line, for the head to match\n *     Note that the opacity of this color is ignored, as it's assumed the container\n *     of both the line and head has opacity applied to it so there isn't greater opacity\n *     where they overlap.\n */\nmodule.exports = function drawArrowHead(el3, ends, options) {\n    var el = el3.node();\n    var headStyle = ARROWPATHS[options.arrowhead || 0];\n    var startHeadStyle = ARROWPATHS[options.startarrowhead || 0];\n    var scale = (options.arrowwidth || 1) * (options.arrowsize || 1);\n    var startScale = (options.arrowwidth || 1) * (options.startarrowsize || 1);\n    var doStart = ends.indexOf('start') >= 0;\n    var doEnd = ends.indexOf('end') >= 0;\n    var backOff = headStyle.backoff * scale + options.standoff;\n    var startBackOff = startHeadStyle.backoff * startScale + options.startstandoff;\n\n    var start, end, startRot, endRot;\n\n    if(el.nodeName === 'line') {\n        start = {x: +el3.attr('x1'), y: +el3.attr('y1')};\n        end = {x: +el3.attr('x2'), y: +el3.attr('y2')};\n\n        var dx = start.x - end.x;\n        var dy = start.y - end.y;\n\n        startRot = Math.atan2(dy, dx);\n        endRot = startRot + Math.PI;\n        if(backOff && startBackOff) {\n            if(backOff + startBackOff > Math.sqrt(dx * dx + dy * dy)) {\n                hideLine();\n                return;\n            }\n        }\n\n        if(backOff) {\n            if(backOff * backOff > dx * dx + dy * dy) {\n                hideLine();\n                return;\n            }\n            var backOffX = backOff * Math.cos(startRot);\n            var backOffY = backOff * Math.sin(startRot);\n\n            end.x += backOffX;\n            end.y += backOffY;\n            el3.attr({x2: end.x, y2: end.y});\n        }\n\n        if(startBackOff) {\n            if(startBackOff * startBackOff > dx * dx + dy * dy) {\n                hideLine();\n                return;\n            }\n            var startBackOffX = startBackOff * Math.cos(startRot);\n            var startbackOffY = startBackOff * Math.sin(startRot);\n\n            start.x -= startBackOffX;\n            start.y -= startbackOffY;\n            el3.attr({x1: start.x, y1: start.y});\n        }\n    } else if(el.nodeName === 'path') {\n        var pathlen = el.getTotalLength();\n        // using dash to hide the backOff region of the path.\n        // if we ever allow dash for the arrow we'll have to\n        // do better than this hack... maybe just manually\n        // combine the two\n        var dashArray = '';\n\n        if(pathlen < backOff + startBackOff) {\n            hideLine();\n            return;\n        }\n\n\n        var start0 = el.getPointAtLength(0);\n        var dstart = el.getPointAtLength(0.1);\n\n        startRot = Math.atan2(start0.y - dstart.y, start0.x - dstart.x);\n        start = el.getPointAtLength(Math.min(startBackOff, pathlen));\n\n        dashArray = '0px,' + startBackOff + 'px,';\n\n        var end0 = el.getPointAtLength(pathlen);\n        var dend = el.getPointAtLength(pathlen - 0.1);\n\n        endRot = Math.atan2(end0.y - dend.y, end0.x - dend.x);\n        end = el.getPointAtLength(Math.max(0, pathlen - backOff));\n\n        var shortening = dashArray ? startBackOff + backOff : backOff;\n        dashArray += (pathlen - shortening) + 'px,' + pathlen + 'px';\n\n        el3.style('stroke-dasharray', dashArray);\n    }\n\n    function hideLine() { el3.style('stroke-dasharray', '0px,100px'); }\n\n    function drawhead(arrowHeadStyle, p, rot, arrowScale) {\n        if(!arrowHeadStyle.path) return;\n        if(arrowHeadStyle.noRotate) rot = 0;\n\n        d3.select(el.parentNode).append('path')\n            .attr({\n                'class': el3.attr('class'),\n                d: arrowHeadStyle.path,\n                transform:\n                    'translate(' + p.x + ',' + p.y + ')' +\n                    (rot ? 'rotate(' + (rot * 180 / Math.PI) + ')' : '') +\n                    'scale(' + arrowScale + ')'\n            })\n            .style({\n                fill: Color.rgb(options.arrowcolor),\n                'stroke-width': 0\n            });\n    }\n\n    if(doStart) drawhead(startHeadStyle, start, startRot, startScale);\n    if(doEnd) drawhead(headStyle, end, endRot, scale);\n};\n\n},{\"../color\":52,\"./arrow_paths\":36,\"d3\":16}],45:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar drawModule = _dereq_('./draw');\nvar clickModule = _dereq_('./click');\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'annotations',\n\n    layoutAttributes: _dereq_('./attributes'),\n    supplyLayoutDefaults: _dereq_('./defaults'),\n    includeBasePlot: _dereq_('../../plots/cartesian/include_components')('annotations'),\n\n    calcAutorange: _dereq_('./calc_autorange'),\n    draw: drawModule.draw,\n    drawOne: drawModule.drawOne,\n    drawRaw: drawModule.drawRaw,\n\n    hasClickToShow: clickModule.hasClickToShow,\n    onClick: clickModule.onClick,\n\n    convertCoords: _dereq_('./convert_coords')\n};\n\n},{\"../../plots/cartesian/include_components\":234,\"./attributes\":37,\"./calc_autorange\":38,\"./click\":39,\"./convert_coords\":41,\"./defaults\":42,\"./draw\":43}],46:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar annAttrs = _dereq_('../annotations/attributes');\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nmodule.exports = overrideAll(templatedArray('annotation', {\n    visible: annAttrs.visible,\n    x: {\n        valType: 'any',\n        \n        \n    },\n    y: {\n        valType: 'any',\n        \n        \n    },\n    z: {\n        valType: 'any',\n        \n        \n    },\n    ax: {\n        valType: 'number',\n        \n        \n    },\n    ay: {\n        valType: 'number',\n        \n        \n    },\n\n    xanchor: annAttrs.xanchor,\n    xshift: annAttrs.xshift,\n    yanchor: annAttrs.yanchor,\n    yshift: annAttrs.yshift,\n\n    text: annAttrs.text,\n    textangle: annAttrs.textangle,\n    font: annAttrs.font,\n    width: annAttrs.width,\n    height: annAttrs.height,\n    opacity: annAttrs.opacity,\n    align: annAttrs.align,\n    valign: annAttrs.valign,\n    bgcolor: annAttrs.bgcolor,\n    bordercolor: annAttrs.bordercolor,\n    borderpad: annAttrs.borderpad,\n    borderwidth: annAttrs.borderwidth,\n    showarrow: annAttrs.showarrow,\n    arrowcolor: annAttrs.arrowcolor,\n    arrowhead: annAttrs.arrowhead,\n    startarrowhead: annAttrs.startarrowhead,\n    arrowside: annAttrs.arrowside,\n    arrowsize: annAttrs.arrowsize,\n    startarrowsize: annAttrs.startarrowsize,\n    arrowwidth: annAttrs.arrowwidth,\n    standoff: annAttrs.standoff,\n    startstandoff: annAttrs.startstandoff,\n    hovertext: annAttrs.hovertext,\n    hoverlabel: annAttrs.hoverlabel,\n    captureevents: annAttrs.captureevents,\n\n    // maybes later?\n    // clicktoshow: annAttrs.clicktoshow,\n    // xclick: annAttrs.xclick,\n    // yclick: annAttrs.yclick,\n\n    // not needed!\n    // axref: 'pixel'\n    // ayref: 'pixel'\n    // xref: 'x'\n    // yref: 'y\n    // zref: 'z'\n}), 'calc', 'from-root');\n\n},{\"../../plot_api/edit_types\":205,\"../../plot_api/plot_template\":212,\"../annotations/attributes\":37}],47:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nmodule.exports = function convert(scene) {\n    var fullSceneLayout = scene.fullSceneLayout;\n    var anns = fullSceneLayout.annotations;\n\n    for(var i = 0; i < anns.length; i++) {\n        mockAnnAxes(anns[i], scene);\n    }\n\n    scene.fullLayout._infolayer\n        .selectAll('.annotation-' + scene.id)\n        .remove();\n};\n\nfunction mockAnnAxes(ann, scene) {\n    var fullSceneLayout = scene.fullSceneLayout;\n    var domain = fullSceneLayout.domain;\n    var size = scene.fullLayout._size;\n\n    var base = {\n        // this gets fill in on render\n        pdata: null,\n\n        // to get setConvert to not execute cleanly\n        type: 'linear',\n\n        // don't try to update them on `editable: true`\n        autorange: false,\n\n        // set infinite range so that annotation draw routine\n        // does not try to remove 'outside-range' annotations,\n        // this case is handled in the render loop\n        range: [-Infinity, Infinity]\n    };\n\n    ann._xa = {};\n    Lib.extendFlat(ann._xa, base);\n    Axes.setConvert(ann._xa);\n    ann._xa._offset = size.l + domain.x[0] * size.w;\n    ann._xa.l2p = function() {\n        return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);\n    };\n\n    ann._ya = {};\n    Lib.extendFlat(ann._ya, base);\n    Axes.setConvert(ann._ya);\n    ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;\n    ann._ya.l2p = function() {\n        return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);\n    };\n}\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222}],48:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\nvar handleAnnotationCommonDefaults = _dereq_('../annotations/common_defaults');\nvar attributes = _dereq_('./attributes');\n\nmodule.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {\n    handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {\n        name: 'annotations',\n        handleItemDefaults: handleAnnotationDefaults,\n        fullLayout: opts.fullLayout\n    });\n};\n\nfunction handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(annIn, annOut, attributes, attr, dflt);\n    }\n\n    function coercePosition(axLetter) {\n        var axName = axLetter + 'axis';\n\n        // mock in such way that getFromId grabs correct 3D axis\n        var gdMock = { _fullLayout: {} };\n        gdMock._fullLayout[axName] = sceneLayout[axName];\n\n        return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);\n    }\n\n\n    var visible = coerce('visible');\n    if(!visible) return;\n\n    handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);\n\n    coercePosition('x');\n    coercePosition('y');\n    coercePosition('z');\n\n    // if you have one coordinate you should all three\n    Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);\n\n    // hard-set here for completeness\n    annOut.xref = 'x';\n    annOut.yref = 'y';\n    annOut.zref = 'z';\n\n    coerce('xanchor');\n    coerce('yanchor');\n    coerce('xshift');\n    coerce('yshift');\n\n    if(annOut.showarrow) {\n        annOut.axref = 'pixel';\n        annOut.ayref = 'pixel';\n\n        // TODO maybe default values should be bigger than the 2D case?\n        coerce('ax', -10);\n        coerce('ay', -30);\n\n        // if you have one part of arrow length you should have both\n        Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);\n    }\n}\n\n},{\"../../lib\":178,\"../../plots/array_container_defaults\":218,\"../../plots/cartesian/axes\":222,\"../annotations/common_defaults\":40,\"./attributes\":46}],49:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar drawRaw = _dereq_('../annotations/draw').drawRaw;\nvar project = _dereq_('../../plots/gl3d/project');\nvar axLetters = ['x', 'y', 'z'];\n\nmodule.exports = function draw(scene) {\n    var fullSceneLayout = scene.fullSceneLayout;\n    var dataScale = scene.dataScale;\n    var anns = fullSceneLayout.annotations;\n\n    for(var i = 0; i < anns.length; i++) {\n        var ann = anns[i];\n        var annotationIsOffscreen = false;\n\n        for(var j = 0; j < 3; j++) {\n            var axLetter = axLetters[j];\n            var pos = ann[axLetter];\n            var ax = fullSceneLayout[axLetter + 'axis'];\n            var posFraction = ax.r2fraction(pos);\n\n            if(posFraction < 0 || posFraction > 1) {\n                annotationIsOffscreen = true;\n                break;\n            }\n        }\n\n        if(annotationIsOffscreen) {\n            scene.fullLayout._infolayer\n                .select('.annotation-' + scene.id + '[data-index=\"' + i + '\"]')\n                .remove();\n        } else {\n            ann._pdata = project(scene.glplot.cameraParams, [\n                fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],\n                fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],\n                fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]\n            ]);\n\n            drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);\n        }\n    }\n};\n\n},{\"../../plots/gl3d/project\":253,\"../annotations/draw\":43}],50:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'annotations3d',\n\n    schema: {\n        subplots: {\n            scene: {annotations: _dereq_('./attributes')}\n        }\n    },\n\n    layoutAttributes: _dereq_('./attributes'),\n    handleDefaults: _dereq_('./defaults'),\n    includeBasePlot: includeGL3D,\n\n    convert: _dereq_('./convert'),\n    draw: _dereq_('./draw')\n};\n\nfunction includeGL3D(layoutIn, layoutOut) {\n    var GL3D = Registry.subplotsRegistry.gl3d;\n    if(!GL3D) return;\n\n    var attrRegex = GL3D.attrRegex;\n\n    var keys = Object.keys(layoutIn);\n    for(var i = 0; i < keys.length; i++) {\n        var k = keys[i];\n        if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {\n            Lib.pushUnique(layoutOut._basePlotModules, GL3D);\n            Lib.pushUnique(layoutOut._subplots.gl3d, k);\n        }\n    }\n}\n\n},{\"../../lib\":178,\"../../registry\":269,\"./attributes\":46,\"./convert\":47,\"./defaults\":48,\"./draw\":49}],51:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\n// IMPORTANT - default colors should be in hex for compatibility\nexports.defaults = [\n    '#1f77b4',  // muted blue\n    '#ff7f0e',  // safety orange\n    '#2ca02c',  // cooked asparagus green\n    '#d62728',  // brick red\n    '#9467bd',  // muted purple\n    '#8c564b',  // chestnut brown\n    '#e377c2',  // raspberry yogurt pink\n    '#7f7f7f',  // middle gray\n    '#bcbd22',  // curry yellow-green\n    '#17becf'   // blue-teal\n];\n\nexports.defaultLine = '#444';\n\nexports.lightLine = '#eee';\n\nexports.background = '#fff';\n\nexports.borderLine = '#BEC8D9';\n\n// with axis.color and Color.interp we aren't using lightLine\n// itself anymore, instead interpolating between axis.color\n// and the background color using tinycolor.mix. lightFraction\n// gives back exactly lightLine if the other colors are defaults.\nexports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4);\n\n},{}],52:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar tinycolor = _dereq_('tinycolor2');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar color = module.exports = {};\n\nvar colorAttrs = _dereq_('./attributes');\ncolor.defaults = colorAttrs.defaults;\nvar defaultLine = color.defaultLine = colorAttrs.defaultLine;\ncolor.lightLine = colorAttrs.lightLine;\nvar background = color.background = colorAttrs.background;\n\n/*\n * tinyRGB: turn a tinycolor into an rgb string, but\n * unlike the built-in tinycolor.toRgbString this never includes alpha\n */\ncolor.tinyRGB = function(tc) {\n    var c = tc.toRgb();\n    return 'rgb(' + Math.round(c.r) + ', ' +\n        Math.round(c.g) + ', ' + Math.round(c.b) + ')';\n};\n\ncolor.rgb = function(cstr) { return color.tinyRGB(tinycolor(cstr)); };\n\ncolor.opacity = function(cstr) { return cstr ? tinycolor(cstr).getAlpha() : 0; };\n\ncolor.addOpacity = function(cstr, op) {\n    var c = tinycolor(cstr).toRgb();\n    return 'rgba(' + Math.round(c.r) + ', ' +\n        Math.round(c.g) + ', ' + Math.round(c.b) + ', ' + op + ')';\n};\n\n// combine two colors into one apparent color\n// if back has transparency or is missing,\n// color.background is assumed behind it\ncolor.combine = function(front, back) {\n    var fc = tinycolor(front).toRgb();\n    if(fc.a === 1) return tinycolor(front).toRgbString();\n\n    var bc = tinycolor(back || background).toRgb();\n    var bcflat = bc.a === 1 ? bc : {\n        r: 255 * (1 - bc.a) + bc.r * bc.a,\n        g: 255 * (1 - bc.a) + bc.g * bc.a,\n        b: 255 * (1 - bc.a) + bc.b * bc.a\n    };\n    var fcflat = {\n        r: bcflat.r * (1 - fc.a) + fc.r * fc.a,\n        g: bcflat.g * (1 - fc.a) + fc.g * fc.a,\n        b: bcflat.b * (1 - fc.a) + fc.b * fc.a\n    };\n    return tinycolor(fcflat).toRgbString();\n};\n\n/*\n * Create a color that contrasts with cstr.\n *\n * If cstr is a dark color, we lighten it; if it's light, we darken.\n *\n * If lightAmount / darkAmount are used, we adjust by these percentages,\n * otherwise we go all the way to white or black.\n */\ncolor.contrast = function(cstr, lightAmount, darkAmount) {\n    var tc = tinycolor(cstr);\n\n    if(tc.getAlpha() !== 1) tc = tinycolor(color.combine(cstr, background));\n\n    var newColor = tc.isDark() ?\n        (lightAmount ? tc.lighten(lightAmount) : background) :\n        (darkAmount ? tc.darken(darkAmount) : defaultLine);\n\n    return newColor.toString();\n};\n\ncolor.stroke = function(s, c) {\n    var tc = tinycolor(c);\n    s.style({'stroke': color.tinyRGB(tc), 'stroke-opacity': tc.getAlpha()});\n};\n\ncolor.fill = function(s, c) {\n    var tc = tinycolor(c);\n    s.style({\n        'fill': color.tinyRGB(tc),\n        'fill-opacity': tc.getAlpha()\n    });\n};\n\n// search container for colors with the deprecated rgb(fractions) format\n// and convert them to rgb(0-255 values)\ncolor.clean = function(container) {\n    if(!container || typeof container !== 'object') return;\n\n    var keys = Object.keys(container);\n    var i, j, key, val;\n\n    for(i = 0; i < keys.length; i++) {\n        key = keys[i];\n        val = container[key];\n\n        if(key.substr(key.length - 5) === 'color') {\n            // only sanitize keys that end in \"color\" or \"colorscale\"\n\n            if(Array.isArray(val)) {\n                for(j = 0; j < val.length; j++) val[j] = cleanOne(val[j]);\n            } else container[key] = cleanOne(val);\n        } else if(key.substr(key.length - 10) === 'colorscale' && Array.isArray(val)) {\n            // colorscales have the format [[0, color1], [frac, color2], ... [1, colorN]]\n\n            for(j = 0; j < val.length; j++) {\n                if(Array.isArray(val[j])) val[j][1] = cleanOne(val[j][1]);\n            }\n        } else if(Array.isArray(val)) {\n            // recurse into arrays of objects, and plain objects\n\n            var el0 = val[0];\n            if(!Array.isArray(el0) && el0 && typeof el0 === 'object') {\n                for(j = 0; j < val.length; j++) color.clean(val[j]);\n            }\n        } else if(val && typeof val === 'object') color.clean(val);\n    }\n};\n\nfunction cleanOne(val) {\n    if(isNumeric(val) || typeof val !== 'string') return val;\n\n    var valTrim = val.trim();\n    if(valTrim.substr(0, 3) !== 'rgb') return val;\n\n    var match = valTrim.match(/^rgba?\\s*\\(([^()]*)\\)$/);\n    if(!match) return val;\n\n    var parts = match[1].trim().split(/\\s*[\\s,]\\s*/);\n    var rgba = valTrim.charAt(3) === 'a' && parts.length === 4;\n    if(!rgba && parts.length !== 3) return val;\n\n    for(var i = 0; i < parts.length; i++) {\n        if(!parts[i].length) return val;\n        parts[i] = Number(parts[i]);\n\n        if(!(parts[i] >= 0)) {\n            // all parts must be non-negative numbers\n\n            return val;\n        }\n\n        if(i === 3) {\n            // alpha>1 gets clipped to 1\n\n            if(parts[i] > 1) parts[i] = 1;\n        } else if(parts[i] >= 1) {\n            // r, g, b must be < 1 (ie 1 itself is not allowed)\n\n            return val;\n        }\n    }\n\n    var rgbStr = Math.round(parts[0] * 255) + ', ' +\n        Math.round(parts[1] * 255) + ', ' +\n        Math.round(parts[2] * 255);\n\n    if(rgba) return 'rgba(' + rgbStr + ', ' + parts[3] + ')';\n    return 'rgb(' + rgbStr + ')';\n}\n\n},{\"./attributes\":51,\"fast-isnumeric\":18,\"tinycolor2\":35}],53:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar axesAttrs = _dereq_('../../plots/cartesian/layout_attributes');\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\n\nmodule.exports = overrideAll({\n// TODO: only right is supported currently\n//     orient: {\n//         valType: 'enumerated',\n//         \n//         values: ['left', 'right', 'top', 'bottom'],\n//         dflt: 'right',\n//         \n//     },\n    thicknessmode: {\n        valType: 'enumerated',\n        values: ['fraction', 'pixels'],\n        \n        dflt: 'pixels',\n        \n    },\n    thickness: {\n        valType: 'number',\n        \n        min: 0,\n        dflt: 30,\n        \n    },\n    lenmode: {\n        valType: 'enumerated',\n        values: ['fraction', 'pixels'],\n        \n        dflt: 'fraction',\n        \n    },\n    len: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        \n    },\n    x: {\n        valType: 'number',\n        dflt: 1.02,\n        min: -2,\n        max: 3,\n        \n        \n    },\n    xanchor: {\n        valType: 'enumerated',\n        values: ['left', 'center', 'right'],\n        dflt: 'left',\n        \n        \n    },\n    xpad: {\n        valType: 'number',\n        \n        min: 0,\n        dflt: 10,\n        \n    },\n    y: {\n        valType: 'number',\n        \n        dflt: 0.5,\n        min: -2,\n        max: 3,\n        \n    },\n    yanchor: {\n        valType: 'enumerated',\n        values: ['top', 'middle', 'bottom'],\n        \n        dflt: 'middle',\n        \n    },\n    ypad: {\n        valType: 'number',\n        \n        min: 0,\n        dflt: 10,\n        \n    },\n    // a possible line around the bar itself\n    outlinecolor: axesAttrs.linecolor,\n    outlinewidth: axesAttrs.linewidth,\n    // Should outlinewidth have {dflt: 0} ?\n    // another possible line outside the padding and tick labels\n    bordercolor: axesAttrs.linecolor,\n    borderwidth: {\n        valType: 'number',\n        \n        min: 0,\n        dflt: 0,\n        \n    },\n    bgcolor: {\n        valType: 'color',\n        \n        dflt: 'rgba(0,0,0,0)',\n        \n    },\n    // tick and title properties named and function exactly as in axes\n    tickmode: axesAttrs.tickmode,\n    nticks: axesAttrs.nticks,\n    tick0: axesAttrs.tick0,\n    dtick: axesAttrs.dtick,\n    tickvals: axesAttrs.tickvals,\n    ticktext: axesAttrs.ticktext,\n    ticks: extendFlat({}, axesAttrs.ticks, {dflt: ''}),\n    ticklen: axesAttrs.ticklen,\n    tickwidth: axesAttrs.tickwidth,\n    tickcolor: axesAttrs.tickcolor,\n    showticklabels: axesAttrs.showticklabels,\n    tickfont: fontAttrs({\n        \n    }),\n    tickangle: axesAttrs.tickangle,\n    tickformat: axesAttrs.tickformat,\n    tickformatstops: axesAttrs.tickformatstops,\n    tickprefix: axesAttrs.tickprefix,\n    showtickprefix: axesAttrs.showtickprefix,\n    ticksuffix: axesAttrs.ticksuffix,\n    showticksuffix: axesAttrs.showticksuffix,\n    separatethousands: axesAttrs.separatethousands,\n    exponentformat: axesAttrs.exponentformat,\n    showexponent: axesAttrs.showexponent,\n    title: {\n        text: {\n            valType: 'string',\n            \n            \n        },\n        font: fontAttrs({\n            \n        }),\n        side: {\n            valType: 'enumerated',\n            values: ['right', 'top', 'bottom'],\n            \n            dflt: 'top',\n            \n        }\n    },\n\n    _deprecated: {\n        title: {\n            valType: 'string',\n            \n            \n        },\n        titlefont: fontAttrs({\n            \n        }),\n        titleside: {\n            valType: 'enumerated',\n            values: ['right', 'top', 'bottom'],\n            \n            dflt: 'top',\n            \n        }\n    }\n}, 'colorbars', 'from-root');\n\n},{\"../../lib/extend\":173,\"../../plot_api/edit_types\":205,\"../../plots/cartesian/layout_attributes\":236,\"../../plots/font_attributes\":250}],54:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    cn: {\n        colorbar: 'colorbar',\n        cbbg: 'cbbg',\n        cbfill: 'cbfill',\n        cbfills: 'cbfills',\n        cbline: 'cbline',\n        cblines: 'cblines',\n        cbaxis: 'cbaxis',\n        cbtitleunshift: 'cbtitleunshift',\n        cbtitle: 'cbtitle',\n        cboutline: 'cboutline',\n        crisp: 'crisp',\n        jsPlaceholder: 'js-placeholder'\n    }\n};\n\n},{}],55:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Template = _dereq_('../../plot_api/plot_template');\n\nvar handleTickValueDefaults = _dereq_('../../plots/cartesian/tick_value_defaults');\nvar handleTickMarkDefaults = _dereq_('../../plots/cartesian/tick_mark_defaults');\nvar handleTickLabelDefaults = _dereq_('../../plots/cartesian/tick_label_defaults');\n\nvar attributes = _dereq_('./attributes');\n\nmodule.exports = function colorbarDefaults(containerIn, containerOut, layout) {\n    var colorbarOut = Template.newContainer(containerOut, 'colorbar');\n    var colorbarIn = containerIn.colorbar || {};\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(colorbarIn, colorbarOut, attributes, attr, dflt);\n    }\n\n    var thicknessmode = coerce('thicknessmode');\n    coerce('thickness', (thicknessmode === 'fraction') ?\n        30 / (layout.width - layout.margin.l - layout.margin.r) :\n        30\n    );\n\n    var lenmode = coerce('lenmode');\n    coerce('len', (lenmode === 'fraction') ?\n        1 :\n        layout.height - layout.margin.t - layout.margin.b\n    );\n\n    coerce('x');\n    coerce('xanchor');\n    coerce('xpad');\n    coerce('y');\n    coerce('yanchor');\n    coerce('ypad');\n    Lib.noneOrAll(colorbarIn, colorbarOut, ['x', 'y']);\n\n    coerce('outlinecolor');\n    coerce('outlinewidth');\n    coerce('bordercolor');\n    coerce('borderwidth');\n    coerce('bgcolor');\n\n    handleTickValueDefaults(colorbarIn, colorbarOut, coerce, 'linear');\n\n    var opts = {outerTicks: false, font: layout.font};\n    handleTickLabelDefaults(colorbarIn, colorbarOut, coerce, 'linear', opts);\n    handleTickMarkDefaults(colorbarIn, colorbarOut, coerce, 'linear', opts);\n\n    coerce('title.text', layout._dfltTitle.colorbar);\n    Lib.coerceFont(coerce, 'title.font', layout.font);\n    coerce('title.side');\n};\n\n},{\"../../lib\":178,\"../../plot_api/plot_template\":212,\"../../plots/cartesian/tick_label_defaults\":243,\"../../plots/cartesian/tick_mark_defaults\":244,\"../../plots/cartesian/tick_value_defaults\":245,\"./attributes\":53}],56:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Plots = _dereq_('../../plots/plots');\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar dragElement = _dereq_('../dragelement');\nvar Lib = _dereq_('../../lib');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar setCursor = _dereq_('../../lib/setcursor');\nvar Drawing = _dereq_('../drawing');\nvar Color = _dereq_('../color');\nvar Titles = _dereq_('../titles');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar flipScale = _dereq_('../colorscale/helpers').flipScale;\n\nvar handleAxisDefaults = _dereq_('../../plots/cartesian/axis_defaults');\nvar handleAxisPositionDefaults = _dereq_('../../plots/cartesian/position_defaults');\nvar axisLayoutAttrs = _dereq_('../../plots/cartesian/layout_attributes');\n\nvar alignmentConstants = _dereq_('../../constants/alignment');\nvar LINE_SPACING = alignmentConstants.LINE_SPACING;\nvar FROM_TL = alignmentConstants.FROM_TL;\nvar FROM_BR = alignmentConstants.FROM_BR;\n\nvar cn = _dereq_('./constants').cn;\n\nfunction draw(gd) {\n    var fullLayout = gd._fullLayout;\n\n    var colorBars = fullLayout._infolayer\n        .selectAll('g.' + cn.colorbar)\n        .data(makeColorBarData(gd), function(opts) { return opts._id; });\n\n    colorBars.enter().append('g')\n        .attr('class', function(opts) { return opts._id; })\n        .classed(cn.colorbar, true);\n\n    colorBars.each(function(opts) {\n        var g = d3.select(this);\n\n        Lib.ensureSingle(g, 'rect', cn.cbbg);\n        Lib.ensureSingle(g, 'g', cn.cbfills);\n        Lib.ensureSingle(g, 'g', cn.cblines);\n        Lib.ensureSingle(g, 'g', cn.cbaxis, function(s) { s.classed(cn.crisp, true); });\n        Lib.ensureSingle(g, 'g', cn.cbtitleunshift, function(s) { s.append('g').classed(cn.cbtitle, true); });\n        Lib.ensureSingle(g, 'rect', cn.cboutline);\n\n        var done = drawColorBar(g, opts, gd);\n        if(done && done.then) (gd._promises || []).push(done);\n\n        if(gd._context.edits.colorbarPosition) {\n            makeEditable(g, opts, gd);\n        }\n    });\n\n    colorBars.exit()\n        .each(function(opts) { Plots.autoMargin(gd, opts._id); })\n        .remove();\n\n    colorBars.order();\n}\n\nfunction makeColorBarData(gd) {\n    var fullLayout = gd._fullLayout;\n    var calcdata = gd.calcdata;\n    var out = [];\n\n    // single out item\n    var opts;\n    // colorbar attr parent container\n    var cont;\n    // trace attr container\n    var trace;\n    // colorbar options\n    var cbOpt;\n\n    function initOpts(opts) {\n        return extendFlat(opts, {\n            // fillcolor can be a d3 scale, domain is z values, range is colors\n            // or leave it out for no fill,\n            // or set to a string constant for single-color fill\n            _fillcolor: null,\n            // line.color has the same options as fillcolor\n            _line: {color: null, width: null, dash: null},\n            // levels of lines to draw.\n            // note that this DOES NOT determine the extent of the bar\n            // that's given by the domain of fillcolor\n            // (or line.color if no fillcolor domain)\n            _levels: {start: null, end: null, size: null},\n            // separate fill levels (for example, heatmap coloring of a\n            // contour map) if this is omitted, fillcolors will be\n            // evaluated halfway between levels\n            _filllevels: null,\n            // for continuous colorscales: fill with a gradient instead of explicit levels\n            // value should be the colorscale [[0, c0], [v1, c1], ..., [1, cEnd]]\n            _fillgradient: null,\n            // when using a gradient, we need the data range specified separately\n            _zrange: null\n        });\n    }\n\n    function calcOpts() {\n        if(typeof cbOpt.calc === 'function') {\n            cbOpt.calc(gd, trace, opts);\n        } else {\n            opts._fillgradient = cont.reversescale ?\n                flipScale(cont.colorscale) :\n                cont.colorscale;\n            opts._zrange = [cont[cbOpt.min], cont[cbOpt.max]];\n        }\n    }\n\n    for(var i = 0; i < calcdata.length; i++) {\n        var cd = calcdata[i];\n        trace = cd[0].trace;\n        var moduleOpts = trace._module.colorbar;\n\n        if(trace.visible === true && moduleOpts) {\n            var allowsMultiplotCbs = Array.isArray(moduleOpts);\n            var cbOpts = allowsMultiplotCbs ? moduleOpts : [moduleOpts];\n\n            for(var j = 0; j < cbOpts.length; j++) {\n                cbOpt = cbOpts[j];\n                var contName = cbOpt.container;\n                cont = contName ? trace[contName] : trace;\n\n                if(cont && cont.showscale) {\n                    opts = initOpts(cont.colorbar);\n                    opts._id = 'cb' + trace.uid + (allowsMultiplotCbs && contName ? '-' + contName : '');\n                    opts._traceIndex = trace.index;\n                    opts._propPrefix = (contName ? contName + '.' : '') + 'colorbar.';\n                    opts._meta = trace._meta;\n                    calcOpts();\n                    out.push(opts);\n                }\n            }\n        }\n    }\n\n    for(var k in fullLayout._colorAxes) {\n        cont = fullLayout[k];\n\n        if(cont.showscale) {\n            var colorAxOpts = fullLayout._colorAxes[k];\n\n            opts = initOpts(cont.colorbar);\n            opts._id = 'cb' + k;\n            opts._propPrefix = k + '.colorbar.';\n            opts._meta = fullLayout._meta;\n\n            cbOpt = {min: 'cmin', max: 'cmax'};\n            if(colorAxOpts[0] !== 'heatmap') {\n                trace = colorAxOpts[1];\n                cbOpt.calc = trace._module.colorbar.calc;\n            }\n\n            calcOpts();\n            out.push(opts);\n        }\n    }\n\n    return out;\n}\n\nfunction drawColorBar(g, opts, gd) {\n    var fullLayout = gd._fullLayout;\n    var gs = fullLayout._size;\n\n    var fillColor = opts._fillcolor;\n    var line = opts._line;\n    var title = opts.title;\n    var titleSide = title.side;\n\n    var zrange = opts._zrange ||\n        d3.extent((typeof fillColor === 'function' ? fillColor : line.color).domain());\n\n    var lineColormap = typeof line.color === 'function' ?\n        line.color :\n        function() { return line.color; };\n    var fillColormap = typeof fillColor === 'function' ?\n        fillColor :\n        function() { return fillColor; };\n\n    var levelsIn = opts._levels;\n    var levelsOut = calcLevels(gd, opts, zrange);\n    var fillLevels = levelsOut.fill;\n    var lineLevels = levelsOut.line;\n\n    // we calculate pixel sizes based on the specified graph size,\n    // not the actual (in case something pushed the margins around)\n    // which is a little odd but avoids an odd iterative effect\n    // when the colorbar itself is pushing the margins.\n    // but then the fractional size is calculated based on the\n    // actual graph size, so that the axes will size correctly.\n    var thickPx = Math.round(opts.thickness * (opts.thicknessmode === 'fraction' ? gs.w : 1));\n    var thickFrac = thickPx / gs.w;\n    var lenPx = Math.round(opts.len * (opts.lenmode === 'fraction' ? gs.h : 1));\n    var lenFrac = lenPx / gs.h;\n    var xpadFrac = opts.xpad / gs.w;\n    var yExtraPx = (opts.borderwidth + opts.outlinewidth) / 2;\n    var ypadFrac = opts.ypad / gs.h;\n\n    // x positioning: do it initially just for left anchor,\n    // then fix at the end (since we don't know the width yet)\n    var xLeft = Math.round(opts.x * gs.w + opts.xpad);\n    // for dragging... this is getting a little muddled...\n    var xLeftFrac = opts.x - thickFrac * ({middle: 0.5, right: 1}[opts.xanchor] || 0);\n\n    // y positioning we can do correctly from the start\n    var yBottomFrac = opts.y + lenFrac * (({top: -0.5, bottom: 0.5}[opts.yanchor] || 0) - 0.5);\n    var yBottomPx = Math.round(gs.h * (1 - yBottomFrac));\n    var yTopPx = yBottomPx - lenPx;\n\n    // stash a few things for makeEditable\n    opts._lenFrac = lenFrac;\n    opts._thickFrac = thickFrac;\n    opts._xLeftFrac = xLeftFrac;\n    opts._yBottomFrac = yBottomFrac;\n\n    // stash mocked axis for contour label formatting\n    var ax = opts._axis = mockColorBarAxis(gd, opts, zrange);\n\n    // position can't go in through supplyDefaults\n    // because that restricts it to [0,1]\n    ax.position = opts.x + xpadFrac + thickFrac;\n\n    if(['top', 'bottom'].indexOf(titleSide) !== -1) {\n        ax.title.side = titleSide;\n        ax.titlex = opts.x + xpadFrac;\n        ax.titley = yBottomFrac + (title.side === 'top' ? lenFrac - ypadFrac : ypadFrac);\n    }\n\n    if(line.color && opts.tickmode === 'auto') {\n        ax.tickmode = 'linear';\n        ax.tick0 = levelsIn.start;\n        var dtick = levelsIn.size;\n        // expand if too many contours, so we don't get too many ticks\n        var autoNtick = Lib.constrain((yBottomPx - yTopPx) / 50, 4, 15) + 1;\n        var dtFactor = (zrange[1] - zrange[0]) / ((opts.nticks || autoNtick) * dtick);\n        if(dtFactor > 1) {\n            var dtexp = Math.pow(10, Math.floor(Math.log(dtFactor) / Math.LN10));\n            dtick *= dtexp * Lib.roundUp(dtFactor / dtexp, [2, 5, 10]);\n            // if the contours are at round multiples, reset tick0\n            // so they're still at round multiples. Otherwise,\n            // keep the first label on the first contour level\n            if((Math.abs(levelsIn.start) / levelsIn.size + 1e-6) % 1 < 2e-6) {\n                ax.tick0 = 0;\n            }\n        }\n        ax.dtick = dtick;\n    }\n\n    // set domain after init, because we may want to\n    // allow it outside [0,1]\n    ax.domain = [\n        yBottomFrac + ypadFrac,\n        yBottomFrac + lenFrac - ypadFrac\n    ];\n\n    ax.setScale();\n\n    g.attr('transform', 'translate(' + Math.round(gs.l) + ',' + Math.round(gs.t) + ')');\n\n    var titleCont = g.select('.' + cn.cbtitleunshift)\n        .attr('transform', 'translate(-' + Math.round(gs.l) + ',-' + Math.round(gs.t) + ')');\n\n    var axLayer = g.select('.' + cn.cbaxis);\n    var titleEl;\n    var titleHeight = 0;\n\n    function drawTitle(titleClass, titleOpts) {\n        var dfltTitleOpts = {\n            propContainer: ax,\n            propName: opts._propPrefix + 'title',\n            traceIndex: opts._traceIndex,\n            _meta: opts._meta,\n            placeholder: fullLayout._dfltTitle.colorbar,\n            containerGroup: g.select('.' + cn.cbtitle)\n        };\n\n        // this class-to-rotate thing with convertToTspans is\n        // getting hackier and hackier... delete groups with the\n        // wrong class (in case earlier the colorbar was drawn on\n        // a different side, I think?)\n        var otherClass = titleClass.charAt(0) === 'h' ?\n            titleClass.substr(1) :\n            'h' + titleClass;\n        g.selectAll('.' + otherClass + ',.' + otherClass + '-math-group').remove();\n\n        Titles.draw(gd, titleClass, extendFlat(dfltTitleOpts, titleOpts || {}));\n    }\n\n    function drawDummyTitle() {\n        if(['top', 'bottom'].indexOf(titleSide) !== -1) {\n            // draw the title so we know how much room it needs\n            // when we squish the axis. This one only applies to\n            // top or bottom titles, not right side.\n            var x = gs.l + (opts.x + xpadFrac) * gs.w;\n            var fontSize = ax.title.font.size;\n            var y;\n\n            if(titleSide === 'top') {\n                y = (1 - (yBottomFrac + lenFrac - ypadFrac)) * gs.h +\n                    gs.t + 3 + fontSize * 0.75;\n            } else {\n                y = (1 - (yBottomFrac + ypadFrac)) * gs.h +\n                    gs.t - 3 - fontSize * 0.25;\n            }\n            drawTitle(ax._id + 'title', {\n                attributes: {x: x, y: y, 'text-anchor': 'start'}\n            });\n        }\n    }\n\n    function drawCbTitle() {\n        if(['top', 'bottom'].indexOf(titleSide) === -1) {\n            var fontSize = ax.title.font.size;\n            var y = ax._offset + ax._length / 2;\n            var x = gs.l + (ax.position || 0) * gs.w + ((ax.side === 'right') ?\n                10 + fontSize * ((ax.showticklabels ? 1 : 0.5)) :\n                -10 - fontSize * ((ax.showticklabels ? 0.5 : 0)));\n\n            // the 'h' + is a hack to get around the fact that\n            // convertToTspans rotates any 'y...' class by 90 degrees.\n            // TODO: find a better way to control this.\n            drawTitle('h' + ax._id + 'title', {\n                avoid: {\n                    selection: d3.select(gd).selectAll('g.' + ax._id + 'tick'),\n                    side: titleSide,\n                    offsetLeft: gs.l,\n                    offsetTop: 0,\n                    maxShift: fullLayout.width\n                },\n                attributes: {x: x, y: y, 'text-anchor': 'middle'},\n                transform: {rotate: '-90', offset: 0}\n            });\n        }\n    }\n\n    function drawAxis() {\n        if(['top', 'bottom'].indexOf(titleSide) !== -1) {\n            // squish the axis top to make room for the title\n            var titleGroup = g.select('.' + cn.cbtitle);\n            var titleText = titleGroup.select('text');\n            var titleTrans = [-opts.outlinewidth / 2, opts.outlinewidth / 2];\n            var mathJaxNode = titleGroup\n                .select('.h' + ax._id + 'title-math-group')\n                .node();\n            var lineSize = 15.6;\n            if(titleText.node()) {\n                lineSize = parseInt(titleText.node().style.fontSize, 10) * LINE_SPACING;\n            }\n            if(mathJaxNode) {\n                titleHeight = Drawing.bBox(mathJaxNode).height;\n                if(titleHeight > lineSize) {\n                    // not entirely sure how mathjax is doing\n                    // vertical alignment, but this seems to work.\n                    titleTrans[1] -= (titleHeight - lineSize) / 2;\n                }\n            } else if(titleText.node() && !titleText.classed(cn.jsPlaceholder)) {\n                titleHeight = Drawing.bBox(titleText.node()).height;\n            }\n            if(titleHeight) {\n                // buffer btwn colorbar and title\n                // TODO: configurable\n                titleHeight += 5;\n\n                if(titleSide === 'top') {\n                    ax.domain[1] -= titleHeight / gs.h;\n                    titleTrans[1] *= -1;\n                } else {\n                    ax.domain[0] += titleHeight / gs.h;\n                    var nlines = svgTextUtils.lineCount(titleText);\n                    titleTrans[1] += (1 - nlines) * lineSize;\n                }\n\n                titleGroup.attr('transform', 'translate(' + titleTrans + ')');\n                ax.setScale();\n            }\n        }\n\n        g.selectAll('.' + cn.cbfills + ',.' + cn.cblines)\n            .attr('transform', 'translate(0,' + Math.round(gs.h * (1 - ax.domain[1])) + ')');\n\n        axLayer.attr('transform', 'translate(0,' + Math.round(-gs.t) + ')');\n\n        var fills = g.select('.' + cn.cbfills)\n            .selectAll('rect.' + cn.cbfill)\n            .data(fillLevels);\n        fills.enter().append('rect')\n            .classed(cn.cbfill, true)\n            .style('stroke', 'none');\n        fills.exit().remove();\n\n        var zBounds = zrange\n            .map(ax.c2p)\n            .map(Math.round)\n            .sort(function(a, b) { return a - b; });\n\n        fills.each(function(d, i) {\n            var z = [\n                (i === 0) ? zrange[0] : (fillLevels[i] + fillLevels[i - 1]) / 2,\n                (i === fillLevels.length - 1) ? zrange[1] : (fillLevels[i] + fillLevels[i + 1]) / 2\n            ]\n            .map(ax.c2p)\n            .map(Math.round);\n\n            // offset the side adjoining the next rectangle so they\n            // overlap, to prevent antialiasing gaps\n            z[1] = Lib.constrain(z[1] + (z[1] > z[0]) ? 1 : -1, zBounds[0], zBounds[1]);\n\n\n            // Colorbar cannot currently support opacities so we\n            // use an opaque fill even when alpha channels present\n            var fillEl = d3.select(this).attr({\n                x: xLeft,\n                width: Math.max(thickPx, 2),\n                y: d3.min(z),\n                height: Math.max(d3.max(z) - d3.min(z), 2),\n            });\n\n            if(opts._fillgradient) {\n                Drawing.gradient(fillEl, gd, opts._id, 'vertical', opts._fillgradient, 'fill');\n            } else {\n                // tinycolor can't handle exponents and\n                // at this scale, removing it makes no difference.\n                var colorString = fillColormap(d).replace('e-', '');\n                fillEl.attr('fill', tinycolor(colorString).toHexString());\n            }\n        });\n\n        var lines = g.select('.' + cn.cblines)\n            .selectAll('path.' + cn.cbline)\n            .data(line.color && line.width ? lineLevels : []);\n        lines.enter().append('path')\n            .classed(cn.cbline, true);\n        lines.exit().remove();\n        lines.each(function(d) {\n            d3.select(this)\n                .attr('d', 'M' + xLeft + ',' +\n                    (Math.round(ax.c2p(d)) + (line.width / 2) % 1) + 'h' + thickPx)\n                .call(Drawing.lineGroupStyle, line.width, lineColormap(d), line.dash);\n        });\n\n        // force full redraw of labels and ticks\n        axLayer.selectAll('g.' + ax._id + 'tick,path').remove();\n\n        var shift = xLeft + thickPx +\n            (opts.outlinewidth || 0) / 2 - (opts.ticks === 'outside' ? 1 : 0);\n\n        var vals = Axes.calcTicks(ax);\n        var transFn = Axes.makeTransFn(ax);\n        var tickSign = Axes.getTickSigns(ax)[2];\n\n        Axes.drawTicks(gd, ax, {\n            vals: ax.ticks === 'inside' ? Axes.clipEnds(ax, vals) : vals,\n            layer: axLayer,\n            path: Axes.makeTickPath(ax, shift, tickSign),\n            transFn: transFn\n        });\n\n        return Axes.drawLabels(gd, ax, {\n            vals: vals,\n            layer: axLayer,\n            transFn: transFn,\n            labelFns: Axes.makeLabelFns(ax, shift)\n        });\n    }\n\n    // wait for the axis & title to finish rendering before\n    // continuing positioning\n    // TODO: why are we redrawing multiple times now with this?\n    // I guess autoMargin doesn't like being post-promise?\n    function positionCB() {\n        var innerWidth = thickPx + opts.outlinewidth / 2 + Drawing.bBox(axLayer.node()).width;\n        titleEl = titleCont.select('text');\n\n        if(titleEl.node() && !titleEl.classed(cn.jsPlaceholder)) {\n            var mathJaxNode = titleCont.select('.h' + ax._id + 'title-math-group').node();\n            var titleWidth;\n            if(mathJaxNode && ['top', 'bottom'].indexOf(titleSide) !== -1) {\n                titleWidth = Drawing.bBox(mathJaxNode).width;\n            } else {\n                // note: the formula below works for all title sides,\n                // (except for top/bottom mathjax, above)\n                // but the weird gs.l is because the titleunshift\n                // transform gets removed by Drawing.bBox\n                titleWidth = Drawing.bBox(titleCont.node()).right - xLeft - gs.l;\n            }\n            innerWidth = Math.max(innerWidth, titleWidth);\n        }\n\n        var outerwidth = 2 * opts.xpad + innerWidth + opts.borderwidth + opts.outlinewidth / 2;\n        var outerheight = yBottomPx - yTopPx;\n\n        g.select('.' + cn.cbbg).attr({\n            x: xLeft - opts.xpad - (opts.borderwidth + opts.outlinewidth) / 2,\n            y: yTopPx - yExtraPx,\n            width: Math.max(outerwidth, 2),\n            height: Math.max(outerheight + 2 * yExtraPx, 2)\n        })\n        .call(Color.fill, opts.bgcolor)\n        .call(Color.stroke, opts.bordercolor)\n        .style('stroke-width', opts.borderwidth);\n\n        g.selectAll('.' + cn.cboutline).attr({\n            x: xLeft,\n            y: yTopPx + opts.ypad + (titleSide === 'top' ? titleHeight : 0),\n            width: Math.max(thickPx, 2),\n            height: Math.max(outerheight - 2 * opts.ypad - titleHeight, 2)\n        })\n        .call(Color.stroke, opts.outlinecolor)\n        .style({\n            fill: 'none',\n            'stroke-width': opts.outlinewidth\n        });\n\n        // fix positioning for xanchor!='left'\n        var xoffset = ({center: 0.5, right: 1}[opts.xanchor] || 0) * outerwidth;\n        g.attr('transform', 'translate(' + (gs.l - xoffset) + ',' + gs.t + ')');\n\n        // auto margin adjustment\n        var marginOpts = {};\n        var tFrac = FROM_TL[opts.yanchor];\n        var bFrac = FROM_BR[opts.yanchor];\n        if(opts.lenmode === 'pixels') {\n            marginOpts.y = opts.y;\n            marginOpts.t = outerheight * tFrac;\n            marginOpts.b = outerheight * bFrac;\n        } else {\n            marginOpts.t = marginOpts.b = 0;\n            marginOpts.yt = opts.y + opts.len * tFrac;\n            marginOpts.yb = opts.y - opts.len * bFrac;\n        }\n\n        var lFrac = FROM_TL[opts.xanchor];\n        var rFrac = FROM_BR[opts.xanchor];\n        if(opts.thicknessmode === 'pixels') {\n            marginOpts.x = opts.x;\n            marginOpts.l = outerwidth * lFrac;\n            marginOpts.r = outerwidth * rFrac;\n        } else {\n            var extraThickness = outerwidth - thickPx;\n            marginOpts.l = extraThickness * lFrac;\n            marginOpts.r = extraThickness * rFrac;\n            marginOpts.xl = opts.x - opts.thickness * lFrac;\n            marginOpts.xr = opts.x + opts.thickness * rFrac;\n        }\n\n        Plots.autoMargin(gd, opts._id, marginOpts);\n    }\n\n    return Lib.syncOrAsync([\n        Plots.previousPromises,\n        drawDummyTitle,\n        drawAxis,\n        drawCbTitle,\n        Plots.previousPromises,\n        positionCB\n    ], gd);\n}\n\nfunction makeEditable(g, opts, gd) {\n    var fullLayout = gd._fullLayout;\n    var gs = fullLayout._size;\n    var t0, xf, yf;\n\n    dragElement.init({\n        element: g.node(),\n        gd: gd,\n        prepFn: function() {\n            t0 = g.attr('transform');\n            setCursor(g);\n        },\n        moveFn: function(dx, dy) {\n            g.attr('transform', t0 + ' ' + 'translate(' + dx + ',' + dy + ')');\n\n            xf = dragElement.align(opts._xLeftFrac + (dx / gs.w), opts._thickFrac,\n                0, 1, opts.xanchor);\n            yf = dragElement.align(opts._yBottomFrac - (dy / gs.h), opts._lenFrac,\n                0, 1, opts.yanchor);\n\n            var csr = dragElement.getCursor(xf, yf, opts.xanchor, opts.yanchor);\n            setCursor(g, csr);\n        },\n        doneFn: function() {\n            setCursor(g);\n\n            if(xf !== undefined && yf !== undefined) {\n                var update = {};\n                update[opts._propPrefix + 'x'] = xf;\n                update[opts._propPrefix + 'y'] = yf;\n                if(opts._traceIndex !== undefined) {\n                    Registry.call('_guiRestyle', gd, update, opts._traceIndex);\n                } else {\n                    Registry.call('_guiRelayout', gd, update);\n                }\n            }\n        }\n    });\n}\n\nfunction calcLevels(gd, opts, zrange) {\n    var levelsIn = opts._levels;\n    var lineLevels = [];\n    var fillLevels = [];\n    var l;\n    var i;\n\n    var l0 = levelsIn.end + levelsIn.size / 100;\n    var ls = levelsIn.size;\n    var zr0 = (1.001 * zrange[0] - 0.001 * zrange[1]);\n    var zr1 = (1.001 * zrange[1] - 0.001 * zrange[0]);\n\n    for(i = 0; i < 1e5; i++) {\n        l = levelsIn.start + i * ls;\n        if(ls > 0 ? (l >= l0) : (l <= l0)) break;\n        if(l > zr0 && l < zr1) lineLevels.push(l);\n    }\n\n    if(opts._fillgradient) {\n        fillLevels = [0];\n    } else if(typeof opts._fillcolor === 'function') {\n        var fillLevelsIn = opts._filllevels;\n\n        if(fillLevelsIn) {\n            l0 = fillLevelsIn.end + fillLevelsIn.size / 100;\n            ls = fillLevelsIn.size;\n            for(i = 0; i < 1e5; i++) {\n                l = fillLevelsIn.start + i * ls;\n                if(ls > 0 ? (l >= l0) : (l <= l0)) break;\n                if(l > zrange[0] && l < zrange[1]) fillLevels.push(l);\n            }\n        } else {\n            fillLevels = lineLevels.map(function(v) {\n                return v - levelsIn.size / 2;\n            });\n            fillLevels.push(fillLevels[fillLevels.length - 1] + levelsIn.size);\n        }\n    } else if(opts._fillcolor && typeof opts._fillcolor === 'string') {\n        // doesn't matter what this value is, with a single value\n        // we'll make a single fill rect covering the whole bar\n        fillLevels = [0];\n    }\n\n    if(levelsIn.size < 0) {\n        lineLevels.reverse();\n        fillLevels.reverse();\n    }\n\n    return {line: lineLevels, fill: fillLevels};\n}\n\nfunction mockColorBarAxis(gd, opts, zrange) {\n    var fullLayout = gd._fullLayout;\n\n    var cbAxisIn = {\n        type: 'linear',\n        range: zrange,\n        tickmode: opts.tickmode,\n        nticks: opts.nticks,\n        tick0: opts.tick0,\n        dtick: opts.dtick,\n        tickvals: opts.tickvals,\n        ticktext: opts.ticktext,\n        ticks: opts.ticks,\n        ticklen: opts.ticklen,\n        tickwidth: opts.tickwidth,\n        tickcolor: opts.tickcolor,\n        showticklabels: opts.showticklabels,\n        tickfont: opts.tickfont,\n        tickangle: opts.tickangle,\n        tickformat: opts.tickformat,\n        exponentformat: opts.exponentformat,\n        separatethousands: opts.separatethousands,\n        showexponent: opts.showexponent,\n        showtickprefix: opts.showtickprefix,\n        tickprefix: opts.tickprefix,\n        showticksuffix: opts.showticksuffix,\n        ticksuffix: opts.ticksuffix,\n        title: opts.title,\n        showline: true,\n        anchor: 'free',\n        side: 'right',\n        position: 1\n    };\n\n    var cbAxisOut = {\n        type: 'linear',\n        _id: 'y' + opts._id\n    };\n\n    var axisOptions = {\n        letter: 'y',\n        font: fullLayout.font,\n        noHover: true,\n        noTickson: true,\n        calendar: fullLayout.calendar  // not really necessary (yet?)\n    };\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(cbAxisIn, cbAxisOut, axisLayoutAttrs, attr, dflt);\n    }\n\n    handleAxisDefaults(cbAxisIn, cbAxisOut, coerce, axisOptions, fullLayout);\n    handleAxisPositionDefaults(cbAxisIn, cbAxisOut, coerce, axisOptions);\n\n    return cbAxisOut;\n}\n\nmodule.exports = {\n    draw: draw\n};\n\n},{\"../../constants/alignment\":154,\"../../lib\":178,\"../../lib/extend\":173,\"../../lib/setcursor\":197,\"../../lib/svg_text_utils\":199,\"../../plots/cartesian/axes\":222,\"../../plots/cartesian/axis_defaults\":224,\"../../plots/cartesian/layout_attributes\":236,\"../../plots/cartesian/position_defaults\":239,\"../../plots/plots\":256,\"../../registry\":269,\"../color\":52,\"../colorscale/helpers\":63,\"../dragelement\":71,\"../drawing\":74,\"../titles\":147,\"./constants\":54,\"d3\":16,\"tinycolor2\":35}],57:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n\nmodule.exports = function hasColorbar(container) {\n    return Lib.isPlainObject(container.colorbar);\n};\n\n},{\"../../lib\":178}],58:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'colorbar',\n\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n\n    draw: _dereq_('./draw').draw,\n    hasColorbar: _dereq_('./has_colorbar')\n};\n\n},{\"./attributes\":53,\"./defaults\":55,\"./draw\":56,\"./has_colorbar\":57}],59:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorbarAttrs = _dereq_('../colorbar/attributes');\nvar counterRegex = _dereq_('../../lib/regex').counter;\n\nvar palettes = _dereq_('./scales.js').scales;\nvar paletteStr = Object.keys(palettes);\n\nfunction code(s) {\n    return '`' + s + '`';\n}\n\n/**\n * Make colorscale attribute declarations for\n *\n * - colorscale,\n * - (c|z)auto, (c|z)min, (c|z)max,\n * - autocolorscale, reversescale,\n * - showscale (optionally)\n * - color (optionally)\n *\n * @param {string} context (dflt: '', i.e. from trace root):\n *     the container this is in ('', *marker*, *marker.line* etc)\n *\n * @param {object} opts:\n *   - cLetter {string} (dflt: 'c'):\n *     leading letter for 'min', 'max and 'auto' attribute (either 'z' or 'c')\n *\n *   - colorAttr {string} (dflt: 'z' if `cLetter: 'z'`, 'color' if `cLetter: 'c'`):\n *     (for descriptions) sets the name of the color attribute that maps to the colorscale.\n *\n *     N.B. if `colorAttr: 'color'`, we include the `color` declaration here.\n *\n *   - onlyIfNumerical {string} (dflt: false' if `cLetter: 'z'`, true if `cLetter: 'c'`):\n *     (for descriptions) set to true if colorscale attribute only\n *\n *   - colorscaleDflt {string}:\n *     overrides the colorscale dflt\n *\n *   - autoColorDflt {boolean} (dflt true):\n *     normally autocolorscale.dflt is `true`, but pass `false` to override\n *\n *   - noScale {boolean} (dflt: true if `context: 'marker.line'`, false otherwise):\n *     set to `false` to not include showscale attribute (e.g. for 'marker.line')\n *\n *   - showScaleDflt {boolean} (dflt: true if `cLetter: 'z'`, false otherwise)\n *\n *   - editTypeOverride {boolean} (dflt: ''):\n *     most of these attributes already require a recalc, but the ones that do not\n *     have editType *style* or *plot* unless you override (presumably with *calc*)\n *\n *   - anim {boolean) (dflt: undefined): is 'color' animatable?\n *\n * @return {object}\n */\nmodule.exports = function colorScaleAttrs(context, opts) {\n    context = context || '';\n    opts = opts || {};\n\n    var cLetter = opts.cLetter || 'c';\n    var onlyIfNumerical = ('onlyIfNumerical' in opts) ? opts.onlyIfNumerical : Boolean(context);\n    var noScale = ('noScale' in opts) ? opts.noScale : context === 'marker.line';\n    var showScaleDflt = ('showScaleDflt' in opts) ? opts.showScaleDflt : cLetter === 'z';\n    var colorscaleDflt = typeof opts.colorscaleDflt === 'string' ? palettes[opts.colorscaleDflt] : null;\n    var editTypeOverride = opts.editTypeOverride || '';\n    var contextHead = context ? (context + '.') : '';\n\n    var colorAttr, colorAttrFull;\n\n    if('colorAttr' in opts) {\n        colorAttr = opts.colorAttr;\n        colorAttrFull = opts.colorAttr;\n    } else {\n        colorAttr = {z: 'z', c: 'color'}[cLetter];\n        colorAttrFull = 'in ' + code(contextHead + colorAttr);\n    }\n\n    var effectDesc = onlyIfNumerical ?\n        ' Has an effect only if ' + colorAttrFull + 'is set to a numerical array.' :\n        '';\n\n    var auto = cLetter + 'auto';\n    var min = cLetter + 'min';\n    var max = cLetter + 'max';\n    var mid = cLetter + 'mid';\n    var autoFull = code(contextHead + auto);\n    var minFull = code(contextHead + min);\n    var maxFull = code(contextHead + max);\n    var minmaxFull = minFull + ' and ' + maxFull;\n    var autoImpliedEdits = {};\n    autoImpliedEdits[min] = autoImpliedEdits[max] = undefined;\n    var minmaxImpliedEdits = {};\n    minmaxImpliedEdits[auto] = false;\n\n    var attrs = {};\n\n    if(colorAttr === 'color') {\n        attrs.color = {\n            valType: 'color',\n            arrayOk: true,\n            \n            editType: editTypeOverride || 'style',\n            \n        };\n\n        if(opts.anim) {\n            attrs.color.anim = true;\n        }\n    }\n\n    attrs[auto] = {\n        valType: 'boolean',\n        \n        dflt: true,\n        editType: 'calc',\n        impliedEdits: autoImpliedEdits,\n        \n    };\n\n    attrs[min] = {\n        valType: 'number',\n        \n        dflt: null,\n        editType: editTypeOverride || 'plot',\n        impliedEdits: minmaxImpliedEdits,\n        \n    };\n\n    attrs[max] = {\n        valType: 'number',\n        \n        dflt: null,\n        editType: editTypeOverride || 'plot',\n        impliedEdits: minmaxImpliedEdits,\n        \n    };\n\n    attrs[mid] = {\n        valType: 'number',\n        \n        dflt: null,\n        editType: 'calc',\n        impliedEdits: autoImpliedEdits,\n        \n    };\n\n    attrs.colorscale = {\n        valType: 'colorscale',\n        \n        editType: 'calc',\n        dflt: colorscaleDflt,\n        impliedEdits: {autocolorscale: false},\n        \n    };\n\n    attrs.autocolorscale = {\n        valType: 'boolean',\n        \n        // gets overrode in 'heatmap' & 'surface' for backwards comp.\n        dflt: opts.autoColorDflt === false ? false : true,\n        editType: 'calc',\n        impliedEdits: {colorscale: undefined},\n        \n    };\n\n    attrs.reversescale = {\n        valType: 'boolean',\n        \n        dflt: false,\n        editType: 'plot',\n        \n    };\n\n    if(!noScale) {\n        attrs.showscale = {\n            valType: 'boolean',\n            \n            dflt: showScaleDflt,\n            editType: 'calc',\n            \n        };\n\n        attrs.colorbar = colorbarAttrs;\n    }\n\n    if(!opts.noColorAxis) {\n        attrs.coloraxis = {\n            valType: 'subplotid',\n            \n            regex: counterRegex('coloraxis'),\n            dflt: null,\n            editType: 'calc',\n            \n        };\n    }\n\n    return attrs;\n};\n\n},{\"../../lib/regex\":193,\"../colorbar/attributes\":53,\"./scales.js\":67}],60:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar extractOpts = _dereq_('./helpers').extractOpts;\n\nmodule.exports = function calc(gd, trace, opts) {\n    var fullLayout = gd._fullLayout;\n    var vals = opts.vals;\n    var containerStr = opts.containerStr;\n\n    var container = containerStr ?\n        Lib.nestedProperty(trace, containerStr).get() :\n        trace;\n\n    var cOpts = extractOpts(container);\n    var auto = cOpts.auto !== false;\n    var min = cOpts.min;\n    var max = cOpts.max;\n    var mid = cOpts.mid;\n\n    var minVal = function() { return Lib.aggNums(Math.min, null, vals); };\n    var maxVal = function() { return Lib.aggNums(Math.max, null, vals); };\n\n    if(min === undefined) {\n        min = minVal();\n    } else if(auto) {\n        if(container._colorAx && isNumeric(min)) {\n            min = Math.min(min, minVal());\n        } else {\n            min = minVal();\n        }\n    }\n\n    if(max === undefined) {\n        max = maxVal();\n    } else if(auto) {\n        if(container._colorAx && isNumeric(max)) {\n            max = Math.max(max, maxVal());\n        } else {\n            max = maxVal();\n        }\n    }\n\n    if(auto && mid !== undefined) {\n        if(max - mid > mid - min) {\n            min = mid - (max - mid);\n        } else if(max - mid < mid - min) {\n            max = mid + (mid - min);\n        }\n    }\n\n    if(min === max) {\n        min -= 0.5;\n        max += 0.5;\n    }\n\n    cOpts._sync('min', min);\n    cOpts._sync('max', max);\n\n    if(cOpts.autocolorscale) {\n        var scl;\n        if(min * max < 0) scl = fullLayout.colorscale.diverging;\n        else if(min >= 0) scl = fullLayout.colorscale.sequential;\n        else scl = fullLayout.colorscale.sequentialminus;\n        cOpts._sync('colorscale', scl);\n    }\n};\n\n},{\"../../lib\":178,\"./helpers\":63,\"fast-isnumeric\":18}],61:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar hasColorscale = _dereq_('./helpers').hasColorscale;\nvar extractOpts = _dereq_('./helpers').extractOpts;\n\nmodule.exports = function crossTraceDefaults(fullData, fullLayout) {\n    function replace(cont, k) {\n        var val = cont['_' + k];\n        if(val !== undefined) {\n            cont[k] = val;\n        }\n    }\n\n    function relinkColorAttrs(outerCont, cbOpt) {\n        var cont = cbOpt.container ?\n            Lib.nestedProperty(outerCont, cbOpt.container).get() :\n            outerCont;\n\n        if(cont) {\n            if(cont.coloraxis) {\n                // stash ref to color axis\n                cont._colorAx = fullLayout[cont.coloraxis];\n            } else {\n                var cOpts = extractOpts(cont);\n                var isAuto = cOpts.auto;\n\n                if(isAuto || cOpts.min === undefined) {\n                    replace(cont, cbOpt.min);\n                }\n                if(isAuto || cOpts.max === undefined) {\n                    replace(cont, cbOpt.max);\n                }\n                if(cOpts.autocolorscale) {\n                    replace(cont, 'colorscale');\n                }\n            }\n        }\n    }\n\n    for(var i = 0; i < fullData.length; i++) {\n        var trace = fullData[i];\n        var cbOpts = trace._module.colorbar;\n\n        if(cbOpts) {\n            if(Array.isArray(cbOpts)) {\n                for(var j = 0; j < cbOpts.length; j++) {\n                    relinkColorAttrs(trace, cbOpts[j]);\n                }\n            } else {\n                relinkColorAttrs(trace, cbOpts);\n            }\n        }\n\n        if(hasColorscale(trace, 'marker.line')) {\n            relinkColorAttrs(trace, {\n                container: 'marker.line',\n                min: 'cmin',\n                max: 'cmax'\n            });\n        }\n    }\n\n    for(var k in fullLayout._colorAxes) {\n        relinkColorAttrs(fullLayout[k], {min: 'cmin', max: 'cmax'});\n    }\n};\n\n},{\"../../lib\":178,\"./helpers\":63}],62:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar hasColorbar = _dereq_('../colorbar/has_colorbar');\nvar colorbarDefaults = _dereq_('../colorbar/defaults');\n\nvar isValidScale = _dereq_('./scales').isValid;\nvar traceIs = _dereq_('../../registry').traceIs;\n\nfunction npMaybe(parentCont, prefix) {\n    var containerStr = prefix.slice(0, prefix.length - 1);\n    return prefix ?\n        Lib.nestedProperty(parentCont, containerStr).get() || {} :\n        parentCont;\n}\n\n/**\n * Colorscale / colorbar default handler\n *\n * @param {object} parentContIn : user (input) parent container (e.g. trace or layout coloraxis object)\n * @param {object} parentContOut : full parent container\n * @param {object} layout : (full) layout object\n * @param {fn} coerce : Lib.coerce wrapper\n * @param {object} opts :\n * - prefix {string} : attr string prefix to colorscale container from parent root\n * - cLetter {string} : 'c or 'z' color letter\n */\nmodule.exports = function colorScaleDefaults(parentContIn, parentContOut, layout, coerce, opts) {\n    var prefix = opts.prefix;\n    var cLetter = opts.cLetter;\n    var inTrace = '_module' in parentContOut;\n    var containerIn = npMaybe(parentContIn, prefix);\n    var containerOut = npMaybe(parentContOut, prefix);\n    var template = npMaybe(parentContOut._template || {}, prefix) || {};\n\n    // colorScaleDefaults wrapper called if-ever we need to reset the colorscale\n    // attributes for containers that were linked to invalid color axes\n    var thisFn = function() {\n        delete parentContIn.coloraxis;\n        delete parentContOut.coloraxis;\n        return colorScaleDefaults(parentContIn, parentContOut, layout, coerce, opts);\n    };\n\n    if(inTrace) {\n        var colorAxes = layout._colorAxes || {};\n        var colorAx = coerce(prefix + 'coloraxis');\n\n        if(colorAx) {\n            var colorbarVisuals = (\n                traceIs(parentContOut, 'contour') &&\n                Lib.nestedProperty(parentContOut, 'contours.coloring').get()\n            ) || 'heatmap';\n\n            var stash = colorAxes[colorAx];\n\n            if(stash) {\n                stash[2].push(thisFn);\n\n                if(stash[0] !== colorbarVisuals) {\n                    stash[0] = false;\n                    Lib.warn([\n                        'Ignoring coloraxis:', colorAx, 'setting',\n                        'as it is linked to incompatible colorscales.'\n                    ].join(' '));\n                }\n            } else {\n                // stash:\n                // - colorbar visual 'type'\n                // - colorbar options to help in Colorbar.draw\n                // - list of colorScaleDefaults wrapper functions\n                colorAxes[colorAx] = [colorbarVisuals, parentContOut, [thisFn]];\n            }\n            return;\n        }\n    }\n\n    var minIn = containerIn[cLetter + 'min'];\n    var maxIn = containerIn[cLetter + 'max'];\n    var validMinMax = isNumeric(minIn) && isNumeric(maxIn) && (minIn < maxIn);\n    var auto = coerce(prefix + cLetter + 'auto', !validMinMax);\n\n    if(auto) {\n        coerce(prefix + cLetter + 'mid');\n    } else {\n        coerce(prefix + cLetter + 'min');\n        coerce(prefix + cLetter + 'max');\n    }\n\n    // handles both the trace case (autocolorscale is false by default) and\n    // the marker and marker.line case (autocolorscale is true by default)\n    var sclIn = containerIn.colorscale;\n    var sclTemplate = template.colorscale;\n    var autoColorscaleDflt;\n    if(sclIn !== undefined) autoColorscaleDflt = !isValidScale(sclIn);\n    if(sclTemplate !== undefined) autoColorscaleDflt = !isValidScale(sclTemplate);\n    coerce(prefix + 'autocolorscale', autoColorscaleDflt);\n\n    coerce(prefix + 'colorscale');\n    coerce(prefix + 'reversescale');\n\n    if(prefix !== 'marker.line.') {\n        // handles both the trace case where the dflt is listed in attributes and\n        // the marker case where the dflt is determined by hasColorbar\n        var showScaleDflt;\n        if(prefix && inTrace) showScaleDflt = hasColorbar(containerIn);\n\n        var showScale = coerce(prefix + 'showscale', showScaleDflt);\n        if(showScale) {\n            if(prefix && template) containerOut._template = template;\n            colorbarDefaults(containerIn, containerOut, layout);\n        }\n    }\n};\n\n},{\"../../lib\":178,\"../../registry\":269,\"../colorbar/defaults\":55,\"../colorbar/has_colorbar\":57,\"./scales\":67,\"fast-isnumeric\":18}],63:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../color');\n\nvar isValidScale = _dereq_('./scales').isValid;\n\nfunction hasColorscale(trace, containerStr, colorKey) {\n    var container = containerStr ?\n        Lib.nestedProperty(trace, containerStr).get() || {} :\n        trace;\n    var color = container[colorKey || 'color'];\n\n    var isArrayWithOneNumber = false;\n    if(Lib.isArrayOrTypedArray(color)) {\n        for(var i = 0; i < color.length; i++) {\n            if(isNumeric(color[i])) {\n                isArrayWithOneNumber = true;\n                break;\n            }\n        }\n    }\n\n    return (\n        Lib.isPlainObject(container) && (\n            isArrayWithOneNumber ||\n            container.showscale === true ||\n            (isNumeric(container.cmin) && isNumeric(container.cmax)) ||\n            isValidScale(container.colorscale) ||\n            Lib.isPlainObject(container.colorbar)\n        )\n    );\n}\n\nvar constantAttrs = ['showscale', 'autocolorscale', 'colorscale', 'reversescale', 'colorbar'];\nvar letterAttrs = ['min', 'max', 'mid', 'auto'];\n\n/**\n * Extract 'c' / 'z', trace / color axis colorscale options\n *\n * Note that it would be nice to replace all z* with c* equivalents in v2\n *\n * @param {object} cont : attribute container\n * @return {object}:\n *  - min: cmin or zmin\n *  - max: cmax or zmax\n *  - mid: cmid or zmid\n *  - auto: cauto or zauto\n *  - *scale: *scale attrs\n *  - colorbar: colorbar\n *  - _sync: function syncing attr and underscore dual (useful when calc'ing min/max)\n */\nfunction extractOpts(cont) {\n    var colorAx = cont._colorAx;\n    var cont2 = colorAx ? colorAx : cont;\n    var out = {};\n    var cLetter;\n    var i, k;\n\n    for(i = 0; i < constantAttrs.length; i++) {\n        k = constantAttrs[i];\n        out[k] = cont2[k];\n    }\n\n    if(colorAx) {\n        cLetter = 'c';\n        for(i = 0; i < letterAttrs.length; i++) {\n            k = letterAttrs[i];\n            out[k] = cont2['c' + k];\n        }\n    } else {\n        var k2;\n        for(i = 0; i < letterAttrs.length; i++) {\n            k = letterAttrs[i];\n            k2 = 'c' + k;\n            if(k2 in cont2) {\n                out[k] = cont2[k2];\n                continue;\n            }\n            k2 = 'z' + k;\n            if(k2 in cont2) {\n                out[k] = cont2[k2];\n            }\n        }\n        cLetter = k2.charAt(0);\n    }\n\n    out._sync = function(k, v) {\n        var k2 = letterAttrs.indexOf(k) !== -1 ? cLetter + k : k;\n        cont2[k2] = cont2['_' + k2] = v;\n    };\n\n    return out;\n}\n\n/**\n * Extract colorscale into numeric domain and color range.\n *\n * @param {object} cont colorscale container (e.g. trace, marker)\n *  - colorscale {array of arrays}\n *  - cmin/zmin {number}\n *  - cmax/zmax {number}\n *  - reversescale {boolean}\n *\n * @return {object}\n *  - domain {array}\n *  - range {array}\n */\nfunction extractScale(cont) {\n    var cOpts = extractOpts(cont);\n    var cmin = cOpts.min;\n    var cmax = cOpts.max;\n\n    var scl = cOpts.reversescale ?\n        flipScale(cOpts.colorscale) :\n        cOpts.colorscale;\n\n    var N = scl.length;\n    var domain = new Array(N);\n    var range = new Array(N);\n\n    for(var i = 0; i < N; i++) {\n        var si = scl[i];\n        domain[i] = cmin + si[0] * (cmax - cmin);\n        range[i] = si[1];\n    }\n\n    return {domain: domain, range: range};\n}\n\nfunction flipScale(scl) {\n    var N = scl.length;\n    var sclNew = new Array(N);\n\n    for(var i = N - 1, j = 0; i >= 0; i--, j++) {\n        var si = scl[i];\n        sclNew[j] = [1 - si[0], si[1]];\n    }\n    return sclNew;\n}\n\n/**\n * General colorscale function generator.\n *\n * @param {object} specs output of Colorscale.extractScale or precomputed domain, range.\n *  - domain {array}\n *  - range {array}\n *\n * @param {object} opts\n *  - noNumericCheck {boolean} if true, scale func bypasses numeric checks\n *  - returnArray {boolean} if true, scale func return 4-item array instead of color strings\n *\n * @return {function}\n */\nfunction makeColorScaleFunc(specs, opts) {\n    opts = opts || {};\n\n    var domain = specs.domain;\n    var range = specs.range;\n    var N = range.length;\n    var _range = new Array(N);\n\n    for(var i = 0; i < N; i++) {\n        var rgba = tinycolor(range[i]).toRgb();\n        _range[i] = [rgba.r, rgba.g, rgba.b, rgba.a];\n    }\n\n    var _sclFunc = d3.scale.linear()\n        .domain(domain)\n        .range(_range)\n        .clamp(true);\n\n    var noNumericCheck = opts.noNumericCheck;\n    var returnArray = opts.returnArray;\n    var sclFunc;\n\n    if(noNumericCheck && returnArray) {\n        sclFunc = _sclFunc;\n    } else if(noNumericCheck) {\n        sclFunc = function(v) {\n            return colorArray2rbga(_sclFunc(v));\n        };\n    } else if(returnArray) {\n        sclFunc = function(v) {\n            if(isNumeric(v)) return _sclFunc(v);\n            else if(tinycolor(v).isValid()) return v;\n            else return Color.defaultLine;\n        };\n    } else {\n        sclFunc = function(v) {\n            if(isNumeric(v)) return colorArray2rbga(_sclFunc(v));\n            else if(tinycolor(v).isValid()) return v;\n            else return Color.defaultLine;\n        };\n    }\n\n    // colorbar draw looks into the d3 scale closure for domain and range\n    sclFunc.domain = _sclFunc.domain;\n    sclFunc.range = function() { return range; };\n\n    return sclFunc;\n}\n\nfunction makeColorScaleFuncFromTrace(trace, opts) {\n    return makeColorScaleFunc(extractScale(trace), opts);\n}\n\nfunction colorArray2rbga(colorArray) {\n    var colorObj = {\n        r: colorArray[0],\n        g: colorArray[1],\n        b: colorArray[2],\n        a: colorArray[3]\n    };\n\n    return tinycolor(colorObj).toRgbString();\n}\n\nmodule.exports = {\n    hasColorscale: hasColorscale,\n    extractOpts: extractOpts,\n    extractScale: extractScale,\n    flipScale: flipScale,\n    makeColorScaleFunc: makeColorScaleFunc,\n    makeColorScaleFuncFromTrace: makeColorScaleFuncFromTrace\n};\n\n},{\"../../lib\":178,\"../color\":52,\"./scales\":67,\"d3\":16,\"fast-isnumeric\":18,\"tinycolor2\":35}],64:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scales = _dereq_('./scales');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'colorscale',\n\n    attributes: _dereq_('./attributes'),\n    layoutAttributes: _dereq_('./layout_attributes'),\n\n    supplyLayoutDefaults: _dereq_('./layout_defaults'),\n    handleDefaults: _dereq_('./defaults'),\n    crossTraceDefaults: _dereq_('./cross_trace_defaults'),\n\n    calc: _dereq_('./calc'),\n\n    // ./scales.js is required in lib/coerce.js ;\n    // it needs to be a seperate module to avoid circular a dependency\n    scales: scales.scales,\n    defaultScale: scales.defaultScale,\n    getScale: scales.get,\n    isValidScale: scales.isValid,\n\n    hasColorscale: helpers.hasColorscale,\n    extractOpts: helpers.extractOpts,\n    extractScale: helpers.extractScale,\n    flipScale: helpers.flipScale,\n    makeColorScaleFunc: helpers.makeColorScaleFunc,\n    makeColorScaleFuncFromTrace: helpers.makeColorScaleFuncFromTrace\n};\n\n},{\"./attributes\":59,\"./calc\":60,\"./cross_trace_defaults\":61,\"./defaults\":62,\"./helpers\":63,\"./layout_attributes\":65,\"./layout_defaults\":66,\"./scales\":67}],65:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar colorScaleAttrs = _dereq_('./attributes');\nvar scales = _dereq_('./scales').scales;\n\nvar msg = 'Note that `autocolorscale` must be true for this attribute to work.';\n\nmodule.exports = {\n    editType: 'calc',\n\n    colorscale: {\n        editType: 'calc',\n\n        sequential: {\n            valType: 'colorscale',\n            dflt: scales.Reds,\n            \n            editType: 'calc',\n            \n        },\n        sequentialminus: {\n            valType: 'colorscale',\n            dflt: scales.Blues,\n            \n            editType: 'calc',\n            \n        },\n        diverging: {\n            valType: 'colorscale',\n            dflt: scales.RdBu,\n            \n            editType: 'calc',\n            \n        }\n    },\n\n    coloraxis: extendFlat({\n        // not really a 'subplot' attribute container,\n        // but this is the flag we use to denote attributes that\n        // support yaxis, yaxis2, yaxis3, ... counters\n        _isSubplotObj: true,\n        editType: 'calc',\n        \n    }, colorScaleAttrs('', {\n        colorAttr: 'corresponding trace color array(s)',\n        noColorAxis: true,\n        showScaleDflt: true\n    }))\n};\n\n},{\"../../lib/extend\":173,\"./attributes\":59,\"./scales\":67}],66:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Template = _dereq_('../../plot_api/plot_template');\n\nvar colorScaleAttrs = _dereq_('./layout_attributes');\nvar colorScaleDefaults = _dereq_('./defaults');\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(layoutIn, layoutOut, colorScaleAttrs, attr, dflt);\n    }\n\n    coerce('colorscale.sequential');\n    coerce('colorscale.sequentialminus');\n    coerce('colorscale.diverging');\n\n    var colorAxes = layoutOut._colorAxes;\n    var colorAxIn, colorAxOut;\n\n    function coerceAx(attr, dflt) {\n        return Lib.coerce(colorAxIn, colorAxOut, colorScaleAttrs.coloraxis, attr, dflt);\n    }\n\n    for(var k in colorAxes) {\n        var stash = colorAxes[k];\n\n        if(stash[0]) {\n            colorAxIn = layoutIn[k] || {};\n            colorAxOut = Template.newContainer(layoutOut, k, 'coloraxis');\n            colorAxOut._name = k;\n            colorScaleDefaults(colorAxIn, colorAxOut, layoutOut, coerceAx, {prefix: '', cLetter: 'c'});\n        } else {\n            // re-coerce colorscale attributes w/o coloraxis\n            for(var i = 0; i < stash[2].length; i++) {\n                stash[2][i]();\n            }\n            delete layoutOut._colorAxes[k];\n        }\n    }\n};\n\n},{\"../../lib\":178,\"../../plot_api/plot_template\":212,\"./defaults\":62,\"./layout_attributes\":65}],67:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar tinycolor = _dereq_('tinycolor2');\n\nvar scales = {\n    'Greys': [\n        [0, 'rgb(0,0,0)'], [1, 'rgb(255,255,255)']\n    ],\n\n    'YlGnBu': [\n        [0, 'rgb(8,29,88)'], [0.125, 'rgb(37,52,148)'],\n        [0.25, 'rgb(34,94,168)'], [0.375, 'rgb(29,145,192)'],\n        [0.5, 'rgb(65,182,196)'], [0.625, 'rgb(127,205,187)'],\n        [0.75, 'rgb(199,233,180)'], [0.875, 'rgb(237,248,217)'],\n        [1, 'rgb(255,255,217)']\n    ],\n\n    'Greens': [\n        [0, 'rgb(0,68,27)'], [0.125, 'rgb(0,109,44)'],\n        [0.25, 'rgb(35,139,69)'], [0.375, 'rgb(65,171,93)'],\n        [0.5, 'rgb(116,196,118)'], [0.625, 'rgb(161,217,155)'],\n        [0.75, 'rgb(199,233,192)'], [0.875, 'rgb(229,245,224)'],\n        [1, 'rgb(247,252,245)']\n    ],\n\n    'YlOrRd': [\n        [0, 'rgb(128,0,38)'], [0.125, 'rgb(189,0,38)'],\n        [0.25, 'rgb(227,26,28)'], [0.375, 'rgb(252,78,42)'],\n        [0.5, 'rgb(253,141,60)'], [0.625, 'rgb(254,178,76)'],\n        [0.75, 'rgb(254,217,118)'], [0.875, 'rgb(255,237,160)'],\n        [1, 'rgb(255,255,204)']\n    ],\n\n    'Bluered': [\n        [0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']\n    ],\n\n    // modified RdBu based on\n    // http://www.kennethmoreland.com/color-maps/\n    'RdBu': [\n        [0, 'rgb(5,10,172)'], [0.35, 'rgb(106,137,247)'],\n        [0.5, 'rgb(190,190,190)'], [0.6, 'rgb(220,170,132)'],\n        [0.7, 'rgb(230,145,90)'], [1, 'rgb(178,10,28)']\n    ],\n\n    // Scale for non-negative numeric values\n    'Reds': [\n        [0, 'rgb(220,220,220)'], [0.2, 'rgb(245,195,157)'],\n        [0.4, 'rgb(245,160,105)'], [1, 'rgb(178,10,28)']\n    ],\n\n    // Scale for non-positive numeric values\n    'Blues': [\n        [0, 'rgb(5,10,172)'], [0.35, 'rgb(40,60,190)'],\n        [0.5, 'rgb(70,100,245)'], [0.6, 'rgb(90,120,245)'],\n        [0.7, 'rgb(106,137,247)'], [1, 'rgb(220,220,220)']\n    ],\n\n    'Picnic': [\n        [0, 'rgb(0,0,255)'], [0.1, 'rgb(51,153,255)'],\n        [0.2, 'rgb(102,204,255)'], [0.3, 'rgb(153,204,255)'],\n        [0.4, 'rgb(204,204,255)'], [0.5, 'rgb(255,255,255)'],\n        [0.6, 'rgb(255,204,255)'], [0.7, 'rgb(255,153,255)'],\n        [0.8, 'rgb(255,102,204)'], [0.9, 'rgb(255,102,102)'],\n        [1, 'rgb(255,0,0)']\n    ],\n\n    'Rainbow': [\n        [0, 'rgb(150,0,90)'], [0.125, 'rgb(0,0,200)'],\n        [0.25, 'rgb(0,25,255)'], [0.375, 'rgb(0,152,255)'],\n        [0.5, 'rgb(44,255,150)'], [0.625, 'rgb(151,255,0)'],\n        [0.75, 'rgb(255,234,0)'], [0.875, 'rgb(255,111,0)'],\n        [1, 'rgb(255,0,0)']\n    ],\n\n    'Portland': [\n        [0, 'rgb(12,51,131)'], [0.25, 'rgb(10,136,186)'],\n        [0.5, 'rgb(242,211,56)'], [0.75, 'rgb(242,143,56)'],\n        [1, 'rgb(217,30,30)']\n    ],\n\n    'Jet': [\n        [0, 'rgb(0,0,131)'], [0.125, 'rgb(0,60,170)'],\n        [0.375, 'rgb(5,255,255)'], [0.625, 'rgb(255,255,0)'],\n        [0.875, 'rgb(250,0,0)'], [1, 'rgb(128,0,0)']\n    ],\n\n    'Hot': [\n        [0, 'rgb(0,0,0)'], [0.3, 'rgb(230,0,0)'],\n        [0.6, 'rgb(255,210,0)'], [1, 'rgb(255,255,255)']\n    ],\n\n    'Blackbody': [\n        [0, 'rgb(0,0,0)'], [0.2, 'rgb(230,0,0)'],\n        [0.4, 'rgb(230,210,0)'], [0.7, 'rgb(255,255,255)'],\n        [1, 'rgb(160,200,255)']\n    ],\n\n    'Earth': [\n        [0, 'rgb(0,0,130)'], [0.1, 'rgb(0,180,180)'],\n        [0.2, 'rgb(40,210,40)'], [0.4, 'rgb(230,230,50)'],\n        [0.6, 'rgb(120,70,20)'], [1, 'rgb(255,255,255)']\n    ],\n\n    'Electric': [\n        [0, 'rgb(0,0,0)'], [0.15, 'rgb(30,0,100)'],\n        [0.4, 'rgb(120,0,100)'], [0.6, 'rgb(160,90,0)'],\n        [0.8, 'rgb(230,200,0)'], [1, 'rgb(255,250,220)']\n    ],\n\n    'Viridis': [\n        [0, '#440154'], [0.06274509803921569, '#48186a'],\n        [0.12549019607843137, '#472d7b'], [0.18823529411764706, '#424086'],\n        [0.25098039215686274, '#3b528b'], [0.3137254901960784, '#33638d'],\n        [0.3764705882352941, '#2c728e'], [0.4392156862745098, '#26828e'],\n        [0.5019607843137255, '#21918c'], [0.5647058823529412, '#1fa088'],\n        [0.6274509803921569, '#28ae80'], [0.6901960784313725, '#3fbc73'],\n        [0.7529411764705882, '#5ec962'], [0.8156862745098039, '#84d44b'],\n        [0.8784313725490196, '#addc30'], [0.9411764705882353, '#d8e219'],\n        [1, '#fde725']\n    ],\n\n    'Cividis': [\n        [0.000000, 'rgb(0,32,76)'], [0.058824, 'rgb(0,42,102)'],\n        [0.117647, 'rgb(0,52,110)'], [0.176471, 'rgb(39,63,108)'],\n        [0.235294, 'rgb(60,74,107)'], [0.294118, 'rgb(76,85,107)'],\n        [0.352941, 'rgb(91,95,109)'], [0.411765, 'rgb(104,106,112)'],\n        [0.470588, 'rgb(117,117,117)'], [0.529412, 'rgb(131,129,120)'],\n        [0.588235, 'rgb(146,140,120)'], [0.647059, 'rgb(161,152,118)'],\n        [0.705882, 'rgb(176,165,114)'], [0.764706, 'rgb(192,177,109)'],\n        [0.823529, 'rgb(209,191,102)'], [0.882353, 'rgb(225,204,92)'],\n        [0.941176, 'rgb(243,219,79)'], [1.000000, 'rgb(255,233,69)']\n    ]\n};\n\nvar defaultScale = scales.RdBu;\n\nfunction getScale(scl, dflt) {\n    if(!dflt) dflt = defaultScale;\n    if(!scl) return dflt;\n\n    function parseScale() {\n        try {\n            scl = scales[scl] || JSON.parse(scl);\n        } catch(e) {\n            scl = dflt;\n        }\n    }\n\n    if(typeof scl === 'string') {\n        parseScale();\n        // occasionally scl is double-JSON encoded...\n        if(typeof scl === 'string') parseScale();\n    }\n\n    if(!isValidScaleArray(scl)) return dflt;\n    return scl;\n}\n\n\nfunction isValidScaleArray(scl) {\n    var highestVal = 0;\n\n    if(!Array.isArray(scl) || scl.length < 2) return false;\n\n    if(!scl[0] || !scl[scl.length - 1]) return false;\n\n    if(+scl[0][0] !== 0 || +scl[scl.length - 1][0] !== 1) return false;\n\n    for(var i = 0; i < scl.length; i++) {\n        var si = scl[i];\n\n        if(si.length !== 2 || +si[0] < highestVal || !tinycolor(si[1]).isValid()) {\n            return false;\n        }\n\n        highestVal = +si[0];\n    }\n\n    return true;\n}\n\nfunction isValidScale(scl) {\n    if(scales[scl] !== undefined) return true;\n    else return isValidScaleArray(scl);\n}\n\nmodule.exports = {\n    scales: scales,\n    defaultScale: defaultScale,\n\n    get: getScale,\n    isValid: isValidScale\n};\n\n},{\"tinycolor2\":35}],68:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n// for automatic alignment on dragging, <1/3 means left align,\n// >2/3 means right, and between is center. Pick the right fraction\n// based on where you are, and return the fraction corresponding to\n// that position on the object\nmodule.exports = function align(v, dv, v0, v1, anchor) {\n    var vmin = (v - v0) / (v1 - v0);\n    var vmax = vmin + dv / (v1 - v0);\n    var vc = (vmin + vmax) / 2;\n\n    // explicitly specified anchor\n    if(anchor === 'left' || anchor === 'bottom') return vmin;\n    if(anchor === 'center' || anchor === 'middle') return vc;\n    if(anchor === 'right' || anchor === 'top') return vmax;\n\n    // automatic based on position\n    if(vmin < (2 / 3) - vc) return vmin;\n    if(vmax > (4 / 3) - vc) return vmax;\n    return vc;\n};\n\n},{}],69:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n\n// set cursors pointing toward the closest corner/side,\n// to indicate alignment\n// x and y are 0-1, fractions of the plot area\nvar cursorset = [\n    ['sw-resize', 's-resize', 'se-resize'],\n    ['w-resize', 'move', 'e-resize'],\n    ['nw-resize', 'n-resize', 'ne-resize']\n];\n\nmodule.exports = function getCursor(x, y, xanchor, yanchor) {\n    if(xanchor === 'left') x = 0;\n    else if(xanchor === 'center') x = 1;\n    else if(xanchor === 'right') x = 2;\n    else x = Lib.constrain(Math.floor(x * 3), 0, 2);\n\n    if(yanchor === 'bottom') y = 0;\n    else if(yanchor === 'middle') y = 1;\n    else if(yanchor === 'top') y = 2;\n    else y = Lib.constrain(Math.floor(y * 3), 0, 2);\n\n    return cursorset[y][x];\n};\n\n},{\"../../lib\":178}],70:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nexports.selectMode = function(dragmode) {\n    return (\n        dragmode === 'lasso' ||\n        dragmode === 'select'\n    );\n};\n\nexports.drawMode = function(dragmode) {\n    return (\n        dragmode === 'drawclosedpath' ||\n        dragmode === 'drawopenpath' ||\n        dragmode === 'drawline' ||\n        dragmode === 'drawrect' ||\n        dragmode === 'drawcircle'\n    );\n};\n\nexports.openMode = function(dragmode) {\n    return (\n        dragmode === 'drawline' ||\n        dragmode === 'drawopenpath'\n    );\n};\n\nexports.rectMode = function(dragmode) {\n    return (\n        dragmode === 'select' ||\n        dragmode === 'drawline' ||\n        dragmode === 'drawrect' ||\n        dragmode === 'drawcircle'\n    );\n};\n\nexports.freeMode = function(dragmode) {\n    return (\n        dragmode === 'lasso' ||\n        dragmode === 'drawclosedpath' ||\n        dragmode === 'drawopenpath'\n    );\n};\n\nexports.selectingOrDrawing = function(dragmode) {\n    return (\n        exports.freeMode(dragmode) ||\n        exports.rectMode(dragmode)\n    );\n};\n\n},{}],71:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar mouseOffset = _dereq_('mouse-event-offset');\nvar hasHover = _dereq_('has-hover');\nvar supportsPassive = _dereq_('has-passive-events');\n\nvar removeElement = _dereq_('../../lib').removeElement;\nvar constants = _dereq_('../../plots/cartesian/constants');\n\nvar dragElement = module.exports = {};\n\ndragElement.align = _dereq_('./align');\ndragElement.getCursor = _dereq_('./cursor');\n\nvar unhover = _dereq_('./unhover');\ndragElement.unhover = unhover.wrapped;\ndragElement.unhoverRaw = unhover.raw;\n\n/**\n * Abstracts click & drag interactions\n *\n * During the interaction, a \"coverSlip\" element - a transparent\n * div covering the whole page - is created, which has two key effects:\n * - Lets you drag beyond the boundaries of the plot itself without\n *   dropping (but if you drag all the way out of the browser window the\n *   interaction will end)\n * - Freezes the cursor: whatever mouse cursor the drag element had when the\n *   interaction started gets copied to the coverSlip for use until mouseup\n *\n * If the user executes a drag bigger than MINDRAG, callbacks will fire as:\n *      prepFn, moveFn (1 or more times), doneFn\n * If the user does not drag enough, prepFn and clickFn will fire.\n *\n * Note: If you cancel contextmenu, clickFn will fire even with a right click\n * (unlike native events) so you'll get a `plotly_click` event. Cancel context eg:\n *    gd.addEventListener('contextmenu', function(e) { e.preventDefault(); });\n * TODO: we should probably turn this into a `config` parameter, so we can fix it\n * such that if you *don't* cancel contextmenu, we can prevent partial drags, which\n * put you in a weird state.\n *\n * If the user clicks multiple times quickly, clickFn will fire each time\n * but numClicks will increase to help you recognize doubleclicks.\n *\n * @param {object} options with keys:\n *      element (required) the DOM element to drag\n *      prepFn (optional) function(event, startX, startY)\n *          executed on mousedown\n *          startX and startY are the clientX and clientY pixel position\n *          of the mousedown event\n *      moveFn (optional) function(dx, dy)\n *          executed on move, ONLY after we've exceeded MINDRAG\n *          (we keep executing moveFn if you move back to where you started)\n *          dx and dy are the net pixel offset of the drag,\n *          dragged is true/false, has the mouse moved enough to\n *          constitute a drag\n *      doneFn (optional) function(e)\n *          executed on mouseup, ONLY if we exceeded MINDRAG (so you can be\n *          sure that moveFn has been called at least once)\n *          numClicks is how many clicks we've registered within\n *          a doubleclick time\n *          e is the original mouseup event\n *      clickFn (optional) function(numClicks, e)\n *          executed on mouseup if we have NOT exceeded MINDRAG (ie moveFn\n *          has not been called at all)\n *          numClicks is how many clicks we've registered within\n *          a doubleclick time\n *          e is the original mousedown event\n *      clampFn (optional, function(dx, dy) return [dx2, dy2])\n *          Provide custom clamping function for small displacements.\n *          By default, clamping is done using `minDrag` to x and y displacements\n *          independently.\n */\ndragElement.init = function init(options) {\n    var gd = options.gd;\n    var numClicks = 1;\n    var doubleClickDelay = gd._context.doubleClickDelay;\n    var element = options.element;\n\n    var startX,\n        startY,\n        newMouseDownTime,\n        cursor,\n        dragCover,\n        initialEvent,\n        initialTarget,\n        rightClick;\n\n    if(!gd._mouseDownTime) gd._mouseDownTime = 0;\n\n    element.style.pointerEvents = 'all';\n\n    element.onmousedown = onStart;\n\n    if(!supportsPassive) {\n        element.ontouchstart = onStart;\n    } else {\n        if(element._ontouchstart) {\n            element.removeEventListener('touchstart', element._ontouchstart);\n        }\n        element._ontouchstart = onStart;\n        element.addEventListener('touchstart', onStart, {passive: false});\n    }\n\n    function _clampFn(dx, dy, minDrag) {\n        if(Math.abs(dx) < minDrag) dx = 0;\n        if(Math.abs(dy) < minDrag) dy = 0;\n        return [dx, dy];\n    }\n\n    var clampFn = options.clampFn || _clampFn;\n\n    function onStart(e) {\n        // make dragging and dragged into properties of gd\n        // so that others can look at and modify them\n        gd._dragged = false;\n        gd._dragging = true;\n        var offset = pointerOffset(e);\n        startX = offset[0];\n        startY = offset[1];\n        initialTarget = e.target;\n        initialEvent = e;\n        rightClick = e.buttons === 2 || e.ctrlKey;\n\n        // fix Fx.hover for touch events\n        if(typeof e.clientX === 'undefined' && typeof e.clientY === 'undefined') {\n            e.clientX = startX;\n            e.clientY = startY;\n        }\n\n        newMouseDownTime = (new Date()).getTime();\n        if(newMouseDownTime - gd._mouseDownTime < doubleClickDelay) {\n            // in a click train\n            numClicks += 1;\n        } else {\n            // new click train\n            numClicks = 1;\n            gd._mouseDownTime = newMouseDownTime;\n        }\n\n        if(options.prepFn) options.prepFn(e, startX, startY);\n\n        if(hasHover && !rightClick) {\n            dragCover = coverSlip();\n            dragCover.style.cursor = window.getComputedStyle(element).cursor;\n        } else if(!hasHover) {\n            // document acts as a dragcover for mobile, bc we can't create dragcover dynamically\n            dragCover = document;\n            cursor = window.getComputedStyle(document.documentElement).cursor;\n            document.documentElement.style.cursor = window.getComputedStyle(element).cursor;\n        }\n\n        document.addEventListener('mouseup', onDone);\n        document.addEventListener('touchend', onDone);\n\n        if(options.dragmode !== false) {\n            e.preventDefault();\n            document.addEventListener('mousemove', onMove);\n            document.addEventListener('touchmove', onMove, {passive: false});\n        }\n\n        return;\n    }\n\n    function onMove(e) {\n        e.preventDefault();\n\n        var offset = pointerOffset(e);\n        var minDrag = options.minDrag || constants.MINDRAG;\n        var dxdy = clampFn(offset[0] - startX, offset[1] - startY, minDrag);\n        var dx = dxdy[0];\n        var dy = dxdy[1];\n\n        if(dx || dy) {\n            gd._dragged = true;\n            dragElement.unhover(gd);\n        }\n\n        if(gd._dragged && options.moveFn && !rightClick) {\n            gd._dragdata = {\n                element: element,\n                dx: dx,\n                dy: dy\n            };\n            options.moveFn(dx, dy);\n        }\n\n        return;\n    }\n\n    function onDone(e) {\n        delete gd._dragdata;\n\n        if(options.dragmode !== false) {\n            e.preventDefault();\n            document.removeEventListener('mousemove', onMove);\n            document.removeEventListener('touchmove', onMove);\n        }\n\n        document.removeEventListener('mouseup', onDone);\n        document.removeEventListener('touchend', onDone);\n\n        if(hasHover) {\n            removeElement(dragCover);\n        } else if(cursor) {\n            dragCover.documentElement.style.cursor = cursor;\n            cursor = null;\n        }\n\n        if(!gd._dragging) {\n            gd._dragged = false;\n            return;\n        }\n        gd._dragging = false;\n\n        // don't count as a dblClick unless the mouseUp is also within\n        // the dblclick delay\n        if((new Date()).getTime() - gd._mouseDownTime > doubleClickDelay) {\n            numClicks = Math.max(numClicks - 1, 1);\n        }\n\n        if(gd._dragged) {\n            if(options.doneFn) options.doneFn();\n        } else {\n            if(options.clickFn) options.clickFn(numClicks, initialEvent);\n\n            // If we haven't dragged, this should be a click. But because of the\n            // coverSlip changing the element, the natural system might not generate one,\n            // so we need to make our own. But right clicks don't normally generate\n            // click events, only contextmenu events, which happen on mousedown.\n            if(!rightClick) {\n                var e2;\n\n                try {\n                    e2 = new MouseEvent('click', e);\n                } catch(err) {\n                    var offset = pointerOffset(e);\n                    e2 = document.createEvent('MouseEvents');\n                    e2.initMouseEvent('click',\n                        e.bubbles, e.cancelable,\n                        e.view, e.detail,\n                        e.screenX, e.screenY,\n                        offset[0], offset[1],\n                        e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,\n                        e.button, e.relatedTarget);\n                }\n\n                initialTarget.dispatchEvent(e2);\n            }\n        }\n\n        gd._dragging = false;\n        gd._dragged = false;\n        return;\n    }\n};\n\nfunction coverSlip() {\n    var cover = document.createElement('div');\n\n    cover.className = 'dragcover';\n    var cStyle = cover.style;\n    cStyle.position = 'fixed';\n    cStyle.left = 0;\n    cStyle.right = 0;\n    cStyle.top = 0;\n    cStyle.bottom = 0;\n    cStyle.zIndex = 999999999;\n    cStyle.background = 'none';\n\n    document.body.appendChild(cover);\n\n    return cover;\n}\n\ndragElement.coverSlip = coverSlip;\n\nfunction pointerOffset(e) {\n    return mouseOffset(\n        e.changedTouches ? e.changedTouches[0] : e,\n        document.body\n    );\n}\n\n},{\"../../lib\":178,\"../../plots/cartesian/constants\":228,\"./align\":68,\"./cursor\":69,\"./unhover\":72,\"has-hover\":20,\"has-passive-events\":21,\"mouse-event-offset\":24}],72:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Events = _dereq_('../../lib/events');\nvar throttle = _dereq_('../../lib/throttle');\nvar getGraphDiv = _dereq_('../../lib/dom').getGraphDiv;\n\nvar hoverConstants = _dereq_('../fx/constants');\n\nvar unhover = module.exports = {};\n\nunhover.wrapped = function(gd, evt, subplot) {\n    gd = getGraphDiv(gd);\n\n    // Important, clear any queued hovers\n    if(gd._fullLayout) {\n        throttle.clear(gd._fullLayout._uid + hoverConstants.HOVERID);\n    }\n\n    unhover.raw(gd, evt, subplot);\n};\n\n\n// remove hover effects on mouse out, and emit unhover event\nunhover.raw = function raw(gd, evt) {\n    var fullLayout = gd._fullLayout;\n    var oldhoverdata = gd._hoverdata;\n\n    if(!evt) evt = {};\n    if(evt.target &&\n       Events.triggerHandler(gd, 'plotly_beforehover', evt) === false) {\n        return;\n    }\n\n    fullLayout._hoverlayer.selectAll('g').remove();\n    fullLayout._hoverlayer.selectAll('line').remove();\n    fullLayout._hoverlayer.selectAll('circle').remove();\n    gd._hoverdata = undefined;\n\n    if(evt.target && oldhoverdata) {\n        gd.emit('plotly_unhover', {\n            event: evt,\n            points: oldhoverdata\n        });\n    }\n};\n\n},{\"../../lib/dom\":171,\"../../lib/events\":172,\"../../lib/throttle\":200,\"../fx/constants\":86}],73:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nexports.dash = {\n    valType: 'string',\n    // string type usually doesn't take values... this one should really be\n    // a special type or at least a special coercion function, from the GUI\n    // you only get these values but elsewhere the user can supply a list of\n    // dash lengths in px, and it will be honored\n    values: ['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'],\n    dflt: 'solid',\n    \n    editType: 'style',\n    \n};\n\n},{}],74:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Registry = _dereq_('../../registry');\nvar Color = _dereq_('../color');\nvar Colorscale = _dereq_('../colorscale');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\nvar alignment = _dereq_('../../constants/alignment');\nvar LINE_SPACING = alignment.LINE_SPACING;\nvar DESELECTDIM = _dereq_('../../constants/interactions').DESELECTDIM;\n\nvar subTypes = _dereq_('../../traces/scatter/subtypes');\nvar makeBubbleSizeFn = _dereq_('../../traces/scatter/make_bubble_size_func');\nvar appendArrayPointValue = _dereq_('../../components/fx/helpers').appendArrayPointValue;\n\nvar drawing = module.exports = {};\n\n// -----------------------------------------------------\n// styling functions for plot elements\n// -----------------------------------------------------\n\ndrawing.font = function(s, family, size, color) {\n    // also allow the form font(s, {family, size, color})\n    if(Lib.isPlainObject(family)) {\n        color = family.color;\n        size = family.size;\n        family = family.family;\n    }\n    if(family) s.style('font-family', family);\n    if(size + 1) s.style('font-size', size + 'px');\n    if(color) s.call(Color.fill, color);\n};\n\n/*\n * Positioning helpers\n * Note: do not use `setPosition` with <text> nodes modified by\n * `svgTextUtils.convertToTspans`. Use `svgTextUtils.positionText`\n * instead, so that <tspan.line> elements get updated to match.\n */\ndrawing.setPosition = function(s, x, y) { s.attr('x', x).attr('y', y); };\ndrawing.setSize = function(s, w, h) { s.attr('width', w).attr('height', h); };\ndrawing.setRect = function(s, x, y, w, h) {\n    s.call(drawing.setPosition, x, y).call(drawing.setSize, w, h);\n};\n\n/** Translate node\n *\n * @param {object} d : calcdata point item\n * @param {sel} sel : d3 selction of node to translate\n * @param {object} xa : corresponding full xaxis object\n * @param {object} ya : corresponding full yaxis object\n *\n * @return {boolean} :\n *  true if selection got translated\n *  false if selection could not get translated\n */\ndrawing.translatePoint = function(d, sel, xa, ya) {\n    var x = xa.c2p(d.x);\n    var y = ya.c2p(d.y);\n\n    if(isNumeric(x) && isNumeric(y) && sel.node()) {\n        // for multiline text this works better\n        if(sel.node().nodeName === 'text') {\n            sel.attr('x', x).attr('y', y);\n        } else {\n            sel.attr('transform', 'translate(' + x + ',' + y + ')');\n        }\n    } else {\n        return false;\n    }\n\n    return true;\n};\n\ndrawing.translatePoints = function(s, xa, ya) {\n    s.each(function(d) {\n        var sel = d3.select(this);\n        drawing.translatePoint(d, sel, xa, ya);\n    });\n};\n\ndrawing.hideOutsideRangePoint = function(d, sel, xa, ya, xcalendar, ycalendar) {\n    sel.attr(\n        'display',\n        (xa.isPtWithinRange(d, xcalendar) && ya.isPtWithinRange(d, ycalendar)) ? null : 'none'\n    );\n};\n\ndrawing.hideOutsideRangePoints = function(traceGroups, subplot) {\n    if(!subplot._hasClipOnAxisFalse) return;\n\n    var xa = subplot.xaxis;\n    var ya = subplot.yaxis;\n\n    traceGroups.each(function(d) {\n        var trace = d[0].trace;\n        var xcalendar = trace.xcalendar;\n        var ycalendar = trace.ycalendar;\n        var selector = Registry.traceIs(trace, 'bar-like') ? '.bartext' : '.point,.textpoint';\n\n        traceGroups.selectAll(selector).each(function(d) {\n            drawing.hideOutsideRangePoint(d, d3.select(this), xa, ya, xcalendar, ycalendar);\n        });\n    });\n};\n\ndrawing.crispRound = function(gd, lineWidth, dflt) {\n    // for lines that disable antialiasing we want to\n    // make sure the width is an integer, and at least 1 if it's nonzero\n\n    if(!lineWidth || !isNumeric(lineWidth)) return dflt || 0;\n\n    // but not for static plots - these don't get antialiased anyway.\n    if(gd._context.staticPlot) return lineWidth;\n\n    if(lineWidth < 1) return 1;\n    return Math.round(lineWidth);\n};\n\ndrawing.singleLineStyle = function(d, s, lw, lc, ld) {\n    s.style('fill', 'none');\n    var line = (((d || [])[0] || {}).trace || {}).line || {};\n    var lw1 = lw || line.width || 0;\n    var dash = ld || line.dash || '';\n\n    Color.stroke(s, lc || line.color);\n    drawing.dashLine(s, dash, lw1);\n};\n\ndrawing.lineGroupStyle = function(s, lw, lc, ld) {\n    s.style('fill', 'none')\n    .each(function(d) {\n        var line = (((d || [])[0] || {}).trace || {}).line || {};\n        var lw1 = lw || line.width || 0;\n        var dash = ld || line.dash || '';\n\n        d3.select(this)\n            .call(Color.stroke, lc || line.color)\n            .call(drawing.dashLine, dash, lw1);\n    });\n};\n\ndrawing.dashLine = function(s, dash, lineWidth) {\n    lineWidth = +lineWidth || 0;\n\n    dash = drawing.dashStyle(dash, lineWidth);\n\n    s.style({\n        'stroke-dasharray': dash,\n        'stroke-width': lineWidth + 'px'\n    });\n};\n\ndrawing.dashStyle = function(dash, lineWidth) {\n    lineWidth = +lineWidth || 1;\n    var dlw = Math.max(lineWidth, 3);\n\n    if(dash === 'solid') dash = '';\n    else if(dash === 'dot') dash = dlw + 'px,' + dlw + 'px';\n    else if(dash === 'dash') dash = (3 * dlw) + 'px,' + (3 * dlw) + 'px';\n    else if(dash === 'longdash') dash = (5 * dlw) + 'px,' + (5 * dlw) + 'px';\n    else if(dash === 'dashdot') {\n        dash = (3 * dlw) + 'px,' + dlw + 'px,' + dlw + 'px,' + dlw + 'px';\n    } else if(dash === 'longdashdot') {\n        dash = (5 * dlw) + 'px,' + (2 * dlw) + 'px,' + dlw + 'px,' + (2 * dlw) + 'px';\n    }\n    // otherwise user wrote the dasharray themselves - leave it be\n\n    return dash;\n};\n\n// Same as fillGroupStyle, except in this case the selection may be a transition\ndrawing.singleFillStyle = function(sel) {\n    var node = d3.select(sel.node());\n    var data = node.data();\n    var fillcolor = (((data[0] || [])[0] || {}).trace || {}).fillcolor;\n    if(fillcolor) {\n        sel.call(Color.fill, fillcolor);\n    }\n};\n\ndrawing.fillGroupStyle = function(s) {\n    s.style('stroke-width', 0)\n    .each(function(d) {\n        var shape = d3.select(this);\n        // N.B. 'd' won't be a calcdata item when\n        // fill !== 'none' on a segment-less and marker-less trace\n        if(d[0].trace) {\n            shape.call(Color.fill, d[0].trace.fillcolor);\n        }\n    });\n};\n\nvar SYMBOLDEFS = _dereq_('./symbol_defs');\n\ndrawing.symbolNames = [];\ndrawing.symbolFuncs = [];\ndrawing.symbolNeedLines = {};\ndrawing.symbolNoDot = {};\ndrawing.symbolNoFill = {};\ndrawing.symbolList = [];\n\nObject.keys(SYMBOLDEFS).forEach(function(k) {\n    var symDef = SYMBOLDEFS[k];\n    var n = symDef.n;\n    drawing.symbolList.push(\n        n,\n        k,\n        n + 100,\n        k + '-open'\n    );\n    drawing.symbolNames[n] = k;\n    drawing.symbolFuncs[n] = symDef.f;\n\n    if(symDef.needLine) {\n        drawing.symbolNeedLines[n] = true;\n    }\n    if(symDef.noDot) {\n        drawing.symbolNoDot[n] = true;\n    } else {\n        drawing.symbolList.push(\n            n + 200,\n            k + '-dot',\n            n + 300,\n            k + '-open-dot'\n        );\n    }\n    if(symDef.noFill) {\n        drawing.symbolNoFill[n] = true;\n    }\n});\n\nvar MAXSYMBOL = drawing.symbolNames.length;\n// add a dot in the middle of the symbol\nvar DOTPATH = 'M0,0.5L0.5,0L0,-0.5L-0.5,0Z';\n\ndrawing.symbolNumber = function(v) {\n    if(typeof v === 'string') {\n        var vbase = 0;\n        if(v.indexOf('-open') > 0) {\n            vbase = 100;\n            v = v.replace('-open', '');\n        }\n        if(v.indexOf('-dot') > 0) {\n            vbase += 200;\n            v = v.replace('-dot', '');\n        }\n        v = drawing.symbolNames.indexOf(v);\n        if(v >= 0) { v += vbase; }\n    }\n\n    return (v % 100 >= MAXSYMBOL || v >= 400) ?\n        0 : Math.floor(Math.max(v, 0));\n};\n\nfunction makePointPath(symbolNumber, r) {\n    var base = symbolNumber % 100;\n    return drawing.symbolFuncs[base](r) + (symbolNumber >= 200 ? DOTPATH : '');\n}\n\nvar HORZGRADIENT = {x1: 1, x2: 0, y1: 0, y2: 0};\nvar VERTGRADIENT = {x1: 0, x2: 0, y1: 1, y2: 0};\nvar stopFormatter = d3.format('~.1f');\nvar gradientInfo = {\n    radial: {node: 'radialGradient'},\n    radialreversed: {node: 'radialGradient', reversed: true},\n    horizontal: {node: 'linearGradient', attrs: HORZGRADIENT},\n    horizontalreversed: {node: 'linearGradient', attrs: HORZGRADIENT, reversed: true},\n    vertical: {node: 'linearGradient', attrs: VERTGRADIENT},\n    verticalreversed: {node: 'linearGradient', attrs: VERTGRADIENT, reversed: true}\n};\n\n/**\n * gradient: create and apply a gradient fill\n *\n * @param {object} sel: d3 selection to apply this gradient to\n *     You can use `selection.call(Drawing.gradient, ...)`\n * @param {DOM element} gd: the graph div `sel` is part of\n * @param {string} gradientID: a unique (within this plot) identifier\n *     for this gradient, so that we don't create unnecessary definitions\n * @param {string} type: 'radial', 'horizontal', or 'vertical', optionally with\n *     'reversed' at the end. Normally radial goes center to edge,\n *     horizontal goes right to left, and vertical goes bottom to top\n * @param {array} colorscale: as in attribute values, [[fraction, color], ...]\n * @param {string} prop: the property to apply to, 'fill' or 'stroke'\n */\ndrawing.gradient = function(sel, gd, gradientID, type, colorscale, prop) {\n    var len = colorscale.length;\n    var info = gradientInfo[type];\n    var colorStops = new Array(len);\n    for(var i = 0; i < len; i++) {\n        if(info.reversed) {\n            colorStops[len - 1 - i] = [stopFormatter((1 - colorscale[i][0]) * 100), colorscale[i][1]];\n        } else {\n            colorStops[i] = [stopFormatter(colorscale[i][0] * 100), colorscale[i][1]];\n        }\n    }\n\n    var fullLayout = gd._fullLayout;\n    var fullID = 'g' + fullLayout._uid + '-' + gradientID;\n\n    var gradient = fullLayout._defs.select('.gradients')\n        .selectAll('#' + fullID)\n        .data([type + colorStops.join(';')], Lib.identity);\n\n    gradient.exit().remove();\n\n    gradient.enter()\n        .append(info.node)\n        .each(function() {\n            var el = d3.select(this);\n            if(info.attrs) el.attr(info.attrs);\n\n            el.attr('id', fullID);\n\n            var stops = el.selectAll('stop')\n                .data(colorStops);\n            stops.exit().remove();\n            stops.enter().append('stop');\n\n            stops.each(function(d) {\n                var tc = tinycolor(d[1]);\n                d3.select(this).attr({\n                    offset: d[0] + '%',\n                    'stop-color': Color.tinyRGB(tc),\n                    'stop-opacity': tc.getAlpha()\n                });\n            });\n        });\n\n    sel.style(prop, getFullUrl(fullID, gd))\n        .style(prop + '-opacity', null);\n\n    var className2query = function(s) {\n        return '.' + s.attr('class').replace(/\\s/g, '.');\n    };\n    var k = className2query(d3.select(sel.node().parentNode)) +\n        '>' + className2query(sel);\n    fullLayout._gradientUrlQueryParts[k] = 1;\n};\n\n/*\n * Make the gradients container and clear out any previous gradients.\n * We never collect all the gradients we need in one place,\n * so we can't ever remove gradients that have stopped being useful,\n * except all at once before a full redraw.\n * The upside of this is arbitrary points can share gradient defs\n */\ndrawing.initGradients = function(gd) {\n    var fullLayout = gd._fullLayout;\n\n    var gradientsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'gradients');\n    gradientsGroup.selectAll('linearGradient,radialGradient').remove();\n\n    // initialize stash of query parts filled in Drawing.gradient,\n    // used to fix URL strings during image exports\n    fullLayout._gradientUrlQueryParts = {};\n};\n\n\ndrawing.pointStyle = function(s, trace, gd) {\n    if(!s.size()) return;\n\n    var fns = drawing.makePointStyleFns(trace);\n\n    s.each(function(d) {\n        drawing.singlePointStyle(d, d3.select(this), trace, fns, gd);\n    });\n};\n\ndrawing.singlePointStyle = function(d, sel, trace, fns, gd) {\n    var marker = trace.marker;\n    var markerLine = marker.line;\n\n    sel.style('opacity',\n        fns.selectedOpacityFn ? fns.selectedOpacityFn(d) :\n            (d.mo === undefined ? marker.opacity : d.mo)\n    );\n\n    if(fns.ms2mrc) {\n        var r;\n\n        // handle multi-trace graph edit case\n        if(d.ms === 'various' || marker.size === 'various') {\n            r = 3;\n        } else {\n            r = fns.ms2mrc(d.ms);\n        }\n\n        // store the calculated size so hover can use it\n        d.mrc = r;\n\n        if(fns.selectedSizeFn) {\n            r = d.mrc = fns.selectedSizeFn(d);\n        }\n\n        // turn the symbol into a sanitized number\n        var x = drawing.symbolNumber(d.mx || marker.symbol) || 0;\n\n        // save if this marker is open\n        // because that impacts how to handle colors\n        d.om = x % 200 >= 100;\n\n        sel.attr('d', makePointPath(x, r));\n    }\n\n    var perPointGradient = false;\n    var fillColor, lineColor, lineWidth;\n\n    // 'so' is suspected outliers, for box plots\n    if(d.so) {\n        lineWidth = markerLine.outlierwidth;\n        lineColor = markerLine.outliercolor;\n        fillColor = marker.outliercolor;\n    } else {\n        var markerLineWidth = (markerLine || {}).width;\n\n        lineWidth = (\n            d.mlw + 1 ||\n            markerLineWidth + 1 ||\n            // TODO: we need the latter for legends... can we get rid of it?\n            (d.trace ? (d.trace.marker.line || {}).width : 0) + 1\n        ) - 1 || 0;\n\n        if('mlc' in d) lineColor = d.mlcc = fns.lineScale(d.mlc);\n        // weird case: array wasn't long enough to apply to every point\n        else if(Lib.isArrayOrTypedArray(markerLine.color)) lineColor = Color.defaultLine;\n        else lineColor = markerLine.color;\n\n        if(Lib.isArrayOrTypedArray(marker.color)) {\n            fillColor = Color.defaultLine;\n            perPointGradient = true;\n        }\n\n        if('mc' in d) {\n            fillColor = d.mcc = fns.markerScale(d.mc);\n        } else {\n            fillColor = marker.color || 'rgba(0,0,0,0)';\n        }\n\n        if(fns.selectedColorFn) {\n            fillColor = fns.selectedColorFn(d);\n        }\n    }\n\n    if(d.om) {\n        // open markers can't have zero linewidth, default to 1px,\n        // and use fill color as stroke color\n        sel.call(Color.stroke, fillColor)\n            .style({\n                'stroke-width': (lineWidth || 1) + 'px',\n                fill: 'none'\n            });\n    } else {\n        sel.style('stroke-width', (d.isBlank ? 0 : lineWidth) + 'px');\n\n        var markerGradient = marker.gradient;\n\n        var gradientType = d.mgt;\n        if(gradientType) perPointGradient = true;\n        else gradientType = markerGradient && markerGradient.type;\n\n        // for legend - arrays will propagate through here, but we don't need\n        // to treat it as per-point.\n        if(Array.isArray(gradientType)) {\n            gradientType = gradientType[0];\n            if(!gradientInfo[gradientType]) gradientType = 0;\n        }\n\n        if(gradientType && gradientType !== 'none') {\n            var gradientColor = d.mgc;\n            if(gradientColor) perPointGradient = true;\n            else gradientColor = markerGradient.color;\n\n            var gradientID = trace.uid;\n            if(perPointGradient) gradientID += '-' + d.i;\n\n            drawing.gradient(sel, gd, gradientID, gradientType,\n                [[0, gradientColor], [1, fillColor]], 'fill');\n        } else {\n            Color.fill(sel, fillColor);\n        }\n\n        if(lineWidth) {\n            Color.stroke(sel, lineColor);\n        }\n    }\n};\n\ndrawing.makePointStyleFns = function(trace) {\n    var out = {};\n    var marker = trace.marker;\n\n    // allow array marker and marker line colors to be\n    // scaled by given max and min to colorscales\n    out.markerScale = drawing.tryColorscale(marker, '');\n    out.lineScale = drawing.tryColorscale(marker, 'line');\n\n    if(Registry.traceIs(trace, 'symbols')) {\n        out.ms2mrc = subTypes.isBubble(trace) ?\n            makeBubbleSizeFn(trace) :\n            function() { return (marker.size || 6) / 2; };\n    }\n\n    if(trace.selectedpoints) {\n        Lib.extendFlat(out, drawing.makeSelectedPointStyleFns(trace));\n    }\n\n    return out;\n};\n\ndrawing.makeSelectedPointStyleFns = function(trace) {\n    var out = {};\n\n    var selectedAttrs = trace.selected || {};\n    var unselectedAttrs = trace.unselected || {};\n\n    var marker = trace.marker || {};\n    var selectedMarker = selectedAttrs.marker || {};\n    var unselectedMarker = unselectedAttrs.marker || {};\n\n    var mo = marker.opacity;\n    var smo = selectedMarker.opacity;\n    var usmo = unselectedMarker.opacity;\n    var smoIsDefined = smo !== undefined;\n    var usmoIsDefined = usmo !== undefined;\n\n    if(Lib.isArrayOrTypedArray(mo) || smoIsDefined || usmoIsDefined) {\n        out.selectedOpacityFn = function(d) {\n            var base = d.mo === undefined ? marker.opacity : d.mo;\n\n            if(d.selected) {\n                return smoIsDefined ? smo : base;\n            } else {\n                return usmoIsDefined ? usmo : DESELECTDIM * base;\n            }\n        };\n    }\n\n    var mc = marker.color;\n    var smc = selectedMarker.color;\n    var usmc = unselectedMarker.color;\n\n    if(smc || usmc) {\n        out.selectedColorFn = function(d) {\n            var base = d.mcc || mc;\n\n            if(d.selected) {\n                return smc || base;\n            } else {\n                return usmc || base;\n            }\n        };\n    }\n\n    var ms = marker.size;\n    var sms = selectedMarker.size;\n    var usms = unselectedMarker.size;\n    var smsIsDefined = sms !== undefined;\n    var usmsIsDefined = usms !== undefined;\n\n    if(Registry.traceIs(trace, 'symbols') && (smsIsDefined || usmsIsDefined)) {\n        out.selectedSizeFn = function(d) {\n            var base = d.mrc || ms / 2;\n\n            if(d.selected) {\n                return smsIsDefined ? sms / 2 : base;\n            } else {\n                return usmsIsDefined ? usms / 2 : base;\n            }\n        };\n    }\n\n    return out;\n};\n\ndrawing.makeSelectedTextStyleFns = function(trace) {\n    var out = {};\n\n    var selectedAttrs = trace.selected || {};\n    var unselectedAttrs = trace.unselected || {};\n\n    var textFont = trace.textfont || {};\n    var selectedTextFont = selectedAttrs.textfont || {};\n    var unselectedTextFont = unselectedAttrs.textfont || {};\n\n    var tc = textFont.color;\n    var stc = selectedTextFont.color;\n    var utc = unselectedTextFont.color;\n\n    out.selectedTextColorFn = function(d) {\n        var base = d.tc || tc;\n\n        if(d.selected) {\n            return stc || base;\n        } else {\n            if(utc) return utc;\n            else return stc ? base : Color.addOpacity(base, DESELECTDIM);\n        }\n    };\n\n    return out;\n};\n\ndrawing.selectedPointStyle = function(s, trace) {\n    if(!s.size() || !trace.selectedpoints) return;\n\n    var fns = drawing.makeSelectedPointStyleFns(trace);\n    var marker = trace.marker || {};\n    var seq = [];\n\n    if(fns.selectedOpacityFn) {\n        seq.push(function(pt, d) {\n            pt.style('opacity', fns.selectedOpacityFn(d));\n        });\n    }\n\n    if(fns.selectedColorFn) {\n        seq.push(function(pt, d) {\n            Color.fill(pt, fns.selectedColorFn(d));\n        });\n    }\n\n    if(fns.selectedSizeFn) {\n        seq.push(function(pt, d) {\n            var mx = d.mx || marker.symbol || 0;\n            var mrc2 = fns.selectedSizeFn(d);\n\n            pt.attr('d', makePointPath(drawing.symbolNumber(mx), mrc2));\n\n            // save for Drawing.selectedTextStyle\n            d.mrc2 = mrc2;\n        });\n    }\n\n    if(seq.length) {\n        s.each(function(d) {\n            var pt = d3.select(this);\n            for(var i = 0; i < seq.length; i++) {\n                seq[i](pt, d);\n            }\n        });\n    }\n};\n\ndrawing.tryColorscale = function(marker, prefix) {\n    var cont = prefix ? Lib.nestedProperty(marker, prefix).get() : marker;\n\n    if(cont) {\n        var colorArray = cont.color;\n        if((cont.colorscale || cont._colorAx) && Lib.isArrayOrTypedArray(colorArray)) {\n            return Colorscale.makeColorScaleFuncFromTrace(cont);\n        }\n    }\n    return Lib.identity;\n};\n\nvar TEXTOFFSETSIGN = {\n    start: 1, end: -1, middle: 0, bottom: 1, top: -1\n};\n\nfunction textPointPosition(s, textPosition, fontSize, markerRadius) {\n    var group = d3.select(s.node().parentNode);\n\n    var v = textPosition.indexOf('top') !== -1 ?\n        'top' :\n        textPosition.indexOf('bottom') !== -1 ? 'bottom' : 'middle';\n    var h = textPosition.indexOf('left') !== -1 ?\n        'end' :\n        textPosition.indexOf('right') !== -1 ? 'start' : 'middle';\n\n    // if markers are shown, offset a little more than\n    // the nominal marker size\n    // ie 2/1.6 * nominal, bcs some markers are a bit bigger\n    var r = markerRadius ? markerRadius / 0.8 + 1 : 0;\n\n    var numLines = (svgTextUtils.lineCount(s) - 1) * LINE_SPACING + 1;\n    var dx = TEXTOFFSETSIGN[h] * r;\n    var dy = fontSize * 0.75 + TEXTOFFSETSIGN[v] * r +\n        (TEXTOFFSETSIGN[v] - 1) * numLines * fontSize / 2;\n\n    // fix the overall text group position\n    s.attr('text-anchor', h);\n    group.attr('transform', 'translate(' + dx + ',' + dy + ')');\n}\n\nfunction extracTextFontSize(d, trace) {\n    var fontSize = d.ts || trace.textfont.size;\n    return (isNumeric(fontSize) && fontSize > 0) ? fontSize : 0;\n}\n\n// draw text at points\ndrawing.textPointStyle = function(s, trace, gd) {\n    if(!s.size()) return;\n\n    var selectedTextColorFn;\n    if(trace.selectedpoints) {\n        var fns = drawing.makeSelectedTextStyleFns(trace);\n        selectedTextColorFn = fns.selectedTextColorFn;\n    }\n\n    var texttemplate = trace.texttemplate;\n    var fullLayout = gd._fullLayout;\n\n    s.each(function(d) {\n        var p = d3.select(this);\n\n        var text = texttemplate ?\n            Lib.extractOption(d, trace, 'txt', 'texttemplate') :\n            Lib.extractOption(d, trace, 'tx', 'text');\n\n        if(!text && text !== 0) {\n            p.remove();\n            return;\n        }\n\n        if(texttemplate) {\n            var labels = trace._module.formatLabels ? trace._module.formatLabels(d, trace, fullLayout) : {};\n            var pointValues = {};\n            appendArrayPointValue(pointValues, trace, d.i);\n            var meta = trace._meta || {};\n            text = Lib.texttemplateString(text, labels, fullLayout._d3locale, pointValues, d, meta);\n        }\n\n        var pos = d.tp || trace.textposition;\n        var fontSize = extracTextFontSize(d, trace);\n        var fontColor = selectedTextColorFn ?\n            selectedTextColorFn(d) :\n            (d.tc || trace.textfont.color);\n\n        p.call(drawing.font,\n                d.tf || trace.textfont.family,\n                fontSize,\n                fontColor)\n            .text(text)\n            .call(svgTextUtils.convertToTspans, gd)\n            .call(textPointPosition, pos, fontSize, d.mrc);\n    });\n};\n\ndrawing.selectedTextStyle = function(s, trace) {\n    if(!s.size() || !trace.selectedpoints) return;\n\n    var fns = drawing.makeSelectedTextStyleFns(trace);\n\n    s.each(function(d) {\n        var tx = d3.select(this);\n        var tc = fns.selectedTextColorFn(d);\n        var tp = d.tp || trace.textposition;\n        var fontSize = extracTextFontSize(d, trace);\n\n        Color.fill(tx, tc);\n        textPointPosition(tx, tp, fontSize, d.mrc2 || d.mrc);\n    });\n};\n\n// generalized Catmull-Rom splines, per\n// http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\nvar CatmullRomExp = 0.5;\ndrawing.smoothopen = function(pts, smoothness) {\n    if(pts.length < 3) { return 'M' + pts.join('L');}\n    var path = 'M' + pts[0];\n    var tangents = [];\n    var i;\n    for(i = 1; i < pts.length - 1; i++) {\n        tangents.push(makeTangent(pts[i - 1], pts[i], pts[i + 1], smoothness));\n    }\n    path += 'Q' + tangents[0][0] + ' ' + pts[1];\n    for(i = 2; i < pts.length - 1; i++) {\n        path += 'C' + tangents[i - 2][1] + ' ' + tangents[i - 1][0] + ' ' + pts[i];\n    }\n    path += 'Q' + tangents[pts.length - 3][1] + ' ' + pts[pts.length - 1];\n    return path;\n};\n\ndrawing.smoothclosed = function(pts, smoothness) {\n    if(pts.length < 3) { return 'M' + pts.join('L') + 'Z'; }\n    var path = 'M' + pts[0];\n    var pLast = pts.length - 1;\n    var tangents = [makeTangent(pts[pLast], pts[0], pts[1], smoothness)];\n    var i;\n    for(i = 1; i < pLast; i++) {\n        tangents.push(makeTangent(pts[i - 1], pts[i], pts[i + 1], smoothness));\n    }\n    tangents.push(\n        makeTangent(pts[pLast - 1], pts[pLast], pts[0], smoothness)\n    );\n\n    for(i = 1; i <= pLast; i++) {\n        path += 'C' + tangents[i - 1][1] + ' ' + tangents[i][0] + ' ' + pts[i];\n    }\n    path += 'C' + tangents[pLast][1] + ' ' + tangents[0][0] + ' ' + pts[0] + 'Z';\n    return path;\n};\n\nfunction makeTangent(prevpt, thispt, nextpt, smoothness) {\n    var d1x = prevpt[0] - thispt[0];\n    var d1y = prevpt[1] - thispt[1];\n    var d2x = nextpt[0] - thispt[0];\n    var d2y = nextpt[1] - thispt[1];\n    var d1a = Math.pow(d1x * d1x + d1y * d1y, CatmullRomExp / 2);\n    var d2a = Math.pow(d2x * d2x + d2y * d2y, CatmullRomExp / 2);\n    var numx = (d2a * d2a * d1x - d1a * d1a * d2x) * smoothness;\n    var numy = (d2a * d2a * d1y - d1a * d1a * d2y) * smoothness;\n    var denom1 = 3 * d2a * (d1a + d2a);\n    var denom2 = 3 * d1a * (d1a + d2a);\n    return [\n        [\n            d3.round(thispt[0] + (denom1 && numx / denom1), 2),\n            d3.round(thispt[1] + (denom1 && numy / denom1), 2)\n        ], [\n            d3.round(thispt[0] - (denom2 && numx / denom2), 2),\n            d3.round(thispt[1] - (denom2 && numy / denom2), 2)\n        ]\n    ];\n}\n\n// step paths - returns a generator function for paths\n// with the given step shape\nvar STEPPATH = {\n    hv: function(p0, p1) {\n        return 'H' + d3.round(p1[0], 2) + 'V' + d3.round(p1[1], 2);\n    },\n    vh: function(p0, p1) {\n        return 'V' + d3.round(p1[1], 2) + 'H' + d3.round(p1[0], 2);\n    },\n    hvh: function(p0, p1) {\n        return 'H' + d3.round((p0[0] + p1[0]) / 2, 2) + 'V' +\n            d3.round(p1[1], 2) + 'H' + d3.round(p1[0], 2);\n    },\n    vhv: function(p0, p1) {\n        return 'V' + d3.round((p0[1] + p1[1]) / 2, 2) + 'H' +\n            d3.round(p1[0], 2) + 'V' + d3.round(p1[1], 2);\n    }\n};\nvar STEPLINEAR = function(p0, p1) {\n    return 'L' + d3.round(p1[0], 2) + ',' + d3.round(p1[1], 2);\n};\ndrawing.steps = function(shape) {\n    var onestep = STEPPATH[shape] || STEPLINEAR;\n    return function(pts) {\n        var path = 'M' + d3.round(pts[0][0], 2) + ',' + d3.round(pts[0][1], 2);\n        for(var i = 1; i < pts.length; i++) {\n            path += onestep(pts[i - 1], pts[i]);\n        }\n        return path;\n    };\n};\n\n// off-screen svg render testing element, shared by the whole page\n// uses the id 'js-plotly-tester' and stores it in drawing.tester\ndrawing.makeTester = function() {\n    var tester = Lib.ensureSingleById(d3.select('body'), 'svg', 'js-plotly-tester', function(s) {\n        s.attr(xmlnsNamespaces.svgAttrs)\n            .style({\n                position: 'absolute',\n                left: '-10000px',\n                top: '-10000px',\n                width: '9000px',\n                height: '9000px',\n                'z-index': '1'\n            });\n    });\n\n    // browsers differ on how they describe the bounding rect of\n    // the svg if its contents spill over... so make a 1x1px\n    // reference point we can measure off of.\n    var testref = Lib.ensureSingle(tester, 'path', 'js-reference-point', function(s) {\n        s.attr('d', 'M0,0H1V1H0Z')\n            .style({\n                'stroke-width': 0,\n                fill: 'black'\n            });\n    });\n\n    drawing.tester = tester;\n    drawing.testref = testref;\n};\n\n/*\n * use our offscreen tester to get a clientRect for an element,\n * in a reference frame where it isn't translated (or transformed) and\n * its anchor point is at (0,0)\n * always returns a copy of the bbox, so the caller can modify it safely\n *\n * @param {SVGElement} node: the element to measure. If possible this should be\n *   a <text> or MathJax <g> element that's already passed through\n *   `convertToTspans` because in that case we can cache the results, but it's\n *   possible to pass in any svg element.\n *\n * @param {boolean} inTester: is this element already in `drawing.tester`?\n *   If you are measuring a dummy element, rather than one you really intend\n *   to use on the plot, making it in `drawing.tester` in the first place\n *   allows us to test faster because it cuts out cloning and appending it.\n *\n * @param {string} hash: for internal use only, if we already know the cache key\n *   for this element beforehand.\n *\n * @return {object}: a plain object containing the width, height, left, right,\n *   top, and bottom of `node`\n */\ndrawing.savedBBoxes = {};\nvar savedBBoxesCount = 0;\nvar maxSavedBBoxes = 10000;\n\ndrawing.bBox = function(node, inTester, hash) {\n    /*\n     * Cache elements we've already measured so we don't have to\n     * remeasure the same thing many times\n     * We have a few bBox callers though who pass a node larger than\n     * a <text> or a MathJax <g>, such as an axis group containing many labels.\n     * These will not generate a hash (unless we figure out an appropriate\n     * hash key for them) and thus we will not hash them.\n     */\n    if(!hash) hash = nodeHash(node);\n    var out;\n    if(hash) {\n        out = drawing.savedBBoxes[hash];\n        if(out) return Lib.extendFlat({}, out);\n    } else if(node.childNodes.length === 1) {\n        /*\n         * If we have only one child element, which is itself hashable, make\n         * a new hash from this element plus its x,y,transform\n         * These bounding boxes *include* x,y,transform - mostly for use by\n         * callers trying to avoid overlaps (ie titles)\n         */\n        var innerNode = node.childNodes[0];\n\n        hash = nodeHash(innerNode);\n        if(hash) {\n            var x = +innerNode.getAttribute('x') || 0;\n            var y = +innerNode.getAttribute('y') || 0;\n            var transform = innerNode.getAttribute('transform');\n\n            if(!transform) {\n                // in this case, just varying x and y, don't bother caching\n                // the final bBox because the alteration is quick.\n                var innerBB = drawing.bBox(innerNode, false, hash);\n                if(x) {\n                    innerBB.left += x;\n                    innerBB.right += x;\n                }\n                if(y) {\n                    innerBB.top += y;\n                    innerBB.bottom += y;\n                }\n                return innerBB;\n            }\n            /*\n             * else we have a transform - rather than make a complicated\n             * (and error-prone and probably slow) transform parser/calculator,\n             * just continue on calculating the boundingClientRect of the group\n             * and use the new composite hash to cache it.\n             * That said, `innerNode.transform.baseVal` is an array of\n             * `SVGTransform` objects, that *do* seem to have a nice matrix\n             * multiplication interface that we could use to avoid making\n             * another getBoundingClientRect call...\n             */\n            hash += '~' + x + '~' + y + '~' + transform;\n\n            out = drawing.savedBBoxes[hash];\n            if(out) return Lib.extendFlat({}, out);\n        }\n    }\n    var testNode, tester;\n    if(inTester) {\n        testNode = node;\n    } else {\n        tester = drawing.tester.node();\n\n        // copy the node to test into the tester\n        testNode = node.cloneNode(true);\n        tester.appendChild(testNode);\n    }\n\n    // standardize its position (and newline tspans if any)\n    d3.select(testNode)\n        .attr('transform', null)\n        .call(svgTextUtils.positionText, 0, 0);\n\n    var testRect = testNode.getBoundingClientRect();\n    var refRect = drawing.testref\n        .node()\n        .getBoundingClientRect();\n\n    if(!inTester) tester.removeChild(testNode);\n\n    var bb = {\n        height: testRect.height,\n        width: testRect.width,\n        left: testRect.left - refRect.left,\n        top: testRect.top - refRect.top,\n        right: testRect.right - refRect.left,\n        bottom: testRect.bottom - refRect.top\n    };\n\n    // make sure we don't have too many saved boxes,\n    // or a long session could overload on memory\n    // by saving boxes for long-gone elements\n    if(savedBBoxesCount >= maxSavedBBoxes) {\n        drawing.savedBBoxes = {};\n        savedBBoxesCount = 0;\n    }\n\n    // cache this bbox\n    if(hash) drawing.savedBBoxes[hash] = bb;\n    savedBBoxesCount++;\n\n    return Lib.extendFlat({}, bb);\n};\n\n// capture everything about a node (at least in our usage) that\n// impacts its bounding box, given that bBox clears x, y, and transform\nfunction nodeHash(node) {\n    var inputText = node.getAttribute('data-unformatted');\n    if(inputText === null) return;\n    return inputText +\n        node.getAttribute('data-math') +\n        node.getAttribute('text-anchor') +\n        node.getAttribute('style');\n}\n\n/**\n * Set clipPath URL in a way that work for all situations.\n *\n * In details, graphs on pages with <base> HTML tags need to prepend\n * the clip path ids with the page's base url EXCEPT during toImage exports.\n *\n * @param {d3 selection} s : node to add clip-path attribute\n * @param {string} localId : local clip-path (w/o base url) id\n * @param {DOM element || object} gd\n * - context._baseUrl {string}\n * - context._exportedPlot {boolean}\n */\ndrawing.setClipUrl = function(s, localId, gd) {\n    s.attr('clip-path', getFullUrl(localId, gd));\n};\n\nfunction getFullUrl(localId, gd) {\n    if(!localId) return null;\n\n    var context = gd._context;\n    var baseUrl = context._exportedPlot ? '' : (context._baseUrl || '');\n    return 'url(\\'' + baseUrl + '#' + localId + '\\')';\n}\n\ndrawing.getTranslate = function(element) {\n    // Note the separator [^\\d] between x and y in this regex\n    // We generally use ',' but IE will convert it to ' '\n    var re = /.*\\btranslate\\((-?\\d*\\.?\\d*)[^-\\d]*(-?\\d*\\.?\\d*)[^\\d].*/;\n    var getter = element.attr ? 'attr' : 'getAttribute';\n    var transform = element[getter]('transform') || '';\n\n    var translate = transform.replace(re, function(match, p1, p2) {\n        return [p1, p2].join(' ');\n    })\n    .split(' ');\n\n    return {\n        x: +translate[0] || 0,\n        y: +translate[1] || 0\n    };\n};\n\ndrawing.setTranslate = function(element, x, y) {\n    var re = /(\\btranslate\\(.*?\\);?)/;\n    var getter = element.attr ? 'attr' : 'getAttribute';\n    var setter = element.attr ? 'attr' : 'setAttribute';\n    var transform = element[getter]('transform') || '';\n\n    x = x || 0;\n    y = y || 0;\n\n    transform = transform.replace(re, '').trim();\n    transform += ' translate(' + x + ', ' + y + ')';\n    transform = transform.trim();\n\n    element[setter]('transform', transform);\n\n    return transform;\n};\n\ndrawing.getScale = function(element) {\n    var re = /.*\\bscale\\((\\d*\\.?\\d*)[^\\d]*(\\d*\\.?\\d*)[^\\d].*/;\n    var getter = element.attr ? 'attr' : 'getAttribute';\n    var transform = element[getter]('transform') || '';\n\n    var translate = transform.replace(re, function(match, p1, p2) {\n        return [p1, p2].join(' ');\n    })\n    .split(' ');\n\n    return {\n        x: +translate[0] || 1,\n        y: +translate[1] || 1\n    };\n};\n\ndrawing.setScale = function(element, x, y) {\n    var re = /(\\bscale\\(.*?\\);?)/;\n    var getter = element.attr ? 'attr' : 'getAttribute';\n    var setter = element.attr ? 'attr' : 'setAttribute';\n    var transform = element[getter]('transform') || '';\n\n    x = x || 1;\n    y = y || 1;\n\n    transform = transform.replace(re, '').trim();\n    transform += ' scale(' + x + ', ' + y + ')';\n    transform = transform.trim();\n\n    element[setter]('transform', transform);\n\n    return transform;\n};\n\nvar SCALE_RE = /\\s*sc.*/;\n\ndrawing.setPointGroupScale = function(selection, xScale, yScale) {\n    xScale = xScale || 1;\n    yScale = yScale || 1;\n\n    if(!selection) return;\n\n    // The same scale transform for every point:\n    var scale = (xScale === 1 && yScale === 1) ?\n        '' :\n        ' scale(' + xScale + ',' + yScale + ')';\n\n    selection.each(function() {\n        var t = (this.getAttribute('transform') || '').replace(SCALE_RE, '');\n        t += scale;\n        t = t.trim();\n        this.setAttribute('transform', t);\n    });\n};\n\nvar TEXT_POINT_LAST_TRANSLATION_RE = /translate\\([^)]*\\)\\s*$/;\n\ndrawing.setTextPointsScale = function(selection, xScale, yScale) {\n    if(!selection) return;\n\n    selection.each(function() {\n        var transforms;\n        var el = d3.select(this);\n        var text = el.select('text');\n\n        if(!text.node()) return;\n\n        var x = parseFloat(text.attr('x') || 0);\n        var y = parseFloat(text.attr('y') || 0);\n\n        var existingTransform = (el.attr('transform') || '').match(TEXT_POINT_LAST_TRANSLATION_RE);\n\n        if(xScale === 1 && yScale === 1) {\n            transforms = [];\n        } else {\n            transforms = [\n                'translate(' + x + ',' + y + ')',\n                'scale(' + xScale + ',' + yScale + ')',\n                'translate(' + (-x) + ',' + (-y) + ')',\n            ];\n        }\n\n        if(existingTransform) {\n            transforms.push(existingTransform);\n        }\n\n        el.attr('transform', transforms.join(' '));\n    });\n};\n\n},{\"../../components/fx/helpers\":88,\"../../constants/alignment\":154,\"../../constants/interactions\":157,\"../../constants/xmlns_namespaces\":159,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../registry\":269,\"../../traces/scatter/make_bubble_size_func\":406,\"../../traces/scatter/subtypes\":413,\"../color\":52,\"../colorscale\":64,\"./symbol_defs\":75,\"d3\":16,\"fast-isnumeric\":18,\"tinycolor2\":35}],75:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\n/** Marker symbol definitions\n * users can specify markers either by number or name\n * add 100 (or '-open') and you get an open marker\n *  open markers have no fill and use line color as the stroke color\n * add 200 (or '-dot') and you get a dot in the middle\n * add both and you get both\n */\n\nmodule.exports = {\n    circle: {\n        n: 0,\n        f: function(r) {\n            var rs = d3.round(r, 2);\n            return 'M' + rs + ',0A' + rs + ',' + rs + ' 0 1,1 0,-' + rs +\n                'A' + rs + ',' + rs + ' 0 0,1 ' + rs + ',0Z';\n        }\n    },\n    square: {\n        n: 1,\n        f: function(r) {\n            var rs = d3.round(r, 2);\n            return 'M' + rs + ',' + rs + 'H-' + rs + 'V-' + rs + 'H' + rs + 'Z';\n        }\n    },\n    diamond: {\n        n: 2,\n        f: function(r) {\n            var rd = d3.round(r * 1.3, 2);\n            return 'M' + rd + ',0L0,' + rd + 'L-' + rd + ',0L0,-' + rd + 'Z';\n        }\n    },\n    cross: {\n        n: 3,\n        f: function(r) {\n            var rc = d3.round(r * 0.4, 2);\n            var rc2 = d3.round(r * 1.2, 2);\n            return 'M' + rc2 + ',' + rc + 'H' + rc + 'V' + rc2 + 'H-' + rc +\n                'V' + rc + 'H-' + rc2 + 'V-' + rc + 'H-' + rc + 'V-' + rc2 +\n                'H' + rc + 'V-' + rc + 'H' + rc2 + 'Z';\n        }\n    },\n    x: {\n        n: 4,\n        f: function(r) {\n            var rx = d3.round(r * 0.8 / Math.sqrt(2), 2);\n            var ne = 'l' + rx + ',' + rx;\n            var se = 'l' + rx + ',-' + rx;\n            var sw = 'l-' + rx + ',-' + rx;\n            var nw = 'l-' + rx + ',' + rx;\n            return 'M0,' + rx + ne + se + sw + se + sw + nw + sw + nw + ne + nw + ne + 'Z';\n        }\n    },\n    'triangle-up': {\n        n: 5,\n        f: function(r) {\n            var rt = d3.round(r * 2 / Math.sqrt(3), 2);\n            var r2 = d3.round(r / 2, 2);\n            var rs = d3.round(r, 2);\n            return 'M-' + rt + ',' + r2 + 'H' + rt + 'L0,-' + rs + 'Z';\n        }\n    },\n    'triangle-down': {\n        n: 6,\n        f: function(r) {\n            var rt = d3.round(r * 2 / Math.sqrt(3), 2);\n            var r2 = d3.round(r / 2, 2);\n            var rs = d3.round(r, 2);\n            return 'M-' + rt + ',-' + r2 + 'H' + rt + 'L0,' + rs + 'Z';\n        }\n    },\n    'triangle-left': {\n        n: 7,\n        f: function(r) {\n            var rt = d3.round(r * 2 / Math.sqrt(3), 2);\n            var r2 = d3.round(r / 2, 2);\n            var rs = d3.round(r, 2);\n            return 'M' + r2 + ',-' + rt + 'V' + rt + 'L-' + rs + ',0Z';\n        }\n    },\n    'triangle-right': {\n        n: 8,\n        f: function(r) {\n            var rt = d3.round(r * 2 / Math.sqrt(3), 2);\n            var r2 = d3.round(r / 2, 2);\n            var rs = d3.round(r, 2);\n            return 'M-' + r2 + ',-' + rt + 'V' + rt + 'L' + rs + ',0Z';\n        }\n    },\n    'triangle-ne': {\n        n: 9,\n        f: function(r) {\n            var r1 = d3.round(r * 0.6, 2);\n            var r2 = d3.round(r * 1.2, 2);\n            return 'M-' + r2 + ',-' + r1 + 'H' + r1 + 'V' + r2 + 'Z';\n        }\n    },\n    'triangle-se': {\n        n: 10,\n        f: function(r) {\n            var r1 = d3.round(r * 0.6, 2);\n            var r2 = d3.round(r * 1.2, 2);\n            return 'M' + r1 + ',-' + r2 + 'V' + r1 + 'H-' + r2 + 'Z';\n        }\n    },\n    'triangle-sw': {\n        n: 11,\n        f: function(r) {\n            var r1 = d3.round(r * 0.6, 2);\n            var r2 = d3.round(r * 1.2, 2);\n            return 'M' + r2 + ',' + r1 + 'H-' + r1 + 'V-' + r2 + 'Z';\n        }\n    },\n    'triangle-nw': {\n        n: 12,\n        f: function(r) {\n            var r1 = d3.round(r * 0.6, 2);\n            var r2 = d3.round(r * 1.2, 2);\n            return 'M-' + r1 + ',' + r2 + 'V-' + r1 + 'H' + r2 + 'Z';\n        }\n    },\n    pentagon: {\n        n: 13,\n        f: function(r) {\n            var x1 = d3.round(r * 0.951, 2);\n            var x2 = d3.round(r * 0.588, 2);\n            var y0 = d3.round(-r, 2);\n            var y1 = d3.round(r * -0.309, 2);\n            var y2 = d3.round(r * 0.809, 2);\n            return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2 + 'H-' + x2 +\n                'L-' + x1 + ',' + y1 + 'L0,' + y0 + 'Z';\n        }\n    },\n    hexagon: {\n        n: 14,\n        f: function(r) {\n            var y0 = d3.round(r, 2);\n            var y1 = d3.round(r / 2, 2);\n            var x = d3.round(r * Math.sqrt(3) / 2, 2);\n            return 'M' + x + ',-' + y1 + 'V' + y1 + 'L0,' + y0 +\n                'L-' + x + ',' + y1 + 'V-' + y1 + 'L0,-' + y0 + 'Z';\n        }\n    },\n    hexagon2: {\n        n: 15,\n        f: function(r) {\n            var x0 = d3.round(r, 2);\n            var x1 = d3.round(r / 2, 2);\n            var y = d3.round(r * Math.sqrt(3) / 2, 2);\n            return 'M-' + x1 + ',' + y + 'H' + x1 + 'L' + x0 +\n                ',0L' + x1 + ',-' + y + 'H-' + x1 + 'L-' + x0 + ',0Z';\n        }\n    },\n    octagon: {\n        n: 16,\n        f: function(r) {\n            var a = d3.round(r * 0.924, 2);\n            var b = d3.round(r * 0.383, 2);\n            return 'M-' + b + ',-' + a + 'H' + b + 'L' + a + ',-' + b + 'V' + b +\n                'L' + b + ',' + a + 'H-' + b + 'L-' + a + ',' + b + 'V-' + b + 'Z';\n        }\n    },\n    star: {\n        n: 17,\n        f: function(r) {\n            var rs = r * 1.4;\n            var x1 = d3.round(rs * 0.225, 2);\n            var x2 = d3.round(rs * 0.951, 2);\n            var x3 = d3.round(rs * 0.363, 2);\n            var x4 = d3.round(rs * 0.588, 2);\n            var y0 = d3.round(-rs, 2);\n            var y1 = d3.round(rs * -0.309, 2);\n            var y3 = d3.round(rs * 0.118, 2);\n            var y4 = d3.round(rs * 0.809, 2);\n            var y5 = d3.round(rs * 0.382, 2);\n            return 'M' + x1 + ',' + y1 + 'H' + x2 + 'L' + x3 + ',' + y3 +\n                'L' + x4 + ',' + y4 + 'L0,' + y5 + 'L-' + x4 + ',' + y4 +\n                'L-' + x3 + ',' + y3 + 'L-' + x2 + ',' + y1 + 'H-' + x1 +\n                'L0,' + y0 + 'Z';\n        }\n    },\n    hexagram: {\n        n: 18,\n        f: function(r) {\n            var y = d3.round(r * 0.66, 2);\n            var x1 = d3.round(r * 0.38, 2);\n            var x2 = d3.round(r * 0.76, 2);\n            return 'M-' + x2 + ',0l-' + x1 + ',-' + y + 'h' + x2 +\n                'l' + x1 + ',-' + y + 'l' + x1 + ',' + y + 'h' + x2 +\n                'l-' + x1 + ',' + y + 'l' + x1 + ',' + y + 'h-' + x2 +\n                'l-' + x1 + ',' + y + 'l-' + x1 + ',-' + y + 'h-' + x2 + 'Z';\n        }\n    },\n    'star-triangle-up': {\n        n: 19,\n        f: function(r) {\n            var x = d3.round(r * Math.sqrt(3) * 0.8, 2);\n            var y1 = d3.round(r * 0.8, 2);\n            var y2 = d3.round(r * 1.6, 2);\n            var rc = d3.round(r * 4, 2);\n            var aPart = 'A ' + rc + ',' + rc + ' 0 0 1 ';\n            return 'M-' + x + ',' + y1 + aPart + x + ',' + y1 +\n                aPart + '0,-' + y2 + aPart + '-' + x + ',' + y1 + 'Z';\n        }\n    },\n    'star-triangle-down': {\n        n: 20,\n        f: function(r) {\n            var x = d3.round(r * Math.sqrt(3) * 0.8, 2);\n            var y1 = d3.round(r * 0.8, 2);\n            var y2 = d3.round(r * 1.6, 2);\n            var rc = d3.round(r * 4, 2);\n            var aPart = 'A ' + rc + ',' + rc + ' 0 0 1 ';\n            return 'M' + x + ',-' + y1 + aPart + '-' + x + ',-' + y1 +\n                aPart + '0,' + y2 + aPart + x + ',-' + y1 + 'Z';\n        }\n    },\n    'star-square': {\n        n: 21,\n        f: function(r) {\n            var rp = d3.round(r * 1.1, 2);\n            var rc = d3.round(r * 2, 2);\n            var aPart = 'A ' + rc + ',' + rc + ' 0 0 1 ';\n            return 'M-' + rp + ',-' + rp + aPart + '-' + rp + ',' + rp +\n                aPart + rp + ',' + rp + aPart + rp + ',-' + rp +\n                aPart + '-' + rp + ',-' + rp + 'Z';\n        }\n    },\n    'star-diamond': {\n        n: 22,\n        f: function(r) {\n            var rp = d3.round(r * 1.4, 2);\n            var rc = d3.round(r * 1.9, 2);\n            var aPart = 'A ' + rc + ',' + rc + ' 0 0 1 ';\n            return 'M-' + rp + ',0' + aPart + '0,' + rp +\n                aPart + rp + ',0' + aPart + '0,-' + rp +\n                aPart + '-' + rp + ',0' + 'Z';\n        }\n    },\n    'diamond-tall': {\n        n: 23,\n        f: function(r) {\n            var x = d3.round(r * 0.7, 2);\n            var y = d3.round(r * 1.4, 2);\n            return 'M0,' + y + 'L' + x + ',0L0,-' + y + 'L-' + x + ',0Z';\n        }\n    },\n    'diamond-wide': {\n        n: 24,\n        f: function(r) {\n            var x = d3.round(r * 1.4, 2);\n            var y = d3.round(r * 0.7, 2);\n            return 'M0,' + y + 'L' + x + ',0L0,-' + y + 'L-' + x + ',0Z';\n        }\n    },\n    hourglass: {\n        n: 25,\n        f: function(r) {\n            var rs = d3.round(r, 2);\n            return 'M' + rs + ',' + rs + 'H-' + rs + 'L' + rs + ',-' + rs + 'H-' + rs + 'Z';\n        },\n        noDot: true\n    },\n    bowtie: {\n        n: 26,\n        f: function(r) {\n            var rs = d3.round(r, 2);\n            return 'M' + rs + ',' + rs + 'V-' + rs + 'L-' + rs + ',' + rs + 'V-' + rs + 'Z';\n        },\n        noDot: true\n    },\n    'circle-cross': {\n        n: 27,\n        f: function(r) {\n            var rs = d3.round(r, 2);\n            return 'M0,' + rs + 'V-' + rs + 'M' + rs + ',0H-' + rs +\n                'M' + rs + ',0A' + rs + ',' + rs + ' 0 1,1 0,-' + rs +\n                'A' + rs + ',' + rs + ' 0 0,1 ' + rs + ',0Z';\n        },\n        needLine: true,\n        noDot: true\n    },\n    'circle-x': {\n        n: 28,\n        f: function(r) {\n            var rs = d3.round(r, 2);\n            var rc = d3.round(r / Math.sqrt(2), 2);\n            return 'M' + rc + ',' + rc + 'L-' + rc + ',-' + rc +\n                'M' + rc + ',-' + rc + 'L-' + rc + ',' + rc +\n                'M' + rs + ',0A' + rs + ',' + rs + ' 0 1,1 0,-' + rs +\n                'A' + rs + ',' + rs + ' 0 0,1 ' + rs + ',0Z';\n        },\n        needLine: true,\n        noDot: true\n    },\n    'square-cross': {\n        n: 29,\n        f: function(r) {\n            var rs = d3.round(r, 2);\n            return 'M0,' + rs + 'V-' + rs + 'M' + rs + ',0H-' + rs +\n                'M' + rs + ',' + rs + 'H-' + rs + 'V-' + rs + 'H' + rs + 'Z';\n        },\n        needLine: true,\n        noDot: true\n    },\n    'square-x': {\n        n: 30,\n        f: function(r) {\n            var rs = d3.round(r, 2);\n            return 'M' + rs + ',' + rs + 'L-' + rs + ',-' + rs +\n                'M' + rs + ',-' + rs + 'L-' + rs + ',' + rs +\n                'M' + rs + ',' + rs + 'H-' + rs + 'V-' + rs + 'H' + rs + 'Z';\n        },\n        needLine: true,\n        noDot: true\n    },\n    'diamond-cross': {\n        n: 31,\n        f: function(r) {\n            var rd = d3.round(r * 1.3, 2);\n            return 'M' + rd + ',0L0,' + rd + 'L-' + rd + ',0L0,-' + rd + 'Z' +\n                'M0,-' + rd + 'V' + rd + 'M-' + rd + ',0H' + rd;\n        },\n        needLine: true,\n        noDot: true\n    },\n    'diamond-x': {\n        n: 32,\n        f: function(r) {\n            var rd = d3.round(r * 1.3, 2);\n            var r2 = d3.round(r * 0.65, 2);\n            return 'M' + rd + ',0L0,' + rd + 'L-' + rd + ',0L0,-' + rd + 'Z' +\n                'M-' + r2 + ',-' + r2 + 'L' + r2 + ',' + r2 +\n                'M-' + r2 + ',' + r2 + 'L' + r2 + ',-' + r2;\n        },\n        needLine: true,\n        noDot: true\n    },\n    'cross-thin': {\n        n: 33,\n        f: function(r) {\n            var rc = d3.round(r * 1.4, 2);\n            return 'M0,' + rc + 'V-' + rc + 'M' + rc + ',0H-' + rc;\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    'x-thin': {\n        n: 34,\n        f: function(r) {\n            var rx = d3.round(r, 2);\n            return 'M' + rx + ',' + rx + 'L-' + rx + ',-' + rx +\n                'M' + rx + ',-' + rx + 'L-' + rx + ',' + rx;\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    asterisk: {\n        n: 35,\n        f: function(r) {\n            var rc = d3.round(r * 1.2, 2);\n            var rs = d3.round(r * 0.85, 2);\n            return 'M0,' + rc + 'V-' + rc + 'M' + rc + ',0H-' + rc +\n                'M' + rs + ',' + rs + 'L-' + rs + ',-' + rs +\n                'M' + rs + ',-' + rs + 'L-' + rs + ',' + rs;\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    hash: {\n        n: 36,\n        f: function(r) {\n            var r1 = d3.round(r / 2, 2);\n            var r2 = d3.round(r, 2);\n            return 'M' + r1 + ',' + r2 + 'V-' + r2 +\n                'm-' + r2 + ',0V' + r2 +\n                'M' + r2 + ',' + r1 + 'H-' + r2 +\n                'm0,-' + r2 + 'H' + r2;\n        },\n        needLine: true,\n        noFill: true\n    },\n    'y-up': {\n        n: 37,\n        f: function(r) {\n            var x = d3.round(r * 1.2, 2);\n            var y0 = d3.round(r * 1.6, 2);\n            var y1 = d3.round(r * 0.8, 2);\n            return 'M-' + x + ',' + y1 + 'L0,0M' + x + ',' + y1 + 'L0,0M0,-' + y0 + 'L0,0';\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    'y-down': {\n        n: 38,\n        f: function(r) {\n            var x = d3.round(r * 1.2, 2);\n            var y0 = d3.round(r * 1.6, 2);\n            var y1 = d3.round(r * 0.8, 2);\n            return 'M-' + x + ',-' + y1 + 'L0,0M' + x + ',-' + y1 + 'L0,0M0,' + y0 + 'L0,0';\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    'y-left': {\n        n: 39,\n        f: function(r) {\n            var y = d3.round(r * 1.2, 2);\n            var x0 = d3.round(r * 1.6, 2);\n            var x1 = d3.round(r * 0.8, 2);\n            return 'M' + x1 + ',' + y + 'L0,0M' + x1 + ',-' + y + 'L0,0M-' + x0 + ',0L0,0';\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    'y-right': {\n        n: 40,\n        f: function(r) {\n            var y = d3.round(r * 1.2, 2);\n            var x0 = d3.round(r * 1.6, 2);\n            var x1 = d3.round(r * 0.8, 2);\n            return 'M-' + x1 + ',' + y + 'L0,0M-' + x1 + ',-' + y + 'L0,0M' + x0 + ',0L0,0';\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    'line-ew': {\n        n: 41,\n        f: function(r) {\n            var rc = d3.round(r * 1.4, 2);\n            return 'M' + rc + ',0H-' + rc;\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    'line-ns': {\n        n: 42,\n        f: function(r) {\n            var rc = d3.round(r * 1.4, 2);\n            return 'M0,' + rc + 'V-' + rc;\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    'line-ne': {\n        n: 43,\n        f: function(r) {\n            var rx = d3.round(r, 2);\n            return 'M' + rx + ',-' + rx + 'L-' + rx + ',' + rx;\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    },\n    'line-nw': {\n        n: 44,\n        f: function(r) {\n            var rx = d3.round(r, 2);\n            return 'M' + rx + ',' + rx + 'L-' + rx + ',-' + rx;\n        },\n        needLine: true,\n        noDot: true,\n        noFill: true\n    }\n};\n\n},{\"d3\":16}],76:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n    visible: {\n        valType: 'boolean',\n        \n        editType: 'calc',\n        \n    },\n    type: {\n        valType: 'enumerated',\n        values: ['percent', 'constant', 'sqrt', 'data'],\n        \n        editType: 'calc',\n        \n    },\n    symmetric: {\n        valType: 'boolean',\n        \n        editType: 'calc',\n        \n    },\n    array: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    arrayminus: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    value: {\n        valType: 'number',\n        min: 0,\n        dflt: 10,\n        \n        editType: 'calc',\n        \n    },\n    valueminus: {\n        valType: 'number',\n        min: 0,\n        dflt: 10,\n        \n        editType: 'calc',\n        \n    },\n    traceref: {\n        valType: 'integer',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'style'\n    },\n    tracerefminus: {\n        valType: 'integer',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'style'\n    },\n    copy_ystyle: {\n        valType: 'boolean',\n        \n        editType: 'plot'\n    },\n    copy_zstyle: {\n        valType: 'boolean',\n        \n        editType: 'style'\n    },\n    color: {\n        valType: 'color',\n        \n        editType: 'style',\n        \n    },\n    thickness: {\n        valType: 'number',\n        min: 0,\n        dflt: 2,\n        \n        editType: 'style',\n        \n    },\n    width: {\n        valType: 'number',\n        min: 0,\n        \n        editType: 'plot',\n        \n    },\n    editType: 'calc',\n\n    _deprecated: {\n        opacity: {\n            valType: 'number',\n            \n            editType: 'style',\n            \n        }\n    }\n};\n\n},{}],77:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\n\nvar makeComputeError = _dereq_('./compute_error');\n\nmodule.exports = function calc(gd) {\n    var calcdata = gd.calcdata;\n\n    for(var i = 0; i < calcdata.length; i++) {\n        var calcTrace = calcdata[i];\n        var trace = calcTrace[0].trace;\n\n        if(trace.visible === true && Registry.traceIs(trace, 'errorBarsOK')) {\n            var xa = Axes.getFromId(gd, trace.xaxis);\n            var ya = Axes.getFromId(gd, trace.yaxis);\n            calcOneAxis(calcTrace, trace, xa, 'x');\n            calcOneAxis(calcTrace, trace, ya, 'y');\n        }\n    }\n};\n\nfunction calcOneAxis(calcTrace, trace, axis, coord) {\n    var opts = trace['error_' + coord] || {};\n    var isVisible = (opts.visible && ['linear', 'log'].indexOf(axis.type) !== -1);\n    var vals = [];\n\n    if(!isVisible) return;\n\n    var computeError = makeComputeError(opts);\n\n    for(var i = 0; i < calcTrace.length; i++) {\n        var calcPt = calcTrace[i];\n\n        var iIn = calcPt.i;\n\n        // for types that don't include `i` in each calcdata point\n        if(iIn === undefined) iIn = i;\n\n        // for stacked area inserted points\n        // TODO: errorbars have been tested cursorily with stacked area,\n        // but not thoroughly. It's not even really clear what you want to do:\n        // Should it just be calculated based on that trace's size data?\n        // Should you add errors from below in quadrature?\n        // And what about normalization, where in principle the errors shrink\n        // again when you get up to the top end?\n        // One option would be to forbid errorbars with stacking until we\n        // decide how to handle these questions.\n        else if(iIn === null) continue;\n\n        var calcCoord = calcPt[coord];\n\n        if(!isNumeric(axis.c2l(calcCoord))) continue;\n\n        var errors = computeError(calcCoord, iIn);\n        if(isNumeric(errors[0]) && isNumeric(errors[1])) {\n            var shoe = calcPt[coord + 's'] = calcCoord - errors[0];\n            var hat = calcPt[coord + 'h'] = calcCoord + errors[1];\n            vals.push(shoe, hat);\n        }\n    }\n\n    var axId = axis._id;\n    var baseExtremes = trace._extremes[axId];\n    var extremes = Axes.findExtremes(\n        axis,\n        vals,\n        Lib.extendFlat({tozero: baseExtremes.opts.tozero}, {padded: true})\n    );\n    baseExtremes.min = baseExtremes.min.concat(extremes.min);\n    baseExtremes.max = baseExtremes.max.concat(extremes.max);\n}\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../../registry\":269,\"./compute_error\":78,\"fast-isnumeric\":18}],78:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n/**\n * Error bar computing function generator\n *\n * N.B. The generated function does not clean the dataPt entries. Non-numeric\n * entries result in undefined error magnitudes.\n *\n * @param {object} opts error bar attributes\n *\n * @return {function} :\n *      @param {numeric} dataPt data point from where to compute the error magnitude\n *      @param {number} index index of dataPt in its corresponding data array\n *      @return {array}\n *        - error[0] : error magnitude in the negative direction\n *        - error[1] : \" \" \" \" positive \"\n */\nmodule.exports = function makeComputeError(opts) {\n    var type = opts.type;\n    var symmetric = opts.symmetric;\n\n    if(type === 'data') {\n        var array = opts.array || [];\n\n        if(symmetric) {\n            return function computeError(dataPt, index) {\n                var val = +(array[index]);\n                return [val, val];\n            };\n        } else {\n            var arrayminus = opts.arrayminus || [];\n            return function computeError(dataPt, index) {\n                var val = +array[index];\n                var valMinus = +arrayminus[index];\n                // in case one is present and the other is missing, fill in 0\n                // so we still see the present one. Mostly useful during manual\n                // data entry.\n                if(!isNaN(val) || !isNaN(valMinus)) {\n                    return [valMinus || 0, val || 0];\n                }\n                return [NaN, NaN];\n            };\n        }\n    } else {\n        var computeErrorValue = makeComputeErrorValue(type, opts.value);\n        var computeErrorValueMinus = makeComputeErrorValue(type, opts.valueminus);\n\n        if(symmetric || opts.valueminus === undefined) {\n            return function computeError(dataPt) {\n                var val = computeErrorValue(dataPt);\n                return [val, val];\n            };\n        } else {\n            return function computeError(dataPt) {\n                return [\n                    computeErrorValueMinus(dataPt),\n                    computeErrorValue(dataPt)\n                ];\n            };\n        }\n    }\n};\n\n/**\n * Compute error bar magnitude (for all types except data)\n *\n * @param {string} type error bar type\n * @param {numeric} value error bar value\n *\n * @return {function} :\n *      @param {numeric} dataPt\n */\nfunction makeComputeErrorValue(type, value) {\n    if(type === 'percent') {\n        return function(dataPt) {\n            return Math.abs(dataPt * value / 100);\n        };\n    }\n    if(type === 'constant') {\n        return function() {\n            return Math.abs(value);\n        };\n    }\n    if(type === 'sqrt') {\n        return function(dataPt) {\n            return Math.sqrt(Math.abs(dataPt));\n        };\n    }\n}\n\n},{}],79:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Template = _dereq_('../../plot_api/plot_template');\n\nvar attributes = _dereq_('./attributes');\n\n\nmodule.exports = function(traceIn, traceOut, defaultColor, opts) {\n    var objName = 'error_' + opts.axis;\n    var containerOut = Template.newContainer(traceOut, objName);\n    var containerIn = traceIn[objName] || {};\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);\n    }\n\n    var hasErrorBars = (\n        containerIn.array !== undefined ||\n        containerIn.value !== undefined ||\n        containerIn.type === 'sqrt'\n    );\n\n    var visible = coerce('visible', hasErrorBars);\n\n    if(visible === false) return;\n\n    var type = coerce('type', 'array' in containerIn ? 'data' : 'percent');\n    var symmetric = true;\n\n    if(type !== 'sqrt') {\n        symmetric = coerce('symmetric',\n            !((type === 'data' ? 'arrayminus' : 'valueminus') in containerIn));\n    }\n\n    if(type === 'data') {\n        coerce('array');\n        coerce('traceref');\n        if(!symmetric) {\n            coerce('arrayminus');\n            coerce('tracerefminus');\n        }\n    } else if(type === 'percent' || type === 'constant') {\n        coerce('value');\n        if(!symmetric) coerce('valueminus');\n    }\n\n    var copyAttr = 'copy_' + opts.inherit + 'style';\n    if(opts.inherit) {\n        var inheritObj = traceOut['error_' + opts.inherit];\n        if((inheritObj || {}).visible) {\n            coerce(copyAttr, !(containerIn.color ||\n                               isNumeric(containerIn.thickness) ||\n                               isNumeric(containerIn.width)));\n        }\n    }\n    if(!opts.inherit || !containerOut[copyAttr]) {\n        coerce('color', defaultColor);\n        coerce('thickness');\n        coerce('width', Registry.traceIs(traceOut, 'gl3d') ? 0 : 4);\n    }\n};\n\n},{\"../../lib\":178,\"../../plot_api/plot_template\":212,\"../../registry\":269,\"./attributes\":76,\"fast-isnumeric\":18}],80:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar attributes = _dereq_('./attributes');\n\nvar xyAttrs = {\n    error_x: Lib.extendFlat({}, attributes),\n    error_y: Lib.extendFlat({}, attributes)\n};\ndelete xyAttrs.error_x.copy_zstyle;\ndelete xyAttrs.error_y.copy_zstyle;\ndelete xyAttrs.error_y.copy_ystyle;\n\nvar xyzAttrs = {\n    error_x: Lib.extendFlat({}, attributes),\n    error_y: Lib.extendFlat({}, attributes),\n    error_z: Lib.extendFlat({}, attributes)\n};\ndelete xyzAttrs.error_x.copy_ystyle;\ndelete xyzAttrs.error_y.copy_ystyle;\ndelete xyzAttrs.error_z.copy_ystyle;\ndelete xyzAttrs.error_z.copy_zstyle;\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'errorbars',\n\n    schema: {\n        traces: {\n            scatter: xyAttrs,\n            bar: xyAttrs,\n            histogram: xyAttrs,\n            scatter3d: overrideAll(xyzAttrs, 'calc', 'nested'),\n            scattergl: overrideAll(xyAttrs, 'calc', 'nested')\n        }\n    },\n\n    supplyDefaults: _dereq_('./defaults'),\n\n    calc: _dereq_('./calc'),\n    makeComputeError: _dereq_('./compute_error'),\n\n    plot: _dereq_('./plot'),\n    style: _dereq_('./style'),\n    hoverInfo: hoverInfo\n};\n\nfunction hoverInfo(calcPoint, trace, hoverPoint) {\n    if((trace.error_y || {}).visible) {\n        hoverPoint.yerr = calcPoint.yh - calcPoint.y;\n        if(!trace.error_y.symmetric) hoverPoint.yerrneg = calcPoint.y - calcPoint.ys;\n    }\n    if((trace.error_x || {}).visible) {\n        hoverPoint.xerr = calcPoint.xh - calcPoint.x;\n        if(!trace.error_x.symmetric) hoverPoint.xerrneg = calcPoint.x - calcPoint.xs;\n    }\n}\n\n},{\"../../lib\":178,\"../../plot_api/edit_types\":205,\"./attributes\":76,\"./calc\":77,\"./compute_error\":78,\"./defaults\":79,\"./plot\":81,\"./style\":82}],81:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Drawing = _dereq_('../drawing');\nvar subTypes = _dereq_('../../traces/scatter/subtypes');\n\nmodule.exports = function plot(gd, traces, plotinfo, transitionOpts) {\n    var isNew;\n\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    var hasAnimation = transitionOpts && transitionOpts.duration > 0;\n\n    traces.each(function(d) {\n        var trace = d[0].trace;\n        // || {} is in case the trace (specifically scatterternary)\n        // doesn't support error bars at all, but does go through\n        // the scatter.plot mechanics, which calls ErrorBars.plot\n        // internally\n        var xObj = trace.error_x || {};\n        var yObj = trace.error_y || {};\n\n        var keyFunc;\n\n        if(trace.ids) {\n            keyFunc = function(d) {return d.id;};\n        }\n\n        var sparse = (\n            subTypes.hasMarkers(trace) &&\n            trace.marker.maxdisplayed > 0\n        );\n\n        if(!yObj.visible && !xObj.visible) d = [];\n\n        var errorbars = d3.select(this).selectAll('g.errorbar')\n            .data(d, keyFunc);\n\n        errorbars.exit().remove();\n\n        if(!d.length) return;\n\n        if(!xObj.visible) errorbars.selectAll('path.xerror').remove();\n        if(!yObj.visible) errorbars.selectAll('path.yerror').remove();\n\n        errorbars.style('opacity', 1);\n\n        var enter = errorbars.enter().append('g')\n            .classed('errorbar', true);\n\n        if(hasAnimation) {\n            enter.style('opacity', 0).transition()\n                .duration(transitionOpts.duration)\n                .style('opacity', 1);\n        }\n\n        Drawing.setClipUrl(errorbars, plotinfo.layerClipId, gd);\n\n        errorbars.each(function(d) {\n            var errorbar = d3.select(this);\n            var coords = errorCoords(d, xa, ya);\n\n            if(sparse && !d.vis) return;\n\n            var path;\n\n            var yerror = errorbar.select('path.yerror');\n            if(yObj.visible && isNumeric(coords.x) &&\n                    isNumeric(coords.yh) &&\n                    isNumeric(coords.ys)) {\n                var yw = yObj.width;\n\n                path = 'M' + (coords.x - yw) + ',' +\n                    coords.yh + 'h' + (2 * yw) + // hat\n                    'm-' + yw + ',0V' + coords.ys; // bar\n\n\n                if(!coords.noYS) path += 'm-' + yw + ',0h' + (2 * yw); // shoe\n\n                isNew = !yerror.size();\n\n                if(isNew) {\n                    yerror = errorbar.append('path')\n                        .style('vector-effect', 'non-scaling-stroke')\n                        .classed('yerror', true);\n                } else if(hasAnimation) {\n                    yerror = yerror\n                        .transition()\n                            .duration(transitionOpts.duration)\n                            .ease(transitionOpts.easing);\n                }\n\n                yerror.attr('d', path);\n            } else yerror.remove();\n\n            var xerror = errorbar.select('path.xerror');\n            if(xObj.visible && isNumeric(coords.y) &&\n                    isNumeric(coords.xh) &&\n                    isNumeric(coords.xs)) {\n                var xw = (xObj.copy_ystyle ? yObj : xObj).width;\n\n                path = 'M' + coords.xh + ',' +\n                    (coords.y - xw) + 'v' + (2 * xw) + // hat\n                    'm0,-' + xw + 'H' + coords.xs; // bar\n\n                if(!coords.noXS) path += 'm0,-' + xw + 'v' + (2 * xw); // shoe\n\n                isNew = !xerror.size();\n\n                if(isNew) {\n                    xerror = errorbar.append('path')\n                        .style('vector-effect', 'non-scaling-stroke')\n                        .classed('xerror', true);\n                } else if(hasAnimation) {\n                    xerror = xerror\n                        .transition()\n                            .duration(transitionOpts.duration)\n                            .ease(transitionOpts.easing);\n                }\n\n                xerror.attr('d', path);\n            } else xerror.remove();\n        });\n    });\n};\n\n// compute the coordinates of the error-bar objects\nfunction errorCoords(d, xa, ya) {\n    var out = {\n        x: xa.c2p(d.x),\n        y: ya.c2p(d.y)\n    };\n\n    // calculate the error bar size and hat and shoe locations\n    if(d.yh !== undefined) {\n        out.yh = ya.c2p(d.yh);\n        out.ys = ya.c2p(d.ys);\n\n        // if the shoes go off-scale (ie log scale, error bars past zero)\n        // clip the bar and hide the shoes\n        if(!isNumeric(out.ys)) {\n            out.noYS = true;\n            out.ys = ya.c2p(d.ys, true);\n        }\n    }\n\n    if(d.xh !== undefined) {\n        out.xh = xa.c2p(d.xh);\n        out.xs = xa.c2p(d.xs);\n\n        if(!isNumeric(out.xs)) {\n            out.noXS = true;\n            out.xs = xa.c2p(d.xs, true);\n        }\n    }\n\n    return out;\n}\n\n},{\"../../traces/scatter/subtypes\":413,\"../drawing\":74,\"d3\":16,\"fast-isnumeric\":18}],82:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Color = _dereq_('../color');\n\n\nmodule.exports = function style(traces) {\n    traces.each(function(d) {\n        var trace = d[0].trace;\n        var yObj = trace.error_y || {};\n        var xObj = trace.error_x || {};\n\n        var s = d3.select(this);\n\n        s.selectAll('path.yerror')\n            .style('stroke-width', yObj.thickness + 'px')\n            .call(Color.stroke, yObj.color);\n\n        if(xObj.copy_ystyle) xObj = yObj;\n\n        s.selectAll('path.xerror')\n            .style('stroke-width', xObj.thickness + 'px')\n            .call(Color.stroke, xObj.color);\n    });\n};\n\n},{\"../color\":52,\"d3\":16}],83:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar hoverLabelAttrs = _dereq_('./layout_attributes').hoverlabel;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n    hoverlabel: {\n        bgcolor: extendFlat({}, hoverLabelAttrs.bgcolor, {\n            arrayOk: true,\n            \n        }),\n        bordercolor: extendFlat({}, hoverLabelAttrs.bordercolor, {\n            arrayOk: true,\n            \n        }),\n        font: fontAttrs({\n            arrayOk: true,\n            editType: 'none',\n            \n        }),\n        align: extendFlat({}, hoverLabelAttrs.align, {arrayOk: true}),\n        namelength: extendFlat({}, hoverLabelAttrs.namelength, {arrayOk: true}),\n        editType: 'none'\n    }\n};\n\n},{\"../../lib/extend\":173,\"../../plots/font_attributes\":250,\"./layout_attributes\":93}],84:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nmodule.exports = function calc(gd) {\n    var calcdata = gd.calcdata;\n    var fullLayout = gd._fullLayout;\n\n    function makeCoerceHoverInfo(trace) {\n        return function(val) {\n            return Lib.coerceHoverinfo({hoverinfo: val}, {_module: trace._module}, fullLayout);\n        };\n    }\n\n    for(var i = 0; i < calcdata.length; i++) {\n        var cd = calcdata[i];\n        var trace = cd[0].trace;\n\n        // don't include hover calc fields for pie traces\n        // as calcdata items might be sorted by value and\n        // won't match the data array order.\n        if(Registry.traceIs(trace, 'pie-like')) continue;\n\n        var fillFn = Registry.traceIs(trace, '2dMap') ? paste : Lib.fillArray;\n\n        fillFn(trace.hoverinfo, cd, 'hi', makeCoerceHoverInfo(trace));\n\n        if(trace.hovertemplate) fillFn(trace.hovertemplate, cd, 'ht');\n\n        if(!trace.hoverlabel) continue;\n\n        fillFn(trace.hoverlabel.bgcolor, cd, 'hbg');\n        fillFn(trace.hoverlabel.bordercolor, cd, 'hbc');\n        fillFn(trace.hoverlabel.font.size, cd, 'hts');\n        fillFn(trace.hoverlabel.font.color, cd, 'htc');\n        fillFn(trace.hoverlabel.font.family, cd, 'htf');\n        fillFn(trace.hoverlabel.namelength, cd, 'hnl');\n        fillFn(trace.hoverlabel.align, cd, 'hta');\n    }\n};\n\nfunction paste(traceAttr, cd, cdAttr, fn) {\n    fn = fn || Lib.identity;\n\n    if(Array.isArray(traceAttr)) {\n        cd[0][cdAttr] = fn(traceAttr);\n    }\n}\n\n},{\"../../lib\":178,\"../../registry\":269}],85:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar hover = _dereq_('./hover').hover;\n\nmodule.exports = function click(gd, evt, subplot) {\n    var annotationsDone = Registry.getComponentMethod('annotations', 'onClick')(gd, gd._hoverdata);\n\n    // fallback to fail-safe in case the plot type's hover method doesn't pass the subplot.\n    // Ternary, for example, didn't, but it was caught because tested.\n    if(subplot !== undefined) {\n        // The true flag at the end causes it to re-run the hover computation to figure out *which*\n        // point is being clicked. Without this, clicking is somewhat unreliable.\n        hover(gd, evt, subplot, true);\n    }\n\n    function emitClick() { gd.emit('plotly_click', {points: gd._hoverdata, event: evt}); }\n\n    if(gd._hoverdata && evt && evt.target) {\n        if(annotationsDone && annotationsDone.then) {\n            annotationsDone.then(emitClick);\n        } else emitClick();\n\n        // why do we get a double event without this???\n        if(evt.stopImmediatePropagation) evt.stopImmediatePropagation();\n    }\n};\n\n},{\"../../registry\":269,\"./hover\":89}],86:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    // hover labels for multiple horizontal bars get tilted by this angle\n    YANGLE: 60,\n\n    // size and display constants for hover text\n\n    // pixel size of hover arrows\n    HOVERARROWSIZE: 6,\n    // pixels padding around text\n    HOVERTEXTPAD: 3,\n    // hover font\n    HOVERFONTSIZE: 13,\n    HOVERFONT: 'Arial, sans-serif',\n\n    // minimum time (msec) between hover calls\n    HOVERMINTIME: 50,\n\n    // ID suffix (with fullLayout._uid) for hover events in the throttle cache\n    HOVERID: '-hover'\n};\n\n},{}],87:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar handleHoverLabelDefaults = _dereq_('./hoverlabel_defaults');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    var opts = Lib.extendFlat({}, layout.hoverlabel);\n    if(traceOut.hovertemplate) opts.namelength = -1;\n\n    handleHoverLabelDefaults(traceIn, traceOut, coerce, opts);\n};\n\n},{\"../../lib\":178,\"./attributes\":83,\"./hoverlabel_defaults\":90}],88:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// look for either subplot or xaxis and yaxis attributes\n// does not handle splom case\nexports.getSubplot = function(trace) {\n    return trace.subplot || (trace.xaxis + trace.yaxis) || trace.geo;\n};\n\n// is trace in given list of subplots?\n// does handle splom case\nexports.isTraceInSubplots = function(trace, subplots) {\n    if(trace.type === 'splom') {\n        var xaxes = trace.xaxes || [];\n        var yaxes = trace.yaxes || [];\n        for(var i = 0; i < xaxes.length; i++) {\n            for(var j = 0; j < yaxes.length; j++) {\n                if(subplots.indexOf(xaxes[i] + yaxes[j]) !== -1) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n\n    return subplots.indexOf(exports.getSubplot(trace)) !== -1;\n};\n\n// convenience functions for mapping all relevant axes\nexports.flat = function(subplots, v) {\n    var out = new Array(subplots.length);\n    for(var i = 0; i < subplots.length; i++) {\n        out[i] = v;\n    }\n    return out;\n};\n\nexports.p2c = function(axArray, v) {\n    var out = new Array(axArray.length);\n    for(var i = 0; i < axArray.length; i++) {\n        out[i] = axArray[i].p2c(v);\n    }\n    return out;\n};\n\nexports.getDistanceFunction = function(mode, dx, dy, dxy) {\n    if(mode === 'closest') return dxy || exports.quadrature(dx, dy);\n    return mode.charAt(0) === 'x' ? dx : dy;\n};\n\nexports.getClosest = function(cd, distfn, pointData) {\n    // do we already have a point number? (array mode only)\n    if(pointData.index !== false) {\n        if(pointData.index >= 0 && pointData.index < cd.length) {\n            pointData.distance = 0;\n        } else pointData.index = false;\n    } else {\n        // apply the distance function to each data point\n        // this is the longest loop... if this bogs down, we may need\n        // to create pre-sorted data (by x or y), not sure how to\n        // do this for 'closest'\n        for(var i = 0; i < cd.length; i++) {\n            var newDistance = distfn(cd[i]);\n            if(newDistance <= pointData.distance) {\n                pointData.index = i;\n                pointData.distance = newDistance;\n            }\n        }\n    }\n    return pointData;\n};\n\n/*\n * pseudo-distance function for hover effects on areas: inside the region\n * distance is finite (`passVal`), outside it's Infinity.\n *\n * @param {number} v0: signed difference between the current position and the left edge\n * @param {number} v1: signed difference between the current position and the right edge\n * @param {number} passVal: the value to return on success\n */\nexports.inbox = function(v0, v1, passVal) {\n    return (v0 * v1 < 0 || v0 === 0) ? passVal : Infinity;\n};\n\nexports.quadrature = function(dx, dy) {\n    return function(di) {\n        var x = dx(di);\n        var y = dy(di);\n        return Math.sqrt(x * x + y * y);\n    };\n};\n\n/** Fill event data point object for hover and selection.\n *  Invokes _module.eventData if present.\n *\n * N.B. note that point 'index' corresponds to input data array index\n *  whereas 'number' is its post-transform version.\n *\n * If the hovered/selected pt corresponds to an multiple input points\n * (e.g. for histogram and transformed traces), 'pointNumbers` and 'pointIndices'\n * are include in the event data.\n *\n * @param {object} pt\n * @param {object} trace\n * @param {object} cd\n * @return {object}\n */\nexports.makeEventData = function(pt, trace, cd) {\n    // hover uses 'index', select uses 'pointNumber'\n    var pointNumber = 'index' in pt ? pt.index : pt.pointNumber;\n\n    var out = {\n        data: trace._input,\n        fullData: trace,\n        curveNumber: trace.index,\n        pointNumber: pointNumber\n    };\n\n    if(trace._indexToPoints) {\n        var pointIndices = trace._indexToPoints[pointNumber];\n\n        if(pointIndices.length === 1) {\n            out.pointIndex = pointIndices[0];\n        } else {\n            out.pointIndices = pointIndices;\n        }\n    } else {\n        out.pointIndex = pointNumber;\n    }\n\n    if(trace._module.eventData) {\n        out = trace._module.eventData(out, pt, trace, cd, pointNumber);\n    } else {\n        if('xVal' in pt) out.x = pt.xVal;\n        else if('x' in pt) out.x = pt.x;\n\n        if('yVal' in pt) out.y = pt.yVal;\n        else if('y' in pt) out.y = pt.y;\n\n        if(pt.xa) out.xaxis = pt.xa;\n        if(pt.ya) out.yaxis = pt.ya;\n        if(pt.zLabelVal !== undefined) out.z = pt.zLabelVal;\n    }\n\n    exports.appendArrayPointValue(out, trace, pointNumber);\n\n    return out;\n};\n\n/** Appends values inside array attributes corresponding to given point number\n *\n * @param {object} pointData : point data object (gets mutated here)\n * @param {object} trace : full trace object\n * @param {number|Array(number)} pointNumber : point number. May be a length-2 array\n *     [row, col] to dig into 2D arrays\n */\nexports.appendArrayPointValue = function(pointData, trace, pointNumber) {\n    var arrayAttrs = trace._arrayAttrs;\n\n    if(!arrayAttrs) {\n        return;\n    }\n\n    for(var i = 0; i < arrayAttrs.length; i++) {\n        var astr = arrayAttrs[i];\n        var key = getPointKey(astr);\n\n        if(pointData[key] === undefined) {\n            var val = Lib.nestedProperty(trace, astr).get();\n            var pointVal = getPointData(val, pointNumber);\n\n            if(pointVal !== undefined) pointData[key] = pointVal;\n        }\n    }\n};\n\n/**\n * Appends values inside array attributes corresponding to given point number array\n * For use when pointData references a plot entity that arose (or potentially arose)\n * from multiple points in the input data\n *\n * @param {object} pointData : point data object (gets mutated here)\n * @param {object} trace : full trace object\n * @param {Array(number)|Array(Array(number))} pointNumbers : Array of point numbers.\n *     Each entry in the array may itself be a length-2 array [row, col] to dig into 2D arrays\n */\nexports.appendArrayMultiPointValues = function(pointData, trace, pointNumbers) {\n    var arrayAttrs = trace._arrayAttrs;\n\n    if(!arrayAttrs) {\n        return;\n    }\n\n    for(var i = 0; i < arrayAttrs.length; i++) {\n        var astr = arrayAttrs[i];\n        var key = getPointKey(astr);\n\n        if(pointData[key] === undefined) {\n            var val = Lib.nestedProperty(trace, astr).get();\n            var keyVal = new Array(pointNumbers.length);\n\n            for(var j = 0; j < pointNumbers.length; j++) {\n                keyVal[j] = getPointData(val, pointNumbers[j]);\n            }\n            pointData[key] = keyVal;\n        }\n    }\n};\n\nvar pointKeyMap = {\n    ids: 'id',\n    locations: 'location',\n    labels: 'label',\n    values: 'value',\n    'marker.colors': 'color',\n    parents: 'parent'\n};\n\nfunction getPointKey(astr) {\n    return pointKeyMap[astr] || astr;\n}\n\nfunction getPointData(val, pointNumber) {\n    if(Array.isArray(pointNumber)) {\n        if(Array.isArray(val) && Array.isArray(val[pointNumber[0]])) {\n            return val[pointNumber[0]][pointNumber[1]];\n        }\n    } else {\n        return val[pointNumber];\n    }\n}\n\nvar xyHoverMode = {\n    x: true,\n    y: true\n};\n\nvar unifiedHoverMode = {\n    'x unified': true,\n    'y unified': true\n};\n\nexports.isUnifiedHover = function(hovermode) {\n    if(typeof hovermode !== 'string') return false;\n    return !!unifiedHoverMode[hovermode];\n};\n\nexports.isXYhover = function(hovermode) {\n    if(typeof hovermode !== 'string') return false;\n    return !!xyHoverMode[hovermode];\n};\n\n},{\"../../lib\":178}],89:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Lib = _dereq_('../../lib');\nvar Events = _dereq_('../../lib/events');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar overrideCursor = _dereq_('../../lib/override_cursor');\nvar Drawing = _dereq_('../drawing');\nvar Color = _dereq_('../color');\nvar dragElement = _dereq_('../dragelement');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Registry = _dereq_('../../registry');\n\nvar helpers = _dereq_('./helpers');\nvar constants = _dereq_('./constants');\n\nvar legendSupplyDefaults = _dereq_('../legend/defaults');\nvar legendDraw = _dereq_('../legend/draw');\n\n// hover labels for multiple horizontal bars get tilted by some angle,\n// then need to be offset differently if they overlap\nvar YANGLE = constants.YANGLE;\nvar YA_RADIANS = Math.PI * YANGLE / 180;\n\n// expansion of projected height\nvar YFACTOR = 1 / Math.sin(YA_RADIANS);\n\n// to make the appropriate post-rotation x offset,\n// you need both x and y offsets\nvar YSHIFTX = Math.cos(YA_RADIANS);\nvar YSHIFTY = Math.sin(YA_RADIANS);\n\n// size and display constants for hover text\nvar HOVERARROWSIZE = constants.HOVERARROWSIZE;\nvar HOVERTEXTPAD = constants.HOVERTEXTPAD;\n\n// fx.hover: highlight data on hover\n// evt can be a mousemove event, or an object with data about what points\n//   to hover on\n//      {xpx,ypx[,hovermode]} - pixel locations from top left\n//          (with optional overriding hovermode)\n//      {xval,yval[,hovermode]} - data values\n//      [{curveNumber,(pointNumber|xval and/or yval)}] -\n//              array of specific points to highlight\n//          pointNumber is a single integer if gd.data[curveNumber] is 1D,\n//              or a two-element array if it's 2D\n//          xval and yval are data values,\n//              1D data may specify either or both,\n//              2D data must specify both\n// subplot is an id string (default \"xy\")\n// makes use of gl.hovermode, which can be:\n//      x (find the points with the closest x values, ie a column),\n//      closest (find the single closest point)\n//    internally there are two more that occasionally get used:\n//      y (pick out a row - only used for multiple horizontal bar charts)\n//      array (used when the user specifies an explicit\n//          array of points to hover on)\n//\n// We wrap the hovers in a timer, to limit their frequency.\n// The actual rendering is done by private function _hover.\nexports.hover = function hover(gd, evt, subplot, noHoverEvent) {\n    gd = Lib.getGraphDiv(gd);\n\n    Lib.throttle(\n        gd._fullLayout._uid + constants.HOVERID,\n        constants.HOVERMINTIME,\n        function() { _hover(gd, evt, subplot, noHoverEvent); }\n    );\n};\n\n/*\n * Draw a single hover item or an array of hover item in a pre-existing svg container somewhere\n * hoverItem should have keys:\n *    - x and y (or x0, x1, y0, and y1):\n *      the pixel position to mark, relative to opts.container\n *    - xLabel, yLabel, zLabel, text, and name:\n *      info to go in the label\n *    - color:\n *      the background color for the label.\n *    - idealAlign (optional):\n *      'left' or 'right' for which side of the x/y box to try to put this on first\n *    - borderColor (optional):\n *      color for the border, defaults to strongest contrast with color\n *    - fontFamily (optional):\n *      string, the font for this label, defaults to constants.HOVERFONT\n *    - fontSize (optional):\n *      the label font size, defaults to constants.HOVERFONTSIZE\n *    - fontColor (optional):\n *      defaults to borderColor\n * opts should have keys:\n *    - bgColor:\n *      the background color this is against, used if the trace is\n *      non-opaque, and for the name, which goes outside the box\n *    - container:\n *      a <svg> or <g> element to add the hover label to\n *    - outerContainer:\n *      normally a parent of `container`, sets the bounding box to use to\n *      constrain the hover label and determine whether to show it on the left or right\n * opts can have optional keys:\n *    - anchorIndex:\n        the index of the hover item used as an anchor for positioning.\n        The other hover items will be pushed up or down to prevent overlap.\n */\nexports.loneHover = function loneHover(hoverItems, opts) {\n    var multiHover = true;\n    if(!Array.isArray(hoverItems)) {\n        multiHover = false;\n        hoverItems = [hoverItems];\n    }\n\n    var pointsData = hoverItems.map(function(hoverItem) {\n        return {\n            color: hoverItem.color || Color.defaultLine,\n            x0: hoverItem.x0 || hoverItem.x || 0,\n            x1: hoverItem.x1 || hoverItem.x || 0,\n            y0: hoverItem.y0 || hoverItem.y || 0,\n            y1: hoverItem.y1 || hoverItem.y || 0,\n            xLabel: hoverItem.xLabel,\n            yLabel: hoverItem.yLabel,\n            zLabel: hoverItem.zLabel,\n            text: hoverItem.text,\n            name: hoverItem.name,\n            idealAlign: hoverItem.idealAlign,\n\n            // optional extra bits of styling\n            borderColor: hoverItem.borderColor,\n            fontFamily: hoverItem.fontFamily,\n            fontSize: hoverItem.fontSize,\n            fontColor: hoverItem.fontColor,\n            nameLength: hoverItem.nameLength,\n            textAlign: hoverItem.textAlign,\n\n            // filler to make createHoverText happy\n            trace: hoverItem.trace || {\n                index: 0,\n                hoverinfo: ''\n            },\n            xa: {_offset: 0},\n            ya: {_offset: 0},\n            index: 0,\n\n            hovertemplate: hoverItem.hovertemplate || false,\n            eventData: hoverItem.eventData || false,\n            hovertemplateLabels: hoverItem.hovertemplateLabels || false,\n        };\n    });\n\n    var container3 = d3.select(opts.container);\n    var outerContainer3 = opts.outerContainer ? d3.select(opts.outerContainer) : container3;\n\n    var fullOpts = {\n        hovermode: 'closest',\n        rotateLabels: false,\n        bgColor: opts.bgColor || Color.background,\n        container: container3,\n        outerContainer: outerContainer3\n    };\n\n    var hoverLabel = createHoverText(pointsData, fullOpts, opts.gd);\n\n    // Fix vertical overlap\n    var tooltipSpacing = 5;\n    var lastBottomY = 0;\n    var anchor = 0;\n    hoverLabel\n        .sort(function(a, b) {return a.y0 - b.y0;})\n        .each(function(d, i) {\n            var topY = d.y0 - d.by / 2;\n\n            if((topY - tooltipSpacing) < lastBottomY) {\n                d.offset = (lastBottomY - topY) + tooltipSpacing;\n            } else {\n                d.offset = 0;\n            }\n\n            lastBottomY = topY + d.by + d.offset;\n\n            if(i === opts.anchorIndex || 0) anchor = d.offset;\n        })\n        .each(function(d) {\n            d.offset -= anchor;\n        });\n\n    alignHoverText(hoverLabel, fullOpts.rotateLabels);\n\n    return multiHover ? hoverLabel : hoverLabel.node();\n};\n\n// The actual implementation is here:\nfunction _hover(gd, evt, subplot, noHoverEvent) {\n    if(!subplot) subplot = 'xy';\n\n    // if the user passed in an array of subplots,\n    // use those instead of finding overlayed plots\n    var subplots = Array.isArray(subplot) ? subplot : [subplot];\n\n    var fullLayout = gd._fullLayout;\n    var plots = fullLayout._plots || [];\n    var plotinfo = plots[subplot];\n    var hasCartesian = fullLayout._has('cartesian');\n\n    // list of all overlaid subplots to look at\n    if(plotinfo) {\n        var overlayedSubplots = plotinfo.overlays.map(function(pi) {\n            return pi.id;\n        });\n\n        subplots = subplots.concat(overlayedSubplots);\n    }\n\n    var len = subplots.length;\n    var xaArray = new Array(len);\n    var yaArray = new Array(len);\n    var supportsCompare = false;\n\n    for(var i = 0; i < len; i++) {\n        var spId = subplots[i];\n\n        if(plots[spId]) {\n            // 'cartesian' case\n            supportsCompare = true;\n            xaArray[i] = plots[spId].xaxis;\n            yaArray[i] = plots[spId].yaxis;\n        } else if(fullLayout[spId] && fullLayout[spId]._subplot) {\n            // other subplot types\n            var _subplot = fullLayout[spId]._subplot;\n            xaArray[i] = _subplot.xaxis;\n            yaArray[i] = _subplot.yaxis;\n        } else {\n            Lib.warn('Unrecognized subplot: ' + spId);\n            return;\n        }\n    }\n\n    var hovermode = evt.hovermode || fullLayout.hovermode;\n\n    if(hovermode && !supportsCompare) hovermode = 'closest';\n\n    if(['x', 'y', 'closest', 'x unified', 'y unified'].indexOf(hovermode) === -1 || !gd.calcdata ||\n            gd.querySelector('.zoombox') || gd._dragging) {\n        return dragElement.unhoverRaw(gd, evt);\n    }\n\n    var hoverdistance = fullLayout.hoverdistance === -1 ? Infinity : fullLayout.hoverdistance;\n    var spikedistance = fullLayout.spikedistance === -1 ? Infinity : fullLayout.spikedistance;\n\n    // hoverData: the set of candidate points we've found to highlight\n    var hoverData = [];\n\n    // searchData: the data to search in. Mostly this is just a copy of\n    // gd.calcdata, filtered to the subplot and overlays we're on\n    // but if a point array is supplied it will be a mapping\n    // of indicated curves\n    var searchData = [];\n\n    // [x|y]valArray: the axis values of the hover event\n    // mapped onto each of the currently selected overlaid subplots\n    var xvalArray, yvalArray;\n\n    var itemnum, curvenum, cd, trace, subplotId, subploti, mode,\n        xval, yval, pointData, closedataPreviousLength;\n\n    // spikePoints: the set of candidate points we've found to draw spikes to\n    var spikePoints = {\n        hLinePoint: null,\n        vLinePoint: null\n    };\n\n    // does subplot have one (or more) horizontal traces?\n    // This is used to determine whether we rotate the labels or not\n    var hasOneHorizontalTrace = false;\n\n    // Figure out what we're hovering on:\n    // mouse location or user-supplied data\n\n    if(Array.isArray(evt)) {\n        // user specified an array of points to highlight\n        hovermode = 'array';\n        for(itemnum = 0; itemnum < evt.length; itemnum++) {\n            cd = gd.calcdata[evt[itemnum].curveNumber || 0];\n            if(cd) {\n                trace = cd[0].trace;\n                if(cd[0].trace.hoverinfo !== 'skip') {\n                    searchData.push(cd);\n                    if(trace.orientation === 'h') {\n                        hasOneHorizontalTrace = true;\n                    }\n                }\n            }\n        }\n    } else {\n        for(curvenum = 0; curvenum < gd.calcdata.length; curvenum++) {\n            cd = gd.calcdata[curvenum];\n            trace = cd[0].trace;\n            if(trace.hoverinfo !== 'skip' && helpers.isTraceInSubplots(trace, subplots)) {\n                searchData.push(cd);\n                if(trace.orientation === 'h') {\n                    hasOneHorizontalTrace = true;\n                }\n            }\n        }\n\n        // [x|y]px: the pixels (from top left) of the mouse location\n        // on the currently selected plot area\n        // add pointerX|Y property for drawing the spikes in spikesnap 'cursor' situation\n        var hasUserCalledHover = !evt.target;\n        var xpx, ypx;\n\n        if(hasUserCalledHover) {\n            if('xpx' in evt) xpx = evt.xpx;\n            else xpx = xaArray[0]._length / 2;\n\n            if('ypx' in evt) ypx = evt.ypx;\n            else ypx = yaArray[0]._length / 2;\n        } else {\n            // fire the beforehover event and quit if it returns false\n            // note that we're only calling this on real mouse events, so\n            // manual calls to fx.hover will always run.\n            if(Events.triggerHandler(gd, 'plotly_beforehover', evt) === false) {\n                return;\n            }\n\n            var dbb = evt.target.getBoundingClientRect();\n\n            xpx = evt.clientX - dbb.left;\n            ypx = evt.clientY - dbb.top;\n\n            // in case hover was called from mouseout into hovertext,\n            // it's possible you're not actually over the plot anymore\n            if(xpx < 0 || xpx > xaArray[0]._length || ypx < 0 || ypx > yaArray[0]._length) {\n                return dragElement.unhoverRaw(gd, evt);\n            }\n        }\n\n        evt.pointerX = xpx + xaArray[0]._offset;\n        evt.pointerY = ypx + yaArray[0]._offset;\n\n        if('xval' in evt) xvalArray = helpers.flat(subplots, evt.xval);\n        else xvalArray = helpers.p2c(xaArray, xpx);\n\n        if('yval' in evt) yvalArray = helpers.flat(subplots, evt.yval);\n        else yvalArray = helpers.p2c(yaArray, ypx);\n\n        if(!isNumeric(xvalArray[0]) || !isNumeric(yvalArray[0])) {\n            Lib.warn('Fx.hover failed', evt, gd);\n            return dragElement.unhoverRaw(gd, evt);\n        }\n    }\n\n    // the pixel distance to beat as a matching point\n    // in 'x' or 'y' mode this resets for each trace\n    var distance = Infinity;\n\n    // find the closest point in each trace\n    // this is minimum dx and/or dy, depending on mode\n    // and the pixel position for the label (labelXpx, labelYpx)\n    function findHoverPoints(customXVal, customYVal) {\n        for(curvenum = 0; curvenum < searchData.length; curvenum++) {\n            cd = searchData[curvenum];\n\n            // filter out invisible or broken data\n            if(!cd || !cd[0] || !cd[0].trace) continue;\n\n            trace = cd[0].trace;\n\n            if(trace.visible !== true || trace._length === 0) continue;\n\n            // Explicitly bail out for these two. I don't know how to otherwise prevent\n            // the rest of this function from running and failing\n            if(['carpet', 'contourcarpet'].indexOf(trace._module.name) !== -1) continue;\n\n            if(trace.type === 'splom') {\n                // splom traces do not generate overlay subplots,\n                // it is safe to assume here splom traces correspond to the 0th subplot\n                subploti = 0;\n                subplotId = subplots[subploti];\n            } else {\n                subplotId = helpers.getSubplot(trace);\n                subploti = subplots.indexOf(subplotId);\n            }\n\n            // within one trace mode can sometimes be overridden\n            mode = hovermode;\n            if(helpers.isUnifiedHover(mode)) {\n                mode = mode.charAt(0);\n            }\n\n            // container for new point, also used to pass info into module.hoverPoints\n            pointData = {\n                // trace properties\n                cd: cd,\n                trace: trace,\n                xa: xaArray[subploti],\n                ya: yaArray[subploti],\n\n                // max distances for hover and spikes - for points that want to show but do not\n                // want to override other points, set distance/spikeDistance equal to max*Distance\n                // and it will not get filtered out but it will be guaranteed to have a greater\n                // distance than any point that calculated a real distance.\n                maxHoverDistance: hoverdistance,\n                maxSpikeDistance: spikedistance,\n\n                // point properties - override all of these\n                index: false, // point index in trace - only used by plotly.js hoverdata consumers\n                distance: Math.min(distance, hoverdistance), // pixel distance or pseudo-distance\n\n                // distance/pseudo-distance for spikes. This distance should always be calculated\n                // as if in \"closest\" mode, and should only be set if this point should\n                // generate a spike.\n                spikeDistance: Infinity,\n\n                // in some cases the spikes have different positioning from the hover label\n                // they don't need x0/x1, just one position\n                xSpike: undefined,\n                ySpike: undefined,\n\n                // where and how to display the hover label\n                color: Color.defaultLine, // trace color\n                name: trace.name,\n                x0: undefined,\n                x1: undefined,\n                y0: undefined,\n                y1: undefined,\n                xLabelVal: undefined,\n                yLabelVal: undefined,\n                zLabelVal: undefined,\n                text: undefined\n            };\n\n            // add ref to subplot object (non-cartesian case)\n            if(fullLayout[subplotId]) {\n                pointData.subplot = fullLayout[subplotId]._subplot;\n            }\n            // add ref to splom scene\n            if(fullLayout._splomScenes && fullLayout._splomScenes[trace.uid]) {\n                pointData.scene = fullLayout._splomScenes[trace.uid];\n            }\n\n            closedataPreviousLength = hoverData.length;\n\n            // for a highlighting array, figure out what\n            // we're searching for with this element\n            if(mode === 'array') {\n                var selection = evt[curvenum];\n                if('pointNumber' in selection) {\n                    pointData.index = selection.pointNumber;\n                    mode = 'closest';\n                } else {\n                    mode = '';\n                    if('xval' in selection) {\n                        xval = selection.xval;\n                        mode = 'x';\n                    }\n                    if('yval' in selection) {\n                        yval = selection.yval;\n                        mode = mode ? 'closest' : 'y';\n                    }\n                }\n            } else if(customXVal !== undefined && customYVal !== undefined) {\n                xval = customXVal;\n                yval = customYVal;\n            } else {\n                xval = xvalArray[subploti];\n                yval = yvalArray[subploti];\n            }\n\n            // Now if there is range to look in, find the points to hover.\n            if(hoverdistance !== 0) {\n                if(trace._module && trace._module.hoverPoints) {\n                    var newPoints = trace._module.hoverPoints(pointData, xval, yval, mode, fullLayout._hoverlayer);\n                    if(newPoints) {\n                        var newPoint;\n                        for(var newPointNum = 0; newPointNum < newPoints.length; newPointNum++) {\n                            newPoint = newPoints[newPointNum];\n                            if(isNumeric(newPoint.x0) && isNumeric(newPoint.y0)) {\n                                hoverData.push(cleanPoint(newPoint, hovermode));\n                            }\n                        }\n                    }\n                } else {\n                    Lib.log('Unrecognized trace type in hover:', trace);\n                }\n            }\n\n            // in closest mode, remove any existing (farther) points\n            // and don't look any farther than this latest point (or points, some\n            // traces like box & violin make multiple hover labels at once)\n            if(hovermode === 'closest' && hoverData.length > closedataPreviousLength) {\n                hoverData.splice(0, closedataPreviousLength);\n                distance = hoverData[0].distance;\n            }\n\n            // Now if there is range to look in, find the points to draw the spikelines\n            // Do it only if there is no hoverData\n            if(hasCartesian && (spikedistance !== 0)) {\n                if(hoverData.length === 0) {\n                    pointData.distance = spikedistance;\n                    pointData.index = false;\n                    var closestPoints = trace._module.hoverPoints(pointData, xval, yval, 'closest', fullLayout._hoverlayer);\n                    if(closestPoints) {\n                        closestPoints = closestPoints.filter(function(point) {\n                            // some hover points, like scatter fills, do not allow spikes,\n                            // so will generate a hover point but without a valid spikeDistance\n                            return point.spikeDistance <= spikedistance;\n                        });\n                    }\n                    if(closestPoints && closestPoints.length) {\n                        var tmpPoint;\n                        var closestVPoints = closestPoints.filter(function(point) {\n                            return point.xa.showspikes && point.xa.spikesnap !== 'hovered data';\n                        });\n                        if(closestVPoints.length) {\n                            var closestVPt = closestVPoints[0];\n                            if(isNumeric(closestVPt.x0) && isNumeric(closestVPt.y0)) {\n                                tmpPoint = fillSpikePoint(closestVPt);\n                                if(!spikePoints.vLinePoint || (spikePoints.vLinePoint.spikeDistance > tmpPoint.spikeDistance)) {\n                                    spikePoints.vLinePoint = tmpPoint;\n                                }\n                            }\n                        }\n\n                        var closestHPoints = closestPoints.filter(function(point) {\n                            return point.ya.showspikes && point.ya.spikesnap !== 'hovered data';\n                        });\n                        if(closestHPoints.length) {\n                            var closestHPt = closestHPoints[0];\n                            if(isNumeric(closestHPt.x0) && isNumeric(closestHPt.y0)) {\n                                tmpPoint = fillSpikePoint(closestHPt);\n                                if(!spikePoints.hLinePoint || (spikePoints.hLinePoint.spikeDistance > tmpPoint.spikeDistance)) {\n                                    spikePoints.hLinePoint = tmpPoint;\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    findHoverPoints();\n\n    function selectClosestPoint(pointsData, spikedistance) {\n        var resultPoint = null;\n        var minDistance = Infinity;\n        var thisSpikeDistance;\n        for(var i = 0; i < pointsData.length; i++) {\n            thisSpikeDistance = pointsData[i].spikeDistance;\n            if(thisSpikeDistance <= minDistance && thisSpikeDistance <= spikedistance) {\n                resultPoint = pointsData[i];\n                minDistance = thisSpikeDistance;\n            }\n        }\n        return resultPoint;\n    }\n\n    function fillSpikePoint(point) {\n        if(!point) return null;\n        return {\n            xa: point.xa,\n            ya: point.ya,\n            x: point.xSpike !== undefined ? point.xSpike : (point.x0 + point.x1) / 2,\n            y: point.ySpike !== undefined ? point.ySpike : (point.y0 + point.y1) / 2,\n            distance: point.distance,\n            spikeDistance: point.spikeDistance,\n            curveNumber: point.trace.index,\n            color: point.color,\n            pointNumber: point.index\n        };\n    }\n\n    var spikelineOpts = {\n        fullLayout: fullLayout,\n        container: fullLayout._hoverlayer,\n        outerContainer: fullLayout._paperdiv,\n        event: evt\n    };\n    var oldspikepoints = gd._spikepoints;\n    var newspikepoints = {\n        vLinePoint: spikePoints.vLinePoint,\n        hLinePoint: spikePoints.hLinePoint\n    };\n    gd._spikepoints = newspikepoints;\n\n    // Now if it is not restricted by spikedistance option, set the points to draw the spikelines\n    if(hasCartesian && (spikedistance !== 0)) {\n        if(hoverData.length !== 0) {\n            var tmpHPointData = hoverData.filter(function(point) {\n                return point.ya.showspikes;\n            });\n            var tmpHPoint = selectClosestPoint(tmpHPointData, spikedistance);\n            spikePoints.hLinePoint = fillSpikePoint(tmpHPoint);\n\n            var tmpVPointData = hoverData.filter(function(point) {\n                return point.xa.showspikes;\n            });\n            var tmpVPoint = selectClosestPoint(tmpVPointData, spikedistance);\n            spikePoints.vLinePoint = fillSpikePoint(tmpVPoint);\n        }\n    }\n\n    // if hoverData is empty check for the spikes to draw and quit if there are none\n    if(hoverData.length === 0) {\n        var result = dragElement.unhoverRaw(gd, evt);\n        if(hasCartesian && ((spikePoints.hLinePoint !== null) || (spikePoints.vLinePoint !== null))) {\n            if(spikesChanged(oldspikepoints)) {\n                createSpikelines(gd, spikePoints, spikelineOpts);\n            }\n        }\n        return result;\n    }\n\n    if(hasCartesian) {\n        if(spikesChanged(oldspikepoints)) {\n            createSpikelines(gd, spikePoints, spikelineOpts);\n        }\n    }\n\n    hoverData.sort(function(d1, d2) { return d1.distance - d2.distance; });\n\n    // If in compare mode, select every point at position\n    if(\n        helpers.isXYhover(mode) &&\n        hoverData[0].length !== 0 &&\n        hoverData[0].trace.type !== 'splom' // TODO: add support for splom\n    ) {\n        var hd = hoverData[0];\n        var cd0 = hd.cd[hd.index];\n        var isGrouped = (fullLayout.boxmode === 'group' || fullLayout.violinmode === 'group');\n\n        var xVal = hd.xVal;\n        var ax = hd.xa;\n        if(ax.type === 'category') xVal = ax._categoriesMap[xVal];\n        if(ax.type === 'date') xVal = ax.d2c(xVal);\n        if(cd0 && cd0.t && cd0.t.posLetter === ax._id && isGrouped) {\n            xVal += cd0.t.dPos;\n        }\n\n        var yVal = hd.yVal;\n        ax = hd.ya;\n        if(ax.type === 'category') yVal = ax._categoriesMap[yVal];\n        if(ax.type === 'date') yVal = ax.d2c(yVal);\n        if(cd0 && cd0.t && cd0.t.posLetter === ax._id && isGrouped) {\n            yVal += cd0.t.dPos;\n        }\n\n        findHoverPoints(xVal, yVal);\n\n        // Remove duplicated hoverData points\n        // note that d3 also filters identical points in the rendering steps\n        var repeated = {};\n        hoverData = hoverData.filter(function(hd) {\n            var key = hoverDataKey(hd);\n            if(!repeated[key]) {\n                repeated[key] = true;\n                return repeated[key];\n            }\n        });\n    }\n\n    // lastly, emit custom hover/unhover events\n    var oldhoverdata = gd._hoverdata;\n    var newhoverdata = [];\n\n    // pull out just the data that's useful to\n    // other people and send it to the event\n    for(itemnum = 0; itemnum < hoverData.length; itemnum++) {\n        var pt = hoverData[itemnum];\n        var eventData = helpers.makeEventData(pt, pt.trace, pt.cd);\n\n        if(pt.hovertemplate !== false) {\n            var ht = false;\n            if(pt.cd[pt.index] && pt.cd[pt.index].ht) {\n                ht = pt.cd[pt.index].ht;\n            }\n            pt.hovertemplate = ht || pt.trace.hovertemplate || false;\n        }\n\n        pt.eventData = [eventData];\n        newhoverdata.push(eventData);\n    }\n\n    gd._hoverdata = newhoverdata;\n\n    var rotateLabels = (\n        (hovermode === 'y' && (searchData.length > 1 || hoverData.length > 1)) ||\n        (hovermode === 'closest' && hasOneHorizontalTrace && hoverData.length > 1)\n    );\n\n    var bgColor = Color.combine(\n        fullLayout.plot_bgcolor || Color.background,\n        fullLayout.paper_bgcolor\n    );\n\n    var labelOpts = {\n        hovermode: hovermode,\n        rotateLabels: rotateLabels,\n        bgColor: bgColor,\n        container: fullLayout._hoverlayer,\n        outerContainer: fullLayout._paperdiv,\n        commonLabelOpts: fullLayout.hoverlabel,\n        hoverdistance: fullLayout.hoverdistance\n    };\n\n    var hoverLabels = createHoverText(hoverData, labelOpts, gd);\n\n    if(!helpers.isUnifiedHover(hovermode)) {\n        hoverAvoidOverlaps(hoverLabels, rotateLabels ? 'xa' : 'ya', fullLayout);\n        alignHoverText(hoverLabels, rotateLabels);\n    }\n\n    // TODO: tagName hack is needed to appease geo.js's hack of using evt.target=true\n    // we should improve the \"fx\" API so other plots can use it without these hack.\n    if(evt.target && evt.target.tagName) {\n        var hasClickToShow = Registry.getComponentMethod('annotations', 'hasClickToShow')(gd, newhoverdata);\n        overrideCursor(d3.select(evt.target), hasClickToShow ? 'pointer' : '');\n    }\n\n    // don't emit events if called manually\n    if(!evt.target || noHoverEvent || !hoverChanged(gd, evt, oldhoverdata)) return;\n\n    if(oldhoverdata) {\n        gd.emit('plotly_unhover', {\n            event: evt,\n            points: oldhoverdata\n        });\n    }\n\n    gd.emit('plotly_hover', {\n        event: evt,\n        points: gd._hoverdata,\n        xaxes: xaArray,\n        yaxes: yaArray,\n        xvals: xvalArray,\n        yvals: yvalArray\n    });\n}\n\nfunction hoverDataKey(d) {\n    return [d.trace.index, d.index, d.x0, d.y0, d.name, d.attr, d.xa, d.ya || ''].join(',');\n}\n\nvar EXTRA_STRING_REGEX = /<extra>([\\s\\S]*)<\\/extra>/;\n\nfunction createHoverText(hoverData, opts, gd) {\n    var fullLayout = gd._fullLayout;\n    var hovermode = opts.hovermode;\n    var rotateLabels = opts.rotateLabels;\n    var bgColor = opts.bgColor;\n    var container = opts.container;\n    var outerContainer = opts.outerContainer;\n    var commonLabelOpts = opts.commonLabelOpts || {};\n\n    // opts.fontFamily/Size are used for the common label\n    // and as defaults for each hover label, though the individual labels\n    // can override this.\n    var fontFamily = opts.fontFamily || constants.HOVERFONT;\n    var fontSize = opts.fontSize || constants.HOVERFONTSIZE;\n\n    var c0 = hoverData[0];\n    var xa = c0.xa;\n    var ya = c0.ya;\n    var commonAttr = hovermode.charAt(0) === 'y' ? 'yLabel' : 'xLabel';\n    var t0 = c0[commonAttr];\n    var t00 = (String(t0) || '').split(' ')[0];\n    var outerContainerBB = outerContainer.node().getBoundingClientRect();\n    var outerTop = outerContainerBB.top;\n    var outerWidth = outerContainerBB.width;\n    var outerHeight = outerContainerBB.height;\n\n    // show the common label, if any, on the axis\n    // never show a common label in array mode,\n    // even if sometimes there could be one\n    var showCommonLabel = (\n        (t0 !== undefined) &&\n        (c0.distance <= opts.hoverdistance) &&\n        (hovermode === 'x' || hovermode === 'y')\n    );\n\n    // all hover traces hoverinfo must contain the hovermode\n    // to have common labels\n    if(showCommonLabel) {\n        var allHaveZ = true;\n        var i, traceHoverinfo;\n        for(i = 0; i < hoverData.length; i++) {\n            if(allHaveZ && hoverData[i].zLabel === undefined) allHaveZ = false;\n\n            traceHoverinfo = hoverData[i].hoverinfo || hoverData[i].trace.hoverinfo;\n            if(traceHoverinfo) {\n                var parts = Array.isArray(traceHoverinfo) ? traceHoverinfo : traceHoverinfo.split('+');\n                if(parts.indexOf('all') === -1 &&\n                    parts.indexOf(hovermode) === -1) {\n                    showCommonLabel = false;\n                    break;\n                }\n            }\n        }\n\n        // xyz labels put all info in their main label, so have no need of a common label\n        if(allHaveZ) showCommonLabel = false;\n    }\n\n    var commonLabel = container.selectAll('g.axistext')\n        .data(showCommonLabel ? [0] : []);\n    commonLabel.enter().append('g')\n        .classed('axistext', true);\n    commonLabel.exit().remove();\n\n    commonLabel.each(function() {\n        var label = d3.select(this);\n        var lpath = Lib.ensureSingle(label, 'path', '', function(s) {\n            s.style({'stroke-width': '1px'});\n        });\n        var ltext = Lib.ensureSingle(label, 'text', '', function(s) {\n            // prohibit tex interpretation until we can handle\n            // tex and regular text together\n            s.attr('data-notex', 1);\n        });\n\n        var commonBgColor = commonLabelOpts.bgcolor || Color.defaultLine;\n        var commonStroke = commonLabelOpts.bordercolor || Color.contrast(commonBgColor);\n        var contrastColor = Color.contrast(commonBgColor);\n        var commonLabelFont = {\n            family: commonLabelOpts.font.family || fontFamily,\n            size: commonLabelOpts.font.size || fontSize,\n            color: commonLabelOpts.font.color || contrastColor\n        };\n\n        lpath.style({\n            fill: commonBgColor,\n            stroke: commonStroke\n        });\n\n        ltext.text(t0)\n            .call(Drawing.font, commonLabelFont)\n            .call(svgTextUtils.positionText, 0, 0)\n            .call(svgTextUtils.convertToTspans, gd);\n\n        label.attr('transform', '');\n\n        var tbb = ltext.node().getBoundingClientRect();\n        var lx, ly;\n\n        if(hovermode === 'x') {\n            var topsign = xa.side === 'top' ? '-' : '';\n\n            ltext.attr('text-anchor', 'middle')\n                .call(svgTextUtils.positionText, 0, (xa.side === 'top' ?\n                    (outerTop - tbb.bottom - HOVERARROWSIZE - HOVERTEXTPAD) :\n                    (outerTop - tbb.top + HOVERARROWSIZE + HOVERTEXTPAD)));\n\n            lx = xa._offset + (c0.x0 + c0.x1) / 2;\n            ly = ya._offset + (xa.side === 'top' ? 0 : ya._length);\n\n            var halfWidth = tbb.width / 2 + HOVERTEXTPAD;\n\n            if(lx < halfWidth) {\n                lx = halfWidth;\n\n                lpath.attr('d', 'M-' + (halfWidth - HOVERARROWSIZE) + ',0' +\n                    'L-' + (halfWidth - HOVERARROWSIZE * 2) + ',' + topsign + HOVERARROWSIZE +\n                    'H' + (HOVERTEXTPAD + tbb.width / 2) +\n                    'v' + topsign + (HOVERTEXTPAD * 2 + tbb.height) +\n                    'H-' + halfWidth +\n                    'V' + topsign + HOVERARROWSIZE +\n                    'Z');\n            } else if(lx > (fullLayout.width - halfWidth)) {\n                lx = fullLayout.width - halfWidth;\n\n                lpath.attr('d', 'M' + (halfWidth - HOVERARROWSIZE) + ',0' +\n                    'L' + halfWidth + ',' + topsign + HOVERARROWSIZE +\n                    'v' + topsign + (HOVERTEXTPAD * 2 + tbb.height) +\n                    'H-' + halfWidth +\n                    'V' + topsign + HOVERARROWSIZE +\n                    'H' + (halfWidth - HOVERARROWSIZE * 2) + 'Z');\n            } else {\n                lpath.attr('d', 'M0,0' +\n                    'L' + HOVERARROWSIZE + ',' + topsign + HOVERARROWSIZE +\n                    'H' + (HOVERTEXTPAD + tbb.width / 2) +\n                    'v' + topsign + (HOVERTEXTPAD * 2 + tbb.height) +\n                    'H-' + (HOVERTEXTPAD + tbb.width / 2) +\n                    'V' + topsign + HOVERARROWSIZE +\n                    'H-' + HOVERARROWSIZE + 'Z');\n            }\n        } else {\n            var anchor;\n            var sgn;\n            var leftsign;\n            if(ya.side === 'right') {\n                anchor = 'start';\n                sgn = 1;\n                leftsign = '';\n                lx = xa._offset + xa._length;\n            } else {\n                anchor = 'end';\n                sgn = -1;\n                leftsign = '-';\n                lx = xa._offset;\n            }\n\n            ly = ya._offset + (c0.y0 + c0.y1) / 2;\n\n            ltext.attr('text-anchor', anchor);\n\n            lpath.attr('d', 'M0,0' +\n                'L' + leftsign + HOVERARROWSIZE + ',' + HOVERARROWSIZE +\n                'V' + (HOVERTEXTPAD + tbb.height / 2) +\n                'h' + leftsign + (HOVERTEXTPAD * 2 + tbb.width) +\n                'V-' + (HOVERTEXTPAD + tbb.height / 2) +\n                'H' + leftsign + HOVERARROWSIZE + 'V-' + HOVERARROWSIZE + 'Z');\n\n            var halfHeight = tbb.height / 2;\n            var lty = outerTop - tbb.top - halfHeight;\n            var clipId = 'clip' + fullLayout._uid + 'commonlabel' + ya._id;\n            var clipPath;\n\n            if(lx < (tbb.width + 2 * HOVERTEXTPAD + HOVERARROWSIZE)) {\n                clipPath = 'M-' + (HOVERARROWSIZE + HOVERTEXTPAD) + '-' + halfHeight +\n                    'h-' + (tbb.width - HOVERTEXTPAD) +\n                    'V' + halfHeight +\n                    'h' + (tbb.width - HOVERTEXTPAD) + 'Z';\n\n                var ltx = tbb.width - lx + HOVERTEXTPAD;\n                svgTextUtils.positionText(ltext, ltx, lty);\n\n                // shift each line (except the longest) so that start-of-line\n                // is always visible\n                if(anchor === 'end') {\n                    ltext.selectAll('tspan').each(function() {\n                        var s = d3.select(this);\n                        var dummy = Drawing.tester.append('text')\n                            .text(s.text())\n                            .call(Drawing.font, commonLabelFont);\n                        var dummyBB = dummy.node().getBoundingClientRect();\n                        if(Math.round(dummyBB.width) < Math.round(tbb.width)) {\n                            s.attr('x', ltx - dummyBB.width);\n                        }\n                        dummy.remove();\n                    });\n                }\n            } else {\n                svgTextUtils.positionText(ltext, sgn * (HOVERTEXTPAD + HOVERARROWSIZE), lty);\n                clipPath = null;\n            }\n\n            var textClip = fullLayout._topclips.selectAll('#' + clipId).data(clipPath ? [0] : []);\n            textClip.enter().append('clipPath').attr('id', clipId).append('path');\n            textClip.exit().remove();\n            textClip.select('path').attr('d', clipPath);\n            Drawing.setClipUrl(ltext, clipPath ? clipId : null, gd);\n        }\n\n        label.attr('transform', 'translate(' + lx + ',' + ly + ')');\n\n        // remove the \"close but not quite\" points\n        // because of error bars, only take up to a space\n        hoverData = filterClosePoints(hoverData);\n    });\n\n    function filterClosePoints(hoverData) {\n        return hoverData.filter(function(d) {\n            return (d.zLabelVal !== undefined) ||\n                (d[commonAttr] || '').split(' ')[0] === t00;\n        });\n    }\n\n    // Show a single hover label\n    if(helpers.isUnifiedHover(hovermode)) {\n        // Delete leftover hover labels from other hovermodes\n        container.selectAll('g.hovertext').remove();\n\n        // similarly to compare mode, we remove the \"close but not quite together\" points\n        if((t0 !== undefined) && (c0.distance <= opts.hoverdistance)) hoverData = filterClosePoints(hoverData);\n\n        // Return early if nothing is hovered on\n        if(hoverData.length === 0) return;\n\n        // mock legend\n        var mockLayoutIn = {\n            showlegend: true,\n            legend: {\n                title: {text: t0, font: fullLayout.hoverlabel.font},\n                font: fullLayout.hoverlabel.font,\n                bgcolor: fullLayout.hoverlabel.bgcolor,\n                bordercolor: fullLayout.hoverlabel.bordercolor,\n                borderwidth: 1,\n                tracegroupgap: 7,\n                traceorder: fullLayout.legend ? fullLayout.legend.traceorder : undefined,\n                orientation: 'v'\n            }\n        };\n        var mockLayoutOut = {};\n        legendSupplyDefaults(mockLayoutIn, mockLayoutOut, gd._fullData);\n        var legendOpts = mockLayoutOut.legend;\n\n        // prepare items for the legend\n        legendOpts.entries = [];\n        for(var j = 0; j < hoverData.length; j++) {\n            var texts = getHoverLabelText(hoverData[j], true, hovermode, fullLayout, t0);\n            var text = texts[0];\n            var name = texts[1];\n            var pt = hoverData[j];\n            pt.name = name;\n            if(name !== '') {\n                pt.text = name + ' : ' + text;\n            } else {\n                pt.text = text;\n            }\n\n            // pass through marker's calcdata to style legend items\n            var cd = pt.cd[pt.index];\n            if(cd) {\n                if(cd.mc) pt.mc = cd.mc;\n                if(cd.mcc) pt.mc = cd.mcc;\n                if(cd.mlc) pt.mlc = cd.mlc;\n                if(cd.mlcc) pt.mlc = cd.mlcc;\n                if(cd.mlw) pt.mlw = cd.mlw;\n                if(cd.mrc) pt.mrc = cd.mrc;\n                if(cd.dir) pt.dir = cd.dir;\n            }\n            pt._distinct = true;\n\n            legendOpts.entries.push([pt]);\n        }\n        legendOpts.entries.sort(function(a, b) { return a[0].trace.index - b[0].trace.index;});\n        legendOpts.layer = container;\n\n        // Draw unified hover label\n        legendDraw(gd, legendOpts);\n\n        // Position the hover\n        var ly = Lib.mean(hoverData.map(function(c) {return (c.y0 + c.y1) / 2;}));\n        var lx = Lib.mean(hoverData.map(function(c) {return (c.x0 + c.x1) / 2;}));\n        var legendContainer = container.select('g.legend');\n        var tbb = legendContainer.node().getBoundingClientRect();\n        lx += xa._offset;\n        ly += ya._offset - tbb.height / 2;\n\n        // Change horizontal alignment to end up on screen\n        var txWidth = tbb.width + 2 * HOVERTEXTPAD;\n        var anchorStartOK = lx + txWidth <= outerWidth;\n        var anchorEndOK = lx - txWidth >= 0;\n        if(!anchorStartOK && anchorEndOK) {\n            lx -= txWidth;\n        } else {\n            lx += 2 * HOVERTEXTPAD;\n        }\n\n        // Change vertical alignement to end up on screen\n        var txHeight = tbb.height + 2 * HOVERTEXTPAD;\n        var overflowTop = ly <= outerTop;\n        var overflowBottom = ly + txHeight >= outerHeight;\n        var canFit = txHeight <= outerHeight;\n        if(canFit) {\n            if(overflowTop) {\n                ly = ya._offset + 2 * HOVERTEXTPAD;\n            } else if(overflowBottom) {\n                ly = outerHeight - txHeight;\n            }\n        }\n        legendContainer.attr('transform', 'translate(' + lx + ',' + ly + ')');\n\n        return legendContainer;\n    }\n\n    // show all the individual labels\n\n    // first create the objects\n    var hoverLabels = container.selectAll('g.hovertext')\n        .data(hoverData, function(d) {\n            // N.B. when multiple items have the same result key-function value,\n            // only the first of those items in hoverData gets rendered\n            return hoverDataKey(d);\n        });\n    hoverLabels.enter().append('g')\n        .classed('hovertext', true)\n        .each(function() {\n            var g = d3.select(this);\n            // trace name label (rect and text.name)\n            g.append('rect')\n                .call(Color.fill, Color.addOpacity(bgColor, 0.8));\n            g.append('text').classed('name', true);\n            // trace data label (path and text.nums)\n            g.append('path')\n                .style('stroke-width', '1px');\n            g.append('text').classed('nums', true)\n                .call(Drawing.font, fontFamily, fontSize);\n        });\n    hoverLabels.exit().remove();\n\n    // then put the text in, position the pointer to the data,\n    // and figure out sizes\n    hoverLabels.each(function(d) {\n        var g = d3.select(this).attr('transform', '');\n\n        // combine possible non-opaque trace color with bgColor\n        var color0 = d.bgcolor || d.color;\n        // color for 'nums' part of the label\n        var numsColor = Color.combine(\n            Color.opacity(color0) ? color0 : Color.defaultLine,\n            bgColor\n        );\n        // color for 'name' part of the label\n        var nameColor = Color.combine(\n            Color.opacity(d.color) ? d.color : Color.defaultLine,\n            bgColor\n        );\n        // find a contrasting color for border and text\n        var contrastColor = d.borderColor || Color.contrast(numsColor);\n\n        var texts = getHoverLabelText(d, showCommonLabel, hovermode, fullLayout, t0, g);\n        var text = texts[0];\n        var name = texts[1];\n\n        // main label\n        var tx = g.select('text.nums')\n            .call(Drawing.font,\n                d.fontFamily || fontFamily,\n                d.fontSize || fontSize,\n                d.fontColor || contrastColor)\n            .text(text)\n            .attr('data-notex', 1)\n            .call(svgTextUtils.positionText, 0, 0)\n            .call(svgTextUtils.convertToTspans, gd);\n\n        var tx2 = g.select('text.name');\n        var tx2width = 0;\n        var tx2height = 0;\n\n        // secondary label for non-empty 'name'\n        if(name && name !== text) {\n            tx2.call(Drawing.font,\n                    d.fontFamily || fontFamily,\n                    d.fontSize || fontSize,\n                    nameColor)\n                .text(name)\n                .attr('data-notex', 1)\n                .call(svgTextUtils.positionText, 0, 0)\n                .call(svgTextUtils.convertToTspans, gd);\n\n            var t2bb = tx2.node().getBoundingClientRect();\n            tx2width = t2bb.width + 2 * HOVERTEXTPAD;\n            tx2height = t2bb.height + 2 * HOVERTEXTPAD;\n        } else {\n            tx2.remove();\n            g.select('rect').remove();\n        }\n\n        g.select('path').style({\n            fill: numsColor,\n            stroke: contrastColor\n        });\n\n        var tbb = tx.node().getBoundingClientRect();\n        var htx = d.xa._offset + (d.x0 + d.x1) / 2;\n        var hty = d.ya._offset + (d.y0 + d.y1) / 2;\n        var dx = Math.abs(d.x1 - d.x0);\n        var dy = Math.abs(d.y1 - d.y0);\n        var txTotalWidth = tbb.width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width;\n        var anchorStartOK, anchorEndOK;\n\n        d.ty0 = outerTop - tbb.top;\n        d.bx = tbb.width + 2 * HOVERTEXTPAD;\n        d.by = Math.max(tbb.height + 2 * HOVERTEXTPAD, tx2height);\n        d.anchor = 'start';\n        d.txwidth = tbb.width;\n        d.tx2width = tx2width;\n        d.offset = 0;\n\n        if(rotateLabels) {\n            d.pos = htx;\n            anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight;\n            anchorEndOK = hty - dy / 2 - txTotalWidth >= 0;\n            if((d.idealAlign === 'top' || !anchorStartOK) && anchorEndOK) {\n                hty -= dy / 2;\n                d.anchor = 'end';\n            } else if(anchorStartOK) {\n                hty += dy / 2;\n                d.anchor = 'start';\n            } else d.anchor = 'middle';\n        } else {\n            d.pos = hty;\n            anchorStartOK = htx + dx / 2 + txTotalWidth <= outerWidth;\n            anchorEndOK = htx - dx / 2 - txTotalWidth >= 0;\n\n            if((d.idealAlign === 'left' || !anchorStartOK) && anchorEndOK) {\n                htx -= dx / 2;\n                d.anchor = 'end';\n            } else if(anchorStartOK) {\n                htx += dx / 2;\n                d.anchor = 'start';\n            } else {\n                d.anchor = 'middle';\n\n                var txHalfWidth = txTotalWidth / 2;\n                var overflowR = htx + txHalfWidth - outerWidth;\n                var overflowL = htx - txHalfWidth;\n                if(overflowR > 0) htx -= overflowR;\n                if(overflowL < 0) htx += -overflowL;\n            }\n        }\n\n        tx.attr('text-anchor', d.anchor);\n        if(tx2width) tx2.attr('text-anchor', d.anchor);\n        g.attr('transform', 'translate(' + htx + ',' + hty + ')' +\n            (rotateLabels ? 'rotate(' + YANGLE + ')' : ''));\n    });\n\n    return hoverLabels;\n}\n\nfunction getHoverLabelText(d, showCommonLabel, hovermode, fullLayout, t0, g) {\n    var name = '';\n    var text = '';\n    // to get custom 'name' labels pass cleanPoint\n    if(d.nameOverride !== undefined) d.name = d.nameOverride;\n\n    if(d.name) {\n        if(d.trace._meta) {\n            d.name = Lib.templateString(d.name, d.trace._meta);\n        }\n        name = plainText(d.name, d.nameLength);\n    }\n\n    if(d.zLabel !== undefined) {\n        if(d.xLabel !== undefined) text += 'x: ' + d.xLabel + '<br>';\n        if(d.yLabel !== undefined) text += 'y: ' + d.yLabel + '<br>';\n        if(d.trace.type !== 'choropleth' && d.trace.type !== 'choroplethmapbox') {\n            text += (text ? 'z: ' : '') + d.zLabel;\n        }\n    } else if(showCommonLabel && d[hovermode.charAt(0) + 'Label'] === t0) {\n        text = d[(hovermode.charAt(0) === 'x' ? 'y' : 'x') + 'Label'] || '';\n    } else if(d.xLabel === undefined) {\n        if(d.yLabel !== undefined && d.trace.type !== 'scattercarpet') {\n            text = d.yLabel;\n        }\n    } else if(d.yLabel === undefined) text = d.xLabel;\n    else text = '(' + d.xLabel + ', ' + d.yLabel + ')';\n\n    if((d.text || d.text === 0) && !Array.isArray(d.text)) {\n        text += (text ? '<br>' : '') + d.text;\n    }\n\n    // used by other modules (initially just ternary) that\n    // manage their own hoverinfo independent of cleanPoint\n    // the rest of this will still apply, so such modules\n    // can still put things in (x|y|z)Label, text, and name\n    // and hoverinfo will still determine their visibility\n    if(d.extraText !== undefined) text += (text ? '<br>' : '') + d.extraText;\n\n    // if 'text' is empty at this point,\n    // and hovertemplate is not defined,\n    // put 'name' in main label and don't show secondary label\n    if(g && text === '' && !d.hovertemplate) {\n        // if 'name' is also empty, remove entire label\n        if(name === '') g.remove();\n        text = name;\n    }\n\n    // hovertemplate\n    var d3locale = fullLayout._d3locale;\n    var hovertemplate = d.hovertemplate || false;\n    var hovertemplateLabels = d.hovertemplateLabels || d;\n    var eventData = d.eventData[0] || {};\n    if(hovertemplate) {\n        text = Lib.hovertemplateString(\n            hovertemplate,\n            hovertemplateLabels,\n            d3locale,\n            eventData,\n            d.trace._meta\n        );\n\n        text = text.replace(EXTRA_STRING_REGEX, function(match, extra) {\n            // assign name for secondary text label\n            name = plainText(extra, d.nameLength);\n            // remove from main text label\n            return '';\n        });\n    }\n    return [text, name];\n}\n\n// Make groups of touching points, and within each group\n// move each point so that no labels overlap, but the average\n// label position is the same as it was before moving. Indicentally,\n// this is equivalent to saying all the labels are on equal linear\n// springs about their initial position. Initially, each point is\n// its own group, but as we find overlaps we will clump the points.\n//\n// Also, there are hard constraints at the edges of the graphs,\n// that push all groups to the middle so they are visible. I don't\n// know what happens if the group spans all the way from one edge to\n// the other, though it hardly matters - there's just too much\n// information then.\nfunction hoverAvoidOverlaps(hoverLabels, axKey, fullLayout) {\n    var nummoves = 0;\n    var axSign = 1;\n    var nLabels = hoverLabels.size();\n\n    // make groups of touching points\n    var pointgroups = new Array(nLabels);\n    var k = 0;\n\n    hoverLabels.each(function(d) {\n        var ax = d[axKey];\n        var axIsX = ax._id.charAt(0) === 'x';\n        var rng = ax.range;\n\n        if(k === 0 && rng && ((rng[0] > rng[1]) !== axIsX)) {\n            axSign = -1;\n        }\n        pointgroups[k++] = [{\n            datum: d,\n            traceIndex: d.trace.index,\n            dp: 0,\n            pos: d.pos,\n            posref: d.posref,\n            size: d.by * (axIsX ? YFACTOR : 1) / 2,\n            pmin: 0,\n            pmax: (axIsX ? fullLayout.width : fullLayout.height)\n        }];\n    });\n\n    pointgroups.sort(function(a, b) {\n        return (a[0].posref - b[0].posref) ||\n            // for equal positions, sort trace indices increasing or decreasing\n            // depending on whether the axis is reversed or not... so stacked\n            // traces will generally keep their order even if one trace adds\n            // nothing to the stack.\n            (axSign * (b[0].traceIndex - a[0].traceIndex));\n    });\n\n    var donepositioning, topOverlap, bottomOverlap, i, j, pti, sumdp;\n\n    function constrainGroup(grp) {\n        var minPt = grp[0];\n        var maxPt = grp[grp.length - 1];\n\n        // overlap with the top - positive vals are overlaps\n        topOverlap = minPt.pmin - minPt.pos - minPt.dp + minPt.size;\n\n        // overlap with the bottom - positive vals are overlaps\n        bottomOverlap = maxPt.pos + maxPt.dp + maxPt.size - minPt.pmax;\n\n        // check for min overlap first, so that we always\n        // see the largest labels\n        // allow for .01px overlap, so we don't get an\n        // infinite loop from rounding errors\n        if(topOverlap > 0.01) {\n            for(j = grp.length - 1; j >= 0; j--) grp[j].dp += topOverlap;\n            donepositioning = false;\n        }\n        if(bottomOverlap < 0.01) return;\n        if(topOverlap < -0.01) {\n            // make sure we're not pushing back and forth\n            for(j = grp.length - 1; j >= 0; j--) grp[j].dp -= bottomOverlap;\n            donepositioning = false;\n        }\n        if(!donepositioning) return;\n\n        // no room to fix positioning, delete off-screen points\n\n        // first see how many points we need to delete\n        var deleteCount = 0;\n        for(i = 0; i < grp.length; i++) {\n            pti = grp[i];\n            if(pti.pos + pti.dp + pti.size > minPt.pmax) deleteCount++;\n        }\n\n        // start by deleting points whose data is off screen\n        for(i = grp.length - 1; i >= 0; i--) {\n            if(deleteCount <= 0) break;\n            pti = grp[i];\n\n            // pos has already been constrained to [pmin,pmax]\n            // so look for points close to that to delete\n            if(pti.pos > minPt.pmax - 1) {\n                pti.del = true;\n                deleteCount--;\n            }\n        }\n        for(i = 0; i < grp.length; i++) {\n            if(deleteCount <= 0) break;\n            pti = grp[i];\n\n            // pos has already been constrained to [pmin,pmax]\n            // so look for points close to that to delete\n            if(pti.pos < minPt.pmin + 1) {\n                pti.del = true;\n                deleteCount--;\n\n                // shift the whole group minus into this new space\n                bottomOverlap = pti.size * 2;\n                for(j = grp.length - 1; j >= 0; j--) grp[j].dp -= bottomOverlap;\n            }\n        }\n        // then delete points that go off the bottom\n        for(i = grp.length - 1; i >= 0; i--) {\n            if(deleteCount <= 0) break;\n            pti = grp[i];\n            if(pti.pos + pti.dp + pti.size > minPt.pmax) {\n                pti.del = true;\n                deleteCount--;\n            }\n        }\n    }\n\n    // loop through groups, combining them if they overlap,\n    // until nothing moves\n    while(!donepositioning && nummoves <= nLabels) {\n        // to avoid infinite loops, don't move more times\n        // than there are traces\n        nummoves++;\n\n        // assume nothing will move in this iteration,\n        // reverse this if it does\n        donepositioning = true;\n        i = 0;\n        while(i < pointgroups.length - 1) {\n            // the higher (g0) and lower (g1) point group\n            var g0 = pointgroups[i];\n            var g1 = pointgroups[i + 1];\n\n            // the lowest point in the higher group (p0)\n            // the highest point in the lower group (p1)\n            var p0 = g0[g0.length - 1];\n            var p1 = g1[0];\n            topOverlap = p0.pos + p0.dp + p0.size - p1.pos - p1.dp + p1.size;\n\n            // Only group points that lie on the same axes\n            if(topOverlap > 0.01 && (p0.pmin === p1.pmin) && (p0.pmax === p1.pmax)) {\n                // push the new point(s) added to this group out of the way\n                for(j = g1.length - 1; j >= 0; j--) g1[j].dp += topOverlap;\n\n                // add them to the group\n                g0.push.apply(g0, g1);\n                pointgroups.splice(i + 1, 1);\n\n                // adjust for minimum average movement\n                sumdp = 0;\n                for(j = g0.length - 1; j >= 0; j--) sumdp += g0[j].dp;\n                bottomOverlap = sumdp / g0.length;\n                for(j = g0.length - 1; j >= 0; j--) g0[j].dp -= bottomOverlap;\n                donepositioning = false;\n            } else i++;\n        }\n\n        // check if we're going off the plot on either side and fix\n        pointgroups.forEach(constrainGroup);\n    }\n\n    // now put these offsets into hoverData\n    for(i = pointgroups.length - 1; i >= 0; i--) {\n        var grp = pointgroups[i];\n        for(j = grp.length - 1; j >= 0; j--) {\n            var pt = grp[j];\n            var hoverPt = pt.datum;\n            hoverPt.offset = pt.dp;\n            hoverPt.del = pt.del;\n        }\n    }\n}\n\nfunction alignHoverText(hoverLabels, rotateLabels) {\n    // finally set the text positioning relative to the data and draw the\n    // box around it\n    hoverLabels.each(function(d) {\n        var g = d3.select(this);\n        if(d.del) return g.remove();\n\n        var tx = g.select('text.nums');\n        var anchor = d.anchor;\n        var horzSign = anchor === 'end' ? -1 : 1;\n        var alignShift = {start: 1, end: -1, middle: 0}[anchor];\n        var txx = alignShift * (HOVERARROWSIZE + HOVERTEXTPAD);\n        var tx2x = txx + alignShift * (d.txwidth + HOVERTEXTPAD);\n        var offsetX = 0;\n        var offsetY = d.offset;\n\n        if(anchor === 'middle') {\n            txx -= d.tx2width / 2;\n            tx2x += d.txwidth / 2 + HOVERTEXTPAD;\n        }\n        if(rotateLabels) {\n            offsetY *= -YSHIFTY;\n            offsetX = d.offset * YSHIFTX;\n        }\n\n        g.select('path').attr('d', anchor === 'middle' ?\n            // middle aligned: rect centered on data\n            ('M-' + (d.bx / 2 + d.tx2width / 2) + ',' + (offsetY - d.by / 2) +\n              'h' + d.bx + 'v' + d.by + 'h-' + d.bx + 'Z') :\n            // left or right aligned: side rect with arrow to data\n            ('M0,0L' + (horzSign * HOVERARROWSIZE + offsetX) + ',' + (HOVERARROWSIZE + offsetY) +\n                'v' + (d.by / 2 - HOVERARROWSIZE) +\n                'h' + (horzSign * d.bx) +\n                'v-' + d.by +\n                'H' + (horzSign * HOVERARROWSIZE + offsetX) +\n                'V' + (offsetY - HOVERARROWSIZE) +\n                'Z'));\n\n        var posX = txx + offsetX;\n        var posY = offsetY + d.ty0 - d.by / 2 + HOVERTEXTPAD;\n        var textAlign = d.textAlign || 'auto';\n\n        if(textAlign !== 'auto') {\n            if(textAlign === 'left' && anchor !== 'start') {\n                tx.attr('text-anchor', 'start');\n                posX = anchor === 'middle' ?\n                    -d.bx / 2 - d.tx2width / 2 + HOVERTEXTPAD :\n                    -d.bx - HOVERTEXTPAD;\n            } else if(textAlign === 'right' && anchor !== 'end') {\n                tx.attr('text-anchor', 'end');\n                posX = anchor === 'middle' ?\n                    d.bx / 2 - d.tx2width / 2 - HOVERTEXTPAD :\n                    d.bx + HOVERTEXTPAD;\n            }\n        }\n\n        tx.call(svgTextUtils.positionText, posX, posY);\n\n        if(d.tx2width) {\n            g.select('text.name')\n                .call(svgTextUtils.positionText,\n                    tx2x + alignShift * HOVERTEXTPAD + offsetX,\n                    offsetY + d.ty0 - d.by / 2 + HOVERTEXTPAD);\n            g.select('rect')\n                .call(Drawing.setRect,\n                    tx2x + (alignShift - 1) * d.tx2width / 2 + offsetX,\n                    offsetY - d.by / 2 - 1,\n                    d.tx2width, d.by + 2);\n        }\n    });\n}\n\nfunction cleanPoint(d, hovermode) {\n    var index = d.index;\n    var trace = d.trace || {};\n    var cd0 = d.cd[0];\n    var cd = d.cd[index] || {};\n\n    function pass(v) {\n        return v || (isNumeric(v) && v === 0);\n    }\n\n    var getVal = Array.isArray(index) ?\n        function(calcKey, traceKey) {\n            var v = Lib.castOption(cd0, index, calcKey);\n            return pass(v) ? v : Lib.extractOption({}, trace, '', traceKey);\n        } :\n        function(calcKey, traceKey) {\n            return Lib.extractOption(cd, trace, calcKey, traceKey);\n        };\n\n    function fill(key, calcKey, traceKey) {\n        var val = getVal(calcKey, traceKey);\n        if(pass(val)) d[key] = val;\n    }\n\n    fill('hoverinfo', 'hi', 'hoverinfo');\n    fill('bgcolor', 'hbg', 'hoverlabel.bgcolor');\n    fill('borderColor', 'hbc', 'hoverlabel.bordercolor');\n    fill('fontFamily', 'htf', 'hoverlabel.font.family');\n    fill('fontSize', 'hts', 'hoverlabel.font.size');\n    fill('fontColor', 'htc', 'hoverlabel.font.color');\n    fill('nameLength', 'hnl', 'hoverlabel.namelength');\n    fill('textAlign', 'hta', 'hoverlabel.align');\n\n    d.posref = (hovermode === 'y' || (hovermode === 'closest' && trace.orientation === 'h')) ?\n        (d.xa._offset + (d.x0 + d.x1) / 2) :\n        (d.ya._offset + (d.y0 + d.y1) / 2);\n\n    // then constrain all the positions to be on the plot\n    d.x0 = Lib.constrain(d.x0, 0, d.xa._length);\n    d.x1 = Lib.constrain(d.x1, 0, d.xa._length);\n    d.y0 = Lib.constrain(d.y0, 0, d.ya._length);\n    d.y1 = Lib.constrain(d.y1, 0, d.ya._length);\n\n    // and convert the x and y label values into formatted text\n    if(d.xLabelVal !== undefined) {\n        d.xLabel = ('xLabel' in d) ? d.xLabel : Axes.hoverLabelText(d.xa, d.xLabelVal);\n        d.xVal = d.xa.c2d(d.xLabelVal);\n    }\n    if(d.yLabelVal !== undefined) {\n        d.yLabel = ('yLabel' in d) ? d.yLabel : Axes.hoverLabelText(d.ya, d.yLabelVal);\n        d.yVal = d.ya.c2d(d.yLabelVal);\n    }\n\n    // Traces like heatmaps generate the zLabel in their hoverPoints function\n    if(d.zLabelVal !== undefined && d.zLabel === undefined) {\n        d.zLabel = String(d.zLabelVal);\n    }\n\n    // for box means and error bars, add the range to the label\n    if(!isNaN(d.xerr) && !(d.xa.type === 'log' && d.xerr <= 0)) {\n        var xeText = Axes.tickText(d.xa, d.xa.c2l(d.xerr), 'hover').text;\n        if(d.xerrneg !== undefined) {\n            d.xLabel += ' +' + xeText + ' / -' +\n                Axes.tickText(d.xa, d.xa.c2l(d.xerrneg), 'hover').text;\n        } else d.xLabel += ' ± ' + xeText;\n\n        // small distance penalty for error bars, so that if there are\n        // traces with errors and some without, the error bar label will\n        // hoist up to the point\n        if(hovermode === 'x') d.distance += 1;\n    }\n    if(!isNaN(d.yerr) && !(d.ya.type === 'log' && d.yerr <= 0)) {\n        var yeText = Axes.tickText(d.ya, d.ya.c2l(d.yerr), 'hover').text;\n        if(d.yerrneg !== undefined) {\n            d.yLabel += ' +' + yeText + ' / -' +\n                Axes.tickText(d.ya, d.ya.c2l(d.yerrneg), 'hover').text;\n        } else d.yLabel += ' ± ' + yeText;\n\n        if(hovermode === 'y') d.distance += 1;\n    }\n\n    var infomode = d.hoverinfo || d.trace.hoverinfo;\n\n    if(infomode && infomode !== 'all') {\n        infomode = Array.isArray(infomode) ? infomode : infomode.split('+');\n        if(infomode.indexOf('x') === -1) d.xLabel = undefined;\n        if(infomode.indexOf('y') === -1) d.yLabel = undefined;\n        if(infomode.indexOf('z') === -1) d.zLabel = undefined;\n        if(infomode.indexOf('text') === -1) d.text = undefined;\n        if(infomode.indexOf('name') === -1) d.name = undefined;\n    }\n\n    return d;\n}\n\nfunction createSpikelines(gd, closestPoints, opts) {\n    var container = opts.container;\n    var fullLayout = opts.fullLayout;\n    var gs = fullLayout._size;\n    var evt = opts.event;\n    var showY = !!closestPoints.hLinePoint;\n    var showX = !!closestPoints.vLinePoint;\n\n    var xa, ya;\n\n    // Remove old spikeline items\n    container.selectAll('.spikeline').remove();\n\n    if(!(showX || showY)) return;\n\n    var contrastColor = Color.combine(fullLayout.plot_bgcolor, fullLayout.paper_bgcolor);\n\n    // Horizontal line (to y-axis)\n    if(showY) {\n        var hLinePoint = closestPoints.hLinePoint;\n        var hLinePointX, hLinePointY;\n\n        xa = hLinePoint && hLinePoint.xa;\n        ya = hLinePoint && hLinePoint.ya;\n        var ySnap = ya.spikesnap;\n\n        if(ySnap === 'cursor') {\n            hLinePointX = evt.pointerX;\n            hLinePointY = evt.pointerY;\n        } else {\n            hLinePointX = xa._offset + hLinePoint.x;\n            hLinePointY = ya._offset + hLinePoint.y;\n        }\n        var dfltHLineColor = tinycolor.readability(hLinePoint.color, contrastColor) < 1.5 ?\n            Color.contrast(contrastColor) : hLinePoint.color;\n        var yMode = ya.spikemode;\n        var yThickness = ya.spikethickness;\n        var yColor = ya.spikecolor || dfltHLineColor;\n        var xEdge = Axes.getPxPosition(gd, ya);\n        var xBase, xEndSpike;\n\n        if(yMode.indexOf('toaxis') !== -1 || yMode.indexOf('across') !== -1) {\n            if(yMode.indexOf('toaxis') !== -1) {\n                xBase = xEdge;\n                xEndSpike = hLinePointX;\n            }\n            if(yMode.indexOf('across') !== -1) {\n                var xAcross0 = ya._counterDomainMin;\n                var xAcross1 = ya._counterDomainMax;\n                if(ya.anchor === 'free') {\n                    xAcross0 = Math.min(xAcross0, ya.position);\n                    xAcross1 = Math.max(xAcross1, ya.position);\n                }\n                xBase = gs.l + xAcross0 * gs.w;\n                xEndSpike = gs.l + xAcross1 * gs.w;\n            }\n\n            // Foreground horizontal line (to y-axis)\n            container.insert('line', ':first-child')\n                .attr({\n                    x1: xBase,\n                    x2: xEndSpike,\n                    y1: hLinePointY,\n                    y2: hLinePointY,\n                    'stroke-width': yThickness,\n                    stroke: yColor,\n                    'stroke-dasharray': Drawing.dashStyle(ya.spikedash, yThickness)\n                })\n                .classed('spikeline', true)\n                .classed('crisp', true);\n\n            // Background horizontal Line (to y-axis)\n            container.insert('line', ':first-child')\n                .attr({\n                    x1: xBase,\n                    x2: xEndSpike,\n                    y1: hLinePointY,\n                    y2: hLinePointY,\n                    'stroke-width': yThickness + 2,\n                    stroke: contrastColor\n                })\n                .classed('spikeline', true)\n                .classed('crisp', true);\n        }\n        // Y axis marker\n        if(yMode.indexOf('marker') !== -1) {\n            container.insert('circle', ':first-child')\n                .attr({\n                    cx: xEdge + (ya.side !== 'right' ? yThickness : -yThickness),\n                    cy: hLinePointY,\n                    r: yThickness,\n                    fill: yColor\n                })\n                .classed('spikeline', true);\n        }\n    }\n\n    if(showX) {\n        var vLinePoint = closestPoints.vLinePoint;\n        var vLinePointX, vLinePointY;\n\n        xa = vLinePoint && vLinePoint.xa;\n        ya = vLinePoint && vLinePoint.ya;\n        var xSnap = xa.spikesnap;\n\n        if(xSnap === 'cursor') {\n            vLinePointX = evt.pointerX;\n            vLinePointY = evt.pointerY;\n        } else {\n            vLinePointX = xa._offset + vLinePoint.x;\n            vLinePointY = ya._offset + vLinePoint.y;\n        }\n        var dfltVLineColor = tinycolor.readability(vLinePoint.color, contrastColor) < 1.5 ?\n            Color.contrast(contrastColor) : vLinePoint.color;\n        var xMode = xa.spikemode;\n        var xThickness = xa.spikethickness;\n        var xColor = xa.spikecolor || dfltVLineColor;\n        var yEdge = Axes.getPxPosition(gd, xa);\n        var yBase, yEndSpike;\n\n        if(xMode.indexOf('toaxis') !== -1 || xMode.indexOf('across') !== -1) {\n            if(xMode.indexOf('toaxis') !== -1) {\n                yBase = yEdge;\n                yEndSpike = vLinePointY;\n            }\n            if(xMode.indexOf('across') !== -1) {\n                var yAcross0 = xa._counterDomainMin;\n                var yAcross1 = xa._counterDomainMax;\n                if(xa.anchor === 'free') {\n                    yAcross0 = Math.min(yAcross0, xa.position);\n                    yAcross1 = Math.max(yAcross1, xa.position);\n                }\n                yBase = gs.t + (1 - yAcross1) * gs.h;\n                yEndSpike = gs.t + (1 - yAcross0) * gs.h;\n            }\n\n            // Foreground vertical line (to x-axis)\n            container.insert('line', ':first-child')\n                .attr({\n                    x1: vLinePointX,\n                    x2: vLinePointX,\n                    y1: yBase,\n                    y2: yEndSpike,\n                    'stroke-width': xThickness,\n                    stroke: xColor,\n                    'stroke-dasharray': Drawing.dashStyle(xa.spikedash, xThickness)\n                })\n                .classed('spikeline', true)\n                .classed('crisp', true);\n\n            // Background vertical line (to x-axis)\n            container.insert('line', ':first-child')\n                .attr({\n                    x1: vLinePointX,\n                    x2: vLinePointX,\n                    y1: yBase,\n                    y2: yEndSpike,\n                    'stroke-width': xThickness + 2,\n                    stroke: contrastColor\n                })\n                .classed('spikeline', true)\n                .classed('crisp', true);\n        }\n\n        // X axis marker\n        if(xMode.indexOf('marker') !== -1) {\n            container.insert('circle', ':first-child')\n                .attr({\n                    cx: vLinePointX,\n                    cy: yEdge - (xa.side !== 'top' ? xThickness : -xThickness),\n                    r: xThickness,\n                    fill: xColor\n                })\n                .classed('spikeline', true);\n        }\n    }\n}\n\nfunction hoverChanged(gd, evt, oldhoverdata) {\n    // don't emit any events if nothing changed\n    if(!oldhoverdata || oldhoverdata.length !== gd._hoverdata.length) return true;\n\n    for(var i = oldhoverdata.length - 1; i >= 0; i--) {\n        var oldPt = oldhoverdata[i];\n        var newPt = gd._hoverdata[i];\n\n        if(oldPt.curveNumber !== newPt.curveNumber ||\n            String(oldPt.pointNumber) !== String(newPt.pointNumber) ||\n            String(oldPt.pointNumbers) !== String(newPt.pointNumbers)\n        ) {\n            return true;\n        }\n    }\n    return false;\n}\n\nfunction spikesChanged(gd, oldspikepoints) {\n    // don't relayout the plot because of new spikelines if spikelines points didn't change\n    if(!oldspikepoints) return true;\n    if(oldspikepoints.vLinePoint !== gd._spikepoints.vLinePoint ||\n        oldspikepoints.hLinePoint !== gd._spikepoints.hLinePoint\n    ) return true;\n    return false;\n}\n\nfunction plainText(s, len) {\n    return svgTextUtils.plainText(s || '', {\n        len: len,\n        allowedTags: ['br', 'sub', 'sup', 'b', 'i', 'em']\n    });\n}\n\n},{\"../../lib\":178,\"../../lib/events\":172,\"../../lib/override_cursor\":189,\"../../lib/svg_text_utils\":199,\"../../plots/cartesian/axes\":222,\"../../registry\":269,\"../color\":52,\"../dragelement\":71,\"../drawing\":74,\"../legend/defaults\":104,\"../legend/draw\":105,\"./constants\":86,\"./helpers\":88,\"d3\":16,\"fast-isnumeric\":18,\"tinycolor2\":35}],90:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../color');\nvar isUnifiedHover = _dereq_('./helpers').isUnifiedHover;\n\nmodule.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts) {\n    opts = opts || {};\n\n    function inheritFontAttr(attr) {\n        if(!opts.font[attr]) {\n            opts.font[attr] = contOut.legend ? contOut.legend.font[attr] : contOut.font[attr];\n        }\n    }\n\n    // In unified hover, inherit from layout.legend if available or layout\n    if(contOut && isUnifiedHover(contOut.hovermode)) {\n        if(!opts.font) opts.font = {};\n        inheritFontAttr('size');\n        inheritFontAttr('family');\n        inheritFontAttr('color');\n\n        if(contOut.legend) {\n            if(!opts.bgcolor) opts.bgcolor = Color.combine(contOut.legend.bgcolor, contOut.paper_bgcolor);\n            if(!opts.bordercolor) opts.bordercolor = contOut.legend.bordercolor;\n        } else {\n            if(!opts.bgcolor) opts.bgcolor = contOut.paper_bgcolor;\n        }\n    }\n\n    coerce('hoverlabel.bgcolor', opts.bgcolor);\n    coerce('hoverlabel.bordercolor', opts.bordercolor);\n    coerce('hoverlabel.namelength', opts.namelength);\n    Lib.coerceFont(coerce, 'hoverlabel.font', opts.font);\n    coerce('hoverlabel.align', opts.align);\n};\n\n},{\"../../lib\":178,\"../color\":52,\"./helpers\":88}],91:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nmodule.exports = function handleHoverModeDefaults(layoutIn, layoutOut, fullData) {\n    function coerce(attr, dflt) {\n        // don't coerce if it is already coerced in other place e.g. in cartesian defaults\n        if(layoutOut[attr] !== undefined) return layoutOut[attr];\n\n        return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n    }\n\n    var clickmode = coerce('clickmode');\n\n    var hovermodeDflt;\n    if(layoutOut._has('cartesian')) {\n        if(clickmode.indexOf('select') > -1) {\n            hovermodeDflt = 'closest';\n        } else {\n            // flag for 'horizontal' plots:\n            // determines the state of the mode bar 'compare' hovermode button\n            layoutOut._isHoriz = isHoriz(fullData, layoutOut);\n            hovermodeDflt = layoutOut._isHoriz ? 'y' : 'x';\n        }\n    } else hovermodeDflt = 'closest';\n\n    return coerce('hovermode', hovermodeDflt);\n};\n\nfunction isHoriz(fullData, fullLayout) {\n    var stackOpts = fullLayout._scatterStackOpts || {};\n\n    for(var i = 0; i < fullData.length; i++) {\n        var trace = fullData[i];\n        var subplot = trace.xaxis + trace.yaxis;\n        var subplotStackOpts = stackOpts[subplot] || {};\n        var groupOpts = subplotStackOpts[trace.stackgroup] || {};\n\n        if(trace.orientation !== 'h' && groupOpts.orientation !== 'h') {\n            return false;\n        }\n    }\n\n    return true;\n}\n\n},{\"../../lib\":178,\"./layout_attributes\":93}],92:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar dragElement = _dereq_('../dragelement');\nvar helpers = _dereq_('./helpers');\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar hoverModule = _dereq_('./hover');\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'fx',\n\n    constants: _dereq_('./constants'),\n    schema: {\n        layout: layoutAttributes\n    },\n\n    attributes: _dereq_('./attributes'),\n    layoutAttributes: layoutAttributes,\n\n    supplyLayoutGlobalDefaults: _dereq_('./layout_global_defaults'),\n    supplyDefaults: _dereq_('./defaults'),\n    supplyLayoutDefaults: _dereq_('./layout_defaults'),\n\n    calc: _dereq_('./calc'),\n\n    getDistanceFunction: helpers.getDistanceFunction,\n    getClosest: helpers.getClosest,\n    inbox: helpers.inbox,\n    quadrature: helpers.quadrature,\n    appendArrayPointValue: helpers.appendArrayPointValue,\n\n    castHoverOption: castHoverOption,\n    castHoverinfo: castHoverinfo,\n\n    hover: hoverModule.hover,\n    unhover: dragElement.unhover,\n\n    loneHover: hoverModule.loneHover,\n    loneUnhover: loneUnhover,\n\n    click: _dereq_('./click')\n};\n\nfunction loneUnhover(containerOrSelection) {\n    // duck type whether the arg is a d3 selection because ie9 doesn't\n    // handle instanceof like modern browsers do.\n    var selection = Lib.isD3Selection(containerOrSelection) ?\n            containerOrSelection :\n            d3.select(containerOrSelection);\n\n    selection.selectAll('g.hovertext').remove();\n    selection.selectAll('.spikeline').remove();\n}\n\n// helpers for traces that use Fx.loneHover\n\nfunction castHoverOption(trace, ptNumber, attr) {\n    return Lib.castOption(trace, ptNumber, 'hoverlabel.' + attr);\n}\n\nfunction castHoverinfo(trace, fullLayout, ptNumber) {\n    function _coerce(val) {\n        return Lib.coerceHoverinfo({hoverinfo: val}, {_module: trace._module}, fullLayout);\n    }\n\n    return Lib.castOption(trace, ptNumber, 'hoverinfo', _coerce);\n}\n\n},{\"../../lib\":178,\"../dragelement\":71,\"./attributes\":83,\"./calc\":84,\"./click\":85,\"./constants\":86,\"./defaults\":87,\"./helpers\":88,\"./hover\":89,\"./layout_attributes\":93,\"./layout_defaults\":94,\"./layout_global_defaults\":95,\"d3\":16}],93:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = _dereq_('./constants');\n\nvar fontAttrs = _dereq_('../../plots/font_attributes')({\n    editType: 'none',\n    \n});\nfontAttrs.family.dflt = constants.HOVERFONT;\nfontAttrs.size.dflt = constants.HOVERFONTSIZE;\n\nmodule.exports = {\n    clickmode: {\n        valType: 'flaglist',\n        \n        flags: ['event', 'select'],\n        dflt: 'event',\n        editType: 'plot',\n        extras: ['none'],\n        \n    },\n    dragmode: {\n        valType: 'enumerated',\n        \n        values: [\n            'zoom',\n            'pan',\n            'select',\n            'lasso',\n            'drawclosedpath',\n            'drawopenpath',\n            'drawline',\n            'drawrect',\n            'drawcircle',\n            'orbit',\n            'turntable',\n            false\n        ],\n        dflt: 'zoom',\n        editType: 'modebar',\n        \n    },\n    hovermode: {\n        valType: 'enumerated',\n        \n        values: ['x', 'y', 'closest', false, 'x unified', 'y unified'],\n        editType: 'modebar',\n        \n    },\n    hoverdistance: {\n        valType: 'integer',\n        min: -1,\n        dflt: 20,\n        \n        editType: 'none',\n        \n    },\n    spikedistance: {\n        valType: 'integer',\n        min: -1,\n        dflt: 20,\n        \n        editType: 'none',\n        \n    },\n    hoverlabel: {\n        bgcolor: {\n            valType: 'color',\n            \n            editType: 'none',\n            \n        },\n        bordercolor: {\n            valType: 'color',\n            \n            editType: 'none',\n            \n        },\n        font: fontAttrs,\n        align: {\n            valType: 'enumerated',\n            values: ['left', 'right', 'auto'],\n            dflt: 'auto',\n            \n            editType: 'none',\n            \n        },\n        namelength: {\n            valType: 'integer',\n            min: -1,\n            dflt: 15,\n            \n            editType: 'none',\n            \n        },\n        editType: 'none'\n    },\n    selectdirection: {\n        valType: 'enumerated',\n        \n        values: ['h', 'v', 'd', 'any'],\n        dflt: 'any',\n        \n        editType: 'none'\n    }\n};\n\n},{\"../../plots/font_attributes\":250,\"./constants\":86}],94:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar isUnifiedHover = _dereq_('./helpers').isUnifiedHover;\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar handleHoverModeDefaults = _dereq_('./hovermode_defaults');\nvar handleHoverLabelDefaults = _dereq_('./hoverlabel_defaults');\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n    }\n\n    var hoverMode = handleHoverModeDefaults(layoutIn, layoutOut, fullData);\n    if(hoverMode) {\n        coerce('hoverdistance');\n        coerce('spikedistance', isUnifiedHover(hoverMode) ? -1 : undefined);\n    }\n\n    var dragMode = coerce('dragmode');\n    if(dragMode === 'select') coerce('selectdirection');\n\n    // if only mapbox or geo subplots is present on graph,\n    // reset 'zoom' dragmode to 'pan' until 'zoom' is implemented,\n    // so that the correct modebar button is active\n    var hasMapbox = layoutOut._has('mapbox');\n    var hasGeo = layoutOut._has('geo');\n    var len = layoutOut._basePlotModules.length;\n\n    if(layoutOut.dragmode === 'zoom' && (\n        ((hasMapbox || hasGeo) && len === 1) ||\n        (hasMapbox && hasGeo && len === 2)\n    )) {\n        layoutOut.dragmode = 'pan';\n    }\n\n    handleHoverLabelDefaults(layoutIn, layoutOut, coerce);\n};\n\n},{\"../../lib\":178,\"./helpers\":88,\"./hoverlabel_defaults\":90,\"./hovermode_defaults\":91,\"./layout_attributes\":93}],95:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar handleHoverLabelDefaults = _dereq_('./hoverlabel_defaults');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nmodule.exports = function supplyLayoutGlobalDefaults(layoutIn, layoutOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n    }\n\n    handleHoverLabelDefaults(layoutIn, layoutOut, coerce);\n};\n\n},{\"../../lib\":178,\"./hoverlabel_defaults\":90,\"./layout_attributes\":93}],96:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar counterRegex = _dereq_('../../lib/regex').counter;\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\nvar cartesianIdRegex = _dereq_('../../plots/cartesian/constants').idRegex;\nvar Template = _dereq_('../../plot_api/plot_template');\n\nvar gridAttrs = {\n    rows: {\n        valType: 'integer',\n        min: 1,\n        \n        editType: 'plot',\n        \n    },\n    roworder: {\n        valType: 'enumerated',\n        values: ['top to bottom', 'bottom to top'],\n        dflt: 'top to bottom',\n        \n        editType: 'plot',\n        \n    },\n    columns: {\n        valType: 'integer',\n        min: 1,\n        \n        editType: 'plot',\n        \n    },\n    subplots: {\n        valType: 'info_array',\n        freeLength: true,\n        dimensions: 2,\n        items: {valType: 'enumerated', values: [counterRegex('xy').toString(), ''], editType: 'plot'},\n        \n        editType: 'plot',\n        \n    },\n    xaxes: {\n        valType: 'info_array',\n        freeLength: true,\n        items: {valType: 'enumerated', values: [cartesianIdRegex.x.toString(), ''], editType: 'plot'},\n        \n        editType: 'plot',\n        \n    },\n    yaxes: {\n        valType: 'info_array',\n        freeLength: true,\n        items: {valType: 'enumerated', values: [cartesianIdRegex.y.toString(), ''], editType: 'plot'},\n        \n        editType: 'plot',\n        \n    },\n    pattern: {\n        valType: 'enumerated',\n        values: ['independent', 'coupled'],\n        dflt: 'coupled',\n        \n        editType: 'plot',\n        \n    },\n    xgap: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        \n        editType: 'plot',\n        \n    },\n    ygap: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        \n        editType: 'plot',\n        \n    },\n    domain: domainAttrs({name: 'grid', editType: 'plot', noGridCell: true}, {\n        \n    }),\n    xside: {\n        valType: 'enumerated',\n        values: ['bottom', 'bottom plot', 'top plot', 'top'],\n        dflt: 'bottom plot',\n        \n        editType: 'plot',\n        \n    },\n    yside: {\n        valType: 'enumerated',\n        values: ['left', 'left plot', 'right plot', 'right'],\n        dflt: 'left plot',\n        \n        editType: 'plot',\n        \n    },\n    editType: 'plot'\n};\n\nfunction getAxes(layout, grid, axLetter) {\n    var gridVal = grid[axLetter + 'axes'];\n    var splomVal = Object.keys((layout._splomAxes || {})[axLetter] || {});\n\n    if(Array.isArray(gridVal)) return gridVal;\n    if(splomVal.length) return splomVal;\n}\n\n// the shape of the grid - this needs to be done BEFORE supplyDataDefaults\n// so that non-subplot traces can place themselves in the grid\nfunction sizeDefaults(layoutIn, layoutOut) {\n    var gridIn = layoutIn.grid || {};\n    var xAxes = getAxes(layoutOut, gridIn, 'x');\n    var yAxes = getAxes(layoutOut, gridIn, 'y');\n\n    if(!layoutIn.grid && !xAxes && !yAxes) return;\n\n    var hasSubplotGrid = Array.isArray(gridIn.subplots) && Array.isArray(gridIn.subplots[0]);\n    var hasXaxes = Array.isArray(xAxes);\n    var hasYaxes = Array.isArray(yAxes);\n    var isSplomGenerated = (\n        hasXaxes && xAxes !== gridIn.xaxes &&\n        hasYaxes && yAxes !== gridIn.yaxes\n    );\n\n    var dfltRows, dfltColumns;\n\n    if(hasSubplotGrid) {\n        dfltRows = gridIn.subplots.length;\n        dfltColumns = gridIn.subplots[0].length;\n    } else {\n        if(hasYaxes) dfltRows = yAxes.length;\n        if(hasXaxes) dfltColumns = xAxes.length;\n    }\n\n    var gridOut = Template.newContainer(layoutOut, 'grid');\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(gridIn, gridOut, gridAttrs, attr, dflt);\n    }\n\n    var rows = coerce('rows', dfltRows);\n    var columns = coerce('columns', dfltColumns);\n\n    if(!(rows * columns > 1)) {\n        delete layoutOut.grid;\n        return;\n    }\n\n    if(!hasSubplotGrid && !hasXaxes && !hasYaxes) {\n        var useDefaultSubplots = coerce('pattern') === 'independent';\n        if(useDefaultSubplots) hasSubplotGrid = true;\n    }\n    gridOut._hasSubplotGrid = hasSubplotGrid;\n\n    var rowOrder = coerce('roworder');\n    var reversed = rowOrder === 'top to bottom';\n\n    var dfltGapX = hasSubplotGrid ? 0.2 : 0.1;\n    var dfltGapY = hasSubplotGrid ? 0.3 : 0.1;\n\n    var dfltSideX, dfltSideY;\n    if(isSplomGenerated && layoutOut._splomGridDflt) {\n        dfltSideX = layoutOut._splomGridDflt.xside;\n        dfltSideY = layoutOut._splomGridDflt.yside;\n    }\n\n    gridOut._domains = {\n        x: fillGridPositions('x', coerce, dfltGapX, dfltSideX, columns),\n        y: fillGridPositions('y', coerce, dfltGapY, dfltSideY, rows, reversed)\n    };\n}\n\n// coerce x or y sizing attributes and return an array of domains for this direction\nfunction fillGridPositions(axLetter, coerce, dfltGap, dfltSide, len, reversed) {\n    var dirGap = coerce(axLetter + 'gap', dfltGap);\n    var domain = coerce('domain.' + axLetter);\n    coerce(axLetter + 'side', dfltSide);\n\n    var out = new Array(len);\n    var start = domain[0];\n    var step = (domain[1] - start) / (len - dirGap);\n    var cellDomain = step * (1 - dirGap);\n    for(var i = 0; i < len; i++) {\n        var cellStart = start + step * i;\n        out[reversed ? (len - 1 - i) : i] = [cellStart, cellStart + cellDomain];\n    }\n    return out;\n}\n\n// the (cartesian) contents of the grid - this needs to happen AFTER supplyDataDefaults\n// so that we know what cartesian subplots are available\nfunction contentDefaults(layoutIn, layoutOut) {\n    var gridOut = layoutOut.grid;\n    // make sure we got to the end of handleGridSizing\n    if(!gridOut || !gridOut._domains) return;\n\n    var gridIn = layoutIn.grid || {};\n    var subplots = layoutOut._subplots;\n    var hasSubplotGrid = gridOut._hasSubplotGrid;\n    var rows = gridOut.rows;\n    var columns = gridOut.columns;\n    var useDefaultSubplots = gridOut.pattern === 'independent';\n\n    var i, j, xId, yId, subplotId, subplotsOut, yPos;\n\n    var axisMap = gridOut._axisMap = {};\n\n    if(hasSubplotGrid) {\n        var subplotsIn = gridIn.subplots || [];\n        subplotsOut = gridOut.subplots = new Array(rows);\n        var index = 1;\n\n        for(i = 0; i < rows; i++) {\n            var rowOut = subplotsOut[i] = new Array(columns);\n            var rowIn = subplotsIn[i] || [];\n            for(j = 0; j < columns; j++) {\n                if(useDefaultSubplots) {\n                    subplotId = (index === 1) ? 'xy' : ('x' + index + 'y' + index);\n                    index++;\n                } else subplotId = rowIn[j];\n\n                rowOut[j] = '';\n\n                if(subplots.cartesian.indexOf(subplotId) !== -1) {\n                    yPos = subplotId.indexOf('y');\n                    xId = subplotId.slice(0, yPos);\n                    yId = subplotId.slice(yPos);\n                    if((axisMap[xId] !== undefined && axisMap[xId] !== j) ||\n                        (axisMap[yId] !== undefined && axisMap[yId] !== i)\n                    ) {\n                        continue;\n                    }\n\n                    rowOut[j] = subplotId;\n                    axisMap[xId] = j;\n                    axisMap[yId] = i;\n                }\n            }\n        }\n    } else {\n        var xAxes = getAxes(layoutOut, gridIn, 'x');\n        var yAxes = getAxes(layoutOut, gridIn, 'y');\n        gridOut.xaxes = fillGridAxes(xAxes, subplots.xaxis, columns, axisMap, 'x');\n        gridOut.yaxes = fillGridAxes(yAxes, subplots.yaxis, rows, axisMap, 'y');\n    }\n\n    var anchors = gridOut._anchors = {};\n    var reversed = gridOut.roworder === 'top to bottom';\n\n    for(var axisId in axisMap) {\n        var axLetter = axisId.charAt(0);\n        var side = gridOut[axLetter + 'side'];\n\n        var i0, inc, iFinal;\n\n        if(side.length < 8) {\n            // grid edge -  ie not \"* plot\" - make these as free axes\n            // since we're not guaranteed to have a subplot there at all\n            anchors[axisId] = 'free';\n        } else if(axLetter === 'x') {\n            if((side.charAt(0) === 't') === reversed) {\n                i0 = 0;\n                inc = 1;\n                iFinal = rows;\n            } else {\n                i0 = rows - 1;\n                inc = -1;\n                iFinal = -1;\n            }\n            if(hasSubplotGrid) {\n                var column = axisMap[axisId];\n                for(i = i0; i !== iFinal; i += inc) {\n                    subplotId = subplotsOut[i][column];\n                    if(!subplotId) continue;\n                    yPos = subplotId.indexOf('y');\n                    if(subplotId.slice(0, yPos) === axisId) {\n                        anchors[axisId] = subplotId.slice(yPos);\n                        break;\n                    }\n                }\n            } else {\n                for(i = i0; i !== iFinal; i += inc) {\n                    yId = gridOut.yaxes[i];\n                    if(subplots.cartesian.indexOf(axisId + yId) !== -1) {\n                        anchors[axisId] = yId;\n                        break;\n                    }\n                }\n            }\n        } else {\n            if((side.charAt(0) === 'l')) {\n                i0 = 0;\n                inc = 1;\n                iFinal = columns;\n            } else {\n                i0 = columns - 1;\n                inc = -1;\n                iFinal = -1;\n            }\n            if(hasSubplotGrid) {\n                var row = axisMap[axisId];\n                for(i = i0; i !== iFinal; i += inc) {\n                    subplotId = subplotsOut[row][i];\n                    if(!subplotId) continue;\n                    yPos = subplotId.indexOf('y');\n                    if(subplotId.slice(yPos) === axisId) {\n                        anchors[axisId] = subplotId.slice(0, yPos);\n                        break;\n                    }\n                }\n            } else {\n                for(i = i0; i !== iFinal; i += inc) {\n                    xId = gridOut.xaxes[i];\n                    if(subplots.cartesian.indexOf(xId + axisId) !== -1) {\n                        anchors[axisId] = xId;\n                        break;\n                    }\n                }\n            }\n        }\n    }\n}\n\nfunction fillGridAxes(axesIn, axesAllowed, len, axisMap, axLetter) {\n    var out = new Array(len);\n    var i;\n\n    function fillOneAxis(i, axisId) {\n        if(axesAllowed.indexOf(axisId) !== -1 && axisMap[axisId] === undefined) {\n            out[i] = axisId;\n            axisMap[axisId] = i;\n        } else out[i] = '';\n    }\n\n    if(Array.isArray(axesIn)) {\n        for(i = 0; i < len; i++) {\n            fillOneAxis(i, axesIn[i]);\n        }\n    } else {\n        // default axis list is the first `len` axis ids\n        fillOneAxis(0, axLetter);\n        for(i = 1; i < len; i++) {\n            fillOneAxis(i, axLetter + (i + 1));\n        }\n    }\n\n    return out;\n}\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'grid',\n\n    schema: {\n        layout: {grid: gridAttrs}\n    },\n\n    layoutAttributes: gridAttrs,\n    sizeDefaults: sizeDefaults,\n    contentDefaults: contentDefaults\n};\n\n},{\"../../lib\":178,\"../../lib/regex\":193,\"../../plot_api/plot_template\":212,\"../../plots/cartesian/constants\":228,\"../../plots/domain\":249}],97:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar cartesianConstants = _dereq_('../../plots/cartesian/constants');\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\n\nmodule.exports = templatedArray('image', {\n    visible: {\n        valType: 'boolean',\n        \n        dflt: true,\n        editType: 'arraydraw',\n        \n    },\n\n    source: {\n        valType: 'string',\n        \n        editType: 'arraydraw',\n        \n    },\n\n    layer: {\n        valType: 'enumerated',\n        values: ['below', 'above'],\n        dflt: 'above',\n        \n        editType: 'arraydraw',\n        \n    },\n\n    sizex: {\n        valType: 'number',\n        \n        dflt: 0,\n        editType: 'arraydraw',\n        \n    },\n\n    sizey: {\n        valType: 'number',\n        \n        dflt: 0,\n        editType: 'arraydraw',\n        \n    },\n\n    sizing: {\n        valType: 'enumerated',\n        values: ['fill', 'contain', 'stretch'],\n        dflt: 'contain',\n        \n        editType: 'arraydraw',\n        \n    },\n\n    opacity: {\n        valType: 'number',\n        \n        min: 0,\n        max: 1,\n        dflt: 1,\n        editType: 'arraydraw',\n        \n    },\n\n    x: {\n        valType: 'any',\n        \n        dflt: 0,\n        editType: 'arraydraw',\n        \n    },\n\n    y: {\n        valType: 'any',\n        \n        dflt: 0,\n        editType: 'arraydraw',\n        \n    },\n\n    xanchor: {\n        valType: 'enumerated',\n        values: ['left', 'center', 'right'],\n        dflt: 'left',\n        \n        editType: 'arraydraw',\n        \n    },\n\n    yanchor: {\n        valType: 'enumerated',\n        values: ['top', 'middle', 'bottom'],\n        dflt: 'top',\n        \n        editType: 'arraydraw',\n        \n    },\n\n    xref: {\n        valType: 'enumerated',\n        values: [\n            'paper',\n            cartesianConstants.idRegex.x.toString()\n        ],\n        dflt: 'paper',\n        \n        editType: 'arraydraw',\n        \n    },\n\n    yref: {\n        valType: 'enumerated',\n        values: [\n            'paper',\n            cartesianConstants.idRegex.y.toString()\n        ],\n        dflt: 'paper',\n        \n        editType: 'arraydraw',\n        \n    },\n    editType: 'arraydraw'\n});\n\n},{\"../../plot_api/plot_template\":212,\"../../plots/cartesian/constants\":228}],98:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar toLogRange = _dereq_('../../lib/to_log_range');\n\n/*\n * convertCoords: when converting an axis between log and linear\n * you need to alter any images on that axis to keep them\n * pointing at the same data point.\n * In v2.0 this will become obsolete (or perhaps size will still need conversion?)\n * we convert size by declaring that the maximum extent *in data units* should be\n * the same, assuming the image is anchored by its center (could remove that restriction\n * if we think it's important) even though the actual left and right values will not be\n * quite the same since the scale becomes nonlinear (and central anchor means the pixel\n * center of the image, not the data units center)\n *\n * gd: the plot div\n * ax: the axis being changed\n * newType: the type it's getting\n * doExtra: function(attr, val) from inside relayout that sets the attribute.\n *     Use this to make the changes as it's aware if any other changes in the\n *     same relayout call should override this conversion.\n */\nmodule.exports = function convertCoords(gd, ax, newType, doExtra) {\n    ax = ax || {};\n\n    var toLog = (newType === 'log') && (ax.type === 'linear');\n    var fromLog = (newType === 'linear') && (ax.type === 'log');\n\n    if(!(toLog || fromLog)) return;\n\n    var images = gd._fullLayout.images;\n    var axLetter = ax._id.charAt(0);\n    var image;\n    var attrPrefix;\n\n    for(var i = 0; i < images.length; i++) {\n        image = images[i];\n        attrPrefix = 'images[' + i + '].';\n\n        if(image[axLetter + 'ref'] === ax._id) {\n            var currentPos = image[axLetter];\n            var currentSize = image['size' + axLetter];\n            var newPos = null;\n            var newSize = null;\n\n            if(toLog) {\n                newPos = toLogRange(currentPos, ax.range);\n\n                // this is the inverse of the conversion we do in fromLog below\n                // so that the conversion is reversible (notice the fromLog conversion\n                // is like sinh, and this one looks like arcsinh)\n                var dx = currentSize / Math.pow(10, newPos) / 2;\n                newSize = 2 * Math.log(dx + Math.sqrt(1 + dx * dx)) / Math.LN10;\n            } else {\n                newPos = Math.pow(10, currentPos);\n                newSize = newPos * (Math.pow(10, currentSize / 2) - Math.pow(10, -currentSize / 2));\n            }\n\n            // if conversion failed, delete the value so it can get a default later on\n            if(!isNumeric(newPos)) {\n                newPos = null;\n                newSize = null;\n            } else if(!isNumeric(newSize)) newSize = null;\n\n            doExtra(attrPrefix + axLetter, newPos);\n            doExtra(attrPrefix + 'size' + axLetter, newSize);\n        }\n    }\n};\n\n},{\"../../lib/to_log_range\":201,\"fast-isnumeric\":18}],99:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\n\nvar attributes = _dereq_('./attributes');\nvar name = 'images';\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n    var opts = {\n        name: name,\n        handleItemDefaults: imageDefaults\n    };\n\n    handleArrayContainerDefaults(layoutIn, layoutOut, opts);\n};\n\n\nfunction imageDefaults(imageIn, imageOut, fullLayout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(imageIn, imageOut, attributes, attr, dflt);\n    }\n\n    var source = coerce('source');\n    var visible = coerce('visible', !!source);\n\n    if(!visible) return imageOut;\n\n    coerce('layer');\n    coerce('xanchor');\n    coerce('yanchor');\n    coerce('sizex');\n    coerce('sizey');\n    coerce('sizing');\n    coerce('opacity');\n\n    var gdMock = { _fullLayout: fullLayout };\n    var axLetters = ['x', 'y'];\n\n    for(var i = 0; i < 2; i++) {\n        // 'paper' is the fallback axref\n        var axLetter = axLetters[i];\n        var axRef = Axes.coerceRef(imageIn, imageOut, gdMock, axLetter, 'paper');\n\n        if(axRef !== 'paper') {\n            var ax = Axes.getFromId(gdMock, axRef);\n            ax._imgIndices.push(imageOut._index);\n        }\n\n        Axes.coercePosition(imageOut, gdMock, coerce, axRef, axLetter, 0);\n    }\n\n    return imageOut;\n}\n\n},{\"../../lib\":178,\"../../plots/array_container_defaults\":218,\"../../plots/cartesian/axes\":222,\"./attributes\":97}],100:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Drawing = _dereq_('../drawing');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\n\nmodule.exports = function draw(gd) {\n    var fullLayout = gd._fullLayout;\n    var imageDataAbove = [];\n    var imageDataSubplot = {};\n    var imageDataBelow = [];\n    var subplot;\n    var i;\n\n    // Sort into top, subplot, and bottom layers\n    for(i = 0; i < fullLayout.images.length; i++) {\n        var img = fullLayout.images[i];\n\n        if(img.visible) {\n            if(img.layer === 'below' && img.xref !== 'paper' && img.yref !== 'paper') {\n                subplot = img.xref + img.yref;\n\n                var plotinfo = fullLayout._plots[subplot];\n\n                if(!plotinfo) {\n                    // Fall back to _imageLowerLayer in case the requested subplot doesn't exist.\n                    // This can happen if you reference the image to an x / y axis combination\n                    // that doesn't have any data on it (and layer is below)\n                    imageDataBelow.push(img);\n                    continue;\n                }\n\n                if(plotinfo.mainplot) {\n                    subplot = plotinfo.mainplot.id;\n                }\n\n                if(!imageDataSubplot[subplot]) {\n                    imageDataSubplot[subplot] = [];\n                }\n                imageDataSubplot[subplot].push(img);\n            } else if(img.layer === 'above') {\n                imageDataAbove.push(img);\n            } else {\n                imageDataBelow.push(img);\n            }\n        }\n    }\n\n\n    var anchors = {\n        x: {\n            left: { sizing: 'xMin', offset: 0 },\n            center: { sizing: 'xMid', offset: -1 / 2 },\n            right: { sizing: 'xMax', offset: -1 }\n        },\n        y: {\n            top: { sizing: 'YMin', offset: 0 },\n            middle: { sizing: 'YMid', offset: -1 / 2 },\n            bottom: { sizing: 'YMax', offset: -1 }\n        }\n    };\n\n\n    // Images must be converted to dataURL's for exporting.\n    function setImage(d) {\n        var thisImage = d3.select(this);\n\n        if(this._imgSrc === d.source) {\n            return;\n        }\n\n        thisImage.attr('xmlns', xmlnsNamespaces.svg);\n\n        if(d.source && d.source.slice(0, 5) === 'data:') {\n            thisImage.attr('xlink:href', d.source);\n            this._imgSrc = d.source;\n        } else {\n            var imagePromise = new Promise(function(resolve) {\n                var img = new Image();\n                this.img = img;\n\n                // If not set, a `tainted canvas` error is thrown\n                img.setAttribute('crossOrigin', 'anonymous');\n                img.onerror = errorHandler;\n                img.onload = function() {\n                    var canvas = document.createElement('canvas');\n                    canvas.width = this.width;\n                    canvas.height = this.height;\n\n                    var ctx = canvas.getContext('2d');\n                    ctx.drawImage(this, 0, 0);\n\n                    var dataURL = canvas.toDataURL('image/png');\n\n                    thisImage.attr('xlink:href', dataURL);\n\n                    // resolve promise in onload handler instead of on 'load' to support IE11\n                    // see https://github.com/plotly/plotly.js/issues/1685\n                    // for more details\n                    resolve();\n                };\n\n                thisImage.on('error', errorHandler);\n\n                img.src = d.source;\n                this._imgSrc = d.source;\n\n                function errorHandler() {\n                    thisImage.remove();\n                    resolve();\n                }\n            }.bind(this));\n\n            gd._promises.push(imagePromise);\n        }\n    }\n\n    function applyAttributes(d) {\n        var thisImage = d3.select(this);\n\n        // Axes if specified\n        var xa = Axes.getFromId(gd, d.xref);\n        var ya = Axes.getFromId(gd, d.yref);\n\n        var size = fullLayout._size;\n        var width = xa ? Math.abs(xa.l2p(d.sizex) - xa.l2p(0)) : d.sizex * size.w;\n        var height = ya ? Math.abs(ya.l2p(d.sizey) - ya.l2p(0)) : d.sizey * size.h;\n\n        // Offsets for anchor positioning\n        var xOffset = width * anchors.x[d.xanchor].offset;\n        var yOffset = height * anchors.y[d.yanchor].offset;\n\n        var sizing = anchors.x[d.xanchor].sizing + anchors.y[d.yanchor].sizing;\n\n        // Final positions\n        var xPos = (xa ? xa.r2p(d.x) + xa._offset : d.x * size.w + size.l) + xOffset;\n        var yPos = (ya ? ya.r2p(d.y) + ya._offset : size.h - d.y * size.h + size.t) + yOffset;\n\n        // Construct the proper aspectRatio attribute\n        switch(d.sizing) {\n            case 'fill':\n                sizing += ' slice';\n                break;\n\n            case 'stretch':\n                sizing = 'none';\n                break;\n        }\n\n        thisImage.attr({\n            x: xPos,\n            y: yPos,\n            width: width,\n            height: height,\n            preserveAspectRatio: sizing,\n            opacity: d.opacity\n        });\n\n\n        // Set proper clipping on images\n        var xId = xa ? xa._id : '';\n        var yId = ya ? ya._id : '';\n        var clipAxes = xId + yId;\n\n        Drawing.setClipUrl(\n            thisImage,\n            clipAxes ? ('clip' + fullLayout._uid + clipAxes) : null,\n            gd\n        );\n    }\n\n    var imagesBelow = fullLayout._imageLowerLayer.selectAll('image')\n        .data(imageDataBelow);\n    var imagesAbove = fullLayout._imageUpperLayer.selectAll('image')\n        .data(imageDataAbove);\n\n    imagesBelow.enter().append('image');\n    imagesAbove.enter().append('image');\n\n    imagesBelow.exit().remove();\n    imagesAbove.exit().remove();\n\n    imagesBelow.each(function(d) {\n        setImage.bind(this)(d);\n        applyAttributes.bind(this)(d);\n    });\n    imagesAbove.each(function(d) {\n        setImage.bind(this)(d);\n        applyAttributes.bind(this)(d);\n    });\n\n    var allSubplots = Object.keys(fullLayout._plots);\n    for(i = 0; i < allSubplots.length; i++) {\n        subplot = allSubplots[i];\n        var subplotObj = fullLayout._plots[subplot];\n\n        // filter out overlaid plots (which havd their images on the main plot)\n        // and gl2d plots (which don't support below images, at least not yet)\n        if(!subplotObj.imagelayer) continue;\n\n        var imagesOnSubplot = subplotObj.imagelayer.selectAll('image')\n            // even if there are no images on this subplot, we need to run\n            // enter and exit in case there were previously\n            .data(imageDataSubplot[subplot] || []);\n\n        imagesOnSubplot.enter().append('image');\n        imagesOnSubplot.exit().remove();\n\n        imagesOnSubplot.each(function(d) {\n            setImage.bind(this)(d);\n            applyAttributes.bind(this)(d);\n        });\n    }\n};\n\n},{\"../../constants/xmlns_namespaces\":159,\"../../plots/cartesian/axes\":222,\"../drawing\":74,\"d3\":16}],101:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'images',\n\n    layoutAttributes: _dereq_('./attributes'),\n    supplyLayoutDefaults: _dereq_('./defaults'),\n    includeBasePlot: _dereq_('../../plots/cartesian/include_components')('images'),\n\n    draw: _dereq_('./draw'),\n\n    convertCoords: _dereq_('./convert_coords')\n};\n\n},{\"../../plots/cartesian/include_components\":234,\"./attributes\":97,\"./convert_coords\":98,\"./defaults\":99,\"./draw\":100}],102:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar colorAttrs = _dereq_('../color/attributes');\n\n\nmodule.exports = {\n    bgcolor: {\n        valType: 'color',\n        \n        editType: 'legend',\n        \n    },\n    bordercolor: {\n        valType: 'color',\n        dflt: colorAttrs.defaultLine,\n        \n        editType: 'legend',\n        \n    },\n    borderwidth: {\n        valType: 'number',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'legend',\n        \n    },\n    font: fontAttrs({\n        editType: 'legend',\n        \n    }),\n    orientation: {\n        valType: 'enumerated',\n        values: ['v', 'h'],\n        dflt: 'v',\n        \n        editType: 'legend',\n        \n    },\n    traceorder: {\n        valType: 'flaglist',\n        flags: ['reversed', 'grouped'],\n        extras: ['normal'],\n        \n        editType: 'legend',\n        \n    },\n    tracegroupgap: {\n        valType: 'number',\n        min: 0,\n        dflt: 10,\n        \n        editType: 'legend',\n        \n    },\n    itemsizing: {\n        valType: 'enumerated',\n        values: ['trace', 'constant'],\n        dflt: 'trace',\n        \n        editType: 'legend',\n        \n    },\n\n    itemclick: {\n        valType: 'enumerated',\n        values: ['toggle', 'toggleothers', false],\n        dflt: 'toggle',\n        \n        editType: 'legend',\n        \n    },\n    itemdoubleclick: {\n        valType: 'enumerated',\n        values: ['toggle', 'toggleothers', false],\n        dflt: 'toggleothers',\n        \n        editType: 'legend',\n        \n    },\n\n    x: {\n        valType: 'number',\n        min: -2,\n        max: 3,\n        \n        editType: 'legend',\n        \n    },\n    xanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'left', 'center', 'right'],\n        dflt: 'left',\n        \n        editType: 'legend',\n        \n    },\n    y: {\n        valType: 'number',\n        min: -2,\n        max: 3,\n        \n        editType: 'legend',\n        \n    },\n    yanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'top', 'middle', 'bottom'],\n        \n        editType: 'legend',\n        \n    },\n    uirevision: {\n        valType: 'any',\n        \n        editType: 'none',\n        \n    },\n    valign: {\n        valType: 'enumerated',\n        values: ['top', 'middle', 'bottom'],\n        dflt: 'middle',\n        \n        editType: 'legend',\n        \n    },\n    title: {\n        text: {\n            valType: 'string',\n            dflt: '',\n            \n            editType: 'legend',\n            \n        },\n        font: fontAttrs({\n            editType: 'legend',\n            \n        }),\n        side: {\n            valType: 'enumerated',\n            values: ['top', 'left', 'top left'],\n            \n            editType: 'legend',\n            \n        },\n        editType: 'legend',\n    },\n\n    editType: 'legend'\n};\n\n},{\"../../plots/font_attributes\":250,\"../color/attributes\":51}],103:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    scrollBarWidth: 6,\n    scrollBarMinHeight: 20,\n    scrollBarColor: '#808BA4',\n    scrollBarMargin: 4,\n    scrollBarEnterAttrs: {rx: 20, ry: 3, width: 0, height: 0},\n\n    // number of px between legend title and (left) side of legend (always in x direction and from inner border)\n    titlePad: 2,\n    // number of px between legend symbol and legend text (always in x direction)\n    textGap: 40,\n    // number of px between each legend item (x and/or y direction)\n    itemGap: 5\n};\n\n},{}],104:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Template = _dereq_('../../plot_api/plot_template');\n\nvar attributes = _dereq_('./attributes');\nvar basePlotLayoutAttributes = _dereq_('../../plots/layout_attributes');\nvar helpers = _dereq_('./helpers');\n\n\nmodule.exports = function legendDefaults(layoutIn, layoutOut, fullData) {\n    var containerIn = layoutIn.legend || {};\n\n    var legendTraceCount = 0;\n    var legendReallyHasATrace = false;\n    var defaultOrder = 'normal';\n\n    for(var i = 0; i < fullData.length; i++) {\n        var trace = fullData[i];\n\n        if(!trace.visible) continue;\n\n        // Note that we explicitly count any trace that is either shown or\n        // *would* be shown by default, toward the two traces you need to\n        // ensure the legend is shown by default, because this can still help\n        // disambiguate.\n        if(trace.showlegend || (\n            trace._dfltShowLegend && !(\n                trace._module &&\n                trace._module.attributes &&\n                trace._module.attributes.showlegend &&\n                trace._module.attributes.showlegend.dflt === false\n            )\n        )) {\n            legendTraceCount++;\n            if(trace.showlegend) {\n                legendReallyHasATrace = true;\n                // Always show the legend by default if there's a pie,\n                // or if there's only one trace but it's explicitly shown\n                if(Registry.traceIs(trace, 'pie-like') ||\n                    trace._input.showlegend === true\n                ) {\n                    legendTraceCount++;\n                }\n            }\n        }\n\n        if((Registry.traceIs(trace, 'bar') && layoutOut.barmode === 'stack') ||\n                ['tonextx', 'tonexty'].indexOf(trace.fill) !== -1) {\n            defaultOrder = helpers.isGrouped({traceorder: defaultOrder}) ?\n                'grouped+reversed' : 'reversed';\n        }\n\n        if(trace.legendgroup !== undefined && trace.legendgroup !== '') {\n            defaultOrder = helpers.isReversed({traceorder: defaultOrder}) ?\n                'reversed+grouped' : 'grouped';\n        }\n    }\n\n    var showLegend = Lib.coerce(layoutIn, layoutOut,\n        basePlotLayoutAttributes, 'showlegend',\n        legendReallyHasATrace && legendTraceCount > 1);\n\n    if(showLegend === false && !containerIn.uirevision) return;\n\n    var containerOut = Template.newContainer(layoutOut, 'legend');\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);\n    }\n\n    coerce('uirevision', layoutOut.uirevision);\n\n    if(showLegend === false) return;\n\n    coerce('bgcolor', layoutOut.paper_bgcolor);\n    coerce('bordercolor');\n    coerce('borderwidth');\n    Lib.coerceFont(coerce, 'font', layoutOut.font);\n\n    var orientation = coerce('orientation');\n    var defaultX, defaultY, defaultYAnchor;\n\n    if(orientation === 'h') {\n        defaultX = 0;\n\n        if(Registry.getComponentMethod('rangeslider', 'isVisible')(layoutIn.xaxis)) {\n            defaultY = 1.1;\n            defaultYAnchor = 'bottom';\n        } else {\n            // maybe use y=1.1 / yanchor=bottom as above\n            //   to avoid https://github.com/plotly/plotly.js/issues/1199\n            //   in v2\n            defaultY = -0.1;\n            defaultYAnchor = 'top';\n        }\n    } else {\n        defaultX = 1.02;\n        defaultY = 1;\n        defaultYAnchor = 'auto';\n    }\n\n    coerce('traceorder', defaultOrder);\n    if(helpers.isGrouped(layoutOut.legend)) coerce('tracegroupgap');\n\n    coerce('itemsizing');\n\n    coerce('itemclick');\n    coerce('itemdoubleclick');\n\n    coerce('x', defaultX);\n    coerce('xanchor');\n    coerce('y', defaultY);\n    coerce('yanchor', defaultYAnchor);\n    coerce('valign');\n    Lib.noneOrAll(containerIn, containerOut, ['x', 'y']);\n\n    var titleText = coerce('title.text');\n    if(titleText) {\n        coerce('title.side', orientation === 'h' ? 'left' : 'top');\n        Lib.coerceFont(coerce, 'title.font', layoutOut.font);\n    }\n};\n\n},{\"../../lib\":178,\"../../plot_api/plot_template\":212,\"../../plots/layout_attributes\":254,\"../../registry\":269,\"./attributes\":102,\"./helpers\":108}],105:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\nvar Plots = _dereq_('../../plots/plots');\nvar Registry = _dereq_('../../registry');\nvar Events = _dereq_('../../lib/events');\nvar dragElement = _dereq_('../dragelement');\nvar Drawing = _dereq_('../drawing');\nvar Color = _dereq_('../color');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar handleClick = _dereq_('./handle_click');\n\nvar constants = _dereq_('./constants');\nvar alignmentConstants = _dereq_('../../constants/alignment');\nvar LINE_SPACING = alignmentConstants.LINE_SPACING;\nvar FROM_TL = alignmentConstants.FROM_TL;\nvar FROM_BR = alignmentConstants.FROM_BR;\n\nvar getLegendData = _dereq_('./get_legend_data');\nvar style = _dereq_('./style');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = function draw(gd, opts) {\n    var fullLayout = gd._fullLayout;\n    var clipId = 'legend' + fullLayout._uid;\n    var layer;\n\n    // Check whether this is the main legend (ie. called without any opts)\n    if(!opts) {\n        opts = fullLayout.legend || {};\n        opts._main = true;\n        layer = fullLayout._infolayer;\n    } else {\n        layer = opts.layer;\n        clipId += '-hover';\n    }\n\n    if(!layer) return;\n\n    if(!gd._legendMouseDownTime) gd._legendMouseDownTime = 0;\n\n    var legendData;\n    if(opts._main) {\n        if(!gd.calcdata) return;\n        legendData = fullLayout.showlegend && getLegendData(gd.calcdata, opts);\n    } else {\n        if(!opts.entries) return;\n        legendData = getLegendData(opts.entries, opts);\n    }\n\n    var hiddenSlices = fullLayout.hiddenlabels || [];\n\n    if(opts._main && (!fullLayout.showlegend || !legendData.length)) {\n        layer.selectAll('.legend').remove();\n        fullLayout._topdefs.select('#' + clipId).remove();\n        return Plots.autoMargin(gd, 'legend');\n    }\n\n    var legend = Lib.ensureSingle(layer, 'g', 'legend', function(s) {\n        if(opts._main) s.attr('pointer-events', 'all');\n    });\n\n    var clipPath = Lib.ensureSingleById(fullLayout._topdefs, 'clipPath', clipId, function(s) {\n        s.append('rect');\n    });\n\n    var bg = Lib.ensureSingle(legend, 'rect', 'bg', function(s) {\n        s.attr('shape-rendering', 'crispEdges');\n    });\n    bg.call(Color.stroke, opts.bordercolor)\n        .call(Color.fill, opts.bgcolor)\n        .style('stroke-width', opts.borderwidth + 'px');\n\n    var scrollBox = Lib.ensureSingle(legend, 'g', 'scrollbox');\n\n    var title = opts.title;\n    opts._titleWidth = 0;\n    opts._titleHeight = 0;\n    if(title.text) {\n        var titleEl = Lib.ensureSingle(scrollBox, 'text', 'legendtitletext');\n        titleEl.attr('text-anchor', 'start')\n            .classed('user-select-none', true)\n            .call(Drawing.font, title.font)\n            .text(title.text);\n\n        textLayout(titleEl, scrollBox, gd, opts); // handle mathjax or multi-line text and compute title height\n    } else {\n        scrollBox.selectAll('.legendtitletext').remove();\n    }\n\n    var scrollBar = Lib.ensureSingle(legend, 'rect', 'scrollbar', function(s) {\n        s.attr(constants.scrollBarEnterAttrs)\n         .call(Color.fill, constants.scrollBarColor);\n    });\n\n    var groups = scrollBox.selectAll('g.groups').data(legendData);\n    groups.enter().append('g').attr('class', 'groups');\n    groups.exit().remove();\n\n    var traces = groups.selectAll('g.traces').data(Lib.identity);\n    traces.enter().append('g').attr('class', 'traces');\n    traces.exit().remove();\n\n    traces.style('opacity', function(d) {\n        var trace = d[0].trace;\n        if(Registry.traceIs(trace, 'pie-like')) {\n            return hiddenSlices.indexOf(d[0].label) !== -1 ? 0.5 : 1;\n        } else {\n            return trace.visible === 'legendonly' ? 0.5 : 1;\n        }\n    })\n    .each(function() { d3.select(this).call(drawTexts, gd, opts); })\n    .call(style, gd, opts)\n    .each(function() { if(opts._main) d3.select(this).call(setupTraceToggle, gd); });\n\n    Lib.syncOrAsync([\n        Plots.previousPromises,\n        function() { return computeLegendDimensions(gd, groups, traces, opts); },\n        function() {\n            // IF expandMargin return a Promise (which is truthy),\n            // we're under a doAutoMargin redraw, so we don't have to\n            // draw the remaining pieces below\n            if(opts._main && expandMargin(gd)) return;\n\n            var gs = fullLayout._size;\n            var bw = opts.borderwidth;\n\n            var lx = gs.l + gs.w * opts.x - FROM_TL[getXanchor(opts)] * opts._width;\n            var ly = gs.t + gs.h * (1 - opts.y) - FROM_TL[getYanchor(opts)] * opts._effHeight;\n\n            if(opts._main && fullLayout.margin.autoexpand) {\n                var lx0 = lx;\n                var ly0 = ly;\n\n                lx = Lib.constrain(lx, 0, fullLayout.width - opts._width);\n                ly = Lib.constrain(ly, 0, fullLayout.height - opts._effHeight);\n\n                if(lx !== lx0) {\n                    Lib.log('Constrain legend.x to make legend fit inside graph');\n                }\n                if(ly !== ly0) {\n                    Lib.log('Constrain legend.y to make legend fit inside graph');\n                }\n            }\n\n            // Set size and position of all the elements that make up a legend:\n            // legend, background and border, scroll box and scroll bar as well as title\n            if(opts._main) Drawing.setTranslate(legend, lx, ly);\n\n            // to be safe, remove previous listeners\n            scrollBar.on('.drag', null);\n            legend.on('wheel', null);\n\n            if(!opts._main || opts._height <= opts._maxHeight || gd._context.staticPlot) {\n                // if scrollbar should not be shown.\n                var height = opts._effHeight;\n\n                // if not the main legend, let it be its full size\n                if(!opts._main) height = opts._height;\n\n                bg.attr({\n                    width: opts._width - bw,\n                    height: height - bw,\n                    x: bw / 2,\n                    y: bw / 2\n                });\n\n                Drawing.setTranslate(scrollBox, 0, 0);\n\n                clipPath.select('rect').attr({\n                    width: opts._width - 2 * bw,\n                    height: height - 2 * bw,\n                    x: bw,\n                    y: bw\n                });\n\n                Drawing.setClipUrl(scrollBox, clipId, gd);\n\n                Drawing.setRect(scrollBar, 0, 0, 0, 0);\n                delete opts._scrollY;\n            } else {\n                var scrollBarHeight = Math.max(constants.scrollBarMinHeight,\n                    opts._effHeight * opts._effHeight / opts._height);\n                var scrollBarYMax = opts._effHeight -\n                    scrollBarHeight -\n                    2 * constants.scrollBarMargin;\n                var scrollBoxYMax = opts._height - opts._effHeight;\n                var scrollRatio = scrollBarYMax / scrollBoxYMax;\n\n                var scrollBoxY = Math.min(opts._scrollY || 0, scrollBoxYMax);\n\n                // increase the background and clip-path width\n                // by the scrollbar width and margin\n                bg.attr({\n                    width: opts._width -\n                        2 * bw +\n                        constants.scrollBarWidth +\n                        constants.scrollBarMargin,\n                    height: opts._effHeight - bw,\n                    x: bw / 2,\n                    y: bw / 2\n                });\n\n                clipPath.select('rect').attr({\n                    width: opts._width -\n                        2 * bw +\n                        constants.scrollBarWidth +\n                        constants.scrollBarMargin,\n                    height: opts._effHeight - 2 * bw,\n                    x: bw,\n                    y: bw + scrollBoxY\n                });\n\n                Drawing.setClipUrl(scrollBox, clipId, gd);\n\n                scrollHandler(scrollBoxY, scrollBarHeight, scrollRatio);\n\n                // scroll legend by mousewheel or touchpad swipe up/down\n                legend.on('wheel', function() {\n                    scrollBoxY = Lib.constrain(\n                        opts._scrollY +\n                            ((d3.event.deltaY / scrollBarYMax) * scrollBoxYMax),\n                        0, scrollBoxYMax);\n                    scrollHandler(scrollBoxY, scrollBarHeight, scrollRatio);\n                    if(scrollBoxY !== 0 && scrollBoxY !== scrollBoxYMax) {\n                        d3.event.preventDefault();\n                    }\n                });\n\n                var eventY0, eventY1, scrollBoxY0;\n\n                var getScrollBarDragY = function(scrollBoxY0, eventY0, eventY1) {\n                    var y = ((eventY1 - eventY0) / scrollRatio) + scrollBoxY0;\n                    return Lib.constrain(y, 0, scrollBoxYMax);\n                };\n\n                var getNaturalDragY = function(scrollBoxY0, eventY0, eventY1) {\n                    var y = ((eventY0 - eventY1) / scrollRatio) + scrollBoxY0;\n                    return Lib.constrain(y, 0, scrollBoxYMax);\n                };\n\n                // scroll legend by dragging scrollBAR\n                var scrollBarDrag = d3.behavior.drag()\n                .on('dragstart', function() {\n                    var e = d3.event.sourceEvent;\n                    if(e.type === 'touchstart') {\n                        eventY0 = e.changedTouches[0].clientY;\n                    } else {\n                        eventY0 = e.clientY;\n                    }\n                    scrollBoxY0 = scrollBoxY;\n                })\n                .on('drag', function() {\n                    var e = d3.event.sourceEvent;\n                    if(e.buttons === 2 || e.ctrlKey) return;\n                    if(e.type === 'touchmove') {\n                        eventY1 = e.changedTouches[0].clientY;\n                    } else {\n                        eventY1 = e.clientY;\n                    }\n                    scrollBoxY = getScrollBarDragY(scrollBoxY0, eventY0, eventY1);\n                    scrollHandler(scrollBoxY, scrollBarHeight, scrollRatio);\n                });\n                scrollBar.call(scrollBarDrag);\n\n                // scroll legend by touch-dragging scrollBOX\n                var scrollBoxTouchDrag = d3.behavior.drag()\n                .on('dragstart', function() {\n                    var e = d3.event.sourceEvent;\n                    if(e.type === 'touchstart') {\n                        eventY0 = e.changedTouches[0].clientY;\n                        scrollBoxY0 = scrollBoxY;\n                    }\n                })\n                .on('drag', function() {\n                    var e = d3.event.sourceEvent;\n                    if(e.type === 'touchmove') {\n                        eventY1 = e.changedTouches[0].clientY;\n                        scrollBoxY = getNaturalDragY(scrollBoxY0, eventY0, eventY1);\n                        scrollHandler(scrollBoxY, scrollBarHeight, scrollRatio);\n                    }\n                });\n                scrollBox.call(scrollBoxTouchDrag);\n            }\n\n            function scrollHandler(scrollBoxY, scrollBarHeight, scrollRatio) {\n                opts._scrollY = gd._fullLayout.legend._scrollY = scrollBoxY;\n                Drawing.setTranslate(scrollBox, 0, -scrollBoxY);\n\n                Drawing.setRect(\n                    scrollBar,\n                    opts._width,\n                    constants.scrollBarMargin + scrollBoxY * scrollRatio,\n                    constants.scrollBarWidth,\n                    scrollBarHeight\n                );\n                clipPath.select('rect').attr('y', bw + scrollBoxY);\n            }\n\n            if(gd._context.edits.legendPosition) {\n                var xf, yf, x0, y0;\n\n                legend.classed('cursor-move', true);\n\n                dragElement.init({\n                    element: legend.node(),\n                    gd: gd,\n                    prepFn: function() {\n                        var transform = Drawing.getTranslate(legend);\n                        x0 = transform.x;\n                        y0 = transform.y;\n                    },\n                    moveFn: function(dx, dy) {\n                        var newX = x0 + dx;\n                        var newY = y0 + dy;\n\n                        Drawing.setTranslate(legend, newX, newY);\n\n                        xf = dragElement.align(newX, 0, gs.l, gs.l + gs.w, opts.xanchor);\n                        yf = dragElement.align(newY, 0, gs.t + gs.h, gs.t, opts.yanchor);\n                    },\n                    doneFn: function() {\n                        if(xf !== undefined && yf !== undefined) {\n                            Registry.call('_guiRelayout', gd, {'legend.x': xf, 'legend.y': yf});\n                        }\n                    },\n                    clickFn: function(numClicks, e) {\n                        var clickedTrace = layer.selectAll('g.traces').filter(function() {\n                            var bbox = this.getBoundingClientRect();\n                            return (\n                                e.clientX >= bbox.left && e.clientX <= bbox.right &&\n                                e.clientY >= bbox.top && e.clientY <= bbox.bottom\n                            );\n                        });\n                        if(clickedTrace.size() > 0) {\n                            clickOrDoubleClick(gd, legend, clickedTrace, numClicks, e);\n                        }\n                    }\n                });\n            }\n        }], gd);\n};\n\nfunction clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {\n    var trace = legendItem.data()[0][0].trace;\n    var evtData = {\n        event: evt,\n        node: legendItem.node(),\n        curveNumber: trace.index,\n        expandedIndex: trace._expandedIndex,\n        data: gd.data,\n        layout: gd.layout,\n        frames: gd._transitionData._frames,\n        config: gd._context,\n        fullData: gd._fullData,\n        fullLayout: gd._fullLayout\n    };\n\n    if(trace._group) {\n        evtData.group = trace._group;\n    }\n    if(Registry.traceIs(trace, 'pie-like')) {\n        evtData.label = legendItem.datum()[0].label;\n    }\n\n    var clickVal = Events.triggerHandler(gd, 'plotly_legendclick', evtData);\n    if(clickVal === false) return;\n\n    if(numClicks === 1) {\n        legend._clickTimeout = setTimeout(function() {\n            handleClick(legendItem, gd, numClicks);\n        }, gd._context.doubleClickDelay);\n    } else if(numClicks === 2) {\n        if(legend._clickTimeout) clearTimeout(legend._clickTimeout);\n        gd._legendMouseDownTime = 0;\n\n        var dblClickVal = Events.triggerHandler(gd, 'plotly_legenddoubleclick', evtData);\n        if(dblClickVal !== false) handleClick(legendItem, gd, numClicks);\n    }\n}\n\nfunction drawTexts(g, gd, opts) {\n    var legendItem = g.data()[0][0];\n    var trace = legendItem.trace;\n    var isPieLike = Registry.traceIs(trace, 'pie-like');\n    var traceIndex = trace.index;\n    var isEditable = opts._main && gd._context.edits.legendText && !isPieLike;\n    var maxNameLength = opts._maxNameLength;\n\n    var name;\n    if(!opts.entries) {\n        name = isPieLike ? legendItem.label : trace.name;\n        if(trace._meta) {\n            name = Lib.templateString(name, trace._meta);\n        }\n    } else {\n        name = legendItem.text;\n    }\n\n    var textEl = Lib.ensureSingle(g, 'text', 'legendtext');\n\n    textEl.attr('text-anchor', 'start')\n        .classed('user-select-none', true)\n        .call(Drawing.font, opts.font)\n        .text(isEditable ? ensureLength(name, maxNameLength) : name);\n\n    svgTextUtils.positionText(textEl, constants.textGap, 0);\n\n    if(isEditable) {\n        textEl.call(svgTextUtils.makeEditable, {gd: gd, text: name})\n            .call(textLayout, g, gd, opts)\n            .on('edit', function(newName) {\n                this.text(ensureLength(newName, maxNameLength))\n                    .call(textLayout, g, gd, opts);\n\n                var fullInput = legendItem.trace._fullInput || {};\n                var update = {};\n\n                if(Registry.hasTransform(fullInput, 'groupby')) {\n                    var groupbyIndices = Registry.getTransformIndices(fullInput, 'groupby');\n                    var index = groupbyIndices[groupbyIndices.length - 1];\n\n                    var kcont = Lib.keyedContainer(fullInput, 'transforms[' + index + '].styles', 'target', 'value.name');\n\n                    kcont.set(legendItem.trace._group, newName);\n\n                    update = kcont.constructUpdate();\n                } else {\n                    update.name = newName;\n                }\n\n                return Registry.call('_guiRestyle', gd, update, traceIndex);\n            });\n    } else {\n        textLayout(textEl, g, gd, opts);\n    }\n}\n\n/*\n * Make sure we have a reasonably clickable region.\n * If this string is missing or very short, pad it with spaces out to at least\n * 4 characters, up to the max length of other labels, on the assumption that\n * most characters are wider than spaces so a string of spaces will usually be\n * no wider than the real labels.\n */\nfunction ensureLength(str, maxLength) {\n    var targetLength = Math.max(4, maxLength);\n    if(str && str.trim().length >= targetLength / 2) return str;\n    str = str || '';\n    for(var i = targetLength - str.length; i > 0; i--) str += ' ';\n    return str;\n}\n\nfunction setupTraceToggle(g, gd) {\n    var doubleClickDelay = gd._context.doubleClickDelay;\n    var newMouseDownTime;\n    var numClicks = 1;\n\n    var traceToggle = Lib.ensureSingle(g, 'rect', 'legendtoggle', function(s) {\n        s.style('cursor', 'pointer')\n            .attr('pointer-events', 'all')\n            .call(Color.fill, 'rgba(0,0,0,0)');\n    });\n\n    traceToggle.on('mousedown', function() {\n        newMouseDownTime = (new Date()).getTime();\n        if(newMouseDownTime - gd._legendMouseDownTime < doubleClickDelay) {\n            // in a click train\n            numClicks += 1;\n        } else {\n            // new click train\n            numClicks = 1;\n            gd._legendMouseDownTime = newMouseDownTime;\n        }\n    });\n    traceToggle.on('mouseup', function() {\n        if(gd._dragged || gd._editing) return;\n        var legend = gd._fullLayout.legend;\n\n        if((new Date()).getTime() - gd._legendMouseDownTime > doubleClickDelay) {\n            numClicks = Math.max(numClicks - 1, 1);\n        }\n\n        clickOrDoubleClick(gd, legend, g, numClicks, d3.event);\n    });\n}\n\nfunction textLayout(s, g, gd, opts) {\n    if(!opts._main) s.attr('data-notex', true); // do not process MathJax if not main\n    svgTextUtils.convertToTspans(s, gd, function() {\n        computeTextDimensions(g, gd, opts);\n    });\n}\n\nfunction computeTextDimensions(g, gd, opts) {\n    var legendItem = g.data()[0][0];\n    if(opts._main && legendItem && !legendItem.trace.showlegend) {\n        g.remove();\n        return;\n    }\n\n    var mathjaxGroup = g.select('g[class*=math-group]');\n    var mathjaxNode = mathjaxGroup.node();\n    if(!opts) opts = gd._fullLayout.legend;\n    var bw = opts.borderwidth;\n    var lineHeight = (legendItem ? opts : opts.title).font.size * LINE_SPACING;\n    var height, width;\n\n    if(mathjaxNode) {\n        var mathjaxBB = Drawing.bBox(mathjaxNode);\n\n        height = mathjaxBB.height;\n        width = mathjaxBB.width;\n\n        if(legendItem) {\n            Drawing.setTranslate(mathjaxGroup, 0, height * 0.25);\n        } else { // case of title\n            Drawing.setTranslate(mathjaxGroup, bw, height * 0.75 + bw);\n        }\n    } else {\n        var textEl = g.select(legendItem ?\n            '.legendtext' : '.legendtitletext'\n        );\n        var textLines = svgTextUtils.lineCount(textEl);\n        var textNode = textEl.node();\n\n        height = lineHeight * textLines;\n        width = textNode ? Drawing.bBox(textNode).width : 0;\n\n        // approximation to height offset to center the font\n        // to avoid getBoundingClientRect\n        var textY = lineHeight * ((textLines - 1) / 2 - 0.3);\n        if(legendItem) {\n            svgTextUtils.positionText(textEl, constants.textGap, -textY);\n        } else { // case of title\n            svgTextUtils.positionText(textEl, constants.titlePad + bw, lineHeight + bw);\n        }\n    }\n\n    if(legendItem) {\n        legendItem.lineHeight = lineHeight;\n        legendItem.height = Math.max(height, 16) + 3;\n        legendItem.width = width;\n    } else { // case of title\n        opts._titleWidth = width;\n        opts._titleHeight = height;\n    }\n}\n\nfunction getTitleSize(opts) {\n    var w = 0;\n    var h = 0;\n\n    var side = opts.title.side;\n    if(side) {\n        if(side.indexOf('left') !== -1) {\n            w = opts._titleWidth;\n        }\n        if(side.indexOf('top') !== -1) {\n            h = opts._titleHeight;\n        }\n    }\n\n    return [w, h];\n}\n\n/*\n * Computes in fullLayout.legend:\n *\n *  - _height: legend height including items past scrollbox height\n *  - _maxHeight: maximum legend height before scrollbox is required\n *  - _effHeight: legend height w/ or w/o scrollbox\n *\n *  - _width: legend width\n *  - _maxWidth (for orientation:h only): maximum width before starting new row\n */\nfunction computeLegendDimensions(gd, groups, traces, opts) {\n    var fullLayout = gd._fullLayout;\n    if(!opts) opts = fullLayout.legend;\n    var gs = fullLayout._size;\n\n    var isVertical = helpers.isVertical(opts);\n    var isGrouped = helpers.isGrouped(opts);\n\n    var bw = opts.borderwidth;\n    var bw2 = 2 * bw;\n    var textGap = constants.textGap;\n    var itemGap = constants.itemGap;\n    var endPad = 2 * (bw + itemGap);\n\n    var yanchor = getYanchor(opts);\n    var isBelowPlotArea = opts.y < 0 || (opts.y === 0 && yanchor === 'top');\n    var isAbovePlotArea = opts.y > 1 || (opts.y === 1 && yanchor === 'bottom');\n\n    // - if below/above plot area, give it the maximum potential margin-push value\n    // - otherwise, extend the height of the plot area\n    opts._maxHeight = Math.max(\n        (isBelowPlotArea || isAbovePlotArea) ? fullLayout.height / 2 : gs.h,\n        30\n    );\n\n    var toggleRectWidth = 0;\n    opts._width = 0;\n    opts._height = 0;\n    var titleSize = getTitleSize(opts);\n\n    if(isVertical) {\n        traces.each(function(d) {\n            var h = d[0].height;\n            Drawing.setTranslate(this,\n                bw + titleSize[0],\n                bw + titleSize[1] + opts._height + h / 2 + itemGap\n            );\n            opts._height += h;\n            opts._width = Math.max(opts._width, d[0].width);\n        });\n\n        toggleRectWidth = textGap + opts._width;\n        opts._width += itemGap + textGap + bw2;\n        opts._height += endPad;\n\n        if(isGrouped) {\n            groups.each(function(d, i) {\n                Drawing.setTranslate(this, 0, i * opts.tracegroupgap);\n            });\n            opts._height += (opts._lgroupsLength - 1) * opts.tracegroupgap;\n        }\n    } else {\n        var xanchor = getXanchor(opts);\n        var isLeftOfPlotArea = opts.x < 0 || (opts.x === 0 && xanchor === 'right');\n        var isRightOfPlotArea = opts.x > 1 || (opts.x === 1 && xanchor === 'left');\n        var isBeyondPlotAreaY = isAbovePlotArea || isBelowPlotArea;\n        var hw = fullLayout.width / 2;\n\n        // - if placed within x-margins, extend the width of the plot area\n        // - else if below/above plot area and anchored in the margin, extend to opposite margin,\n        // - otherwise give it the maximum potential margin-push value\n        opts._maxWidth = Math.max(\n            isLeftOfPlotArea ? ((isBeyondPlotAreaY && xanchor === 'left') ? gs.l + gs.w : hw) :\n            isRightOfPlotArea ? ((isBeyondPlotAreaY && xanchor === 'right') ? gs.r + gs.w : hw) :\n            gs.w,\n        2 * textGap);\n        var maxItemWidth = 0;\n        var combinedItemWidth = 0;\n        traces.each(function(d) {\n            var w = d[0].width + textGap;\n            maxItemWidth = Math.max(maxItemWidth, w);\n            combinedItemWidth += w;\n        });\n\n        toggleRectWidth = null;\n        var maxRowWidth = 0;\n\n        if(isGrouped) {\n            var maxGroupHeightInRow = 0;\n            var groupOffsetX = 0;\n            var groupOffsetY = 0;\n            groups.each(function() {\n                var maxWidthInGroup = 0;\n                var offsetY = 0;\n                d3.select(this).selectAll('g.traces').each(function(d) {\n                    var h = d[0].height;\n                    Drawing.setTranslate(this,\n                        titleSize[0],\n                        titleSize[1] + bw + itemGap + h / 2 + offsetY\n                    );\n                    offsetY += h;\n                    maxWidthInGroup = Math.max(maxWidthInGroup, textGap + d[0].width);\n                });\n                maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);\n\n                var next = maxWidthInGroup + itemGap;\n\n                if((next + bw + groupOffsetX) > opts._maxWidth) {\n                    maxRowWidth = Math.max(maxRowWidth, groupOffsetX);\n                    groupOffsetX = 0;\n                    groupOffsetY += maxGroupHeightInRow + opts.tracegroupgap;\n                    maxGroupHeightInRow = offsetY;\n                }\n\n                Drawing.setTranslate(this, groupOffsetX, groupOffsetY);\n\n                groupOffsetX += next;\n            });\n\n            opts._width = Math.max(maxRowWidth, groupOffsetX) + bw;\n            opts._height = groupOffsetY + maxGroupHeightInRow + endPad;\n        } else {\n            var nTraces = traces.size();\n            var oneRowLegend = (combinedItemWidth + bw2 + (nTraces - 1) * itemGap) < opts._maxWidth;\n\n            var maxItemHeightInRow = 0;\n            var offsetX = 0;\n            var offsetY = 0;\n            var rowWidth = 0;\n            traces.each(function(d) {\n                var h = d[0].height;\n                var w = textGap + d[0].width;\n                var next = (oneRowLegend ? w : maxItemWidth) + itemGap;\n\n                if((next + bw + offsetX) > opts._maxWidth) {\n                    maxRowWidth = Math.max(maxRowWidth, rowWidth);\n                    offsetX = 0;\n                    offsetY += maxItemHeightInRow;\n                    opts._height += maxItemHeightInRow;\n                    maxItemHeightInRow = 0;\n                }\n\n                Drawing.setTranslate(this,\n                    titleSize[0] + bw + offsetX,\n                    titleSize[1] + bw + offsetY + h / 2 + itemGap\n                );\n\n                rowWidth = offsetX + w + itemGap;\n                offsetX += next;\n                maxItemHeightInRow = Math.max(maxItemHeightInRow, h);\n            });\n\n            if(oneRowLegend) {\n                opts._width = offsetX + bw2;\n                opts._height = maxItemHeightInRow + endPad;\n            } else {\n                opts._width = Math.max(maxRowWidth, rowWidth) + bw2;\n                opts._height += maxItemHeightInRow + endPad;\n            }\n        }\n    }\n\n    opts._width = Math.ceil(\n        Math.max(\n            opts._width + titleSize[0],\n            opts._titleWidth + 2 * (bw + constants.titlePad)\n        )\n    );\n\n    opts._height = Math.ceil(\n        Math.max(\n            opts._height + titleSize[1],\n            opts._titleHeight + 2 * (bw + constants.itemGap)\n        )\n    );\n\n    opts._effHeight = Math.min(opts._height, opts._maxHeight);\n\n    var edits = gd._context.edits;\n    var isEditable = edits.legendText || edits.legendPosition;\n    traces.each(function(d) {\n        var traceToggle = d3.select(this).select('.legendtoggle');\n        var h = d[0].height;\n        var w = isEditable ? textGap : (toggleRectWidth || (textGap + d[0].width));\n        if(!isVertical) w += itemGap / 2;\n        Drawing.setRect(traceToggle, 0, -h / 2, w, h);\n    });\n}\n\nfunction expandMargin(gd) {\n    var fullLayout = gd._fullLayout;\n    var opts = fullLayout.legend;\n    var xanchor = getXanchor(opts);\n    var yanchor = getYanchor(opts);\n\n    return Plots.autoMargin(gd, 'legend', {\n        x: opts.x,\n        y: opts.y,\n        l: opts._width * (FROM_TL[xanchor]),\n        r: opts._width * (FROM_BR[xanchor]),\n        b: opts._effHeight * (FROM_BR[yanchor]),\n        t: opts._effHeight * (FROM_TL[yanchor])\n    });\n}\n\nfunction getXanchor(opts) {\n    return Lib.isRightAnchor(opts) ? 'right' :\n        Lib.isCenterAnchor(opts) ? 'center' :\n        'left';\n}\n\nfunction getYanchor(opts) {\n    return Lib.isBottomAnchor(opts) ? 'bottom' :\n        Lib.isMiddleAnchor(opts) ? 'middle' :\n        'top';\n}\n\n},{\"../../constants/alignment\":154,\"../../lib\":178,\"../../lib/events\":172,\"../../lib/svg_text_utils\":199,\"../../plots/plots\":256,\"../../registry\":269,\"../color\":52,\"../dragelement\":71,\"../drawing\":74,\"./constants\":103,\"./get_legend_data\":106,\"./handle_click\":107,\"./helpers\":108,\"./style\":110,\"d3\":16}],106:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = function getLegendData(calcdata, opts) {\n    var lgroupToTraces = {};\n    var lgroups = [];\n    var hasOneNonBlankGroup = false;\n    var slicesShown = {};\n    var lgroupi = 0;\n    var maxNameLength = 0;\n    var i, j;\n    var main = opts._main;\n\n    function addOneItem(legendGroup, legendItem) {\n        // each '' legend group is treated as a separate group\n        if(legendGroup === '' || !helpers.isGrouped(opts)) {\n            // TODO: check this against fullData legendgroups?\n            var uniqueGroup = '~~i' + lgroupi;\n            lgroups.push(uniqueGroup);\n            lgroupToTraces[uniqueGroup] = [[legendItem]];\n            lgroupi++;\n        } else if(lgroups.indexOf(legendGroup) === -1) {\n            lgroups.push(legendGroup);\n            hasOneNonBlankGroup = true;\n            lgroupToTraces[legendGroup] = [[legendItem]];\n        } else {\n            lgroupToTraces[legendGroup].push([legendItem]);\n        }\n    }\n\n    // build an { legendgroup: [cd0, cd0], ... } object\n    for(i = 0; i < calcdata.length; i++) {\n        var cd = calcdata[i];\n        var cd0 = cd[0];\n        var trace = cd0.trace;\n        var lgroup = trace.legendgroup;\n\n        if(main && (!trace.visible || !trace.showlegend)) continue;\n\n        if(Registry.traceIs(trace, 'pie-like')) {\n            if(!slicesShown[lgroup]) slicesShown[lgroup] = {};\n\n            for(j = 0; j < cd.length; j++) {\n                var labelj = cd[j].label;\n\n                if(!slicesShown[lgroup][labelj]) {\n                    addOneItem(lgroup, {\n                        label: labelj,\n                        color: cd[j].color,\n                        i: cd[j].i,\n                        trace: trace,\n                        pts: cd[j].pts\n                    });\n\n                    slicesShown[lgroup][labelj] = true;\n                    maxNameLength = Math.max(maxNameLength, (labelj || '').length);\n                }\n            }\n        } else {\n            addOneItem(lgroup, cd0);\n            maxNameLength = Math.max(maxNameLength, (trace.name || '').length);\n        }\n    }\n\n    // won't draw a legend in this case\n    if(!lgroups.length) return [];\n\n    // rearrange lgroupToTraces into a d3-friendly array of arrays\n    var lgroupsLength = lgroups.length;\n    var ltraces;\n    var legendData;\n\n    if(hasOneNonBlankGroup && helpers.isGrouped(opts)) {\n        legendData = new Array(lgroupsLength);\n\n        for(i = 0; i < lgroupsLength; i++) {\n            ltraces = lgroupToTraces[lgroups[i]];\n            legendData[i] = helpers.isReversed(opts) ? ltraces.reverse() : ltraces;\n        }\n    } else {\n        // collapse all groups into one if all groups are blank\n        legendData = [new Array(lgroupsLength)];\n\n        for(i = 0; i < lgroupsLength; i++) {\n            ltraces = lgroupToTraces[lgroups[i]][0];\n            legendData[0][helpers.isReversed(opts) ? lgroupsLength - i - 1 : i] = ltraces;\n        }\n        lgroupsLength = 1;\n    }\n\n    // number of legend groups - needed in legend/draw.js\n    opts._lgroupsLength = lgroupsLength;\n    // maximum name/label length - needed in legend/draw.js\n    opts._maxNameLength = maxNameLength;\n\n    return legendData;\n};\n\n},{\"../../registry\":269,\"./helpers\":108}],107:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nvar SHOWISOLATETIP = true;\n\nmodule.exports = function handleClick(g, gd, numClicks) {\n    var fullLayout = gd._fullLayout;\n\n    if(gd._dragged || gd._editing) return;\n\n    var itemClick = fullLayout.legend.itemclick;\n    var itemDoubleClick = fullLayout.legend.itemdoubleclick;\n\n    if(numClicks === 1 && itemClick === 'toggle' && itemDoubleClick === 'toggleothers' &&\n        SHOWISOLATETIP && gd.data && gd._context.showTips\n    ) {\n        Lib.notifier(Lib._(gd, 'Double-click on legend to isolate one trace'), 'long');\n        SHOWISOLATETIP = false;\n    } else {\n        SHOWISOLATETIP = false;\n    }\n\n    var mode;\n    if(numClicks === 1) mode = itemClick;\n    else if(numClicks === 2) mode = itemDoubleClick;\n    if(!mode) return;\n\n    var hiddenSlices = fullLayout.hiddenlabels ?\n        fullLayout.hiddenlabels.slice() :\n        [];\n\n    var legendItem = g.data()[0][0];\n    var fullData = gd._fullData;\n    var fullTrace = legendItem.trace;\n    var legendgroup = fullTrace.legendgroup;\n\n    var i, j, kcont, key, keys, val;\n    var attrUpdate = {};\n    var attrIndices = [];\n    var carrs = [];\n    var carrIdx = [];\n\n    function insertUpdate(traceIndex, key, value) {\n        var attrIndex = attrIndices.indexOf(traceIndex);\n        var valueArray = attrUpdate[key];\n        if(!valueArray) {\n            valueArray = attrUpdate[key] = [];\n        }\n\n        if(attrIndices.indexOf(traceIndex) === -1) {\n            attrIndices.push(traceIndex);\n            attrIndex = attrIndices.length - 1;\n        }\n\n        valueArray[attrIndex] = value;\n\n        return attrIndex;\n    }\n\n    function setVisibility(fullTrace, visibility) {\n        var fullInput = fullTrace._fullInput;\n        if(Registry.hasTransform(fullInput, 'groupby')) {\n            var kcont = carrs[fullInput.index];\n            if(!kcont) {\n                var groupbyIndices = Registry.getTransformIndices(fullInput, 'groupby');\n                var lastGroupbyIndex = groupbyIndices[groupbyIndices.length - 1];\n                kcont = Lib.keyedContainer(fullInput, 'transforms[' + lastGroupbyIndex + '].styles', 'target', 'value.visible');\n                carrs[fullInput.index] = kcont;\n            }\n\n            var curState = kcont.get(fullTrace._group);\n\n            // If not specified, assume visible. This happens if there are other style\n            // properties set for a group but not the visibility. There are many similar\n            // ways to do this (e.g. why not just `curState = fullTrace.visible`??? The\n            // answer is: because it breaks other things like groupby trace names in\n            // subtle ways.)\n            if(curState === undefined) {\n                curState = true;\n            }\n\n            if(curState !== false) {\n                // true -> legendonly. All others toggle to true:\n                kcont.set(fullTrace._group, visibility);\n            }\n            carrIdx[fullInput.index] = insertUpdate(fullInput.index, 'visible', fullInput.visible === false ? false : true);\n        } else {\n            // false -> false (not possible since will not be visible in legend)\n            // true -> legendonly\n            // legendonly -> true\n            var nextVisibility = fullInput.visible === false ? false : visibility;\n\n            insertUpdate(fullInput.index, 'visible', nextVisibility);\n        }\n    }\n\n    if(Registry.traceIs(fullTrace, 'pie-like')) {\n        var thisLabel = legendItem.label;\n        var thisLabelIndex = hiddenSlices.indexOf(thisLabel);\n\n        if(mode === 'toggle') {\n            if(thisLabelIndex === -1) hiddenSlices.push(thisLabel);\n            else hiddenSlices.splice(thisLabelIndex, 1);\n        } else if(mode === 'toggleothers') {\n            hiddenSlices = [];\n            gd.calcdata[0].forEach(function(d) {\n                if(thisLabel !== d.label) {\n                    hiddenSlices.push(d.label);\n                }\n            });\n            if(gd._fullLayout.hiddenlabels && gd._fullLayout.hiddenlabels.length === hiddenSlices.length && thisLabelIndex === -1) {\n                hiddenSlices = [];\n            }\n        }\n\n        Registry.call('_guiRelayout', gd, 'hiddenlabels', hiddenSlices);\n    } else {\n        var hasLegendgroup = legendgroup && legendgroup.length;\n        var traceIndicesInGroup = [];\n        var tracei;\n        if(hasLegendgroup) {\n            for(i = 0; i < fullData.length; i++) {\n                tracei = fullData[i];\n                if(!tracei.visible) continue;\n                if(tracei.legendgroup === legendgroup) {\n                    traceIndicesInGroup.push(i);\n                }\n            }\n        }\n\n        if(mode === 'toggle') {\n            var nextVisibility;\n\n            switch(fullTrace.visible) {\n                case true:\n                    nextVisibility = 'legendonly';\n                    break;\n                case false:\n                    nextVisibility = false;\n                    break;\n                case 'legendonly':\n                    nextVisibility = true;\n                    break;\n            }\n\n            if(hasLegendgroup) {\n                for(i = 0; i < fullData.length; i++) {\n                    if(fullData[i].visible !== false && fullData[i].legendgroup === legendgroup) {\n                        setVisibility(fullData[i], nextVisibility);\n                    }\n                }\n            } else {\n                setVisibility(fullTrace, nextVisibility);\n            }\n        } else if(mode === 'toggleothers') {\n            // Compute the clicked index. expandedIndex does what we want for expanded traces\n            // but also culls hidden traces. That means we have some work to do.\n            var isClicked, isInGroup, notInLegend, otherState;\n            var isIsolated = true;\n            for(i = 0; i < fullData.length; i++) {\n                isClicked = fullData[i] === fullTrace;\n                notInLegend = fullData[i].showlegend !== true;\n                if(isClicked || notInLegend) continue;\n\n                isInGroup = (hasLegendgroup && fullData[i].legendgroup === legendgroup);\n\n                if(!isInGroup && fullData[i].visible === true && !Registry.traceIs(fullData[i], 'notLegendIsolatable')) {\n                    isIsolated = false;\n                    break;\n                }\n            }\n\n            for(i = 0; i < fullData.length; i++) {\n                // False is sticky; we don't change it.\n                if(fullData[i].visible === false) continue;\n\n                if(Registry.traceIs(fullData[i], 'notLegendIsolatable')) {\n                    continue;\n                }\n\n                switch(fullTrace.visible) {\n                    case 'legendonly':\n                        setVisibility(fullData[i], true);\n                        break;\n                    case true:\n                        otherState = isIsolated ? true : 'legendonly';\n                        isClicked = fullData[i] === fullTrace;\n                        // N.B. consider traces that have a set legendgroup as toggleable\n                        notInLegend = (fullData[i].showlegend !== true && !fullData[i].legendgroup);\n                        isInGroup = isClicked || (hasLegendgroup && fullData[i].legendgroup === legendgroup);\n                        setVisibility(fullData[i], (isInGroup || notInLegend) ? true : otherState);\n                        break;\n                }\n            }\n        }\n\n        for(i = 0; i < carrs.length; i++) {\n            kcont = carrs[i];\n            if(!kcont) continue;\n            var update = kcont.constructUpdate();\n\n            var updateKeys = Object.keys(update);\n            for(j = 0; j < updateKeys.length; j++) {\n                key = updateKeys[j];\n                val = attrUpdate[key] = attrUpdate[key] || [];\n                val[carrIdx[i]] = update[key];\n            }\n        }\n\n        // The length of the value arrays should be equal and any unspecified\n        // values should be explicitly undefined for them to get properly culled\n        // as updates and not accidentally reset to the default value. This fills\n        // out sparse arrays with the required number of undefined values:\n        keys = Object.keys(attrUpdate);\n        for(i = 0; i < keys.length; i++) {\n            key = keys[i];\n            for(j = 0; j < attrIndices.length; j++) {\n                // Use hasOwnPropety to protect against falsey values:\n                if(!attrUpdate[key].hasOwnProperty(j)) {\n                    attrUpdate[key][j] = undefined;\n                }\n            }\n        }\n\n        Registry.call('_guiRestyle', gd, attrUpdate, attrIndices);\n    }\n};\n\n},{\"../../lib\":178,\"../../registry\":269}],108:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nexports.isGrouped = function isGrouped(legendLayout) {\n    return (legendLayout.traceorder || '').indexOf('grouped') !== -1;\n};\n\nexports.isVertical = function isVertical(legendLayout) {\n    return legendLayout.orientation !== 'h';\n};\n\nexports.isReversed = function isReversed(legendLayout) {\n    return (legendLayout.traceorder || '').indexOf('reversed') !== -1;\n};\n\n},{}],109:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'legend',\n\n    layoutAttributes: _dereq_('./attributes'),\n    supplyLayoutDefaults: _dereq_('./defaults'),\n\n    draw: _dereq_('./draw'),\n    style: _dereq_('./style')\n};\n\n},{\"./attributes\":102,\"./defaults\":104,\"./draw\":105,\"./style\":110}],110:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../drawing');\nvar Color = _dereq_('../color');\nvar extractOpts = _dereq_('../colorscale/helpers').extractOpts;\n\nvar subTypes = _dereq_('../../traces/scatter/subtypes');\nvar stylePie = _dereq_('../../traces/pie/style_one');\nvar pieCastOption = _dereq_('../../traces/pie/helpers').castOption;\n\nvar CST_MARKER_SIZE = 12;\nvar CST_LINE_WIDTH = 5;\nvar CST_MARKER_LINE_WIDTH = 2;\nvar MAX_LINE_WIDTH = 10;\nvar MAX_MARKER_LINE_WIDTH = 5;\n\nmodule.exports = function style(s, gd, legend) {\n    var fullLayout = gd._fullLayout;\n    if(!legend) legend = fullLayout.legend;\n    var constantItemSizing = legend.itemsizing === 'constant';\n\n    var boundLineWidth = function(mlw, cont, max, cst) {\n        var v;\n        if(mlw + 1) {\n            v = mlw;\n        } else if(cont && cont.width > 0) {\n            v = cont.width;\n        } else {\n            return 0;\n        }\n        return constantItemSizing ? cst : Math.min(v, max);\n    };\n\n    s.each(function(d) {\n        var traceGroup = d3.select(this);\n\n        var layers = Lib.ensureSingle(traceGroup, 'g', 'layers');\n        layers.style('opacity', d[0].trace.opacity);\n\n        var valign = legend.valign;\n        var lineHeight = d[0].lineHeight;\n        var height = d[0].height;\n\n        if(valign === 'middle' || !lineHeight || !height) {\n            layers.attr('transform', null);\n        } else {\n            var factor = {top: 1, bottom: -1}[valign];\n            var markerOffsetY = factor * (0.5 * (lineHeight - height + 3));\n            layers.attr('transform', 'translate(0,' + markerOffsetY + ')');\n        }\n\n        var fill = layers\n            .selectAll('g.legendfill')\n                .data([d]);\n        fill.enter().append('g')\n            .classed('legendfill', true);\n\n        var line = layers\n            .selectAll('g.legendlines')\n                .data([d]);\n        line.enter().append('g')\n            .classed('legendlines', true);\n\n        var symbol = layers\n            .selectAll('g.legendsymbols')\n                .data([d]);\n        symbol.enter().append('g')\n            .classed('legendsymbols', true);\n\n        symbol.selectAll('g.legendpoints')\n            .data([d])\n          .enter().append('g')\n            .classed('legendpoints', true);\n    })\n    .each(styleSpatial)\n    .each(styleWaterfalls)\n    .each(styleFunnels)\n    .each(styleBars)\n    .each(styleBoxes)\n    .each(styleFunnelareas)\n    .each(stylePies)\n    .each(styleLines)\n    .each(stylePoints)\n    .each(styleCandles)\n    .each(styleOHLC);\n\n    function styleLines(d) {\n        var d0 = d[0];\n        var trace = d0.trace;\n        var showFill = trace.visible && trace.fill && trace.fill !== 'none';\n        var showLine = subTypes.hasLines(trace);\n        var contours = trace.contours;\n        var showGradientLine = false;\n        var showGradientFill = false;\n        var dMod, tMod;\n\n        var cOpts = extractOpts(trace);\n        var colorscale = cOpts.colorscale;\n        var reversescale = cOpts.reversescale;\n\n        var fillGradient = function(s) {\n            if(s.size()) {\n                var gradientID = 'legendfill-' + trace.uid;\n                Drawing.gradient(s, gd, gradientID,\n                    getGradientDirection(reversescale),\n                    colorscale, 'fill');\n            }\n        };\n\n        var lineGradient = function(s) {\n            if(s.size()) {\n                var gradientID = 'legendline-' + trace.uid;\n                Drawing.lineGroupStyle(s);\n                Drawing.gradient(s, gd, gradientID,\n                    getGradientDirection(reversescale),\n                    colorscale, 'stroke');\n            }\n        };\n\n        if(contours) {\n            var coloring = contours.coloring;\n\n            if(coloring === 'lines') {\n                showGradientLine = true;\n            } else {\n                showLine = coloring === 'none' || coloring === 'heatmap' || contours.showlines;\n            }\n\n            if(contours.type === 'constraint') {\n                showFill = contours._operation !== '=';\n            } else if(coloring === 'fill' || coloring === 'heatmap') {\n                showGradientFill = true;\n            }\n        }\n\n        // with fill and no markers or text, move the line and fill up a bit\n        // so it's more centered\n        var markersOrText = subTypes.hasMarkers(trace) || subTypes.hasText(trace);\n        var anyFill = showFill || showGradientFill;\n        var anyLine = showLine || showGradientLine;\n        var pathStart = (markersOrText || !anyFill) ? 'M5,0' :\n            // with a line leave it slightly below center, to leave room for the\n            // line thickness and because the line is usually more prominent\n            anyLine ? 'M5,-2' : 'M5,-3';\n\n        var this3 = d3.select(this);\n\n        var fill = this3.select('.legendfill').selectAll('path')\n            .data(showFill || showGradientFill ? [d] : []);\n        fill.enter().append('path').classed('js-fill', true);\n        fill.exit().remove();\n        fill.attr('d', pathStart + 'h30v6h-30z')\n            .call(showFill ? Drawing.fillGroupStyle : fillGradient);\n\n        if(showLine || showGradientLine) {\n            var lw = boundLineWidth(undefined, trace.line, MAX_LINE_WIDTH, CST_LINE_WIDTH);\n            tMod = Lib.minExtend(trace, {line: {width: lw}});\n            dMod = [Lib.minExtend(d0, {trace: tMod})];\n        }\n\n        var line = this3.select('.legendlines').selectAll('path')\n            .data(showLine || showGradientLine ? [dMod] : []);\n        line.enter().append('path').classed('js-line', true);\n        line.exit().remove();\n\n        // this is ugly... but you can't apply a gradient to a perfectly\n        // horizontal or vertical line. Presumably because then\n        // the system doesn't know how to scale vertical variation, even\n        // though there *is* no vertical variation in this case.\n        // so add an invisibly small angle to the line\n        // This issue (and workaround) exist across (Mac) Chrome, FF, and Safari\n        line.attr('d', pathStart + (showGradientLine ? 'l30,0.0001' : 'h30'))\n            .call(showLine ? Drawing.lineGroupStyle : lineGradient);\n    }\n\n    function stylePoints(d) {\n        var d0 = d[0];\n        var trace = d0.trace;\n        var showMarkers = subTypes.hasMarkers(trace);\n        var showText = subTypes.hasText(trace);\n        var showLines = subTypes.hasLines(trace);\n        var dMod, tMod;\n\n        // 'scatter3d' don't use gd.calcdata,\n        // use d0.trace to infer arrayOk attributes\n\n        function boundVal(attrIn, arrayToValFn, bounds, cst) {\n            var valIn = Lib.nestedProperty(trace, attrIn).get();\n            var valToBound = (Lib.isArrayOrTypedArray(valIn) && arrayToValFn) ?\n                arrayToValFn(valIn) :\n                valIn;\n\n            if(constantItemSizing && valToBound && cst !== undefined) {\n                valToBound = cst;\n            }\n\n            if(bounds) {\n                if(valToBound < bounds[0]) return bounds[0];\n                else if(valToBound > bounds[1]) return bounds[1];\n            }\n            return valToBound;\n        }\n\n        function pickFirst(array) {\n            if(d0._distinct && d0.index && array[d0.index]) return array[d0.index];\n            return array[0];\n        }\n\n        // constrain text, markers, etc so they'll fit on the legend\n        if(showMarkers || showText || showLines) {\n            var dEdit = {};\n            var tEdit = {};\n\n            if(showMarkers) {\n                dEdit.mc = boundVal('marker.color', pickFirst);\n                dEdit.mx = boundVal('marker.symbol', pickFirst);\n                dEdit.mo = boundVal('marker.opacity', Lib.mean, [0.2, 1]);\n                dEdit.mlc = boundVal('marker.line.color', pickFirst);\n                dEdit.mlw = boundVal('marker.line.width', Lib.mean, [0, 5], CST_MARKER_LINE_WIDTH);\n                tEdit.marker = {\n                    sizeref: 1,\n                    sizemin: 1,\n                    sizemode: 'diameter'\n                };\n\n                var ms = boundVal('marker.size', Lib.mean, [2, 16], CST_MARKER_SIZE);\n                dEdit.ms = ms;\n                tEdit.marker.size = ms;\n            }\n\n            if(showLines) {\n                tEdit.line = {\n                    width: boundVal('line.width', pickFirst, [0, 10], CST_LINE_WIDTH)\n                };\n            }\n\n            if(showText) {\n                dEdit.tx = 'Aa';\n                dEdit.tp = boundVal('textposition', pickFirst);\n                dEdit.ts = 10;\n                dEdit.tc = boundVal('textfont.color', pickFirst);\n                dEdit.tf = boundVal('textfont.family', pickFirst);\n            }\n\n            dMod = [Lib.minExtend(d0, dEdit)];\n            tMod = Lib.minExtend(trace, tEdit);\n\n            // always show legend items in base state\n            tMod.selectedpoints = null;\n\n            // never show texttemplate\n            tMod.texttemplate = null;\n        }\n\n        var ptgroup = d3.select(this).select('g.legendpoints');\n\n        var pts = ptgroup.selectAll('path.scatterpts')\n            .data(showMarkers ? dMod : []);\n        // make sure marker is on the bottom, in case it enters after text\n        pts.enter().insert('path', ':first-child')\n            .classed('scatterpts', true)\n            .attr('transform', 'translate(20,0)');\n        pts.exit().remove();\n        pts.call(Drawing.pointStyle, tMod, gd);\n\n        // 'mrc' is set in pointStyle and used in textPointStyle:\n        // constrain it here\n        if(showMarkers) dMod[0].mrc = 3;\n\n        var txt = ptgroup.selectAll('g.pointtext')\n            .data(showText ? dMod : []);\n        txt.enter()\n            .append('g').classed('pointtext', true)\n                .append('text').attr('transform', 'translate(20,0)');\n        txt.exit().remove();\n        txt.selectAll('text').call(Drawing.textPointStyle, tMod, gd);\n    }\n\n    function styleWaterfalls(d) {\n        var trace = d[0].trace;\n        var isWaterfall = trace.type === 'waterfall';\n\n        if(d[0]._distinct && isWaterfall) {\n            var cont = d[0].trace[d[0].dir].marker;\n            d[0].mc = cont.color;\n            d[0].mlw = cont.line.width;\n            d[0].mlc = cont.line.color;\n            return styleBarLike(d, this, 'waterfall');\n        }\n\n        var ptsData = [];\n        if(trace.visible && isWaterfall) {\n            ptsData = d[0].hasTotals ?\n                [['increasing', 'M-6,-6V6H0Z'], ['totals', 'M6,6H0L-6,-6H-0Z'], ['decreasing', 'M6,6V-6H0Z']] :\n                [['increasing', 'M-6,-6V6H6Z'], ['decreasing', 'M6,6V-6H-6Z']];\n        }\n\n        var pts = d3.select(this).select('g.legendpoints')\n            .selectAll('path.legendwaterfall')\n            .data(ptsData);\n        pts.enter().append('path').classed('legendwaterfall', true)\n            .attr('transform', 'translate(20,0)')\n            .style('stroke-miterlimit', 1);\n        pts.exit().remove();\n\n        pts.each(function(dd) {\n            var pt = d3.select(this);\n            var cont = trace[dd[0]].marker;\n            var lw = boundLineWidth(undefined, cont.line, MAX_MARKER_LINE_WIDTH, CST_MARKER_LINE_WIDTH);\n\n            pt.attr('d', dd[1])\n                .style('stroke-width', lw + 'px')\n                .call(Color.fill, cont.color);\n\n            if(lw) {\n                pt.call(Color.stroke, cont.line.color);\n            }\n        });\n    }\n\n    function styleBars(d) {\n        styleBarLike(d, this);\n    }\n\n    function styleFunnels(d) {\n        styleBarLike(d, this, 'funnel');\n    }\n\n    function styleBarLike(d, lThis, desiredType) {\n        var trace = d[0].trace;\n        var marker = trace.marker || {};\n        var markerLine = marker.line || {};\n\n        var isVisible = (!desiredType) ? Registry.traceIs(trace, 'bar') :\n            (trace.visible && trace.type === desiredType);\n\n        var barpath = d3.select(lThis).select('g.legendpoints')\n            .selectAll('path.legend' + desiredType)\n            .data(isVisible ? [d] : []);\n        barpath.enter().append('path').classed('legend' + desiredType, true)\n            .attr('d', 'M6,6H-6V-6H6Z')\n            .attr('transform', 'translate(20,0)');\n        barpath.exit().remove();\n\n        barpath.each(function(d) {\n            var p = d3.select(this);\n            var d0 = d[0];\n            var w = boundLineWidth(d0.mlw, marker.line, MAX_MARKER_LINE_WIDTH, CST_MARKER_LINE_WIDTH);\n\n            p.style('stroke-width', w + 'px')\n                .call(Color.fill, d0.mc || marker.color);\n\n            if(w) Color.stroke(p, d0.mlc || markerLine.color);\n        });\n    }\n\n    function styleBoxes(d) {\n        var trace = d[0].trace;\n\n        var pts = d3.select(this).select('g.legendpoints')\n            .selectAll('path.legendbox')\n            .data(trace.visible && Registry.traceIs(trace, 'box-violin') ? [d] : []);\n        pts.enter().append('path').classed('legendbox', true)\n            // if we want the median bar, prepend M6,0H-6\n            .attr('d', 'M6,6H-6V-6H6Z')\n            .attr('transform', 'translate(20,0)');\n        pts.exit().remove();\n\n        pts.each(function() {\n            var p = d3.select(this);\n\n            if((trace.boxpoints === 'all' || trace.points === 'all') &&\n                Color.opacity(trace.fillcolor) === 0 && Color.opacity((trace.line || {}).color) === 0\n            ) {\n                var tMod = Lib.minExtend(trace, {\n                    marker: {\n                        size: constantItemSizing ? CST_MARKER_SIZE : Lib.constrain(trace.marker.size, 2, 16),\n                        sizeref: 1,\n                        sizemin: 1,\n                        sizemode: 'diameter'\n                    }\n                });\n                pts.call(Drawing.pointStyle, tMod, gd);\n            } else {\n                var w = boundLineWidth(undefined, trace.line, MAX_MARKER_LINE_WIDTH, CST_MARKER_LINE_WIDTH);\n\n                p.style('stroke-width', w + 'px')\n                    .call(Color.fill, trace.fillcolor);\n\n                if(w) Color.stroke(p, trace.line.color);\n            }\n        });\n    }\n\n    function styleCandles(d) {\n        var trace = d[0].trace;\n\n        var pts = d3.select(this).select('g.legendpoints')\n            .selectAll('path.legendcandle')\n            .data(trace.visible && trace.type === 'candlestick' ? [d, d] : []);\n        pts.enter().append('path').classed('legendcandle', true)\n            .attr('d', function(_, i) {\n                if(i) return 'M-15,0H-8M-8,6V-6H8Z'; // increasing\n                return 'M15,0H8M8,-6V6H-8Z'; // decreasing\n            })\n            .attr('transform', 'translate(20,0)')\n            .style('stroke-miterlimit', 1);\n        pts.exit().remove();\n\n        pts.each(function(_, i) {\n            var p = d3.select(this);\n            var cont = trace[i ? 'increasing' : 'decreasing'];\n            var w = boundLineWidth(undefined, cont.line, MAX_MARKER_LINE_WIDTH, CST_MARKER_LINE_WIDTH);\n\n            p.style('stroke-width', w + 'px')\n                .call(Color.fill, cont.fillcolor);\n\n            if(w) Color.stroke(p, cont.line.color);\n        });\n    }\n\n    function styleOHLC(d) {\n        var trace = d[0].trace;\n\n        var pts = d3.select(this).select('g.legendpoints')\n            .selectAll('path.legendohlc')\n            .data(trace.visible && trace.type === 'ohlc' ? [d, d] : []);\n        pts.enter().append('path').classed('legendohlc', true)\n            .attr('d', function(_, i) {\n                if(i) return 'M-15,0H0M-8,-6V0'; // increasing\n                return 'M15,0H0M8,6V0'; // decreasing\n            })\n            .attr('transform', 'translate(20,0)')\n            .style('stroke-miterlimit', 1);\n        pts.exit().remove();\n\n        pts.each(function(_, i) {\n            var p = d3.select(this);\n            var cont = trace[i ? 'increasing' : 'decreasing'];\n            var w = boundLineWidth(undefined, cont.line, MAX_MARKER_LINE_WIDTH, CST_MARKER_LINE_WIDTH);\n\n            p.style('fill', 'none')\n                .call(Drawing.dashLine, cont.line.dash, w);\n\n            if(w) Color.stroke(p, cont.line.color);\n        });\n    }\n\n    function stylePies(d) {\n        stylePieLike(d, this, 'pie');\n    }\n\n    function styleFunnelareas(d) {\n        stylePieLike(d, this, 'funnelarea');\n    }\n\n    function stylePieLike(d, lThis, desiredType) {\n        var d0 = d[0];\n        var trace = d0.trace;\n\n        var isVisible = (!desiredType) ? Registry.traceIs(trace, desiredType) :\n            (trace.visible && trace.type === desiredType);\n\n        var pts = d3.select(lThis).select('g.legendpoints')\n            .selectAll('path.legend' + desiredType)\n            .data(isVisible ? [d] : []);\n        pts.enter().append('path').classed('legend' + desiredType, true)\n            .attr('d', 'M6,6H-6V-6H6Z')\n            .attr('transform', 'translate(20,0)');\n        pts.exit().remove();\n\n        if(pts.size()) {\n            var cont = (trace.marker || {}).line;\n            var lw = boundLineWidth(pieCastOption(cont.width, d0.pts), cont, MAX_MARKER_LINE_WIDTH, CST_MARKER_LINE_WIDTH);\n\n            var tMod = Lib.minExtend(trace, {marker: {line: {width: lw}}});\n            // since minExtend do not slice more than 3 items we need to patch line.color here\n            tMod.marker.line.color = cont.color;\n\n            var d0Mod = Lib.minExtend(d0, {trace: tMod});\n\n            stylePie(pts, d0Mod, tMod);\n        }\n    }\n\n    function styleSpatial(d) { // i.e. maninly traces having z and colorscale\n        var trace = d[0].trace;\n\n        var useGradient;\n        var ptsData = [];\n        if(trace.visible) {\n            switch(trace.type) {\n                case 'histogram2d' :\n                case 'heatmap' :\n                    ptsData = [\n                        ['M-15,-2V4H15V-2Z'] // similar to contour\n                    ];\n                    useGradient = true;\n                    break;\n                case 'choropleth' :\n                case 'choroplethmapbox' :\n                    ptsData = [\n                        ['M-6,-6V6H6V-6Z']\n                    ];\n                    useGradient = true;\n                    break;\n                case 'densitymapbox' :\n                    ptsData = [\n                        ['M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0']\n                    ];\n                    useGradient = 'radial';\n                    break;\n                case 'cone' :\n                    ptsData = [\n                        ['M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z'],\n                        ['M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z'],\n                        ['M-6,-2 A2,2 0 0,0 -6,2 L6,0Z']\n                    ];\n                    useGradient = false;\n                    break;\n                case 'streamtube' :\n                    ptsData = [\n                        ['M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z'],\n                        ['M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z'],\n                        ['M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z']\n                    ];\n                    useGradient = false;\n                    break;\n                case 'surface' :\n                    ptsData = [\n                        ['M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z'],\n                        ['M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z']\n                    ];\n                    useGradient = true;\n                    break;\n                case 'mesh3d' :\n                    ptsData = [\n                        ['M-6,6H0L-6,-6Z'],\n                        ['M6,6H0L6,-6Z'],\n                        ['M-6,-6H6L0,6Z']\n                    ];\n                    useGradient = false;\n                    break;\n                case 'volume' :\n                    ptsData = [\n                        ['M-6,6H0L-6,-6Z'],\n                        ['M6,6H0L6,-6Z'],\n                        ['M-6,-6H6L0,6Z']\n                    ];\n                    useGradient = true;\n                    break;\n                case 'isosurface':\n                    ptsData = [\n                        ['M-6,6H0L-6,-6Z'],\n                        ['M6,6H0L6,-6Z'],\n                        ['M-6,-6 A12,24 0 0,0 6,-6 L0,6Z']\n                    ];\n                    useGradient = false;\n                    break;\n            }\n        }\n\n        var pts = d3.select(this).select('g.legendpoints')\n            .selectAll('path.legend3dandfriends')\n            .data(ptsData);\n        pts.enter().append('path').classed('legend3dandfriends', true)\n            .attr('transform', 'translate(20,0)')\n            .style('stroke-miterlimit', 1);\n        pts.exit().remove();\n\n        pts.each(function(dd, i) {\n            var pt = d3.select(this);\n\n            var cOpts = extractOpts(trace);\n            var colorscale = cOpts.colorscale;\n            var reversescale = cOpts.reversescale;\n            var fillGradient = function(s) {\n                if(s.size()) {\n                    var gradientID = 'legendfill-' + trace.uid;\n                    Drawing.gradient(s, gd, gradientID,\n                        getGradientDirection(reversescale, useGradient === 'radial'),\n                        colorscale, 'fill');\n                }\n            };\n\n            var fillColor;\n            if(!colorscale) {\n                var color = trace.vertexcolor || trace.facecolor || trace.color;\n                fillColor = Lib.isArrayOrTypedArray(color) ? (color[i] || color[0]) : color;\n            } else {\n                if(!useGradient) {\n                    var len = colorscale.length;\n                    fillColor =\n                        i === 0 ? colorscale[reversescale ? len - 1 : 0][1] : // minimum\n                        i === 1 ? colorscale[reversescale ? 0 : len - 1][1] : // maximum\n                            colorscale[Math.floor((len - 1) / 2)][1]; // middle\n                }\n            }\n\n            pt.attr('d', dd[0]);\n            if(fillColor) {\n                pt.call(Color.fill, fillColor);\n            } else {\n                pt.call(fillGradient);\n            }\n        });\n    }\n};\n\nfunction getGradientDirection(reversescale, isRadial) {\n    var str = isRadial ? 'radial' : 'horizontal';\n    return str + (reversescale ? '' : 'reversed');\n}\n\n},{\"../../lib\":178,\"../../registry\":269,\"../../traces/pie/helpers\":381,\"../../traces/pie/style_one\":387,\"../../traces/scatter/subtypes\":413,\"../color\":52,\"../colorscale/helpers\":63,\"../drawing\":74,\"d3\":16}],111:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Plots = _dereq_('../../plots/plots');\nvar axisIds = _dereq_('../../plots/cartesian/axis_ids');\nvar Icons = _dereq_('../../fonts/ploticon');\nvar eraseActiveShape = _dereq_('../shapes/draw').eraseActiveShape;\nvar Lib = _dereq_('../../lib');\nvar _ = Lib._;\n\nvar modeBarButtons = module.exports = {};\n\n/**\n * ModeBar buttons configuration\n *\n * @param {string} name\n *      name / id of the buttons (for tracking)\n * @param {string} title\n *      text that appears while hovering over the button,\n *      enter null, false or '' for no hover text\n * @param {string} icon\n *      svg icon object associated with the button\n *      can be linked to Plotly.Icons to use the default plotly icons\n * @param {string} [gravity]\n *      icon positioning\n * @param {function} click\n *      click handler associated with the button, a function of\n *      'gd' (the main graph object) and\n *      'ev' (the event object)\n * @param {string} [attr]\n *      attribute associated with button,\n *      use this with 'val' to keep track of the state\n * @param {*} [val]\n *      initial 'attr' value, can be a function of gd\n * @param {boolean} [toggle]\n *      is the button a toggle button?\n */\nmodeBarButtons.toImage = {\n    name: 'toImage',\n    title: function(gd) {\n        var opts = gd._context.toImageButtonOptions || {};\n        var format = opts.format || 'png';\n        return format === 'png' ?\n            _(gd, 'Download plot as a png') : // legacy text\n            _(gd, 'Download plot'); // generic non-PNG text\n    },\n    icon: Icons.camera,\n    click: function(gd) {\n        var toImageButtonOptions = gd._context.toImageButtonOptions;\n        var opts = {format: toImageButtonOptions.format || 'png'};\n\n        Lib.notifier(_(gd, 'Taking snapshot - this may take a few seconds'), 'long');\n\n        if(opts.format !== 'svg' && Lib.isIE()) {\n            Lib.notifier(_(gd, 'IE only supports svg.  Changing format to svg.'), 'long');\n            opts.format = 'svg';\n        }\n\n        ['filename', 'width', 'height', 'scale'].forEach(function(key) {\n            if(key in toImageButtonOptions) {\n                opts[key] = toImageButtonOptions[key];\n            }\n        });\n\n        Registry.call('downloadImage', gd, opts)\n          .then(function(filename) {\n              Lib.notifier(_(gd, 'Snapshot succeeded') + ' - ' + filename, 'long');\n          })\n          .catch(function() {\n              Lib.notifier(_(gd, 'Sorry, there was a problem downloading your snapshot!'), 'long');\n          });\n    }\n};\n\nmodeBarButtons.sendDataToCloud = {\n    name: 'sendDataToCloud',\n    title: function(gd) { return _(gd, 'Edit in Chart Studio'); },\n    icon: Icons.disk,\n    click: function(gd) {\n        Plots.sendDataToCloud(gd);\n    }\n};\n\nmodeBarButtons.editInChartStudio = {\n    name: 'editInChartStudio',\n    title: function(gd) { return _(gd, 'Edit in Chart Studio'); },\n    icon: Icons.pencil,\n    click: function(gd) {\n        Plots.sendDataToCloud(gd);\n    }\n};\n\nmodeBarButtons.zoom2d = {\n    name: 'zoom2d',\n    title: function(gd) { return _(gd, 'Zoom'); },\n    attr: 'dragmode',\n    val: 'zoom',\n    icon: Icons.zoombox,\n    click: handleCartesian\n};\n\nmodeBarButtons.pan2d = {\n    name: 'pan2d',\n    title: function(gd) { return _(gd, 'Pan'); },\n    attr: 'dragmode',\n    val: 'pan',\n    icon: Icons.pan,\n    click: handleCartesian\n};\n\nmodeBarButtons.select2d = {\n    name: 'select2d',\n    title: function(gd) { return _(gd, 'Box Select'); },\n    attr: 'dragmode',\n    val: 'select',\n    icon: Icons.selectbox,\n    click: handleCartesian\n};\n\nmodeBarButtons.lasso2d = {\n    name: 'lasso2d',\n    title: function(gd) { return _(gd, 'Lasso Select'); },\n    attr: 'dragmode',\n    val: 'lasso',\n    icon: Icons.lasso,\n    click: handleCartesian\n};\n\nmodeBarButtons.drawclosedpath = {\n    name: 'drawclosedpath',\n    title: function(gd) { return _(gd, 'Draw closed freeform'); },\n    attr: 'dragmode',\n    val: 'drawclosedpath',\n    icon: Icons.drawclosedpath,\n    click: handleCartesian\n};\n\nmodeBarButtons.drawopenpath = {\n    name: 'drawopenpath',\n    title: function(gd) { return _(gd, 'Draw open freeform'); },\n    attr: 'dragmode',\n    val: 'drawopenpath',\n    icon: Icons.drawopenpath,\n    click: handleCartesian\n};\n\nmodeBarButtons.drawline = {\n    name: 'drawline',\n    title: function(gd) { return _(gd, 'Draw line'); },\n    attr: 'dragmode',\n    val: 'drawline',\n    icon: Icons.drawline,\n    click: handleCartesian\n};\n\nmodeBarButtons.drawrect = {\n    name: 'drawrect',\n    title: function(gd) { return _(gd, 'Draw rectangle'); },\n    attr: 'dragmode',\n    val: 'drawrect',\n    icon: Icons.drawrect,\n    click: handleCartesian\n};\n\nmodeBarButtons.drawcircle = {\n    name: 'drawcircle',\n    title: function(gd) { return _(gd, 'Draw circle'); },\n    attr: 'dragmode',\n    val: 'drawcircle',\n    icon: Icons.drawcircle,\n    click: handleCartesian\n};\n\nmodeBarButtons.eraseshape = {\n    name: 'eraseshape',\n    title: function(gd) { return _(gd, 'Erase active shape'); },\n    icon: Icons.eraseshape,\n    click: eraseActiveShape\n};\n\nmodeBarButtons.zoomIn2d = {\n    name: 'zoomIn2d',\n    title: function(gd) { return _(gd, 'Zoom in'); },\n    attr: 'zoom',\n    val: 'in',\n    icon: Icons.zoom_plus,\n    click: handleCartesian\n};\n\nmodeBarButtons.zoomOut2d = {\n    name: 'zoomOut2d',\n    title: function(gd) { return _(gd, 'Zoom out'); },\n    attr: 'zoom',\n    val: 'out',\n    icon: Icons.zoom_minus,\n    click: handleCartesian\n};\n\nmodeBarButtons.autoScale2d = {\n    name: 'autoScale2d',\n    title: function(gd) { return _(gd, 'Autoscale'); },\n    attr: 'zoom',\n    val: 'auto',\n    icon: Icons.autoscale,\n    click: handleCartesian\n};\n\nmodeBarButtons.resetScale2d = {\n    name: 'resetScale2d',\n    title: function(gd) { return _(gd, 'Reset axes'); },\n    attr: 'zoom',\n    val: 'reset',\n    icon: Icons.home,\n    click: handleCartesian\n};\n\nmodeBarButtons.hoverClosestCartesian = {\n    name: 'hoverClosestCartesian',\n    title: function(gd) { return _(gd, 'Show closest data on hover'); },\n    attr: 'hovermode',\n    val: 'closest',\n    icon: Icons.tooltip_basic,\n    gravity: 'ne',\n    click: handleCartesian\n};\n\nmodeBarButtons.hoverCompareCartesian = {\n    name: 'hoverCompareCartesian',\n    title: function(gd) { return _(gd, 'Compare data on hover'); },\n    attr: 'hovermode',\n    val: function(gd) {\n        return gd._fullLayout._isHoriz ? 'y' : 'x';\n    },\n    icon: Icons.tooltip_compare,\n    gravity: 'ne',\n    click: handleCartesian\n};\n\nfunction handleCartesian(gd, ev) {\n    var button = ev.currentTarget;\n    var astr = button.getAttribute('data-attr');\n    var val = button.getAttribute('data-val') || true;\n    var fullLayout = gd._fullLayout;\n    var aobj = {};\n    var axList = axisIds.list(gd, null, true);\n    var allSpikesEnabled = fullLayout._cartesianSpikesEnabled;\n\n    var ax, i;\n\n    if(astr === 'zoom') {\n        var mag = (val === 'in') ? 0.5 : 2;\n        var r0 = (1 + mag) / 2;\n        var r1 = (1 - mag) / 2;\n        var axName;\n\n        for(i = 0; i < axList.length; i++) {\n            ax = axList[i];\n\n            if(!ax.fixedrange) {\n                axName = ax._name;\n                if(val === 'auto') {\n                    aobj[axName + '.autorange'] = true;\n                } else if(val === 'reset') {\n                    if(ax._rangeInitial === undefined) {\n                        aobj[axName + '.autorange'] = true;\n                    } else {\n                        var rangeInitial = ax._rangeInitial.slice();\n                        aobj[axName + '.range[0]'] = rangeInitial[0];\n                        aobj[axName + '.range[1]'] = rangeInitial[1];\n                    }\n\n                    // N.B. \"reset\" also resets showspikes\n                    if(ax._showSpikeInitial !== undefined) {\n                        aobj[axName + '.showspikes'] = ax._showSpikeInitial;\n                        if(allSpikesEnabled === 'on' && !ax._showSpikeInitial) {\n                            allSpikesEnabled = 'off';\n                        }\n                    }\n                } else {\n                    var rangeNow = [\n                        ax.r2l(ax.range[0]),\n                        ax.r2l(ax.range[1]),\n                    ];\n\n                    var rangeNew = [\n                        r0 * rangeNow[0] + r1 * rangeNow[1],\n                        r0 * rangeNow[1] + r1 * rangeNow[0]\n                    ];\n\n                    aobj[axName + '.range[0]'] = ax.l2r(rangeNew[0]);\n                    aobj[axName + '.range[1]'] = ax.l2r(rangeNew[1]);\n                }\n            }\n        }\n    } else {\n        // if ALL traces have orientation 'h', 'hovermode': 'x' otherwise: 'y'\n        if(astr === 'hovermode' && (val === 'x' || val === 'y')) {\n            val = fullLayout._isHoriz ? 'y' : 'x';\n            button.setAttribute('data-val', val);\n        }\n\n        aobj[astr] = val;\n    }\n\n    fullLayout._cartesianSpikesEnabled = allSpikesEnabled;\n\n    Registry.call('_guiRelayout', gd, aobj);\n}\n\nmodeBarButtons.zoom3d = {\n    name: 'zoom3d',\n    title: function(gd) { return _(gd, 'Zoom'); },\n    attr: 'scene.dragmode',\n    val: 'zoom',\n    icon: Icons.zoombox,\n    click: handleDrag3d\n};\n\nmodeBarButtons.pan3d = {\n    name: 'pan3d',\n    title: function(gd) { return _(gd, 'Pan'); },\n    attr: 'scene.dragmode',\n    val: 'pan',\n    icon: Icons.pan,\n    click: handleDrag3d\n};\n\nmodeBarButtons.orbitRotation = {\n    name: 'orbitRotation',\n    title: function(gd) { return _(gd, 'Orbital rotation'); },\n    attr: 'scene.dragmode',\n    val: 'orbit',\n    icon: Icons['3d_rotate'],\n    click: handleDrag3d\n};\n\nmodeBarButtons.tableRotation = {\n    name: 'tableRotation',\n    title: function(gd) { return _(gd, 'Turntable rotation'); },\n    attr: 'scene.dragmode',\n    val: 'turntable',\n    icon: Icons['z-axis'],\n    click: handleDrag3d\n};\n\nfunction handleDrag3d(gd, ev) {\n    var button = ev.currentTarget;\n    var attr = button.getAttribute('data-attr');\n    var val = button.getAttribute('data-val') || true;\n    var sceneIds = gd._fullLayout._subplots.gl3d || [];\n    var layoutUpdate = {};\n\n    var parts = attr.split('.');\n\n    for(var i = 0; i < sceneIds.length; i++) {\n        layoutUpdate[sceneIds[i] + '.' + parts[1]] = val;\n    }\n\n    // for multi-type subplots\n    var val2d = (val === 'pan') ? val : 'zoom';\n    layoutUpdate.dragmode = val2d;\n\n    Registry.call('_guiRelayout', gd, layoutUpdate);\n}\n\nmodeBarButtons.resetCameraDefault3d = {\n    name: 'resetCameraDefault3d',\n    title: function(gd) { return _(gd, 'Reset camera to default'); },\n    attr: 'resetDefault',\n    icon: Icons.home,\n    click: handleCamera3d\n};\n\nmodeBarButtons.resetCameraLastSave3d = {\n    name: 'resetCameraLastSave3d',\n    title: function(gd) { return _(gd, 'Reset camera to last save'); },\n    attr: 'resetLastSave',\n    icon: Icons.movie,\n    click: handleCamera3d\n};\n\nfunction handleCamera3d(gd, ev) {\n    var button = ev.currentTarget;\n    var attr = button.getAttribute('data-attr');\n    var fullLayout = gd._fullLayout;\n    var sceneIds = fullLayout._subplots.gl3d || [];\n    var aobj = {};\n\n    for(var i = 0; i < sceneIds.length; i++) {\n        var sceneId = sceneIds[i];\n        var camera = sceneId + '.camera';\n        var aspectratio = sceneId + '.aspectratio';\n        var aspectmode = sceneId + '.aspectmode';\n        var scene = fullLayout[sceneId]._scene;\n        var didUpdate;\n\n        if(attr === 'resetLastSave') {\n            aobj[camera + '.up'] = scene.viewInitial.up;\n            aobj[camera + '.eye'] = scene.viewInitial.eye;\n            aobj[camera + '.center'] = scene.viewInitial.center;\n            didUpdate = true;\n        } else if(attr === 'resetDefault') {\n            aobj[camera + '.up'] = null;\n            aobj[camera + '.eye'] = null;\n            aobj[camera + '.center'] = null;\n            didUpdate = true;\n        }\n\n        if(didUpdate) {\n            aobj[aspectratio + '.x'] = scene.viewInitial.aspectratio.x;\n            aobj[aspectratio + '.y'] = scene.viewInitial.aspectratio.y;\n            aobj[aspectratio + '.z'] = scene.viewInitial.aspectratio.z;\n            aobj[aspectmode] = scene.viewInitial.aspectmode;\n        }\n    }\n\n    Registry.call('_guiRelayout', gd, aobj);\n}\n\nmodeBarButtons.hoverClosest3d = {\n    name: 'hoverClosest3d',\n    title: function(gd) { return _(gd, 'Toggle show closest data on hover'); },\n    attr: 'hovermode',\n    val: null,\n    toggle: true,\n    icon: Icons.tooltip_basic,\n    gravity: 'ne',\n    click: handleHover3d\n};\n\nfunction getNextHover3d(gd, ev) {\n    var button = ev.currentTarget;\n    var val = button._previousVal;\n    var fullLayout = gd._fullLayout;\n    var sceneIds = fullLayout._subplots.gl3d || [];\n\n    var axes = ['xaxis', 'yaxis', 'zaxis'];\n\n    // initialize 'current spike' object to be stored in the DOM\n    var currentSpikes = {};\n    var layoutUpdate = {};\n\n    if(val) {\n        layoutUpdate = val;\n        button._previousVal = null;\n    } else {\n        for(var i = 0; i < sceneIds.length; i++) {\n            var sceneId = sceneIds[i];\n            var sceneLayout = fullLayout[sceneId];\n\n            var hovermodeAStr = sceneId + '.hovermode';\n            currentSpikes[hovermodeAStr] = sceneLayout.hovermode;\n            layoutUpdate[hovermodeAStr] = false;\n\n            // copy all the current spike attrs\n            for(var j = 0; j < 3; j++) {\n                var axis = axes[j];\n                var spikeAStr = sceneId + '.' + axis + '.showspikes';\n                layoutUpdate[spikeAStr] = false;\n                currentSpikes[spikeAStr] = sceneLayout[axis].showspikes;\n            }\n        }\n\n        button._previousVal = currentSpikes;\n    }\n    return layoutUpdate;\n}\n\nfunction handleHover3d(gd, ev) {\n    var layoutUpdate = getNextHover3d(gd, ev);\n    Registry.call('_guiRelayout', gd, layoutUpdate);\n}\n\nmodeBarButtons.zoomInGeo = {\n    name: 'zoomInGeo',\n    title: function(gd) { return _(gd, 'Zoom in'); },\n    attr: 'zoom',\n    val: 'in',\n    icon: Icons.zoom_plus,\n    click: handleGeo\n};\n\nmodeBarButtons.zoomOutGeo = {\n    name: 'zoomOutGeo',\n    title: function(gd) { return _(gd, 'Zoom out'); },\n    attr: 'zoom',\n    val: 'out',\n    icon: Icons.zoom_minus,\n    click: handleGeo\n};\n\nmodeBarButtons.resetGeo = {\n    name: 'resetGeo',\n    title: function(gd) { return _(gd, 'Reset'); },\n    attr: 'reset',\n    val: null,\n    icon: Icons.autoscale,\n    click: handleGeo\n};\n\nmodeBarButtons.hoverClosestGeo = {\n    name: 'hoverClosestGeo',\n    title: function(gd) { return _(gd, 'Toggle show closest data on hover'); },\n    attr: 'hovermode',\n    val: null,\n    toggle: true,\n    icon: Icons.tooltip_basic,\n    gravity: 'ne',\n    click: toggleHover\n};\n\nfunction handleGeo(gd, ev) {\n    var button = ev.currentTarget;\n    var attr = button.getAttribute('data-attr');\n    var val = button.getAttribute('data-val') || true;\n    var fullLayout = gd._fullLayout;\n    var geoIds = fullLayout._subplots.geo || [];\n\n    for(var i = 0; i < geoIds.length; i++) {\n        var id = geoIds[i];\n        var geoLayout = fullLayout[id];\n\n        if(attr === 'zoom') {\n            var scale = geoLayout.projection.scale;\n            var newScale = (val === 'in') ? 2 * scale : 0.5 * scale;\n\n            Registry.call('_guiRelayout', gd, id + '.projection.scale', newScale);\n        }\n    }\n\n    if(attr === 'reset') {\n        resetView(gd, 'geo');\n    }\n}\n\nmodeBarButtons.hoverClosestGl2d = {\n    name: 'hoverClosestGl2d',\n    title: function(gd) { return _(gd, 'Toggle show closest data on hover'); },\n    attr: 'hovermode',\n    val: null,\n    toggle: true,\n    icon: Icons.tooltip_basic,\n    gravity: 'ne',\n    click: toggleHover\n};\n\nmodeBarButtons.hoverClosestPie = {\n    name: 'hoverClosestPie',\n    title: function(gd) { return _(gd, 'Toggle show closest data on hover'); },\n    attr: 'hovermode',\n    val: 'closest',\n    icon: Icons.tooltip_basic,\n    gravity: 'ne',\n    click: toggleHover\n};\n\nfunction getNextHover(gd) {\n    var fullLayout = gd._fullLayout;\n\n    if(fullLayout.hovermode) return false;\n\n    if(fullLayout._has('cartesian')) {\n        return fullLayout._isHoriz ? 'y' : 'x';\n    }\n    return 'closest';\n}\n\nfunction toggleHover(gd) {\n    var newHover = getNextHover(gd);\n    Registry.call('_guiRelayout', gd, 'hovermode', newHover);\n}\n\nmodeBarButtons.resetViewSankey = {\n    name: 'resetSankeyGroup',\n    title: function(gd) { return _(gd, 'Reset view'); },\n    icon: Icons.home,\n    click: function(gd) {\n        var aObj = {\n            'node.groups': [],\n            'node.x': [],\n            'node.y': []\n        };\n        for(var i = 0; i < gd._fullData.length; i++) {\n            var viewInitial = gd._fullData[i]._viewInitial;\n            aObj['node.groups'].push(viewInitial.node.groups.slice());\n            aObj['node.x'].push(viewInitial.node.x.slice());\n            aObj['node.y'].push(viewInitial.node.y.slice());\n        }\n        Registry.call('restyle', gd, aObj);\n    }\n};\n\n// buttons when more then one plot types are present\n\nmodeBarButtons.toggleHover = {\n    name: 'toggleHover',\n    title: function(gd) { return _(gd, 'Toggle show closest data on hover'); },\n    attr: 'hovermode',\n    val: null,\n    toggle: true,\n    icon: Icons.tooltip_basic,\n    gravity: 'ne',\n    click: function(gd, ev) {\n        var layoutUpdate = getNextHover3d(gd, ev);\n        layoutUpdate.hovermode = getNextHover(gd);\n\n        Registry.call('_guiRelayout', gd, layoutUpdate);\n    }\n};\n\nmodeBarButtons.resetViews = {\n    name: 'resetViews',\n    title: function(gd) { return _(gd, 'Reset views'); },\n    icon: Icons.home,\n    click: function(gd, ev) {\n        var button = ev.currentTarget;\n\n        button.setAttribute('data-attr', 'zoom');\n        button.setAttribute('data-val', 'reset');\n        handleCartesian(gd, ev);\n\n        button.setAttribute('data-attr', 'resetLastSave');\n        handleCamera3d(gd, ev);\n\n        resetView(gd, 'geo');\n        resetView(gd, 'mapbox');\n    }\n};\n\nmodeBarButtons.toggleSpikelines = {\n    name: 'toggleSpikelines',\n    title: function(gd) { return _(gd, 'Toggle Spike Lines'); },\n    icon: Icons.spikeline,\n    attr: '_cartesianSpikesEnabled',\n    val: 'on',\n    click: function(gd) {\n        var fullLayout = gd._fullLayout;\n        var allSpikesEnabled = fullLayout._cartesianSpikesEnabled;\n\n        fullLayout._cartesianSpikesEnabled = allSpikesEnabled === 'on' ? 'off' : 'on';\n        Registry.call('_guiRelayout', gd, setSpikelineVisibility(gd));\n    }\n};\n\nfunction setSpikelineVisibility(gd) {\n    var fullLayout = gd._fullLayout;\n    var areSpikesOn = fullLayout._cartesianSpikesEnabled === 'on';\n    var axList = axisIds.list(gd, null, true);\n    var aobj = {};\n\n    for(var i = 0; i < axList.length; i++) {\n        var ax = axList[i];\n        aobj[ax._name + '.showspikes'] = areSpikesOn ? true : ax._showSpikeInitial;\n    }\n\n    return aobj;\n}\n\nmodeBarButtons.resetViewMapbox = {\n    name: 'resetViewMapbox',\n    title: function(gd) { return _(gd, 'Reset view'); },\n    attr: 'reset',\n    icon: Icons.home,\n    click: function(gd) {\n        resetView(gd, 'mapbox');\n    }\n};\n\nmodeBarButtons.zoomInMapbox = {\n    name: 'zoomInMapbox',\n    title: function(gd) { return _(gd, 'Zoom in'); },\n    attr: 'zoom',\n    val: 'in',\n    icon: Icons.zoom_plus,\n    click: handleMapboxZoom\n};\n\nmodeBarButtons.zoomOutMapbox = {\n    name: 'zoomOutMapbox',\n    title: function(gd) { return _(gd, 'Zoom out'); },\n    attr: 'zoom',\n    val: 'out',\n    icon: Icons.zoom_minus,\n    click: handleMapboxZoom\n};\n\nfunction handleMapboxZoom(gd, ev) {\n    var button = ev.currentTarget;\n    var val = button.getAttribute('data-val');\n    var fullLayout = gd._fullLayout;\n    var subplotIds = fullLayout._subplots.mapbox || [];\n    var scalar = 1.05;\n    var aObj = {};\n\n    for(var i = 0; i < subplotIds.length; i++) {\n        var id = subplotIds[i];\n        var current = fullLayout[id].zoom;\n        var next = (val === 'in') ? scalar * current : current / scalar;\n        aObj[id + '.zoom'] = next;\n    }\n\n    Registry.call('_guiRelayout', gd, aObj);\n}\n\nfunction resetView(gd, subplotType) {\n    var fullLayout = gd._fullLayout;\n    var subplotIds = fullLayout._subplots[subplotType] || [];\n    var aObj = {};\n\n    for(var i = 0; i < subplotIds.length; i++) {\n        var id = subplotIds[i];\n        var subplotObj = fullLayout[id]._subplot;\n        var viewInitial = subplotObj.viewInitial;\n        var viewKeys = Object.keys(viewInitial);\n\n        for(var j = 0; j < viewKeys.length; j++) {\n            var key = viewKeys[j];\n            aObj[id + '.' + key] = viewInitial[key];\n        }\n    }\n\n    Registry.call('_guiRelayout', gd, aObj);\n}\n\n},{\"../../fonts/ploticon\":162,\"../../lib\":178,\"../../plots/cartesian/axis_ids\":225,\"../../plots/plots\":256,\"../../registry\":269,\"../shapes/draw\":133}],112:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nexports.manage = _dereq_('./manage');\n\n},{\"./manage\":113}],113:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar axisIds = _dereq_('../../plots/cartesian/axis_ids');\nvar scatterSubTypes = _dereq_('../../traces/scatter/subtypes');\nvar Registry = _dereq_('../../registry');\nvar isUnifiedHover = _dereq_('../fx/helpers').isUnifiedHover;\n\nvar createModeBar = _dereq_('./modebar');\nvar modeBarButtons = _dereq_('./buttons');\n\n/**\n * ModeBar wrapper around 'create' and 'update',\n * chooses buttons to pass to ModeBar constructor based on\n * plot type and plot config.\n *\n * @param {object} gd main plot object\n *\n */\nmodule.exports = function manageModeBar(gd) {\n    var fullLayout = gd._fullLayout;\n    var context = gd._context;\n    var modeBar = fullLayout._modeBar;\n\n    if(!context.displayModeBar && !context.watermark) {\n        if(modeBar) {\n            modeBar.destroy();\n            delete fullLayout._modeBar;\n        }\n        return;\n    }\n\n    if(!Array.isArray(context.modeBarButtonsToRemove)) {\n        throw new Error([\n            '*modeBarButtonsToRemove* configuration options',\n            'must be an array.'\n        ].join(' '));\n    }\n\n    if(!Array.isArray(context.modeBarButtonsToAdd)) {\n        throw new Error([\n            '*modeBarButtonsToAdd* configuration options',\n            'must be an array.'\n        ].join(' '));\n    }\n\n    var customButtons = context.modeBarButtons;\n    var buttonGroups;\n\n    if(Array.isArray(customButtons) && customButtons.length) {\n        buttonGroups = fillCustomButton(customButtons);\n    } else if(!context.displayModeBar && context.watermark) {\n        buttonGroups = [];\n    } else {\n        buttonGroups = getButtonGroups(gd);\n    }\n\n    if(modeBar) modeBar.update(gd, buttonGroups);\n    else fullLayout._modeBar = createModeBar(gd, buttonGroups);\n};\n\nvar DRAW_MODES = [\n    'drawline',\n    'drawopenpath',\n    'drawclosedpath',\n    'drawcircle',\n    'drawrect',\n    'eraseshape'\n];\n\n// logic behind which buttons are displayed by default\nfunction getButtonGroups(gd) {\n    var fullLayout = gd._fullLayout;\n    var fullData = gd._fullData;\n    var context = gd._context;\n    var buttonsToRemove = context.modeBarButtonsToRemove;\n    var buttonsToAdd = context.modeBarButtonsToAdd;\n\n    var hasCartesian = fullLayout._has('cartesian');\n    var hasGL3D = fullLayout._has('gl3d');\n    var hasGeo = fullLayout._has('geo');\n    var hasPie = fullLayout._has('pie');\n    var hasFunnelarea = fullLayout._has('funnelarea');\n    var hasGL2D = fullLayout._has('gl2d');\n    var hasTernary = fullLayout._has('ternary');\n    var hasMapbox = fullLayout._has('mapbox');\n    var hasPolar = fullLayout._has('polar');\n    var hasSankey = fullLayout._has('sankey');\n    var allAxesFixed = areAllAxesFixed(fullLayout);\n    var hasUnifiedHoverLabel = isUnifiedHover(fullLayout.hovermode);\n\n    var groups = [];\n\n    function addGroup(newGroup) {\n        if(!newGroup.length) return;\n\n        var out = [];\n\n        for(var i = 0; i < newGroup.length; i++) {\n            var button = newGroup[i];\n            if(buttonsToRemove.indexOf(button) !== -1) continue;\n            out.push(modeBarButtons[button]);\n        }\n\n        groups.push(out);\n    }\n\n    // buttons common to all plot types\n    var commonGroup = ['toImage'];\n    if(context.showEditInChartStudio) commonGroup.push('editInChartStudio');\n    else if(context.showSendToCloud) commonGroup.push('sendDataToCloud');\n    addGroup(commonGroup);\n\n    var zoomGroup = [];\n    var hoverGroup = [];\n    var resetGroup = [];\n    var dragModeGroup = [];\n\n    if((hasCartesian || hasGL2D || hasPie || hasFunnelarea || hasTernary) + hasGeo + hasGL3D + hasMapbox + hasPolar > 1) {\n        // graphs with more than one plot types get 'union buttons'\n        // which reset the view or toggle hover labels across all subplots.\n        hoverGroup = ['toggleHover'];\n        resetGroup = ['resetViews'];\n    } else if(hasGeo) {\n        zoomGroup = ['zoomInGeo', 'zoomOutGeo'];\n        hoverGroup = ['hoverClosestGeo'];\n        resetGroup = ['resetGeo'];\n    } else if(hasGL3D) {\n        hoverGroup = ['hoverClosest3d'];\n        resetGroup = ['resetCameraDefault3d', 'resetCameraLastSave3d'];\n    } else if(hasMapbox) {\n        zoomGroup = ['zoomInMapbox', 'zoomOutMapbox'];\n        hoverGroup = ['toggleHover'];\n        resetGroup = ['resetViewMapbox'];\n    } else if(hasGL2D) {\n        hoverGroup = ['hoverClosestGl2d'];\n    } else if(hasPie) {\n        hoverGroup = ['hoverClosestPie'];\n    } else if(hasSankey) {\n        hoverGroup = ['hoverClosestCartesian', 'hoverCompareCartesian'];\n        resetGroup = ['resetViewSankey'];\n    } else { // hasPolar, hasTernary\n        // always show at least one hover icon.\n        hoverGroup = ['toggleHover'];\n    }\n    // if we have cartesian, allow switching between closest and compare\n    // regardless of what other types are on the plot, since they'll all\n    // just treat any truthy hovermode as 'closest'\n    if(hasCartesian) {\n        hoverGroup = ['toggleSpikelines', 'hoverClosestCartesian', 'hoverCompareCartesian'];\n    }\n    if(hasNoHover(fullData) || hasUnifiedHoverLabel) {\n        hoverGroup = [];\n    }\n\n    if((hasCartesian || hasGL2D) && !allAxesFixed) {\n        zoomGroup = ['zoomIn2d', 'zoomOut2d', 'autoScale2d'];\n        if(resetGroup[0] !== 'resetViews') resetGroup = ['resetScale2d'];\n    }\n\n    if(hasGL3D) {\n        dragModeGroup = ['zoom3d', 'pan3d', 'orbitRotation', 'tableRotation'];\n    } else if(((hasCartesian || hasGL2D) && !allAxesFixed) || hasTernary) {\n        dragModeGroup = ['zoom2d', 'pan2d'];\n    } else if(hasMapbox || hasGeo) {\n        dragModeGroup = ['pan2d'];\n    } else if(hasPolar) {\n        dragModeGroup = ['zoom2d'];\n    }\n    if(isSelectable(fullData)) {\n        dragModeGroup.push('select2d', 'lasso2d');\n    }\n\n    // accept pre-defined buttons as string\n    if(Array.isArray(buttonsToAdd)) {\n        var newList = [];\n        for(var i = 0; i < buttonsToAdd.length; i++) {\n            var b = buttonsToAdd[i];\n            if(typeof b === 'string') {\n                if(DRAW_MODES.indexOf(b) !== -1) {\n                    if(\n                        fullLayout._has('mapbox') || // draw shapes in paper coordinate (could be improved in future to support data coordinate, when there is no pitch)\n                        fullLayout._has('cartesian') // draw shapes in data coordinate\n                    ) {\n                        dragModeGroup.push(b);\n                    }\n                }\n            } else newList.push(b);\n        }\n        buttonsToAdd = newList;\n    }\n\n    addGroup(dragModeGroup);\n    addGroup(zoomGroup.concat(resetGroup));\n    addGroup(hoverGroup);\n\n    return appendButtonsToGroups(groups, buttonsToAdd);\n}\n\nfunction areAllAxesFixed(fullLayout) {\n    var axList = axisIds.list({_fullLayout: fullLayout}, null, true);\n\n    for(var i = 0; i < axList.length; i++) {\n        if(!axList[i].fixedrange) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\n// look for traces that support selection\n// to be updated as we add more selectPoints handlers\nfunction isSelectable(fullData) {\n    var selectable = false;\n\n    for(var i = 0; i < fullData.length; i++) {\n        if(selectable) break;\n\n        var trace = fullData[i];\n\n        if(!trace._module || !trace._module.selectPoints) continue;\n\n        if(Registry.traceIs(trace, 'scatter-like')) {\n            if(scatterSubTypes.hasMarkers(trace) || scatterSubTypes.hasText(trace)) {\n                selectable = true;\n            }\n        } else if(Registry.traceIs(trace, 'box-violin')) {\n            if(trace.boxpoints === 'all' || trace.points === 'all') {\n                selectable = true;\n            }\n        } else {\n            // assume that in general if the trace module has selectPoints,\n            // then it's selectable. Scatter is an exception to this because it must\n            // have markers or text, not just be a scatter type.\n\n            selectable = true;\n        }\n    }\n\n    return selectable;\n}\n\n// check whether all trace are 'noHover'\nfunction hasNoHover(fullData) {\n    for(var i = 0; i < fullData.length; i++) {\n        if(!Registry.traceIs(fullData[i], 'noHover')) return false;\n    }\n    return true;\n}\n\nfunction appendButtonsToGroups(groups, buttons) {\n    if(buttons.length) {\n        if(Array.isArray(buttons[0])) {\n            for(var i = 0; i < buttons.length; i++) {\n                groups.push(buttons[i]);\n            }\n        } else groups.push(buttons);\n    }\n\n    return groups;\n}\n\n// fill in custom buttons referring to default mode bar buttons\nfunction fillCustomButton(customButtons) {\n    for(var i = 0; i < customButtons.length; i++) {\n        var buttonGroup = customButtons[i];\n\n        for(var j = 0; j < buttonGroup.length; j++) {\n            var button = buttonGroup[j];\n\n            if(typeof button === 'string') {\n                if(modeBarButtons[button] !== undefined) {\n                    customButtons[i][j] = modeBarButtons[button];\n                } else {\n                    throw new Error([\n                        '*modeBarButtons* configuration options',\n                        'invalid button name'\n                    ].join(' '));\n                }\n            }\n        }\n    }\n\n    return customButtons;\n}\n\n},{\"../../plots/cartesian/axis_ids\":225,\"../../registry\":269,\"../../traces/scatter/subtypes\":413,\"../fx/helpers\":88,\"./buttons\":111,\"./modebar\":114}],114:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar Icons = _dereq_('../../fonts/ploticon');\nvar Parser = new DOMParser();\n\n/**\n * UI controller for interactive plots\n * @Class\n * @Param {object} opts\n * @Param {object} opts.buttons    nested arrays of grouped buttons config objects\n * @Param {object} opts.container  container div to append modeBar\n * @Param {object} opts.graphInfo  primary plot object containing data and layout\n */\nfunction ModeBar(opts) {\n    this.container = opts.container;\n    this.element = document.createElement('div');\n\n    this.update(opts.graphInfo, opts.buttons);\n\n    this.container.appendChild(this.element);\n}\n\nvar proto = ModeBar.prototype;\n\n/**\n * Update modeBar (buttons and logo)\n *\n * @param {object} graphInfo  primary plot object containing data and layout\n * @param {array of arrays} buttons nested arrays of grouped buttons to initialize\n *\n */\nproto.update = function(graphInfo, buttons) {\n    this.graphInfo = graphInfo;\n\n    var context = this.graphInfo._context;\n    var fullLayout = this.graphInfo._fullLayout;\n    var modeBarId = 'modebar-' + fullLayout._uid;\n\n    this.element.setAttribute('id', modeBarId);\n    this._uid = modeBarId;\n\n    this.element.className = 'modebar';\n    if(context.displayModeBar === 'hover') this.element.className += ' modebar--hover ease-bg';\n\n    if(fullLayout.modebar.orientation === 'v') {\n        this.element.className += ' vertical';\n        buttons = buttons.reverse();\n    }\n\n    var style = fullLayout.modebar;\n    var bgSelector = context.displayModeBar === 'hover' ? '.js-plotly-plot .plotly:hover ' : '';\n\n    Lib.deleteRelatedStyleRule(modeBarId);\n    Lib.addRelatedStyleRule(modeBarId, bgSelector + '#' + modeBarId + ' .modebar-group', 'background-color: ' + style.bgcolor);\n    Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn .icon path', 'fill: ' + style.color);\n    Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn:hover .icon path', 'fill: ' + style.activecolor);\n    Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn.active .icon path', 'fill: ' + style.activecolor);\n\n    // if buttons or logo have changed, redraw modebar interior\n    var needsNewButtons = !this.hasButtons(buttons);\n    var needsNewLogo = (this.hasLogo !== context.displaylogo);\n    var needsNewLocale = (this.locale !== context.locale);\n\n    this.locale = context.locale;\n\n    if(needsNewButtons || needsNewLogo || needsNewLocale) {\n        this.removeAllButtons();\n\n        this.updateButtons(buttons);\n\n        if(context.watermark || context.displaylogo) {\n            var logoGroup = this.getLogo();\n            if(context.watermark) {\n                logoGroup.className = logoGroup.className + ' watermark';\n            }\n\n            if(fullLayout.modebar.orientation === 'v') {\n                this.element.insertBefore(logoGroup, this.element.childNodes[0]);\n            } else {\n                this.element.appendChild(logoGroup);\n            }\n\n            this.hasLogo = true;\n        }\n    }\n\n    this.updateActiveButton();\n};\n\nproto.updateButtons = function(buttons) {\n    var _this = this;\n\n    this.buttons = buttons;\n    this.buttonElements = [];\n    this.buttonsNames = [];\n\n    this.buttons.forEach(function(buttonGroup) {\n        var group = _this.createGroup();\n\n        buttonGroup.forEach(function(buttonConfig) {\n            var buttonName = buttonConfig.name;\n            if(!buttonName) {\n                throw new Error('must provide button \\'name\\' in button config');\n            }\n            if(_this.buttonsNames.indexOf(buttonName) !== -1) {\n                throw new Error('button name \\'' + buttonName + '\\' is taken');\n            }\n            _this.buttonsNames.push(buttonName);\n\n            var button = _this.createButton(buttonConfig);\n            _this.buttonElements.push(button);\n            group.appendChild(button);\n        });\n\n        _this.element.appendChild(group);\n    });\n};\n\n/**\n * Empty div for containing a group of buttons\n * @Return {HTMLelement}\n */\nproto.createGroup = function() {\n    var group = document.createElement('div');\n    group.className = 'modebar-group';\n    return group;\n};\n\n/**\n * Create a new button div and set constant and configurable attributes\n * @Param {object} config (see ./buttons.js for more info)\n * @Return {HTMLelement}\n */\nproto.createButton = function(config) {\n    var _this = this;\n    var button = document.createElement('a');\n\n    button.setAttribute('rel', 'tooltip');\n    button.className = 'modebar-btn';\n\n    var title = config.title;\n    if(title === undefined) title = config.name;\n    // for localization: allow title to be a callable that takes gd as arg\n    else if(typeof title === 'function') title = title(this.graphInfo);\n\n    if(title || title === 0) button.setAttribute('data-title', title);\n\n    if(config.attr !== undefined) button.setAttribute('data-attr', config.attr);\n\n    var val = config.val;\n    if(val !== undefined) {\n        if(typeof val === 'function') val = val(this.graphInfo);\n        button.setAttribute('data-val', val);\n    }\n\n    var click = config.click;\n    if(typeof click !== 'function') {\n        throw new Error('must provide button \\'click\\' function in button config');\n    } else {\n        button.addEventListener('click', function(ev) {\n            config.click(_this.graphInfo, ev);\n\n            // only needed for 'hoverClosestGeo' which does not call relayout\n            _this.updateActiveButton(ev.currentTarget);\n        });\n    }\n\n    button.setAttribute('data-toggle', config.toggle || false);\n    if(config.toggle) d3.select(button).classed('active', true);\n\n    var icon = config.icon;\n    if(typeof icon === 'function') {\n        button.appendChild(icon());\n    } else {\n        button.appendChild(this.createIcon(icon || Icons.question));\n    }\n    button.setAttribute('data-gravity', config.gravity || 'n');\n\n    return button;\n};\n\n/**\n * Add an icon to a button\n * @Param {object} thisIcon\n * @Param {number} thisIcon.width\n * @Param {string} thisIcon.path\n * @Param {string} thisIcon.color\n * @Return {HTMLelement}\n */\nproto.createIcon = function(thisIcon) {\n    var iconHeight = isNumeric(thisIcon.height) ?\n        Number(thisIcon.height) :\n        thisIcon.ascent - thisIcon.descent;\n    var svgNS = 'http://www.w3.org/2000/svg';\n    var icon;\n\n    if(thisIcon.path) {\n        icon = document.createElementNS(svgNS, 'svg');\n        icon.setAttribute('viewBox', [0, 0, thisIcon.width, iconHeight].join(' '));\n        icon.setAttribute('class', 'icon');\n\n        var path = document.createElementNS(svgNS, 'path');\n        path.setAttribute('d', thisIcon.path);\n\n        if(thisIcon.transform) {\n            path.setAttribute('transform', thisIcon.transform);\n        } else if(thisIcon.ascent !== undefined) {\n            // Legacy icon transform calculation\n            path.setAttribute('transform', 'matrix(1 0 0 -1 0 ' + thisIcon.ascent + ')');\n        }\n\n        icon.appendChild(path);\n    }\n\n    if(thisIcon.svg) {\n        var svgDoc = Parser.parseFromString(thisIcon.svg, 'application/xml');\n        icon = svgDoc.childNodes[0];\n    }\n\n    icon.setAttribute('height', '1em');\n    icon.setAttribute('width', '1em');\n\n    return icon;\n};\n\n/**\n * Updates active button with attribute specified in layout\n * @Param {object} graphInfo plot object containing data and layout\n * @Return {HTMLelement}\n */\nproto.updateActiveButton = function(buttonClicked) {\n    var fullLayout = this.graphInfo._fullLayout;\n    var dataAttrClicked = (buttonClicked !== undefined) ?\n        buttonClicked.getAttribute('data-attr') :\n        null;\n\n    this.buttonElements.forEach(function(button) {\n        var thisval = button.getAttribute('data-val') || true;\n        var dataAttr = button.getAttribute('data-attr');\n        var isToggleButton = (button.getAttribute('data-toggle') === 'true');\n        var button3 = d3.select(button);\n\n        // Use 'data-toggle' and 'buttonClicked' to toggle buttons\n        // that have no one-to-one equivalent in fullLayout\n        if(isToggleButton) {\n            if(dataAttr === dataAttrClicked) {\n                button3.classed('active', !button3.classed('active'));\n            }\n        } else {\n            var val = (dataAttr === null) ?\n                dataAttr :\n                Lib.nestedProperty(fullLayout, dataAttr).get();\n\n            button3.classed('active', val === thisval);\n        }\n    });\n};\n\n/**\n * Check if modeBar is configured as button configuration argument\n *\n * @Param {object} buttons 2d array of grouped button config objects\n * @Return {boolean}\n */\nproto.hasButtons = function(buttons) {\n    var currentButtons = this.buttons;\n\n    if(!currentButtons) return false;\n\n    if(buttons.length !== currentButtons.length) return false;\n\n    for(var i = 0; i < buttons.length; ++i) {\n        if(buttons[i].length !== currentButtons[i].length) return false;\n        for(var j = 0; j < buttons[i].length; j++) {\n            if(buttons[i][j].name !== currentButtons[i][j].name) return false;\n        }\n    }\n\n    return true;\n};\n\n/**\n * @return {HTMLDivElement} The logo image wrapped in a group\n */\nproto.getLogo = function() {\n    var group = this.createGroup();\n    var a = document.createElement('a');\n\n    a.href = 'https://plotly.com/';\n    a.target = '_blank';\n    a.setAttribute('data-title', Lib._(this.graphInfo, 'Produced with Plotly'));\n    a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';\n\n    a.appendChild(this.createIcon(Icons.newplotlylogo));\n\n    group.appendChild(a);\n    return group;\n};\n\nproto.removeAllButtons = function() {\n    while(this.element.firstChild) {\n        this.element.removeChild(this.element.firstChild);\n    }\n\n    this.hasLogo = false;\n};\n\nproto.destroy = function() {\n    Lib.removeElement(this.container.querySelector('.modebar'));\n    Lib.deleteRelatedStyleRule(this._uid);\n};\n\nfunction createModeBar(gd, buttons) {\n    var fullLayout = gd._fullLayout;\n\n    var modeBar = new ModeBar({\n        graphInfo: gd,\n        container: fullLayout._modebardiv.node(),\n        buttons: buttons\n    });\n\n    if(fullLayout._privateplot) {\n        d3.select(modeBar.element).append('span')\n            .classed('badge-private float--left', true)\n            .text('PRIVATE');\n    }\n\n    return modeBar;\n}\n\nmodule.exports = createModeBar;\n\n},{\"../../fonts/ploticon\":162,\"../../lib\":178,\"d3\":16,\"fast-isnumeric\":18}],115:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar colorAttrs = _dereq_('../color/attributes');\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nvar buttonAttrs = templatedArray('button', {\n    visible: {\n        valType: 'boolean',\n        \n        dflt: true,\n        editType: 'plot',\n        \n    },\n    step: {\n        valType: 'enumerated',\n        \n        values: ['month', 'year', 'day', 'hour', 'minute', 'second', 'all'],\n        dflt: 'month',\n        editType: 'plot',\n        \n    },\n    stepmode: {\n        valType: 'enumerated',\n        \n        values: ['backward', 'todate'],\n        dflt: 'backward',\n        editType: 'plot',\n        \n    },\n    count: {\n        valType: 'number',\n        \n        min: 0,\n        dflt: 1,\n        editType: 'plot',\n        \n    },\n    label: {\n        valType: 'string',\n        \n        editType: 'plot',\n        \n    },\n    editType: 'plot',\n    \n});\n\nmodule.exports = {\n    visible: {\n        valType: 'boolean',\n        \n        editType: 'plot',\n        \n    },\n\n    buttons: buttonAttrs,\n\n    x: {\n        valType: 'number',\n        min: -2,\n        max: 3,\n        \n        editType: 'plot',\n        \n    },\n    xanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'left', 'center', 'right'],\n        dflt: 'left',\n        \n        editType: 'plot',\n        \n    },\n    y: {\n        valType: 'number',\n        min: -2,\n        max: 3,\n        \n        editType: 'plot',\n        \n    },\n    yanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'top', 'middle', 'bottom'],\n        dflt: 'bottom',\n        \n        editType: 'plot',\n        \n    },\n\n    font: fontAttrs({\n        editType: 'plot',\n        \n    }),\n\n    bgcolor: {\n        valType: 'color',\n        dflt: colorAttrs.lightLine,\n        \n        editType: 'plot',\n        \n    },\n    activecolor: {\n        valType: 'color',\n        \n        editType: 'plot',\n        \n    },\n    bordercolor: {\n        valType: 'color',\n        dflt: colorAttrs.defaultLine,\n        \n        editType: 'plot',\n        \n    },\n    borderwidth: {\n        valType: 'number',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'plot',\n        \n    },\n    editType: 'plot'\n};\n\n},{\"../../plot_api/plot_template\":212,\"../../plots/font_attributes\":250,\"../color/attributes\":51}],116:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n\n    // 'y' position pad above counter axis domain\n    yPad: 0.02,\n\n    // minimum button width (regardless of text size)\n    minButtonWidth: 30,\n\n    // buttons rect radii\n    rx: 3,\n    ry: 3,\n\n    // light fraction used to compute the 'activecolor' default\n    lightAmount: 25,\n    darkAmount: 10\n};\n\n},{}],117:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../color');\nvar Template = _dereq_('../../plot_api/plot_template');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\n\nvar attributes = _dereq_('./attributes');\nvar constants = _dereq_('./constants');\n\n\nmodule.exports = function handleDefaults(containerIn, containerOut, layout, counterAxes, calendar) {\n    var selectorIn = containerIn.rangeselector || {};\n    var selectorOut = Template.newContainer(containerOut, 'rangeselector');\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(selectorIn, selectorOut, attributes, attr, dflt);\n    }\n\n    var buttons = handleArrayContainerDefaults(selectorIn, selectorOut, {\n        name: 'buttons',\n        handleItemDefaults: buttonDefaults,\n        calendar: calendar\n    });\n\n    var visible = coerce('visible', buttons.length > 0);\n    if(visible) {\n        var posDflt = getPosDflt(containerOut, layout, counterAxes);\n        coerce('x', posDflt[0]);\n        coerce('y', posDflt[1]);\n        Lib.noneOrAll(containerIn, containerOut, ['x', 'y']);\n\n        coerce('xanchor');\n        coerce('yanchor');\n\n        Lib.coerceFont(coerce, 'font', layout.font);\n\n        var bgColor = coerce('bgcolor');\n        coerce('activecolor', Color.contrast(bgColor, constants.lightAmount, constants.darkAmount));\n        coerce('bordercolor');\n        coerce('borderwidth');\n    }\n};\n\nfunction buttonDefaults(buttonIn, buttonOut, selectorOut, opts) {\n    var calendar = opts.calendar;\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(buttonIn, buttonOut, attributes.buttons, attr, dflt);\n    }\n\n    var visible = coerce('visible');\n\n    if(visible) {\n        var step = coerce('step');\n        if(step !== 'all') {\n            if(calendar && calendar !== 'gregorian' && (step === 'month' || step === 'year')) {\n                buttonOut.stepmode = 'backward';\n            } else {\n                coerce('stepmode');\n            }\n\n            coerce('count');\n        }\n\n        coerce('label');\n    }\n}\n\nfunction getPosDflt(containerOut, layout, counterAxes) {\n    var anchoredList = counterAxes.filter(function(ax) {\n        return layout[ax].anchor === containerOut._id;\n    });\n\n    var posY = 0;\n    for(var i = 0; i < anchoredList.length; i++) {\n        var domain = layout[anchoredList[i]].domain;\n        if(domain) posY = Math.max(domain[1], posY);\n    }\n\n    return [containerOut.domain[0], posY + constants.yPad];\n}\n\n},{\"../../lib\":178,\"../../plot_api/plot_template\":212,\"../../plots/array_container_defaults\":218,\"../color\":52,\"./attributes\":115,\"./constants\":116}],118:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Plots = _dereq_('../../plots/plots');\nvar Color = _dereq_('../color');\nvar Drawing = _dereq_('../drawing');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar axisIds = _dereq_('../../plots/cartesian/axis_ids');\n\nvar alignmentConstants = _dereq_('../../constants/alignment');\nvar LINE_SPACING = alignmentConstants.LINE_SPACING;\nvar FROM_TL = alignmentConstants.FROM_TL;\nvar FROM_BR = alignmentConstants.FROM_BR;\n\nvar constants = _dereq_('./constants');\nvar getUpdateObject = _dereq_('./get_update_object');\n\nmodule.exports = function draw(gd) {\n    var fullLayout = gd._fullLayout;\n\n    var selectors = fullLayout._infolayer.selectAll('.rangeselector')\n        .data(makeSelectorData(gd), selectorKeyFunc);\n\n    selectors.enter().append('g')\n        .classed('rangeselector', true);\n\n    selectors.exit().remove();\n\n    selectors.style({\n        cursor: 'pointer',\n        'pointer-events': 'all'\n    });\n\n    selectors.each(function(d) {\n        var selector = d3.select(this);\n        var axisLayout = d;\n        var selectorLayout = axisLayout.rangeselector;\n\n        var buttons = selector.selectAll('g.button')\n            .data(Lib.filterVisible(selectorLayout.buttons));\n\n        buttons.enter().append('g')\n            .classed('button', true);\n\n        buttons.exit().remove();\n\n        buttons.each(function(d) {\n            var button = d3.select(this);\n            var update = getUpdateObject(axisLayout, d);\n\n            d._isActive = isActive(axisLayout, d, update);\n\n            button.call(drawButtonRect, selectorLayout, d);\n            button.call(drawButtonText, selectorLayout, d, gd);\n\n            button.on('click', function() {\n                if(gd._dragged) return;\n\n                Registry.call('_guiRelayout', gd, update);\n            });\n\n            button.on('mouseover', function() {\n                d._isHovered = true;\n                button.call(drawButtonRect, selectorLayout, d);\n            });\n\n            button.on('mouseout', function() {\n                d._isHovered = false;\n                button.call(drawButtonRect, selectorLayout, d);\n            });\n        });\n\n        reposition(gd, buttons, selectorLayout, axisLayout._name, selector);\n    });\n};\n\nfunction makeSelectorData(gd) {\n    var axes = axisIds.list(gd, 'x', true);\n    var data = [];\n\n    for(var i = 0; i < axes.length; i++) {\n        var axis = axes[i];\n\n        if(axis.rangeselector && axis.rangeselector.visible) {\n            data.push(axis);\n        }\n    }\n\n    return data;\n}\n\nfunction selectorKeyFunc(d) {\n    return d._id;\n}\n\nfunction isActive(axisLayout, opts, update) {\n    if(opts.step === 'all') {\n        return axisLayout.autorange === true;\n    } else {\n        var keys = Object.keys(update);\n\n        return (\n            axisLayout.range[0] === update[keys[0]] &&\n            axisLayout.range[1] === update[keys[1]]\n        );\n    }\n}\n\nfunction drawButtonRect(button, selectorLayout, d) {\n    var rect = Lib.ensureSingle(button, 'rect', 'selector-rect', function(s) {\n        s.attr('shape-rendering', 'crispEdges');\n    });\n\n    rect.attr({\n        'rx': constants.rx,\n        'ry': constants.ry\n    });\n\n    rect.call(Color.stroke, selectorLayout.bordercolor)\n        .call(Color.fill, getFillColor(selectorLayout, d))\n        .style('stroke-width', selectorLayout.borderwidth + 'px');\n}\n\nfunction getFillColor(selectorLayout, d) {\n    return (d._isActive || d._isHovered) ?\n        selectorLayout.activecolor :\n        selectorLayout.bgcolor;\n}\n\nfunction drawButtonText(button, selectorLayout, d, gd) {\n    function textLayout(s) {\n        svgTextUtils.convertToTspans(s, gd);\n    }\n\n    var text = Lib.ensureSingle(button, 'text', 'selector-text', function(s) {\n        s.classed('user-select-none', true)\n            .attr('text-anchor', 'middle');\n    });\n\n    text.call(Drawing.font, selectorLayout.font)\n        .text(getLabel(d, gd._fullLayout._meta))\n        .call(textLayout);\n}\n\nfunction getLabel(opts, _meta) {\n    if(opts.label) {\n        return _meta ?\n            Lib.templateString(opts.label, _meta) :\n            opts.label;\n    }\n\n    if(opts.step === 'all') return 'all';\n\n    return opts.count + opts.step.charAt(0);\n}\n\nfunction reposition(gd, buttons, opts, axName, selector) {\n    var width = 0;\n    var height = 0;\n\n    var borderWidth = opts.borderwidth;\n\n    buttons.each(function() {\n        var button = d3.select(this);\n        var text = button.select('.selector-text');\n\n        var tHeight = opts.font.size * LINE_SPACING;\n        var hEff = Math.max(tHeight * svgTextUtils.lineCount(text), 16) + 3;\n\n        height = Math.max(height, hEff);\n    });\n\n    buttons.each(function() {\n        var button = d3.select(this);\n        var rect = button.select('.selector-rect');\n        var text = button.select('.selector-text');\n\n        var tWidth = text.node() && Drawing.bBox(text.node()).width;\n        var tHeight = opts.font.size * LINE_SPACING;\n        var tLines = svgTextUtils.lineCount(text);\n\n        var wEff = Math.max(tWidth + 10, constants.minButtonWidth);\n\n        // TODO add MathJax support\n\n        // TODO add buttongap attribute\n\n        button.attr('transform', 'translate(' +\n            (borderWidth + width) + ',' + borderWidth +\n        ')');\n\n        rect.attr({\n            x: 0,\n            y: 0,\n            width: wEff,\n            height: height\n        });\n\n        svgTextUtils.positionText(text, wEff / 2,\n            height / 2 - ((tLines - 1) * tHeight / 2) + 3);\n\n        width += wEff + 5;\n    });\n\n    var graphSize = gd._fullLayout._size;\n    var lx = graphSize.l + graphSize.w * opts.x;\n    var ly = graphSize.t + graphSize.h * (1 - opts.y);\n\n    var xanchor = 'left';\n    if(Lib.isRightAnchor(opts)) {\n        lx -= width;\n        xanchor = 'right';\n    }\n    if(Lib.isCenterAnchor(opts)) {\n        lx -= width / 2;\n        xanchor = 'center';\n    }\n\n    var yanchor = 'top';\n    if(Lib.isBottomAnchor(opts)) {\n        ly -= height;\n        yanchor = 'bottom';\n    }\n    if(Lib.isMiddleAnchor(opts)) {\n        ly -= height / 2;\n        yanchor = 'middle';\n    }\n\n    width = Math.ceil(width);\n    height = Math.ceil(height);\n    lx = Math.round(lx);\n    ly = Math.round(ly);\n\n    Plots.autoMargin(gd, axName + '-range-selector', {\n        x: opts.x,\n        y: opts.y,\n        l: width * FROM_TL[xanchor],\n        r: width * FROM_BR[xanchor],\n        b: height * FROM_BR[yanchor],\n        t: height * FROM_TL[yanchor]\n    });\n\n    selector.attr('transform', 'translate(' + lx + ',' + ly + ')');\n}\n\n},{\"../../constants/alignment\":154,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../plots/cartesian/axis_ids\":225,\"../../plots/plots\":256,\"../../registry\":269,\"../color\":52,\"../drawing\":74,\"./constants\":116,\"./get_update_object\":119,\"d3\":16}],119:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nmodule.exports = function getUpdateObject(axisLayout, buttonLayout) {\n    var axName = axisLayout._name;\n    var update = {};\n\n    if(buttonLayout.step === 'all') {\n        update[axName + '.autorange'] = true;\n    } else {\n        var xrange = getXRange(axisLayout, buttonLayout);\n\n        update[axName + '.range[0]'] = xrange[0];\n        update[axName + '.range[1]'] = xrange[1];\n    }\n\n    return update;\n};\n\nfunction getXRange(axisLayout, buttonLayout) {\n    var currentRange = axisLayout.range;\n    var base = new Date(axisLayout.r2l(currentRange[1]));\n    var step = buttonLayout.step;\n    var count = buttonLayout.count;\n    var range0;\n\n    switch(buttonLayout.stepmode) {\n        case 'backward':\n            range0 = axisLayout.l2r(+d3.time[step].utc.offset(base, -count));\n            break;\n\n        case 'todate':\n            var base2 = d3.time[step].utc.offset(base, -count);\n\n            range0 = axisLayout.l2r(+d3.time[step].utc.ceil(base2));\n            break;\n    }\n\n    var range1 = currentRange[1];\n\n    return [range0, range1];\n}\n\n},{\"d3\":16}],120:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'rangeselector',\n\n    schema: {\n        subplots: {\n            xaxis: {rangeselector: _dereq_('./attributes')}\n        }\n    },\n\n    layoutAttributes: _dereq_('./attributes'),\n    handleDefaults: _dereq_('./defaults'),\n\n    draw: _dereq_('./draw')\n};\n\n},{\"./attributes\":115,\"./defaults\":117,\"./draw\":118}],121:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorAttributes = _dereq_('../color/attributes');\n\nmodule.exports = {\n    bgcolor: {\n        valType: 'color',\n        dflt: colorAttributes.background,\n        \n        editType: 'plot',\n        \n    },\n    bordercolor: {\n        valType: 'color',\n        dflt: colorAttributes.defaultLine,\n        \n        editType: 'plot',\n        \n    },\n    borderwidth: {\n        valType: 'integer',\n        dflt: 0,\n        min: 0,\n        \n        editType: 'plot',\n        \n    },\n    autorange: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'calc',\n        impliedEdits: {'range[0]': undefined, 'range[1]': undefined},\n        \n    },\n    range: {\n        valType: 'info_array',\n        \n        items: [\n            {valType: 'any', editType: 'calc', impliedEdits: {'^autorange': false}},\n            {valType: 'any', editType: 'calc', impliedEdits: {'^autorange': false}}\n        ],\n        editType: 'calc',\n        impliedEdits: {'autorange': false},\n        \n    },\n    thickness: {\n        valType: 'number',\n        dflt: 0.15,\n        min: 0,\n        max: 1,\n        \n        editType: 'plot',\n        \n    },\n    visible: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'calc',\n        \n    },\n    editType: 'calc'\n};\n\n},{\"../color/attributes\":51}],122:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar listAxes = _dereq_('../../plots/cartesian/axis_ids').list;\nvar getAutoRange = _dereq_('../../plots/cartesian/autorange').getAutoRange;\nvar constants = _dereq_('./constants');\n\nmodule.exports = function calcAutorange(gd) {\n    var axes = listAxes(gd, 'x', true);\n\n    // Compute new slider range using axis autorange if necessary.\n    //\n    // Copy back range to input range slider container to skip\n    // this step in subsequent draw calls.\n\n    for(var i = 0; i < axes.length; i++) {\n        var ax = axes[i];\n        var opts = ax[constants.name];\n\n        if(opts && opts.visible && opts.autorange) {\n            opts._input.autorange = true;\n            opts._input.range = opts.range = getAutoRange(gd, ax);\n        }\n    }\n};\n\n},{\"../../plots/cartesian/autorange\":221,\"../../plots/cartesian/axis_ids\":225,\"./constants\":123}],123:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n\n    // attribute container name\n    name: 'rangeslider',\n\n    // class names\n\n    containerClassName: 'rangeslider-container',\n    bgClassName: 'rangeslider-bg',\n    rangePlotClassName: 'rangeslider-rangeplot',\n\n    maskMinClassName: 'rangeslider-mask-min',\n    maskMaxClassName: 'rangeslider-mask-max',\n    slideBoxClassName: 'rangeslider-slidebox',\n\n    grabberMinClassName: 'rangeslider-grabber-min',\n    grabAreaMinClassName: 'rangeslider-grabarea-min',\n    handleMinClassName: 'rangeslider-handle-min',\n\n    grabberMaxClassName: 'rangeslider-grabber-max',\n    grabAreaMaxClassName: 'rangeslider-grabarea-max',\n    handleMaxClassName: 'rangeslider-handle-max',\n\n    maskMinOppAxisClassName: 'rangeslider-mask-min-opp-axis',\n    maskMaxOppAxisClassName: 'rangeslider-mask-max-opp-axis',\n\n    // style constants\n\n    maskColor: 'rgba(0,0,0,0.4)',\n    maskOppAxisColor: 'rgba(0,0,0,0.2)',\n\n    slideBoxFill: 'transparent',\n    slideBoxCursor: 'ew-resize',\n\n    grabAreaFill: 'transparent',\n    grabAreaCursor: 'col-resize',\n    grabAreaWidth: 10,\n\n    handleWidth: 4,\n    handleRadius: 1,\n    handleStrokeWidth: 1,\n\n    extraPad: 15\n};\n\n},{}],124:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Template = _dereq_('../../plot_api/plot_template');\nvar axisIds = _dereq_('../../plots/cartesian/axis_ids');\n\nvar attributes = _dereq_('./attributes');\nvar oppAxisAttrs = _dereq_('./oppaxis_attributes');\n\nmodule.exports = function handleDefaults(layoutIn, layoutOut, axName) {\n    var axIn = layoutIn[axName];\n    var axOut = layoutOut[axName];\n\n    if(!(axIn.rangeslider || layoutOut._requestRangeslider[axOut._id])) return;\n\n    // not super proud of this (maybe store _ in axis object instead\n    if(!Lib.isPlainObject(axIn.rangeslider)) {\n        axIn.rangeslider = {};\n    }\n\n    var containerIn = axIn.rangeslider;\n    var containerOut = Template.newContainer(axOut, 'rangeslider');\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);\n    }\n\n    var rangeContainerIn, rangeContainerOut;\n    function coerceRange(attr, dflt) {\n        return Lib.coerce(rangeContainerIn, rangeContainerOut, oppAxisAttrs, attr, dflt);\n    }\n\n    var visible = coerce('visible');\n    if(!visible) return;\n\n    coerce('bgcolor', layoutOut.plot_bgcolor);\n    coerce('bordercolor');\n    coerce('borderwidth');\n    coerce('thickness');\n\n    coerce('autorange', !axOut.isValidRange(containerIn.range));\n    coerce('range');\n\n    var subplots = layoutOut._subplots;\n    if(subplots) {\n        var yIds = subplots.cartesian\n            .filter(function(subplotId) {\n                return subplotId.substr(0, subplotId.indexOf('y')) === axisIds.name2id(axName);\n            })\n            .map(function(subplotId) {\n                return subplotId.substr(subplotId.indexOf('y'), subplotId.length);\n            });\n        var yNames = Lib.simpleMap(yIds, axisIds.id2name);\n        for(var i = 0; i < yNames.length; i++) {\n            var yName = yNames[i];\n\n            rangeContainerIn = containerIn[yName] || {};\n            rangeContainerOut = Template.newContainer(containerOut, yName, 'yaxis');\n\n            var yAxOut = layoutOut[yName];\n\n            var rangemodeDflt;\n            if(rangeContainerIn.range && yAxOut.isValidRange(rangeContainerIn.range)) {\n                rangemodeDflt = 'fixed';\n            }\n\n            var rangeMode = coerceRange('rangemode', rangemodeDflt);\n            if(rangeMode !== 'match') {\n                coerceRange('range', yAxOut.range.slice());\n            }\n        }\n    }\n\n    // to map back range slider (auto) range\n    containerOut._input = containerIn;\n};\n\n},{\"../../lib\":178,\"../../plot_api/plot_template\":212,\"../../plots/cartesian/axis_ids\":225,\"./attributes\":121,\"./oppaxis_attributes\":128}],125:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Plots = _dereq_('../../plots/plots');\n\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../drawing');\nvar Color = _dereq_('../color');\nvar Titles = _dereq_('../titles');\n\nvar Cartesian = _dereq_('../../plots/cartesian');\nvar axisIDs = _dereq_('../../plots/cartesian/axis_ids');\n\nvar dragElement = _dereq_('../dragelement');\nvar setCursor = _dereq_('../../lib/setcursor');\n\nvar constants = _dereq_('./constants');\n\nmodule.exports = function(gd) {\n    var fullLayout = gd._fullLayout;\n    var rangeSliderData = fullLayout._rangeSliderData;\n    for(var i = 0; i < rangeSliderData.length; i++) {\n        var opts = rangeSliderData[i][constants.name];\n        // fullLayout._uid may not exist when we call makeData\n        opts._clipId = opts._id + '-' + fullLayout._uid;\n    }\n\n    /*\n     * <g container />\n     *  <rect bg />\n     *  < .... range plot />\n     *  <rect mask-min />\n     *  <rect mask-max />\n     *  <rect slidebox />\n     *  <g grabber-min />\n     *      <rect handle-min />\n     *      <rect grabare-min />\n     *  <g grabber-max />\n     *      <rect handle-max />\n     *      <rect grabare-max />\n     *\n     *  ...\n     */\n\n    function keyFunction(axisOpts) {\n        return axisOpts._name;\n    }\n\n    var rangeSliders = fullLayout._infolayer\n        .selectAll('g.' + constants.containerClassName)\n        .data(rangeSliderData, keyFunction);\n\n    // remove exiting sliders and their corresponding clip paths\n    rangeSliders.exit().each(function(axisOpts) {\n        var opts = axisOpts[constants.name];\n        fullLayout._topdefs.select('#' + opts._clipId).remove();\n    }).remove();\n\n    // return early if no range slider is visible\n    if(rangeSliderData.length === 0) return;\n\n    rangeSliders.enter().append('g')\n        .classed(constants.containerClassName, true)\n        .attr('pointer-events', 'all');\n\n    // for all present range sliders\n    rangeSliders.each(function(axisOpts) {\n        var rangeSlider = d3.select(this);\n        var opts = axisOpts[constants.name];\n        var oppAxisOpts = fullLayout[axisIDs.id2name(axisOpts.anchor)];\n        var oppAxisRangeOpts = opts[axisIDs.id2name(axisOpts.anchor)];\n\n        // update range\n        // Expand slider range to the axis range\n        if(opts.range) {\n            var rng = Lib.simpleMap(opts.range, axisOpts.r2l);\n            var axRng = Lib.simpleMap(axisOpts.range, axisOpts.r2l);\n            var newRng;\n\n            if(axRng[0] < axRng[1]) {\n                newRng = [\n                    Math.min(rng[0], axRng[0]),\n                    Math.max(rng[1], axRng[1])\n                ];\n            } else {\n                newRng = [\n                    Math.max(rng[0], axRng[0]),\n                    Math.min(rng[1], axRng[1])\n                ];\n            }\n\n            opts.range = opts._input.range = Lib.simpleMap(newRng, axisOpts.l2r);\n        }\n\n        axisOpts.cleanRange('rangeslider.range');\n\n        // update range slider dimensions\n\n        var gs = fullLayout._size;\n        var domain = axisOpts.domain;\n\n        opts._width = gs.w * (domain[1] - domain[0]);\n\n        var x = Math.round(gs.l + (gs.w * domain[0]));\n\n        var y = Math.round(\n            gs.t + gs.h * (1 - axisOpts._counterDomainMin) +\n            (axisOpts.side === 'bottom' ? axisOpts._depth : 0) +\n            opts._offsetShift + constants.extraPad\n        );\n\n        rangeSlider.attr('transform', 'translate(' + x + ',' + y + ')');\n\n        // update data <--> pixel coordinate conversion methods\n\n        opts._rl = Lib.simpleMap(opts.range, axisOpts.r2l);\n        var rl0 = opts._rl[0];\n        var rl1 = opts._rl[1];\n        var drl = rl1 - rl0;\n\n        opts.p2d = function(v) {\n            return (v / opts._width) * drl + rl0;\n        };\n\n        opts.d2p = function(v) {\n            return (v - rl0) / drl * opts._width;\n        };\n\n        if(axisOpts.rangebreaks) {\n            var rsBreaks = axisOpts.locateBreaks(rl0, rl1);\n\n            if(rsBreaks.length) {\n                var j, brk;\n\n                var lBreaks = 0;\n                for(j = 0; j < rsBreaks.length; j++) {\n                    brk = rsBreaks[j];\n                    lBreaks += (brk.max - brk.min);\n                }\n\n                // TODO fix for reversed-range axes !!!\n\n                // compute slope and piecewise offsets\n                var m2 = opts._width / (rl1 - rl0 - lBreaks);\n                var _B = [-m2 * rl0];\n                for(j = 0; j < rsBreaks.length; j++) {\n                    brk = rsBreaks[j];\n                    _B.push(_B[_B.length - 1] - m2 * (brk.max - brk.min));\n                }\n\n                opts.d2p = function(v) {\n                    var b = _B[0];\n                    for(var j = 0; j < rsBreaks.length; j++) {\n                        var brk = rsBreaks[j];\n                        if(v >= brk.max) b = _B[j + 1];\n                        else if(v < brk.min) break;\n                    }\n                    return b + m2 * v;\n                };\n\n                // fill pixel (i.e. 'p') min/max here,\n                // to not have to loop through the _rangebreaks twice during `p2d`\n                for(j = 0; j < rsBreaks.length; j++) {\n                    brk = rsBreaks[j];\n                    brk.pmin = opts.d2p(brk.min);\n                    brk.pmax = opts.d2p(brk.max);\n                }\n\n                opts.p2d = function(v) {\n                    var b = _B[0];\n                    for(var j = 0; j < rsBreaks.length; j++) {\n                        var brk = rsBreaks[j];\n                        if(v >= brk.pmax) b = _B[j + 1];\n                        else if(v < brk.pmin) break;\n                    }\n                    return (v - b) / m2;\n                };\n            }\n        }\n\n        if(oppAxisRangeOpts.rangemode !== 'match') {\n            var range0OppAxis = oppAxisOpts.r2l(oppAxisRangeOpts.range[0]);\n            var range1OppAxis = oppAxisOpts.r2l(oppAxisRangeOpts.range[1]);\n            var distOppAxis = range1OppAxis - range0OppAxis;\n\n            opts.d2pOppAxis = function(v) {\n                return (v - range0OppAxis) / distOppAxis * opts._height;\n            };\n        }\n\n        // update inner nodes\n\n        rangeSlider\n            .call(drawBg, gd, axisOpts, opts)\n            .call(addClipPath, gd, axisOpts, opts)\n            .call(drawRangePlot, gd, axisOpts, opts)\n            .call(drawMasks, gd, axisOpts, opts, oppAxisRangeOpts)\n            .call(drawSlideBox, gd, axisOpts, opts)\n            .call(drawGrabbers, gd, axisOpts, opts);\n\n        // setup drag element\n        setupDragElement(rangeSlider, gd, axisOpts, opts);\n\n        // update current range\n        setPixelRange(rangeSlider, gd, axisOpts, opts, oppAxisOpts, oppAxisRangeOpts);\n\n        // title goes next to range slider instead of tick labels, so\n        // just take it over and draw it from here\n        if(axisOpts.side === 'bottom') {\n            Titles.draw(gd, axisOpts._id + 'title', {\n                propContainer: axisOpts,\n                propName: axisOpts._name + '.title',\n                placeholder: fullLayout._dfltTitle.x,\n                attributes: {\n                    x: axisOpts._offset + axisOpts._length / 2,\n                    y: y + opts._height + opts._offsetShift + 10 + 1.5 * axisOpts.title.font.size,\n                    'text-anchor': 'middle'\n                }\n            });\n        }\n    });\n};\n\nfunction setupDragElement(rangeSlider, gd, axisOpts, opts) {\n    var slideBox = rangeSlider.select('rect.' + constants.slideBoxClassName).node();\n    var grabAreaMin = rangeSlider.select('rect.' + constants.grabAreaMinClassName).node();\n    var grabAreaMax = rangeSlider.select('rect.' + constants.grabAreaMaxClassName).node();\n\n    rangeSlider.on('mousedown', function() {\n        var event = d3.event;\n        var target = event.target;\n        var startX = event.clientX;\n        var offsetX = startX - rangeSlider.node().getBoundingClientRect().left;\n        var minVal = opts.d2p(axisOpts._rl[0]);\n        var maxVal = opts.d2p(axisOpts._rl[1]);\n\n        var dragCover = dragElement.coverSlip();\n\n        dragCover.addEventListener('mousemove', mouseMove);\n        dragCover.addEventListener('mouseup', mouseUp);\n\n        function mouseMove(e) {\n            var delta = +e.clientX - startX;\n            var pixelMin, pixelMax, cursor;\n\n            switch(target) {\n                case slideBox:\n                    cursor = 'ew-resize';\n                    pixelMin = minVal + delta;\n                    pixelMax = maxVal + delta;\n                    break;\n\n                case grabAreaMin:\n                    cursor = 'col-resize';\n                    pixelMin = minVal + delta;\n                    pixelMax = maxVal;\n                    break;\n\n                case grabAreaMax:\n                    cursor = 'col-resize';\n                    pixelMin = minVal;\n                    pixelMax = maxVal + delta;\n                    break;\n\n                default:\n                    cursor = 'ew-resize';\n                    pixelMin = offsetX;\n                    pixelMax = offsetX + delta;\n                    break;\n            }\n\n            if(pixelMax < pixelMin) {\n                var tmp = pixelMax;\n                pixelMax = pixelMin;\n                pixelMin = tmp;\n            }\n\n            opts._pixelMin = pixelMin;\n            opts._pixelMax = pixelMax;\n\n            setCursor(d3.select(dragCover), cursor);\n            setDataRange(rangeSlider, gd, axisOpts, opts);\n        }\n\n        function mouseUp() {\n            dragCover.removeEventListener('mousemove', mouseMove);\n            dragCover.removeEventListener('mouseup', mouseUp);\n            Lib.removeElement(dragCover);\n        }\n    });\n}\n\nfunction setDataRange(rangeSlider, gd, axisOpts, opts) {\n    function clamp(v) {\n        return axisOpts.l2r(Lib.constrain(v, opts._rl[0], opts._rl[1]));\n    }\n\n    var dataMin = clamp(opts.p2d(opts._pixelMin));\n    var dataMax = clamp(opts.p2d(opts._pixelMax));\n\n    window.requestAnimationFrame(function() {\n        Registry.call('_guiRelayout', gd, axisOpts._name + '.range', [dataMin, dataMax]);\n    });\n}\n\nfunction setPixelRange(rangeSlider, gd, axisOpts, opts, oppAxisOpts, oppAxisRangeOpts) {\n    var hw2 = constants.handleWidth / 2;\n\n    function clamp(v) {\n        return Lib.constrain(v, 0, opts._width);\n    }\n\n    function clampOppAxis(v) {\n        return Lib.constrain(v, 0, opts._height);\n    }\n\n    function clampHandle(v) {\n        return Lib.constrain(v, -hw2, opts._width + hw2);\n    }\n\n    var pixelMin = clamp(opts.d2p(axisOpts._rl[0]));\n    var pixelMax = clamp(opts.d2p(axisOpts._rl[1]));\n\n    rangeSlider.select('rect.' + constants.slideBoxClassName)\n        .attr('x', pixelMin)\n        .attr('width', pixelMax - pixelMin);\n\n    rangeSlider.select('rect.' + constants.maskMinClassName)\n        .attr('width', pixelMin);\n\n    rangeSlider.select('rect.' + constants.maskMaxClassName)\n        .attr('x', pixelMax)\n        .attr('width', opts._width - pixelMax);\n\n    if(oppAxisRangeOpts.rangemode !== 'match') {\n        var pixelMinOppAxis = opts._height - clampOppAxis(opts.d2pOppAxis(oppAxisOpts._rl[1]));\n        var pixelMaxOppAxis = opts._height - clampOppAxis(opts.d2pOppAxis(oppAxisOpts._rl[0]));\n\n        rangeSlider.select('rect.' + constants.maskMinOppAxisClassName)\n            .attr('x', pixelMin)\n            .attr('height', pixelMinOppAxis)\n            .attr('width', pixelMax - pixelMin);\n\n        rangeSlider.select('rect.' + constants.maskMaxOppAxisClassName)\n            .attr('x', pixelMin)\n            .attr('y', pixelMaxOppAxis)\n            .attr('height', opts._height - pixelMaxOppAxis)\n            .attr('width', pixelMax - pixelMin);\n\n        rangeSlider.select('rect.' + constants.slideBoxClassName)\n            .attr('y', pixelMinOppAxis)\n            .attr('height', pixelMaxOppAxis - pixelMinOppAxis);\n    }\n\n    // add offset for crispier corners\n    // https://github.com/plotly/plotly.js/pull/1409\n    var offset = 0.5;\n\n    var xMin = Math.round(clampHandle(pixelMin - hw2)) - offset;\n    var xMax = Math.round(clampHandle(pixelMax - hw2)) + offset;\n\n    rangeSlider.select('g.' + constants.grabberMinClassName)\n        .attr('transform', 'translate(' + xMin + ',' + offset + ')');\n\n    rangeSlider.select('g.' + constants.grabberMaxClassName)\n        .attr('transform', 'translate(' + xMax + ',' + offset + ')');\n}\n\nfunction drawBg(rangeSlider, gd, axisOpts, opts) {\n    var bg = Lib.ensureSingle(rangeSlider, 'rect', constants.bgClassName, function(s) {\n        s.attr({\n            x: 0,\n            y: 0,\n            'shape-rendering': 'crispEdges'\n        });\n    });\n\n    var borderCorrect = (opts.borderwidth % 2) === 0 ?\n        opts.borderwidth :\n        opts.borderwidth - 1;\n\n    var offsetShift = -opts._offsetShift;\n    var lw = Drawing.crispRound(gd, opts.borderwidth);\n\n    bg.attr({\n        width: opts._width + borderCorrect,\n        height: opts._height + borderCorrect,\n        transform: 'translate(' + offsetShift + ',' + offsetShift + ')',\n        fill: opts.bgcolor,\n        stroke: opts.bordercolor,\n        'stroke-width': lw\n    });\n}\n\nfunction addClipPath(rangeSlider, gd, axisOpts, opts) {\n    var fullLayout = gd._fullLayout;\n\n    var clipPath = Lib.ensureSingleById(fullLayout._topdefs, 'clipPath', opts._clipId, function(s) {\n        s.append('rect').attr({ x: 0, y: 0 });\n    });\n\n    clipPath.select('rect').attr({\n        width: opts._width,\n        height: opts._height\n    });\n}\n\nfunction drawRangePlot(rangeSlider, gd, axisOpts, opts) {\n    var calcData = gd.calcdata;\n\n    var rangePlots = rangeSlider.selectAll('g.' + constants.rangePlotClassName)\n        .data(axisOpts._subplotsWith, Lib.identity);\n\n    rangePlots.enter().append('g')\n        .attr('class', function(id) { return constants.rangePlotClassName + ' ' + id; })\n        .call(Drawing.setClipUrl, opts._clipId, gd);\n\n    rangePlots.order();\n\n    rangePlots.exit().remove();\n\n    var mainplotinfo;\n\n    rangePlots.each(function(id, i) {\n        var plotgroup = d3.select(this);\n        var isMainPlot = (i === 0);\n\n        var oppAxisOpts = axisIDs.getFromId(gd, id, 'y');\n        var oppAxisName = oppAxisOpts._name;\n        var oppAxisRangeOpts = opts[oppAxisName];\n\n        var mockFigure = {\n            data: [],\n            layout: {\n                xaxis: {\n                    type: axisOpts.type,\n                    domain: [0, 1],\n                    range: opts.range.slice(),\n                    calendar: axisOpts.calendar\n                },\n                width: opts._width,\n                height: opts._height,\n                margin: { t: 0, b: 0, l: 0, r: 0 }\n            },\n            _context: gd._context\n        };\n\n        if(axisOpts.rangebreaks) {\n            mockFigure.layout.xaxis.rangebreaks = axisOpts.rangebreaks;\n        }\n\n        mockFigure.layout[oppAxisName] = {\n            type: oppAxisOpts.type,\n            domain: [0, 1],\n            range: oppAxisRangeOpts.rangemode !== 'match' ? oppAxisRangeOpts.range.slice() : oppAxisOpts.range.slice(),\n            calendar: oppAxisOpts.calendar\n        };\n\n        if(oppAxisOpts.rangebreaks) {\n            mockFigure.layout[oppAxisName].rangebreaks = oppAxisOpts.rangebreaks;\n        }\n\n        Plots.supplyDefaults(mockFigure);\n\n        var xa = mockFigure._fullLayout.xaxis;\n        var ya = mockFigure._fullLayout[oppAxisName];\n\n        xa.clearCalc();\n        xa.setScale();\n        ya.clearCalc();\n        ya.setScale();\n\n        var plotinfo = {\n            id: id,\n            plotgroup: plotgroup,\n            xaxis: xa,\n            yaxis: ya,\n            isRangePlot: true\n        };\n\n        if(isMainPlot) mainplotinfo = plotinfo;\n        else {\n            plotinfo.mainplot = 'xy';\n            plotinfo.mainplotinfo = mainplotinfo;\n        }\n\n        Cartesian.rangePlot(gd, plotinfo, filterRangePlotCalcData(calcData, id));\n    });\n}\n\nfunction filterRangePlotCalcData(calcData, subplotId) {\n    var out = [];\n\n    for(var i = 0; i < calcData.length; i++) {\n        var calcTrace = calcData[i];\n        var trace = calcTrace[0].trace;\n\n        if(trace.xaxis + trace.yaxis === subplotId) {\n            out.push(calcTrace);\n        }\n    }\n\n    return out;\n}\n\nfunction drawMasks(rangeSlider, gd, axisOpts, opts, oppAxisRangeOpts) {\n    var maskMin = Lib.ensureSingle(rangeSlider, 'rect', constants.maskMinClassName, function(s) {\n        s.attr({\n            x: 0,\n            y: 0,\n            'shape-rendering': 'crispEdges'\n        });\n    });\n\n    maskMin\n        .attr('height', opts._height)\n        .call(Color.fill, constants.maskColor);\n\n    var maskMax = Lib.ensureSingle(rangeSlider, 'rect', constants.maskMaxClassName, function(s) {\n        s.attr({\n            y: 0,\n            'shape-rendering': 'crispEdges'\n        });\n    });\n\n    maskMax\n        .attr('height', opts._height)\n        .call(Color.fill, constants.maskColor);\n\n    // masks used for oppAxis zoom\n    if(oppAxisRangeOpts.rangemode !== 'match') {\n        var maskMinOppAxis = Lib.ensureSingle(rangeSlider, 'rect', constants.maskMinOppAxisClassName, function(s) {\n            s.attr({\n                y: 0,\n                'shape-rendering': 'crispEdges'\n            });\n        });\n\n        maskMinOppAxis\n            .attr('width', opts._width)\n            .call(Color.fill, constants.maskOppAxisColor);\n\n        var maskMaxOppAxis = Lib.ensureSingle(rangeSlider, 'rect', constants.maskMaxOppAxisClassName, function(s) {\n            s.attr({\n                y: 0,\n                'shape-rendering': 'crispEdges'\n            });\n        });\n\n        maskMaxOppAxis\n            .attr('width', opts._width)\n            .style('border-top', constants.maskOppBorder)\n            .call(Color.fill, constants.maskOppAxisColor);\n    }\n}\n\nfunction drawSlideBox(rangeSlider, gd, axisOpts, opts) {\n    if(gd._context.staticPlot) return;\n\n    var slideBox = Lib.ensureSingle(rangeSlider, 'rect', constants.slideBoxClassName, function(s) {\n        s.attr({\n            y: 0,\n            cursor: constants.slideBoxCursor,\n            'shape-rendering': 'crispEdges'\n        });\n    });\n\n    slideBox.attr({\n        height: opts._height,\n        fill: constants.slideBoxFill\n    });\n}\n\nfunction drawGrabbers(rangeSlider, gd, axisOpts, opts) {\n    // <g grabber />\n    var grabberMin = Lib.ensureSingle(rangeSlider, 'g', constants.grabberMinClassName);\n    var grabberMax = Lib.ensureSingle(rangeSlider, 'g', constants.grabberMaxClassName);\n\n    // <g handle />\n    var handleFixAttrs = {\n        x: 0,\n        width: constants.handleWidth,\n        rx: constants.handleRadius,\n        fill: Color.background,\n        stroke: Color.defaultLine,\n        'stroke-width': constants.handleStrokeWidth,\n        'shape-rendering': 'crispEdges'\n    };\n    var handleDynamicAttrs = {\n        y: Math.round(opts._height / 4),\n        height: Math.round(opts._height / 2),\n    };\n    var handleMin = Lib.ensureSingle(grabberMin, 'rect', constants.handleMinClassName, function(s) {\n        s.attr(handleFixAttrs);\n    });\n    handleMin.attr(handleDynamicAttrs);\n\n    var handleMax = Lib.ensureSingle(grabberMax, 'rect', constants.handleMaxClassName, function(s) {\n        s.attr(handleFixAttrs);\n    });\n    handleMax.attr(handleDynamicAttrs);\n\n    // <g grabarea />\n    if(gd._context.staticPlot) return;\n\n    var grabAreaFixAttrs = {\n        width: constants.grabAreaWidth,\n        x: 0,\n        y: 0,\n        fill: constants.grabAreaFill,\n        cursor: constants.grabAreaCursor\n    };\n\n    var grabAreaMin = Lib.ensureSingle(grabberMin, 'rect', constants.grabAreaMinClassName, function(s) {\n        s.attr(grabAreaFixAttrs);\n    });\n    grabAreaMin.attr('height', opts._height);\n\n    var grabAreaMax = Lib.ensureSingle(grabberMax, 'rect', constants.grabAreaMaxClassName, function(s) {\n        s.attr(grabAreaFixAttrs);\n    });\n    grabAreaMax.attr('height', opts._height);\n}\n\n},{\"../../lib\":178,\"../../lib/setcursor\":197,\"../../plots/cartesian\":235,\"../../plots/cartesian/axis_ids\":225,\"../../plots/plots\":256,\"../../registry\":269,\"../color\":52,\"../dragelement\":71,\"../drawing\":74,\"../titles\":147,\"./constants\":123,\"d3\":16}],126:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar axisIDs = _dereq_('../../plots/cartesian/axis_ids');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar constants = _dereq_('./constants');\nvar LINE_SPACING = _dereq_('../../constants/alignment').LINE_SPACING;\nvar name = constants.name;\n\nfunction isVisible(ax) {\n    var rangeSlider = ax && ax[name];\n    return rangeSlider && rangeSlider.visible;\n}\nexports.isVisible = isVisible;\n\nexports.makeData = function(fullLayout) {\n    var axes = axisIDs.list({ _fullLayout: fullLayout }, 'x', true);\n    var margin = fullLayout.margin;\n    var rangeSliderData = [];\n\n    if(!fullLayout._has('gl2d')) {\n        for(var i = 0; i < axes.length; i++) {\n            var ax = axes[i];\n\n            if(isVisible(ax)) {\n                rangeSliderData.push(ax);\n\n                var opts = ax[name];\n                opts._id = name + ax._id;\n                opts._height = (fullLayout.height - margin.b - margin.t) * opts.thickness;\n                opts._offsetShift = Math.floor(opts.borderwidth / 2);\n            }\n        }\n    }\n\n    fullLayout._rangeSliderData = rangeSliderData;\n};\n\nexports.autoMarginOpts = function(gd, ax) {\n    var fullLayout = gd._fullLayout;\n    var opts = ax[name];\n    var axLetter = ax._id.charAt(0);\n\n    var bottomDepth = 0;\n    var titleHeight = 0;\n    if(ax.side === 'bottom') {\n        bottomDepth = ax._depth;\n        if(ax.title.text !== fullLayout._dfltTitle[axLetter]) {\n            // as in rangeslider/draw.js\n            titleHeight = 1.5 * ax.title.font.size + 10 + opts._offsetShift;\n            // multi-line extra bump\n            var extraLines = (ax.title.text.match(svgTextUtils.BR_TAG_ALL) || []).length;\n            titleHeight += extraLines * ax.title.font.size * LINE_SPACING;\n        }\n    }\n\n    return {\n        x: 0,\n        y: ax._counterDomainMin,\n        l: 0,\n        r: 0,\n        t: 0,\n        b: opts._height + bottomDepth + Math.max(fullLayout.margin.b, titleHeight),\n        pad: constants.extraPad + opts._offsetShift * 2\n    };\n};\n\n},{\"../../constants/alignment\":154,\"../../lib/svg_text_utils\":199,\"../../plots/cartesian/axis_ids\":225,\"./constants\":123}],127:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attrs = _dereq_('./attributes');\nvar oppAxisAttrs = _dereq_('./oppaxis_attributes');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'rangeslider',\n\n    schema: {\n        subplots: {\n            xaxis: {\n                rangeslider: Lib.extendFlat({}, attrs, {\n                    yaxis: oppAxisAttrs\n                })\n            }\n        }\n    },\n\n    layoutAttributes: _dereq_('./attributes'),\n    handleDefaults: _dereq_('./defaults'),\n    calcAutorange: _dereq_('./calc_autorange'),\n    draw: _dereq_('./draw'),\n    isVisible: helpers.isVisible,\n    makeData: helpers.makeData,\n    autoMarginOpts: helpers.autoMarginOpts\n};\n\n},{\"../../lib\":178,\"./attributes\":121,\"./calc_autorange\":122,\"./defaults\":124,\"./draw\":125,\"./helpers\":126,\"./oppaxis_attributes\":128}],128:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    // not really a 'subplot' attribute container,\n    // but this is the flag we use to denote attributes that\n    // support yaxis, yaxis2, yaxis3, ... counters\n    _isSubplotObj: true,\n\n    rangemode: {\n        valType: 'enumerated',\n        values: ['auto', 'fixed', 'match'],\n        dflt: 'match',\n        \n        editType: 'calc',\n        \n    },\n    range: {\n        valType: 'info_array',\n        \n        items: [\n            {valType: 'any', editType: 'plot'},\n            {valType: 'any', editType: 'plot'}\n        ],\n        editType: 'plot',\n        \n    },\n    editType: 'calc'\n};\n\n},{}],129:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar annAttrs = _dereq_('../annotations/attributes');\nvar scatterLineAttrs = _dereq_('../../traces/scatter/attributes').line;\nvar dash = _dereq_('../drawing/attributes').dash;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nmodule.exports = templatedArray('shape', {\n    visible: {\n        valType: 'boolean',\n        \n        dflt: true,\n        editType: 'calc+arraydraw',\n        \n    },\n\n    type: {\n        valType: 'enumerated',\n        values: ['circle', 'rect', 'path', 'line'],\n        \n        editType: 'calc+arraydraw',\n        \n    },\n\n    layer: {\n        valType: 'enumerated',\n        values: ['below', 'above'],\n        dflt: 'above',\n        \n        editType: 'arraydraw',\n        \n    },\n\n    xref: extendFlat({}, annAttrs.xref, {\n        \n    }),\n    xsizemode: {\n        valType: 'enumerated',\n        values: ['scaled', 'pixel'],\n        dflt: 'scaled',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    xanchor: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    x0: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    x1: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n\n    yref: extendFlat({}, annAttrs.yref, {\n        \n    }),\n    ysizemode: {\n        valType: 'enumerated',\n        values: ['scaled', 'pixel'],\n        dflt: 'scaled',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    yanchor: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    y0: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n    y1: {\n        valType: 'any',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n\n    path: {\n        valType: 'string',\n        \n        editType: 'calc+arraydraw',\n        \n    },\n\n    opacity: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        dflt: 1,\n        \n        editType: 'arraydraw',\n        \n    },\n    line: {\n        color: extendFlat({}, scatterLineAttrs.color, {editType: 'arraydraw'}),\n        width: extendFlat({}, scatterLineAttrs.width, {editType: 'calc+arraydraw'}),\n        dash: extendFlat({}, dash, {editType: 'arraydraw'}),\n        \n        editType: 'calc+arraydraw'\n    },\n    fillcolor: {\n        valType: 'color',\n        dflt: 'rgba(0,0,0,0)',\n        \n        editType: 'arraydraw',\n        \n    },\n    fillrule: {\n        valType: 'enumerated',\n        values: ['evenodd', 'nonzero'],\n        dflt: 'evenodd',\n        \n        editType: 'arraydraw',\n        \n    },\n    editable: {\n        valType: 'boolean',\n        \n        dflt: false,\n        editType: 'calc+arraydraw',\n        \n    },\n\n    editType: 'arraydraw'\n});\n\n},{\"../../lib/extend\":173,\"../../plot_api/plot_template\":212,\"../../traces/scatter/attributes\":389,\"../annotations/attributes\":37,\"../drawing/attributes\":73}],130:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar constants = _dereq_('./constants');\nvar helpers = _dereq_('./helpers');\n\n\nmodule.exports = function calcAutorange(gd) {\n    var fullLayout = gd._fullLayout;\n    var shapeList = Lib.filterVisible(fullLayout.shapes);\n\n    if(!shapeList.length || !gd._fullData.length) return;\n\n    for(var i = 0; i < shapeList.length; i++) {\n        var shape = shapeList[i];\n        shape._extremes = {};\n\n        var ax, bounds;\n\n        if(shape.xref !== 'paper') {\n            var vx0 = shape.xsizemode === 'pixel' ? shape.xanchor : shape.x0;\n            var vx1 = shape.xsizemode === 'pixel' ? shape.xanchor : shape.x1;\n            ax = Axes.getFromId(gd, shape.xref);\n\n            bounds = shapeBounds(ax, vx0, vx1, shape.path, constants.paramIsX);\n            if(bounds) {\n                shape._extremes[ax._id] = Axes.findExtremes(ax, bounds, calcXPaddingOptions(shape));\n            }\n        }\n\n        if(shape.yref !== 'paper') {\n            var vy0 = shape.ysizemode === 'pixel' ? shape.yanchor : shape.y0;\n            var vy1 = shape.ysizemode === 'pixel' ? shape.yanchor : shape.y1;\n            ax = Axes.getFromId(gd, shape.yref);\n\n            bounds = shapeBounds(ax, vy0, vy1, shape.path, constants.paramIsY);\n            if(bounds) {\n                shape._extremes[ax._id] = Axes.findExtremes(ax, bounds, calcYPaddingOptions(shape));\n            }\n        }\n    }\n};\n\nfunction calcXPaddingOptions(shape) {\n    return calcPaddingOptions(shape.line.width, shape.xsizemode, shape.x0, shape.x1, shape.path, false);\n}\n\nfunction calcYPaddingOptions(shape) {\n    return calcPaddingOptions(shape.line.width, shape.ysizemode, shape.y0, shape.y1, shape.path, true);\n}\n\nfunction calcPaddingOptions(lineWidth, sizeMode, v0, v1, path, isYAxis) {\n    var ppad = lineWidth / 2;\n    var axisDirectionReverted = isYAxis;\n\n    if(sizeMode === 'pixel') {\n        var coords = path ?\n            helpers.extractPathCoords(path, isYAxis ? constants.paramIsY : constants.paramIsX) :\n            [v0, v1];\n        var maxValue = Lib.aggNums(Math.max, null, coords);\n        var minValue = Lib.aggNums(Math.min, null, coords);\n        var beforePad = minValue < 0 ? Math.abs(minValue) + ppad : ppad;\n        var afterPad = maxValue > 0 ? maxValue + ppad : ppad;\n\n        return {\n            ppad: ppad,\n            ppadplus: axisDirectionReverted ? beforePad : afterPad,\n            ppadminus: axisDirectionReverted ? afterPad : beforePad\n        };\n    } else {\n        return {ppad: ppad};\n    }\n}\n\nfunction shapeBounds(ax, v0, v1, path, paramsToUse) {\n    var convertVal = (ax.type === 'category' || ax.type === 'multicategory') ? ax.r2c : ax.d2c;\n\n    if(v0 !== undefined) return [convertVal(v0), convertVal(v1)];\n    if(!path) return;\n\n    var min = Infinity;\n    var max = -Infinity;\n    var segments = path.match(constants.segmentRE);\n    var i;\n    var segment;\n    var drawnParam;\n    var params;\n    var val;\n\n    if(ax.type === 'date') convertVal = helpers.decodeDate(convertVal);\n\n    for(i = 0; i < segments.length; i++) {\n        segment = segments[i];\n        drawnParam = paramsToUse[segment.charAt(0)].drawn;\n        if(drawnParam === undefined) continue;\n\n        params = segments[i].substr(1).match(constants.paramRE);\n        if(!params || params.length < drawnParam) continue;\n\n        val = convertVal(params[drawnParam]);\n        if(val < min) min = val;\n        if(val > max) max = val;\n    }\n    if(max >= min) return [min, max];\n}\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"./constants\":131,\"./helpers\":140}],131:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n    segmentRE: /[MLHVQCTSZ][^MLHVQCTSZ]*/g,\n    paramRE: /[^\\s,]+/g,\n\n    // which numbers in each path segment are x (or y) values\n    // drawn is which param is a drawn point, as opposed to a\n    // control point (which doesn't count toward autorange.\n    // TODO: this means curved paths could extend beyond the\n    // autorange bounds. This is a bit tricky to get right\n    // unless we revert to bounding boxes, but perhaps there's\n    // a calculation we could do...)\n    paramIsX: {\n        M: {0: true, drawn: 0},\n        L: {0: true, drawn: 0},\n        H: {0: true, drawn: 0},\n        V: {},\n        Q: {0: true, 2: true, drawn: 2},\n        C: {0: true, 2: true, 4: true, drawn: 4},\n        T: {0: true, drawn: 0},\n        S: {0: true, 2: true, drawn: 2},\n        // A: {0: true, 5: true},\n        Z: {}\n    },\n\n    paramIsY: {\n        M: {1: true, drawn: 1},\n        L: {1: true, drawn: 1},\n        H: {},\n        V: {0: true, drawn: 0},\n        Q: {1: true, 3: true, drawn: 3},\n        C: {1: true, 3: true, 5: true, drawn: 5},\n        T: {1: true, drawn: 1},\n        S: {1: true, 3: true, drawn: 5},\n        // A: {1: true, 6: true},\n        Z: {}\n    },\n\n    numParams: {\n        M: 2,\n        L: 2,\n        H: 1,\n        V: 1,\n        Q: 4,\n        C: 6,\n        T: 2,\n        S: 4,\n        // A: 7,\n        Z: 0\n    }\n};\n\n},{}],132:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\n\nvar attributes = _dereq_('./attributes');\nvar helpers = _dereq_('./helpers');\n\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n    handleArrayContainerDefaults(layoutIn, layoutOut, {\n        name: 'shapes',\n        handleItemDefaults: handleShapeDefaults\n    });\n};\n\nfunction handleShapeDefaults(shapeIn, shapeOut, fullLayout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(shapeIn, shapeOut, attributes, attr, dflt);\n    }\n\n    var visible = coerce('visible');\n    if(!visible) return;\n\n    var path = coerce('path');\n    var dfltType = path ? 'path' : 'rect';\n    var shapeType = coerce('type', dfltType);\n    if(shapeOut.type !== 'path') delete shapeOut.path;\n\n    coerce('editable');\n    coerce('layer');\n    coerce('opacity');\n    coerce('fillcolor');\n    coerce('fillrule');\n    var lineWidth = coerce('line.width');\n    if(lineWidth) {\n        coerce('line.color');\n        coerce('line.dash');\n    }\n\n    var xSizeMode = coerce('xsizemode');\n    var ySizeMode = coerce('ysizemode');\n\n    // positioning\n    var axLetters = ['x', 'y'];\n    for(var i = 0; i < 2; i++) {\n        var axLetter = axLetters[i];\n        var attrAnchor = axLetter + 'anchor';\n        var sizeMode = axLetter === 'x' ? xSizeMode : ySizeMode;\n        var gdMock = {_fullLayout: fullLayout};\n        var ax;\n        var pos2r;\n        var r2pos;\n\n        // xref, yref\n        var axRef = Axes.coerceRef(shapeIn, shapeOut, gdMock, axLetter, '', 'paper');\n\n        if(axRef !== 'paper') {\n            ax = Axes.getFromId(gdMock, axRef);\n            ax._shapeIndices.push(shapeOut._index);\n            r2pos = helpers.rangeToShapePosition(ax);\n            pos2r = helpers.shapePositionToRange(ax);\n        } else {\n            pos2r = r2pos = Lib.identity;\n        }\n\n        // Coerce x0, x1, y0, y1\n        if(shapeType !== 'path') {\n            var dflt0 = 0.25;\n            var dflt1 = 0.75;\n\n            // hack until V2.0 when log has regular range behavior - make it look like other\n            // ranges to send to coerce, then put it back after\n            // this is all to give reasonable default position behavior on log axes, which is\n            // a pretty unimportant edge case so we could just ignore this.\n            var attr0 = axLetter + '0';\n            var attr1 = axLetter + '1';\n            var in0 = shapeIn[attr0];\n            var in1 = shapeIn[attr1];\n            shapeIn[attr0] = pos2r(shapeIn[attr0], true);\n            shapeIn[attr1] = pos2r(shapeIn[attr1], true);\n\n            if(sizeMode === 'pixel') {\n                coerce(attr0, 0);\n                coerce(attr1, 10);\n            } else {\n                Axes.coercePosition(shapeOut, gdMock, coerce, axRef, attr0, dflt0);\n                Axes.coercePosition(shapeOut, gdMock, coerce, axRef, attr1, dflt1);\n            }\n\n            // hack part 2\n            shapeOut[attr0] = r2pos(shapeOut[attr0]);\n            shapeOut[attr1] = r2pos(shapeOut[attr1]);\n            shapeIn[attr0] = in0;\n            shapeIn[attr1] = in1;\n        }\n\n        // Coerce xanchor and yanchor\n        if(sizeMode === 'pixel') {\n            // Hack for log axis described above\n            var inAnchor = shapeIn[attrAnchor];\n            shapeIn[attrAnchor] = pos2r(shapeIn[attrAnchor], true);\n\n            Axes.coercePosition(shapeOut, gdMock, coerce, axRef, attrAnchor, 0.25);\n\n            // Hack part 2\n            shapeOut[attrAnchor] = r2pos(shapeOut[attrAnchor]);\n            shapeIn[attrAnchor] = inAnchor;\n        }\n    }\n\n    if(shapeType === 'path') {\n        coerce('path');\n    } else {\n        Lib.noneOrAll(shapeIn, shapeOut, ['x0', 'x1', 'y0', 'y1']);\n    }\n}\n\n},{\"../../lib\":178,\"../../plots/array_container_defaults\":218,\"../../plots/cartesian/axes\":222,\"./attributes\":129,\"./helpers\":140}],133:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar readPaths = _dereq_('./draw_newshape/helpers').readPaths;\nvar displayOutlines = _dereq_('./draw_newshape/display_outlines');\n\nvar clearOutlineControllers = _dereq_('../../plots/cartesian/handle_outline').clearOutlineControllers;\n\nvar Color = _dereq_('../color');\nvar Drawing = _dereq_('../drawing');\nvar arrayEditor = _dereq_('../../plot_api/plot_template').arrayEditor;\n\nvar dragElement = _dereq_('../dragelement');\nvar setCursor = _dereq_('../../lib/setcursor');\n\nvar constants = _dereq_('./constants');\nvar helpers = _dereq_('./helpers');\n\n\n// Shapes are stored in gd.layout.shapes, an array of objects\n// index can point to one item in this array,\n//  or non-numeric to simply add a new one\n//  or -1 to modify all existing\n// opt can be the full options object, or one key (to be set to value)\n//  or undefined to simply redraw\n// if opt is blank, val can be 'add' or a full options object to add a new\n//  annotation at that point in the array, or 'remove' to delete this one\n\nmodule.exports = {\n    draw: draw,\n    drawOne: drawOne,\n    eraseActiveShape: eraseActiveShape\n};\n\nfunction draw(gd) {\n    var fullLayout = gd._fullLayout;\n\n    // Remove previous shapes before drawing new in shapes in fullLayout.shapes\n    fullLayout._shapeUpperLayer.selectAll('path').remove();\n    fullLayout._shapeLowerLayer.selectAll('path').remove();\n\n    for(var k in fullLayout._plots) {\n        var shapelayer = fullLayout._plots[k].shapelayer;\n        if(shapelayer) shapelayer.selectAll('path').remove();\n    }\n\n    for(var i = 0; i < fullLayout.shapes.length; i++) {\n        if(fullLayout.shapes[i].visible) {\n            drawOne(gd, i);\n        }\n    }\n\n    // may need to resurrect this if we put text (LaTeX) in shapes\n    // return Plots.previousPromises(gd);\n}\n\nfunction shouldSkipEdits(gd) {\n    return !!gd._fullLayout._drawing;\n}\n\nfunction couldHaveActiveShape(gd) {\n    // for now keep config.editable: true as it was before shape-drawing PR\n    return !gd._context.edits.shapePosition;\n}\n\nfunction drawOne(gd, index) {\n    // remove the existing shape if there is one.\n    // because indices can change, we need to look in all shape layers\n    gd._fullLayout._paperdiv\n        .selectAll('.shapelayer [data-index=\"' + index + '\"]')\n        .remove();\n\n    var o = helpers.makeOptionsAndPlotinfo(gd, index);\n    var options = o.options;\n    var plotinfo = o.plotinfo;\n\n    // this shape is gone - quit now after deleting it\n    // TODO: use d3 idioms instead of deleting and redrawing every time\n    if(!options._input || options.visible === false) return;\n\n    if(options.layer !== 'below') {\n        drawShape(gd._fullLayout._shapeUpperLayer);\n    } else if(options.xref === 'paper' || options.yref === 'paper') {\n        drawShape(gd._fullLayout._shapeLowerLayer);\n    } else {\n        if(plotinfo._hadPlotinfo) {\n            var mainPlot = plotinfo.mainplotinfo || plotinfo;\n            drawShape(mainPlot.shapelayer);\n        } else {\n            // Fall back to _shapeLowerLayer in case the requested subplot doesn't exist.\n            // This can happen if you reference the shape to an x / y axis combination\n            // that doesn't have any data on it (and layer is below)\n            drawShape(gd._fullLayout._shapeLowerLayer);\n        }\n    }\n\n    function drawShape(shapeLayer) {\n        var d = getPathString(gd, options);\n        var attrs = {\n            'data-index': index,\n            'fill-rule': options.fillrule,\n            d: d\n        };\n\n        var opacity = options.opacity;\n        var fillColor = options.fillcolor;\n        var lineColor = options.line.width ? options.line.color : 'rgba(0,0,0,0)';\n        var lineWidth = options.line.width;\n        var lineDash = options.line.dash;\n        if(!lineWidth && options.editable === true) {\n            // ensure invisible border to activate the shape\n            lineWidth = 5;\n            lineDash = 'solid';\n        }\n\n        var isOpen = d[d.length - 1] !== 'Z';\n\n        var isActiveShape = couldHaveActiveShape(gd) &&\n            options.editable && gd._fullLayout._activeShapeIndex === index;\n\n        if(isActiveShape) {\n            fillColor = isOpen ? 'rgba(0,0,0,0)' :\n                gd._fullLayout.activeshape.fillcolor;\n\n            opacity = gd._fullLayout.activeshape.opacity;\n        }\n\n        var path = shapeLayer.append('path')\n            .attr(attrs)\n            .style('opacity', opacity)\n            .call(Color.stroke, lineColor)\n            .call(Color.fill, fillColor)\n            .call(Drawing.dashLine, lineDash, lineWidth);\n\n        setClipPath(path, gd, options);\n\n        var editHelpers;\n        if(isActiveShape || gd._context.edits.shapePosition) editHelpers = arrayEditor(gd.layout, 'shapes', options);\n\n        if(isActiveShape) {\n            path.style({\n                'cursor': 'move',\n            });\n\n            var dragOptions = {\n                element: path.node(),\n                plotinfo: plotinfo,\n                gd: gd,\n                editHelpers: editHelpers,\n                isActiveShape: true // i.e. to enable controllers\n            };\n\n            var polygons = readPaths(d, gd);\n            // display polygons on the screen\n            displayOutlines(polygons, path, dragOptions);\n        } else {\n            if(gd._context.edits.shapePosition) {\n                setupDragElement(gd, path, options, index, shapeLayer, editHelpers);\n            } else if(options.editable === true) {\n                path.style('pointer-events',\n                    (isOpen || Color.opacity(fillColor) * opacity <= 0.5) ? 'stroke' : 'all'\n                );\n            }\n        }\n\n        path.node().addEventListener('click', function() { return activateShape(gd, path); });\n    }\n}\n\nfunction setClipPath(shapePath, gd, shapeOptions) {\n    // note that for layer=\"below\" the clipAxes can be different from the\n    // subplot we're drawing this in. This could cause problems if the shape\n    // spans two subplots. See https://github.com/plotly/plotly.js/issues/1452\n    var clipAxes = (shapeOptions.xref + shapeOptions.yref).replace(/paper/g, '');\n\n    Drawing.setClipUrl(\n        shapePath,\n        clipAxes ? 'clip' + gd._fullLayout._uid + clipAxes : null,\n        gd\n    );\n}\n\nfunction setupDragElement(gd, shapePath, shapeOptions, index, shapeLayer, editHelpers) {\n    var MINWIDTH = 10;\n    var MINHEIGHT = 10;\n\n    var xPixelSized = shapeOptions.xsizemode === 'pixel';\n    var yPixelSized = shapeOptions.ysizemode === 'pixel';\n    var isLine = shapeOptions.type === 'line';\n    var isPath = shapeOptions.type === 'path';\n\n    var modifyItem = editHelpers.modifyItem;\n\n    var x0, y0, x1, y1, xAnchor, yAnchor;\n    var n0, s0, w0, e0, optN, optS, optW, optE;\n    var pathIn;\n\n    // setup conversion functions\n    var xa = Axes.getFromId(gd, shapeOptions.xref);\n    var ya = Axes.getFromId(gd, shapeOptions.yref);\n    var x2p = helpers.getDataToPixel(gd, xa);\n    var y2p = helpers.getDataToPixel(gd, ya, true);\n    var p2x = helpers.getPixelToData(gd, xa);\n    var p2y = helpers.getPixelToData(gd, ya, true);\n\n    var sensoryElement = obtainSensoryElement();\n    var dragOptions = {\n        element: sensoryElement.node(),\n        gd: gd,\n        prepFn: startDrag,\n        doneFn: endDrag,\n        clickFn: abortDrag\n    };\n    var dragMode;\n\n    dragElement.init(dragOptions);\n\n    sensoryElement.node().onmousemove = updateDragMode;\n\n    function obtainSensoryElement() {\n        return isLine ? createLineDragHandles() : shapePath;\n    }\n\n    function createLineDragHandles() {\n        var minSensoryWidth = 10;\n        var sensoryWidth = Math.max(shapeOptions.line.width, minSensoryWidth);\n\n        // Helper shapes group\n        // Note that by setting the `data-index` attr, it is ensured that\n        // the helper group is purged in this modules `draw` function\n        var g = shapeLayer.append('g')\n          .attr('data-index', index);\n\n        // Helper path for moving\n        g.append('path')\n          .attr('d', shapePath.attr('d'))\n          .style({\n              'cursor': 'move',\n              'stroke-width': sensoryWidth,\n              'stroke-opacity': '0' // ensure not visible\n          });\n\n        // Helper circles for resizing\n        var circleStyle = {\n            'fill-opacity': '0' // ensure not visible\n        };\n        var circleRadius = Math.max(sensoryWidth / 2, minSensoryWidth);\n\n        g.append('circle')\n          .attr({\n              'data-line-point': 'start-point',\n              'cx': xPixelSized ? x2p(shapeOptions.xanchor) + shapeOptions.x0 : x2p(shapeOptions.x0),\n              'cy': yPixelSized ? y2p(shapeOptions.yanchor) - shapeOptions.y0 : y2p(shapeOptions.y0),\n              'r': circleRadius\n          })\n          .style(circleStyle)\n          .classed('cursor-grab', true);\n\n        g.append('circle')\n          .attr({\n              'data-line-point': 'end-point',\n              'cx': xPixelSized ? x2p(shapeOptions.xanchor) + shapeOptions.x1 : x2p(shapeOptions.x1),\n              'cy': yPixelSized ? y2p(shapeOptions.yanchor) - shapeOptions.y1 : y2p(shapeOptions.y1),\n              'r': circleRadius\n          })\n          .style(circleStyle)\n          .classed('cursor-grab', true);\n\n        return g;\n    }\n\n    function updateDragMode(evt) {\n        if(shouldSkipEdits(gd)) {\n            dragMode = null;\n            return;\n        }\n\n        if(isLine) {\n            if(evt.target.tagName === 'path') {\n                dragMode = 'move';\n            } else {\n                dragMode = evt.target.attributes['data-line-point'].value === 'start-point' ?\n                  'resize-over-start-point' : 'resize-over-end-point';\n            }\n        } else {\n            // element might not be on screen at time of setup,\n            // so obtain bounding box here\n            var dragBBox = dragOptions.element.getBoundingClientRect();\n\n            // choose 'move' or 'resize'\n            // based on initial position of cursor within the drag element\n            var w = dragBBox.right - dragBBox.left;\n            var h = dragBBox.bottom - dragBBox.top;\n            var x = evt.clientX - dragBBox.left;\n            var y = evt.clientY - dragBBox.top;\n            var cursor = (!isPath && w > MINWIDTH && h > MINHEIGHT && !evt.shiftKey) ?\n                dragElement.getCursor(x / w, 1 - y / h) :\n                'move';\n\n            setCursor(shapePath, cursor);\n\n            // possible values 'move', 'sw', 'w', 'se', 'e', 'ne', 'n', 'nw' and 'w'\n            dragMode = cursor.split('-')[0];\n        }\n    }\n\n    function startDrag(evt) {\n        if(shouldSkipEdits(gd)) return;\n\n        // setup update strings and initial values\n        if(xPixelSized) {\n            xAnchor = x2p(shapeOptions.xanchor);\n        }\n        if(yPixelSized) {\n            yAnchor = y2p(shapeOptions.yanchor);\n        }\n\n        if(shapeOptions.type === 'path') {\n            pathIn = shapeOptions.path;\n        } else {\n            x0 = xPixelSized ? shapeOptions.x0 : x2p(shapeOptions.x0);\n            y0 = yPixelSized ? shapeOptions.y0 : y2p(shapeOptions.y0);\n            x1 = xPixelSized ? shapeOptions.x1 : x2p(shapeOptions.x1);\n            y1 = yPixelSized ? shapeOptions.y1 : y2p(shapeOptions.y1);\n        }\n\n        if(x0 < x1) {\n            w0 = x0;\n            optW = 'x0';\n            e0 = x1;\n            optE = 'x1';\n        } else {\n            w0 = x1;\n            optW = 'x1';\n            e0 = x0;\n            optE = 'x0';\n        }\n\n        // For fixed size shapes take opposing direction of y-axis into account.\n        // Hint: For data sized shapes this is done by the y2p function.\n        if((!yPixelSized && y0 < y1) || (yPixelSized && y0 > y1)) {\n            n0 = y0;\n            optN = 'y0';\n            s0 = y1;\n            optS = 'y1';\n        } else {\n            n0 = y1;\n            optN = 'y1';\n            s0 = y0;\n            optS = 'y0';\n        }\n\n        // setup dragMode and the corresponding handler\n        updateDragMode(evt);\n        renderVisualCues(shapeLayer, shapeOptions);\n        deactivateClipPathTemporarily(shapePath, shapeOptions, gd);\n        dragOptions.moveFn = (dragMode === 'move') ? moveShape : resizeShape;\n        dragOptions.altKey = evt.altKey;\n    }\n\n    function endDrag() {\n        if(shouldSkipEdits(gd)) return;\n\n        setCursor(shapePath);\n        removeVisualCues(shapeLayer);\n\n        // Don't rely on clipPath being activated during re-layout\n        setClipPath(shapePath, gd, shapeOptions);\n        Registry.call('_guiRelayout', gd, editHelpers.getUpdateObj());\n    }\n\n    function abortDrag() {\n        if(shouldSkipEdits(gd)) return;\n\n        removeVisualCues(shapeLayer);\n    }\n\n    function moveShape(dx, dy) {\n        if(shapeOptions.type === 'path') {\n            var noOp = function(coord) { return coord; };\n            var moveX = noOp;\n            var moveY = noOp;\n\n            if(xPixelSized) {\n                modifyItem('xanchor', shapeOptions.xanchor = p2x(xAnchor + dx));\n            } else {\n                moveX = function moveX(x) { return p2x(x2p(x) + dx); };\n                if(xa && xa.type === 'date') moveX = helpers.encodeDate(moveX);\n            }\n\n            if(yPixelSized) {\n                modifyItem('yanchor', shapeOptions.yanchor = p2y(yAnchor + dy));\n            } else {\n                moveY = function moveY(y) { return p2y(y2p(y) + dy); };\n                if(ya && ya.type === 'date') moveY = helpers.encodeDate(moveY);\n            }\n\n            modifyItem('path', shapeOptions.path = movePath(pathIn, moveX, moveY));\n        } else {\n            if(xPixelSized) {\n                modifyItem('xanchor', shapeOptions.xanchor = p2x(xAnchor + dx));\n            } else {\n                modifyItem('x0', shapeOptions.x0 = p2x(x0 + dx));\n                modifyItem('x1', shapeOptions.x1 = p2x(x1 + dx));\n            }\n\n            if(yPixelSized) {\n                modifyItem('yanchor', shapeOptions.yanchor = p2y(yAnchor + dy));\n            } else {\n                modifyItem('y0', shapeOptions.y0 = p2y(y0 + dy));\n                modifyItem('y1', shapeOptions.y1 = p2y(y1 + dy));\n            }\n        }\n\n        shapePath.attr('d', getPathString(gd, shapeOptions));\n        renderVisualCues(shapeLayer, shapeOptions);\n    }\n\n    function resizeShape(dx, dy) {\n        if(isPath) {\n            // TODO: implement path resize, don't forget to update dragMode code\n            var noOp = function(coord) { return coord; };\n            var moveX = noOp;\n            var moveY = noOp;\n\n            if(xPixelSized) {\n                modifyItem('xanchor', shapeOptions.xanchor = p2x(xAnchor + dx));\n            } else {\n                moveX = function moveX(x) { return p2x(x2p(x) + dx); };\n                if(xa && xa.type === 'date') moveX = helpers.encodeDate(moveX);\n            }\n\n            if(yPixelSized) {\n                modifyItem('yanchor', shapeOptions.yanchor = p2y(yAnchor + dy));\n            } else {\n                moveY = function moveY(y) { return p2y(y2p(y) + dy); };\n                if(ya && ya.type === 'date') moveY = helpers.encodeDate(moveY);\n            }\n\n            modifyItem('path', shapeOptions.path = movePath(pathIn, moveX, moveY));\n        } else if(isLine) {\n            if(dragMode === 'resize-over-start-point') {\n                var newX0 = x0 + dx;\n                var newY0 = yPixelSized ? y0 - dy : y0 + dy;\n                modifyItem('x0', shapeOptions.x0 = xPixelSized ? newX0 : p2x(newX0));\n                modifyItem('y0', shapeOptions.y0 = yPixelSized ? newY0 : p2y(newY0));\n            } else if(dragMode === 'resize-over-end-point') {\n                var newX1 = x1 + dx;\n                var newY1 = yPixelSized ? y1 - dy : y1 + dy;\n                modifyItem('x1', shapeOptions.x1 = xPixelSized ? newX1 : p2x(newX1));\n                modifyItem('y1', shapeOptions.y1 = yPixelSized ? newY1 : p2y(newY1));\n            }\n        } else {\n            var has = function(str) { return dragMode.indexOf(str) !== -1; };\n            var hasN = has('n');\n            var hasS = has('s');\n            var hasW = has('w');\n            var hasE = has('e');\n\n            var newN = hasN ? n0 + dy : n0;\n            var newS = hasS ? s0 + dy : s0;\n            var newW = hasW ? w0 + dx : w0;\n            var newE = hasE ? e0 + dx : e0;\n\n            if(yPixelSized) {\n                // Do things in opposing direction for y-axis.\n                // Hint: for data-sized shapes the reversal of axis direction is done in p2y.\n                if(hasN) newN = n0 - dy;\n                if(hasS) newS = s0 - dy;\n            }\n\n            // Update shape eventually. Again, be aware of the\n            // opposing direction of the y-axis of fixed size shapes.\n            if(\n                (!yPixelSized && newS - newN > MINHEIGHT) ||\n                (yPixelSized && newN - newS > MINHEIGHT)\n            ) {\n                modifyItem(optN, shapeOptions[optN] = yPixelSized ? newN : p2y(newN));\n                modifyItem(optS, shapeOptions[optS] = yPixelSized ? newS : p2y(newS));\n            }\n            if(newE - newW > MINWIDTH) {\n                modifyItem(optW, shapeOptions[optW] = xPixelSized ? newW : p2x(newW));\n                modifyItem(optE, shapeOptions[optE] = xPixelSized ? newE : p2x(newE));\n            }\n        }\n\n        shapePath.attr('d', getPathString(gd, shapeOptions));\n        renderVisualCues(shapeLayer, shapeOptions);\n    }\n\n    function renderVisualCues(shapeLayer, shapeOptions) {\n        if(xPixelSized || yPixelSized) {\n            renderAnchor();\n        }\n\n        function renderAnchor() {\n            var isNotPath = shapeOptions.type !== 'path';\n\n            // d3 join with dummy data to satisfy d3 data-binding\n            var visualCues = shapeLayer.selectAll('.visual-cue').data([0]);\n\n            // Enter\n            var strokeWidth = 1;\n            visualCues.enter()\n              .append('path')\n              .attr({\n                  'fill': '#fff',\n                  'fill-rule': 'evenodd',\n                  'stroke': '#000',\n                  'stroke-width': strokeWidth\n              })\n              .classed('visual-cue', true);\n\n            // Update\n            var posX = x2p(\n              xPixelSized ?\n                shapeOptions.xanchor :\n                Lib.midRange(\n                  isNotPath ?\n                    [shapeOptions.x0, shapeOptions.x1] :\n                    helpers.extractPathCoords(shapeOptions.path, constants.paramIsX))\n            );\n            var posY = y2p(\n              yPixelSized ?\n                shapeOptions.yanchor :\n                Lib.midRange(\n                  isNotPath ?\n                    [shapeOptions.y0, shapeOptions.y1] :\n                    helpers.extractPathCoords(shapeOptions.path, constants.paramIsY))\n            );\n\n            posX = helpers.roundPositionForSharpStrokeRendering(posX, strokeWidth);\n            posY = helpers.roundPositionForSharpStrokeRendering(posY, strokeWidth);\n\n            if(xPixelSized && yPixelSized) {\n                var crossPath = 'M' + (posX - 1 - strokeWidth) + ',' + (posY - 1 - strokeWidth) +\n                  'h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z';\n                visualCues.attr('d', crossPath);\n            } else if(xPixelSized) {\n                var vBarPath = 'M' + (posX - 1 - strokeWidth) + ',' + (posY - 9 - strokeWidth) +\n                  'v18 h2 v-18 Z';\n                visualCues.attr('d', vBarPath);\n            } else {\n                var hBarPath = 'M' + (posX - 9 - strokeWidth) + ',' + (posY - 1 - strokeWidth) +\n                  'h18 v2 h-18 Z';\n                visualCues.attr('d', hBarPath);\n            }\n        }\n    }\n\n    function removeVisualCues(shapeLayer) {\n        shapeLayer.selectAll('.visual-cue').remove();\n    }\n\n    function deactivateClipPathTemporarily(shapePath, shapeOptions, gd) {\n        var xref = shapeOptions.xref;\n        var yref = shapeOptions.yref;\n        var xa = Axes.getFromId(gd, xref);\n        var ya = Axes.getFromId(gd, yref);\n\n        var clipAxes = '';\n        if(xref !== 'paper' && !xa.autorange) clipAxes += xref;\n        if(yref !== 'paper' && !ya.autorange) clipAxes += yref;\n\n        Drawing.setClipUrl(\n            shapePath,\n            clipAxes ? 'clip' + gd._fullLayout._uid + clipAxes : null,\n            gd\n        );\n    }\n}\n\nfunction getPathString(gd, options) {\n    var type = options.type;\n    var xa = Axes.getFromId(gd, options.xref);\n    var ya = Axes.getFromId(gd, options.yref);\n    var gs = gd._fullLayout._size;\n    var x2r, x2p, y2r, y2p;\n    var x0, x1, y0, y1;\n\n    if(xa) {\n        x2r = helpers.shapePositionToRange(xa);\n        x2p = function(v) { return xa._offset + xa.r2p(x2r(v, true)); };\n    } else {\n        x2p = function(v) { return gs.l + gs.w * v; };\n    }\n\n    if(ya) {\n        y2r = helpers.shapePositionToRange(ya);\n        y2p = function(v) { return ya._offset + ya.r2p(y2r(v, true)); };\n    } else {\n        y2p = function(v) { return gs.t + gs.h * (1 - v); };\n    }\n\n    if(type === 'path') {\n        if(xa && xa.type === 'date') x2p = helpers.decodeDate(x2p);\n        if(ya && ya.type === 'date') y2p = helpers.decodeDate(y2p);\n        return convertPath(options, x2p, y2p);\n    }\n\n    if(options.xsizemode === 'pixel') {\n        var xAnchorPos = x2p(options.xanchor);\n        x0 = xAnchorPos + options.x0;\n        x1 = xAnchorPos + options.x1;\n    } else {\n        x0 = x2p(options.x0);\n        x1 = x2p(options.x1);\n    }\n\n    if(options.ysizemode === 'pixel') {\n        var yAnchorPos = y2p(options.yanchor);\n        y0 = yAnchorPos - options.y0;\n        y1 = yAnchorPos - options.y1;\n    } else {\n        y0 = y2p(options.y0);\n        y1 = y2p(options.y1);\n    }\n\n    if(type === 'line') return 'M' + x0 + ',' + y0 + 'L' + x1 + ',' + y1;\n    if(type === 'rect') return 'M' + x0 + ',' + y0 + 'H' + x1 + 'V' + y1 + 'H' + x0 + 'Z';\n\n    // circle\n    var cx = (x0 + x1) / 2;\n    var cy = (y0 + y1) / 2;\n    var rx = Math.abs(cx - x0);\n    var ry = Math.abs(cy - y0);\n    var rArc = 'A' + rx + ',' + ry;\n    var rightPt = (cx + rx) + ',' + cy;\n    var topPt = cx + ',' + (cy - ry);\n    return 'M' + rightPt + rArc + ' 0 1,1 ' + topPt +\n        rArc + ' 0 0,1 ' + rightPt + 'Z';\n}\n\n\nfunction convertPath(options, x2p, y2p) {\n    var pathIn = options.path;\n    var xSizemode = options.xsizemode;\n    var ySizemode = options.ysizemode;\n    var xAnchor = options.xanchor;\n    var yAnchor = options.yanchor;\n\n    return pathIn.replace(constants.segmentRE, function(segment) {\n        var paramNumber = 0;\n        var segmentType = segment.charAt(0);\n        var xParams = constants.paramIsX[segmentType];\n        var yParams = constants.paramIsY[segmentType];\n        var nParams = constants.numParams[segmentType];\n\n        var paramString = segment.substr(1).replace(constants.paramRE, function(param) {\n            if(xParams[paramNumber]) {\n                if(xSizemode === 'pixel') param = x2p(xAnchor) + Number(param);\n                else param = x2p(param);\n            } else if(yParams[paramNumber]) {\n                if(ySizemode === 'pixel') param = y2p(yAnchor) - Number(param);\n                else param = y2p(param);\n            }\n            paramNumber++;\n\n            if(paramNumber > nParams) param = 'X';\n            return param;\n        });\n\n        if(paramNumber > nParams) {\n            paramString = paramString.replace(/[\\s,]*X.*/, '');\n            Lib.log('Ignoring extra params in segment ' + segment);\n        }\n\n        return segmentType + paramString;\n    });\n}\n\nfunction movePath(pathIn, moveX, moveY) {\n    return pathIn.replace(constants.segmentRE, function(segment) {\n        var paramNumber = 0;\n        var segmentType = segment.charAt(0);\n        var xParams = constants.paramIsX[segmentType];\n        var yParams = constants.paramIsY[segmentType];\n        var nParams = constants.numParams[segmentType];\n\n        var paramString = segment.substr(1).replace(constants.paramRE, function(param) {\n            if(paramNumber >= nParams) return param;\n\n            if(xParams[paramNumber]) param = moveX(param);\n            else if(yParams[paramNumber]) param = moveY(param);\n\n            paramNumber++;\n\n            return param;\n        });\n\n        return segmentType + paramString;\n    });\n}\n\nfunction activateShape(gd, path) {\n    if(!couldHaveActiveShape(gd)) return;\n\n    var element = path.node();\n    var id = +element.getAttribute('data-index');\n    if(id >= 0) {\n        // deactivate if already active\n        if(id === gd._fullLayout._activeShapeIndex) {\n            deactivateShape(gd);\n            return;\n        }\n\n        gd._fullLayout._activeShapeIndex = id;\n        gd._fullLayout._deactivateShape = deactivateShape;\n        draw(gd);\n    }\n}\n\nfunction deactivateShape(gd) {\n    if(!couldHaveActiveShape(gd)) return;\n\n    var id = gd._fullLayout._activeShapeIndex;\n    if(id >= 0) {\n        clearOutlineControllers(gd);\n        delete gd._fullLayout._activeShapeIndex;\n        draw(gd);\n    }\n}\n\nfunction eraseActiveShape(gd) {\n    if(!couldHaveActiveShape(gd)) return;\n\n    clearOutlineControllers(gd);\n\n    var id = gd._fullLayout._activeShapeIndex;\n    var shapes = (gd.layout || {}).shapes || [];\n    if(id < shapes.length) {\n        var newShapes = [];\n        for(var q = 0; q < shapes.length; q++) {\n            if(q !== id) {\n                newShapes.push(shapes[q]);\n            }\n        }\n\n        delete gd._fullLayout._activeShapeIndex;\n\n        Registry.call('_guiRelayout', gd, {\n            shapes: newShapes\n        });\n    }\n}\n\n},{\"../../lib\":178,\"../../lib/setcursor\":197,\"../../plot_api/plot_template\":212,\"../../plots/cartesian/axes\":222,\"../../plots/cartesian/handle_outline\":232,\"../../registry\":269,\"../color\":52,\"../dragelement\":71,\"../drawing\":74,\"./constants\":131,\"./draw_newshape/display_outlines\":137,\"./draw_newshape/helpers\":138,\"./helpers\":140}],134:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar dash = _dereq_('../../drawing/attributes').dash;\nvar extendFlat = _dereq_('../../../lib/extend').extendFlat;\n\nmodule.exports = {\n    newshape: {\n        line: {\n            color: {\n                valType: 'color',\n                editType: 'none',\n                \n                \n            },\n            width: {\n                valType: 'number',\n                min: 0,\n                dflt: 4,\n                \n                editType: 'none',\n                \n            },\n            dash: extendFlat({}, dash, {\n                dflt: 'solid',\n                editType: 'none'\n            }),\n            \n            editType: 'none'\n        },\n        fillcolor: {\n            valType: 'color',\n            dflt: 'rgba(0,0,0,0)',\n            \n            editType: 'none',\n            \n        },\n        fillrule: {\n            valType: 'enumerated',\n            values: ['evenodd', 'nonzero'],\n            dflt: 'evenodd',\n            \n            editType: 'none',\n            \n        },\n        opacity: {\n            valType: 'number',\n            min: 0,\n            max: 1,\n            dflt: 1,\n            \n            editType: 'none',\n            \n        },\n        layer: {\n            valType: 'enumerated',\n            values: ['below', 'above'],\n            dflt: 'above',\n            \n            editType: 'none',\n            \n        },\n        drawdirection: {\n            valType: 'enumerated',\n            \n            values: ['ortho', 'horizontal', 'vertical', 'diagonal'],\n            dflt: 'diagonal',\n            editType: 'none',\n            \n        },\n\n        editType: 'none'\n    },\n\n    activeshape: {\n        fillcolor: {\n            valType: 'color',\n            dflt: 'rgb(255,0,255)',\n            \n            editType: 'none',\n            \n        },\n        opacity: {\n            valType: 'number',\n            min: 0,\n            max: 1,\n            dflt: 0.5,\n            \n            editType: 'none',\n            \n        },\n        editType: 'none'\n    }\n};\n\n},{\"../../../lib/extend\":173,\"../../drawing/attributes\":73}],135:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar CIRCLE_SIDES = 32;  // should be divisible by 4\n\nmodule.exports = {\n    CIRCLE_SIDES: CIRCLE_SIDES,\n    i000: 0,\n    i090: CIRCLE_SIDES / 4,\n    i180: CIRCLE_SIDES / 2,\n    i270: CIRCLE_SIDES / 4 * 3,\n    cos45: Math.cos(Math.PI / 4),\n    sin45: Math.sin(Math.PI / 4),\n    SQRT2: Math.sqrt(2)\n};\n\n},{}],136:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = _dereq_('../../color');\n\n\nmodule.exports = function supplyDrawNewShapeDefaults(layoutIn, layoutOut, coerce) {\n    coerce('newshape.drawdirection');\n    coerce('newshape.layer');\n    coerce('newshape.fillcolor');\n    coerce('newshape.fillrule');\n    coerce('newshape.opacity');\n    var newshapeLineWidth = coerce('newshape.line.width');\n    if(newshapeLineWidth) {\n        var bgcolor = (layoutIn || {}).plot_bgcolor || '#FFF';\n        coerce('newshape.line.color', Color.contrast(bgcolor));\n        coerce('newshape.line.dash');\n    }\n\n    coerce('activeshape.fillcolor');\n    coerce('activeshape.opacity');\n};\n\n},{\"../../color\":52}],137:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar dragElement = _dereq_('../../dragelement');\nvar dragHelpers = _dereq_('../../dragelement/helpers');\nvar drawMode = dragHelpers.drawMode;\n\nvar Registry = _dereq_('../../../registry');\n\nvar constants = _dereq_('./constants');\nvar i000 = constants.i000;\nvar i090 = constants.i090;\nvar i180 = constants.i180;\nvar i270 = constants.i270;\n\nvar handleOutline = _dereq_('../../../plots/cartesian/handle_outline');\nvar clearOutlineControllers = handleOutline.clearOutlineControllers;\n\nvar helpers = _dereq_('./helpers');\nvar pointsShapeRectangle = helpers.pointsShapeRectangle;\nvar pointsShapeEllipse = helpers.pointsShapeEllipse;\nvar writePaths = helpers.writePaths;\nvar newShapes = _dereq_('./newshapes');\n\nmodule.exports = function displayOutlines(polygons, outlines, dragOptions, nCalls) {\n    if(!nCalls) nCalls = 0;\n\n    var gd = dragOptions.gd;\n\n    function redraw() {\n        // recursive call\n        displayOutlines(polygons, outlines, dragOptions, nCalls++);\n\n        if(pointsShapeEllipse(polygons[0])) {\n            update({redrawing: true});\n        }\n    }\n\n    function update(opts) {\n        dragOptions.isActiveShape = false; // i.e. to disable controllers\n\n        var updateObject = newShapes(outlines, dragOptions);\n        if(Object.keys(updateObject).length) {\n            Registry.call((opts || {}).redrawing ? 'relayout' : '_guiRelayout', gd, updateObject);\n        }\n    }\n\n\n    var isActiveShape = dragOptions.isActiveShape;\n    var fullLayout = gd._fullLayout;\n    var zoomLayer = fullLayout._zoomlayer;\n\n    var dragmode = dragOptions.dragmode;\n    var isDrawMode = drawMode(dragmode);\n\n    if(isDrawMode) gd._fullLayout._drawing = true;\n    else if(gd._fullLayout._activeShapeIndex >= 0) clearOutlineControllers(gd);\n\n    // make outline\n    outlines.attr('d', writePaths(polygons));\n\n    // add controllers\n    var vertexDragOptions;\n    var shapeDragOptions;\n    var indexI; // cell index\n    var indexJ; // vertex or cell-controller index\n    var copyPolygons;\n\n    if(isActiveShape && !nCalls) {\n        copyPolygons = recordPositions([], polygons);\n\n        var g = zoomLayer.append('g').attr('class', 'outline-controllers');\n        addVertexControllers(g);\n        addShapeControllers();\n    }\n\n    function startDragVertex(evt) {\n        indexI = +evt.srcElement.getAttribute('data-i');\n        indexJ = +evt.srcElement.getAttribute('data-j');\n\n        vertexDragOptions[indexI][indexJ].moveFn = moveVertexController;\n    }\n\n    function moveVertexController(dx, dy) {\n        if(!polygons.length) return;\n\n        var x0 = copyPolygons[indexI][indexJ][1];\n        var y0 = copyPolygons[indexI][indexJ][2];\n\n        var cell = polygons[indexI];\n        var len = cell.length;\n        if(pointsShapeRectangle(cell)) {\n            for(var q = 0; q < len; q++) {\n                if(q === indexJ) continue;\n\n                // move other corners of rectangle\n                var pos = cell[q];\n\n                if(pos[1] === cell[indexJ][1]) {\n                    pos[1] = x0 + dx;\n                }\n\n                if(pos[2] === cell[indexJ][2]) {\n                    pos[2] = y0 + dy;\n                }\n            }\n            // move the corner\n            cell[indexJ][1] = x0 + dx;\n            cell[indexJ][2] = y0 + dy;\n\n            if(!pointsShapeRectangle(cell)) {\n                // reject result to rectangles with ensure areas\n                for(var j = 0; j < len; j++) {\n                    for(var k = 0; k < cell[j].length; k++) {\n                        cell[j][k] = copyPolygons[indexI][j][k];\n                    }\n                }\n            }\n        } else { // other polylines\n            cell[indexJ][1] = x0 + dx;\n            cell[indexJ][2] = y0 + dy;\n        }\n\n        redraw();\n    }\n\n    function endDragVertexController() {\n        update();\n    }\n\n    function removeVertex() {\n        if(!polygons.length) return;\n        if(!polygons[indexI]) return;\n        if(!polygons[indexI].length) return;\n\n        var newPolygon = [];\n        for(var j = 0; j < polygons[indexI].length; j++) {\n            if(j !== indexJ) {\n                newPolygon.push(\n                    polygons[indexI][j]\n                );\n            }\n        }\n\n        if(newPolygon.length > 1 && !(\n            newPolygon.length === 2 && newPolygon[1][0] === 'Z')\n        ) {\n            if(indexJ === 0) {\n                newPolygon[0][0] = 'M';\n            }\n\n            polygons[indexI] = newPolygon;\n\n            redraw();\n            update();\n        }\n    }\n\n    function clickVertexController(numClicks, evt) {\n        if(numClicks === 2) {\n            indexI = +evt.srcElement.getAttribute('data-i');\n            indexJ = +evt.srcElement.getAttribute('data-j');\n\n            var cell = polygons[indexI];\n            if(\n                !pointsShapeRectangle(cell) &&\n                !pointsShapeEllipse(cell)\n            ) {\n                removeVertex();\n            }\n        }\n    }\n\n    function addVertexControllers(g) {\n        vertexDragOptions = [];\n\n        for(var i = 0; i < polygons.length; i++) {\n            var cell = polygons[i];\n\n            var onRect = pointsShapeRectangle(cell);\n            var onEllipse = !onRect && pointsShapeEllipse(cell);\n\n            vertexDragOptions[i] = [];\n            for(var j = 0; j < cell.length; j++) {\n                if(cell[j][0] === 'Z') continue;\n\n                if(onEllipse &&\n                    j !== i000 &&\n                    j !== i090 &&\n                    j !== i180 &&\n                    j !== i270\n                ) {\n                    continue;\n                }\n\n                var x = cell[j][1];\n                var y = cell[j][2];\n\n                var vertex = g.append('circle')\n                    .classed('cursor-grab', true)\n                    .attr('data-i', i)\n                    .attr('data-j', j)\n                    .attr('cx', x)\n                    .attr('cy', y)\n                    .attr('r', 4)\n                    .style({\n                        'mix-blend-mode': 'luminosity',\n                        fill: 'black',\n                        stroke: 'white',\n                        'stroke-width': 1\n                    });\n\n                vertexDragOptions[i][j] = {\n                    element: vertex.node(),\n                    gd: gd,\n                    prepFn: startDragVertex,\n                    doneFn: endDragVertexController,\n                    clickFn: clickVertexController\n                };\n\n                dragElement.init(vertexDragOptions[i][j]);\n            }\n        }\n    }\n\n    function moveShape(dx, dy) {\n        if(!polygons.length) return;\n\n        for(var i = 0; i < polygons.length; i++) {\n            for(var j = 0; j < polygons[i].length; j++) {\n                for(var k = 0; k + 2 < polygons[i][j].length; k += 2) {\n                    polygons[i][j][k + 1] = copyPolygons[i][j][k + 1] + dx;\n                    polygons[i][j][k + 2] = copyPolygons[i][j][k + 2] + dy;\n                }\n            }\n        }\n    }\n\n    function moveShapeController(dx, dy) {\n        moveShape(dx, dy);\n\n        redraw();\n    }\n\n    function startDragShapeController(evt) {\n        indexI = +evt.srcElement.getAttribute('data-i');\n        if(!indexI) indexI = 0; // ensure non-existing move button get zero index\n\n        shapeDragOptions[indexI].moveFn = moveShapeController;\n    }\n\n    function endDragShapeController() {\n        update();\n    }\n\n    function addShapeControllers() {\n        shapeDragOptions = [];\n\n        if(!polygons.length) return;\n\n        var i = 0;\n        shapeDragOptions[i] = {\n            element: outlines[0][0],\n            gd: gd,\n            prepFn: startDragShapeController,\n            doneFn: endDragShapeController\n        };\n\n        dragElement.init(shapeDragOptions[i]);\n    }\n};\n\nfunction recordPositions(polygonsOut, polygonsIn) {\n    for(var i = 0; i < polygonsIn.length; i++) {\n        var cell = polygonsIn[i];\n        polygonsOut[i] = [];\n        for(var j = 0; j < cell.length; j++) {\n            polygonsOut[i][j] = [];\n            for(var k = 0; k < cell[j].length; k++) {\n                polygonsOut[i][j][k] = cell[j][k];\n            }\n        }\n    }\n    return polygonsOut;\n}\n\n},{\"../../../plots/cartesian/handle_outline\":232,\"../../../registry\":269,\"../../dragelement\":71,\"../../dragelement/helpers\":70,\"./constants\":135,\"./helpers\":138,\"./newshapes\":139}],138:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar parseSvgPath = _dereq_('parse-svg-path');\n\nvar constants = _dereq_('./constants');\nvar CIRCLE_SIDES = constants.CIRCLE_SIDES;\nvar SQRT2 = constants.SQRT2;\n\nvar cartesianHelpers = _dereq_('../../../plots/cartesian/helpers');\nvar p2r = cartesianHelpers.p2r;\nvar r2p = cartesianHelpers.r2p;\n\nvar iC = [0, 3, 4, 5, 6, 1, 2];\nvar iQS = [0, 3, 4, 1, 2];\n\nexports.writePaths = function(polygons) {\n    var nI = polygons.length;\n    if(!nI) return 'M0,0Z';\n\n    var str = '';\n    for(var i = 0; i < nI; i++) {\n        var nJ = polygons[i].length;\n        for(var j = 0; j < nJ; j++) {\n            var w = polygons[i][j][0];\n            if(w === 'Z') {\n                str += 'Z';\n            } else {\n                var nK = polygons[i][j].length;\n                for(var k = 0; k < nK; k++) {\n                    var realK = k;\n                    if(w === 'Q' || w === 'S') {\n                        realK = iQS[k];\n                    } else if(w === 'C') {\n                        realK = iC[k];\n                    }\n\n                    str += polygons[i][j][realK];\n                    if(k > 0 && k < nK - 1) {\n                        str += ',';\n                    }\n                }\n            }\n        }\n    }\n\n    return str;\n};\n\nexports.readPaths = function(str, gd, plotinfo, isActiveShape) {\n    var cmd = parseSvgPath(str);\n\n    var polys = [];\n    var n = -1;\n    var newPoly = function() {\n        n++;\n        polys[n] = [];\n    };\n\n    var k;\n    var x = 0;\n    var y = 0;\n    var initX;\n    var initY;\n    var recStart = function() {\n        initX = x;\n        initY = y;\n    };\n\n    recStart();\n    for(var i = 0; i < cmd.length; i++) {\n        var newPos = [];\n\n        var x1, x2, y1, y2; // i.e. extra params for curves\n\n        var c = cmd[i][0];\n        var w = c;\n        switch(c) {\n            case 'M':\n                newPoly();\n                x = +cmd[i][1];\n                y = +cmd[i][2];\n                newPos.push([w, x, y]);\n\n                recStart();\n                break;\n\n            case 'Q':\n            case 'S':\n                x1 = +cmd[i][1];\n                y1 = +cmd[i][2];\n                x = +cmd[i][3];\n                y = +cmd[i][4];\n                newPos.push([w, x, y, x1, y1]); // -> iQS order\n                break;\n\n            case 'C':\n                x1 = +cmd[i][1];\n                y1 = +cmd[i][2];\n                x2 = +cmd[i][3];\n                y2 = +cmd[i][4];\n                x = +cmd[i][5];\n                y = +cmd[i][6];\n                newPos.push([w, x, y, x1, y1, x2, y2]); // -> iC order\n                break;\n\n            case 'T':\n            case 'L':\n                x = +cmd[i][1];\n                y = +cmd[i][2];\n                newPos.push([w, x, y]);\n                break;\n\n            case 'H':\n                w = 'L'; // convert to line (for now)\n                x = +cmd[i][1];\n                newPos.push([w, x, y]);\n                break;\n\n            case 'V':\n                w = 'L'; // convert to line (for now)\n                y = +cmd[i][1];\n                newPos.push([w, x, y]);\n                break;\n\n            case 'A':\n                w = 'L'; // convert to line to handle circle\n                var rx = +cmd[i][1];\n                var ry = +cmd[i][2];\n                if(!+cmd[i][4]) {\n                    rx = -rx;\n                    ry = -ry;\n                }\n\n                var cenX = x - rx;\n                var cenY = y;\n                for(k = 1; k <= CIRCLE_SIDES / 2; k++) {\n                    var t = 2 * Math.PI * k / CIRCLE_SIDES;\n                    newPos.push([\n                        w,\n                        cenX + rx * Math.cos(t),\n                        cenY + ry * Math.sin(t)\n                    ]);\n                }\n                break;\n\n            case 'Z':\n                if(x !== initX || y !== initY) {\n                    x = initX;\n                    y = initY;\n                    newPos.push([w, x, y]);\n                }\n                break;\n        }\n\n        var domain = (plotinfo || {}).domain;\n        var size = gd._fullLayout._size;\n        var xPixelSized = plotinfo && plotinfo.xsizemode === 'pixel';\n        var yPixelSized = plotinfo && plotinfo.ysizemode === 'pixel';\n        var noOffset = isActiveShape === false;\n\n        for(var j = 0; j < newPos.length; j++) {\n            for(k = 0; k + 2 < 7; k += 2) {\n                var _x = newPos[j][k + 1];\n                var _y = newPos[j][k + 2];\n\n                if(_x === undefined || _y === undefined) continue;\n                // keep track of end point for Z\n                x = _x;\n                y = _y;\n\n                if(plotinfo) {\n                    if(plotinfo.xaxis && plotinfo.xaxis.p2r) {\n                        if(noOffset) _x -= plotinfo.xaxis._offset;\n                        if(xPixelSized) {\n                            _x = r2p(plotinfo.xaxis, plotinfo.xanchor) + _x;\n                        } else {\n                            _x = p2r(plotinfo.xaxis, _x);\n                        }\n                    } else {\n                        if(noOffset) _x -= size.l;\n                        if(domain) _x = domain.x[0] + _x / size.w;\n                        else _x = _x / size.w;\n                    }\n\n                    if(plotinfo.yaxis && plotinfo.yaxis.p2r) {\n                        if(noOffset) _y -= plotinfo.yaxis._offset;\n                        if(yPixelSized) {\n                            _y = r2p(plotinfo.yaxis, plotinfo.yanchor) - _y;\n                        } else {\n                            _y = p2r(plotinfo.yaxis, _y);\n                        }\n                    } else {\n                        if(noOffset) _y -= size.t;\n                        if(domain) _y = domain.y[1] - _y / size.h;\n                        else _y = 1 - _y / size.h;\n                    }\n                }\n\n                newPos[j][k + 1] = _x;\n                newPos[j][k + 2] = _y;\n            }\n            polys[n].push(\n                newPos[j].slice()\n            );\n        }\n    }\n\n    return polys;\n};\n\nfunction almostEq(a, b) {\n    return Math.abs(a - b) <= 1e-6;\n}\n\nfunction dist(a, b) {\n    var dx = b[1] - a[1];\n    var dy = b[2] - a[2];\n    return Math.sqrt(\n        dx * dx +\n        dy * dy\n    );\n}\n\nexports.pointsShapeRectangle = function(cell) {\n    var len = cell.length;\n    if(len !== 5) return false;\n\n    for(var j = 1; j < 3; j++) {\n        var e01 = cell[0][j] - cell[1][j];\n        var e32 = cell[3][j] - cell[2][j];\n\n        if(!almostEq(e01, e32)) return false;\n\n        var e03 = cell[0][j] - cell[3][j];\n        var e12 = cell[1][j] - cell[2][j];\n        if(!almostEq(e03, e12)) return false;\n    }\n\n    // N.B. rotated rectangles are not valid rects since rotation is not supported in shapes for now.\n    if(\n        !almostEq(cell[0][1], cell[1][1]) &&\n        !almostEq(cell[0][1], cell[3][1])\n    ) return false;\n\n    // reject cases with zero area\n    return !!(\n        dist(cell[0], cell[1]) *\n        dist(cell[0], cell[3])\n    );\n};\n\nexports.pointsShapeEllipse = function(cell) {\n    var len = cell.length;\n    if(len !== CIRCLE_SIDES + 1) return false;\n\n    // opposite diagonals should be the same\n    len = CIRCLE_SIDES;\n    for(var i = 0; i < len; i++) {\n        var k = (len * 2 - i) % len;\n\n        var k2 = (len / 2 + k) % len;\n        var i2 = (len / 2 + i) % len;\n\n        if(!almostEq(\n            dist(cell[i], cell[i2]),\n            dist(cell[k], cell[k2])\n        )) return false;\n    }\n    return true;\n};\n\nexports.handleEllipse = function(isEllipse, start, end) {\n    if(!isEllipse) return [start, end]; // i.e. case of line\n\n    var pos = exports.ellipseOver({\n        x0: start[0],\n        y0: start[1],\n        x1: end[0],\n        y1: end[1]\n    });\n\n    var cx = (pos.x1 + pos.x0) / 2;\n    var cy = (pos.y1 + pos.y0) / 2;\n    var rx = (pos.x1 - pos.x0) / 2;\n    var ry = (pos.y1 - pos.y0) / 2;\n\n    // make a circle when one dimension is zero\n    if(!rx) rx = ry = ry / SQRT2;\n    if(!ry) ry = rx = rx / SQRT2;\n\n    var cell = [];\n    for(var i = 0; i < CIRCLE_SIDES; i++) {\n        var t = i * 2 * Math.PI / CIRCLE_SIDES;\n        cell.push([\n            cx + rx * Math.cos(t),\n            cy + ry * Math.sin(t),\n        ]);\n    }\n    return cell;\n};\n\nexports.ellipseOver = function(pos) {\n    var x0 = pos.x0;\n    var y0 = pos.y0;\n    var x1 = pos.x1;\n    var y1 = pos.y1;\n\n    var dx = x1 - x0;\n    var dy = y1 - y0;\n\n    x0 -= dx;\n    y0 -= dy;\n\n    var cx = (x0 + x1) / 2;\n    var cy = (y0 + y1) / 2;\n\n    var scale = SQRT2;\n    dx *= scale;\n    dy *= scale;\n\n    return {\n        x0: cx - dx,\n        y0: cy - dy,\n        x1: cx + dx,\n        y1: cy + dy\n    };\n};\n\n},{\"../../../plots/cartesian/helpers\":233,\"./constants\":135,\"parse-svg-path\":25}],139:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar dragHelpers = _dereq_('../../dragelement/helpers');\nvar drawMode = dragHelpers.drawMode;\nvar openMode = dragHelpers.openMode;\n\nvar constants = _dereq_('./constants');\nvar i000 = constants.i000;\nvar i090 = constants.i090;\nvar i180 = constants.i180;\nvar i270 = constants.i270;\nvar cos45 = constants.cos45;\nvar sin45 = constants.sin45;\n\nvar cartesianHelpers = _dereq_('../../../plots/cartesian/helpers');\nvar p2r = cartesianHelpers.p2r;\nvar r2p = cartesianHelpers.r2p;\n\nvar handleOutline = _dereq_('../../../plots/cartesian/handle_outline');\nvar clearSelect = handleOutline.clearSelect;\n\nvar helpers = _dereq_('./helpers');\nvar readPaths = helpers.readPaths;\nvar writePaths = helpers.writePaths;\nvar ellipseOver = helpers.ellipseOver;\n\n\nmodule.exports = function newShapes(outlines, dragOptions) {\n    if(!outlines.length) return;\n    var e = outlines[0][0]; // pick first\n    if(!e) return;\n    var d = e.getAttribute('d');\n\n    var gd = dragOptions.gd;\n    var drwStyle = gd._fullLayout.newshape;\n\n    var plotinfo = dragOptions.plotinfo;\n    var xaxis = plotinfo.xaxis;\n    var yaxis = plotinfo.yaxis;\n    var xPaper = !!plotinfo.domain || !plotinfo.xaxis;\n    var yPaper = !!plotinfo.domain || !plotinfo.yaxis;\n\n    var isActiveShape = dragOptions.isActiveShape;\n    var dragmode = dragOptions.dragmode;\n\n    var shapes = (gd.layout || {}).shapes || [];\n\n    if(!drawMode(dragmode) && isActiveShape !== undefined) {\n        var id = gd._fullLayout._activeShapeIndex;\n        if(id < shapes.length) {\n            switch(gd._fullLayout.shapes[id].type) {\n                case 'rect':\n                    dragmode = 'drawrect';\n                    break;\n                case 'circle':\n                    dragmode = 'drawcircle';\n                    break;\n                case 'line':\n                    dragmode = 'drawline';\n                    break;\n                case 'path':\n                    var path = shapes[id].path || '';\n                    if(path[path.length - 1] === 'Z') {\n                        dragmode = 'drawclosedpath';\n                    } else {\n                        dragmode = 'drawopenpath';\n                    }\n                    break;\n            }\n        }\n    }\n\n    var isOpenMode = openMode(dragmode);\n\n    var polygons = readPaths(d, gd, plotinfo, isActiveShape);\n\n    var newShape = {\n        editable: true,\n\n        xref: xPaper ? 'paper' : xaxis._id,\n        yref: yPaper ? 'paper' : yaxis._id,\n\n        layer: drwStyle.layer,\n        opacity: drwStyle.opacity,\n        line: {\n            color: drwStyle.line.color,\n            width: drwStyle.line.width,\n            dash: drwStyle.line.dash\n        }\n    };\n\n    if(!isOpenMode) {\n        newShape.fillcolor = drwStyle.fillcolor;\n        newShape.fillrule = drwStyle.fillrule;\n    }\n\n    var cell;\n    // line, rect and circle can be in one cell\n    // only define cell if there is single cell\n    if(polygons.length === 1) cell = polygons[0];\n\n    if(\n        cell &&\n        dragmode === 'drawrect'\n    ) {\n        newShape.type = 'rect';\n        newShape.x0 = cell[0][1];\n        newShape.y0 = cell[0][2];\n        newShape.x1 = cell[2][1];\n        newShape.y1 = cell[2][2];\n    } else if(\n        cell &&\n        dragmode === 'drawline'\n    ) {\n        newShape.type = 'line';\n        newShape.x0 = cell[0][1];\n        newShape.y0 = cell[0][2];\n        newShape.x1 = cell[1][1];\n        newShape.y1 = cell[1][2];\n    } else if(\n        cell &&\n        dragmode === 'drawcircle'\n    ) {\n        newShape.type = 'circle'; // an ellipse!\n\n        var xA = cell[i000][1];\n        var xB = cell[i090][1];\n        var xC = cell[i180][1];\n        var xD = cell[i270][1];\n\n        var yA = cell[i000][2];\n        var yB = cell[i090][2];\n        var yC = cell[i180][2];\n        var yD = cell[i270][2];\n\n        var xDateOrLog = plotinfo.xaxis && (\n            plotinfo.xaxis.type === 'date' ||\n            plotinfo.xaxis.type === 'log'\n        );\n\n        var yDateOrLog = plotinfo.yaxis && (\n            plotinfo.yaxis.type === 'date' ||\n            plotinfo.yaxis.type === 'log'\n        );\n\n        if(xDateOrLog) {\n            xA = r2p(plotinfo.xaxis, xA);\n            xB = r2p(plotinfo.xaxis, xB);\n            xC = r2p(plotinfo.xaxis, xC);\n            xD = r2p(plotinfo.xaxis, xD);\n        }\n\n        if(yDateOrLog) {\n            yA = r2p(plotinfo.yaxis, yA);\n            yB = r2p(plotinfo.yaxis, yB);\n            yC = r2p(plotinfo.yaxis, yC);\n            yD = r2p(plotinfo.yaxis, yD);\n        }\n\n        var x0 = (xB + xD) / 2;\n        var y0 = (yA + yC) / 2;\n        var rx = (xD - xB + xC - xA) / 2;\n        var ry = (yD - yB + yC - yA) / 2;\n        var pos = ellipseOver({\n            x0: x0,\n            y0: y0,\n            x1: x0 + rx * cos45,\n            y1: y0 + ry * sin45\n        });\n\n        if(xDateOrLog) {\n            pos.x0 = p2r(plotinfo.xaxis, pos.x0);\n            pos.x1 = p2r(plotinfo.xaxis, pos.x1);\n        }\n\n        if(yDateOrLog) {\n            pos.y0 = p2r(plotinfo.yaxis, pos.y0);\n            pos.y1 = p2r(plotinfo.yaxis, pos.y1);\n        }\n\n        newShape.x0 = pos.x0;\n        newShape.y0 = pos.y0;\n        newShape.x1 = pos.x1;\n        newShape.y1 = pos.y1;\n    } else {\n        newShape.type = 'path';\n        if(xaxis && yaxis) fixDatesForPaths(polygons, xaxis, yaxis);\n        newShape.path = writePaths(polygons);\n        cell = null;\n    }\n\n    clearSelect(gd);\n\n    var editHelpers = dragOptions.editHelpers;\n    var modifyItem = (editHelpers || {}).modifyItem;\n\n    var allShapes = [];\n    for(var q = 0; q < shapes.length; q++) {\n        var beforeEdit = gd._fullLayout.shapes[q];\n        allShapes[q] = beforeEdit._input;\n\n        if(\n            isActiveShape !== undefined &&\n            q === gd._fullLayout._activeShapeIndex\n        ) {\n            var afterEdit = newShape;\n\n            switch(beforeEdit.type) {\n                case 'line':\n                case 'rect':\n                case 'circle':\n                    modifyItem('x0', afterEdit.x0);\n                    modifyItem('x1', afterEdit.x1);\n                    modifyItem('y0', afterEdit.y0);\n                    modifyItem('y1', afterEdit.y1);\n                    break;\n\n                case 'path':\n                    modifyItem('path', afterEdit.path);\n                    break;\n            }\n        }\n    }\n\n    if(isActiveShape === undefined) {\n        allShapes.push(newShape); // add new shape\n        return allShapes;\n    }\n\n    return editHelpers ? editHelpers.getUpdateObj() : {};\n};\n\nfunction fixDatesForPaths(polygons, xaxis, yaxis) {\n    var xIsDate = xaxis.type === 'date';\n    var yIsDate = yaxis.type === 'date';\n    if(!xIsDate && !yIsDate) return polygons;\n\n    for(var i = 0; i < polygons.length; i++) {\n        for(var j = 0; j < polygons[i].length; j++) {\n            for(var k = 0; k + 2 < polygons[i][j].length; k += 2) {\n                if(xIsDate) polygons[i][j][k + 1] = polygons[i][j][k + 1].replace(' ', '_');\n                if(yIsDate) polygons[i][j][k + 2] = polygons[i][j][k + 2].replace(' ', '_');\n            }\n        }\n    }\n\n    return polygons;\n}\n\n},{\"../../../plots/cartesian/handle_outline\":232,\"../../../plots/cartesian/helpers\":233,\"../../dragelement/helpers\":70,\"./constants\":135,\"./helpers\":138}],140:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar constants = _dereq_('./constants');\n\nvar Lib = _dereq_('../../lib');\n\n// special position conversion functions... category axis positions can't be\n// specified by their data values, because they don't make a continuous mapping.\n// so these have to be specified in terms of the category serial numbers,\n// but can take fractional values. Other axis types we specify position based on\n// the actual data values.\n// TODO: in V2.0 (when log axis ranges are in data units) range and shape position\n// will be identical, so rangeToShapePosition and shapePositionToRange can be\n// removed entirely.\n\nexports.rangeToShapePosition = function(ax) {\n    return (ax.type === 'log') ? ax.r2d : function(v) { return v; };\n};\n\nexports.shapePositionToRange = function(ax) {\n    return (ax.type === 'log') ? ax.d2r : function(v) { return v; };\n};\n\nexports.decodeDate = function(convertToPx) {\n    return function(v) {\n        if(v.replace) v = v.replace('_', ' ');\n        return convertToPx(v);\n    };\n};\n\nexports.encodeDate = function(convertToDate) {\n    return function(v) { return convertToDate(v).replace(' ', '_'); };\n};\n\nexports.extractPathCoords = function(path, paramsToUse) {\n    var extractedCoordinates = [];\n\n    var segments = path.match(constants.segmentRE);\n    segments.forEach(function(segment) {\n        var relevantParamIdx = paramsToUse[segment.charAt(0)].drawn;\n        if(relevantParamIdx === undefined) return;\n\n        var params = segment.substr(1).match(constants.paramRE);\n        if(!params || params.length < relevantParamIdx) return;\n\n        extractedCoordinates.push(Lib.cleanNumber(params[relevantParamIdx]));\n    });\n\n    return extractedCoordinates;\n};\n\nexports.getDataToPixel = function(gd, axis, isVertical) {\n    var gs = gd._fullLayout._size;\n    var dataToPixel;\n\n    if(axis) {\n        var d2r = exports.shapePositionToRange(axis);\n\n        dataToPixel = function(v) {\n            return axis._offset + axis.r2p(d2r(v, true));\n        };\n\n        if(axis.type === 'date') dataToPixel = exports.decodeDate(dataToPixel);\n    } else if(isVertical) {\n        dataToPixel = function(v) { return gs.t + gs.h * (1 - v); };\n    } else {\n        dataToPixel = function(v) { return gs.l + gs.w * v; };\n    }\n\n    return dataToPixel;\n};\n\nexports.getPixelToData = function(gd, axis, isVertical) {\n    var gs = gd._fullLayout._size;\n    var pixelToData;\n\n    if(axis) {\n        var r2d = exports.rangeToShapePosition(axis);\n        pixelToData = function(p) { return r2d(axis.p2r(p - axis._offset)); };\n    } else if(isVertical) {\n        pixelToData = function(p) { return 1 - (p - gs.t) / gs.h; };\n    } else {\n        pixelToData = function(p) { return (p - gs.l) / gs.w; };\n    }\n\n    return pixelToData;\n};\n\n/**\n * Based on the given stroke width, rounds the passed\n * position value to represent either a full or half pixel.\n *\n * In case of an odd stroke width (e.g. 1), this measure ensures\n * that a stroke positioned at the returned position isn't rendered\n * blurry due to anti-aliasing.\n *\n * In case of an even stroke width (e.g. 2), this measure ensures\n * that the position value is transformed to a full pixel value\n * so that anti-aliasing doesn't take effect either.\n *\n * @param {number} pos The raw position value to be transformed\n * @param {number} strokeWidth The stroke width\n * @returns {number} either an integer or a .5 decimal number\n */\nexports.roundPositionForSharpStrokeRendering = function(pos, strokeWidth) {\n    var strokeWidthIsOdd = Math.round(strokeWidth % 2) === 1;\n    var posValAsInt = Math.round(pos);\n\n    return strokeWidthIsOdd ? posValAsInt + 0.5 : posValAsInt;\n};\n\nexports.makeOptionsAndPlotinfo = function(gd, index) {\n    var options = gd._fullLayout.shapes[index] || {};\n\n    var plotinfo = gd._fullLayout._plots[options.xref + options.yref];\n    var hasPlotinfo = !!plotinfo;\n    if(hasPlotinfo) {\n        plotinfo._hadPlotinfo = true;\n    } else {\n        plotinfo = {};\n        if(options.xref && options.xref !== 'paper') plotinfo.xaxis = gd._fullLayout[options.xref + 'axis'];\n        if(options.yref && options.yref !== 'paper') plotinfo.yaxis = gd._fullLayout[options.yref + 'axis'];\n    }\n\n    plotinfo.xsizemode = options.xsizemode;\n    plotinfo.ysizemode = options.ysizemode;\n    plotinfo.xanchor = options.xanchor;\n    plotinfo.yanchor = options.yanchor;\n\n    return {\n        options: options,\n        plotinfo: plotinfo\n    };\n};\n\n},{\"../../lib\":178,\"./constants\":131}],141:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar drawModule = _dereq_('./draw');\n\nmodule.exports = {\n    moduleType: 'component',\n    name: 'shapes',\n\n    layoutAttributes: _dereq_('./attributes'),\n    supplyLayoutDefaults: _dereq_('./defaults'),\n    supplyDrawNewShapeDefaults: _dereq_('./draw_newshape/defaults'),\n    includeBasePlot: _dereq_('../../plots/cartesian/include_components')('shapes'),\n\n    calcAutorange: _dereq_('./calc_autorange'),\n    draw: drawModule.draw,\n    drawOne: drawModule.drawOne\n};\n\n},{\"../../plots/cartesian/include_components\":234,\"./attributes\":129,\"./calc_autorange\":130,\"./defaults\":132,\"./draw\":133,\"./draw_newshape/defaults\":136}],142:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar padAttrs = _dereq_('../../plots/pad_attributes');\nvar extendDeepAll = _dereq_('../../lib/extend').extendDeepAll;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar animationAttrs = _dereq_('../../plots/animation_attributes');\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\nvar constants = _dereq_('./constants');\n\nvar stepsAttrs = templatedArray('step', {\n    visible: {\n        valType: 'boolean',\n        \n        dflt: true,\n        \n    },\n    method: {\n        valType: 'enumerated',\n        values: ['restyle', 'relayout', 'animate', 'update', 'skip'],\n        dflt: 'restyle',\n        \n        \n    },\n    args: {\n        valType: 'info_array',\n        \n        freeLength: true,\n        items: [\n            { valType: 'any' },\n            { valType: 'any' },\n            { valType: 'any' }\n        ],\n        \n    },\n    label: {\n        valType: 'string',\n        \n        \n    },\n    value: {\n        valType: 'string',\n        \n        \n    },\n    execute: {\n        valType: 'boolean',\n        \n        dflt: true,\n        \n    }\n});\n\nmodule.exports = overrideAll(templatedArray('slider', {\n    visible: {\n        valType: 'boolean',\n        \n        dflt: true,\n        \n    },\n\n    active: {\n        valType: 'number',\n        \n        min: 0,\n        dflt: 0,\n        \n    },\n\n    steps: stepsAttrs,\n\n    lenmode: {\n        valType: 'enumerated',\n        values: ['fraction', 'pixels'],\n        \n        dflt: 'fraction',\n        \n    },\n    len: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        \n    },\n    x: {\n        valType: 'number',\n        min: -2,\n        max: 3,\n        dflt: 0,\n        \n        \n    },\n    pad: extendDeepAll(padAttrs({editType: 'arraydraw'}), {\n        \n    }, {t: {dflt: 20}}),\n    xanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'left', 'center', 'right'],\n        dflt: 'left',\n        \n        \n    },\n    y: {\n        valType: 'number',\n        min: -2,\n        max: 3,\n        dflt: 0,\n        \n        \n    },\n    yanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'top', 'middle', 'bottom'],\n        dflt: 'top',\n        \n        \n    },\n\n    transition: {\n        duration: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 150,\n            \n        },\n        easing: {\n            valType: 'enumerated',\n            values: animationAttrs.transition.easing.values,\n            \n            dflt: 'cubic-in-out',\n            \n        }\n    },\n\n    currentvalue: {\n        visible: {\n            valType: 'boolean',\n            \n            dflt: true,\n            \n        },\n\n        xanchor: {\n            valType: 'enumerated',\n            values: ['left', 'center', 'right'],\n            dflt: 'left',\n            \n            \n        },\n\n        offset: {\n            valType: 'number',\n            dflt: 10,\n            \n            \n        },\n\n        prefix: {\n            valType: 'string',\n            \n            \n        },\n\n        suffix: {\n            valType: 'string',\n            \n            \n        },\n\n        font: fontAttrs({\n            \n        })\n    },\n\n    font: fontAttrs({\n        \n    }),\n\n    activebgcolor: {\n        valType: 'color',\n        \n        dflt: constants.gripBgActiveColor,\n        \n    },\n    bgcolor: {\n        valType: 'color',\n        \n        dflt: constants.railBgColor,\n        \n    },\n    bordercolor: {\n        valType: 'color',\n        dflt: constants.railBorderColor,\n        \n        \n    },\n    borderwidth: {\n        valType: 'number',\n        min: 0,\n        dflt: constants.railBorderWidth,\n        \n        \n    },\n    ticklen: {\n        valType: 'number',\n        min: 0,\n        dflt: constants.tickLength,\n        \n        \n    },\n    tickcolor: {\n        valType: 'color',\n        dflt: constants.tickColor,\n        \n        \n    },\n    tickwidth: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        \n    },\n    minorticklen: {\n        valType: 'number',\n        min: 0,\n        dflt: constants.minorTickLength,\n        \n        \n    }\n}), 'arraydraw', 'from-root');\n\n},{\"../../lib/extend\":173,\"../../plot_api/edit_types\":205,\"../../plot_api/plot_template\":212,\"../../plots/animation_attributes\":217,\"../../plots/font_attributes\":250,\"../../plots/pad_attributes\":255,\"./constants\":143}],143:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n\n    // layout attribute name\n    name: 'sliders',\n\n    // class names\n    containerClassName: 'slider-container',\n    groupClassName: 'slider-group',\n    inputAreaClass: 'slider-input-area',\n    railRectClass: 'slider-rail-rect',\n    railTouchRectClass: 'slider-rail-touch-rect',\n    gripRectClass: 'slider-grip-rect',\n    tickRectClass: 'slider-tick-rect',\n    inputProxyClass: 'slider-input-proxy',\n    labelsClass: 'slider-labels',\n    labelGroupClass: 'slider-label-group',\n    labelClass: 'slider-label',\n    currentValueClass: 'slider-current-value',\n\n    railHeight: 5,\n\n    // DOM attribute name in button group keeping track\n    // of active update menu\n    menuIndexAttrName: 'slider-active-index',\n\n    // id root pass to Plots.autoMargin\n    autoMarginIdRoot: 'slider-',\n\n    // min item width / height\n    minWidth: 30,\n    minHeight: 30,\n\n    // padding around item text\n    textPadX: 40,\n\n    // arrow offset off right edge\n    arrowOffsetX: 4,\n\n    railRadius: 2,\n    railWidth: 5,\n    railBorder: 4,\n    railBorderWidth: 1,\n    railBorderColor: '#bec8d9',\n    railBgColor: '#f8fafc',\n\n    // The distance of the rail from the edge of the touchable area\n    // Slightly less than the step inset because of the curved edges\n    // of the rail\n    railInset: 8,\n\n    // The distance from the extremal tick marks to the edge of the\n    // touchable area. This is basically the same as the grip radius,\n    // but for other styles it wouldn't really need to be.\n    stepInset: 10,\n\n    gripRadius: 10,\n    gripWidth: 20,\n    gripHeight: 20,\n    gripBorder: 20,\n    gripBorderWidth: 1,\n    gripBorderColor: '#bec8d9',\n    gripBgColor: '#f6f8fa',\n    gripBgActiveColor: '#dbdde0',\n\n    labelPadding: 8,\n    labelOffset: 0,\n\n    tickWidth: 1,\n    tickColor: '#333',\n    tickOffset: 25,\n    tickLength: 7,\n\n    minorTickOffset: 25,\n    minorTickColor: '#333',\n    minorTickLength: 4,\n\n    // Extra space below the current value label:\n    currentValuePadding: 8,\n    currentValueInset: 0,\n};\n\n},{}],144:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\n\nvar attributes = _dereq_('./attributes');\nvar constants = _dereq_('./constants');\n\nvar name = constants.name;\nvar stepAttrs = attributes.steps;\n\n\nmodule.exports = function slidersDefaults(layoutIn, layoutOut) {\n    handleArrayContainerDefaults(layoutIn, layoutOut, {\n        name: name,\n        handleItemDefaults: sliderDefaults\n    });\n};\n\nfunction sliderDefaults(sliderIn, sliderOut, layoutOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(sliderIn, sliderOut, attributes, attr, dflt);\n    }\n\n    var steps = handleArrayContainerDefaults(sliderIn, sliderOut, {\n        name: 'steps',\n        handleItemDefaults: stepDefaults\n    });\n\n    var stepCount = 0;\n    for(var i = 0; i < steps.length; i++) {\n        if(steps[i].visible) stepCount++;\n    }\n\n    var visible;\n    // If it has fewer than two options, it's not really a slider\n    if(stepCount < 2) visible = sliderOut.visible = false;\n    else visible = coerce('visible');\n    if(!visible) return;\n\n    sliderOut._stepCount = stepCount;\n    var visSteps = sliderOut._visibleSteps = Lib.filterVisible(steps);\n\n    var active = coerce('active');\n    if(!(steps[active] || {}).visible) sliderOut.active = visSteps[0]._index;\n\n    coerce('x');\n    coerce('y');\n    Lib.noneOrAll(sliderIn, sliderOut, ['x', 'y']);\n\n    coerce('xanchor');\n    coerce('yanchor');\n\n    coerce('len');\n    coerce('lenmode');\n\n    coerce('pad.t');\n    coerce('pad.r');\n    coerce('pad.b');\n    coerce('pad.l');\n\n    Lib.coerceFont(coerce, 'font', layoutOut.font);\n\n    var currentValueIsVisible = coerce('currentvalue.visible');\n\n    if(currentValueIsVisible) {\n        coerce('currentvalue.xanchor');\n        coerce('currentvalue.prefix');\n        coerce('currentvalue.suffix');\n        coerce('currentvalue.offset');\n\n        Lib.coerceFont(coerce, 'currentvalue.font', sliderOut.font);\n    }\n\n    coerce('transition.duration');\n    coerce('transition.easing');\n\n    coerce('bgcolor');\n    coerce('activebgcolor');\n    coerce('bordercolor');\n    coerce('borderwidth');\n    coerce('ticklen');\n    coerce('tickwidth');\n    coerce('tickcolor');\n    coerce('minorticklen');\n}\n\nfunction stepDefaults(valueIn, valueOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(valueIn, valueOut, stepAttrs, attr, dflt);\n    }\n\n    var visible;\n    if(valueIn.method !== 'skip' && !Array.isArray(valueIn.args)) {\n        visible = valueOut.visible = false;\n    } else visible = coerce('visible');\n\n    if(visible) {\n        coerce('method');\n        coerce('args');\n        var label = coerce('label', 'step-' + valueOut._index);\n        coerce('value', label);\n        coerce('execute');\n    }\n}\n\n},{\"../../lib\":178,\"../../plots/array_container_defaults\":218,\"./attributes\":142,\"./constants\":143}],145:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Plots = _dereq_('../../plots/plots');\nvar Color = _dereq_('../color');\nvar Drawing = _dereq_('../drawing');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar arrayEditor = _dereq_('../../plot_api/plot_template').arrayEditor;\n\nvar constants = _dereq_('./constants');\nvar alignmentConstants = _dereq_('../../constants/alignment');\nvar LINE_SPACING = alignmentConstants.LINE_SPACING;\nvar FROM_TL = alignmentConstants.FROM_TL;\nvar FROM_BR = alignmentConstants.FROM_BR;\n\nmodule.exports = function draw(gd) {\n    var fullLayout = gd._fullLayout;\n    var sliderData = makeSliderData(fullLayout, gd);\n\n    // draw a container for *all* sliders:\n    var sliders = fullLayout._infolayer\n        .selectAll('g.' + constants.containerClassName)\n        .data(sliderData.length > 0 ? [0] : []);\n\n    sliders.enter().append('g')\n        .classed(constants.containerClassName, true)\n        .style('cursor', 'ew-resize');\n\n    function clearSlider(sliderOpts) {\n        if(sliderOpts._commandObserver) {\n            sliderOpts._commandObserver.remove();\n            delete sliderOpts._commandObserver;\n        }\n\n        // Most components don't need to explicitly remove autoMargin, because\n        // marginPushers does this - but slider updates don't go through\n        // a full replot so we need to explicitly remove it.\n        Plots.autoMargin(gd, autoMarginId(sliderOpts));\n    }\n\n    sliders.exit().each(function() {\n        d3.select(this).selectAll('g.' + constants.groupClassName)\n            .each(clearSlider);\n    })\n    .remove();\n\n    // Return early if no menus visible:\n    if(sliderData.length === 0) return;\n\n    var sliderGroups = sliders.selectAll('g.' + constants.groupClassName)\n        .data(sliderData, keyFunction);\n\n    sliderGroups.enter().append('g')\n        .classed(constants.groupClassName, true);\n\n    sliderGroups.exit()\n        .each(clearSlider)\n        .remove();\n\n    // Find the dimensions of the sliders:\n    for(var i = 0; i < sliderData.length; i++) {\n        var sliderOpts = sliderData[i];\n        findDimensions(gd, sliderOpts);\n    }\n\n    sliderGroups.each(function(sliderOpts) {\n        var gSlider = d3.select(this);\n\n        computeLabelSteps(sliderOpts);\n\n        Plots.manageCommandObserver(gd, sliderOpts, sliderOpts._visibleSteps, function(data) {\n            // NB: Same as below. This is *not* always the same as sliderOpts since\n            // if a new set of steps comes in, the reference in this callback would\n            // be invalid. We need to refetch it from the slider group, which is\n            // the join data that creates this slider. So if this slider still exists,\n            // the group should be valid, *to the best of my knowledge.* If not,\n            // we'd have to look it up by d3 data join index/key.\n            var opts = gSlider.data()[0];\n\n            if(opts.active === data.index) return;\n            if(opts._dragging) return;\n\n            setActive(gd, gSlider, opts, data.index, false, true);\n        });\n\n        drawSlider(gd, d3.select(this), sliderOpts);\n    });\n};\n\nfunction autoMarginId(sliderOpts) {\n    return constants.autoMarginIdRoot + sliderOpts._index;\n}\n\n// This really only just filters by visibility:\nfunction makeSliderData(fullLayout, gd) {\n    var contOpts = fullLayout[constants.name];\n    var sliderData = [];\n\n    for(var i = 0; i < contOpts.length; i++) {\n        var item = contOpts[i];\n        if(!item.visible) continue;\n        item._gd = gd;\n        sliderData.push(item);\n    }\n\n    return sliderData;\n}\n\n// This is set in the defaults step:\nfunction keyFunction(opts) {\n    return opts._index;\n}\n\n// Compute the dimensions (mutates sliderOpts):\nfunction findDimensions(gd, sliderOpts) {\n    var sliderLabels = Drawing.tester.selectAll('g.' + constants.labelGroupClass)\n        .data(sliderOpts._visibleSteps);\n\n    sliderLabels.enter().append('g')\n        .classed(constants.labelGroupClass, true);\n\n    // loop over fake buttons to find width / height\n    var maxLabelWidth = 0;\n    var labelHeight = 0;\n    sliderLabels.each(function(stepOpts) {\n        var labelGroup = d3.select(this);\n\n        var text = drawLabel(labelGroup, {step: stepOpts}, sliderOpts);\n\n        var textNode = text.node();\n        if(textNode) {\n            var bBox = Drawing.bBox(textNode);\n            labelHeight = Math.max(labelHeight, bBox.height);\n            maxLabelWidth = Math.max(maxLabelWidth, bBox.width);\n        }\n    });\n\n    sliderLabels.remove();\n\n    var dims = sliderOpts._dims = {};\n\n    dims.inputAreaWidth = Math.max(\n        constants.railWidth,\n        constants.gripHeight\n    );\n\n    // calculate some overall dimensions - some of these are needed for\n    // calculating the currentValue dimensions\n    var graphSize = gd._fullLayout._size;\n    dims.lx = graphSize.l + graphSize.w * sliderOpts.x;\n    dims.ly = graphSize.t + graphSize.h * (1 - sliderOpts.y);\n\n    if(sliderOpts.lenmode === 'fraction') {\n        // fraction:\n        dims.outerLength = Math.round(graphSize.w * sliderOpts.len);\n    } else {\n        // pixels:\n        dims.outerLength = sliderOpts.len;\n    }\n\n    // The length of the rail, *excluding* padding on either end:\n    dims.inputAreaStart = 0;\n    dims.inputAreaLength = Math.round(dims.outerLength - sliderOpts.pad.l - sliderOpts.pad.r);\n\n    var textableInputLength = dims.inputAreaLength - 2 * constants.stepInset;\n    var availableSpacePerLabel = textableInputLength / (sliderOpts._stepCount - 1);\n    var computedSpacePerLabel = maxLabelWidth + constants.labelPadding;\n    dims.labelStride = Math.max(1, Math.ceil(computedSpacePerLabel / availableSpacePerLabel));\n    dims.labelHeight = labelHeight;\n\n    // loop over all possible values for currentValue to find the\n    // area we need for it\n    dims.currentValueMaxWidth = 0;\n    dims.currentValueHeight = 0;\n    dims.currentValueTotalHeight = 0;\n    dims.currentValueMaxLines = 1;\n\n    if(sliderOpts.currentvalue.visible) {\n        // Get the dimensions of the current value label:\n        var dummyGroup = Drawing.tester.append('g');\n\n        sliderLabels.each(function(stepOpts) {\n            var curValPrefix = drawCurrentValue(dummyGroup, sliderOpts, stepOpts.label);\n            var curValSize = (curValPrefix.node() && Drawing.bBox(curValPrefix.node())) || {width: 0, height: 0};\n            var lines = svgTextUtils.lineCount(curValPrefix);\n            dims.currentValueMaxWidth = Math.max(dims.currentValueMaxWidth, Math.ceil(curValSize.width));\n            dims.currentValueHeight = Math.max(dims.currentValueHeight, Math.ceil(curValSize.height));\n            dims.currentValueMaxLines = Math.max(dims.currentValueMaxLines, lines);\n        });\n\n        dims.currentValueTotalHeight = dims.currentValueHeight + sliderOpts.currentvalue.offset;\n\n        dummyGroup.remove();\n    }\n\n    dims.height = dims.currentValueTotalHeight + constants.tickOffset + sliderOpts.ticklen + constants.labelOffset + dims.labelHeight + sliderOpts.pad.t + sliderOpts.pad.b;\n\n    var xanchor = 'left';\n    if(Lib.isRightAnchor(sliderOpts)) {\n        dims.lx -= dims.outerLength;\n        xanchor = 'right';\n    }\n    if(Lib.isCenterAnchor(sliderOpts)) {\n        dims.lx -= dims.outerLength / 2;\n        xanchor = 'center';\n    }\n\n    var yanchor = 'top';\n    if(Lib.isBottomAnchor(sliderOpts)) {\n        dims.ly -= dims.height;\n        yanchor = 'bottom';\n    }\n    if(Lib.isMiddleAnchor(sliderOpts)) {\n        dims.ly -= dims.height / 2;\n        yanchor = 'middle';\n    }\n\n    dims.outerLength = Math.ceil(dims.outerLength);\n    dims.height = Math.ceil(dims.height);\n    dims.lx = Math.round(dims.lx);\n    dims.ly = Math.round(dims.ly);\n\n    var marginOpts = {\n        y: sliderOpts.y,\n        b: dims.height * FROM_BR[yanchor],\n        t: dims.height * FROM_TL[yanchor]\n    };\n\n    if(sliderOpts.lenmode === 'fraction') {\n        marginOpts.l = 0;\n        marginOpts.xl = sliderOpts.x - sliderOpts.len * FROM_TL[xanchor];\n        marginOpts.r = 0;\n        marginOpts.xr = sliderOpts.x + sliderOpts.len * FROM_BR[xanchor];\n    } else {\n        marginOpts.x = sliderOpts.x;\n        marginOpts.l = dims.outerLength * FROM_TL[xanchor];\n        marginOpts.r = dims.outerLength * FROM_BR[xanchor];\n    }\n\n    Plots.autoMargin(gd, autoMarginId(sliderOpts), marginOpts);\n}\n\nfunction drawSlider(gd, sliderGroup, sliderOpts) {\n    // This is related to the other long notes in this file regarding what happens\n    // when slider steps disappear. This particular fix handles what happens when\n    // the *current* slider step is removed. The drawing functions will error out\n    // when they fail to find it, so the fix for now is that it will just draw the\n    // slider in the first position but will not execute the command.\n    if(!((sliderOpts.steps[sliderOpts.active] || {}).visible)) {\n        sliderOpts.active = sliderOpts._visibleSteps[0]._index;\n    }\n\n    // These are carefully ordered for proper z-ordering:\n    sliderGroup\n        .call(drawCurrentValue, sliderOpts)\n        .call(drawRail, sliderOpts)\n        .call(drawLabelGroup, sliderOpts)\n        .call(drawTicks, sliderOpts)\n        .call(drawTouchRect, gd, sliderOpts)\n        .call(drawGrip, gd, sliderOpts);\n\n    var dims = sliderOpts._dims;\n\n    // Position the rectangle:\n    Drawing.setTranslate(sliderGroup, dims.lx + sliderOpts.pad.l, dims.ly + sliderOpts.pad.t);\n\n    sliderGroup.call(setGripPosition, sliderOpts, false);\n    sliderGroup.call(drawCurrentValue, sliderOpts);\n}\n\nfunction drawCurrentValue(sliderGroup, sliderOpts, valueOverride) {\n    if(!sliderOpts.currentvalue.visible) return;\n\n    var dims = sliderOpts._dims;\n    var x0, textAnchor;\n\n    switch(sliderOpts.currentvalue.xanchor) {\n        case 'right':\n            // This is anchored left and adjusted by the width of the longest label\n            // so that the prefix doesn't move. The goal of this is to emphasize\n            // what's actually changing and make the update less distracting.\n            x0 = dims.inputAreaLength - constants.currentValueInset - dims.currentValueMaxWidth;\n            textAnchor = 'left';\n            break;\n        case 'center':\n            x0 = dims.inputAreaLength * 0.5;\n            textAnchor = 'middle';\n            break;\n        default:\n            x0 = constants.currentValueInset;\n            textAnchor = 'left';\n    }\n\n    var text = Lib.ensureSingle(sliderGroup, 'text', constants.labelClass, function(s) {\n        s.classed('user-select-none', true)\n            .attr({\n                'text-anchor': textAnchor,\n                'data-notex': 1\n            });\n    });\n\n    var str = sliderOpts.currentvalue.prefix ? sliderOpts.currentvalue.prefix : '';\n\n    if(typeof valueOverride === 'string') {\n        str += valueOverride;\n    } else {\n        var curVal = sliderOpts.steps[sliderOpts.active].label;\n        var _meta = sliderOpts._gd._fullLayout._meta;\n        if(_meta) curVal = Lib.templateString(curVal, _meta);\n        str += curVal;\n    }\n\n    if(sliderOpts.currentvalue.suffix) {\n        str += sliderOpts.currentvalue.suffix;\n    }\n\n    text.call(Drawing.font, sliderOpts.currentvalue.font)\n        .text(str)\n        .call(svgTextUtils.convertToTspans, sliderOpts._gd);\n\n    var lines = svgTextUtils.lineCount(text);\n\n    var y0 = (dims.currentValueMaxLines + 1 - lines) *\n        sliderOpts.currentvalue.font.size * LINE_SPACING;\n\n    svgTextUtils.positionText(text, x0, y0);\n\n    return text;\n}\n\nfunction drawGrip(sliderGroup, gd, sliderOpts) {\n    var grip = Lib.ensureSingle(sliderGroup, 'rect', constants.gripRectClass, function(s) {\n        s.call(attachGripEvents, gd, sliderGroup, sliderOpts)\n            .style('pointer-events', 'all');\n    });\n\n    grip.attr({\n        width: constants.gripWidth,\n        height: constants.gripHeight,\n        rx: constants.gripRadius,\n        ry: constants.gripRadius,\n    })\n    .call(Color.stroke, sliderOpts.bordercolor)\n    .call(Color.fill, sliderOpts.bgcolor)\n    .style('stroke-width', sliderOpts.borderwidth + 'px');\n}\n\nfunction drawLabel(item, data, sliderOpts) {\n    var text = Lib.ensureSingle(item, 'text', constants.labelClass, function(s) {\n        s.classed('user-select-none', true)\n            .attr({\n                'text-anchor': 'middle',\n                'data-notex': 1\n            });\n    });\n\n    var tx = data.step.label;\n    var _meta = sliderOpts._gd._fullLayout._meta;\n    if(_meta) tx = Lib.templateString(tx, _meta);\n\n    text.call(Drawing.font, sliderOpts.font)\n        .text(tx)\n        .call(svgTextUtils.convertToTspans, sliderOpts._gd);\n\n    return text;\n}\n\nfunction drawLabelGroup(sliderGroup, sliderOpts) {\n    var labels = Lib.ensureSingle(sliderGroup, 'g', constants.labelsClass);\n    var dims = sliderOpts._dims;\n\n    var labelItems = labels.selectAll('g.' + constants.labelGroupClass)\n        .data(dims.labelSteps);\n\n    labelItems.enter().append('g')\n        .classed(constants.labelGroupClass, true);\n\n    labelItems.exit().remove();\n\n    labelItems.each(function(d) {\n        var item = d3.select(this);\n\n        item.call(drawLabel, d, sliderOpts);\n\n        Drawing.setTranslate(item,\n            normalizedValueToPosition(sliderOpts, d.fraction),\n            constants.tickOffset +\n                sliderOpts.ticklen +\n                // position is the baseline of the top line of text only, even\n                // if the label spans multiple lines\n                sliderOpts.font.size * LINE_SPACING +\n                constants.labelOffset +\n                dims.currentValueTotalHeight\n        );\n    });\n}\n\nfunction handleInput(gd, sliderGroup, sliderOpts, normalizedPosition, doTransition) {\n    var quantizedPosition = Math.round(normalizedPosition * (sliderOpts._stepCount - 1));\n    var quantizedIndex = sliderOpts._visibleSteps[quantizedPosition]._index;\n\n    if(quantizedIndex !== sliderOpts.active) {\n        setActive(gd, sliderGroup, sliderOpts, quantizedIndex, true, doTransition);\n    }\n}\n\nfunction setActive(gd, sliderGroup, sliderOpts, index, doCallback, doTransition) {\n    var previousActive = sliderOpts.active;\n    sliderOpts.active = index;\n\n    // due to templating, it's possible this slider doesn't even exist yet\n    arrayEditor(gd.layout, constants.name, sliderOpts)\n        .applyUpdate('active', index);\n\n    var step = sliderOpts.steps[sliderOpts.active];\n\n    sliderGroup.call(setGripPosition, sliderOpts, doTransition);\n    sliderGroup.call(drawCurrentValue, sliderOpts);\n\n    gd.emit('plotly_sliderchange', {\n        slider: sliderOpts,\n        step: sliderOpts.steps[sliderOpts.active],\n        interaction: doCallback,\n        previousActive: previousActive\n    });\n\n    if(step && step.method && doCallback) {\n        if(sliderGroup._nextMethod) {\n            // If we've already queued up an update, just overwrite it with the most recent:\n            sliderGroup._nextMethod.step = step;\n            sliderGroup._nextMethod.doCallback = doCallback;\n            sliderGroup._nextMethod.doTransition = doTransition;\n        } else {\n            sliderGroup._nextMethod = {step: step, doCallback: doCallback, doTransition: doTransition};\n            sliderGroup._nextMethodRaf = window.requestAnimationFrame(function() {\n                var _step = sliderGroup._nextMethod.step;\n                if(!_step.method) return;\n\n                if(_step.execute) {\n                    Plots.executeAPICommand(gd, _step.method, _step.args);\n                }\n\n                sliderGroup._nextMethod = null;\n                sliderGroup._nextMethodRaf = null;\n            });\n        }\n    }\n}\n\nfunction attachGripEvents(item, gd, sliderGroup) {\n    var node = sliderGroup.node();\n    var $gd = d3.select(gd);\n\n    // NB: This is *not* the same as sliderOpts itself! These callbacks\n    // are in a closure so this array won't actually be correct if the\n    // steps have changed since this was initialized. The sliderGroup,\n    // however, has not changed since that *is* the slider, so it must\n    // be present to receive mouse events.\n    function getSliderOpts() {\n        return sliderGroup.data()[0];\n    }\n\n    item.on('mousedown', function() {\n        var sliderOpts = getSliderOpts();\n        gd.emit('plotly_sliderstart', {slider: sliderOpts});\n\n        var grip = sliderGroup.select('.' + constants.gripRectClass);\n\n        d3.event.stopPropagation();\n        d3.event.preventDefault();\n        grip.call(Color.fill, sliderOpts.activebgcolor);\n\n        var normalizedPosition = positionToNormalizedValue(sliderOpts, d3.mouse(node)[0]);\n        handleInput(gd, sliderGroup, sliderOpts, normalizedPosition, true);\n        sliderOpts._dragging = true;\n\n        $gd.on('mousemove', function() {\n            var sliderOpts = getSliderOpts();\n            var normalizedPosition = positionToNormalizedValue(sliderOpts, d3.mouse(node)[0]);\n            handleInput(gd, sliderGroup, sliderOpts, normalizedPosition, false);\n        });\n\n        $gd.on('mouseup', function() {\n            var sliderOpts = getSliderOpts();\n            sliderOpts._dragging = false;\n            grip.call(Color.fill, sliderOpts.bgcolor);\n            $gd.on('mouseup', null);\n            $gd.on('mousemove', null);\n\n            gd.emit('plotly_sliderend', {\n                slider: sliderOpts,\n                step: sliderOpts.steps[sliderOpts.active]\n            });\n        });\n    });\n}\n\nfunction drawTicks(sliderGroup, sliderOpts) {\n    var tick = sliderGroup.selectAll('rect.' + constants.tickRectClass)\n        .data(sliderOpts._visibleSteps);\n    var dims = sliderOpts._dims;\n\n    tick.enter().append('rect')\n        .classed(constants.tickRectClass, true);\n\n    tick.exit().remove();\n\n    tick.attr({\n        width: sliderOpts.tickwidth + 'px',\n        'shape-rendering': 'crispEdges'\n    });\n\n    tick.each(function(d, i) {\n        var isMajor = i % dims.labelStride === 0;\n        var item = d3.select(this);\n\n        item\n            .attr({height: isMajor ? sliderOpts.ticklen : sliderOpts.minorticklen})\n            .call(Color.fill, isMajor ? sliderOpts.tickcolor : sliderOpts.tickcolor);\n\n        Drawing.setTranslate(item,\n            normalizedValueToPosition(sliderOpts, i / (sliderOpts._stepCount - 1)) - 0.5 * sliderOpts.tickwidth,\n            (isMajor ? constants.tickOffset : constants.minorTickOffset) + dims.currentValueTotalHeight\n        );\n    });\n}\n\nfunction computeLabelSteps(sliderOpts) {\n    var dims = sliderOpts._dims;\n    dims.labelSteps = [];\n    var nsteps = sliderOpts._stepCount;\n\n    for(var i = 0; i < nsteps; i += dims.labelStride) {\n        dims.labelSteps.push({\n            fraction: i / (nsteps - 1),\n            step: sliderOpts._visibleSteps[i]\n        });\n    }\n}\n\nfunction setGripPosition(sliderGroup, sliderOpts, doTransition) {\n    var grip = sliderGroup.select('rect.' + constants.gripRectClass);\n\n    var quantizedIndex = 0;\n    for(var i = 0; i < sliderOpts._stepCount; i++) {\n        if(sliderOpts._visibleSteps[i]._index === sliderOpts.active) {\n            quantizedIndex = i;\n            break;\n        }\n    }\n\n    var x = normalizedValueToPosition(sliderOpts, quantizedIndex / (sliderOpts._stepCount - 1));\n\n    // If this is true, then *this component* is already invoking its own command\n    // and has triggered its own animation.\n    if(sliderOpts._invokingCommand) return;\n\n    var el = grip;\n    if(doTransition && sliderOpts.transition.duration > 0) {\n        el = el.transition()\n            .duration(sliderOpts.transition.duration)\n            .ease(sliderOpts.transition.easing);\n    }\n\n    // Drawing.setTranslate doesn't work here becasue of the transition duck-typing.\n    // It's also not necessary because there are no other transitions to preserve.\n    el.attr('transform', 'translate(' + (x - constants.gripWidth * 0.5) + ',' + (sliderOpts._dims.currentValueTotalHeight) + ')');\n}\n\n// Convert a number from [0-1] to a pixel position relative to the slider group container:\nfunction normalizedValueToPosition(sliderOpts, normalizedPosition) {\n    var dims = sliderOpts._dims;\n    return dims.inputAreaStart + constants.stepInset +\n        (dims.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n}\n\n// Convert a position relative to the slider group to a nubmer in [0, 1]\nfunction positionToNormalizedValue(sliderOpts, position) {\n    var dims = sliderOpts._dims;\n    return Math.min(1, Math.max(0, (position - constants.stepInset - dims.inputAreaStart) / (dims.inputAreaLength - 2 * constants.stepInset - 2 * dims.inputAreaStart)));\n}\n\nfunction drawTouchRect(sliderGroup, gd, sliderOpts) {\n    var dims = sliderOpts._dims;\n    var rect = Lib.ensureSingle(sliderGroup, 'rect', constants.railTouchRectClass, function(s) {\n        s.call(attachGripEvents, gd, sliderGroup, sliderOpts)\n            .style('pointer-events', 'all');\n    });\n\n    rect.attr({\n        width: dims.inputAreaLength,\n        height: Math.max(dims.inputAreaWidth, constants.tickOffset + sliderOpts.ticklen + dims.labelHeight)\n    })\n        .call(Color.fill, sliderOpts.bgcolor)\n        .attr('opacity', 0);\n\n    Drawing.setTranslate(rect, 0, dims.currentValueTotalHeight);\n}\n\nfunction drawRail(sliderGroup, sliderOpts) {\n    var dims = sliderOpts._dims;\n    var computedLength = dims.inputAreaLength - constants.railInset * 2;\n    var rect = Lib.ensureSingle(sliderGroup, 'rect', constants.railRectClass);\n\n    rect.attr({\n        width: computedLength,\n        height: constants.railWidth,\n        rx: constants.railRadius,\n        ry: constants.railRadius,\n        'shape-rendering': 'crispEdges'\n    })\n    .call(Color.stroke, sliderOpts.bordercolor)\n    .call(Color.fill, sliderOpts.bgcolor)\n    .style('stroke-width', sliderOpts.borderwidth + 'px');\n\n    Drawing.setTranslate(rect,\n        constants.railInset,\n        (dims.inputAreaWidth - constants.railWidth) * 0.5 + dims.currentValueTotalHeight\n    );\n}\n\n},{\"../../constants/alignment\":154,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../plot_api/plot_template\":212,\"../../plots/plots\":256,\"../color\":52,\"../drawing\":74,\"./constants\":143,\"d3\":16}],146:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = _dereq_('./constants');\n\nmodule.exports = {\n    moduleType: 'component',\n    name: constants.name,\n\n    layoutAttributes: _dereq_('./attributes'),\n    supplyLayoutDefaults: _dereq_('./defaults'),\n\n    draw: _dereq_('./draw')\n};\n\n},{\"./attributes\":142,\"./constants\":143,\"./defaults\":144,\"./draw\":145}],147:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Plots = _dereq_('../../plots/plots');\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../drawing');\nvar Color = _dereq_('../color');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar interactConstants = _dereq_('../../constants/interactions');\n\nvar OPPOSITE_SIDE = _dereq_('../../constants/alignment').OPPOSITE_SIDE;\nvar numStripRE = / [XY][0-9]* /;\n\n/**\n * Titles - (re)draw titles on the axes and plot:\n * @param {DOM element} gd - the graphDiv\n * @param {string} titleClass - the css class of this title\n * @param {object} options - how and what to draw\n *      propContainer - the layout object containing `title` and `titlefont`\n *          attributes that apply to this title\n *      propName - the full name of the title property (for Plotly.relayout)\n *      [traceIndex] - include only if this property applies to one trace\n *          (such as a colorbar title) - then editing pipes to Plotly.restyle\n *          instead of Plotly.relayout\n *      placeholder - placeholder text for an empty editable title\n *      [avoid] {object} - include if this title should move to avoid other elements\n *          selection - d3 selection of elements to avoid\n *          side - which direction to move if there is a conflict\n *          [offsetLeft] - if these elements are subject to a translation\n *              wrt the title element\n *          [offsetTop]\n *      attributes {object} - position and alignment attributes\n *          x - pixels\n *          y - pixels\n *          text-anchor - start|middle|end\n *      transform {object} - how to transform the title after positioning\n *          rotate - degrees\n *          offset - shift up/down in the rotated frame (unused?)\n *      containerGroup - if an svg <g> element already exists to hold this\n *          title, include here. Otherwise it will go in fullLayout._infolayer\n *      _meta {object (optional} - meta key-value to for title with\n *          Lib.templateString, default to fullLayout._meta, if not provided\n *\n *  @return {selection} d3 selection of title container group\n */\nfunction draw(gd, titleClass, options) {\n    var cont = options.propContainer;\n    var prop = options.propName;\n    var placeholder = options.placeholder;\n    var traceIndex = options.traceIndex;\n    var avoid = options.avoid || {};\n    var attributes = options.attributes;\n    var transform = options.transform;\n    var group = options.containerGroup;\n\n    var fullLayout = gd._fullLayout;\n\n    var opacity = 1;\n    var isplaceholder = false;\n    var title = cont.title;\n    var txt = (title && title.text ? title.text : '').trim();\n\n    var font = title && title.font ? title.font : {};\n    var fontFamily = font.family;\n    var fontSize = font.size;\n    var fontColor = font.color;\n\n    // only make this title editable if we positively identify its property\n    // as one that has editing enabled.\n    var editAttr;\n    if(prop === 'title.text') editAttr = 'titleText';\n    else if(prop.indexOf('axis') !== -1) editAttr = 'axisTitleText';\n    else if(prop.indexOf('colorbar' !== -1)) editAttr = 'colorbarTitleText';\n    var editable = gd._context.edits[editAttr];\n\n    if(txt === '') opacity = 0;\n    // look for placeholder text while stripping out numbers from eg X2, Y3\n    // this is just for backward compatibility with the old version that had\n    // \"Click to enter X2 title\" and may have gotten saved in some old plots,\n    // we don't want this to show up when these are displayed.\n    else if(txt.replace(numStripRE, ' % ') === placeholder.replace(numStripRE, ' % ')) {\n        opacity = 0.2;\n        isplaceholder = true;\n        if(!editable) txt = '';\n    }\n\n    if(options._meta) {\n        txt = Lib.templateString(txt, options._meta);\n    } else if(fullLayout._meta) {\n        txt = Lib.templateString(txt, fullLayout._meta);\n    }\n\n    var elShouldExist = txt || editable;\n\n    if(!group) {\n        group = Lib.ensureSingle(fullLayout._infolayer, 'g', 'g-' + titleClass);\n    }\n\n    var el = group.selectAll('text')\n        .data(elShouldExist ? [0] : []);\n    el.enter().append('text');\n    el.text(txt)\n        // this is hacky, but convertToTspans uses the class\n        // to determine whether to rotate mathJax...\n        // so we need to clear out any old class and put the\n        // correct one (only relevant for colorbars, at least\n        // for now) - ie don't use .classed\n        .attr('class', titleClass);\n    el.exit().remove();\n\n    if(!elShouldExist) return group;\n\n    function titleLayout(titleEl) {\n        Lib.syncOrAsync([drawTitle, scootTitle], titleEl);\n    }\n\n    function drawTitle(titleEl) {\n        var transformVal;\n\n        if(transform) {\n            transformVal = '';\n            if(transform.rotate) {\n                transformVal += 'rotate(' + [transform.rotate, attributes.x, attributes.y] + ')';\n            }\n            if(transform.offset) {\n                transformVal += 'translate(0, ' + transform.offset + ')';\n            }\n        } else {\n            transformVal = null;\n        }\n\n        titleEl.attr('transform', transformVal);\n\n        titleEl.style({\n            'font-family': fontFamily,\n            'font-size': d3.round(fontSize, 2) + 'px',\n            fill: Color.rgb(fontColor),\n            opacity: opacity * Color.opacity(fontColor),\n            'font-weight': Plots.fontWeight\n        })\n        .attr(attributes)\n        .call(svgTextUtils.convertToTspans, gd);\n\n        return Plots.previousPromises(gd);\n    }\n\n    function scootTitle(titleElIn) {\n        var titleGroup = d3.select(titleElIn.node().parentNode);\n\n        if(avoid && avoid.selection && avoid.side && txt) {\n            titleGroup.attr('transform', null);\n\n            // move toward avoid.side (= left, right, top, bottom) if needed\n            // can include pad (pixels, default 2)\n            var backside = OPPOSITE_SIDE[avoid.side];\n            var shiftSign = (avoid.side === 'left' || avoid.side === 'top') ? -1 : 1;\n            var pad = isNumeric(avoid.pad) ? avoid.pad : 2;\n\n            var titlebb = Drawing.bBox(titleGroup.node());\n            var paperbb = {\n                left: 0,\n                top: 0,\n                right: fullLayout.width,\n                bottom: fullLayout.height\n            };\n\n            var maxshift = avoid.maxShift ||\n                shiftSign * (paperbb[avoid.side] - titlebb[avoid.side]);\n            var shift = 0;\n\n            // Prevent the title going off the paper\n            if(maxshift < 0) {\n                shift = maxshift;\n            } else {\n                // so we don't have to offset each avoided element,\n                // give the title the opposite offset\n                var offsetLeft = avoid.offsetLeft || 0;\n                var offsetTop = avoid.offsetTop || 0;\n                titlebb.left -= offsetLeft;\n                titlebb.right -= offsetLeft;\n                titlebb.top -= offsetTop;\n                titlebb.bottom -= offsetTop;\n\n                // iterate over a set of elements (avoid.selection)\n                // to avoid collisions with\n                avoid.selection.each(function() {\n                    var avoidbb = Drawing.bBox(this);\n\n                    if(Lib.bBoxIntersect(titlebb, avoidbb, pad)) {\n                        shift = Math.max(shift, shiftSign * (\n                            avoidbb[avoid.side] - titlebb[backside]) + pad);\n                    }\n                });\n                shift = Math.min(maxshift, shift);\n            }\n\n            if(shift > 0 || maxshift < 0) {\n                var shiftTemplate = {\n                    left: [-shift, 0],\n                    right: [shift, 0],\n                    top: [0, -shift],\n                    bottom: [0, shift]\n                }[avoid.side];\n                titleGroup.attr('transform', 'translate(' + shiftTemplate + ')');\n            }\n        }\n    }\n\n    el.call(titleLayout);\n\n    function setPlaceholder() {\n        opacity = 0;\n        isplaceholder = true;\n        el.text(placeholder)\n            .on('mouseover.opacity', function() {\n                d3.select(this).transition()\n                    .duration(interactConstants.SHOW_PLACEHOLDER).style('opacity', 1);\n            })\n            .on('mouseout.opacity', function() {\n                d3.select(this).transition()\n                    .duration(interactConstants.HIDE_PLACEHOLDER).style('opacity', 0);\n            });\n    }\n\n    if(editable) {\n        if(!txt) setPlaceholder();\n        else el.on('.opacity', null);\n\n        el.call(svgTextUtils.makeEditable, {gd: gd})\n            .on('edit', function(text) {\n                if(traceIndex !== undefined) {\n                    Registry.call('_guiRestyle', gd, prop, text, traceIndex);\n                } else {\n                    Registry.call('_guiRelayout', gd, prop, text);\n                }\n            })\n            .on('cancel', function() {\n                this.text(this.attr('data-unformatted'))\n                    .call(titleLayout);\n            })\n            .on('input', function(d) {\n                this.text(d || ' ')\n                    .call(svgTextUtils.positionText, attributes.x, attributes.y);\n            });\n    }\n    el.classed('js-placeholder', isplaceholder);\n\n    return group;\n}\n\nmodule.exports = {\n    draw: draw\n};\n\n},{\"../../constants/alignment\":154,\"../../constants/interactions\":157,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../plots/plots\":256,\"../../registry\":269,\"../color\":52,\"../drawing\":74,\"d3\":16,\"fast-isnumeric\":18}],148:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar colorAttrs = _dereq_('../color/attributes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar padAttrs = _dereq_('../../plots/pad_attributes');\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nvar buttonsAttrs = templatedArray('button', {\n    visible: {\n        valType: 'boolean',\n        \n        \n    },\n    method: {\n        valType: 'enumerated',\n        values: ['restyle', 'relayout', 'animate', 'update', 'skip'],\n        dflt: 'restyle',\n        \n        \n    },\n    args: {\n        valType: 'info_array',\n        \n        freeLength: true,\n        items: [\n            {valType: 'any'},\n            {valType: 'any'},\n            {valType: 'any'}\n        ],\n        \n    },\n    args2: {\n        valType: 'info_array',\n        \n        freeLength: true,\n        items: [\n            {valType: 'any'},\n            {valType: 'any'},\n            {valType: 'any'}\n        ],\n        \n    },\n    label: {\n        valType: 'string',\n        \n        dflt: '',\n        \n    },\n    execute: {\n        valType: 'boolean',\n        \n        dflt: true,\n        \n    }\n});\n\nmodule.exports = overrideAll(templatedArray('updatemenu', {\n    _arrayAttrRegexps: [/^updatemenus\\[(0|[1-9][0-9]+)\\]\\.buttons/],\n\n    visible: {\n        valType: 'boolean',\n        \n        \n    },\n\n    type: {\n        valType: 'enumerated',\n        values: ['dropdown', 'buttons'],\n        dflt: 'dropdown',\n        \n        \n    },\n\n    direction: {\n        valType: 'enumerated',\n        values: ['left', 'right', 'up', 'down'],\n        dflt: 'down',\n        \n        \n    },\n\n    active: {\n        valType: 'integer',\n        \n        min: -1,\n        dflt: 0,\n        \n    },\n\n    showactive: {\n        valType: 'boolean',\n        \n        dflt: true,\n        \n    },\n\n    buttons: buttonsAttrs,\n\n    x: {\n        valType: 'number',\n        min: -2,\n        max: 3,\n        dflt: -0.05,\n        \n        \n    },\n    xanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'left', 'center', 'right'],\n        dflt: 'right',\n        \n        \n    },\n    y: {\n        valType: 'number',\n        min: -2,\n        max: 3,\n        dflt: 1,\n        \n        \n    },\n    yanchor: {\n        valType: 'enumerated',\n        values: ['auto', 'top', 'middle', 'bottom'],\n        dflt: 'top',\n        \n        \n    },\n\n    pad: extendFlat(padAttrs({editType: 'arraydraw'}), {\n        \n    }),\n\n    font: fontAttrs({\n        \n    }),\n\n    bgcolor: {\n        valType: 'color',\n        \n        \n    },\n    bordercolor: {\n        valType: 'color',\n        dflt: colorAttrs.borderLine,\n        \n        \n    },\n    borderwidth: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        editType: 'arraydraw',\n        \n    }\n}), 'arraydraw', 'from-root');\n\n},{\"../../lib/extend\":173,\"../../plot_api/edit_types\":205,\"../../plot_api/plot_template\":212,\"../../plots/font_attributes\":250,\"../../plots/pad_attributes\":255,\"../color/attributes\":51}],149:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n\n    // layout attribute name\n    name: 'updatemenus',\n\n    // class names\n    containerClassName: 'updatemenu-container',\n    headerGroupClassName: 'updatemenu-header-group',\n    headerClassName: 'updatemenu-header',\n    headerArrowClassName: 'updatemenu-header-arrow',\n    dropdownButtonGroupClassName: 'updatemenu-dropdown-button-group',\n    dropdownButtonClassName: 'updatemenu-dropdown-button',\n    buttonClassName: 'updatemenu-button',\n    itemRectClassName: 'updatemenu-item-rect',\n    itemTextClassName: 'updatemenu-item-text',\n\n    // DOM attribute name in button group keeping track\n    // of active update menu\n    menuIndexAttrName: 'updatemenu-active-index',\n\n    // id root pass to Plots.autoMargin\n    autoMarginIdRoot: 'updatemenu-',\n\n    // options when 'active: -1'\n    blankHeaderOpts: { label: '  ' },\n\n    // min item width / height\n    minWidth: 30,\n    minHeight: 30,\n\n    // padding around item text\n    textPadX: 24,\n    arrowPadX: 16,\n\n    // item rect radii\n    rx: 2,\n    ry: 2,\n\n    // item  text x offset off left edge\n    textOffsetX: 12,\n\n    // item  text y offset (w.r.t. middle)\n    textOffsetY: 3,\n\n    // arrow offset off right edge\n    arrowOffsetX: 4,\n\n    // gap between header and buttons\n    gapButtonHeader: 5,\n\n    // gap between between buttons\n    gapButton: 2,\n\n    // color given to active buttons\n    activeColor: '#F4FAFF',\n\n    // color given to hovered buttons\n    hoverColor: '#F4FAFF',\n\n    // symbol for menu open arrow\n    arrowSymbol: {\n        left: '◄',\n        right: '►',\n        up: '▲',\n        down: '▼'\n    }\n};\n\n},{}],150:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\n\nvar attributes = _dereq_('./attributes');\nvar constants = _dereq_('./constants');\n\nvar name = constants.name;\nvar buttonAttrs = attributes.buttons;\n\n\nmodule.exports = function updateMenusDefaults(layoutIn, layoutOut) {\n    var opts = {\n        name: name,\n        handleItemDefaults: menuDefaults\n    };\n\n    handleArrayContainerDefaults(layoutIn, layoutOut, opts);\n};\n\nfunction menuDefaults(menuIn, menuOut, layoutOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(menuIn, menuOut, attributes, attr, dflt);\n    }\n\n    var buttons = handleArrayContainerDefaults(menuIn, menuOut, {\n        name: 'buttons',\n        handleItemDefaults: buttonDefaults\n    });\n\n    var visible = coerce('visible', buttons.length > 0);\n    if(!visible) return;\n\n    coerce('active');\n    coerce('direction');\n    coerce('type');\n    coerce('showactive');\n\n    coerce('x');\n    coerce('y');\n    Lib.noneOrAll(menuIn, menuOut, ['x', 'y']);\n\n    coerce('xanchor');\n    coerce('yanchor');\n\n    coerce('pad.t');\n    coerce('pad.r');\n    coerce('pad.b');\n    coerce('pad.l');\n\n    Lib.coerceFont(coerce, 'font', layoutOut.font);\n\n    coerce('bgcolor', layoutOut.paper_bgcolor);\n    coerce('bordercolor');\n    coerce('borderwidth');\n}\n\nfunction buttonDefaults(buttonIn, buttonOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(buttonIn, buttonOut, buttonAttrs, attr, dflt);\n    }\n\n    var visible = coerce('visible',\n        (buttonIn.method === 'skip' || Array.isArray(buttonIn.args)));\n    if(visible) {\n        coerce('method');\n        coerce('args');\n        coerce('args2');\n        coerce('label');\n        coerce('execute');\n    }\n}\n\n},{\"../../lib\":178,\"../../plots/array_container_defaults\":218,\"./attributes\":148,\"./constants\":149}],151:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Plots = _dereq_('../../plots/plots');\nvar Color = _dereq_('../color');\nvar Drawing = _dereq_('../drawing');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar arrayEditor = _dereq_('../../plot_api/plot_template').arrayEditor;\n\nvar LINE_SPACING = _dereq_('../../constants/alignment').LINE_SPACING;\n\nvar constants = _dereq_('./constants');\nvar ScrollBox = _dereq_('./scrollbox');\n\nmodule.exports = function draw(gd) {\n    var fullLayout = gd._fullLayout;\n    var menuData = Lib.filterVisible(fullLayout[constants.name]);\n\n    /* Update menu data is bound to the header-group.\n     * The items in the header group are always present.\n     *\n     * Upon clicking on a header its corresponding button\n     * data is bound to the button-group.\n     *\n     * We draw all headers in one group before all buttons\n     * so that the buttons *always* appear above the headers.\n     *\n     * Note that only one set of buttons are visible at once.\n     *\n     * <g container />\n     *\n     *     <g header-group />\n     *         <g item header />\n     *         <text item header-arrow />\n     *     <g header-group />\n     *         <g item header />\n     *         <text item header-arrow />\n     *     ...\n     *\n     *     <g button-group />\n     *         <g item button />\n     *         <g item button />\n     *         ...\n     */\n\n    function clearAutoMargin(menuOpts) {\n        Plots.autoMargin(gd, autoMarginId(menuOpts));\n    }\n\n    // draw update menu container\n    var menus = fullLayout._menulayer\n        .selectAll('g.' + constants.containerClassName)\n        .data(menuData.length > 0 ? [0] : []);\n\n    menus.enter().append('g')\n        .classed(constants.containerClassName, true)\n        .style('cursor', 'pointer');\n\n    menus.exit().each(function() {\n        // Most components don't need to explicitly remove autoMargin, because\n        // marginPushers does this - but updatemenu updates don't go through\n        // a full replot so we need to explicitly remove it.\n        // This is for removing *all* updatemenus, removing individuals is\n        // handled below, in headerGroups.exit\n        d3.select(this).selectAll('g.' + constants.headerGroupClassName)\n            .each(clearAutoMargin);\n    }).remove();\n\n    // return early if no update menus are visible\n    if(menuData.length === 0) return;\n\n    // join header group\n    var headerGroups = menus.selectAll('g.' + constants.headerGroupClassName)\n        .data(menuData, keyFunction);\n\n    headerGroups.enter().append('g')\n        .classed(constants.headerGroupClassName, true);\n\n    // draw dropdown button container\n    var gButton = Lib.ensureSingle(menus, 'g', constants.dropdownButtonGroupClassName, function(s) {\n        s.style('pointer-events', 'all');\n    });\n\n    // find dimensions before plotting anything (this mutates menuOpts)\n    for(var i = 0; i < menuData.length; i++) {\n        var menuOpts = menuData[i];\n        findDimensions(gd, menuOpts);\n    }\n\n    // setup scrollbox\n    var scrollBoxId = 'updatemenus' + fullLayout._uid;\n    var scrollBox = new ScrollBox(gd, gButton, scrollBoxId);\n\n    // remove exiting header, remove dropped buttons and reset margins\n    if(headerGroups.enter().size()) {\n        // make sure gButton is on top of all headers\n        gButton.node().parentNode.appendChild(gButton.node());\n        gButton.call(removeAllButtons);\n    }\n\n    headerGroups.exit().each(function(menuOpts) {\n        gButton.call(removeAllButtons);\n        clearAutoMargin(menuOpts);\n    }).remove();\n\n    // draw headers!\n    headerGroups.each(function(menuOpts) {\n        var gHeader = d3.select(this);\n\n        var _gButton = menuOpts.type === 'dropdown' ? gButton : null;\n\n        Plots.manageCommandObserver(gd, menuOpts, menuOpts.buttons, function(data) {\n            setActive(gd, menuOpts, menuOpts.buttons[data.index], gHeader, _gButton, scrollBox, data.index, true);\n        });\n\n        if(menuOpts.type === 'dropdown') {\n            drawHeader(gd, gHeader, gButton, scrollBox, menuOpts);\n\n            // if this menu is active, update the dropdown container\n            if(isActive(gButton, menuOpts)) {\n                drawButtons(gd, gHeader, gButton, scrollBox, menuOpts);\n            }\n        } else {\n            drawButtons(gd, gHeader, null, null, menuOpts);\n        }\n    });\n};\n\n// Note that '_index' is set at the default step,\n// it corresponds to the menu index in the user layout update menu container.\n// Because a menu can be set invisible,\n// this is a more 'consistent' field than the index in the menuData.\nfunction keyFunction(menuOpts) {\n    return menuOpts._index;\n}\n\nfunction isFolded(gButton) {\n    return +gButton.attr(constants.menuIndexAttrName) === -1;\n}\n\nfunction isActive(gButton, menuOpts) {\n    return +gButton.attr(constants.menuIndexAttrName) === menuOpts._index;\n}\n\nfunction setActive(gd, menuOpts, buttonOpts, gHeader, gButton, scrollBox, buttonIndex, isSilentUpdate) {\n    // update 'active' attribute in menuOpts\n    menuOpts.active = buttonIndex;\n\n    // due to templating, it's possible this slider doesn't even exist yet\n    arrayEditor(gd.layout, constants.name, menuOpts)\n        .applyUpdate('active', buttonIndex);\n\n    if(menuOpts.type === 'buttons') {\n        drawButtons(gd, gHeader, null, null, menuOpts);\n    } else if(menuOpts.type === 'dropdown') {\n        // fold up buttons and redraw header\n        gButton.attr(constants.menuIndexAttrName, '-1');\n\n        drawHeader(gd, gHeader, gButton, scrollBox, menuOpts);\n\n        if(!isSilentUpdate) {\n            drawButtons(gd, gHeader, gButton, scrollBox, menuOpts);\n        }\n    }\n}\n\nfunction drawHeader(gd, gHeader, gButton, scrollBox, menuOpts) {\n    var header = Lib.ensureSingle(gHeader, 'g', constants.headerClassName, function(s) {\n        s.style('pointer-events', 'all');\n    });\n\n    var dims = menuOpts._dims;\n    var active = menuOpts.active;\n    var headerOpts = menuOpts.buttons[active] || constants.blankHeaderOpts;\n    var posOpts = { y: menuOpts.pad.t, yPad: 0, x: menuOpts.pad.l, xPad: 0, index: 0 };\n    var positionOverrides = {\n        width: dims.headerWidth,\n        height: dims.headerHeight\n    };\n\n    header\n        .call(drawItem, menuOpts, headerOpts, gd)\n        .call(setItemPosition, menuOpts, posOpts, positionOverrides);\n\n    // draw drop arrow at the right edge\n    var arrow = Lib.ensureSingle(gHeader, 'text', constants.headerArrowClassName, function(s) {\n        s.classed('user-select-none', true)\n            .attr('text-anchor', 'end')\n            .call(Drawing.font, menuOpts.font)\n            .text(constants.arrowSymbol[menuOpts.direction]);\n    });\n\n    arrow.attr({\n        x: dims.headerWidth - constants.arrowOffsetX + menuOpts.pad.l,\n        y: dims.headerHeight / 2 + constants.textOffsetY + menuOpts.pad.t\n    });\n\n    header.on('click', function() {\n        gButton.call(removeAllButtons,\n            String(isActive(gButton, menuOpts) ? -1 : menuOpts._index)\n        );\n\n        drawButtons(gd, gHeader, gButton, scrollBox, menuOpts);\n    });\n\n    header.on('mouseover', function() {\n        header.call(styleOnMouseOver);\n    });\n\n    header.on('mouseout', function() {\n        header.call(styleOnMouseOut, menuOpts);\n    });\n\n    // translate header group\n    Drawing.setTranslate(gHeader, dims.lx, dims.ly);\n}\n\nfunction drawButtons(gd, gHeader, gButton, scrollBox, menuOpts) {\n    // If this is a set of buttons, set pointer events = all since we play\n    // some minor games with which container is which in order to simplify\n    // the drawing of *either* buttons or menus\n    if(!gButton) {\n        gButton = gHeader;\n        gButton.attr('pointer-events', 'all');\n    }\n\n    var buttonData = (!isFolded(gButton) || menuOpts.type === 'buttons') ?\n        menuOpts.buttons :\n        [];\n\n    var klass = menuOpts.type === 'dropdown' ? constants.dropdownButtonClassName : constants.buttonClassName;\n\n    var buttons = gButton.selectAll('g.' + klass)\n        .data(Lib.filterVisible(buttonData));\n\n    var enter = buttons.enter().append('g')\n        .classed(klass, true);\n\n    var exit = buttons.exit();\n\n    if(menuOpts.type === 'dropdown') {\n        enter.attr('opacity', '0')\n            .transition()\n            .attr('opacity', '1');\n\n        exit.transition()\n            .attr('opacity', '0')\n            .remove();\n    } else {\n        exit.remove();\n    }\n\n    var x0 = 0;\n    var y0 = 0;\n    var dims = menuOpts._dims;\n\n    var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n\n    if(menuOpts.type === 'dropdown') {\n        if(isVertical) {\n            y0 = dims.headerHeight + constants.gapButtonHeader;\n        } else {\n            x0 = dims.headerWidth + constants.gapButtonHeader;\n        }\n    }\n\n    if(menuOpts.type === 'dropdown' && menuOpts.direction === 'up') {\n        y0 = -constants.gapButtonHeader + constants.gapButton - dims.openHeight;\n    }\n\n    if(menuOpts.type === 'dropdown' && menuOpts.direction === 'left') {\n        x0 = -constants.gapButtonHeader + constants.gapButton - dims.openWidth;\n    }\n\n    var posOpts = {\n        x: dims.lx + x0 + menuOpts.pad.l,\n        y: dims.ly + y0 + menuOpts.pad.t,\n        yPad: constants.gapButton,\n        xPad: constants.gapButton,\n        index: 0,\n    };\n\n    var scrollBoxPosition = {\n        l: posOpts.x + menuOpts.borderwidth,\n        t: posOpts.y + menuOpts.borderwidth\n    };\n\n    buttons.each(function(buttonOpts, buttonIndex) {\n        var button = d3.select(this);\n\n        button\n            .call(drawItem, menuOpts, buttonOpts, gd)\n            .call(setItemPosition, menuOpts, posOpts);\n\n        button.on('click', function() {\n            // skip `dragend` events\n            if(d3.event.defaultPrevented) return;\n\n            if(buttonOpts.execute) {\n                if(buttonOpts.args2 && menuOpts.active === buttonIndex) {\n                    setActive(gd, menuOpts, buttonOpts, gHeader, gButton, scrollBox, -1);\n                    Plots.executeAPICommand(gd, buttonOpts.method, buttonOpts.args2);\n                } else {\n                    setActive(gd, menuOpts, buttonOpts, gHeader, gButton, scrollBox, buttonIndex);\n                    Plots.executeAPICommand(gd, buttonOpts.method, buttonOpts.args);\n                }\n            }\n\n            gd.emit('plotly_buttonclicked', {menu: menuOpts, button: buttonOpts, active: menuOpts.active});\n        });\n\n        button.on('mouseover', function() {\n            button.call(styleOnMouseOver);\n        });\n\n        button.on('mouseout', function() {\n            button.call(styleOnMouseOut, menuOpts);\n            buttons.call(styleButtons, menuOpts);\n        });\n    });\n\n    buttons.call(styleButtons, menuOpts);\n\n    if(isVertical) {\n        scrollBoxPosition.w = Math.max(dims.openWidth, dims.headerWidth);\n        scrollBoxPosition.h = posOpts.y - scrollBoxPosition.t;\n    } else {\n        scrollBoxPosition.w = posOpts.x - scrollBoxPosition.l;\n        scrollBoxPosition.h = Math.max(dims.openHeight, dims.headerHeight);\n    }\n\n    scrollBoxPosition.direction = menuOpts.direction;\n\n    if(scrollBox) {\n        if(buttons.size()) {\n            drawScrollBox(gd, gHeader, gButton, scrollBox, menuOpts, scrollBoxPosition);\n        } else {\n            hideScrollBox(scrollBox);\n        }\n    }\n}\n\nfunction drawScrollBox(gd, gHeader, gButton, scrollBox, menuOpts, position) {\n    // enable the scrollbox\n    var direction = menuOpts.direction;\n    var isVertical = (direction === 'up' || direction === 'down');\n    var dims = menuOpts._dims;\n\n    var active = menuOpts.active;\n    var translateX, translateY;\n    var i;\n    if(isVertical) {\n        translateY = 0;\n        for(i = 0; i < active; i++) {\n            translateY += dims.heights[i] + constants.gapButton;\n        }\n    } else {\n        translateX = 0;\n        for(i = 0; i < active; i++) {\n            translateX += dims.widths[i] + constants.gapButton;\n        }\n    }\n\n    scrollBox.enable(position, translateX, translateY);\n\n    if(scrollBox.hbar) {\n        scrollBox.hbar\n            .attr('opacity', '0')\n            .transition()\n            .attr('opacity', '1');\n    }\n\n    if(scrollBox.vbar) {\n        scrollBox.vbar\n            .attr('opacity', '0')\n            .transition()\n            .attr('opacity', '1');\n    }\n}\n\nfunction hideScrollBox(scrollBox) {\n    var hasHBar = !!scrollBox.hbar;\n    var hasVBar = !!scrollBox.vbar;\n\n    if(hasHBar) {\n        scrollBox.hbar\n            .transition()\n            .attr('opacity', '0')\n            .each('end', function() {\n                hasHBar = false;\n                if(!hasVBar) scrollBox.disable();\n            });\n    }\n\n    if(hasVBar) {\n        scrollBox.vbar\n            .transition()\n            .attr('opacity', '0')\n            .each('end', function() {\n                hasVBar = false;\n                if(!hasHBar) scrollBox.disable();\n            });\n    }\n}\n\nfunction drawItem(item, menuOpts, itemOpts, gd) {\n    item.call(drawItemRect, menuOpts)\n        .call(drawItemText, menuOpts, itemOpts, gd);\n}\n\nfunction drawItemRect(item, menuOpts) {\n    var rect = Lib.ensureSingle(item, 'rect', constants.itemRectClassName, function(s) {\n        s.attr({\n            rx: constants.rx,\n            ry: constants.ry,\n            'shape-rendering': 'crispEdges'\n        });\n    });\n\n    rect.call(Color.stroke, menuOpts.bordercolor)\n        .call(Color.fill, menuOpts.bgcolor)\n        .style('stroke-width', menuOpts.borderwidth + 'px');\n}\n\nfunction drawItemText(item, menuOpts, itemOpts, gd) {\n    var text = Lib.ensureSingle(item, 'text', constants.itemTextClassName, function(s) {\n        s.classed('user-select-none', true)\n            .attr({\n                'text-anchor': 'start',\n                'data-notex': 1\n            });\n    });\n\n    var tx = itemOpts.label;\n    var _meta = gd._fullLayout._meta;\n    if(_meta) tx = Lib.templateString(tx, _meta);\n\n    text.call(Drawing.font, menuOpts.font)\n        .text(tx)\n        .call(svgTextUtils.convertToTspans, gd);\n}\n\nfunction styleButtons(buttons, menuOpts) {\n    var active = menuOpts.active;\n\n    buttons.each(function(buttonOpts, i) {\n        var button = d3.select(this);\n\n        if(i === active && menuOpts.showactive) {\n            button.select('rect.' + constants.itemRectClassName)\n                .call(Color.fill, constants.activeColor);\n        }\n    });\n}\n\nfunction styleOnMouseOver(item) {\n    item.select('rect.' + constants.itemRectClassName)\n        .call(Color.fill, constants.hoverColor);\n}\n\nfunction styleOnMouseOut(item, menuOpts) {\n    item.select('rect.' + constants.itemRectClassName)\n        .call(Color.fill, menuOpts.bgcolor);\n}\n\n// find item dimensions (this mutates menuOpts)\nfunction findDimensions(gd, menuOpts) {\n    var dims = menuOpts._dims = {\n        width1: 0,\n        height1: 0,\n        heights: [],\n        widths: [],\n        totalWidth: 0,\n        totalHeight: 0,\n        openWidth: 0,\n        openHeight: 0,\n        lx: 0,\n        ly: 0\n    };\n\n    var fakeButtons = Drawing.tester.selectAll('g.' + constants.dropdownButtonClassName)\n        .data(Lib.filterVisible(menuOpts.buttons));\n\n    fakeButtons.enter().append('g')\n        .classed(constants.dropdownButtonClassName, true);\n\n    var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n\n    // loop over fake buttons to find width / height\n    fakeButtons.each(function(buttonOpts, i) {\n        var button = d3.select(this);\n\n        button.call(drawItem, menuOpts, buttonOpts, gd);\n\n        var text = button.select('.' + constants.itemTextClassName);\n\n        // width is given by max width of all buttons\n        var tWidth = text.node() && Drawing.bBox(text.node()).width;\n        var wEff = Math.max(tWidth + constants.textPadX, constants.minWidth);\n\n        // height is determined by item text\n        var tHeight = menuOpts.font.size * LINE_SPACING;\n        var tLines = svgTextUtils.lineCount(text);\n        var hEff = Math.max(tHeight * tLines, constants.minHeight) + constants.textOffsetY;\n\n        hEff = Math.ceil(hEff);\n        wEff = Math.ceil(wEff);\n\n        // Store per-item sizes since a row of horizontal buttons, for example,\n        // don't all need to be the same width:\n        dims.widths[i] = wEff;\n        dims.heights[i] = hEff;\n\n        // Height and width of individual element:\n        dims.height1 = Math.max(dims.height1, hEff);\n        dims.width1 = Math.max(dims.width1, wEff);\n\n        if(isVertical) {\n            dims.totalWidth = Math.max(dims.totalWidth, wEff);\n            dims.openWidth = dims.totalWidth;\n            dims.totalHeight += hEff + constants.gapButton;\n            dims.openHeight += hEff + constants.gapButton;\n        } else {\n            dims.totalWidth += wEff + constants.gapButton;\n            dims.openWidth += wEff + constants.gapButton;\n            dims.totalHeight = Math.max(dims.totalHeight, hEff);\n            dims.openHeight = dims.totalHeight;\n        }\n    });\n\n    if(isVertical) {\n        dims.totalHeight -= constants.gapButton;\n    } else {\n        dims.totalWidth -= constants.gapButton;\n    }\n\n\n    dims.headerWidth = dims.width1 + constants.arrowPadX;\n    dims.headerHeight = dims.height1;\n\n    if(menuOpts.type === 'dropdown') {\n        if(isVertical) {\n            dims.width1 += constants.arrowPadX;\n            dims.totalHeight = dims.height1;\n        } else {\n            dims.totalWidth = dims.width1;\n        }\n        dims.totalWidth += constants.arrowPadX;\n    }\n\n    fakeButtons.remove();\n\n    var paddedWidth = dims.totalWidth + menuOpts.pad.l + menuOpts.pad.r;\n    var paddedHeight = dims.totalHeight + menuOpts.pad.t + menuOpts.pad.b;\n\n    var graphSize = gd._fullLayout._size;\n    dims.lx = graphSize.l + graphSize.w * menuOpts.x;\n    dims.ly = graphSize.t + graphSize.h * (1 - menuOpts.y);\n\n    var xanchor = 'left';\n    if(Lib.isRightAnchor(menuOpts)) {\n        dims.lx -= paddedWidth;\n        xanchor = 'right';\n    }\n    if(Lib.isCenterAnchor(menuOpts)) {\n        dims.lx -= paddedWidth / 2;\n        xanchor = 'center';\n    }\n\n    var yanchor = 'top';\n    if(Lib.isBottomAnchor(menuOpts)) {\n        dims.ly -= paddedHeight;\n        yanchor = 'bottom';\n    }\n    if(Lib.isMiddleAnchor(menuOpts)) {\n        dims.ly -= paddedHeight / 2;\n        yanchor = 'middle';\n    }\n\n    dims.totalWidth = Math.ceil(dims.totalWidth);\n    dims.totalHeight = Math.ceil(dims.totalHeight);\n    dims.lx = Math.round(dims.lx);\n    dims.ly = Math.round(dims.ly);\n\n    Plots.autoMargin(gd, autoMarginId(menuOpts), {\n        x: menuOpts.x,\n        y: menuOpts.y,\n        l: paddedWidth * ({right: 1, center: 0.5}[xanchor] || 0),\n        r: paddedWidth * ({left: 1, center: 0.5}[xanchor] || 0),\n        b: paddedHeight * ({top: 1, middle: 0.5}[yanchor] || 0),\n        t: paddedHeight * ({bottom: 1, middle: 0.5}[yanchor] || 0)\n    });\n}\n\nfunction autoMarginId(menuOpts) {\n    return constants.autoMarginIdRoot + menuOpts._index;\n}\n\n// set item positions (mutates posOpts)\nfunction setItemPosition(item, menuOpts, posOpts, overrideOpts) {\n    overrideOpts = overrideOpts || {};\n    var rect = item.select('.' + constants.itemRectClassName);\n    var text = item.select('.' + constants.itemTextClassName);\n    var borderWidth = menuOpts.borderwidth;\n    var index = posOpts.index;\n    var dims = menuOpts._dims;\n\n    Drawing.setTranslate(item, borderWidth + posOpts.x, borderWidth + posOpts.y);\n\n    var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n    var finalHeight = overrideOpts.height || (isVertical ? dims.heights[index] : dims.height1);\n\n    rect.attr({\n        x: 0,\n        y: 0,\n        width: overrideOpts.width || (isVertical ? dims.width1 : dims.widths[index]),\n        height: finalHeight\n    });\n\n    var tHeight = menuOpts.font.size * LINE_SPACING;\n    var tLines = svgTextUtils.lineCount(text);\n    var spanOffset = ((tLines - 1) * tHeight / 2);\n\n    svgTextUtils.positionText(text, constants.textOffsetX,\n        finalHeight / 2 - spanOffset + constants.textOffsetY);\n\n    if(isVertical) {\n        posOpts.y += dims.heights[index] + posOpts.yPad;\n    } else {\n        posOpts.x += dims.widths[index] + posOpts.xPad;\n    }\n\n    posOpts.index++;\n}\n\nfunction removeAllButtons(gButton, newMenuIndexAttr) {\n    gButton\n        .attr(constants.menuIndexAttrName, newMenuIndexAttr || '-1')\n        .selectAll('g.' + constants.dropdownButtonClassName).remove();\n}\n\n},{\"../../constants/alignment\":154,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../plot_api/plot_template\":212,\"../../plots/plots\":256,\"../color\":52,\"../drawing\":74,\"./constants\":149,\"./scrollbox\":153,\"d3\":16}],152:[function(_dereq_,module,exports){\narguments[4][146][0].apply(exports,arguments)\n},{\"./attributes\":148,\"./constants\":149,\"./defaults\":150,\"./draw\":151,\"dup\":146}],153:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = ScrollBox;\n\nvar d3 = _dereq_('d3');\n\nvar Color = _dereq_('../color');\nvar Drawing = _dereq_('../drawing');\n\nvar Lib = _dereq_('../../lib');\n\n/**\n * Helper class to setup a scroll box\n *\n * @class\n * @param           gd          Plotly's graph div\n * @param           container   Container to be scroll-boxed (as a D3 selection)\n * @param {string}  id          Id for the clip path to implement the scroll box\n */\nfunction ScrollBox(gd, container, id) {\n    this.gd = gd;\n    this.container = container;\n    this.id = id;\n\n    // See ScrollBox.prototype.enable for further definition\n    this.position = null;  // scrollbox position\n    this.translateX = null;  // scrollbox horizontal translation\n    this.translateY = null;  // scrollbox vertical translation\n    this.hbar = null;  // horizontal scrollbar D3 selection\n    this.vbar = null;  // vertical scrollbar D3 selection\n\n    // <rect> element to capture pointer events\n    this.bg = this.container.selectAll('rect.scrollbox-bg').data([0]);\n\n    this.bg.exit()\n        .on('.drag', null)\n        .on('wheel', null)\n        .remove();\n\n    this.bg.enter().append('rect')\n        .classed('scrollbox-bg', true)\n        .style('pointer-events', 'all')\n        .attr({\n            opacity: 0,\n            x: 0,\n            y: 0,\n            width: 0,\n            height: 0\n        });\n}\n\n// scroll bar dimensions\nScrollBox.barWidth = 2;\nScrollBox.barLength = 20;\nScrollBox.barRadius = 2;\nScrollBox.barPad = 1;\nScrollBox.barColor = '#808BA4';\n\n/**\n * If needed, setup a clip path and scrollbars\n *\n * @method\n * @param {Object}  position\n * @param {number}  position.l  Left side position (in pixels)\n * @param {number}  position.t  Top side (in pixels)\n * @param {number}  position.w  Width (in pixels)\n * @param {number}  position.h  Height (in pixels)\n * @param {string}  [position.direction='down']\n *                  Either 'down', 'left', 'right' or 'up'\n * @param {number}  [translateX=0]  Horizontal offset (in pixels)\n * @param {number}  [translateY=0]  Vertical offset (in pixels)\n */\nScrollBox.prototype.enable = function enable(position, translateX, translateY) {\n    var fullLayout = this.gd._fullLayout;\n    var fullWidth = fullLayout.width;\n    var fullHeight = fullLayout.height;\n\n    // compute position of scrollbox\n    this.position = position;\n\n    var l = this.position.l;\n    var w = this.position.w;\n    var t = this.position.t;\n    var h = this.position.h;\n    var direction = this.position.direction;\n    var isDown = (direction === 'down');\n    var isLeft = (direction === 'left');\n    var isRight = (direction === 'right');\n    var isUp = (direction === 'up');\n    var boxW = w;\n    var boxH = h;\n    var boxL, boxR;\n    var boxT, boxB;\n\n    if(!isDown && !isLeft && !isRight && !isUp) {\n        this.position.direction = 'down';\n        isDown = true;\n    }\n\n    var isVertical = isDown || isUp;\n    if(isVertical) {\n        boxL = l;\n        boxR = boxL + boxW;\n\n        if(isDown) {\n            // anchor to top side\n            boxT = t;\n            boxB = Math.min(boxT + boxH, fullHeight);\n            boxH = boxB - boxT;\n        } else {\n            // anchor to bottom side\n            boxB = t + boxH;\n            boxT = Math.max(boxB - boxH, 0);\n            boxH = boxB - boxT;\n        }\n    } else {\n        boxT = t;\n        boxB = boxT + boxH;\n\n        if(isLeft) {\n            // anchor to right side\n            boxR = l + boxW;\n            boxL = Math.max(boxR - boxW, 0);\n            boxW = boxR - boxL;\n        } else {\n            // anchor to left side\n            boxL = l;\n            boxR = Math.min(boxL + boxW, fullWidth);\n            boxW = boxR - boxL;\n        }\n    }\n\n    this._box = {\n        l: boxL,\n        t: boxT,\n        w: boxW,\n        h: boxH\n    };\n\n    // compute position of horizontal scroll bar\n    var needsHorizontalScrollBar = (w > boxW);\n    var hbarW = ScrollBox.barLength + 2 * ScrollBox.barPad;\n    var hbarH = ScrollBox.barWidth + 2 * ScrollBox.barPad;\n    // draw horizontal scrollbar on the bottom side\n    var hbarL = l;\n    var hbarT = t + h;\n\n    if(hbarT + hbarH > fullHeight) hbarT = fullHeight - hbarH;\n\n    var hbar = this.container.selectAll('rect.scrollbar-horizontal').data(\n            (needsHorizontalScrollBar) ? [0] : []);\n\n    hbar.exit()\n        .on('.drag', null)\n        .remove();\n\n    hbar.enter().append('rect')\n        .classed('scrollbar-horizontal', true)\n        .call(Color.fill, ScrollBox.barColor);\n\n    if(needsHorizontalScrollBar) {\n        this.hbar = hbar.attr({\n            'rx': ScrollBox.barRadius,\n            'ry': ScrollBox.barRadius,\n            'x': hbarL,\n            'y': hbarT,\n            'width': hbarW,\n            'height': hbarH\n        });\n\n        // hbar center moves between hbarXMin and hbarXMin + hbarTranslateMax\n        this._hbarXMin = hbarL + hbarW / 2;\n        this._hbarTranslateMax = boxW - hbarW;\n    } else {\n        delete this.hbar;\n        delete this._hbarXMin;\n        delete this._hbarTranslateMax;\n    }\n\n    // compute position of vertical scroll bar\n    var needsVerticalScrollBar = (h > boxH);\n    var vbarW = ScrollBox.barWidth + 2 * ScrollBox.barPad;\n    var vbarH = ScrollBox.barLength + 2 * ScrollBox.barPad;\n    // draw vertical scrollbar on the right side\n    var vbarL = l + w;\n    var vbarT = t;\n\n    if(vbarL + vbarW > fullWidth) vbarL = fullWidth - vbarW;\n\n    var vbar = this.container.selectAll('rect.scrollbar-vertical').data(\n            (needsVerticalScrollBar) ? [0] : []);\n\n    vbar.exit()\n        .on('.drag', null)\n        .remove();\n\n    vbar.enter().append('rect')\n        .classed('scrollbar-vertical', true)\n        .call(Color.fill, ScrollBox.barColor);\n\n    if(needsVerticalScrollBar) {\n        this.vbar = vbar.attr({\n            'rx': ScrollBox.barRadius,\n            'ry': ScrollBox.barRadius,\n            'x': vbarL,\n            'y': vbarT,\n            'width': vbarW,\n            'height': vbarH\n        });\n\n        // vbar center moves between vbarYMin and vbarYMin + vbarTranslateMax\n        this._vbarYMin = vbarT + vbarH / 2;\n        this._vbarTranslateMax = boxH - vbarH;\n    } else {\n        delete this.vbar;\n        delete this._vbarYMin;\n        delete this._vbarTranslateMax;\n    }\n\n    // setup a clip path (if scroll bars are needed)\n    var clipId = this.id;\n    var clipL = boxL - 0.5;\n    var clipR = (needsVerticalScrollBar) ? boxR + vbarW + 0.5 : boxR + 0.5;\n    var clipT = boxT - 0.5;\n    var clipB = (needsHorizontalScrollBar) ? boxB + hbarH + 0.5 : boxB + 0.5;\n\n    var clipPath = fullLayout._topdefs.selectAll('#' + clipId)\n        .data((needsHorizontalScrollBar || needsVerticalScrollBar) ? [0] : []);\n\n    clipPath.exit().remove();\n\n    clipPath.enter()\n        .append('clipPath').attr('id', clipId)\n        .append('rect');\n\n    if(needsHorizontalScrollBar || needsVerticalScrollBar) {\n        this._clipRect = clipPath.select('rect').attr({\n            x: Math.floor(clipL),\n            y: Math.floor(clipT),\n            width: Math.ceil(clipR) - Math.floor(clipL),\n            height: Math.ceil(clipB) - Math.floor(clipT)\n        });\n\n        this.container.call(Drawing.setClipUrl, clipId, this.gd);\n\n        this.bg.attr({\n            x: l,\n            y: t,\n            width: w,\n            height: h\n        });\n    } else {\n        this.bg.attr({\n            width: 0,\n            height: 0\n        });\n        this.container\n            .on('wheel', null)\n            .on('.drag', null)\n            .call(Drawing.setClipUrl, null);\n        delete this._clipRect;\n    }\n\n    // set up drag listeners (if scroll bars are needed)\n    if(needsHorizontalScrollBar || needsVerticalScrollBar) {\n        var onBoxDrag = d3.behavior.drag()\n            .on('dragstart', function() {\n                d3.event.sourceEvent.preventDefault();\n            })\n            .on('drag', this._onBoxDrag.bind(this));\n\n        this.container\n            .on('wheel', null)\n            .on('wheel', this._onBoxWheel.bind(this))\n            .on('.drag', null)\n            .call(onBoxDrag);\n\n        var onBarDrag = d3.behavior.drag()\n            .on('dragstart', function() {\n                d3.event.sourceEvent.preventDefault();\n                d3.event.sourceEvent.stopPropagation();\n            })\n            .on('drag', this._onBarDrag.bind(this));\n\n        if(needsHorizontalScrollBar) {\n            this.hbar\n                .on('.drag', null)\n                .call(onBarDrag);\n        }\n\n        if(needsVerticalScrollBar) {\n            this.vbar\n                .on('.drag', null)\n                .call(onBarDrag);\n        }\n    }\n\n    // set scrollbox translation\n    this.setTranslate(translateX, translateY);\n};\n\n/**\n * If present, remove clip-path and scrollbars\n *\n * @method\n */\nScrollBox.prototype.disable = function disable() {\n    if(this.hbar || this.vbar) {\n        this.bg.attr({\n            width: 0,\n            height: 0\n        });\n        this.container\n            .on('wheel', null)\n            .on('.drag', null)\n            .call(Drawing.setClipUrl, null);\n        delete this._clipRect;\n    }\n\n    if(this.hbar) {\n        this.hbar.on('.drag', null);\n        this.hbar.remove();\n        delete this.hbar;\n        delete this._hbarXMin;\n        delete this._hbarTranslateMax;\n    }\n\n    if(this.vbar) {\n        this.vbar.on('.drag', null);\n        this.vbar.remove();\n        delete this.vbar;\n        delete this._vbarYMin;\n        delete this._vbarTranslateMax;\n    }\n};\n\n/**\n * Handles scroll box drag events\n *\n * @method\n */\nScrollBox.prototype._onBoxDrag = function _onBoxDrag() {\n    var translateX = this.translateX;\n    var translateY = this.translateY;\n\n    if(this.hbar) {\n        translateX -= d3.event.dx;\n    }\n\n    if(this.vbar) {\n        translateY -= d3.event.dy;\n    }\n\n    this.setTranslate(translateX, translateY);\n};\n\n/**\n * Handles scroll box wheel events\n *\n * @method\n */\nScrollBox.prototype._onBoxWheel = function _onBoxWheel() {\n    var translateX = this.translateX;\n    var translateY = this.translateY;\n\n    if(this.hbar) {\n        translateX += d3.event.deltaY;\n    }\n\n    if(this.vbar) {\n        translateY += d3.event.deltaY;\n    }\n\n    this.setTranslate(translateX, translateY);\n};\n\n/**\n * Handles scroll bar drag events\n *\n * @method\n */\nScrollBox.prototype._onBarDrag = function _onBarDrag() {\n    var translateX = this.translateX;\n    var translateY = this.translateY;\n\n    if(this.hbar) {\n        var xMin = translateX + this._hbarXMin;\n        var xMax = xMin + this._hbarTranslateMax;\n        var x = Lib.constrain(d3.event.x, xMin, xMax);\n        var xf = (x - xMin) / (xMax - xMin);\n\n        var translateXMax = this.position.w - this._box.w;\n\n        translateX = xf * translateXMax;\n    }\n\n    if(this.vbar) {\n        var yMin = translateY + this._vbarYMin;\n        var yMax = yMin + this._vbarTranslateMax;\n        var y = Lib.constrain(d3.event.y, yMin, yMax);\n        var yf = (y - yMin) / (yMax - yMin);\n\n        var translateYMax = this.position.h - this._box.h;\n\n        translateY = yf * translateYMax;\n    }\n\n    this.setTranslate(translateX, translateY);\n};\n\n/**\n * Set clip path and scroll bar translate transform\n *\n * @method\n * @param {number}  [translateX=0]  Horizontal offset (in pixels)\n * @param {number}  [translateY=0]  Vertical offset (in pixels)\n */\nScrollBox.prototype.setTranslate = function setTranslate(translateX, translateY) {\n    // store translateX and translateY (needed by mouse event handlers)\n    var translateXMax = this.position.w - this._box.w;\n    var translateYMax = this.position.h - this._box.h;\n\n    translateX = Lib.constrain(translateX || 0, 0, translateXMax);\n    translateY = Lib.constrain(translateY || 0, 0, translateYMax);\n\n    this.translateX = translateX;\n    this.translateY = translateY;\n\n    this.container.call(Drawing.setTranslate,\n        this._box.l - this.position.l - translateX,\n        this._box.t - this.position.t - translateY);\n\n    if(this._clipRect) {\n        this._clipRect.attr({\n            x: Math.floor(this.position.l + translateX - 0.5),\n            y: Math.floor(this.position.t + translateY - 0.5)\n        });\n    }\n\n    if(this.hbar) {\n        var xf = translateX / translateXMax;\n\n        this.hbar.call(Drawing.setTranslate,\n            translateX + xf * this._hbarTranslateMax,\n            translateY);\n    }\n\n    if(this.vbar) {\n        var yf = translateY / translateYMax;\n\n        this.vbar.call(Drawing.setTranslate,\n            translateX,\n            translateY + yf * this._vbarTranslateMax);\n    }\n};\n\n},{\"../../lib\":178,\"../color\":52,\"../drawing\":74,\"d3\":16}],154:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// fraction of some size to get to a named position\nmodule.exports = {\n    // from bottom left: this is the origin of our paper-reference\n    // positioning system\n    FROM_BL: {\n        left: 0,\n        center: 0.5,\n        right: 1,\n        bottom: 0,\n        middle: 0.5,\n        top: 1\n    },\n    // from top left: this is the screen pixel positioning origin\n    FROM_TL: {\n        left: 0,\n        center: 0.5,\n        right: 1,\n        bottom: 1,\n        middle: 0.5,\n        top: 0\n    },\n    // from bottom right: sometimes you just need the opposite of ^^\n    FROM_BR: {\n        left: 1,\n        center: 0.5,\n        right: 0,\n        bottom: 0,\n        middle: 0.5,\n        top: 1\n    },\n    // multiple of fontSize to get the vertical offset between lines\n    LINE_SPACING: 1.3,\n\n    // multiple of fontSize to shift from the baseline\n    // to the cap (captical letter) line\n    // (to use when we don't calculate this shift from Drawing.bBox)\n    // This is an approximation since in reality cap height can differ\n    // from font to font. However, according to Wikipedia\n    //   an \"average\" font might have a cap height of 70% of the em\n    // https://en.wikipedia.org/wiki/Em_(typography)#History\n    CAP_SHIFT: 0.70,\n\n    // half the cap height (distance between baseline and cap line)\n    // of an \"average\" font (for more info see above).\n    MID_SHIFT: 0.35,\n\n    OPPOSITE_SIDE: {\n        left: 'right',\n        right: 'left',\n        top: 'bottom',\n        bottom: 'top'\n    }\n};\n\n},{}],155:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    FORMAT_LINK: 'https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format',\n    DATE_FORMAT_LINK: 'https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format'\n};\n\n},{}],156:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    COMPARISON_OPS: ['=', '!=', '<', '>=', '>', '<='],\n    COMPARISON_OPS2: ['=', '<', '>=', '>', '<='],\n    INTERVAL_OPS: ['[]', '()', '[)', '(]', '][', ')(', '](', ')['],\n    SET_OPS: ['{}', '}{'],\n    CONSTRAINT_REDUCTION: {\n        // for contour constraints, open/closed endpoints are equivalent\n        '=': '=',\n\n        '<': '<',\n        '<=': '<',\n\n        '>': '>',\n        '>=': '>',\n\n        '[]': '[]',\n        '()': '[]',\n        '[)': '[]',\n        '(]': '[]',\n\n        '][': '][',\n        ')(': '][',\n        '](': '][',\n        ')[': ']['\n    }\n};\n\n},{}],157:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n    /**\n     * Timing information for interactive elements\n     */\n    SHOW_PLACEHOLDER: 100,\n    HIDE_PLACEHOLDER: 1000,\n\n    // opacity dimming fraction for points that are not in selection\n    DESELECTDIM: 0.2\n};\n\n},{}],158:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n    /**\n     * Standardize all missing data in calcdata to use undefined\n     * never null or NaN.\n     * That way we can use !==undefined, or !== BADNUM,\n     * to test for real data\n     */\n    BADNUM: undefined,\n\n    /*\n     * Limit certain operations to well below floating point max value\n     * to avoid glitches: Make sure that even when you multiply it by the\n     * number of pixels on a giant screen it still works\n     */\n    FP_SAFE: Number.MAX_VALUE / 10000,\n\n    /*\n     * conversion of date units to milliseconds\n     * year and month constants are marked \"AVG\"\n     * to remind us that not all years and months\n     * have the same length\n     */\n    ONEAVGYEAR: 31557600000, // 365.25 days\n    ONEAVGMONTH: 2629800000, // 1/12 of ONEAVGYEAR\n    ONEDAY: 86400000,\n    ONEHOUR: 3600000,\n    ONEMIN: 60000,\n    ONESEC: 1000,\n\n    /*\n     * For fast conversion btwn world calendars and epoch ms, the Julian Day Number\n     * of the unix epoch. From calendars.instance().newDate(1970, 1, 1).toJD()\n     */\n    EPOCHJD: 2440587.5,\n\n    /*\n     * Are two values nearly equal? Compare to 1PPM\n     */\n    ALMOST_EQUAL: 1 - 1e-6,\n\n    /*\n     * If we're asked to clip a non-positive log value, how far off-screen\n     * do we put it?\n     */\n    LOG_CLIP: 10,\n\n    /*\n     * not a number, but for displaying numbers: the \"minus sign\" symbol is\n     * wider than the regular ascii dash \"-\"\n     */\n    MINUS_SIGN: '\\u2212'\n};\n\n},{}],159:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nexports.xmlns = 'http://www.w3.org/2000/xmlns/';\nexports.svg = 'http://www.w3.org/2000/svg';\nexports.xlink = 'http://www.w3.org/1999/xlink';\n\n// the 'old' d3 quirk got fix in v3.5.7\n// https://github.com/mbostock/d3/commit/a6f66e9dd37f764403fc7c1f26be09ab4af24fed\nexports.svgAttrs = {\n    xmlns: exports.svg,\n    'xmlns:xlink': exports.xlink\n};\n\n},{}],160:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nexports.version = _dereq_('./version').version;\n\n// inject promise polyfill\n_dereq_('es6-promise').polyfill();\n\n// inject plot css\n_dereq_('../build/plotcss');\n\n// inject default MathJax config\n_dereq_('./fonts/mathjax_config')();\n\n// include registry module and expose register method\nvar Registry = _dereq_('./registry');\nvar register = exports.register = Registry.register;\n\n// expose plot api methods\nvar plotApi = _dereq_('./plot_api');\nvar methodNames = Object.keys(plotApi);\nfor(var i = 0; i < methodNames.length; i++) {\n    var name = methodNames[i];\n    // _ -> private API methods, but still registered for internal use\n    if(name.charAt(0) !== '_') exports[name] = plotApi[name];\n    register({\n        moduleType: 'apiMethod',\n        name: name,\n        fn: plotApi[name]\n    });\n}\n\n// scatter is the only trace included by default\nregister(_dereq_('./traces/scatter'));\n\n// register all registrable components modules\nregister([\n    _dereq_('./components/legend'),\n    _dereq_('./components/fx'), // fx needs to come after legend\n    _dereq_('./components/annotations'),\n    _dereq_('./components/annotations3d'),\n    _dereq_('./components/shapes'),\n    _dereq_('./components/images'),\n    _dereq_('./components/updatemenus'),\n    _dereq_('./components/sliders'),\n    _dereq_('./components/rangeslider'),\n    _dereq_('./components/rangeselector'),\n    _dereq_('./components/grid'),\n    _dereq_('./components/errorbars'),\n    _dereq_('./components/colorscale'),\n    _dereq_('./components/colorbar')\n]);\n\n// locales en and en-US are required for default behavior\nregister([\n    _dereq_('./locale-en'),\n    _dereq_('./locale-en-us')\n]);\n\n// locales that are present in the window should be loaded\nif(window.PlotlyLocales && Array.isArray(window.PlotlyLocales)) {\n    register(window.PlotlyLocales);\n    delete window.PlotlyLocales;\n}\n\n// plot icons\nexports.Icons = _dereq_('./fonts/ploticon');\n\n// unofficial 'beta' plot methods, use at your own risk\nexports.Plots = _dereq_('./plots/plots');\nexports.Fx = _dereq_('./components/fx');\nexports.Snapshot = _dereq_('./snapshot');\nexports.PlotSchema = _dereq_('./plot_api/plot_schema');\nexports.Queue = _dereq_('./lib/queue');\n\n// export d3 used in the bundle\nexports.d3 = _dereq_('d3');\n\n},{\"../build/plotcss\":1,\"./components/annotations\":45,\"./components/annotations3d\":50,\"./components/colorbar\":58,\"./components/colorscale\":64,\"./components/errorbars\":80,\"./components/fx\":92,\"./components/grid\":96,\"./components/images\":101,\"./components/legend\":109,\"./components/rangeselector\":120,\"./components/rangeslider\":127,\"./components/shapes\":141,\"./components/sliders\":146,\"./components/updatemenus\":152,\"./fonts/mathjax_config\":161,\"./fonts/ploticon\":162,\"./lib/queue\":192,\"./locale-en\":203,\"./locale-en-us\":202,\"./plot_api\":207,\"./plot_api/plot_schema\":211,\"./plots/plots\":256,\"./registry\":269,\"./snapshot\":274,\"./traces/scatter\":401,\"./version\":435,\"d3\":16,\"es6-promise\":17}],161:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/* global MathJax:false */\n\nmodule.exports = function() {\n    if(typeof MathJax !== 'undefined') {\n        var globalConfig = (window.PlotlyConfig || {}).MathJaxConfig !== 'local';\n\n        if(globalConfig) {\n            MathJax.Hub.Config({\n                messageStyle: 'none',\n                skipStartupTypeset: true,\n                displayAlign: 'left',\n                tex2jax: {\n                    inlineMath: [['$', '$'], ['\\\\(', '\\\\)']]\n                }\n            });\n            MathJax.Hub.Configured();\n        }\n    }\n};\n\n},{}],162:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    'undo': {\n        'width': 857.1,\n        'height': 1000,\n        'path': 'm857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'home': {\n        'width': 928.6,\n        'height': 1000,\n        'path': 'm786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'camera-retro': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'zoombox': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'pan': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'zoom_plus': {\n        'width': 875,\n        'height': 1000,\n        'path': 'm1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'zoom_minus': {\n        'width': 875,\n        'height': 1000,\n        'path': 'm0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'autoscale': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'tooltip_basic': {\n        'width': 1500,\n        'height': 1000,\n        'path': 'm375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'tooltip_compare': {\n        'width': 1125,\n        'height': 1000,\n        'path': 'm187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'plotlylogo': {\n        'width': 1542,\n        'height': 1000,\n        'path': 'm0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'z-axis': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    '3d_rotate': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'camera': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'movie': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'question': {\n        'width': 857.1,\n        'height': 1000,\n        'path': 'm500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'disk': {\n        'width': 857.1,\n        'height': 1000,\n        'path': 'm214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'drawopenpath': {\n        'width': 70,\n        'height': 70,\n        'path': 'M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z',\n        'transform': 'matrix(1 0 0 1 -15 -15)'\n    },\n    'drawclosedpath': {\n        'width': 90,\n        'height': 90,\n        'path': 'M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z',\n        'transform': 'matrix(1 0 0 1 -5 -5)'\n    },\n    'lasso': {\n        'width': 1031,\n        'height': 1000,\n        'path': 'm1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'selectbox': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'm0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z',\n        'transform': 'matrix(1 0 0 -1 0 850)'\n    },\n    'drawline': {\n        'width': 70,\n        'height': 70,\n        'path': 'M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z',\n        'transform': 'matrix(1 0 0 1 -15 -15)'\n    },\n    'drawrect': {\n        'width': 80,\n        'height': 80,\n        'path': 'M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z',\n        'transform': 'matrix(1 0 0 1 -10 -10)'\n    },\n    'drawcircle': {\n        'width': 80,\n        'height': 80,\n        'path': 'M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z',\n        'transform': 'matrix(1 0 0 1 -10 -10)'\n    },\n    'eraseshape': {\n        'width': 80,\n        'height': 80,\n        'path': 'M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z',\n        'transform': 'matrix(1 0 0 1 -10 -10)'\n    },\n    'spikeline': {\n        'width': 1000,\n        'height': 1000,\n        'path': 'M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z',\n        'transform': 'matrix(1.5 0 0 -1.5 0 850)'\n    },\n    'pencil': {\n        'width': 1792,\n        'height': 1792,\n        'path': 'M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z',\n        'transform': 'matrix(1 0 0 1 0 1)'\n    },\n    'newplotlylogo': {\n        'name': 'newplotlylogo',\n        'svg': '<svg xmlns=\\'http://www.w3.org/2000/svg\\' viewBox=\\'0 0 132 132\\'><defs><style>.cls-1 {fill: #3f4f75;} .cls-2 {fill: #80cfbe;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id=\\'symbol\\'><rect class=\\'cls-1\\' width=\\'132\\' height=\\'132\\' rx=\\'6\\' ry=\\'6\\'/><circle class=\\'cls-2\\' cx=\\'78\\' cy=\\'54\\' r=\\'6\\'/><circle class=\\'cls-2\\' cx=\\'102\\' cy=\\'30\\' r=\\'6\\'/><circle class=\\'cls-2\\' cx=\\'78\\' cy=\\'30\\' r=\\'6\\'/><circle class=\\'cls-2\\' cx=\\'54\\' cy=\\'30\\' r=\\'6\\'/><circle class=\\'cls-2\\' cx=\\'30\\' cy=\\'30\\' r=\\'6\\'/><circle class=\\'cls-2\\' cx=\\'30\\' cy=\\'54\\' r=\\'6\\'/><path class=\\'cls-3\\' d=\\'M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z\\'/><path class=\\'cls-3\\' d=\\'M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z\\'/><path class=\\'cls-3\\' d=\\'M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z\\'/><path class=\\'cls-3\\' d=\\'M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z\\'/></g></svg>'\n    }\n};\n\n},{}],163:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n/**\n * Determine the position anchor property of x/y xanchor/yanchor components.\n *\n * - values < 1/3 align the low side at that fraction,\n * - values [1/3, 2/3] align the center at that fraction,\n * - values > 2/3 align the right at that fraction.\n */\n\n\nexports.isLeftAnchor = function isLeftAnchor(opts) {\n    return (\n      opts.xanchor === 'left' ||\n      (opts.xanchor === 'auto' && opts.x <= 1 / 3)\n    );\n};\n\nexports.isCenterAnchor = function isCenterAnchor(opts) {\n    return (\n        opts.xanchor === 'center' ||\n        (opts.xanchor === 'auto' && opts.x > 1 / 3 && opts.x < 2 / 3)\n    );\n};\n\nexports.isRightAnchor = function isRightAnchor(opts) {\n    return (\n      opts.xanchor === 'right' ||\n      (opts.xanchor === 'auto' && opts.x >= 2 / 3)\n    );\n};\n\nexports.isTopAnchor = function isTopAnchor(opts) {\n    return (\n        opts.yanchor === 'top' ||\n        (opts.yanchor === 'auto' && opts.y >= 2 / 3)\n    );\n};\n\nexports.isMiddleAnchor = function isMiddleAnchor(opts) {\n    return (\n        opts.yanchor === 'middle' ||\n        (opts.yanchor === 'auto' && opts.y > 1 / 3 && opts.y < 2 / 3)\n    );\n};\n\nexports.isBottomAnchor = function isBottomAnchor(opts) {\n    return (\n      opts.yanchor === 'bottom' ||\n      (opts.yanchor === 'auto' && opts.y <= 1 / 3)\n    );\n};\n\n},{}],164:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar modModule = _dereq_('./mod');\nvar mod = modModule.mod;\nvar modHalf = modModule.modHalf;\n\nvar PI = Math.PI;\nvar twoPI = 2 * PI;\n\nfunction deg2rad(deg) { return deg / 180 * PI; }\n\nfunction rad2deg(rad) { return rad / PI * 180; }\n\n/**\n * is sector a full circle?\n * ... this comes up a lot in SVG path-drawing routines\n *\n * N.B. we consider all sectors that span more that 2pi 'full' circles\n *\n * @param {2-item array} aBnds : angular bounds in *radians*\n * @return {boolean}\n */\nfunction isFullCircle(aBnds) {\n    return Math.abs(aBnds[1] - aBnds[0]) > twoPI - 1e-14;\n}\n\n/**\n * angular delta between angle 'a' and 'b'\n * solution taken from: https://stackoverflow.com/a/2007279\n *\n * @param {number} a : first angle in *radians*\n * @param {number} b : second angle in *radians*\n * @return {number} angular delta in *radians*\n */\nfunction angleDelta(a, b) {\n    return modHalf(b - a, twoPI);\n}\n\n/**\n * angular distance between angle 'a' and 'b'\n *\n * @param {number} a : first angle in *radians*\n * @param {number} b : second angle in *radians*\n * @return {number} angular distance in *radians*\n */\nfunction angleDist(a, b) {\n    return Math.abs(angleDelta(a, b));\n}\n\n/**\n * is angle inside sector?\n *\n * @param {number} a : angle to test in *radians*\n * @param {2-item array} aBnds : sector's angular bounds in *radians*\n * @param {boolean}\n */\nfunction isAngleInsideSector(a, aBnds) {\n    if(isFullCircle(aBnds)) return true;\n\n    var s0, s1;\n\n    if(aBnds[0] < aBnds[1]) {\n        s0 = aBnds[0];\n        s1 = aBnds[1];\n    } else {\n        s0 = aBnds[1];\n        s1 = aBnds[0];\n    }\n\n    s0 = mod(s0, twoPI);\n    s1 = mod(s1, twoPI);\n    if(s0 > s1) s1 += twoPI;\n\n    var a0 = mod(a, twoPI);\n    var a1 = a0 + twoPI;\n\n    return (a0 >= s0 && a0 <= s1) || (a1 >= s0 && a1 <= s1);\n}\n\n/**\n * is pt (r,a) inside sector?\n *\n * @param {number} r : pt's radial coordinate\n * @param {number} a : pt's angular coordinate in *radians*\n * @param {2-item array} rBnds : sector's radial bounds\n * @param {2-item array} aBnds : sector's angular bounds in *radians*\n * @return {boolean}\n */\nfunction isPtInsideSector(r, a, rBnds, aBnds) {\n    if(!isAngleInsideSector(a, aBnds)) return false;\n\n    var r0, r1;\n\n    if(rBnds[0] < rBnds[1]) {\n        r0 = rBnds[0];\n        r1 = rBnds[1];\n    } else {\n        r0 = rBnds[1];\n        r1 = rBnds[0];\n    }\n\n    return r >= r0 && r <= r1;\n}\n\n// common to pathArc, pathSector and pathAnnulus\nfunction _path(r0, r1, a0, a1, cx, cy, isClosed) {\n    cx = cx || 0;\n    cy = cy || 0;\n\n    var isCircle = isFullCircle([a0, a1]);\n    var aStart, aMid, aEnd;\n    var rStart, rEnd;\n\n    if(isCircle) {\n        aStart = 0;\n        aMid = PI;\n        aEnd = twoPI;\n    } else {\n        if(a0 < a1) {\n            aStart = a0;\n            aEnd = a1;\n        } else {\n            aStart = a1;\n            aEnd = a0;\n        }\n    }\n\n    if(r0 < r1) {\n        rStart = r0;\n        rEnd = r1;\n    } else {\n        rStart = r1;\n        rEnd = r0;\n    }\n\n    // N.B. svg coordinates here, where y increases downward\n    function pt(r, a) {\n        return [r * Math.cos(a) + cx, cy - r * Math.sin(a)];\n    }\n\n    var largeArc = Math.abs(aEnd - aStart) <= PI ? 0 : 1;\n    function arc(r, a, cw) {\n        return 'A' + [r, r] + ' ' + [0, largeArc, cw] + ' ' + pt(r, a);\n    }\n\n    var p;\n\n    if(isCircle) {\n        if(rStart === null) {\n            p = 'M' + pt(rEnd, aStart) +\n                arc(rEnd, aMid, 0) +\n                arc(rEnd, aEnd, 0) + 'Z';\n        } else {\n            p = 'M' + pt(rStart, aStart) +\n                arc(rStart, aMid, 0) +\n                arc(rStart, aEnd, 0) + 'Z' +\n                'M' + pt(rEnd, aStart) +\n                arc(rEnd, aMid, 1) +\n                arc(rEnd, aEnd, 1) + 'Z';\n        }\n    } else {\n        if(rStart === null) {\n            p = 'M' + pt(rEnd, aStart) + arc(rEnd, aEnd, 0);\n            if(isClosed) p += 'L0,0Z';\n        } else {\n            p = 'M' + pt(rStart, aStart) +\n                'L' + pt(rEnd, aStart) +\n                arc(rEnd, aEnd, 0) +\n                'L' + pt(rStart, aEnd) +\n                arc(rStart, aStart, 1) + 'Z';\n        }\n    }\n\n    return p;\n}\n\n/**\n * path an arc\n *\n * @param {number} r : radius\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathArc(r, a0, a1, cx, cy) {\n    return _path(null, r, a0, a1, cx, cy, 0);\n}\n\n/**\n * path a sector\n *\n * @param {number} r : radius\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathSector(r, a0, a1, cx, cy) {\n    return _path(null, r, a0, a1, cx, cy, 1);\n}\n\n/**\n * path an annulus\n *\n * @param {number} r0 : first radial coordinate\n * @param {number} r1 : second radial coordinate\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathAnnulus(r0, r1, a0, a1, cx, cy) {\n    return _path(r0, r1, a0, a1, cx, cy, 1);\n}\n\nmodule.exports = {\n    deg2rad: deg2rad,\n    rad2deg: rad2deg,\n    angleDelta: angleDelta,\n    angleDist: angleDist,\n    isFullCircle: isFullCircle,\n    isAngleInsideSector: isAngleInsideSector,\n    isPtInsideSector: isPtInsideSector,\n    pathArc: pathArc,\n    pathSector: pathSector,\n    pathAnnulus: pathAnnulus\n};\n\n},{\"./mod\":185}],165:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArray = Array.isArray;\n\n// IE9 fallbacks\n\nvar ab = (typeof ArrayBuffer === 'undefined' || !ArrayBuffer.isView) ?\n    {isView: function() { return false; }} :\n    ArrayBuffer;\n\nvar dv = (typeof DataView === 'undefined') ?\n    function() {} :\n    DataView;\n\nfunction isTypedArray(a) {\n    return ab.isView(a) && !(a instanceof dv);\n}\nexports.isTypedArray = isTypedArray;\n\nfunction isArrayOrTypedArray(a) {\n    return isArray(a) || isTypedArray(a);\n}\nexports.isArrayOrTypedArray = isArrayOrTypedArray;\n\n/*\n * Test whether an input object is 1D.\n *\n * Assumes we already know the object is an array.\n *\n * Looks only at the first element, if the dimensionality is\n * not consistent we won't figure that out here.\n */\nfunction isArray1D(a) {\n    return !isArrayOrTypedArray(a[0]);\n}\nexports.isArray1D = isArray1D;\n\n/*\n * Ensures an array has the right amount of storage space. If it doesn't\n * exist, it creates an array. If it does exist, it returns it if too\n * short or truncates it in-place.\n *\n * The goal is to just reuse memory to avoid a bit of excessive garbage\n * collection.\n */\nexports.ensureArray = function(out, n) {\n    // TODO: typed array support here? This is only used in\n    // traces/carpet/compute_control_points\n    if(!isArray(out)) out = [];\n\n    // If too long, truncate. (If too short, it will grow\n    // automatically so we don't care about that case)\n    out.length = n;\n\n    return out;\n};\n\n/*\n * TypedArray-compatible concatenation of n arrays\n * if all arrays are the same type it will preserve that type,\n * otherwise it falls back on Array.\n * Also tries to avoid copying, in case one array has zero length\n * But never mutates an existing array\n */\nexports.concat = function() {\n    var args = [];\n    var allArray = true;\n    var totalLen = 0;\n\n    var _constructor, arg0, i, argi, posi, leni, out, j;\n\n    for(i = 0; i < arguments.length; i++) {\n        argi = arguments[i];\n        leni = argi.length;\n        if(leni) {\n            if(arg0) args.push(argi);\n            else {\n                arg0 = argi;\n                posi = leni;\n            }\n\n            if(isArray(argi)) {\n                _constructor = false;\n            } else {\n                allArray = false;\n                if(!totalLen) {\n                    _constructor = argi.constructor;\n                } else if(_constructor !== argi.constructor) {\n                    // TODO: in principle we could upgrade here,\n                    // ie keep typed array but convert all to Float64Array?\n                    _constructor = false;\n                }\n            }\n\n            totalLen += leni;\n        }\n    }\n\n    if(!totalLen) return [];\n    if(!args.length) return arg0;\n\n    if(allArray) return arg0.concat.apply(arg0, args);\n    if(_constructor) {\n        // matching typed arrays\n        out = new _constructor(totalLen);\n        out.set(arg0);\n        for(i = 0; i < args.length; i++) {\n            argi = args[i];\n            out.set(argi, posi);\n            posi += argi.length;\n        }\n        return out;\n    }\n\n    // mismatched types or Array + typed\n    out = new Array(totalLen);\n    for(j = 0; j < arg0.length; j++) out[j] = arg0[j];\n    for(i = 0; i < args.length; i++) {\n        argi = args[i];\n        for(j = 0; j < argi.length; j++) out[posi + j] = argi[j];\n        posi += j;\n    }\n    return out;\n};\n\nexports.maxRowLength = function(z) {\n    return _rowLength(z, Math.max, 0);\n};\n\nexports.minRowLength = function(z) {\n    return _rowLength(z, Math.min, Infinity);\n};\n\nfunction _rowLength(z, fn, len0) {\n    if(isArrayOrTypedArray(z)) {\n        if(isArrayOrTypedArray(z[0])) {\n            var len = len0;\n            for(var i = 0; i < z.length; i++) {\n                len = fn(len, z[i].length);\n            }\n            return len;\n        } else {\n            return z.length;\n        }\n    }\n    return 0;\n}\n\n},{}],166:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\n// precompile for speed\nvar JUNK = /^['\"%,$#\\s']+|[, ]|['\"%,$#\\s']+$/g;\n\n/**\n * cleanNumber: remove common leading and trailing cruft\n * Always returns either a number or BADNUM.\n */\nmodule.exports = function cleanNumber(v) {\n    if(typeof v === 'string') {\n        v = v.replace(JUNK, '');\n    }\n\n    if(isNumeric(v)) return Number(v);\n\n    return BADNUM;\n};\n\n},{\"../constants/numerical\":158,\"fast-isnumeric\":18}],167:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Clear gl frame (if any). This is a common pattern as\n * we usually set `preserveDrawingBuffer: true` during\n * gl context creation (e.g. via `reglUtils.prepare`).\n *\n * @param {DOM node or object} gd : graph div object\n */\nmodule.exports = function clearGlCanvases(gd) {\n    var fullLayout = gd._fullLayout;\n\n    if(fullLayout._glcanvas && fullLayout._glcanvas.size()) {\n        fullLayout._glcanvas.each(function(d) {\n            if(d.regl) d.regl.clear({color: true, depth: true});\n        });\n    }\n};\n\n},{}],168:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Clear responsive handlers (if any).\n *\n * @param {DOM node or object} gd : graph div object\n */\nmodule.exports = function clearResponsive(gd) {\n    if(gd._responsiveChartHandler) {\n        window.removeEventListener('resize', gd._responsiveChartHandler);\n        delete gd._responsiveChartHandler;\n    }\n};\n\n},{}],169:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar baseTraceAttrs = _dereq_('../plots/attributes');\nvar colorscales = _dereq_('../components/colorscale/scales');\nvar DESELECTDIM = _dereq_('../constants/interactions').DESELECTDIM;\n\nvar nestedProperty = _dereq_('./nested_property');\nvar counterRegex = _dereq_('./regex').counter;\nvar modHalf = _dereq_('./mod').modHalf;\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\n\nexports.valObjectMeta = {\n    data_array: {\n        // You can use *dflt=[] to force said array to exist though.\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt) {\n            // TODO maybe `v: {type: 'float32', vals: [/* ... */]}` also\n            if(isArrayOrTypedArray(v)) propOut.set(v);\n            else if(dflt !== undefined) propOut.set(dflt);\n        }\n    },\n    enumerated: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt, opts) {\n            if(opts.coerceNumber) v = +v;\n            if(opts.values.indexOf(v) === -1) propOut.set(dflt);\n            else propOut.set(v);\n        },\n        validateFunction: function(v, opts) {\n            if(opts.coerceNumber) v = +v;\n\n            var values = opts.values;\n            for(var i = 0; i < values.length; i++) {\n                var k = String(values[i]);\n\n                if((k.charAt(0) === '/' && k.charAt(k.length - 1) === '/')) {\n                    var regex = new RegExp(k.substr(1, k.length - 2));\n                    if(regex.test(v)) return true;\n                } else if(v === values[i]) return true;\n            }\n            return false;\n        }\n    },\n    'boolean': {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt) {\n            if(v === true || v === false) propOut.set(v);\n            else propOut.set(dflt);\n        }\n    },\n    number: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt, opts) {\n            if(!isNumeric(v) ||\n                    (opts.min !== undefined && v < opts.min) ||\n                    (opts.max !== undefined && v > opts.max)) {\n                propOut.set(dflt);\n            } else propOut.set(+v);\n        }\n    },\n    integer: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt, opts) {\n            if(v % 1 || !isNumeric(v) ||\n                    (opts.min !== undefined && v < opts.min) ||\n                    (opts.max !== undefined && v > opts.max)) {\n                propOut.set(dflt);\n            } else propOut.set(+v);\n        }\n    },\n    string: {\n        \n        \n        // TODO 'values shouldn't be in there (edge case: 'dash' in Scatter)\n        \n        coerceFunction: function(v, propOut, dflt, opts) {\n            if(typeof v !== 'string') {\n                var okToCoerce = (typeof v === 'number');\n\n                if(opts.strict === true || !okToCoerce) propOut.set(dflt);\n                else propOut.set(String(v));\n            } else if(opts.noBlank && !v) propOut.set(dflt);\n            else propOut.set(v);\n        }\n    },\n    color: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt) {\n            if(tinycolor(v).isValid()) propOut.set(v);\n            else propOut.set(dflt);\n        }\n    },\n    colorlist: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt) {\n            function isColor(color) {\n                return tinycolor(color).isValid();\n            }\n            if(!Array.isArray(v) || !v.length) propOut.set(dflt);\n            else if(v.every(isColor)) propOut.set(v);\n            else propOut.set(dflt);\n        }\n    },\n    colorscale: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt) {\n            propOut.set(colorscales.get(v, dflt));\n        }\n    },\n    angle: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt) {\n            if(v === 'auto') propOut.set('auto');\n            else if(!isNumeric(v)) propOut.set(dflt);\n            else propOut.set(modHalf(+v, 360));\n        }\n    },\n    subplotid: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt, opts) {\n            var regex = opts.regex || counterRegex(dflt);\n            if(typeof v === 'string' && regex.test(v)) {\n                propOut.set(v);\n                return;\n            }\n            propOut.set(dflt);\n        },\n        validateFunction: function(v, opts) {\n            var dflt = opts.dflt;\n\n            if(v === dflt) return true;\n            if(typeof v !== 'string') return false;\n            if(counterRegex(dflt).test(v)) return true;\n\n            return false;\n        }\n    },\n    flaglist: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt, opts) {\n            if(typeof v !== 'string') {\n                propOut.set(dflt);\n                return;\n            }\n            if((opts.extras || []).indexOf(v) !== -1) {\n                propOut.set(v);\n                return;\n            }\n            var vParts = v.split('+');\n            var i = 0;\n            while(i < vParts.length) {\n                var vi = vParts[i];\n                if(opts.flags.indexOf(vi) === -1 || vParts.indexOf(vi) < i) {\n                    vParts.splice(i, 1);\n                } else i++;\n            }\n            if(!vParts.length) propOut.set(dflt);\n            else propOut.set(vParts.join('+'));\n        }\n    },\n    any: {\n        \n        \n        \n        coerceFunction: function(v, propOut, dflt) {\n            if(v === undefined) propOut.set(dflt);\n            else propOut.set(v);\n        }\n    },\n    info_array: {\n        \n        \n        // set `dimensions=2` for a 2D array or '1-2' for either\n        // `items` may be a single object instead of an array, in which case\n        // `freeLength` must be true.\n        // if `dimensions='1-2'` and items is a 1D array, then the value can\n        // either be a matching 1D array or an array of such matching 1D arrays\n        \n        coerceFunction: function(v, propOut, dflt, opts) {\n            // simplified coerce function just for array items\n            function coercePart(v, opts, dflt) {\n                var out;\n                var propPart = {set: function(v) { out = v; }};\n\n                if(dflt === undefined) dflt = opts.dflt;\n\n                exports.valObjectMeta[opts.valType].coerceFunction(v, propPart, dflt, opts);\n\n                return out;\n            }\n\n            var twoD = opts.dimensions === 2 || (opts.dimensions === '1-2' && Array.isArray(v) && Array.isArray(v[0]));\n\n            if(!Array.isArray(v)) {\n                propOut.set(dflt);\n                return;\n            }\n\n            var items = opts.items;\n            var vOut = [];\n            var arrayItems = Array.isArray(items);\n            var arrayItems2D = arrayItems && twoD && Array.isArray(items[0]);\n            var innerItemsOnly = twoD && arrayItems && !arrayItems2D;\n            var len = (arrayItems && !innerItemsOnly) ? items.length : v.length;\n\n            var i, j, row, item, len2, vNew;\n\n            dflt = Array.isArray(dflt) ? dflt : [];\n\n            if(twoD) {\n                for(i = 0; i < len; i++) {\n                    vOut[i] = [];\n                    row = Array.isArray(v[i]) ? v[i] : [];\n                    if(innerItemsOnly) len2 = items.length;\n                    else if(arrayItems) len2 = items[i].length;\n                    else len2 = row.length;\n\n                    for(j = 0; j < len2; j++) {\n                        if(innerItemsOnly) item = items[j];\n                        else if(arrayItems) item = items[i][j];\n                        else item = items;\n\n                        vNew = coercePart(row[j], item, (dflt[i] || [])[j]);\n                        if(vNew !== undefined) vOut[i][j] = vNew;\n                    }\n                }\n            } else {\n                for(i = 0; i < len; i++) {\n                    vNew = coercePart(v[i], arrayItems ? items[i] : items, dflt[i]);\n                    if(vNew !== undefined) vOut[i] = vNew;\n                }\n            }\n\n            propOut.set(vOut);\n        },\n        validateFunction: function(v, opts) {\n            if(!Array.isArray(v)) return false;\n\n            var items = opts.items;\n            var arrayItems = Array.isArray(items);\n            var twoD = opts.dimensions === 2;\n\n            // when free length is off, input and declared lengths must match\n            if(!opts.freeLength && v.length !== items.length) return false;\n\n            // valid when all input items are valid\n            for(var i = 0; i < v.length; i++) {\n                if(twoD) {\n                    if(!Array.isArray(v[i]) || (!opts.freeLength && v[i].length !== items[i].length)) {\n                        return false;\n                    }\n                    for(var j = 0; j < v[i].length; j++) {\n                        if(!validate(v[i][j], arrayItems ? items[i][j] : items)) {\n                            return false;\n                        }\n                    }\n                } else if(!validate(v[i], arrayItems ? items[i] : items)) return false;\n            }\n\n            return true;\n        }\n    }\n};\n\n/**\n * Ensures that container[attribute] has a valid value.\n *\n * attributes[attribute] is an object with possible keys:\n * - valType: data_array, enumerated, boolean, ... as in valObjectMeta\n * - values: (enumerated only) array of allowed vals\n * - min, max: (number, integer only) inclusive bounds on allowed vals\n *      either or both may be omitted\n * - dflt: if attribute is invalid or missing, use this default\n *      if dflt is provided as an argument to lib.coerce it takes precedence\n *      as a convenience, returns the value it finally set\n */\nexports.coerce = function(containerIn, containerOut, attributes, attribute, dflt) {\n    return _coerce(containerIn, containerOut, attributes, attribute, dflt).val;\n};\n\nfunction _coerce(containerIn, containerOut, attributes, attribute, dflt, opts) {\n    var shouldValidate = (opts || {}).shouldValidate;\n\n    var attr = nestedProperty(attributes, attribute).get();\n    if(dflt === undefined) dflt = attr.dflt;\n    var src = false;\n\n    var propIn = nestedProperty(containerIn, attribute);\n    var propOut = nestedProperty(containerOut, attribute);\n    var valIn = propIn.get();\n\n    var template = containerOut._template;\n    if(valIn === undefined && template) {\n        valIn = nestedProperty(template, attribute).get();\n        src = (valIn !== undefined);\n\n        // already used the template value, so short-circuit the second check\n        template = 0;\n    }\n\n    /**\n     * arrayOk: value MAY be an array, then we do no value checking\n     * at this point, because it can be more complicated than the\n     * individual form (eg. some array vals can be numbers, even if the\n     * single values must be color strings)\n     */\n    if(attr.arrayOk && isArrayOrTypedArray(valIn)) {\n        propOut.set(valIn);\n        return {\n            inp: valIn,\n            val: valIn,\n            src: true\n        };\n    }\n\n    var coerceFunction = exports.valObjectMeta[attr.valType].coerceFunction;\n    coerceFunction(valIn, propOut, dflt, attr);\n\n    var valOut = propOut.get();\n    src = (valOut !== undefined) && shouldValidate && validate(valIn, attr);\n\n    // in case v was provided but invalid, try the template again so it still\n    // overrides the regular default\n    if(template && valOut === dflt && !validate(valIn, attr)) {\n        valIn = nestedProperty(template, attribute).get();\n        coerceFunction(valIn, propOut, dflt, attr);\n        valOut = propOut.get();\n\n        src = (valOut !== undefined) && shouldValidate && validate(valIn, attr);\n    }\n\n    return {\n        inp: valIn,\n        val: valOut,\n        src: src\n    };\n}\n\n/**\n * Variation on coerce\n * useful when setting an attribute to a valid value\n * can change the default for another attribute.\n *\n * Uses coerce to get attribute value if user input is valid,\n * returns attribute default if user input it not valid or\n * returns false if there is no user input.\n */\nexports.coerce2 = function(containerIn, containerOut, attributes, attribute, dflt) {\n    var out = _coerce(containerIn, containerOut, attributes, attribute, dflt, {\n        shouldValidate: true\n    });\n    return (out.src && out.inp !== undefined) ? out.val : false;\n};\n\n/*\n * Shortcut to coerce the three font attributes\n *\n * 'coerce' is a lib.coerce wrapper with implied first three arguments\n */\nexports.coerceFont = function(coerce, attr, dfltObj) {\n    var out = {};\n\n    dfltObj = dfltObj || {};\n\n    out.family = coerce(attr + '.family', dfltObj.family);\n    out.size = coerce(attr + '.size', dfltObj.size);\n    out.color = coerce(attr + '.color', dfltObj.color);\n\n    return out;\n};\n\n/** Coerce shortcut for 'hoverinfo'\n * handling 1-vs-multi-trace dflt logic\n *\n * @param {object} traceIn : user trace object\n * @param {object} traceOut : full trace object (requires _module ref)\n * @param {object} layoutOut : full layout object (require _dataLength ref)\n * @return {any} : the coerced value\n */\nexports.coerceHoverinfo = function(traceIn, traceOut, layoutOut) {\n    var moduleAttrs = traceOut._module.attributes;\n    var attrs = moduleAttrs.hoverinfo ? moduleAttrs : baseTraceAttrs;\n\n    var valObj = attrs.hoverinfo;\n    var dflt;\n\n    if(layoutOut._dataLength === 1) {\n        var flags = valObj.dflt === 'all' ?\n            valObj.flags.slice() :\n            valObj.dflt.split('+');\n\n        flags.splice(flags.indexOf('name'), 1);\n        dflt = flags.join('+');\n    }\n\n    return exports.coerce(traceIn, traceOut, attrs, 'hoverinfo', dflt);\n};\n\n/** Coerce shortcut for [un]selected.marker.opacity,\n *  which has special default logic, to ensure that it corresponds to the\n *  default selection behavior while allowing to be overtaken by any other\n *  [un]selected attribute.\n *\n *  N.B. This must be called *after* coercing all the other [un]selected attrs,\n *  to give the intended result.\n *\n * @param {object} traceOut : fullData item\n * @param {function} coerce : lib.coerce wrapper with implied first three arguments\n */\nexports.coerceSelectionMarkerOpacity = function(traceOut, coerce) {\n    if(!traceOut.marker) return;\n\n    var mo = traceOut.marker.opacity;\n    // you can still have a `marker` container with no markers if there's text\n    if(mo === undefined) return;\n\n    var smoDflt;\n    var usmoDflt;\n\n    // Don't give [un]selected.marker.opacity a default value if\n    // marker.opacity is an array: handle this during style step.\n    //\n    // Only give [un]selected.marker.opacity a default value if you don't\n    // set any other [un]selected attributes.\n    if(!isArrayOrTypedArray(mo) && !traceOut.selected && !traceOut.unselected) {\n        smoDflt = mo;\n        usmoDflt = DESELECTDIM * mo;\n    }\n\n    coerce('selected.marker.opacity', smoDflt);\n    coerce('unselected.marker.opacity', usmoDflt);\n};\n\nfunction validate(value, opts) {\n    var valObjectDef = exports.valObjectMeta[opts.valType];\n\n    if(opts.arrayOk && isArrayOrTypedArray(value)) return true;\n\n    if(valObjectDef.validateFunction) {\n        return valObjectDef.validateFunction(value, opts);\n    }\n\n    var failed = {};\n    var out = failed;\n    var propMock = { set: function(v) { out = v; } };\n\n    // 'failed' just something mutable that won't be === anything else\n\n    valObjectDef.coerceFunction(value, propMock, failed, opts);\n    return out !== failed;\n}\nexports.validate = validate;\n\n},{\"../components/colorscale/scales\":67,\"../constants/interactions\":157,\"../plots/attributes\":219,\"./array\":165,\"./mod\":185,\"./nested_property\":186,\"./regex\":193,\"fast-isnumeric\":18,\"tinycolor2\":35}],170:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Loggers = _dereq_('./loggers');\nvar mod = _dereq_('./mod').mod;\n\nvar constants = _dereq_('../constants/numerical');\nvar BADNUM = constants.BADNUM;\nvar ONEDAY = constants.ONEDAY;\nvar ONEHOUR = constants.ONEHOUR;\nvar ONEMIN = constants.ONEMIN;\nvar ONESEC = constants.ONESEC;\nvar EPOCHJD = constants.EPOCHJD;\n\nvar Registry = _dereq_('../registry');\n\nvar utcFormat = d3.time.format.utc;\n\nvar DATETIME_REGEXP = /^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\d)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m;\n// special regex for chinese calendars to support yyyy-mmi-dd etc for intercalary months\nvar DATETIME_REGEXP_CN = /^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\di?)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m;\n\n// for 2-digit years, the first year we map them onto\nvar YFIRST = new Date().getFullYear() - 70;\n\nfunction isWorldCalendar(calendar) {\n    return (\n        calendar &&\n        Registry.componentsRegistry.calendars &&\n        typeof calendar === 'string' && calendar !== 'gregorian'\n    );\n}\n\n/*\n * dateTick0: get the canonical tick for this calendar\n *\n * bool sunday is for week ticks, shift it to a Sunday.\n */\nexports.dateTick0 = function(calendar, sunday) {\n    if(isWorldCalendar(calendar)) {\n        return sunday ?\n            Registry.getComponentMethod('calendars', 'CANONICAL_SUNDAY')[calendar] :\n            Registry.getComponentMethod('calendars', 'CANONICAL_TICK')[calendar];\n    } else {\n        return sunday ? '2000-01-02' : '2000-01-01';\n    }\n};\n\n/*\n * dfltRange: for each calendar, give a valid default range\n */\nexports.dfltRange = function(calendar) {\n    if(isWorldCalendar(calendar)) {\n        return Registry.getComponentMethod('calendars', 'DFLTRANGE')[calendar];\n    } else {\n        return ['2000-01-01', '2001-01-01'];\n    }\n};\n\n// is an object a javascript date?\nexports.isJSDate = function(v) {\n    return typeof v === 'object' && v !== null && typeof v.getTime === 'function';\n};\n\n// The absolute limits of our date-time system\n// This is a little weird: we use MIN_MS and MAX_MS in dateTime2ms\n// but we use dateTime2ms to calculate them (after defining it!)\nvar MIN_MS, MAX_MS;\n\n/**\n * dateTime2ms - turn a date object or string s into milliseconds\n * (relative to 1970-01-01, per javascript standard)\n * optional calendar (string) to use a non-gregorian calendar\n *\n * Returns BADNUM if it doesn't find a date\n *\n * strings should have the form:\n *\n *    -?YYYY-mm-dd<sep>HH:MM:SS.sss<tzInfo>?\n *\n * <sep>: space (our normal standard) or T or t (ISO-8601)\n * <tzInfo>: Z, z, or [+\\-]HH:?MM and we THROW IT AWAY\n * this format comes from https://tools.ietf.org/html/rfc3339#section-5.6\n * but we allow it even with a space as the separator\n *\n * May truncate after any full field, and sss can be any length\n * even >3 digits, though javascript dates truncate to milliseconds,\n * we keep as much as javascript numeric precision can hold, but we only\n * report back up to 100 microsecond precision, because most dates support\n * this precision (close to 1970 support more, very far away support less)\n *\n * Expanded to support negative years to -9999 but you must always\n * give 4 digits, except for 2-digit positive years which we assume are\n * near the present time.\n * Note that we follow ISO 8601:2004: there *is* a year 0, which\n * is 1BC/BCE, and -1===2BC etc.\n *\n * World calendars: not all of these *have* agreed extensions to this full range,\n * if you have another calendar system but want a date range outside its validity,\n * you can use a gregorian date string prefixed with 'G' or 'g'.\n *\n * Where to cut off 2-digit years between 1900s and 2000s?\n * from http://support.microsoft.com/kb/244664:\n *   1930-2029 (the most retro of all...)\n * but in my mac chrome from eg. d=new Date(Date.parse('8/19/50')):\n *   1950-2049\n * by Java, from http://stackoverflow.com/questions/2024273/:\n *   now-80 - now+19\n * or FileMaker Pro, from\n *      http://www.filemaker.com/12help/html/add_view_data.4.21.html:\n *   now-70 - now+29\n * but python strptime etc, via\n *      http://docs.python.org/py3k/library/time.html:\n *   1969-2068 (super forward-looking, but static, not sliding!)\n *\n * lets go with now-70 to now+29, and if anyone runs into this problem\n * they can learn the hard way not to use 2-digit years, as no choice we\n * make now will cover all possibilities. mostly this will all be taken\n * care of in initial parsing, should only be an issue for hand-entered data\n * currently (2016) this range is:\n *   1946-2045\n */\nexports.dateTime2ms = function(s, calendar) {\n    // first check if s is a date object\n    if(exports.isJSDate(s)) {\n        // Convert to the UTC milliseconds that give the same\n        // hours as this date has in the local timezone\n        var tzOffset = s.getTimezoneOffset() * ONEMIN;\n        var offsetTweak = (s.getUTCMinutes() - s.getMinutes()) * ONEMIN +\n            (s.getUTCSeconds() - s.getSeconds()) * ONESEC +\n            (s.getUTCMilliseconds() - s.getMilliseconds());\n\n        if(offsetTweak) {\n            var comb = 3 * ONEMIN;\n            tzOffset = tzOffset - comb / 2 + mod(offsetTweak - tzOffset + comb / 2, comb);\n        }\n        s = Number(s) - tzOffset;\n        if(s >= MIN_MS && s <= MAX_MS) return s;\n        return BADNUM;\n    }\n    // otherwise only accept strings and numbers\n    if(typeof s !== 'string' && typeof s !== 'number') return BADNUM;\n\n    s = String(s);\n\n    var isWorld = isWorldCalendar(calendar);\n\n    // to handle out-of-range dates in international calendars, accept\n    // 'G' as a prefix to force the built-in gregorian calendar.\n    var s0 = s.charAt(0);\n    if(isWorld && (s0 === 'G' || s0 === 'g')) {\n        s = s.substr(1);\n        calendar = '';\n    }\n\n    var isChinese = isWorld && calendar.substr(0, 7) === 'chinese';\n\n    var match = s.match(isChinese ? DATETIME_REGEXP_CN : DATETIME_REGEXP);\n    if(!match) return BADNUM;\n    var y = match[1];\n    var m = match[3] || '1';\n    var d = Number(match[5] || 1);\n    var H = Number(match[7] || 0);\n    var M = Number(match[9] || 0);\n    var S = Number(match[11] || 0);\n\n    if(isWorld) {\n        // disallow 2-digit years for world calendars\n        if(y.length === 2) return BADNUM;\n        y = Number(y);\n\n        var cDate;\n        try {\n            var calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar);\n            if(isChinese) {\n                var isIntercalary = m.charAt(m.length - 1) === 'i';\n                m = parseInt(m, 10);\n                cDate = calInstance.newDate(y, calInstance.toMonthIndex(y, m, isIntercalary), d);\n            } else {\n                cDate = calInstance.newDate(y, Number(m), d);\n            }\n        } catch(e) { return BADNUM; } // Invalid ... date\n\n        if(!cDate) return BADNUM;\n\n        return ((cDate.toJD() - EPOCHJD) * ONEDAY) +\n            (H * ONEHOUR) + (M * ONEMIN) + (S * ONESEC);\n    }\n\n    if(y.length === 2) {\n        y = (Number(y) + 2000 - YFIRST) % 100 + YFIRST;\n    } else y = Number(y);\n\n    // new Date uses months from 0; subtract 1 here just so we\n    // don't have to do it again during the validity test below\n    m -= 1;\n\n    // javascript takes new Date(0..99,m,d) to mean 1900-1999, so\n    // to support years 0-99 we need to use setFullYear explicitly\n    // Note that 2000 is a leap year.\n    var date = new Date(Date.UTC(2000, m, d, H, M));\n    date.setUTCFullYear(y);\n\n    if(date.getUTCMonth() !== m) return BADNUM;\n    if(date.getUTCDate() !== d) return BADNUM;\n\n    return date.getTime() + S * ONESEC;\n};\n\nMIN_MS = exports.MIN_MS = exports.dateTime2ms('-9999');\nMAX_MS = exports.MAX_MS = exports.dateTime2ms('9999-12-31 23:59:59.9999');\n\n// is string s a date? (see above)\nexports.isDateTime = function(s, calendar) {\n    return (exports.dateTime2ms(s, calendar) !== BADNUM);\n};\n\n// pad a number with zeroes, to given # of digits before the decimal point\nfunction lpad(val, digits) {\n    return String(val + Math.pow(10, digits)).substr(1);\n}\n\n/**\n * Turn ms into string of the form YYYY-mm-dd HH:MM:SS.ssss\n * Crop any trailing zeros in time, except never stop right after hours\n * (we could choose to crop '-01' from date too but for now we always\n * show the whole date)\n * Optional range r is the data range that applies, also in ms.\n * If rng is big, the later parts of time will be omitted\n */\nvar NINETYDAYS = 90 * ONEDAY;\nvar THREEHOURS = 3 * ONEHOUR;\nvar FIVEMIN = 5 * ONEMIN;\nexports.ms2DateTime = function(ms, r, calendar) {\n    if(typeof ms !== 'number' || !(ms >= MIN_MS && ms <= MAX_MS)) return BADNUM;\n\n    if(!r) r = 0;\n\n    var msecTenths = Math.floor(mod(ms + 0.05, 1) * 10);\n    var msRounded = Math.round(ms - msecTenths / 10);\n    var dateStr, h, m, s, msec10, d;\n\n    if(isWorldCalendar(calendar)) {\n        var dateJD = Math.floor(msRounded / ONEDAY) + EPOCHJD;\n        var timeMs = Math.floor(mod(ms, ONEDAY));\n        try {\n            dateStr = Registry.getComponentMethod('calendars', 'getCal')(calendar)\n                .fromJD(dateJD).formatDate('yyyy-mm-dd');\n        } catch(e) {\n            // invalid date in this calendar - fall back to Gyyyy-mm-dd\n            dateStr = utcFormat('G%Y-%m-%d')(new Date(msRounded));\n        }\n\n        // yyyy does NOT guarantee 4-digit years. YYYY mostly does, but does\n        // other things for a few calendars, so we can't trust it. Just pad\n        // it manually (after the '-' if there is one)\n        if(dateStr.charAt(0) === '-') {\n            while(dateStr.length < 11) dateStr = '-0' + dateStr.substr(1);\n        } else {\n            while(dateStr.length < 10) dateStr = '0' + dateStr;\n        }\n\n        // TODO: if this is faster, we could use this block for extracting\n        // the time components of regular gregorian too\n        h = (r < NINETYDAYS) ? Math.floor(timeMs / ONEHOUR) : 0;\n        m = (r < NINETYDAYS) ? Math.floor((timeMs % ONEHOUR) / ONEMIN) : 0;\n        s = (r < THREEHOURS) ? Math.floor((timeMs % ONEMIN) / ONESEC) : 0;\n        msec10 = (r < FIVEMIN) ? (timeMs % ONESEC) * 10 + msecTenths : 0;\n    } else {\n        d = new Date(msRounded);\n\n        dateStr = utcFormat('%Y-%m-%d')(d);\n\n        // <90 days: add hours and minutes - never *only* add hours\n        h = (r < NINETYDAYS) ? d.getUTCHours() : 0;\n        m = (r < NINETYDAYS) ? d.getUTCMinutes() : 0;\n        // <3 hours: add seconds\n        s = (r < THREEHOURS) ? d.getUTCSeconds() : 0;\n        // <5 minutes: add ms (plus one extra digit, this is msec*10)\n        msec10 = (r < FIVEMIN) ? d.getUTCMilliseconds() * 10 + msecTenths : 0;\n    }\n\n    return includeTime(dateStr, h, m, s, msec10);\n};\n\n// For converting old-style milliseconds to date strings,\n// we use the local timezone rather than UTC like we use\n// everywhere else, both for backward compatibility and\n// because that's how people mostly use javasript date objects.\n// Clip one extra day off our date range though so we can't get\n// thrown beyond the range by the timezone shift.\nexports.ms2DateTimeLocal = function(ms) {\n    if(!(ms >= MIN_MS + ONEDAY && ms <= MAX_MS - ONEDAY)) return BADNUM;\n\n    var msecTenths = Math.floor(mod(ms + 0.05, 1) * 10);\n    var d = new Date(Math.round(ms - msecTenths / 10));\n    var dateStr = d3.time.format('%Y-%m-%d')(d);\n    var h = d.getHours();\n    var m = d.getMinutes();\n    var s = d.getSeconds();\n    var msec10 = d.getUTCMilliseconds() * 10 + msecTenths;\n\n    return includeTime(dateStr, h, m, s, msec10);\n};\n\nfunction includeTime(dateStr, h, m, s, msec10) {\n    // include each part that has nonzero data in or after it\n    if(h || m || s || msec10) {\n        dateStr += ' ' + lpad(h, 2) + ':' + lpad(m, 2);\n        if(s || msec10) {\n            dateStr += ':' + lpad(s, 2);\n            if(msec10) {\n                var digits = 4;\n                while(msec10 % 10 === 0) {\n                    digits -= 1;\n                    msec10 /= 10;\n                }\n                dateStr += '.' + lpad(msec10, digits);\n            }\n        }\n    }\n    return dateStr;\n}\n\n// normalize date format to date string, in case it starts as\n// a Date object or milliseconds\n// optional dflt is the return value if cleaning fails\nexports.cleanDate = function(v, dflt, calendar) {\n    // let us use cleanDate to provide a missing default without an error\n    if(v === BADNUM) return dflt;\n    if(exports.isJSDate(v) || (typeof v === 'number' && isFinite(v))) {\n        // do not allow milliseconds (old) or jsdate objects (inherently\n        // described as gregorian dates) with world calendars\n        if(isWorldCalendar(calendar)) {\n            Loggers.error('JS Dates and milliseconds are incompatible with world calendars', v);\n            return dflt;\n        }\n\n        // NOTE: if someone puts in a year as a number rather than a string,\n        // this will mistakenly convert it thinking it's milliseconds from 1970\n        // that is: '2012' -> Jan. 1, 2012, but 2012 -> 2012 epoch milliseconds\n        v = exports.ms2DateTimeLocal(+v);\n        if(!v && dflt !== undefined) return dflt;\n    } else if(!exports.isDateTime(v, calendar)) {\n        Loggers.error('unrecognized date', v);\n        return dflt;\n    }\n    return v;\n};\n\n/*\n *  Date formatting for ticks and hovertext\n */\n\n/*\n * modDateFormat: Support world calendars, and add one item to\n * d3's vocabulary:\n * %{n}f where n is the max number of digits of fractional seconds\n */\nvar fracMatch = /%\\d?f/g;\nfunction modDateFormat(fmt, x, formatter, calendar) {\n    fmt = fmt.replace(fracMatch, function(match) {\n        var digits = Math.min(+(match.charAt(1)) || 6, 6);\n        var fracSecs = ((x / 1000 % 1) + 2)\n            .toFixed(digits)\n            .substr(2).replace(/0+$/, '') || '0';\n        return fracSecs;\n    });\n\n    var d = new Date(Math.floor(x + 0.05));\n\n    if(isWorldCalendar(calendar)) {\n        try {\n            fmt = Registry.getComponentMethod('calendars', 'worldCalFmt')(fmt, x, calendar);\n        } catch(e) {\n            return 'Invalid';\n        }\n    }\n    return formatter(fmt)(d);\n}\n\n/*\n * formatTime: create a time string from:\n *   x: milliseconds\n *   tr: tickround ('M', 'S', or # digits)\n * only supports UTC times (where every day is 24 hours and 0 is at midnight)\n */\nvar MAXSECONDS = [59, 59.9, 59.99, 59.999, 59.9999];\nfunction formatTime(x, tr) {\n    var timePart = mod(x + 0.05, ONEDAY);\n\n    var timeStr = lpad(Math.floor(timePart / ONEHOUR), 2) + ':' +\n        lpad(mod(Math.floor(timePart / ONEMIN), 60), 2);\n\n    if(tr !== 'M') {\n        if(!isNumeric(tr)) tr = 0; // should only be 'S'\n\n        /*\n         * this is a weird one - and shouldn't come up unless people\n         * monkey with tick0 in weird ways, but we need to do something!\n         * IN PARTICULAR we had better not display garbage (see below)\n         * for numbers we always round to the nearest increment of the\n         * precision we're showing, and this seems like the right way to\n         * handle seconds and milliseconds, as they have a decimal point\n         * and people will interpret that to mean rounding like numbers.\n         * but for larger increments we floor the value: it's always\n         * 2013 until the ball drops on the new year. We could argue about\n         * which field it is where we start rounding (should 12:08:59\n         * round to 12:09 if we're stopping at minutes?) but for now I'll\n         * say we round seconds but floor everything else. BUT that means\n         * we need to never round up to 60 seconds, ie 23:59:60\n         */\n        var sec = Math.min(mod(x / ONESEC, 60), MAXSECONDS[tr]);\n\n        var secStr = (100 + sec).toFixed(tr).substr(1);\n        if(tr > 0) {\n            secStr = secStr.replace(/0+$/, '').replace(/[\\.]$/, '');\n        }\n\n        timeStr += ':' + secStr;\n    }\n    return timeStr;\n}\n\n/*\n * formatDate: turn a date into tick or hover label text.\n *\n *   x: milliseconds, the value to convert\n *   fmt: optional, an explicit format string (d3 format, even for world calendars)\n *   tr: tickround ('y', 'm', 'd', 'M', 'S', or # digits)\n *      used if no explicit fmt is provided\n *   formatter: locale-aware d3 date formatter for standard gregorian calendars\n *      should be the result of exports.getD3DateFormat(gd)\n *   calendar: optional string, the world calendar system to use\n *\n * returns the date/time as a string, potentially with the leading portion\n * on a separate line (after '\\n')\n * Note that this means if you provide an explicit format which includes '\\n'\n * the axis may choose to strip things after it when they don't change from\n * one tick to the next (as it does with automatic formatting)\n */\nexports.formatDate = function(x, fmt, tr, formatter, calendar, extraFormat) {\n    calendar = isWorldCalendar(calendar) && calendar;\n\n    if(!fmt) {\n        if(tr === 'y') fmt = extraFormat.year;\n        else if(tr === 'm') fmt = extraFormat.month;\n        else if(tr === 'd') {\n            fmt = extraFormat.dayMonth + '\\n' + extraFormat.year;\n        } else {\n            return formatTime(x, tr) + '\\n' + modDateFormat(extraFormat.dayMonthYear, x, formatter, calendar);\n        }\n    }\n\n    return modDateFormat(fmt, x, formatter, calendar);\n};\n\n/*\n * incrementMonth: make a new milliseconds value from the given one,\n * having changed the month\n *\n * special case for world calendars: multiples of 12 are treated as years,\n * even for calendar systems that don't have (always or ever) 12 months/year\n * TODO: perhaps we need a different code for year increments to support this?\n *\n * ms (number): the initial millisecond value\n * dMonth (int): the (signed) number of months to shift\n * calendar (string): the calendar system to use\n *\n * changing month does not (and CANNOT) always preserve day, since\n * months have different lengths. The worst example of this is:\n *   d = new Date(1970,0,31); d.setMonth(1) -> Feb 31 turns into Mar 3\n *\n * But we want to be able to iterate over the last day of each month,\n * regardless of what its number is.\n * So shift 3 days forward, THEN set the new month, then unshift:\n *   1/31 -> 2/28 (or 29) -> 3/31 -> 4/30 -> ...\n *\n * Note that odd behavior still exists if you start from the 26th-28th:\n *   1/28 -> 2/28 -> 3/31\n * but at least you can't shift any dates into the wrong month,\n * and ticks on these days incrementing by month would be very unusual\n */\nvar THREEDAYS = 3 * ONEDAY;\nexports.incrementMonth = function(ms, dMonth, calendar) {\n    calendar = isWorldCalendar(calendar) && calendar;\n\n    // pull time out and operate on pure dates, then add time back at the end\n    // this gives maximum precision - not that we *normally* care if we're\n    // incrementing by month, but better to be safe!\n    var timeMs = mod(ms, ONEDAY);\n    ms = Math.round(ms - timeMs);\n\n    if(calendar) {\n        try {\n            var dateJD = Math.round(ms / ONEDAY) + EPOCHJD;\n            var calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar);\n            var cDate = calInstance.fromJD(dateJD);\n\n            if(dMonth % 12) calInstance.add(cDate, dMonth, 'm');\n            else calInstance.add(cDate, dMonth / 12, 'y');\n\n            return (cDate.toJD() - EPOCHJD) * ONEDAY + timeMs;\n        } catch(e) {\n            Loggers.error('invalid ms ' + ms + ' in calendar ' + calendar);\n            // then keep going in gregorian even though the result will be 'Invalid'\n        }\n    }\n\n    var y = new Date(ms + THREEDAYS);\n    return y.setUTCMonth(y.getUTCMonth() + dMonth) + timeMs - THREEDAYS;\n};\n\n/*\n * findExactDates: what fraction of data is exact days, months, or years?\n *\n * data: array of millisecond values\n * calendar (string) the calendar to test against\n */\nexports.findExactDates = function(data, calendar) {\n    var exactYears = 0;\n    var exactMonths = 0;\n    var exactDays = 0;\n    var blankCount = 0;\n    var d;\n    var di;\n\n    var calInstance = (\n        isWorldCalendar(calendar) &&\n        Registry.getComponentMethod('calendars', 'getCal')(calendar)\n    );\n\n    for(var i = 0; i < data.length; i++) {\n        di = data[i];\n\n        // not date data at all\n        if(!isNumeric(di)) {\n            blankCount ++;\n            continue;\n        }\n\n        // not an exact date\n        if(di % ONEDAY) continue;\n\n        if(calInstance) {\n            try {\n                d = calInstance.fromJD(di / ONEDAY + EPOCHJD);\n                if(d.day() === 1) {\n                    if(d.month() === 1) exactYears++;\n                    else exactMonths++;\n                } else exactDays++;\n            } catch(e) {\n                // invalid date in this calendar - ignore it here.\n            }\n        } else {\n            d = new Date(di);\n            if(d.getUTCDate() === 1) {\n                if(d.getUTCMonth() === 0) exactYears++;\n                else exactMonths++;\n            } else exactDays++;\n        }\n    }\n    exactMonths += exactYears;\n    exactDays += exactMonths;\n\n    var dataCount = data.length - blankCount;\n\n    return {\n        exactYears: exactYears / dataCount,\n        exactMonths: exactMonths / dataCount,\n        exactDays: exactDays / dataCount\n    };\n};\n\n},{\"../constants/numerical\":158,\"../registry\":269,\"./loggers\":182,\"./mod\":185,\"d3\":16,\"fast-isnumeric\":18}],171:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar loggers = _dereq_('./loggers');\n\n/**\n * Allow referencing a graph DOM element either directly\n * or by its id string\n *\n * @param {HTMLDivElement|string} gd: a graph element or its id\n *\n * @returns {HTMLDivElement} the DOM element of the graph\n */\nfunction getGraphDiv(gd) {\n    var gdElement;\n\n    if(typeof gd === 'string') {\n        gdElement = document.getElementById(gd);\n\n        if(gdElement === null) {\n            throw new Error('No DOM element with id \\'' + gd + '\\' exists on the page.');\n        }\n\n        return gdElement;\n    } else if(gd === null || gd === undefined) {\n        throw new Error('DOM element provided is null or undefined');\n    }\n\n    // otherwise assume that gd is a DOM element\n    return gd;\n}\n\nfunction isPlotDiv(el) {\n    var el3 = d3.select(el);\n    return el3.node() instanceof HTMLElement &&\n        el3.size() &&\n        el3.classed('js-plotly-plot');\n}\n\nfunction removeElement(el) {\n    var elParent = el && el.parentNode;\n    if(elParent) elParent.removeChild(el);\n}\n\n/**\n * for dynamically adding style rules\n * makes one stylesheet that contains all rules added\n * by all calls to this function\n */\nfunction addStyleRule(selector, styleString) {\n    addRelatedStyleRule('global', selector, styleString);\n}\n\n/**\n * for dynamically adding style rules\n * to a stylesheet uniquely identified by a uid\n */\nfunction addRelatedStyleRule(uid, selector, styleString) {\n    var id = 'plotly.js-style-' + uid;\n    var style = document.getElementById(id);\n    if(!style) {\n        style = document.createElement('style');\n        style.setAttribute('id', id);\n        // WebKit hack :(\n        style.appendChild(document.createTextNode(''));\n        document.head.appendChild(style);\n    }\n    var styleSheet = style.sheet;\n\n    if(styleSheet.insertRule) {\n        styleSheet.insertRule(selector + '{' + styleString + '}', 0);\n    } else if(styleSheet.addRule) {\n        styleSheet.addRule(selector, styleString, 0);\n    } else loggers.warn('addStyleRule failed');\n}\n\n/**\n * to remove from the page a stylesheet identified by a given uid\n */\nfunction deleteRelatedStyleRule(uid) {\n    var id = 'plotly.js-style-' + uid;\n    var style = document.getElementById(id);\n    if(style) removeElement(style);\n}\n\nmodule.exports = {\n    getGraphDiv: getGraphDiv,\n    isPlotDiv: isPlotDiv,\n    removeElement: removeElement,\n    addStyleRule: addStyleRule,\n    addRelatedStyleRule: addRelatedStyleRule,\n    deleteRelatedStyleRule: deleteRelatedStyleRule\n};\n\n},{\"./loggers\":182,\"d3\":16}],172:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/* global jQuery:false */\n\nvar EventEmitter = _dereq_('events').EventEmitter;\n\nvar Events = {\n\n    init: function(plotObj) {\n        /*\n         * If we have already instantiated an emitter for this plot\n         * return early.\n         */\n        if(plotObj._ev instanceof EventEmitter) return plotObj;\n\n        var ev = new EventEmitter();\n        var internalEv = new EventEmitter();\n\n        /*\n         * Assign to plot._ev while we still live in a land\n         * where plot is a DOM element with stuff attached to it.\n         * In the future we can make plot the event emitter itself.\n         */\n        plotObj._ev = ev;\n\n        /*\n         * Create a second event handler that will manage events *internally*.\n         * This allows parts of plotly to respond to thing like relayout without\n         * having to use the user-facing event handler. They cannot peacefully\n         * coexist on the same handler because a user invoking\n         * plotObj.removeAllListeners() would detach internal events, breaking\n         * plotly.\n         */\n        plotObj._internalEv = internalEv;\n\n        /*\n         * Assign bound methods from the ev to the plot object. These methods\n         * will reference the 'this' of plot._ev even though they are methods\n         * of plot. This will keep the event machinery away from the plot object\n         * which currently is often a DOM element but presents an API that will\n         * continue to function when plot becomes an emitter. Not all EventEmitter\n         * methods have been bound to `plot` as some do not currently add value to\n         * the Plotly event API.\n         */\n        plotObj.on = ev.on.bind(ev);\n        plotObj.once = ev.once.bind(ev);\n        plotObj.removeListener = ev.removeListener.bind(ev);\n        plotObj.removeAllListeners = ev.removeAllListeners.bind(ev);\n\n        /*\n         * Create functions for managing internal events. These are *only* triggered\n         * by the mirroring of external events via the emit function.\n         */\n        plotObj._internalOn = internalEv.on.bind(internalEv);\n        plotObj._internalOnce = internalEv.once.bind(internalEv);\n        plotObj._removeInternalListener = internalEv.removeListener.bind(internalEv);\n        plotObj._removeAllInternalListeners = internalEv.removeAllListeners.bind(internalEv);\n\n        /*\n         * We must wrap emit to continue to support JQuery events. The idea\n         * is to check to see if the user is using JQuery events, if they are\n         * we emit JQuery events to trigger user handlers as well as the EventEmitter\n         * events.\n         */\n        plotObj.emit = function(event, data) {\n            if(typeof jQuery !== 'undefined') {\n                jQuery(plotObj).trigger(event, data);\n            }\n\n            ev.emit(event, data);\n            internalEv.emit(event, data);\n        };\n\n        return plotObj;\n    },\n\n    /*\n     * This function behaves like jQuery's triggerHandler. It calls\n     * all handlers for a particular event and returns the return value\n     * of the LAST handler. This function also triggers jQuery's\n     * triggerHandler for backwards compatibility.\n     */\n    triggerHandler: function(plotObj, event, data) {\n        var jQueryHandlerValue;\n        var nodeEventHandlerValue;\n\n        /*\n         * If jQuery exists run all its handlers for this event and\n         * collect the return value of the LAST handler function\n         */\n        if(typeof jQuery !== 'undefined') {\n            jQueryHandlerValue = jQuery(plotObj).triggerHandler(event, data);\n        }\n\n        /*\n         * Now run all the node style event handlers\n         */\n        var ev = plotObj._ev;\n        if(!ev) return jQueryHandlerValue;\n\n        var handlers = ev._events[event];\n        if(!handlers) return jQueryHandlerValue;\n\n        // making sure 'this' is the EventEmitter instance\n        function apply(handler) {\n            // The 'once' case, we can't just call handler() as we need\n            // the return value here. So,\n            // - remove handler\n            // - call listener and grab return value!\n            // - stash 'fired' key to not call handler twice\n            if(handler.listener) {\n                ev.removeListener(event, handler.listener);\n                if(!handler.fired) {\n                    handler.fired = true;\n                    return handler.listener.apply(ev, [data]);\n                }\n            } else {\n                return handler.apply(ev, [data]);\n            }\n        }\n\n        // handlers can be function or an array of functions\n        handlers = Array.isArray(handlers) ? handlers : [handlers];\n\n        var i;\n        for(i = 0; i < handlers.length - 1; i++) {\n            apply(handlers[i]);\n        }\n        // now call the final handler and collect its value\n        nodeEventHandlerValue = apply(handlers[i]);\n\n        /*\n         * Return either the jQuery handler value if it exists or the\n         * nodeEventHandler value. jQuery event value supersedes nodejs\n         * events for backwards compatibility reasons.\n         */\n        return jQueryHandlerValue !== undefined ?\n            jQueryHandlerValue :\n            nodeEventHandlerValue;\n    },\n\n    purge: function(plotObj) {\n        delete plotObj._ev;\n        delete plotObj.on;\n        delete plotObj.once;\n        delete plotObj.removeListener;\n        delete plotObj.removeAllListeners;\n        delete plotObj.emit;\n\n        delete plotObj._ev;\n        delete plotObj._internalEv;\n        delete plotObj._internalOn;\n        delete plotObj._internalOnce;\n        delete plotObj._removeInternalListener;\n        delete plotObj._removeAllInternalListeners;\n\n        return plotObj;\n    }\n\n};\n\nmodule.exports = Events;\n\n},{\"events\":15}],173:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isPlainObject = _dereq_('./is_plain_object.js');\nvar isArray = Array.isArray;\n\nfunction primitivesLoopSplice(source, target) {\n    var i, value;\n    for(i = 0; i < source.length; i++) {\n        value = source[i];\n        if(value !== null && typeof(value) === 'object') {\n            return false;\n        }\n        if(value !== void(0)) {\n            target[i] = value;\n        }\n    }\n    return true;\n}\n\nexports.extendFlat = function() {\n    return _extend(arguments, false, false, false);\n};\n\nexports.extendDeep = function() {\n    return _extend(arguments, true, false, false);\n};\n\nexports.extendDeepAll = function() {\n    return _extend(arguments, true, true, false);\n};\n\nexports.extendDeepNoArrays = function() {\n    return _extend(arguments, true, false, true);\n};\n\n/*\n * Inspired by https://github.com/justmoon/node-extend/blob/master/index.js\n * All credit to the jQuery authors for perfecting this amazing utility.\n *\n * API difference with jQuery version:\n * - No optional boolean (true -> deep extend) first argument,\n *   use `extendFlat` for first-level only extend and\n *   use `extendDeep` for a deep extend.\n *\n * Other differences with jQuery version:\n * - Uses a modern (and faster) isPlainObject routine.\n * - Expected to work with object {} and array [] arguments only.\n * - Does not check for circular structure.\n *   FYI: jQuery only does a check across one level.\n *   Warning: this might result in infinite loops.\n *\n */\nfunction _extend(inputs, isDeep, keepAllKeys, noArrayCopies) {\n    var target = inputs[0];\n    var length = inputs.length;\n\n    var input, key, src, copy, copyIsArray, clone, allPrimitives;\n\n    // TODO does this do the right thing for typed arrays?\n\n    if(length === 2 && isArray(target) && isArray(inputs[1]) && target.length === 0) {\n        allPrimitives = primitivesLoopSplice(inputs[1], target);\n\n        if(allPrimitives) {\n            return target;\n        } else {\n            target.splice(0, target.length); // reset target and continue to next block\n        }\n    }\n\n    for(var i = 1; i < length; i++) {\n        input = inputs[i];\n\n        for(key in input) {\n            src = target[key];\n            copy = input[key];\n\n            if(noArrayCopies && isArray(copy)) {\n                // Stop early and just transfer the array if array copies are disallowed:\n\n                target[key] = copy;\n            } else if(isDeep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n                // recurse if we're merging plain objects or arrays\n\n                if(copyIsArray) {\n                    copyIsArray = false;\n                    clone = src && isArray(src) ? src : [];\n                } else {\n                    clone = src && isPlainObject(src) ? src : {};\n                }\n\n                // never move original objects, clone them\n                target[key] = _extend([clone, copy], isDeep, keepAllKeys, noArrayCopies);\n            } else if(typeof copy !== 'undefined' || keepAllKeys) {\n                // don't bring in undefined values, except for extendDeepAll\n\n                target[key] = copy;\n            }\n        }\n    }\n\n    return target;\n}\n\n},{\"./is_plain_object.js\":179}],174:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n/**\n * Return news array containing only the unique items\n * found in input array.\n *\n * IMPORTANT: Note that items are considered unique\n * if `String({})` is unique. For example;\n *\n *  Lib.filterUnique([ { a: 1 }, { b: 2 } ])\n *\n *  returns [{ a: 1 }]\n *\n * and\n *\n *  Lib.filterUnique([ '1', 1 ])\n *\n *  returns ['1']\n *\n *\n * @param {array} array base array\n * @return {array} new filtered array\n */\nmodule.exports = function filterUnique(array) {\n    var seen = {};\n    var out = [];\n    var j = 0;\n\n    for(var i = 0; i < array.length; i++) {\n        var item = array[i];\n\n        if(seen[item] !== 1) {\n            seen[item] = 1;\n            out[j++] = item;\n        }\n    }\n\n    return out;\n};\n\n},{}],175:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/** Filter out object items with visible !== true\n *  insider array container.\n *\n *  @param {array of objects} container\n *  @return {array of objects} of length <= container\n *\n */\nmodule.exports = function filterVisible(container) {\n    var filterFn = isCalcData(container) ? calcDataFilter : baseFilter;\n    var out = [];\n\n    for(var i = 0; i < container.length; i++) {\n        var item = container[i];\n        if(filterFn(item)) out.push(item);\n    }\n\n    return out;\n};\n\nfunction baseFilter(item) {\n    return item.visible === true;\n}\n\nfunction calcDataFilter(item) {\n    var trace = item[0].trace;\n    return trace.visible === true && trace._length !== 0;\n}\n\nfunction isCalcData(cont) {\n    return (\n        Array.isArray(cont) &&\n        Array.isArray(cont[0]) &&\n        cont[0][0] &&\n        cont[0][0].trace\n    );\n}\n\n},{}],176:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar mod = _dereq_('./mod').mod;\n\n/*\n * look for intersection of two line segments\n *   (1->2 and 3->4) - returns array [x,y] if they do, null if not\n */\nexports.segmentsIntersect = segmentsIntersect;\nfunction segmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n    var a = x2 - x1;\n    var b = x3 - x1;\n    var c = x4 - x3;\n    var d = y2 - y1;\n    var e = y3 - y1;\n    var f = y4 - y3;\n    var det = a * f - c * d;\n    // parallel lines? intersection is undefined\n    // ignore the case where they are colinear\n    if(det === 0) return null;\n    var t = (b * f - c * e) / det;\n    var u = (b * d - a * e) / det;\n    // segments do not intersect?\n    if(u < 0 || u > 1 || t < 0 || t > 1) return null;\n\n    return {x: x1 + a * t, y: y1 + d * t};\n}\n\n/*\n * find the minimum distance between two line segments (1->2 and 3->4)\n */\nexports.segmentDistance = function segmentDistance(x1, y1, x2, y2, x3, y3, x4, y4) {\n    if(segmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4)) return 0;\n\n    // the two segments and their lengths squared\n    var x12 = x2 - x1;\n    var y12 = y2 - y1;\n    var x34 = x4 - x3;\n    var y34 = y4 - y3;\n    var ll12 = x12 * x12 + y12 * y12;\n    var ll34 = x34 * x34 + y34 * y34;\n\n    // calculate distance squared, then take the sqrt at the very end\n    var dist2 = Math.min(\n        perpDistance2(x12, y12, ll12, x3 - x1, y3 - y1),\n        perpDistance2(x12, y12, ll12, x4 - x1, y4 - y1),\n        perpDistance2(x34, y34, ll34, x1 - x3, y1 - y3),\n        perpDistance2(x34, y34, ll34, x2 - x3, y2 - y3)\n    );\n\n    return Math.sqrt(dist2);\n};\n\n/*\n * distance squared from segment ab to point c\n * [xab, yab] is the vector b-a\n * [xac, yac] is the vector c-a\n * llab is the length squared of (b-a), just to simplify calculation\n */\nfunction perpDistance2(xab, yab, llab, xac, yac) {\n    var fcAB = (xac * xab + yac * yab);\n    if(fcAB < 0) {\n        // point c is closer to point a\n        return xac * xac + yac * yac;\n    } else if(fcAB > llab) {\n        // point c is closer to point b\n        var xbc = xac - xab;\n        var ybc = yac - yab;\n        return xbc * xbc + ybc * ybc;\n    } else {\n        // perpendicular distance is the shortest\n        var crossProduct = xac * yab - yac * xab;\n        return crossProduct * crossProduct / llab;\n    }\n}\n\n// a very short-term cache for getTextLocation, just because\n// we're often looping over the same locations multiple times\n// invalidated as soon as we look at a different path\nvar locationCache, workingPath, workingTextWidth;\n\n// turn a path and position along it into x, y, and angle for the given text\nexports.getTextLocation = function getTextLocation(path, totalPathLen, positionOnPath, textWidth) {\n    if(path !== workingPath || textWidth !== workingTextWidth) {\n        locationCache = {};\n        workingPath = path;\n        workingTextWidth = textWidth;\n    }\n    if(locationCache[positionOnPath]) {\n        return locationCache[positionOnPath];\n    }\n\n    // for the angle, use points on the path separated by the text width\n    // even though due to curvature, the text will cover a bit more than that\n    var p0 = path.getPointAtLength(mod(positionOnPath - textWidth / 2, totalPathLen));\n    var p1 = path.getPointAtLength(mod(positionOnPath + textWidth / 2, totalPathLen));\n    // note: atan handles 1/0 nicely\n    var theta = Math.atan((p1.y - p0.y) / (p1.x - p0.x));\n    // center the text at 2/3 of the center position plus 1/3 the p0/p1 midpoint\n    // that's the average position of this segment, assuming it's roughly quadratic\n    var pCenter = path.getPointAtLength(mod(positionOnPath, totalPathLen));\n    var x = (pCenter.x * 4 + p0.x + p1.x) / 6;\n    var y = (pCenter.y * 4 + p0.y + p1.y) / 6;\n\n    var out = {x: x, y: y, theta: theta};\n    locationCache[positionOnPath] = out;\n    return out;\n};\n\nexports.clearLocationCache = function() {\n    workingPath = null;\n};\n\n/*\n * Find the segment of `path` that's within the visible area\n * given by `bounds` {left, right, top, bottom}, to within a\n * precision of `buffer` px\n *\n * returns: undefined if nothing is visible, else object:\n * {\n *   min: position where the path first enters bounds, or 0 if it\n *        starts within bounds\n *   max: position where the path last exits bounds, or the path length\n *        if it finishes within bounds\n *   len: max - min, ie the length of visible path\n *   total: the total path length - just included so the caller doesn't\n *        need to call path.getTotalLength() again\n *   isClosed: true iff the start and end points of the path are both visible\n *        and are at the same point\n * }\n *\n * Works by starting from either end and repeatedly finding the distance from\n * that point to the plot area, and if it's outside the plot, moving along the\n * path by that distance (because the plot must be at least that far away on\n * the path). Note that if a path enters, exits, and re-enters the plot, we\n * will not capture this behavior.\n */\nexports.getVisibleSegment = function getVisibleSegment(path, bounds, buffer) {\n    var left = bounds.left;\n    var right = bounds.right;\n    var top = bounds.top;\n    var bottom = bounds.bottom;\n\n    var pMin = 0;\n    var pTotal = path.getTotalLength();\n    var pMax = pTotal;\n\n    var pt0, ptTotal;\n\n    function getDistToPlot(len) {\n        var pt = path.getPointAtLength(len);\n\n        // hold on to the start and end points for `closed`\n        if(len === 0) pt0 = pt;\n        else if(len === pTotal) ptTotal = pt;\n\n        var dx = (pt.x < left) ? left - pt.x : (pt.x > right ? pt.x - right : 0);\n        var dy = (pt.y < top) ? top - pt.y : (pt.y > bottom ? pt.y - bottom : 0);\n        return Math.sqrt(dx * dx + dy * dy);\n    }\n\n    var distToPlot = getDistToPlot(pMin);\n    while(distToPlot) {\n        pMin += distToPlot + buffer;\n        if(pMin > pMax) return;\n        distToPlot = getDistToPlot(pMin);\n    }\n\n    distToPlot = getDistToPlot(pMax);\n    while(distToPlot) {\n        pMax -= distToPlot + buffer;\n        if(pMin > pMax) return;\n        distToPlot = getDistToPlot(pMax);\n    }\n\n    return {\n        min: pMin,\n        max: pMax,\n        len: pMax - pMin,\n        total: pTotal,\n        isClosed: pMin === 0 && pMax === pTotal &&\n            Math.abs(pt0.x - ptTotal.x) < 0.1 &&\n            Math.abs(pt0.y - ptTotal.y) < 0.1\n    };\n};\n\n/**\n * Find point on SVG path corresponding to a given constraint coordinate\n *\n * @param {SVGPathElement} path\n * @param {Number} val : constraint coordinate value\n * @param {String} coord : 'x' or 'y' the constraint coordinate\n * @param {Object} opts :\n *  - {Number} pathLength : supply total path length before hand\n *  - {Number} tolerance\n *  - {Number} iterationLimit\n * @return {SVGPoint}\n */\nexports.findPointOnPath = function findPointOnPath(path, val, coord, opts) {\n    opts = opts || {};\n\n    var pathLength = opts.pathLength || path.getTotalLength();\n    var tolerance = opts.tolerance || 1e-3;\n    var iterationLimit = opts.iterationLimit || 30;\n\n    // if path starts at a val greater than the path tail (like on vertical violins),\n    // we must flip the sign of the computed diff.\n    var mul = path.getPointAtLength(0)[coord] > path.getPointAtLength(pathLength)[coord] ? -1 : 1;\n\n    var i = 0;\n    var b0 = 0;\n    var b1 = pathLength;\n    var mid;\n    var pt;\n    var diff;\n\n    while(i < iterationLimit) {\n        mid = (b0 + b1) / 2;\n        pt = path.getPointAtLength(mid);\n        diff = pt[coord] - val;\n\n        if(Math.abs(diff) < tolerance) {\n            return pt;\n        } else {\n            if(mul * diff > 0) {\n                b1 = mid;\n            } else {\n                b0 = mid;\n            }\n            i++;\n        }\n    }\n    return pt;\n};\n\n},{\"./mod\":185}],177:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function identity(d) { return d; };\n\n},{}],178:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar numConstants = _dereq_('../constants/numerical');\nvar FP_SAFE = numConstants.FP_SAFE;\nvar BADNUM = numConstants.BADNUM;\n\nvar lib = module.exports = {};\n\nlib.nestedProperty = _dereq_('./nested_property');\nlib.keyedContainer = _dereq_('./keyed_container');\nlib.relativeAttr = _dereq_('./relative_attr');\nlib.isPlainObject = _dereq_('./is_plain_object');\nlib.toLogRange = _dereq_('./to_log_range');\nlib.relinkPrivateKeys = _dereq_('./relink_private');\n\nvar arrayModule = _dereq_('./array');\nlib.isTypedArray = arrayModule.isTypedArray;\nlib.isArrayOrTypedArray = arrayModule.isArrayOrTypedArray;\nlib.isArray1D = arrayModule.isArray1D;\nlib.ensureArray = arrayModule.ensureArray;\nlib.concat = arrayModule.concat;\nlib.maxRowLength = arrayModule.maxRowLength;\nlib.minRowLength = arrayModule.minRowLength;\n\nvar modModule = _dereq_('./mod');\nlib.mod = modModule.mod;\nlib.modHalf = modModule.modHalf;\n\nvar coerceModule = _dereq_('./coerce');\nlib.valObjectMeta = coerceModule.valObjectMeta;\nlib.coerce = coerceModule.coerce;\nlib.coerce2 = coerceModule.coerce2;\nlib.coerceFont = coerceModule.coerceFont;\nlib.coerceHoverinfo = coerceModule.coerceHoverinfo;\nlib.coerceSelectionMarkerOpacity = coerceModule.coerceSelectionMarkerOpacity;\nlib.validate = coerceModule.validate;\n\nvar datesModule = _dereq_('./dates');\nlib.dateTime2ms = datesModule.dateTime2ms;\nlib.isDateTime = datesModule.isDateTime;\nlib.ms2DateTime = datesModule.ms2DateTime;\nlib.ms2DateTimeLocal = datesModule.ms2DateTimeLocal;\nlib.cleanDate = datesModule.cleanDate;\nlib.isJSDate = datesModule.isJSDate;\nlib.formatDate = datesModule.formatDate;\nlib.incrementMonth = datesModule.incrementMonth;\nlib.dateTick0 = datesModule.dateTick0;\nlib.dfltRange = datesModule.dfltRange;\nlib.findExactDates = datesModule.findExactDates;\nlib.MIN_MS = datesModule.MIN_MS;\nlib.MAX_MS = datesModule.MAX_MS;\n\nvar searchModule = _dereq_('./search');\nlib.findBin = searchModule.findBin;\nlib.sorterAsc = searchModule.sorterAsc;\nlib.sorterDes = searchModule.sorterDes;\nlib.distinctVals = searchModule.distinctVals;\nlib.roundUp = searchModule.roundUp;\nlib.sort = searchModule.sort;\nlib.findIndexOfMin = searchModule.findIndexOfMin;\n\nvar statsModule = _dereq_('./stats');\nlib.aggNums = statsModule.aggNums;\nlib.len = statsModule.len;\nlib.mean = statsModule.mean;\nlib.median = statsModule.median;\nlib.midRange = statsModule.midRange;\nlib.variance = statsModule.variance;\nlib.stdev = statsModule.stdev;\nlib.interp = statsModule.interp;\n\nvar matrixModule = _dereq_('./matrix');\nlib.init2dArray = matrixModule.init2dArray;\nlib.transposeRagged = matrixModule.transposeRagged;\nlib.dot = matrixModule.dot;\nlib.translationMatrix = matrixModule.translationMatrix;\nlib.rotationMatrix = matrixModule.rotationMatrix;\nlib.rotationXYMatrix = matrixModule.rotationXYMatrix;\nlib.apply2DTransform = matrixModule.apply2DTransform;\nlib.apply2DTransform2 = matrixModule.apply2DTransform2;\n\nvar anglesModule = _dereq_('./angles');\nlib.deg2rad = anglesModule.deg2rad;\nlib.rad2deg = anglesModule.rad2deg;\nlib.angleDelta = anglesModule.angleDelta;\nlib.angleDist = anglesModule.angleDist;\nlib.isFullCircle = anglesModule.isFullCircle;\nlib.isAngleInsideSector = anglesModule.isAngleInsideSector;\nlib.isPtInsideSector = anglesModule.isPtInsideSector;\nlib.pathArc = anglesModule.pathArc;\nlib.pathSector = anglesModule.pathSector;\nlib.pathAnnulus = anglesModule.pathAnnulus;\n\nvar anchorUtils = _dereq_('./anchor_utils');\nlib.isLeftAnchor = anchorUtils.isLeftAnchor;\nlib.isCenterAnchor = anchorUtils.isCenterAnchor;\nlib.isRightAnchor = anchorUtils.isRightAnchor;\nlib.isTopAnchor = anchorUtils.isTopAnchor;\nlib.isMiddleAnchor = anchorUtils.isMiddleAnchor;\nlib.isBottomAnchor = anchorUtils.isBottomAnchor;\n\nvar geom2dModule = _dereq_('./geometry2d');\nlib.segmentsIntersect = geom2dModule.segmentsIntersect;\nlib.segmentDistance = geom2dModule.segmentDistance;\nlib.getTextLocation = geom2dModule.getTextLocation;\nlib.clearLocationCache = geom2dModule.clearLocationCache;\nlib.getVisibleSegment = geom2dModule.getVisibleSegment;\nlib.findPointOnPath = geom2dModule.findPointOnPath;\n\nvar extendModule = _dereq_('./extend');\nlib.extendFlat = extendModule.extendFlat;\nlib.extendDeep = extendModule.extendDeep;\nlib.extendDeepAll = extendModule.extendDeepAll;\nlib.extendDeepNoArrays = extendModule.extendDeepNoArrays;\n\nvar loggersModule = _dereq_('./loggers');\nlib.log = loggersModule.log;\nlib.warn = loggersModule.warn;\nlib.error = loggersModule.error;\n\nvar regexModule = _dereq_('./regex');\nlib.counterRegex = regexModule.counter;\n\nvar throttleModule = _dereq_('./throttle');\nlib.throttle = throttleModule.throttle;\nlib.throttleDone = throttleModule.done;\nlib.clearThrottle = throttleModule.clear;\n\nvar domModule = _dereq_('./dom');\nlib.getGraphDiv = domModule.getGraphDiv;\nlib.isPlotDiv = domModule.isPlotDiv;\nlib.removeElement = domModule.removeElement;\nlib.addStyleRule = domModule.addStyleRule;\nlib.addRelatedStyleRule = domModule.addRelatedStyleRule;\nlib.deleteRelatedStyleRule = domModule.deleteRelatedStyleRule;\n\nlib.clearResponsive = _dereq_('./clear_responsive');\n\nlib.makeTraceGroups = _dereq_('./make_trace_groups');\n\nlib._ = _dereq_('./localize');\n\nlib.notifier = _dereq_('./notifier');\n\nlib.filterUnique = _dereq_('./filter_unique');\nlib.filterVisible = _dereq_('./filter_visible');\nlib.pushUnique = _dereq_('./push_unique');\n\nlib.cleanNumber = _dereq_('./clean_number');\n\nlib.ensureNumber = function ensureNumber(v) {\n    if(!isNumeric(v)) return BADNUM;\n    v = Number(v);\n    if(v < -FP_SAFE || v > FP_SAFE) return BADNUM;\n    return isNumeric(v) ? Number(v) : BADNUM;\n};\n\n/**\n * Is v a valid array index? Accepts numeric strings as well as numbers.\n *\n * @param {any} v: the value to test\n * @param {Optional[integer]} len: the array length we are indexing\n *\n * @return {bool}: v is a valid array index\n */\nlib.isIndex = function(v, len) {\n    if(len !== undefined && v >= len) return false;\n    return isNumeric(v) && (v >= 0) && (v % 1 === 0);\n};\n\nlib.noop = _dereq_('./noop');\nlib.identity = _dereq_('./identity');\n\n/**\n * create an array of length 'cnt' filled with 'v' at all indices\n *\n * @param {any} v\n * @param {number} cnt\n * @return {array}\n */\nlib.repeat = function(v, cnt) {\n    var out = new Array(cnt);\n    for(var i = 0; i < cnt; i++) {\n        out[i] = v;\n    }\n    return out;\n};\n\n/**\n * swap x and y of the same attribute in container cont\n * specify attr with a ? in place of x/y\n * you can also swap other things than x/y by providing part1 and part2\n */\nlib.swapAttrs = function(cont, attrList, part1, part2) {\n    if(!part1) part1 = 'x';\n    if(!part2) part2 = 'y';\n    for(var i = 0; i < attrList.length; i++) {\n        var attr = attrList[i];\n        var xp = lib.nestedProperty(cont, attr.replace('?', part1));\n        var yp = lib.nestedProperty(cont, attr.replace('?', part2));\n        var temp = xp.get();\n        xp.set(yp.get());\n        yp.set(temp);\n    }\n};\n\n/**\n * SVG painter's algo worked around with reinsertion\n */\nlib.raiseToTop = function raiseToTop(elem) {\n    elem.parentNode.appendChild(elem);\n};\n\n/**\n * cancel a possibly pending transition; returned selection may be used by caller\n */\nlib.cancelTransition = function(selection) {\n    return selection.transition().duration(0);\n};\n\n// constrain - restrict a number v to be between v0 and v1\nlib.constrain = function(v, v0, v1) {\n    if(v0 > v1) return Math.max(v1, Math.min(v0, v));\n    return Math.max(v0, Math.min(v1, v));\n};\n\n/**\n * do two bounding boxes from getBoundingClientRect,\n * ie {left,right,top,bottom,width,height}, overlap?\n * takes optional padding pixels\n */\nlib.bBoxIntersect = function(a, b, pad) {\n    pad = pad || 0;\n    return (a.left <= b.right + pad &&\n            b.left <= a.right + pad &&\n            a.top <= b.bottom + pad &&\n            b.top <= a.bottom + pad);\n};\n\n/*\n * simpleMap: alternative to Array.map that only\n * passes on the element and up to 2 extra args you\n * provide (but not the array index or the whole array)\n *\n * array: the array to map it to\n * func: the function to apply\n * x1, x2: optional extra args\n */\nlib.simpleMap = function(array, func, x1, x2, opts) {\n    var len = array.length;\n    var out = new Array(len);\n    for(var i = 0; i < len; i++) out[i] = func(array[i], x1, x2, opts);\n    return out;\n};\n\n/**\n * Random string generator\n *\n * @param {object} existing\n *     pass in strings to avoid as keys with truthy values\n * @param {int} bits\n *     bits of information in the output string, default 24\n * @param {int} base\n *     base of string representation, default 16. Should be a power of 2.\n */\nlib.randstr = function randstr(existing, bits, base, _recursion) {\n    if(!base) base = 16;\n    if(bits === undefined) bits = 24;\n    if(bits <= 0) return '0';\n\n    var digits = Math.log(Math.pow(2, bits)) / Math.log(base);\n    var res = '';\n    var i, b, x;\n\n    for(i = 2; digits === Infinity; i *= 2) {\n        digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;\n    }\n\n    var rem = digits - Math.floor(digits);\n\n    for(i = 0; i < Math.floor(digits); i++) {\n        x = Math.floor(Math.random() * base).toString(base);\n        res = x + res;\n    }\n\n    if(rem) {\n        b = Math.pow(base, rem);\n        x = Math.floor(Math.random() * b).toString(base);\n        res = x + res;\n    }\n\n    var parsed = parseInt(res, base);\n    if((existing && existing[res]) ||\n         (parsed !== Infinity && parsed >= Math.pow(2, bits))) {\n        if(_recursion > 10) {\n            lib.warn('randstr failed uniqueness');\n            return res;\n        }\n        return randstr(existing, bits, base, (_recursion || 0) + 1);\n    } else return res;\n};\n\nlib.OptionControl = function(opt, optname) {\n    /*\n     * An environment to contain all option setters and\n     * getters that collectively modify opts.\n     *\n     * You can call up opts from any function in new object\n     * as this.optname || this.opt\n     *\n     * See FitOpts for example of usage\n     */\n    if(!opt) opt = {};\n    if(!optname) optname = 'opt';\n\n    var self = {};\n    self.optionList = [];\n\n    self._newoption = function(optObj) {\n        optObj[optname] = opt;\n        self[optObj.name] = optObj;\n        self.optionList.push(optObj);\n    };\n\n    self['_' + optname] = opt;\n    return self;\n};\n\n/**\n * lib.smooth: smooth arrayIn by convolving with\n * a hann window with given full width at half max\n * bounce the ends in, so the output has the same length as the input\n */\nlib.smooth = function(arrayIn, FWHM) {\n    FWHM = Math.round(FWHM) || 0; // only makes sense for integers\n    if(FWHM < 2) return arrayIn;\n\n    var alen = arrayIn.length;\n    var alen2 = 2 * alen;\n    var wlen = 2 * FWHM - 1;\n    var w = new Array(wlen);\n    var arrayOut = new Array(alen);\n    var i;\n    var j;\n    var k;\n    var v;\n\n    // first make the window array\n    for(i = 0; i < wlen; i++) {\n        w[i] = (1 - Math.cos(Math.PI * (i + 1) / FWHM)) / (2 * FWHM);\n    }\n\n    // now do the convolution\n    for(i = 0; i < alen; i++) {\n        v = 0;\n        for(j = 0; j < wlen; j++) {\n            k = i + j + 1 - FWHM;\n\n            // multibounce\n            if(k < -alen) k -= alen2 * Math.round(k / alen2);\n            else if(k >= alen2) k -= alen2 * Math.floor(k / alen2);\n\n            // single bounce\n            if(k < 0) k = - 1 - k;\n            else if(k >= alen) k = alen2 - 1 - k;\n\n            v += arrayIn[k] * w[j];\n        }\n        arrayOut[i] = v;\n    }\n\n    return arrayOut;\n};\n\n/**\n * syncOrAsync: run a sequence of functions synchronously\n * as long as its returns are not promises (ie have no .then)\n * includes one argument arg to send to all functions...\n * this is mainly just to prevent us having to make wrapper functions\n * when the only purpose of the wrapper is to reference gd\n * and a final step to be executed at the end\n * TODO: if there's an error and everything is sync,\n * this doesn't happen yet because we want to make sure\n * that it gets reported\n */\nlib.syncOrAsync = function(sequence, arg, finalStep) {\n    var ret, fni;\n\n    function continueAsync() {\n        return lib.syncOrAsync(sequence, arg, finalStep);\n    }\n\n    while(sequence.length) {\n        fni = sequence.splice(0, 1)[0];\n        ret = fni(arg);\n\n        if(ret && ret.then) {\n            return ret.then(continueAsync)\n                .then(undefined, lib.promiseError);\n        }\n    }\n\n    return finalStep && finalStep(arg);\n};\n\n\n/**\n * Helper to strip trailing slash, from\n * http://stackoverflow.com/questions/6680825/return-string-without-trailing-slash\n */\nlib.stripTrailingSlash = function(str) {\n    if(str.substr(-1) === '/') return str.substr(0, str.length - 1);\n    return str;\n};\n\nlib.noneOrAll = function(containerIn, containerOut, attrList) {\n    /**\n     * some attributes come together, so if you have one of them\n     * in the input, you should copy the default values of the others\n     * to the input as well.\n     */\n    if(!containerIn) return;\n\n    var hasAny = false;\n    var hasAll = true;\n    var i;\n    var val;\n\n    for(i = 0; i < attrList.length; i++) {\n        val = containerIn[attrList[i]];\n        if(val !== undefined && val !== null) hasAny = true;\n        else hasAll = false;\n    }\n\n    if(hasAny && !hasAll) {\n        for(i = 0; i < attrList.length; i++) {\n            containerIn[attrList[i]] = containerOut[attrList[i]];\n        }\n    }\n};\n\n/** merges calcdata field (given by cdAttr) with traceAttr values\n *\n * N.B. Loop over minimum of cd.length and traceAttr.length\n * i.e. it does not try to fill in beyond traceAttr.length-1\n *\n * @param {array} traceAttr : trace attribute\n * @param {object} cd : calcdata trace\n * @param {string} cdAttr : calcdata key\n */\nlib.mergeArray = function(traceAttr, cd, cdAttr, fn) {\n    var hasFn = typeof fn === 'function';\n    if(lib.isArrayOrTypedArray(traceAttr)) {\n        var imax = Math.min(traceAttr.length, cd.length);\n        for(var i = 0; i < imax; i++) {\n            var v = traceAttr[i];\n            cd[i][cdAttr] = hasFn ? fn(v) : v;\n        }\n    }\n};\n\n// cast numbers to positive numbers, returns 0 if not greater than 0\nlib.mergeArrayCastPositive = function(traceAttr, cd, cdAttr) {\n    return lib.mergeArray(traceAttr, cd, cdAttr, function(v) {\n        var w = +v;\n        return !isFinite(w) ? 0 : w > 0 ? w : 0;\n    });\n};\n\n/** fills calcdata field (given by cdAttr) with traceAttr values\n *  or function of traceAttr values (e.g. some fallback)\n *\n * N.B. Loops over all cd items.\n *\n * @param {array} traceAttr : trace attribute\n * @param {object} cd : calcdata trace\n * @param {string} cdAttr : calcdata key\n * @param {function} [fn] : optional function to apply to each array item\n */\nlib.fillArray = function(traceAttr, cd, cdAttr, fn) {\n    fn = fn || lib.identity;\n\n    if(lib.isArrayOrTypedArray(traceAttr)) {\n        for(var i = 0; i < cd.length; i++) {\n            cd[i][cdAttr] = fn(traceAttr[i]);\n        }\n    }\n};\n\n/** Handler for trace-wide vs per-point options\n *\n * @param {object} trace : (full) trace object\n * @param {number} ptNumber : index of the point in question\n * @param {string} astr : attribute string\n * @param {function} [fn] : optional function to apply to each array item\n *\n * @return {any}\n */\nlib.castOption = function(trace, ptNumber, astr, fn) {\n    fn = fn || lib.identity;\n\n    var val = lib.nestedProperty(trace, astr).get();\n\n    if(lib.isArrayOrTypedArray(val)) {\n        if(Array.isArray(ptNumber) && lib.isArrayOrTypedArray(val[ptNumber[0]])) {\n            return fn(val[ptNumber[0]][ptNumber[1]]);\n        } else {\n            return fn(val[ptNumber]);\n        }\n    } else {\n        return val;\n    }\n};\n\n/** Extract option from calcdata item, correctly falling back to\n *  trace value if not found.\n *\n *  @param {object} calcPt : calcdata[i][j] item\n *  @param {object} trace : (full) trace object\n *  @param {string} calcKey : calcdata key\n *  @param {string} traceKey : aka trace attribute string\n *  @return {any}\n */\nlib.extractOption = function(calcPt, trace, calcKey, traceKey) {\n    if(calcKey in calcPt) return calcPt[calcKey];\n\n    // fallback to trace value,\n    //   must check if value isn't itself an array\n    //   which means the trace attribute has a corresponding\n    //   calcdata key, but its value is falsy\n    var traceVal = lib.nestedProperty(trace, traceKey).get();\n    if(!Array.isArray(traceVal)) return traceVal;\n};\n\nfunction makePtIndex2PtNumber(indexToPoints) {\n    var ptIndex2ptNumber = {};\n    for(var k in indexToPoints) {\n        var pts = indexToPoints[k];\n        for(var j = 0; j < pts.length; j++) {\n            ptIndex2ptNumber[pts[j]] = +k;\n        }\n    }\n    return ptIndex2ptNumber;\n}\n\n/** Tag selected calcdata items\n *\n * N.B. note that point 'index' corresponds to input data array index\n *  whereas 'number' is its post-transform version.\n *\n * @param {array} calcTrace\n * @param {object} trace\n *  - selectedpoints {array}\n *  - _indexToPoints {object}\n * @param {ptNumber2cdIndex} ptNumber2cdIndex (optional)\n *  optional map object for trace types that do not have 1-to-1 point number to\n *  calcdata item index correspondence (e.g. histogram)\n */\nlib.tagSelected = function(calcTrace, trace, ptNumber2cdIndex) {\n    var selectedpoints = trace.selectedpoints;\n    var indexToPoints = trace._indexToPoints;\n    var ptIndex2ptNumber;\n\n    // make pt index-to-number map object, which takes care of transformed traces\n    if(indexToPoints) {\n        ptIndex2ptNumber = makePtIndex2PtNumber(indexToPoints);\n    }\n\n    function isCdIndexValid(v) {\n        return v !== undefined && v < calcTrace.length;\n    }\n\n    for(var i = 0; i < selectedpoints.length; i++) {\n        var ptIndex = selectedpoints[i];\n\n        if(lib.isIndex(ptIndex) ||\n           (lib.isArrayOrTypedArray(ptIndex) && lib.isIndex(ptIndex[0]) && lib.isIndex(ptIndex[1]))\n        ) {\n            var ptNumber = ptIndex2ptNumber ? ptIndex2ptNumber[ptIndex] : ptIndex;\n            var cdIndex = ptNumber2cdIndex ? ptNumber2cdIndex[ptNumber] : ptNumber;\n\n            if(isCdIndexValid(cdIndex)) {\n                calcTrace[cdIndex].selected = 1;\n            }\n        }\n    }\n};\n\nlib.selIndices2selPoints = function(trace) {\n    var selectedpoints = trace.selectedpoints;\n    var indexToPoints = trace._indexToPoints;\n\n    if(indexToPoints) {\n        var ptIndex2ptNumber = makePtIndex2PtNumber(indexToPoints);\n        var out = [];\n\n        for(var i = 0; i < selectedpoints.length; i++) {\n            var ptIndex = selectedpoints[i];\n            if(lib.isIndex(ptIndex)) {\n                var ptNumber = ptIndex2ptNumber[ptIndex];\n                if(lib.isIndex(ptNumber)) {\n                    out.push(ptNumber);\n                }\n            }\n        }\n\n        return out;\n    } else {\n        return selectedpoints;\n    }\n};\n\n/** Returns target as set by 'target' transform attribute\n *\n * @param {object} trace : full trace object\n * @param {object} transformOpts : transform option object\n *  - target (string} :\n *      either an attribute string referencing an array in the trace object, or\n *      a set array.\n *\n * @return {array or false} : the target array (NOT a copy!!) or false if invalid\n */\nlib.getTargetArray = function(trace, transformOpts) {\n    var target = transformOpts.target;\n\n    if(typeof target === 'string' && target) {\n        var array = lib.nestedProperty(trace, target).get();\n        return Array.isArray(array) ? array : false;\n    } else if(Array.isArray(target)) {\n        return target;\n    }\n\n    return false;\n};\n\n/**\n * modified version of jQuery's extend to strip out private objs and functions,\n * and cut arrays down to first <arraylen> or 1 elements\n * because extend-like algorithms are hella slow\n * obj2 is assumed to already be clean of these things (including no arrays)\n */\nlib.minExtend = function(obj1, obj2) {\n    var objOut = {};\n    if(typeof obj2 !== 'object') obj2 = {};\n    var arrayLen = 3;\n    var keys = Object.keys(obj1);\n    var i, k, v;\n\n    for(i = 0; i < keys.length; i++) {\n        k = keys[i];\n        v = obj1[k];\n        if(k.charAt(0) === '_' || typeof v === 'function') continue;\n        else if(k === 'module') objOut[k] = v;\n        else if(Array.isArray(v)) {\n            if(k === 'colorscale') {\n                objOut[k] = v.slice();\n            } else {\n                objOut[k] = v.slice(0, arrayLen);\n            }\n        } else if(lib.isTypedArray(v)) {\n            objOut[k] = v.subarray(0, arrayLen);\n        } else if(v && (typeof v === 'object')) objOut[k] = lib.minExtend(obj1[k], obj2[k]);\n        else objOut[k] = v;\n    }\n\n    keys = Object.keys(obj2);\n    for(i = 0; i < keys.length; i++) {\n        k = keys[i];\n        v = obj2[k];\n        if(typeof v !== 'object' || !(k in objOut) || typeof objOut[k] !== 'object') {\n            objOut[k] = v;\n        }\n    }\n\n    return objOut;\n};\n\nlib.titleCase = function(s) {\n    return s.charAt(0).toUpperCase() + s.substr(1);\n};\n\nlib.containsAny = function(s, fragments) {\n    for(var i = 0; i < fragments.length; i++) {\n        if(s.indexOf(fragments[i]) !== -1) return true;\n    }\n    return false;\n};\n\nlib.isIE = function() {\n    return typeof window.navigator.msSaveBlob !== 'undefined';\n};\n\nvar IS_IE9_OR_BELOW_REGEX = /MSIE [1-9]\\./;\nlib.isIE9orBelow = function() {\n    return lib.isIE() && IS_IE9_OR_BELOW_REGEX.test(window.navigator.userAgent);\n};\n\nvar IS_SAFARI_REGEX = /Version\\/[\\d\\.]+.*Safari/;\nlib.isSafari = function() {\n    return IS_SAFARI_REGEX.test(window.navigator.userAgent);\n};\n\n/**\n * Duck typing to recognize a d3 selection, mostly for IE9's benefit\n * because it doesn't handle instanceof like modern browsers\n */\nlib.isD3Selection = function(obj) {\n    return obj && (typeof obj.classed === 'function');\n};\n\n/**\n * Append element to DOM only if not present.\n *\n * @param {d3 selection} parent : parent selection of the element in question\n * @param {string} nodeType : node type of element to append\n * @param {string} className (optional) : class name of element in question\n * @param {fn} enterFn (optional) : optional fn applied to entering elements only\n * @return {d3 selection} selection of new layer\n *\n * Previously, we were using the following pattern:\n *\n * ```\n * var sel = parent.selectAll('.' + className)\n *     .data([0]);\n *\n * sel.enter().append(nodeType)\n *     .classed(className, true);\n *\n * return sel;\n * ```\n *\n * in numerous places in our codebase to achieve the same behavior.\n *\n * The logic below performs much better, mostly as we are using\n * `.select` instead `.selectAll` that is `querySelector` instead of\n * `querySelectorAll`.\n *\n */\nlib.ensureSingle = function(parent, nodeType, className, enterFn) {\n    var sel = parent.select(nodeType + (className ? '.' + className : ''));\n    if(sel.size()) return sel;\n\n    var layer = parent.append(nodeType);\n    if(className) layer.classed(className, true);\n    if(enterFn) layer.call(enterFn);\n\n    return layer;\n};\n\n/**\n * Same as Lib.ensureSingle, but using id as selector.\n * This version is mostly used for clipPath nodes.\n *\n * @param {d3 selection} parent : parent selection of the element in question\n * @param {string} nodeType : node type of element to append\n * @param {string} id : id of element in question\n * @param {fn} enterFn (optional) : optional fn applied to entering elements only\n * @return {d3 selection} selection of new layer\n */\nlib.ensureSingleById = function(parent, nodeType, id, enterFn) {\n    var sel = parent.select(nodeType + '#' + id);\n    if(sel.size()) return sel;\n\n    var layer = parent.append(nodeType).attr('id', id);\n    if(enterFn) layer.call(enterFn);\n\n    return layer;\n};\n\n/**\n * Converts a string path to an object.\n *\n * When given a string containing an array element, it will create a `null`\n * filled array of the given size.\n *\n * @example\n * lib.objectFromPath('nested.test[2].path', 'value');\n * // returns { nested: { test: [null, null, { path: 'value' }]}\n *\n * @param   {string}    path to nested value\n * @param   {*}         any value to be set\n *\n * @return {Object} the constructed object with a full nested path\n */\nlib.objectFromPath = function(path, value) {\n    var keys = path.split('.');\n    var tmpObj;\n    var obj = tmpObj = {};\n\n    for(var i = 0; i < keys.length; i++) {\n        var key = keys[i];\n        var el = null;\n\n        var parts = keys[i].match(/(.*)\\[([0-9]+)\\]/);\n\n        if(parts) {\n            key = parts[1];\n            el = parts[2];\n\n            tmpObj = tmpObj[key] = [];\n\n            if(i === keys.length - 1) {\n                tmpObj[el] = value;\n            } else {\n                tmpObj[el] = {};\n            }\n\n            tmpObj = tmpObj[el];\n        } else {\n            if(i === keys.length - 1) {\n                tmpObj[key] = value;\n            } else {\n                tmpObj[key] = {};\n            }\n\n            tmpObj = tmpObj[key];\n        }\n    }\n\n    return obj;\n};\n\n/**\n * Iterate through an object in-place, converting dotted properties to objects.\n *\n * Examples:\n *\n *   lib.expandObjectPaths({'nested.test.path': 'value'});\n *     => { nested: { test: {path: 'value'}}}\n *\n * It also handles array notation, e.g.:\n *\n *   lib.expandObjectPaths({'foo[1].bar': 'value'});\n *     => { foo: [null, {bar: value}] }\n *\n * It handles merges the results when two properties are specified in parallel:\n *\n *   lib.expandObjectPaths({'foo[1].bar': 10, 'foo[0].bar': 20});\n *     => { foo: [{bar: 10}, {bar: 20}] }\n *\n * It does NOT, however, merge mulitple mutliply-nested arrays::\n *\n *   lib.expandObjectPaths({'marker[1].range[1]': 5, 'marker[1].range[0]': 4})\n *     => { marker: [null, {range: 4}] }\n */\n\n// Store this to avoid recompiling regex on *every* prop since this may happen many\n// many times for animations. Could maybe be inside the function. Not sure about\n// scoping vs. recompilation tradeoff, but at least it's not just inlining it into\n// the inner loop.\nvar dottedPropertyRegex = /^([^\\[\\.]+)\\.(.+)?/;\nvar indexedPropertyRegex = /^([^\\.]+)\\[([0-9]+)\\](\\.)?(.+)?/;\n\nlib.expandObjectPaths = function(data) {\n    var match, key, prop, datum, idx, dest, trailingPath;\n    if(typeof data === 'object' && !Array.isArray(data)) {\n        for(key in data) {\n            if(data.hasOwnProperty(key)) {\n                if((match = key.match(dottedPropertyRegex))) {\n                    datum = data[key];\n                    prop = match[1];\n\n                    delete data[key];\n\n                    data[prop] = lib.extendDeepNoArrays(data[prop] || {}, lib.objectFromPath(key, lib.expandObjectPaths(datum))[prop]);\n                } else if((match = key.match(indexedPropertyRegex))) {\n                    datum = data[key];\n\n                    prop = match[1];\n                    idx = parseInt(match[2]);\n\n                    delete data[key];\n\n                    data[prop] = data[prop] || [];\n\n                    if(match[3] === '.') {\n                        // This is the case where theere are subsequent properties into which\n                        // we must recurse, e.g. transforms[0].value\n                        trailingPath = match[4];\n                        dest = data[prop][idx] = data[prop][idx] || {};\n\n                        // NB: Extend deep no arrays prevents this from working on multiple\n                        // nested properties in the same object, e.g.\n                        //\n                        // {\n                        //   foo[0].bar[1].range\n                        //   foo[0].bar[0].range\n                        // }\n                        //\n                        // In this case, the extendDeepNoArrays will overwrite one array with\n                        // the other, so that both properties *will not* be present in the\n                        // result. Fixing this would require a more intelligent tracking\n                        // of changes and merging than extendDeepNoArrays currently accomplishes.\n                        lib.extendDeepNoArrays(dest, lib.objectFromPath(trailingPath, lib.expandObjectPaths(datum)));\n                    } else {\n                        // This is the case where this property is the end of the line,\n                        // e.g. xaxis.range[0]\n                        data[prop][idx] = lib.expandObjectPaths(datum);\n                    }\n                } else {\n                    data[key] = lib.expandObjectPaths(data[key]);\n                }\n            }\n        }\n    }\n\n    return data;\n};\n\n/**\n * Converts value to string separated by the provided separators.\n *\n * @example\n * lib.numSeparate(2016, '.,');\n * // returns '2016'\n *\n * @example\n * lib.numSeparate(3000, '.,', true);\n * // returns '3,000'\n *\n * @example\n * lib.numSeparate(1234.56, '|,')\n * // returns '1,234|56'\n *\n * @param   {string|number} value       the value to be converted\n * @param   {string}    separators  string of decimal, then thousands separators\n * @param   {boolean}    separatethousands  boolean, 4-digit integers are separated if true\n *\n * @return  {string}    the value that has been separated\n */\nlib.numSeparate = function(value, separators, separatethousands) {\n    if(!separatethousands) separatethousands = false;\n\n    if(typeof separators !== 'string' || separators.length === 0) {\n        throw new Error('Separator string required for formatting!');\n    }\n\n    if(typeof value === 'number') {\n        value = String(value);\n    }\n\n    var thousandsRe = /(\\d+)(\\d{3})/;\n    var decimalSep = separators.charAt(0);\n    var thouSep = separators.charAt(1);\n\n    var x = value.split('.');\n    var x1 = x[0];\n    var x2 = x.length > 1 ? decimalSep + x[1] : '';\n\n    // Years are ignored for thousands separators\n    if(thouSep && (x.length > 1 || x1.length > 4 || separatethousands)) {\n        while(thousandsRe.test(x1)) {\n            x1 = x1.replace(thousandsRe, '$1' + thouSep + '$2');\n        }\n    }\n\n    return x1 + x2;\n};\n\nlib.TEMPLATE_STRING_REGEX = /%{([^\\s%{}:]*)([:|\\|][^}]*)?}/g;\nvar SIMPLE_PROPERTY_REGEX = /^\\w*$/;\n\n/**\n * Substitute values from an object into a string\n *\n * Examples:\n *  Lib.templateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'\n *  Lib.templateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'\n *\n * @param {string}  input string containing %{...} template strings\n * @param {obj}     data object containing substitution values\n *\n * @return {string} templated string\n */\nlib.templateString = function(string, obj) {\n    // Not all that useful, but cache nestedProperty instantiation\n    // just in case it speeds things up *slightly*:\n    var getterCache = {};\n\n    return string.replace(lib.TEMPLATE_STRING_REGEX, function(dummy, key) {\n        var v;\n        if(SIMPLE_PROPERTY_REGEX.test(key)) {\n            v = obj[key];\n        } else {\n            getterCache[key] = getterCache[key] || lib.nestedProperty(obj, key).get;\n            v = getterCache[key]();\n        }\n        return lib.isValidTextValue(v) ? v : '';\n    });\n};\n\nvar hovertemplateWarnings = {\n    max: 10,\n    count: 0,\n    name: 'hovertemplate'\n};\nlib.hovertemplateString = function() {\n    return templateFormatString.apply(hovertemplateWarnings, arguments);\n};\n\nvar texttemplateWarnings = {\n    max: 10,\n    count: 0,\n    name: 'texttemplate'\n};\nlib.texttemplateString = function() {\n    return templateFormatString.apply(texttemplateWarnings, arguments);\n};\n\nvar TEMPLATE_STRING_FORMAT_SEPARATOR = /^[:|\\|]/;\n/**\n * Substitute values from an object into a string and optionally formats them using d3-format,\n * or fallback to associated labels.\n *\n * Examples:\n *  Lib.hovertemplateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'\n *  Lib.hovertemplateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'\n *  Lib.hovertemplateString('price: %{y:$.2f}', {y: 1}) --> 'price: $1.00'\n *\n * @param {string}  input string containing %{...:...} template strings\n * @param {obj}     data object containing fallback text when no formatting is specified, ex.: {yLabel: 'formattedYValue'}\n * @param {obj}     d3 locale\n * @param {obj}     data objects containing substitution values\n *\n * @return {string} templated string\n */\nfunction templateFormatString(string, labels, d3locale) {\n    var opts = this;\n    var args = arguments;\n    if(!labels) labels = {};\n    // Not all that useful, but cache nestedProperty instantiation\n    // just in case it speeds things up *slightly*:\n    var getterCache = {};\n\n    return string.replace(lib.TEMPLATE_STRING_REGEX, function(match, key, format) {\n        var obj, value, i;\n        for(i = 3; i < args.length; i++) {\n            obj = args[i];\n            if(!obj) continue;\n            if(obj.hasOwnProperty(key)) {\n                value = obj[key];\n                break;\n            }\n\n            if(!SIMPLE_PROPERTY_REGEX.test(key)) {\n                value = getterCache[key] || lib.nestedProperty(obj, key).get();\n                if(value) getterCache[key] = value;\n            }\n            if(value !== undefined) break;\n        }\n\n        if(value === undefined && opts) {\n            if(opts.count < opts.max) {\n                lib.warn('Variable \\'' + key + '\\' in ' + opts.name + ' could not be found!');\n                value = match;\n            }\n\n            if(opts.count === opts.max) {\n                lib.warn('Too many ' + opts.name + ' warnings - additional warnings will be suppressed');\n            }\n            opts.count++;\n\n            return match;\n        }\n\n        if(format) {\n            var fmt;\n            if(format[0] === ':') {\n                fmt = d3locale ? d3locale.numberFormat : d3.format;\n                value = fmt(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);\n            }\n\n            if(format[0] === '|') {\n                fmt = d3locale ? d3locale.timeFormat.utc : d3.time.format.utc;\n                var ms = lib.dateTime2ms(value);\n                value = lib.formatDate(ms, format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''), false, fmt);\n            }\n        } else {\n            if(labels.hasOwnProperty(key + 'Label')) value = labels[key + 'Label'];\n        }\n        return value;\n    });\n}\n\n/*\n * alphanumeric string sort, tailored for subplot IDs like scene2, scene10, x10y13 etc\n */\nvar char0 = 48;\nvar char9 = 57;\nlib.subplotSort = function(a, b) {\n    var l = Math.min(a.length, b.length) + 1;\n    var numA = 0;\n    var numB = 0;\n    for(var i = 0; i < l; i++) {\n        var charA = a.charCodeAt(i) || 0;\n        var charB = b.charCodeAt(i) || 0;\n        var isNumA = charA >= char0 && charA <= char9;\n        var isNumB = charB >= char0 && charB <= char9;\n\n        if(isNumA) numA = 10 * numA + charA - char0;\n        if(isNumB) numB = 10 * numB + charB - char0;\n\n        if(!isNumA || !isNumB) {\n            if(numA !== numB) return numA - numB;\n            if(charA !== charB) return charA - charB;\n        }\n    }\n    return numB - numA;\n};\n\n// repeatable pseudorandom generator\nvar randSeed = 2000000000;\n\nlib.seedPseudoRandom = function() {\n    randSeed = 2000000000;\n};\n\nlib.pseudoRandom = function() {\n    var lastVal = randSeed;\n    randSeed = (69069 * randSeed + 1) % 4294967296;\n    // don't let consecutive vals be too close together\n    // gets away from really trying to be random, in favor of better local uniformity\n    if(Math.abs(randSeed - lastVal) < 429496729) return lib.pseudoRandom();\n    return randSeed / 4294967296;\n};\n\n\n/** Fill hover 'pointData' container with 'correct' hover text value\n *\n * - If trace hoverinfo contains a 'text' flag and hovertext is not set,\n *   the text elements will be seen in the hover labels.\n *\n * - If trace hoverinfo contains a 'text' flag and hovertext is set,\n *   hovertext takes precedence over text\n *   i.e. the hoverinfo elements will be seen in the hover labels\n *\n *  @param {object} calcPt\n *  @param {object} trace\n *  @param {object || array} contOut (mutated here)\n */\nlib.fillText = function(calcPt, trace, contOut) {\n    var fill = Array.isArray(contOut) ?\n        function(v) { contOut.push(v); } :\n        function(v) { contOut.text = v; };\n\n    var htx = lib.extractOption(calcPt, trace, 'htx', 'hovertext');\n    if(lib.isValidTextValue(htx)) return fill(htx);\n\n    var tx = lib.extractOption(calcPt, trace, 'tx', 'text');\n    if(lib.isValidTextValue(tx)) return fill(tx);\n};\n\n// accept all truthy values and 0 (which gets cast to '0' in the hover labels)\nlib.isValidTextValue = function(v) {\n    return v || v === 0;\n};\n\n/**\n * @param {number} ratio\n * @param {number} n (number of decimal places)\n */\nlib.formatPercent = function(ratio, n) {\n    n = n || 0;\n    var str = (Math.round(100 * ratio * Math.pow(10, n)) * Math.pow(0.1, n)).toFixed(n) + '%';\n    for(var i = 0; i < n; i++) {\n        if(str.indexOf('.') !== -1) {\n            str = str.replace('0%', '%');\n            str = str.replace('.%', '%');\n        }\n    }\n    return str;\n};\n\nlib.isHidden = function(gd) {\n    var display = window.getComputedStyle(gd).display;\n    return !display || display === 'none';\n};\n\n/** Return transform text for bar bar-like rectangles and pie-like slices\n *  @param {object} transform\n *  - targetX: desired position on the x-axis\n *  - targetY: desired position on the y-axis\n *  - textX: text middle position on the x-axis\n *  - textY: text middle position on the y-axis\n *  - anchorX: (optional) text anchor position on the x-axis (computed from textX), zero for middle anchor\n *  - anchorY: (optional) text anchor position on the y-axis (computed from textY), zero for middle anchor\n *  - scale: (optional) scale applied after translate\n *  - rotate: (optional) rotation applied after scale\n *  - noCenter: when defined no extra arguments needed in rotation\n */\nlib.getTextTransform = function(transform) {\n    var noCenter = transform.noCenter;\n    var textX = transform.textX;\n    var textY = transform.textY;\n    var targetX = transform.targetX;\n    var targetY = transform.targetY;\n    var anchorX = transform.anchorX || 0;\n    var anchorY = transform.anchorY || 0;\n    var rotate = transform.rotate;\n    var scale = transform.scale;\n    if(!scale) scale = 0;\n    else if(scale > 1) scale = 1;\n\n    return (\n        'translate(' +\n            (targetX - scale * (textX + anchorX)) + ',' +\n            (targetY - scale * (textY + anchorY)) +\n        ')' +\n        (scale < 1 ?\n            'scale(' + scale + ')' : ''\n        ) +\n        (rotate ?\n            'rotate(' + rotate +\n                (noCenter ? '' : ' ' + textX + ' ' + textY) +\n            ')' : ''\n        )\n    );\n};\n\nlib.ensureUniformFontSize = function(gd, baseFont) {\n    var out = lib.extendFlat({}, baseFont);\n    out.size = Math.max(\n        baseFont.size,\n        gd._fullLayout.uniformtext.minsize || 0\n    );\n    return out;\n};\n\n},{\"../constants/numerical\":158,\"./anchor_utils\":163,\"./angles\":164,\"./array\":165,\"./clean_number\":166,\"./clear_responsive\":168,\"./coerce\":169,\"./dates\":170,\"./dom\":171,\"./extend\":173,\"./filter_unique\":174,\"./filter_visible\":175,\"./geometry2d\":176,\"./identity\":177,\"./is_plain_object\":179,\"./keyed_container\":180,\"./localize\":181,\"./loggers\":182,\"./make_trace_groups\":183,\"./matrix\":184,\"./mod\":185,\"./nested_property\":186,\"./noop\":187,\"./notifier\":188,\"./push_unique\":191,\"./regex\":193,\"./relative_attr\":194,\"./relink_private\":195,\"./search\":196,\"./stats\":198,\"./throttle\":200,\"./to_log_range\":201,\"d3\":16,\"fast-isnumeric\":18}],179:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// more info: http://stackoverflow.com/questions/18531624/isplainobject-thing\nmodule.exports = function isPlainObject(obj) {\n    // We need to be a little less strict in the `imagetest` container because\n    // of how async image requests are handled.\n    //\n    // N.B. isPlainObject(new Constructor()) will return true in `imagetest`\n    if(window && window.process && window.process.versions) {\n        return Object.prototype.toString.call(obj) === '[object Object]';\n    }\n\n    return (\n        Object.prototype.toString.call(obj) === '[object Object]' &&\n        Object.getPrototypeOf(obj) === Object.prototype\n    );\n};\n\n},{}],180:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar nestedProperty = _dereq_('./nested_property');\n\nvar SIMPLE_PROPERTY_REGEX = /^\\w*$/;\n\n// bitmask for deciding what's updated. Sometimes the name needs to be updated,\n// sometimes the value needs to be updated, and sometimes both do. This is just\n// a simple way to track what's updated such that it's a simple OR operation to\n// assimilate new updates.\n//\n// The only exception is the UNSET bit that tracks when we need to explicitly\n// unset and remove the property. This concrn arises because of the special\n// way in which nestedProperty handles null/undefined. When you specify `null`,\n// it prunes any unused items in the tree. I ran into some issues with it getting\n// null vs undefined confused, so UNSET is just a bit that forces the property\n// update to send `null`, removing the property explicitly rather than setting\n// it to undefined.\nvar NONE = 0;\nvar NAME = 1;\nvar VALUE = 2;\nvar BOTH = 3;\nvar UNSET = 4;\n\nmodule.exports = function keyedContainer(baseObj, path, keyName, valueName) {\n    keyName = keyName || 'name';\n    valueName = valueName || 'value';\n    var i, arr, baseProp;\n    var changeTypes = {};\n\n    if(path && path.length) {\n        baseProp = nestedProperty(baseObj, path);\n        arr = baseProp.get();\n    } else {\n        arr = baseObj;\n    }\n\n    path = path || '';\n\n    // Construct an index:\n    var indexLookup = {};\n    if(arr) {\n        for(i = 0; i < arr.length; i++) {\n            indexLookup[arr[i][keyName]] = i;\n        }\n    }\n\n    var isSimpleValueProp = SIMPLE_PROPERTY_REGEX.test(valueName);\n\n    var obj = {\n        set: function(name, value) {\n            var changeType = value === null ? UNSET : NONE;\n\n            // create the base array if necessary\n            if(!arr) {\n                if(!baseProp || changeType === UNSET) return;\n\n                arr = [];\n                baseProp.set(arr);\n            }\n\n            var idx = indexLookup[name];\n            if(idx === undefined) {\n                if(changeType === UNSET) return;\n\n                changeType = changeType | BOTH;\n                idx = arr.length;\n                indexLookup[name] = idx;\n            } else if(value !== (isSimpleValueProp ? arr[idx][valueName] : nestedProperty(arr[idx], valueName).get())) {\n                changeType = changeType | VALUE;\n            }\n\n            var newValue = arr[idx] = arr[idx] || {};\n            newValue[keyName] = name;\n\n            if(isSimpleValueProp) {\n                newValue[valueName] = value;\n            } else {\n                nestedProperty(newValue, valueName).set(value);\n            }\n\n            // If it's not an unset, force that bit to be unset. This is all related to the fact\n            // that undefined and null are a bit specially implemented in nestedProperties.\n            if(value !== null) {\n                changeType = changeType & ~UNSET;\n            }\n\n            changeTypes[idx] = changeTypes[idx] | changeType;\n\n            return obj;\n        },\n        get: function(name) {\n            if(!arr) return;\n\n            var idx = indexLookup[name];\n\n            if(idx === undefined) {\n                return undefined;\n            } else if(isSimpleValueProp) {\n                return arr[idx][valueName];\n            } else {\n                return nestedProperty(arr[idx], valueName).get();\n            }\n        },\n        rename: function(name, newName) {\n            var idx = indexLookup[name];\n\n            if(idx === undefined) return obj;\n            changeTypes[idx] = changeTypes[idx] | NAME;\n\n            indexLookup[newName] = idx;\n            delete indexLookup[name];\n\n            arr[idx][keyName] = newName;\n\n            return obj;\n        },\n        remove: function(name) {\n            var idx = indexLookup[name];\n\n            if(idx === undefined) return obj;\n\n            var object = arr[idx];\n            if(Object.keys(object).length > 2) {\n                // This object contains more than just the key/value, so unset\n                // the value without modifying the entry otherwise:\n                changeTypes[idx] = changeTypes[idx] | VALUE;\n                return obj.set(name, null);\n            }\n\n            if(isSimpleValueProp) {\n                for(i = idx; i < arr.length; i++) {\n                    changeTypes[i] = changeTypes[i] | BOTH;\n                }\n                for(i = idx; i < arr.length; i++) {\n                    indexLookup[arr[i][keyName]]--;\n                }\n                arr.splice(idx, 1);\n                delete(indexLookup[name]);\n            } else {\n                // Perform this update *strictly* so we can check whether the result's\n                // been pruned. If so, it's a removal. If not, it's a value unset only.\n                nestedProperty(object, valueName).set(null);\n\n                // Now check if the top level nested property has any keys left. If so,\n                // the object still has values so we only want to unset the key. If not,\n                // the entire object can be removed since there's no other data.\n                // var topLevelKeys = Object.keys(object[valueName.split('.')[0]] || []);\n\n                changeTypes[idx] = changeTypes[idx] | VALUE | UNSET;\n            }\n\n            return obj;\n        },\n        constructUpdate: function() {\n            var astr, idx;\n            var update = {};\n            var changed = Object.keys(changeTypes);\n            for(var i = 0; i < changed.length; i++) {\n                idx = changed[i];\n                astr = path + '[' + idx + ']';\n                if(arr[idx]) {\n                    if(changeTypes[idx] & NAME) {\n                        update[astr + '.' + keyName] = arr[idx][keyName];\n                    }\n                    if(changeTypes[idx] & VALUE) {\n                        if(isSimpleValueProp) {\n                            update[astr + '.' + valueName] = (changeTypes[idx] & UNSET) ? null : arr[idx][valueName];\n                        } else {\n                            update[astr + '.' + valueName] = (changeTypes[idx] & UNSET) ? null : nestedProperty(arr[idx], valueName).get();\n                        }\n                    }\n                } else {\n                    update[astr] = null;\n                }\n            }\n\n            return update;\n        }\n    };\n\n    return obj;\n};\n\n},{\"./nested_property\":186}],181:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\n\n/**\n * localize: translate a string for the current locale\n *\n * @param {object} gd: the graphDiv for context\n *  gd._context.locale determines the language (& optional region/country)\n *  the dictionary for each locale may either be supplied in\n *  gd._context.locales or globally via Plotly.register\n * @param {string} s: the string to translate\n */\nmodule.exports = function localize(gd, s) {\n    var locale = gd._context.locale;\n\n    /*\n     * Priority of lookup:\n     *     contextDicts[locale],\n     *     registeredDicts[locale],\n     *     contextDicts[baseLocale], (if baseLocale is distinct)\n     *     registeredDicts[baseLocale]\n     * Return the first translation we find.\n     * This way if you have a regionalization you are allowed to specify\n     * only what's different from the base locale, everything else will\n     * fall back on the base.\n     */\n    for(var i = 0; i < 2; i++) {\n        var locales = gd._context.locales;\n        for(var j = 0; j < 2; j++) {\n            var dict = (locales[locale] || {}).dictionary;\n            if(dict) {\n                var out = dict[s];\n                if(out) return out;\n            }\n            locales = Registry.localeRegistry;\n        }\n\n        var baseLocale = locale.split('-')[0];\n        if(baseLocale === locale) break;\n        locale = baseLocale;\n    }\n\n    return s;\n};\n\n},{\"../registry\":269}],182:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/* eslint-disable no-console */\n\nvar dfltConfig = _dereq_('../plot_api/plot_config').dfltConfig;\n\nvar notifier = _dereq_('./notifier');\n\nvar loggers = module.exports = {};\n\n/**\n * ------------------------------------------\n * debugging tools\n * ------------------------------------------\n */\n\nloggers.log = function() {\n    var i;\n\n    if(dfltConfig.logging > 1) {\n        var messages = ['LOG:'];\n        for(i = 0; i < arguments.length; i++) {\n            messages.push(arguments[i]);\n        }\n        apply(console.trace || console.log, messages);\n    }\n\n    if(dfltConfig.notifyOnLogging > 1) {\n        var lines = [];\n        for(i = 0; i < arguments.length; i++) {\n            lines.push(arguments[i]);\n        }\n        notifier(lines.join('<br>'), 'long');\n    }\n};\n\nloggers.warn = function() {\n    var i;\n\n    if(dfltConfig.logging > 0) {\n        var messages = ['WARN:'];\n        for(i = 0; i < arguments.length; i++) {\n            messages.push(arguments[i]);\n        }\n        apply(console.trace || console.log, messages);\n    }\n\n    if(dfltConfig.notifyOnLogging > 0) {\n        var lines = [];\n        for(i = 0; i < arguments.length; i++) {\n            lines.push(arguments[i]);\n        }\n        notifier(lines.join('<br>'), 'stick');\n    }\n};\n\nloggers.error = function() {\n    var i;\n\n    if(dfltConfig.logging > 0) {\n        var messages = ['ERROR:'];\n        for(i = 0; i < arguments.length; i++) {\n            messages.push(arguments[i]);\n        }\n        apply(console.error, messages);\n    }\n\n    if(dfltConfig.notifyOnLogging > 0) {\n        var lines = [];\n        for(i = 0; i < arguments.length; i++) {\n            lines.push(arguments[i]);\n        }\n        notifier(lines.join('<br>'), 'stick');\n    }\n};\n\n/*\n * Robust apply, for IE9 where console.log doesn't support\n * apply like other functions do\n */\nfunction apply(f, args) {\n    if(f && f.apply) {\n        try {\n            // `this` should always be console, since here we're always\n            // applying a method of the console object.\n            f.apply(console, args);\n            return;\n        } catch(e) { /* in case apply failed, fall back on the code below */ }\n    }\n\n    // no apply - just try calling the function on each arg independently\n    for(var i = 0; i < args.length; i++) {\n        try {\n            f(args[i]);\n        } catch(e) {\n            // still fails - last resort simple console.log\n            console.log(args[i]);\n        }\n    }\n}\n\n},{\"../plot_api/plot_config\":210,\"./notifier\":188}],183:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\n/**\n * General helper to manage trace groups based on calcdata\n *\n * @param {d3.selection} traceLayer: a selection containing a single group\n *     to draw these traces into\n * @param {array} cdModule: array of calcdata items for this\n *     module and subplot combination. Assumes the calcdata item for each\n *     trace is an array with the fullData trace attached to the first item.\n * @param {string} cls: the class attribute to give each trace group\n *     so you can give multiple classes separated by spaces\n */\nmodule.exports = function makeTraceGroups(traceLayer, cdModule, cls) {\n    var traces = traceLayer.selectAll('g.' + cls.replace(/\\s/g, '.'))\n        .data(cdModule, function(cd) { return cd[0].trace.uid; });\n\n    traces.exit().remove();\n\n    traces.enter().append('g')\n        .attr('class', cls);\n\n    traces.order();\n\n    // stash ref node to trace group in calcdata,\n    // useful for (fast) styleOnSelect\n    var k = traceLayer.classed('rangeplot') ? 'nodeRangePlot3' : 'node3';\n    traces.each(function(cd) { cd[0][k] = d3.select(this); });\n\n    return traces;\n};\n\n},{\"d3\":16}],184:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nexports.init2dArray = function(rowLength, colLength) {\n    var array = new Array(rowLength);\n    for(var i = 0; i < rowLength; i++) array[i] = new Array(colLength);\n    return array;\n};\n\n/**\n * transpose a (possibly ragged) 2d array z. inspired by\n * http://stackoverflow.com/questions/17428587/\n * transposing-a-2d-array-in-javascript\n */\nexports.transposeRagged = function(z) {\n    var maxlen = 0;\n    var zlen = z.length;\n    var i, j;\n    // Maximum row length:\n    for(i = 0; i < zlen; i++) maxlen = Math.max(maxlen, z[i].length);\n\n    var t = new Array(maxlen);\n    for(i = 0; i < maxlen; i++) {\n        t[i] = new Array(zlen);\n        for(j = 0; j < zlen; j++) t[i][j] = z[j][i];\n    }\n\n    return t;\n};\n\n// our own dot function so that we don't need to include numeric\nexports.dot = function(x, y) {\n    if(!(x.length && y.length) || x.length !== y.length) return null;\n\n    var len = x.length;\n    var out;\n    var i;\n\n    if(x[0].length) {\n        // mat-vec or mat-mat\n        out = new Array(len);\n        for(i = 0; i < len; i++) out[i] = exports.dot(x[i], y);\n    } else if(y[0].length) {\n        // vec-mat\n        var yTranspose = exports.transposeRagged(y);\n        out = new Array(yTranspose.length);\n        for(i = 0; i < yTranspose.length; i++) out[i] = exports.dot(x, yTranspose[i]);\n    } else {\n        // vec-vec\n        out = 0;\n        for(i = 0; i < len; i++) out += x[i] * y[i];\n    }\n\n    return out;\n};\n\n// translate by (x,y)\nexports.translationMatrix = function(x, y) {\n    return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n};\n\n// rotate by alpha around (0,0)\nexports.rotationMatrix = function(alpha) {\n    var a = alpha * Math.PI / 180;\n    return [[Math.cos(a), -Math.sin(a), 0],\n            [Math.sin(a), Math.cos(a), 0],\n            [0, 0, 1]];\n};\n\n// rotate by alpha around (x,y)\nexports.rotationXYMatrix = function(a, x, y) {\n    return exports.dot(\n        exports.dot(exports.translationMatrix(x, y),\n                    exports.rotationMatrix(a)),\n        exports.translationMatrix(-x, -y));\n};\n\n// applies a 2D transformation matrix to either x and y params or an [x,y] array\nexports.apply2DTransform = function(transform) {\n    return function() {\n        var args = arguments;\n        if(args.length === 3) {\n            args = args[0];\n        }// from map\n        var xy = arguments.length === 1 ? args[0] : [args[0], args[1]];\n        return exports.dot(transform, [xy[0], xy[1], 1]).slice(0, 2);\n    };\n};\n\n// applies a 2D transformation matrix to an [x1,y1,x2,y2] array (to transform a segment)\nexports.apply2DTransform2 = function(transform) {\n    var at = exports.apply2DTransform(transform);\n    return function(xys) {\n        return at(xys.slice(0, 2)).concat(at(xys.slice(2, 4)));\n    };\n};\n\n},{}],185:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * sanitized modulus function that always returns in the range [0, d)\n * rather than (-d, 0] if v is negative\n */\nfunction mod(v, d) {\n    var out = v % d;\n    return out < 0 ? out + d : out;\n}\n\n/**\n * sanitized modulus function that always returns in the range [-d/2, d/2]\n * rather than (-d, 0] if v is negative\n */\nfunction modHalf(v, d) {\n    return Math.abs(v) > (d / 2) ?\n        v - Math.round(v / d) * d :\n        v;\n}\n\nmodule.exports = {\n    mod: mod,\n    modHalf: modHalf\n};\n\n},{}],186:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\n\n/**\n * convert a string s (such as 'xaxis.range[0]')\n * representing a property of nested object into set and get methods\n * also return the string and object so we don't have to keep track of them\n * allows [-1] for an array index, to set a property inside all elements\n * of an array\n * eg if obj = {arr: [{a: 1}, {a: 2}]}\n * you can do p = nestedProperty(obj, 'arr[-1].a')\n * but you cannot set the array itself this way, to do that\n * just set the whole array.\n * eg if obj = {arr: [1, 2, 3]}\n * you can't do nestedProperty(obj, 'arr[-1]').set(5)\n * but you can do nestedProperty(obj, 'arr').set([5, 5, 5])\n */\nmodule.exports = function nestedProperty(container, propStr) {\n    if(isNumeric(propStr)) propStr = String(propStr);\n    else if(typeof propStr !== 'string' ||\n            propStr.substr(propStr.length - 4) === '[-1]') {\n        throw 'bad property string';\n    }\n\n    var j = 0;\n    var propParts = propStr.split('.');\n    var indexed;\n    var indices;\n    var i;\n\n    // check for parts of the nesting hierarchy that are numbers (ie array elements)\n    while(j < propParts.length) {\n        // look for non-bracket chars, then any number of [##] blocks\n        indexed = String(propParts[j]).match(/^([^\\[\\]]*)((\\[\\-?[0-9]*\\])+)$/);\n        if(indexed) {\n            if(indexed[1]) propParts[j] = indexed[1];\n            // allow propStr to start with bracketed array indices\n            else if(j === 0) propParts.splice(0, 1);\n            else throw 'bad property string';\n\n            indices = indexed[2]\n                .substr(1, indexed[2].length - 2)\n                .split('][');\n\n            for(i = 0; i < indices.length; i++) {\n                j++;\n                propParts.splice(j, 0, Number(indices[i]));\n            }\n        }\n        j++;\n    }\n\n    if(typeof container !== 'object') {\n        return badContainer(container, propStr, propParts);\n    }\n\n    return {\n        set: npSet(container, propParts, propStr),\n        get: npGet(container, propParts),\n        astr: propStr,\n        parts: propParts,\n        obj: container\n    };\n};\n\nfunction npGet(cont, parts) {\n    return function() {\n        var curCont = cont;\n        var curPart;\n        var allSame;\n        var out;\n        var i;\n        var j;\n\n        for(i = 0; i < parts.length - 1; i++) {\n            curPart = parts[i];\n            if(curPart === -1) {\n                allSame = true;\n                out = [];\n                for(j = 0; j < curCont.length; j++) {\n                    out[j] = npGet(curCont[j], parts.slice(i + 1))();\n                    if(out[j] !== out[0]) allSame = false;\n                }\n                return allSame ? out[0] : out;\n            }\n            if(typeof curPart === 'number' && !isArrayOrTypedArray(curCont)) {\n                return undefined;\n            }\n            curCont = curCont[curPart];\n            if(typeof curCont !== 'object' || curCont === null) {\n                return undefined;\n            }\n        }\n\n        // only hit this if parts.length === 1\n        if(typeof curCont !== 'object' || curCont === null) return undefined;\n\n        out = curCont[parts[i]];\n        if(out === null) return undefined;\n        return out;\n    };\n}\n\n/*\n * Can this value be deleted? We can delete `undefined`, and `null` except INSIDE an\n * *args* array.\n *\n * Previously we also deleted some `{}` and `[]`, in order to try and make set/unset\n * a net noop; but this causes far more complication than it's worth, and still had\n * lots of exceptions. See https://github.com/plotly/plotly.js/issues/1410\n *\n * *args* arrays get passed directly to API methods and we should respect null if\n * the user put it there, but otherwise null is deleted as we use it as code\n * in restyle/relayout/update for \"delete this value\" whereas undefined means\n * \"ignore this edit\"\n */\nvar ARGS_PATTERN = /(^|\\.)args\\[/;\nfunction isDeletable(val, propStr) {\n    return (val === undefined) || (val === null && !propStr.match(ARGS_PATTERN));\n}\n\nfunction npSet(cont, parts, propStr) {\n    return function(val) {\n        var curCont = cont;\n        var propPart = '';\n        var containerLevels = [[cont, propPart]];\n        var toDelete = isDeletable(val, propStr);\n        var curPart;\n        var i;\n\n        for(i = 0; i < parts.length - 1; i++) {\n            curPart = parts[i];\n\n            if(typeof curPart === 'number' && !isArrayOrTypedArray(curCont)) {\n                throw 'array index but container is not an array';\n            }\n\n            // handle special -1 array index\n            if(curPart === -1) {\n                toDelete = !setArrayAll(curCont, parts.slice(i + 1), val, propStr);\n                if(toDelete) break;\n                else return;\n            }\n\n            if(!checkNewContainer(curCont, curPart, parts[i + 1], toDelete)) {\n                break;\n            }\n\n            curCont = curCont[curPart];\n\n            if(typeof curCont !== 'object' || curCont === null) {\n                throw 'container is not an object';\n            }\n\n            propPart = joinPropStr(propPart, curPart);\n\n            containerLevels.push([curCont, propPart]);\n        }\n\n        if(toDelete) {\n            if(i === parts.length - 1) {\n                delete curCont[parts[i]];\n\n                // The one bit of pruning we still do: drop `undefined` from the end of arrays.\n                // In case someone has already unset previous items, continue until we hit a\n                // non-undefined value.\n                if(Array.isArray(curCont) && +parts[i] === curCont.length - 1) {\n                    while(curCont.length && curCont[curCont.length - 1] === undefined) {\n                        curCont.pop();\n                    }\n                }\n            }\n        } else curCont[parts[i]] = val;\n    };\n}\n\nfunction joinPropStr(propStr, newPart) {\n    var toAdd = newPart;\n    if(isNumeric(newPart)) toAdd = '[' + newPart + ']';\n    else if(propStr) toAdd = '.' + newPart;\n\n    return propStr + toAdd;\n}\n\n// handle special -1 array index\nfunction setArrayAll(containerArray, innerParts, val, propStr) {\n    var arrayVal = isArrayOrTypedArray(val);\n    var allSet = true;\n    var thisVal = val;\n    var thisPropStr = propStr.replace('-1', 0);\n    var deleteThis = arrayVal ? false : isDeletable(val, thisPropStr);\n    var firstPart = innerParts[0];\n    var i;\n\n    for(i = 0; i < containerArray.length; i++) {\n        thisPropStr = propStr.replace('-1', i);\n        if(arrayVal) {\n            thisVal = val[i % val.length];\n            deleteThis = isDeletable(thisVal, thisPropStr);\n        }\n        if(deleteThis) allSet = false;\n        if(!checkNewContainer(containerArray, i, firstPart, deleteThis)) {\n            continue;\n        }\n        npSet(containerArray[i], innerParts, propStr.replace('-1', i))(thisVal);\n    }\n    return allSet;\n}\n\n/**\n * make new sub-container as needed.\n * returns false if there's no container and none is needed\n * because we're only deleting an attribute\n */\nfunction checkNewContainer(container, part, nextPart, toDelete) {\n    if(container[part] === undefined) {\n        if(toDelete) return false;\n\n        if(typeof nextPart === 'number') container[part] = [];\n        else container[part] = {};\n    }\n    return true;\n}\n\nfunction badContainer(container, propStr, propParts) {\n    return {\n        set: function() { throw 'bad container'; },\n        get: function() {},\n        astr: propStr,\n        parts: propParts,\n        obj: container\n    };\n}\n\n},{\"./array\":165,\"fast-isnumeric\":18}],187:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function noop() {};\n\n},{}],188:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar NOTEDATA = [];\n\n/**\n * notifier\n * @param {String} text The person's user name\n * @param {Number} [delay=1000] The delay time in milliseconds\n *          or 'long' which provides 2000 ms delay time.\n * @return {undefined} this function does not return a value\n */\nmodule.exports = function(text, displayLength) {\n    if(NOTEDATA.indexOf(text) !== -1) return;\n\n    NOTEDATA.push(text);\n\n    var ts = 1000;\n    if(isNumeric(displayLength)) ts = displayLength;\n    else if(displayLength === 'long') ts = 3000;\n\n    var notifierContainer = d3.select('body')\n        .selectAll('.plotly-notifier')\n        .data([0]);\n    notifierContainer.enter()\n        .append('div')\n        .classed('plotly-notifier', true);\n\n    var notes = notifierContainer.selectAll('.notifier-note').data(NOTEDATA);\n\n    function killNote(transition) {\n        transition\n            .duration(700)\n            .style('opacity', 0)\n            .each('end', function(thisText) {\n                var thisIndex = NOTEDATA.indexOf(thisText);\n                if(thisIndex !== -1) NOTEDATA.splice(thisIndex, 1);\n                d3.select(this).remove();\n            });\n    }\n\n    notes.enter().append('div')\n        .classed('notifier-note', true)\n        .style('opacity', 0)\n        .each(function(thisText) {\n            var note = d3.select(this);\n\n            note.append('button')\n                .classed('notifier-close', true)\n                .html('&times;')\n                .on('click', function() {\n                    note.transition().call(killNote);\n                });\n\n            var p = note.append('p');\n            var lines = thisText.split(/<br\\s*\\/?>/g);\n            for(var i = 0; i < lines.length; i++) {\n                if(i) p.append('br');\n                p.append('span').text(lines[i]);\n            }\n\n            if(displayLength === 'stick') {\n                note.transition()\n                        .duration(350)\n                        .style('opacity', 1);\n            } else {\n                note.transition()\n                        .duration(700)\n                        .style('opacity', 1)\n                    .transition()\n                        .delay(ts)\n                        .call(killNote);\n            }\n        });\n};\n\n},{\"d3\":16,\"fast-isnumeric\":18}],189:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar setCursor = _dereq_('./setcursor');\n\nvar STASHATTR = 'data-savedcursor';\nvar NO_CURSOR = '!!';\n\n/*\n * works with our CSS cursor classes (see css/_cursor.scss)\n * to override a previous cursor set on d3 single-element selections,\n * by moving the name of the original cursor to the data-savedcursor attr.\n * omit cursor to revert to the previously set value.\n */\nmodule.exports = function overrideCursor(el3, csr) {\n    var savedCursor = el3.attr(STASHATTR);\n    if(csr) {\n        if(!savedCursor) {\n            var classes = (el3.attr('class') || '').split(' ');\n            for(var i = 0; i < classes.length; i++) {\n                var cls = classes[i];\n                if(cls.indexOf('cursor-') === 0) {\n                    el3.attr(STASHATTR, cls.substr(7))\n                        .classed(cls, false);\n                }\n            }\n            if(!el3.attr(STASHATTR)) {\n                el3.attr(STASHATTR, NO_CURSOR);\n            }\n        }\n        setCursor(el3, csr);\n    } else if(savedCursor) {\n        el3.attr(STASHATTR, null);\n\n        if(savedCursor === NO_CURSOR) setCursor(el3);\n        else setCursor(el3, savedCursor);\n    }\n};\n\n},{\"./setcursor\":197}],190:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar dot = _dereq_('./matrix').dot;\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\nvar polygon = module.exports = {};\n\n/**\n * Turn an array of [x, y] pairs into a polygon object\n * that can test if points are inside it\n *\n * @param ptsIn Array of [x, y] pairs\n *\n * @returns polygon Object {xmin, xmax, ymin, ymax, pts, contains}\n *      (x|y)(min|max) are the bounding rect of the polygon\n *      pts is the original array, with the first pair repeated at the end\n *      contains is a function: (pt, omitFirstEdge)\n *          pt is the [x, y] pair to test\n *          omitFirstEdge truthy means points exactly on the first edge don't\n *              count. This is for use adding one polygon to another so we\n *              don't double-count the edge where they meet.\n *          returns boolean: is pt inside the polygon (including on its edges)\n */\npolygon.tester = function tester(ptsIn) {\n    var pts = ptsIn.slice();\n    var xmin = pts[0][0];\n    var xmax = xmin;\n    var ymin = pts[0][1];\n    var ymax = ymin;\n    var i;\n\n    pts.push(pts[0]);\n    for(i = 1; i < pts.length; i++) {\n        xmin = Math.min(xmin, pts[i][0]);\n        xmax = Math.max(xmax, pts[i][0]);\n        ymin = Math.min(ymin, pts[i][1]);\n        ymax = Math.max(ymax, pts[i][1]);\n    }\n\n    // do we have a rectangle? Handle this here, so we can use the same\n    // tester for the rectangular case without sacrificing speed\n\n    var isRect = false;\n    var rectFirstEdgeTest;\n\n    if(pts.length === 5) {\n        if(pts[0][0] === pts[1][0]) { // vert, horz, vert, horz\n            if(pts[2][0] === pts[3][0] &&\n                    pts[0][1] === pts[3][1] &&\n                    pts[1][1] === pts[2][1]) {\n                isRect = true;\n                rectFirstEdgeTest = function(pt) { return pt[0] === pts[0][0]; };\n            }\n        } else if(pts[0][1] === pts[1][1]) { // horz, vert, horz, vert\n            if(pts[2][1] === pts[3][1] &&\n                    pts[0][0] === pts[3][0] &&\n                    pts[1][0] === pts[2][0]) {\n                isRect = true;\n                rectFirstEdgeTest = function(pt) { return pt[1] === pts[0][1]; };\n            }\n        }\n    }\n\n    function rectContains(pt, omitFirstEdge) {\n        var x = pt[0];\n        var y = pt[1];\n\n        if(x === BADNUM || x < xmin || x > xmax || y === BADNUM || y < ymin || y > ymax) {\n            // pt is outside the bounding box of polygon\n            return false;\n        }\n        if(omitFirstEdge && rectFirstEdgeTest(pt)) return false;\n\n        return true;\n    }\n\n    function contains(pt, omitFirstEdge) {\n        var x = pt[0];\n        var y = pt[1];\n\n        if(x === BADNUM || x < xmin || x > xmax || y === BADNUM || y < ymin || y > ymax) {\n            // pt is outside the bounding box of polygon\n            return false;\n        }\n\n        var imax = pts.length;\n        var x1 = pts[0][0];\n        var y1 = pts[0][1];\n        var crossings = 0;\n        var i;\n        var x0;\n        var y0;\n        var xmini;\n        var ycross;\n\n        for(i = 1; i < imax; i++) {\n            // find all crossings of a vertical line upward from pt with\n            // polygon segments\n            // crossings exactly at xmax don't count, unless the point is\n            // exactly on the segment, then it counts as inside.\n            x0 = x1;\n            y0 = y1;\n            x1 = pts[i][0];\n            y1 = pts[i][1];\n            xmini = Math.min(x0, x1);\n\n            if(x < xmini || x > Math.max(x0, x1) || y > Math.max(y0, y1)) {\n                // outside the bounding box of this segment, it's only a crossing\n                // if it's below the box.\n\n                continue;\n            } else if(y < Math.min(y0, y1)) {\n                // don't count the left-most point of the segment as a crossing\n                // because we don't want to double-count adjacent crossings\n                // UNLESS the polygon turns past vertical at exactly this x\n                // Note that this is repeated below, but we can't factor it out\n                // because\n                if(x !== xmini) crossings++;\n            } else {\n                // inside the bounding box, check the actual line intercept\n\n                // vertical segment - we know already that the point is exactly\n                // on the segment, so mark the crossing as exactly at the point.\n                if(x1 === x0) ycross = y;\n                // any other angle\n                else ycross = y0 + (x - x0) * (y1 - y0) / (x1 - x0);\n\n                // exactly on the edge: counts as inside the polygon, unless it's the\n                // first edge and we're omitting it.\n                if(y === ycross) {\n                    if(i === 1 && omitFirstEdge) return false;\n                    return true;\n                }\n\n                if(y <= ycross && x !== xmini) crossings++;\n            }\n        }\n\n        // if we've gotten this far, odd crossings means inside, even is outside\n        return crossings % 2 === 1;\n    }\n\n    // detect if poly is degenerate\n    var degenerate = true;\n    var lastPt = pts[0];\n    for(i = 1; i < pts.length; i++) {\n        if(lastPt[0] !== pts[i][0] || lastPt[1] !== pts[i][1]) {\n            degenerate = false;\n            break;\n        }\n    }\n\n    return {\n        xmin: xmin,\n        xmax: xmax,\n        ymin: ymin,\n        ymax: ymax,\n        pts: pts,\n        contains: isRect ? rectContains : contains,\n        isRect: isRect,\n        degenerate: degenerate\n    };\n};\n\n/**\n * Test if a segment of a points array is bent or straight\n *\n * @param pts Array of [x, y] pairs\n * @param start the index of the proposed start of the straight section\n * @param end the index of the proposed end point\n * @param tolerance the max distance off the line connecting start and end\n *      before the line counts as bent\n * @returns boolean: true means this segment is bent, false means straight\n */\npolygon.isSegmentBent = function isSegmentBent(pts, start, end, tolerance) {\n    var startPt = pts[start];\n    var segment = [pts[end][0] - startPt[0], pts[end][1] - startPt[1]];\n    var segmentSquared = dot(segment, segment);\n    var segmentLen = Math.sqrt(segmentSquared);\n    var unitPerp = [-segment[1] / segmentLen, segment[0] / segmentLen];\n    var i;\n    var part;\n    var partParallel;\n\n    for(i = start + 1; i < end; i++) {\n        part = [pts[i][0] - startPt[0], pts[i][1] - startPt[1]];\n        partParallel = dot(part, segment);\n\n        if(partParallel < 0 || partParallel > segmentSquared ||\n            Math.abs(dot(part, unitPerp)) > tolerance) return true;\n    }\n    return false;\n};\n\n/**\n * Make a filtering polygon, to minimize the number of segments\n *\n * @param pts Array of [x, y] pairs (must start with at least 1 pair)\n * @param tolerance the maximum deviation from straight allowed for\n *      removing points to simplify the polygon\n *\n * @returns Object {addPt, raw, filtered}\n *      addPt is a function(pt: [x, y] pair) to add a raw point and\n *          continue filtering\n *      raw is all the input points\n *      filtered is the resulting filtered Array of [x, y] pairs\n */\npolygon.filter = function filter(pts, tolerance) {\n    var ptsFiltered = [pts[0]];\n    var doneRawIndex = 0;\n    var doneFilteredIndex = 0;\n\n    function addPt(pt) {\n        pts.push(pt);\n        var prevFilterLen = ptsFiltered.length;\n        var iLast = doneRawIndex;\n        ptsFiltered.splice(doneFilteredIndex + 1);\n\n        for(var i = iLast + 1; i < pts.length; i++) {\n            if(i === pts.length - 1 || polygon.isSegmentBent(pts, iLast, i + 1, tolerance)) {\n                ptsFiltered.push(pts[i]);\n                if(ptsFiltered.length < prevFilterLen - 2) {\n                    doneRawIndex = i;\n                    doneFilteredIndex = ptsFiltered.length - 1;\n                }\n                iLast = i;\n            }\n        }\n    }\n\n    if(pts.length > 1) {\n        var lastPt = pts.pop();\n        addPt(lastPt);\n    }\n\n    return {\n        addPt: addPt,\n        raw: pts,\n        filtered: ptsFiltered\n    };\n};\n\n},{\"../constants/numerical\":158,\"./matrix\":184}],191:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Push array with unique items\n *\n * Ignores falsy items, except 0 so we can use it to construct arrays of indices.\n *\n * @param {array} array\n *  array to be filled\n * @param {any} item\n *  item to be or not to be inserted\n * @return {array}\n *  ref to array (now possibly containing one more item)\n *\n */\nmodule.exports = function pushUnique(array, item) {\n    if(item instanceof RegExp) {\n        var itemStr = item.toString();\n        for(var i = 0; i < array.length; i++) {\n            if(array[i] instanceof RegExp && array[i].toString() === itemStr) {\n                return array;\n            }\n        }\n        array.push(item);\n    } else if((item || item === 0) && array.indexOf(item) === -1) array.push(item);\n\n    return array;\n};\n\n},{}],192:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar dfltConfig = _dereq_('../plot_api/plot_config').dfltConfig;\n\n/**\n * Copy arg array *without* removing `undefined` values from objects.\n *\n * @param gd\n * @param args\n * @returns {Array}\n */\nfunction copyArgArray(gd, args) {\n    var copy = [];\n    var arg;\n\n    for(var i = 0; i < args.length; i++) {\n        arg = args[i];\n\n        if(arg === gd) copy[i] = arg;\n        else if(typeof arg === 'object') {\n            copy[i] = Array.isArray(arg) ?\n                Lib.extendDeep([], arg) :\n                Lib.extendDeepAll({}, arg);\n        } else copy[i] = arg;\n    }\n\n    return copy;\n}\n\n\n// -----------------------------------------------------\n// Undo/Redo queue for plots\n// -----------------------------------------------------\n\n\nvar queue = {};\n\n// TODO: disable/enable undo and redo buttons appropriately\n\n/**\n * Add an item to the undoQueue for a graphDiv\n *\n * @param gd\n * @param undoFunc Function undo this operation\n * @param undoArgs Args to supply undoFunc with\n * @param redoFunc Function to redo this operation\n * @param redoArgs Args to supply redoFunc with\n */\nqueue.add = function(gd, undoFunc, undoArgs, redoFunc, redoArgs) {\n    var queueObj,\n        queueIndex;\n\n    // make sure we have the queue and our position in it\n    gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n    queueIndex = gd.undoQueue.index;\n\n    // if we're already playing an undo or redo, or if this is an auto operation\n    // (like pane resize... any others?) then we don't save this to the undo queue\n    if(gd.autoplay) {\n        if(!gd.undoQueue.inSequence) gd.autoplay = false;\n        return;\n    }\n\n    // if we're not in a sequence or are just starting, we need a new queue item\n    if(!gd.undoQueue.sequence || gd.undoQueue.beginSequence) {\n        queueObj = {undo: {calls: [], args: []}, redo: {calls: [], args: []}};\n        gd.undoQueue.queue.splice(queueIndex, gd.undoQueue.queue.length - queueIndex, queueObj);\n        gd.undoQueue.index += 1;\n    } else {\n        queueObj = gd.undoQueue.queue[queueIndex - 1];\n    }\n    gd.undoQueue.beginSequence = false;\n\n    // we unshift to handle calls for undo in a forward for loop later\n    if(queueObj) {\n        queueObj.undo.calls.unshift(undoFunc);\n        queueObj.undo.args.unshift(undoArgs);\n        queueObj.redo.calls.push(redoFunc);\n        queueObj.redo.args.push(redoArgs);\n    }\n\n    if(gd.undoQueue.queue.length > dfltConfig.queueLength) {\n        gd.undoQueue.queue.shift();\n        gd.undoQueue.index--;\n    }\n};\n\n/**\n * Begin a sequence of undoQueue changes\n *\n * @param gd\n */\nqueue.startSequence = function(gd) {\n    gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n    gd.undoQueue.sequence = true;\n    gd.undoQueue.beginSequence = true;\n};\n\n/**\n * Stop a sequence of undoQueue changes\n *\n * Call this *after* you're sure your undo chain has ended\n *\n * @param gd\n */\nqueue.stopSequence = function(gd) {\n    gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n    gd.undoQueue.sequence = false;\n    gd.undoQueue.beginSequence = false;\n};\n\n/**\n * Move one step back in the undo queue, and undo the object there.\n *\n * @param gd\n */\nqueue.undo = function undo(gd) {\n    var queueObj, i;\n\n    if(gd.framework && gd.framework.isPolar) {\n        gd.framework.undo();\n        return;\n    }\n    if(gd.undoQueue === undefined ||\n            isNaN(gd.undoQueue.index) ||\n            gd.undoQueue.index <= 0) {\n        return;\n    }\n\n    // index is pointing to next *forward* queueObj, point to the one we're undoing\n    gd.undoQueue.index--;\n\n    // get the queueObj for instructions on how to undo\n    queueObj = gd.undoQueue.queue[gd.undoQueue.index];\n\n    // this sequence keeps things from adding to the queue during undo/redo\n    gd.undoQueue.inSequence = true;\n    for(i = 0; i < queueObj.undo.calls.length; i++) {\n        queue.plotDo(gd, queueObj.undo.calls[i], queueObj.undo.args[i]);\n    }\n    gd.undoQueue.inSequence = false;\n    gd.autoplay = false;\n};\n\n/**\n * Redo the current object in the undo, then move forward in the queue.\n *\n * @param gd\n */\nqueue.redo = function redo(gd) {\n    var queueObj, i;\n\n    if(gd.framework && gd.framework.isPolar) {\n        gd.framework.redo();\n        return;\n    }\n    if(gd.undoQueue === undefined ||\n            isNaN(gd.undoQueue.index) ||\n            gd.undoQueue.index >= gd.undoQueue.queue.length) {\n        return;\n    }\n\n    // get the queueObj for instructions on how to undo\n    queueObj = gd.undoQueue.queue[gd.undoQueue.index];\n\n    // this sequence keeps things from adding to the queue during undo/redo\n    gd.undoQueue.inSequence = true;\n    for(i = 0; i < queueObj.redo.calls.length; i++) {\n        queue.plotDo(gd, queueObj.redo.calls[i], queueObj.redo.args[i]);\n    }\n    gd.undoQueue.inSequence = false;\n    gd.autoplay = false;\n\n    // index is pointing to the thing we just redid, move it\n    gd.undoQueue.index++;\n};\n\n/**\n * Called by undo/redo to make the actual changes.\n *\n * Not meant to be called publically, but included for mocking out in tests.\n *\n * @param gd\n * @param func\n * @param args\n */\nqueue.plotDo = function(gd, func, args) {\n    gd.autoplay = true;\n\n    // this *won't* copy gd and it preserves `undefined` properties!\n    args = copyArgArray(gd, args);\n\n    // call the supplied function\n    func.apply(null, args);\n};\n\nmodule.exports = queue;\n\n},{\"../lib\":178,\"../plot_api/plot_config\":210}],193:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * make a regex for matching counter ids/names ie xaxis, xaxis2, xaxis10...\n *\n * @param {string} head: the head of the pattern, eg 'x' matches 'x', 'x2', 'x10' etc.\n *      'xy' is a special case for cartesian subplots: it matches 'x2y3' etc\n * @param {Optional(string)} tail: a fixed piece after the id\n *      eg counterRegex('scene', '.annotations') for scene2.annotations etc.\n * @param {boolean} openEnded: if true, the string may continue past the match.\n * @param {boolean} matchBeginning: if false, the string may start before the match.\n */\nexports.counter = function(head, tail, openEnded, matchBeginning) {\n    var fullTail = (tail || '') + (openEnded ? '' : '$');\n    var startWithPrefix = matchBeginning === false ? '' : '^';\n    if(head === 'xy') {\n        return new RegExp(startWithPrefix + 'x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?' + fullTail);\n    }\n    return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail);\n};\n\n},{}],194:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// ASCEND: chop off the last nesting level - either [<n>] or .<key> - to ascend\n// the attribute tree. the remaining attrString is in match[1]\nvar ASCEND = /^(.*)(\\.[^\\.\\[\\]]+|\\[\\d\\])$/;\n\n// SIMPLEATTR: is this an un-nested attribute? (no dots or brackets)\nvar SIMPLEATTR = /^[^\\.\\[\\]]+$/;\n\n/*\n * calculate a relative attribute string, similar to a relative path\n *\n * @param {string} baseAttr:\n *   an attribute string, such as 'annotations[3].x'. The \"current location\"\n *   is the attribute string minus the last component ('annotations[3]')\n * @param {string} relativeAttr:\n *   a route to the desired attribute string, using '^' to ascend\n *\n * @return {string} attrString:\n *   for example:\n *     relativeAttr('annotations[3].x', 'y') = 'annotations[3].y'\n *     relativeAttr('annotations[3].x', '^[2].z') = 'annotations[2].z'\n *     relativeAttr('annotations[3].x', '^^margin') = 'margin'\n *     relativeAttr('annotations[3].x', '^^margin.r') = 'margin.r'\n */\nmodule.exports = function(baseAttr, relativeAttr) {\n    while(relativeAttr) {\n        var match = baseAttr.match(ASCEND);\n\n        if(match) baseAttr = match[1];\n        else if(baseAttr.match(SIMPLEATTR)) baseAttr = '';\n        else throw new Error('bad relativeAttr call:' + [baseAttr, relativeAttr]);\n\n        if(relativeAttr.charAt(0) === '^') relativeAttr = relativeAttr.slice(1);\n        else break;\n    }\n\n    if(baseAttr && relativeAttr.charAt(0) !== '[') {\n        return baseAttr + '.' + relativeAttr;\n    }\n    return baseAttr + relativeAttr;\n};\n\n},{}],195:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\nvar isPlainObject = _dereq_('./is_plain_object');\n\n/**\n * Relink private _keys and keys with a function value from one container\n * to the new container.\n * Relink means copying if object is pass-by-value and adding a reference\n * if object is pass-by-ref.\n * This prevents deepCopying massive structures like a webgl context.\n */\nmodule.exports = function relinkPrivateKeys(toContainer, fromContainer) {\n    for(var k in fromContainer) {\n        var fromVal = fromContainer[k];\n        var toVal = toContainer[k];\n\n        if(toVal === fromVal) continue;\n\n        if(k.charAt(0) === '_' || typeof fromVal === 'function') {\n            // if it already exists at this point, it's something\n            // that we recreate each time around, so ignore it\n            if(k in toContainer) continue;\n\n            toContainer[k] = fromVal;\n        } else if(isArrayOrTypedArray(fromVal) && isArrayOrTypedArray(toVal) && isPlainObject(fromVal[0])) {\n            // filter out data_array items that can contain user objects\n            // most of the time the toVal === fromVal check will catch these early\n            // but if the user makes new ones we also don't want to recurse in.\n            if(k === 'customdata' || k === 'ids') continue;\n\n            // recurse into arrays containers\n            var minLen = Math.min(fromVal.length, toVal.length);\n            for(var j = 0; j < minLen; j++) {\n                if((toVal[j] !== fromVal[j]) && isPlainObject(fromVal[j]) && isPlainObject(toVal[j])) {\n                    relinkPrivateKeys(toVal[j], fromVal[j]);\n                }\n            }\n        } else if(isPlainObject(fromVal) && isPlainObject(toVal)) {\n            // recurse into objects, but only if they still exist\n            relinkPrivateKeys(toVal, fromVal);\n\n            if(!Object.keys(toVal).length) delete toContainer[k];\n        }\n    }\n};\n\n},{\"./array\":165,\"./is_plain_object\":179}],196:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar loggers = _dereq_('./loggers');\nvar identity = _dereq_('./identity');\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\n// don't trust floating point equality - fraction of bin size to call\n// \"on the line\" and ensure that they go the right way specified by\n// linelow\nvar roundingError = 1e-9;\n\n\n/**\n * findBin - find the bin for val - note that it can return outside the\n * bin range any pos. or neg. integer for linear bins, or -1 or\n * bins.length-1 for explicit.\n * bins is either an object {start,size,end} or an array length #bins+1\n * bins can be either increasing or decreasing but must be monotonic\n * for linear bins, we can just calculate. For listed bins, run a binary\n * search linelow (truthy) says the bin boundary should be attributed to\n * the lower bin rather than the default upper bin\n */\nexports.findBin = function(val, bins, linelow) {\n    if(isNumeric(bins.start)) {\n        return linelow ?\n            Math.ceil((val - bins.start) / bins.size - roundingError) - 1 :\n            Math.floor((val - bins.start) / bins.size + roundingError);\n    } else {\n        var n1 = 0;\n        var n2 = bins.length;\n        var c = 0;\n        var binSize = (n2 > 1) ? (bins[n2 - 1] - bins[0]) / (n2 - 1) : 1;\n        var n, test;\n        if(binSize >= 0) {\n            test = linelow ? lessThan : lessOrEqual;\n        } else {\n            test = linelow ? greaterOrEqual : greaterThan;\n        }\n        val += binSize * roundingError * (linelow ? -1 : 1) * (binSize >= 0 ? 1 : -1);\n        // c is just to avoid infinite loops if there's an error\n        while(n1 < n2 && c++ < 100) {\n            n = Math.floor((n1 + n2) / 2);\n            if(test(bins[n], val)) n1 = n + 1;\n            else n2 = n;\n        }\n        if(c > 90) loggers.log('Long binary search...');\n        return n1 - 1;\n    }\n};\n\nfunction lessThan(a, b) { return a < b; }\nfunction lessOrEqual(a, b) { return a <= b; }\nfunction greaterThan(a, b) { return a > b; }\nfunction greaterOrEqual(a, b) { return a >= b; }\n\nexports.sorterAsc = function(a, b) { return a - b; };\nexports.sorterDes = function(a, b) { return b - a; };\n\n/**\n * find distinct values in an array, lumping together ones that appear to\n * just be off by a rounding error\n * return the distinct values and the minimum difference between any two\n */\nexports.distinctVals = function(valsIn) {\n    var vals = valsIn.slice();  // otherwise we sort the original array...\n    vals.sort(exports.sorterAsc); // undefined listed in the end - also works on IE11\n\n    var last;\n    for(last = vals.length - 1; last > -1; last--) {\n        if(vals[last] !== BADNUM) break;\n    }\n\n    var minDiff = (vals[last] - vals[0]) || 1;\n    var errDiff = minDiff / (last || 1) / 10000;\n    var newVals = [];\n    var preV;\n    for(var i = 0; i <= last; i++) {\n        var v = vals[i];\n\n        // make sure values aren't just off by a rounding error\n        var diff = v - preV;\n\n        if(preV === undefined) {\n            newVals.push(v);\n            preV = v;\n        } else if(diff > errDiff) {\n            minDiff = Math.min(minDiff, diff);\n\n            newVals.push(v);\n            preV = v;\n        }\n    }\n\n    return {vals: newVals, minDiff: minDiff};\n};\n\n/**\n * return the smallest element from (sorted) array arrayIn that's bigger than val,\n * or (reverse) the largest element smaller than val\n * used to find the best tick given the minimum (non-rounded) tick\n * particularly useful for date/time where things are not powers of 10\n * binary search is probably overkill here...\n */\nexports.roundUp = function(val, arrayIn, reverse) {\n    var low = 0;\n    var high = arrayIn.length - 1;\n    var mid;\n    var c = 0;\n    var dlow = reverse ? 0 : 1;\n    var dhigh = reverse ? 1 : 0;\n    var rounded = reverse ? Math.ceil : Math.floor;\n    // c is just to avoid infinite loops if there's an error\n    while(low < high && c++ < 100) {\n        mid = rounded((low + high) / 2);\n        if(arrayIn[mid] <= val) low = mid + dlow;\n        else high = mid - dhigh;\n    }\n    return arrayIn[low];\n};\n\n/**\n * Tweak to Array.sort(sortFn) that improves performance for pre-sorted arrays\n *\n * Note that newer browsers (such as Chrome v70+) are starting to pick up\n * on pre-sorted arrays which may render the following optimization unnecessary\n * in the future.\n *\n * Motivation: sometimes we need to sort arrays but the input is likely to\n * already be sorted. Browsers don't seem to pick up on pre-sorted arrays,\n * and in fact Chrome is actually *slower* sorting pre-sorted arrays than purely\n * random arrays. FF is at least faster if the array is pre-sorted, but still\n * not as fast as it could be.\n * Here's how this plays out sorting a length-1e6 array:\n *\n * Calls to Sort FN  |  Chrome bare  |  FF bare  |  Chrome tweak  |  FF tweak\n *                   |  v68.0 Mac    |  v61.0 Mac|                |\n * ------------------+---------------+-----------+----------------+------------\n * ordered           |  30.4e6       |  10.1e6   |  1e6           |  1e6\n * reversed          |  29.4e6       |  9.9e6    |  1e6 + reverse |  1e6 + reverse\n * random            |  ~21e6        |  ~18.7e6  |  ~21e6         |  ~18.7e6\n *\n * So this is a substantial win for pre-sorted (ordered or exactly reversed)\n * arrays. Including this wrapper on an unsorted array adds a penalty that will\n * in general be only a few calls to the sort function. The only case this\n * penalty will be significant is if the array is mostly sorted but there are\n * a few unsorted items near the end, but the penalty is still at most N calls\n * out of (for N=1e6) ~20N total calls\n *\n * @param {Array} array: the array, to be sorted in place\n * @param {function} sortFn: As in Array.sort, function(a, b) that puts\n *     item a before item b if the return is negative, a after b if positive,\n *     and no change if zero.\n * @return {Array}: the original array, sorted in place.\n */\nexports.sort = function(array, sortFn) {\n    var notOrdered = 0;\n    var notReversed = 0;\n    for(var i = 1; i < array.length; i++) {\n        var pairOrder = sortFn(array[i], array[i - 1]);\n        if(pairOrder < 0) notOrdered = 1;\n        else if(pairOrder > 0) notReversed = 1;\n        if(notOrdered && notReversed) return array.sort(sortFn);\n    }\n    return notReversed ? array : array.reverse();\n};\n\n/**\n * find index in array 'arr' that minimizes 'fn'\n *\n * @param {array} arr : array where to search\n * @param {fn (optional)} fn : function to minimize,\n *   if not given, fn is the identity function\n * @return {integer}\n */\nexports.findIndexOfMin = function(arr, fn) {\n    fn = fn || identity;\n\n    var min = Infinity;\n    var ind;\n\n    for(var i = 0; i < arr.length; i++) {\n        var v = fn(arr[i]);\n        if(v < min) {\n            min = v;\n            ind = i;\n        }\n    }\n    return ind;\n};\n\n},{\"../constants/numerical\":158,\"./identity\":177,\"./loggers\":182,\"fast-isnumeric\":18}],197:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// works with our CSS cursor classes (see css/_cursor.scss)\n// to apply cursors to d3 single-element selections.\n// omit cursor to revert to the default.\nmodule.exports = function setCursor(el3, csr) {\n    (el3.attr('class') || '').split(' ').forEach(function(cls) {\n        if(cls.indexOf('cursor-') === 0) el3.classed(cls, false);\n    });\n\n    if(csr) el3.classed('cursor-' + csr, true);\n};\n\n},{}],198:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\n\n/**\n * aggNums() returns the result of an aggregate function applied to an array of\n * values, where non-numerical values have been tossed out.\n *\n * @param {function} f - aggregation function (e.g., Math.min)\n * @param {Number} v - initial value (continuing from previous calls)\n *      if there's no continuing value, use null for selector-type\n *      functions (max,min), or 0 for summations\n * @param {Array} a - array to aggregate (may be nested, we will recurse,\n *                    but all elements must have the same dimension)\n * @param {Number} len - maximum length of a to aggregate\n * @return {Number} - result of f applied to a starting from v\n */\nexports.aggNums = function(f, v, a, len) {\n    var i,\n        b;\n    if(!len || len > a.length) len = a.length;\n    if(!isNumeric(v)) v = false;\n    if(isArrayOrTypedArray(a[0])) {\n        b = new Array(len);\n        for(i = 0; i < len; i++) b[i] = exports.aggNums(f, v, a[i]);\n        a = b;\n    }\n\n    for(i = 0; i < len; i++) {\n        if(!isNumeric(v)) v = a[i];\n        else if(isNumeric(a[i])) v = f(+v, +a[i]);\n    }\n    return v;\n};\n\n/**\n * mean & std dev functions using aggNums, so it handles non-numerics nicely\n * even need to use aggNums instead of .length, to toss out non-numerics\n */\nexports.len = function(data) {\n    return exports.aggNums(function(a) { return a + 1; }, 0, data);\n};\n\nexports.mean = function(data, len) {\n    if(!len) len = exports.len(data);\n    return exports.aggNums(function(a, b) { return a + b; }, 0, data) / len;\n};\n\nexports.midRange = function(numArr) {\n    if(numArr === undefined || numArr.length === 0) return undefined;\n    return (exports.aggNums(Math.max, null, numArr) + exports.aggNums(Math.min, null, numArr)) / 2;\n};\n\nexports.variance = function(data, len, mean) {\n    if(!len) len = exports.len(data);\n    if(!isNumeric(mean)) mean = exports.mean(data, len);\n\n    return exports.aggNums(function(a, b) {\n        return a + Math.pow(b - mean, 2);\n    }, 0, data) / len;\n};\n\nexports.stdev = function(data, len, mean) {\n    return Math.sqrt(exports.variance(data, len, mean));\n};\n\n/**\n * median of a finite set of numbers\n * reference page: https://en.wikipedia.org/wiki/Median#Finite_set_of_numbers\n**/\nexports.median = function(data) {\n    var b = data.slice().sort();\n    return exports.interp(b, 0.5);\n};\n\n/**\n * interp() computes a percentile (quantile) for a given distribution.\n * We interpolate the distribution (to compute quantiles, we follow method #10 here:\n * http://www.amstat.org/publications/jse/v14n3/langford.html).\n * Typically the index or rank (n * arr.length) may be non-integer.\n * For reference: ends are clipped to the extreme values in the array;\n * For box plots: index you get is half a point too high (see\n * http://en.wikipedia.org/wiki/Percentile#Nearest_rank) but note that this definition\n * indexes from 1 rather than 0, so we subtract 1/2 (instead of add).\n *\n * @param {Array} arr - This array contains the values that make up the distribution.\n * @param {Number} n - Between 0 and 1, n = p/100 is such that we compute the p^th percentile.\n * For example, the 50th percentile (or median) corresponds to n = 0.5\n * @return {Number} - percentile\n */\nexports.interp = function(arr, n) {\n    if(!isNumeric(n)) throw 'n should be a finite number';\n    n = n * arr.length - 0.5;\n    if(n < 0) return arr[0];\n    if(n > arr.length - 1) return arr[arr.length - 1];\n    var frac = n % 1;\n    return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)];\n};\n\n},{\"./array\":165,\"fast-isnumeric\":18}],199:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/* global MathJax:false */\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../lib');\nvar xmlnsNamespaces = _dereq_('../constants/xmlns_namespaces');\nvar LINE_SPACING = _dereq_('../constants/alignment').LINE_SPACING;\n\n// text converter\n\nfunction getSize(_selection, _dimension) {\n    return _selection.node().getBoundingClientRect()[_dimension];\n}\n\nvar FIND_TEX = /([^$]*)([$]+[^$]*[$]+)([^$]*)/;\n\nexports.convertToTspans = function(_context, gd, _callback) {\n    var str = _context.text();\n\n    // Until we get tex integrated more fully (so it can be used along with non-tex)\n    // allow some elements to prohibit it by attaching 'data-notex' to the original\n    var tex = (!_context.attr('data-notex')) &&\n        (typeof MathJax !== 'undefined') &&\n        str.match(FIND_TEX);\n\n    var parent = d3.select(_context.node().parentNode);\n    if(parent.empty()) return;\n    var svgClass = (_context.attr('class')) ? _context.attr('class').split(' ')[0] : 'text';\n    svgClass += '-math';\n    parent.selectAll('svg.' + svgClass).remove();\n    parent.selectAll('g.' + svgClass + '-group').remove();\n    _context.style('display', null)\n        .attr({\n            // some callers use data-unformatted *from the <text> element* in 'cancel'\n            // so we need it here even if we're going to turn it into math\n            // these two (plus style and text-anchor attributes) form the key we're\n            // going to use for Drawing.bBox\n            'data-unformatted': str,\n            'data-math': 'N'\n        });\n\n    function showText() {\n        if(!parent.empty()) {\n            svgClass = _context.attr('class') + '-math';\n            parent.select('svg.' + svgClass).remove();\n        }\n        _context.text('')\n            .style('white-space', 'pre');\n\n        var hasLink = buildSVGText(_context.node(), str);\n\n        if(hasLink) {\n            // at least in Chrome, pointer-events does not seem\n            // to be honored in children of <text> elements\n            // so if we have an anchor, we have to make the\n            // whole element respond\n            _context.style('pointer-events', 'all');\n        }\n\n        exports.positionText(_context);\n\n        if(_callback) _callback.call(_context);\n    }\n\n    if(tex) {\n        ((gd && gd._promises) || []).push(new Promise(function(resolve) {\n            _context.style('display', 'none');\n            var fontSize = parseInt(_context.node().style.fontSize, 10);\n            var config = {fontSize: fontSize};\n\n            texToSVG(tex[2], config, function(_svgEl, _glyphDefs, _svgBBox) {\n                parent.selectAll('svg.' + svgClass).remove();\n                parent.selectAll('g.' + svgClass + '-group').remove();\n\n                var newSvg = _svgEl && _svgEl.select('svg');\n                if(!newSvg || !newSvg.node()) {\n                    showText();\n                    resolve();\n                    return;\n                }\n\n                var mathjaxGroup = parent.append('g')\n                    .classed(svgClass + '-group', true)\n                    .attr({\n                        'pointer-events': 'none',\n                        'data-unformatted': str,\n                        'data-math': 'Y'\n                    });\n\n                mathjaxGroup.node().appendChild(newSvg.node());\n\n                // stitch the glyph defs\n                if(_glyphDefs && _glyphDefs.node()) {\n                    newSvg.node().insertBefore(_glyphDefs.node().cloneNode(true),\n                                               newSvg.node().firstChild);\n                }\n\n                newSvg.attr({\n                    'class': svgClass,\n                    height: _svgBBox.height,\n                    preserveAspectRatio: 'xMinYMin meet'\n                })\n                .style({overflow: 'visible', 'pointer-events': 'none'});\n\n                var fill = _context.node().style.fill || 'black';\n                var g = newSvg.select('g');\n                g.attr({fill: fill, stroke: fill});\n\n                var newSvgW = getSize(g, 'width');\n                var newSvgH = getSize(g, 'height');\n                var newX = +_context.attr('x') - newSvgW *\n                    {start: 0, middle: 0.5, end: 1}[_context.attr('text-anchor') || 'start'];\n                // font baseline is about 1/4 fontSize below centerline\n                var textHeight = fontSize || getSize(_context, 'height');\n                var dy = -textHeight / 4;\n\n                if(svgClass[0] === 'y') {\n                    mathjaxGroup.attr({\n                        transform: 'rotate(' + [-90, +_context.attr('x'), +_context.attr('y')] +\n                        ') translate(' + [-newSvgW / 2, dy - newSvgH / 2] + ')'\n                    });\n                    newSvg.attr({x: +_context.attr('x'), y: +_context.attr('y')});\n                } else if(svgClass[0] === 'l') {\n                    newSvg.attr({x: _context.attr('x'), y: dy - (newSvgH / 2)});\n                } else if(svgClass[0] === 'a' && svgClass.indexOf('atitle') !== 0) {\n                    newSvg.attr({x: 0, y: dy});\n                } else {\n                    newSvg.attr({x: newX, y: (+_context.attr('y') + dy - newSvgH / 2)});\n                }\n\n                if(_callback) _callback.call(_context, mathjaxGroup);\n                resolve(mathjaxGroup);\n            });\n        }));\n    } else showText();\n\n    return _context;\n};\n\n\n// MathJax\n\nvar LT_MATCH = /(<|&lt;|&#60;)/g;\nvar GT_MATCH = /(>|&gt;|&#62;)/g;\n\nfunction cleanEscapesForTex(s) {\n    return s.replace(LT_MATCH, '\\\\lt ')\n        .replace(GT_MATCH, '\\\\gt ');\n}\n\nfunction texToSVG(_texString, _config, _callback) {\n    var originalRenderer,\n        originalConfig,\n        originalProcessSectionDelay,\n        tmpDiv;\n\n    MathJax.Hub.Queue(\n    function() {\n        originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);\n\n        originalProcessSectionDelay = MathJax.Hub.processSectionDelay;\n        if(MathJax.Hub.processSectionDelay !== undefined) {\n            // MathJax 2.5+\n            MathJax.Hub.processSectionDelay = 0;\n        }\n\n        return MathJax.Hub.Config({\n            messageStyle: 'none',\n            tex2jax: {\n                inlineMath: [['$', '$'], ['\\\\(', '\\\\)']]\n            },\n            displayAlign: 'left',\n        });\n    },\n    function() {\n        // Get original renderer\n        originalRenderer = MathJax.Hub.config.menuSettings.renderer;\n        if(originalRenderer !== 'SVG') {\n            return MathJax.Hub.setRenderer('SVG');\n        }\n    },\n    function() {\n        var randomID = 'math-output-' + Lib.randstr({}, 64);\n        tmpDiv = d3.select('body').append('div')\n            .attr({id: randomID})\n            .style({visibility: 'hidden', position: 'absolute'})\n            .style({'font-size': _config.fontSize + 'px'})\n            .text(cleanEscapesForTex(_texString));\n\n        return MathJax.Hub.Typeset(tmpDiv.node());\n    },\n    function() {\n        var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');\n\n        if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {\n            Lib.log('There was an error in the tex syntax.', _texString);\n            _callback();\n        } else {\n            var svgBBox = tmpDiv.select('svg').node().getBoundingClientRect();\n            _callback(tmpDiv.select('.MathJax_SVG'), glyphDefs, svgBBox);\n        }\n\n        tmpDiv.remove();\n\n        if(originalRenderer !== 'SVG') {\n            return MathJax.Hub.setRenderer(originalRenderer);\n        }\n    },\n    function() {\n        if(originalProcessSectionDelay !== undefined) {\n            MathJax.Hub.processSectionDelay = originalProcessSectionDelay;\n        }\n        return MathJax.Hub.Config(originalConfig);\n    });\n}\n\nvar TAG_STYLES = {\n    // would like to use baseline-shift for sub/sup but FF doesn't support it\n    // so we need to use dy along with the uber hacky shift-back-to\n    // baseline below\n    sup: 'font-size:70%',\n    sub: 'font-size:70%',\n    b: 'font-weight:bold',\n    i: 'font-style:italic',\n    a: 'cursor:pointer',\n    span: '',\n    em: 'font-style:italic;font-weight:bold'\n};\n\n// baseline shifts for sub and sup\nvar SHIFT_DY = {\n    sub: '0.3em',\n    sup: '-0.6em'\n};\n// reset baseline by adding a tspan (empty except for a zero-width space)\n// with dy of -70% * SHIFT_DY (because font-size=70%)\nvar RESET_DY = {\n    sub: '-0.21em',\n    sup: '0.42em'\n};\nvar ZERO_WIDTH_SPACE = '\\u200b';\n\n/*\n * Whitelist of protocols in user-supplied urls. Mostly we want to avoid javascript\n * and related attack vectors. The empty items are there for IE, that in various\n * versions treats relative paths as having different flavors of no protocol, while\n * other browsers have these explicitly inherit the protocol of the page they're in.\n */\nvar PROTOCOLS = ['http:', 'https:', 'mailto:', '', undefined, ':'];\n\nvar NEWLINES = exports.NEWLINES = /(\\r\\n?|\\n)/g;\n\nvar SPLIT_TAGS = /(<[^<>]*>)/;\n\nvar ONE_TAG = /<(\\/?)([^ >]*)(\\s+(.*))?>/i;\n\nvar BR_TAG = /<br(\\s+.*)?>/i;\nexports.BR_TAG_ALL = /<br(\\s+.*)?>/gi;\n\n/*\n * style and href: pull them out of either single or double quotes. Also\n * - target: (_blank|_self|_parent|_top|framename)\n *     note that you can't use target to get a popup but if you use popup,\n *     a `framename` will be passed along as the name of the popup window.\n *     per the spec, cannot contain whitespace.\n *     for backward compatibility we default to '_blank'\n * - popup: a custom one for us to enable popup (new window) links. String\n *     for window.open -> strWindowFeatures, like 'menubar=yes,width=500,height=550'\n *     note that at least in Chrome, you need to give at least one property\n *     in this string or the page will open in a new tab anyway. We follow this\n *     convention and will not make a popup if this string is empty.\n *     per the spec, cannot contain whitespace.\n *\n * Because we hack in other attributes with style (sub & sup), drop any trailing\n * semicolon in user-supplied styles so we can consistently append the tag-dependent style\n *\n * These are for tag attributes; Chrome anyway will convert entities in\n * attribute values, but not in attribute names\n * you can test this by for example:\n * > p = document.createElement('p')\n * > p.innerHTML = '<span styl&#x65;=\"font-color:r&#x65;d;\">Hi</span>'\n * > p.innerHTML\n * <- '<span styl&#x65;=\"font-color:red;\">Hi</span>'\n */\nvar STYLEMATCH = /(^|[\\s\"'])style\\s*=\\s*(\"([^\"]*);?\"|'([^']*);?')/i;\nvar HREFMATCH = /(^|[\\s\"'])href\\s*=\\s*(\"([^\"]*)\"|'([^']*)')/i;\nvar TARGETMATCH = /(^|[\\s\"'])target\\s*=\\s*(\"([^\"\\s]*)\"|'([^'\\s]*)')/i;\nvar POPUPMATCH = /(^|[\\s\"'])popup\\s*=\\s*(\"([\\w=,]*)\"|'([\\w=,]*)')/i;\n\n// dedicated matcher for these quoted regexes, that can return their results\n// in two different places\nfunction getQuotedMatch(_str, re) {\n    if(!_str) return null;\n    var match = _str.match(re);\n    var result = match && (match[3] || match[4]);\n    return result && convertEntities(result);\n}\n\nvar COLORMATCH = /(^|;)\\s*color:/;\n\n/**\n * Strip string of tags\n *\n * @param {string} _str : input string\n * @param {object} opts :\n * - len {number} max length of output string\n * - allowedTags {array} list of pseudo-html tags to NOT strip\n * @return {string}\n */\nexports.plainText = function(_str, opts) {\n    opts = opts || {};\n\n    var len = (opts.len !== undefined && opts.len !== -1) ? opts.len : Infinity;\n    var allowedTags = opts.allowedTags !== undefined ? opts.allowedTags : ['br'];\n\n    var ellipsis = '...';\n    var eLen = ellipsis.length;\n\n    var oldParts = _str.split(SPLIT_TAGS);\n    var newParts = [];\n    var prevTag = '';\n    var l = 0;\n\n    for(var i = 0; i < oldParts.length; i++) {\n        var p = oldParts[i];\n        var match = p.match(ONE_TAG);\n        var tagType = match && match[2].toLowerCase();\n\n        if(tagType) {\n            // N.B. tags do not count towards string length\n            if(allowedTags.indexOf(tagType) !== -1) {\n                newParts.push(p);\n                prevTag = tagType;\n            }\n        } else {\n            var pLen = p.length;\n\n            if((l + pLen) < len) {\n                newParts.push(p);\n                l += pLen;\n            } else if(l < len) {\n                var pLen2 = len - l;\n\n                if(prevTag && (prevTag !== 'br' || pLen2 <= eLen || pLen <= eLen)) {\n                    newParts.pop();\n                }\n\n                if(len > eLen) {\n                    newParts.push(p.substr(0, pLen2 - eLen) + ellipsis);\n                } else {\n                    newParts.push(p.substr(0, pLen2));\n                }\n                break;\n            }\n\n            prevTag = '';\n        }\n    }\n\n    return newParts.join('');\n};\n\n/*\n * N.B. HTML entities are listed without the leading '&' and trailing ';'\n * https://www.freeformatter.com/html-entities.html\n *\n * FWIW if we wanted to support the full set, it has 2261 entries:\n * https://www.w3.org/TR/html5/entities.json\n * though I notice that some of these are duplicates and/or are missing \";\"\n * eg: \"&amp;\", \"&amp\", \"&AMP;\", and \"&AMP\" all map to \"&\"\n * We no longer need to include numeric entities here, these are now handled\n * by String.fromCodePoint/fromCharCode\n *\n * Anyway the only ones that are really important to allow are the HTML special\n * chars <, >, and &, because these ones can trigger special processing if not\n * replaced by the corresponding entity.\n */\nvar entityToUnicode = {\n    mu: 'μ',\n    amp: '&',\n    lt: '<',\n    gt: '>',\n    nbsp: ' ',\n    times: '×',\n    plusmn: '±',\n    deg: '°'\n};\n\n// NOTE: in general entities can contain uppercase too (so [a-zA-Z]) but all the\n// ones we support use only lowercase. If we ever change that, update the regex.\nvar ENTITY_MATCH = /&(#\\d+|#x[\\da-fA-F]+|[a-z]+);/g;\nfunction convertEntities(_str) {\n    return _str.replace(ENTITY_MATCH, function(fullMatch, innerMatch) {\n        var outChar;\n        if(innerMatch.charAt(0) === '#') {\n            // cannot use String.fromCodePoint in IE\n            outChar = fromCodePoint(\n                innerMatch.charAt(1) === 'x' ?\n                    parseInt(innerMatch.substr(2), 16) :\n                    parseInt(innerMatch.substr(1), 10)\n            );\n        } else outChar = entityToUnicode[innerMatch];\n\n        // as in regular HTML, if we didn't decode the entity just\n        // leave the raw text in place.\n        return outChar || fullMatch;\n    });\n}\nexports.convertEntities = convertEntities;\n\nfunction fromCodePoint(code) {\n    // Don't allow overflow. In Chrome this turns into � but I feel like it's\n    // more useful to just not convert it at all.\n    if(code > 0x10FFFF) return;\n    var stringFromCodePoint = String.fromCodePoint;\n    if(stringFromCodePoint) return stringFromCodePoint(code);\n\n    // IE doesn't have String.fromCodePoint\n    // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint\n    var stringFromCharCode = String.fromCharCode;\n    if(code <= 0xFFFF) return stringFromCharCode(code);\n    return stringFromCharCode(\n        (code >> 10) + 0xD7C0,\n        (code % 0x400) + 0xDC00\n    );\n}\n\n/*\n * buildSVGText: convert our pseudo-html into SVG tspan elements, and attach these\n * to containerNode\n *\n * @param {svg text element} containerNode: the <text> node to insert this text into\n * @param {string} str: the pseudo-html string to convert to svg\n *\n * @returns {bool}: does the result contain any links? We need to handle the text element\n *   somewhat differently if it does, so just keep track of this when it happens.\n */\nfunction buildSVGText(containerNode, str) {\n    /*\n     * Normalize behavior between IE and others wrt newlines and whitespace:pre\n     * this combination makes IE barf https://github.com/plotly/plotly.js/issues/746\n     * Chrome and FF display \\n, \\r, or \\r\\n as a space in this mode.\n     * I feel like at some point we turned these into <br> but currently we don't so\n     * I'm just going to cement what we do now in Chrome and FF\n     */\n    str = str.replace(NEWLINES, ' ');\n\n    var hasLink = false;\n\n    // as we're building the text, keep track of what elements we're nested inside\n    // nodeStack will be an array of {node, type, style, href, target, popup}\n    // where only type: 'a' gets the last 3 and node is only added when it's created\n    var nodeStack = [];\n    var currentNode;\n    var currentLine = -1;\n\n    function newLine() {\n        currentLine++;\n\n        var lineNode = document.createElementNS(xmlnsNamespaces.svg, 'tspan');\n        d3.select(lineNode).attr({\n            class: 'line',\n            dy: (currentLine * LINE_SPACING) + 'em'\n        });\n        containerNode.appendChild(lineNode);\n\n        currentNode = lineNode;\n\n        var oldNodeStack = nodeStack;\n        nodeStack = [{node: lineNode}];\n\n        if(oldNodeStack.length > 1) {\n            for(var i = 1; i < oldNodeStack.length; i++) {\n                enterNode(oldNodeStack[i]);\n            }\n        }\n    }\n\n    function enterNode(nodeSpec) {\n        var type = nodeSpec.type;\n        var nodeAttrs = {};\n        var nodeType;\n\n        if(type === 'a') {\n            nodeType = 'a';\n            var target = nodeSpec.target;\n            var href = nodeSpec.href;\n            var popup = nodeSpec.popup;\n            if(href) {\n                nodeAttrs = {\n                    'xlink:xlink:show': (target === '_blank' || target.charAt(0) !== '_') ? 'new' : 'replace',\n                    target: target,\n                    'xlink:xlink:href': href\n                };\n                if(popup) {\n                    // security: href and target are not inserted as code but\n                    // as attributes. popup is, but limited to /[A-Za-z0-9_=,]/\n                    nodeAttrs.onclick = 'window.open(this.href.baseVal,this.target.baseVal,\"' +\n                        popup + '\");return false;';\n                }\n            }\n        } else nodeType = 'tspan';\n\n        if(nodeSpec.style) nodeAttrs.style = nodeSpec.style;\n\n        var newNode = document.createElementNS(xmlnsNamespaces.svg, nodeType);\n\n        if(type === 'sup' || type === 'sub') {\n            addTextNode(currentNode, ZERO_WIDTH_SPACE);\n            currentNode.appendChild(newNode);\n\n            var resetter = document.createElementNS(xmlnsNamespaces.svg, 'tspan');\n            addTextNode(resetter, ZERO_WIDTH_SPACE);\n            d3.select(resetter).attr('dy', RESET_DY[type]);\n            nodeAttrs.dy = SHIFT_DY[type];\n\n            currentNode.appendChild(newNode);\n            currentNode.appendChild(resetter);\n        } else {\n            currentNode.appendChild(newNode);\n        }\n\n        d3.select(newNode).attr(nodeAttrs);\n\n        currentNode = nodeSpec.node = newNode;\n        nodeStack.push(nodeSpec);\n    }\n\n    function addTextNode(node, text) {\n        node.appendChild(document.createTextNode(text));\n    }\n\n    function exitNode(type) {\n        // A bare closing tag can't close the root node. If we encounter this it\n        // means there's an extra closing tag that can just be ignored:\n        if(nodeStack.length === 1) {\n            Lib.log('Ignoring unexpected end tag </' + type + '>.', str);\n            return;\n        }\n\n        var innerNode = nodeStack.pop();\n\n        if(type !== innerNode.type) {\n            Lib.log('Start tag <' + innerNode.type + '> doesnt match end tag <' +\n                type + '>. Pretending it did match.', str);\n        }\n        currentNode = nodeStack[nodeStack.length - 1].node;\n    }\n\n    var hasLines = BR_TAG.test(str);\n\n    if(hasLines) newLine();\n    else {\n        currentNode = containerNode;\n        nodeStack = [{node: containerNode}];\n    }\n\n    var parts = str.split(SPLIT_TAGS);\n    for(var i = 0; i < parts.length; i++) {\n        var parti = parts[i];\n        var match = parti.match(ONE_TAG);\n        var tagType = match && match[2].toLowerCase();\n        var tagStyle = TAG_STYLES[tagType];\n\n        if(tagType === 'br') {\n            newLine();\n        } else if(tagStyle === undefined) {\n            addTextNode(currentNode, convertEntities(parti));\n        } else {\n            // tag - open or close\n            if(match[1]) {\n                exitNode(tagType);\n            } else {\n                var extra = match[4];\n\n                var nodeSpec = {type: tagType};\n\n                // now add style, from both the tag name and any extra css\n                // Most of the svg css that users will care about is just like html,\n                // but font color is different (uses fill). Let our users ignore this.\n                var css = getQuotedMatch(extra, STYLEMATCH);\n                if(css) {\n                    css = css.replace(COLORMATCH, '$1 fill:');\n                    if(tagStyle) css += ';' + tagStyle;\n                } else if(tagStyle) css = tagStyle;\n\n                if(css) nodeSpec.style = css;\n\n                if(tagType === 'a') {\n                    hasLink = true;\n\n                    var href = getQuotedMatch(extra, HREFMATCH);\n\n                    if(href) {\n                        // check safe protocols\n                        var dummyAnchor = document.createElement('a');\n                        dummyAnchor.href = href;\n                        if(PROTOCOLS.indexOf(dummyAnchor.protocol) !== -1) {\n                            // Decode href to allow both already encoded and not encoded\n                            // URIs. Without decoding prior encoding, an already encoded\n                            // URI would be encoded twice producing a semantically different URI.\n                            nodeSpec.href = encodeURI(decodeURI(href));\n                            nodeSpec.target = getQuotedMatch(extra, TARGETMATCH) || '_blank';\n                            nodeSpec.popup = getQuotedMatch(extra, POPUPMATCH);\n                        }\n                    }\n                }\n\n                enterNode(nodeSpec);\n            }\n        }\n    }\n\n    return hasLink;\n}\n\n/*\n * sanitizeHTML: port of buildSVGText aimed at providing a clean subset of HTML\n * @param {string} str: the html string to clean\n * @returns {string}: a cleaned and normalized version of the input,\n *     supporting only a small subset of html\n */\nexports.sanitizeHTML = function sanitizeHTML(str) {\n    str = str.replace(NEWLINES, ' ');\n\n    var rootNode = document.createElement('p');\n    var currentNode = rootNode;\n    var nodeStack = [];\n\n    var parts = str.split(SPLIT_TAGS);\n    for(var i = 0; i < parts.length; i++) {\n        var parti = parts[i];\n        var match = parti.match(ONE_TAG);\n        var tagType = match && match[2].toLowerCase();\n\n        if(tagType in TAG_STYLES) {\n            if(match[1]) {\n                if(nodeStack.length) {\n                    currentNode = nodeStack.pop();\n                }\n            } else {\n                var extra = match[4];\n\n                var css = getQuotedMatch(extra, STYLEMATCH);\n                var nodeAttrs = css ? {style: css} : {};\n\n                if(tagType === 'a') {\n                    var href = getQuotedMatch(extra, HREFMATCH);\n\n                    if(href) {\n                        var dummyAnchor = document.createElement('a');\n                        dummyAnchor.href = href;\n                        if(PROTOCOLS.indexOf(dummyAnchor.protocol) !== -1) {\n                            nodeAttrs.href = encodeURI(decodeURI(href));\n                            var target = getQuotedMatch(extra, TARGETMATCH);\n                            if(target) {\n                                nodeAttrs.target = target;\n                            }\n                        }\n                    }\n                }\n\n                var newNode = document.createElement(tagType);\n                currentNode.appendChild(newNode);\n                d3.select(newNode).attr(nodeAttrs);\n\n                currentNode = newNode;\n                nodeStack.push(newNode);\n            }\n        } else {\n            currentNode.appendChild(\n                document.createTextNode(convertEntities(parti))\n            );\n        }\n    }\n    var key = 'innerHTML'; // i.e. to avoid pass test-syntax\n    return rootNode[key];\n};\n\nexports.lineCount = function lineCount(s) {\n    return s.selectAll('tspan.line').size() || 1;\n};\n\nexports.positionText = function positionText(s, x, y) {\n    return s.each(function() {\n        var text = d3.select(this);\n\n        function setOrGet(attr, val) {\n            if(val === undefined) {\n                val = text.attr(attr);\n                if(val === null) {\n                    text.attr(attr, 0);\n                    val = 0;\n                }\n            } else text.attr(attr, val);\n            return val;\n        }\n\n        var thisX = setOrGet('x', x);\n        var thisY = setOrGet('y', y);\n\n        if(this.nodeName === 'text') {\n            text.selectAll('tspan.line').attr({x: thisX, y: thisY});\n        }\n    });\n};\n\nfunction alignHTMLWith(_base, container, options) {\n    var alignH = options.horizontalAlign;\n    var alignV = options.verticalAlign || 'top';\n    var bRect = _base.node().getBoundingClientRect();\n    var cRect = container.node().getBoundingClientRect();\n    var thisRect;\n    var getTop;\n    var getLeft;\n\n    if(alignV === 'bottom') {\n        getTop = function() { return bRect.bottom - thisRect.height; };\n    } else if(alignV === 'middle') {\n        getTop = function() { return bRect.top + (bRect.height - thisRect.height) / 2; };\n    } else { // default: top\n        getTop = function() { return bRect.top; };\n    }\n\n    if(alignH === 'right') {\n        getLeft = function() { return bRect.right - thisRect.width; };\n    } else if(alignH === 'center') {\n        getLeft = function() { return bRect.left + (bRect.width - thisRect.width) / 2; };\n    } else { // default: left\n        getLeft = function() { return bRect.left; };\n    }\n\n    return function() {\n        thisRect = this.node().getBoundingClientRect();\n        this.style({\n            top: (getTop() - cRect.top) + 'px',\n            left: (getLeft() - cRect.left) + 'px',\n            'z-index': 1000\n        });\n        return this;\n    };\n}\n\n/*\n * Editable title\n * @param {d3.selection} context: the element being edited. Normally text,\n *   but if it isn't, you should provide the styling options\n * @param {object} options:\n *   @param {div} options.gd: graphDiv\n *   @param {d3.selection} options.delegate: item to bind events to if not this\n *   @param {boolean} options.immediate: start editing now (true) or on click (false, default)\n *   @param {string} options.fill: font color if not as shown\n *   @param {string} options.background: background color if not as shown\n *   @param {string} options.text: initial text, if not as shown\n *   @param {string} options.horizontalAlign: alignment of the edit box wrt. the bound element\n *   @param {string} options.verticalAlign: alignment of the edit box wrt. the bound element\n */\n\nexports.makeEditable = function(context, options) {\n    var gd = options.gd;\n    var _delegate = options.delegate;\n    var dispatch = d3.dispatch('edit', 'input', 'cancel');\n    var handlerElement = _delegate || context;\n\n    context.style({'pointer-events': _delegate ? 'none' : 'all'});\n\n    if(context.size() !== 1) throw new Error('boo');\n\n    function handleClick() {\n        appendEditable();\n        context.style({opacity: 0});\n        // also hide any mathjax svg\n        var svgClass = handlerElement.attr('class');\n        var mathjaxClass;\n        if(svgClass) mathjaxClass = '.' + svgClass.split(' ')[0] + '-math-group';\n        else mathjaxClass = '[class*=-math-group]';\n        if(mathjaxClass) {\n            d3.select(context.node().parentNode).select(mathjaxClass).style({opacity: 0});\n        }\n    }\n\n    function selectElementContents(_el) {\n        var el = _el.node();\n        var range = document.createRange();\n        range.selectNodeContents(el);\n        var sel = window.getSelection();\n        sel.removeAllRanges();\n        sel.addRange(range);\n        el.focus();\n    }\n\n    function appendEditable() {\n        var plotDiv = d3.select(gd);\n        var container = plotDiv.select('.svg-container');\n        var div = container.append('div');\n        var cStyle = context.node().style;\n        var fontSize = parseFloat(cStyle.fontSize || 12);\n\n        var initialText = options.text;\n        if(initialText === undefined) initialText = context.attr('data-unformatted');\n\n        div.classed('plugin-editable editable', true)\n            .style({\n                position: 'absolute',\n                'font-family': cStyle.fontFamily || 'Arial',\n                'font-size': fontSize,\n                color: options.fill || cStyle.fill || 'black',\n                opacity: 1,\n                'background-color': options.background || 'transparent',\n                outline: '#ffffff33 1px solid',\n                margin: [-fontSize / 8 + 1, 0, 0, -1].join('px ') + 'px',\n                padding: '0',\n                'box-sizing': 'border-box'\n            })\n            .attr({contenteditable: true})\n            .text(initialText)\n            .call(alignHTMLWith(context, container, options))\n            .on('blur', function() {\n                gd._editing = false;\n                context.text(this.textContent)\n                    .style({opacity: 1});\n                var svgClass = d3.select(this).attr('class');\n                var mathjaxClass;\n                if(svgClass) mathjaxClass = '.' + svgClass.split(' ')[0] + '-math-group';\n                else mathjaxClass = '[class*=-math-group]';\n                if(mathjaxClass) {\n                    d3.select(context.node().parentNode).select(mathjaxClass).style({opacity: 0});\n                }\n                var text = this.textContent;\n                d3.select(this).transition().duration(0).remove();\n                d3.select(document).on('mouseup', null);\n                dispatch.edit.call(context, text);\n            })\n            .on('focus', function() {\n                var editDiv = this;\n                gd._editing = true;\n                d3.select(document).on('mouseup', function() {\n                    if(d3.event.target === editDiv) return false;\n                    if(document.activeElement === div.node()) div.node().blur();\n                });\n            })\n            .on('keyup', function() {\n                if(d3.event.which === 27) {\n                    gd._editing = false;\n                    context.style({opacity: 1});\n                    d3.select(this)\n                        .style({opacity: 0})\n                        .on('blur', function() { return false; })\n                        .transition().remove();\n                    dispatch.cancel.call(context, this.textContent);\n                } else {\n                    dispatch.input.call(context, this.textContent);\n                    d3.select(this).call(alignHTMLWith(context, container, options));\n                }\n            })\n            .on('keydown', function() {\n                if(d3.event.which === 13) this.blur();\n            })\n            .call(selectElementContents);\n    }\n\n    if(options.immediate) handleClick();\n    else handlerElement.on('click', handleClick);\n\n    return d3.rebind(context, dispatch, 'on');\n};\n\n},{\"../constants/alignment\":154,\"../constants/xmlns_namespaces\":159,\"../lib\":178,\"d3\":16}],200:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar timerCache = {};\n\n/**\n * Throttle a callback. `callback` executes synchronously only if\n * more than `minInterval` milliseconds have already elapsed since the latest\n * call (if any). Otherwise we wait until `minInterval` is over and execute the\n * last callback received while waiting.\n * So the first and last events in a train are always executed (eventually)\n * but some of the events in the middle can be dropped.\n *\n * @param {string} id: an identifier to mark events to throttle together\n * @param {number} minInterval: minimum time, in milliseconds, between\n *   invocations of `callback`\n * @param {function} callback: the function to throttle. `callback` itself\n *   should be a purely synchronous function.\n */\nexports.throttle = function throttle(id, minInterval, callback) {\n    var cache = timerCache[id];\n    var now = Date.now();\n\n    if(!cache) {\n        /*\n         * Throw out old items before making a new one, to prevent the cache\n         * getting overgrown, for example from old plots that have been replaced.\n         * 1 minute age is arbitrary.\n         */\n        for(var idi in timerCache) {\n            if(timerCache[idi].ts < now - 60000) {\n                delete timerCache[idi];\n            }\n        }\n        cache = timerCache[id] = {ts: 0, timer: null};\n    }\n\n    _clearTimeout(cache);\n\n    function exec() {\n        callback();\n        cache.ts = Date.now();\n        if(cache.onDone) {\n            cache.onDone();\n            cache.onDone = null;\n        }\n    }\n\n    if(now > cache.ts + minInterval) {\n        exec();\n        return;\n    }\n\n    cache.timer = setTimeout(function() {\n        exec();\n        cache.timer = null;\n    }, minInterval);\n};\n\nexports.done = function(id) {\n    var cache = timerCache[id];\n    if(!cache || !cache.timer) return Promise.resolve();\n\n    return new Promise(function(resolve) {\n        var previousOnDone = cache.onDone;\n        cache.onDone = function onDone() {\n            if(previousOnDone) previousOnDone();\n            resolve();\n            cache.onDone = null;\n        };\n    });\n};\n\n/**\n * Clear the throttle cache for one or all timers\n * @param {optional string} id:\n *   if provided, clear just this timer\n *   if omitted, clear all timers (mainly useful for testing)\n */\nexports.clear = function(id) {\n    if(id) {\n        _clearTimeout(timerCache[id]);\n        delete timerCache[id];\n    } else {\n        for(var idi in timerCache) exports.clear(idi);\n    }\n};\n\nfunction _clearTimeout(cache) {\n    if(cache && cache.timer !== null) {\n        clearTimeout(cache.timer);\n        cache.timer = null;\n    }\n}\n\n},{}],201:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\n/**\n * convert a linear value into a logged value, folding negative numbers into\n * the given range\n */\nmodule.exports = function toLogRange(val, range) {\n    if(val > 0) return Math.log(val) / Math.LN10;\n\n    // move a negative value reference to a log axis - just put the\n    // result at the lowest range value on the plot (or if the range also went negative,\n    // one millionth of the top of the range)\n    var newVal = Math.log(Math.min(range[0], range[1])) / Math.LN10;\n    if(!isNumeric(newVal)) newVal = Math.log(Math.max(range[0], range[1])) / Math.LN10 - 6;\n    return newVal;\n};\n\n},{\"fast-isnumeric\":18}],202:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    moduleType: 'locale',\n    name: 'en-US',\n    dictionary: {\n        'Click to enter Colorscale title': 'Click to enter Colorscale title'\n    },\n    format: {\n        date: '%m/%d/%Y'\n    }\n};\n\n},{}],203:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    moduleType: 'locale',\n    name: 'en',\n    dictionary: {\n        'Click to enter Colorscale title': 'Click to enter Colourscale title'\n    },\n    format: {\n        days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n        shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n        months: [\n            'January', 'February', 'March', 'April', 'May', 'June',\n            'July', 'August', 'September', 'October', 'November', 'December'\n        ],\n        shortMonths: [\n            'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n        ],\n        periods: ['AM', 'PM'],\n        dateTime: '%a %b %e %X %Y',\n        date: '%d/%m/%Y',\n        time: '%H:%M:%S',\n        decimal: '.',\n        thousands: ',',\n        grouping: [3],\n        currency: ['$', ''],\n        year: '%Y',\n        month: '%b %Y',\n        dayMonth: '%b %-d',\n        dayMonthYear: '%b %-d, %Y'\n    }\n};\n\n},{}],204:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\n\n/*\n * containerArrayMatch: does this attribute string point into a\n * layout container array?\n *\n * @param {String} astr: an attribute string, like *annotations[2].text*\n *\n * @returns {Object | false} Returns false if `astr` doesn't match a container\n *  array. If it does, returns:\n *     {array: {String}, index: {Number}, property: {String}}\n *  ie the attribute string for the array, the index within the array (or ''\n *  if the whole array) and the property within that (or '' if the whole array\n *  or the whole object)\n */\nmodule.exports = function containerArrayMatch(astr) {\n    var rootContainers = Registry.layoutArrayContainers;\n    var regexpContainers = Registry.layoutArrayRegexes;\n    var rootPart = astr.split('[')[0];\n    var arrayStr;\n    var match;\n\n    // look for regexp matches first, because they may be nested inside root matches\n    // eg updatemenus[i].buttons is nested inside updatemenus\n    for(var i = 0; i < regexpContainers.length; i++) {\n        match = astr.match(regexpContainers[i]);\n        if(match && match.index === 0) {\n            arrayStr = match[0];\n            break;\n        }\n    }\n\n    // now look for root matches\n    if(!arrayStr) arrayStr = rootContainers[rootContainers.indexOf(rootPart)];\n\n    if(!arrayStr) return false;\n\n    var tail = astr.substr(arrayStr.length);\n    if(!tail) return {array: arrayStr, index: '', property: ''};\n\n    match = tail.match(/^\\[(0|[1-9][0-9]*)\\](\\.(.+))?$/);\n    if(!match) return false;\n\n    return {array: arrayStr, index: Number(match[1]), property: match[3] || ''};\n};\n\n},{\"../registry\":269}],205:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar extendFlat = Lib.extendFlat;\nvar isPlainObject = Lib.isPlainObject;\n\nvar traceOpts = {\n    valType: 'flaglist',\n    extras: ['none'],\n    flags: ['calc', 'clearAxisTypes', 'plot', 'style', 'markerSize', 'colorbars'],\n    \n};\n\nvar layoutOpts = {\n    valType: 'flaglist',\n    extras: ['none'],\n    flags: [\n        'calc', 'plot', 'legend', 'ticks', 'axrange',\n        'layoutstyle', 'modebar', 'camera', 'arraydraw', 'colorbars'\n    ],\n    \n};\n\n// flags for inside restyle/relayout include a few extras\n// that shouldn't be used in attributes, to deal with certain\n// combinations and conditionals efficiently\nvar traceEditTypeFlags = traceOpts.flags.slice()\n    .concat(['fullReplot']);\n\nvar layoutEditTypeFlags = layoutOpts.flags.slice()\n    .concat('layoutReplot');\n\nmodule.exports = {\n    traces: traceOpts,\n    layout: layoutOpts,\n    /*\n     * default (all false) edit flags for restyle (traces)\n     * creates a new object each call, so the caller can mutate freely\n     */\n    traceFlags: function() { return falseObj(traceEditTypeFlags); },\n\n    /*\n     * default (all false) edit flags for relayout\n     * creates a new object each call, so the caller can mutate freely\n     */\n    layoutFlags: function() { return falseObj(layoutEditTypeFlags); },\n\n    /*\n     * update `flags` with the `editType` values found in `attr`\n     */\n    update: function(flags, attr) {\n        var editType = attr.editType;\n        if(editType && editType !== 'none') {\n            var editTypeParts = editType.split('+');\n            for(var i = 0; i < editTypeParts.length; i++) {\n                flags[editTypeParts[i]] = true;\n            }\n        }\n    },\n\n    overrideAll: overrideAll\n};\n\nfunction falseObj(keys) {\n    var out = {};\n    for(var i = 0; i < keys.length; i++) out[keys[i]] = false;\n    return out;\n}\n\n/**\n * For attributes that are largely copied from elsewhere into a plot type that doesn't\n * support partial redraws - overrides the editType field of all attributes in the object\n *\n * @param {object} attrs: the attributes to override. Will not be mutated.\n * @param {string} editTypeOverride: the new editType to use\n * @param {'nested'|'from-root'} overrideContainers:\n *   - 'nested' will override editType for nested containers but not the root.\n *   - 'from-root' will also override editType of the root container.\n *   Containers below the absolute top level (trace or layout root) DO need an\n *   editType even if they are not `valObject`s themselves (eg `scatter.marker`)\n *   to handle the case where you edit the whole container.\n *\n * @return {object} a new attributes object with `editType` modified as directed\n */\nfunction overrideAll(attrs, editTypeOverride, overrideContainers) {\n    var out = extendFlat({}, attrs);\n    for(var key in out) {\n        var attr = out[key];\n        if(isPlainObject(attr)) {\n            out[key] = overrideOne(attr, editTypeOverride, overrideContainers, key);\n        }\n    }\n    if(overrideContainers === 'from-root') out.editType = editTypeOverride;\n\n    return out;\n}\n\nfunction overrideOne(attr, editTypeOverride, overrideContainers, key) {\n    if(attr.valType) {\n        var out = extendFlat({}, attr);\n        out.editType = editTypeOverride;\n\n        if(Array.isArray(attr.items)) {\n            out.items = new Array(attr.items.length);\n            for(var i = 0; i < attr.items.length; i++) {\n                out.items[i] = overrideOne(attr.items[i], editTypeOverride, 'from-root');\n            }\n        }\n        return out;\n    } else {\n        // don't provide an editType for the _deprecated container\n        return overrideAll(attr, editTypeOverride,\n            (key.charAt(0) === '_') ? 'nested' : 'from-root');\n    }\n}\n\n},{\"../lib\":178}],206:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar m4FromQuat = _dereq_('gl-mat4/fromQuat');\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\nvar Plots = _dereq_('../plots/plots');\nvar AxisIds = _dereq_('../plots/cartesian/axis_ids');\nvar Color = _dereq_('../components/color');\n\nvar cleanId = AxisIds.cleanId;\nvar getFromTrace = AxisIds.getFromTrace;\nvar traceIs = Registry.traceIs;\n\n// clear the promise queue if one of them got rejected\nexports.clearPromiseQueue = function(gd) {\n    if(Array.isArray(gd._promises) && gd._promises.length > 0) {\n        Lib.log('Clearing previous rejected promises from queue.');\n    }\n\n    gd._promises = [];\n};\n\n// make a few changes to the layout right away\n// before it gets used for anything\n// backward compatibility and cleanup of nonstandard options\nexports.cleanLayout = function(layout) {\n    var i, j;\n\n    if(!layout) layout = {};\n\n    // cannot have (x|y)axis1, numbering goes axis, axis2, axis3...\n    if(layout.xaxis1) {\n        if(!layout.xaxis) layout.xaxis = layout.xaxis1;\n        delete layout.xaxis1;\n    }\n    if(layout.yaxis1) {\n        if(!layout.yaxis) layout.yaxis = layout.yaxis1;\n        delete layout.yaxis1;\n    }\n    if(layout.scene1) {\n        if(!layout.scene) layout.scene = layout.scene1;\n        delete layout.scene1;\n    }\n\n    var axisAttrRegex = (Plots.subplotsRegistry.cartesian || {}).attrRegex;\n    var polarAttrRegex = (Plots.subplotsRegistry.polar || {}).attrRegex;\n    var ternaryAttrRegex = (Plots.subplotsRegistry.ternary || {}).attrRegex;\n    var sceneAttrRegex = (Plots.subplotsRegistry.gl3d || {}).attrRegex;\n\n    var keys = Object.keys(layout);\n    for(i = 0; i < keys.length; i++) {\n        var key = keys[i];\n\n        if(axisAttrRegex && axisAttrRegex.test(key)) {\n            // modifications to cartesian axes\n\n            var ax = layout[key];\n            if(ax.anchor && ax.anchor !== 'free') {\n                ax.anchor = cleanId(ax.anchor);\n            }\n            if(ax.overlaying) ax.overlaying = cleanId(ax.overlaying);\n\n            // old method of axis type - isdate and islog (before category existed)\n            if(!ax.type) {\n                if(ax.isdate) ax.type = 'date';\n                else if(ax.islog) ax.type = 'log';\n                else if(ax.isdate === false && ax.islog === false) ax.type = 'linear';\n            }\n            if(ax.autorange === 'withzero' || ax.autorange === 'tozero') {\n                ax.autorange = true;\n                ax.rangemode = 'tozero';\n            }\n            delete ax.islog;\n            delete ax.isdate;\n            delete ax.categories; // replaced by _categories\n\n            // prune empty domain arrays made before the new nestedProperty\n            if(emptyContainer(ax, 'domain')) delete ax.domain;\n\n            // autotick -> tickmode\n            if(ax.autotick !== undefined) {\n                if(ax.tickmode === undefined) {\n                    ax.tickmode = ax.autotick ? 'auto' : 'linear';\n                }\n                delete ax.autotick;\n            }\n\n            cleanTitle(ax);\n        } else if(polarAttrRegex && polarAttrRegex.test(key)) {\n            // modifications for polar\n\n            var polar = layout[key];\n            cleanTitle(polar.radialaxis);\n        } else if(ternaryAttrRegex && ternaryAttrRegex.test(key)) {\n            // modifications for ternary\n\n            var ternary = layout[key];\n            cleanTitle(ternary.aaxis);\n            cleanTitle(ternary.baxis);\n            cleanTitle(ternary.caxis);\n        } else if(sceneAttrRegex && sceneAttrRegex.test(key)) {\n            // modifications for 3D scenes\n\n            var scene = layout[key];\n\n            // clean old Camera coords\n            var cameraposition = scene.cameraposition;\n\n            if(Array.isArray(cameraposition) && cameraposition[0].length === 4) {\n                var rotation = cameraposition[0];\n                var center = cameraposition[1];\n                var radius = cameraposition[2];\n                var mat = m4FromQuat([], rotation);\n                var eye = [];\n\n                for(j = 0; j < 3; ++j) {\n                    eye[j] = center[j] + radius * mat[2 + 4 * j];\n                }\n\n                scene.camera = {\n                    eye: {x: eye[0], y: eye[1], z: eye[2]},\n                    center: {x: center[0], y: center[1], z: center[2]},\n                    up: {x: 0, y: 0, z: 1} // we just ignore calculating camera z up in this case\n                };\n\n                delete scene.cameraposition;\n            }\n\n            // clean axis titles\n            cleanTitle(scene.xaxis);\n            cleanTitle(scene.yaxis);\n            cleanTitle(scene.zaxis);\n        }\n    }\n\n    var annotationsLen = Array.isArray(layout.annotations) ? layout.annotations.length : 0;\n    for(i = 0; i < annotationsLen; i++) {\n        var ann = layout.annotations[i];\n\n        if(!Lib.isPlainObject(ann)) continue;\n\n        if(ann.ref) {\n            if(ann.ref === 'paper') {\n                ann.xref = 'paper';\n                ann.yref = 'paper';\n            } else if(ann.ref === 'data') {\n                ann.xref = 'x';\n                ann.yref = 'y';\n            }\n            delete ann.ref;\n        }\n\n        cleanAxRef(ann, 'xref');\n        cleanAxRef(ann, 'yref');\n    }\n\n    var shapesLen = Array.isArray(layout.shapes) ? layout.shapes.length : 0;\n    for(i = 0; i < shapesLen; i++) {\n        var shape = layout.shapes[i];\n\n        if(!Lib.isPlainObject(shape)) continue;\n\n        cleanAxRef(shape, 'xref');\n        cleanAxRef(shape, 'yref');\n    }\n\n    var legend = layout.legend;\n    if(legend) {\n        // check for old-style legend positioning (x or y is +/- 100)\n        if(legend.x > 3) {\n            legend.x = 1.02;\n            legend.xanchor = 'left';\n        } else if(legend.x < -2) {\n            legend.x = -0.02;\n            legend.xanchor = 'right';\n        }\n\n        if(legend.y > 3) {\n            legend.y = 1.02;\n            legend.yanchor = 'bottom';\n        } else if(legend.y < -2) {\n            legend.y = -0.02;\n            legend.yanchor = 'top';\n        }\n    }\n\n    // clean plot title\n    cleanTitle(layout);\n\n    /*\n     * Moved from rotate -> orbit for dragmode\n     */\n    if(layout.dragmode === 'rotate') layout.dragmode = 'orbit';\n\n    // sanitize rgb(fractions) and rgba(fractions) that old tinycolor\n    // supported, but new tinycolor does not because they're not valid css\n    Color.clean(layout);\n\n    // clean the layout container in layout.template\n    if(layout.template && layout.template.layout) {\n        exports.cleanLayout(layout.template.layout);\n    }\n\n    return layout;\n};\n\nfunction cleanAxRef(container, attr) {\n    var valIn = container[attr];\n    var axLetter = attr.charAt(0);\n    if(valIn && valIn !== 'paper') {\n        container[attr] = cleanId(valIn, axLetter);\n    }\n}\n\n/**\n * Cleans up old title attribute structure (flat) in favor of the new one (nested).\n *\n * @param {Object} titleContainer - an object potentially including deprecated title attributes\n */\nfunction cleanTitle(titleContainer) {\n    if(titleContainer) {\n        // title -> title.text\n        // (although title used to be a string attribute,\n        // numbers are accepted as well)\n        if(typeof titleContainer.title === 'string' || typeof titleContainer.title === 'number') {\n            titleContainer.title = {\n                text: titleContainer.title\n            };\n        }\n\n        rewireAttr('titlefont', 'font');\n        rewireAttr('titleposition', 'position');\n        rewireAttr('titleside', 'side');\n        rewireAttr('titleoffset', 'offset');\n    }\n\n    function rewireAttr(oldAttrName, newAttrName) {\n        var oldAttrSet = titleContainer[oldAttrName];\n        var newAttrSet = titleContainer.title && titleContainer.title[newAttrName];\n\n        if(oldAttrSet && !newAttrSet) {\n            // Ensure title object exists\n            if(!titleContainer.title) {\n                titleContainer.title = {};\n            }\n\n            titleContainer.title[newAttrName] = titleContainer[oldAttrName];\n            delete titleContainer[oldAttrName];\n        }\n    }\n}\n\n/*\n * cleanData: Make a few changes to the data for backward compatibility\n * before it gets used for anything. Modifies the data traces users provide.\n *\n * Important: if you're going to add something here that modifies a data array,\n * update it in place so the new array === the old one.\n */\nexports.cleanData = function(data) {\n    for(var tracei = 0; tracei < data.length; tracei++) {\n        var trace = data[tracei];\n        var i;\n\n        // use xbins to bin data in x, and ybins to bin data in y\n        if(trace.type === 'histogramy' && 'xbins' in trace && !('ybins' in trace)) {\n            trace.ybins = trace.xbins;\n            delete trace.xbins;\n        }\n\n        // error_y.opacity is obsolete - merge into color\n        if(trace.error_y && 'opacity' in trace.error_y) {\n            var dc = Color.defaults;\n            var yeColor = trace.error_y.color || (traceIs(trace, 'bar') ?\n                Color.defaultLine :\n                dc[tracei % dc.length]);\n            trace.error_y.color = Color.addOpacity(\n                Color.rgb(yeColor),\n                Color.opacity(yeColor) * trace.error_y.opacity);\n            delete trace.error_y.opacity;\n        }\n\n        // convert bardir to orientation, and put the data into\n        // the axes it's eventually going to be used with\n        if('bardir' in trace) {\n            if(trace.bardir === 'h' && (traceIs(trace, 'bar') ||\n                trace.type.substr(0, 9) === 'histogram')) {\n                trace.orientation = 'h';\n                exports.swapXYData(trace);\n            }\n            delete trace.bardir;\n        }\n\n        // now we have only one 1D histogram type, and whether\n        // it uses x or y data depends on trace.orientation\n        if(trace.type === 'histogramy') exports.swapXYData(trace);\n        if(trace.type === 'histogramx' || trace.type === 'histogramy') {\n            trace.type = 'histogram';\n        }\n\n        // scl->scale, reversescl->reversescale\n        if('scl' in trace && !('colorscale' in trace)) {\n            trace.colorscale = trace.scl;\n            delete trace.scl;\n        }\n        if('reversescl' in trace && !('reversescale' in trace)) {\n            trace.reversescale = trace.reversescl;\n            delete trace.reversescl;\n        }\n\n        // axis ids x1 -> x, y1-> y\n        if(trace.xaxis) trace.xaxis = cleanId(trace.xaxis, 'x');\n        if(trace.yaxis) trace.yaxis = cleanId(trace.yaxis, 'y');\n\n        // scene ids scene1 -> scene\n        if(traceIs(trace, 'gl3d') && trace.scene) {\n            trace.scene = Plots.subplotsRegistry.gl3d.cleanId(trace.scene);\n        }\n\n        if(!traceIs(trace, 'pie-like') && !traceIs(trace, 'bar-like')) {\n            if(Array.isArray(trace.textposition)) {\n                for(i = 0; i < trace.textposition.length; i++) {\n                    trace.textposition[i] = cleanTextPosition(trace.textposition[i]);\n                }\n            } else if(trace.textposition) {\n                trace.textposition = cleanTextPosition(trace.textposition);\n            }\n        }\n\n        // fix typo in colorscale definition\n        var _module = Registry.getModule(trace);\n        if(_module && _module.colorbar) {\n            var containerName = _module.colorbar.container;\n            var container = containerName ? trace[containerName] : trace;\n            if(container && container.colorscale) {\n                if(container.colorscale === 'YIGnBu') container.colorscale = 'YlGnBu';\n                if(container.colorscale === 'YIOrRd') container.colorscale = 'YlOrRd';\n            }\n        }\n\n        // fix typo in surface 'highlight*' definitions\n        if(trace.type === 'surface' && Lib.isPlainObject(trace.contours)) {\n            var dims = ['x', 'y', 'z'];\n\n            for(i = 0; i < dims.length; i++) {\n                var opts = trace.contours[dims[i]];\n\n                if(!Lib.isPlainObject(opts)) continue;\n\n                if(opts.highlightColor) {\n                    opts.highlightcolor = opts.highlightColor;\n                    delete opts.highlightColor;\n                }\n\n                if(opts.highlightWidth) {\n                    opts.highlightwidth = opts.highlightWidth;\n                    delete opts.highlightWidth;\n                }\n            }\n        }\n\n        // fixes from converting finance from transforms to real trace types\n        if(trace.type === 'candlestick' || trace.type === 'ohlc') {\n            var increasingShowlegend = (trace.increasing || {}).showlegend !== false;\n            var decreasingShowlegend = (trace.decreasing || {}).showlegend !== false;\n            var increasingName = cleanFinanceDir(trace.increasing);\n            var decreasingName = cleanFinanceDir(trace.decreasing);\n\n            // now figure out something smart to do with the separate direction\n            // names we removed\n            if((increasingName !== false) && (decreasingName !== false)) {\n                // both sub-names existed: base name previously had no effect\n                // so ignore it and try to find a shared part of the sub-names\n\n                var newName = commonPrefix(\n                    increasingName, decreasingName,\n                    increasingShowlegend, decreasingShowlegend\n                );\n                // if no common part, leave whatever name was (or wasn't) there\n                if(newName) trace.name = newName;\n            } else if((increasingName || decreasingName) && !trace.name) {\n                // one sub-name existed but not the base name - just use the sub-name\n                trace.name = increasingName || decreasingName;\n            }\n        }\n\n        // transforms backward compatibility fixes\n        if(Array.isArray(trace.transforms)) {\n            var transforms = trace.transforms;\n\n            for(i = 0; i < transforms.length; i++) {\n                var transform = transforms[i];\n\n                if(!Lib.isPlainObject(transform)) continue;\n\n                switch(transform.type) {\n                    case 'filter':\n                        if(transform.filtersrc) {\n                            transform.target = transform.filtersrc;\n                            delete transform.filtersrc;\n                        }\n\n                        if(transform.calendar) {\n                            if(!transform.valuecalendar) {\n                                transform.valuecalendar = transform.calendar;\n                            }\n                            delete transform.calendar;\n                        }\n                        break;\n\n                    case 'groupby':\n                        // Name has changed from `style` to `styles`, so use `style` but prefer `styles`:\n                        transform.styles = transform.styles || transform.style;\n\n                        if(transform.styles && !Array.isArray(transform.styles)) {\n                            var prevStyles = transform.styles;\n                            var styleKeys = Object.keys(prevStyles);\n\n                            transform.styles = [];\n                            for(var j = 0; j < styleKeys.length; j++) {\n                                transform.styles.push({\n                                    target: styleKeys[j],\n                                    value: prevStyles[styleKeys[j]]\n                                });\n                            }\n                        }\n                        break;\n                }\n            }\n        }\n\n        // prune empty containers made before the new nestedProperty\n        if(emptyContainer(trace, 'line')) delete trace.line;\n        if('marker' in trace) {\n            if(emptyContainer(trace.marker, 'line')) delete trace.marker.line;\n            if(emptyContainer(trace, 'marker')) delete trace.marker;\n        }\n\n        // sanitize rgb(fractions) and rgba(fractions) that old tinycolor\n        // supported, but new tinycolor does not because they're not valid css\n        Color.clean(trace);\n\n        // remove obsolete autobin(x|y) attributes, but only if true\n        // if false, this needs to happen in Histogram.calc because it\n        // can be a one-time autobin so we need to know the results before\n        // we can push them back into the trace.\n        if(trace.autobinx) {\n            delete trace.autobinx;\n            delete trace.xbins;\n        }\n        if(trace.autobiny) {\n            delete trace.autobiny;\n            delete trace.ybins;\n        }\n\n        cleanTitle(trace);\n        if(trace.colorbar) cleanTitle(trace.colorbar);\n        if(trace.marker && trace.marker.colorbar) cleanTitle(trace.marker.colorbar);\n        if(trace.line && trace.line.colorbar) cleanTitle(trace.line.colorbar);\n        if(trace.aaxis) cleanTitle(trace.aaxis);\n        if(trace.baxis) cleanTitle(trace.baxis);\n    }\n};\n\nfunction cleanFinanceDir(dirContainer) {\n    if(!Lib.isPlainObject(dirContainer)) return false;\n\n    var dirName = dirContainer.name;\n\n    delete dirContainer.name;\n    delete dirContainer.showlegend;\n\n    return (typeof dirName === 'string' || typeof dirName === 'number') && String(dirName);\n}\n\nfunction commonPrefix(name1, name2, show1, show2) {\n    // if only one is shown in the legend, use that\n    if(show1 && !show2) return name1;\n    if(show2 && !show1) return name2;\n\n    // if both or neither are in the legend, check if one is blank (or whitespace)\n    // and use the other one\n    // note that hover labels can still use the name even if the legend doesn't\n    if(!name1.trim()) return name2;\n    if(!name2.trim()) return name1;\n\n    var minLen = Math.min(name1.length, name2.length);\n    var i;\n    for(i = 0; i < minLen; i++) {\n        if(name1.charAt(i) !== name2.charAt(i)) break;\n    }\n\n    var out = name1.substr(0, i);\n    return out.trim();\n}\n\n// textposition - support partial attributes (ie just 'top')\n// and incorrect use of middle / center etc.\nfunction cleanTextPosition(textposition) {\n    var posY = 'middle';\n    var posX = 'center';\n\n    if(typeof textposition === 'string') {\n        if(textposition.indexOf('top') !== -1) posY = 'top';\n        else if(textposition.indexOf('bottom') !== -1) posY = 'bottom';\n\n        if(textposition.indexOf('left') !== -1) posX = 'left';\n        else if(textposition.indexOf('right') !== -1) posX = 'right';\n    }\n\n    return posY + ' ' + posX;\n}\n\nfunction emptyContainer(outer, innerStr) {\n    return (innerStr in outer) &&\n        (typeof outer[innerStr] === 'object') &&\n        (Object.keys(outer[innerStr]).length === 0);\n}\n\n\n// swap all the data and data attributes associated with x and y\nexports.swapXYData = function(trace) {\n    var i;\n    Lib.swapAttrs(trace, ['?', '?0', 'd?', '?bins', 'nbins?', 'autobin?', '?src', 'error_?']);\n    if(Array.isArray(trace.z) && Array.isArray(trace.z[0])) {\n        if(trace.transpose) delete trace.transpose;\n        else trace.transpose = true;\n    }\n    if(trace.error_x && trace.error_y) {\n        var errorY = trace.error_y;\n        var copyYstyle = ('copy_ystyle' in errorY) ?\n            errorY.copy_ystyle :\n            !(errorY.color || errorY.thickness || errorY.width);\n        Lib.swapAttrs(trace, ['error_?.copy_ystyle']);\n        if(copyYstyle) {\n            Lib.swapAttrs(trace, ['error_?.color', 'error_?.thickness', 'error_?.width']);\n        }\n    }\n    if(typeof trace.hoverinfo === 'string') {\n        var hoverInfoParts = trace.hoverinfo.split('+');\n        for(i = 0; i < hoverInfoParts.length; i++) {\n            if(hoverInfoParts[i] === 'x') hoverInfoParts[i] = 'y';\n            else if(hoverInfoParts[i] === 'y') hoverInfoParts[i] = 'x';\n        }\n        trace.hoverinfo = hoverInfoParts.join('+');\n    }\n};\n\n// coerce traceIndices input to array of trace indices\nexports.coerceTraceIndices = function(gd, traceIndices) {\n    if(isNumeric(traceIndices)) {\n        return [traceIndices];\n    } else if(!Array.isArray(traceIndices) || !traceIndices.length) {\n        return gd.data.map(function(_, i) { return i; });\n    } else if(Array.isArray(traceIndices)) {\n        var traceIndicesOut = [];\n        for(var i = 0; i < traceIndices.length; i++) {\n            if(Lib.isIndex(traceIndices[i], gd.data.length)) {\n                traceIndicesOut.push(traceIndices[i]);\n            } else {\n                Lib.warn('trace index (', traceIndices[i], ') is not a number or is out of bounds');\n            }\n        }\n        return traceIndicesOut;\n    }\n\n    return traceIndices;\n};\n\n/**\n * Manages logic around array container item creation / deletion / update\n * that nested property alone can't handle.\n *\n * @param {Object} np\n *  nested property of update attribute string about trace or layout object\n * @param {*} newVal\n *  update value passed to restyle / relayout / update\n * @param {Object} undoit\n *  undo hash (N.B. undoit may be mutated here).\n *\n */\nexports.manageArrayContainers = function(np, newVal, undoit) {\n    var obj = np.obj;\n    var parts = np.parts;\n    var pLength = parts.length;\n    var pLast = parts[pLength - 1];\n\n    var pLastIsNumber = isNumeric(pLast);\n\n    if(pLastIsNumber && newVal === null) {\n        // delete item\n\n        // Clear item in array container when new value is null\n        var contPath = parts.slice(0, pLength - 1).join('.');\n        var cont = Lib.nestedProperty(obj, contPath).get();\n        cont.splice(pLast, 1);\n\n        // Note that nested property clears null / undefined at end of\n        // array container, but not within them.\n    } else if(pLastIsNumber && np.get() === undefined) {\n        // create item\n\n        // When adding a new item, make sure undo command will remove it\n        if(np.get() === undefined) undoit[np.astr] = null;\n\n        np.set(newVal);\n    } else {\n        // update item\n\n        // If the last part of attribute string isn't a number,\n        // np.set is all we need.\n        np.set(newVal);\n    }\n};\n\n/*\n * Match the part to strip off to turn an attribute into its parent\n * really it should be either '.some_characters' or '[number]'\n * but we're a little more permissive here and match either\n * '.not_brackets_or_dot' or '[not_brackets_or_dot]'\n */\nvar ATTR_TAIL_RE = /(\\.[^\\[\\]\\.]+|\\[[^\\[\\]\\.]+\\])$/;\n\nfunction getParent(attr) {\n    var tail = attr.search(ATTR_TAIL_RE);\n    if(tail > 0) return attr.substr(0, tail);\n}\n\n/*\n * hasParent: does an attribute object contain a parent of the given attribute?\n * for example, given 'images[2].x' do we also have 'images' or 'images[2]'?\n *\n * @param {Object} aobj\n *  update object, whose keys are attribute strings and values are their new settings\n * @param {string} attr\n *  the attribute string to test against\n * @returns {Boolean}\n *  is a parent of attr present in aobj?\n */\nexports.hasParent = function(aobj, attr) {\n    var attrParent = getParent(attr);\n    while(attrParent) {\n        if(attrParent in aobj) return true;\n        attrParent = getParent(attrParent);\n    }\n    return false;\n};\n\n/**\n * Empty out types for all axes containing these traces so we auto-set them again\n *\n * @param {object} gd\n * @param {[integer]} traces: trace indices to search for axes to clear the types of\n * @param {object} layoutUpdate: any update being done concurrently to the layout,\n *   which may supercede clearing the axis types\n */\nvar axLetters = ['x', 'y', 'z'];\nexports.clearAxisTypes = function(gd, traces, layoutUpdate) {\n    for(var i = 0; i < traces.length; i++) {\n        var trace = gd._fullData[i];\n        for(var j = 0; j < 3; j++) {\n            var ax = getFromTrace(gd, trace, axLetters[j]);\n\n            // do not clear log type - that's never an auto result so must have been intentional\n            if(ax && ax.type !== 'log') {\n                var axAttr = ax._name;\n                var sceneName = ax._id.substr(1);\n                if(sceneName.substr(0, 5) === 'scene') {\n                    if(layoutUpdate[sceneName] !== undefined) continue;\n                    axAttr = sceneName + '.' + axAttr;\n                }\n                var typeAttr = axAttr + '.type';\n\n                if(layoutUpdate[axAttr] === undefined && layoutUpdate[typeAttr] === undefined) {\n                    Lib.nestedProperty(gd.layout, typeAttr).set(null);\n                }\n            }\n        }\n    }\n};\n\n},{\"../components/color\":52,\"../lib\":178,\"../plots/cartesian/axis_ids\":225,\"../plots/plots\":256,\"../registry\":269,\"fast-isnumeric\":18,\"gl-mat4/fromQuat\":19}],207:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar main = _dereq_('./plot_api');\n\nexports.plot = main.plot;\nexports.newPlot = main.newPlot;\nexports.restyle = main.restyle;\nexports.relayout = main.relayout;\nexports.redraw = main.redraw;\nexports.update = main.update;\nexports._guiRestyle = main._guiRestyle;\nexports._guiRelayout = main._guiRelayout;\nexports._guiUpdate = main._guiUpdate;\nexports._storeDirectGUIEdit = main._storeDirectGUIEdit;\nexports.react = main.react;\nexports.extendTraces = main.extendTraces;\nexports.prependTraces = main.prependTraces;\nexports.addTraces = main.addTraces;\nexports.deleteTraces = main.deleteTraces;\nexports.moveTraces = main.moveTraces;\nexports.purge = main.purge;\nexports.addFrames = main.addFrames;\nexports.deleteFrames = main.deleteFrames;\nexports.animate = main.animate;\nexports.setPlotConfig = main.setPlotConfig;\n\nexports.toImage = _dereq_('./to_image');\nexports.validate = _dereq_('./validate');\nexports.downloadImage = _dereq_('../snapshot/download');\n\nvar templateApi = _dereq_('./template_api');\nexports.makeTemplate = templateApi.makeTemplate;\nexports.validateTemplate = templateApi.validateTemplate;\n\n},{\"../snapshot/download\":271,\"./plot_api\":209,\"./template_api\":214,\"./to_image\":215,\"./validate\":216}],208:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isPlainObject = _dereq_('../lib/is_plain_object');\nvar noop = _dereq_('../lib/noop');\nvar Loggers = _dereq_('../lib/loggers');\nvar sorterAsc = _dereq_('../lib/search').sorterAsc;\nvar Registry = _dereq_('../registry');\n\n\nexports.containerArrayMatch = _dereq_('./container_array_match');\n\nvar isAddVal = exports.isAddVal = function isAddVal(val) {\n    return val === 'add' || isPlainObject(val);\n};\n\nvar isRemoveVal = exports.isRemoveVal = function isRemoveVal(val) {\n    return val === null || val === 'remove';\n};\n\n/*\n * applyContainerArrayChanges: for managing arrays of layout components in relayout\n * handles them all with a consistent interface.\n *\n * Here are the supported actions -> relayout calls -> edits we get here\n * (as prepared in _relayout):\n *\n * add an empty obj -> {'annotations[2]': 'add'} -> {2: {'': 'add'}}\n * add a specific obj -> {'annotations[2]': {attrs}} -> {2: {'': {attrs}}}\n * delete an obj -> {'annotations[2]': 'remove'} -> {2: {'': 'remove'}}\n *               -> {'annotations[2]': null} -> {2: {'': null}}\n * delete the whole array -> {'annotations': 'remove'} -> {'': {'': 'remove'}}\n *                        -> {'annotations': null} -> {'': {'': null}}\n * edit an object -> {'annotations[2].text': 'boo'} -> {2: {'text': 'boo'}}\n *\n * You can combine many edits to different objects. Objects are added and edited\n * in ascending order, then removed in descending order.\n * For example, starting with [a, b, c], if you want to:\n * - replace b with d:\n *   {'annotations[1]': d, 'annotations[2]': null} (b is item 2 after adding d)\n * - add a new item d between a and b, and edit b:\n *    {'annotations[1]': d, 'annotations[2].x': newX} (b is item 2 after adding d)\n * - delete b and edit c:\n *    {'annotations[1]': null, 'annotations[2].x': newX} (c is edited before b is removed)\n *\n * You CANNOT combine adding/deleting an item at index `i` with edits to the same index `i`\n * You CANNOT combine replacing/deleting the whole array with anything else (for the same array).\n *\n * @param {HTMLDivElement} gd\n *  the DOM element of the graph container div\n * @param {Lib.nestedProperty} componentType: the array we are editing\n * @param {Object} edits\n *  the changes to make; keys are indices to edit, values are themselves objects:\n *  {attr: newValue} of changes to make to that index (with add/remove behavior\n *  in special values of the empty attr)\n * @param {Object} flags\n *  the flags for which actions we're going to perform to display these (and\n *  any other) changes. If we're already `recalc`ing, we don't need to redraw\n *  individual items\n * @param {function} _nestedProperty\n *  a (possibly modified for gui edits) nestedProperty constructor\n *  The modified version takes a 3rd argument, for a prefix to the attribute\n *  string necessary for storing GUI edits\n *\n * @returns {bool} `true` if it managed to complete drawing of the changes\n *  `false` would mean the parent should replot.\n */\nexports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, edits, flags, _nestedProperty) {\n    var componentType = np.astr;\n    var supplyComponentDefaults = Registry.getComponentMethod(componentType, 'supplyLayoutDefaults');\n    var draw = Registry.getComponentMethod(componentType, 'draw');\n    var drawOne = Registry.getComponentMethod(componentType, 'drawOne');\n    var replotLater = flags.replot || flags.recalc || (supplyComponentDefaults === noop) || (draw === noop);\n    var layout = gd.layout;\n    var fullLayout = gd._fullLayout;\n\n    if(edits['']) {\n        if(Object.keys(edits).length > 1) {\n            Loggers.warn('Full array edits are incompatible with other edits',\n                componentType);\n        }\n\n        var fullVal = edits[''][''];\n\n        if(isRemoveVal(fullVal)) np.set(null);\n        else if(Array.isArray(fullVal)) np.set(fullVal);\n        else {\n            Loggers.warn('Unrecognized full array edit value', componentType, fullVal);\n            return true;\n        }\n\n        if(replotLater) return false;\n\n        supplyComponentDefaults(layout, fullLayout);\n        draw(gd);\n        return true;\n    }\n\n    var componentNums = Object.keys(edits).map(Number).sort(sorterAsc);\n    var componentArrayIn = np.get();\n    var componentArray = componentArrayIn || [];\n    // componentArrayFull is used just to keep splices in line between\n    // full and input arrays, so private keys can be copied over after\n    // redoing supplyDefaults\n    // TODO: this assumes componentArray is in gd.layout - which will not be\n    // true after we extend this to restyle\n    var componentArrayFull = _nestedProperty(fullLayout, componentType).get();\n\n    var deletes = [];\n    var firstIndexChange = -1;\n    var maxIndex = componentArray.length;\n    var i;\n    var j;\n    var componentNum;\n    var objEdits;\n    var objKeys;\n    var objVal;\n    var adding, prefix;\n\n    // first make the add and edit changes\n    for(i = 0; i < componentNums.length; i++) {\n        componentNum = componentNums[i];\n        objEdits = edits[componentNum];\n        objKeys = Object.keys(objEdits);\n        objVal = objEdits[''],\n        adding = isAddVal(objVal);\n\n        if(componentNum < 0 || componentNum > componentArray.length - (adding ? 0 : 1)) {\n            Loggers.warn('index out of range', componentType, componentNum);\n            continue;\n        }\n\n        if(objVal !== undefined) {\n            if(objKeys.length > 1) {\n                Loggers.warn(\n                    'Insertion & removal are incompatible with edits to the same index.',\n                    componentType, componentNum);\n            }\n\n            if(isRemoveVal(objVal)) {\n                deletes.push(componentNum);\n            } else if(adding) {\n                if(objVal === 'add') objVal = {};\n                componentArray.splice(componentNum, 0, objVal);\n                if(componentArrayFull) componentArrayFull.splice(componentNum, 0, {});\n            } else {\n                Loggers.warn('Unrecognized full object edit value',\n                    componentType, componentNum, objVal);\n            }\n\n            if(firstIndexChange === -1) firstIndexChange = componentNum;\n        } else {\n            for(j = 0; j < objKeys.length; j++) {\n                prefix = componentType + '[' + componentNum + '].';\n                _nestedProperty(componentArray[componentNum], objKeys[j], prefix)\n                    .set(objEdits[objKeys[j]]);\n            }\n        }\n    }\n\n    // now do deletes\n    for(i = deletes.length - 1; i >= 0; i--) {\n        componentArray.splice(deletes[i], 1);\n        // TODO: this drops private keys that had been stored in componentArrayFull\n        // does this have any ill effects?\n        if(componentArrayFull) componentArrayFull.splice(deletes[i], 1);\n    }\n\n    if(!componentArray.length) np.set(null);\n    else if(!componentArrayIn) np.set(componentArray);\n\n    if(replotLater) return false;\n\n    supplyComponentDefaults(layout, fullLayout);\n\n    // finally draw all the components we need to\n    // if we added or removed any, redraw all after it\n    if(drawOne !== noop) {\n        var indicesToDraw;\n        if(firstIndexChange === -1) {\n            // there's no re-indexing to do, so only redraw components that changed\n            indicesToDraw = componentNums;\n        } else {\n            // in case the component array was shortened, we still need do call\n            // drawOne on the latter items so they get properly removed\n            maxIndex = Math.max(componentArray.length, maxIndex);\n            indicesToDraw = [];\n            for(i = 0; i < componentNums.length; i++) {\n                componentNum = componentNums[i];\n                if(componentNum >= firstIndexChange) break;\n                indicesToDraw.push(componentNum);\n            }\n            for(i = firstIndexChange; i < maxIndex; i++) {\n                indicesToDraw.push(i);\n            }\n        }\n        for(i = 0; i < indicesToDraw.length; i++) {\n            drawOne(gd, indicesToDraw[i]);\n        }\n    } else draw(gd);\n\n    return true;\n};\n\n},{\"../lib/is_plain_object\":179,\"../lib/loggers\":182,\"../lib/noop\":187,\"../lib/search\":196,\"../registry\":269,\"./container_array_match\":204}],209:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\nvar hasHover = _dereq_('has-hover');\n\nvar Lib = _dereq_('../lib');\nvar nestedProperty = Lib.nestedProperty;\n\nvar Events = _dereq_('../lib/events');\nvar Queue = _dereq_('../lib/queue');\n\nvar Registry = _dereq_('../registry');\nvar PlotSchema = _dereq_('./plot_schema');\nvar Plots = _dereq_('../plots/plots');\nvar Polar = _dereq_('../plots/polar/legacy');\n\nvar Axes = _dereq_('../plots/cartesian/axes');\nvar Drawing = _dereq_('../components/drawing');\nvar Color = _dereq_('../components/color');\nvar initInteractions = _dereq_('../plots/cartesian/graph_interact').initInteractions;\nvar xmlnsNamespaces = _dereq_('../constants/xmlns_namespaces');\nvar svgTextUtils = _dereq_('../lib/svg_text_utils');\nvar clearSelect = _dereq_('../plots/cartesian/select').clearSelect;\n\nvar dfltConfig = _dereq_('./plot_config').dfltConfig;\nvar manageArrays = _dereq_('./manage_arrays');\nvar helpers = _dereq_('./helpers');\nvar subroutines = _dereq_('./subroutines');\nvar editTypes = _dereq_('./edit_types');\n\nvar AX_NAME_PATTERN = _dereq_('../plots/cartesian/constants').AX_NAME_PATTERN;\n\nvar numericNameWarningCount = 0;\nvar numericNameWarningCountLimit = 5;\n\n/**\n * Main plot-creation function\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n * @param {array of objects} data\n *      array of traces, containing the data and display information for each trace\n * @param {object} layout\n *      object describing the overall display of the plot,\n *      all the stuff that doesn't pertain to any individual trace\n * @param {object} config\n *      configuration options (see ./plot_config.js for more info)\n *\n * OR\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n * @param {object} figure\n *      object containing `data`, `layout`, `config`, and `frames` members\n *\n */\nfunction plot(gd, data, layout, config) {\n    var frames;\n\n    gd = Lib.getGraphDiv(gd);\n\n    // Events.init is idempotent and bails early if gd has already been init'd\n    Events.init(gd);\n\n    if(Lib.isPlainObject(data)) {\n        var obj = data;\n        data = obj.data;\n        layout = obj.layout;\n        config = obj.config;\n        frames = obj.frames;\n    }\n\n    var okToPlot = Events.triggerHandler(gd, 'plotly_beforeplot', [data, layout, config]);\n    if(okToPlot === false) return Promise.reject();\n\n    // if there's no data or layout, and this isn't yet a plotly plot\n    // container, log a warning to help plotly.js users debug\n    if(!data && !layout && !Lib.isPlotDiv(gd)) {\n        Lib.warn('Calling Plotly.plot as if redrawing ' +\n            'but this container doesn\\'t yet have a plot.', gd);\n    }\n\n    function addFrames() {\n        if(frames) {\n            return exports.addFrames(gd, frames);\n        }\n    }\n\n    // transfer configuration options to gd until we move over to\n    // a more OO like model\n    setPlotContext(gd, config);\n\n    if(!layout) layout = {};\n\n    // hook class for plots main container (in case of plotly.js\n    // this won't be #embedded-graph or .js-tab-contents)\n    d3.select(gd).classed('js-plotly-plot', true);\n\n    // off-screen getBoundingClientRect testing space,\n    // in #js-plotly-tester (and stored as Drawing.tester)\n    // so we can share cached text across tabs\n    Drawing.makeTester();\n\n    // collect promises for any async actions during plotting\n    // any part of the plotting code can push to gd._promises, then\n    // before we move to the next step, we check that they're all\n    // complete, and empty out the promise list again.\n    if(!Array.isArray(gd._promises)) gd._promises = [];\n\n    var graphWasEmpty = ((gd.data || []).length === 0 && Array.isArray(data));\n\n    // if there is already data on the graph, append the new data\n    // if you only want to redraw, pass a non-array for data\n    if(Array.isArray(data)) {\n        helpers.cleanData(data);\n\n        if(graphWasEmpty) gd.data = data;\n        else gd.data.push.apply(gd.data, data);\n\n        // for routines outside graph_obj that want a clean tab\n        // (rather than appending to an existing one) gd.empty\n        // is used to determine whether to make a new tab\n        gd.empty = false;\n    }\n\n    if(!gd.layout || graphWasEmpty) {\n        gd.layout = helpers.cleanLayout(layout);\n    }\n\n    Plots.supplyDefaults(gd);\n\n    var fullLayout = gd._fullLayout;\n    var hasCartesian = fullLayout._has('cartesian');\n\n    // Legacy polar plots\n    if(!fullLayout._has('polar') && data && data[0] && data[0].r) {\n        Lib.log('Legacy polar charts are deprecated!');\n        return plotLegacyPolar(gd, data, layout);\n    }\n\n    // so we don't try to re-call Plotly.plot from inside\n    // legend and colorbar, if margins changed\n    fullLayout._replotting = true;\n\n    // make or remake the framework if we need to\n    if(graphWasEmpty || fullLayout._shouldCreateBgLayer) {\n        makePlotFramework(gd);\n\n        if(fullLayout._shouldCreateBgLayer) {\n            delete fullLayout._shouldCreateBgLayer;\n        }\n    }\n\n    // polar need a different framework\n    if(gd.framework !== makePlotFramework) {\n        gd.framework = makePlotFramework;\n        makePlotFramework(gd);\n    }\n\n    // clear gradient defs on each .plot call, because we know we'll loop through all traces\n    Drawing.initGradients(gd);\n\n    // save initial show spikes once per graph\n    if(graphWasEmpty) Axes.saveShowSpikeInitial(gd);\n\n    // prepare the data and find the autorange\n\n    // generate calcdata, if we need to\n    // to force redoing calcdata, just delete it before calling Plotly.plot\n    var recalc = !gd.calcdata || gd.calcdata.length !== (gd._fullData || []).length;\n    if(recalc) Plots.doCalcdata(gd);\n\n    // in case it has changed, attach fullData traces to calcdata\n    for(var i = 0; i < gd.calcdata.length; i++) {\n        gd.calcdata[i][0].trace = gd._fullData[i];\n    }\n\n    // make the figure responsive\n    if(gd._context.responsive) {\n        if(!gd._responsiveChartHandler) {\n            // Keep a reference to the resize handler to purge it down the road\n            gd._responsiveChartHandler = function() { if(!Lib.isHidden(gd)) Plots.resize(gd); };\n\n            // Listen to window resize\n            window.addEventListener('resize', gd._responsiveChartHandler);\n        }\n    } else {\n        Lib.clearResponsive(gd);\n    }\n\n    /*\n     * start async-friendly code - now we're actually drawing things\n     */\n\n    var oldMargins = Lib.extendFlat({}, fullLayout._size);\n\n    // draw framework first so that margin-pushing\n    // components can position themselves correctly\n    var drawFrameworkCalls = 0;\n    function drawFramework() {\n        var basePlotModules = fullLayout._basePlotModules;\n\n        for(var i = 0; i < basePlotModules.length; i++) {\n            if(basePlotModules[i].drawFramework) {\n                basePlotModules[i].drawFramework(gd);\n            }\n        }\n\n        if(!fullLayout._glcanvas && fullLayout._has('gl')) {\n            fullLayout._glcanvas = fullLayout._glcontainer.selectAll('.gl-canvas').data([{\n                key: 'contextLayer',\n                context: true,\n                pick: false\n            }, {\n                key: 'focusLayer',\n                context: false,\n                pick: false\n            }, {\n                key: 'pickLayer',\n                context: false,\n                pick: true\n            }], function(d) { return d.key; });\n\n            fullLayout._glcanvas.enter().append('canvas')\n                .attr('class', function(d) {\n                    return 'gl-canvas gl-canvas-' + d.key.replace('Layer', '');\n                })\n                .style({\n                    position: 'absolute',\n                    top: 0,\n                    left: 0,\n                    overflow: 'visible',\n                    'pointer-events': 'none'\n                });\n        }\n\n        if(fullLayout._glcanvas) {\n            fullLayout._glcanvas\n                .attr('width', fullLayout.width)\n                .attr('height', fullLayout.height);\n\n            var regl = fullLayout._glcanvas.data()[0].regl;\n            if(regl) {\n                // Unfortunately, this can happen when relayouting to large\n                // width/height on some browsers.\n                if(Math.floor(fullLayout.width) !== regl._gl.drawingBufferWidth ||\n                    Math.floor(fullLayout.height) !== regl._gl.drawingBufferHeight\n                 ) {\n                    var msg = 'WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.';\n                    if(drawFrameworkCalls) {\n                        Lib.error(msg);\n                    } else {\n                        Lib.log(msg + ' Clearing graph and plotting again.');\n                        Plots.cleanPlot([], {}, gd._fullData, fullLayout);\n                        Plots.supplyDefaults(gd);\n                        fullLayout = gd._fullLayout;\n                        Plots.doCalcdata(gd);\n                        drawFrameworkCalls++;\n                        return drawFramework();\n                    }\n                }\n            }\n        }\n\n        if(fullLayout.modebar.orientation === 'h') {\n            fullLayout._modebardiv\n              .style('height', null)\n              .style('width', '100%');\n        } else {\n            fullLayout._modebardiv\n              .style('width', null)\n              .style('height', fullLayout.height + 'px');\n        }\n\n        return Plots.previousPromises(gd);\n    }\n\n    // draw anything that can affect margins.\n    function marginPushers() {\n        // First reset the list of things that are allowed to change the margins\n        // So any deleted traces or components will be wiped out of the\n        // automargin calculation.\n        // This means *every* margin pusher must be listed here, even if it\n        // doesn't actually try to push the margins until later.\n        Plots.clearAutoMarginIds(gd);\n\n        subroutines.drawMarginPushers(gd);\n        Axes.allowAutoMargin(gd);\n\n        // TODO can this be moved elsewhere?\n        if(fullLayout._has('pie')) {\n            var fullData = gd._fullData;\n            for(var i = 0; i < fullData.length; i++) {\n                var trace = fullData[i];\n                if(trace.type === 'pie' && trace.automargin) {\n                    Plots.allowAutoMargin(gd, 'pie.' + trace.uid + '.automargin');\n                }\n            }\n        }\n\n        Plots.doAutoMargin(gd);\n        return Plots.previousPromises(gd);\n    }\n\n    // in case the margins changed, draw margin pushers again\n    function marginPushersAgain() {\n        if(!Plots.didMarginChange(oldMargins, fullLayout._size)) return;\n\n        return Lib.syncOrAsync([\n            marginPushers,\n            subroutines.layoutStyles\n        ], gd);\n    }\n\n    function positionAndAutorange() {\n        if(!recalc) {\n            doAutoRangeAndConstraints();\n            return;\n        }\n\n        // TODO: autosize extra for text markers and images\n        // see https://github.com/plotly/plotly.js/issues/1111\n        return Lib.syncOrAsync([\n            Registry.getComponentMethod('shapes', 'calcAutorange'),\n            Registry.getComponentMethod('annotations', 'calcAutorange'),\n            doAutoRangeAndConstraints\n        ], gd);\n    }\n\n    function doAutoRangeAndConstraints() {\n        if(gd._transitioning) return;\n\n        subroutines.doAutoRangeAndConstraints(gd);\n\n        // store initial ranges *after* enforcing constraints, otherwise\n        // we will never look like we're at the initial ranges\n        if(graphWasEmpty) Axes.saveRangeInitial(gd);\n\n        // this one is different from shapes/annotations calcAutorange\n        // the others incorporate those components into ax._extremes,\n        // this one actually sets the ranges in rangesliders.\n        Registry.getComponentMethod('rangeslider', 'calcAutorange')(gd);\n    }\n\n    // draw ticks, titles, and calculate axis scaling (._b, ._m)\n    function drawAxes() {\n        return Axes.draw(gd, graphWasEmpty ? '' : 'redraw');\n    }\n\n    var seq = [\n        Plots.previousPromises,\n        addFrames,\n        drawFramework,\n        marginPushers,\n        marginPushersAgain\n    ];\n\n    if(hasCartesian) seq.push(positionAndAutorange);\n\n    seq.push(subroutines.layoutStyles);\n    if(hasCartesian) seq.push(drawAxes);\n\n    seq.push(\n        subroutines.drawData,\n        subroutines.finalDraw,\n        initInteractions,\n        Plots.addLinks,\n        Plots.rehover,\n        Plots.redrag,\n        // TODO: doAutoMargin is only needed here for axis automargin, which\n        // happens outside of marginPushers where all the other automargins are\n        // calculated. Would be much better to separate margin calculations from\n        // component drawing - see https://github.com/plotly/plotly.js/issues/2704\n        Plots.doAutoMargin,\n        Plots.previousPromises\n    );\n\n    // even if everything we did was synchronous, return a promise\n    // so that the caller doesn't care which route we took\n    var plotDone = Lib.syncOrAsync(seq, gd);\n    if(!plotDone || !plotDone.then) plotDone = Promise.resolve();\n\n    return plotDone.then(function() {\n        emitAfterPlot(gd);\n        return gd;\n    });\n}\n\nfunction emitAfterPlot(gd) {\n    var fullLayout = gd._fullLayout;\n\n    if(fullLayout._redrawFromAutoMarginCount) {\n        fullLayout._redrawFromAutoMarginCount--;\n    } else {\n        gd.emit('plotly_afterplot');\n    }\n}\n\nfunction setPlotConfig(obj) {\n    return Lib.extendFlat(dfltConfig, obj);\n}\n\nfunction setBackground(gd, bgColor) {\n    try {\n        gd._fullLayout._paper.style('background', bgColor);\n    } catch(e) {\n        Lib.error(e);\n    }\n}\n\nfunction opaqueSetBackground(gd, bgColor) {\n    var blend = Color.combine(bgColor, 'white');\n    setBackground(gd, blend);\n}\n\nfunction setPlotContext(gd, config) {\n    if(!gd._context) {\n        gd._context = Lib.extendDeep({}, dfltConfig);\n\n        // stash <base> href, used to make robust clipPath URLs\n        var base = d3.select('base');\n        gd._context._baseUrl = base.size() && base.attr('href') ?\n            window.location.href.split('#')[0] :\n            '';\n    }\n\n    var context = gd._context;\n\n    var i, keys, key;\n\n    if(config) {\n        keys = Object.keys(config);\n        for(i = 0; i < keys.length; i++) {\n            key = keys[i];\n            if(key === 'editable' || key === 'edits') continue;\n            if(key in context) {\n                if(key === 'setBackground' && config[key] === 'opaque') {\n                    context[key] = opaqueSetBackground;\n                } else {\n                    context[key] = config[key];\n                }\n            }\n        }\n\n        // map plot3dPixelRatio to plotGlPixelRatio for backward compatibility\n        if(config.plot3dPixelRatio && !context.plotGlPixelRatio) {\n            context.plotGlPixelRatio = context.plot3dPixelRatio;\n        }\n\n        // now deal with editable and edits - first editable overrides\n        // everything, then edits refines\n        var editable = config.editable;\n        if(editable !== undefined) {\n            // we're not going to *use* context.editable, we're only going to\n            // use context.edits... but keep it for the record\n            context.editable = editable;\n\n            keys = Object.keys(context.edits);\n            for(i = 0; i < keys.length; i++) {\n                context.edits[keys[i]] = editable;\n            }\n        }\n        if(config.edits) {\n            keys = Object.keys(config.edits);\n            for(i = 0; i < keys.length; i++) {\n                key = keys[i];\n                if(key in context.edits) {\n                    context.edits[key] = config.edits[key];\n                }\n            }\n        }\n\n        // not part of the user-facing config options\n        context._exportedPlot = config._exportedPlot;\n    }\n\n    // staticPlot forces a bunch of others:\n    if(context.staticPlot) {\n        context.editable = false;\n        context.edits = {};\n        context.autosizable = false;\n        context.scrollZoom = false;\n        context.doubleClick = false;\n        context.showTips = false;\n        context.showLink = false;\n        context.displayModeBar = false;\n    }\n\n    // make sure hover-only devices have mode bar visible\n    if(context.displayModeBar === 'hover' && !hasHover) {\n        context.displayModeBar = true;\n    }\n\n    // default and fallback for setBackground\n    if(context.setBackground === 'transparent' || typeof context.setBackground !== 'function') {\n        context.setBackground = setBackground;\n    }\n\n    // Check if gd has a specified widht/height to begin with\n    context._hasZeroHeight = context._hasZeroHeight || gd.clientHeight === 0;\n    context._hasZeroWidth = context._hasZeroWidth || gd.clientWidth === 0;\n\n    // fill context._scrollZoom helper to help manage scrollZoom flaglist\n    var szIn = context.scrollZoom;\n    var szOut = context._scrollZoom = {};\n    if(szIn === true) {\n        szOut.cartesian = 1;\n        szOut.gl3d = 1;\n        szOut.geo = 1;\n        szOut.mapbox = 1;\n    } else if(typeof szIn === 'string') {\n        var parts = szIn.split('+');\n        for(i = 0; i < parts.length; i++) {\n            szOut[parts[i]] = 1;\n        }\n    } else if(szIn !== false) {\n        szOut.gl3d = 1;\n        szOut.geo = 1;\n        szOut.mapbox = 1;\n    }\n}\n\nfunction plotLegacyPolar(gd, data, layout) {\n    // build or reuse the container skeleton\n    var plotContainer = d3.select(gd).selectAll('.plot-container')\n        .data([0]);\n    plotContainer.enter()\n        .insert('div', ':first-child')\n        .classed('plot-container plotly', true);\n    var paperDiv = plotContainer.selectAll('.svg-container')\n        .data([0]);\n    paperDiv.enter().append('div')\n        .classed('svg-container', true)\n        .style('position', 'relative');\n\n    // empty it everytime for now\n    paperDiv.html('');\n\n    // fulfill gd requirements\n    if(data) gd.data = data;\n    if(layout) gd.layout = layout;\n    Polar.manager.fillLayout(gd);\n\n    // resize canvas\n    paperDiv.style({\n        width: gd._fullLayout.width + 'px',\n        height: gd._fullLayout.height + 'px'\n    });\n\n    // instantiate framework\n    gd.framework = Polar.manager.framework(gd);\n\n    // plot\n    gd.framework({data: gd.data, layout: gd.layout}, paperDiv.node());\n\n    // set undo point\n    gd.framework.setUndoPoint();\n\n    // get the resulting svg for extending it\n    var polarPlotSVG = gd.framework.svg();\n\n    // editable title\n    var opacity = 1;\n    var txt = gd._fullLayout.title ? gd._fullLayout.title.text : '';\n    if(txt === '' || !txt) opacity = 0;\n\n    var titleLayout = function() {\n        this.call(svgTextUtils.convertToTspans, gd);\n        // TODO: html/mathjax\n        // TODO: center title\n    };\n\n    var title = polarPlotSVG.select('.title-group text')\n        .call(titleLayout);\n\n    if(gd._context.edits.titleText) {\n        var placeholderText = Lib._(gd, 'Click to enter Plot title');\n        if(!txt || txt === placeholderText) {\n            opacity = 0.2;\n            // placeholder is not going through convertToTspans\n            // so needs explicit data-unformatted\n            title.attr({'data-unformatted': placeholderText})\n                .text(placeholderText)\n                .style({opacity: opacity})\n                .on('mouseover.opacity', function() {\n                    d3.select(this).transition().duration(100)\n                        .style('opacity', 1);\n                })\n                .on('mouseout.opacity', function() {\n                    d3.select(this).transition().duration(1000)\n                        .style('opacity', 0);\n                });\n        }\n\n        var setContenteditable = function() {\n            this.call(svgTextUtils.makeEditable, {gd: gd})\n                .on('edit', function(text) {\n                    gd.framework({layout: {title: {text: text}}});\n                    this.text(text)\n                        .call(titleLayout);\n                    this.call(setContenteditable);\n                })\n                .on('cancel', function() {\n                    var txt = this.attr('data-unformatted');\n                    this.text(txt).call(titleLayout);\n                });\n        };\n        title.call(setContenteditable);\n    }\n\n    gd._context.setBackground(gd, gd._fullLayout.paper_bgcolor);\n    Plots.addLinks(gd);\n\n    return Promise.resolve();\n}\n\n// convenience function to force a full redraw, mostly for use by plotly.js\nfunction redraw(gd) {\n    gd = Lib.getGraphDiv(gd);\n\n    if(!Lib.isPlotDiv(gd)) {\n        throw new Error('This element is not a Plotly plot: ' + gd);\n    }\n\n    helpers.cleanData(gd.data);\n    helpers.cleanLayout(gd.layout);\n\n    gd.calcdata = undefined;\n    return exports.plot(gd).then(function() {\n        gd.emit('plotly_redraw');\n        return gd;\n    });\n}\n\n/**\n * Convenience function to make idempotent plot option obvious to users.\n *\n * @param gd\n * @param {Object[]} data\n * @param {Object} layout\n * @param {Object} config\n */\nfunction newPlot(gd, data, layout, config) {\n    gd = Lib.getGraphDiv(gd);\n\n    // remove gl contexts\n    Plots.cleanPlot([], {}, gd._fullData || [], gd._fullLayout || {});\n\n    Plots.purge(gd);\n    return exports.plot(gd, data, layout, config);\n}\n\n/**\n * Wrap negative indicies to their positive counterparts.\n *\n * @param {Number[]} indices An array of indices\n * @param {Number} maxIndex The maximum index allowable (arr.length - 1)\n */\nfunction positivifyIndices(indices, maxIndex) {\n    var parentLength = maxIndex + 1;\n    var positiveIndices = [];\n    var i;\n    var index;\n\n    for(i = 0; i < indices.length; i++) {\n        index = indices[i];\n        if(index < 0) {\n            positiveIndices.push(parentLength + index);\n        } else {\n            positiveIndices.push(index);\n        }\n    }\n    return positiveIndices;\n}\n\n/**\n * Ensures that an index array for manipulating gd.data is valid.\n *\n * Intended for use with addTraces, deleteTraces, and moveTraces.\n *\n * @param gd\n * @param indices\n * @param arrayName\n */\nfunction assertIndexArray(gd, indices, arrayName) {\n    var i,\n        index;\n\n    for(i = 0; i < indices.length; i++) {\n        index = indices[i];\n\n        // validate that indices are indeed integers\n        if(index !== parseInt(index, 10)) {\n            throw new Error('all values in ' + arrayName + ' must be integers');\n        }\n\n        // check that all indices are in bounds for given gd.data array length\n        if(index >= gd.data.length || index < -gd.data.length) {\n            throw new Error(arrayName + ' must be valid indices for gd.data.');\n        }\n\n        // check that indices aren't repeated\n        if(indices.indexOf(index, i + 1) > -1 ||\n                index >= 0 && indices.indexOf(-gd.data.length + index) > -1 ||\n                index < 0 && indices.indexOf(gd.data.length + index) > -1) {\n            throw new Error('each index in ' + arrayName + ' must be unique.');\n        }\n    }\n}\n\n/**\n * Private function used by Plotly.moveTraces to check input args\n *\n * @param gd\n * @param currentIndices\n * @param newIndices\n */\nfunction checkMoveTracesArgs(gd, currentIndices, newIndices) {\n    // check that gd has attribute 'data' and 'data' is array\n    if(!Array.isArray(gd.data)) {\n        throw new Error('gd.data must be an array.');\n    }\n\n    // validate currentIndices array\n    if(typeof currentIndices === 'undefined') {\n        throw new Error('currentIndices is a required argument.');\n    } else if(!Array.isArray(currentIndices)) {\n        currentIndices = [currentIndices];\n    }\n    assertIndexArray(gd, currentIndices, 'currentIndices');\n\n    // validate newIndices array if it exists\n    if(typeof newIndices !== 'undefined' && !Array.isArray(newIndices)) {\n        newIndices = [newIndices];\n    }\n    if(typeof newIndices !== 'undefined') {\n        assertIndexArray(gd, newIndices, 'newIndices');\n    }\n\n    // check currentIndices and newIndices are the same length if newIdices exists\n    if(typeof newIndices !== 'undefined' && currentIndices.length !== newIndices.length) {\n        throw new Error('current and new indices must be of equal length.');\n    }\n}\n/**\n * A private function to reduce the type checking clutter in addTraces.\n *\n * @param gd\n * @param traces\n * @param newIndices\n */\nfunction checkAddTracesArgs(gd, traces, newIndices) {\n    var i, value;\n\n    // check that gd has attribute 'data' and 'data' is array\n    if(!Array.isArray(gd.data)) {\n        throw new Error('gd.data must be an array.');\n    }\n\n    // make sure traces exists\n    if(typeof traces === 'undefined') {\n        throw new Error('traces must be defined.');\n    }\n\n    // make sure traces is an array\n    if(!Array.isArray(traces)) {\n        traces = [traces];\n    }\n\n    // make sure each value in traces is an object\n    for(i = 0; i < traces.length; i++) {\n        value = traces[i];\n        if(typeof value !== 'object' || (Array.isArray(value) || value === null)) {\n            throw new Error('all values in traces array must be non-array objects');\n        }\n    }\n\n    // make sure we have an index for each trace\n    if(typeof newIndices !== 'undefined' && !Array.isArray(newIndices)) {\n        newIndices = [newIndices];\n    }\n    if(typeof newIndices !== 'undefined' && newIndices.length !== traces.length) {\n        throw new Error(\n            'if indices is specified, traces.length must equal indices.length'\n        );\n    }\n}\n\n/**\n * A private function to reduce the type checking clutter in spliceTraces.\n * Get all update Properties from gd.data. Validate inputs and outputs.\n * Used by prependTrace and extendTraces\n *\n * @param gd\n * @param update\n * @param indices\n * @param maxPoints\n */\nfunction assertExtendTracesArgs(gd, update, indices, maxPoints) {\n    var maxPointsIsObject = Lib.isPlainObject(maxPoints);\n\n    if(!Array.isArray(gd.data)) {\n        throw new Error('gd.data must be an array');\n    }\n    if(!Lib.isPlainObject(update)) {\n        throw new Error('update must be a key:value object');\n    }\n\n    if(typeof indices === 'undefined') {\n        throw new Error('indices must be an integer or array of integers');\n    }\n\n    assertIndexArray(gd, indices, 'indices');\n\n    for(var key in update) {\n        /*\n         * Verify that the attribute to be updated contains as many trace updates\n         * as indices. Failure must result in throw and no-op\n         */\n        if(!Array.isArray(update[key]) || update[key].length !== indices.length) {\n            throw new Error('attribute ' + key + ' must be an array of length equal to indices array length');\n        }\n\n        /*\n         * if maxPoints is an object it must match keys and array lengths of 'update' 1:1\n         */\n        if(maxPointsIsObject &&\n            (!(key in maxPoints) || !Array.isArray(maxPoints[key]) ||\n            maxPoints[key].length !== update[key].length)) {\n            throw new Error('when maxPoints is set as a key:value object it must contain a 1:1 ' +\n                            'corrispondence with the keys and number of traces in the update object');\n        }\n    }\n}\n\n/**\n * A private function to reduce the type checking clutter in spliceTraces.\n *\n * @param {Object|HTMLDivElement} gd\n * @param {Object} update\n * @param {Number[]} indices\n * @param {Number||Object} maxPoints\n * @return {Object[]}\n */\nfunction getExtendProperties(gd, update, indices, maxPoints) {\n    var maxPointsIsObject = Lib.isPlainObject(maxPoints);\n    var updateProps = [];\n    var trace, target, prop, insert, maxp;\n\n    // allow scalar index to represent a single trace position\n    if(!Array.isArray(indices)) indices = [indices];\n\n    // negative indices are wrapped around to their positive value. Equivalent to python indexing.\n    indices = positivifyIndices(indices, gd.data.length - 1);\n\n    // loop through all update keys and traces and harvest validated data.\n    for(var key in update) {\n        for(var j = 0; j < indices.length; j++) {\n            /*\n             * Choose the trace indexed by the indices map argument and get the prop setter-getter\n             * instance that references the key and value for this particular trace.\n             */\n            trace = gd.data[indices[j]];\n            prop = nestedProperty(trace, key);\n\n            /*\n             * Target is the existing gd.data.trace.dataArray value like \"x\" or \"marker.size\"\n             * Target must exist as an Array to allow the extend operation to be performed.\n             */\n            target = prop.get();\n            insert = update[key][j];\n\n            if(!Lib.isArrayOrTypedArray(insert)) {\n                throw new Error('attribute: ' + key + ' index: ' + j + ' must be an array');\n            }\n            if(!Lib.isArrayOrTypedArray(target)) {\n                throw new Error('cannot extend missing or non-array attribute: ' + key);\n            }\n            if(target.constructor !== insert.constructor) {\n                throw new Error('cannot extend array with an array of a different type: ' + key);\n            }\n\n            /*\n             * maxPoints may be an object map or a scalar. If object select the key:value, else\n             * Use the scalar maxPoints for all key and trace combinations.\n             */\n            maxp = maxPointsIsObject ? maxPoints[key][j] : maxPoints;\n\n            // could have chosen null here, -1 just tells us to not take a window\n            if(!isNumeric(maxp)) maxp = -1;\n\n            /*\n             * Wrap the nestedProperty in an object containing required data\n             * for lengthening and windowing this particular trace - key combination.\n             * Flooring maxp mirrors the behaviour of floats in the Array.slice JSnative function.\n             */\n            updateProps.push({\n                prop: prop,\n                target: target,\n                insert: insert,\n                maxp: Math.floor(maxp)\n            });\n        }\n    }\n\n    // all target and insertion data now validated\n    return updateProps;\n}\n\n/**\n * A private function to key Extend and Prepend traces DRY\n *\n * @param {Object|HTMLDivElement} gd\n * @param {Object} update\n * @param {Number[]} indices\n * @param {Number||Object} maxPoints\n * @param {Function} updateArray\n * @return {Object}\n */\nfunction spliceTraces(gd, update, indices, maxPoints, updateArray) {\n    assertExtendTracesArgs(gd, update, indices, maxPoints);\n\n    var updateProps = getExtendProperties(gd, update, indices, maxPoints);\n    var undoUpdate = {};\n    var undoPoints = {};\n\n    for(var i = 0; i < updateProps.length; i++) {\n        var prop = updateProps[i].prop;\n        var maxp = updateProps[i].maxp;\n\n        // return new array and remainder\n        var out = updateArray(updateProps[i].target, updateProps[i].insert, maxp);\n        prop.set(out[0]);\n\n        // build the inverse update object for the undo operation\n        if(!Array.isArray(undoUpdate[prop.astr])) undoUpdate[prop.astr] = [];\n        undoUpdate[prop.astr].push(out[1]);\n\n         // build the matching maxPoints undo object containing original trace lengths\n        if(!Array.isArray(undoPoints[prop.astr])) undoPoints[prop.astr] = [];\n        undoPoints[prop.astr].push(updateProps[i].target.length);\n    }\n\n    return {update: undoUpdate, maxPoints: undoPoints};\n}\n\nfunction concatTypedArray(arr0, arr1) {\n    var arr2 = new arr0.constructor(arr0.length + arr1.length);\n    arr2.set(arr0);\n    arr2.set(arr1, arr0.length);\n    return arr2;\n}\n\n/**\n * extend && prepend traces at indices with update arrays, window trace lengths to maxPoints\n *\n * Extend and Prepend have identical APIs. Prepend inserts an array at the head while Extend\n * inserts an array off the tail. Prepend truncates the tail of the array - counting maxPoints\n * from the head, whereas Extend truncates the head of the array, counting backward maxPoints\n * from the tail.\n *\n * If maxPoints is undefined, nonNumeric, negative or greater than extended trace length no\n * truncation / windowing will be performed. If its zero, well the whole trace is truncated.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object} update The key:array map of target attributes to extend\n * @param {Number|Number[]} indices The locations of traces to be extended\n * @param {Number|Object} [maxPoints] Number of points for trace window after lengthening.\n *\n */\nfunction extendTraces(gd, update, indices, maxPoints) {\n    gd = Lib.getGraphDiv(gd);\n\n    function updateArray(target, insert, maxp) {\n        var newArray, remainder;\n\n        if(Lib.isTypedArray(target)) {\n            if(maxp < 0) {\n                var none = new target.constructor(0);\n                var both = concatTypedArray(target, insert);\n\n                if(maxp < 0) {\n                    newArray = both;\n                    remainder = none;\n                } else {\n                    newArray = none;\n                    remainder = both;\n                }\n            } else {\n                newArray = new target.constructor(maxp);\n                remainder = new target.constructor(target.length + insert.length - maxp);\n\n                if(maxp === insert.length) {\n                    newArray.set(insert);\n                    remainder.set(target);\n                } else if(maxp < insert.length) {\n                    var numberOfItemsFromInsert = insert.length - maxp;\n\n                    newArray.set(insert.subarray(numberOfItemsFromInsert));\n                    remainder.set(target);\n                    remainder.set(insert.subarray(0, numberOfItemsFromInsert), target.length);\n                } else {\n                    var numberOfItemsFromTarget = maxp - insert.length;\n                    var targetBegin = target.length - numberOfItemsFromTarget;\n\n                    newArray.set(target.subarray(targetBegin));\n                    newArray.set(insert, numberOfItemsFromTarget);\n                    remainder.set(target.subarray(0, targetBegin));\n                }\n            }\n        } else {\n            newArray = target.concat(insert);\n            remainder = (maxp >= 0 && maxp < newArray.length) ?\n                newArray.splice(0, newArray.length - maxp) :\n                [];\n        }\n\n        return [newArray, remainder];\n    }\n\n    var undo = spliceTraces(gd, update, indices, maxPoints, updateArray);\n    var promise = exports.redraw(gd);\n    var undoArgs = [gd, undo.update, indices, undo.maxPoints];\n    Queue.add(gd, exports.prependTraces, undoArgs, extendTraces, arguments);\n\n    return promise;\n}\n\nfunction prependTraces(gd, update, indices, maxPoints) {\n    gd = Lib.getGraphDiv(gd);\n\n    function updateArray(target, insert, maxp) {\n        var newArray, remainder;\n\n        if(Lib.isTypedArray(target)) {\n            if(maxp <= 0) {\n                var none = new target.constructor(0);\n                var both = concatTypedArray(insert, target);\n\n                if(maxp < 0) {\n                    newArray = both;\n                    remainder = none;\n                } else {\n                    newArray = none;\n                    remainder = both;\n                }\n            } else {\n                newArray = new target.constructor(maxp);\n                remainder = new target.constructor(target.length + insert.length - maxp);\n\n                if(maxp === insert.length) {\n                    newArray.set(insert);\n                    remainder.set(target);\n                } else if(maxp < insert.length) {\n                    var numberOfItemsFromInsert = insert.length - maxp;\n\n                    newArray.set(insert.subarray(0, numberOfItemsFromInsert));\n                    remainder.set(insert.subarray(numberOfItemsFromInsert));\n                    remainder.set(target, numberOfItemsFromInsert);\n                } else {\n                    var numberOfItemsFromTarget = maxp - insert.length;\n\n                    newArray.set(insert);\n                    newArray.set(target.subarray(0, numberOfItemsFromTarget), insert.length);\n                    remainder.set(target.subarray(numberOfItemsFromTarget));\n                }\n            }\n        } else {\n            newArray = insert.concat(target);\n            remainder = (maxp >= 0 && maxp < newArray.length) ?\n                newArray.splice(maxp, newArray.length) :\n                [];\n        }\n\n        return [newArray, remainder];\n    }\n\n    var undo = spliceTraces(gd, update, indices, maxPoints, updateArray);\n    var promise = exports.redraw(gd);\n    var undoArgs = [gd, undo.update, indices, undo.maxPoints];\n    Queue.add(gd, exports.extendTraces, undoArgs, prependTraces, arguments);\n\n    return promise;\n}\n\n/**\n * Add data traces to an existing graph div.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're adding to\n * @param {Object[]|Object} traces The object or array of objects to add\n * @param {Number[]|Number} [newIndices=[gd.data.length]] Locations to add traces\n *\n */\nfunction addTraces(gd, traces, newIndices) {\n    gd = Lib.getGraphDiv(gd);\n\n    var currentIndices = [];\n    var undoFunc = exports.deleteTraces;\n    var redoFunc = addTraces;\n    var undoArgs = [gd, currentIndices];\n    var redoArgs = [gd, traces];  // no newIndices here\n    var i;\n    var promise;\n\n    // all validation is done elsewhere to remove clutter here\n    checkAddTracesArgs(gd, traces, newIndices);\n\n    // make sure traces is an array\n    if(!Array.isArray(traces)) {\n        traces = [traces];\n    }\n\n    // make sure traces do not repeat existing ones\n    traces = traces.map(function(trace) {\n        return Lib.extendFlat({}, trace);\n    });\n\n    helpers.cleanData(traces);\n\n    // add the traces to gd.data (no redrawing yet!)\n    for(i = 0; i < traces.length; i++) {\n        gd.data.push(traces[i]);\n    }\n\n    // to continue, we need to call moveTraces which requires currentIndices\n    for(i = 0; i < traces.length; i++) {\n        currentIndices.push(-traces.length + i);\n    }\n\n    // if the user didn't define newIndices, they just want the traces appended\n    // i.e., we can simply redraw and be done\n    if(typeof newIndices === 'undefined') {\n        promise = exports.redraw(gd);\n        Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n        return promise;\n    }\n\n    // make sure indices is property defined\n    if(!Array.isArray(newIndices)) {\n        newIndices = [newIndices];\n    }\n\n    try {\n        // this is redundant, but necessary to not catch later possible errors!\n        checkMoveTracesArgs(gd, currentIndices, newIndices);\n    } catch(error) {\n        // something went wrong, reset gd to be safe and rethrow error\n        gd.data.splice(gd.data.length - traces.length, traces.length);\n        throw error;\n    }\n\n    // if we're here, the user has defined specific places to place the new traces\n    // this requires some extra work that moveTraces will do\n    Queue.startSequence(gd);\n    Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n    promise = exports.moveTraces(gd, currentIndices, newIndices);\n    Queue.stopSequence(gd);\n    return promise;\n}\n\n/**\n * Delete traces at `indices` from gd.data array.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're removing from\n * @param {Number|Number[]} indices The indices\n */\nfunction deleteTraces(gd, indices) {\n    gd = Lib.getGraphDiv(gd);\n\n    var traces = [];\n    var undoFunc = exports.addTraces;\n    var redoFunc = deleteTraces;\n    var undoArgs = [gd, traces, indices];\n    var redoArgs = [gd, indices];\n    var i;\n    var deletedTrace;\n\n    // make sure indices are defined\n    if(typeof indices === 'undefined') {\n        throw new Error('indices must be an integer or array of integers.');\n    } else if(!Array.isArray(indices)) {\n        indices = [indices];\n    }\n    assertIndexArray(gd, indices, 'indices');\n\n    // convert negative indices to positive indices\n    indices = positivifyIndices(indices, gd.data.length - 1);\n\n    // we want descending here so that splicing later doesn't affect indexing\n    indices.sort(Lib.sorterDes);\n    for(i = 0; i < indices.length; i += 1) {\n        deletedTrace = gd.data.splice(indices[i], 1)[0];\n        traces.push(deletedTrace);\n    }\n\n    var promise = exports.redraw(gd);\n    Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n    return promise;\n}\n\n/**\n * Move traces at currentIndices array to locations in newIndices array.\n *\n * If newIndices is omitted, currentIndices will be moved to the end. E.g.,\n * these are equivalent:\n *\n * Plotly.moveTraces(gd, [1, 2, 3], [-3, -2, -1])\n * Plotly.moveTraces(gd, [1, 2, 3])\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're removing from\n * @param {Number|Number[]} currentIndices The locations of traces to be moved\n * @param {Number|Number[]} [newIndices] The locations to move traces to\n *\n * Example calls:\n *\n *      // move trace i to location x\n *      Plotly.moveTraces(gd, i, x)\n *\n *      // move trace i to end of array\n *      Plotly.moveTraces(gd, i)\n *\n *      // move traces i, j, k to end of array (i != j != k)\n *      Plotly.moveTraces(gd, [i, j, k])\n *\n *      // move traces [i, j, k] to [x, y, z] (i != j != k) (x != y != z)\n *      Plotly.moveTraces(gd, [i, j, k], [x, y, z])\n *\n *      // reorder all traces (assume there are 5--a, b, c, d, e)\n *      Plotly.moveTraces(gd, [b, d, e, a, c])  // same as 'move to end'\n */\nfunction moveTraces(gd, currentIndices, newIndices) {\n    gd = Lib.getGraphDiv(gd);\n\n    var newData = [];\n    var movingTraceMap = [];\n    var undoFunc = moveTraces;\n    var redoFunc = moveTraces;\n    var undoArgs = [gd, newIndices, currentIndices];\n    var redoArgs = [gd, currentIndices, newIndices];\n    var i;\n\n    // to reduce complexity here, check args elsewhere\n    // this throws errors where appropriate\n    checkMoveTracesArgs(gd, currentIndices, newIndices);\n\n    // make sure currentIndices is an array\n    currentIndices = Array.isArray(currentIndices) ? currentIndices : [currentIndices];\n\n    // if undefined, define newIndices to point to the end of gd.data array\n    if(typeof newIndices === 'undefined') {\n        newIndices = [];\n        for(i = 0; i < currentIndices.length; i++) {\n            newIndices.push(-currentIndices.length + i);\n        }\n    }\n\n    // make sure newIndices is an array if it's user-defined\n    newIndices = Array.isArray(newIndices) ? newIndices : [newIndices];\n\n    // convert negative indices to positive indices (they're the same length)\n    currentIndices = positivifyIndices(currentIndices, gd.data.length - 1);\n    newIndices = positivifyIndices(newIndices, gd.data.length - 1);\n\n    // at this point, we've coerced the index arrays into predictable forms\n\n    // get the traces that aren't being moved around\n    for(i = 0; i < gd.data.length; i++) {\n        // if index isn't in currentIndices, include it in ignored!\n        if(currentIndices.indexOf(i) === -1) {\n            newData.push(gd.data[i]);\n        }\n    }\n\n    // get a mapping of indices to moving traces\n    for(i = 0; i < currentIndices.length; i++) {\n        movingTraceMap.push({newIndex: newIndices[i], trace: gd.data[currentIndices[i]]});\n    }\n\n    // reorder this mapping by newIndex, ascending\n    movingTraceMap.sort(function(a, b) {\n        return a.newIndex - b.newIndex;\n    });\n\n    // now, add the moving traces back in, in order!\n    for(i = 0; i < movingTraceMap.length; i += 1) {\n        newData.splice(movingTraceMap[i].newIndex, 0, movingTraceMap[i].trace);\n    }\n\n    gd.data = newData;\n\n    var promise = exports.redraw(gd);\n    Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n    return promise;\n}\n\n/**\n * restyle: update trace attributes of an existing plot\n *\n * Can be called two ways.\n *\n * Signature 1:\n * @param {String | HTMLDivElement} gd\n *  the id or DOM element of the graph container div\n * @param {String} astr\n *  attribute string (like `'marker.symbol'`) to update\n * @param {*} val\n *  value to give this attribute\n * @param {Number[] | Number} [traces]\n *  integer or array of integers for the traces to alter (all if omitted)\n *\n * Signature 2:\n * @param {String | HTMLDivElement} gd\n *  (as in signature 1)\n * @param {Object} aobj\n *  attribute object `{astr1: val1, astr2: val2 ...}`\n *  allows setting multiple attributes simultaneously\n * @param {Number[] | Number} [traces]\n *  (as in signature 1)\n *\n * `val` (or `val1`, `val2` ... in the object form) can be an array,\n * to apply different values to each trace.\n *\n * If the array is too short, it will wrap around (useful for\n * style files that want to specify cyclical default values).\n */\nfunction restyle(gd, astr, val, _traces) {\n    gd = Lib.getGraphDiv(gd);\n    helpers.clearPromiseQueue(gd);\n\n    var aobj = {};\n    if(typeof astr === 'string') aobj[astr] = val;\n    else if(Lib.isPlainObject(astr)) {\n        // the 3-arg form\n        aobj = Lib.extendFlat({}, astr);\n        if(_traces === undefined) _traces = val;\n    } else {\n        Lib.warn('Restyle fail.', astr, val, _traces);\n        return Promise.reject();\n    }\n\n    if(Object.keys(aobj).length) gd.changed = true;\n\n    var traces = helpers.coerceTraceIndices(gd, _traces);\n\n    var specs = _restyle(gd, aobj, traces);\n    var flags = specs.flags;\n\n    // clear calcdata and/or axis types if required so they get regenerated\n    if(flags.calc) gd.calcdata = undefined;\n    if(flags.clearAxisTypes) helpers.clearAxisTypes(gd, traces, {});\n\n    // fill in redraw sequence\n    var seq = [];\n\n    if(flags.fullReplot) {\n        seq.push(exports.plot);\n    } else {\n        seq.push(Plots.previousPromises);\n\n        // maybe only call Plots.supplyDataDefaults in the splom case,\n        // to skip over long and slow axes defaults\n        Plots.supplyDefaults(gd);\n\n        if(flags.markerSize) {\n            Plots.doCalcdata(gd);\n            addAxRangeSequence(seq);\n\n            // TODO\n            // if all axes have autorange:false, then\n            // proceed to subroutines.doTraceStyle(),\n            // otherwise we must go through addAxRangeSequence,\n            // which in general must redraws 'all' axes\n        }\n\n        if(flags.style) seq.push(subroutines.doTraceStyle);\n        if(flags.colorbars) seq.push(subroutines.doColorBars);\n\n        seq.push(emitAfterPlot);\n    }\n\n    seq.push(Plots.rehover, Plots.redrag);\n\n    Queue.add(gd,\n        restyle, [gd, specs.undoit, specs.traces],\n        restyle, [gd, specs.redoit, specs.traces]\n    );\n\n    var plotDone = Lib.syncOrAsync(seq, gd);\n    if(!plotDone || !plotDone.then) plotDone = Promise.resolve();\n\n    return plotDone.then(function() {\n        gd.emit('plotly_restyle', specs.eventData);\n        return gd;\n    });\n}\n\n// for undo: undefined initial vals must be turned into nulls\n// so that we unset rather than ignore them\nfunction undefinedToNull(val) {\n    if(val === undefined) return null;\n    return val;\n}\n\n/**\n * Factory function to wrap nestedProperty with GUI edits if necessary\n * with GUI edits we add an optional prefix to the nestedProperty constructor\n * to prepend to the attribute string in the preGUI store.\n */\nfunction makeNP(preGUI, guiEditFlag) {\n    if(!guiEditFlag) return nestedProperty;\n\n    return function(container, attr, prefix) {\n        var np = nestedProperty(container, attr);\n        var npSet = np.set;\n        np.set = function(val) {\n            var fullAttr = (prefix || '') + attr;\n            storeCurrent(fullAttr, np.get(), val, preGUI);\n            npSet(val);\n        };\n        return np;\n    };\n}\n\nfunction storeCurrent(attr, val, newVal, preGUI) {\n    if(Array.isArray(val) || Array.isArray(newVal)) {\n        var arrayVal = Array.isArray(val) ? val : [];\n        var arrayNew = Array.isArray(newVal) ? newVal : [];\n        var maxLen = Math.max(arrayVal.length, arrayNew.length);\n        for(var i = 0; i < maxLen; i++) {\n            storeCurrent(attr + '[' + i + ']', arrayVal[i], arrayNew[i], preGUI);\n        }\n    } else if(Lib.isPlainObject(val) || Lib.isPlainObject(newVal)) {\n        var objVal = Lib.isPlainObject(val) ? val : {};\n        var objNew = Lib.isPlainObject(newVal) ? newVal : {};\n        var objBoth = Lib.extendFlat({}, objVal, objNew);\n        for(var key in objBoth) {\n            storeCurrent(attr + '.' + key, objVal[key], objNew[key], preGUI);\n        }\n    } else if(preGUI[attr] === undefined) {\n        preGUI[attr] = undefinedToNull(val);\n    }\n}\n\n/**\n * storeDirectGUIEdit: for routines that skip restyle/relayout and mock it\n * by emitting a plotly_restyle or plotly_relayout event, this routine\n * keeps track of the initial state in _preGUI for use by uirevision\n * Does *not* apply these changes to data/layout - that's the responsibility\n * of the calling routine.\n *\n * @param {object} container: the input attributes container (eg `layout` or a `trace`)\n * @param {object} preGUI: where original values should be stored, either\n *     `layout._preGUI` or `layout._tracePreGUI[uid]`\n * @param {object} edits: the {attr: val} object as normally passed to `relayout` etc\n */\nfunction _storeDirectGUIEdit(container, preGUI, edits) {\n    for(var attr in edits) {\n        var np = nestedProperty(container, attr);\n        storeCurrent(attr, np.get(), edits[attr], preGUI);\n    }\n}\n\nfunction _restyle(gd, aobj, traces) {\n    var fullLayout = gd._fullLayout;\n    var fullData = gd._fullData;\n    var data = gd.data;\n    var guiEditFlag = fullLayout._guiEditing;\n    var layoutNP = makeNP(fullLayout._preGUI, guiEditFlag);\n    var eventData = Lib.extendDeepAll({}, aobj);\n    var i;\n\n    cleanDeprecatedAttributeKeys(aobj);\n\n    // initialize flags\n    var flags = editTypes.traceFlags();\n\n    // copies of the change (and previous values of anything affected)\n    // for the undo / redo queue\n    var redoit = {};\n    var undoit = {};\n    var axlist;\n\n    // make a new empty vals array for undoit\n    function a0() { return traces.map(function() { return undefined; }); }\n\n    // for autoranging multiple axes\n    function addToAxlist(axid) {\n        var axName = Axes.id2name(axid);\n        if(axlist.indexOf(axName) === -1) axlist.push(axName);\n    }\n\n    function autorangeAttr(axName) { return 'LAYOUT' + axName + '.autorange'; }\n\n    function rangeAttr(axName) { return 'LAYOUT' + axName + '.range'; }\n\n    function getFullTrace(traceIndex) {\n        // usually fullData maps 1:1 onto data, but with groupby transforms\n        // the fullData index can be greater. Take the *first* matching trace.\n        for(var j = traceIndex; j < fullData.length; j++) {\n            if(fullData[j]._input === data[traceIndex]) return fullData[j];\n        }\n        // should never get here - and if we *do* it should cause an error\n        // later on undefined fullTrace is passed to nestedProperty.\n    }\n\n    // for attrs that interact (like scales & autoscales), save the\n    // old vals before making the change\n    // val=undefined will not set a value, just record what the value was.\n    // val=null will delete the attribute\n    // attr can be an array to set several at once (all to the same val)\n    function doextra(attr, val, i) {\n        if(Array.isArray(attr)) {\n            attr.forEach(function(a) { doextra(a, val, i); });\n            return;\n        }\n        // quit if explicitly setting this elsewhere\n        if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n        var extraparam;\n        if(attr.substr(0, 6) === 'LAYOUT') {\n            extraparam = layoutNP(gd.layout, attr.replace('LAYOUT', ''));\n        } else {\n            var tracei = traces[i];\n            var preGUI = fullLayout._tracePreGUI[getFullTrace(tracei)._fullInput.uid];\n            extraparam = makeNP(preGUI, guiEditFlag)(data[tracei], attr);\n        }\n\n        if(!(attr in undoit)) {\n            undoit[attr] = a0();\n        }\n        if(undoit[attr][i] === undefined) {\n            undoit[attr][i] = undefinedToNull(extraparam.get());\n        }\n        if(val !== undefined) {\n            extraparam.set(val);\n        }\n    }\n\n    function allBins(binAttr) {\n        return function(j) {\n            return fullData[j][binAttr];\n        };\n    }\n\n    function arrayBins(binAttr) {\n        return function(vij, j) {\n            return vij === false ? fullData[traces[j]][binAttr] : null;\n        };\n    }\n\n    // now make the changes to gd.data (and occasionally gd.layout)\n    // and figure out what kind of graphics update we need to do\n    for(var ai in aobj) {\n        if(helpers.hasParent(aobj, ai)) {\n            throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously');\n        }\n\n        var vi = aobj[ai];\n        var cont;\n        var contFull;\n        var param;\n        var oldVal;\n        var newVal;\n        var valObject;\n\n        // Backward compatibility shim for turning histogram autobin on,\n        // or freezing previous autobinned values.\n        // Replace obsolete `autobin(x|y): true` with `(x|y)bins: null`\n        // and `autobin(x|y): false` with the `(x|y)bins` in `fullData`\n        if(ai === 'autobinx' || ai === 'autobiny') {\n            ai = ai.charAt(ai.length - 1) + 'bins';\n            if(Array.isArray(vi)) vi = vi.map(arrayBins(ai));\n            else if(vi === false) vi = traces.map(allBins(ai));\n            else vi = null;\n        }\n\n        redoit[ai] = vi;\n\n        if(ai.substr(0, 6) === 'LAYOUT') {\n            param = layoutNP(gd.layout, ai.replace('LAYOUT', ''));\n            undoit[ai] = [undefinedToNull(param.get())];\n            // since we're allowing val to be an array, allow it here too,\n            // even though that's meaningless\n            param.set(Array.isArray(vi) ? vi[0] : vi);\n            // ironically, the layout attrs in restyle only require replot,\n            // not relayout\n            flags.calc = true;\n            continue;\n        }\n\n        // set attribute in gd.data\n        undoit[ai] = a0();\n        for(i = 0; i < traces.length; i++) {\n            cont = data[traces[i]];\n            contFull = getFullTrace(traces[i]);\n            var preGUI = fullLayout._tracePreGUI[contFull._fullInput.uid];\n            param = makeNP(preGUI, guiEditFlag)(cont, ai);\n            oldVal = param.get();\n            newVal = Array.isArray(vi) ? vi[i % vi.length] : vi;\n\n            if(newVal === undefined) continue;\n\n            var finalPart = param.parts[param.parts.length - 1];\n            var prefix = ai.substr(0, ai.length - finalPart.length - 1);\n            var prefixDot = prefix ? prefix + '.' : '';\n            var innerContFull = prefix ?\n                nestedProperty(contFull, prefix).get() : contFull;\n\n            valObject = PlotSchema.getTraceValObject(contFull, param.parts);\n\n            if(valObject && valObject.impliedEdits && newVal !== null) {\n                for(var impliedKey in valObject.impliedEdits) {\n                    doextra(Lib.relativeAttr(ai, impliedKey), valObject.impliedEdits[impliedKey], i);\n                }\n            } else if((finalPart === 'thicknessmode' || finalPart === 'lenmode') &&\n                    oldVal !== newVal &&\n                    (newVal === 'fraction' || newVal === 'pixels') &&\n                    innerContFull\n            ) {\n                // changing colorbar size modes,\n                // make the resulting size not change\n                // note that colorbar fractional sizing is based on the\n                // original plot size, before anything (like a colorbar)\n                // increases the margins\n\n                var gs = fullLayout._size;\n                var orient = innerContFull.orient;\n                var topOrBottom = (orient === 'top') || (orient === 'bottom');\n                if(finalPart === 'thicknessmode') {\n                    var thicknorm = topOrBottom ? gs.h : gs.w;\n                    doextra(prefixDot + 'thickness', innerContFull.thickness *\n                        (newVal === 'fraction' ? 1 / thicknorm : thicknorm), i);\n                } else {\n                    var lennorm = topOrBottom ? gs.w : gs.h;\n                    doextra(prefixDot + 'len', innerContFull.len *\n                        (newVal === 'fraction' ? 1 / lennorm : lennorm), i);\n                }\n            } else if(ai === 'type' && (\n                (newVal === 'pie') !== (oldVal === 'pie') ||\n                (newVal === 'funnelarea') !== (oldVal === 'funnelarea')\n            )) {\n                var labelsTo = 'x';\n                var valuesTo = 'y';\n                if((newVal === 'bar' || oldVal === 'bar') && cont.orientation === 'h') {\n                    labelsTo = 'y';\n                    valuesTo = 'x';\n                }\n                Lib.swapAttrs(cont, ['?', '?src'], 'labels', labelsTo);\n                Lib.swapAttrs(cont, ['d?', '?0'], 'label', labelsTo);\n                Lib.swapAttrs(cont, ['?', '?src'], 'values', valuesTo);\n\n                if(oldVal === 'pie' || oldVal === 'funnelarea') {\n                    nestedProperty(cont, 'marker.color')\n                        .set(nestedProperty(cont, 'marker.colors').get());\n\n                    // super kludgy - but if all pies are gone we won't remove them otherwise\n                    fullLayout._pielayer.selectAll('g.trace').remove();\n                } else if(Registry.traceIs(cont, 'cartesian')) {\n                    nestedProperty(cont, 'marker.colors')\n                        .set(nestedProperty(cont, 'marker.color').get());\n                }\n            }\n\n            undoit[ai][i] = undefinedToNull(oldVal);\n            // set the new value - if val is an array, it's one el per trace\n            // first check for attributes that get more complex alterations\n            var swapAttrs = [\n                'swapxy', 'swapxyaxes', 'orientation', 'orientationaxes'\n            ];\n            if(swapAttrs.indexOf(ai) !== -1) {\n                // setting an orientation: make sure it's changing\n                // before we swap everything else\n                if(ai === 'orientation') {\n                    param.set(newVal);\n                    // obnoxious that we need this level of coupling... but in order to\n                    // properly handle setting orientation to `null` we need to mimic\n                    // the logic inside Bars.supplyDefaults for default orientation\n                    var defaultOrientation = (cont.x && !cont.y) ? 'h' : 'v';\n                    if((param.get() || defaultOrientation) === contFull.orientation) {\n                        continue;\n                    }\n                } else if(ai === 'orientationaxes') {\n                    // orientationaxes has no value,\n                    // it flips everything and the axes\n\n                    cont.orientation =\n                        {v: 'h', h: 'v'}[contFull.orientation];\n                }\n                helpers.swapXYData(cont);\n                flags.calc = flags.clearAxisTypes = true;\n            } else if(Plots.dataArrayContainers.indexOf(param.parts[0]) !== -1) {\n                // TODO: use manageArrays.applyContainerArrayChanges here too\n                helpers.manageArrayContainers(param, newVal, undoit);\n                flags.calc = true;\n            } else {\n                if(valObject) {\n                    // must redo calcdata when restyling array values of arrayOk attributes\n                    // ... but no need to this for regl-based traces\n                    if(valObject.arrayOk &&\n                        !Registry.traceIs(contFull, 'regl') &&\n                        (Lib.isArrayOrTypedArray(newVal) || Lib.isArrayOrTypedArray(oldVal))\n                    ) {\n                        flags.calc = true;\n                    } else editTypes.update(flags, valObject);\n                } else {\n                    /*\n                     * if we couldn't find valObject,  assume a full recalc.\n                     * This can happen if you're changing type and making\n                     * some other edits too, so the modules we're\n                     * looking at don't have these attributes in them.\n                     */\n                    flags.calc = true;\n                }\n\n                // all the other ones, just modify that one attribute\n                param.set(newVal);\n            }\n        }\n\n        // swap the data attributes of the relevant x and y axes?\n        if(['swapxyaxes', 'orientationaxes'].indexOf(ai) !== -1) {\n            Axes.swap(gd, traces);\n        }\n\n        // swap hovermode if set to \"compare x/y data\"\n        if(ai === 'orientationaxes') {\n            var hovermode = nestedProperty(gd.layout, 'hovermode');\n            if(hovermode.get() === 'x') {\n                hovermode.set('y');\n            } else if(hovermode.get() === 'y') {\n                hovermode.set('x');\n            } else if(hovermode.get() === 'x unified') {\n                hovermode.set('y unified');\n            } else if(hovermode.get() === 'y unified') {\n                hovermode.set('x unified');\n            }\n        }\n\n        // Major enough changes deserve autoscale and\n        // non-reversed axes so people don't get confused\n        //\n        // Note: autobin (or its new analog bin clearing) is not included here\n        // since we're not pushing bins back to gd.data, so if we have bin\n        // info it was explicitly provided by the user.\n        if(['orientation', 'type'].indexOf(ai) !== -1) {\n            axlist = [];\n            for(i = 0; i < traces.length; i++) {\n                var trace = data[traces[i]];\n\n                if(Registry.traceIs(trace, 'cartesian')) {\n                    addToAxlist(trace.xaxis || 'x');\n                    addToAxlist(trace.yaxis || 'y');\n                }\n            }\n\n            doextra(axlist.map(autorangeAttr), true, 0);\n            doextra(axlist.map(rangeAttr), [0, 1], 0);\n        }\n    }\n\n    if(flags.calc || flags.plot) {\n        flags.fullReplot = true;\n    }\n\n    return {\n        flags: flags,\n        undoit: undoit,\n        redoit: redoit,\n        traces: traces,\n        eventData: Lib.extendDeepNoArrays([], [eventData, traces])\n    };\n}\n\n/**\n * Converts deprecated attribute keys to\n * the current API to ensure backwards compatibility.\n *\n * This is needed for the update mechanism to determine which\n * subroutines to run based on the actual attribute\n * definitions (that don't include the deprecated ones).\n *\n * E.g. Maps {'xaxis.title': 'A chart'} to {'xaxis.title.text': 'A chart'}\n * and {titlefont: {...}} to {'title.font': {...}}.\n *\n * @param aobj\n */\nfunction cleanDeprecatedAttributeKeys(aobj) {\n    var oldAxisTitleRegex = Lib.counterRegex('axis', '\\.title', false, false);\n    var colorbarRegex = /colorbar\\.title$/;\n    var keys = Object.keys(aobj);\n    var i, key, value;\n\n    for(i = 0; i < keys.length; i++) {\n        key = keys[i];\n        value = aobj[key];\n\n        if((key === 'title' || oldAxisTitleRegex.test(key) || colorbarRegex.test(key)) &&\n          (typeof value === 'string' || typeof value === 'number')) {\n            replace(key, key.replace('title', 'title.text'));\n        } else if(key.indexOf('titlefont') > -1) {\n            replace(key, key.replace('titlefont', 'title.font'));\n        } else if(key.indexOf('titleposition') > -1) {\n            replace(key, key.replace('titleposition', 'title.position'));\n        } else if(key.indexOf('titleside') > -1) {\n            replace(key, key.replace('titleside', 'title.side'));\n        } else if(key.indexOf('titleoffset') > -1) {\n            replace(key, key.replace('titleoffset', 'title.offset'));\n        }\n    }\n\n    function replace(oldAttrStr, newAttrStr) {\n        aobj[newAttrStr] = aobj[oldAttrStr];\n        delete aobj[oldAttrStr];\n    }\n}\n\n/**\n * relayout: update layout attributes of an existing plot\n *\n * Can be called two ways:\n *\n * Signature 1:\n * @param {String | HTMLDivElement} gd\n *  the id or dom element of the graph container div\n * @param {String} astr\n *  attribute string (like `'xaxis.range[0]'`) to update\n * @param {*} val\n *  value to give this attribute\n *\n * Signature 2:\n * @param {String | HTMLDivElement} gd\n *  (as in signature 1)\n * @param {Object} aobj\n *  attribute object `{astr1: val1, astr2: val2 ...}`\n *  allows setting multiple attributes simultaneously\n */\nfunction relayout(gd, astr, val) {\n    gd = Lib.getGraphDiv(gd);\n    helpers.clearPromiseQueue(gd);\n\n    if(gd.framework && gd.framework.isPolar) {\n        return Promise.resolve(gd);\n    }\n\n    var aobj = {};\n    if(typeof astr === 'string') {\n        aobj[astr] = val;\n    } else if(Lib.isPlainObject(astr)) {\n        aobj = Lib.extendFlat({}, astr);\n    } else {\n        Lib.warn('Relayout fail.', astr, val);\n        return Promise.reject();\n    }\n\n    if(Object.keys(aobj).length) gd.changed = true;\n\n    var specs = _relayout(gd, aobj);\n    var flags = specs.flags;\n\n    // clear calcdata if required\n    if(flags.calc) gd.calcdata = undefined;\n\n    // fill in redraw sequence\n\n    // even if we don't have anything left in aobj,\n    // something may have happened within relayout that we\n    // need to wait for\n    var seq = [Plots.previousPromises];\n\n    if(flags.layoutReplot) {\n        seq.push(subroutines.layoutReplot);\n    } else if(Object.keys(aobj).length) {\n        axRangeSupplyDefaultsByPass(gd, flags, specs) || Plots.supplyDefaults(gd);\n\n        if(flags.legend) seq.push(subroutines.doLegend);\n        if(flags.layoutstyle) seq.push(subroutines.layoutStyles);\n        if(flags.axrange) addAxRangeSequence(seq, specs.rangesAltered);\n        if(flags.ticks) seq.push(subroutines.doTicksRelayout);\n        if(flags.modebar) seq.push(subroutines.doModeBar);\n        if(flags.camera) seq.push(subroutines.doCamera);\n        if(flags.colorbars) seq.push(subroutines.doColorBars);\n\n        seq.push(emitAfterPlot);\n    }\n\n    seq.push(Plots.rehover, Plots.redrag);\n\n    Queue.add(gd,\n        relayout, [gd, specs.undoit],\n        relayout, [gd, specs.redoit]\n    );\n\n    var plotDone = Lib.syncOrAsync(seq, gd);\n    if(!plotDone || !plotDone.then) plotDone = Promise.resolve(gd);\n\n    return plotDone.then(function() {\n        gd.emit('plotly_relayout', specs.eventData);\n        return gd;\n    });\n}\n\n// Optimization mostly for large splom traces where\n// Plots.supplyDefaults can take > 100ms\nfunction axRangeSupplyDefaultsByPass(gd, flags, specs) {\n    var fullLayout = gd._fullLayout;\n\n    if(!flags.axrange) return false;\n\n    for(var k in flags) {\n        if(k !== 'axrange' && flags[k]) return false;\n    }\n\n    for(var axId in specs.rangesAltered) {\n        var axName = Axes.id2name(axId);\n        var axIn = gd.layout[axName];\n        var axOut = fullLayout[axName];\n        axOut.autorange = axIn.autorange;\n        axOut.range = axIn.range.slice();\n        axOut.cleanRange();\n\n        if(axOut._matchGroup) {\n            for(var axId2 in axOut._matchGroup) {\n                if(axId2 !== axId) {\n                    var ax2 = fullLayout[Axes.id2name(axId2)];\n                    ax2.autorange = axOut.autorange;\n                    ax2.range = axOut.range.slice();\n                    ax2._input.range = axOut.range.slice();\n                }\n            }\n        }\n    }\n\n    return true;\n}\n\nfunction addAxRangeSequence(seq, rangesAltered) {\n    // N.B. leave as sequence of subroutines (for now) instead of\n    // subroutine of its own so that finalDraw always gets\n    // executed after drawData\n    var drawAxes = rangesAltered ?\n        function(gd) {\n            var axIds = [];\n            var skipTitle = true;\n\n            for(var id in rangesAltered) {\n                var ax = Axes.getFromId(gd, id);\n                axIds.push(id);\n\n                if(ax._matchGroup) {\n                    for(var id2 in ax._matchGroup) {\n                        if(!rangesAltered[id2]) {\n                            axIds.push(id2);\n                        }\n                    }\n                }\n\n                if(ax.automargin) skipTitle = false;\n            }\n\n            return Axes.draw(gd, axIds, {skipTitle: skipTitle});\n        } :\n        function(gd) {\n            return Axes.draw(gd, 'redraw');\n        };\n\n    seq.push(\n        clearSelect,\n        subroutines.doAutoRangeAndConstraints,\n        drawAxes,\n        subroutines.drawData,\n        subroutines.finalDraw\n    );\n}\n\nvar AX_RANGE_RE = /^[xyz]axis[0-9]*\\.range(\\[[0|1]\\])?$/;\nvar AX_AUTORANGE_RE = /^[xyz]axis[0-9]*\\.autorange$/;\nvar AX_DOMAIN_RE = /^[xyz]axis[0-9]*\\.domain(\\[[0|1]\\])?$/;\n\nfunction _relayout(gd, aobj) {\n    var layout = gd.layout;\n    var fullLayout = gd._fullLayout;\n    var guiEditFlag = fullLayout._guiEditing;\n    var layoutNP = makeNP(fullLayout._preGUI, guiEditFlag);\n    var keys = Object.keys(aobj);\n    var axes = Axes.list(gd);\n    var eventData = Lib.extendDeepAll({}, aobj);\n    var arrayEdits = {};\n\n    var arrayStr, i, j;\n\n    cleanDeprecatedAttributeKeys(aobj);\n    keys = Object.keys(aobj);\n\n    // look for 'allaxes', split out into all axes\n    // in case of 3D the axis are nested within a scene which is held in _id\n    for(i = 0; i < keys.length; i++) {\n        if(keys[i].indexOf('allaxes') === 0) {\n            for(j = 0; j < axes.length; j++) {\n                var scene = axes[j]._id.substr(1);\n                var axisAttr = (scene.indexOf('scene') !== -1) ? (scene + '.') : '';\n                var newkey = keys[i].replace('allaxes', axisAttr + axes[j]._name);\n\n                if(!aobj[newkey]) aobj[newkey] = aobj[keys[i]];\n            }\n\n            delete aobj[keys[i]];\n        }\n    }\n\n    // initialize flags\n    var flags = editTypes.layoutFlags();\n\n    // copies of the change (and previous values of anything affected)\n    // for the undo / redo queue\n    var redoit = {};\n    var undoit = {};\n\n    // for attrs that interact (like scales & autoscales), save the\n    // old vals before making the change\n    // val=undefined will not set a value, just record what the value was.\n    // attr can be an array to set several at once (all to the same val)\n    function doextra(attr, val) {\n        if(Array.isArray(attr)) {\n            attr.forEach(function(a) { doextra(a, val); });\n            return;\n        }\n\n        // if we have another value for this attribute (explicitly or\n        // via a parent) do not override with this auto-generated extra\n        if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n        var p = layoutNP(layout, attr);\n        if(!(attr in undoit)) {\n            undoit[attr] = undefinedToNull(p.get());\n        }\n        if(val !== undefined) p.set(val);\n    }\n\n    // for constraint enforcement: keep track of all axes (as {id: name})\n    // we're editing the (auto)range of, so we can tell the others constrained\n    // to scale with them that it's OK for them to shrink\n    var rangesAltered = {};\n    var axId;\n\n    function recordAlteredAxis(pleafPlus) {\n        var axId = Axes.name2id(pleafPlus.split('.')[0]);\n        rangesAltered[axId] = 1;\n        return axId;\n    }\n\n    // alter gd.layout\n    for(var ai in aobj) {\n        if(helpers.hasParent(aobj, ai)) {\n            throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously');\n        }\n\n        var p = layoutNP(layout, ai);\n        var vi = aobj[ai];\n        var plen = p.parts.length;\n        // p.parts may end with an index integer if the property is an array\n        var pend = plen - 1;\n        while(pend > 0 && typeof p.parts[pend] !== 'string') pend--;\n        // last property in chain (leaf node)\n        var pleaf = p.parts[pend];\n        // leaf plus immediate parent\n        var pleafPlus = p.parts[pend - 1] + '.' + pleaf;\n        // trunk nodes (everything except the leaf)\n        var ptrunk = p.parts.slice(0, pend).join('.');\n        var parentIn = nestedProperty(gd.layout, ptrunk).get();\n        var parentFull = nestedProperty(fullLayout, ptrunk).get();\n        var vOld = p.get();\n\n        if(vi === undefined) continue;\n\n        redoit[ai] = vi;\n\n        // axis reverse is special - it is its own inverse\n        // op and has no flag.\n        undoit[ai] = (pleaf === 'reverse') ? vi : undefinedToNull(vOld);\n\n        var valObject = PlotSchema.getLayoutValObject(fullLayout, p.parts);\n\n        if(valObject && valObject.impliedEdits && vi !== null) {\n            for(var impliedKey in valObject.impliedEdits) {\n                doextra(Lib.relativeAttr(ai, impliedKey), valObject.impliedEdits[impliedKey]);\n            }\n        }\n\n        // Setting width or height to null must reset the graph's width / height\n        // back to its initial value as computed during the first pass in Plots.plotAutoSize.\n        //\n        // To do so, we must manually set them back here using the _initialAutoSize cache.\n        // can't use impliedEdits for this because behavior depends on vi\n        if(['width', 'height'].indexOf(ai) !== -1) {\n            if(vi) {\n                doextra('autosize', null);\n                // currently we don't support autosize one dim only - so\n                // explicitly set the other one. Note that doextra will\n                // ignore this if the same relayout call also provides oppositeAttr\n                var oppositeAttr = ai === 'height' ? 'width' : 'height';\n                doextra(oppositeAttr, fullLayout[oppositeAttr]);\n            } else {\n                fullLayout[ai] = gd._initialAutoSize[ai];\n            }\n        } else if(ai === 'autosize') {\n            // depends on vi here too, so again can't use impliedEdits\n            doextra('width', vi ? null : fullLayout.width);\n            doextra('height', vi ? null : fullLayout.height);\n        } else if(pleafPlus.match(AX_RANGE_RE)) {\n            // check autorange vs range\n\n            recordAlteredAxis(pleafPlus);\n            nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n        } else if(pleafPlus.match(AX_AUTORANGE_RE)) {\n            recordAlteredAxis(pleafPlus);\n            nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n            var axFull = nestedProperty(fullLayout, ptrunk).get();\n            if(axFull._inputDomain) {\n                // if we're autoranging and this axis has a constrained domain,\n                // reset it so we don't get locked into a shrunken size\n                axFull._input.domain = axFull._inputDomain.slice();\n            }\n        } else if(pleafPlus.match(AX_DOMAIN_RE)) {\n            nestedProperty(fullLayout, ptrunk + '._inputDomain').set(null);\n        }\n\n        // toggling axis type between log and linear: we need to convert\n        // positions for components that are still using linearized values,\n        // not data values like newer components.\n        // previously we did this for log <-> not-log, but now only do it\n        // for log <-> linear\n        if(pleaf === 'type') {\n            var ax = parentIn;\n            var toLog = parentFull.type === 'linear' && vi === 'log';\n            var fromLog = parentFull.type === 'log' && vi === 'linear';\n\n            if(toLog || fromLog) {\n                if(!ax || !ax.range) {\n                    // 2D never gets here, but 3D does\n                    // I don't think this is needed, but left here in case there\n                    // are edge cases I'm not thinking of.\n                    doextra(ptrunk + '.autorange', true);\n                } else if(!parentFull.autorange) {\n                    // toggling log without autorange: need to also recalculate ranges\n                    // because log axes use linearized values for range endpoints\n                    var r0 = ax.range[0];\n                    var r1 = ax.range[1];\n                    if(toLog) {\n                        // if both limits are negative, autorange\n                        if(r0 <= 0 && r1 <= 0) {\n                            doextra(ptrunk + '.autorange', true);\n                        }\n                        // if one is negative, set it 6 orders below the other.\n                        if(r0 <= 0) r0 = r1 / 1e6;\n                        else if(r1 <= 0) r1 = r0 / 1e6;\n                        // now set the range values as appropriate\n                        doextra(ptrunk + '.range[0]', Math.log(r0) / Math.LN10);\n                        doextra(ptrunk + '.range[1]', Math.log(r1) / Math.LN10);\n                    } else {\n                        doextra(ptrunk + '.range[0]', Math.pow(10, r0));\n                        doextra(ptrunk + '.range[1]', Math.pow(10, r1));\n                    }\n                } else if(toLog) {\n                    // just make sure the range is positive and in the right\n                    // order, it'll get recalculated later\n                    ax.range = (ax.range[1] > ax.range[0]) ? [1, 2] : [2, 1];\n                }\n\n                // clear polar view initial stash for radial range so that\n                // value get recomputed in correct units\n                if(Array.isArray(fullLayout._subplots.polar) &&\n                    fullLayout._subplots.polar.length &&\n                    fullLayout[p.parts[0]] &&\n                    p.parts[1] === 'radialaxis'\n                ) {\n                    delete fullLayout[p.parts[0]]._subplot.viewInitial['radialaxis.range'];\n                }\n\n                // Annotations and images also need to convert to/from linearized coords\n                // Shapes do not need this :)\n                Registry.getComponentMethod('annotations', 'convertCoords')(gd, parentFull, vi, doextra);\n                Registry.getComponentMethod('images', 'convertCoords')(gd, parentFull, vi, doextra);\n            } else {\n                // any other type changes: the range from the previous type\n                // will not make sense, so autorange it.\n                doextra(ptrunk + '.autorange', true);\n                doextra(ptrunk + '.range', null);\n            }\n            nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n        } else if(pleaf.match(AX_NAME_PATTERN)) {\n            var fullProp = nestedProperty(fullLayout, ai).get();\n            var newType = (vi || {}).type;\n\n            // This can potentially cause strange behavior if the autotype is not\n            // numeric (linear, because we don't auto-log) but the previous type\n            // was log. That's a very strange edge case though\n            if(!newType || newType === '-') newType = 'linear';\n            Registry.getComponentMethod('annotations', 'convertCoords')(gd, fullProp, newType, doextra);\n            Registry.getComponentMethod('images', 'convertCoords')(gd, fullProp, newType, doextra);\n        }\n\n        // alter gd.layout\n\n        // collect array component edits for execution all together\n        // so we can ensure consistent behavior adding/removing items\n        // and order-independence for add/remove/edit all together in\n        // one relayout call\n        var containerArrayMatch = manageArrays.containerArrayMatch(ai);\n        if(containerArrayMatch) {\n            arrayStr = containerArrayMatch.array;\n            i = containerArrayMatch.index;\n            var propStr = containerArrayMatch.property;\n            var updateValObject = valObject || {editType: 'calc'};\n\n            if(i !== '' && propStr === '') {\n                // special handling of undoit if we're adding or removing an element\n                // ie 'annotations[2]' which can be {...} (add) or null,\n                // does not work when replacing the entire array\n                if(manageArrays.isAddVal(vi)) {\n                    undoit[ai] = null;\n                } else if(manageArrays.isRemoveVal(vi)) {\n                    undoit[ai] = (nestedProperty(layout, arrayStr).get() || [])[i];\n                } else {\n                    Lib.warn('unrecognized full object value', aobj);\n                }\n            }\n            editTypes.update(flags, updateValObject);\n\n            // prepare the edits object we'll send to applyContainerArrayChanges\n            if(!arrayEdits[arrayStr]) arrayEdits[arrayStr] = {};\n            var objEdits = arrayEdits[arrayStr][i];\n            if(!objEdits) objEdits = arrayEdits[arrayStr][i] = {};\n            objEdits[propStr] = vi;\n\n            delete aobj[ai];\n        } else if(pleaf === 'reverse') {\n            // handle axis reversal explicitly, as there's no 'reverse' attribute\n\n            if(parentIn.range) parentIn.range.reverse();\n            else {\n                doextra(ptrunk + '.autorange', true);\n                parentIn.range = [1, 0];\n            }\n\n            if(parentFull.autorange) flags.calc = true;\n            else flags.plot = true;\n        } else {\n            if((fullLayout._has('scatter-like') && fullLayout._has('regl')) &&\n                (ai === 'dragmode' &&\n                (vi === 'lasso' || vi === 'select') &&\n                !(vOld === 'lasso' || vOld === 'select'))\n            ) {\n                flags.plot = true;\n            } else if(fullLayout._has('gl2d')) {\n                flags.plot = true;\n            } else if(valObject) editTypes.update(flags, valObject);\n            else flags.calc = true;\n\n            p.set(vi);\n        }\n    }\n\n    // now we've collected component edits - execute them all together\n    for(arrayStr in arrayEdits) {\n        var finished = manageArrays.applyContainerArrayChanges(gd,\n            layoutNP(layout, arrayStr), arrayEdits[arrayStr], flags, layoutNP);\n        if(!finished) flags.plot = true;\n    }\n\n    // figure out if we need to recalculate axis constraints\n    var constraints = fullLayout._axisConstraintGroups || [];\n    for(axId in rangesAltered) {\n        for(i = 0; i < constraints.length; i++) {\n            var group = constraints[i];\n            if(group[axId]) {\n                // Always recalc if we're changing constrained ranges.\n                // Otherwise it's possible to violate the constraints by\n                // specifying arbitrary ranges for all axes in the group.\n                // this way some ranges may expand beyond what's specified,\n                // as they do at first draw, to satisfy the constraints.\n                flags.calc = true;\n                for(var groupAxId in group) {\n                    if(!rangesAltered[groupAxId]) {\n                        Axes.getFromId(gd, groupAxId)._constraintShrinkable = true;\n                    }\n                }\n            }\n        }\n    }\n\n    // If the autosize changed or height or width was explicitly specified,\n    // this triggers a redraw\n    // TODO: do we really need special aobj.height/width handling here?\n    // couldn't editType do this?\n    if(updateAutosize(gd) || aobj.height || aobj.width) flags.plot = true;\n\n    if(flags.plot || flags.calc) {\n        flags.layoutReplot = true;\n    }\n\n    // now all attribute mods are done, as are\n    // redo and undo so we can save them\n\n    return {\n        flags: flags,\n        rangesAltered: rangesAltered,\n        undoit: undoit,\n        redoit: redoit,\n        eventData: eventData\n    };\n}\n\n/*\n * updateAutosize: we made a change, does it change the autosize result?\n * puts the new size into fullLayout\n * returns true if either height or width changed\n */\nfunction updateAutosize(gd) {\n    var fullLayout = gd._fullLayout;\n    var oldWidth = fullLayout.width;\n    var oldHeight = fullLayout.height;\n\n    // calculate autosizing\n    if(gd.layout.autosize) Plots.plotAutoSize(gd, gd.layout, fullLayout);\n\n    return (fullLayout.width !== oldWidth) || (fullLayout.height !== oldHeight);\n}\n\n/**\n * update: update trace and layout attributes of an existing plot\n *\n * @param {String | HTMLDivElement} gd\n *  the id or DOM element of the graph container div\n * @param {Object} traceUpdate\n *  attribute object `{astr1: val1, astr2: val2 ...}`\n *  corresponding to updates in the plot's traces\n * @param {Object} layoutUpdate\n *  attribute object `{astr1: val1, astr2: val2 ...}`\n *  corresponding to updates in the plot's layout\n * @param {Number[] | Number} [traces]\n *  integer or array of integers for the traces to alter (all if omitted)\n *\n */\nfunction update(gd, traceUpdate, layoutUpdate, _traces) {\n    gd = Lib.getGraphDiv(gd);\n    helpers.clearPromiseQueue(gd);\n\n    if(gd.framework && gd.framework.isPolar) {\n        return Promise.resolve(gd);\n    }\n\n    if(!Lib.isPlainObject(traceUpdate)) traceUpdate = {};\n    if(!Lib.isPlainObject(layoutUpdate)) layoutUpdate = {};\n\n    if(Object.keys(traceUpdate).length) gd.changed = true;\n    if(Object.keys(layoutUpdate).length) gd.changed = true;\n\n    var traces = helpers.coerceTraceIndices(gd, _traces);\n\n    var restyleSpecs = _restyle(gd, Lib.extendFlat({}, traceUpdate), traces);\n    var restyleFlags = restyleSpecs.flags;\n\n    var relayoutSpecs = _relayout(gd, Lib.extendFlat({}, layoutUpdate));\n    var relayoutFlags = relayoutSpecs.flags;\n\n    // clear calcdata and/or axis types if required\n    if(restyleFlags.calc || relayoutFlags.calc) gd.calcdata = undefined;\n    if(restyleFlags.clearAxisTypes) helpers.clearAxisTypes(gd, traces, layoutUpdate);\n\n    // fill in redraw sequence\n    var seq = [];\n\n    if(relayoutFlags.layoutReplot) {\n        // N.B. works fine when both\n        // relayoutFlags.layoutReplot and restyleFlags.fullReplot are true\n        seq.push(subroutines.layoutReplot);\n    } else if(restyleFlags.fullReplot) {\n        seq.push(exports.plot);\n    } else {\n        seq.push(Plots.previousPromises);\n        axRangeSupplyDefaultsByPass(gd, relayoutFlags, relayoutSpecs) || Plots.supplyDefaults(gd);\n\n        if(restyleFlags.style) seq.push(subroutines.doTraceStyle);\n        if(restyleFlags.colorbars || relayoutFlags.colorbars) seq.push(subroutines.doColorBars);\n        if(relayoutFlags.legend) seq.push(subroutines.doLegend);\n        if(relayoutFlags.layoutstyle) seq.push(subroutines.layoutStyles);\n        if(relayoutFlags.axrange) addAxRangeSequence(seq, relayoutSpecs.rangesAltered);\n        if(relayoutFlags.ticks) seq.push(subroutines.doTicksRelayout);\n        if(relayoutFlags.modebar) seq.push(subroutines.doModeBar);\n        if(relayoutFlags.camera) seq.push(subroutines.doCamera);\n\n        seq.push(emitAfterPlot);\n    }\n\n    seq.push(Plots.rehover, Plots.redrag);\n\n    Queue.add(gd,\n        update, [gd, restyleSpecs.undoit, relayoutSpecs.undoit, restyleSpecs.traces],\n        update, [gd, restyleSpecs.redoit, relayoutSpecs.redoit, restyleSpecs.traces]\n    );\n\n    var plotDone = Lib.syncOrAsync(seq, gd);\n    if(!plotDone || !plotDone.then) plotDone = Promise.resolve(gd);\n\n    return plotDone.then(function() {\n        gd.emit('plotly_update', {\n            data: restyleSpecs.eventData,\n            layout: relayoutSpecs.eventData\n        });\n\n        return gd;\n    });\n}\n\n/*\n * internal-use-only restyle/relayout/update variants that record the initial\n * values in (fullLayout|fullTrace)._preGUI so changes can be persisted across\n * Plotly.react data updates, dependent on uirevision attributes\n */\nfunction guiEdit(func) {\n    return function wrappedEdit(gd) {\n        gd._fullLayout._guiEditing = true;\n        var p = func.apply(null, arguments);\n        gd._fullLayout._guiEditing = false;\n        return p;\n    };\n}\n\n// For connecting edited layout attributes to uirevision attrs\n// If no `attr` we use `match[1] + '.uirevision'`\n// Ordered by most common edits first, to minimize our search time\nvar layoutUIControlPatterns = [\n    {pattern: /^hiddenlabels/, attr: 'legend.uirevision'},\n    {pattern: /^((x|y)axis\\d*)\\.((auto)?range|title\\.text)/},\n\n    // showspikes and modes include those nested inside scenes\n    {pattern: /axis\\d*\\.showspikes$/, attr: 'modebar.uirevision'},\n    {pattern: /(hover|drag)mode$/, attr: 'modebar.uirevision'},\n\n    {pattern: /^(scene\\d*)\\.camera/},\n    {pattern: /^(geo\\d*)\\.(projection|center|fitbounds)/},\n    {pattern: /^(ternary\\d*\\.[abc]axis)\\.(min|title\\.text)$/},\n    {pattern: /^(polar\\d*\\.radialaxis)\\.((auto)?range|angle|title\\.text)/},\n    {pattern: /^(polar\\d*\\.angularaxis)\\.rotation/},\n    {pattern: /^(mapbox\\d*)\\.(center|zoom|bearing|pitch)/},\n\n    {pattern: /^legend\\.(x|y)$/, attr: 'editrevision'},\n    {pattern: /^(shapes|annotations)/, attr: 'editrevision'},\n    {pattern: /^title\\.text$/, attr: 'editrevision'}\n];\n\n// same for trace attributes: if `attr` is given it's in layout,\n// or with no `attr` we use `trace.uirevision`\nvar traceUIControlPatterns = [\n    {pattern: /^selectedpoints$/, attr: 'selectionrevision'},\n    // \"visible\" includes trace.transforms[i].styles[j].value.visible\n    {pattern: /(^|value\\.)visible$/, attr: 'legend.uirevision'},\n    {pattern: /^dimensions\\[\\d+\\]\\.constraintrange/},\n    {pattern: /^node\\.(x|y|groups)/}, // for Sankey nodes\n    {pattern: /^level$/}, // for Sunburst & Treemap traces\n\n    // below this you must be in editable: true mode\n    // TODO: I still put name and title with `trace.uirevision`\n    // reasonable or should these be `editrevision`?\n    // Also applies to axis titles up in the layout section\n\n    // \"name\" also includes transform.styles\n    {pattern: /(^|value\\.)name$/},\n    // including nested colorbar attributes (ie marker.colorbar)\n    {pattern: /colorbar\\.title\\.text$/},\n    {pattern: /colorbar\\.(x|y)$/, attr: 'editrevision'}\n];\n\nfunction findUIPattern(key, patternSpecs) {\n    for(var i = 0; i < patternSpecs.length; i++) {\n        var spec = patternSpecs[i];\n        var match = key.match(spec.pattern);\n        if(match) {\n            return {head: match[1], attr: spec.attr};\n        }\n    }\n}\n\n// We're finding the new uirevision before supplyDefaults, so do the\n// inheritance manually. Note that only `undefined` inherits - other\n// falsy values are returned.\nfunction getNewRev(revAttr, container) {\n    var newRev = nestedProperty(container, revAttr).get();\n    if(newRev !== undefined) return newRev;\n\n    var parts = revAttr.split('.');\n    parts.pop();\n    while(parts.length > 1) {\n        parts.pop();\n        newRev = nestedProperty(container, parts.join('.') + '.uirevision').get();\n        if(newRev !== undefined) return newRev;\n    }\n\n    return container.uirevision;\n}\n\nfunction getFullTraceIndexFromUid(uid, fullData) {\n    for(var i = 0; i < fullData.length; i++) {\n        if(fullData[i]._fullInput.uid === uid) return i;\n    }\n    return -1;\n}\n\nfunction getTraceIndexFromUid(uid, data, tracei) {\n    for(var i = 0; i < data.length; i++) {\n        if(data[i].uid === uid) return i;\n    }\n    // fall back on trace order, but only if user didn't provide a uid for that trace\n    return (!data[tracei] || data[tracei].uid) ? -1 : tracei;\n}\n\nfunction valsMatch(v1, v2) {\n    var v1IsObj = Lib.isPlainObject(v1);\n    var v1IsArray = Array.isArray(v1);\n    if(v1IsObj || v1IsArray) {\n        return (\n            (v1IsObj && Lib.isPlainObject(v2)) ||\n            (v1IsArray && Array.isArray(v2))\n        ) && JSON.stringify(v1) === JSON.stringify(v2);\n    }\n    return v1 === v2;\n}\n\nfunction applyUIRevisions(data, layout, oldFullData, oldFullLayout) {\n    var layoutPreGUI = oldFullLayout._preGUI;\n    var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal;\n    var bothInheritAutorange = [];\n    var newRangeAccepted = {};\n    for(key in layoutPreGUI) {\n        match = findUIPattern(key, layoutUIControlPatterns);\n        if(match) {\n            revAttr = match.attr || (match.head + '.uirevision');\n            oldRev = nestedProperty(oldFullLayout, revAttr).get();\n            newRev = oldRev && getNewRev(revAttr, layout);\n            if(newRev && (newRev === oldRev)) {\n                preGUIVal = layoutPreGUI[key];\n                if(preGUIVal === null) preGUIVal = undefined;\n                newNP = nestedProperty(layout, key);\n                newVal = newNP.get();\n                if(valsMatch(newVal, preGUIVal)) {\n                    if(newVal === undefined && key.substr(key.length - 9) === 'autorange') {\n                        bothInheritAutorange.push(key.substr(0, key.length - 10));\n                    }\n                    newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));\n                    continue;\n                }\n            }\n        } else {\n            Lib.warn('unrecognized GUI edit: ' + key);\n        }\n        // if we got this far, the new value was accepted as the new starting\n        // point (either because it changed or revision changed)\n        // so remove it from _preGUI for next time.\n        delete layoutPreGUI[key];\n\n        if(key.substr(key.length - 8, 6) === 'range[') {\n            newRangeAccepted[key.substr(0, key.length - 9)] = 1;\n        }\n    }\n\n    // Special logic for `autorange`, since it interacts with `range`:\n    // If the new figure's matching `range` was kept, and `autorange`\n    // wasn't supplied explicitly in either the original or the new figure,\n    // we shouldn't alter that - but we may just have done that, so fix it.\n    for(var i = 0; i < bothInheritAutorange.length; i++) {\n        var axAttr = bothInheritAutorange[i];\n        if(newRangeAccepted[axAttr]) {\n            var newAx = nestedProperty(layout, axAttr).get();\n            if(newAx) delete newAx.autorange;\n        }\n    }\n\n    // Now traces - try to match them up by uid (in case we added/deleted in\n    // the middle), then fall back on index.\n    var allTracePreGUI = oldFullLayout._tracePreGUI;\n    for(var uid in allTracePreGUI) {\n        var tracePreGUI = allTracePreGUI[uid];\n        var newTrace = null;\n        var fullInput;\n        for(key in tracePreGUI) {\n            // wait until we know we have preGUI values to look for traces\n            // but if we don't find both, stop looking at this uid\n            if(!newTrace) {\n                var fulli = getFullTraceIndexFromUid(uid, oldFullData);\n                if(fulli < 0) {\n                    // Somehow we didn't even have this trace in oldFullData...\n                    // I guess this could happen with `deleteTraces` or something\n                    delete allTracePreGUI[uid];\n                    break;\n                }\n                var fullTrace = oldFullData[fulli];\n                fullInput = fullTrace._fullInput;\n\n                var newTracei = getTraceIndexFromUid(uid, data, fullInput.index);\n                if(newTracei < 0) {\n                    // No match in new data\n                    delete allTracePreGUI[uid];\n                    break;\n                }\n                newTrace = data[newTracei];\n            }\n\n            match = findUIPattern(key, traceUIControlPatterns);\n            if(match) {\n                if(match.attr) {\n                    oldRev = nestedProperty(oldFullLayout, match.attr).get();\n                    newRev = oldRev && getNewRev(match.attr, layout);\n                } else {\n                    oldRev = fullInput.uirevision;\n                    // inheritance for trace.uirevision is simple, just layout.uirevision\n                    newRev = newTrace.uirevision;\n                    if(newRev === undefined) newRev = layout.uirevision;\n                }\n\n                if(newRev && newRev === oldRev) {\n                    preGUIVal = tracePreGUI[key];\n                    if(preGUIVal === null) preGUIVal = undefined;\n                    newNP = nestedProperty(newTrace, key);\n                    newVal = newNP.get();\n                    if(valsMatch(newVal, preGUIVal)) {\n                        newNP.set(undefinedToNull(nestedProperty(fullInput, key).get()));\n                        continue;\n                    }\n                }\n            } else {\n                Lib.warn('unrecognized GUI edit: ' + key + ' in trace uid ' + uid);\n            }\n            delete tracePreGUI[key];\n        }\n    }\n}\n\n/**\n * Plotly.react:\n * A plot/update method that takes the full plot state (same API as plot/newPlot)\n * and diffs to determine the minimal update pathway\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n * @param {array of objects} data\n *      array of traces, containing the data and display information for each trace\n * @param {object} layout\n *      object describing the overall display of the plot,\n *      all the stuff that doesn't pertain to any individual trace\n * @param {object} config\n *      configuration options (see ./plot_config.js for more info)\n *\n * OR\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n * @param {object} figure\n *      object containing `data`, `layout`, `config`, and `frames` members\n *\n */\nfunction react(gd, data, layout, config) {\n    var frames, plotDone;\n\n    function addFrames() { return exports.addFrames(gd, frames); }\n\n    gd = Lib.getGraphDiv(gd);\n    helpers.clearPromiseQueue(gd);\n\n    var oldFullData = gd._fullData;\n    var oldFullLayout = gd._fullLayout;\n\n    // you can use this as the initial draw as well as to update\n    if(!Lib.isPlotDiv(gd) || !oldFullData || !oldFullLayout) {\n        plotDone = exports.newPlot(gd, data, layout, config);\n    } else {\n        if(Lib.isPlainObject(data)) {\n            var obj = data;\n            data = obj.data;\n            layout = obj.layout;\n            config = obj.config;\n            frames = obj.frames;\n        }\n\n        var configChanged = false;\n        // assume that if there's a config at all, we're reacting to it too,\n        // and completely replace the previous config\n        if(config) {\n            var oldConfig = Lib.extendDeep({}, gd._context);\n            gd._context = undefined;\n            setPlotContext(gd, config);\n            configChanged = diffConfig(oldConfig, gd._context);\n        }\n\n        gd.data = data || [];\n        helpers.cleanData(gd.data);\n        gd.layout = layout || {};\n        helpers.cleanLayout(gd.layout);\n\n        applyUIRevisions(gd.data, gd.layout, oldFullData, oldFullLayout);\n\n        var allNames = Object.getOwnPropertyNames(oldFullLayout);\n        for(var q = 0; q < allNames.length; q++) {\n            var name = allNames[q];\n            var start = name.substring(0, 5);\n            if(start === 'xaxis' || start === 'yaxis') {\n                var emptyCategories = oldFullLayout[name]._emptyCategories;\n                if(emptyCategories) emptyCategories();\n            }\n        }\n\n        // \"true\" skips updating calcdata and remapping arrays from calcTransforms,\n        // which supplyDefaults usually does at the end, but we may need to NOT do\n        // if the diff (which we haven't determined yet) says we'll recalc\n        Plots.supplyDefaults(gd, {skipUpdateCalc: true});\n\n        var newFullData = gd._fullData;\n        var newFullLayout = gd._fullLayout;\n        var immutable = newFullLayout.datarevision === undefined;\n        var transition = newFullLayout.transition;\n\n        var relayoutFlags = diffLayout(gd, oldFullLayout, newFullLayout, immutable, transition);\n        var newDataRevision = relayoutFlags.newDataRevision;\n        var restyleFlags = diffData(gd, oldFullData, newFullData, immutable, transition, newDataRevision);\n\n        // TODO: how to translate this part of relayout to Plotly.react?\n        // // Setting width or height to null must reset the graph's width / height\n        // // back to its initial value as computed during the first pass in Plots.plotAutoSize.\n        // //\n        // // To do so, we must manually set them back here using the _initialAutoSize cache.\n        // if(['width', 'height'].indexOf(ai) !== -1 && vi === null) {\n        //     fullLayout[ai] = gd._initialAutoSize[ai];\n        // }\n\n        if(updateAutosize(gd)) relayoutFlags.layoutReplot = true;\n\n        // clear calcdata if required\n        if(restyleFlags.calc || relayoutFlags.calc) gd.calcdata = undefined;\n        // otherwise do the calcdata updates and calcTransform array remaps that we skipped earlier\n        else Plots.supplyDefaultsUpdateCalc(gd.calcdata, newFullData);\n\n        // Note: what restyle/relayout use impliedEdits and clearAxisTypes for\n        // must be handled by the user when using Plotly.react.\n\n        // fill in redraw sequence\n        var seq = [];\n\n        if(frames) {\n            gd._transitionData = {};\n            Plots.createTransitionData(gd);\n            seq.push(addFrames);\n        }\n\n        // Transition pathway,\n        // only used when 'transition' is set by user and\n        // when at least one animatable attribute has changed,\n        // N.B. config changed aren't animatable\n        if(newFullLayout.transition && !configChanged && (restyleFlags.anim || relayoutFlags.anim)) {\n            Plots.doCalcdata(gd);\n            subroutines.doAutoRangeAndConstraints(gd);\n\n            seq.push(function() {\n                return Plots.transitionFromReact(gd, restyleFlags, relayoutFlags, oldFullLayout);\n            });\n        } else if(restyleFlags.fullReplot || relayoutFlags.layoutReplot || configChanged) {\n            gd._fullLayout._skipDefaults = true;\n            seq.push(exports.plot);\n        } else {\n            for(var componentType in relayoutFlags.arrays) {\n                var indices = relayoutFlags.arrays[componentType];\n                if(indices.length) {\n                    var drawOne = Registry.getComponentMethod(componentType, 'drawOne');\n                    if(drawOne !== Lib.noop) {\n                        for(var i = 0; i < indices.length; i++) {\n                            drawOne(gd, indices[i]);\n                        }\n                    } else {\n                        var draw = Registry.getComponentMethod(componentType, 'draw');\n                        if(draw === Lib.noop) {\n                            throw new Error('cannot draw components: ' + componentType);\n                        }\n                        draw(gd);\n                    }\n                }\n            }\n\n            seq.push(Plots.previousPromises);\n            if(restyleFlags.style) seq.push(subroutines.doTraceStyle);\n            if(restyleFlags.colorbars || relayoutFlags.colorbars) seq.push(subroutines.doColorBars);\n            if(relayoutFlags.legend) seq.push(subroutines.doLegend);\n            if(relayoutFlags.layoutstyle) seq.push(subroutines.layoutStyles);\n            if(relayoutFlags.axrange) addAxRangeSequence(seq);\n            if(relayoutFlags.ticks) seq.push(subroutines.doTicksRelayout);\n            if(relayoutFlags.modebar) seq.push(subroutines.doModeBar);\n            if(relayoutFlags.camera) seq.push(subroutines.doCamera);\n            seq.push(emitAfterPlot);\n        }\n\n        seq.push(Plots.rehover, Plots.redrag);\n\n        plotDone = Lib.syncOrAsync(seq, gd);\n        if(!plotDone || !plotDone.then) plotDone = Promise.resolve(gd);\n    }\n\n    return plotDone.then(function() {\n        gd.emit('plotly_react', {\n            data: data,\n            layout: layout\n        });\n\n        return gd;\n    });\n}\n\nfunction diffData(gd, oldFullData, newFullData, immutable, transition, newDataRevision) {\n    var sameTraceLength = oldFullData.length === newFullData.length;\n\n    if(!transition && !sameTraceLength) {\n        return {\n            fullReplot: true,\n            calc: true\n        };\n    }\n\n    var flags = editTypes.traceFlags();\n    flags.arrays = {};\n    flags.nChanges = 0;\n    flags.nChangesAnim = 0;\n\n    var i, trace;\n\n    function getTraceValObject(parts) {\n        var out = PlotSchema.getTraceValObject(trace, parts);\n        if(!trace._module.animatable && out.anim) {\n            out.anim = false;\n        }\n        return out;\n    }\n\n    var diffOpts = {\n        getValObject: getTraceValObject,\n        flags: flags,\n        immutable: immutable,\n        transition: transition,\n        newDataRevision: newDataRevision,\n        gd: gd\n    };\n\n    var seenUIDs = {};\n\n    for(i = 0; i < oldFullData.length; i++) {\n        if(newFullData[i]) {\n            trace = newFullData[i]._fullInput;\n            if(Plots.hasMakesDataTransform(trace)) trace = newFullData[i];\n            if(seenUIDs[trace.uid]) continue;\n            seenUIDs[trace.uid] = 1;\n\n            getDiffFlags(oldFullData[i]._fullInput, trace, [], diffOpts);\n        }\n    }\n\n    if(flags.calc || flags.plot) {\n        flags.fullReplot = true;\n    }\n\n    if(transition && flags.nChanges && flags.nChangesAnim) {\n        flags.anim = (flags.nChanges === flags.nChangesAnim) && sameTraceLength ? 'all' : 'some';\n    }\n\n    return flags;\n}\n\nfunction diffLayout(gd, oldFullLayout, newFullLayout, immutable, transition) {\n    var flags = editTypes.layoutFlags();\n    flags.arrays = {};\n    flags.rangesAltered = {};\n    flags.nChanges = 0;\n    flags.nChangesAnim = 0;\n\n    function getLayoutValObject(parts) {\n        return PlotSchema.getLayoutValObject(newFullLayout, parts);\n    }\n\n    var diffOpts = {\n        getValObject: getLayoutValObject,\n        flags: flags,\n        immutable: immutable,\n        transition: transition,\n        gd: gd\n    };\n\n    getDiffFlags(oldFullLayout, newFullLayout, [], diffOpts);\n\n    if(flags.plot || flags.calc) {\n        flags.layoutReplot = true;\n    }\n\n    if(transition && flags.nChanges && flags.nChangesAnim) {\n        flags.anim = flags.nChanges === flags.nChangesAnim ? 'all' : 'some';\n    }\n\n    return flags;\n}\n\nfunction getDiffFlags(oldContainer, newContainer, outerparts, opts) {\n    var valObject, key, astr;\n\n    var getValObject = opts.getValObject;\n    var flags = opts.flags;\n    var immutable = opts.immutable;\n    var inArray = opts.inArray;\n    var arrayIndex = opts.arrayIndex;\n\n    function changed() {\n        var editType = valObject.editType;\n        if(inArray && editType.indexOf('arraydraw') !== -1) {\n            Lib.pushUnique(flags.arrays[inArray], arrayIndex);\n            return;\n        }\n        editTypes.update(flags, valObject);\n\n        if(editType !== 'none') {\n            flags.nChanges++;\n        }\n\n        // track animatable changes\n        if(opts.transition && valObject.anim) {\n            flags.nChangesAnim++;\n        }\n\n        // track cartesian axes with altered ranges\n        if(AX_RANGE_RE.test(astr) || AX_AUTORANGE_RE.test(astr)) {\n            flags.rangesAltered[outerparts[0]] = 1;\n        }\n\n        // clear _inputDomain on cartesian axes with altered domains\n        if(AX_DOMAIN_RE.test(astr)) {\n            nestedProperty(newContainer, '_inputDomain').set(null);\n        }\n\n        // track datarevision changes\n        if(key === 'datarevision') {\n            flags.newDataRevision = 1;\n        }\n    }\n\n    function valObjectCanBeDataArray(valObject) {\n        return valObject.valType === 'data_array' || valObject.arrayOk;\n    }\n\n    for(key in oldContainer) {\n        // short-circuit based on previous calls or previous keys that already maximized the pathway\n        if(flags.calc && !opts.transition) return;\n\n        var oldVal = oldContainer[key];\n        var newVal = newContainer[key];\n        var parts = outerparts.concat(key);\n        astr = parts.join('.');\n\n        if(key.charAt(0) === '_' || typeof oldVal === 'function' || oldVal === newVal) continue;\n\n        // FIXME: ax.tick0 and dtick get filled in during plotting (except for geo subplots),\n        // and unlike other auto values they don't make it back into the input,\n        // so newContainer won't have them.\n        if((key === 'tick0' || key === 'dtick') && outerparts[0] !== 'geo') {\n            var tickMode = newContainer.tickmode;\n            if(tickMode === 'auto' || tickMode === 'array' || !tickMode) continue;\n        }\n        // FIXME: Similarly for axis ranges for 3D\n        // contourcarpet doesn't HAVE zmin/zmax, they're just auto-added. It needs them.\n        if(key === 'range' && newContainer.autorange) continue;\n        if((key === 'zmin' || key === 'zmax') && newContainer.type === 'contourcarpet') continue;\n\n        valObject = getValObject(parts);\n\n        // in case type changed, we may not even *have* a valObject.\n        if(!valObject) continue;\n\n        if(valObject._compareAsJSON && JSON.stringify(oldVal) === JSON.stringify(newVal)) continue;\n\n        var valType = valObject.valType;\n        var i;\n\n        var canBeDataArray = valObjectCanBeDataArray(valObject);\n        var wasArray = Array.isArray(oldVal);\n        var nowArray = Array.isArray(newVal);\n\n        // hack for traces that modify the data in supplyDefaults, like\n        // converting 1D to 2D arrays, which will always create new objects\n        if(wasArray && nowArray) {\n            var inputKey = '_input_' + key;\n            var oldValIn = oldContainer[inputKey];\n            var newValIn = newContainer[inputKey];\n            if(Array.isArray(oldValIn) && oldValIn === newValIn) continue;\n        }\n\n        if(newVal === undefined) {\n            if(canBeDataArray && wasArray) flags.calc = true;\n            else changed();\n        } else if(valObject._isLinkedToArray) {\n            var arrayEditIndices = [];\n            var extraIndices = false;\n            if(!inArray) flags.arrays[key] = arrayEditIndices;\n\n            var minLen = Math.min(oldVal.length, newVal.length);\n            var maxLen = Math.max(oldVal.length, newVal.length);\n            if(minLen !== maxLen) {\n                if(valObject.editType === 'arraydraw') {\n                    extraIndices = true;\n                } else {\n                    changed();\n                    continue;\n                }\n            }\n\n            for(i = 0; i < minLen; i++) {\n                getDiffFlags(oldVal[i], newVal[i], parts.concat(i),\n                    // add array indices, but not if we're already in an array\n                    Lib.extendFlat({inArray: key, arrayIndex: i}, opts));\n            }\n\n            // put this at the end so that we know our collected array indices are sorted\n            // but the check for length changes happens up front so we can short-circuit\n            // diffing if appropriate\n            if(extraIndices) {\n                for(i = minLen; i < maxLen; i++) {\n                    arrayEditIndices.push(i);\n                }\n            }\n        } else if(!valType && Lib.isPlainObject(oldVal)) {\n            getDiffFlags(oldVal, newVal, parts, opts);\n        } else if(canBeDataArray) {\n            if(wasArray && nowArray) {\n                // don't try to diff two data arrays. If immutable we know the data changed,\n                // if not, assume it didn't and let `layout.datarevision` tell us if it did\n                if(immutable) {\n                    flags.calc = true;\n                }\n\n                // look for animatable attributes when the data changed\n                if(immutable || opts.newDataRevision) {\n                    changed();\n                }\n            } else if(wasArray !== nowArray) {\n                flags.calc = true;\n            } else changed();\n        } else if(wasArray && nowArray) {\n            // info array, colorscale, 'any' - these are short, just stringify.\n            // I don't *think* that covers up any real differences post-validation, does it?\n            // otherwise we need to dive in 1 (info_array) or 2 (colorscale) levels and compare\n            // all elements.\n            if(oldVal.length !== newVal.length || String(oldVal) !== String(newVal)) {\n                changed();\n            }\n        } else {\n            changed();\n        }\n    }\n\n    for(key in newContainer) {\n        if(!(key in oldContainer || key.charAt(0) === '_' || typeof newContainer[key] === 'function')) {\n            valObject = getValObject(outerparts.concat(key));\n\n            if(valObjectCanBeDataArray(valObject) && Array.isArray(newContainer[key])) {\n                flags.calc = true;\n                return;\n            } else changed();\n        }\n    }\n}\n\n/*\n * simple diff for config - for now, just treat all changes as equivalent\n */\nfunction diffConfig(oldConfig, newConfig) {\n    var key;\n\n    for(key in oldConfig) {\n        if(key.charAt(0) === '_') continue;\n        var oldVal = oldConfig[key];\n        var newVal = newConfig[key];\n        if(oldVal !== newVal) {\n            if(Lib.isPlainObject(oldVal) && Lib.isPlainObject(newVal)) {\n                if(diffConfig(oldVal, newVal)) {\n                    return true;\n                }\n            } else if(Array.isArray(oldVal) && Array.isArray(newVal)) {\n                if(oldVal.length !== newVal.length) {\n                    return true;\n                }\n                for(var i = 0; i < oldVal.length; i++) {\n                    if(oldVal[i] !== newVal[i]) {\n                        if(Lib.isPlainObject(oldVal[i]) && Lib.isPlainObject(newVal[i])) {\n                            if(diffConfig(oldVal[i], newVal[i])) {\n                                return true;\n                            }\n                        } else {\n                            return true;\n                        }\n                    }\n                }\n            } else {\n                return true;\n            }\n        }\n    }\n}\n\n/**\n * Animate to a frame, sequence of frame, frame group, or frame definition\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n *\n * @param {string or object or array of strings or array of objects} frameOrGroupNameOrFrameList\n *      a single frame, array of frames, or group to which to animate. The intent is\n *      inferred by the type of the input. Valid inputs are:\n *\n *      - string, e.g. 'groupname': animate all frames of a given `group` in the order\n *            in which they are defined via `Plotly.addFrames`.\n *\n *      - array of strings, e.g. ['frame1', frame2']: a list of frames by name to which\n *            to animate in sequence\n *\n *      - object: {data: ...}: a frame definition to which to animate. The frame is not\n *            and does not need to be added via `Plotly.addFrames`. It may contain any of\n *            the properties of a frame, including `data`, `layout`, and `traces`. The\n *            frame is used as provided and does not use the `baseframe` property.\n *\n *      - array of objects, e.g. [{data: ...}, {data: ...}]: a list of frame objects,\n *            each following the same rules as a single `object`.\n *\n * @param {object} animationOpts\n *      configuration for the animation\n */\nfunction animate(gd, frameOrGroupNameOrFrameList, animationOpts) {\n    gd = Lib.getGraphDiv(gd);\n\n    if(!Lib.isPlotDiv(gd)) {\n        throw new Error(\n            'This element is not a Plotly plot: ' + gd + '. It\\'s likely that you\\'ve failed ' +\n            'to create a plot before animating it. For more details, see ' +\n            'https://plotly.com/javascript/animations/'\n        );\n    }\n\n    var trans = gd._transitionData;\n\n    // This is the queue of frames that will be animated as soon as possible. They\n    // are popped immediately upon the *start* of a transition:\n    if(!trans._frameQueue) {\n        trans._frameQueue = [];\n    }\n\n    animationOpts = Plots.supplyAnimationDefaults(animationOpts);\n    var transitionOpts = animationOpts.transition;\n    var frameOpts = animationOpts.frame;\n\n    // Since frames are popped immediately, an empty queue only means all frames have\n    // *started* to transition, not that the animation is complete. To solve that,\n    // track a separate counter that increments at the same time as frames are added\n    // to the queue, but decrements only when the transition is complete.\n    if(trans._frameWaitingCnt === undefined) {\n        trans._frameWaitingCnt = 0;\n    }\n\n    function getTransitionOpts(i) {\n        if(Array.isArray(transitionOpts)) {\n            if(i >= transitionOpts.length) {\n                return transitionOpts[0];\n            } else {\n                return transitionOpts[i];\n            }\n        } else {\n            return transitionOpts;\n        }\n    }\n\n    function getFrameOpts(i) {\n        if(Array.isArray(frameOpts)) {\n            if(i >= frameOpts.length) {\n                return frameOpts[0];\n            } else {\n                return frameOpts[i];\n            }\n        } else {\n            return frameOpts;\n        }\n    }\n\n    // Execute a callback after the wrapper function has been called n times.\n    // This is used to defer the resolution until a transition has resovled *and*\n    // the frame has completed. If it's not done this way, then we get a race\n    // condition in which the animation might resolve before a transition is complete\n    // or vice versa.\n    function callbackOnNthTime(cb, n) {\n        var cnt = 0;\n        return function() {\n            if(cb && ++cnt === n) {\n                return cb();\n            }\n        };\n    }\n\n    return new Promise(function(resolve, reject) {\n        function discardExistingFrames() {\n            if(trans._frameQueue.length === 0) {\n                return;\n            }\n\n            while(trans._frameQueue.length) {\n                var next = trans._frameQueue.pop();\n                if(next.onInterrupt) {\n                    next.onInterrupt();\n                }\n            }\n\n            gd.emit('plotly_animationinterrupted', []);\n        }\n\n        function queueFrames(frameList) {\n            if(frameList.length === 0) return;\n\n            for(var i = 0; i < frameList.length; i++) {\n                var computedFrame;\n\n                if(frameList[i].type === 'byname') {\n                    // If it's a named frame, compute it:\n                    computedFrame = Plots.computeFrame(gd, frameList[i].name);\n                } else {\n                    // Otherwise we must have been given a simple object, so treat\n                    // the input itself as the computed frame.\n                    computedFrame = frameList[i].data;\n                }\n\n                var frameOpts = getFrameOpts(i);\n                var transitionOpts = getTransitionOpts(i);\n\n                // It doesn't make much sense for the transition duration to be greater than\n                // the frame duration, so limit it:\n                transitionOpts.duration = Math.min(transitionOpts.duration, frameOpts.duration);\n\n                var nextFrame = {\n                    frame: computedFrame,\n                    name: frameList[i].name,\n                    frameOpts: frameOpts,\n                    transitionOpts: transitionOpts,\n                };\n                if(i === frameList.length - 1) {\n                    // The last frame in this .animate call stores the promise resolve\n                    // and reject callbacks. This is how we ensure that the animation\n                    // loop (which may exist as a result of a *different* .animate call)\n                    // still resolves or rejecdts this .animate call's promise. once it's\n                    // complete.\n                    nextFrame.onComplete = callbackOnNthTime(resolve, 2);\n                    nextFrame.onInterrupt = reject;\n                }\n\n                trans._frameQueue.push(nextFrame);\n            }\n\n            // Set it as never having transitioned to a frame. This will cause the animation\n            // loop to immediately transition to the next frame (which, for immediate mode,\n            // is the first frame in the list since all others would have been discarded\n            // below)\n            if(animationOpts.mode === 'immediate') {\n                trans._lastFrameAt = -Infinity;\n            }\n\n            // Only it's not already running, start a RAF loop. This could be avoided in the\n            // case that there's only one frame, but it significantly complicated the logic\n            // and only sped things up by about 5% or so for a lorenz attractor simulation.\n            // It would be a fine thing to implement, but the benefit of that optimization\n            // doesn't seem worth the extra complexity.\n            if(!trans._animationRaf) {\n                beginAnimationLoop();\n            }\n        }\n\n        function stopAnimationLoop() {\n            gd.emit('plotly_animated');\n\n            // Be sure to unset also since it's how we know whether a loop is already running:\n            window.cancelAnimationFrame(trans._animationRaf);\n            trans._animationRaf = null;\n        }\n\n        function nextFrame() {\n            if(trans._currentFrame && trans._currentFrame.onComplete) {\n                // Execute the callback and unset it to ensure it doesn't\n                // accidentally get called twice\n                trans._currentFrame.onComplete();\n            }\n\n            var newFrame = trans._currentFrame = trans._frameQueue.shift();\n\n            if(newFrame) {\n                // Since it's sometimes necessary to do deep digging into frame data,\n                // we'll consider it not 100% impossible for nulls or numbers to sneak through,\n                // so check when casting the name, just to be absolutely certain:\n                var stringName = newFrame.name ? newFrame.name.toString() : null;\n                gd._fullLayout._currentFrame = stringName;\n\n                trans._lastFrameAt = Date.now();\n                trans._timeToNext = newFrame.frameOpts.duration;\n\n                // This is simply called and it's left to .transition to decide how to manage\n                // interrupting current transitions. That means we don't need to worry about\n                // how it resolves or what happens after this:\n                Plots.transition(gd,\n                    newFrame.frame.data,\n                    newFrame.frame.layout,\n                    helpers.coerceTraceIndices(gd, newFrame.frame.traces),\n                    newFrame.frameOpts,\n                    newFrame.transitionOpts\n                ).then(function() {\n                    if(newFrame.onComplete) {\n                        newFrame.onComplete();\n                    }\n                });\n\n                gd.emit('plotly_animatingframe', {\n                    name: stringName,\n                    frame: newFrame.frame,\n                    animation: {\n                        frame: newFrame.frameOpts,\n                        transition: newFrame.transitionOpts,\n                    }\n                });\n            } else {\n                // If there are no more frames, then stop the RAF loop:\n                stopAnimationLoop();\n            }\n        }\n\n        function beginAnimationLoop() {\n            gd.emit('plotly_animating');\n\n            // If no timer is running, then set last frame = long ago so that the next\n            // frame is immediately transitioned:\n            trans._lastFrameAt = -Infinity;\n            trans._timeToNext = 0;\n            trans._runningTransitions = 0;\n            trans._currentFrame = null;\n\n            var doFrame = function() {\n                // This *must* be requested before nextFrame since nextFrame may decide\n                // to cancel it if there's nothing more to animated:\n                trans._animationRaf = window.requestAnimationFrame(doFrame);\n\n                // Check if we're ready for a new frame:\n                if(Date.now() - trans._lastFrameAt > trans._timeToNext) {\n                    nextFrame();\n                }\n            };\n\n            doFrame();\n        }\n\n        // This is an animate-local counter that helps match up option input list\n        // items with the particular frame.\n        var configCounter = 0;\n        function setTransitionConfig(frame) {\n            if(Array.isArray(transitionOpts)) {\n                if(configCounter >= transitionOpts.length) {\n                    frame.transitionOpts = transitionOpts[configCounter];\n                } else {\n                    frame.transitionOpts = transitionOpts[0];\n                }\n            } else {\n                frame.transitionOpts = transitionOpts;\n            }\n            configCounter++;\n            return frame;\n        }\n\n        // Disambiguate what's sort of frames have been received\n        var i, frame;\n        var frameList = [];\n        var allFrames = frameOrGroupNameOrFrameList === undefined || frameOrGroupNameOrFrameList === null;\n        var isFrameArray = Array.isArray(frameOrGroupNameOrFrameList);\n        var isSingleFrame = !allFrames && !isFrameArray && Lib.isPlainObject(frameOrGroupNameOrFrameList);\n\n        if(isSingleFrame) {\n            // In this case, a simple object has been passed to animate.\n            frameList.push({\n                type: 'object',\n                data: setTransitionConfig(Lib.extendFlat({}, frameOrGroupNameOrFrameList))\n            });\n        } else if(allFrames || ['string', 'number'].indexOf(typeof frameOrGroupNameOrFrameList) !== -1) {\n            // In this case, null or undefined has been passed so that we want to\n            // animate *all* currently defined frames\n            for(i = 0; i < trans._frames.length; i++) {\n                frame = trans._frames[i];\n\n                if(!frame) continue;\n\n                if(allFrames || String(frame.group) === String(frameOrGroupNameOrFrameList)) {\n                    frameList.push({\n                        type: 'byname',\n                        name: String(frame.name),\n                        data: setTransitionConfig({name: frame.name})\n                    });\n                }\n            }\n        } else if(isFrameArray) {\n            for(i = 0; i < frameOrGroupNameOrFrameList.length; i++) {\n                var frameOrName = frameOrGroupNameOrFrameList[i];\n                if(['number', 'string'].indexOf(typeof frameOrName) !== -1) {\n                    frameOrName = String(frameOrName);\n                    // In this case, there's an array and this frame is a string name:\n                    frameList.push({\n                        type: 'byname',\n                        name: frameOrName,\n                        data: setTransitionConfig({name: frameOrName})\n                    });\n                } else if(Lib.isPlainObject(frameOrName)) {\n                    frameList.push({\n                        type: 'object',\n                        data: setTransitionConfig(Lib.extendFlat({}, frameOrName))\n                    });\n                }\n            }\n        }\n\n        // Verify that all of these frames actually exist; return and reject if not:\n        for(i = 0; i < frameList.length; i++) {\n            frame = frameList[i];\n            if(frame.type === 'byname' && !trans._frameHash[frame.data.name]) {\n                Lib.warn('animate failure: frame not found: \"' + frame.data.name + '\"');\n                reject();\n                return;\n            }\n        }\n\n        // If the mode is either next or immediate, then all currently queued frames must\n        // be dumped and the corresponding .animate promises rejected.\n        if(['next', 'immediate'].indexOf(animationOpts.mode) !== -1) {\n            discardExistingFrames();\n        }\n\n        if(animationOpts.direction === 'reverse') {\n            frameList.reverse();\n        }\n\n        var currentFrame = gd._fullLayout._currentFrame;\n        if(currentFrame && animationOpts.fromcurrent) {\n            var idx = -1;\n            for(i = 0; i < frameList.length; i++) {\n                frame = frameList[i];\n                if(frame.type === 'byname' && frame.name === currentFrame) {\n                    idx = i;\n                    break;\n                }\n            }\n\n            if(idx > 0 && idx < frameList.length - 1) {\n                var filteredFrameList = [];\n                for(i = 0; i < frameList.length; i++) {\n                    frame = frameList[i];\n                    if(frameList[i].type !== 'byname' || i > idx) {\n                        filteredFrameList.push(frame);\n                    }\n                }\n                frameList = filteredFrameList;\n            }\n        }\n\n        if(frameList.length > 0) {\n            queueFrames(frameList);\n        } else {\n            // This is the case where there were simply no frames. It's a little strange\n            // since there's not much to do:\n            gd.emit('plotly_animated');\n            resolve();\n        }\n    });\n}\n\n/**\n * Register new frames\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n *\n * @param {array of objects} frameList\n *      list of frame definitions, in which each object includes any of:\n *      - name: {string} name of frame to add\n *      - data: {array of objects} trace data\n *      - layout {object} layout definition\n *      - traces {array} trace indices\n *      - baseframe {string} name of frame from which this frame gets defaults\n *\n *  @param {array of integers} indices\n *      an array of integer indices matching the respective frames in `frameList`. If not\n *      provided, an index will be provided in serial order. If already used, the frame\n *      will be overwritten.\n */\nfunction addFrames(gd, frameList, indices) {\n    gd = Lib.getGraphDiv(gd);\n\n    if(frameList === null || frameList === undefined) {\n        return Promise.resolve();\n    }\n\n    if(!Lib.isPlotDiv(gd)) {\n        throw new Error(\n            'This element is not a Plotly plot: ' + gd + '. It\\'s likely that you\\'ve failed ' +\n            'to create a plot before adding frames. For more details, see ' +\n            'https://plotly.com/javascript/animations/'\n        );\n    }\n\n    var i, frame, j, idx;\n    var _frames = gd._transitionData._frames;\n    var _frameHash = gd._transitionData._frameHash;\n\n\n    if(!Array.isArray(frameList)) {\n        throw new Error('addFrames failure: frameList must be an Array of frame definitions' + frameList);\n    }\n\n    // Create a sorted list of insertions since we run into lots of problems if these\n    // aren't in ascending order of index:\n    //\n    // Strictly for sorting. Make sure this is guaranteed to never collide with any\n    // already-exisisting indices:\n    var bigIndex = _frames.length + frameList.length * 2;\n\n    var insertions = [];\n    var _frameHashLocal = {};\n    for(i = frameList.length - 1; i >= 0; i--) {\n        if(!Lib.isPlainObject(frameList[i])) continue;\n\n        // The entire logic for checking for this type of name collision can be removed once we migrate to ES6 and\n        // use a Map instead of an Object instance, as Map keys aren't converted to strings.\n        var lookupName = frameList[i].name;\n        var name = (_frameHash[lookupName] || _frameHashLocal[lookupName] || {}).name;\n        var newName = frameList[i].name;\n        var collisionPresent = _frameHash[name] || _frameHashLocal[name];\n\n        if(name && newName && typeof newName === 'number' && collisionPresent && numericNameWarningCount < numericNameWarningCountLimit) {\n            numericNameWarningCount++;\n\n            Lib.warn('addFrames: overwriting frame \"' + (_frameHash[name] || _frameHashLocal[name]).name +\n                '\" with a frame whose name of type \"number\" also equates to \"' +\n                name + '\". This is valid but may potentially lead to unexpected ' +\n                'behavior since all plotly.js frame names are stored internally ' +\n                'as strings.');\n\n            if(numericNameWarningCount === numericNameWarningCountLimit) {\n                Lib.warn('addFrames: This API call has yielded too many of these warnings. ' +\n                    'For the rest of this call, further warnings about numeric frame ' +\n                    'names will be suppressed.');\n            }\n        }\n\n        _frameHashLocal[lookupName] = {name: lookupName};\n\n        insertions.push({\n            frame: Plots.supplyFrameDefaults(frameList[i]),\n            index: (indices && indices[i] !== undefined && indices[i] !== null) ? indices[i] : bigIndex + i\n        });\n    }\n\n    // Sort this, taking note that undefined insertions end up at the end:\n    insertions.sort(function(a, b) {\n        if(a.index > b.index) return -1;\n        if(a.index < b.index) return 1;\n        return 0;\n    });\n\n    var ops = [];\n    var revops = [];\n    var frameCount = _frames.length;\n\n    for(i = insertions.length - 1; i >= 0; i--) {\n        frame = insertions[i].frame;\n\n        if(typeof frame.name === 'number') {\n            Lib.warn('Warning: addFrames accepts frames with numeric names, but the numbers are' +\n                'implicitly cast to strings');\n        }\n\n        if(!frame.name) {\n            // Repeatedly assign a default name, incrementing the counter each time until\n            // we get a name that's not in the hashed lookup table:\n            while(_frameHash[(frame.name = 'frame ' + gd._transitionData._counter++)]);\n        }\n\n        if(_frameHash[frame.name]) {\n            // If frame is present, overwrite its definition:\n            for(j = 0; j < _frames.length; j++) {\n                if((_frames[j] || {}).name === frame.name) break;\n            }\n            ops.push({type: 'replace', index: j, value: frame});\n            revops.unshift({type: 'replace', index: j, value: _frames[j]});\n        } else {\n            // Otherwise insert it at the end of the list:\n            idx = Math.max(0, Math.min(insertions[i].index, frameCount));\n\n            ops.push({type: 'insert', index: idx, value: frame});\n            revops.unshift({type: 'delete', index: idx});\n            frameCount++;\n        }\n    }\n\n    var undoFunc = Plots.modifyFrames;\n    var redoFunc = Plots.modifyFrames;\n    var undoArgs = [gd, revops];\n    var redoArgs = [gd, ops];\n\n    if(Queue) Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n    return Plots.modifyFrames(gd, ops);\n}\n\n/**\n * Delete frame\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n *\n * @param {array of integers} frameList\n *      list of integer indices of frames to be deleted\n */\nfunction deleteFrames(gd, frameList) {\n    gd = Lib.getGraphDiv(gd);\n\n    if(!Lib.isPlotDiv(gd)) {\n        throw new Error('This element is not a Plotly plot: ' + gd);\n    }\n\n    var i, idx;\n    var _frames = gd._transitionData._frames;\n    var ops = [];\n    var revops = [];\n\n    if(!frameList) {\n        frameList = [];\n        for(i = 0; i < _frames.length; i++) {\n            frameList.push(i);\n        }\n    }\n\n    frameList = frameList.slice();\n    frameList.sort();\n\n    for(i = frameList.length - 1; i >= 0; i--) {\n        idx = frameList[i];\n        ops.push({type: 'delete', index: idx});\n        revops.unshift({type: 'insert', index: idx, value: _frames[idx]});\n    }\n\n    var undoFunc = Plots.modifyFrames;\n    var redoFunc = Plots.modifyFrames;\n    var undoArgs = [gd, revops];\n    var redoArgs = [gd, ops];\n\n    if(Queue) Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n    return Plots.modifyFrames(gd, ops);\n}\n\n/**\n * Purge a graph container div back to its initial pre-Plotly.plot state\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n */\nfunction purge(gd) {\n    gd = Lib.getGraphDiv(gd);\n\n    var fullLayout = gd._fullLayout || {};\n    var fullData = gd._fullData || [];\n\n    // remove gl contexts\n    Plots.cleanPlot([], {}, fullData, fullLayout);\n\n    // purge properties\n    Plots.purge(gd);\n\n    // purge event emitter methods\n    Events.purge(gd);\n\n    // remove plot container\n    if(fullLayout._container) fullLayout._container.remove();\n\n    // in contrast to Plotly.Plots.purge which does NOT clear _context!\n    delete gd._context;\n\n    return gd;\n}\n\n// -------------------------------------------------------\n// makePlotFramework: Create the plot container and axes\n// -------------------------------------------------------\nfunction makePlotFramework(gd) {\n    var gd3 = d3.select(gd);\n    var fullLayout = gd._fullLayout;\n\n    // Plot container\n    fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n    fullLayout._container.enter().insert('div', ':first-child')\n        .classed('plot-container', true)\n        .classed('plotly', true);\n\n    // Make the svg container\n    fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n    fullLayout._paperdiv.enter().append('div')\n        .classed('svg-container', true)\n        .style('position', 'relative');\n\n    // Make the graph containers\n    // start fresh each time we get here, so we know the order comes out\n    // right, rather than enter/exit which can muck up the order\n    // TODO: sort out all the ordering so we don't have to\n    // explicitly delete anything\n    // FIXME: parcoords reuses this object, not the best pattern\n    fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container')\n        .data([{}]);\n\n    fullLayout._glcontainer.enter().append('div')\n        .classed('gl-container', true);\n\n    fullLayout._paperdiv.selectAll('.main-svg').remove();\n    fullLayout._paperdiv.select('.modebar-container').remove();\n\n    fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child')\n        .classed('main-svg', true);\n\n    fullLayout._toppaper = fullLayout._paperdiv.append('svg')\n        .classed('main-svg', true);\n\n    fullLayout._modebardiv = fullLayout._paperdiv.append('div');\n\n    fullLayout._hoverpaper = fullLayout._paperdiv.append('svg')\n        .classed('main-svg', true);\n\n    if(!fullLayout._uid) {\n        var otherUids = {};\n        d3.selectAll('defs').each(function() {\n            if(this.id) otherUids[this.id.split('-')[1]] = 1;\n        });\n        fullLayout._uid = Lib.randstr(otherUids);\n    }\n\n    fullLayout._paperdiv.selectAll('.main-svg')\n        .attr(xmlnsNamespaces.svgAttrs);\n\n    fullLayout._defs = fullLayout._paper.append('defs')\n        .attr('id', 'defs-' + fullLayout._uid);\n\n    fullLayout._clips = fullLayout._defs.append('g')\n        .classed('clips', true);\n\n    fullLayout._topdefs = fullLayout._toppaper.append('defs')\n        .attr('id', 'topdefs-' + fullLayout._uid);\n\n    fullLayout._topclips = fullLayout._topdefs.append('g')\n        .classed('clips', true);\n\n    fullLayout._bgLayer = fullLayout._paper.append('g')\n        .classed('bglayer', true);\n\n    fullLayout._draggers = fullLayout._paper.append('g')\n        .classed('draglayer', true);\n\n    // lower shape/image layer - note that this is behind\n    // all subplots data/grids but above the backgrounds\n    // except inset subplots, whose backgrounds are drawn\n    // inside their own group so that they appear above\n    // the data for the main subplot\n    // lower shapes and images which are fully referenced to\n    // a subplot still get drawn within the subplot's group\n    // so they will work correctly on insets\n    var layerBelow = fullLayout._paper.append('g')\n        .classed('layer-below', true);\n    fullLayout._imageLowerLayer = layerBelow.append('g')\n        .classed('imagelayer', true);\n    fullLayout._shapeLowerLayer = layerBelow.append('g')\n        .classed('shapelayer', true);\n\n    // single cartesian layer for the whole plot\n    fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n    // single polar layer for the whole plot\n    fullLayout._polarlayer = fullLayout._paper.append('g').classed('polarlayer', true);\n\n    // single ternary layer for the whole plot\n    fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n    // single geo layer for the whole plot\n    fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true);\n\n    // single funnelarea layer for the whole plot\n    fullLayout._funnelarealayer = fullLayout._paper.append('g').classed('funnelarealayer', true);\n\n    // single pie layer for the whole plot\n    fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n    // single treemap layer for the whole plot\n    fullLayout._treemaplayer = fullLayout._paper.append('g').classed('treemaplayer', true);\n\n    // single sunburst layer for the whole plot\n    fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunburstlayer', true);\n\n    // single indicator layer for the whole plot\n    fullLayout._indicatorlayer = fullLayout._toppaper.append('g').classed('indicatorlayer', true);\n\n    // fill in image server scrape-svg\n    fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\n    // lastly upper shapes, info (legend, annotations) and hover layers go on top\n    // these are in a different svg element normally, but get collapsed into a single\n    // svg when exporting (after inserting 3D)\n    // upper shapes/images are only those drawn above the whole plot, including subplots\n    var layerAbove = fullLayout._toppaper.append('g')\n        .classed('layer-above', true);\n    fullLayout._imageUpperLayer = layerAbove.append('g')\n        .classed('imagelayer', true);\n    fullLayout._shapeUpperLayer = layerAbove.append('g')\n        .classed('shapelayer', true);\n\n    fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n    fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);\n    fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n    fullLayout._hoverlayer = fullLayout._hoverpaper.append('g').classed('hoverlayer', true);\n\n    // Make the modebar container\n    fullLayout._modebardiv\n        .classed('modebar-container', true)\n        .style('position', 'absolute')\n        .style('top', '0px')\n        .style('right', '0px');\n\n    gd.emit('plotly_framework');\n}\n\nexports.animate = animate;\nexports.addFrames = addFrames;\nexports.deleteFrames = deleteFrames;\n\nexports.addTraces = addTraces;\nexports.deleteTraces = deleteTraces;\nexports.extendTraces = extendTraces;\nexports.moveTraces = moveTraces;\nexports.prependTraces = prependTraces;\n\nexports.newPlot = newPlot;\nexports.plot = plot;\nexports.purge = purge;\n\nexports.react = react;\nexports.redraw = redraw;\nexports.relayout = relayout;\nexports.restyle = restyle;\n\nexports.setPlotConfig = setPlotConfig;\n\nexports.update = update;\n\nexports._guiRelayout = guiEdit(relayout);\nexports._guiRestyle = guiEdit(restyle);\nexports._guiUpdate = guiEdit(update);\n\nexports._storeDirectGUIEdit = _storeDirectGUIEdit;\n\n},{\"../components/color\":52,\"../components/drawing\":74,\"../constants/xmlns_namespaces\":159,\"../lib\":178,\"../lib/events\":172,\"../lib/queue\":192,\"../lib/svg_text_utils\":199,\"../plots/cartesian/axes\":222,\"../plots/cartesian/constants\":228,\"../plots/cartesian/graph_interact\":231,\"../plots/cartesian/select\":241,\"../plots/plots\":256,\"../plots/polar/legacy\":259,\"../registry\":269,\"./edit_types\":205,\"./helpers\":206,\"./manage_arrays\":208,\"./plot_config\":210,\"./plot_schema\":211,\"./subroutines\":213,\"d3\":16,\"fast-isnumeric\":18,\"has-hover\":20}],210:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * This will be transferred over to gd and overridden by\n * config args to Plotly.plot.\n *\n * The defaults are the appropriate settings for plotly.js,\n * so we get the right experience without any config argument.\n *\n * N.B. the config options are not coerced using Lib.coerce so keys\n * like `valType` and `values` are only set for documentation purposes\n * at the moment.\n */\n\nvar configAttributes = {\n    staticPlot: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n\n    plotlyServerURL: {\n        valType: 'string',\n        dflt: '',\n        \n    },\n\n    editable: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n    edits: {\n        annotationPosition: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        annotationTail: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        annotationText: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        axisTitleText: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        colorbarPosition: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        colorbarTitleText: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        legendPosition: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        legendText: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        shapePosition: {\n            valType: 'boolean',\n            dflt: false,\n            \n        },\n        titleText: {\n            valType: 'boolean',\n            dflt: false,\n            \n        }\n    },\n\n    autosizable: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n    responsive: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n    fillFrame: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n    frameMargins: {\n        valType: 'number',\n        dflt: 0,\n        min: 0,\n        max: 0.5,\n        \n    },\n\n    scrollZoom: {\n        valType: 'flaglist',\n        flags: ['cartesian', 'gl3d', 'geo', 'mapbox'],\n        extras: [true, false],\n        dflt: 'gl3d+geo+mapbox',\n        \n    },\n    doubleClick: {\n        valType: 'enumerated',\n        values: [false, 'reset', 'autosize', 'reset+autosize'],\n        dflt: 'reset+autosize',\n        \n    },\n    doubleClickDelay: {\n        valType: 'number',\n        dflt: 300,\n        min: 0,\n        \n    },\n\n    showAxisDragHandles: {\n        valType: 'boolean',\n        dflt: true,\n        \n    },\n    showAxisRangeEntryBoxes: {\n        valType: 'boolean',\n        dflt: true,\n        \n    },\n\n    showTips: {\n        valType: 'boolean',\n        dflt: true,\n        \n    },\n\n    showLink: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n    linkText: {\n        valType: 'string',\n        dflt: 'Edit chart',\n        noBlank: true,\n        \n    },\n    sendData: {\n        valType: 'boolean',\n        dflt: true,\n        \n    },\n    showSources: {\n        valType: 'any',\n        dflt: false,\n        \n    },\n\n    displayModeBar: {\n        valType: 'enumerated',\n        values: ['hover', true, false],\n        dflt: 'hover',\n        \n    },\n    showSendToCloud: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n    showEditInChartStudio: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n    modeBarButtonsToRemove: {\n        valType: 'any',\n        dflt: [],\n        \n    },\n    modeBarButtonsToAdd: {\n        valType: 'any',\n        dflt: [],\n        \n    },\n    modeBarButtons: {\n        valType: 'any',\n        dflt: false,\n        \n    },\n    toImageButtonOptions: {\n        valType: 'any',\n        dflt: {},\n        \n    },\n    displaylogo: {\n        valType: 'boolean',\n        dflt: true,\n        \n    },\n    watermark: {\n        valType: 'boolean',\n        dflt: false,\n        \n    },\n\n    plotGlPixelRatio: {\n        valType: 'number',\n        dflt: 2,\n        min: 1,\n        max: 4,\n        \n    },\n\n    setBackground: {\n        valType: 'any',\n        dflt: 'transparent',\n        \n    },\n\n    topojsonURL: {\n        valType: 'string',\n        noBlank: true,\n        dflt: 'https://cdn.plot.ly/',\n        \n    },\n\n    mapboxAccessToken: {\n        valType: 'string',\n        dflt: null,\n        \n    },\n\n    logging: {\n        valType: 'integer',\n        min: 0,\n        max: 2,\n        dflt: 1,\n        \n    },\n\n    notifyOnLogging: {\n        valType: 'integer',\n        min: 0,\n        max: 2,\n        dflt: 0,\n        \n    },\n\n    queueLength: {\n        valType: 'integer',\n        min: 0,\n        dflt: 0,\n        \n    },\n\n    globalTransforms: {\n        valType: 'any',\n        dflt: [],\n        \n    },\n\n    locale: {\n        valType: 'string',\n        dflt: 'en-US',\n        \n    },\n\n    locales: {\n        valType: 'any',\n        dflt: {},\n        \n    }\n};\n\nvar dfltConfig = {};\n\nfunction crawl(src, target) {\n    for(var k in src) {\n        var obj = src[k];\n        if(obj.valType) {\n            target[k] = obj.dflt;\n        } else {\n            if(!target[k]) {\n                target[k] = {};\n            }\n            crawl(obj, target[k]);\n        }\n    }\n}\n\ncrawl(configAttributes, dfltConfig);\n\nmodule.exports = {\n    configAttributes: configAttributes,\n    dfltConfig: dfltConfig\n};\n\n},{}],211:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\n\nvar baseAttributes = _dereq_('../plots/attributes');\nvar baseLayoutAttributes = _dereq_('../plots/layout_attributes');\nvar frameAttributes = _dereq_('../plots/frame_attributes');\nvar animationAttributes = _dereq_('../plots/animation_attributes');\nvar configAttributes = _dereq_('./plot_config').configAttributes;\n\n// polar attributes are not part of the Registry yet\nvar polarAreaAttrs = _dereq_('../plots/polar/legacy/area_attributes');\nvar polarAxisAttrs = _dereq_('../plots/polar/legacy/axis_attributes');\n\nvar editTypes = _dereq_('./edit_types');\n\nvar extendFlat = Lib.extendFlat;\nvar extendDeepAll = Lib.extendDeepAll;\nvar isPlainObject = Lib.isPlainObject;\nvar isArrayOrTypedArray = Lib.isArrayOrTypedArray;\nvar nestedProperty = Lib.nestedProperty;\nvar valObjectMeta = Lib.valObjectMeta;\n\nvar IS_SUBPLOT_OBJ = '_isSubplotObj';\nvar IS_LINKED_TO_ARRAY = '_isLinkedToArray';\nvar ARRAY_ATTR_REGEXPS = '_arrayAttrRegexps';\nvar DEPRECATED = '_deprecated';\nvar UNDERSCORE_ATTRS = [IS_SUBPLOT_OBJ, IS_LINKED_TO_ARRAY, ARRAY_ATTR_REGEXPS, DEPRECATED];\n\nexports.IS_SUBPLOT_OBJ = IS_SUBPLOT_OBJ;\nexports.IS_LINKED_TO_ARRAY = IS_LINKED_TO_ARRAY;\nexports.DEPRECATED = DEPRECATED;\nexports.UNDERSCORE_ATTRS = UNDERSCORE_ATTRS;\n\n/** Outputs the full plotly.js plot schema\n *\n * @return {object}\n *  - defs\n *  - traces\n *  - layout\n *  - transforms\n *  - frames\n *  - animations\n *  - config\n */\nexports.get = function() {\n    var traces = {};\n\n    Registry.allTypes.concat('area').forEach(function(type) {\n        traces[type] = getTraceAttributes(type);\n    });\n\n    var transforms = {};\n\n    Object.keys(Registry.transformsRegistry).forEach(function(type) {\n        transforms[type] = getTransformAttributes(type);\n    });\n\n    return {\n        defs: {\n            valObjects: valObjectMeta,\n            metaKeys: UNDERSCORE_ATTRS.concat(['description', 'role', 'editType', 'impliedEdits']),\n            editType: {\n                traces: editTypes.traces,\n                layout: editTypes.layout\n            },\n            impliedEdits: {\n                \n            }\n        },\n\n        traces: traces,\n        layout: getLayoutAttributes(),\n\n        transforms: transforms,\n\n        frames: getFramesAttributes(),\n        animation: formatAttributes(animationAttributes),\n\n        config: formatAttributes(configAttributes)\n    };\n};\n\n/**\n * Crawl the attribute tree, recursively calling a callback function\n *\n * @param {object} attrs\n *  The node of the attribute tree (e.g. the root) from which recursion originates\n * @param {Function} callback\n *  A callback function with the signature:\n *          @callback callback\n *          @param {object} attr an attribute\n *          @param {String} attrName name string\n *          @param {object[]} attrs all the attributes\n *          @param {Number} level the recursion level, 0 at the root\n *          @param {String} fullAttrString full attribute name (ie 'marker.line')\n * @param {Number} [specifiedLevel]\n *  The level in the tree, in order to let the callback function detect descend or backtrack,\n *  typically unsupplied (implied 0), just used by the self-recursive call.\n *  The necessity arises because the tree traversal is not controlled by callback return values.\n *  The decision to not use callback return values for controlling tree pruning arose from\n *  the goal of keeping the crawler backwards compatible. Observe that one of the pruning conditions\n *  precedes the callback call.\n * @param {string} [attrString]\n *  the path to the current attribute, as an attribute string (ie 'marker.line')\n *  typically unsupplied, but you may supply it if you want to disambiguate which attrs tree you\n *  are starting from\n *\n * @return {object} transformOut\n *  copy of transformIn that contains attribute defaults\n */\nexports.crawl = function(attrs, callback, specifiedLevel, attrString) {\n    var level = specifiedLevel || 0;\n    attrString = attrString || '';\n\n    Object.keys(attrs).forEach(function(attrName) {\n        var attr = attrs[attrName];\n\n        if(UNDERSCORE_ATTRS.indexOf(attrName) !== -1) return;\n\n        var fullAttrString = (attrString ? attrString + '.' : '') + attrName;\n        callback(attr, attrName, attrs, level, fullAttrString);\n\n        if(exports.isValObject(attr)) return;\n\n        if(isPlainObject(attr) && attrName !== 'impliedEdits') {\n            exports.crawl(attr, callback, level + 1, fullAttrString);\n        }\n    });\n};\n\n/** Is object a value object (or a container object)?\n *\n * @param {object} obj\n * @return {boolean}\n *  returns true for a valid value object and\n *  false for tree nodes in the attribute hierarchy\n */\nexports.isValObject = function(obj) {\n    return obj && obj.valType !== undefined;\n};\n\n/**\n * Find all data array attributes in a given trace object - including\n * `arrayOk` attributes.\n *\n * @param {object} trace\n *  full trace object that contains a reference to `_module.attributes`\n *\n * @return {array} arrayAttributes\n *  list of array attributes for the given trace\n */\nexports.findArrayAttributes = function(trace) {\n    var arrayAttributes = [];\n    var stack = [];\n    var isArrayStack = [];\n    var baseContainer, baseAttrName;\n\n    function callback(attr, attrName, attrs, level) {\n        stack = stack.slice(0, level).concat([attrName]);\n        isArrayStack = isArrayStack.slice(0, level).concat([attr && attr._isLinkedToArray]);\n\n        var splittableAttr = (\n            attr &&\n            (attr.valType === 'data_array' || attr.arrayOk === true) &&\n            !(stack[level - 1] === 'colorbar' && (attrName === 'ticktext' || attrName === 'tickvals'))\n        );\n\n        // Manually exclude 'colorbar.tickvals' and 'colorbar.ticktext' for now\n        // which are declared as `valType: 'data_array'` but scale independently of\n        // the coordinate arrays.\n        //\n        // Down the road, we might want to add a schema field (e.g `uncorrelatedArray: true`)\n        // to distinguish attributes of the likes.\n\n        if(!splittableAttr) return;\n\n        crawlIntoTrace(baseContainer, 0, '');\n    }\n\n    function crawlIntoTrace(container, i, astrPartial) {\n        var item = container[stack[i]];\n        var newAstrPartial = astrPartial + stack[i];\n        if(i === stack.length - 1) {\n            if(isArrayOrTypedArray(item)) {\n                arrayAttributes.push(baseAttrName + newAstrPartial);\n            }\n        } else {\n            if(isArrayStack[i]) {\n                if(Array.isArray(item)) {\n                    for(var j = 0; j < item.length; j++) {\n                        if(isPlainObject(item[j])) {\n                            crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');\n                        }\n                    }\n                }\n            } else if(isPlainObject(item)) {\n                crawlIntoTrace(item, i + 1, newAstrPartial + '.');\n            }\n        }\n    }\n\n    baseContainer = trace;\n    baseAttrName = '';\n    exports.crawl(baseAttributes, callback);\n    if(trace._module && trace._module.attributes) {\n        exports.crawl(trace._module.attributes, callback);\n    }\n\n    var transforms = trace.transforms;\n    if(transforms) {\n        for(var i = 0; i < transforms.length; i++) {\n            var transform = transforms[i];\n            var module = transform._module;\n\n            if(module) {\n                baseAttrName = 'transforms[' + i + '].';\n                baseContainer = transform;\n\n                exports.crawl(module.attributes, callback);\n            }\n        }\n    }\n\n    return arrayAttributes;\n};\n\n/*\n * Find the valObject for one attribute in an existing trace\n *\n * @param {object} trace\n *  full trace object that contains a reference to `_module.attributes`\n * @param {object} parts\n *  an array of parts, like ['transforms', 1, 'value']\n *  typically from nestedProperty(...).parts\n *\n * @return {object|false}\n *  the valObject for this attribute, or the last found parent\n *  in some cases the innermost valObject will not exist, for example\n *  `valType: 'any'` attributes where we might set a part of the attribute.\n *  In that case, stop at the deepest valObject we *do* find.\n */\nexports.getTraceValObject = function(trace, parts) {\n    var head = parts[0];\n    var i = 1; // index to start recursing from\n    var moduleAttrs, valObject;\n\n    if(head === 'transforms') {\n        if(parts.length === 1) {\n            return baseAttributes.transforms;\n        }\n        var transforms = trace.transforms;\n        if(!Array.isArray(transforms) || !transforms.length) return false;\n        var tNum = parts[1];\n        if(!isIndex(tNum) || tNum >= transforms.length) {\n            return false;\n        }\n        moduleAttrs = (Registry.transformsRegistry[transforms[tNum].type] || {}).attributes;\n        valObject = moduleAttrs && moduleAttrs[parts[2]];\n        i = 3; // start recursing only inside the transform\n    } else if(trace.type === 'area') {\n        valObject = polarAreaAttrs[head];\n    } else {\n        // first look in the module for this trace\n        // components have already merged their trace attributes in here\n        var _module = trace._module;\n        if(!_module) _module = (Registry.modules[trace.type || baseAttributes.type.dflt] || {})._module;\n        if(!_module) return false;\n\n        moduleAttrs = _module.attributes;\n        valObject = moduleAttrs && moduleAttrs[head];\n\n        // then look in the subplot attributes\n        if(!valObject) {\n            var subplotModule = _module.basePlotModule;\n            if(subplotModule && subplotModule.attributes) {\n                valObject = subplotModule.attributes[head];\n            }\n        }\n\n        // finally look in the global attributes\n        if(!valObject) valObject = baseAttributes[head];\n    }\n\n    return recurseIntoValObject(valObject, parts, i);\n};\n\n/*\n * Find the valObject for one layout attribute\n *\n * @param {array} parts\n *  an array of parts, like ['annotations', 1, 'x']\n *  typically from nestedProperty(...).parts\n *\n * @return {object|false}\n *  the valObject for this attribute, or the last found parent\n *  in some cases the innermost valObject will not exist, for example\n *  `valType: 'any'` attributes where we might set a part of the attribute.\n *  In that case, stop at the deepest valObject we *do* find.\n */\nexports.getLayoutValObject = function(fullLayout, parts) {\n    var valObject = layoutHeadAttr(fullLayout, parts[0]);\n\n    return recurseIntoValObject(valObject, parts, 1);\n};\n\nfunction layoutHeadAttr(fullLayout, head) {\n    var i, key, _module, attributes;\n\n    // look for attributes of the subplot types used on the plot\n    var basePlotModules = fullLayout._basePlotModules;\n    if(basePlotModules) {\n        var out;\n        for(i = 0; i < basePlotModules.length; i++) {\n            _module = basePlotModules[i];\n            if(_module.attrRegex && _module.attrRegex.test(head)) {\n                // if a module defines overrides, these take precedence\n                // initially this is to allow gl2d different editTypes from svg cartesian\n                if(_module.layoutAttrOverrides) return _module.layoutAttrOverrides;\n\n                // otherwise take the first attributes we find\n                if(!out && _module.layoutAttributes) out = _module.layoutAttributes;\n            }\n\n            // a module can also override the behavior of base (and component) module layout attrs\n            // again see gl2d for initial use case\n            var baseOverrides = _module.baseLayoutAttrOverrides;\n            if(baseOverrides && head in baseOverrides) return baseOverrides[head];\n        }\n        if(out) return out;\n    }\n\n    // look for layout attributes contributed by traces on the plot\n    var modules = fullLayout._modules;\n    if(modules) {\n        for(i = 0; i < modules.length; i++) {\n            attributes = modules[i].layoutAttributes;\n            if(attributes && head in attributes) {\n                return attributes[head];\n            }\n        }\n    }\n\n    /*\n     * Next look in components.\n     * Components that define a schema have already merged this into\n     * base and subplot attribute defs, so ignore these.\n     * Others (older style) all put all their attributes\n     * inside a container matching the module `name`\n     * eg `attributes` (array) or `legend` (object)\n     */\n    for(key in Registry.componentsRegistry) {\n        _module = Registry.componentsRegistry[key];\n        if(_module.name === 'colorscale' && head.indexOf('coloraxis') === 0) {\n            return _module.layoutAttributes[head];\n        } else if(!_module.schema && (head === _module.name)) {\n            return _module.layoutAttributes;\n        }\n    }\n\n    if(head in baseLayoutAttributes) return baseLayoutAttributes[head];\n\n    // Polar doesn't populate _modules or _basePlotModules\n    // just fall back on these when the others fail\n    if(head === 'radialaxis' || head === 'angularaxis') {\n        return polarAxisAttrs[head];\n    }\n    return polarAxisAttrs.layout[head] || false;\n}\n\nfunction recurseIntoValObject(valObject, parts, i) {\n    if(!valObject) return false;\n\n    if(valObject._isLinkedToArray) {\n        // skip array index, abort if we try to dive into an array without an index\n        if(isIndex(parts[i])) i++;\n        else if(i < parts.length) return false;\n    }\n\n    // now recurse as far as we can. Occasionally we have an attribute\n    // setting an internal part below what's in the schema; just return\n    // the innermost schema item we find.\n    for(; i < parts.length; i++) {\n        var newValObject = valObject[parts[i]];\n        if(isPlainObject(newValObject)) valObject = newValObject;\n        else break;\n\n        if(i === parts.length - 1) break;\n\n        if(valObject._isLinkedToArray) {\n            i++;\n            if(!isIndex(parts[i])) return false;\n        } else if(valObject.valType === 'info_array') {\n            i++;\n            var index = parts[i];\n            if(!isIndex(index)) return false;\n\n            var items = valObject.items;\n            if(Array.isArray(items)) {\n                if(index >= items.length) return false;\n                if(valObject.dimensions === 2) {\n                    i++;\n                    if(parts.length === i) return valObject;\n                    var index2 = parts[i];\n                    if(!isIndex(index2)) return false;\n                    valObject = items[index][index2];\n                } else valObject = items[index];\n            } else {\n                valObject = items;\n            }\n        }\n    }\n\n    return valObject;\n}\n\n// note: this is different from Lib.isIndex, this one doesn't accept numeric\n// strings, only actual numbers.\nfunction isIndex(val) {\n    return val === Math.round(val) && val >= 0;\n}\n\nfunction getTraceAttributes(type) {\n    var _module, basePlotModule;\n\n    if(type === 'area') {\n        _module = { attributes: polarAreaAttrs };\n        basePlotModule = {};\n    } else {\n        _module = Registry.modules[type]._module,\n        basePlotModule = _module.basePlotModule;\n    }\n\n    var attributes = {};\n\n    // make 'type' the first attribute in the object\n    attributes.type = null;\n\n    var copyBaseAttributes = extendDeepAll({}, baseAttributes);\n    var copyModuleAttributes = extendDeepAll({}, _module.attributes);\n\n    // prune global-level trace attributes that are already defined in a trace\n    exports.crawl(copyModuleAttributes, function(attr, attrName, attrs, level, fullAttrString) {\n        nestedProperty(copyBaseAttributes, fullAttrString).set(undefined);\n        // Prune undefined attributes\n        if(attr === undefined) nestedProperty(copyModuleAttributes, fullAttrString).set(undefined);\n    });\n\n    // base attributes (same for all trace types)\n    extendDeepAll(attributes, copyBaseAttributes);\n\n    // prune-out base attributes based on trace module categories\n    if(Registry.traceIs(type, 'noOpacity')) {\n        delete attributes.opacity;\n    }\n    if(!Registry.traceIs(type, 'showLegend')) {\n        delete attributes.showlegend;\n        delete attributes.legendgroup;\n    }\n    if(Registry.traceIs(type, 'noHover')) {\n        delete attributes.hoverinfo;\n        delete attributes.hoverlabel;\n    }\n    if(!_module.selectPoints) {\n        delete attributes.selectedpoints;\n    }\n\n    // module attributes\n    extendDeepAll(attributes, copyModuleAttributes);\n\n    // subplot attributes\n    if(basePlotModule.attributes) {\n        extendDeepAll(attributes, basePlotModule.attributes);\n    }\n\n    // 'type' gets overwritten by baseAttributes; reset it here\n    attributes.type = type;\n\n    var out = {\n        meta: _module.meta || {},\n        categories: _module.categories || {},\n        animatable: Boolean(_module.animatable),\n        type: type,\n        attributes: formatAttributes(attributes),\n    };\n\n    // trace-specific layout attributes\n    if(_module.layoutAttributes) {\n        var layoutAttributes = {};\n\n        extendDeepAll(layoutAttributes, _module.layoutAttributes);\n        out.layoutAttributes = formatAttributes(layoutAttributes);\n    }\n\n    // drop anim:true in non-animatable modules\n    if(!_module.animatable) {\n        exports.crawl(out, function(attr) {\n            if(exports.isValObject(attr) && 'anim' in attr) {\n                delete attr.anim;\n            }\n        });\n    }\n\n    return out;\n}\n\nfunction getLayoutAttributes() {\n    var layoutAttributes = {};\n    var key, _module;\n\n    // global layout attributes\n    extendDeepAll(layoutAttributes, baseLayoutAttributes);\n\n    // add base plot module layout attributes\n    for(key in Registry.subplotsRegistry) {\n        _module = Registry.subplotsRegistry[key];\n\n        if(!_module.layoutAttributes) continue;\n\n        if(Array.isArray(_module.attr)) {\n            for(var i = 0; i < _module.attr.length; i++) {\n                handleBasePlotModule(layoutAttributes, _module, _module.attr[i]);\n            }\n        } else {\n            var astr = _module.attr === 'subplot' ? _module.name : _module.attr;\n            handleBasePlotModule(layoutAttributes, _module, astr);\n        }\n    }\n\n    // polar layout attributes\n    layoutAttributes = assignPolarLayoutAttrs(layoutAttributes);\n\n    // add registered components layout attributes\n    for(key in Registry.componentsRegistry) {\n        _module = Registry.componentsRegistry[key];\n        var schema = _module.schema;\n\n        if(schema && (schema.subplots || schema.layout)) {\n            /*\n             * Components with defined schema have already been merged in at register time\n             * but a few components define attributes that apply only to xaxis\n             * not yaxis (rangeselector, rangeslider) - delete from y schema.\n             * Note that the input attributes for xaxis/yaxis are the same object\n             * so it's not possible to only add them to xaxis from the start.\n             * If we ever have such asymmetry the other way, or anywhere else,\n             * we will need to extend both this code and mergeComponentAttrsToSubplot\n             * (which will not find yaxis only for example)\n             */\n            var subplots = schema.subplots;\n            if(subplots && subplots.xaxis && !subplots.yaxis) {\n                for(var xkey in subplots.xaxis) {\n                    delete layoutAttributes.yaxis[xkey];\n                }\n            }\n        } else if(_module.name === 'colorscale') {\n            extendDeepAll(layoutAttributes, _module.layoutAttributes);\n        } else if(_module.layoutAttributes) {\n            // older style without schema need to be explicitly merged in now\n            insertAttrs(layoutAttributes, _module.layoutAttributes, _module.name);\n        }\n    }\n\n    return {\n        layoutAttributes: formatAttributes(layoutAttributes)\n    };\n}\n\nfunction getTransformAttributes(type) {\n    var _module = Registry.transformsRegistry[type];\n    var attributes = extendDeepAll({}, _module.attributes);\n\n    // add registered components transform attributes\n    Object.keys(Registry.componentsRegistry).forEach(function(k) {\n        var _module = Registry.componentsRegistry[k];\n\n        if(_module.schema && _module.schema.transforms && _module.schema.transforms[type]) {\n            Object.keys(_module.schema.transforms[type]).forEach(function(v) {\n                insertAttrs(attributes, _module.schema.transforms[type][v], v);\n            });\n        }\n    });\n\n    return {\n        attributes: formatAttributes(attributes)\n    };\n}\n\nfunction getFramesAttributes() {\n    var attrs = {\n        frames: extendDeepAll({}, frameAttributes)\n    };\n\n    formatAttributes(attrs);\n\n    return attrs.frames;\n}\n\nfunction formatAttributes(attrs) {\n    mergeValTypeAndRole(attrs);\n    formatArrayContainers(attrs);\n    stringify(attrs);\n\n    return attrs;\n}\n\nfunction mergeValTypeAndRole(attrs) {\n    function makeSrcAttr(attrName) {\n        return {\n            valType: 'string',\n            \n            \n            editType: 'none'\n        };\n    }\n\n    function callback(attr, attrName, attrs) {\n        if(exports.isValObject(attr)) {\n            if(attr.valType === 'data_array') {\n                // all 'data_array' attrs have role 'data'\n                attr.role = 'data';\n                // all 'data_array' attrs have a corresponding 'src' attr\n                attrs[attrName + 'src'] = makeSrcAttr(attrName);\n            } else if(attr.arrayOk === true) {\n                // all 'arrayOk' attrs have a corresponding 'src' attr\n                attrs[attrName + 'src'] = makeSrcAttr(attrName);\n            }\n        } else if(isPlainObject(attr)) {\n            // all attrs container objects get role 'object'\n            attr.role = 'object';\n        }\n    }\n\n    exports.crawl(attrs, callback);\n}\n\nfunction formatArrayContainers(attrs) {\n    function callback(attr, attrName, attrs) {\n        if(!attr) return;\n\n        var itemName = attr[IS_LINKED_TO_ARRAY];\n\n        if(!itemName) return;\n\n        delete attr[IS_LINKED_TO_ARRAY];\n\n        attrs[attrName] = { items: {} };\n        attrs[attrName].items[itemName] = attr;\n        attrs[attrName].role = 'object';\n    }\n\n    exports.crawl(attrs, callback);\n}\n\n// this can take around 10ms and should only be run from PlotSchema.get(),\n// to ensure JSON.stringify(PlotSchema.get()) gives the intended result.\nfunction stringify(attrs) {\n    function walk(attr) {\n        for(var k in attr) {\n            if(isPlainObject(attr[k])) {\n                walk(attr[k]);\n            } else if(Array.isArray(attr[k])) {\n                for(var i = 0; i < attr[k].length; i++) {\n                    walk(attr[k][i]);\n                }\n            } else {\n                // as JSON.stringify(/test/) // => {}\n                if(attr[k] instanceof RegExp) {\n                    attr[k] = attr[k].toString();\n                }\n            }\n        }\n    }\n\n    walk(attrs);\n}\n\nfunction assignPolarLayoutAttrs(layoutAttributes) {\n    extendFlat(layoutAttributes, {\n        radialaxis: polarAxisAttrs.radialaxis,\n        angularaxis: polarAxisAttrs.angularaxis\n    });\n\n    extendFlat(layoutAttributes, polarAxisAttrs.layout);\n\n    return layoutAttributes;\n}\n\nfunction handleBasePlotModule(layoutAttributes, _module, astr) {\n    var np = nestedProperty(layoutAttributes, astr);\n    var attrs = extendDeepAll({}, _module.layoutAttributes);\n\n    attrs[IS_SUBPLOT_OBJ] = true;\n    np.set(attrs);\n}\n\nfunction insertAttrs(baseAttrs, newAttrs, astr) {\n    var np = nestedProperty(baseAttrs, astr);\n\n    np.set(extendDeepAll(np.get() || {}, newAttrs));\n}\n\n},{\"../lib\":178,\"../plots/animation_attributes\":217,\"../plots/attributes\":219,\"../plots/frame_attributes\":251,\"../plots/layout_attributes\":254,\"../plots/polar/legacy/area_attributes\":257,\"../plots/polar/legacy/axis_attributes\":258,\"../registry\":269,\"./edit_types\":205,\"./plot_config\":210}],212:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar plotAttributes = _dereq_('../plots/attributes');\n\nvar TEMPLATEITEMNAME = 'templateitemname';\n\nvar templateAttrs = {\n    name: {\n        valType: 'string',\n        \n        editType: 'none',\n        \n    }\n};\ntemplateAttrs[TEMPLATEITEMNAME] = {\n    valType: 'string',\n    \n    editType: 'calc',\n    \n};\n\n/**\n * templatedArray: decorate an attributes object with templating (and array)\n * properties.\n *\n * @param {string} name: the singular form of the array name. Sets\n *     `_isLinkedToArray` to this, so the schema knows to treat this as an array.\n * @param {object} attrs: the item attributes. Since all callers are expected\n *     to be constructing this object on the spot, we mutate it here for\n *     performance, rather than extending a new object with it.\n *\n * @returns {object}: the decorated `attrs` object\n */\nexports.templatedArray = function(name, attrs) {\n    attrs._isLinkedToArray = name;\n    attrs.name = templateAttrs.name;\n    attrs[TEMPLATEITEMNAME] = templateAttrs[TEMPLATEITEMNAME];\n    return attrs;\n};\n\n/**\n * traceTemplater: logic for matching traces to trace templates\n *\n * @param {object} dataTemplate: collection of {traceType: [{template}, ...]}\n *     ie each type the template applies to contains a list of template objects,\n *     to be provided cyclically to data traces of that type.\n *\n * @returns {object}: {newTrace}, a function:\n *     newTrace(traceIn): that takes the input traceIn, coerces its type, then\n *         uses that type to find the next template to apply. returns the output\n *         traceOut with template attached, ready to continue supplyDefaults.\n */\nexports.traceTemplater = function(dataTemplate) {\n    var traceCounts = {};\n    var traceType, typeTemplates;\n\n    for(traceType in dataTemplate) {\n        typeTemplates = dataTemplate[traceType];\n        if(Array.isArray(typeTemplates) && typeTemplates.length) {\n            traceCounts[traceType] = 0;\n        }\n    }\n\n    function newTrace(traceIn) {\n        traceType = Lib.coerce(traceIn, {}, plotAttributes, 'type');\n        var traceOut = {type: traceType, _template: null};\n        if(traceType in traceCounts) {\n            typeTemplates = dataTemplate[traceType];\n            // cycle through traces in the template set for this type\n            var typei = traceCounts[traceType] % typeTemplates.length;\n            traceCounts[traceType]++;\n            traceOut._template = typeTemplates[typei];\n        } else {\n            // TODO: anything we should do for types missing from the template?\n            // try to apply some other type? Or just bail as we do here?\n            // Actually I think yes, we should apply other types; would be nice\n            // if all scatter* could inherit from each other, and if histogram\n            // could inherit from bar, etc... but how to specify this? And do we\n            // compose them, or if a type is present require it to be complete?\n            // Actually this could apply to layout too - 3D annotations\n            // inheriting from 2D, axes of different types inheriting from each\n            // other...\n        }\n        return traceOut;\n    }\n\n    return {\n        newTrace: newTrace\n        // TODO: function to figure out what's left & what didn't work\n    };\n};\n\n/**\n * newContainer: Create a new sub-container inside `container` and propagate any\n * applicable template to it. If there's no template, still propagates\n * `undefined` so relinkPrivate will not retain an old template!\n *\n * @param {object} container: the outer container, should already have _template\n *     if there *is* a template for this plot\n * @param {string} name: the key of the new container to make\n * @param {string} baseName: if applicable, a base attribute to take the\n *     template from, ie for xaxis3 the base would be xaxis\n *\n * @returns {object}: an object for inclusion _full*, empty except for the\n *     appropriate template piece\n */\nexports.newContainer = function(container, name, baseName) {\n    var template = container._template;\n    var part = template && (template[name] || (baseName && template[baseName]));\n    if(!Lib.isPlainObject(part)) part = null;\n\n    var out = container[name] = {_template: part};\n    return out;\n};\n\n/**\n * arrayTemplater: special logic for templating both defaults and specific items\n * in a container array (annotations etc)\n *\n * @param {object} container: the outer container, should already have _template\n *     if there *is* a template for this plot\n * @param {string} name: the name of the array to template (ie 'annotations')\n *     will be used to find default ('annotationdefaults' object) and specific\n *     ('annotations' array) template specs.\n * @param {string} inclusionAttr: the attribute determining this item's\n *     inclusion in the output, usually 'visible' or 'enabled'\n *\n * @returns {object}: {newItem, defaultItems}, both functions:\n *     newItem(itemIn): create an output item, bare except for the correct\n *         template and name(s), as the base for supplyDefaults\n *     defaultItems(): to be called after all newItem calls, return any\n *         specific template items that have not already beeen included,\n *         also as bare output items ready for supplyDefaults.\n */\nexports.arrayTemplater = function(container, name, inclusionAttr) {\n    var template = container._template;\n    var defaultsTemplate = template && template[arrayDefaultKey(name)];\n    var templateItems = template && template[name];\n    if(!Array.isArray(templateItems) || !templateItems.length) {\n        templateItems = [];\n    }\n\n    var usedNames = {};\n\n    function newItem(itemIn) {\n        // include name and templateitemname in the output object for ALL\n        // container array items. Note: you could potentially use different\n        // name and templateitemname, if you're using one template to make\n        // another template. templateitemname would be the name in the original\n        // template, and name is the new \"subclassed\" item name.\n        var out = {name: itemIn.name, _input: itemIn};\n        var templateItemName = out[TEMPLATEITEMNAME] = itemIn[TEMPLATEITEMNAME];\n\n        // no itemname: use the default template\n        if(!validItemName(templateItemName)) {\n            out._template = defaultsTemplate;\n            return out;\n        }\n\n        // look for an item matching this itemname\n        // note these do not inherit from the default template, only the item.\n        for(var i = 0; i < templateItems.length; i++) {\n            var templateItem = templateItems[i];\n            if(templateItem.name === templateItemName) {\n                // Note: it's OK to use a template item more than once\n                // but using it at least once will stop it from generating\n                // a default item at the end.\n                usedNames[templateItemName] = 1;\n                out._template = templateItem;\n                return out;\n            }\n        }\n\n        // Didn't find a matching template item, so since this item is intended\n        // to only be modifications it's most likely broken. Hide it unless\n        // it's explicitly marked visible - in which case it gets NO template,\n        // not even the default.\n        out[inclusionAttr] = itemIn[inclusionAttr] || false;\n        // special falsy value we can look for in validateTemplate\n        out._template = false;\n        return out;\n    }\n\n    function defaultItems() {\n        var out = [];\n        for(var i = 0; i < templateItems.length; i++) {\n            var templateItem = templateItems[i];\n            var name = templateItem.name;\n            // only allow named items to be added as defaults,\n            // and only allow each name once\n            if(validItemName(name) && !usedNames[name]) {\n                var outi = {\n                    _template: templateItem,\n                    name: name,\n                    _input: {_templateitemname: name}\n                };\n                outi[TEMPLATEITEMNAME] = templateItem[TEMPLATEITEMNAME];\n                out.push(outi);\n                usedNames[name] = 1;\n            }\n        }\n        return out;\n    }\n\n    return {\n        newItem: newItem,\n        defaultItems: defaultItems\n    };\n};\n\nfunction validItemName(name) {\n    return name && typeof name === 'string';\n}\n\nfunction arrayDefaultKey(name) {\n    var lastChar = name.length - 1;\n    if(name.charAt(lastChar) !== 's') {\n        Lib.warn('bad argument to arrayDefaultKey: ' + name);\n    }\n    return name.substr(0, name.length - 1) + 'defaults';\n}\nexports.arrayDefaultKey = arrayDefaultKey;\n\n/**\n * arrayEditor: helper for editing array items that may have come from\n *     template defaults (in which case they will not exist in the input yet)\n *\n * @param {object} parentIn: the input container (eg gd.layout)\n * @param {string} containerStr: the attribute string for the container inside\n *     `parentIn`.\n * @param {object} itemOut: the _full* item (eg gd._fullLayout.annotations[0])\n *     that we'll be editing. Assumed to have been created by `arrayTemplater`.\n *\n * @returns {object}: {modifyBase, modifyItem, getUpdateObj, applyUpdate}, all functions:\n *     modifyBase(attr, value): Add an update that's *not* related to the item.\n *         `attr` is the full attribute string.\n *     modifyItem(attr, value): Add an update to the item. `attr` is just the\n *         portion of the attribute string inside the item.\n *     getUpdateObj(): Get the final constructed update object, to use in\n *         `restyle` or `relayout`. Also resets the update object in case this\n *         update was canceled.\n *     applyUpdate(attr, value): optionally add an update `attr: value`,\n *         then apply it to `parent` which should be the parent of `containerIn`,\n *         ie the object to which `containerStr` is the attribute string.\n */\nexports.arrayEditor = function(parentIn, containerStr, itemOut) {\n    var lengthIn = (Lib.nestedProperty(parentIn, containerStr).get() || []).length;\n    var index = itemOut._index;\n    // Check that we are indeed off the end of this container.\n    // Otherwise a devious user could put a key `_templateitemname` in their\n    // own input and break lots of things.\n    var templateItemName = (index >= lengthIn) && (itemOut._input || {})._templateitemname;\n    if(templateItemName) index = lengthIn;\n    var itemStr = containerStr + '[' + index + ']';\n\n    var update;\n    function resetUpdate() {\n        update = {};\n        if(templateItemName) {\n            update[itemStr] = {};\n            update[itemStr][TEMPLATEITEMNAME] = templateItemName;\n        }\n    }\n    resetUpdate();\n\n    function modifyBase(attr, value) {\n        update[attr] = value;\n    }\n\n    function modifyItem(attr, value) {\n        if(templateItemName) {\n            // we're making a new object: edit that object\n            Lib.nestedProperty(update[itemStr], attr).set(value);\n        } else {\n            // we're editing an existing object: include *just* the edit\n            update[itemStr + '.' + attr] = value;\n        }\n    }\n\n    function getUpdateObj() {\n        var updateOut = update;\n        resetUpdate();\n        return updateOut;\n    }\n\n    function applyUpdate(attr, value) {\n        if(attr) modifyItem(attr, value);\n        var updateToApply = getUpdateObj();\n        for(var key in updateToApply) {\n            Lib.nestedProperty(parentIn, key).set(updateToApply[key]);\n        }\n    }\n\n    return {\n        modifyBase: modifyBase,\n        modifyItem: modifyItem,\n        getUpdateObj: getUpdateObj,\n        applyUpdate: applyUpdate\n    };\n};\n\n},{\"../lib\":178,\"../plots/attributes\":219}],213:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Registry = _dereq_('../registry');\nvar Plots = _dereq_('../plots/plots');\n\nvar Lib = _dereq_('../lib');\nvar clearGlCanvases = _dereq_('../lib/clear_gl_canvases');\n\nvar Color = _dereq_('../components/color');\nvar Drawing = _dereq_('../components/drawing');\nvar Titles = _dereq_('../components/titles');\nvar ModeBar = _dereq_('../components/modebar');\n\nvar Axes = _dereq_('../plots/cartesian/axes');\nvar alignmentConstants = _dereq_('../constants/alignment');\nvar axisConstraints = _dereq_('../plots/cartesian/constraints');\nvar enforceAxisConstraints = axisConstraints.enforce;\nvar cleanAxisConstraints = axisConstraints.clean;\nvar doAutoRange = _dereq_('../plots/cartesian/autorange').doAutoRange;\n\nvar SVG_TEXT_ANCHOR_START = 'start';\nvar SVG_TEXT_ANCHOR_MIDDLE = 'middle';\nvar SVG_TEXT_ANCHOR_END = 'end';\n\nexports.layoutStyles = function(gd) {\n    return Lib.syncOrAsync([Plots.doAutoMargin, lsInner], gd);\n};\n\nfunction overlappingDomain(xDomain, yDomain, domains) {\n    for(var i = 0; i < domains.length; i++) {\n        var existingX = domains[i][0];\n        var existingY = domains[i][1];\n\n        if(existingX[0] >= xDomain[1] || existingX[1] <= xDomain[0]) {\n            continue;\n        }\n        if(existingY[0] < yDomain[1] && existingY[1] > yDomain[0]) {\n            return true;\n        }\n    }\n    return false;\n}\n\nfunction lsInner(gd) {\n    var fullLayout = gd._fullLayout;\n    var gs = fullLayout._size;\n    var pad = gs.p;\n    var axList = Axes.list(gd, '', true);\n    var i, subplot, plotinfo, ax, xa, ya;\n\n    fullLayout._paperdiv.style({\n        width: (gd._context.responsive && fullLayout.autosize && !gd._context._hasZeroWidth && !gd.layout.width) ? '100%' : fullLayout.width + 'px',\n        height: (gd._context.responsive && fullLayout.autosize && !gd._context._hasZeroHeight && !gd.layout.height) ? '100%' : fullLayout.height + 'px'\n    })\n    .selectAll('.main-svg')\n    .call(Drawing.setSize, fullLayout.width, fullLayout.height);\n    gd._context.setBackground(gd, fullLayout.paper_bgcolor);\n\n    exports.drawMainTitle(gd);\n    ModeBar.manage(gd);\n\n    // _has('cartesian') means SVG specifically, not GL2D - but GL2D\n    // can still get here because it makes some of the SVG structure\n    // for shared features like selections.\n    if(!fullLayout._has('cartesian')) {\n        return Plots.previousPromises(gd);\n    }\n\n    function getLinePosition(ax, counterAx, side) {\n        var lwHalf = ax._lw / 2;\n\n        if(ax._id.charAt(0) === 'x') {\n            if(!counterAx) return gs.t + gs.h * (1 - (ax.position || 0)) + (lwHalf % 1);\n            else if(side === 'top') return counterAx._offset - pad - lwHalf;\n            return counterAx._offset + counterAx._length + pad + lwHalf;\n        }\n\n        if(!counterAx) return gs.l + gs.w * (ax.position || 0) + (lwHalf % 1);\n        else if(side === 'right') return counterAx._offset + counterAx._length + pad + lwHalf;\n        return counterAx._offset - pad - lwHalf;\n    }\n\n    // some preparation of axis position info\n    for(i = 0; i < axList.length; i++) {\n        ax = axList[i];\n\n        var counterAx = ax._anchorAxis;\n\n        // clear axis line positions, to be set in the subplot loop below\n        ax._linepositions = {};\n\n        // stash crispRounded linewidth so we don't need to pass gd all over the place\n        ax._lw = Drawing.crispRound(gd, ax.linewidth, 1);\n\n        // figure out the main axis line and main mirror line position.\n        // it's easier to follow the logic if we handle these separately from\n        // ax._linepositions, which are only used by mirror=allticks\n        // for non-main-subplot ticks, and mirror=all(ticks)? for zero line\n        // hiding logic\n        ax._mainLinePosition = getLinePosition(ax, counterAx, ax.side);\n        ax._mainMirrorPosition = (ax.mirror && counterAx) ?\n            getLinePosition(ax, counterAx,\n                alignmentConstants.OPPOSITE_SIDE[ax.side]) : null;\n    }\n\n    // figure out which backgrounds we need to draw,\n    // and in which layers to put them\n    var lowerBackgroundIDs = [];\n    var backgroundIds = [];\n    var lowerDomains = [];\n    // no need to draw background when paper and plot color are the same color,\n    // activate mode just for large splom (which benefit the most from this\n    // optimization), but this could apply to all cartesian subplots.\n    var noNeedForBg = (\n        Color.opacity(fullLayout.paper_bgcolor) === 1 &&\n        Color.opacity(fullLayout.plot_bgcolor) === 1 &&\n        fullLayout.paper_bgcolor === fullLayout.plot_bgcolor\n    );\n\n    for(subplot in fullLayout._plots) {\n        plotinfo = fullLayout._plots[subplot];\n\n        if(plotinfo.mainplot) {\n            // mainplot is a reference to the main plot this one is overlaid on\n            // so if it exists, this is an overlaid plot and we don't need to\n            // give it its own background\n            if(plotinfo.bg) {\n                plotinfo.bg.remove();\n            }\n            plotinfo.bg = undefined;\n        } else {\n            var xDomain = plotinfo.xaxis.domain;\n            var yDomain = plotinfo.yaxis.domain;\n            var plotgroup = plotinfo.plotgroup;\n\n            if(overlappingDomain(xDomain, yDomain, lowerDomains)) {\n                var pgNode = plotgroup.node();\n                var plotgroupBg = plotinfo.bg = Lib.ensureSingle(plotgroup, 'rect', 'bg');\n                pgNode.insertBefore(plotgroupBg.node(), pgNode.childNodes[0]);\n                backgroundIds.push(subplot);\n            } else {\n                plotgroup.select('rect.bg').remove();\n                lowerDomains.push([xDomain, yDomain]);\n                if(!noNeedForBg) {\n                    lowerBackgroundIDs.push(subplot);\n                    backgroundIds.push(subplot);\n                }\n            }\n        }\n    }\n\n    // now create all the lower-layer backgrounds at once now that\n    // we have the list of subplots that need them\n    var lowerBackgrounds = fullLayout._bgLayer.selectAll('.bg')\n        .data(lowerBackgroundIDs);\n\n    lowerBackgrounds.enter().append('rect')\n        .classed('bg', true);\n\n    lowerBackgrounds.exit().remove();\n\n    lowerBackgrounds.each(function(subplot) {\n        fullLayout._plots[subplot].bg = d3.select(this);\n    });\n\n    // style all backgrounds\n    for(i = 0; i < backgroundIds.length; i++) {\n        plotinfo = fullLayout._plots[backgroundIds[i]];\n        xa = plotinfo.xaxis;\n        ya = plotinfo.yaxis;\n\n        if(plotinfo.bg) {\n            plotinfo.bg\n                .call(Drawing.setRect,\n                    xa._offset - pad, ya._offset - pad,\n                    xa._length + 2 * pad, ya._length + 2 * pad)\n                .call(Color.fill, fullLayout.plot_bgcolor)\n                .style('stroke-width', 0);\n        }\n    }\n\n    if(!fullLayout._hasOnlyLargeSploms) {\n        for(subplot in fullLayout._plots) {\n            plotinfo = fullLayout._plots[subplot];\n            xa = plotinfo.xaxis;\n            ya = plotinfo.yaxis;\n\n            // Clip so that data only shows up on the plot area.\n            var clipId = plotinfo.clipId = 'clip' + fullLayout._uid + subplot + 'plot';\n\n            var plotClip = Lib.ensureSingleById(fullLayout._clips, 'clipPath', clipId, function(s) {\n                s.classed('plotclip', true)\n                    .append('rect');\n            });\n\n            plotinfo.clipRect = plotClip.select('rect').attr({\n                width: xa._length,\n                height: ya._length\n            });\n\n            Drawing.setTranslate(plotinfo.plot, xa._offset, ya._offset);\n\n            var plotClipId;\n            var layerClipId;\n\n            if(plotinfo._hasClipOnAxisFalse) {\n                plotClipId = null;\n                layerClipId = clipId;\n            } else {\n                plotClipId = clipId;\n                layerClipId = null;\n            }\n\n            Drawing.setClipUrl(plotinfo.plot, plotClipId, gd);\n\n            // stash layer clipId value (null or same as clipId)\n            // to DRY up Drawing.setClipUrl calls on trace-module and trace layers\n            // downstream\n            plotinfo.layerClipId = layerClipId;\n        }\n    }\n\n    var xLinesXLeft, xLinesXRight, xLinesYBottom, xLinesYTop,\n        leftYLineWidth, rightYLineWidth;\n    var yLinesYBottom, yLinesYTop, yLinesXLeft, yLinesXRight,\n        connectYBottom, connectYTop;\n    var extraSubplot;\n\n    function xLinePath(y) {\n        return 'M' + xLinesXLeft + ',' + y + 'H' + xLinesXRight;\n    }\n\n    function xLinePathFree(y) {\n        return 'M' + xa._offset + ',' + y + 'h' + xa._length;\n    }\n\n    function yLinePath(x) {\n        return 'M' + x + ',' + yLinesYTop + 'V' + yLinesYBottom;\n    }\n\n    function yLinePathFree(x) {\n        return 'M' + x + ',' + ya._offset + 'v' + ya._length;\n    }\n\n    function mainPath(ax, pathFn, pathFnFree) {\n        if(!ax.showline || subplot !== ax._mainSubplot) return '';\n        if(!ax._anchorAxis) return pathFnFree(ax._mainLinePosition);\n        var out = pathFn(ax._mainLinePosition);\n        if(ax.mirror) out += pathFn(ax._mainMirrorPosition);\n        return out;\n    }\n\n    for(subplot in fullLayout._plots) {\n        plotinfo = fullLayout._plots[subplot];\n        xa = plotinfo.xaxis;\n        ya = plotinfo.yaxis;\n\n        /*\n         * x lines get longer where they meet y lines, to make a crisp corner.\n         * The x lines get the padding (margin.pad) plus the y line width to\n         * fill up the corner nicely. Free x lines are excluded - they always\n         * span exactly the data area of the plot\n         *\n         *  | XXXXX\n         *  | XXXXX\n         *  |\n         *  +------\n         *     x1\n         *    -----\n         *     x2\n         */\n        var xPath = 'M0,0';\n        if(shouldShowLinesOrTicks(xa, subplot)) {\n            leftYLineWidth = findCounterAxisLineWidth(xa, 'left', ya, axList);\n            xLinesXLeft = xa._offset - (leftYLineWidth ? (pad + leftYLineWidth) : 0);\n            rightYLineWidth = findCounterAxisLineWidth(xa, 'right', ya, axList);\n            xLinesXRight = xa._offset + xa._length + (rightYLineWidth ? (pad + rightYLineWidth) : 0);\n            xLinesYBottom = getLinePosition(xa, ya, 'bottom');\n            xLinesYTop = getLinePosition(xa, ya, 'top');\n\n            // save axis line positions for extra ticks to reference\n            // each subplot that gets ticks from \"allticks\" gets an entry:\n            //    [left or bottom, right or top]\n            extraSubplot = (!xa._anchorAxis || subplot !== xa._mainSubplot);\n            if(extraSubplot && (xa.mirror === 'allticks' || xa.mirror === 'all')) {\n                xa._linepositions[subplot] = [xLinesYBottom, xLinesYTop];\n            }\n\n            xPath = mainPath(xa, xLinePath, xLinePathFree);\n            if(extraSubplot && xa.showline && (xa.mirror === 'all' || xa.mirror === 'allticks')) {\n                xPath += xLinePath(xLinesYBottom) + xLinePath(xLinesYTop);\n            }\n\n            plotinfo.xlines\n                .style('stroke-width', xa._lw + 'px')\n                .call(Color.stroke, xa.showline ?\n                    xa.linecolor : 'rgba(0,0,0,0)');\n        }\n        plotinfo.xlines.attr('d', xPath);\n\n        /*\n         * y lines that meet x axes get longer only by margin.pad, because\n         * the x axes fill in the corner space. Free y axes, like free x axes,\n         * always span exactly the data area of the plot\n         *\n         *   |   | XXXX\n         * y2| y1| XXXX\n         *   |   | XXXX\n         *       |\n         *       +-----\n         */\n        var yPath = 'M0,0';\n        if(shouldShowLinesOrTicks(ya, subplot)) {\n            connectYBottom = findCounterAxisLineWidth(ya, 'bottom', xa, axList);\n            yLinesYBottom = ya._offset + ya._length + (connectYBottom ? pad : 0);\n            connectYTop = findCounterAxisLineWidth(ya, 'top', xa, axList);\n            yLinesYTop = ya._offset - (connectYTop ? pad : 0);\n            yLinesXLeft = getLinePosition(ya, xa, 'left');\n            yLinesXRight = getLinePosition(ya, xa, 'right');\n\n            extraSubplot = (!ya._anchorAxis || subplot !== ya._mainSubplot);\n            if(extraSubplot && (ya.mirror === 'allticks' || ya.mirror === 'all')) {\n                ya._linepositions[subplot] = [yLinesXLeft, yLinesXRight];\n            }\n\n            yPath = mainPath(ya, yLinePath, yLinePathFree);\n            if(extraSubplot && ya.showline && (ya.mirror === 'all' || ya.mirror === 'allticks')) {\n                yPath += yLinePath(yLinesXLeft) + yLinePath(yLinesXRight);\n            }\n\n            plotinfo.ylines\n                .style('stroke-width', ya._lw + 'px')\n                .call(Color.stroke, ya.showline ?\n                    ya.linecolor : 'rgba(0,0,0,0)');\n        }\n        plotinfo.ylines.attr('d', yPath);\n    }\n\n    Axes.makeClipPaths(gd);\n\n    return Plots.previousPromises(gd);\n}\n\nfunction shouldShowLinesOrTicks(ax, subplot) {\n    return (ax.ticks || ax.showline) &&\n        (subplot === ax._mainSubplot || ax.mirror === 'all' || ax.mirror === 'allticks');\n}\n\n/*\n * should we draw a line on counterAx at this side of ax?\n * It's assumed that counterAx is known to overlay the subplot we're working on\n * but it may not be its main axis.\n */\nfunction shouldShowLineThisSide(ax, side, counterAx) {\n    // does counterAx get a line at all?\n    if(!counterAx.showline || !counterAx._lw) return false;\n\n    // are we drawing *all* lines for counterAx?\n    if(counterAx.mirror === 'all' || counterAx.mirror === 'allticks') return true;\n\n    var anchorAx = counterAx._anchorAxis;\n\n    // is this a free axis? free axes can only have a subplot side-line with all(ticks)? mirroring\n    if(!anchorAx) return false;\n\n    // in order to handle cases where the user forgot to anchor this axis correctly\n    // (because its default anchor has the same domain on the relevant end)\n    // check whether the relevant position is the same.\n    var sideIndex = alignmentConstants.FROM_BL[side];\n    if(counterAx.side === side) {\n        return anchorAx.domain[sideIndex] === ax.domain[sideIndex];\n    }\n    return counterAx.mirror && anchorAx.domain[1 - sideIndex] === ax.domain[1 - sideIndex];\n}\n\n/*\n * Is there another axis intersecting `side` end of `ax`?\n * First look at `counterAx` (the axis for this subplot),\n * then at all other potential counteraxes on or overlaying this subplot.\n * Take the line width from the first one that has a line.\n */\nfunction findCounterAxisLineWidth(ax, side, counterAx, axList) {\n    if(shouldShowLineThisSide(ax, side, counterAx)) {\n        return counterAx._lw;\n    }\n    for(var i = 0; i < axList.length; i++) {\n        var axi = axList[i];\n        if(axi._mainAxis === counterAx._mainAxis && shouldShowLineThisSide(ax, side, axi)) {\n            return axi._lw;\n        }\n    }\n    return 0;\n}\n\nexports.drawMainTitle = function(gd) {\n    var fullLayout = gd._fullLayout;\n\n    var textAnchor = getMainTitleTextAnchor(fullLayout);\n    var dy = getMainTitleDy(fullLayout);\n\n    Titles.draw(gd, 'gtitle', {\n        propContainer: fullLayout,\n        propName: 'title.text',\n        placeholder: fullLayout._dfltTitle.plot,\n        attributes: {\n            x: getMainTitleX(fullLayout, textAnchor),\n            y: getMainTitleY(fullLayout, dy),\n            'text-anchor': textAnchor,\n            dy: dy\n        }\n    });\n};\n\nfunction getMainTitleX(fullLayout, textAnchor) {\n    var title = fullLayout.title;\n    var gs = fullLayout._size;\n    var hPadShift = 0;\n\n    if(textAnchor === SVG_TEXT_ANCHOR_START) {\n        hPadShift = title.pad.l;\n    } else if(textAnchor === SVG_TEXT_ANCHOR_END) {\n        hPadShift = -title.pad.r;\n    }\n\n    switch(title.xref) {\n        case 'paper':\n            return gs.l + gs.w * title.x + hPadShift;\n        case 'container':\n        default:\n            return fullLayout.width * title.x + hPadShift;\n    }\n}\n\nfunction getMainTitleY(fullLayout, dy) {\n    var title = fullLayout.title;\n    var gs = fullLayout._size;\n    var vPadShift = 0;\n\n    if(dy === '0em' || !dy) {\n        vPadShift = -title.pad.b;\n    } else if(dy === alignmentConstants.CAP_SHIFT + 'em') {\n        vPadShift = title.pad.t;\n    }\n\n    if(title.y === 'auto') {\n        return gs.t / 2;\n    } else {\n        switch(title.yref) {\n            case 'paper':\n                return gs.t + gs.h - gs.h * title.y + vPadShift;\n            case 'container':\n            default:\n                return fullLayout.height - fullLayout.height * title.y + vPadShift;\n        }\n    }\n}\n\nfunction getMainTitleTextAnchor(fullLayout) {\n    var title = fullLayout.title;\n\n    var textAnchor = SVG_TEXT_ANCHOR_MIDDLE;\n    if(Lib.isRightAnchor(title)) {\n        textAnchor = SVG_TEXT_ANCHOR_END;\n    } else if(Lib.isLeftAnchor(title)) {\n        textAnchor = SVG_TEXT_ANCHOR_START;\n    }\n\n    return textAnchor;\n}\n\nfunction getMainTitleDy(fullLayout) {\n    var title = fullLayout.title;\n\n    var dy = '0em';\n    if(Lib.isTopAnchor(title)) {\n        dy = alignmentConstants.CAP_SHIFT + 'em';\n    } else if(Lib.isMiddleAnchor(title)) {\n        dy = alignmentConstants.MID_SHIFT + 'em';\n    }\n\n    return dy;\n}\n\nexports.doTraceStyle = function(gd) {\n    var calcdata = gd.calcdata;\n    var editStyleCalls = [];\n    var i;\n\n    for(i = 0; i < calcdata.length; i++) {\n        var cd = calcdata[i];\n        var cd0 = cd[0] || {};\n        var trace = cd0.trace || {};\n        var _module = trace._module || {};\n\n        // See if we need to do arraysToCalcdata\n        // call it regardless of what change we made, in case\n        // supplyDefaults brought in an array that was already\n        // in gd.data but not in gd._fullData previously\n        var arraysToCalcdata = _module.arraysToCalcdata;\n        if(arraysToCalcdata) arraysToCalcdata(cd, trace);\n\n        var editStyle = _module.editStyle;\n        if(editStyle) editStyleCalls.push({fn: editStyle, cd0: cd0});\n    }\n\n    if(editStyleCalls.length) {\n        for(i = 0; i < editStyleCalls.length; i++) {\n            var edit = editStyleCalls[i];\n            edit.fn(gd, edit.cd0);\n        }\n        clearGlCanvases(gd);\n        exports.redrawReglTraces(gd);\n    }\n\n    Plots.style(gd);\n    Registry.getComponentMethod('legend', 'draw')(gd);\n\n    return Plots.previousPromises(gd);\n};\n\nexports.doColorBars = function(gd) {\n    Registry.getComponentMethod('colorbar', 'draw')(gd);\n    return Plots.previousPromises(gd);\n};\n\n// force plot() to redo the layout and replot with the modified layout\nexports.layoutReplot = function(gd) {\n    var layout = gd.layout;\n    gd.layout = undefined;\n    return Registry.call('plot', gd, '', layout);\n};\n\nexports.doLegend = function(gd) {\n    Registry.getComponentMethod('legend', 'draw')(gd);\n    return Plots.previousPromises(gd);\n};\n\nexports.doTicksRelayout = function(gd) {\n    Axes.draw(gd, 'redraw');\n\n    if(gd._fullLayout._hasOnlyLargeSploms) {\n        Registry.subplotsRegistry.splom.updateGrid(gd);\n        clearGlCanvases(gd);\n        exports.redrawReglTraces(gd);\n    }\n\n    exports.drawMainTitle(gd);\n    return Plots.previousPromises(gd);\n};\n\nexports.doModeBar = function(gd) {\n    var fullLayout = gd._fullLayout;\n\n    ModeBar.manage(gd);\n\n    for(var i = 0; i < fullLayout._basePlotModules.length; i++) {\n        var updateFx = fullLayout._basePlotModules[i].updateFx;\n        if(updateFx) updateFx(gd);\n    }\n\n    return Plots.previousPromises(gd);\n};\n\nexports.doCamera = function(gd) {\n    var fullLayout = gd._fullLayout;\n    var sceneIds = fullLayout._subplots.gl3d;\n\n    for(var i = 0; i < sceneIds.length; i++) {\n        var sceneLayout = fullLayout[sceneIds[i]];\n        var scene = sceneLayout._scene;\n\n        scene.setViewport(sceneLayout);\n    }\n};\n\nexports.drawData = function(gd) {\n    var fullLayout = gd._fullLayout;\n\n    clearGlCanvases(gd);\n\n    // loop over the base plot modules present on graph\n    var basePlotModules = fullLayout._basePlotModules;\n    for(var i = 0; i < basePlotModules.length; i++) {\n        basePlotModules[i].plot(gd);\n    }\n\n    exports.redrawReglTraces(gd);\n\n    // styling separate from drawing\n    Plots.style(gd);\n\n    // draw components that can be drawn on axes,\n    // and that do not push the margins\n    Registry.getComponentMethod('shapes', 'draw')(gd);\n    Registry.getComponentMethod('annotations', 'draw')(gd);\n    Registry.getComponentMethod('images', 'draw')(gd);\n\n    // Mark the first render as complete\n    fullLayout._replotting = false;\n\n    return Plots.previousPromises(gd);\n};\n\n// Draw (or redraw) all regl-based traces in one go,\n// useful during drag and selection where buffers of targeted traces are updated,\n// but all traces need to be redrawn following clearGlCanvases.\n//\n// Note that _module.plot for regl trace does NOT draw things\n// on the canvas, they only update the buffers.\n// Drawing is perform here.\n//\n// TODO try adding per-subplot option using gl.SCISSOR_TEST for\n// non-overlaying, disjoint subplots.\n//\n// TODO try to include parcoords in here.\n// https://github.com/plotly/plotly.js/issues/3069\nexports.redrawReglTraces = function(gd) {\n    var fullLayout = gd._fullLayout;\n\n    if(fullLayout._has('regl')) {\n        var fullData = gd._fullData;\n        var cartesianIds = [];\n        var polarIds = [];\n        var i, sp;\n\n        if(fullLayout._hasOnlyLargeSploms) {\n            fullLayout._splomGrid.draw();\n        }\n\n        // N.B.\n        // - Loop over fullData (not _splomScenes) to preserve splom trace-to-trace ordering\n        // - Fill list if subplot ids (instead of fullLayout._subplots) to handle cases where all traces\n        //   of a given module are `visible !== true`\n        for(i = 0; i < fullData.length; i++) {\n            var trace = fullData[i];\n\n            if(trace.visible === true && trace._length !== 0) {\n                if(trace.type === 'splom') {\n                    fullLayout._splomScenes[trace.uid].draw();\n                } else if(trace.type === 'scattergl') {\n                    Lib.pushUnique(cartesianIds, trace.xaxis + trace.yaxis);\n                } else if(trace.type === 'scatterpolargl') {\n                    Lib.pushUnique(polarIds, trace.subplot);\n                }\n            }\n        }\n\n        for(i = 0; i < cartesianIds.length; i++) {\n            sp = fullLayout._plots[cartesianIds[i]];\n            if(sp._scene) sp._scene.draw();\n        }\n\n        for(i = 0; i < polarIds.length; i++) {\n            sp = fullLayout[polarIds[i]]._subplot;\n            if(sp._scene) sp._scene.draw();\n        }\n    }\n};\n\nexports.doAutoRangeAndConstraints = function(gd) {\n    var fullLayout = gd._fullLayout;\n    var axList = Axes.list(gd, '', true);\n    var matchGroups = fullLayout._axisMatchGroups || [];\n    var axLookup = {};\n    var ax;\n    var axRng;\n\n    for(var i = 0; i < axList.length; i++) {\n        ax = axList[i];\n        cleanAxisConstraints(gd, ax);\n        doAutoRange(gd, ax);\n        axLookup[ax._id] = 1;\n    }\n\n    enforceAxisConstraints(gd);\n\n    groupLoop:\n    for(var j = 0; j < matchGroups.length; j++) {\n        var group = matchGroups[j];\n        var rng = null;\n        var id;\n\n        for(id in group) {\n            ax = Axes.getFromId(gd, id);\n\n            // skip over 'missing' axes which do not pass through doAutoRange\n            if(!axLookup[ax._id]) continue;\n            // if one axis has autorange false, we're done\n            if(ax.autorange === false) continue groupLoop;\n\n            axRng = Lib.simpleMap(ax.range, ax.r2l);\n            if(rng) {\n                if(rng[0] < rng[1]) {\n                    rng[0] = Math.min(rng[0], axRng[0]);\n                    rng[1] = Math.max(rng[1], axRng[1]);\n                } else {\n                    rng[0] = Math.max(rng[0], axRng[0]);\n                    rng[1] = Math.min(rng[1], axRng[1]);\n                }\n            } else {\n                rng = axRng;\n            }\n        }\n\n        for(id in group) {\n            ax = Axes.getFromId(gd, id);\n            ax.range = Lib.simpleMap(rng, ax.l2r);\n            ax._input.range = ax.range.slice();\n            ax.setScale();\n        }\n    }\n};\n\n// An initial paint must be completed before these components can be\n// correctly sized and the whole plot re-margined. fullLayout._replotting must\n// be set to false before these will work properly.\nexports.finalDraw = function(gd) {\n    // TODO: rangesliders really belong in marginPushers but they need to be\n    // drawn after data - can we at least get the margin pushing part separated\n    // out and done earlier?\n    Registry.getComponentMethod('rangeslider', 'draw')(gd);\n    // TODO: rangeselector only needs to be here (in addition to drawMarginPushers)\n    // because the margins need to be fully determined before we can call\n    // autorange and update axis ranges (which rangeselector needs to know which\n    // button is active). Can we break out its automargin step from its draw step?\n    Registry.getComponentMethod('rangeselector', 'draw')(gd);\n};\n\nexports.drawMarginPushers = function(gd) {\n    Registry.getComponentMethod('legend', 'draw')(gd);\n    Registry.getComponentMethod('rangeselector', 'draw')(gd);\n    Registry.getComponentMethod('sliders', 'draw')(gd);\n    Registry.getComponentMethod('updatemenus', 'draw')(gd);\n    Registry.getComponentMethod('colorbar', 'draw')(gd);\n};\n\n},{\"../components/color\":52,\"../components/drawing\":74,\"../components/modebar\":112,\"../components/titles\":147,\"../constants/alignment\":154,\"../lib\":178,\"../lib/clear_gl_canvases\":167,\"../plots/cartesian/autorange\":221,\"../plots/cartesian/axes\":222,\"../plots/cartesian/constraints\":229,\"../plots/plots\":256,\"../registry\":269,\"d3\":16}],214:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar isPlainObject = Lib.isPlainObject;\nvar PlotSchema = _dereq_('./plot_schema');\nvar Plots = _dereq_('../plots/plots');\nvar plotAttributes = _dereq_('../plots/attributes');\nvar Template = _dereq_('./plot_template');\nvar dfltConfig = _dereq_('./plot_config').dfltConfig;\n\n/**\n * Plotly.makeTemplate: create a template off an existing figure to reuse\n * style attributes on other figures.\n *\n * Note: separated from the rest of templates because otherwise we get circular\n * references due to PlotSchema.\n *\n * @param {object|DOM element|string} figure: The figure to base the template on\n *     should contain a trace array `figure.data`\n *     and a layout object `figure.layout`\n * @returns {object} template: the extracted template - can then be used as\n *     `layout.template` in another figure.\n */\nexports.makeTemplate = function(figure) {\n    figure = Lib.isPlainObject(figure) ? figure : Lib.getGraphDiv(figure);\n    figure = Lib.extendDeep({_context: dfltConfig}, {data: figure.data, layout: figure.layout});\n    Plots.supplyDefaults(figure);\n    var data = figure.data || [];\n    var layout = figure.layout || {};\n    // copy over a few items to help follow the schema\n    layout._basePlotModules = figure._fullLayout._basePlotModules;\n    layout._modules = figure._fullLayout._modules;\n\n    var template = {\n        data: {},\n        layout: {}\n    };\n\n    /*\n     * Note: we do NOT validate template values, we just take what's in the\n     * user inputs data and layout, not the validated values in fullData and\n     * fullLayout. Even if we were to validate here, there's no guarantee that\n     * these values would still be valid when applied to a new figure, which\n     * may contain different trace modes, different axes, etc. So it's\n     * important that when applying a template we still validate the template\n     * values, rather than just using them as defaults.\n     */\n\n    data.forEach(function(trace) {\n        // TODO: What if no style info is extracted for this trace. We may\n        // not want an empty object as the null value.\n        // TODO: allow transforms to contribute to templates?\n        // as it stands they are ignored, which may be for the best...\n\n        var traceTemplate = {};\n        walkStyleKeys(trace, traceTemplate, getTraceInfo.bind(null, trace));\n\n        var traceType = Lib.coerce(trace, {}, plotAttributes, 'type');\n        var typeTemplates = template.data[traceType];\n        if(!typeTemplates) typeTemplates = template.data[traceType] = [];\n        typeTemplates.push(traceTemplate);\n    });\n\n    walkStyleKeys(layout, template.layout, getLayoutInfo.bind(null, layout));\n\n    /*\n     * Compose the new template with an existing one to the same effect\n     *\n     * NOTE: there's a possibility of slightly different behavior: if the plot\n     * has an invalid value and the old template has a valid value for the same\n     * attribute, the plot will use the old template value but this routine\n     * will pull the invalid value (resulting in the original default).\n     * In the general case it's not possible to solve this with a single value,\n     * since valid options can be context-dependent. It could be solved with\n     * a *list* of values, but that would be huge complexity for little gain.\n     */\n    delete template.layout.template;\n    var oldTemplate = layout.template;\n    if(isPlainObject(oldTemplate)) {\n        var oldLayoutTemplate = oldTemplate.layout;\n\n        var i, traceType, oldTypeTemplates, oldTypeLen, typeTemplates, typeLen;\n\n        if(isPlainObject(oldLayoutTemplate)) {\n            mergeTemplates(oldLayoutTemplate, template.layout);\n        }\n        var oldDataTemplate = oldTemplate.data;\n        if(isPlainObject(oldDataTemplate)) {\n            for(traceType in template.data) {\n                oldTypeTemplates = oldDataTemplate[traceType];\n                if(Array.isArray(oldTypeTemplates)) {\n                    typeTemplates = template.data[traceType];\n                    typeLen = typeTemplates.length;\n                    oldTypeLen = oldTypeTemplates.length;\n                    for(i = 0; i < typeLen; i++) {\n                        mergeTemplates(oldTypeTemplates[i % oldTypeLen], typeTemplates[i]);\n                    }\n                    for(i = typeLen; i < oldTypeLen; i++) {\n                        typeTemplates.push(Lib.extendDeep({}, oldTypeTemplates[i]));\n                    }\n                }\n            }\n            for(traceType in oldDataTemplate) {\n                if(!(traceType in template.data)) {\n                    template.data[traceType] = Lib.extendDeep([], oldDataTemplate[traceType]);\n                }\n            }\n        }\n    }\n\n    return template;\n};\n\nfunction mergeTemplates(oldTemplate, newTemplate) {\n    // we don't care about speed here, just make sure we have a totally\n    // distinct object from the previous template\n    oldTemplate = Lib.extendDeep({}, oldTemplate);\n\n    // sort keys so we always get annotationdefaults before annotations etc\n    // so arrayTemplater will work right\n    var oldKeys = Object.keys(oldTemplate).sort();\n    var i, j;\n\n    function mergeOne(oldVal, newVal, key) {\n        if(isPlainObject(newVal) && isPlainObject(oldVal)) {\n            mergeTemplates(oldVal, newVal);\n        } else if(Array.isArray(newVal) && Array.isArray(oldVal)) {\n            // Note: omitted `inclusionAttr` from arrayTemplater here,\n            // it's irrelevant as we only want the resulting `_template`.\n            var templater = Template.arrayTemplater({_template: oldTemplate}, key);\n            for(j = 0; j < newVal.length; j++) {\n                var item = newVal[j];\n                var oldItem = templater.newItem(item)._template;\n                if(oldItem) mergeTemplates(oldItem, item);\n            }\n            var defaultItems = templater.defaultItems();\n            for(j = 0; j < defaultItems.length; j++) newVal.push(defaultItems[j]._template);\n\n            // templateitemname only applies to receiving plots\n            for(j = 0; j < newVal.length; j++) delete newVal[j].templateitemname;\n        }\n    }\n\n    for(i = 0; i < oldKeys.length; i++) {\n        var key = oldKeys[i];\n        var oldVal = oldTemplate[key];\n        if(key in newTemplate) {\n            mergeOne(oldVal, newTemplate[key], key);\n        } else newTemplate[key] = oldVal;\n\n        // if this is a base key from the old template (eg xaxis), look for\n        // extended keys (eg xaxis2) in the new template to merge into\n        if(getBaseKey(key) === key) {\n            for(var key2 in newTemplate) {\n                var baseKey2 = getBaseKey(key2);\n                if(key2 !== baseKey2 && baseKey2 === key && !(key2 in oldTemplate)) {\n                    mergeOne(oldVal, newTemplate[key2], key);\n                }\n            }\n        }\n    }\n}\n\nfunction getBaseKey(key) {\n    return key.replace(/[0-9]+$/, '');\n}\n\nfunction walkStyleKeys(parent, templateOut, getAttributeInfo, path, basePath) {\n    var pathAttr = basePath && getAttributeInfo(basePath);\n    for(var key in parent) {\n        var child = parent[key];\n        var nextPath = getNextPath(parent, key, path);\n        var nextBasePath = getNextPath(parent, key, basePath);\n        var attr = getAttributeInfo(nextBasePath);\n        if(!attr) {\n            var baseKey = getBaseKey(key);\n            if(baseKey !== key) {\n                nextBasePath = getNextPath(parent, baseKey, basePath);\n                attr = getAttributeInfo(nextBasePath);\n            }\n        }\n\n        // we'll get an attr if path starts with a valid part, then has an\n        // invalid ending. Make sure we got all the way to the end.\n        if(pathAttr && (pathAttr === attr)) continue;\n\n        if(!attr || attr._noTemplating ||\n            attr.valType === 'data_array' ||\n            (attr.arrayOk && Array.isArray(child))\n        ) {\n            continue;\n        }\n\n        if(!attr.valType && isPlainObject(child)) {\n            walkStyleKeys(child, templateOut, getAttributeInfo, nextPath, nextBasePath);\n        } else if(attr._isLinkedToArray && Array.isArray(child)) {\n            var dfltDone = false;\n            var namedIndex = 0;\n            var usedNames = {};\n            for(var i = 0; i < child.length; i++) {\n                var item = child[i];\n                if(isPlainObject(item)) {\n                    var name = item.name;\n                    if(name) {\n                        if(!usedNames[name]) {\n                            // named array items: allow all attributes except data arrays\n                            walkStyleKeys(item, templateOut, getAttributeInfo,\n                                getNextPath(child, namedIndex, nextPath),\n                                getNextPath(child, namedIndex, nextBasePath));\n                            namedIndex++;\n                            usedNames[name] = 1;\n                        }\n                    } else if(!dfltDone) {\n                        var dfltKey = Template.arrayDefaultKey(key);\n                        var dfltPath = getNextPath(parent, dfltKey, path);\n\n                        // getAttributeInfo will fail if we try to use dfltKey directly.\n                        // Instead put this item into the next array element, then\n                        // pull it out and move it to dfltKey.\n                        var pathInArray = getNextPath(child, namedIndex, nextPath);\n                        walkStyleKeys(item, templateOut, getAttributeInfo, pathInArray,\n                            getNextPath(child, namedIndex, nextBasePath));\n                        var itemPropInArray = Lib.nestedProperty(templateOut, pathInArray);\n                        var dfltProp = Lib.nestedProperty(templateOut, dfltPath);\n                        dfltProp.set(itemPropInArray.get());\n                        itemPropInArray.set(null);\n\n                        dfltDone = true;\n                    }\n                }\n            }\n        } else {\n            var templateProp = Lib.nestedProperty(templateOut, nextPath);\n            templateProp.set(child);\n        }\n    }\n}\n\nfunction getLayoutInfo(layout, path) {\n    return PlotSchema.getLayoutValObject(\n        layout, Lib.nestedProperty({}, path).parts\n    );\n}\n\nfunction getTraceInfo(trace, path) {\n    return PlotSchema.getTraceValObject(\n        trace, Lib.nestedProperty({}, path).parts\n    );\n}\n\nfunction getNextPath(parent, key, path) {\n    var nextPath;\n    if(!path) nextPath = key;\n    else if(Array.isArray(parent)) nextPath = path + '[' + key + ']';\n    else nextPath = path + '.' + key;\n\n    return nextPath;\n}\n\n/**\n * validateTemplate: Test for consistency between the given figure and\n * a template, either already included in the figure or given separately.\n * Note that not every issue we identify here is necessarily a problem,\n * it depends on what you're using the template for.\n *\n * @param {object|DOM element} figure: the plot, with {data, layout} members,\n *     to test the template against\n * @param {Optional(object)} template: the template, with its own {data, layout},\n *     to test. If omitted, we will look for a template already attached as the\n *     plot's `layout.template` attribute.\n *\n * @returns {array} array of error objects each containing:\n *  - {string} code\n *      error code ('missing', 'unused', 'reused', 'noLayout', 'noData')\n *  - {string} msg\n *      a full readable description of the issue.\n */\nexports.validateTemplate = function(figureIn, template) {\n    var figure = Lib.extendDeep({}, {\n        _context: dfltConfig,\n        data: figureIn.data,\n        layout: figureIn.layout\n    });\n    var layout = figure.layout || {};\n    if(!isPlainObject(template)) template = layout.template || {};\n    var layoutTemplate = template.layout;\n    var dataTemplate = template.data;\n    var errorList = [];\n\n    figure.layout = layout;\n    figure.layout.template = template;\n    Plots.supplyDefaults(figure);\n\n    var fullLayout = figure._fullLayout;\n    var fullData = figure._fullData;\n\n    var layoutPaths = {};\n    function crawlLayoutForContainers(obj, paths) {\n        for(var key in obj) {\n            if(key.charAt(0) !== '_' && isPlainObject(obj[key])) {\n                var baseKey = getBaseKey(key);\n                var nextPaths = [];\n                var i;\n                for(i = 0; i < paths.length; i++) {\n                    nextPaths.push(getNextPath(obj, key, paths[i]));\n                    if(baseKey !== key) nextPaths.push(getNextPath(obj, baseKey, paths[i]));\n                }\n                for(i = 0; i < nextPaths.length; i++) {\n                    layoutPaths[nextPaths[i]] = 1;\n                }\n                crawlLayoutForContainers(obj[key], nextPaths);\n            }\n        }\n    }\n\n    function crawlLayoutTemplateForContainers(obj, path) {\n        for(var key in obj) {\n            if(key.indexOf('defaults') === -1 && isPlainObject(obj[key])) {\n                var nextPath = getNextPath(obj, key, path);\n                if(layoutPaths[nextPath]) {\n                    crawlLayoutTemplateForContainers(obj[key], nextPath);\n                } else {\n                    errorList.push({code: 'unused', path: nextPath});\n                }\n            }\n        }\n    }\n\n    if(!isPlainObject(layoutTemplate)) {\n        errorList.push({code: 'layout'});\n    } else {\n        crawlLayoutForContainers(fullLayout, ['layout']);\n        crawlLayoutTemplateForContainers(layoutTemplate, 'layout');\n    }\n\n    if(!isPlainObject(dataTemplate)) {\n        errorList.push({code: 'data'});\n    } else {\n        var typeCount = {};\n        var traceType;\n        for(var i = 0; i < fullData.length; i++) {\n            var fullTrace = fullData[i];\n            traceType = fullTrace.type;\n            typeCount[traceType] = (typeCount[traceType] || 0) + 1;\n            if(!fullTrace._fullInput._template) {\n                // this takes care of the case of traceType in the data but not\n                // the template\n                errorList.push({\n                    code: 'missing',\n                    index: fullTrace._fullInput.index,\n                    traceType: traceType\n                });\n            }\n        }\n        for(traceType in dataTemplate) {\n            var templateCount = dataTemplate[traceType].length;\n            var dataCount = typeCount[traceType] || 0;\n            if(templateCount > dataCount) {\n                errorList.push({\n                    code: 'unused',\n                    traceType: traceType,\n                    templateCount: templateCount,\n                    dataCount: dataCount\n                });\n            } else if(dataCount > templateCount) {\n                errorList.push({\n                    code: 'reused',\n                    traceType: traceType,\n                    templateCount: templateCount,\n                    dataCount: dataCount\n                });\n            }\n        }\n    }\n\n    // _template: false is when someone tried to modify an array item\n    // but there was no template with matching name\n    function crawlForMissingTemplates(obj, path) {\n        for(var key in obj) {\n            if(key.charAt(0) === '_') continue;\n            var val = obj[key];\n            var nextPath = getNextPath(obj, key, path);\n            if(isPlainObject(val)) {\n                if(Array.isArray(obj) && val._template === false && val.templateitemname) {\n                    errorList.push({\n                        code: 'missing',\n                        path: nextPath,\n                        templateitemname: val.templateitemname\n                    });\n                }\n                crawlForMissingTemplates(val, nextPath);\n            } else if(Array.isArray(val) && hasPlainObject(val)) {\n                crawlForMissingTemplates(val, nextPath);\n            }\n        }\n    }\n    crawlForMissingTemplates({data: fullData, layout: fullLayout}, '');\n\n    if(errorList.length) return errorList.map(format);\n};\n\nfunction hasPlainObject(arr) {\n    for(var i = 0; i < arr.length; i++) {\n        if(isPlainObject(arr[i])) return true;\n    }\n}\n\nfunction format(opts) {\n    var msg;\n    switch(opts.code) {\n        case 'data':\n            msg = 'The template has no key data.';\n            break;\n        case 'layout':\n            msg = 'The template has no key layout.';\n            break;\n        case 'missing':\n            if(opts.path) {\n                msg = 'There are no templates for item ' + opts.path +\n                    ' with name ' + opts.templateitemname;\n            } else {\n                msg = 'There are no templates for trace ' + opts.index +\n                    ', of type ' + opts.traceType + '.';\n            }\n            break;\n        case 'unused':\n            if(opts.path) {\n                msg = 'The template item at ' + opts.path +\n                    ' was not used in constructing the plot.';\n            } else if(opts.dataCount) {\n                msg = 'Some of the templates of type ' + opts.traceType +\n                    ' were not used. The template has ' + opts.templateCount +\n                    ' traces, the data only has ' + opts.dataCount +\n                    ' of this type.';\n            } else {\n                msg = 'The template has ' + opts.templateCount +\n                    ' traces of type ' + opts.traceType +\n                    ' but there are none in the data.';\n            }\n            break;\n        case 'reused':\n            msg = 'Some of the templates of type ' + opts.traceType +\n                ' were used more than once. The template has ' +\n                opts.templateCount + ' traces, the data has ' +\n                opts.dataCount + ' of this type.';\n            break;\n    }\n    opts.msg = msg;\n\n    return opts;\n}\n\n},{\"../lib\":178,\"../plots/attributes\":219,\"../plots/plots\":256,\"./plot_config\":210,\"./plot_schema\":211,\"./plot_template\":212}],215:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar plotApi = _dereq_('./plot_api');\nvar plots = _dereq_('../plots/plots');\nvar Lib = _dereq_('../lib');\n\nvar helpers = _dereq_('../snapshot/helpers');\nvar toSVG = _dereq_('../snapshot/tosvg');\nvar svgToImg = _dereq_('../snapshot/svgtoimg');\nvar version = _dereq_('../version').version;\n\nvar attrs = {\n    format: {\n        valType: 'enumerated',\n        values: ['png', 'jpeg', 'webp', 'svg', 'full-json'],\n        dflt: 'png',\n        \n    },\n    width: {\n        valType: 'number',\n        min: 1,\n        \n    },\n    height: {\n        valType: 'number',\n        min: 1,\n        \n    },\n    scale: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n    },\n    setBackground: {\n        valType: 'any',\n        dflt: false,\n        \n    },\n    imageDataOnly: {\n        valType: 'boolean',\n        dflt: false,\n        \n    }\n};\n\n/** Plotly.toImage\n *\n * @param {object | string | HTML div} gd\n *   can either be a data/layout/config object\n *   or an existing graph <div>\n *   or an id to an existing graph <div>\n * @param {object} opts (see above)\n * @return {promise}\n */\nfunction toImage(gd, opts) {\n    opts = opts || {};\n\n    var data;\n    var layout;\n    var config;\n    var fullLayout;\n\n    if(Lib.isPlainObject(gd)) {\n        data = gd.data || [];\n        layout = gd.layout || {};\n        config = gd.config || {};\n        fullLayout = {};\n    } else {\n        gd = Lib.getGraphDiv(gd);\n        data = Lib.extendDeep([], gd.data);\n        layout = Lib.extendDeep({}, gd.layout);\n        config = gd._context;\n        fullLayout = gd._fullLayout || {};\n    }\n\n    function isImpliedOrValid(attr) {\n        return !(attr in opts) || Lib.validate(opts[attr], attrs[attr]);\n    }\n\n    if((!isImpliedOrValid('width') && opts.width !== null) ||\n        (!isImpliedOrValid('height') && opts.height !== null)) {\n        throw new Error('Height and width should be pixel values.');\n    }\n\n    if(!isImpliedOrValid('format')) {\n        throw new Error('Image format is not jpeg, png, svg or webp.');\n    }\n\n    var fullOpts = {};\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(opts, fullOpts, attrs, attr, dflt);\n    }\n\n    var format = coerce('format');\n    var width = coerce('width');\n    var height = coerce('height');\n    var scale = coerce('scale');\n    var setBackground = coerce('setBackground');\n    var imageDataOnly = coerce('imageDataOnly');\n\n    // put the cloned div somewhere off screen before attaching to DOM\n    var clonedGd = document.createElement('div');\n    clonedGd.style.position = 'absolute';\n    clonedGd.style.left = '-5000px';\n    document.body.appendChild(clonedGd);\n\n    // extend layout with image options\n    var layoutImage = Lib.extendFlat({}, layout);\n    if(width) {\n        layoutImage.width = width;\n    } else if(opts.width === null && isNumeric(fullLayout.width)) {\n        layoutImage.width = fullLayout.width;\n    }\n    if(height) {\n        layoutImage.height = height;\n    } else if(opts.height === null && isNumeric(fullLayout.height)) {\n        layoutImage.height = fullLayout.height;\n    }\n\n    // extend config for static plot\n    var configImage = Lib.extendFlat({}, config, {\n        _exportedPlot: true,\n        staticPlot: true,\n        setBackground: setBackground\n    });\n\n    var redrawFunc = helpers.getRedrawFunc(clonedGd);\n\n    function wait() {\n        return new Promise(function(resolve) {\n            setTimeout(resolve, helpers.getDelay(clonedGd._fullLayout));\n        });\n    }\n\n    function convert() {\n        return new Promise(function(resolve, reject) {\n            var svg = toSVG(clonedGd, format, scale);\n            var width = clonedGd._fullLayout.width;\n            var height = clonedGd._fullLayout.height;\n\n            function cleanup() {\n                plotApi.purge(clonedGd);\n                document.body.removeChild(clonedGd);\n            }\n\n            if(format === 'full-json') {\n                var json = plots.graphJson(clonedGd, false, 'keepdata', 'object', true, true);\n                json.version = version;\n                json = JSON.stringify(json);\n                cleanup();\n                if(imageDataOnly) {\n                    return resolve(json);\n                } else {\n                    return resolve(helpers.encodeJSON(json));\n                }\n            }\n\n            cleanup();\n\n            if(format === 'svg') {\n                if(imageDataOnly) {\n                    return resolve(svg);\n                } else {\n                    return resolve(helpers.encodeSVG(svg));\n                }\n            }\n\n            var canvas = document.createElement('canvas');\n            canvas.id = Lib.randstr();\n\n            svgToImg({\n                format: format,\n                width: width,\n                height: height,\n                scale: scale,\n                canvas: canvas,\n                svg: svg,\n                // ask svgToImg to return a Promise\n                //  rather than EventEmitter\n                //  leave EventEmitter for backward\n                //  compatibility\n                promise: true\n            })\n            .then(resolve)\n            .catch(reject);\n        });\n    }\n\n    function urlToImageData(url) {\n        if(imageDataOnly) {\n            return url.replace(helpers.IMAGE_URL_PREFIX, '');\n        } else {\n            return url;\n        }\n    }\n\n    return new Promise(function(resolve, reject) {\n        plotApi.plot(clonedGd, data, layoutImage, configImage)\n            .then(redrawFunc)\n            .then(wait)\n            .then(convert)\n            .then(function(url) { resolve(urlToImageData(url)); })\n            .catch(function(err) { reject(err); });\n    });\n}\n\nmodule.exports = toImage;\n\n},{\"../lib\":178,\"../plots/plots\":256,\"../snapshot/helpers\":273,\"../snapshot/svgtoimg\":275,\"../snapshot/tosvg\":277,\"../version\":435,\"./plot_api\":209,\"fast-isnumeric\":18}],216:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar Plots = _dereq_('../plots/plots');\nvar PlotSchema = _dereq_('./plot_schema');\nvar dfltConfig = _dereq_('./plot_config').dfltConfig;\n\nvar isPlainObject = Lib.isPlainObject;\nvar isArray = Array.isArray;\nvar isArrayOrTypedArray = Lib.isArrayOrTypedArray;\n\n/**\n * Validate a data array and layout object.\n *\n * @param {array} data\n * @param {object} layout\n *\n * @return {array} array of error objects each containing:\n *  - {string} code\n *      error code ('object', 'array', 'schema', 'unused', 'invisible' or 'value')\n *  - {string} container\n *      container where the error occurs ('data' or 'layout')\n *  - {number} trace\n *      trace index of the 'data' container where the error occurs\n *  - {array} path\n *      nested path to the key that causes the error\n *  - {string} astr\n *      attribute string variant of 'path' compatible with Plotly.restyle and\n *      Plotly.relayout.\n *  - {string} msg\n *      error message (shown in console in logger config argument is enable)\n */\nmodule.exports = function validate(data, layout) {\n    if(data === undefined) data = [];\n    if(layout === undefined) layout = {};\n\n    var schema = PlotSchema.get();\n    var errorList = [];\n    var gd = {_context: Lib.extendFlat({}, dfltConfig)};\n\n    var dataIn, layoutIn;\n\n    if(isArray(data)) {\n        gd.data = Lib.extendDeep([], data);\n        dataIn = data;\n    } else {\n        gd.data = [];\n        dataIn = [];\n        errorList.push(format('array', 'data'));\n    }\n\n    if(isPlainObject(layout)) {\n        gd.layout = Lib.extendDeep({}, layout);\n        layoutIn = layout;\n    } else {\n        gd.layout = {};\n        layoutIn = {};\n        if(arguments.length > 1) {\n            errorList.push(format('object', 'layout'));\n        }\n    }\n\n    // N.B. dataIn and layoutIn are in general not the same as\n    // gd.data and gd.layout after supplyDefaults as some attributes\n    // in gd.data and gd.layout (still) get mutated during this step.\n\n    Plots.supplyDefaults(gd);\n\n    var dataOut = gd._fullData;\n    var len = dataIn.length;\n\n    for(var i = 0; i < len; i++) {\n        var traceIn = dataIn[i];\n        var base = ['data', i];\n\n        if(!isPlainObject(traceIn)) {\n            errorList.push(format('object', base));\n            continue;\n        }\n\n        var traceOut = dataOut[i];\n        var traceType = traceOut.type;\n        var traceSchema = schema.traces[traceType].attributes;\n\n        // PlotSchema does something fancy with trace 'type', reset it here\n        // to make the trace schema compatible with Lib.validate.\n        traceSchema.type = {\n            valType: 'enumerated',\n            values: [traceType]\n        };\n\n        if(traceOut.visible === false && traceIn.visible !== false) {\n            errorList.push(format('invisible', base));\n        }\n\n        crawl(traceIn, traceOut, traceSchema, errorList, base);\n\n        var transformsIn = traceIn.transforms;\n        var transformsOut = traceOut.transforms;\n\n        if(transformsIn) {\n            if(!isArray(transformsIn)) {\n                errorList.push(format('array', base, ['transforms']));\n            }\n\n            base.push('transforms');\n\n            for(var j = 0; j < transformsIn.length; j++) {\n                var path = ['transforms', j];\n                var transformType = transformsIn[j].type;\n\n                if(!isPlainObject(transformsIn[j])) {\n                    errorList.push(format('object', base, path));\n                    continue;\n                }\n\n                var transformSchema = schema.transforms[transformType] ?\n                    schema.transforms[transformType].attributes :\n                    {};\n\n                // add 'type' to transform schema to validate the transform type\n                transformSchema.type = {\n                    valType: 'enumerated',\n                    values: Object.keys(schema.transforms)\n                };\n\n                crawl(transformsIn[j], transformsOut[j], transformSchema, errorList, base, path);\n            }\n        }\n    }\n\n    var layoutOut = gd._fullLayout;\n    var layoutSchema = fillLayoutSchema(schema, dataOut);\n\n    crawl(layoutIn, layoutOut, layoutSchema, errorList, 'layout');\n\n    // return undefined if no validation errors were found\n    return (errorList.length === 0) ? void(0) : errorList;\n};\n\nfunction crawl(objIn, objOut, schema, list, base, path) {\n    path = path || [];\n\n    var keys = Object.keys(objIn);\n\n    for(var i = 0; i < keys.length; i++) {\n        var k = keys[i];\n\n        // transforms are handled separately\n        if(k === 'transforms') continue;\n\n        var p = path.slice();\n        p.push(k);\n\n        var valIn = objIn[k];\n        var valOut = objOut[k];\n\n        var nestedSchema = getNestedSchema(schema, k);\n        var nestedValType = (nestedSchema || {}).valType;\n        var isInfoArray = nestedValType === 'info_array';\n        var isColorscale = nestedValType === 'colorscale';\n        var items = (nestedSchema || {}).items;\n\n        if(!isInSchema(schema, k)) {\n            list.push(format('schema', base, p));\n        } else if(isPlainObject(valIn) && isPlainObject(valOut) && nestedValType !== 'any') {\n            crawl(valIn, valOut, nestedSchema, list, base, p);\n        } else if(isInfoArray && isArray(valIn)) {\n            if(valIn.length > valOut.length) {\n                list.push(format('unused', base, p.concat(valOut.length)));\n            }\n            var len = valOut.length;\n            var arrayItems = Array.isArray(items);\n            if(arrayItems) len = Math.min(len, items.length);\n            var m, n, item, valInPart, valOutPart;\n            if(nestedSchema.dimensions === 2) {\n                for(n = 0; n < len; n++) {\n                    if(isArray(valIn[n])) {\n                        if(valIn[n].length > valOut[n].length) {\n                            list.push(format('unused', base, p.concat(n, valOut[n].length)));\n                        }\n                        var len2 = valOut[n].length;\n                        for(m = 0; m < (arrayItems ? Math.min(len2, items[n].length) : len2); m++) {\n                            item = arrayItems ? items[n][m] : items;\n                            valInPart = valIn[n][m];\n                            valOutPart = valOut[n][m];\n                            if(!Lib.validate(valInPart, item)) {\n                                list.push(format('value', base, p.concat(n, m), valInPart));\n                            } else if(valOutPart !== valInPart && valOutPart !== +valInPart) {\n                                list.push(format('dynamic', base, p.concat(n, m), valInPart, valOutPart));\n                            }\n                        }\n                    } else {\n                        list.push(format('array', base, p.concat(n), valIn[n]));\n                    }\n                }\n            } else {\n                for(n = 0; n < len; n++) {\n                    item = arrayItems ? items[n] : items;\n                    valInPart = valIn[n];\n                    valOutPart = valOut[n];\n                    if(!Lib.validate(valInPart, item)) {\n                        list.push(format('value', base, p.concat(n), valInPart));\n                    } else if(valOutPart !== valInPart && valOutPart !== +valInPart) {\n                        list.push(format('dynamic', base, p.concat(n), valInPart, valOutPart));\n                    }\n                }\n            }\n        } else if(nestedSchema.items && !isInfoArray && isArray(valIn)) {\n            var _nestedSchema = items[Object.keys(items)[0]];\n            var indexList = [];\n\n            var j, _p;\n\n            // loop over valOut items while keeping track of their\n            // corresponding input container index (given by _index)\n            for(j = 0; j < valOut.length; j++) {\n                var _index = valOut[j]._index || j;\n\n                _p = p.slice();\n                _p.push(_index);\n\n                if(isPlainObject(valIn[_index]) && isPlainObject(valOut[j])) {\n                    indexList.push(_index);\n                    var valInj = valIn[_index];\n                    var valOutj = valOut[j];\n                    if(isPlainObject(valInj) && valInj.visible !== false && valOutj.visible === false) {\n                        list.push(format('invisible', base, _p));\n                    } else crawl(valInj, valOutj, _nestedSchema, list, base, _p);\n                }\n            }\n\n            // loop over valIn to determine where it went wrong for some items\n            for(j = 0; j < valIn.length; j++) {\n                _p = p.slice();\n                _p.push(j);\n\n                if(!isPlainObject(valIn[j])) {\n                    list.push(format('object', base, _p, valIn[j]));\n                } else if(indexList.indexOf(j) === -1) {\n                    list.push(format('unused', base, _p));\n                }\n            }\n        } else if(!isPlainObject(valIn) && isPlainObject(valOut)) {\n            list.push(format('object', base, p, valIn));\n        } else if(!isArrayOrTypedArray(valIn) && isArrayOrTypedArray(valOut) && !isInfoArray && !isColorscale) {\n            list.push(format('array', base, p, valIn));\n        } else if(!(k in objOut)) {\n            list.push(format('unused', base, p, valIn));\n        } else if(!Lib.validate(valIn, nestedSchema)) {\n            list.push(format('value', base, p, valIn));\n        } else if(nestedSchema.valType === 'enumerated' &&\n            ((nestedSchema.coerceNumber && valIn !== +valOut) || valIn !== valOut)\n        ) {\n            list.push(format('dynamic', base, p, valIn, valOut));\n        }\n    }\n\n    return list;\n}\n\n// the 'full' layout schema depends on the traces types presents\nfunction fillLayoutSchema(schema, dataOut) {\n    var layoutSchema = schema.layout.layoutAttributes;\n\n    for(var i = 0; i < dataOut.length; i++) {\n        var traceOut = dataOut[i];\n        var traceSchema = schema.traces[traceOut.type];\n        var traceLayoutAttr = traceSchema.layoutAttributes;\n\n        if(traceLayoutAttr) {\n            if(traceOut.subplot) {\n                Lib.extendFlat(layoutSchema[traceSchema.attributes.subplot.dflt], traceLayoutAttr);\n            } else {\n                Lib.extendFlat(layoutSchema, traceLayoutAttr);\n            }\n        }\n    }\n\n    return layoutSchema;\n}\n\n// validation error codes\nvar code2msgFunc = {\n    object: function(base, astr) {\n        var prefix;\n\n        if(base === 'layout' && astr === '') prefix = 'The layout argument';\n        else if(base[0] === 'data' && astr === '') {\n            prefix = 'Trace ' + base[1] + ' in the data argument';\n        } else prefix = inBase(base) + 'key ' + astr;\n\n        return prefix + ' must be linked to an object container';\n    },\n    array: function(base, astr) {\n        var prefix;\n\n        if(base === 'data') prefix = 'The data argument';\n        else prefix = inBase(base) + 'key ' + astr;\n\n        return prefix + ' must be linked to an array container';\n    },\n    schema: function(base, astr) {\n        return inBase(base) + 'key ' + astr + ' is not part of the schema';\n    },\n    unused: function(base, astr, valIn) {\n        var target = isPlainObject(valIn) ? 'container' : 'key';\n\n        return inBase(base) + target + ' ' + astr + ' did not get coerced';\n    },\n    dynamic: function(base, astr, valIn, valOut) {\n        return [\n            inBase(base) + 'key',\n            astr,\n            '(set to \\'' + valIn + '\\')',\n            'got reset to',\n            '\\'' + valOut + '\\'',\n            'during defaults.'\n        ].join(' ');\n    },\n    invisible: function(base, astr) {\n        return (\n            astr ? (inBase(base) + 'item ' + astr) : ('Trace ' + base[1])\n        ) + ' got defaulted to be not visible';\n    },\n    value: function(base, astr, valIn) {\n        return [\n            inBase(base) + 'key ' + astr,\n            'is set to an invalid value (' + valIn + ')'\n        ].join(' ');\n    }\n};\n\nfunction inBase(base) {\n    if(isArray(base)) return 'In data trace ' + base[1] + ', ';\n\n    return 'In ' + base + ', ';\n}\n\nfunction format(code, base, path, valIn, valOut) {\n    path = path || '';\n\n    var container, trace;\n\n    // container is either 'data' or 'layout\n    // trace is the trace index if 'data', null otherwise\n\n    if(isArray(base)) {\n        container = base[0];\n        trace = base[1];\n    } else {\n        container = base;\n        trace = null;\n    }\n\n    var astr = convertPathToAttributeString(path);\n    var msg = code2msgFunc[code](base, astr, valIn, valOut);\n\n    // log to console if logger config option is enabled\n    Lib.log(msg);\n\n    return {\n        code: code,\n        container: container,\n        trace: trace,\n        path: path,\n        astr: astr,\n        msg: msg\n    };\n}\n\nfunction isInSchema(schema, key) {\n    var parts = splitKey(key);\n    var keyMinusId = parts.keyMinusId;\n    var id = parts.id;\n\n    if((keyMinusId in schema) && schema[keyMinusId]._isSubplotObj && id) {\n        return true;\n    }\n\n    return (key in schema);\n}\n\nfunction getNestedSchema(schema, key) {\n    if(key in schema) return schema[key];\n\n    var parts = splitKey(key);\n\n    return schema[parts.keyMinusId];\n}\n\nvar idRegex = Lib.counterRegex('([a-z]+)');\n\nfunction splitKey(key) {\n    var idMatch = key.match(idRegex);\n\n    return {\n        keyMinusId: idMatch && idMatch[1],\n        id: idMatch && idMatch[2]\n    };\n}\n\nfunction convertPathToAttributeString(path) {\n    if(!isArray(path)) return String(path);\n\n    var astr = '';\n\n    for(var i = 0; i < path.length; i++) {\n        var p = path[i];\n\n        if(typeof p === 'number') {\n            astr = astr.substr(0, astr.length - 1) + '[' + p + ']';\n        } else {\n            astr += p;\n        }\n\n        if(i < path.length - 1) astr += '.';\n    }\n\n    return astr;\n}\n\n},{\"../lib\":178,\"../plots/plots\":256,\"./plot_config\":210,\"./plot_schema\":211}],217:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    mode: {\n        valType: 'enumerated',\n        dflt: 'afterall',\n        \n        values: ['immediate', 'next', 'afterall'],\n        \n    },\n    direction: {\n        valType: 'enumerated',\n        \n        values: ['forward', 'reverse'],\n        dflt: 'forward',\n        \n    },\n    fromcurrent: {\n        valType: 'boolean',\n        dflt: false,\n        \n        \n    },\n    frame: {\n        duration: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 500,\n            \n        },\n        redraw: {\n            valType: 'boolean',\n            \n            dflt: true,\n            \n        },\n    },\n    transition: {\n        duration: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 500,\n            editType: 'none',\n            \n        },\n        easing: {\n            valType: 'enumerated',\n            dflt: 'cubic-in-out',\n            values: [\n                'linear',\n                'quad',\n                'cubic',\n                'sin',\n                'exp',\n                'circle',\n                'elastic',\n                'back',\n                'bounce',\n                'linear-in',\n                'quad-in',\n                'cubic-in',\n                'sin-in',\n                'exp-in',\n                'circle-in',\n                'elastic-in',\n                'back-in',\n                'bounce-in',\n                'linear-out',\n                'quad-out',\n                'cubic-out',\n                'sin-out',\n                'exp-out',\n                'circle-out',\n                'elastic-out',\n                'back-out',\n                'bounce-out',\n                'linear-in-out',\n                'quad-in-out',\n                'cubic-in-out',\n                'sin-in-out',\n                'exp-in-out',\n                'circle-in-out',\n                'elastic-in-out',\n                'back-in-out',\n                'bounce-in-out'\n            ],\n            \n            editType: 'none',\n            \n        },\n        ordering: {\n            valType: 'enumerated',\n            values: ['layout first', 'traces first'],\n            dflt: 'layout first',\n            \n            editType: 'none',\n            \n        }\n    }\n};\n\n},{}],218:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar Template = _dereq_('../plot_api/plot_template');\n\n/** Convenience wrapper for making array container logic DRY and consistent\n *\n * @param {object} parentObjIn\n *  user input object where the container in question is linked\n *  (i.e. either a user trace object or the user layout object)\n *\n * @param {object} parentObjOut\n *  full object where the coerced container will be linked\n *  (i.e. either a full trace object or the full layout object)\n *\n * @param {object} opts\n *  options object:\n *   - name {string}\n *      name of the key linking the container in question\n *   - inclusionAttr {string}\n *      name of the item attribute for inclusion/exclusion. Default is 'visible'.\n *      Since inclusion is true, use eg 'enabled' instead of 'disabled'.\n *   - handleItemDefaults {function}\n *      defaults method to be called on each item in the array container in question\n *\n *      Its arguments are:\n *          - itemIn {object} item in user layout\n *          - itemOut {object} item in full layout\n *          - parentObj {object} (as in closure)\n *          - opts {object} (as in closure)\n * N.B.\n *\n *  - opts is passed to handleItemDefaults so it can also store\n *    links to supplementary data (e.g. fullData for layout components)\n *\n */\nmodule.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut, opts) {\n    var name = opts.name;\n    var inclusionAttr = opts.inclusionAttr || 'visible';\n\n    var previousContOut = parentObjOut[name];\n\n    var contIn = Lib.isArrayOrTypedArray(parentObjIn[name]) ? parentObjIn[name] : [];\n    var contOut = parentObjOut[name] = [];\n    var templater = Template.arrayTemplater(parentObjOut, name, inclusionAttr);\n    var i, itemOut;\n\n    for(i = 0; i < contIn.length; i++) {\n        var itemIn = contIn[i];\n\n        if(!Lib.isPlainObject(itemIn)) {\n            itemOut = templater.newItem({});\n            itemOut[inclusionAttr] = false;\n        } else {\n            itemOut = templater.newItem(itemIn);\n        }\n\n        itemOut._index = i;\n\n        if(itemOut[inclusionAttr] !== false) {\n            opts.handleItemDefaults(itemIn, itemOut, parentObjOut, opts);\n        }\n\n        contOut.push(itemOut);\n    }\n\n    var defaultItems = templater.defaultItems();\n    for(i = 0; i < defaultItems.length; i++) {\n        itemOut = defaultItems[i];\n        itemOut._index = contOut.length;\n        opts.handleItemDefaults({}, itemOut, parentObjOut, opts, {});\n        contOut.push(itemOut);\n    }\n\n    // in case this array gets its defaults rebuilt independent of the whole layout,\n    // relink the private keys just for this array.\n    if(Lib.isArrayOrTypedArray(previousContOut)) {\n        var len = Math.min(previousContOut.length, contOut.length);\n        for(i = 0; i < len; i++) {\n            Lib.relinkPrivateKeys(contOut[i], previousContOut[i]);\n        }\n    }\n\n    return contOut;\n};\n\n},{\"../lib\":178,\"../plot_api/plot_template\":212}],219:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fxAttrs = _dereq_('../components/fx/attributes');\n\nmodule.exports = {\n    type: {\n        valType: 'enumerated',\n        \n        values: [],     // listed dynamically\n        dflt: 'scatter',\n        editType: 'calc+clearAxisTypes',\n        _noTemplating: true // we handle this at a higher level\n    },\n    visible: {\n        valType: 'enumerated',\n        values: [true, false, 'legendonly'],\n        \n        dflt: true,\n        editType: 'calc',\n        \n    },\n    showlegend: {\n        valType: 'boolean',\n        \n        dflt: true,\n        editType: 'style',\n        \n    },\n    legendgroup: {\n        valType: 'string',\n        \n        dflt: '',\n        editType: 'style',\n        \n    },\n    opacity: {\n        valType: 'number',\n        \n        min: 0,\n        max: 1,\n        dflt: 1,\n        editType: 'style',\n        \n    },\n    name: {\n        valType: 'string',\n        \n        editType: 'style',\n        \n    },\n    uid: {\n        valType: 'string',\n        \n        editType: 'plot',\n        anim: true,\n        \n    },\n    ids: {\n        valType: 'data_array',\n        editType: 'calc',\n        anim: true,\n        \n    },\n    customdata: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    meta: {\n        valType: 'any',\n        arrayOk: true,\n        \n        editType: 'plot',\n        \n    },\n\n    // N.B. these cannot be 'data_array' as they do not have the same length as\n    // other data arrays and arrayOk attributes in general\n    //\n    // Maybe add another valType:\n    // https://github.com/plotly/plotly.js/issues/1894\n    selectedpoints: {\n        valType: 'any',\n        \n        editType: 'calc',\n        \n    },\n\n    hoverinfo: {\n        valType: 'flaglist',\n        \n        flags: ['x', 'y', 'z', 'text', 'name'],\n        extras: ['all', 'none', 'skip'],\n        arrayOk: true,\n        dflt: 'all',\n        editType: 'none',\n        \n    },\n    hoverlabel: fxAttrs.hoverlabel,\n    stream: {\n        token: {\n            valType: 'string',\n            noBlank: true,\n            strict: true,\n            \n            editType: 'calc',\n            \n        },\n        maxpoints: {\n            valType: 'number',\n            min: 0,\n            max: 10000,\n            dflt: 500,\n            \n            editType: 'calc',\n            \n        },\n        editType: 'calc'\n    },\n    transforms: {\n        _isLinkedToArray: 'transform',\n        editType: 'calc',\n        \n    },\n    uirevision: {\n        valType: 'any',\n        \n        editType: 'none',\n        \n    }\n};\n\n},{\"../components/fx/attributes\":83}],220:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n    xaxis: {\n        valType: 'subplotid',\n        \n        dflt: 'x',\n        editType: 'calc+clearAxisTypes',\n        \n    },\n    yaxis: {\n        valType: 'subplotid',\n        \n        dflt: 'y',\n        editType: 'calc+clearAxisTypes',\n        \n    }\n};\n\n},{}],221:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar FP_SAFE = _dereq_('../../constants/numerical').FP_SAFE;\nvar Registry = _dereq_('../../registry');\n\nmodule.exports = {\n    getAutoRange: getAutoRange,\n    makePadFn: makePadFn,\n    doAutoRange: doAutoRange,\n    findExtremes: findExtremes,\n    concatExtremes: concatExtremes\n};\n\n/**\n * getAutoRange\n *\n * Collects all _extremes values corresponding to a given axis\n * and computes its auto range.\n *\n * Note that getAutoRange uses return values from findExtremes.\n *\n * @param {object} gd:\n *   graph div object with filled-in fullData and fullLayout, in particular\n *   with filled-in '_extremes' containers:\n *   {\n *      val: calcdata value,\n *      pad: extra pixels beyond this value,\n *      extrapad: bool, does this point want 5% extra padding\n *   }\n * @param {object} ax:\n *   full axis object, in particular with filled-in '_traceIndices'\n *   and '_annIndices' / '_shapeIndices' if applicable\n * @return {array}\n *   an array of [min, max]. These are calcdata for log and category axes\n *   and data for linear and date axes.\n *\n * TODO: we want to change log to data as well, but it's hard to do this\n * maintaining backward compatibility. category will always have to use calcdata\n * though, because otherwise values between categories (or outside all categories)\n * would be impossible.\n */\nfunction getAutoRange(gd, ax) {\n    var i, j;\n    var newRange = [];\n\n    var getPad = makePadFn(ax);\n    var extremes = concatExtremes(gd, ax);\n    var minArray = extremes.min;\n    var maxArray = extremes.max;\n\n    if(minArray.length === 0 || maxArray.length === 0) {\n        return Lib.simpleMap(ax.range, ax.r2l);\n    }\n\n    var minmin = minArray[0].val;\n    var maxmax = maxArray[0].val;\n\n    for(i = 1; i < minArray.length; i++) {\n        if(minmin !== maxmax) break;\n        minmin = Math.min(minmin, minArray[i].val);\n    }\n    for(i = 1; i < maxArray.length; i++) {\n        if(minmin !== maxmax) break;\n        maxmax = Math.max(maxmax, maxArray[i].val);\n    }\n\n    var axReverse = false;\n\n    if(ax.range) {\n        var rng = Lib.simpleMap(ax.range, ax.r2l);\n        axReverse = rng[1] < rng[0];\n    }\n    // one-time setting to easily reverse the axis\n    // when plotting from code\n    if(ax.autorange === 'reversed') {\n        axReverse = true;\n        ax.autorange = true;\n    }\n\n    var rangeMode = ax.rangemode;\n    var toZero = rangeMode === 'tozero';\n    var nonNegative = rangeMode === 'nonnegative';\n    var axLen = ax._length;\n    // don't allow padding to reduce the data to < 10% of the length\n    var minSpan = axLen / 10;\n\n    // find axis rangebreaks in [v0,v1] and compute its length in value space\n    var calcBreaksLength = function(v0, v1) {\n        var lBreaks = 0;\n        if(ax.rangebreaks) {\n            var rangebreaksOut = ax.locateBreaks(v0, v1);\n            for(var i = 0; i < rangebreaksOut.length; i++) {\n                var brk = rangebreaksOut[i];\n                lBreaks += brk.max - brk.min;\n            }\n        }\n        return lBreaks;\n    };\n\n    var mbest = 0;\n    var minpt, maxpt, minbest, maxbest, dp, dv;\n\n    for(i = 0; i < minArray.length; i++) {\n        minpt = minArray[i];\n        for(j = 0; j < maxArray.length; j++) {\n            maxpt = maxArray[j];\n            dv = maxpt.val - minpt.val - calcBreaksLength(minpt.val, maxpt.val);\n            if(dv > 0) {\n                dp = axLen - getPad(minpt) - getPad(maxpt);\n                if(dp > minSpan) {\n                    if(dv / dp > mbest) {\n                        minbest = minpt;\n                        maxbest = maxpt;\n                        mbest = dv / dp;\n                    }\n                } else if(dv / axLen > mbest) {\n                    // in case of padding longer than the axis\n                    // at least include the unpadded data values.\n                    minbest = {val: minpt.val, pad: 0};\n                    maxbest = {val: maxpt.val, pad: 0};\n                    mbest = dv / axLen;\n                }\n            }\n        }\n    }\n\n    function getMaxPad(prev, pt) {\n        return Math.max(prev, getPad(pt));\n    }\n\n    if(minmin === maxmax) {\n        var lower = minmin - 1;\n        var upper = minmin + 1;\n        if(toZero) {\n            if(minmin === 0) {\n                // The only value we have on this axis is 0, and we want to\n                // autorange so zero is one end.\n                // In principle this could be [0, 1] or [-1, 0] but usually\n                // 'tozero' pins 0 to the low end, so follow that.\n                newRange = [0, 1];\n            } else {\n                var maxPad = (minmin > 0 ? maxArray : minArray).reduce(getMaxPad, 0);\n                // we're pushing a single value away from the edge due to its\n                // padding, with the other end clamped at zero\n                // 0.5 means don't push it farther than the center.\n                var rangeEnd = minmin / (1 - Math.min(0.5, maxPad / axLen));\n                newRange = minmin > 0 ? [0, rangeEnd] : [rangeEnd, 0];\n            }\n        } else if(nonNegative) {\n            newRange = [Math.max(0, lower), Math.max(1, upper)];\n        } else {\n            newRange = [lower, upper];\n        }\n    } else {\n        if(toZero) {\n            if(minbest.val >= 0) {\n                minbest = {val: 0, pad: 0};\n            }\n            if(maxbest.val <= 0) {\n                maxbest = {val: 0, pad: 0};\n            }\n        } else if(nonNegative) {\n            if(minbest.val - mbest * getPad(minbest) < 0) {\n                minbest = {val: 0, pad: 0};\n            }\n            if(maxbest.val <= 0) {\n                maxbest = {val: 1, pad: 0};\n            }\n        }\n\n        // in case it changed again...\n        mbest = (maxbest.val - minbest.val - calcBreaksLength(minpt.val, maxpt.val)) /\n            (axLen - getPad(minbest) - getPad(maxbest));\n\n        newRange = [\n            minbest.val - mbest * getPad(minbest),\n            maxbest.val + mbest * getPad(maxbest)\n        ];\n    }\n\n    // maintain reversal\n    if(axReverse) newRange.reverse();\n\n    return Lib.simpleMap(newRange, ax.l2r || Number);\n}\n\n/*\n * calculate the pixel padding for ax._min and ax._max entries with\n * optional extrapad as 5% of the total axis length\n */\nfunction makePadFn(ax) {\n    // 5% padding for points that specify extrapad: true\n    var extrappad = ax._length / 20;\n\n    // domain-constrained axes: base extrappad on the unconstrained\n    // domain so it's consistent as the domain changes\n    if((ax.constrain === 'domain') && ax._inputDomain) {\n        extrappad *= (ax._inputDomain[1] - ax._inputDomain[0]) /\n            (ax.domain[1] - ax.domain[0]);\n    }\n\n    return function getPad(pt) { return pt.pad + (pt.extrapad ? extrappad : 0); };\n}\n\nfunction concatExtremes(gd, ax) {\n    var axId = ax._id;\n    var fullData = gd._fullData;\n    var fullLayout = gd._fullLayout;\n    var minArray = [];\n    var maxArray = [];\n    var i, j, d;\n\n    function _concat(cont, indices) {\n        for(i = 0; i < indices.length; i++) {\n            var item = cont[indices[i]];\n            var extremes = (item._extremes || {})[axId];\n            if(item.visible === true && extremes) {\n                for(j = 0; j < extremes.min.length; j++) {\n                    d = extremes.min[j];\n                    collapseMinArray(minArray, d.val, d.pad, {extrapad: d.extrapad});\n                }\n                for(j = 0; j < extremes.max.length; j++) {\n                    d = extremes.max[j];\n                    collapseMaxArray(maxArray, d.val, d.pad, {extrapad: d.extrapad});\n                }\n            }\n        }\n    }\n\n    _concat(fullData, ax._traceIndices);\n    _concat(fullLayout.annotations || [], ax._annIndices || []);\n    _concat(fullLayout.shapes || [], ax._shapeIndices || []);\n\n    return {min: minArray, max: maxArray};\n}\n\nfunction doAutoRange(gd, ax) {\n    ax.setScale();\n\n    if(ax.autorange) {\n        ax.range = getAutoRange(gd, ax);\n\n        ax._r = ax.range.slice();\n        ax._rl = Lib.simpleMap(ax._r, ax.r2l);\n\n        // doAutoRange will get called on fullLayout,\n        // but we want to report its results back to layout\n\n        var axIn = ax._input;\n\n        // before we edit _input, store preGUI values\n        var edits = {};\n        edits[ax._attr + '.range'] = ax.range;\n        edits[ax._attr + '.autorange'] = ax.autorange;\n        Registry.call('_storeDirectGUIEdit', gd.layout, gd._fullLayout._preGUI, edits);\n\n        axIn.range = ax.range.slice();\n        axIn.autorange = ax.autorange;\n    }\n\n    var anchorAx = ax._anchorAxis;\n\n    if(anchorAx && anchorAx.rangeslider) {\n        var axeRangeOpts = anchorAx.rangeslider[ax._name];\n        if(axeRangeOpts) {\n            if(axeRangeOpts.rangemode === 'auto') {\n                axeRangeOpts.range = getAutoRange(gd, ax);\n            }\n        }\n        anchorAx._input.rangeslider[ax._name] = Lib.extendFlat({}, axeRangeOpts);\n    }\n}\n\n/**\n * findExtremes\n *\n * Find min/max extremes of an array of coordinates on a given axis.\n *\n * Note that findExtremes is called during `calc`, when we don't yet know the axis\n * length; all the inputs should be based solely on the trace data, nothing\n * about the axis layout.\n *\n * Note that `ppad` and `vpad` as well as their asymmetric variants refer to\n * the before and after padding of the passed `data` array, not to the whole axis.\n *\n * @param {object} ax: full axis object\n *   relies on\n *   - ax.type\n *   - ax._m (just its sign)\n *   - ax.d2l\n * @param {array} data:\n *  array of numbers (i.e. already run though ax.d2c)\n * @param {object} opts:\n *  available keys are:\n *      vpad: (number or number array) pad values (data value +-vpad)\n *      ppad: (number or number array) pad pixels (pixel location +-ppad)\n *      ppadplus, ppadminus, vpadplus, vpadminus:\n *          separate padding for each side, overrides symmetric\n *      padded: (boolean) add 5% padding to both ends\n *          (unless one end is overridden by tozero)\n *      tozero: (boolean) make sure to include zero if axis is linear,\n *          and make it a tight bound if possible\n *      vpadLinearized: (boolean) whether or not vpad (or vpadplus/vpadminus)\n *          is linearized (for log scale axes)\n *\n * @return {object}\n *  - min {array of objects}\n *  - max {array of objects}\n *  each object item has fields:\n *    - val {number}\n *    - pad {number}\n *    - extrappad {number}\n *  - opts {object}: a ref to the passed \"options\" object\n */\nfunction findExtremes(ax, data, opts) {\n    if(!opts) opts = {};\n    if(!ax._m) ax.setScale();\n\n    var minArray = [];\n    var maxArray = [];\n\n    var len = data.length;\n    var extrapad = opts.padded || false;\n    var tozero = opts.tozero && (ax.type === 'linear' || ax.type === '-');\n    var isLog = ax.type === 'log';\n    var hasArrayOption = false;\n    var vpadLinearized = opts.vpadLinearized || false;\n    var i, v, di, dmin, dmax, ppadiplus, ppadiminus, vmin, vmax;\n\n    function makePadAccessor(item) {\n        if(Array.isArray(item)) {\n            hasArrayOption = true;\n            return function(i) { return Math.max(Number(item[i]||0), 0); };\n        } else {\n            var v = Math.max(Number(item||0), 0);\n            return function() { return v; };\n        }\n    }\n\n    var ppadplus = makePadAccessor((ax._m > 0 ?\n        opts.ppadplus : opts.ppadminus) || opts.ppad || 0);\n    var ppadminus = makePadAccessor((ax._m > 0 ?\n        opts.ppadminus : opts.ppadplus) || opts.ppad || 0);\n    var vpadplus = makePadAccessor(opts.vpadplus || opts.vpad);\n    var vpadminus = makePadAccessor(opts.vpadminus || opts.vpad);\n\n    if(!hasArrayOption) {\n        // with no arrays other than `data` we don't need to consider\n        // every point, only the extreme data points\n        vmin = Infinity;\n        vmax = -Infinity;\n\n        if(isLog) {\n            for(i = 0; i < len; i++) {\n                v = data[i];\n                // data is not linearized yet so we still have to filter out negative logs\n                if(v < vmin && v > 0) vmin = v;\n                if(v > vmax && v < FP_SAFE) vmax = v;\n            }\n        } else {\n            for(i = 0; i < len; i++) {\n                v = data[i];\n                if(v < vmin && v > -FP_SAFE) vmin = v;\n                if(v > vmax && v < FP_SAFE) vmax = v;\n            }\n        }\n\n        data = [vmin, vmax];\n        len = 2;\n    }\n\n    var collapseOpts = {tozero: tozero, extrapad: extrapad};\n\n    function addItem(i) {\n        di = data[i];\n        if(!isNumeric(di)) return;\n        ppadiplus = ppadplus(i);\n        ppadiminus = ppadminus(i);\n\n        if(vpadLinearized) {\n            dmin = ax.c2l(di) - vpadminus(i);\n            dmax = ax.c2l(di) + vpadplus(i);\n        } else {\n            vmin = di - vpadminus(i);\n            vmax = di + vpadplus(i);\n            // special case for log axes: if vpad makes this object span\n            // more than an order of mag, clip it to one order. This is so\n            // we don't have non-positive errors or absurdly large lower\n            // range due to rounding errors\n            if(isLog && vmin < vmax / 10) vmin = vmax / 10;\n\n            dmin = ax.c2l(vmin);\n            dmax = ax.c2l(vmax);\n        }\n\n        if(tozero) {\n            dmin = Math.min(0, dmin);\n            dmax = Math.max(0, dmax);\n        }\n        if(goodNumber(dmin)) {\n            collapseMinArray(minArray, dmin, ppadiminus, collapseOpts);\n        }\n        if(goodNumber(dmax)) {\n            collapseMaxArray(maxArray, dmax, ppadiplus, collapseOpts);\n        }\n    }\n\n    // For efficiency covering monotonic or near-monotonic data,\n    // check a few points at both ends first and then sweep\n    // through the middle\n    var iMax = Math.min(6, len);\n    for(i = 0; i < iMax; i++) addItem(i);\n    for(i = len - 1; i >= iMax; i--) addItem(i);\n\n    return {\n        min: minArray,\n        max: maxArray,\n        opts: opts\n    };\n}\n\nfunction collapseMinArray(array, newVal, newPad, opts) {\n    collapseArray(array, newVal, newPad, opts, lessOrEqual);\n}\n\nfunction collapseMaxArray(array, newVal, newPad, opts) {\n    collapseArray(array, newVal, newPad, opts, greaterOrEqual);\n}\n\n/**\n * collapseArray\n *\n * Takes items from 'array' and compares them to 'newVal', 'newPad'.\n *\n * @param {array} array:\n *  current set of min or max extremes\n * @param {number} newVal:\n *  new value to compare against\n * @param {number} newPad:\n *  pad value associated with 'newVal'\n * @param {object} opts:\n *  - tozero {boolean}\n *  - extrapad {number}\n * @param {function} atLeastAsExtreme:\n *  comparison function, use\n *  - lessOrEqual for min 'array' and\n *  - greaterOrEqual for max 'array'\n *\n * In practice, 'array' is either\n *  - 'extremes[ax._id].min' or\n *  - 'extremes[ax._id].max\n *  found in traces and layout items that affect autorange.\n *\n * Since we don't yet know the relationship between pixels and values\n * (that's what we're trying to figure out!) AND we don't yet know how\n * many pixels `extrapad` represents (it's going to be 5% of the length,\n * but we don't want to have to redo calc just because length changed)\n * two point must satisfy three criteria simultaneously for one to supersede the other:\n *  - at least as extreme a `val`\n *  - at least as big a `pad`\n *  - an unpadded point cannot supersede a padded point, but any other combination can\n *\n * Then:\n * - If the item supersedes the new point, set includeThis false\n * - If the new pt supersedes the item, delete it from 'array'\n */\nfunction collapseArray(array, newVal, newPad, opts, atLeastAsExtreme) {\n    var tozero = opts.tozero;\n    var extrapad = opts.extrapad;\n    var includeThis = true;\n\n    for(var j = 0; j < array.length && includeThis; j++) {\n        var v = array[j];\n        if(atLeastAsExtreme(v.val, newVal) && v.pad >= newPad && (v.extrapad || !extrapad)) {\n            includeThis = false;\n            break;\n        } else if(atLeastAsExtreme(newVal, v.val) && v.pad <= newPad && (extrapad || !v.extrapad)) {\n            array.splice(j, 1);\n            j--;\n        }\n    }\n    if(includeThis) {\n        var clipAtZero = (tozero && newVal === 0);\n        array.push({\n            val: newVal,\n            pad: clipAtZero ? 0 : newPad,\n            extrapad: clipAtZero ? false : extrapad\n        });\n    }\n}\n\n// In order to stop overflow errors, don't consider points\n// too close to the limits of js floating point\nfunction goodNumber(v) {\n    return isNumeric(v) && Math.abs(v) < FP_SAFE;\n}\n\nfunction lessOrEqual(v0, v1) { return v0 <= v1; }\nfunction greaterOrEqual(v0, v1) { return v0 >= v1; }\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"../../registry\":269,\"fast-isnumeric\":18}],222:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Plots = _dereq_('../../plots/plots');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar Titles = _dereq_('../../components/titles');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\n\nvar axAttrs = _dereq_('./layout_attributes');\nvar cleanTicks = _dereq_('./clean_ticks');\n\nvar constants = _dereq_('../../constants/numerical');\nvar ONEAVGYEAR = constants.ONEAVGYEAR;\nvar ONEAVGMONTH = constants.ONEAVGMONTH;\nvar ONEDAY = constants.ONEDAY;\nvar ONEHOUR = constants.ONEHOUR;\nvar ONEMIN = constants.ONEMIN;\nvar ONESEC = constants.ONESEC;\nvar MINUS_SIGN = constants.MINUS_SIGN;\nvar BADNUM = constants.BADNUM;\n\nvar alignmentConstants = _dereq_('../../constants/alignment');\nvar MID_SHIFT = alignmentConstants.MID_SHIFT;\nvar CAP_SHIFT = alignmentConstants.CAP_SHIFT;\nvar LINE_SPACING = alignmentConstants.LINE_SPACING;\nvar OPPOSITE_SIDE = alignmentConstants.OPPOSITE_SIDE;\n\nvar axes = module.exports = {};\n\naxes.setConvert = _dereq_('./set_convert');\nvar autoType = _dereq_('./axis_autotype');\n\nvar axisIds = _dereq_('./axis_ids');\naxes.id2name = axisIds.id2name;\naxes.name2id = axisIds.name2id;\naxes.cleanId = axisIds.cleanId;\naxes.list = axisIds.list;\naxes.listIds = axisIds.listIds;\naxes.getFromId = axisIds.getFromId;\naxes.getFromTrace = axisIds.getFromTrace;\n\nvar autorange = _dereq_('./autorange');\naxes.getAutoRange = autorange.getAutoRange;\naxes.findExtremes = autorange.findExtremes;\n\nvar epsilon = 0.0001;\nfunction expandRange(range) {\n    var delta = (range[1] - range[0]) * epsilon;\n    return [\n        range[0] - delta,\n        range[1] + delta\n    ];\n}\n\n/*\n * find the list of possible axes to reference with an xref or yref attribute\n * and coerce it to that list\n *\n * attr: the attribute we're generating a reference for. Should end in 'x' or 'y'\n *     but can be prefixed, like 'ax' for annotation's arrow x\n * dflt: the default to coerce to, or blank to use the first axis (falling back on\n *     extraOption if there is no axis)\n * extraOption: aside from existing axes with this letter, what non-axis value is allowed?\n *     Only required if it's different from `dflt`\n */\naxes.coerceRef = function(containerIn, containerOut, gd, attr, dflt, extraOption) {\n    var axLetter = attr.charAt(attr.length - 1);\n    var axlist = gd._fullLayout._subplots[axLetter + 'axis'];\n    var refAttr = attr + 'ref';\n    var attrDef = {};\n\n    if(!dflt) dflt = axlist[0] || extraOption;\n    if(!extraOption) extraOption = dflt;\n\n    // data-ref annotations are not supported in gl2d yet\n\n    attrDef[refAttr] = {\n        valType: 'enumerated',\n        values: axlist.concat(extraOption ? [extraOption] : []),\n        dflt: dflt\n    };\n\n    // xref, yref\n    return Lib.coerce(containerIn, containerOut, attrDef, refAttr);\n};\n\n/*\n * coerce position attributes (range-type) that can be either on axes or absolute\n * (paper or pixel) referenced. The biggest complication here is that we don't know\n * before looking at the axis whether the value must be a number or not (it may be\n * a date string), so we can't use the regular valType='number' machinery\n *\n * axRef (string): the axis this position is referenced to, or:\n *     paper: fraction of the plot area\n *     pixel: pixels relative to some starting position\n * attr (string): the attribute in containerOut we are coercing\n * dflt (number): the default position, as a fraction or pixels. If the attribute\n *     is to be axis-referenced, this will be converted to an axis data value\n *\n * Also cleans the values, since the attribute definition itself has to say\n * valType: 'any' to handle date axes. This allows us to accept:\n * - for category axes: category names, and convert them here into serial numbers.\n *   Note that this will NOT work for axis range endpoints, because we don't know\n *   the category list yet (it's set by ax.makeCalcdata during calc)\n *   but it works for component (note, shape, images) positions.\n * - for date axes: JS Dates or milliseconds, and convert to date strings\n * - for other types: coerce them to numbers\n */\naxes.coercePosition = function(containerOut, gd, coerce, axRef, attr, dflt) {\n    var cleanPos, pos;\n\n    if(axRef === 'paper' || axRef === 'pixel') {\n        cleanPos = Lib.ensureNumber;\n        pos = coerce(attr, dflt);\n    } else {\n        var ax = axes.getFromId(gd, axRef);\n        dflt = ax.fraction2r(dflt);\n        pos = coerce(attr, dflt);\n        cleanPos = ax.cleanPos;\n    }\n\n    containerOut[attr] = cleanPos(pos);\n};\n\naxes.cleanPosition = function(pos, gd, axRef) {\n    var cleanPos = (axRef === 'paper' || axRef === 'pixel') ?\n        Lib.ensureNumber :\n        axes.getFromId(gd, axRef).cleanPos;\n\n    return cleanPos(pos);\n};\n\naxes.redrawComponents = function(gd, axIds) {\n    axIds = axIds ? axIds : axes.listIds(gd);\n\n    var fullLayout = gd._fullLayout;\n\n    function _redrawOneComp(moduleName, methodName, stashName, shortCircuit) {\n        var method = Registry.getComponentMethod(moduleName, methodName);\n        var stash = {};\n\n        for(var i = 0; i < axIds.length; i++) {\n            var ax = fullLayout[axes.id2name(axIds[i])];\n            var indices = ax[stashName];\n\n            for(var j = 0; j < indices.length; j++) {\n                var ind = indices[j];\n\n                if(!stash[ind]) {\n                    method(gd, ind);\n                    stash[ind] = 1;\n                    // once is enough for images (which doesn't use the `i` arg anyway)\n                    if(shortCircuit) return;\n                }\n            }\n        }\n    }\n\n    // annotations and shapes 'draw' method is slow,\n    // use the finer-grained 'drawOne' method instead\n    _redrawOneComp('annotations', 'drawOne', '_annIndices');\n    _redrawOneComp('shapes', 'drawOne', '_shapeIndices');\n    _redrawOneComp('images', 'draw', '_imgIndices', true);\n};\n\nvar getDataConversions = axes.getDataConversions = function(gd, trace, target, targetArray) {\n    var ax;\n\n    // If target points to an axis, use the type we already have for that\n    // axis to find the data type. Otherwise use the values to autotype.\n    var d2cTarget = (target === 'x' || target === 'y' || target === 'z') ?\n        target :\n        targetArray;\n\n    // In the case of an array target, make a mock data array\n    // and call supplyDefaults to the data type and\n    // setup the data-to-calc method.\n    if(Array.isArray(d2cTarget)) {\n        ax = {\n            type: autoType(targetArray),\n            _categories: []\n        };\n        axes.setConvert(ax);\n\n        // build up ax._categories (usually done during ax.makeCalcdata()\n        if(ax.type === 'category') {\n            for(var i = 0; i < targetArray.length; i++) {\n                ax.d2c(targetArray[i]);\n            }\n        }\n        // TODO what to do for transforms?\n    } else {\n        ax = axes.getFromTrace(gd, trace, d2cTarget);\n    }\n\n    // if 'target' has corresponding axis\n    // -> use setConvert method\n    if(ax) return {d2c: ax.d2c, c2d: ax.c2d};\n\n    // special case for 'ids'\n    // -> cast to String\n    if(d2cTarget === 'ids') return {d2c: toString, c2d: toString};\n\n    // otherwise (e.g. numeric-array of 'marker.color' or 'marker.size')\n    // -> cast to Number\n\n    return {d2c: toNum, c2d: toNum};\n};\n\nfunction toNum(v) { return +v; }\nfunction toString(v) { return String(v); }\n\naxes.getDataToCoordFunc = function(gd, trace, target, targetArray) {\n    return getDataConversions(gd, trace, target, targetArray).d2c;\n};\n\n// get counteraxis letter for this axis (name or id)\n// this can also be used as the id for default counter axis\naxes.counterLetter = function(id) {\n    var axLetter = id.charAt(0);\n    if(axLetter === 'x') return 'y';\n    if(axLetter === 'y') return 'x';\n};\n\n// incorporate a new minimum difference and first tick into\n// forced\n// note that _forceTick0 is linearized, so needs to be turned into\n// a range value for setting tick0\naxes.minDtick = function(ax, newDiff, newFirst, allow) {\n    // doesn't make sense to do forced min dTick on log or category axes,\n    // and the plot itself may decide to cancel (ie non-grouped bars)\n    if(['log', 'category', 'multicategory'].indexOf(ax.type) !== -1 || !allow) {\n        ax._minDtick = 0;\n    } else if(ax._minDtick === undefined) {\n        // undefined means there's nothing there yet\n\n        ax._minDtick = newDiff;\n        ax._forceTick0 = newFirst;\n    } else if(ax._minDtick) {\n        if((ax._minDtick / newDiff + 1e-6) % 1 < 2e-6 &&\n            // existing minDtick is an integer multiple of newDiff\n            // (within rounding err)\n            // and forceTick0 can be shifted to newFirst\n\n                (((newFirst - ax._forceTick0) / newDiff % 1) +\n                    1.000001) % 1 < 2e-6) {\n            ax._minDtick = newDiff;\n            ax._forceTick0 = newFirst;\n        } else if((newDiff / ax._minDtick + 1e-6) % 1 > 2e-6 ||\n            // if the converse is true (newDiff is a multiple of minDtick and\n            // newFirst can be shifted to forceTick0) then do nothing - same\n            // forcing stands. Otherwise, cancel forced minimum\n\n                (((newFirst - ax._forceTick0) / ax._minDtick % 1) +\n                    1.000001) % 1 > 2e-6) {\n            ax._minDtick = 0;\n        }\n    }\n};\n\n// save a copy of the initial axis ranges in fullLayout\n// use them in mode bar and dblclick events\naxes.saveRangeInitial = function(gd, overwrite) {\n    var axList = axes.list(gd, '', true);\n    var hasOneAxisChanged = false;\n\n    for(var i = 0; i < axList.length; i++) {\n        var ax = axList[i];\n        var isNew = (ax._rangeInitial === undefined);\n        var hasChanged = isNew || !(\n            ax.range[0] === ax._rangeInitial[0] &&\n            ax.range[1] === ax._rangeInitial[1]\n        );\n\n        if((isNew && ax.autorange === false) || (overwrite && hasChanged)) {\n            ax._rangeInitial = ax.range.slice();\n            hasOneAxisChanged = true;\n        }\n    }\n\n    return hasOneAxisChanged;\n};\n\n// save a copy of the initial spike visibility\naxes.saveShowSpikeInitial = function(gd, overwrite) {\n    var axList = axes.list(gd, '', true);\n    var hasOneAxisChanged = false;\n    var allSpikesEnabled = 'on';\n\n    for(var i = 0; i < axList.length; i++) {\n        var ax = axList[i];\n        var isNew = (ax._showSpikeInitial === undefined);\n        var hasChanged = isNew || !(ax.showspikes === ax._showspikes);\n\n        if(isNew || (overwrite && hasChanged)) {\n            ax._showSpikeInitial = ax.showspikes;\n            hasOneAxisChanged = true;\n        }\n\n        if(allSpikesEnabled === 'on' && !ax.showspikes) {\n            allSpikesEnabled = 'off';\n        }\n    }\n    gd._fullLayout._cartesianSpikesEnabled = allSpikesEnabled;\n    return hasOneAxisChanged;\n};\n\naxes.autoBin = function(data, ax, nbins, is2d, calendar, size) {\n    var dataMin = Lib.aggNums(Math.min, null, data);\n    var dataMax = Lib.aggNums(Math.max, null, data);\n\n    if(ax.type === 'category' || ax.type === 'multicategory') {\n        return {\n            start: dataMin - 0.5,\n            end: dataMax + 0.5,\n            size: Math.max(1, Math.round(size) || 1),\n            _dataSpan: dataMax - dataMin,\n        };\n    }\n\n    if(!calendar) calendar = ax.calendar;\n\n    // piggyback off tick code to make \"nice\" bin sizes and edges\n    var dummyAx;\n    if(ax.type === 'log') {\n        dummyAx = {\n            type: 'linear',\n            range: [dataMin, dataMax]\n        };\n    } else {\n        dummyAx = {\n            type: ax.type,\n            range: Lib.simpleMap([dataMin, dataMax], ax.c2r, 0, calendar),\n            calendar: calendar\n        };\n    }\n    axes.setConvert(dummyAx);\n\n    size = size && cleanTicks.dtick(size, dummyAx.type);\n\n    if(size) {\n        dummyAx.dtick = size;\n        dummyAx.tick0 = cleanTicks.tick0(undefined, dummyAx.type, calendar);\n    } else {\n        var size0;\n        if(nbins) size0 = ((dataMax - dataMin) / nbins);\n        else {\n            // totally auto: scale off std deviation so the highest bin is\n            // somewhat taller than the total number of bins, but don't let\n            // the size get smaller than the 'nice' rounded down minimum\n            // difference between values\n            var distinctData = Lib.distinctVals(data);\n            var msexp = Math.pow(10, Math.floor(\n                Math.log(distinctData.minDiff) / Math.LN10));\n            var minSize = msexp * Lib.roundUp(\n                distinctData.minDiff / msexp, [0.9, 1.9, 4.9, 9.9], true);\n            size0 = Math.max(minSize, 2 * Lib.stdev(data) /\n                Math.pow(data.length, is2d ? 0.25 : 0.4));\n\n            // fallback if ax.d2c output BADNUMs\n            // e.g. when user try to plot categorical bins\n            // on a layout.xaxis.type: 'linear'\n            if(!isNumeric(size0)) size0 = 1;\n        }\n\n        axes.autoTicks(dummyAx, size0);\n    }\n\n    var finalSize = dummyAx.dtick;\n    var binStart = axes.tickIncrement(\n            axes.tickFirst(dummyAx), finalSize, 'reverse', calendar);\n    var binEnd, bincount;\n\n    // check for too many data points right at the edges of bins\n    // (>50% within 1% of bin edges) or all data points integral\n    // and offset the bins accordingly\n    if(typeof finalSize === 'number') {\n        binStart = autoShiftNumericBins(binStart, data, dummyAx, dataMin, dataMax);\n\n        bincount = 1 + Math.floor((dataMax - binStart) / finalSize);\n        binEnd = binStart + bincount * finalSize;\n    } else {\n        // month ticks - should be the only nonlinear kind we have at this point.\n        // dtick (as supplied by axes.autoTick) only has nonlinear values on\n        // date and log axes, but even if you display a histogram on a log axis\n        // we bin it on a linear axis (which one could argue against, but that's\n        // a separate issue)\n        if(dummyAx.dtick.charAt(0) === 'M') {\n            binStart = autoShiftMonthBins(binStart, data, finalSize, dataMin, calendar);\n        }\n\n        // calculate the endpoint for nonlinear ticks - you have to\n        // just increment until you're done\n        binEnd = binStart;\n        bincount = 0;\n        while(binEnd <= dataMax) {\n            binEnd = axes.tickIncrement(binEnd, finalSize, false, calendar);\n            bincount++;\n        }\n    }\n\n    return {\n        start: ax.c2r(binStart, 0, calendar),\n        end: ax.c2r(binEnd, 0, calendar),\n        size: finalSize,\n        _dataSpan: dataMax - dataMin\n    };\n};\n\n\nfunction autoShiftNumericBins(binStart, data, ax, dataMin, dataMax) {\n    var edgecount = 0;\n    var midcount = 0;\n    var intcount = 0;\n    var blankCount = 0;\n\n    function nearEdge(v) {\n        // is a value within 1% of a bin edge?\n        return (1 + (v - binStart) * 100 / ax.dtick) % 100 < 2;\n    }\n\n    for(var i = 0; i < data.length; i++) {\n        if(data[i] % 1 === 0) intcount++;\n        else if(!isNumeric(data[i])) blankCount++;\n\n        if(nearEdge(data[i])) edgecount++;\n        if(nearEdge(data[i] + ax.dtick / 2)) midcount++;\n    }\n    var dataCount = data.length - blankCount;\n\n    if(intcount === dataCount && ax.type !== 'date') {\n        if(ax.dtick < 1) {\n            // all integers: if bin size is <1, it's because\n            // that was specifically requested (large nbins)\n            // so respect that... but center the bins containing\n            // integers on those integers\n\n            binStart = dataMin - 0.5 * ax.dtick;\n        } else {\n            // otherwise start half an integer down regardless of\n            // the bin size, just enough to clear up endpoint\n            // ambiguity about which integers are in which bins.\n\n            binStart -= 0.5;\n            if(binStart + ax.dtick < dataMin) binStart += ax.dtick;\n        }\n    } else if(midcount < dataCount * 0.1) {\n        if(edgecount > dataCount * 0.3 ||\n                nearEdge(dataMin) || nearEdge(dataMax)) {\n            // lots of points at the edge, not many in the middle\n            // shift half a bin\n            var binshift = ax.dtick / 2;\n            binStart += (binStart + binshift < dataMin) ? binshift : -binshift;\n        }\n    }\n    return binStart;\n}\n\n\nfunction autoShiftMonthBins(binStart, data, dtick, dataMin, calendar) {\n    var stats = Lib.findExactDates(data, calendar);\n    // number of data points that needs to be an exact value\n    // to shift that increment to (near) the bin center\n    var threshold = 0.8;\n\n    if(stats.exactDays > threshold) {\n        var numMonths = Number(dtick.substr(1));\n\n        if((stats.exactYears > threshold) && (numMonths % 12 === 0)) {\n            // The exact middle of a non-leap-year is 1.5 days into July\n            // so if we start the bins here, all but leap years will\n            // get hover-labeled as exact years.\n            binStart = axes.tickIncrement(binStart, 'M6', 'reverse') + ONEDAY * 1.5;\n        } else if(stats.exactMonths > threshold) {\n            // Months are not as clean, but if we shift half the *longest*\n            // month (31/2 days) then 31-day months will get labeled exactly\n            // and shorter months will get labeled with the correct month\n            // but shifted 12-36 hours into it.\n            binStart = axes.tickIncrement(binStart, 'M1', 'reverse') + ONEDAY * 15.5;\n        } else {\n            // Shifting half a day is exact, but since these are month bins it\n            // will always give a somewhat odd-looking label, until we do something\n            // smarter like showing the bin boundaries (or the bounds of the actual\n            // data in each bin)\n            binStart -= ONEDAY / 2;\n        }\n        var nextBinStart = axes.tickIncrement(binStart, dtick);\n\n        if(nextBinStart <= dataMin) return nextBinStart;\n    }\n    return binStart;\n}\n\n// ----------------------------------------------------\n// Ticks and grids\n// ----------------------------------------------------\n\n// ensure we have tick0, dtick, and tick rounding calculated\naxes.prepTicks = function(ax, opts) {\n    var rng = Lib.simpleMap(ax.range, ax.r2l, undefined, undefined, opts);\n\n    // calculate max number of (auto) ticks to display based on plot size\n    if(ax.tickmode === 'auto' || !ax.dtick) {\n        var nt = ax.nticks;\n        var minPx;\n\n        if(!nt) {\n            if(ax.type === 'category' || ax.type === 'multicategory') {\n                minPx = ax.tickfont ? (ax.tickfont.size || 12) * 1.2 : 15;\n                nt = ax._length / minPx;\n            } else {\n                minPx = ax._id.charAt(0) === 'y' ? 40 : 80;\n                nt = Lib.constrain(ax._length / minPx, 4, 9) + 1;\n            }\n\n            // radial axes span half their domain,\n            // multiply nticks value by two to get correct number of auto ticks.\n            if(ax._name === 'radialaxis') nt *= 2;\n        }\n\n        // add a couple of extra digits for filling in ticks when we\n        // have explicit tickvals without tick text\n        if(ax.tickmode === 'array') nt *= 100;\n\n\n        ax._roughDTick = (Math.abs(rng[1] - rng[0]) - (ax._lBreaks || 0)) / nt;\n        axes.autoTicks(ax, ax._roughDTick);\n\n        // check for a forced minimum dtick\n        if(ax._minDtick > 0 && ax.dtick < ax._minDtick * 2) {\n            ax.dtick = ax._minDtick;\n            ax.tick0 = ax.l2r(ax._forceTick0);\n        }\n    }\n\n    // check for missing tick0\n    if(!ax.tick0) {\n        ax.tick0 = (ax.type === 'date') ? '2000-01-01' : 0;\n    }\n\n    // ensure we don't try to make ticks below our minimum precision\n    // see https://github.com/plotly/plotly.js/issues/2892\n    if(ax.type === 'date' && ax.dtick < 0.1) ax.dtick = 0.1;\n\n    // now figure out rounding of tick values\n    autoTickRound(ax);\n};\n\n// calculate the ticks: text, values, positioning\n// if ticks are set to automatic, determine the right values (tick0,dtick)\n// in any case, set tickround to # of digits to round tick labels to,\n// or codes to this effect for log and date scales\naxes.calcTicks = function calcTicks(ax, opts) {\n    axes.prepTicks(ax, opts);\n    var rng = Lib.simpleMap(ax.range, ax.r2l, undefined, undefined, opts);\n\n    // now that we've figured out the auto values for formatting\n    // in case we're missing some ticktext, we can break out for array ticks\n    if(ax.tickmode === 'array') return arrayTicks(ax);\n\n    // find the first tick\n    ax._tmin = axes.tickFirst(ax, opts);\n\n    // add a tiny bit so we get ticks which may have rounded out\n    var exRng = expandRange(rng);\n    var startTick = exRng[0];\n    var endTick = exRng[1];\n    // check for reversed axis\n    var axrev = (rng[1] < rng[0]);\n\n    // No visible ticks? Quit.\n    // I've only seen this on category axes with all categories off the edge.\n    if((ax._tmin < startTick) !== axrev) return [];\n\n    // return the full set of tick vals\n    if(ax.type === 'category' || ax.type === 'multicategory') {\n        endTick = (axrev) ? Math.max(-0.5, endTick) :\n            Math.min(ax._categories.length - 0.5, endTick);\n    }\n\n    var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');\n\n    var tickVals;\n    function generateTicks() {\n        var xPrevious = null;\n        var maxTicks = Math.max(1000, ax._length || 0);\n        tickVals = [];\n        for(var x = ax._tmin;\n                (axrev) ? (x >= endTick) : (x <= endTick);\n                x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)) {\n            // prevent infinite loops - no more than one tick per pixel,\n            // and make sure each value is different from the previous\n            if(tickVals.length > maxTicks || x === xPrevious) break;\n            xPrevious = x;\n\n            var minor = false;\n            if(isDLog && (x !== (x | 0))) {\n                minor = true;\n            }\n\n            tickVals.push({\n                minor: minor,\n                value: x\n            });\n        }\n    }\n\n    generateTicks();\n\n    if(ax.rangebreaks) {\n        // replace ticks inside breaks that would get a tick\n        // and reduce ticks\n        var len = tickVals.length;\n        if(len) {\n            var tf = 0;\n            if(ax.tickmode === 'auto') {\n                tf =\n                    (ax._id.charAt(0) === 'y' ? 2 : 6) *\n                    (ax.tickfont ? ax.tickfont.size : 12);\n            }\n\n            var newTickVals = [];\n            var prevPos;\n\n            var dir = axrev ? 1 : -1;\n            var first = axrev ? 0 : len - 1;\n            var last = axrev ? len - 1 : 0;\n            for(var q = first; dir * q <= dir * last; q += dir) {\n                var tickVal = tickVals[q];\n                if(ax.maskBreaks(tickVal.value) === BADNUM) {\n                    tickVal.value = moveOutsideBreak(tickVal.value, ax);\n\n                    if(ax._rl && (\n                        ax._rl[0] === tickVal.value ||\n                        ax._rl[1] === tickVal.value\n                    )) continue;\n                }\n\n                var pos = ax.c2p(tickVal.value);\n\n                if(pos === prevPos) {\n                    if(newTickVals[newTickVals.length - 1].value < tickVal.value) {\n                        newTickVals[newTickVals.length - 1] = tickVal;\n                    }\n                } else if(prevPos === undefined || Math.abs(pos - prevPos) > tf) {\n                    prevPos = pos;\n                    newTickVals.push(tickVal);\n                }\n            }\n            tickVals = newTickVals.reverse();\n        }\n    }\n\n    // If same angle over a full circle, the last tick vals is a duplicate.\n    // TODO must do something similar for angular date axes.\n    if(isAngular(ax) && Math.abs(rng[1] - rng[0]) === 360) {\n        tickVals.pop();\n    }\n\n    // save the last tick as well as first, so we can\n    // show the exponent only on the last one\n    ax._tmax = (tickVals[tickVals.length - 1] || {}).value;\n\n    // for showing the rest of a date when the main tick label is only the\n    // latter part: ax._prevDateHead holds what we showed most recently.\n    // Start with it cleared and mark that we're in calcTicks (ie calculating a\n    // whole string of these so we should care what the previous date head was!)\n    ax._prevDateHead = '';\n    ax._inCalcTicks = true;\n\n    var ticksOut = new Array(tickVals.length);\n    for(var i = 0; i < tickVals.length; i++) {\n        var _minor = tickVals[i].minor;\n        var _value = tickVals[i].value;\n\n        ticksOut[i] = axes.tickText(\n            ax,\n            _value,\n            false, // hover\n            _minor // noSuffixPrefix\n        );\n    }\n\n    ax._inCalcTicks = false;\n\n    return ticksOut;\n};\n\nfunction arrayTicks(ax) {\n    var vals = ax.tickvals;\n    var text = ax.ticktext;\n    var ticksOut = new Array(vals.length);\n    var rng = Lib.simpleMap(ax.range, ax.r2l);\n    var exRng = expandRange(rng);\n    var tickMin = Math.min(exRng[0], exRng[1]);\n    var tickMax = Math.max(exRng[0], exRng[1]);\n    var j = 0;\n\n    // without a text array, just format the given values as any other ticks\n    // except with more precision to the numbers\n    if(!Array.isArray(text)) text = [];\n\n    // make sure showing ticks doesn't accidentally add new categories\n    // TODO multicategory, if we allow ticktext / tickvals\n    var tickVal2l = ax.type === 'category' ? ax.d2l_noadd : ax.d2l;\n\n    // array ticks on log axes always show the full number\n    // (if no explicit ticktext overrides it)\n    if(ax.type === 'log' && String(ax.dtick).charAt(0) !== 'L') {\n        ax.dtick = 'L' + Math.pow(10, Math.floor(Math.min(ax.range[0], ax.range[1])) - 1);\n    }\n\n    for(var i = 0; i < vals.length; i++) {\n        var vali = tickVal2l(vals[i]);\n        if(vali > tickMin && vali < tickMax) {\n            if(text[i] === undefined) ticksOut[j] = axes.tickText(ax, vali);\n            else ticksOut[j] = tickTextObj(ax, vali, String(text[i]));\n            j++;\n        }\n    }\n\n    if(j < vals.length) ticksOut.splice(j, vals.length - j);\n\n    if(ax.rangebreaks) {\n        // remove ticks falling inside rangebreaks\n        ticksOut = ticksOut.filter(function(d) {\n            return ax.maskBreaks(d.x) !== BADNUM;\n        });\n    }\n\n    return ticksOut;\n}\n\nvar roundBase10 = [2, 5, 10];\nvar roundBase24 = [1, 2, 3, 6, 12];\nvar roundBase60 = [1, 2, 5, 10, 15, 30];\n// 2&3 day ticks are weird, but need something btwn 1&7\nvar roundDays = [1, 2, 3, 7, 14];\n// approx. tick positions for log axes, showing all (1) and just 1, 2, 5 (2)\n// these don't have to be exact, just close enough to round to the right value\nvar roundLog1 = [-0.046, 0, 0.301, 0.477, 0.602, 0.699, 0.778, 0.845, 0.903, 0.954, 1];\nvar roundLog2 = [-0.301, 0, 0.301, 0.699, 1];\n// N.B. `thetaunit; 'radians' angular axes must be converted to degrees\nvar roundAngles = [15, 30, 45, 90, 180];\n\nfunction roundDTick(roughDTick, base, roundingSet) {\n    return base * Lib.roundUp(roughDTick / base, roundingSet);\n}\n\n// autoTicks: calculate best guess at pleasant ticks for this axis\n// inputs:\n//      ax - an axis object\n//      roughDTick - rough tick spacing (to be turned into a nice round number)\n// outputs (into ax):\n//   tick0: starting point for ticks (not necessarily on the graph)\n//      usually 0 for numeric (=10^0=1 for log) or jan 1, 2000 for dates\n//   dtick: the actual, nice round tick spacing, usually a little larger than roughDTick\n//      if the ticks are spaced linearly (linear scale, categories,\n//          log with only full powers, date ticks < month),\n//          this will just be a number\n//      months: M#\n//      years: M# where # is 12*number of years\n//      log with linear ticks: L# where # is the linear tick spacing\n//      log showing powers plus some intermediates:\n//          D1 shows all digits, D2 shows 2 and 5\naxes.autoTicks = function(ax, roughDTick) {\n    var base;\n\n    function getBase(v) {\n        return Math.pow(v, Math.floor(Math.log(roughDTick) / Math.LN10));\n    }\n\n    if(ax.type === 'date') {\n        ax.tick0 = Lib.dateTick0(ax.calendar);\n        // the criteria below are all based on the rough spacing we calculate\n        // being > half of the final unit - so precalculate twice the rough val\n        var roughX2 = 2 * roughDTick;\n\n        if(roughX2 > ONEAVGYEAR) {\n            roughDTick /= ONEAVGYEAR;\n            base = getBase(10);\n            ax.dtick = 'M' + (12 * roundDTick(roughDTick, base, roundBase10));\n        } else if(roughX2 > ONEAVGMONTH) {\n            roughDTick /= ONEAVGMONTH;\n            ax.dtick = 'M' + roundDTick(roughDTick, 1, roundBase24);\n        } else if(roughX2 > ONEDAY) {\n            ax.dtick = roundDTick(roughDTick, ONEDAY, ax._hasDayOfWeekBreaks ? [1, 2, 7, 14] : roundDays);\n            // get week ticks on sunday\n            // this will also move the base tick off 2000-01-01 if dtick is\n            // 2 or 3 days... but that's a weird enough case that we'll ignore it.\n            ax.tick0 = Lib.dateTick0(ax.calendar, true);\n        } else if(roughX2 > ONEHOUR) {\n            ax.dtick = roundDTick(roughDTick, ONEHOUR, roundBase24);\n        } else if(roughX2 > ONEMIN) {\n            ax.dtick = roundDTick(roughDTick, ONEMIN, roundBase60);\n        } else if(roughX2 > ONESEC) {\n            ax.dtick = roundDTick(roughDTick, ONESEC, roundBase60);\n        } else {\n            // milliseconds\n            base = getBase(10);\n            ax.dtick = roundDTick(roughDTick, base, roundBase10);\n        }\n    } else if(ax.type === 'log') {\n        ax.tick0 = 0;\n        var rng = Lib.simpleMap(ax.range, ax.r2l);\n\n        if(roughDTick > 0.7) {\n            // only show powers of 10\n            ax.dtick = Math.ceil(roughDTick);\n        } else if(Math.abs(rng[1] - rng[0]) < 1) {\n            // span is less than one power of 10\n            var nt = 1.5 * Math.abs((rng[1] - rng[0]) / roughDTick);\n\n            // ticks on a linear scale, labeled fully\n            roughDTick = Math.abs(Math.pow(10, rng[1]) -\n                Math.pow(10, rng[0])) / nt;\n            base = getBase(10);\n            ax.dtick = 'L' + roundDTick(roughDTick, base, roundBase10);\n        } else {\n            // include intermediates between powers of 10,\n            // labeled with small digits\n            // ax.dtick = \"D2\" (show 2 and 5) or \"D1\" (show all digits)\n            ax.dtick = (roughDTick > 0.3) ? 'D2' : 'D1';\n        }\n    } else if(ax.type === 'category' || ax.type === 'multicategory') {\n        ax.tick0 = 0;\n        ax.dtick = Math.ceil(Math.max(roughDTick, 1));\n    } else if(isAngular(ax)) {\n        ax.tick0 = 0;\n        base = 1;\n        ax.dtick = roundDTick(roughDTick, base, roundAngles);\n    } else {\n        // auto ticks always start at 0\n        ax.tick0 = 0;\n        base = getBase(10);\n        ax.dtick = roundDTick(roughDTick, base, roundBase10);\n    }\n\n    // prevent infinite loops\n    if(ax.dtick === 0) ax.dtick = 1;\n\n    // TODO: this is from log axis histograms with autorange off\n    if(!isNumeric(ax.dtick) && typeof ax.dtick !== 'string') {\n        var olddtick = ax.dtick;\n        ax.dtick = 1;\n        throw 'ax.dtick error: ' + String(olddtick);\n    }\n};\n\n// after dtick is already known, find tickround = precision\n// to display in tick labels\n//   for numeric ticks, integer # digits after . to round to\n//   for date ticks, the last date part to show (y,m,d,H,M,S)\n//      or an integer # digits past seconds\nfunction autoTickRound(ax) {\n    var dtick = ax.dtick;\n\n    ax._tickexponent = 0;\n    if(!isNumeric(dtick) && typeof dtick !== 'string') {\n        dtick = 1;\n    }\n\n    if(ax.type === 'category' || ax.type === 'multicategory') {\n        ax._tickround = null;\n    }\n    if(ax.type === 'date') {\n        // If tick0 is unusual, give tickround a bit more information\n        // not necessarily *all* the information in tick0 though, if it's really odd\n        // minimal string length for tick0: 'd' is 10, 'M' is 16, 'S' is 19\n        // take off a leading minus (year < 0) and i (intercalary month) so length is consistent\n        var tick0ms = ax.r2l(ax.tick0);\n        var tick0str = ax.l2r(tick0ms).replace(/(^-|i)/g, '');\n        var tick0len = tick0str.length;\n\n        if(String(dtick).charAt(0) === 'M') {\n            // any tick0 more specific than a year: alway show the full date\n            if(tick0len > 10 || tick0str.substr(5) !== '01-01') ax._tickround = 'd';\n            // show the month unless ticks are full multiples of a year\n            else ax._tickround = (+(dtick.substr(1)) % 12 === 0) ? 'y' : 'm';\n        } else if((dtick >= ONEDAY && tick0len <= 10) || (dtick >= ONEDAY * 15)) ax._tickround = 'd';\n        else if((dtick >= ONEMIN && tick0len <= 16) || (dtick >= ONEHOUR)) ax._tickround = 'M';\n        else if((dtick >= ONESEC && tick0len <= 19) || (dtick >= ONEMIN)) ax._tickround = 'S';\n        else {\n            // tickround is a number of digits of fractional seconds\n            // of any two adjacent ticks, at least one will have the maximum fractional digits\n            // of all possible ticks - so take the max. length of tick0 and the next one\n            var tick1len = ax.l2r(tick0ms + dtick).replace(/^-/, '').length;\n            ax._tickround = Math.max(tick0len, tick1len) - 20;\n\n            // We shouldn't get here... but in case there's a situation I'm\n            // not thinking of where tick0str and tick1str are identical or\n            // something, fall back on maximum precision\n            if(ax._tickround < 0) ax._tickround = 4;\n        }\n    } else if(isNumeric(dtick) || dtick.charAt(0) === 'L') {\n        // linear or log (except D1, D2)\n        var rng = ax.range.map(ax.r2d || Number);\n        if(!isNumeric(dtick)) dtick = Number(dtick.substr(1));\n        // 2 digits past largest digit of dtick\n        ax._tickround = 2 - Math.floor(Math.log(dtick) / Math.LN10 + 0.01);\n\n        var maxend = Math.max(Math.abs(rng[0]), Math.abs(rng[1]));\n        var rangeexp = Math.floor(Math.log(maxend) / Math.LN10 + 0.01);\n        if(Math.abs(rangeexp) > 3) {\n            if(isSIFormat(ax.exponentformat) && !beyondSI(rangeexp)) {\n                ax._tickexponent = 3 * Math.round((rangeexp - 1) / 3);\n            } else ax._tickexponent = rangeexp;\n        }\n    } else {\n        // D1 or D2 (log)\n        ax._tickround = null;\n    }\n}\n\n// months and years don't have constant millisecond values\n// (but a year is always 12 months so we only need months)\n// log-scale ticks are also not consistently spaced, except\n// for pure powers of 10\n// numeric ticks always have constant differences, other datetime ticks\n// can all be calculated as constant number of milliseconds\naxes.tickIncrement = function(x, dtick, axrev, calendar) {\n    var axSign = axrev ? -1 : 1;\n\n    // includes linear, all dates smaller than month, and pure 10^n in log\n    if(isNumeric(dtick)) return x + axSign * dtick;\n\n    // everything else is a string, one character plus a number\n    var tType = dtick.charAt(0);\n    var dtSigned = axSign * Number(dtick.substr(1));\n\n    // Dates: months (or years - see Lib.incrementMonth)\n    if(tType === 'M') return Lib.incrementMonth(x, dtSigned, calendar);\n\n    // Log scales: Linear, Digits\n    if(tType === 'L') return Math.log(Math.pow(10, x) + dtSigned) / Math.LN10;\n\n    // log10 of 2,5,10, or all digits (logs just have to be\n    // close enough to round)\n    if(tType === 'D') {\n        var tickset = (dtick === 'D2') ? roundLog2 : roundLog1;\n        var x2 = x + axSign * 0.01;\n        var frac = Lib.roundUp(Lib.mod(x2, 1), tickset, axrev);\n\n        return Math.floor(x2) +\n            Math.log(d3.round(Math.pow(10, frac), 1)) / Math.LN10;\n    }\n\n    throw 'unrecognized dtick ' + String(dtick);\n};\n\n// calculate the first tick on an axis\naxes.tickFirst = function(ax, opts) {\n    var r2l = ax.r2l || Number;\n    var rng = Lib.simpleMap(ax.range, r2l, undefined, undefined, opts);\n    var axrev = rng[1] < rng[0];\n    var sRound = axrev ? Math.floor : Math.ceil;\n    // add a tiny extra bit to make sure we get ticks\n    // that may have been rounded out\n    var r0 = expandRange(rng)[0];\n    var dtick = ax.dtick;\n    var tick0 = r2l(ax.tick0);\n\n    if(isNumeric(dtick)) {\n        var tmin = sRound((r0 - tick0) / dtick) * dtick + tick0;\n\n        // make sure no ticks outside the category list\n        if(ax.type === 'category' || ax.type === 'multicategory') {\n            tmin = Lib.constrain(tmin, 0, ax._categories.length - 1);\n        }\n        return tmin;\n    }\n\n    var tType = dtick.charAt(0);\n    var dtNum = Number(dtick.substr(1));\n\n    // Dates: months (or years)\n    if(tType === 'M') {\n        var cnt = 0;\n        var t0 = tick0;\n        var t1, mult, newDTick;\n\n        // This algorithm should work for *any* nonlinear (but close to linear!)\n        // tick spacing. Limit to 10 iterations, for gregorian months it's normally <=3.\n        while(cnt < 10) {\n            t1 = axes.tickIncrement(t0, dtick, axrev, ax.calendar);\n            if((t1 - r0) * (t0 - r0) <= 0) {\n                // t1 and t0 are on opposite sides of r0! we've succeeded!\n                if(axrev) return Math.min(t0, t1);\n                return Math.max(t0, t1);\n            }\n            mult = (r0 - ((t0 + t1) / 2)) / (t1 - t0);\n            newDTick = tType + ((Math.abs(Math.round(mult)) || 1) * dtNum);\n            t0 = axes.tickIncrement(t0, newDTick, mult < 0 ? !axrev : axrev, ax.calendar);\n            cnt++;\n        }\n        Lib.error('tickFirst did not converge', ax);\n        return t0;\n    } else if(tType === 'L') {\n        // Log scales: Linear, Digits\n\n        return Math.log(sRound(\n            (Math.pow(10, r0) - tick0) / dtNum) * dtNum + tick0) / Math.LN10;\n    } else if(tType === 'D') {\n        var tickset = (dtick === 'D2') ? roundLog2 : roundLog1;\n        var frac = Lib.roundUp(Lib.mod(r0, 1), tickset, axrev);\n\n        return Math.floor(r0) +\n            Math.log(d3.round(Math.pow(10, frac), 1)) / Math.LN10;\n    } else throw 'unrecognized dtick ' + String(dtick);\n};\n\n// draw the text for one tick.\n// px,py are the location on gd.paper\n// prefix is there so the x axis ticks can be dropped a line\n// ax is the axis layout, x is the tick value\n// hover is a (truthy) flag for whether to show numbers with a bit\n// more precision for hovertext\naxes.tickText = function(ax, x, hover, noSuffixPrefix) {\n    var out = tickTextObj(ax, x);\n    var arrayMode = ax.tickmode === 'array';\n    var extraPrecision = hover || arrayMode;\n    var axType = ax.type;\n    // TODO multicategory, if we allow ticktext / tickvals\n    var tickVal2l = axType === 'category' ? ax.d2l_noadd : ax.d2l;\n    var i;\n\n    if(arrayMode && Array.isArray(ax.ticktext)) {\n        var rng = Lib.simpleMap(ax.range, ax.r2l);\n        var minDiff = (Math.abs(rng[1] - rng[0]) - (ax._lBreaks || 0)) / 10000;\n\n        for(i = 0; i < ax.ticktext.length; i++) {\n            if(Math.abs(x - tickVal2l(ax.tickvals[i])) < minDiff) break;\n        }\n        if(i < ax.ticktext.length) {\n            out.text = String(ax.ticktext[i]);\n            return out;\n        }\n    }\n\n    function isHidden(showAttr) {\n        if(showAttr === undefined) return true;\n        if(hover) return showAttr === 'none';\n\n        var firstOrLast = {\n            first: ax._tmin,\n            last: ax._tmax\n        }[showAttr];\n\n        return showAttr !== 'all' && x !== firstOrLast;\n    }\n\n    var hideexp = hover ?\n        'never' :\n        ax.exponentformat !== 'none' && isHidden(ax.showexponent) ? 'hide' : '';\n\n    if(axType === 'date') formatDate(ax, out, hover, extraPrecision);\n    else if(axType === 'log') formatLog(ax, out, hover, extraPrecision, hideexp);\n    else if(axType === 'category') formatCategory(ax, out);\n    else if(axType === 'multicategory') formatMultiCategory(ax, out, hover);\n    else if(isAngular(ax)) formatAngle(ax, out, hover, extraPrecision, hideexp);\n    else formatLinear(ax, out, hover, extraPrecision, hideexp);\n\n    // add prefix and suffix\n    if(!noSuffixPrefix) {\n        if(ax.tickprefix && !isHidden(ax.showtickprefix)) out.text = ax.tickprefix + out.text;\n        if(ax.ticksuffix && !isHidden(ax.showticksuffix)) out.text += ax.ticksuffix;\n    }\n\n    // Setup ticks and grid lines boundaries\n    // at 1/2 a 'category' to the left/bottom\n    if(ax.tickson === 'boundaries' || ax.showdividers) {\n        var inbounds = function(v) {\n            var p = ax.l2p(v);\n            return p >= 0 && p <= ax._length ? v : null;\n        };\n\n        out.xbnd = [\n            inbounds(out.x - 0.5),\n            inbounds(out.x + ax.dtick - 0.5)\n        ];\n    }\n\n    return out;\n};\n\n/**\n * create text for a hover label on this axis, with special handling of\n * log axes (where negative values can't be displayed but can appear in hover text)\n *\n * @param {object} ax: the axis to format text for\n * @param {number} val: calcdata value to format\n * @param {Optional(number)} val2: a second value to display\n *\n * @returns {string} `val` formatted as a string appropriate to this axis, or\n *     `val` and `val2` as a range (ie '<val> - <val2>') if `val2` is provided and\n *     it's different from `val`.\n */\naxes.hoverLabelText = function(ax, val, val2) {\n    if(val2 !== BADNUM && val2 !== val) {\n        return axes.hoverLabelText(ax, val) + ' - ' + axes.hoverLabelText(ax, val2);\n    }\n\n    var logOffScale = (ax.type === 'log' && val <= 0);\n    var tx = axes.tickText(ax, ax.c2l(logOffScale ? -val : val), 'hover').text;\n\n    if(logOffScale) {\n        return val === 0 ? '0' : MINUS_SIGN + tx;\n    }\n\n    // TODO: should we do something special if the axis calendar and\n    // the data calendar are different? Somehow display both dates with\n    // their system names? Right now it will just display in the axis calendar\n    // but users could add the other one as text.\n    return tx;\n};\n\nfunction tickTextObj(ax, x, text) {\n    var tf = ax.tickfont || {};\n\n    return {\n        x: x,\n        dx: 0,\n        dy: 0,\n        text: text || '',\n        fontSize: tf.size,\n        font: tf.family,\n        fontColor: tf.color\n    };\n}\n\nfunction formatDate(ax, out, hover, extraPrecision) {\n    var tr = ax._tickround;\n    var fmt = (hover && ax.hoverformat) || axes.getTickFormat(ax);\n\n    if(extraPrecision) {\n        // second or sub-second precision: extra always shows max digits.\n        // for other fields, extra precision just adds one field.\n        if(isNumeric(tr)) tr = 4;\n        else tr = {y: 'm', m: 'd', d: 'M', M: 'S', S: 4}[tr];\n    }\n\n    var dateStr = Lib.formatDate(out.x, fmt, tr, ax._dateFormat, ax.calendar, ax._extraFormat);\n    var headStr;\n\n    var splitIndex = dateStr.indexOf('\\n');\n    if(splitIndex !== -1) {\n        headStr = dateStr.substr(splitIndex + 1);\n        dateStr = dateStr.substr(0, splitIndex);\n    }\n\n    if(extraPrecision) {\n        // if extraPrecision led to trailing zeros, strip them off\n        // actually, this can lead to removing even more zeros than\n        // in the original rounding, but that's fine because in these\n        // contexts uniformity is not so important (if there's even\n        // anything to be uniform with!)\n\n        // can we remove the whole time part?\n        if(dateStr === '00:00:00' || dateStr === '00:00') {\n            dateStr = headStr;\n            headStr = '';\n        } else if(dateStr.length === 8) {\n            // strip off seconds if they're zero (zero fractional seconds\n            // are already omitted)\n            // but we never remove minutes and leave just hours\n            dateStr = dateStr.replace(/:00$/, '');\n        }\n    }\n\n    if(headStr) {\n        if(hover) {\n            // hover puts it all on one line, so headPart works best up front\n            // except for year headPart: turn this into \"Jan 1, 2000\" etc.\n            if(tr === 'd') dateStr += ', ' + headStr;\n            else dateStr = headStr + (dateStr ? ', ' + dateStr : '');\n        } else if(!ax._inCalcTicks || (headStr !== ax._prevDateHead)) {\n            dateStr += '<br>' + headStr;\n            ax._prevDateHead = headStr;\n        }\n    }\n\n    out.text = dateStr;\n}\n\nfunction formatLog(ax, out, hover, extraPrecision, hideexp) {\n    var dtick = ax.dtick;\n    var x = out.x;\n    var tickformat = ax.tickformat;\n    var dtChar0 = typeof dtick === 'string' && dtick.charAt(0);\n\n    if(hideexp === 'never') {\n        // If this is a hover label, then we must *never* hide the exponent\n        // for the sake of display, which could give the wrong value by\n        // potentially many orders of magnitude. If hideexp was 'never', then\n        // it's now succeeded by preventing the other condition from automating\n        // this choice. Thus we can unset it so that the axis formatting takes\n        // precedence.\n        hideexp = '';\n    }\n\n    if(extraPrecision && (dtChar0 !== 'L')) {\n        dtick = 'L3';\n        dtChar0 = 'L';\n    }\n\n    if(tickformat || (dtChar0 === 'L')) {\n        out.text = numFormat(Math.pow(10, x), ax, hideexp, extraPrecision);\n    } else if(isNumeric(dtick) || ((dtChar0 === 'D') && (Lib.mod(x + 0.01, 1) < 0.1))) {\n        var p = Math.round(x);\n        var absP = Math.abs(p);\n        var exponentFormat = ax.exponentformat;\n        if(exponentFormat === 'power' || (isSIFormat(exponentFormat) && beyondSI(p))) {\n            if(p === 0) out.text = 1;\n            else if(p === 1) out.text = '10';\n            else out.text = '10<sup>' + (p > 1 ? '' : MINUS_SIGN) + absP + '</sup>';\n\n            out.fontSize *= 1.25;\n        } else if((exponentFormat === 'e' || exponentFormat === 'E') && absP > 2) {\n            out.text = '1' + exponentFormat + (p > 0 ? '+' : MINUS_SIGN) + absP;\n        } else {\n            out.text = numFormat(Math.pow(10, x), ax, '', 'fakehover');\n            if(dtick === 'D1' && ax._id.charAt(0) === 'y') {\n                out.dy -= out.fontSize / 6;\n            }\n        }\n    } else if(dtChar0 === 'D') {\n        out.text = String(Math.round(Math.pow(10, Lib.mod(x, 1))));\n        out.fontSize *= 0.75;\n    } else throw 'unrecognized dtick ' + String(dtick);\n\n    // if 9's are printed on log scale, move the 10's away a bit\n    if(ax.dtick === 'D1') {\n        var firstChar = String(out.text).charAt(0);\n        if(firstChar === '0' || firstChar === '1') {\n            if(ax._id.charAt(0) === 'y') {\n                out.dx -= out.fontSize / 4;\n            } else {\n                out.dy += out.fontSize / 2;\n                out.dx += (ax.range[1] > ax.range[0] ? 1 : -1) *\n                    out.fontSize * (x < 0 ? 0.5 : 0.25);\n            }\n        }\n    }\n}\n\nfunction formatCategory(ax, out) {\n    var tt = ax._categories[Math.round(out.x)];\n    if(tt === undefined) tt = '';\n    out.text = String(tt);\n}\n\nfunction formatMultiCategory(ax, out, hover) {\n    var v = Math.round(out.x);\n    var cats = ax._categories[v] || [];\n    var tt = cats[1] === undefined ? '' : String(cats[1]);\n    var tt2 = cats[0] === undefined ? '' : String(cats[0]);\n\n    if(hover) {\n        // TODO is this what we want?\n        out.text = tt2 + ' - ' + tt;\n    } else {\n        // setup for secondary labels\n        out.text = tt;\n        out.text2 = tt2;\n    }\n}\n\nfunction formatLinear(ax, out, hover, extraPrecision, hideexp) {\n    if(hideexp === 'never') {\n        // If this is a hover label, then we must *never* hide the exponent\n        // for the sake of display, which could give the wrong value by\n        // potentially many orders of magnitude. If hideexp was 'never', then\n        // it's now succeeded by preventing the other condition from automating\n        // this choice. Thus we can unset it so that the axis formatting takes\n        // precedence.\n        hideexp = '';\n    } else if(ax.showexponent === 'all' && Math.abs(out.x / ax.dtick) < 1e-6) {\n        // don't add an exponent to zero if we're showing all exponents\n        // so the only reason you'd show an exponent on zero is if it's the\n        // ONLY tick to get an exponent (first or last)\n        hideexp = 'hide';\n    }\n    out.text = numFormat(out.x, ax, hideexp, extraPrecision);\n}\n\nfunction formatAngle(ax, out, hover, extraPrecision, hideexp) {\n    if(ax.thetaunit === 'radians' && !hover) {\n        var num = out.x / 180;\n\n        if(num === 0) {\n            out.text = '0';\n        } else {\n            var frac = num2frac(num);\n\n            if(frac[1] >= 100) {\n                out.text = numFormat(Lib.deg2rad(out.x), ax, hideexp, extraPrecision);\n            } else {\n                var isNeg = out.x < 0;\n\n                if(frac[1] === 1) {\n                    if(frac[0] === 1) out.text = 'π';\n                    else out.text = frac[0] + 'π';\n                } else {\n                    out.text = [\n                        '<sup>', frac[0], '</sup>',\n                        '⁄',\n                        '<sub>', frac[1], '</sub>',\n                        'π'\n                    ].join('');\n                }\n\n                if(isNeg) out.text = MINUS_SIGN + out.text;\n            }\n        }\n    } else {\n        out.text = numFormat(out.x, ax, hideexp, extraPrecision);\n    }\n}\n\n// inspired by\n// https://github.com/yisibl/num2fraction/blob/master/index.js\nfunction num2frac(num) {\n    function almostEq(a, b) {\n        return Math.abs(a - b) <= 1e-6;\n    }\n\n    function findGCD(a, b) {\n        return almostEq(b, 0) ? a : findGCD(b, a % b);\n    }\n\n    function findPrecision(n) {\n        var e = 1;\n        while(!almostEq(Math.round(n * e) / e, n)) {\n            e *= 10;\n        }\n        return e;\n    }\n\n    var precision = findPrecision(num);\n    var number = num * precision;\n    var gcd = Math.abs(findGCD(number, precision));\n\n    return [\n        // numerator\n        Math.round(number / gcd),\n        // denominator\n        Math.round(precision / gcd)\n    ];\n}\n\n// format a number (tick value) according to the axis settings\n// new, more reliable procedure than d3.round or similar:\n// add half the rounding increment, then stringify and truncate\n// also automatically switch to sci. notation\nvar SIPREFIXES = ['f', 'p', 'n', 'μ', 'm', '', 'k', 'M', 'G', 'T'];\n\nfunction isSIFormat(exponentFormat) {\n    return exponentFormat === 'SI' || exponentFormat === 'B';\n}\n\n// are we beyond the range of common SI prefixes?\n// 10^-16 -> 1x10^-16\n// 10^-15 -> 1f\n// ...\n// 10^14 -> 100T\n// 10^15 -> 1x10^15\n// 10^16 -> 1x10^16\nfunction beyondSI(exponent) {\n    return exponent > 14 || exponent < -15;\n}\n\nfunction numFormat(v, ax, fmtoverride, hover) {\n    var isNeg = v < 0;\n    // max number of digits past decimal point to show\n    var tickRound = ax._tickround;\n    var exponentFormat = fmtoverride || ax.exponentformat || 'B';\n    var exponent = ax._tickexponent;\n    var tickformat = axes.getTickFormat(ax);\n    var separatethousands = ax.separatethousands;\n\n    // special case for hover: set exponent just for this value, and\n    // add a couple more digits of precision over tick labels\n    if(hover) {\n        // make a dummy axis obj to get the auto rounding and exponent\n        var ah = {\n            exponentformat: exponentFormat,\n            dtick: ax.showexponent === 'none' ? ax.dtick :\n                (isNumeric(v) ? Math.abs(v) || 1 : 1),\n            // if not showing any exponents, don't change the exponent\n            // from what we calculate\n            range: ax.showexponent === 'none' ? ax.range.map(ax.r2d) : [0, v || 1]\n        };\n        autoTickRound(ah);\n        tickRound = (Number(ah._tickround) || 0) + 4;\n        exponent = ah._tickexponent;\n        if(ax.hoverformat) tickformat = ax.hoverformat;\n    }\n\n    if(tickformat) return ax._numFormat(tickformat)(v).replace(/-/g, MINUS_SIGN);\n\n    // 'epsilon' - rounding increment\n    var e = Math.pow(10, -tickRound) / 2;\n\n    // exponentFormat codes:\n    // 'e' (1.2e+6, default)\n    // 'E' (1.2E+6)\n    // 'SI' (1.2M)\n    // 'B' (same as SI except 10^9=B not G)\n    // 'none' (1200000)\n    // 'power' (1.2x10^6)\n    // 'hide' (1.2, use 3rd argument=='hide' to eg\n    //      only show exponent on last tick)\n    if(exponentFormat === 'none') exponent = 0;\n\n    // take the sign out, put it back manually at the end\n    // - makes cases easier\n    v = Math.abs(v);\n    if(v < e) {\n        // 0 is just 0, but may get exponent if it's the last tick\n        v = '0';\n        isNeg = false;\n    } else {\n        v += e;\n        // take out a common exponent, if any\n        if(exponent) {\n            v *= Math.pow(10, -exponent);\n            tickRound += exponent;\n        }\n        // round the mantissa\n        if(tickRound === 0) v = String(Math.floor(v));\n        else if(tickRound < 0) {\n            v = String(Math.round(v));\n            v = v.substr(0, v.length + tickRound);\n            for(var i = tickRound; i < 0; i++) v += '0';\n        } else {\n            v = String(v);\n            var dp = v.indexOf('.') + 1;\n            if(dp) v = v.substr(0, dp + tickRound).replace(/\\.?0+$/, '');\n        }\n        // insert appropriate decimal point and thousands separator\n        v = Lib.numSeparate(v, ax._separators, separatethousands);\n    }\n\n    // add exponent\n    if(exponent && exponentFormat !== 'hide') {\n        if(isSIFormat(exponentFormat) && beyondSI(exponent)) exponentFormat = 'power';\n\n        var signedExponent;\n        if(exponent < 0) signedExponent = MINUS_SIGN + -exponent;\n        else if(exponentFormat !== 'power') signedExponent = '+' + exponent;\n        else signedExponent = String(exponent);\n\n        if(exponentFormat === 'e' || exponentFormat === 'E') {\n            v += exponentFormat + signedExponent;\n        } else if(exponentFormat === 'power') {\n            v += '×10<sup>' + signedExponent + '</sup>';\n        } else if(exponentFormat === 'B' && exponent === 9) {\n            v += 'B';\n        } else if(isSIFormat(exponentFormat)) {\n            v += SIPREFIXES[exponent / 3 + 5];\n        }\n    }\n\n    // put sign back in and return\n    // replace standard minus character (which is technically a hyphen)\n    // with a true minus sign\n    if(isNeg) return MINUS_SIGN + v;\n    return v;\n}\n\naxes.getTickFormat = function(ax) {\n    var i;\n\n    function convertToMs(dtick) {\n        return typeof dtick !== 'string' ? dtick : Number(dtick.replace('M', '')) * ONEAVGMONTH;\n    }\n\n    function compareLogTicks(left, right) {\n        var priority = ['L', 'D'];\n        if(typeof left === typeof right) {\n            if(typeof left === 'number') {\n                return left - right;\n            } else {\n                var leftPriority = priority.indexOf(left.charAt(0));\n                var rightPriority = priority.indexOf(right.charAt(0));\n                if(leftPriority === rightPriority) {\n                    return Number(left.replace(/(L|D)/g, '')) - Number(right.replace(/(L|D)/g, ''));\n                } else {\n                    return leftPriority - rightPriority;\n                }\n            }\n        } else {\n            return typeof left === 'number' ? 1 : -1;\n        }\n    }\n\n    function isProperStop(dtick, range, convert) {\n        var convertFn = convert || function(x) { return x;};\n        var leftDtick = range[0];\n        var rightDtick = range[1];\n        return ((!leftDtick && typeof leftDtick !== 'number') || convertFn(leftDtick) <= convertFn(dtick)) &&\n               ((!rightDtick && typeof rightDtick !== 'number') || convertFn(rightDtick) >= convertFn(dtick));\n    }\n\n    function isProperLogStop(dtick, range) {\n        var isLeftDtickNull = range[0] === null;\n        var isRightDtickNull = range[1] === null;\n        var isDtickInRangeLeft = compareLogTicks(dtick, range[0]) >= 0;\n        var isDtickInRangeRight = compareLogTicks(dtick, range[1]) <= 0;\n        return (isLeftDtickNull || isDtickInRangeLeft) && (isRightDtickNull || isDtickInRangeRight);\n    }\n\n    var tickstop, stopi;\n    if(ax.tickformatstops && ax.tickformatstops.length > 0) {\n        switch(ax.type) {\n            case 'date':\n            case 'linear': {\n                for(i = 0; i < ax.tickformatstops.length; i++) {\n                    stopi = ax.tickformatstops[i];\n                    if(stopi.enabled && isProperStop(ax.dtick, stopi.dtickrange, convertToMs)) {\n                        tickstop = stopi;\n                        break;\n                    }\n                }\n                break;\n            }\n            case 'log': {\n                for(i = 0; i < ax.tickformatstops.length; i++) {\n                    stopi = ax.tickformatstops[i];\n                    if(stopi.enabled && isProperLogStop(ax.dtick, stopi.dtickrange)) {\n                        tickstop = stopi;\n                        break;\n                    }\n                }\n                break;\n            }\n            default:\n        }\n    }\n    return tickstop ? tickstop.value : ax.tickformat;\n};\n\n// getSubplots - extract all subplot IDs we need\n// as an array of items like 'xy', 'x2y', 'x2y2'...\n// sorted by x (x,x2,x3...) then y\n// optionally restrict to only subplots containing axis object ax\n//\n// NOTE: this is currently only used OUTSIDE plotly.js (toolpanel, webapp)\n// ideally we get rid of it there (or just copy this there) and remove it here\naxes.getSubplots = function(gd, ax) {\n    var subplotObj = gd._fullLayout._subplots;\n    var allSubplots = subplotObj.cartesian.concat(subplotObj.gl2d || []);\n\n    var out = ax ? axes.findSubplotsWithAxis(allSubplots, ax) : allSubplots;\n\n    out.sort(function(a, b) {\n        var aParts = a.substr(1).split('y');\n        var bParts = b.substr(1).split('y');\n\n        if(aParts[0] === bParts[0]) return +aParts[1] - +bParts[1];\n        return +aParts[0] - +bParts[0];\n    });\n\n    return out;\n};\n\n// find all subplots with axis 'ax'\n// NOTE: this is only used in axes.getSubplots (only used outside plotly.js) and\n// gl2d/convert (where it restricts axis subplots to only those with gl2d)\naxes.findSubplotsWithAxis = function(subplots, ax) {\n    var axMatch = new RegExp(\n        (ax._id.charAt(0) === 'x') ? ('^' + ax._id + 'y') : (ax._id + '$')\n    );\n    var subplotsWithAx = [];\n\n    for(var i = 0; i < subplots.length; i++) {\n        var sp = subplots[i];\n        if(axMatch.test(sp)) subplotsWithAx.push(sp);\n    }\n\n    return subplotsWithAx;\n};\n\n// makeClipPaths: prepare clipPaths for all single axes and all possible xy pairings\naxes.makeClipPaths = function(gd) {\n    var fullLayout = gd._fullLayout;\n\n    // for more info: https://github.com/plotly/plotly.js/issues/2595\n    if(fullLayout._hasOnlyLargeSploms) return;\n\n    var fullWidth = {_offset: 0, _length: fullLayout.width, _id: ''};\n    var fullHeight = {_offset: 0, _length: fullLayout.height, _id: ''};\n    var xaList = axes.list(gd, 'x', true);\n    var yaList = axes.list(gd, 'y', true);\n    var clipList = [];\n    var i, j;\n\n    for(i = 0; i < xaList.length; i++) {\n        clipList.push({x: xaList[i], y: fullHeight});\n        for(j = 0; j < yaList.length; j++) {\n            if(i === 0) clipList.push({x: fullWidth, y: yaList[j]});\n            clipList.push({x: xaList[i], y: yaList[j]});\n        }\n    }\n\n    // selectors don't work right with camelCase tags,\n    // have to use class instead\n    // https://groups.google.com/forum/#!topic/d3-js/6EpAzQ2gU9I\n    var axClips = fullLayout._clips.selectAll('.axesclip')\n        .data(clipList, function(d) { return d.x._id + d.y._id; });\n\n    axClips.enter().append('clipPath')\n        .classed('axesclip', true)\n        .attr('id', function(d) { return 'clip' + fullLayout._uid + d.x._id + d.y._id; })\n      .append('rect');\n\n    axClips.exit().remove();\n\n    axClips.each(function(d) {\n        d3.select(this).select('rect').attr({\n            x: d.x._offset || 0,\n            y: d.y._offset || 0,\n            width: d.x._length || 1,\n            height: d.y._length || 1\n        });\n    });\n};\n\n/**\n * Main multi-axis drawing routine!\n *\n * @param {DOM element} gd : graph div\n * @param {string or array of strings} arg : polymorphic argument\n * @param {object} opts:\n * - @param {boolean} skipTitle : optional flag to skip axis title draw/update\n *\n * Signature 1: Axes.draw(gd, 'redraw')\n *   use this to clear and redraw all axes on graph\n *\n * Signature 2: Axes.draw(gd, '')\n *   use this to draw all axes on graph w/o the selectAll().remove()\n *   of the 'redraw' signature\n *\n * Signature 3: Axes.draw(gd, [axId, axId2, ...])\n *   where the items are axis id string,\n *   use this to update multiple axes in one call\n *\n * N.B draw updates:\n * - ax._r (stored range for use by zoom/pan)\n * - ax._rl (stored linearized range for use by zoom/pan)\n */\naxes.draw = function(gd, arg, opts) {\n    var fullLayout = gd._fullLayout;\n\n    if(arg === 'redraw') {\n        fullLayout._paper.selectAll('g.subplot').each(function(d) {\n            var id = d[0];\n            var plotinfo = fullLayout._plots[id];\n            var xa = plotinfo.xaxis;\n            var ya = plotinfo.yaxis;\n\n            plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick').remove();\n            plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick').remove();\n            plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick2').remove();\n            plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick2').remove();\n            plotinfo.xaxislayer.selectAll('.' + xa._id + 'divider').remove();\n            plotinfo.yaxislayer.selectAll('.' + ya._id + 'divider').remove();\n\n            if(plotinfo.gridlayer) plotinfo.gridlayer.selectAll('path').remove();\n            if(plotinfo.zerolinelayer) plotinfo.zerolinelayer.selectAll('path').remove();\n\n            fullLayout._infolayer.select('.g-' + xa._id + 'title').remove();\n            fullLayout._infolayer.select('.g-' + ya._id + 'title').remove();\n        });\n    }\n\n    var axList = (!arg || arg === 'redraw') ? axes.listIds(gd) : arg;\n\n    return Lib.syncOrAsync(axList.map(function(axId) {\n        return function() {\n            if(!axId) return;\n\n            var ax = axes.getFromId(gd, axId);\n            var axDone = axes.drawOne(gd, ax, opts);\n\n            ax._r = ax.range.slice();\n            ax._rl = Lib.simpleMap(ax._r, ax.r2l);\n\n            return axDone;\n        };\n    }));\n};\n\n/**\n * Draw one cartesian axis\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * @param {object} opts\n * - @param {boolean} skipTitle (set to true to skip axis title draw call)\n *\n * Depends on:\n * - ax._mainSubplot (from linkSubplots)\n * - ax._mainAxis\n * - ax._anchorAxis\n * - ax._subplotsWith\n * - ax._counterDomainMin, ax._counterDomainMax (optionally, from linkSubplots)\n * - ax._tickAngles (on redraw only, old value relinked during supplyDefaults)\n * - ax._mainLinePosition (from lsInner)\n * - ax._mainMirrorPosition\n * - ax._linepositions\n *\n * Fills in:\n * - ax._vals:\n * - ax._gridVals:\n * - ax._selections:\n * - ax._tickAngles:\n * - ax._depth (when required only):\n * - and calls ax.setScale\n */\naxes.drawOne = function(gd, ax, opts) {\n    opts = opts || {};\n\n    var i, sp, plotinfo;\n\n    ax.setScale();\n\n    var fullLayout = gd._fullLayout;\n    var axId = ax._id;\n    var axLetter = axId.charAt(0);\n    var counterLetter = axes.counterLetter(axId);\n    var mainPlotinfo = fullLayout._plots[ax._mainSubplot];\n\n    // this happens when updating matched group with 'missing' axes\n    if(!mainPlotinfo) return;\n\n    var mainAxLayer = mainPlotinfo[axLetter + 'axislayer'];\n    var mainLinePosition = ax._mainLinePosition;\n    var mainMirrorPosition = ax._mainMirrorPosition;\n\n    var vals = ax._vals = axes.calcTicks(ax);\n\n    // Add a couple of axis properties that should cause us to recreate\n    // elements. Used in d3 data function.\n    var axInfo = [ax.mirror, mainLinePosition, mainMirrorPosition].join('_');\n    for(i = 0; i < vals.length; i++) {\n        vals[i].axInfo = axInfo;\n    }\n\n    // stash selections to avoid DOM queries e.g.\n    // - stash tickLabels selection, so that drawTitle can use it to scoot title\n    ax._selections = {};\n    // stash tick angle (including the computed 'auto' values) per tick-label class\n    // linkup 'previous' tick angles on redraws\n    if(ax._tickAngles) ax._prevTickAngles = ax._tickAngles;\n    ax._tickAngles = {};\n    // measure [in px] between axis position and outward-most part of bounding box\n    // (touching either the tick label or ticks)\n    // depth can be expansive to compute, so we only do so when required\n    ax._depth = null;\n\n    // calcLabelLevelBbox can be expensive,\n    // so make sure to not call it twice during the same Axes.drawOne call\n    // by stashing label-level bounding boxes per tick-label class\n    var llbboxes = {};\n    function getLabelLevelBbox(suffix) {\n        var cls = axId + (suffix || 'tick');\n        if(!llbboxes[cls]) llbboxes[cls] = calcLabelLevelBbox(ax, cls);\n        return llbboxes[cls];\n    }\n\n    if(!ax.visible) return;\n\n    var transFn = axes.makeTransFn(ax);\n    var tickVals;\n    // We remove zero lines, grid lines, and inside ticks if they're within 1px of the end\n    // The key case here is removing zero lines when the axis bound is zero\n    var valsClipped;\n\n    if(ax.tickson === 'boundaries') {\n        var boundaryVals = getBoundaryVals(ax, vals);\n        valsClipped = axes.clipEnds(ax, boundaryVals);\n        tickVals = ax.ticks === 'inside' ? valsClipped : boundaryVals;\n    } else {\n        valsClipped = axes.clipEnds(ax, vals);\n        tickVals = ax.ticks === 'inside' ? valsClipped : vals;\n    }\n\n    var gridVals = ax._gridVals = valsClipped;\n    var dividerVals = getDividerVals(ax, vals);\n\n    if(!fullLayout._hasOnlyLargeSploms) {\n        var subplotsWithAx = ax._subplotsWith;\n\n        // keep track of which subplots (by main counter axis) we've already\n        // drawn grids for, so we don't overdraw overlaying subplots\n        var finishedGrids = {};\n\n        for(i = 0; i < subplotsWithAx.length; i++) {\n            sp = subplotsWithAx[i];\n            plotinfo = fullLayout._plots[sp];\n\n            var counterAxis = plotinfo[counterLetter + 'axis'];\n            var mainCounterID = counterAxis._mainAxis._id;\n            if(finishedGrids[mainCounterID]) continue;\n            finishedGrids[mainCounterID] = 1;\n\n            var gridPath = axLetter === 'x' ?\n                'M0,' + counterAxis._offset + 'v' + counterAxis._length :\n                'M' + counterAxis._offset + ',0h' + counterAxis._length;\n\n            axes.drawGrid(gd, ax, {\n                vals: gridVals,\n                counterAxis: counterAxis,\n                layer: plotinfo.gridlayer.select('.' + axId),\n                path: gridPath,\n                transFn: transFn\n            });\n            axes.drawZeroLine(gd, ax, {\n                counterAxis: counterAxis,\n                layer: plotinfo.zerolinelayer,\n                path: gridPath,\n                transFn: transFn\n            });\n        }\n    }\n\n    var tickSigns = axes.getTickSigns(ax);\n    var tickSubplots = [];\n\n    if(ax.ticks) {\n        var mainTickPath = axes.makeTickPath(ax, mainLinePosition, tickSigns[2]);\n        var mirrorTickPath;\n        var fullTickPath;\n        if(ax._anchorAxis && ax.mirror && ax.mirror !== true) {\n            mirrorTickPath = axes.makeTickPath(ax, mainMirrorPosition, tickSigns[3]);\n            fullTickPath = mainTickPath + mirrorTickPath;\n        } else {\n            mirrorTickPath = '';\n            fullTickPath = mainTickPath;\n        }\n\n        var tickPath;\n        if(ax.showdividers && ax.ticks === 'outside' && ax.tickson === 'boundaries') {\n            var dividerLookup = {};\n            for(i = 0; i < dividerVals.length; i++) {\n                dividerLookup[dividerVals[i].x] = 1;\n            }\n            tickPath = function(d) {\n                return dividerLookup[d.x] ? mirrorTickPath : fullTickPath;\n            };\n        } else {\n            tickPath = fullTickPath;\n        }\n\n        axes.drawTicks(gd, ax, {\n            vals: tickVals,\n            layer: mainAxLayer,\n            path: tickPath,\n            transFn: transFn\n        });\n\n        if(ax.mirror === 'allticks') {\n            tickSubplots = Object.keys(ax._linepositions || {});\n        }\n    }\n\n    for(i = 0; i < tickSubplots.length; i++) {\n        sp = tickSubplots[i];\n        plotinfo = fullLayout._plots[sp];\n        // [bottom or left, top or right], free and main are handled above\n        var linepositions = ax._linepositions[sp] || [];\n        var spTickPath = axes.makeTickPath(ax, linepositions[0], tickSigns[0]) +\n            axes.makeTickPath(ax, linepositions[1], tickSigns[1]);\n\n        axes.drawTicks(gd, ax, {\n            vals: tickVals,\n            layer: plotinfo[axLetter + 'axislayer'],\n            path: spTickPath,\n            transFn: transFn\n        });\n    }\n\n    var seq = [];\n\n    // tick labels - for now just the main labels.\n    // TODO: mirror labels, esp for subplots\n\n    seq.push(function() {\n        return axes.drawLabels(gd, ax, {\n            vals: vals,\n            layer: mainAxLayer,\n            transFn: transFn,\n            labelFns: axes.makeLabelFns(ax, mainLinePosition)\n        });\n    });\n\n    if(ax.type === 'multicategory') {\n        var pad = {x: 2, y: 10}[axLetter];\n\n        seq.push(function() {\n            var bboxKey = {x: 'height', y: 'width'}[axLetter];\n            var standoff = getLabelLevelBbox()[bboxKey] + pad +\n                (ax._tickAngles[axId + 'tick'] ? ax.tickfont.size * LINE_SPACING : 0);\n\n            return axes.drawLabels(gd, ax, {\n                vals: getSecondaryLabelVals(ax, vals),\n                layer: mainAxLayer,\n                cls: axId + 'tick2',\n                repositionOnUpdate: true,\n                secondary: true,\n                transFn: transFn,\n                labelFns: axes.makeLabelFns(ax, mainLinePosition + standoff * tickSigns[4])\n            });\n        });\n\n        seq.push(function() {\n            ax._depth = tickSigns[4] * (getLabelLevelBbox('tick2')[ax.side] - mainLinePosition);\n\n            return drawDividers(gd, ax, {\n                vals: dividerVals,\n                layer: mainAxLayer,\n                path: axes.makeTickPath(ax, mainLinePosition, tickSigns[4], ax._depth),\n                transFn: transFn\n            });\n        });\n    } else if(ax.title.hasOwnProperty('standoff')) {\n        seq.push(function() {\n            ax._depth = tickSigns[4] * (getLabelLevelBbox()[ax.side] - mainLinePosition);\n        });\n    }\n\n    var hasRangeSlider = Registry.getComponentMethod('rangeslider', 'isVisible')(ax);\n\n    seq.push(function() {\n        var s = ax.side.charAt(0);\n        var sMirror = OPPOSITE_SIDE[ax.side].charAt(0);\n        var pos = axes.getPxPosition(gd, ax);\n        var outsideTickLen = ax.ticks === 'outside' ? ax.ticklen : 0;\n        var llbbox;\n\n        var push;\n        var mirrorPush;\n        var rangeSliderPush;\n\n        if(ax.automargin || hasRangeSlider) {\n            if(ax.type === 'multicategory') {\n                llbbox = getLabelLevelBbox('tick2');\n            } else {\n                llbbox = getLabelLevelBbox();\n                if(axLetter === 'x' && s === 'b') {\n                    ax._depth = Math.max(llbbox.width > 0 ? llbbox.bottom - pos : 0, outsideTickLen);\n                }\n            }\n        }\n\n        if(ax.automargin) {\n            push = {x: 0, y: 0, r: 0, l: 0, t: 0, b: 0};\n            var domainIndices = [0, 1];\n\n            if(axLetter === 'x') {\n                if(s === 'b') {\n                    push[s] = ax._depth;\n                } else {\n                    push[s] = ax._depth = Math.max(llbbox.width > 0 ? pos - llbbox.top : 0, outsideTickLen);\n                    domainIndices.reverse();\n                }\n\n                if(llbbox.width > 0) {\n                    var rExtra = llbbox.right - (ax._offset + ax._length);\n                    if(rExtra > 0) {\n                        push.xr = 1;\n                        push.r = rExtra;\n                    }\n                    var lExtra = ax._offset - llbbox.left;\n                    if(lExtra > 0) {\n                        push.xl = 0;\n                        push.l = lExtra;\n                    }\n                }\n            } else {\n                if(s === 'l') {\n                    push[s] = ax._depth = Math.max(llbbox.height > 0 ? pos - llbbox.left : 0, outsideTickLen);\n                } else {\n                    push[s] = ax._depth = Math.max(llbbox.height > 0 ? llbbox.right - pos : 0, outsideTickLen);\n                    domainIndices.reverse();\n                }\n\n                if(llbbox.height > 0) {\n                    var bExtra = llbbox.bottom - (ax._offset + ax._length);\n                    if(bExtra > 0) {\n                        push.yb = 0;\n                        push.b = bExtra;\n                    }\n                    var tExtra = ax._offset - llbbox.top;\n                    if(tExtra > 0) {\n                        push.yt = 1;\n                        push.t = tExtra;\n                    }\n                }\n            }\n\n            push[counterLetter] = ax.anchor === 'free' ?\n                ax.position :\n                ax._anchorAxis.domain[domainIndices[0]];\n\n            if(ax.title.text !== fullLayout._dfltTitle[axLetter]) {\n                push[s] += approxTitleDepth(ax) + (ax.title.standoff || 0);\n            }\n\n            if(ax.mirror && ax.anchor !== 'free') {\n                mirrorPush = {x: 0, y: 0, r: 0, l: 0, t: 0, b: 0};\n\n                mirrorPush[sMirror] = ax.linewidth;\n                if(ax.mirror && ax.mirror !== true) mirrorPush[sMirror] += outsideTickLen;\n\n                if(ax.mirror === true || ax.mirror === 'ticks') {\n                    mirrorPush[counterLetter] = ax._anchorAxis.domain[domainIndices[1]];\n                } else if(ax.mirror === 'all' || ax.mirror === 'allticks') {\n                    mirrorPush[counterLetter] = [ax._counterDomainMin, ax._counterDomainMax][domainIndices[1]];\n                }\n            }\n        }\n\n        if(hasRangeSlider) {\n            rangeSliderPush = Registry.getComponentMethod('rangeslider', 'autoMarginOpts')(gd, ax);\n        }\n\n        Plots.autoMargin(gd, axAutoMarginID(ax), push);\n        Plots.autoMargin(gd, axMirrorAutoMarginID(ax), mirrorPush);\n        Plots.autoMargin(gd, rangeSliderAutoMarginID(ax), rangeSliderPush);\n    });\n\n    if(!opts.skipTitle &&\n        !(hasRangeSlider && ax.side === 'bottom')\n    ) {\n        seq.push(function() { return drawTitle(gd, ax); });\n    }\n\n    return Lib.syncOrAsync(seq);\n};\n\nfunction getBoundaryVals(ax, vals) {\n    var out = [];\n    var i;\n\n    // boundaryVals are never used for labels;\n    // no need to worry about the other tickTextObj keys\n    var _push = function(d, bndIndex) {\n        var xb = d.xbnd[bndIndex];\n        if(xb !== null) {\n            out.push(Lib.extendFlat({}, d, {x: xb}));\n        }\n    };\n\n    if(vals.length) {\n        for(i = 0; i < vals.length; i++) {\n            _push(vals[i], 0);\n        }\n        _push(vals[i - 1], 1);\n    }\n\n    return out;\n}\n\nfunction getSecondaryLabelVals(ax, vals) {\n    var out = [];\n    var lookup = {};\n\n    for(var i = 0; i < vals.length; i++) {\n        var d = vals[i];\n        if(lookup[d.text2]) {\n            lookup[d.text2].push(d.x);\n        } else {\n            lookup[d.text2] = [d.x];\n        }\n    }\n\n    for(var k in lookup) {\n        out.push(tickTextObj(ax, Lib.interp(lookup[k], 0.5), k));\n    }\n\n    return out;\n}\n\nfunction getDividerVals(ax, vals) {\n    var out = [];\n    var i, current;\n\n    var reversed = (vals.length && vals[vals.length - 1].x < vals[0].x);\n\n    // never used for labels;\n    // no need to worry about the other tickTextObj keys\n    var _push = function(d, bndIndex) {\n        var xb = d.xbnd[bndIndex];\n        if(xb !== null) {\n            out.push(Lib.extendFlat({}, d, {x: xb}));\n        }\n    };\n\n    if(ax.showdividers && vals.length) {\n        for(i = 0; i < vals.length; i++) {\n            var d = vals[i];\n            if(d.text2 !== current) {\n                _push(d, reversed ? 1 : 0);\n            }\n            current = d.text2;\n        }\n        _push(vals[i - 1], reversed ? 0 : 1);\n    }\n\n    return out;\n}\n\nfunction calcLabelLevelBbox(ax, cls) {\n    var top, bottom;\n    var left, right;\n\n    if(ax._selections[cls].size()) {\n        top = Infinity;\n        bottom = -Infinity;\n        left = Infinity;\n        right = -Infinity;\n        ax._selections[cls].each(function() {\n            var thisLabel = selectTickLabel(this);\n            // Use parent node <g.(x|y)tick>, to make Drawing.bBox\n            // retrieve a bbox computed with transform info\n            //\n            // To improve perf, it would be nice to use `thisLabel.node()`\n            // (like in fixLabelOverlaps) instead and use Axes.getPxPosition\n            // together with the makeLabelFns outputs and `tickangle`\n            // to compute one bbox per (tick value x tick style)\n            var bb = Drawing.bBox(thisLabel.node().parentNode);\n            top = Math.min(top, bb.top);\n            bottom = Math.max(bottom, bb.bottom);\n            left = Math.min(left, bb.left);\n            right = Math.max(right, bb.right);\n        });\n    } else {\n        top = 0;\n        bottom = 0;\n        left = 0;\n        right = 0;\n    }\n\n    return {\n        top: top,\n        bottom: bottom,\n        left: left,\n        right: right,\n        height: bottom - top,\n        width: right - left\n    };\n}\n\n/**\n * Which direction do the 'ax.side' values, and free ticks go?\n *\n * @param {object} ax (full) axis object\n *  - {string} _id (starting with 'x' or 'y')\n *  - {string} side\n *  - {string} ticks\n * @return {array} all entries are either -1 or 1\n *  - [0]: sign for top/right ticks (i.e. negative SVG direction)\n *  - [1]: sign for bottom/left ticks (i.e. positive SVG direction)\n *  - [2]: sign for ticks corresponding to 'ax.side'\n *  - [3]: sign for ticks mirroring 'ax.side'\n *  - [4]: sign of arrow starting at axis pointing towards margin\n */\naxes.getTickSigns = function(ax) {\n    var axLetter = ax._id.charAt(0);\n    var sideOpposite = {x: 'top', y: 'right'}[axLetter];\n    var main = ax.side === sideOpposite ? 1 : -1;\n    var out = [-1, 1, main, -main];\n    // then we flip if outside XOR y axis\n    if((ax.ticks !== 'inside') === (axLetter === 'x')) {\n        out = out.map(function(v) { return -v; });\n    }\n    // independent of `ticks`; do not flip this one\n    if(ax.side) {\n        out.push({l: -1, t: -1, r: 1, b: 1}[ax.side.charAt(0)]);\n    }\n    return out;\n};\n\n/**\n * Make axis translate transform function\n *\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {number} _offset\n *  - {fn} l2p\n * @return {fn} function of calcTicks items\n */\naxes.makeTransFn = function(ax) {\n    var axLetter = ax._id.charAt(0);\n    var offset = ax._offset;\n    return axLetter === 'x' ?\n        function(d) { return 'translate(' + (offset + ax.l2p(d.x)) + ',0)'; } :\n        function(d) { return 'translate(0,' + (offset + ax.l2p(d.x)) + ')'; };\n};\n\n/**\n * Make axis tick path string\n *\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {number} ticklen\n *  - {number} linewidth\n * @param {number} shift along direction of ticklen\n * @param {1 or -1} sgn tick sign\n * @param {number (optional)} len tick length\n * @return {string}\n */\naxes.makeTickPath = function(ax, shift, sgn, len) {\n    len = len !== undefined ? len : ax.ticklen;\n\n    var axLetter = ax._id.charAt(0);\n    var pad = (ax.linewidth || 1) / 2;\n\n    return axLetter === 'x' ?\n        'M0,' + (shift + pad * sgn) + 'v' + (len * sgn) :\n        'M' + (shift + pad * sgn) + ',0h' + (len * sgn);\n};\n\n/**\n * Make axis tick label x, y and anchor functions\n *\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {string} ticks\n *  - {number} ticklen\n *  - {string} side\n *  - {number} linewidth\n *  - {number} tickfont.size\n *  - {boolean} showline\n * @param {number} shift\n * @param {number} angle [in degrees] ...\n * @return {object}\n *  - {fn} xFn\n *  - {fn} yFn\n *  - {fn} anchorFn\n *  - {fn} heightFn\n *  - {number} labelStandoff (gap parallel to ticks)\n *  - {number} labelShift (gap perpendicular to ticks)\n */\naxes.makeLabelFns = function(ax, shift, angle) {\n    var axLetter = ax._id.charAt(0);\n    var ticksOnOutsideLabels = ax.tickson !== 'boundaries' && ax.ticks === 'outside';\n\n    var labelStandoff = 0;\n    var labelShift = 0;\n\n    if(ticksOnOutsideLabels) {\n        labelStandoff += ax.ticklen;\n    }\n    if(angle && ax.ticks === 'outside') {\n        var rad = Lib.deg2rad(angle);\n        labelStandoff = ax.ticklen * Math.cos(rad) + 1;\n        labelShift = ax.ticklen * Math.sin(rad);\n    }\n    if(ax.showticklabels && (ticksOnOutsideLabels || ax.showline)) {\n        labelStandoff += 0.2 * ax.tickfont.size;\n    }\n    labelStandoff += (ax.linewidth || 1) / 2;\n\n    var out = {\n        labelStandoff: labelStandoff,\n        labelShift: labelShift\n    };\n\n    var x0, y0, ff, flipIt;\n\n    if(axLetter === 'x') {\n        flipIt = ax.side === 'bottom' ? 1 : -1;\n        x0 = labelShift * flipIt;\n        y0 = shift + labelStandoff * flipIt;\n        ff = ax.side === 'bottom' ? 1 : -0.2;\n\n        out.xFn = function(d) { return d.dx + x0; };\n        out.yFn = function(d) { return d.dy + y0 + d.fontSize * ff; };\n        out.anchorFn = function(d, a) {\n            if(!isNumeric(a) || a === 0 || a === 180) {\n                return 'middle';\n            }\n            return (a * flipIt < 0) ? 'end' : 'start';\n        };\n        out.heightFn = function(d, a, h) {\n            return (a < -60 || a > 60) ? -0.5 * h :\n                ax.side === 'top' ? -h :\n                0;\n        };\n    } else if(axLetter === 'y') {\n        flipIt = ax.side === 'right' ? 1 : -1;\n        x0 = labelStandoff;\n        y0 = -labelShift * flipIt;\n        ff = Math.abs(ax.tickangle) === 90 ? 0.5 : 0;\n\n        out.xFn = function(d) { return d.dx + shift + (x0 + d.fontSize * ff) * flipIt; };\n        out.yFn = function(d) { return d.dy + y0 + d.fontSize * MID_SHIFT; };\n        out.anchorFn = function(d, a) {\n            if(isNumeric(a) && Math.abs(a) === 90) {\n                return 'middle';\n            }\n            return ax.side === 'right' ? 'start' : 'end';\n        };\n        out.heightFn = function(d, a, h) {\n            a *= ax.side === 'left' ? 1 : -1;\n            return a < -30 ? -h :\n                a < 30 ? -0.5 * h :\n                0;\n        };\n    }\n\n    return out;\n};\n\nfunction tickDataFn(d) {\n    return [d.text, d.x, d.axInfo, d.font, d.fontSize, d.fontColor].join('_');\n}\n\n/**\n * Draw axis ticks\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {string} ticks\n *  - {number} linewidth\n *  - {string} tickcolor\n * @param {object} opts\n * - {array of object} vals (calcTicks output-like)\n * - {d3 selection} layer\n * - {string or fn} path\n * - {fn} transFn\n * - {boolean} crisp (set to false to unset crisp-edge SVG rendering)\n */\naxes.drawTicks = function(gd, ax, opts) {\n    opts = opts || {};\n\n    var cls = ax._id + 'tick';\n\n    var ticks = opts.layer.selectAll('path.' + cls)\n        .data(ax.ticks ? opts.vals : [], tickDataFn);\n\n    ticks.exit().remove();\n\n    ticks.enter().append('path')\n        .classed(cls, 1)\n        .classed('ticks', 1)\n        .classed('crisp', opts.crisp !== false)\n        .call(Color.stroke, ax.tickcolor)\n        .style('stroke-width', Drawing.crispRound(gd, ax.tickwidth, 1) + 'px')\n        .attr('d', opts.path);\n\n    ticks.attr('transform', opts.transFn);\n};\n\n/**\n * Draw axis grid\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {boolean} showgrid\n *  - {string} gridcolor\n *  - {string} gridwidth\n *  - {boolean} zeroline\n *  - {string} type\n *  - {string} dtick\n * @param {object} opts\n * - {array of object} vals (calcTicks output-like)\n * - {d3 selection} layer\n * - {object} counterAxis (full axis object corresponding to counter axis)\n *     optional - only required if this axis supports zero lines\n * - {string or fn} path\n * - {fn} transFn\n * - {boolean} crisp (set to false to unset crisp-edge SVG rendering)\n */\naxes.drawGrid = function(gd, ax, opts) {\n    opts = opts || {};\n\n    var cls = ax._id + 'grid';\n    var vals = opts.vals;\n    var counterAx = opts.counterAxis;\n    if(ax.showgrid === false) {\n        vals = [];\n    } else if(counterAx && axes.shouldShowZeroLine(gd, ax, counterAx)) {\n        var isArrayMode = ax.tickmode === 'array';\n        for(var i = 0; i < vals.length; i++) {\n            var xi = vals[i].x;\n            if(isArrayMode ? !xi : (Math.abs(xi) < ax.dtick / 100)) {\n                vals = vals.slice(0, i).concat(vals.slice(i + 1));\n                // In array mode you can in principle have multiple\n                // ticks at 0, so test them all. Otherwise once we found\n                // one we can stop.\n                if(isArrayMode) i--;\n                else break;\n            }\n        }\n    }\n\n    var grid = opts.layer.selectAll('path.' + cls)\n        .data(vals, tickDataFn);\n\n    grid.exit().remove();\n\n    grid.enter().append('path')\n        .classed(cls, 1)\n        .classed('crisp', opts.crisp !== false);\n\n    ax._gw = Drawing.crispRound(gd, ax.gridwidth, 1);\n\n    grid.attr('transform', opts.transFn)\n        .attr('d', opts.path)\n        .call(Color.stroke, ax.gridcolor || '#ddd')\n        .style('stroke-width', ax._gw + 'px');\n\n    if(typeof opts.path === 'function') grid.attr('d', opts.path);\n};\n\n/**\n * Draw axis zero-line\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {boolean} zeroline\n *  - {number} zerolinewidth\n *  - {string} zerolinecolor\n *  - {number (optional)} _gridWidthCrispRound\n * @param {object} opts\n * - {d3 selection} layer\n * - {object} counterAxis (full axis object corresponding to counter axis)\n * - {string or fn} path\n * - {fn} transFn\n * - {boolean} crisp (set to false to unset crisp-edge SVG rendering)\n */\naxes.drawZeroLine = function(gd, ax, opts) {\n    opts = opts || opts;\n\n    var cls = ax._id + 'zl';\n    var show = axes.shouldShowZeroLine(gd, ax, opts.counterAxis);\n\n    var zl = opts.layer.selectAll('path.' + cls)\n        .data(show ? [{x: 0, id: ax._id}] : []);\n\n    zl.exit().remove();\n\n    zl.enter().append('path')\n        .classed(cls, 1)\n        .classed('zl', 1)\n        .classed('crisp', opts.crisp !== false)\n        .each(function() {\n            // use the fact that only one element can enter to trigger a sort.\n            // If several zerolines enter at the same time we will sort once per,\n            // but generally this should be a minimal overhead.\n            opts.layer.selectAll('path').sort(function(da, db) {\n                return axisIds.idSort(da.id, db.id);\n            });\n        });\n\n    zl.attr('transform', opts.transFn)\n        .attr('d', opts.path)\n        .call(Color.stroke, ax.zerolinecolor || Color.defaultLine)\n        .style('stroke-width', Drawing.crispRound(gd, ax.zerolinewidth, ax._gw || 1) + 'px');\n};\n\n/**\n * Draw axis tick labels\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {boolean} showticklabels\n *  - {number} tickangle\n *  - {object (optional)} _selections\n *  - {object} (optional)} _tickAngles\n *  - {object} (optional)} _prevTickAngles\n * @param {object} opts\n * - {array of object} vals (calcTicks output-like)\n * - {d3 selection} layer\n * - {string (optional)} cls (node className)\n * - {boolean} repositionOnUpdate (set to true to reposition update selection)\n * - {boolean} secondary\n * - {fn} transFn\n * - {object} labelFns\n *  + {fn} xFn\n *  + {fn} yFn\n *  + {fn} anchorFn\n *  + {fn} heightFn\n */\naxes.drawLabels = function(gd, ax, opts) {\n    opts = opts || {};\n\n    var fullLayout = gd._fullLayout;\n    var axId = ax._id;\n    var axLetter = axId.charAt(0);\n    var cls = opts.cls || axId + 'tick';\n    var vals = opts.vals;\n    var labelFns = opts.labelFns;\n    var tickAngle = opts.secondary ? 0 : ax.tickangle;\n    var prevAngle = (ax._prevTickAngles || {})[cls];\n\n    var tickLabels = opts.layer.selectAll('g.' + cls)\n        .data(ax.showticklabels ? vals : [], tickDataFn);\n\n    var labelsReady = [];\n\n    tickLabels.enter().append('g')\n        .classed(cls, 1)\n        .append('text')\n            // only so tex has predictable alignment that we can\n            // alter later\n            .attr('text-anchor', 'middle')\n            .each(function(d) {\n                var thisLabel = d3.select(this);\n                var newPromise = gd._promises.length;\n\n                thisLabel\n                    .call(svgTextUtils.positionText, labelFns.xFn(d), labelFns.yFn(d))\n                    .call(Drawing.font, d.font, d.fontSize, d.fontColor)\n                    .text(d.text)\n                    .call(svgTextUtils.convertToTspans, gd);\n\n                if(gd._promises[newPromise]) {\n                    // if we have an async label, we'll deal with that\n                    // all here so take it out of gd._promises and\n                    // instead position the label and promise this in\n                    // labelsReady\n                    labelsReady.push(gd._promises.pop().then(function() {\n                        positionLabels(thisLabel, tickAngle);\n                    }));\n                } else {\n                    // sync label: just position it now.\n                    positionLabels(thisLabel, tickAngle);\n                }\n            });\n\n    tickLabels.exit().remove();\n\n    if(opts.repositionOnUpdate) {\n        tickLabels.each(function(d) {\n            d3.select(this).select('text')\n                .call(svgTextUtils.positionText, labelFns.xFn(d), labelFns.yFn(d));\n        });\n    }\n\n    function positionLabels(s, angle) {\n        s.each(function(d) {\n            var thisLabel = d3.select(this);\n            var mathjaxGroup = thisLabel.select('.text-math-group');\n            var anchor = labelFns.anchorFn(d, angle);\n\n            var transform = opts.transFn.call(thisLabel.node(), d) +\n                ((isNumeric(angle) && +angle !== 0) ?\n                (' rotate(' + angle + ',' + labelFns.xFn(d) + ',' +\n                    (labelFns.yFn(d) - d.fontSize / 2) + ')') :\n                '');\n\n            // how much to shift a multi-line label to center it vertically.\n            var nLines = svgTextUtils.lineCount(thisLabel);\n            var lineHeight = LINE_SPACING * d.fontSize;\n            var anchorHeight = labelFns.heightFn(d, isNumeric(angle) ? +angle : 0, (nLines - 1) * lineHeight);\n\n            if(anchorHeight) {\n                transform += ' translate(0, ' + anchorHeight + ')';\n            }\n\n            if(mathjaxGroup.empty()) {\n                thisLabel.select('text').attr({\n                    transform: transform,\n                    'text-anchor': anchor\n                });\n            } else {\n                var mjWidth = Drawing.bBox(mathjaxGroup.node()).width;\n                var mjShift = mjWidth * {end: -0.5, start: 0.5}[anchor];\n                mathjaxGroup.attr('transform', transform + (mjShift ? 'translate(' + mjShift + ',0)' : ''));\n            }\n        });\n    }\n\n    // make sure all labels are correctly positioned at their base angle\n    // the positionLabels call above is only for newly drawn labels.\n    // do this without waiting, using the last calculated angle to\n    // minimize flicker, then do it again when we know all labels are\n    // there, putting back the prescribed angle to check for overlaps.\n    positionLabels(tickLabels, (prevAngle + 1) ? prevAngle : tickAngle);\n\n    function allLabelsReady() {\n        return labelsReady.length && Promise.all(labelsReady);\n    }\n\n    var autoangle = null;\n\n    function fixLabelOverlaps() {\n        positionLabels(tickLabels, tickAngle);\n\n        // check for auto-angling if x labels overlap\n        // don't auto-angle at all for log axes with\n        // base and digit format\n        if(vals.length && axLetter === 'x' && !isNumeric(tickAngle) &&\n            (ax.type !== 'log' || String(ax.dtick).charAt(0) !== 'D')\n        ) {\n            autoangle = 0;\n\n            var maxFontSize = 0;\n            var lbbArray = [];\n            var i;\n\n            tickLabels.each(function(d) {\n                maxFontSize = Math.max(maxFontSize, d.fontSize);\n\n                var x = ax.l2p(d.x);\n                var thisLabel = selectTickLabel(this);\n                var bb = Drawing.bBox(thisLabel.node());\n\n                lbbArray.push({\n                    // ignore about y, just deal with x overlaps\n                    top: 0,\n                    bottom: 10,\n                    height: 10,\n                    left: x - bb.width / 2,\n                    // impose a 2px gap\n                    right: x + bb.width / 2 + 2,\n                    width: bb.width + 2\n                });\n            });\n\n            if((ax.tickson === 'boundaries' || ax.showdividers) && !opts.secondary) {\n                var gap = 2;\n                if(ax.ticks) gap += ax.tickwidth / 2;\n\n                // TODO should secondary labels also fall into this fix-overlap regime?\n\n                for(i = 0; i < lbbArray.length; i++) {\n                    var xbnd = vals[i].xbnd;\n                    var lbb = lbbArray[i];\n                    if(\n                        (xbnd[0] !== null && (lbb.left - ax.l2p(xbnd[0])) < gap) ||\n                        (xbnd[1] !== null && (ax.l2p(xbnd[1]) - lbb.right) < gap)\n                    ) {\n                        autoangle = 90;\n                        break;\n                    }\n                }\n            } else {\n                var vLen = vals.length;\n                var tickSpacing = Math.abs((vals[vLen - 1].x - vals[0].x) * ax._m) / (vLen - 1);\n                var rotate90 = (tickSpacing < maxFontSize * 2.5) || ax.type === 'multicategory';\n\n                // any overlap at all - set 30 degrees or 90 degrees\n                for(i = 0; i < lbbArray.length - 1; i++) {\n                    if(Lib.bBoxIntersect(lbbArray[i], lbbArray[i + 1])) {\n                        autoangle = rotate90 ? 90 : 30;\n                        break;\n                    }\n                }\n            }\n\n            if(autoangle) {\n                positionLabels(tickLabels, autoangle);\n            }\n        }\n    }\n\n    if(ax._selections) {\n        ax._selections[cls] = tickLabels;\n    }\n\n    var seq = [allLabelsReady];\n\n    // N.B. during auto-margin redraws, if the axis fixed its label overlaps\n    // by rotating 90 degrees, do not attempt to re-fix its label overlaps\n    // as this can lead to infinite redraw loops!\n    if(ax.automargin && fullLayout._redrawFromAutoMarginCount && prevAngle === 90) {\n        autoangle = 90;\n        seq.push(function() {\n            positionLabels(tickLabels, prevAngle);\n        });\n    } else {\n        seq.push(fixLabelOverlaps);\n    }\n\n    // save current tick angle for future redraws\n    if(ax._tickAngles) {\n        seq.push(function() {\n            ax._tickAngles[cls] = autoangle === null ?\n                (isNumeric(tickAngle) ? tickAngle : 0) :\n                autoangle;\n        });\n    }\n\n    var done = Lib.syncOrAsync(seq);\n    if(done && done.then) gd._promises.push(done);\n    return done;\n};\n\n/**\n * Draw axis dividers\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {string} showdividers\n *  - {number} dividerwidth\n *  - {string} dividercolor\n * @param {object} opts\n * - {array of object} vals (calcTicks output-like)\n * - {d3 selection} layer\n * - {fn} path\n * - {fn} transFn\n */\nfunction drawDividers(gd, ax, opts) {\n    var cls = ax._id + 'divider';\n    var vals = opts.vals;\n\n    var dividers = opts.layer.selectAll('path.' + cls)\n        .data(vals, tickDataFn);\n\n    dividers.exit().remove();\n\n    dividers.enter().insert('path', ':first-child')\n        .classed(cls, 1)\n        .classed('crisp', 1)\n        .call(Color.stroke, ax.dividercolor)\n        .style('stroke-width', Drawing.crispRound(gd, ax.dividerwidth, 1) + 'px');\n\n    dividers\n        .attr('transform', opts.transFn)\n        .attr('d', opts.path);\n}\n\n/**\n * Get axis position in px, that is the distance for the graph's\n * top (left) edge for x (y) axes.\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {string} side\n *  if anchored:\n *  - {object} _anchorAxis\n *  Otherwise:\n *  - {number} position\n * @return {number}\n */\naxes.getPxPosition = function(gd, ax) {\n    var gs = gd._fullLayout._size;\n    var axLetter = ax._id.charAt(0);\n    var side = ax.side;\n    var anchorAxis;\n\n    if(ax.anchor !== 'free') {\n        anchorAxis = ax._anchorAxis;\n    } else if(axLetter === 'x') {\n        anchorAxis = {\n            _offset: gs.t + (1 - (ax.position || 0)) * gs.h,\n            _length: 0\n        };\n    } else if(axLetter === 'y') {\n        anchorAxis = {\n            _offset: gs.l + (ax.position || 0) * gs.w,\n            _length: 0\n        };\n    }\n\n    if(side === 'top' || side === 'left') {\n        return anchorAxis._offset;\n    } else if(side === 'bottom' || side === 'right') {\n        return anchorAxis._offset + anchorAxis._length;\n    }\n};\n\n/**\n * Approximate axis title depth (w/o computing its bounding box)\n *\n * @param {object} ax (full) axis object\n *  - {string} title.text\n *  - {number} title.font.size\n *  - {number} title.standoff\n * @return {number} (in px)\n */\nfunction approxTitleDepth(ax) {\n    var fontSize = ax.title.font.size;\n    var extraLines = (ax.title.text.match(svgTextUtils.BR_TAG_ALL) || []).length;\n    if(ax.title.hasOwnProperty('standoff')) {\n        return extraLines ?\n            fontSize * (CAP_SHIFT + (extraLines * LINE_SPACING)) :\n            fontSize * CAP_SHIFT;\n    } else {\n        return extraLines ?\n            fontSize * (extraLines + 1) * LINE_SPACING :\n            fontSize;\n    }\n}\n\n/**\n * Draw axis title, compute default standoff if necessary\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n *  - {string} _id\n *  - {string} _name\n *  - {string} side\n *  - {number} title.font.size\n *  - {object} _selections\n *\n *  - {number} _depth\n *  - {number} title.standoff\n *  OR\n *  - {number} linewidth\n *  - {boolean} showticklabels\n */\nfunction drawTitle(gd, ax) {\n    var fullLayout = gd._fullLayout;\n    var axId = ax._id;\n    var axLetter = axId.charAt(0);\n    var fontSize = ax.title.font.size;\n\n    var titleStandoff;\n\n    if(ax.title.hasOwnProperty('standoff')) {\n        titleStandoff = ax._depth + ax.title.standoff + approxTitleDepth(ax);\n    } else {\n        if(ax.type === 'multicategory') {\n            titleStandoff = ax._depth;\n        } else {\n            var offsetBase = 1.5;\n            titleStandoff = 10 + fontSize * offsetBase + (ax.linewidth ? ax.linewidth - 1 : 0);\n        }\n\n        if(axLetter === 'x') {\n            titleStandoff += ax.side === 'top' ?\n                fontSize * (ax.showticklabels ? 1 : 0) :\n                fontSize * (ax.showticklabels ? 1.5 : 0.5);\n        } else {\n            titleStandoff += ax.side === 'right' ?\n                fontSize * (ax.showticklabels ? 1 : 0.5) :\n                fontSize * (ax.showticklabels ? 0.5 : 0);\n        }\n    }\n\n    var pos = axes.getPxPosition(gd, ax);\n    var transform, x, y;\n\n    if(axLetter === 'x') {\n        x = ax._offset + ax._length / 2;\n        y = (ax.side === 'top') ? pos - titleStandoff : pos + titleStandoff;\n    } else {\n        y = ax._offset + ax._length / 2;\n        x = (ax.side === 'right') ? pos + titleStandoff : pos - titleStandoff;\n        transform = {rotate: '-90', offset: 0};\n    }\n\n    var avoid;\n\n    if(ax.type !== 'multicategory') {\n        var tickLabels = ax._selections[ax._id + 'tick'];\n\n        avoid = {\n            selection: tickLabels,\n            side: ax.side\n        };\n\n        if(tickLabels && tickLabels.node() && tickLabels.node().parentNode) {\n            var translation = Drawing.getTranslate(tickLabels.node().parentNode);\n            avoid.offsetLeft = translation.x;\n            avoid.offsetTop = translation.y;\n        }\n\n        if(ax.title.hasOwnProperty('standoff')) {\n            avoid.pad = 0;\n        }\n    }\n\n    return Titles.draw(gd, axId + 'title', {\n        propContainer: ax,\n        propName: ax._name + '.title.text',\n        placeholder: fullLayout._dfltTitle[axLetter],\n        avoid: avoid,\n        transform: transform,\n        attributes: {x: x, y: y, 'text-anchor': 'middle'}\n    });\n}\n\naxes.shouldShowZeroLine = function(gd, ax, counterAxis) {\n    var rng = Lib.simpleMap(ax.range, ax.r2l);\n    return (\n        (rng[0] * rng[1] <= 0) &&\n        ax.zeroline &&\n        (ax.type === 'linear' || ax.type === '-') &&\n        !(ax.rangebreaks && ax.maskBreaks(0) === BADNUM) &&\n        (\n            clipEnds(ax, 0) ||\n            !anyCounterAxLineAtZero(gd, ax, counterAxis, rng) ||\n            hasBarsOrFill(gd, ax)\n        )\n    );\n};\n\naxes.clipEnds = function(ax, vals) {\n    return vals.filter(function(d) { return clipEnds(ax, d.x); });\n};\n\nfunction clipEnds(ax, l) {\n    var p = ax.l2p(l);\n    return (p > 1 && p < ax._length - 1);\n}\n\nfunction anyCounterAxLineAtZero(gd, ax, counterAxis, rng) {\n    var mainCounterAxis = counterAxis._mainAxis;\n    if(!mainCounterAxis) return;\n\n    var fullLayout = gd._fullLayout;\n    var axLetter = ax._id.charAt(0);\n    var counterLetter = axes.counterLetter(ax._id);\n\n    var zeroPosition = ax._offset + (\n        ((Math.abs(rng[0]) < Math.abs(rng[1])) === (axLetter === 'x')) ?\n        0 : ax._length\n    );\n\n    function lineNearZero(ax2) {\n        if(!ax2.showline || !ax2.linewidth) return false;\n        var tolerance = Math.max((ax2.linewidth + ax.zerolinewidth) / 2, 1);\n\n        function closeEnough(pos2) {\n            return typeof pos2 === 'number' && Math.abs(pos2 - zeroPosition) < tolerance;\n        }\n\n        if(closeEnough(ax2._mainLinePosition) || closeEnough(ax2._mainMirrorPosition)) {\n            return true;\n        }\n        var linePositions = ax2._linepositions || {};\n        for(var k in linePositions) {\n            if(closeEnough(linePositions[k][0]) || closeEnough(linePositions[k][1])) {\n                return true;\n            }\n        }\n    }\n\n    var plotinfo = fullLayout._plots[counterAxis._mainSubplot];\n    if(!(plotinfo.mainplotinfo || plotinfo).overlays.length) {\n        return lineNearZero(counterAxis, zeroPosition);\n    }\n\n    var counterLetterAxes = axes.list(gd, counterLetter);\n    for(var i = 0; i < counterLetterAxes.length; i++) {\n        var counterAxis2 = counterLetterAxes[i];\n        if(\n            counterAxis2._mainAxis === mainCounterAxis &&\n            lineNearZero(counterAxis2, zeroPosition)\n        ) {\n            return true;\n        }\n    }\n}\n\nfunction hasBarsOrFill(gd, ax) {\n    var fullData = gd._fullData;\n    var subplot = ax._mainSubplot;\n    var axLetter = ax._id.charAt(0);\n\n    for(var i = 0; i < fullData.length; i++) {\n        var trace = fullData[i];\n\n        if(trace.visible === true && (trace.xaxis + trace.yaxis) === subplot) {\n            if(\n                Registry.traceIs(trace, 'bar-like') &&\n                trace.orientation === {x: 'h', y: 'v'}[axLetter]\n            ) return true;\n\n            if(\n                trace.fill &&\n                trace.fill.charAt(trace.fill.length - 1) === axLetter\n            ) return true;\n        }\n    }\n    return false;\n}\n\nfunction selectTickLabel(gTick) {\n    var s = d3.select(gTick);\n    var mj = s.select('.text-math-group');\n    return mj.empty() ? s.select('text') : mj;\n}\n\n/**\n * Find all margin pushers for 2D axes and reserve them for later use\n * Both label and rangeslider automargin calculations happen later so\n * we need to explicitly allow their ids in order to not delete them.\n *\n * TODO: can we pull the actual automargin calls forward to avoid this hack?\n * We're probably also doing multiple redraws in this case, would be faster\n * if we can just do the whole calculation ahead of time and draw once.\n */\naxes.allowAutoMargin = function(gd) {\n    var axList = axes.list(gd, '', true);\n    for(var i = 0; i < axList.length; i++) {\n        var ax = axList[i];\n        if(ax.automargin) {\n            Plots.allowAutoMargin(gd, axAutoMarginID(ax));\n            if(ax.mirror) {\n                Plots.allowAutoMargin(gd, axMirrorAutoMarginID(ax));\n            }\n        }\n        if(Registry.getComponentMethod('rangeslider', 'isVisible')(ax)) {\n            Plots.allowAutoMargin(gd, rangeSliderAutoMarginID(ax));\n        }\n    }\n};\n\nfunction axAutoMarginID(ax) { return ax._id + '.automargin'; }\nfunction axMirrorAutoMarginID(ax) { return axAutoMarginID(ax) + '.mirror'; }\nfunction rangeSliderAutoMarginID(ax) { return ax._id + '.rangeslider'; }\n\n// swap all the presentation attributes of the axes showing these traces\naxes.swap = function(gd, traces) {\n    var axGroups = makeAxisGroups(gd, traces);\n\n    for(var i = 0; i < axGroups.length; i++) {\n        swapAxisGroup(gd, axGroups[i].x, axGroups[i].y);\n    }\n};\n\nfunction makeAxisGroups(gd, traces) {\n    var groups = [];\n    var i, j;\n\n    for(i = 0; i < traces.length; i++) {\n        var groupsi = [];\n        var xi = gd._fullData[traces[i]].xaxis;\n        var yi = gd._fullData[traces[i]].yaxis;\n        if(!xi || !yi) continue; // not a 2D cartesian trace?\n\n        for(j = 0; j < groups.length; j++) {\n            if(groups[j].x.indexOf(xi) !== -1 || groups[j].y.indexOf(yi) !== -1) {\n                groupsi.push(j);\n            }\n        }\n\n        if(!groupsi.length) {\n            groups.push({x: [xi], y: [yi]});\n            continue;\n        }\n\n        var group0 = groups[groupsi[0]];\n        var groupj;\n\n        if(groupsi.length > 1) {\n            for(j = 1; j < groupsi.length; j++) {\n                groupj = groups[groupsi[j]];\n                mergeAxisGroups(group0.x, groupj.x);\n                mergeAxisGroups(group0.y, groupj.y);\n            }\n        }\n        mergeAxisGroups(group0.x, [xi]);\n        mergeAxisGroups(group0.y, [yi]);\n    }\n\n    return groups;\n}\n\nfunction mergeAxisGroups(intoSet, fromSet) {\n    for(var i = 0; i < fromSet.length; i++) {\n        if(intoSet.indexOf(fromSet[i]) === -1) intoSet.push(fromSet[i]);\n    }\n}\n\nfunction swapAxisGroup(gd, xIds, yIds) {\n    var xFullAxes = [];\n    var yFullAxes = [];\n    var layout = gd.layout;\n    var i, j;\n\n    for(i = 0; i < xIds.length; i++) xFullAxes.push(axes.getFromId(gd, xIds[i]));\n    for(i = 0; i < yIds.length; i++) yFullAxes.push(axes.getFromId(gd, yIds[i]));\n\n    var allAxKeys = Object.keys(axAttrs);\n\n    var noSwapAttrs = [\n        'anchor', 'domain', 'overlaying', 'position', 'side', 'tickangle', 'editType'\n    ];\n    var numericTypes = ['linear', 'log'];\n\n    for(i = 0; i < allAxKeys.length; i++) {\n        var keyi = allAxKeys[i];\n        var xVal = xFullAxes[0][keyi];\n        var yVal = yFullAxes[0][keyi];\n        var allEqual = true;\n        var coerceLinearX = false;\n        var coerceLinearY = false;\n        if(keyi.charAt(0) === '_' || typeof xVal === 'function' ||\n                noSwapAttrs.indexOf(keyi) !== -1) {\n            continue;\n        }\n        for(j = 1; j < xFullAxes.length && allEqual; j++) {\n            var xVali = xFullAxes[j][keyi];\n            if(keyi === 'type' && numericTypes.indexOf(xVal) !== -1 &&\n                    numericTypes.indexOf(xVali) !== -1 && xVal !== xVali) {\n                // type is special - if we find a mixture of linear and log,\n                // coerce them all to linear on flipping\n                coerceLinearX = true;\n            } else if(xVali !== xVal) allEqual = false;\n        }\n        for(j = 1; j < yFullAxes.length && allEqual; j++) {\n            var yVali = yFullAxes[j][keyi];\n            if(keyi === 'type' && numericTypes.indexOf(yVal) !== -1 &&\n                    numericTypes.indexOf(yVali) !== -1 && yVal !== yVali) {\n                // type is special - if we find a mixture of linear and log,\n                // coerce them all to linear on flipping\n                coerceLinearY = true;\n            } else if(yFullAxes[j][keyi] !== yVal) allEqual = false;\n        }\n        if(allEqual) {\n            if(coerceLinearX) layout[xFullAxes[0]._name].type = 'linear';\n            if(coerceLinearY) layout[yFullAxes[0]._name].type = 'linear';\n            swapAxisAttrs(layout, keyi, xFullAxes, yFullAxes, gd._fullLayout._dfltTitle);\n        }\n    }\n\n    // now swap x&y for any annotations anchored to these x & y\n    for(i = 0; i < gd._fullLayout.annotations.length; i++) {\n        var ann = gd._fullLayout.annotations[i];\n        if(xIds.indexOf(ann.xref) !== -1 &&\n                yIds.indexOf(ann.yref) !== -1) {\n            Lib.swapAttrs(layout.annotations[i], ['?']);\n        }\n    }\n}\n\nfunction swapAxisAttrs(layout, key, xFullAxes, yFullAxes, dfltTitle) {\n    // in case the value is the default for either axis,\n    // look at the first axis in each list and see if\n    // this key's value is undefined\n    var np = Lib.nestedProperty;\n    var xVal = np(layout[xFullAxes[0]._name], key).get();\n    var yVal = np(layout[yFullAxes[0]._name], key).get();\n    var i;\n\n    if(key === 'title') {\n        // special handling of placeholder titles\n        if(xVal && xVal.text === dfltTitle.x) {\n            xVal.text = dfltTitle.y;\n        }\n        if(yVal && yVal.text === dfltTitle.y) {\n            yVal.text = dfltTitle.x;\n        }\n    }\n\n    for(i = 0; i < xFullAxes.length; i++) {\n        np(layout, xFullAxes[i]._name + '.' + key).set(yVal);\n    }\n    for(i = 0; i < yFullAxes.length; i++) {\n        np(layout, yFullAxes[i]._name + '.' + key).set(xVal);\n    }\n}\n\nfunction isAngular(ax) {\n    return ax._id === 'angularaxis';\n}\n\nfunction moveOutsideBreak(v, ax) {\n    var len = ax._rangebreaks.length;\n    for(var k = 0; k < len; k++) {\n        var brk = ax._rangebreaks[k];\n        if(v >= brk.min && v < brk.max) {\n            return brk.max;\n        }\n    }\n    return v;\n}\n\n},{\"../../components/color\":52,\"../../components/drawing\":74,\"../../components/titles\":147,\"../../constants/alignment\":154,\"../../constants/numerical\":158,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../plots/plots\":256,\"../../registry\":269,\"./autorange\":221,\"./axis_autotype\":223,\"./axis_ids\":225,\"./clean_ticks\":227,\"./layout_attributes\":236,\"./set_convert\":242,\"d3\":16,\"fast-isnumeric\":18}],223:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function autoType(array, calendar, opts) {\n    opts = opts || {};\n\n    if(!opts.noMultiCategory && multiCategory(array)) return 'multicategory';\n    if(moreDates(array, calendar)) return 'date';\n    if(category(array)) return 'category';\n    if(linearOK(array)) return 'linear';\n    else return '-';\n};\n\n// is there at least one number in array? If not, we should leave\n// ax.type empty so it can be autoset later\nfunction linearOK(array) {\n    if(!array) return false;\n\n    for(var i = 0; i < array.length; i++) {\n        if(isNumeric(array[i])) return true;\n    }\n\n    return false;\n}\n\n// does the array a have mostly dates rather than numbers?\n// note: some values can be neither (such as blanks, text)\n// 2- or 4-digit integers can be both, so require twice as many\n// dates as non-dates, to exclude cases with mostly 2 & 4 digit\n// numbers and a few dates\n// as with categories, consider DISTINCT values only.\nfunction moreDates(a, calendar) {\n    // test at most 1000 points, evenly spaced\n    var inc = Math.max(1, (a.length - 1) / 1000);\n    var dcnt = 0;\n    var ncnt = 0;\n    var seen = {};\n\n    for(var i = 0; i < a.length; i += inc) {\n        var ai = a[Math.round(i)];\n        var stri = String(ai);\n        if(seen[stri]) continue;\n        seen[stri] = 1;\n\n        if(Lib.isDateTime(ai, calendar)) dcnt += 1;\n        if(isNumeric(ai)) ncnt += 1;\n    }\n\n    return (dcnt > ncnt * 2);\n}\n\n// are the (x,y)-values in gd.data mostly text?\n// require twice as many DISTINCT categories as distinct numbers\nfunction category(a) {\n    // test at most 1000 points\n    var inc = Math.max(1, (a.length - 1) / 1000);\n    var curvenums = 0;\n    var curvecats = 0;\n    var seen = {};\n\n    for(var i = 0; i < a.length; i += inc) {\n        var ai = a[Math.round(i)];\n        var stri = String(ai);\n        if(seen[stri]) continue;\n        seen[stri] = 1;\n\n        if(typeof ai === 'boolean') curvecats++;\n        else if(Lib.cleanNumber(ai) !== BADNUM) curvenums++;\n        else if(typeof ai === 'string') curvecats++;\n    }\n\n    return curvecats > curvenums * 2;\n}\n\n// very-loose requirements for multicategory,\n// trace modules that should never auto-type to multicategory\n// should be declared with 'noMultiCategory'\nfunction multiCategory(a) {\n    return Lib.isArrayOrTypedArray(a[0]) && Lib.isArrayOrTypedArray(a[1]);\n}\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"fast-isnumeric\":18}],224:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nvar handleArrayContainerDefaults = _dereq_('../array_container_defaults');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar handleTickValueDefaults = _dereq_('./tick_value_defaults');\nvar handleTickMarkDefaults = _dereq_('./tick_mark_defaults');\nvar handleTickLabelDefaults = _dereq_('./tick_label_defaults');\nvar handleCategoryOrderDefaults = _dereq_('./category_order_defaults');\nvar handleLineGridDefaults = _dereq_('./line_grid_defaults');\nvar setConvert = _dereq_('./set_convert');\n\nvar DAY_OF_WEEK = _dereq_('./constants').WEEKDAY_PATTERN;\nvar HOUR = _dereq_('./constants').HOUR_PATTERN;\n\n/**\n * options: object containing:\n *\n *  letter: 'x' or 'y'\n *  title: name of the axis (ie 'Colorbar') to go in default title\n *  font: the default font to inherit\n *  outerTicks: boolean, should ticks default to outside?\n *  showGrid: boolean, should gridlines be shown by default?\n *  noHover: boolean, this axis doesn't support hover effects?\n *  noTickson: boolean, this axis doesn't support 'tickson'\n *  data: the plot data, used to manage categories\n *  bgColor: the plot background color, to calculate default gridline colors\n *  calendar:\n *  splomStash:\n *  visibleDflt: boolean\n *  reverseDflt: boolean\n *  automargin: boolean\n */\nmodule.exports = function handleAxisDefaults(containerIn, containerOut, coerce, options, layoutOut) {\n    var letter = options.letter;\n    var font = options.font || {};\n    var splomStash = options.splomStash || {};\n\n    var visible = coerce('visible', !options.visibleDflt);\n\n    var axTemplate = containerOut._template || {};\n    var axType = containerOut.type || axTemplate.type || '-';\n\n    if(axType === 'date') {\n        var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleDefaults');\n        handleCalendarDefaults(containerIn, containerOut, 'calendar', options.calendar);\n    }\n\n    setConvert(containerOut, layoutOut);\n\n    var autorangeDflt = !containerOut.isValidRange(containerIn.range);\n    if(autorangeDflt && options.reverseDflt) autorangeDflt = 'reversed';\n    var autoRange = coerce('autorange', autorangeDflt);\n    if(autoRange && (axType === 'linear' || axType === '-')) coerce('rangemode');\n\n    coerce('range');\n    containerOut.cleanRange();\n\n    handleCategoryOrderDefaults(containerIn, containerOut, coerce, options);\n\n    if(axType !== 'category' && !options.noHover) coerce('hoverformat');\n\n    var dfltColor = coerce('color');\n    // if axis.color was provided, use it for fonts too; otherwise,\n    // inherit from global font color in case that was provided.\n    // Compare to dflt rather than to containerIn, so we can provide color via\n    // template too.\n    var dfltFontColor = (dfltColor !== layoutAttributes.color.dflt) ? dfltColor : font.color;\n    // try to get default title from splom trace, fallback to graph-wide value\n    var dfltTitle = splomStash.label || layoutOut._dfltTitle[letter];\n\n    handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options, {pass: 1});\n    if(!visible) return containerOut;\n\n    coerce('title.text', dfltTitle);\n    Lib.coerceFont(coerce, 'title.font', {\n        family: font.family,\n        size: Math.round(font.size * 1.2),\n        color: dfltFontColor\n    });\n\n    handleTickValueDefaults(containerIn, containerOut, coerce, axType);\n    handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options, {pass: 2});\n    handleTickMarkDefaults(containerIn, containerOut, coerce, options);\n    handleLineGridDefaults(containerIn, containerOut, coerce, {\n        dfltColor: dfltColor,\n        bgColor: options.bgColor,\n        showGrid: options.showGrid,\n        attributes: layoutAttributes\n    });\n\n    if(containerOut.showline || containerOut.ticks) coerce('mirror');\n\n    if(options.automargin) coerce('automargin');\n\n    var isMultiCategory = axType === 'multicategory';\n\n    if(!options.noTickson &&\n        (axType === 'category' || isMultiCategory) &&\n        (containerOut.ticks || containerOut.showgrid)\n    ) {\n        var ticksonDflt;\n        if(isMultiCategory) ticksonDflt = 'boundaries';\n        coerce('tickson', ticksonDflt);\n    }\n\n    if(isMultiCategory) {\n        var showDividers = coerce('showdividers');\n        if(showDividers) {\n            coerce('dividercolor');\n            coerce('dividerwidth');\n        }\n    }\n\n    if(axType === 'date') {\n        handleArrayContainerDefaults(containerIn, containerOut, {\n            name: 'rangebreaks',\n            inclusionAttr: 'enabled',\n            handleItemDefaults: rangebreaksDefaults\n        });\n\n        if(!containerOut.rangebreaks.length) {\n            delete containerOut.rangebreaks;\n        } else {\n            for(var k = 0; k < containerOut.rangebreaks.length; k++) {\n                if(containerOut.rangebreaks[k].pattern === DAY_OF_WEEK) {\n                    containerOut._hasDayOfWeekBreaks = true;\n                    break;\n                }\n            }\n\n            setConvert(containerOut, layoutOut);\n\n            if(layoutOut._has('scattergl') || layoutOut._has('splom')) {\n                for(var i = 0; i < options.data.length; i++) {\n                    var trace = options.data[i];\n                    if(trace.type === 'scattergl' || trace.type === 'splom') {\n                        trace.visible = false;\n                        Lib.warn(trace.type +\n                            ' traces do not work on axes with rangebreaks.' +\n                            ' Setting trace ' + trace.index + ' to `visible: false`.');\n                    }\n                }\n            }\n        }\n    }\n\n    return containerOut;\n};\n\nfunction rangebreaksDefaults(itemIn, itemOut, containerOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(itemIn, itemOut, layoutAttributes.rangebreaks, attr, dflt);\n    }\n\n    var enabled = coerce('enabled');\n\n    if(enabled) {\n        var bnds = coerce('bounds');\n        if(bnds && bnds.length >= 2) {\n            var dfltPattern = '';\n            var i, q;\n            if(bnds.length === 2) {\n                for(i = 0; i < 2; i++) {\n                    q = indexOfDay(bnds[i]);\n                    if(q) {\n                        dfltPattern = DAY_OF_WEEK;\n                        break;\n                    }\n                }\n            }\n            var pattern = coerce('pattern', dfltPattern);\n            if(pattern === DAY_OF_WEEK) {\n                for(i = 0; i < 2; i++) {\n                    q = indexOfDay(bnds[i]);\n                    if(q) {\n                        // convert to integers i.e 'Sunday' --> 0\n                        itemOut.bounds[i] = bnds[i] = q - 1;\n                    }\n                }\n            }\n            if(pattern) {\n                // ensure types and ranges\n                for(i = 0; i < 2; i++) {\n                    q = bnds[i];\n                    switch(pattern) {\n                        case DAY_OF_WEEK :\n                            if(!isNumeric(q)) {\n                                itemOut.enabled = false;\n                                return;\n                            }\n                            q = +q;\n\n                            if(\n                                q !== Math.floor(q) || // don't accept fractional days for mow\n                                q < 0 || q >= 7\n                            ) {\n                                itemOut.enabled = false;\n                                return;\n                            }\n                            // use number\n                            itemOut.bounds[i] = bnds[i] = q;\n                            break;\n\n                        case HOUR :\n                            if(!isNumeric(q)) {\n                                itemOut.enabled = false;\n                                return;\n                            }\n                            q = +q;\n\n                            if(q < 0 || q > 24) { // accept 24\n                                itemOut.enabled = false;\n                                return;\n                            }\n                            // use number\n                            itemOut.bounds[i] = bnds[i] = q;\n                            break;\n                    }\n                }\n            }\n\n            if(containerOut.autorange === false) {\n                var rng = containerOut.range;\n\n                // if bounds are bigger than the (set) range, disable break\n                if(rng[0] < rng[1]) {\n                    if(bnds[0] < rng[0] && bnds[1] > rng[1]) {\n                        itemOut.enabled = false;\n                        return;\n                    }\n                } else if(bnds[0] > rng[0] && bnds[1] < rng[1]) {\n                    itemOut.enabled = false;\n                    return;\n                }\n            }\n        } else {\n            var values = coerce('values');\n\n            if(values && values.length) {\n                coerce('dvalue');\n            } else {\n                itemOut.enabled = false;\n                return;\n            }\n        }\n    }\n}\n\n// these numbers are one more than what bounds would be mapped to\nvar dayStrToNum = {\n    sun: 1,\n    mon: 2,\n    tue: 3,\n    wed: 4,\n    thu: 5,\n    fri: 6,\n    sat: 7\n};\n\nfunction indexOfDay(v) {\n    if(typeof v !== 'string') return;\n    return dayStrToNum[\n        v.substr(0, 3).toLowerCase()\n    ];\n}\n\n},{\"../../lib\":178,\"../../registry\":269,\"../array_container_defaults\":218,\"./category_order_defaults\":226,\"./constants\":228,\"./layout_attributes\":236,\"./line_grid_defaults\":238,\"./set_convert\":242,\"./tick_label_defaults\":243,\"./tick_mark_defaults\":244,\"./tick_value_defaults\":245,\"fast-isnumeric\":18}],225:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\n\nvar constants = _dereq_('./constants');\n\n\n// convert between axis names (xaxis, xaxis2, etc, elements of gd.layout)\n// and axis id's (x, x2, etc). Would probably have ditched 'xaxis'\n// completely in favor of just 'x' if it weren't ingrained in the API etc.\nexports.id2name = function id2name(id) {\n    if(typeof id !== 'string' || !id.match(constants.AX_ID_PATTERN)) return;\n    var axNum = id.substr(1);\n    if(axNum === '1') axNum = '';\n    return id.charAt(0) + 'axis' + axNum;\n};\n\nexports.name2id = function name2id(name) {\n    if(!name.match(constants.AX_NAME_PATTERN)) return;\n    var axNum = name.substr(5);\n    if(axNum === '1') axNum = '';\n    return name.charAt(0) + axNum;\n};\n\nexports.cleanId = function cleanId(id, axLetter) {\n    if(typeof id !== 'string' || !id.match(constants.AX_ID_PATTERN)) return;\n    if(axLetter && id.charAt(0) !== axLetter) return;\n\n    var axNum = id.substr(1).replace(/^0+/, '');\n    if(axNum === '1') axNum = '';\n    return id.charAt(0) + axNum;\n};\n\n// get all axis objects, as restricted in listNames\nexports.list = function(gd, axLetter, only2d) {\n    var fullLayout = gd._fullLayout;\n    if(!fullLayout) return [];\n\n    var idList = exports.listIds(gd, axLetter);\n    var out = new Array(idList.length);\n    var i;\n\n    for(i = 0; i < idList.length; i++) {\n        var idi = idList[i];\n        out[i] = fullLayout[idi.charAt(0) + 'axis' + idi.substr(1)];\n    }\n\n    if(!only2d) {\n        var sceneIds3D = fullLayout._subplots.gl3d || [];\n\n        for(i = 0; i < sceneIds3D.length; i++) {\n            var scene = fullLayout[sceneIds3D[i]];\n\n            if(axLetter) out.push(scene[axLetter + 'axis']);\n            else out.push(scene.xaxis, scene.yaxis, scene.zaxis);\n        }\n    }\n\n    return out;\n};\n\n// get all axis ids, optionally restricted by letter\n// this only makes sense for 2d axes\nexports.listIds = function(gd, axLetter) {\n    var fullLayout = gd._fullLayout;\n    if(!fullLayout) return [];\n\n    var subplotLists = fullLayout._subplots;\n    if(axLetter) return subplotLists[axLetter + 'axis'];\n    return subplotLists.xaxis.concat(subplotLists.yaxis);\n};\n\n// get an axis object from its id 'x','x2' etc\n// optionally, id can be a subplot (ie 'x2y3') and type gets x or y from it\nexports.getFromId = function(gd, id, type) {\n    var fullLayout = gd._fullLayout;\n\n    if(type === 'x') id = id.replace(/y[0-9]*/, '');\n    else if(type === 'y') id = id.replace(/x[0-9]*/, '');\n\n    return fullLayout[exports.id2name(id)];\n};\n\n// get an axis object of specified type from the containing trace\nexports.getFromTrace = function(gd, fullTrace, type) {\n    var fullLayout = gd._fullLayout;\n    var ax = null;\n\n    if(Registry.traceIs(fullTrace, 'gl3d')) {\n        var scene = fullTrace.scene;\n        if(scene.substr(0, 5) === 'scene') {\n            ax = fullLayout[scene][type + 'axis'];\n        }\n    } else {\n        ax = exports.getFromId(gd, fullTrace[type + 'axis'] || type);\n    }\n\n    return ax;\n};\n\n// sort x, x2, x10, y, y2, y10...\nexports.idSort = function(id1, id2) {\n    var letter1 = id1.charAt(0);\n    var letter2 = id2.charAt(0);\n    if(letter1 !== letter2) return letter1 > letter2 ? 1 : -1;\n    return +(id1.substr(1) || 1) - +(id2.substr(1) || 1);\n};\n\nexports.getAxisGroup = function getAxisGroup(fullLayout, axId) {\n    var matchGroups = fullLayout._axisMatchGroups;\n\n    for(var i = 0; i < matchGroups.length; i++) {\n        var group = matchGroups[i];\n        if(group[axId]) return 'g' + i;\n    }\n    return axId;\n};\n\n},{\"../../registry\":269,\"./constants\":228}],226:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nfunction findCategories(ax, opts) {\n    var dataAttr = opts.dataAttr || ax._id.charAt(0);\n    var lookup = {};\n    var axData;\n    var i, j;\n\n    if(opts.axData) {\n        // non-x/y case\n        axData = opts.axData;\n    } else {\n        // x/y case\n        axData = [];\n        for(i = 0; i < opts.data.length; i++) {\n            var trace = opts.data[i];\n            if(trace[dataAttr + 'axis'] === ax._id) {\n                axData.push(trace);\n            }\n        }\n    }\n\n    for(i = 0; i < axData.length; i++) {\n        var vals = axData[i][dataAttr];\n        for(j = 0; j < vals.length; j++) {\n            var v = vals[j];\n            if(v !== null && v !== undefined) {\n                lookup[v] = 1;\n            }\n        }\n    }\n\n    return Object.keys(lookup);\n}\n\n/**\n * Fills in category* default and initial categories.\n *\n * @param {object} containerIn : input axis object\n * @param {object} containerOut : full axis object\n * @param {function} coerce : Lib.coerce fn wrapper\n * @param {object} opts :\n *   - data {array} : (full) data trace\n * OR\n *   - axData {array} : (full) data associated with axis being coerced here\n *   - dataAttr {string} : attribute name corresponding to coordinate array\n */\nmodule.exports = function handleCategoryOrderDefaults(containerIn, containerOut, coerce, opts) {\n    if(containerOut.type !== 'category') return;\n\n    var arrayIn = containerIn.categoryarray;\n    var isValidArray = (Array.isArray(arrayIn) && arrayIn.length > 0);\n\n    // override default 'categoryorder' value when non-empty array is supplied\n    var orderDefault;\n    if(isValidArray) orderDefault = 'array';\n\n    var order = coerce('categoryorder', orderDefault);\n    var array;\n\n    // coerce 'categoryarray' only in array order case\n    if(order === 'array') {\n        array = coerce('categoryarray');\n    }\n\n    // cannot set 'categoryorder' to 'array' with an invalid 'categoryarray'\n    if(!isValidArray && order === 'array') {\n        order = containerOut.categoryorder = 'trace';\n    }\n\n    // set up things for makeCalcdata\n    if(order === 'trace') {\n        containerOut._initialCategories = [];\n    } else if(order === 'array') {\n        containerOut._initialCategories = array.slice();\n    } else {\n        array = findCategories(containerOut, opts).sort();\n        if(order === 'category ascending') {\n            containerOut._initialCategories = array;\n        } else if(order === 'category descending') {\n            containerOut._initialCategories = array.reverse();\n        }\n    }\n};\n\n},{}],227:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\nvar ONEDAY = _dereq_('../../constants/numerical').ONEDAY;\n\n/**\n * Return a validated dtick value for this axis\n *\n * @param {any} dtick: the candidate dtick. valid values are numbers and strings,\n *     and further constrained depending on the axis type.\n * @param {string} axType: the axis type\n */\nexports.dtick = function(dtick, axType) {\n    var isLog = axType === 'log';\n    var isDate = axType === 'date';\n    var isCat = axType === 'category';\n    var dtickDflt = isDate ? ONEDAY : 1;\n\n    if(!dtick) return dtickDflt;\n\n    if(isNumeric(dtick)) {\n        dtick = Number(dtick);\n        if(dtick <= 0) return dtickDflt;\n        if(isCat) {\n            // category dtick must be positive integers\n            return Math.max(1, Math.round(dtick));\n        }\n        if(isDate) {\n            // date dtick must be at least 0.1ms (our current precision)\n            return Math.max(0.1, dtick);\n        }\n        return dtick;\n    }\n\n    if(typeof dtick !== 'string' || !(isDate || isLog)) {\n        return dtickDflt;\n    }\n\n    var prefix = dtick.charAt(0);\n    var dtickNum = dtick.substr(1);\n    dtickNum = isNumeric(dtickNum) ? Number(dtickNum) : 0;\n\n    if((dtickNum <= 0) || !(\n            // \"M<n>\" gives ticks every (integer) n months\n            (isDate && prefix === 'M' && dtickNum === Math.round(dtickNum)) ||\n            // \"L<f>\" gives ticks linearly spaced in data (not in position) every (float) f\n            (isLog && prefix === 'L') ||\n            // \"D1\" gives powers of 10 with all small digits between, \"D2\" gives only 2 and 5\n            (isLog && prefix === 'D' && (dtickNum === 1 || dtickNum === 2))\n        )) {\n        return dtickDflt;\n    }\n\n    return dtick;\n};\n\n/**\n * Return a validated tick0 for this axis\n *\n * @param {any} tick0: the candidate tick0. Valid values are numbers and strings,\n *     further constrained depending on the axis type\n * @param {string} axType: the axis type\n * @param {string} calendar: for date axes, the calendar to validate/convert with\n * @param {any} dtick: an already valid dtick. Only used for D1 and D2 log dticks,\n *     which do not support tick0 at all.\n */\nexports.tick0 = function(tick0, axType, calendar, dtick) {\n    if(axType === 'date') {\n        return Lib.cleanDate(tick0, Lib.dateTick0(calendar));\n    }\n    if(dtick === 'D1' || dtick === 'D2') {\n        // D1 and D2 modes ignore tick0 entirely\n        return undefined;\n    }\n    // Aside from date axes, tick0 must be numeric\n    return isNumeric(tick0) ? Number(tick0) : 0;\n};\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"fast-isnumeric\":18}],228:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar counterRegex = _dereq_('../../lib/regex').counter;\n\nmodule.exports = {\n    idRegex: {\n        x: counterRegex('x'),\n        y: counterRegex('y')\n    },\n\n    attrRegex: counterRegex('[xy]axis'),\n\n    // axis match regular expression\n    xAxisMatch: counterRegex('xaxis'),\n    yAxisMatch: counterRegex('yaxis'),\n\n    // pattern matching axis ids and names\n    // note that this is more permissive than counterRegex, as\n    // id2name, name2id, and cleanId accept \"x1\" etc\n    AX_ID_PATTERN: /^[xyz][0-9]*$/,\n    AX_NAME_PATTERN: /^[xyz]axis[0-9]*$/,\n\n    // and for 2D subplots\n    SUBPLOT_PATTERN: /^x([0-9]*)y([0-9]*)$/,\n\n    HOUR_PATTERN: 'hour',\n    WEEKDAY_PATTERN: 'day of week',\n\n    // pixels to move mouse before you stop clamping to starting point\n    MINDRAG: 8,\n\n    // smallest dimension allowed for a select box\n    MINSELECT: 12,\n\n    // smallest dimension allowed for a zoombox\n    MINZOOM: 20,\n\n    // width of axis drag regions\n    DRAGGERSIZE: 20,\n\n    // max pixels off straight before a lasso select line counts as bent\n    BENDPX: 1.5,\n\n    // delay before a redraw (relayout) after smooth panning and zooming\n    REDRAWDELAY: 50,\n\n    // throttling limit (ms) for selectPoints calls\n    SELECTDELAY: 100,\n\n    // cache ID suffix for throttle\n    SELECTID: '-select',\n\n    // last resort axis ranges for x and y axes if we have no data\n    DFLTRANGEX: [-1, 6],\n    DFLTRANGEY: [-1, 4],\n\n    // Layers to keep trace types in the right order\n    // N.B. each  'unique' plot method must have its own layer\n    traceLayerClasses: [\n        'imagelayer',\n        'heatmaplayer',\n        'contourcarpetlayer', 'contourlayer',\n        'funnellayer', 'waterfalllayer', 'barlayer',\n        'carpetlayer',\n        'violinlayer',\n        'boxlayer',\n        'ohlclayer',\n        'scattercarpetlayer', 'scatterlayer'\n    ],\n\n    clipOnAxisFalseQuery: [\n        '.scatterlayer',\n        '.barlayer',\n        '.funnellayer',\n        '.waterfalllayer'\n    ],\n\n    layerValue2layerClass: {\n        'above traces': 'above',\n        'below traces': 'below'\n    }\n};\n\n},{\"../../lib/regex\":193}],229:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar id2name = _dereq_('./axis_ids').id2name;\nvar scaleZoom = _dereq_('./scale_zoom');\nvar makePadFn = _dereq_('./autorange').makePadFn;\nvar concatExtremes = _dereq_('./autorange').concatExtremes;\n\nvar ALMOST_EQUAL = _dereq_('../../constants/numerical').ALMOST_EQUAL;\nvar FROM_BL = _dereq_('../../constants/alignment').FROM_BL;\n\nexports.handleConstraintDefaults = function(containerIn, containerOut, coerce, opts) {\n    var allAxisIds = opts.allAxisIds;\n    var layoutOut = opts.layoutOut;\n    var scaleanchorDflt = opts.scaleanchorDflt;\n    var constrainDflt = opts.constrainDflt;\n    var constraintGroups = layoutOut._axisConstraintGroups;\n    var matchGroups = layoutOut._axisMatchGroups;\n    var axId = containerOut._id;\n    var axLetter = axId.charAt(0);\n    var splomStash = ((layoutOut._splomAxes || {})[axLetter] || {})[axId] || {};\n    var thisID = containerOut._id;\n    var letter = thisID.charAt(0);\n\n    // coerce the constraint mechanics even if this axis has no scaleanchor\n    // because it may be the anchor of another axis.\n    var constrain = coerce('constrain', constrainDflt);\n    Lib.coerce(containerIn, containerOut, {\n        constraintoward: {\n            valType: 'enumerated',\n            values: letter === 'x' ? ['left', 'center', 'right'] : ['bottom', 'middle', 'top'],\n            dflt: letter === 'x' ? 'center' : 'middle'\n        }\n    }, 'constraintoward');\n\n    var matches, matchOpts;\n\n    if((containerIn.matches || splomStash.matches) && !containerOut.fixedrange) {\n        matchOpts = getConstraintOpts(matchGroups, thisID, allAxisIds, layoutOut);\n        matches = Lib.coerce(containerIn, containerOut, {\n            matches: {\n                valType: 'enumerated',\n                values: matchOpts.linkableAxes || [],\n                dflt: splomStash.matches\n            }\n        }, 'matches');\n    }\n\n    // 'matches' wins over 'scaleanchor' (for now)\n    var scaleanchor, scaleOpts;\n\n    if(!matches &&\n       !(containerOut.fixedrange && constrain !== 'domain') &&\n       (containerIn.scaleanchor || scaleanchorDflt)\n     ) {\n        scaleOpts = getConstraintOpts(constraintGroups, thisID, allAxisIds, layoutOut, constrain);\n        scaleanchor = Lib.coerce(containerIn, containerOut, {\n            scaleanchor: {\n                valType: 'enumerated',\n                values: scaleOpts.linkableAxes || []\n            }\n        }, 'scaleanchor', scaleanchorDflt);\n    }\n\n    if(matches) {\n        delete containerOut.constrain;\n        updateConstraintGroups(matchGroups, matchOpts.thisGroup, thisID, matches, 1);\n    } else if(allAxisIds.indexOf(containerIn.matches) !== -1) {\n        Lib.warn('ignored ' + containerOut._name + '.matches: \"' +\n            containerIn.matches + '\" to avoid either an infinite loop ' +\n            'or because the target axis has fixed range.');\n    }\n\n    if(scaleanchor) {\n        var scaleratio = coerce('scaleratio');\n\n        // TODO: I suppose I could do attribute.min: Number.MIN_VALUE to avoid zero,\n        // but that seems hacky. Better way to say \"must be a positive number\"?\n        // Of course if you use several super-tiny values you could eventually\n        // force a product of these to zero and all hell would break loose...\n        // Likewise with super-huge values.\n        if(!scaleratio) scaleratio = containerOut.scaleratio = 1;\n\n        updateConstraintGroups(constraintGroups, scaleOpts.thisGroup, thisID, scaleanchor, scaleratio);\n    } else if(allAxisIds.indexOf(containerIn.scaleanchor) !== -1) {\n        Lib.warn('ignored ' + containerOut._name + '.scaleanchor: \"' +\n            containerIn.scaleanchor + '\" to avoid either an infinite loop ' +\n            'and possibly inconsistent scaleratios, or because the target ' +\n            'axis has fixed range or this axis declares a *matches* constraint.');\n    }\n};\n\n// If this axis is already part of a constraint group, we can't\n// scaleanchor any other axis in that group, or we'd make a loop.\n// Filter allAxisIds to enforce this, also matching axis types.\nfunction getConstraintOpts(groups, thisID, allAxisIds, layoutOut, constrain) {\n    var doesNotConstrainRange = constrain !== 'range';\n    var thisType = layoutOut[id2name(thisID)].type;\n    var i, j, idj, axj;\n\n    var linkableAxes = [];\n    for(j = 0; j < allAxisIds.length; j++) {\n        idj = allAxisIds[j];\n        if(idj === thisID) continue;\n\n        axj = layoutOut[id2name(idj)];\n        if(axj.type === thisType) {\n            if(!axj.fixedrange) {\n                linkableAxes.push(idj);\n            } else if(doesNotConstrainRange && axj.anchor) {\n                // allow domain constraints on subplots where\n                // BOTH axes have fixedrange:true and constrain:domain\n                var counterAxj = layoutOut[id2name(axj.anchor)];\n                if(counterAxj.fixedrange) {\n                    linkableAxes.push(idj);\n                }\n            }\n        }\n    }\n\n    for(i = 0; i < groups.length; i++) {\n        if(groups[i][thisID]) {\n            var thisGroup = groups[i];\n\n            var linkableAxesNoLoops = [];\n            for(j = 0; j < linkableAxes.length; j++) {\n                idj = linkableAxes[j];\n                if(!thisGroup[idj]) linkableAxesNoLoops.push(idj);\n            }\n            return {linkableAxes: linkableAxesNoLoops, thisGroup: thisGroup};\n        }\n    }\n\n    return {linkableAxes: linkableAxes, thisGroup: null};\n}\n\n/*\n * Add this axis to the axis constraint groups, which is the collection\n * of axes that are all constrained together on scale.\n *\n * constraintGroups: a list of objects. each object is\n * {axis_id: scale_within_group}, where scale_within_group is\n * only important relative to the rest of the group, and defines\n * the relative scales between all axes in the group\n *\n * thisGroup: the group the current axis is already in\n * thisID: the id if the current axis\n * scaleanchor: the id of the axis to scale it with\n * scaleratio: the ratio of this axis to the scaleanchor axis\n */\nfunction updateConstraintGroups(constraintGroups, thisGroup, thisID, scaleanchor, scaleratio) {\n    var i, j, groupi, keyj, thisGroupIndex;\n\n    if(thisGroup === null) {\n        thisGroup = {};\n        thisGroup[thisID] = 1;\n        thisGroupIndex = constraintGroups.length;\n        constraintGroups.push(thisGroup);\n    } else {\n        thisGroupIndex = constraintGroups.indexOf(thisGroup);\n    }\n\n    var thisGroupKeys = Object.keys(thisGroup);\n\n    // we know that this axis isn't in any other groups, but we don't know\n    // about the scaleanchor axis. If it is, we need to merge the groups.\n    for(i = 0; i < constraintGroups.length; i++) {\n        groupi = constraintGroups[i];\n        if(i !== thisGroupIndex && groupi[scaleanchor]) {\n            var baseScale = groupi[scaleanchor];\n            for(j = 0; j < thisGroupKeys.length; j++) {\n                keyj = thisGroupKeys[j];\n                groupi[keyj] = baseScale * scaleratio * thisGroup[keyj];\n            }\n            constraintGroups.splice(thisGroupIndex, 1);\n            return;\n        }\n    }\n\n    // otherwise, we insert the new scaleanchor axis as the base scale (1)\n    // in its group, and scale the rest of the group to it\n    if(scaleratio !== 1) {\n        for(j = 0; j < thisGroupKeys.length; j++) {\n            thisGroup[thisGroupKeys[j]] *= scaleratio;\n        }\n    }\n    thisGroup[scaleanchor] = 1;\n}\n\nexports.enforce = function enforce(gd) {\n    var fullLayout = gd._fullLayout;\n    var constraintGroups = fullLayout._axisConstraintGroups || [];\n\n    var i, j, axisID, ax, normScale, mode, factor;\n\n    for(i = 0; i < constraintGroups.length; i++) {\n        var group = constraintGroups[i];\n        var axisIDs = Object.keys(group);\n\n        var minScale = Infinity;\n        var maxScale = 0;\n        // mostly matchScale will be the same as minScale\n        // ie we expand axis ranges to encompass *everything*\n        // that's currently in any of their ranges, but during\n        // autorange of a subset of axes we will ignore other\n        // axes for this purpose.\n        var matchScale = Infinity;\n        var normScales = {};\n        var axes = {};\n        var hasAnyDomainConstraint = false;\n\n        // find the (normalized) scale of each axis in the group\n        for(j = 0; j < axisIDs.length; j++) {\n            axisID = axisIDs[j];\n            axes[axisID] = ax = fullLayout[id2name(axisID)];\n\n            if(ax._inputDomain) ax.domain = ax._inputDomain.slice();\n            else ax._inputDomain = ax.domain.slice();\n\n            if(!ax._inputRange) ax._inputRange = ax.range.slice();\n\n            // set axis scale here so we can use _m rather than\n            // having to calculate it from length and range\n            ax.setScale();\n\n            // abs: inverted scales still satisfy the constraint\n            normScales[axisID] = normScale = Math.abs(ax._m) / group[axisID];\n            minScale = Math.min(minScale, normScale);\n            if(ax.constrain === 'domain' || !ax._constraintShrinkable) {\n                matchScale = Math.min(matchScale, normScale);\n            }\n\n            // this has served its purpose, so remove it\n            delete ax._constraintShrinkable;\n            maxScale = Math.max(maxScale, normScale);\n\n            if(ax.constrain === 'domain') hasAnyDomainConstraint = true;\n        }\n\n        // Do we have a constraint mismatch? Give a small buffer for rounding errors\n        if(minScale > ALMOST_EQUAL * maxScale && !hasAnyDomainConstraint) continue;\n\n        // now increase any ranges we need to until all normalized scales are equal\n        for(j = 0; j < axisIDs.length; j++) {\n            axisID = axisIDs[j];\n            normScale = normScales[axisID];\n            ax = axes[axisID];\n            mode = ax.constrain;\n\n            // even if the scale didn't change, if we're shrinking domain\n            // we need to recalculate in case `constraintoward` changed\n            if(normScale !== matchScale || mode === 'domain') {\n                factor = normScale / matchScale;\n\n                if(mode === 'range') {\n                    scaleZoom(ax, factor);\n                } else {\n                    // mode === 'domain'\n\n                    var inputDomain = ax._inputDomain;\n                    var domainShrunk = (ax.domain[1] - ax.domain[0]) /\n                        (inputDomain[1] - inputDomain[0]);\n                    var rangeShrunk = (ax.r2l(ax.range[1]) - ax.r2l(ax.range[0])) /\n                        (ax.r2l(ax._inputRange[1]) - ax.r2l(ax._inputRange[0]));\n\n                    factor /= domainShrunk;\n\n                    if(factor * rangeShrunk < 1) {\n                        // we've asked to magnify the axis more than we can just by\n                        // enlarging the domain - so we need to constrict range\n                        ax.domain = ax._input.domain = inputDomain.slice();\n                        scaleZoom(ax, factor);\n                        continue;\n                    }\n\n                    if(rangeShrunk < 1) {\n                        // the range has previously been constricted by ^^, but we've\n                        // switched to the domain-constricted regime, so reset range\n                        ax.range = ax._input.range = ax._inputRange.slice();\n                        factor *= rangeShrunk;\n                    }\n\n                    if(ax.autorange) {\n                        /*\n                         * range & factor may need to change because range was\n                         * calculated for the larger scaling, so some pixel\n                         * paddings may get cut off when we reduce the domain.\n                         *\n                         * This is easier than the regular autorange calculation\n                         * because we already know the scaling `m`, but we still\n                         * need to cut out impossible constraints (like\n                         * annotations with super-long arrows). That's what\n                         * outerMin/Max are for - if the expansion was going to\n                         * go beyond the original domain, it must be impossible\n                         */\n                        var rl0 = ax.r2l(ax.range[0]);\n                        var rl1 = ax.r2l(ax.range[1]);\n                        var rangeCenter = (rl0 + rl1) / 2;\n                        var rangeMin = rangeCenter;\n                        var rangeMax = rangeCenter;\n                        var halfRange = Math.abs(rl1 - rangeCenter);\n                        // extra tiny bit for rounding errors, in case we actually\n                        // *are* expanding to the full domain\n                        var outerMin = rangeCenter - halfRange * factor * 1.0001;\n                        var outerMax = rangeCenter + halfRange * factor * 1.0001;\n                        var getPad = makePadFn(ax);\n\n                        updateDomain(ax, factor);\n                        var m = Math.abs(ax._m);\n                        var extremes = concatExtremes(gd, ax);\n                        var minArray = extremes.min;\n                        var maxArray = extremes.max;\n                        var newVal;\n                        var k;\n\n                        for(k = 0; k < minArray.length; k++) {\n                            newVal = minArray[k].val - getPad(minArray[k]) / m;\n                            if(newVal > outerMin && newVal < rangeMin) {\n                                rangeMin = newVal;\n                            }\n                        }\n\n                        for(k = 0; k < maxArray.length; k++) {\n                            newVal = maxArray[k].val + getPad(maxArray[k]) / m;\n                            if(newVal < outerMax && newVal > rangeMax) {\n                                rangeMax = newVal;\n                            }\n                        }\n\n                        var domainExpand = (rangeMax - rangeMin) / (2 * halfRange);\n                        factor /= domainExpand;\n\n                        rangeMin = ax.l2r(rangeMin);\n                        rangeMax = ax.l2r(rangeMax);\n                        ax.range = ax._input.range = (rl0 < rl1) ?\n                            [rangeMin, rangeMax] : [rangeMax, rangeMin];\n                    }\n\n                    updateDomain(ax, factor);\n                }\n            }\n        }\n    }\n};\n\n// For use before autoranging, check if this axis was previously constrained\n// by domain but no longer is\nexports.clean = function clean(gd, ax) {\n    if(ax._inputDomain) {\n        var isConstrained = false;\n        var axId = ax._id;\n        var constraintGroups = gd._fullLayout._axisConstraintGroups;\n        for(var j = 0; j < constraintGroups.length; j++) {\n            if(constraintGroups[j][axId]) {\n                isConstrained = true;\n                break;\n            }\n        }\n        if(!isConstrained || ax.constrain !== 'domain') {\n            ax._input.domain = ax.domain = ax._inputDomain;\n            delete ax._inputDomain;\n        }\n    }\n};\n\nfunction updateDomain(ax, factor) {\n    var inputDomain = ax._inputDomain;\n    var centerFraction = FROM_BL[ax.constraintoward];\n    var center = inputDomain[0] + (inputDomain[1] - inputDomain[0]) * centerFraction;\n\n    ax.domain = ax._input.domain = [\n        center + (inputDomain[0] - center) / factor,\n        center + (inputDomain[1] - center) / factor\n    ];\n    ax.setScale();\n}\n\n},{\"../../constants/alignment\":154,\"../../constants/numerical\":158,\"../../lib\":178,\"./autorange\":221,\"./axis_ids\":225,\"./scale_zoom\":240}],230:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\nvar supportsPassive = _dereq_('has-passive-events');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Fx = _dereq_('../../components/fx');\nvar Axes = _dereq_('./axes');\nvar setCursor = _dereq_('../../lib/setcursor');\nvar dragElement = _dereq_('../../components/dragelement');\nvar helpers = _dereq_('../../components/dragelement/helpers');\nvar selectingOrDrawing = helpers.selectingOrDrawing;\nvar freeMode = helpers.freeMode;\n\nvar FROM_TL = _dereq_('../../constants/alignment').FROM_TL;\nvar clearGlCanvases = _dereq_('../../lib/clear_gl_canvases');\nvar redrawReglTraces = _dereq_('../../plot_api/subroutines').redrawReglTraces;\n\nvar Plots = _dereq_('../plots');\n\nvar getFromId = _dereq_('./axis_ids').getFromId;\nvar prepSelect = _dereq_('./select').prepSelect;\nvar clearSelect = _dereq_('./select').clearSelect;\nvar selectOnClick = _dereq_('./select').selectOnClick;\nvar scaleZoom = _dereq_('./scale_zoom');\n\nvar constants = _dereq_('./constants');\nvar MINDRAG = constants.MINDRAG;\nvar MINZOOM = constants.MINZOOM;\n\n// flag for showing \"doubleclick to zoom out\" only at the beginning\nvar SHOWZOOMOUTTIP = true;\n\n// dragBox: create an element to drag one or more axis ends\n// inputs:\n//      plotinfo - which subplot are we making dragboxes on?\n//      x,y,w,h - left, top, width, height of the box\n//      ns - how does this drag the vertical axis?\n//          'n' - top only\n//          's' - bottom only\n//          'ns' - top and bottom together, difference unchanged\n//      ew - same for horizontal axis\nfunction makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {\n    // mouseDown stores ms of first mousedown event in the last\n    // `gd._context.doubleClickDelay` ms on the drag bars\n    // numClicks stores how many mousedowns have been seen\n    // within `gd._context.doubleClickDelay` so we can check for click or doubleclick events\n    // dragged stores whether a drag has occurred, so we don't have to\n    // redraw unnecessarily, ie if no move bigger than MINDRAG or MINZOOM px\n    var zoomlayer = gd._fullLayout._zoomlayer;\n    var isMainDrag = (ns + ew === 'nsew');\n    var singleEnd = (ns + ew).length === 1;\n\n    // main subplot x and y (i.e. found in plotinfo - the main ones)\n    var xa0, ya0;\n    // {ax._id: ax} hash objects\n    var xaHash, yaHash;\n    // xaHash/yaHash values (arrays)\n    var xaxes, yaxes;\n    // main axis offsets\n    var xs, ys;\n    // main axis lengths\n    var pw, ph;\n    // contains keys 'xaHash', 'yaHash', 'xaxes', and 'yaxes'\n    // which are the x/y {ax._id: ax} hash objects and their values\n    // for linked axis relative to this subplot\n    var links;\n    // similar to `links` but for matching axes\n    var matches;\n    // set to ew/ns val when active, set to '' when inactive\n    var xActive, yActive;\n    // are all axes in this subplot are fixed?\n    var allFixedRanges;\n    // do we need to edit x/y ranges?\n    var editX, editY;\n    // graph-wide optimization flags\n    var hasScatterGl, hasSplom, hasSVG;\n    // collected changes to be made to the plot by relayout at the end\n    var updates;\n\n    function recomputeAxisLists() {\n        xa0 = plotinfo.xaxis;\n        ya0 = plotinfo.yaxis;\n        pw = xa0._length;\n        ph = ya0._length;\n        xs = xa0._offset;\n        ys = ya0._offset;\n\n        xaHash = {};\n        xaHash[xa0._id] = xa0;\n        yaHash = {};\n        yaHash[ya0._id] = ya0;\n\n        // if we're dragging two axes at once, also drag overlays\n        if(ns && ew) {\n            var overlays = plotinfo.overlays;\n            for(var i = 0; i < overlays.length; i++) {\n                var xa = overlays[i].xaxis;\n                xaHash[xa._id] = xa;\n                var ya = overlays[i].yaxis;\n                yaHash[ya._id] = ya;\n            }\n        }\n\n        xaxes = hashValues(xaHash);\n        yaxes = hashValues(yaHash);\n        xActive = isDirectionActive(xaxes, ew);\n        yActive = isDirectionActive(yaxes, ns);\n        allFixedRanges = !yActive && !xActive;\n\n        links = calcLinks(gd, gd._fullLayout._axisConstraintGroups, xaHash, yaHash);\n        matches = calcLinks(gd, gd._fullLayout._axisMatchGroups, xaHash, yaHash);\n        editX = ew || links.isSubplotConstrained || matches.isSubplotConstrained;\n        editY = ns || links.isSubplotConstrained || matches.isSubplotConstrained;\n\n        var fullLayout = gd._fullLayout;\n        hasScatterGl = fullLayout._has('scattergl');\n        hasSplom = fullLayout._has('splom');\n        hasSVG = fullLayout._has('svg');\n    }\n\n    recomputeAxisLists();\n\n    var cursor = getDragCursor(yActive + xActive, gd._fullLayout.dragmode, isMainDrag);\n    var dragger = makeRectDragger(plotinfo, ns + ew + 'drag', cursor, x, y, w, h);\n\n    // still need to make the element if the axes are disabled\n    // but nuke its events (except for maindrag which needs them for hover)\n    // and stop there\n    if(allFixedRanges && !isMainDrag) {\n        dragger.onmousedown = null;\n        dragger.style.pointerEvents = 'none';\n        return dragger;\n    }\n\n    var dragOptions = {\n        element: dragger,\n        gd: gd,\n        plotinfo: plotinfo\n    };\n\n    dragOptions.prepFn = function(e, startX, startY) {\n        var dragModePrev = dragOptions.dragmode;\n        var dragModeNow = gd._fullLayout.dragmode;\n        if(dragModeNow !== dragModePrev) {\n            dragOptions.dragmode = dragModeNow;\n        }\n\n        recomputeAxisLists();\n\n        if(!allFixedRanges) {\n            if(isMainDrag) {\n                // main dragger handles all drag modes, and changes\n                // to pan (or to zoom if it already is pan) on shift\n                if(e.shiftKey) {\n                    if(dragModeNow === 'pan') dragModeNow = 'zoom';\n                    else if(!selectingOrDrawing(dragModeNow)) dragModeNow = 'pan';\n                } else if(e.ctrlKey) {\n                    dragModeNow = 'pan';\n                }\n            } else {\n                // all other draggers just pan\n                dragModeNow = 'pan';\n            }\n        }\n\n        if(freeMode(dragModeNow)) dragOptions.minDrag = 1;\n        else dragOptions.minDrag = undefined;\n\n        if(selectingOrDrawing(dragModeNow)) {\n            dragOptions.xaxes = xaxes;\n            dragOptions.yaxes = yaxes;\n            // this attaches moveFn, clickFn, doneFn on dragOptions\n            prepSelect(e, startX, startY, dragOptions, dragModeNow);\n        } else {\n            dragOptions.clickFn = clickFn;\n            if(selectingOrDrawing(dragModePrev)) {\n                // TODO Fix potential bug\n                // Note: clearing / resetting selection state only happens, when user\n                // triggers at least one interaction in pan/zoom mode. Otherwise, the\n                // select/lasso outlines are deleted (in plots.js.cleanPlot) but the selection\n                // cache isn't cleared. So when the user switches back to select/lasso and\n                // 'adds to a selection' with Shift, the \"old\", seemingly removed outlines\n                // are redrawn again because the selection cache still holds their coordinates.\n                // However, this isn't easily solved, since plots.js would need\n                // to have a reference to the dragOptions object (which holds the\n                // selection cache).\n                clearAndResetSelect();\n            }\n\n            if(!allFixedRanges) {\n                if(dragModeNow === 'zoom') {\n                    dragOptions.moveFn = zoomMove;\n                    dragOptions.doneFn = zoomDone;\n\n                    // zoomMove takes care of the threshold, but we need to\n                    // minimize this so that constrained zoom boxes will flip\n                    // orientation at the right place\n                    dragOptions.minDrag = 1;\n\n                    zoomPrep(e, startX, startY);\n                } else if(dragModeNow === 'pan') {\n                    dragOptions.moveFn = plotDrag;\n                    dragOptions.doneFn = dragTail;\n                }\n            }\n        }\n\n        gd._fullLayout._redrag = function() {\n            var dragDataNow = gd._dragdata;\n\n            if(dragDataNow && dragDataNow.element === dragger) {\n                var dragModeNow = gd._fullLayout.dragmode;\n\n                if(!selectingOrDrawing(dragModeNow)) {\n                    recomputeAxisLists();\n                    updateSubplots([0, 0, pw, ph]);\n                    dragOptions.moveFn(dragDataNow.dx, dragDataNow.dy);\n                }\n\n                // TODO should we try to \"re-select\" under select/lasso modes?\n                // probably best to wait for https://github.com/plotly/plotly.js/issues/1851\n            }\n        };\n    };\n\n    function clearAndResetSelect() {\n        // clear selection polygon cache (if any)\n        dragOptions.plotinfo.selection = false;\n        // clear selection outlines\n        clearSelect(gd);\n    }\n\n    function clickFn(numClicks, evt) {\n        var gd = dragOptions.gd;\n        if(gd._fullLayout._activeShapeIndex >= 0) {\n            gd._fullLayout._deactivateShape(gd);\n            return;\n        }\n\n        var clickmode = gd._fullLayout.clickmode;\n\n        removeZoombox(gd);\n\n        if(numClicks === 2 && !singleEnd) doubleClick();\n\n        if(isMainDrag) {\n            if(clickmode.indexOf('select') > -1) {\n                selectOnClick(evt, gd, xaxes, yaxes, plotinfo.id, dragOptions);\n            }\n\n            if(clickmode.indexOf('event') > -1) {\n                Fx.click(gd, evt, plotinfo.id);\n            }\n        } else if(numClicks === 1 && singleEnd) {\n            var ax = ns ? ya0 : xa0;\n            var end = (ns === 's' || ew === 'w') ? 0 : 1;\n            var attrStr = ax._name + '.range[' + end + ']';\n            var initialText = getEndText(ax, end);\n            var hAlign = 'left';\n            var vAlign = 'middle';\n\n            if(ax.fixedrange) return;\n\n            if(ns) {\n                vAlign = (ns === 'n') ? 'top' : 'bottom';\n                if(ax.side === 'right') hAlign = 'right';\n            } else if(ew === 'e') hAlign = 'right';\n\n            if(gd._context.showAxisRangeEntryBoxes) {\n                d3.select(dragger)\n                    .call(svgTextUtils.makeEditable, {\n                        gd: gd,\n                        immediate: true,\n                        background: gd._fullLayout.paper_bgcolor,\n                        text: String(initialText),\n                        fill: ax.tickfont ? ax.tickfont.color : '#444',\n                        horizontalAlign: hAlign,\n                        verticalAlign: vAlign\n                    })\n                    .on('edit', function(text) {\n                        var v = ax.d2r(text);\n                        if(v !== undefined) {\n                            Registry.call('_guiRelayout', gd, attrStr, v);\n                        }\n                    });\n            }\n        }\n    }\n\n    dragElement.init(dragOptions);\n\n    // x/y px position at start of drag\n    var x0, y0;\n    // bbox object of the zoombox\n    var box;\n    // luminance of bg behind zoombox\n    var lum;\n    // zoombox path outline\n    var path0;\n    // is zoombox dimmed (during drag)\n    var dimmed;\n    // 'x'-only, 'y' or 'xy' zooming\n    var zoomMode;\n    // zoombox d3 selection\n    var zb;\n    // zoombox corner d3 selection\n    var corners;\n    // zoom takes over minDrag, so it also has to take over gd._dragged\n    var zoomDragged;\n\n    function zoomPrep(e, startX, startY) {\n        var dragBBox = dragger.getBoundingClientRect();\n        x0 = startX - dragBBox.left;\n        y0 = startY - dragBBox.top;\n        box = {l: x0, r: x0, w: 0, t: y0, b: y0, h: 0};\n        lum = gd._hmpixcount ?\n            (gd._hmlumcount / gd._hmpixcount) :\n            tinycolor(gd._fullLayout.plot_bgcolor).getLuminance();\n        path0 = 'M0,0H' + pw + 'V' + ph + 'H0V0';\n        dimmed = false;\n        zoomMode = 'xy';\n        zoomDragged = false;\n        zb = makeZoombox(zoomlayer, lum, xs, ys, path0);\n        corners = makeCorners(zoomlayer, xs, ys);\n    }\n\n    function zoomMove(dx0, dy0) {\n        if(gd._transitioningWithDuration) {\n            return false;\n        }\n\n        var x1 = Math.max(0, Math.min(pw, dx0 + x0));\n        var y1 = Math.max(0, Math.min(ph, dy0 + y0));\n        var dx = Math.abs(x1 - x0);\n        var dy = Math.abs(y1 - y0);\n\n        box.l = Math.min(x0, x1);\n        box.r = Math.max(x0, x1);\n        box.t = Math.min(y0, y1);\n        box.b = Math.max(y0, y1);\n\n        function noZoom() {\n            zoomMode = '';\n            box.r = box.l;\n            box.t = box.b;\n            corners.attr('d', 'M0,0Z');\n        }\n\n        if(links.isSubplotConstrained) {\n            if(dx > MINZOOM || dy > MINZOOM) {\n                zoomMode = 'xy';\n                if(dx / pw > dy / ph) {\n                    dy = dx * ph / pw;\n                    if(y0 > y1) box.t = y0 - dy;\n                    else box.b = y0 + dy;\n                } else {\n                    dx = dy * pw / ph;\n                    if(x0 > x1) box.l = x0 - dx;\n                    else box.r = x0 + dx;\n                }\n                corners.attr('d', xyCorners(box));\n            } else {\n                noZoom();\n            }\n        } else if(matches.isSubplotConstrained) {\n            if(dx > MINZOOM || dy > MINZOOM) {\n                zoomMode = 'xy';\n\n                var r0 = Math.min(box.l / pw, (ph - box.b) / ph);\n                var r1 = Math.max(box.r / pw, (ph - box.t) / ph);\n\n                box.l = r0 * pw;\n                box.r = r1 * pw;\n                box.b = (1 - r0) * ph;\n                box.t = (1 - r1) * ph;\n                corners.attr('d', xyCorners(box));\n            } else {\n                noZoom();\n            }\n        } else if(!yActive || dy < Math.min(Math.max(dx * 0.6, MINDRAG), MINZOOM)) {\n            // look for small drags in one direction or the other,\n            // and only drag the other axis\n\n            if(dx < MINDRAG || !xActive) {\n                noZoom();\n            } else {\n                box.t = 0;\n                box.b = ph;\n                zoomMode = 'x';\n                corners.attr('d', xCorners(box, y0));\n            }\n        } else if(!xActive || dx < Math.min(dy * 0.6, MINZOOM)) {\n            box.l = 0;\n            box.r = pw;\n            zoomMode = 'y';\n            corners.attr('d', yCorners(box, x0));\n        } else {\n            zoomMode = 'xy';\n            corners.attr('d', xyCorners(box));\n        }\n        box.w = box.r - box.l;\n        box.h = box.b - box.t;\n\n        if(zoomMode) zoomDragged = true;\n        gd._dragged = zoomDragged;\n\n        updateZoombox(zb, corners, box, path0, dimmed, lum);\n        computeZoomUpdates();\n        gd.emit('plotly_relayouting', updates);\n        dimmed = true;\n    }\n\n    function computeZoomUpdates() {\n        updates = {};\n\n        // TODO: edit linked axes in zoomAxRanges and in dragTail\n        if(zoomMode === 'xy' || zoomMode === 'x') {\n            zoomAxRanges(xaxes, box.l / pw, box.r / pw, updates, links.xaxes);\n            updateMatchedAxRange('x', updates);\n        }\n        if(zoomMode === 'xy' || zoomMode === 'y') {\n            zoomAxRanges(yaxes, (ph - box.b) / ph, (ph - box.t) / ph, updates, links.yaxes);\n            updateMatchedAxRange('y', updates);\n        }\n    }\n\n    function zoomDone() {\n        computeZoomUpdates();\n        removeZoombox(gd);\n        dragTail();\n        showDoubleClickNotifier(gd);\n    }\n\n    // scroll zoom, on all draggers except corners\n    var scrollViewBox = [0, 0, pw, ph];\n    // wait a little after scrolling before redrawing\n    var redrawTimer = null;\n    var REDRAWDELAY = constants.REDRAWDELAY;\n    var mainplot = plotinfo.mainplot ? gd._fullLayout._plots[plotinfo.mainplot] : plotinfo;\n\n    function zoomWheel(e) {\n        // deactivate mousewheel scrolling on embedded graphs\n        // devs can override this with layout._enablescrollzoom,\n        // but _ ensures this setting won't leave their page\n        if(!gd._context._scrollZoom.cartesian && !gd._fullLayout._enablescrollzoom) {\n            return;\n        }\n\n        clearAndResetSelect();\n\n        // If a transition is in progress, then disable any behavior:\n        if(gd._transitioningWithDuration) {\n            e.preventDefault();\n            e.stopPropagation();\n            return;\n        }\n\n        recomputeAxisLists();\n\n        clearTimeout(redrawTimer);\n\n        var wheelDelta = -e.deltaY;\n        if(!isFinite(wheelDelta)) wheelDelta = e.wheelDelta / 10;\n        if(!isFinite(wheelDelta)) {\n            Lib.log('Did not find wheel motion attributes: ', e);\n            return;\n        }\n\n        var zoom = Math.exp(-Math.min(Math.max(wheelDelta, -20), 20) / 200);\n        var gbb = mainplot.draglayer.select('.nsewdrag').node().getBoundingClientRect();\n        var xfrac = (e.clientX - gbb.left) / gbb.width;\n        var yfrac = (gbb.bottom - e.clientY) / gbb.height;\n        var i;\n\n        function zoomWheelOneAxis(ax, centerFraction, zoom) {\n            if(ax.fixedrange) return;\n\n            var axRange = Lib.simpleMap(ax.range, ax.r2l);\n            var v0 = axRange[0] + (axRange[1] - axRange[0]) * centerFraction;\n            function doZoom(v) { return ax.l2r(v0 + (v - v0) * zoom); }\n            ax.range = axRange.map(doZoom);\n        }\n\n        if(editX) {\n            // if we're only zooming this axis because of constraints,\n            // zoom it about the center\n            if(!ew) xfrac = 0.5;\n\n            for(i = 0; i < xaxes.length; i++) {\n                zoomWheelOneAxis(xaxes[i], xfrac, zoom);\n            }\n            updateMatchedAxRange('x');\n\n            scrollViewBox[2] *= zoom;\n            scrollViewBox[0] += scrollViewBox[2] * xfrac * (1 / zoom - 1);\n        }\n        if(editY) {\n            if(!ns) yfrac = 0.5;\n\n            for(i = 0; i < yaxes.length; i++) {\n                zoomWheelOneAxis(yaxes[i], yfrac, zoom);\n            }\n            updateMatchedAxRange('y');\n\n            scrollViewBox[3] *= zoom;\n            scrollViewBox[1] += scrollViewBox[3] * (1 - yfrac) * (1 / zoom - 1);\n        }\n\n        // viewbox redraw at first\n        updateSubplots(scrollViewBox);\n        ticksAndAnnotations();\n\n        gd.emit('plotly_relayouting', updates);\n\n        // then replot after a delay to make sure\n        // no more scrolling is coming\n        redrawTimer = setTimeout(function() {\n            scrollViewBox = [0, 0, pw, ph];\n            dragTail();\n        }, REDRAWDELAY);\n\n        e.preventDefault();\n        return;\n    }\n\n    // everything but the corners gets wheel zoom\n    if(ns.length * ew.length !== 1) {\n        attachWheelEventHandler(dragger, zoomWheel);\n    }\n\n    // plotDrag: move the plot in response to a drag\n    function plotDrag(dx, dy) {\n        // If a transition is in progress, then disable any behavior:\n        if(gd._transitioningWithDuration) {\n            return;\n        }\n\n        // prevent axis drawing from monkeying with margins until we're done\n        gd._fullLayout._replotting = true;\n\n        if(xActive === 'ew' || yActive === 'ns') {\n            if(xActive) {\n                dragAxList(xaxes, dx);\n                updateMatchedAxRange('x');\n            }\n            if(yActive) {\n                dragAxList(yaxes, dy);\n                updateMatchedAxRange('y');\n            }\n            updateSubplots([xActive ? -dx : 0, yActive ? -dy : 0, pw, ph]);\n            ticksAndAnnotations();\n            gd.emit('plotly_relayouting', updates);\n            return;\n        }\n\n        // dz: set a new value for one end (0 or 1) of an axis array axArray,\n        // and return a pixel shift for that end for the viewbox\n        // based on pixel drag distance d\n        // TODO: this makes (generally non-fatal) errors when you get\n        // near floating point limits\n        function dz(axArray, end, d) {\n            var otherEnd = 1 - end;\n            var movedAx;\n            var newLinearizedEnd;\n            for(var i = 0; i < axArray.length; i++) {\n                var axi = axArray[i];\n                if(axi.fixedrange) continue;\n                movedAx = axi;\n                newLinearizedEnd = axi._rl[otherEnd] +\n                    (axi._rl[end] - axi._rl[otherEnd]) / dZoom(d / axi._length);\n                var newEnd = axi.l2r(newLinearizedEnd);\n\n                // if l2r comes back false or undefined, it means we've dragged off\n                // the end of valid ranges - so stop.\n                if(newEnd !== false && newEnd !== undefined) axi.range[end] = newEnd;\n            }\n            return movedAx._length * (movedAx._rl[end] - newLinearizedEnd) /\n                (movedAx._rl[end] - movedAx._rl[otherEnd]);\n        }\n\n        if(links.isSubplotConstrained && xActive && yActive) {\n            // dragging a corner of a constrained subplot:\n            // respect the fixed corner, but harmonize dx and dy\n            var dxySign = ((xActive === 'w') === (yActive === 'n')) ? 1 : -1;\n            var dxyFraction = (dx / pw + dxySign * dy / ph) / 2;\n            dx = dxyFraction * pw;\n            dy = dxySign * dxyFraction * ph;\n        }\n\n        if(xActive === 'w') dx = dz(xaxes, 0, dx);\n        else if(xActive === 'e') dx = dz(xaxes, 1, -dx);\n        else if(!xActive) dx = 0;\n\n        if(yActive === 'n') dy = dz(yaxes, 1, dy);\n        else if(yActive === 's') dy = dz(yaxes, 0, -dy);\n        else if(!yActive) dy = 0;\n\n        var xStart = (xActive === 'w') ? dx : 0;\n        var yStart = (yActive === 'n') ? dy : 0;\n\n        if(links.isSubplotConstrained) {\n            var i;\n            if(!xActive && yActive.length === 1) {\n                // dragging one end of the y axis of a constrained subplot\n                // scale the other axis the same about its middle\n                for(i = 0; i < xaxes.length; i++) {\n                    xaxes[i].range = xaxes[i]._r.slice();\n                    scaleZoom(xaxes[i], 1 - dy / ph);\n                }\n                dx = dy * pw / ph;\n                xStart = dx / 2;\n            }\n            if(!yActive && xActive.length === 1) {\n                for(i = 0; i < yaxes.length; i++) {\n                    yaxes[i].range = yaxes[i]._r.slice();\n                    scaleZoom(yaxes[i], 1 - dx / pw);\n                }\n                dy = dx * ph / pw;\n                yStart = dy / 2;\n            }\n        }\n\n        updateMatchedAxRange('x');\n        updateMatchedAxRange('y');\n        updateSubplots([xStart, yStart, pw - dx, ph - dy]);\n        ticksAndAnnotations();\n        gd.emit('plotly_relayouting', updates);\n    }\n\n    function updateMatchedAxRange(axLetter, out) {\n        var matchedAxes = matches.isSubplotConstrained ?\n            {x: yaxes, y: xaxes}[axLetter] :\n            matches[axLetter + 'axes'];\n\n        var constrainedAxes = matches.isSubplotConstrained ?\n            {x: xaxes, y: yaxes}[axLetter] :\n            [];\n\n        for(var i = 0; i < matchedAxes.length; i++) {\n            var ax = matchedAxes[i];\n            var axId = ax._id;\n            var axId2 = matches.xLinks[axId] || matches.yLinks[axId];\n            var ax2 = constrainedAxes[0] || xaHash[axId2] || yaHash[axId2];\n\n            if(ax2) {\n                if(out) {\n                    // zoombox case - don't mutate 'range', just add keys in 'updates'\n                    out[ax._name + '.range[0]'] = out[ax2._name + '.range[0]'];\n                    out[ax._name + '.range[1]'] = out[ax2._name + '.range[1]'];\n                } else {\n                    ax.range = ax2.range.slice();\n                }\n            }\n        }\n    }\n\n    // Draw ticks and annotations (and other components) when ranges change.\n    // Also records the ranges that have changed for use by update at the end.\n    function ticksAndAnnotations() {\n        var activeAxIds = [];\n        var i;\n\n        function pushActiveAxIds(axList) {\n            for(i = 0; i < axList.length; i++) {\n                if(!axList[i].fixedrange) activeAxIds.push(axList[i]._id);\n            }\n        }\n\n        if(editX) {\n            pushActiveAxIds(xaxes);\n            pushActiveAxIds(links.xaxes);\n            pushActiveAxIds(matches.xaxes);\n        }\n        if(editY) {\n            pushActiveAxIds(yaxes);\n            pushActiveAxIds(links.yaxes);\n            pushActiveAxIds(matches.yaxes);\n        }\n\n        updates = {};\n        for(i = 0; i < activeAxIds.length; i++) {\n            var axId = activeAxIds[i];\n            var ax = getFromId(gd, axId);\n            Axes.drawOne(gd, ax, {skipTitle: true});\n            updates[ax._name + '.range[0]'] = ax.range[0];\n            updates[ax._name + '.range[1]'] = ax.range[1];\n        }\n\n        Axes.redrawComponents(gd, activeAxIds);\n    }\n\n    function doubleClick() {\n        if(gd._transitioningWithDuration) return;\n\n        var doubleClickConfig = gd._context.doubleClick;\n\n        var axList = [];\n        if(xActive) axList = axList.concat(xaxes);\n        if(yActive) axList = axList.concat(yaxes);\n        if(matches.xaxes) axList = axList.concat(matches.xaxes);\n        if(matches.yaxes) axList = axList.concat(matches.yaxes);\n\n        var attrs = {};\n        var ax, i, rangeInitial;\n\n        // For reset+autosize mode:\n        // If *any* of the main axes is not at its initial range\n        // (or autoranged, if we have no initial range, to match the logic in\n        // doubleClickConfig === 'reset' below), we reset.\n        // If they are *all* at their initial ranges, then we autosize.\n        if(doubleClickConfig === 'reset+autosize') {\n            doubleClickConfig = 'autosize';\n\n            for(i = 0; i < axList.length; i++) {\n                ax = axList[i];\n                if((ax._rangeInitial && (\n                        ax.range[0] !== ax._rangeInitial[0] ||\n                        ax.range[1] !== ax._rangeInitial[1]\n                    )) ||\n                    (!ax._rangeInitial && !ax.autorange)\n                ) {\n                    doubleClickConfig = 'reset';\n                    break;\n                }\n            }\n        }\n\n        if(doubleClickConfig === 'autosize') {\n            // don't set the linked axes here, so relayout marks them as shrinkable\n            // and we autosize just to the requested axis/axes\n            for(i = 0; i < axList.length; i++) {\n                ax = axList[i];\n                if(!ax.fixedrange) attrs[ax._name + '.autorange'] = true;\n            }\n        } else if(doubleClickConfig === 'reset') {\n            // when we're resetting, reset all linked axes too, so we get back\n            // to the fully-auto-with-constraints situation\n            if(xActive || links.isSubplotConstrained) axList = axList.concat(links.xaxes);\n            if(yActive && !links.isSubplotConstrained) axList = axList.concat(links.yaxes);\n\n            if(links.isSubplotConstrained) {\n                if(!xActive) axList = axList.concat(xaxes);\n                else if(!yActive) axList = axList.concat(yaxes);\n            }\n\n            for(i = 0; i < axList.length; i++) {\n                ax = axList[i];\n\n                if(!ax.fixedrange) {\n                    if(!ax._rangeInitial) {\n                        attrs[ax._name + '.autorange'] = true;\n                    } else {\n                        rangeInitial = ax._rangeInitial;\n                        attrs[ax._name + '.range[0]'] = rangeInitial[0];\n                        attrs[ax._name + '.range[1]'] = rangeInitial[1];\n                    }\n                }\n            }\n        }\n\n        gd.emit('plotly_doubleclick', null);\n        Registry.call('_guiRelayout', gd, attrs);\n    }\n\n    // dragTail - finish a drag event with a redraw\n    function dragTail() {\n        // put the subplot viewboxes back to default (Because we're going to)\n        // be repositioning the data in the relayout. But DON'T call\n        // ticksAndAnnotations again - it's unnecessary and would overwrite `updates`\n        updateSubplots([0, 0, pw, ph]);\n\n        // since we may have been redrawing some things during the drag, we may have\n        // accumulated MathJax promises - wait for them before we relayout.\n        Lib.syncOrAsync([\n            Plots.previousPromises,\n            function() {\n                gd._fullLayout._replotting = false;\n                Registry.call('_guiRelayout', gd, updates);\n            }\n        ], gd);\n    }\n\n    // updateSubplots - find all plot viewboxes that should be\n    // affected by this drag, and update them. look for all plots\n    // sharing an affected axis (including the one being dragged),\n    // includes also scattergl and splom logic.\n    function updateSubplots(viewBox) {\n        var fullLayout = gd._fullLayout;\n        var plotinfos = fullLayout._plots;\n        var subplots = fullLayout._subplots.cartesian;\n        var i, sp, xa, ya;\n\n        if(hasSplom) {\n            Registry.subplotsRegistry.splom.drag(gd);\n        }\n\n        if(hasScatterGl) {\n            for(i = 0; i < subplots.length; i++) {\n                sp = plotinfos[subplots[i]];\n                xa = sp.xaxis;\n                ya = sp.yaxis;\n\n                if(sp._scene) {\n                    var xrng = Lib.simpleMap(xa.range, xa.r2l);\n                    var yrng = Lib.simpleMap(ya.range, ya.r2l);\n                    sp._scene.update({range: [xrng[0], yrng[0], xrng[1], yrng[1]]});\n                }\n            }\n        }\n\n        if(hasSplom || hasScatterGl) {\n            clearGlCanvases(gd);\n            redrawReglTraces(gd);\n        }\n\n        if(hasSVG) {\n            var xScaleFactor = viewBox[2] / xa0._length;\n            var yScaleFactor = viewBox[3] / ya0._length;\n\n            for(i = 0; i < subplots.length; i++) {\n                sp = plotinfos[subplots[i]];\n                xa = sp.xaxis;\n                ya = sp.yaxis;\n\n                var editX2 = editX && !xa.fixedrange && xaHash[xa._id];\n                var editY2 = editY && !ya.fixedrange && yaHash[ya._id];\n\n                var xScaleFactor2, yScaleFactor2;\n                var clipDx, clipDy;\n\n                if(editX2) {\n                    xScaleFactor2 = xScaleFactor;\n                    clipDx = ew ? viewBox[0] : getShift(xa, xScaleFactor2);\n                } else if(matches.xaHash[xa._id]) {\n                    xScaleFactor2 = xScaleFactor;\n                    clipDx = viewBox[0] * xa._length / xa0._length;\n                } else if(matches.yaHash[xa._id]) {\n                    xScaleFactor2 = yScaleFactor;\n                    clipDx = yActive === 'ns' ?\n                        -viewBox[1] * xa._length / ya0._length :\n                        getShift(xa, xScaleFactor2, {n: 'top', s: 'bottom'}[yActive]);\n                } else {\n                    xScaleFactor2 = getLinkedScaleFactor(xa, xScaleFactor, yScaleFactor);\n                    clipDx = scaleAndGetShift(xa, xScaleFactor2);\n                }\n\n                if(editY2) {\n                    yScaleFactor2 = yScaleFactor;\n                    clipDy = ns ? viewBox[1] : getShift(ya, yScaleFactor2);\n                } else if(matches.yaHash[ya._id]) {\n                    yScaleFactor2 = yScaleFactor;\n                    clipDy = viewBox[1] * ya._length / ya0._length;\n                } else if(matches.xaHash[ya._id]) {\n                    yScaleFactor2 = xScaleFactor;\n                    clipDy = xActive === 'ew' ?\n                        -viewBox[0] * ya._length / xa0._length :\n                        getShift(ya, yScaleFactor2, {e: 'right', w: 'left'}[xActive]);\n                } else {\n                    yScaleFactor2 = getLinkedScaleFactor(ya, xScaleFactor, yScaleFactor);\n                    clipDy = scaleAndGetShift(ya, yScaleFactor2);\n                }\n\n                // don't scale at all if neither axis is scalable here\n                if(!xScaleFactor2 && !yScaleFactor2) {\n                    continue;\n                }\n\n                // but if only one is, reset the other axis scaling\n                if(!xScaleFactor2) xScaleFactor2 = 1;\n                if(!yScaleFactor2) yScaleFactor2 = 1;\n\n                var plotDx = xa._offset - clipDx / xScaleFactor2;\n                var plotDy = ya._offset - clipDy / yScaleFactor2;\n\n                // TODO could be more efficient here:\n                // setTranslate and setScale do a lot of extra work\n                // when working independently, should perhaps combine\n                // them into a single routine.\n                sp.clipRect\n                    .call(Drawing.setTranslate, clipDx, clipDy)\n                    .call(Drawing.setScale, xScaleFactor2, yScaleFactor2);\n\n                sp.plot\n                    .call(Drawing.setTranslate, plotDx, plotDy)\n                    .call(Drawing.setScale, 1 / xScaleFactor2, 1 / yScaleFactor2);\n\n                // apply an inverse scale to individual points to counteract\n                // the scale of the trace group.\n                // apply only when scale changes, as adjusting the scale of\n                // all the points can be expansive.\n                if(xScaleFactor2 !== sp.xScaleFactor || yScaleFactor2 !== sp.yScaleFactor) {\n                    Drawing.setPointGroupScale(sp.zoomScalePts, xScaleFactor2, yScaleFactor2);\n                    Drawing.setTextPointsScale(sp.zoomScaleTxt, xScaleFactor2, yScaleFactor2);\n                }\n\n                Drawing.hideOutsideRangePoints(sp.clipOnAxisFalseTraces, sp);\n\n                // update x/y scaleFactor stash\n                sp.xScaleFactor = xScaleFactor2;\n                sp.yScaleFactor = yScaleFactor2;\n            }\n        }\n    }\n\n    // Find the appropriate scaling for this axis, if it's linked to the\n    // dragged axes by constraints. 0 is special, it means this axis shouldn't\n    // ever be scaled (will be converted to 1 if the other axis is scaled)\n    function getLinkedScaleFactor(ax, xScaleFactor, yScaleFactor) {\n        if(ax.fixedrange) return 0;\n\n        if(editX && links.xaHash[ax._id]) {\n            return xScaleFactor;\n        }\n        if(editY && (links.isSubplotConstrained ? links.xaHash : links.yaHash)[ax._id]) {\n            return yScaleFactor;\n        }\n        return 0;\n    }\n\n    function scaleAndGetShift(ax, scaleFactor) {\n        if(scaleFactor) {\n            ax.range = ax._r.slice();\n            scaleZoom(ax, scaleFactor);\n            return getShift(ax, scaleFactor);\n        }\n        return 0;\n    }\n\n    function getShift(ax, scaleFactor, from) {\n        return ax._length * (1 - scaleFactor) * FROM_TL[from || ax.constraintoward || 'middle'];\n    }\n\n    return dragger;\n}\n\nfunction makeDragger(plotinfo, nodeName, dragClass, cursor) {\n    var dragger3 = Lib.ensureSingle(plotinfo.draglayer, nodeName, dragClass, function(s) {\n        s.classed('drag', true)\n            .style({fill: 'transparent', 'stroke-width': 0})\n            .attr('data-subplot', plotinfo.id);\n    });\n\n    dragger3.call(setCursor, cursor);\n\n    return dragger3.node();\n}\n\nfunction makeRectDragger(plotinfo, dragClass, cursor, x, y, w, h) {\n    var dragger = makeDragger(plotinfo, 'rect', dragClass, cursor);\n    d3.select(dragger).call(Drawing.setRect, x, y, w, h);\n    return dragger;\n}\n\nfunction isDirectionActive(axList, activeVal) {\n    for(var i = 0; i < axList.length; i++) {\n        if(!axList[i].fixedrange) return activeVal;\n    }\n    return '';\n}\n\nfunction getEndText(ax, end) {\n    var initialVal = ax.range[end];\n    var diff = Math.abs(initialVal - ax.range[1 - end]);\n    var dig;\n\n    // TODO: this should basically be ax.r2d but we're doing extra\n    // rounding here... can we clean up at all?\n    if(ax.type === 'date') {\n        return initialVal;\n    } else if(ax.type === 'log') {\n        dig = Math.ceil(Math.max(0, -Math.log(diff) / Math.LN10)) + 3;\n        return d3.format('.' + dig + 'g')(Math.pow(10, initialVal));\n    } else { // linear numeric (or category... but just show numbers here)\n        dig = Math.floor(Math.log(Math.abs(initialVal)) / Math.LN10) -\n            Math.floor(Math.log(diff) / Math.LN10) + 4;\n        return d3.format('.' + String(dig) + 'g')(initialVal);\n    }\n}\n\nfunction zoomAxRanges(axList, r0Fraction, r1Fraction, updates, linkedAxes) {\n    for(var i = 0; i < axList.length; i++) {\n        var axi = axList[i];\n        if(axi.fixedrange) continue;\n\n        if(axi.rangebreaks) {\n            var isY = axi._id.charAt(0) === 'y';\n            var r0F = isY ? (1 - r0Fraction) : r0Fraction;\n            var r1F = isY ? (1 - r1Fraction) : r1Fraction;\n\n            updates[axi._name + '.range[0]'] = axi.l2r(axi.p2l(r0F * axi._length));\n            updates[axi._name + '.range[1]'] = axi.l2r(axi.p2l(r1F * axi._length));\n        } else {\n            var axRangeLinear0 = axi._rl[0];\n            var axRangeLinearSpan = axi._rl[1] - axRangeLinear0;\n            updates[axi._name + '.range[0]'] = axi.l2r(axRangeLinear0 + axRangeLinearSpan * r0Fraction);\n            updates[axi._name + '.range[1]'] = axi.l2r(axRangeLinear0 + axRangeLinearSpan * r1Fraction);\n        }\n    }\n\n    // zoom linked axes about their centers\n    if(linkedAxes && linkedAxes.length) {\n        var linkedR0Fraction = (r0Fraction + (1 - r1Fraction)) / 2;\n        zoomAxRanges(linkedAxes, linkedR0Fraction, 1 - linkedR0Fraction, updates, []);\n    }\n}\n\nfunction dragAxList(axList, pix) {\n    for(var i = 0; i < axList.length; i++) {\n        var axi = axList[i];\n        if(!axi.fixedrange) {\n            if(axi.rangebreaks) {\n                var p0 = 0;\n                var p1 = axi._length;\n                var d0 = axi.p2l(p0 + pix) - axi.p2l(p0);\n                var d1 = axi.p2l(p1 + pix) - axi.p2l(p1);\n                var delta = (d0 + d1) / 2;\n\n                axi.range = [\n                    axi.l2r(axi._rl[0] - delta),\n                    axi.l2r(axi._rl[1] - delta)\n                ];\n            } else {\n                axi.range = [\n                    axi.l2r(axi._rl[0] - pix / axi._m),\n                    axi.l2r(axi._rl[1] - pix / axi._m)\n                ];\n            }\n        }\n    }\n}\n\n// common transform for dragging one end of an axis\n// d>0 is compressing scale (cursor is over the plot,\n//  the axis end should move with the cursor)\n// d<0 is expanding (cursor is off the plot, axis end moves\n//  nonlinearly so you can expand far)\nfunction dZoom(d) {\n    return 1 - ((d >= 0) ? Math.min(d, 0.9) :\n        1 / (1 / Math.max(d, -0.3) + 3.222));\n}\n\nfunction getDragCursor(nsew, dragmode, isMainDrag) {\n    if(!nsew) return 'pointer';\n    if(nsew === 'nsew') {\n        // in this case here, clear cursor and\n        // use the cursor style set on <g .draglayer>\n        if(isMainDrag) return '';\n        if(dragmode === 'pan') return 'move';\n        return 'crosshair';\n    }\n    return nsew.toLowerCase() + '-resize';\n}\n\nfunction makeZoombox(zoomlayer, lum, xs, ys, path0) {\n    return zoomlayer.append('path')\n        .attr('class', 'zoombox')\n        .style({\n            'fill': lum > 0.2 ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)',\n            'stroke-width': 0\n        })\n        .attr('transform', 'translate(' + xs + ', ' + ys + ')')\n        .attr('d', path0 + 'Z');\n}\n\nfunction makeCorners(zoomlayer, xs, ys) {\n    return zoomlayer.append('path')\n        .attr('class', 'zoombox-corners')\n        .style({\n            fill: Color.background,\n            stroke: Color.defaultLine,\n            'stroke-width': 1,\n            opacity: 0\n        })\n        .attr('transform', 'translate(' + xs + ', ' + ys + ')')\n        .attr('d', 'M0,0Z');\n}\n\nfunction updateZoombox(zb, corners, box, path0, dimmed, lum) {\n    zb.attr('d',\n        path0 + 'M' + (box.l) + ',' + (box.t) + 'v' + (box.h) +\n        'h' + (box.w) + 'v-' + (box.h) + 'h-' + (box.w) + 'Z');\n    transitionZoombox(zb, corners, dimmed, lum);\n}\n\nfunction transitionZoombox(zb, corners, dimmed, lum) {\n    if(!dimmed) {\n        zb.transition()\n            .style('fill', lum > 0.2 ? 'rgba(0,0,0,0.4)' :\n                'rgba(255,255,255,0.3)')\n            .duration(200);\n        corners.transition()\n            .style('opacity', 1)\n            .duration(200);\n    }\n}\n\nfunction removeZoombox(gd) {\n    d3.select(gd)\n        .selectAll('.zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners')\n        .remove();\n}\n\nfunction showDoubleClickNotifier(gd) {\n    if(SHOWZOOMOUTTIP && gd.data && gd._context.showTips) {\n        Lib.notifier(Lib._(gd, 'Double-click to zoom back out'), 'long');\n        SHOWZOOMOUTTIP = false;\n    }\n}\n\nfunction xCorners(box, y0) {\n    return 'M' +\n        (box.l - 0.5) + ',' + (y0 - MINZOOM - 0.5) +\n        'h-3v' + (2 * MINZOOM + 1) + 'h3ZM' +\n        (box.r + 0.5) + ',' + (y0 - MINZOOM - 0.5) +\n        'h3v' + (2 * MINZOOM + 1) + 'h-3Z';\n}\n\nfunction yCorners(box, x0) {\n    return 'M' +\n        (x0 - MINZOOM - 0.5) + ',' + (box.t - 0.5) +\n        'v-3h' + (2 * MINZOOM + 1) + 'v3ZM' +\n        (x0 - MINZOOM - 0.5) + ',' + (box.b + 0.5) +\n        'v3h' + (2 * MINZOOM + 1) + 'v-3Z';\n}\n\nfunction xyCorners(box) {\n    var clen = Math.floor(Math.min(box.b - box.t, box.r - box.l, MINZOOM) / 2);\n    return 'M' +\n        (box.l - 3.5) + ',' + (box.t - 0.5 + clen) + 'h3v' + (-clen) +\n            'h' + clen + 'v-3h-' + (clen + 3) + 'ZM' +\n        (box.r + 3.5) + ',' + (box.t - 0.5 + clen) + 'h-3v' + (-clen) +\n            'h' + (-clen) + 'v-3h' + (clen + 3) + 'ZM' +\n        (box.r + 3.5) + ',' + (box.b + 0.5 - clen) + 'h-3v' + clen +\n            'h' + (-clen) + 'v3h' + (clen + 3) + 'ZM' +\n        (box.l - 3.5) + ',' + (box.b + 0.5 - clen) + 'h3v' + clen +\n            'h' + clen + 'v3h-' + (clen + 3) + 'Z';\n}\n\nfunction calcLinks(gd, groups, xaHash, yaHash) {\n    var isSubplotConstrained = false;\n    var xLinks = {};\n    var yLinks = {};\n    var xID, yID, xLinkID, yLinkID;\n\n    for(var i = 0; i < groups.length; i++) {\n        var group = groups[i];\n        // check if any of the x axes we're dragging is in this constraint group\n        for(xID in xaHash) {\n            if(group[xID]) {\n                // put the rest of these axes into xLinks, if we're not already\n                // dragging them, so we know to scale these axes automatically too\n                // to match the changes in the dragged x axes\n                for(xLinkID in group) {\n                    if(!(xLinkID.charAt(0) === 'x' ? xaHash : yaHash)[xLinkID]) {\n                        xLinks[xLinkID] = xID;\n                    }\n                }\n\n                // check if the x and y axes of THIS drag are linked\n                for(yID in yaHash) {\n                    if(group[yID]) isSubplotConstrained = true;\n                }\n            }\n        }\n\n        // now check if any of the y axes we're dragging is in this constraint group\n        // only look for outside links, as we've already checked for links within the dragger\n        for(yID in yaHash) {\n            if(group[yID]) {\n                for(yLinkID in group) {\n                    if(!(yLinkID.charAt(0) === 'x' ? xaHash : yaHash)[yLinkID]) {\n                        yLinks[yLinkID] = yID;\n                    }\n                }\n            }\n        }\n    }\n\n    if(isSubplotConstrained) {\n        // merge xLinks and yLinks if the subplot is constrained,\n        // since we'll always apply both anyway and the two will contain\n        // duplicates\n        Lib.extendFlat(xLinks, yLinks);\n        yLinks = {};\n    }\n\n    var xaHashLinked = {};\n    var xaxesLinked = [];\n    for(xLinkID in xLinks) {\n        var xa = getFromId(gd, xLinkID);\n        xaxesLinked.push(xa);\n        xaHashLinked[xa._id] = xa;\n    }\n\n    var yaHashLinked = {};\n    var yaxesLinked = [];\n    for(yLinkID in yLinks) {\n        var ya = getFromId(gd, yLinkID);\n        yaxesLinked.push(ya);\n        yaHashLinked[ya._id] = ya;\n    }\n\n    return {\n        xaHash: xaHashLinked,\n        yaHash: yaHashLinked,\n        xaxes: xaxesLinked,\n        yaxes: yaxesLinked,\n        xLinks: xLinks,\n        yLinks: yLinks,\n        isSubplotConstrained: isSubplotConstrained\n    };\n}\n\n// still seems to be some confusion about onwheel vs onmousewheel...\nfunction attachWheelEventHandler(element, handler) {\n    if(!supportsPassive) {\n        if(element.onwheel !== undefined) element.onwheel = handler;\n        else if(element.onmousewheel !== undefined) element.onmousewheel = handler;\n        else if(!element.isAddedWheelEvent) {\n            element.isAddedWheelEvent = true;\n            element.addEventListener('wheel', handler, {passive: false});\n        }\n    } else {\n        var wheelEventName = element.onwheel !== undefined ? 'wheel' : 'mousewheel';\n\n        if(element._onwheel) {\n            element.removeEventListener(wheelEventName, element._onwheel);\n        }\n        element._onwheel = handler;\n\n        element.addEventListener(wheelEventName, handler, {passive: false});\n    }\n}\n\nfunction hashValues(hash) {\n    var out = [];\n    for(var k in hash) out.push(hash[k]);\n    return out;\n}\n\nmodule.exports = {\n    makeDragBox: makeDragBox,\n\n    makeDragger: makeDragger,\n    makeRectDragger: makeRectDragger,\n    makeZoombox: makeZoombox,\n    makeCorners: makeCorners,\n\n    updateZoombox: updateZoombox,\n    xyCorners: xyCorners,\n    transitionZoombox: transitionZoombox,\n    removeZoombox: removeZoombox,\n    showDoubleClickNotifier: showDoubleClickNotifier,\n\n    attachWheelEventHandler: attachWheelEventHandler\n};\n\n},{\"../../components/color\":52,\"../../components/dragelement\":71,\"../../components/dragelement/helpers\":70,\"../../components/drawing\":74,\"../../components/fx\":92,\"../../constants/alignment\":154,\"../../lib\":178,\"../../lib/clear_gl_canvases\":167,\"../../lib/setcursor\":197,\"../../lib/svg_text_utils\":199,\"../../plot_api/subroutines\":213,\"../../registry\":269,\"../plots\":256,\"./axes\":222,\"./axis_ids\":225,\"./constants\":228,\"./scale_zoom\":240,\"./select\":241,\"d3\":16,\"has-passive-events\":21,\"tinycolor2\":35}],231:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Fx = _dereq_('../../components/fx');\nvar dragElement = _dereq_('../../components/dragelement');\nvar setCursor = _dereq_('../../lib/setcursor');\n\nvar makeDragBox = _dereq_('./dragbox').makeDragBox;\nvar DRAGGERSIZE = _dereq_('./constants').DRAGGERSIZE;\n\nexports.initInteractions = function initInteractions(gd) {\n    var fullLayout = gd._fullLayout;\n\n    if(gd._context.staticPlot) {\n        // this sweeps up more than just cartesian drag elements...\n        d3.select(gd).selectAll('.drag').remove();\n        return;\n    }\n\n    if(!fullLayout._has('cartesian') && !fullLayout._has('splom')) return;\n\n    var subplots = Object.keys(fullLayout._plots || {}).sort(function(a, b) {\n        // sort overlays last, then by x axis number, then y axis number\n        if((fullLayout._plots[a].mainplot && true) ===\n            (fullLayout._plots[b].mainplot && true)) {\n            var aParts = a.split('y');\n            var bParts = b.split('y');\n            return (aParts[0] === bParts[0]) ?\n                (Number(aParts[1] || 1) - Number(bParts[1] || 1)) :\n                (Number(aParts[0] || 1) - Number(bParts[0] || 1));\n        }\n        return fullLayout._plots[a].mainplot ? 1 : -1;\n    });\n\n    subplots.forEach(function(subplot) {\n        var plotinfo = fullLayout._plots[subplot];\n        var xa = plotinfo.xaxis;\n        var ya = plotinfo.yaxis;\n\n        // main and corner draggers need not be repeated for\n        // overlaid subplots - these draggers drag them all\n        if(!plotinfo.mainplot) {\n            // main dragger goes over the grids and data, so we use its\n            // mousemove events for all data hover effects\n            var maindrag = makeDragBox(gd, plotinfo, xa._offset, ya._offset,\n                xa._length, ya._length, 'ns', 'ew');\n\n            maindrag.onmousemove = function(evt) {\n                // This is on `gd._fullLayout`, *not* fullLayout because the reference\n                // changes by the time this is called again.\n                gd._fullLayout._rehover = function() {\n                    if((gd._fullLayout._hoversubplot === subplot) && gd._fullLayout._plots[subplot]) {\n                        Fx.hover(gd, evt, subplot);\n                    }\n                };\n\n                Fx.hover(gd, evt, subplot);\n\n                // Note that we have *not* used the cached fullLayout variable here\n                // since that may be outdated when this is called as a callback later on\n                gd._fullLayout._lasthover = maindrag;\n                gd._fullLayout._hoversubplot = subplot;\n            };\n\n            /*\n             * IMPORTANT:\n             * We must check for the presence of the drag cover here.\n             * If we don't, a 'mouseout' event is triggered on the\n             * maindrag before each 'click' event, which has the effect\n             * of clearing the hoverdata; thus, cancelling the click event.\n             */\n            maindrag.onmouseout = function(evt) {\n                if(gd._dragging) return;\n\n                // When the mouse leaves this maindrag, unset the hovered subplot.\n                // This may cause problems if it leaves the subplot directly *onto*\n                // another subplot, but that's a tiny corner case at the moment.\n                gd._fullLayout._hoversubplot = null;\n\n                dragElement.unhover(gd, evt);\n            };\n\n            // corner draggers\n            if(gd._context.showAxisDragHandles) {\n                makeDragBox(gd, plotinfo, xa._offset - DRAGGERSIZE, ya._offset - DRAGGERSIZE,\n                    DRAGGERSIZE, DRAGGERSIZE, 'n', 'w');\n                makeDragBox(gd, plotinfo, xa._offset + xa._length, ya._offset - DRAGGERSIZE,\n                    DRAGGERSIZE, DRAGGERSIZE, 'n', 'e');\n                makeDragBox(gd, plotinfo, xa._offset - DRAGGERSIZE, ya._offset + ya._length,\n                    DRAGGERSIZE, DRAGGERSIZE, 's', 'w');\n                makeDragBox(gd, plotinfo, xa._offset + xa._length, ya._offset + ya._length,\n                    DRAGGERSIZE, DRAGGERSIZE, 's', 'e');\n            }\n        }\n        if(gd._context.showAxisDragHandles) {\n            // x axis draggers - if you have overlaid plots,\n            // these drag each axis separately\n            if(subplot === xa._mainSubplot) {\n                // the y position of the main x axis line\n                var y0 = xa._mainLinePosition;\n                if(xa.side === 'top') y0 -= DRAGGERSIZE;\n                makeDragBox(gd, plotinfo, xa._offset + xa._length * 0.1, y0,\n                    xa._length * 0.8, DRAGGERSIZE, '', 'ew');\n                makeDragBox(gd, plotinfo, xa._offset, y0,\n                    xa._length * 0.1, DRAGGERSIZE, '', 'w');\n                makeDragBox(gd, plotinfo, xa._offset + xa._length * 0.9, y0,\n                    xa._length * 0.1, DRAGGERSIZE, '', 'e');\n            }\n            // y axis draggers\n            if(subplot === ya._mainSubplot) {\n                // the x position of the main y axis line\n                var x0 = ya._mainLinePosition;\n                if(ya.side !== 'right') x0 -= DRAGGERSIZE;\n                makeDragBox(gd, plotinfo, x0, ya._offset + ya._length * 0.1,\n                    DRAGGERSIZE, ya._length * 0.8, 'ns', '');\n                makeDragBox(gd, plotinfo, x0, ya._offset + ya._length * 0.9,\n                    DRAGGERSIZE, ya._length * 0.1, 's', '');\n                makeDragBox(gd, plotinfo, x0, ya._offset,\n                    DRAGGERSIZE, ya._length * 0.1, 'n', '');\n            }\n        }\n    });\n\n    // In case you mousemove over some hovertext, send it to Fx.hover too\n    // we do this so that we can put the hover text in front of everything,\n    // but still be able to interact with everything as if it isn't there\n    var hoverLayer = fullLayout._hoverlayer.node();\n\n    hoverLayer.onmousemove = function(evt) {\n        evt.target = gd._fullLayout._lasthover;\n        Fx.hover(gd, evt, fullLayout._hoversubplot);\n    };\n\n    hoverLayer.onclick = function(evt) {\n        evt.target = gd._fullLayout._lasthover;\n        Fx.click(gd, evt);\n    };\n\n    // also delegate mousedowns... TODO: does this actually work?\n    hoverLayer.onmousedown = function(evt) {\n        gd._fullLayout._lasthover.onmousedown(evt);\n    };\n\n    exports.updateFx(gd);\n};\n\n// Minimal set of update needed on 'modebar' edits.\n// We only need to update the <g .draglayer> cursor style.\n//\n// Note that changing the axis configuration and/or the fixedrange attribute\n// should trigger a full initInteractions.\nexports.updateFx = function(gd) {\n    var fullLayout = gd._fullLayout;\n    var cursor = fullLayout.dragmode === 'pan' ? 'move' : 'crosshair';\n    setCursor(fullLayout._draggers, cursor);\n};\n\n},{\"../../components/dragelement\":71,\"../../components/fx\":92,\"../../lib/setcursor\":197,\"./constants\":228,\"./dragbox\":230,\"d3\":16}],232:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nfunction clearOutlineControllers(gd) {\n    var zoomLayer = gd._fullLayout._zoomlayer;\n    if(zoomLayer) {\n        zoomLayer.selectAll('.outline-controllers').remove();\n    }\n}\n\nfunction clearSelect(gd) {\n    var zoomLayer = gd._fullLayout._zoomlayer;\n    if(zoomLayer) {\n        // until we get around to persistent selections, remove the outline\n        // here. The selection itself will be removed when the plot redraws\n        // at the end.\n        zoomLayer.selectAll('.select-outline').remove();\n    }\n\n    gd._fullLayout._drawing = false;\n}\n\nmodule.exports = {\n    clearOutlineControllers: clearOutlineControllers,\n    clearSelect: clearSelect\n};\n\n},{}],233:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// in v2 (once log ranges are fixed),\n// we'll be able to p2r here for all axis types\nfunction p2r(ax, v) {\n    switch(ax.type) {\n        case 'log':\n            return ax.p2d(v);\n        case 'date':\n            return ax.p2r(v, 0, ax.calendar);\n        default:\n            return ax.p2r(v);\n    }\n}\n\nfunction r2p(ax, v) {\n    switch(ax.type) {\n        case 'log':\n            return ax.d2p(v);\n        case 'date':\n            return ax.r2p(v, 0, ax.calendar);\n        default:\n            return ax.r2p(v);\n    }\n}\n\nfunction axValue(ax) {\n    var index = (ax._id.charAt(0) === 'y') ? 1 : 0;\n    return function(v) { return p2r(ax, v[index]); };\n}\n\nfunction getTransform(plotinfo) {\n    return 'translate(' +\n        plotinfo.xaxis._offset + ',' +\n        plotinfo.yaxis._offset + ')';\n}\n\nmodule.exports = {\n    p2r: p2r,\n    r2p: r2p,\n    axValue: axValue,\n    getTransform: getTransform\n};\n\n},{}],234:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\n/**\n * Factory function for checking component arrays for subplot references.\n *\n * @param {string} containerArrayName: the top-level array in gd.layout to check\n *   If an item in this container is found that references a cartesian x and/or y axis,\n *   ensure cartesian is marked as a base plot module and record the axes (and subplot\n *   if both refs are axes) in gd._fullLayout\n *\n * @return {function}: with args layoutIn (gd.layout) and layoutOut (gd._fullLayout)\n * as expected of a component includeBasePlot method\n */\nmodule.exports = function makeIncludeComponents(containerArrayName) {\n    return function includeComponents(layoutIn, layoutOut) {\n        var array = layoutIn[containerArrayName];\n        if(!Array.isArray(array)) return;\n\n        var Cartesian = Registry.subplotsRegistry.cartesian;\n        var idRegex = Cartesian.idRegex;\n        var subplots = layoutOut._subplots;\n        var xaList = subplots.xaxis;\n        var yaList = subplots.yaxis;\n        var cartesianList = subplots.cartesian;\n        var hasCartesianOrGL2D = layoutOut._has('cartesian') || layoutOut._has('gl2d');\n\n        for(var i = 0; i < array.length; i++) {\n            var itemi = array[i];\n            if(!Lib.isPlainObject(itemi)) continue;\n\n            var xref = itemi.xref;\n            var yref = itemi.yref;\n\n            var hasXref = idRegex.x.test(xref);\n            var hasYref = idRegex.y.test(yref);\n            if(hasXref || hasYref) {\n                if(!hasCartesianOrGL2D) Lib.pushUnique(layoutOut._basePlotModules, Cartesian);\n\n                var newAxis = false;\n                if(hasXref && xaList.indexOf(xref) === -1) {\n                    xaList.push(xref);\n                    newAxis = true;\n                }\n                if(hasYref && yaList.indexOf(yref) === -1) {\n                    yaList.push(yref);\n                    newAxis = true;\n                }\n\n                /*\n                 * Notice the logic here: only add a subplot for a component if\n                 * it's referencing both x and y axes AND it's creating a new axis\n                 * so for example if your plot already has xy and x2y2, an annotation\n                 * on x2y or xy2 will not create a new subplot.\n                 */\n                if(newAxis && hasXref && hasYref) {\n                    cartesianList.push(xref + yref);\n                }\n            }\n        }\n    };\n};\n\n},{\"../../lib\":178,\"../../registry\":269}],235:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Plots = _dereq_('../plots');\nvar Drawing = _dereq_('../../components/drawing');\n\nvar getModuleCalcData = _dereq_('../get_data').getModuleCalcData;\nvar axisIds = _dereq_('./axis_ids');\nvar constants = _dereq_('./constants');\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\n\nvar ensureSingle = Lib.ensureSingle;\n\nfunction ensureSingleAndAddDatum(parent, nodeType, className) {\n    return Lib.ensureSingle(parent, nodeType, className, function(s) {\n        s.datum(className);\n    });\n}\n\nexports.name = 'cartesian';\n\nexports.attr = ['xaxis', 'yaxis'];\n\nexports.idRoot = ['x', 'y'];\n\nexports.idRegex = constants.idRegex;\n\nexports.attrRegex = constants.attrRegex;\n\nexports.attributes = _dereq_('./attributes');\n\nexports.layoutAttributes = _dereq_('./layout_attributes');\n\nexports.supplyLayoutDefaults = _dereq_('./layout_defaults');\n\nexports.transitionAxes = _dereq_('./transition_axes');\n\nexports.finalizeSubplots = function(layoutIn, layoutOut) {\n    var subplots = layoutOut._subplots;\n    var xList = subplots.xaxis;\n    var yList = subplots.yaxis;\n    var spSVG = subplots.cartesian;\n    var spAll = spSVG.concat(subplots.gl2d || []);\n    var allX = {};\n    var allY = {};\n    var i, xi, yi;\n\n    for(i = 0; i < spAll.length; i++) {\n        var parts = spAll[i].split('y');\n        allX[parts[0]] = 1;\n        allY['y' + parts[1]] = 1;\n    }\n\n    // check for x axes with no subplot, and make one from the anchor of that x axis\n    for(i = 0; i < xList.length; i++) {\n        xi = xList[i];\n        if(!allX[xi]) {\n            yi = (layoutIn[axisIds.id2name(xi)] || {}).anchor;\n            if(!constants.idRegex.y.test(yi)) yi = 'y';\n            spSVG.push(xi + yi);\n            spAll.push(xi + yi);\n\n            if(!allY[yi]) {\n                allY[yi] = 1;\n                Lib.pushUnique(yList, yi);\n            }\n        }\n    }\n\n    // same for y axes with no subplot\n    for(i = 0; i < yList.length; i++) {\n        yi = yList[i];\n        if(!allY[yi]) {\n            xi = (layoutIn[axisIds.id2name(yi)] || {}).anchor;\n            if(!constants.idRegex.x.test(xi)) xi = 'x';\n            spSVG.push(xi + yi);\n            spAll.push(xi + yi);\n\n            if(!allX[xi]) {\n                allX[xi] = 1;\n                Lib.pushUnique(xList, xi);\n            }\n        }\n    }\n\n    // finally, if we've gotten here we're supposed to show cartesian...\n    // so if there are NO subplots at all, make one from the first\n    // x & y axes in the input layout\n    if(!spAll.length) {\n        xi = '';\n        yi = '';\n        for(var ki in layoutIn) {\n            if(constants.attrRegex.test(ki)) {\n                var axLetter = ki.charAt(0);\n                if(axLetter === 'x') {\n                    if(!xi || (+ki.substr(5) < +xi.substr(5))) {\n                        xi = ki;\n                    }\n                } else if(!yi || (+ki.substr(5) < +yi.substr(5))) {\n                    yi = ki;\n                }\n            }\n        }\n        xi = xi ? axisIds.name2id(xi) : 'x';\n        yi = yi ? axisIds.name2id(yi) : 'y';\n        xList.push(xi);\n        yList.push(yi);\n        spSVG.push(xi + yi);\n    }\n};\n\n/**\n * Cartesian.plot\n *\n * @param {DOM div | object} gd\n * @param {array (optional)} traces\n *  array of traces indices to plot\n *  if undefined, plots all cartesian traces,\n * @param {object} (optional) transitionOpts\n *  transition option object\n * @param {function} (optional) makeOnCompleteCallback\n *  transition make callback function from Plots.transition\n */\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n    var fullLayout = gd._fullLayout;\n    var subplots = fullLayout._subplots.cartesian;\n    var calcdata = gd.calcdata;\n    var i;\n\n    if(!Array.isArray(traces)) {\n        // If traces is not provided, then it's a complete replot and missing\n        // traces are removed\n        traces = [];\n        for(i = 0; i < calcdata.length; i++) traces.push(i);\n    }\n\n    for(i = 0; i < subplots.length; i++) {\n        var subplot = subplots[i];\n        var subplotInfo = fullLayout._plots[subplot];\n\n        // Get all calcdata for this subplot:\n        var cdSubplot = [];\n        var pcd;\n\n        for(var j = 0; j < calcdata.length; j++) {\n            var cd = calcdata[j];\n            var trace = cd[0].trace;\n\n            // Skip trace if whitelist provided and it's not whitelisted:\n            // if (Array.isArray(traces) && traces.indexOf(i) === -1) continue;\n            if(trace.xaxis + trace.yaxis === subplot) {\n                // XXX: Should trace carpet dependencies. Only replot all carpet plots if the carpet\n                // axis has actually changed:\n                //\n                // If this trace is specifically requested, add it to the list:\n                if(traces.indexOf(trace.index) !== -1 || trace.carpet) {\n                    // Okay, so example: traces 0, 1, and 2 have fill = tonext. You animate\n                    // traces 0 and 2. Trace 1 also needs to be updated, otherwise its fill\n                    // is outdated. So this retroactively adds the previous trace if the\n                    // traces are interdependent.\n                    if(\n                        pcd &&\n                        pcd[0].trace.xaxis + pcd[0].trace.yaxis === subplot &&\n                        ['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1 &&\n                        cdSubplot.indexOf(pcd) === -1\n                    ) {\n                        cdSubplot.push(pcd);\n                    }\n\n                    cdSubplot.push(cd);\n                }\n\n                // Track the previous trace on this subplot for the retroactive-add step\n                // above:\n                pcd = cd;\n            }\n        }\n\n        plotOne(gd, subplotInfo, cdSubplot, transitionOpts, makeOnCompleteCallback);\n    }\n};\n\nfunction plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback) {\n    var traceLayerClasses = constants.traceLayerClasses;\n    var fullLayout = gd._fullLayout;\n    var modules = fullLayout._modules;\n    var _module, cdModuleAndOthers, cdModule;\n\n    var layerData = [];\n    var zoomScaleQueryParts = [];\n\n    for(var i = 0; i < modules.length; i++) {\n        _module = modules[i];\n        var name = _module.name;\n        var categories = Registry.modules[name].categories;\n\n        if(categories.svg) {\n            var className = (_module.layerName || name + 'layer');\n            var plotMethod = _module.plot;\n\n            // plot all visible traces of this type on this subplot at once\n            cdModuleAndOthers = getModuleCalcData(cdSubplot, plotMethod);\n            cdModule = cdModuleAndOthers[0];\n            // don't need to search the found traces again - in fact we need to NOT\n            // so that if two modules share the same plotter we don't double-plot\n            cdSubplot = cdModuleAndOthers[1];\n\n            if(cdModule.length) {\n                layerData.push({\n                    i: traceLayerClasses.indexOf(className),\n                    className: className,\n                    plotMethod: plotMethod,\n                    cdModule: cdModule\n                });\n            }\n\n            if(categories.zoomScale) {\n                zoomScaleQueryParts.push('.' + className);\n            }\n        }\n    }\n\n    layerData.sort(function(a, b) { return a.i - b.i; });\n\n    var layers = plotinfo.plot.selectAll('g.mlayer')\n        .data(layerData, function(d) { return d.className; });\n\n    layers.enter().append('g')\n        .attr('class', function(d) { return d.className; })\n        .classed('mlayer', true)\n        .classed('rangeplot', plotinfo.isRangePlot);\n\n    layers.exit().remove();\n\n    layers.order();\n\n    layers.each(function(d) {\n        var sel = d3.select(this);\n        var className = d.className;\n\n        d.plotMethod(\n            gd, plotinfo, d.cdModule, sel,\n            transitionOpts, makeOnCompleteCallback\n        );\n\n        // layers that allow `cliponaxis: false`\n        if(constants.clipOnAxisFalseQuery.indexOf('.' + className) === -1) {\n            Drawing.setClipUrl(sel, plotinfo.layerClipId, gd);\n        }\n    });\n\n    // call Scattergl.plot separately\n    if(fullLayout._has('scattergl')) {\n        _module = Registry.getModule('scattergl');\n        cdModule = getModuleCalcData(cdSubplot, _module)[0];\n        _module.plot(gd, plotinfo, cdModule);\n    }\n\n    // stash \"hot\" selections for faster interaction on drag and scroll\n    if(!gd._context.staticPlot) {\n        if(plotinfo._hasClipOnAxisFalse) {\n            plotinfo.clipOnAxisFalseTraces = plotinfo.plot\n                .selectAll(constants.clipOnAxisFalseQuery.join(','))\n                .selectAll('.trace');\n        }\n\n        if(zoomScaleQueryParts.length) {\n            var traces = plotinfo.plot\n                .selectAll(zoomScaleQueryParts.join(','))\n                .selectAll('.trace');\n\n            plotinfo.zoomScalePts = traces.selectAll('path.point');\n            plotinfo.zoomScaleTxt = traces.selectAll('.textpoint');\n        }\n    }\n}\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n    var oldPlots = oldFullLayout._plots || {};\n    var newPlots = newFullLayout._plots || {};\n    var oldSubplotList = oldFullLayout._subplots || {};\n    var plotinfo;\n    var i, k;\n\n    // when going from a large splom graph to something else,\n    // we need to clear <g subplot> so that the new cartesian subplot\n    // can have the correct layer ordering\n    if(oldFullLayout._hasOnlyLargeSploms && !newFullLayout._hasOnlyLargeSploms) {\n        for(k in oldPlots) {\n            plotinfo = oldPlots[k];\n            if(plotinfo.plotgroup) plotinfo.plotgroup.remove();\n        }\n    }\n\n    var hadGl = (oldFullLayout._has && oldFullLayout._has('gl'));\n    var hasGl = (newFullLayout._has && newFullLayout._has('gl'));\n\n    if(hadGl && !hasGl) {\n        for(k in oldPlots) {\n            plotinfo = oldPlots[k];\n            if(plotinfo._scene) plotinfo._scene.destroy();\n        }\n    }\n\n    // delete any titles we don't need anymore\n    // check if axis list has changed, and if so clear old titles\n    if(oldSubplotList.xaxis && oldSubplotList.yaxis) {\n        var oldAxIDs = axisIds.listIds({_fullLayout: oldFullLayout});\n        for(i = 0; i < oldAxIDs.length; i++) {\n            var oldAxId = oldAxIDs[i];\n            if(!newFullLayout[axisIds.id2name(oldAxId)]) {\n                oldFullLayout._infolayer.selectAll('.g-' + oldAxId + 'title').remove();\n            }\n        }\n    }\n\n    var hadCartesian = (oldFullLayout._has && oldFullLayout._has('cartesian'));\n    var hasCartesian = (newFullLayout._has && newFullLayout._has('cartesian'));\n\n    if(hadCartesian && !hasCartesian) {\n        // if we've gotten rid of all cartesian traces, remove all the subplot svg items\n\n        purgeSubplotLayers(oldFullLayout._cartesianlayer.selectAll('.subplot'), oldFullLayout);\n        oldFullLayout._defs.selectAll('.axesclip').remove();\n        delete oldFullLayout._axisConstraintGroups;\n    } else if(oldSubplotList.cartesian) {\n        // otherwise look for subplots we need to remove\n\n        for(i = 0; i < oldSubplotList.cartesian.length; i++) {\n            var oldSubplotId = oldSubplotList.cartesian[i];\n            if(!newPlots[oldSubplotId]) {\n                var selector = '.' + oldSubplotId + ',.' + oldSubplotId + '-x,.' + oldSubplotId + '-y';\n                oldFullLayout._cartesianlayer.selectAll(selector).remove();\n                removeSubplotExtras(oldSubplotId, oldFullLayout);\n            }\n        }\n    }\n};\n\nexports.drawFramework = function(gd) {\n    var fullLayout = gd._fullLayout;\n    var subplotData = makeSubplotData(gd);\n\n    var subplotLayers = fullLayout._cartesianlayer.selectAll('.subplot')\n        .data(subplotData, String);\n\n    subplotLayers.enter().append('g')\n        .attr('class', function(d) { return 'subplot ' + d[0]; });\n\n    subplotLayers.order();\n\n    subplotLayers.exit()\n        .call(purgeSubplotLayers, fullLayout);\n\n    subplotLayers.each(function(d) {\n        var id = d[0];\n        var plotinfo = fullLayout._plots[id];\n\n        plotinfo.plotgroup = d3.select(this);\n        makeSubplotLayer(gd, plotinfo);\n\n        // make separate drag layers for each subplot,\n        // but append them to paper rather than the plot groups,\n        // so they end up on top of the rest\n        plotinfo.draglayer = ensureSingle(fullLayout._draggers, 'g', id);\n    });\n};\n\nexports.rangePlot = function(gd, plotinfo, cdSubplot) {\n    makeSubplotLayer(gd, plotinfo);\n    plotOne(gd, plotinfo, cdSubplot);\n    Plots.style(gd);\n};\n\nfunction makeSubplotData(gd) {\n    var fullLayout = gd._fullLayout;\n    var ids = fullLayout._subplots.cartesian;\n    var len = ids.length;\n    var i, j, id, plotinfo, xa, ya;\n\n    // split 'regular' and 'overlaying' subplots\n    var regulars = [];\n    var overlays = [];\n\n    for(i = 0; i < len; i++) {\n        id = ids[i];\n        plotinfo = fullLayout._plots[id];\n        xa = plotinfo.xaxis;\n        ya = plotinfo.yaxis;\n\n        var xa2 = xa._mainAxis;\n        var ya2 = ya._mainAxis;\n        var mainplot = xa2._id + ya2._id;\n        var mainplotinfo = fullLayout._plots[mainplot];\n        plotinfo.overlays = [];\n\n        if(mainplot !== id && mainplotinfo) {\n            plotinfo.mainplot = mainplot;\n            plotinfo.mainplotinfo = mainplotinfo;\n            overlays.push(id);\n        } else {\n            plotinfo.mainplot = undefined;\n            plotinfo.mainPlotinfo = undefined;\n            regulars.push(id);\n        }\n    }\n\n    // fill in list of overlaying subplots in 'main plot'\n    for(i = 0; i < overlays.length; i++) {\n        id = overlays[i];\n        plotinfo = fullLayout._plots[id];\n        plotinfo.mainplotinfo.overlays.push(plotinfo);\n    }\n\n    // put 'regular' subplot data before 'overlaying'\n    var subplotIds = regulars.concat(overlays);\n    var subplotData = new Array(len);\n\n    for(i = 0; i < len; i++) {\n        id = subplotIds[i];\n        plotinfo = fullLayout._plots[id];\n        xa = plotinfo.xaxis;\n        ya = plotinfo.yaxis;\n\n        // use info about axis layer and overlaying pattern\n        // to clean what need to be cleaned up in exit selection\n        var d = [id, xa.layer, ya.layer, xa.overlaying || '', ya.overlaying || ''];\n        for(j = 0; j < plotinfo.overlays.length; j++) {\n            d.push(plotinfo.overlays[j].id);\n        }\n        subplotData[i] = d;\n    }\n\n    return subplotData;\n}\n\nfunction makeSubplotLayer(gd, plotinfo) {\n    var plotgroup = plotinfo.plotgroup;\n    var id = plotinfo.id;\n    var xLayer = constants.layerValue2layerClass[plotinfo.xaxis.layer];\n    var yLayer = constants.layerValue2layerClass[plotinfo.yaxis.layer];\n    var hasOnlyLargeSploms = gd._fullLayout._hasOnlyLargeSploms;\n\n    if(!plotinfo.mainplot) {\n        if(hasOnlyLargeSploms) {\n            // TODO could do even better\n            // - we don't need plot (but we would have to mock it in lsInner\n            //   and other places\n            // - we don't (x|y)lines and (x|y)axislayer for most subplots\n            //   usually just the bottom x and left y axes.\n            plotinfo.xlines = ensureSingle(plotgroup, 'path', 'xlines-above');\n            plotinfo.ylines = ensureSingle(plotgroup, 'path', 'ylines-above');\n            plotinfo.xaxislayer = ensureSingle(plotgroup, 'g', 'xaxislayer-above');\n            plotinfo.yaxislayer = ensureSingle(plotgroup, 'g', 'yaxislayer-above');\n        } else {\n            var backLayer = ensureSingle(plotgroup, 'g', 'layer-subplot');\n            plotinfo.shapelayer = ensureSingle(backLayer, 'g', 'shapelayer');\n            plotinfo.imagelayer = ensureSingle(backLayer, 'g', 'imagelayer');\n\n            plotinfo.gridlayer = ensureSingle(plotgroup, 'g', 'gridlayer');\n            plotinfo.zerolinelayer = ensureSingle(plotgroup, 'g', 'zerolinelayer');\n\n            ensureSingle(plotgroup, 'path', 'xlines-below');\n            ensureSingle(plotgroup, 'path', 'ylines-below');\n            plotinfo.overlinesBelow = ensureSingle(plotgroup, 'g', 'overlines-below');\n\n            ensureSingle(plotgroup, 'g', 'xaxislayer-below');\n            ensureSingle(plotgroup, 'g', 'yaxislayer-below');\n            plotinfo.overaxesBelow = ensureSingle(plotgroup, 'g', 'overaxes-below');\n\n            plotinfo.plot = ensureSingle(plotgroup, 'g', 'plot');\n            plotinfo.overplot = ensureSingle(plotgroup, 'g', 'overplot');\n\n            plotinfo.xlines = ensureSingle(plotgroup, 'path', 'xlines-above');\n            plotinfo.ylines = ensureSingle(plotgroup, 'path', 'ylines-above');\n            plotinfo.overlinesAbove = ensureSingle(plotgroup, 'g', 'overlines-above');\n\n            ensureSingle(plotgroup, 'g', 'xaxislayer-above');\n            ensureSingle(plotgroup, 'g', 'yaxislayer-above');\n            plotinfo.overaxesAbove = ensureSingle(plotgroup, 'g', 'overaxes-above');\n\n            // set refs to correct layers as determined by 'axis.layer'\n            plotinfo.xlines = plotgroup.select('.xlines-' + xLayer);\n            plotinfo.ylines = plotgroup.select('.ylines-' + yLayer);\n            plotinfo.xaxislayer = plotgroup.select('.xaxislayer-' + xLayer);\n            plotinfo.yaxislayer = plotgroup.select('.yaxislayer-' + yLayer);\n        }\n    } else {\n        var mainplotinfo = plotinfo.mainplotinfo;\n        var mainplotgroup = mainplotinfo.plotgroup;\n        var xId = id + '-x';\n        var yId = id + '-y';\n\n        // now make the components of overlaid subplots\n        // overlays don't have backgrounds, and append all\n        // their other components to the corresponding\n        // extra groups of their main plots.\n\n        plotinfo.gridlayer = mainplotinfo.gridlayer;\n        plotinfo.zerolinelayer = mainplotinfo.zerolinelayer;\n\n        ensureSingle(mainplotinfo.overlinesBelow, 'path', xId);\n        ensureSingle(mainplotinfo.overlinesBelow, 'path', yId);\n        ensureSingle(mainplotinfo.overaxesBelow, 'g', xId);\n        ensureSingle(mainplotinfo.overaxesBelow, 'g', yId);\n\n        plotinfo.plot = ensureSingle(mainplotinfo.overplot, 'g', id);\n\n        ensureSingle(mainplotinfo.overlinesAbove, 'path', xId);\n        ensureSingle(mainplotinfo.overlinesAbove, 'path', yId);\n        ensureSingle(mainplotinfo.overaxesAbove, 'g', xId);\n        ensureSingle(mainplotinfo.overaxesAbove, 'g', yId);\n\n        // set refs to correct layers as determined by 'abovetraces'\n        plotinfo.xlines = mainplotgroup.select('.overlines-' + xLayer).select('.' + xId);\n        plotinfo.ylines = mainplotgroup.select('.overlines-' + yLayer).select('.' + yId);\n        plotinfo.xaxislayer = mainplotgroup.select('.overaxes-' + xLayer).select('.' + xId);\n        plotinfo.yaxislayer = mainplotgroup.select('.overaxes-' + yLayer).select('.' + yId);\n    }\n\n    // common attributes for all subplots, overlays or not\n\n    if(!hasOnlyLargeSploms) {\n        ensureSingleAndAddDatum(plotinfo.gridlayer, 'g', plotinfo.xaxis._id);\n        ensureSingleAndAddDatum(plotinfo.gridlayer, 'g', plotinfo.yaxis._id);\n        plotinfo.gridlayer.selectAll('g')\n            .map(function(d) { return d[0]; })\n            .sort(axisIds.idSort);\n    }\n\n    plotinfo.xlines\n        .style('fill', 'none')\n        .classed('crisp', true);\n\n    plotinfo.ylines\n        .style('fill', 'none')\n        .classed('crisp', true);\n}\n\nfunction purgeSubplotLayers(layers, fullLayout) {\n    if(!layers) return;\n\n    var overlayIdsToRemove = {};\n\n    layers.each(function(d) {\n        var id = d[0];\n        var plotgroup = d3.select(this);\n\n        plotgroup.remove();\n        removeSubplotExtras(id, fullLayout);\n        overlayIdsToRemove[id] = true;\n\n        // do not remove individual axis <clipPath>s here\n        // as other subplots may need them\n    });\n\n    // must remove overlaid subplot trace layers 'manually'\n\n    for(var k in fullLayout._plots) {\n        var subplotInfo = fullLayout._plots[k];\n        var overlays = subplotInfo.overlays || [];\n\n        for(var j = 0; j < overlays.length; j++) {\n            var overlayInfo = overlays[j];\n\n            if(overlayIdsToRemove[overlayInfo.id]) {\n                overlayInfo.plot.selectAll('.trace').remove();\n            }\n        }\n    }\n}\n\nfunction removeSubplotExtras(subplotId, fullLayout) {\n    fullLayout._draggers.selectAll('g.' + subplotId).remove();\n    fullLayout._defs.select('#clip' + fullLayout._uid + subplotId + 'plot').remove();\n}\n\nexports.toSVG = function(gd) {\n    var imageRoot = gd._fullLayout._glimages;\n    var root = d3.select(gd).selectAll('.svg-container');\n    var canvases = root.filter(function(d, i) {return i === root.size() - 1;})\n        .selectAll('.gl-canvas-context, .gl-canvas-focus');\n\n    function canvasToImage() {\n        var canvas = this;\n        var imageData = canvas.toDataURL('image/png');\n        var image = imageRoot.append('svg:image');\n\n        image.attr({\n            xmlns: xmlnsNamespaces.svg,\n            'xlink:href': imageData,\n            preserveAspectRatio: 'none',\n            x: 0,\n            y: 0,\n            width: canvas.width,\n            height: canvas.height\n        });\n    }\n\n    canvases.each(canvasToImage);\n};\n\nexports.updateFx = _dereq_('./graph_interact').updateFx;\n\n},{\"../../components/drawing\":74,\"../../constants/xmlns_namespaces\":159,\"../../lib\":178,\"../../registry\":269,\"../get_data\":252,\"../plots\":256,\"./attributes\":220,\"./axis_ids\":225,\"./constants\":228,\"./graph_interact\":231,\"./layout_attributes\":236,\"./layout_defaults\":237,\"./transition_axes\":246,\"d3\":16}],236:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../font_attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\nvar DATE_FORMAT_LINK = _dereq_('../../constants/docs').DATE_FORMAT_LINK;\nvar ONEDAY = _dereq_('../../constants/numerical').ONEDAY;\nvar constants = _dereq_('./constants');\nvar HOUR = constants.HOUR_PATTERN;\nvar DAY_OF_WEEK = constants.WEEKDAY_PATTERN;\n\nmodule.exports = {\n    visible: {\n        valType: 'boolean',\n        \n        editType: 'plot',\n        \n    },\n    color: {\n        valType: 'color',\n        dflt: colorAttrs.defaultLine,\n        \n        editType: 'ticks',\n        \n    },\n    title: {\n        text: {\n            valType: 'string',\n            \n            editType: 'ticks',\n            \n        },\n        font: fontAttrs({\n            editType: 'ticks',\n            \n        }),\n        standoff: {\n            valType: 'number',\n            \n            min: 0,\n            editType: 'ticks',\n            \n        },\n        editType: 'ticks'\n    },\n    type: {\n        valType: 'enumerated',\n        // '-' means we haven't yet run autotype or couldn't find any data\n        // it gets turned into linear in gd._fullLayout but not copied back\n        // to gd.data like the others are.\n        values: ['-', 'linear', 'log', 'date', 'category', 'multicategory'],\n        dflt: '-',\n        \n        editType: 'calc',\n        // we forget when an axis has been autotyped, just writing the auto\n        // value back to the input - so it doesn't make sense to template this.\n        // Note: we do NOT prohibit this in `coerce`, so if someone enters a\n        // type in the template explicitly it will be honored as the default.\n        _noTemplating: true,\n        \n    },\n    autorange: {\n        valType: 'enumerated',\n        values: [true, false, 'reversed'],\n        dflt: true,\n        \n        editType: 'axrange',\n        impliedEdits: {'range[0]': undefined, 'range[1]': undefined},\n        \n    },\n    rangemode: {\n        valType: 'enumerated',\n        values: ['normal', 'tozero', 'nonnegative'],\n        dflt: 'normal',\n        \n        editType: 'plot',\n        \n    },\n    range: {\n        valType: 'info_array',\n        \n        items: [\n            {valType: 'any', editType: 'axrange', impliedEdits: {'^autorange': false}, anim: true},\n            {valType: 'any', editType: 'axrange', impliedEdits: {'^autorange': false}, anim: true}\n        ],\n        editType: 'axrange',\n        impliedEdits: {'autorange': false},\n        anim: true,\n        \n    },\n    fixedrange: {\n        valType: 'boolean',\n        dflt: false,\n        \n        editType: 'calc',\n        \n    },\n    // scaleanchor: not used directly, just put here for reference\n    // values are any opposite-letter axis id\n    scaleanchor: {\n        valType: 'enumerated',\n        values: [\n            constants.idRegex.x.toString(),\n            constants.idRegex.y.toString()\n        ],\n        \n        editType: 'plot',\n        \n    },\n    scaleratio: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        editType: 'plot',\n        \n    },\n    constrain: {\n        valType: 'enumerated',\n        values: ['range', 'domain'],\n        dflt: 'range',\n        \n        editType: 'plot',\n        \n    },\n    // constraintoward: not used directly, just put here for reference\n    constraintoward: {\n        valType: 'enumerated',\n        values: ['left', 'center', 'right', 'top', 'middle', 'bottom'],\n        \n        editType: 'plot',\n        \n    },\n    matches: {\n        valType: 'enumerated',\n        values: [\n            constants.idRegex.x.toString(),\n            constants.idRegex.y.toString()\n        ],\n        \n        editType: 'calc',\n        \n    },\n\n    rangebreaks: templatedArray('rangebreak', {\n        enabled: {\n            valType: 'boolean',\n            \n            dflt: true,\n            editType: 'calc',\n            \n        },\n\n        bounds: {\n            valType: 'info_array',\n            \n            items: [\n                {valType: 'any', editType: 'calc'},\n                {valType: 'any', editType: 'calc'}\n            ],\n            editType: 'calc',\n            \n        },\n\n        pattern: {\n            valType: 'enumerated',\n            values: [DAY_OF_WEEK, HOUR, ''],\n            \n            editType: 'calc',\n            \n        },\n\n        values: {\n            valType: 'info_array',\n            freeLength: true,\n            \n            editType: 'calc',\n            items: {\n                valType: 'any',\n                editType: 'calc'\n            },\n            \n        },\n        dvalue: {\n            // TODO could become 'any' to add support for 'months', 'years'\n            valType: 'number',\n            \n            editType: 'calc',\n            min: 0,\n            dflt: ONEDAY,\n            \n        },\n\n        /*\n        gap: {\n            valType: 'number',\n            min: 0,\n            dflt: 0, // for *date* axes, maybe something else for *linear*\n            editType: 'calc',\n            \n            \n        },\n        gapmode: {\n            valType: 'enumerated',\n            values: ['pixels', 'fraction'],\n            dflt: 'pixels',\n            editType: 'calc',\n            \n            \n        },\n        */\n\n        // To complete https://github.com/plotly/plotly.js/issues/4210\n        // we additionally need `gap` and make this work on *linear*, and\n        // possibly all other cartesian axis types. We possibly would also need\n        // some style attributes controlling the zig-zag on the corresponding\n        // axis.\n\n        editType: 'calc'\n    }),\n\n    // ticks\n    tickmode: {\n        valType: 'enumerated',\n        values: ['auto', 'linear', 'array'],\n        \n        editType: 'ticks',\n        impliedEdits: {tick0: undefined, dtick: undefined},\n        \n    },\n    nticks: {\n        valType: 'integer',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'ticks',\n        \n    },\n    tick0: {\n        valType: 'any',\n        \n        editType: 'ticks',\n        impliedEdits: {tickmode: 'linear'},\n        \n    },\n    dtick: {\n        valType: 'any',\n        \n        editType: 'ticks',\n        impliedEdits: {tickmode: 'linear'},\n        \n    },\n    tickvals: {\n        valType: 'data_array',\n        editType: 'ticks',\n        \n    },\n    ticktext: {\n        valType: 'data_array',\n        editType: 'ticks',\n        \n    },\n    ticks: {\n        valType: 'enumerated',\n        values: ['outside', 'inside', ''],\n        \n        editType: 'ticks',\n        \n    },\n    tickson: {\n        valType: 'enumerated',\n        values: ['labels', 'boundaries'],\n        \n        dflt: 'labels',\n        editType: 'ticks',\n        \n    },\n    mirror: {\n        valType: 'enumerated',\n        values: [true, 'ticks', false, 'all', 'allticks'],\n        dflt: false,\n        \n        editType: 'ticks+layoutstyle',\n        \n    },\n    ticklen: {\n        valType: 'number',\n        min: 0,\n        dflt: 5,\n        \n        editType: 'ticks',\n        \n    },\n    tickwidth: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        editType: 'ticks',\n        \n    },\n    tickcolor: {\n        valType: 'color',\n        dflt: colorAttrs.defaultLine,\n        \n        editType: 'ticks',\n        \n    },\n    showticklabels: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'ticks',\n        \n    },\n    automargin: {\n        valType: 'boolean',\n        dflt: false,\n        \n        editType: 'ticks',\n        \n    },\n    showspikes: {\n        valType: 'boolean',\n        dflt: false,\n        \n        editType: 'modebar',\n        \n    },\n    spikecolor: {\n        valType: 'color',\n        dflt: null,\n        \n        editType: 'none',\n        \n    },\n    spikethickness: {\n        valType: 'number',\n        dflt: 3,\n        \n        editType: 'none',\n        \n    },\n    spikedash: extendFlat({}, dash, {dflt: 'dash', editType: 'none'}),\n    spikemode: {\n        valType: 'flaglist',\n        flags: ['toaxis', 'across', 'marker'],\n        \n        dflt: 'toaxis',\n        editType: 'none',\n        \n    },\n    spikesnap: {\n        valType: 'enumerated',\n        values: ['data', 'cursor', 'hovered data'],\n        dflt: 'data',\n        \n        editType: 'none',\n        \n    },\n    tickfont: fontAttrs({\n        editType: 'ticks',\n        \n    }),\n    tickangle: {\n        valType: 'angle',\n        dflt: 'auto',\n        \n        editType: 'ticks',\n        \n    },\n    tickprefix: {\n        valType: 'string',\n        dflt: '',\n        \n        editType: 'ticks',\n        \n    },\n    showtickprefix: {\n        valType: 'enumerated',\n        values: ['all', 'first', 'last', 'none'],\n        dflt: 'all',\n        \n        editType: 'ticks',\n        \n    },\n    ticksuffix: {\n        valType: 'string',\n        dflt: '',\n        \n        editType: 'ticks',\n        \n    },\n    showticksuffix: {\n        valType: 'enumerated',\n        values: ['all', 'first', 'last', 'none'],\n        dflt: 'all',\n        \n        editType: 'ticks',\n        \n    },\n    showexponent: {\n        valType: 'enumerated',\n        values: ['all', 'first', 'last', 'none'],\n        dflt: 'all',\n        \n        editType: 'ticks',\n        \n    },\n    exponentformat: {\n        valType: 'enumerated',\n        values: ['none', 'e', 'E', 'power', 'SI', 'B'],\n        dflt: 'B',\n        \n        editType: 'ticks',\n        \n    },\n    separatethousands: {\n        valType: 'boolean',\n        dflt: false,\n        \n        editType: 'ticks',\n        \n    },\n    tickformat: {\n        valType: 'string',\n        dflt: '',\n        \n        editType: 'ticks',\n        \n    },\n    tickformatstops: templatedArray('tickformatstop', {\n        enabled: {\n            valType: 'boolean',\n            \n            dflt: true,\n            editType: 'ticks',\n            \n        },\n        dtickrange: {\n            valType: 'info_array',\n            \n            items: [\n                {valType: 'any', editType: 'ticks'},\n                {valType: 'any', editType: 'ticks'}\n            ],\n            editType: 'ticks',\n            \n        },\n        value: {\n            valType: 'string',\n            dflt: '',\n            \n            editType: 'ticks',\n            \n        },\n        editType: 'ticks'\n    }),\n    hoverformat: {\n        valType: 'string',\n        dflt: '',\n        \n        editType: 'none',\n        \n    },\n    // lines and grids\n    showline: {\n        valType: 'boolean',\n        dflt: false,\n        \n        editType: 'ticks+layoutstyle',\n        \n    },\n    linecolor: {\n        valType: 'color',\n        dflt: colorAttrs.defaultLine,\n        \n        editType: 'layoutstyle',\n        \n    },\n    linewidth: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        editType: 'ticks+layoutstyle',\n        \n    },\n    showgrid: {\n        valType: 'boolean',\n        \n        editType: 'ticks',\n        \n    },\n    gridcolor: {\n        valType: 'color',\n        dflt: colorAttrs.lightLine,\n        \n        editType: 'ticks',\n        \n    },\n    gridwidth: {\n        valType: 'number',\n        min: 0,\n        dflt: 1,\n        \n        editType: 'ticks',\n        \n    },\n    zeroline: {\n        valType: 'boolean',\n        \n        editType: 'ticks',\n        \n    },\n    zerolinecolor: {\n        valType: 'color',\n        dflt: colorAttrs.defaultLine,\n        \n        editType: 'ticks',\n        \n    },\n    zerolinewidth: {\n        valType: 'number',\n        dflt: 1,\n        \n        editType: 'ticks',\n        \n    },\n\n    showdividers: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'ticks',\n        \n    },\n    dividercolor: {\n        valType: 'color',\n        dflt: colorAttrs.defaultLine,\n        \n        editType: 'ticks',\n        \n    },\n    dividerwidth: {\n        valType: 'number',\n        dflt: 1,\n        \n        editType: 'ticks',\n        \n    },\n    // TODO dividerlen: that would override \"to label base\" length?\n\n    // positioning attributes\n    // anchor: not used directly, just put here for reference\n    // values are any opposite-letter axis id\n    anchor: {\n        valType: 'enumerated',\n        values: [\n            'free',\n            constants.idRegex.x.toString(),\n            constants.idRegex.y.toString()\n        ],\n        \n        editType: 'plot',\n        \n    },\n    // side: not used directly, as values depend on direction\n    // values are top, bottom for x axes, and left, right for y\n    side: {\n        valType: 'enumerated',\n        values: ['top', 'bottom', 'left', 'right'],\n        \n        editType: 'plot',\n        \n    },\n    // overlaying: not used directly, just put here for reference\n    // values are false and any other same-letter axis id that's not\n    // itself overlaying anything\n    overlaying: {\n        valType: 'enumerated',\n        values: [\n            'free',\n            constants.idRegex.x.toString(),\n            constants.idRegex.y.toString()\n        ],\n        \n        editType: 'plot',\n        \n    },\n    layer: {\n        valType: 'enumerated',\n        values: ['above traces', 'below traces'],\n        dflt: 'above traces',\n        \n        editType: 'plot',\n        \n    },\n    domain: {\n        valType: 'info_array',\n        \n        items: [\n            {valType: 'number', min: 0, max: 1, editType: 'plot'},\n            {valType: 'number', min: 0, max: 1, editType: 'plot'}\n        ],\n        dflt: [0, 1],\n        editType: 'plot',\n        \n    },\n    position: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        dflt: 0,\n        \n        editType: 'plot',\n        \n    },\n    categoryorder: {\n        valType: 'enumerated',\n        values: [\n            'trace', 'category ascending', 'category descending', 'array',\n            'total ascending', 'total descending',\n            'min ascending', 'min descending',\n            'max ascending', 'max descending',\n            'sum ascending', 'sum descending',\n            'mean ascending', 'mean descending',\n            'median ascending', 'median descending'\n        ],\n        dflt: 'trace',\n        \n        editType: 'calc',\n        \n    },\n    categoryarray: {\n        valType: 'data_array',\n        \n        editType: 'calc',\n        \n    },\n    uirevision: {\n        valType: 'any',\n        \n        editType: 'none',\n        \n    },\n    editType: 'calc',\n\n    _deprecated: {\n        autotick: {\n            valType: 'boolean',\n            \n            editType: 'ticks',\n            \n        },\n        title: {\n            valType: 'string',\n            \n            editType: 'ticks',\n            \n        },\n        titlefont: fontAttrs({\n            editType: 'ticks',\n            \n        })\n    }\n};\n\n},{\"../../components/color/attributes\":51,\"../../components/drawing/attributes\":73,\"../../constants/docs\":155,\"../../constants/numerical\":158,\"../../lib/extend\":173,\"../../plot_api/plot_template\":212,\"../font_attributes\":250,\"./constants\":228}],237:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar isUnifiedHover = _dereq_('../../components/fx/helpers').isUnifiedHover;\nvar handleHoverModeDefaults = _dereq_('../../components/fx/hovermode_defaults');\nvar Template = _dereq_('../../plot_api/plot_template');\nvar basePlotLayoutAttributes = _dereq_('../layout_attributes');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar handleTypeDefaults = _dereq_('./type_defaults');\nvar handleAxisDefaults = _dereq_('./axis_defaults');\nvar handleConstraintDefaults = _dereq_('./constraints').handleConstraintDefaults;\nvar handlePositionDefaults = _dereq_('./position_defaults');\n\nvar axisIds = _dereq_('./axis_ids');\nvar id2name = axisIds.id2name;\nvar name2id = axisIds.name2id;\n\nvar AX_ID_PATTERN = _dereq_('./constants').AX_ID_PATTERN;\n\nvar Registry = _dereq_('../../registry');\nvar traceIs = Registry.traceIs;\nvar getComponentMethod = Registry.getComponentMethod;\n\nfunction appendList(cont, k, item) {\n    if(Array.isArray(cont[k])) cont[k].push(item);\n    else cont[k] = [item];\n}\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n    var ax2traces = {};\n    var xaMayHide = {};\n    var yaMayHide = {};\n    var xaMustDisplay = {};\n    var yaMustDisplay = {};\n    var yaMustNotReverse = {};\n    var yaMayReverse = {};\n    var axHasImage = {};\n    var outerTicks = {};\n    var noGrids = {};\n    var i, j;\n\n    // look for axes in the data\n    for(i = 0; i < fullData.length; i++) {\n        var trace = fullData[i];\n        if(!traceIs(trace, 'cartesian') && !traceIs(trace, 'gl2d')) continue;\n\n        var xaName;\n        if(trace.xaxis) {\n            xaName = id2name(trace.xaxis);\n            appendList(ax2traces, xaName, trace);\n        } else if(trace.xaxes) {\n            for(j = 0; j < trace.xaxes.length; j++) {\n                appendList(ax2traces, id2name(trace.xaxes[j]), trace);\n            }\n        }\n\n        var yaName;\n        if(trace.yaxis) {\n            yaName = id2name(trace.yaxis);\n            appendList(ax2traces, yaName, trace);\n        } else if(trace.yaxes) {\n            for(j = 0; j < trace.yaxes.length; j++) {\n                appendList(ax2traces, id2name(trace.yaxes[j]), trace);\n            }\n        }\n\n        // logic for funnels\n        if(trace.type === 'funnel') {\n            if(trace.orientation === 'h') {\n                if(xaName) xaMayHide[xaName] = true;\n                if(yaName) yaMayReverse[yaName] = true;\n            } else {\n                if(yaName) yaMayHide[yaName] = true;\n            }\n        } else if(trace.type === 'image') {\n            if(yaName) axHasImage[yaName] = true;\n            if(xaName) axHasImage[xaName] = true;\n        } else {\n            if(yaName) {\n                yaMustDisplay[yaName] = true;\n                yaMustNotReverse[yaName] = true;\n            }\n\n            if(!traceIs(trace, 'carpet') || (trace.type === 'carpet' && !trace._cheater)) {\n                if(xaName) xaMustDisplay[xaName] = true;\n            }\n        }\n\n        // Two things trigger axis visibility:\n        // 1. is not carpet\n        // 2. carpet that's not cheater\n\n        // The above check for definitely-not-cheater is not adequate. This\n        // second list tracks which axes *could* be a cheater so that the\n        // full condition triggering hiding is:\n        //   *could* be a cheater and *is not definitely visible*\n        if(trace.type === 'carpet' && trace._cheater) {\n            if(xaName) xaMayHide[xaName] = true;\n        }\n\n        // check for default formatting tweaks\n        if(traceIs(trace, '2dMap')) {\n            outerTicks[xaName] = true;\n            outerTicks[yaName] = true;\n        }\n\n        if(traceIs(trace, 'oriented')) {\n            var positionAxis = trace.orientation === 'h' ? yaName : xaName;\n            noGrids[positionAxis] = true;\n        }\n    }\n\n    var subplots = layoutOut._subplots;\n    var xIds = subplots.xaxis;\n    var yIds = subplots.yaxis;\n    var xNames = Lib.simpleMap(xIds, id2name);\n    var yNames = Lib.simpleMap(yIds, id2name);\n    var axNames = xNames.concat(yNames);\n\n    // plot_bgcolor only makes sense if there's a (2D) plot!\n    // TODO: bgcolor for each subplot, to inherit from the main one\n    var plotBgColor = Color.background;\n    if(xIds.length && yIds.length) {\n        plotBgColor = Lib.coerce(layoutIn, layoutOut, basePlotLayoutAttributes, 'plot_bgcolor');\n    }\n\n    var bgColor = Color.combine(plotBgColor, layoutOut.paper_bgcolor);\n\n    // name of single axis (e.g. 'xaxis', 'yaxis2')\n    var axName;\n    // id of single axis (e.g. 'y', 'x5')\n    var axId;\n    // 'x' or 'y'\n    var axLetter;\n    // input layout axis container\n    var axLayoutIn;\n    // full layout axis container\n    var axLayoutOut;\n\n    function newAxLayoutOut() {\n        var traces = ax2traces[axName] || [];\n        axLayoutOut._traceIndices = traces.map(function(t) { return t._expandedIndex; });\n        axLayoutOut._annIndices = [];\n        axLayoutOut._shapeIndices = [];\n        axLayoutOut._imgIndices = [];\n        axLayoutOut._subplotsWith = [];\n        axLayoutOut._counterAxes = [];\n        axLayoutOut._name = axLayoutOut._attr = axName;\n        axLayoutOut._id = axId;\n    }\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(axLayoutIn, axLayoutOut, layoutAttributes, attr, dflt);\n    }\n\n    function coerce2(attr, dflt) {\n        return Lib.coerce2(axLayoutIn, axLayoutOut, layoutAttributes, attr, dflt);\n    }\n\n    function getCounterAxes(axLetter) {\n        return (axLetter === 'x') ? yIds : xIds;\n    }\n\n    function getOverlayableAxes(axLetter, axName) {\n        var list = (axLetter === 'x') ? xNames : yNames;\n        var out = [];\n\n        for(var j = 0; j < list.length; j++) {\n            var axName2 = list[j];\n\n            if(axName2 !== axName && !(layoutIn[axName2] || {}).overlaying) {\n                out.push(name2id(axName2));\n            }\n        }\n\n        return out;\n    }\n\n    // list of available counter axis names\n    var counterAxes = {x: getCounterAxes('x'), y: getCounterAxes('y')};\n    // list of all x AND y axis ids\n    var allAxisIds = counterAxes.x.concat(counterAxes.y);\n    // lookup and list of axis ids that axes in axNames have a reference to,\n    // even though they are missing from allAxisIds\n    var missingMatchedAxisIdsLookup = {};\n    var missingMatchedAxisIds = [];\n\n    // fill in 'missing' axis lookup when an axis is set to match an axis\n    // not part of the allAxisIds list, save axis type so that we can propagate\n    // it to the missing axes\n    function addMissingMatchedAxis() {\n        var matchesIn = axLayoutIn.matches;\n        if(AX_ID_PATTERN.test(matchesIn) && allAxisIds.indexOf(matchesIn) === -1) {\n            missingMatchedAxisIdsLookup[matchesIn] = axLayoutIn.type;\n            missingMatchedAxisIds = Object.keys(missingMatchedAxisIdsLookup);\n        }\n    }\n\n    var hovermode = handleHoverModeDefaults(layoutIn, layoutOut, fullData);\n    var unifiedHover = isUnifiedHover(hovermode);\n\n    // first pass creates the containers, determines types, and handles most of the settings\n    for(i = 0; i < axNames.length; i++) {\n        axName = axNames[i];\n        axId = name2id(axName);\n        axLetter = axName.charAt(0);\n\n        if(!Lib.isPlainObject(layoutIn[axName])) {\n            layoutIn[axName] = {};\n        }\n\n        axLayoutIn = layoutIn[axName];\n        axLayoutOut = Template.newContainer(layoutOut, axName, axLetter + 'axis');\n        newAxLayoutOut();\n\n        var visibleDflt =\n            (axLetter === 'x' && !xaMustDisplay[axName] && xaMayHide[axName]) ||\n            (axLetter === 'y' && !yaMustDisplay[axName] && yaMayHide[axName]);\n\n        var reverseDflt =\n            (axLetter === 'y' &&\n              (\n                (!yaMustNotReverse[axName] && yaMayReverse[axName]) ||\n                axHasImage[axName]\n              ));\n\n        var defaultOptions = {\n            letter: axLetter,\n            font: layoutOut.font,\n            outerTicks: outerTicks[axName],\n            showGrid: !noGrids[axName],\n            data: ax2traces[axName] || [],\n            bgColor: bgColor,\n            calendar: layoutOut.calendar,\n            automargin: true,\n            visibleDflt: visibleDflt,\n            reverseDflt: reverseDflt,\n            splomStash: ((layoutOut._splomAxes || {})[axLetter] || {})[axId]\n        };\n\n        coerce('uirevision', layoutOut.uirevision);\n\n        handleTypeDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions);\n        handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions, layoutOut);\n\n        var unifiedSpike = unifiedHover && axLetter === hovermode.charAt(0);\n        var spikecolor = coerce2('spikecolor', unifiedHover ? axLayoutOut.color : undefined);\n        var spikethickness = coerce2('spikethickness', unifiedHover ? 1.5 : undefined);\n        var spikedash = coerce2('spikedash', unifiedHover ? 'dot' : undefined);\n        var spikemode = coerce2('spikemode', unifiedHover ? 'across' : undefined);\n        var spikesnap = coerce2('spikesnap', unifiedHover ? 'hovered data' : undefined);\n        var showSpikes = coerce('showspikes', !!unifiedSpike || !!spikecolor || !!spikethickness || !!spikedash || !!spikemode || !!spikesnap);\n\n        if(!showSpikes) {\n            delete axLayoutOut.spikecolor;\n            delete axLayoutOut.spikethickness;\n            delete axLayoutOut.spikedash;\n            delete axLayoutOut.spikemode;\n            delete axLayoutOut.spikesnap;\n        }\n\n        handlePositionDefaults(axLayoutIn, axLayoutOut, coerce, {\n            letter: axLetter,\n            counterAxes: counterAxes[axLetter],\n            overlayableAxes: getOverlayableAxes(axLetter, axName),\n            grid: layoutOut.grid\n        });\n\n        coerce('title.standoff');\n\n        addMissingMatchedAxis();\n\n        axLayoutOut._input = axLayoutIn;\n    }\n\n    // coerce the 'missing' axes\n    i = 0;\n    while(i < missingMatchedAxisIds.length) {\n        axId = missingMatchedAxisIds[i++];\n        axName = id2name(axId);\n        axLetter = axName.charAt(0);\n\n        if(!Lib.isPlainObject(layoutIn[axName])) {\n            layoutIn[axName] = {};\n        }\n\n        axLayoutIn = layoutIn[axName];\n        axLayoutOut = Template.newContainer(layoutOut, axName, axLetter + 'axis');\n        newAxLayoutOut();\n\n        var defaultOptions2 = {\n            letter: axLetter,\n            font: layoutOut.font,\n            outerTicks: outerTicks[axName],\n            showGrid: !noGrids[axName],\n            data: [],\n            bgColor: bgColor,\n            calendar: layoutOut.calendar,\n            automargin: true,\n            visibleDflt: false,\n            reverseDflt: false,\n            splomStash: ((layoutOut._splomAxes || {})[axLetter] || {})[axId]\n        };\n\n        coerce('uirevision', layoutOut.uirevision);\n\n        axLayoutOut.type = missingMatchedAxisIdsLookup[axId] || 'linear';\n\n        handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions2, layoutOut);\n\n        handlePositionDefaults(axLayoutIn, axLayoutOut, coerce, {\n            letter: axLetter,\n            counterAxes: counterAxes[axLetter],\n            overlayableAxes: getOverlayableAxes(axLetter, axName),\n            grid: layoutOut.grid\n        });\n\n        coerce('fixedrange');\n\n        addMissingMatchedAxis();\n\n        axLayoutOut._input = axLayoutIn;\n    }\n\n    // quick second pass for range slider and selector defaults\n    var rangeSliderDefaults = getComponentMethod('rangeslider', 'handleDefaults');\n    var rangeSelectorDefaults = getComponentMethod('rangeselector', 'handleDefaults');\n\n    for(i = 0; i < xNames.length; i++) {\n        axName = xNames[i];\n        axLayoutIn = layoutIn[axName];\n        axLayoutOut = layoutOut[axName];\n\n        rangeSliderDefaults(layoutIn, layoutOut, axName);\n\n        if(axLayoutOut.type === 'date') {\n            rangeSelectorDefaults(\n                axLayoutIn,\n                axLayoutOut,\n                layoutOut,\n                yNames,\n                axLayoutOut.calendar\n            );\n        }\n\n        coerce('fixedrange');\n    }\n\n    for(i = 0; i < yNames.length; i++) {\n        axName = yNames[i];\n        axLayoutIn = layoutIn[axName];\n        axLayoutOut = layoutOut[axName];\n\n        var anchoredAxis = layoutOut[id2name(axLayoutOut.anchor)];\n\n        var fixedRangeDflt = getComponentMethod('rangeslider', 'isVisible')(anchoredAxis);\n\n        coerce('fixedrange', fixedRangeDflt);\n    }\n\n    // Finally, handle scale constraints and matching axes.\n    //\n    // We need to do this after all axes have coerced both `type`\n    // (so we link only axes of the same type) and\n    // `fixedrange` (so we can avoid linking from OR TO a fixed axis).\n\n    // sets of axes linked by `scaleanchor` along with the scaleratios compounded\n    // together, populated in handleConstraintDefaults\n    var constraintGroups = layoutOut._axisConstraintGroups = [];\n    // similar to _axisConstraintGroups, but for matching axes\n    var matchGroups = layoutOut._axisMatchGroups = [];\n    // make sure to include 'missing' axes here\n    var allAxisIdsIncludingMissing = allAxisIds.concat(missingMatchedAxisIds);\n    var axNamesIncludingMissing = axNames.concat(Lib.simpleMap(missingMatchedAxisIds, id2name));\n\n    for(i = 0; i < axNamesIncludingMissing.length; i++) {\n        axName = axNamesIncludingMissing[i];\n        axLetter = axName.charAt(0);\n        axLayoutIn = layoutIn[axName];\n        axLayoutOut = layoutOut[axName];\n\n        var scaleanchorDflt;\n        if(axLetter === 'y' && !axLayoutIn.hasOwnProperty('scaleanchor') && axHasImage[axName]) {\n            scaleanchorDflt = axLayoutOut.anchor;\n        } else {\n            scaleanchorDflt = undefined;\n        }\n\n        var constrainDflt;\n        if(!axLayoutIn.hasOwnProperty('constrain') && axHasImage[axName]) {\n            constrainDflt = 'domain';\n        } else {\n            constrainDflt = undefined;\n        }\n\n        handleConstraintDefaults(axLayoutIn, axLayoutOut, coerce, {\n            allAxisIds: allAxisIdsIncludingMissing,\n            layoutOut: layoutOut,\n            scaleanchorDflt: scaleanchorDflt,\n            constrainDflt: constrainDflt\n        });\n    }\n\n    for(i = 0; i < matchGroups.length; i++) {\n        var group = matchGroups[i];\n        var rng = null;\n        var autorange = null;\n\n        // find 'matching' range attrs\n        for(axId in group) {\n            axLayoutOut = layoutOut[id2name(axId)];\n            if(!axLayoutOut.matches) {\n                rng = axLayoutOut.range;\n                autorange = axLayoutOut.autorange;\n            }\n        }\n        // if `ax.matches` values are reciprocal,\n        // pick values of first axis in group\n        if(rng === null || autorange === null) {\n            for(axId in group) {\n                axLayoutOut = layoutOut[id2name(axId)];\n                rng = axLayoutOut.range;\n                autorange = axLayoutOut.autorange;\n                break;\n            }\n        }\n        // apply matching range attrs\n        for(axId in group) {\n            axLayoutOut = layoutOut[id2name(axId)];\n            if(axLayoutOut.matches) {\n                axLayoutOut.range = rng.slice();\n                axLayoutOut.autorange = autorange;\n            }\n            axLayoutOut._matchGroup = group;\n        }\n\n        // remove matching axis from scaleanchor constraint groups (for now)\n        if(constraintGroups.length) {\n            for(axId in group) {\n                for(j = 0; j < constraintGroups.length; j++) {\n                    var group2 = constraintGroups[j];\n                    for(var axId2 in group2) {\n                        if(axId === axId2) {\n                            Lib.warn('Axis ' + axId2 + ' is set with both ' +\n                                'a *scaleanchor* and *matches* constraint; ' +\n                                'ignoring the scale constraint.');\n\n                            delete group2[axId2];\n                            if(Object.keys(group2).length < 2) {\n                                constraintGroups.splice(j, 1);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n};\n\n},{\"../../components/color\":52,\"../../components/fx/helpers\":88,\"../../components/fx/hovermode_defaults\":91,\"../../lib\":178,\"../../plot_api/plot_template\":212,\"../../registry\":269,\"../layout_attributes\":254,\"./axis_defaults\":224,\"./axis_ids\":225,\"./constants\":228,\"./constraints\":229,\"./layout_attributes\":236,\"./position_defaults\":239,\"./type_defaults\":247}],238:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorMix = _dereq_('tinycolor2').mix;\nvar lightFraction = _dereq_('../../components/color/attributes').lightFraction;\nvar Lib = _dereq_('../../lib');\n\n/**\n * @param {object} opts :\n *   - dfltColor {string} : default axis color\n *   - bgColor {string} : combined subplot bg color\n *   - blend {number, optional} : blend percentage (to compute dflt grid color)\n *   - showLine {boolean} : show line by default\n *   - showGrid {boolean} : show grid by default\n *   - noZeroLine {boolean} : don't coerce zeroline* attributes\n *   - attributes {object} : attribute object associated with input containers\n */\nmodule.exports = function handleLineGridDefaults(containerIn, containerOut, coerce, opts) {\n    opts = opts || {};\n\n    var dfltColor = opts.dfltColor;\n\n    function coerce2(attr, dflt) {\n        return Lib.coerce2(containerIn, containerOut, opts.attributes, attr, dflt);\n    }\n\n    var lineColor = coerce2('linecolor', dfltColor);\n    var lineWidth = coerce2('linewidth');\n    var showLine = coerce('showline', opts.showLine || !!lineColor || !!lineWidth);\n\n    if(!showLine) {\n        delete containerOut.linecolor;\n        delete containerOut.linewidth;\n    }\n\n    var gridColorDflt = colorMix(dfltColor, opts.bgColor, opts.blend || lightFraction).toRgbString();\n    var gridColor = coerce2('gridcolor', gridColorDflt);\n    var gridWidth = coerce2('gridwidth');\n    var showGridLines = coerce('showgrid', opts.showGrid || !!gridColor || !!gridWidth);\n\n    if(!showGridLines) {\n        delete containerOut.gridcolor;\n        delete containerOut.gridwidth;\n    }\n\n    if(!opts.noZeroLine) {\n        var zeroLineColor = coerce2('zerolinecolor', dfltColor);\n        var zeroLineWidth = coerce2('zerolinewidth');\n        var showZeroLine = coerce('zeroline', opts.showGrid || !!zeroLineColor || !!zeroLineWidth);\n\n        if(!showZeroLine) {\n            delete containerOut.zerolinecolor;\n            delete containerOut.zerolinewidth;\n        }\n    }\n};\n\n},{\"../../components/color/attributes\":51,\"../../lib\":178,\"tinycolor2\":35}],239:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\n\n\nmodule.exports = function handlePositionDefaults(containerIn, containerOut, coerce, options) {\n    var counterAxes = options.counterAxes || [];\n    var overlayableAxes = options.overlayableAxes || [];\n    var letter = options.letter;\n    var grid = options.grid;\n\n    var dfltAnchor, dfltDomain, dfltSide, dfltPosition;\n\n    if(grid) {\n        dfltDomain = grid._domains[letter][grid._axisMap[containerOut._id]];\n        dfltAnchor = grid._anchors[containerOut._id];\n        if(dfltDomain) {\n            dfltSide = grid[letter + 'side'].split(' ')[0];\n            dfltPosition = grid.domain[letter][dfltSide === 'right' || dfltSide === 'top' ? 1 : 0];\n        }\n    }\n\n    // Even if there's a grid, this axis may not be in it - fall back on non-grid defaults\n    dfltDomain = dfltDomain || [0, 1];\n    dfltAnchor = dfltAnchor || (isNumeric(containerIn.position) ? 'free' : (counterAxes[0] || 'free'));\n    dfltSide = dfltSide || (letter === 'x' ? 'bottom' : 'left');\n    dfltPosition = dfltPosition || 0;\n\n    var anchor = Lib.coerce(containerIn, containerOut, {\n        anchor: {\n            valType: 'enumerated',\n            values: ['free'].concat(counterAxes),\n            dflt: dfltAnchor\n        }\n    }, 'anchor');\n\n    if(anchor === 'free') coerce('position', dfltPosition);\n\n    Lib.coerce(containerIn, containerOut, {\n        side: {\n            valType: 'enumerated',\n            values: letter === 'x' ? ['bottom', 'top'] : ['left', 'right'],\n            dflt: dfltSide\n        }\n    }, 'side');\n\n    var overlaying = false;\n    if(overlayableAxes.length) {\n        overlaying = Lib.coerce(containerIn, containerOut, {\n            overlaying: {\n                valType: 'enumerated',\n                values: [false].concat(overlayableAxes),\n                dflt: false\n            }\n        }, 'overlaying');\n    }\n\n    if(!overlaying) {\n        // TODO: right now I'm copying this domain over to overlaying axes\n        // in ax.setscale()... but this means we still need (imperfect) logic\n        // in the axes popover to hide domain for the overlaying axis.\n        // perhaps I should make a private version _domain that all axes get???\n        var domain = coerce('domain', dfltDomain);\n\n        // according to https://www.npmjs.com/package/canvas-size\n        // the minimum value of max canvas width across browsers and devices is 4096\n        // which applied in the calculation below:\n        if(domain[0] > domain[1] - 1 / 4096) containerOut.domain = dfltDomain;\n        Lib.noneOrAll(containerIn.domain, containerOut.domain, dfltDomain);\n    }\n\n    coerce('layer');\n\n    return containerOut;\n};\n\n},{\"../../lib\":178,\"fast-isnumeric\":18}],240:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar FROM_BL = _dereq_('../../constants/alignment').FROM_BL;\n\nmodule.exports = function scaleZoom(ax, factor, centerFraction) {\n    if(centerFraction === undefined) {\n        centerFraction = FROM_BL[ax.constraintoward || 'center'];\n    }\n\n    var rangeLinear = [ax.r2l(ax.range[0]), ax.r2l(ax.range[1])];\n    var center = rangeLinear[0] + (rangeLinear[1] - rangeLinear[0]) * centerFraction;\n\n    ax.range = ax._input.range = [\n        ax.l2r(center + (rangeLinear[0] - center) * factor),\n        ax.l2r(center + (rangeLinear[1] - center) * factor)\n    ];\n};\n\n},{\"../../constants/alignment\":154}],241:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar polybool = _dereq_('polybooljs');\n\nvar Registry = _dereq_('../../registry');\nvar dashStyle = _dereq_('../../components/drawing').dashStyle;\nvar Color = _dereq_('../../components/color');\nvar Fx = _dereq_('../../components/fx');\nvar makeEventData = _dereq_('../../components/fx/helpers').makeEventData;\nvar dragHelpers = _dereq_('../../components/dragelement/helpers');\nvar freeMode = dragHelpers.freeMode;\nvar rectMode = dragHelpers.rectMode;\nvar drawMode = dragHelpers.drawMode;\nvar openMode = dragHelpers.openMode;\nvar selectMode = dragHelpers.selectMode;\n\nvar displayOutlines = _dereq_('../../components/shapes/draw_newshape/display_outlines');\nvar handleEllipse = _dereq_('../../components/shapes/draw_newshape/helpers').handleEllipse;\nvar newShapes = _dereq_('../../components/shapes/draw_newshape/newshapes');\n\nvar Lib = _dereq_('../../lib');\nvar polygon = _dereq_('../../lib/polygon');\nvar throttle = _dereq_('../../lib/throttle');\nvar getFromId = _dereq_('./axis_ids').getFromId;\nvar clearGlCanvases = _dereq_('../../lib/clear_gl_canvases');\n\nvar redrawReglTraces = _dereq_('../../plot_api/subroutines').redrawReglTraces;\n\nvar constants = _dereq_('./constants');\nvar MINSELECT = constants.MINSELECT;\n\nvar filteredPolygon = polygon.filter;\nvar polygonTester = polygon.tester;\n\nvar clearSelect = _dereq_('./handle_outline').clearSelect;\n\nvar helpers = _dereq_('./helpers');\nvar p2r = helpers.p2r;\nvar axValue = helpers.axValue;\nvar getTransform = helpers.getTransform;\n\nfunction prepSelect(e, startX, startY, dragOptions, mode) {\n    var isFreeMode = freeMode(mode);\n    var isRectMode = rectMode(mode);\n    var isOpenMode = openMode(mode);\n    var isDrawMode = drawMode(mode);\n    var isSelectMode = selectMode(mode);\n\n    var isLine = mode === 'drawline';\n    var isEllipse = mode === 'drawcircle';\n    var isLineOrEllipse = isLine || isEllipse; // cases with two start & end positions\n\n    var gd = dragOptions.gd;\n    var fullLayout = gd._fullLayout;\n    var zoomLayer = fullLayout._zoomlayer;\n    var dragBBox = dragOptions.element.getBoundingClientRect();\n    var plotinfo = dragOptions.plotinfo;\n    var transform = getTransform(plotinfo);\n    var x0 = startX - dragBBox.left;\n    var y0 = startY - dragBBox.top;\n    var x1 = x0;\n    var y1 = y0;\n    var path0 = 'M' + x0 + ',' + y0;\n    var pw = dragOptions.xaxes[0]._length;\n    var ph = dragOptions.yaxes[0]._length;\n    var allAxes = dragOptions.xaxes.concat(dragOptions.yaxes);\n    var subtract = e.altKey &&\n        !(drawMode(mode) && isOpenMode);\n\n    var filterPoly, selectionTester, mergedPolygons, currentPolygon;\n    var i, searchInfo, eventData;\n\n    coerceSelectionsCache(e, gd, dragOptions);\n\n    if(isFreeMode) {\n        filterPoly = filteredPolygon([[x0, y0]], constants.BENDPX);\n    }\n\n    var outlines = zoomLayer.selectAll('path.select-outline-' + plotinfo.id).data(isDrawMode ? [0] : [1, 2]);\n    var drwStyle = fullLayout.newshape;\n\n    outlines.enter()\n        .append('path')\n        .attr('class', function(d) { return 'select-outline select-outline-' + d + ' select-outline-' + plotinfo.id; })\n        .style(isDrawMode ? {\n            opacity: drwStyle.opacity / 2,\n            fill: isOpenMode ? undefined : drwStyle.fillcolor,\n            stroke: drwStyle.line.color,\n            'stroke-dasharray': dashStyle(drwStyle.line.dash, drwStyle.line.width),\n            'stroke-width': drwStyle.line.width + 'px'\n        } : {})\n        .attr('fill-rule', drwStyle.fillrule)\n        .classed('cursor-move', isDrawMode ? true : false)\n        .attr('transform', transform)\n        .attr('d', path0 + 'Z');\n\n    var corners = zoomLayer.append('path')\n        .attr('class', 'zoombox-corners')\n        .style({\n            fill: Color.background,\n            stroke: Color.defaultLine,\n            'stroke-width': 1\n        })\n        .attr('transform', transform)\n        .attr('d', 'M0,0Z');\n\n\n    var throttleID = fullLayout._uid + constants.SELECTID;\n    var selection = [];\n\n    // find the traces to search for selection points\n    var searchTraces = determineSearchTraces(gd, dragOptions.xaxes,\n      dragOptions.yaxes, dragOptions.subplot);\n\n    function ascending(a, b) { return a - b; }\n\n    // allow subplots to override fillRangeItems routine\n    var fillRangeItems;\n\n    if(plotinfo.fillRangeItems) {\n        fillRangeItems = plotinfo.fillRangeItems;\n    } else {\n        if(isRectMode) {\n            fillRangeItems = function(eventData, poly) {\n                var ranges = eventData.range = {};\n\n                for(i = 0; i < allAxes.length; i++) {\n                    var ax = allAxes[i];\n                    var axLetter = ax._id.charAt(0);\n\n                    ranges[ax._id] = [\n                        p2r(ax, poly[axLetter + 'min']),\n                        p2r(ax, poly[axLetter + 'max'])\n                    ].sort(ascending);\n                }\n            };\n        } else { // case of isFreeMode\n            fillRangeItems = function(eventData, poly, filterPoly) {\n                var dataPts = eventData.lassoPoints = {};\n\n                for(i = 0; i < allAxes.length; i++) {\n                    var ax = allAxes[i];\n                    dataPts[ax._id] = filterPoly.filtered.map(axValue(ax));\n                }\n            };\n        }\n    }\n\n    dragOptions.moveFn = function(dx0, dy0) {\n        x1 = Math.max(0, Math.min(pw, dx0 + x0));\n        y1 = Math.max(0, Math.min(ph, dy0 + y0));\n\n        var dx = Math.abs(x1 - x0);\n        var dy = Math.abs(y1 - y0);\n\n        if(isRectMode) {\n            var direction;\n            var start, end;\n\n            if(isSelectMode) {\n                var q = fullLayout.selectdirection;\n\n                if(q === 'any') {\n                    if(dy < Math.min(dx * 0.6, MINSELECT)) {\n                        direction = 'h';\n                    } else if(dx < Math.min(dy * 0.6, MINSELECT)) {\n                        direction = 'v';\n                    } else {\n                        direction = 'd';\n                    }\n                } else {\n                    direction = q;\n                }\n\n                switch(direction) {\n                    case 'h':\n                        start = isEllipse ? ph / 2 : 0;\n                        end = ph;\n                        break;\n                    case 'v':\n                        start = isEllipse ? pw / 2 : 0;\n                        end = pw;\n                        break;\n                }\n            }\n\n            if(isDrawMode) {\n                switch(fullLayout.newshape.drawdirection) {\n                    case 'vertical':\n                        direction = 'h';\n                        start = isEllipse ? ph / 2 : 0;\n                        end = ph;\n                        break;\n                    case 'horizontal':\n                        direction = 'v';\n                        start = isEllipse ? pw / 2 : 0;\n                        end = pw;\n                        break;\n                    case 'ortho':\n                        if(dx < dy) {\n                            direction = 'h';\n                            start = y0;\n                            end = y1;\n                        } else {\n                            direction = 'v';\n                            start = x0;\n                            end = x1;\n                        }\n                        break;\n                    default: // i.e. case of 'diagonal'\n                        direction = 'd';\n                }\n            }\n\n            if(direction === 'h') {\n                // horizontal motion\n                currentPolygon = isLineOrEllipse ?\n                    handleEllipse(isEllipse, [x1, start], [x1, end]) : // using x1 instead of x0 allows adjusting the line while drawing\n                    [[x0, start], [x0, end], [x1, end], [x1, start]]; // make a vertical box\n\n                currentPolygon.xmin = isLineOrEllipse ? x1 : Math.min(x0, x1);\n                currentPolygon.xmax = isLineOrEllipse ? x1 : Math.max(x0, x1);\n                currentPolygon.ymin = Math.min(start, end);\n                currentPolygon.ymax = Math.max(start, end);\n                // extras to guide users in keeping a straight selection\n                corners.attr('d', 'M' + currentPolygon.xmin + ',' + (y0 - MINSELECT) +\n                    'h-4v' + (2 * MINSELECT) + 'h4Z' +\n                    'M' + (currentPolygon.xmax - 1) + ',' + (y0 - MINSELECT) +\n                    'h4v' + (2 * MINSELECT) + 'h-4Z');\n            } else if(direction === 'v') {\n                // vertical motion\n                currentPolygon = isLineOrEllipse ?\n                    handleEllipse(isEllipse, [start, y1], [end, y1]) : // using y1 instead of y0 allows adjusting the line while drawing\n                    [[start, y0], [start, y1], [end, y1], [end, y0]]; // make a horizontal box\n\n                currentPolygon.xmin = Math.min(start, end);\n                currentPolygon.xmax = Math.max(start, end);\n                currentPolygon.ymin = isLineOrEllipse ? y1 : Math.min(y0, y1);\n                currentPolygon.ymax = isLineOrEllipse ? y1 : Math.max(y0, y1);\n                corners.attr('d', 'M' + (x0 - MINSELECT) + ',' + currentPolygon.ymin +\n                    'v-4h' + (2 * MINSELECT) + 'v4Z' +\n                    'M' + (x0 - MINSELECT) + ',' + (currentPolygon.ymax - 1) +\n                    'v4h' + (2 * MINSELECT) + 'v-4Z');\n            } else if(direction === 'd') {\n                // diagonal motion\n                currentPolygon = isLineOrEllipse ?\n                    handleEllipse(isEllipse, [x0, y0], [x1, y1]) :\n                    [[x0, y0], [x0, y1], [x1, y1], [x1, y0]];\n\n                currentPolygon.xmin = Math.min(x0, x1);\n                currentPolygon.xmax = Math.max(x0, x1);\n                currentPolygon.ymin = Math.min(y0, y1);\n                currentPolygon.ymax = Math.max(y0, y1);\n                corners.attr('d', 'M0,0Z');\n            }\n        } else if(isFreeMode) {\n            filterPoly.addPt([x1, y1]);\n            currentPolygon = filterPoly.filtered;\n        }\n\n        // create outline & tester\n        if(dragOptions.selectionDefs && dragOptions.selectionDefs.length) {\n            mergedPolygons = mergePolygons(dragOptions.mergedPolygons, currentPolygon, subtract);\n            currentPolygon.subtract = subtract;\n            selectionTester = multiTester(dragOptions.selectionDefs.concat([currentPolygon]));\n        } else {\n            mergedPolygons = [currentPolygon];\n            selectionTester = polygonTester(currentPolygon);\n        }\n\n        // display polygons on the screen\n        displayOutlines(convertPoly(mergedPolygons, isOpenMode), outlines, dragOptions);\n\n        if(isSelectMode) {\n            throttle.throttle(\n                throttleID,\n                constants.SELECTDELAY,\n                function() {\n                    selection = [];\n\n                    var thisSelection;\n                    var traceSelections = [];\n                    var traceSelection;\n                    for(i = 0; i < searchTraces.length; i++) {\n                        searchInfo = searchTraces[i];\n\n                        traceSelection = searchInfo._module.selectPoints(searchInfo, selectionTester);\n                        traceSelections.push(traceSelection);\n\n                        thisSelection = fillSelectionItem(traceSelection, searchInfo);\n\n                        if(selection.length) {\n                            for(var j = 0; j < thisSelection.length; j++) {\n                                selection.push(thisSelection[j]);\n                            }\n                        } else selection = thisSelection;\n                    }\n\n                    eventData = {points: selection};\n                    updateSelectedState(gd, searchTraces, eventData);\n                    fillRangeItems(eventData, currentPolygon, filterPoly);\n                    dragOptions.gd.emit('plotly_selecting', eventData);\n                }\n            );\n        }\n    };\n\n    dragOptions.clickFn = function(numClicks, evt) {\n        corners.remove();\n\n        if(gd._fullLayout._activeShapeIndex >= 0) {\n            gd._fullLayout._deactivateShape(gd);\n            return;\n        }\n        if(isDrawMode) return;\n\n        var clickmode = fullLayout.clickmode;\n\n        throttle.done(throttleID).then(function() {\n            throttle.clear(throttleID);\n            if(numClicks === 2) {\n                // clear selection on doubleclick\n                outlines.remove();\n                for(i = 0; i < searchTraces.length; i++) {\n                    searchInfo = searchTraces[i];\n                    searchInfo._module.selectPoints(searchInfo, false);\n                }\n\n                updateSelectedState(gd, searchTraces);\n\n                clearSelectionsCache(dragOptions);\n\n                gd.emit('plotly_deselect', null);\n            } else {\n                if(clickmode.indexOf('select') > -1) {\n                    selectOnClick(evt, gd, dragOptions.xaxes, dragOptions.yaxes,\n                      dragOptions.subplot, dragOptions, outlines);\n                }\n\n                if(clickmode === 'event') {\n                    // TODO: remove in v2 - this was probably never intended to work as it does,\n                    // but in case anyone depends on it we don't want to break it now.\n                    // Note that click-to-select introduced pre v2 also emitts proper\n                    // event data when clickmode is having 'select' in its flag list.\n                    gd.emit('plotly_selected', undefined);\n                }\n            }\n\n            Fx.click(gd, evt);\n        }).catch(Lib.error);\n    };\n\n    dragOptions.doneFn = function() {\n        corners.remove();\n\n        throttle.done(throttleID).then(function() {\n            throttle.clear(throttleID);\n            dragOptions.gd.emit('plotly_selected', eventData);\n\n            if(currentPolygon && dragOptions.selectionDefs) {\n                // save last polygons\n                currentPolygon.subtract = subtract;\n                dragOptions.selectionDefs.push(currentPolygon);\n\n                // we have to keep reference to arrays container\n                dragOptions.mergedPolygons.length = 0;\n                [].push.apply(dragOptions.mergedPolygons, mergedPolygons);\n            }\n\n            if(dragOptions.doneFnCompleted) {\n                dragOptions.doneFnCompleted(selection);\n            }\n        }).catch(Lib.error);\n\n        if(isDrawMode) {\n            clearSelectionsCache(dragOptions);\n        }\n    };\n}\n\nfunction selectOnClick(evt, gd, xAxes, yAxes, subplot, dragOptions, polygonOutlines) {\n    var hoverData = gd._hoverdata;\n    var fullLayout = gd._fullLayout;\n    var clickmode = fullLayout.clickmode;\n    var sendEvents = clickmode.indexOf('event') > -1;\n    var selection = [];\n    var searchTraces, searchInfo, currentSelectionDef, selectionTester, traceSelection;\n    var thisTracesSelection, pointOrBinSelected, subtract, eventData, i;\n\n    if(isHoverDataSet(hoverData)) {\n        coerceSelectionsCache(evt, gd, dragOptions);\n        searchTraces = determineSearchTraces(gd, xAxes, yAxes, subplot);\n        var clickedPtInfo = extractClickedPtInfo(hoverData, searchTraces);\n        var isBinnedTrace = clickedPtInfo.pointNumbers.length > 0;\n\n\n        // Note: potentially costly operation isPointOrBinSelected is\n        // called as late as possible through the use of an assignment\n        // in an if condition.\n        if(isBinnedTrace ?\n            isOnlyThisBinSelected(searchTraces, clickedPtInfo) :\n            isOnlyOnePointSelected(searchTraces) &&\n                (pointOrBinSelected = isPointOrBinSelected(clickedPtInfo))) {\n            if(polygonOutlines) polygonOutlines.remove();\n            for(i = 0; i < searchTraces.length; i++) {\n                searchInfo = searchTraces[i];\n                searchInfo._module.selectPoints(searchInfo, false);\n            }\n\n            updateSelectedState(gd, searchTraces);\n\n            clearSelectionsCache(dragOptions);\n\n            if(sendEvents) {\n                gd.emit('plotly_deselect', null);\n            }\n        } else {\n            subtract = evt.shiftKey &&\n              (pointOrBinSelected !== undefined ?\n                pointOrBinSelected :\n                isPointOrBinSelected(clickedPtInfo));\n            currentSelectionDef = newPointSelectionDef(clickedPtInfo.pointNumber, clickedPtInfo.searchInfo, subtract);\n\n            var allSelectionDefs = dragOptions.selectionDefs.concat([currentSelectionDef]);\n            selectionTester = multiTester(allSelectionDefs);\n\n            for(i = 0; i < searchTraces.length; i++) {\n                traceSelection = searchTraces[i]._module.selectPoints(searchTraces[i], selectionTester);\n                thisTracesSelection = fillSelectionItem(traceSelection, searchTraces[i]);\n\n                if(selection.length) {\n                    for(var j = 0; j < thisTracesSelection.length; j++) {\n                        selection.push(thisTracesSelection[j]);\n                    }\n                } else selection = thisTracesSelection;\n            }\n\n            eventData = {points: selection};\n            updateSelectedState(gd, searchTraces, eventData);\n\n            if(currentSelectionDef && dragOptions) {\n                dragOptions.selectionDefs.push(currentSelectionDef);\n            }\n\n            if(polygonOutlines) {\n                var polygons = dragOptions.mergedPolygons;\n                var isOpenMode = openMode(dragOptions.dragmode);\n\n                // display polygons on the screen\n                displayOutlines(convertPoly(polygons, isOpenMode), polygonOutlines, dragOptions);\n            }\n\n            if(sendEvents) {\n                gd.emit('plotly_selected', eventData);\n            }\n        }\n    }\n}\n\n/**\n * Constructs a new point selection definition object.\n */\nfunction newPointSelectionDef(pointNumber, searchInfo, subtract) {\n    return {\n        pointNumber: pointNumber,\n        searchInfo: searchInfo,\n        subtract: subtract\n    };\n}\n\nfunction isPointSelectionDef(o) {\n    return 'pointNumber' in o && 'searchInfo' in o;\n}\n\n/*\n * Constructs a new point number tester.\n */\nfunction newPointNumTester(pointSelectionDef) {\n    return {\n        xmin: 0,\n        xmax: 0,\n        ymin: 0,\n        ymax: 0,\n        pts: [],\n        contains: function(pt, omitFirstEdge, pointNumber, searchInfo) {\n            var idxWantedTrace = pointSelectionDef.searchInfo.cd[0].trace._expandedIndex;\n            var idxActualTrace = searchInfo.cd[0].trace._expandedIndex;\n            return idxActualTrace === idxWantedTrace &&\n              pointNumber === pointSelectionDef.pointNumber;\n        },\n        isRect: false,\n        degenerate: false,\n        subtract: pointSelectionDef.subtract\n    };\n}\n\n/**\n * Wraps multiple selection testers.\n *\n * @param {Array} list - An array of selection testers.\n *\n * @return a selection tester object with a contains function\n * that can be called to evaluate a point against all wrapped\n * selection testers that were passed in list.\n */\nfunction multiTester(list) {\n    var testers = [];\n    var xmin = isPointSelectionDef(list[0]) ? 0 : list[0][0][0];\n    var xmax = xmin;\n    var ymin = isPointSelectionDef(list[0]) ? 0 : list[0][0][1];\n    var ymax = ymin;\n\n    for(var i = 0; i < list.length; i++) {\n        if(isPointSelectionDef(list[i])) {\n            testers.push(newPointNumTester(list[i]));\n        } else {\n            var tester = polygon.tester(list[i]);\n            tester.subtract = list[i].subtract;\n            testers.push(tester);\n            xmin = Math.min(xmin, tester.xmin);\n            xmax = Math.max(xmax, tester.xmax);\n            ymin = Math.min(ymin, tester.ymin);\n            ymax = Math.max(ymax, tester.ymax);\n        }\n    }\n\n    /**\n     * Tests if the given point is within this tester.\n     *\n     * @param {Array} pt - [0] is the x coordinate, [1] is the y coordinate of the point.\n     * @param {*} arg - An optional parameter to pass down to wrapped testers.\n     * @param {number} pointNumber - The point number of the point within the underlying data array.\n     * @param {number} searchInfo - An object identifying the trace the point is contained in.\n     *\n     * @return {boolean} true if point is considered to be selected, false otherwise.\n     */\n    function contains(pt, arg, pointNumber, searchInfo) {\n        var contained = false;\n        for(var i = 0; i < testers.length; i++) {\n            if(testers[i].contains(pt, arg, pointNumber, searchInfo)) {\n                // if contained by subtract tester - exclude the point\n                contained = testers[i].subtract === false;\n            }\n        }\n\n        return contained;\n    }\n\n    return {\n        xmin: xmin,\n        xmax: xmax,\n        ymin: ymin,\n        ymax: ymax,\n        pts: [],\n        contains: contains,\n        isRect: false,\n        degenerate: false\n    };\n}\n\nfunction coerceSelectionsCache(evt, gd, dragOptions) {\n    gd._fullLayout._drawing = false;\n\n    var fullLayout = gd._fullLayout;\n    var plotinfo = dragOptions.plotinfo;\n    var dragmode = dragOptions.dragmode;\n\n    var selectingOnSameSubplot = (\n        fullLayout._lastSelectedSubplot &&\n        fullLayout._lastSelectedSubplot === plotinfo.id\n    );\n\n    var hasModifierKey = (evt.shiftKey || evt.altKey) &&\n        !(drawMode(dragmode) && openMode(dragmode));\n\n    if(selectingOnSameSubplot && hasModifierKey &&\n      (plotinfo.selection && plotinfo.selection.selectionDefs) && !dragOptions.selectionDefs) {\n        // take over selection definitions from prev mode, if any\n        dragOptions.selectionDefs = plotinfo.selection.selectionDefs;\n        dragOptions.mergedPolygons = plotinfo.selection.mergedPolygons;\n    } else if(!hasModifierKey || !plotinfo.selection) {\n        clearSelectionsCache(dragOptions);\n    }\n\n    // clear selection outline when selecting a different subplot\n    if(!selectingOnSameSubplot) {\n        clearSelect(gd);\n        fullLayout._lastSelectedSubplot = plotinfo.id;\n    }\n}\n\nfunction clearSelectionsCache(dragOptions) {\n    var dragmode = dragOptions.dragmode;\n    var plotinfo = dragOptions.plotinfo;\n\n    var gd = dragOptions.gd;\n    if(gd._fullLayout._activeShapeIndex >= 0) {\n        gd._fullLayout._deactivateShape(gd);\n    }\n\n    if(drawMode(dragmode)) {\n        var fullLayout = gd._fullLayout;\n        var zoomLayer = fullLayout._zoomlayer;\n\n        var outlines = zoomLayer.selectAll('.select-outline-' + plotinfo.id);\n        if(outlines && gd._fullLayout._drawing) {\n            // add shape\n            var shapes = newShapes(outlines, dragOptions);\n            if(shapes) {\n                Registry.call('_guiRelayout', gd, {\n                    shapes: shapes\n                });\n            }\n\n            gd._fullLayout._drawing = false;\n        }\n    }\n\n    plotinfo.selection = {};\n    plotinfo.selection.selectionDefs = dragOptions.selectionDefs = [];\n    plotinfo.selection.mergedPolygons = dragOptions.mergedPolygons = [];\n}\n\nfunction determineSearchTraces(gd, xAxes, yAxes, subplot) {\n    var searchTraces = [];\n    var xAxisIds = xAxes.map(function(ax) { return ax._id; });\n    var yAxisIds = yAxes.map(function(ax) { return ax._id; });\n    var cd, trace, i;\n\n    for(i = 0; i < gd.calcdata.length; i++) {\n        cd = gd.calcdata[i];\n        trace = cd[0].trace;\n\n        if(trace.visible !== true || !trace._module || !trace._module.selectPoints) continue;\n\n        if(subplot && (trace.subplot === subplot || trace.geo === subplot)) {\n            searchTraces.push(createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]));\n        } else if(\n          trace.type === 'splom' &&\n          // FIXME: make sure we don't have more than single axis for splom\n          trace._xaxes[xAxisIds[0]] && trace._yaxes[yAxisIds[0]]\n        ) {\n            var info = createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]);\n            info.scene = gd._fullLayout._splomScenes[trace.uid];\n            searchTraces.push(info);\n        } else if(\n          trace.type === 'sankey'\n        ) {\n            var sankeyInfo = createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]);\n            searchTraces.push(sankeyInfo);\n        } else {\n            if(xAxisIds.indexOf(trace.xaxis) === -1) continue;\n            if(yAxisIds.indexOf(trace.yaxis) === -1) continue;\n\n            searchTraces.push(createSearchInfo(trace._module, cd,\n              getFromId(gd, trace.xaxis), getFromId(gd, trace.yaxis)));\n        }\n    }\n\n    return searchTraces;\n\n    function createSearchInfo(module, calcData, xaxis, yaxis) {\n        return {\n            _module: module,\n            cd: calcData,\n            xaxis: xaxis,\n            yaxis: yaxis\n        };\n    }\n}\n\nfunction isHoverDataSet(hoverData) {\n    return hoverData &&\n      Array.isArray(hoverData) &&\n      hoverData[0].hoverOnBox !== true;\n}\n\nfunction extractClickedPtInfo(hoverData, searchTraces) {\n    var hoverDatum = hoverData[0];\n    var pointNumber = -1;\n    var pointNumbers = [];\n    var searchInfo, i;\n\n    for(i = 0; i < searchTraces.length; i++) {\n        searchInfo = searchTraces[i];\n        if(hoverDatum.fullData._expandedIndex === searchInfo.cd[0].trace._expandedIndex) {\n            // Special case for box (and violin)\n            if(hoverDatum.hoverOnBox === true) {\n                break;\n            }\n\n            // Hint: in some traces like histogram, one graphical element\n            // doesn't correspond to one particular data point, but to\n            // bins of data points. Thus, hoverDatum can have a binNumber\n            // property instead of pointNumber.\n            if(hoverDatum.pointNumber !== undefined) {\n                pointNumber = hoverDatum.pointNumber;\n            } else if(hoverDatum.binNumber !== undefined) {\n                pointNumber = hoverDatum.binNumber;\n                pointNumbers = hoverDatum.pointNumbers;\n            }\n\n            break;\n        }\n    }\n\n    return {\n        pointNumber: pointNumber,\n        pointNumbers: pointNumbers,\n        searchInfo: searchInfo\n    };\n}\n\nfunction isPointOrBinSelected(clickedPtInfo) {\n    var trace = clickedPtInfo.searchInfo.cd[0].trace;\n    var ptNum = clickedPtInfo.pointNumber;\n    var ptNums = clickedPtInfo.pointNumbers;\n    var ptNumsSet = ptNums.length > 0;\n\n    // When pointsNumbers is set (e.g. histogram's binning),\n    // it is assumed that when the first point of\n    // a bin is selected, all others are as well\n    var ptNumToTest = ptNumsSet ? ptNums[0] : ptNum;\n\n    // TODO potential performance improvement\n    // Primarily we need this function to determine if a click adds\n    // or subtracts from a selection.\n    // In cases `trace.selectedpoints` is a huge array, indexOf\n    // might be slow. One remedy would be to introduce a hash somewhere.\n    return trace.selectedpoints ? trace.selectedpoints.indexOf(ptNumToTest) > -1 : false;\n}\n\nfunction isOnlyThisBinSelected(searchTraces, clickedPtInfo) {\n    var tracesWithSelectedPts = [];\n    var searchInfo, trace, isSameTrace, i;\n\n    for(i = 0; i < searchTraces.length; i++) {\n        searchInfo = searchTraces[i];\n        if(searchInfo.cd[0].trace.selectedpoints && searchInfo.cd[0].trace.selectedpoints.length > 0) {\n            tracesWithSelectedPts.push(searchInfo);\n        }\n    }\n\n    if(tracesWithSelectedPts.length === 1) {\n        isSameTrace = tracesWithSelectedPts[0] === clickedPtInfo.searchInfo;\n        if(isSameTrace) {\n            trace = clickedPtInfo.searchInfo.cd[0].trace;\n            if(trace.selectedpoints.length === clickedPtInfo.pointNumbers.length) {\n                for(i = 0; i < clickedPtInfo.pointNumbers.length; i++) {\n                    if(trace.selectedpoints.indexOf(clickedPtInfo.pointNumbers[i]) < 0) {\n                        return false;\n                    }\n                }\n                return true;\n            }\n        }\n    }\n\n    return false;\n}\n\nfunction isOnlyOnePointSelected(searchTraces) {\n    var len = 0;\n    var searchInfo, trace, i;\n\n    for(i = 0; i < searchTraces.length; i++) {\n        searchInfo = searchTraces[i];\n        trace = searchInfo.cd[0].trace;\n        if(trace.selectedpoints) {\n            if(trace.selectedpoints.length > 1) return false;\n\n            len += trace.selectedpoints.length;\n            if(len > 1) return false;\n        }\n    }\n\n    return len === 1;\n}\n\nfunction updateSelectedState(gd, searchTraces, eventData) {\n    var i, searchInfo, cd, trace;\n\n    // before anything else, update preGUI if necessary\n    for(i = 0; i < searchTraces.length; i++) {\n        var fullInputTrace = searchTraces[i].cd[0].trace._fullInput;\n        var tracePreGUI = gd._fullLayout._tracePreGUI[fullInputTrace.uid] || {};\n        if(tracePreGUI.selectedpoints === undefined) {\n            tracePreGUI.selectedpoints = fullInputTrace._input.selectedpoints || null;\n        }\n    }\n\n    if(eventData) {\n        var pts = eventData.points || [];\n\n        for(i = 0; i < searchTraces.length; i++) {\n            trace = searchTraces[i].cd[0].trace;\n            trace._input.selectedpoints = trace._fullInput.selectedpoints = [];\n            if(trace._fullInput !== trace) trace.selectedpoints = [];\n        }\n\n        for(i = 0; i < pts.length; i++) {\n            var pt = pts[i];\n            var data = pt.data;\n            var fullData = pt.fullData;\n\n            if(pt.pointIndices) {\n                [].push.apply(data.selectedpoints, pt.pointIndices);\n                if(trace._fullInput !== trace) {\n                    [].push.apply(fullData.selectedpoints, pt.pointIndices);\n                }\n            } else {\n                data.selectedpoints.push(pt.pointIndex);\n                if(trace._fullInput !== trace) {\n                    fullData.selectedpoints.push(pt.pointIndex);\n                }\n            }\n        }\n    } else {\n        for(i = 0; i < searchTraces.length; i++) {\n            trace = searchTraces[i].cd[0].trace;\n            delete trace.selectedpoints;\n            delete trace._input.selectedpoints;\n            if(trace._fullInput !== trace) {\n                delete trace._fullInput.selectedpoints;\n            }\n        }\n    }\n\n    var hasRegl = false;\n\n    for(i = 0; i < searchTraces.length; i++) {\n        searchInfo = searchTraces[i];\n        cd = searchInfo.cd;\n        trace = cd[0].trace;\n\n        if(Registry.traceIs(trace, 'regl')) {\n            hasRegl = true;\n        }\n\n        var _module = searchInfo._module;\n        var fn = _module.styleOnSelect || _module.style;\n        if(fn) {\n            fn(gd, cd, cd[0].node3);\n            if(cd[0].nodeRangePlot3) fn(gd, cd, cd[0].nodeRangePlot3);\n        }\n    }\n\n    if(hasRegl) {\n        clearGlCanvases(gd);\n        redrawReglTraces(gd);\n    }\n}\n\nfunction mergePolygons(list, poly, subtract) {\n    var res;\n\n    if(subtract) {\n        res = polybool.difference({\n            regions: list,\n            inverted: false\n        }, {\n            regions: [poly],\n            inverted: false\n        });\n\n        return res.regions;\n    }\n\n    res = polybool.union({\n        regions: list,\n        inverted: false\n    }, {\n        regions: [poly],\n        inverted: false\n    });\n\n    return res.regions;\n}\n\nfunction fillSelectionItem(selection, searchInfo) {\n    if(Array.isArray(selection)) {\n        var cd = searchInfo.cd;\n        var trace = searchInfo.cd[0].trace;\n\n        for(var i = 0; i < selection.length; i++) {\n            selection[i] = makeEventData(selection[i], trace, cd);\n        }\n    }\n\n    return selection;\n}\n\nfunction convertPoly(polygonsIn, isOpenMode) { // add M and L command to draft positions\n    var polygonsOut = [];\n    for(var i = 0; i < polygonsIn.length; i++) {\n        polygonsOut[i] = [];\n        for(var j = 0; j < polygonsIn[i].length; j++) {\n            polygonsOut[i][j] = [];\n            polygonsOut[i][j][0] = j ? 'L' : 'M';\n            for(var k = 0; k < polygonsIn[i][j].length; k++) {\n                polygonsOut[i][j].push(\n                    polygonsIn[i][j][k]\n                );\n            }\n        }\n\n        if(!isOpenMode) {\n            polygonsOut[i].push([\n                'Z',\n                polygonsOut[i][0][1], // initial x\n                polygonsOut[i][0][2]  // initial y\n            ]);\n        }\n    }\n\n    return polygonsOut;\n}\n\nmodule.exports = {\n    prepSelect: prepSelect,\n    clearSelect: clearSelect,\n    clearSelectionsCache: clearSelectionsCache,\n    selectOnClick: selectOnClick\n};\n\n},{\"../../components/color\":52,\"../../components/dragelement/helpers\":70,\"../../components/drawing\":74,\"../../components/fx\":92,\"../../components/fx/helpers\":88,\"../../components/shapes/draw_newshape/display_outlines\":137,\"../../components/shapes/draw_newshape/helpers\":138,\"../../components/shapes/draw_newshape/newshapes\":139,\"../../lib\":178,\"../../lib/clear_gl_canvases\":167,\"../../lib/polygon\":190,\"../../lib/throttle\":200,\"../../plot_api/subroutines\":213,\"../../registry\":269,\"./axis_ids\":225,\"./constants\":228,\"./handle_outline\":232,\"./helpers\":233,\"polybooljs\":26}],242:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar cleanNumber = Lib.cleanNumber;\nvar ms2DateTime = Lib.ms2DateTime;\nvar dateTime2ms = Lib.dateTime2ms;\nvar ensureNumber = Lib.ensureNumber;\nvar isArrayOrTypedArray = Lib.isArrayOrTypedArray;\n\nvar numConstants = _dereq_('../../constants/numerical');\nvar FP_SAFE = numConstants.FP_SAFE;\nvar BADNUM = numConstants.BADNUM;\nvar LOG_CLIP = numConstants.LOG_CLIP;\nvar ONEDAY = numConstants.ONEDAY;\nvar ONEHOUR = numConstants.ONEHOUR;\nvar ONEMIN = numConstants.ONEMIN;\nvar ONESEC = numConstants.ONESEC;\n\nvar axisIds = _dereq_('./axis_ids');\n\nvar constants = _dereq_('./constants');\nvar HOUR_PATTERN = constants.HOUR_PATTERN;\nvar WEEKDAY_PATTERN = constants.WEEKDAY_PATTERN;\n\nfunction fromLog(v) {\n    return Math.pow(10, v);\n}\n\nfunction isValidCategory(v) {\n    return v !== null && v !== undefined;\n}\n\n/**\n * Define the conversion functions for an axis data is used in 5 ways:\n *\n *  d: data, in whatever form it's provided\n *  c: calcdata: turned into numbers, but not linearized\n *  l: linearized - same as c except for log axes (and other nonlinear\n *      mappings later?) this is used when we need to know if it's\n *      *possible* to show some data on this axis, without caring about\n *      the current range\n *  p: pixel value - mapped to the screen with current size and zoom\n *  r: ranges, tick0, and annotation positions match one of the above\n *     but are handled differently for different types:\n *     - linear and date: data format (d)\n *     - category: calcdata format (c), and will stay that way because\n *       the data format has no continuous mapping\n *     - log: linearized (l) format\n *       TODO: in v2.0 we plan to change it to data format. At that point\n *       shapes will work the same way as ranges, tick0, and annotations\n *       so they can use this conversion too.\n *\n * Creates/updates these conversion functions, and a few more utilities\n * like cleanRange, and makeCalcdata\n *\n * also clears the autotick constraints ._minDtick, ._forceTick0\n */\nmodule.exports = function setConvert(ax, fullLayout) {\n    fullLayout = fullLayout || {};\n\n    var axId = (ax._id || 'x');\n    var axLetter = axId.charAt(0);\n\n    function toLog(v, clip) {\n        if(v > 0) return Math.log(v) / Math.LN10;\n\n        else if(v <= 0 && clip && ax.range && ax.range.length === 2) {\n            // clip NaN (ie past negative infinity) to LOG_CLIP axis\n            // length past the negative edge\n            var r0 = ax.range[0];\n            var r1 = ax.range[1];\n            return 0.5 * (r0 + r1 - 2 * LOG_CLIP * Math.abs(r0 - r1));\n        } else return BADNUM;\n    }\n\n    /*\n     * wrapped dateTime2ms that:\n     * - accepts ms numbers for backward compatibility\n     * - inserts a dummy arg so calendar is the 3rd arg (see notes below).\n     * - defaults to ax.calendar\n     */\n    function dt2ms(v, _, calendar, opts) {\n        // NOTE: Changed this behavior: previously we took any numeric value\n        // to be a ms, even if it was a string that could be a bare year.\n        // Now we convert it as a date if at all possible, and only try\n        // as (local) ms if that fails.\n        var ms = dateTime2ms(v, calendar || ax.calendar);\n        if(ms === BADNUM) {\n            if(isNumeric(v)) {\n                v = +v;\n                if((opts || {}).msUTC) {\n                    // For now it is only used\n                    // to fix bar length in milliseconds.\n                    // It could be applied in other places in v2\n                    return v;\n                }\n\n                // keep track of tenths of ms, that `new Date` will drop\n                // same logic as in Lib.ms2DateTime\n                var msecTenths = Math.floor(Lib.mod(v + 0.05, 1) * 10);\n                var msRounded = Math.round(v - msecTenths / 10);\n                ms = dateTime2ms(new Date(msRounded)) + msecTenths / 10;\n            } else return BADNUM;\n        }\n        return ms;\n    }\n\n    // wrapped ms2DateTime to insert default ax.calendar\n    function ms2dt(v, r, calendar) {\n        return ms2DateTime(v, r, calendar || ax.calendar);\n    }\n\n    function getCategoryName(v) {\n        return ax._categories[Math.round(v)];\n    }\n\n    /*\n     * setCategoryIndex: return the index of category v,\n     * inserting it in the list if it's not already there\n     *\n     * this will enter the categories in the order it\n     * encounters them, ie all the categories from the\n     * first data set, then all the ones from the second\n     * that aren't in the first etc.\n     *\n     * it is assumed that this function is being invoked in the\n     * already sorted category order; otherwise there would be\n     * a disconnect between the array and the index returned\n     */\n    function setCategoryIndex(v) {\n        if(isValidCategory(v)) {\n            if(ax._categoriesMap === undefined) {\n                ax._categoriesMap = {};\n            }\n\n            if(ax._categoriesMap[v] !== undefined) {\n                return ax._categoriesMap[v];\n            } else {\n                ax._categories.push(typeof v === 'number' ? String(v) : v);\n\n                var curLength = ax._categories.length - 1;\n                ax._categoriesMap[v] = curLength;\n\n                return curLength;\n            }\n        }\n        return BADNUM;\n    }\n\n    function setMultiCategoryIndex(arrayIn, len) {\n        var arrayOut = new Array(len);\n\n        for(var i = 0; i < len; i++) {\n            var v0 = (arrayIn[0] || [])[i];\n            var v1 = (arrayIn[1] || [])[i];\n            arrayOut[i] = getCategoryIndex([v0, v1]);\n        }\n\n        return arrayOut;\n    }\n\n    function getCategoryIndex(v) {\n        if(ax._categoriesMap) {\n            return ax._categoriesMap[v];\n        }\n    }\n\n    function getCategoryPosition(v) {\n        // d2l/d2c variant that that won't add categories but will also\n        // allow numbers to be mapped to the linearized axis positions\n        var index = getCategoryIndex(v);\n        if(index !== undefined) return index;\n        if(isNumeric(v)) return +v;\n    }\n\n    // include 2 fractional digits on pixel, for PDF zooming etc\n    function _l2p(v, m, b) { return d3.round(b + m * v, 2); }\n\n    function _p2l(px, m, b) { return (px - b) / m; }\n\n    var l2p = function l2p(v) {\n        if(!isNumeric(v)) return BADNUM;\n        return _l2p(v, ax._m, ax._b);\n    };\n\n    var p2l = function(px) {\n        return _p2l(px, ax._m, ax._b);\n    };\n\n    if(ax.rangebreaks) {\n        var isY = axLetter === 'y';\n\n        l2p = function(v) {\n            if(!isNumeric(v)) return BADNUM;\n            var len = ax._rangebreaks.length;\n            if(!len) return _l2p(v, ax._m, ax._b);\n\n            var flip = isY;\n            if(ax.range[0] > ax.range[1]) flip = !flip;\n            var signAx = flip ? -1 : 1;\n            var pos = signAx * v;\n\n            var q = 0;\n            for(var i = 0; i < len; i++) {\n                var min = signAx * ax._rangebreaks[i].min;\n                var max = signAx * ax._rangebreaks[i].max;\n\n                if(pos < min) break;\n                if(pos > max) q = i + 1;\n                else {\n                    // when falls into break, pick 'closest' offset\n                    q = pos < (min + max) / 2 ? i : i + 1;\n                    break;\n                }\n            }\n            var b2 = ax._B[q] || 0;\n            if(!isFinite(b2)) return 0; // avoid NaN translate e.g. in positionLabels if one keep zooming exactly into a break\n            return _l2p(v, ax._m2, b2);\n        };\n\n        p2l = function(px) {\n            var len = ax._rangebreaks.length;\n            if(!len) return _p2l(px, ax._m, ax._b);\n\n            var q = 0;\n            for(var i = 0; i < len; i++) {\n                if(px < ax._rangebreaks[i].pmin) break;\n                if(px > ax._rangebreaks[i].pmax) q = i + 1;\n            }\n            return _p2l(px, ax._m2, ax._B[q]);\n        };\n    }\n\n    // conversions among c/l/p are fairly simple - do them together for all axis types\n    ax.c2l = (ax.type === 'log') ? toLog : ensureNumber;\n    ax.l2c = (ax.type === 'log') ? fromLog : ensureNumber;\n\n    ax.l2p = l2p;\n    ax.p2l = p2l;\n\n    ax.c2p = (ax.type === 'log') ? function(v, clip) { return l2p(toLog(v, clip)); } : l2p;\n    ax.p2c = (ax.type === 'log') ? function(px) { return fromLog(p2l(px)); } : p2l;\n\n    /*\n     * now type-specific conversions for **ALL** other combinations\n     * they're all written out, instead of being combinations of each other, for\n     * both clarity and speed.\n     */\n    if(['linear', '-'].indexOf(ax.type) !== -1) {\n        // all are data vals, but d and r need cleaning\n        ax.d2r = ax.r2d = ax.d2c = ax.r2c = ax.d2l = ax.r2l = cleanNumber;\n        ax.c2d = ax.c2r = ax.l2d = ax.l2r = ensureNumber;\n\n        ax.d2p = ax.r2p = function(v) { return ax.l2p(cleanNumber(v)); };\n        ax.p2d = ax.p2r = p2l;\n\n        ax.cleanPos = ensureNumber;\n    } else if(ax.type === 'log') {\n        // d and c are data vals, r and l are logged (but d and r need cleaning)\n        ax.d2r = ax.d2l = function(v, clip) { return toLog(cleanNumber(v), clip); };\n        ax.r2d = ax.r2c = function(v) { return fromLog(cleanNumber(v)); };\n\n        ax.d2c = ax.r2l = cleanNumber;\n        ax.c2d = ax.l2r = ensureNumber;\n\n        ax.c2r = toLog;\n        ax.l2d = fromLog;\n\n        ax.d2p = function(v, clip) { return ax.l2p(ax.d2r(v, clip)); };\n        ax.p2d = function(px) { return fromLog(p2l(px)); };\n\n        ax.r2p = function(v) { return ax.l2p(cleanNumber(v)); };\n        ax.p2r = p2l;\n\n        ax.cleanPos = ensureNumber;\n    } else if(ax.type === 'date') {\n        // r and d are date strings, l and c are ms\n\n        /*\n         * Any of these functions with r and d on either side, calendar is the\n         * **3rd** argument. log has reserved the second argument.\n         *\n         * Unless you need the special behavior of the second arg (ms2DateTime\n         * uses this to limit precision, toLog uses true to clip negatives\n         * to offscreen low rather than undefined), it's safe to pass 0.\n         */\n        ax.d2r = ax.r2d = Lib.identity;\n\n        ax.d2c = ax.r2c = ax.d2l = ax.r2l = dt2ms;\n        ax.c2d = ax.c2r = ax.l2d = ax.l2r = ms2dt;\n\n        ax.d2p = ax.r2p = function(v, _, calendar) { return ax.l2p(dt2ms(v, 0, calendar)); };\n        ax.p2d = ax.p2r = function(px, r, calendar) { return ms2dt(p2l(px), r, calendar); };\n\n        ax.cleanPos = function(v) { return Lib.cleanDate(v, BADNUM, ax.calendar); };\n    } else if(ax.type === 'category') {\n        // d is categories (string)\n        // c and l are indices (numbers)\n        // r is categories or numbers\n\n        ax.d2c = ax.d2l = setCategoryIndex;\n        ax.r2d = ax.c2d = ax.l2d = getCategoryName;\n\n        ax.d2r = ax.d2l_noadd = getCategoryPosition;\n\n        ax.r2c = function(v) {\n            var index = getCategoryPosition(v);\n            return index !== undefined ? index : ax.fraction2r(0.5);\n        };\n\n        ax.l2r = ax.c2r = ensureNumber;\n        ax.r2l = getCategoryPosition;\n\n        ax.d2p = function(v) { return ax.l2p(ax.r2c(v)); };\n        ax.p2d = function(px) { return getCategoryName(p2l(px)); };\n        ax.r2p = ax.d2p;\n        ax.p2r = p2l;\n\n        ax.cleanPos = function(v) {\n            if(typeof v === 'string' && v !== '') return v;\n            return ensureNumber(v);\n        };\n    } else if(ax.type === 'multicategory') {\n        // N.B. multicategory axes don't define d2c and d2l,\n        // as 'data-to-calcdata' conversion needs to take into\n        // account all data array items as in ax.makeCalcdata.\n\n        ax.r2d = ax.c2d = ax.l2d = getCategoryName;\n        ax.d2r = ax.d2l_noadd = getCategoryPosition;\n\n        ax.r2c = function(v) {\n            var index = getCategoryPosition(v);\n            return index !== undefined ? index : ax.fraction2r(0.5);\n        };\n\n        ax.r2c_just_indices = getCategoryIndex;\n\n        ax.l2r = ax.c2r = ensureNumber;\n        ax.r2l = getCategoryPosition;\n\n        ax.d2p = function(v) { return ax.l2p(ax.r2c(v)); };\n        ax.p2d = function(px) { return getCategoryName(p2l(px)); };\n        ax.r2p = ax.d2p;\n        ax.p2r = p2l;\n\n        ax.cleanPos = function(v) {\n            if(Array.isArray(v) || (typeof v === 'string' && v !== '')) return v;\n            return ensureNumber(v);\n        };\n\n        ax.setupMultiCategory = function(fullData) {\n            var traceIndices = ax._traceIndices;\n            var i, j;\n\n            var matchGroups = fullLayout._axisMatchGroups;\n            if(matchGroups && matchGroups.length && ax._categories.length === 0) {\n                for(i = 0; i < matchGroups.length; i++) {\n                    var group = matchGroups[i];\n                    if(group[axId]) {\n                        for(var axId2 in group) {\n                            if(axId2 !== axId) {\n                                var ax2 = fullLayout[axisIds.id2name(axId2)];\n                                traceIndices = traceIndices.concat(ax2._traceIndices);\n                            }\n                        }\n                    }\n                }\n            }\n\n            // [ [cnt, {$cat: index}], for 1,2 ]\n            var seen = [[0, {}], [0, {}]];\n            // [ [arrayIn[0][i], arrayIn[1][i]], for i .. N ]\n            var list = [];\n\n            for(i = 0; i < traceIndices.length; i++) {\n                var trace = fullData[traceIndices[i]];\n\n                if(axLetter in trace) {\n                    var arrayIn = trace[axLetter];\n                    var len = trace._length || Lib.minRowLength(arrayIn);\n\n                    if(isArrayOrTypedArray(arrayIn[0]) && isArrayOrTypedArray(arrayIn[1])) {\n                        for(j = 0; j < len; j++) {\n                            var v0 = arrayIn[0][j];\n                            var v1 = arrayIn[1][j];\n\n                            if(isValidCategory(v0) && isValidCategory(v1)) {\n                                list.push([v0, v1]);\n\n                                if(!(v0 in seen[0][1])) {\n                                    seen[0][1][v0] = seen[0][0]++;\n                                }\n                                if(!(v1 in seen[1][1])) {\n                                    seen[1][1][v1] = seen[1][0]++;\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n\n            list.sort(function(a, b) {\n                var ind0 = seen[0][1];\n                var d = ind0[a[0]] - ind0[b[0]];\n                if(d) return d;\n\n                var ind1 = seen[1][1];\n                return ind1[a[1]] - ind1[b[1]];\n            });\n\n            for(i = 0; i < list.length; i++) {\n                setCategoryIndex(list[i]);\n            }\n        };\n    }\n\n    // find the range value at the specified (linear) fraction of the axis\n    ax.fraction2r = function(v) {\n        var rl0 = ax.r2l(ax.range[0]);\n        var rl1 = ax.r2l(ax.range[1]);\n        return ax.l2r(rl0 + v * (rl1 - rl0));\n    };\n\n    // find the fraction of the range at the specified range value\n    ax.r2fraction = function(v) {\n        var rl0 = ax.r2l(ax.range[0]);\n        var rl1 = ax.r2l(ax.range[1]);\n        return (ax.r2l(v) - rl0) / (rl1 - rl0);\n    };\n\n    /*\n     * cleanRange: make sure range is a couplet of valid & distinct values\n     * keep numbers away from the limits of floating point numbers,\n     * and dates away from the ends of our date system (+/- 9999 years)\n     *\n     * optional param rangeAttr: operate on a different attribute, like\n     * ax._r, rather than ax.range\n     */\n    ax.cleanRange = function(rangeAttr, opts) {\n        if(!opts) opts = {};\n        if(!rangeAttr) rangeAttr = 'range';\n\n        var range = Lib.nestedProperty(ax, rangeAttr).get();\n        var i, dflt;\n\n        if(ax.type === 'date') dflt = Lib.dfltRange(ax.calendar);\n        else if(axLetter === 'y') dflt = constants.DFLTRANGEY;\n        else dflt = opts.dfltRange || constants.DFLTRANGEX;\n\n        // make sure we don't later mutate the defaults\n        dflt = dflt.slice();\n\n        if(ax.rangemode === 'tozero' || ax.rangemode === 'nonnegative') {\n            dflt[0] = 0;\n        }\n\n        if(!range || range.length !== 2) {\n            Lib.nestedProperty(ax, rangeAttr).set(dflt);\n            return;\n        }\n\n        if(ax.type === 'date' && !ax.autorange) {\n            // check if milliseconds or js date objects are provided for range\n            // and convert to date strings\n            range[0] = Lib.cleanDate(range[0], BADNUM, ax.calendar);\n            range[1] = Lib.cleanDate(range[1], BADNUM, ax.calendar);\n        }\n\n        for(i = 0; i < 2; i++) {\n            if(ax.type === 'date') {\n                if(!Lib.isDateTime(range[i], ax.calendar)) {\n                    ax[rangeAttr] = dflt;\n                    break;\n                }\n\n                if(ax.r2l(range[0]) === ax.r2l(range[1])) {\n                    // split by +/- 1 second\n                    var linCenter = Lib.constrain(ax.r2l(range[0]),\n                        Lib.MIN_MS + 1000, Lib.MAX_MS - 1000);\n                    range[0] = ax.l2r(linCenter - 1000);\n                    range[1] = ax.l2r(linCenter + 1000);\n                    break;\n                }\n            } else {\n                if(!isNumeric(range[i])) {\n                    if(isNumeric(range[1 - i])) {\n                        range[i] = range[1 - i] * (i ? 10 : 0.1);\n                    } else {\n                        ax[rangeAttr] = dflt;\n                        break;\n                    }\n                }\n\n                if(range[i] < -FP_SAFE) range[i] = -FP_SAFE;\n                else if(range[i] > FP_SAFE) range[i] = FP_SAFE;\n\n                if(range[0] === range[1]) {\n                    // somewhat arbitrary: split by 1 or 1ppm, whichever is bigger\n                    var inc = Math.max(1, Math.abs(range[0] * 1e-6));\n                    range[0] -= inc;\n                    range[1] += inc;\n                }\n            }\n        }\n    };\n\n    // set scaling to pixels\n    ax.setScale = function(usePrivateRange) {\n        var gs = fullLayout._size;\n\n        // make sure we have a domain (pull it in from the axis\n        // this one is overlaying if necessary)\n        if(ax.overlaying) {\n            var ax2 = axisIds.getFromId({ _fullLayout: fullLayout }, ax.overlaying);\n            ax.domain = ax2.domain;\n        }\n\n        // While transitions are occurring, we get a double-transform\n        // issue if we transform the drawn layer *and* use the new axis range to\n        // draw the data. This allows us to construct setConvert using the pre-\n        // interaction values of the range:\n        var rangeAttr = (usePrivateRange && ax._r) ? '_r' : 'range';\n        var calendar = ax.calendar;\n        ax.cleanRange(rangeAttr);\n\n        var rl0 = ax.r2l(ax[rangeAttr][0], calendar);\n        var rl1 = ax.r2l(ax[rangeAttr][1], calendar);\n\n        var isY = axLetter === 'y';\n        if(isY) {\n            ax._offset = gs.t + (1 - ax.domain[1]) * gs.h;\n            ax._length = gs.h * (ax.domain[1] - ax.domain[0]);\n            ax._m = ax._length / (rl0 - rl1);\n            ax._b = -ax._m * rl1;\n        } else {\n            ax._offset = gs.l + ax.domain[0] * gs.w;\n            ax._length = gs.w * (ax.domain[1] - ax.domain[0]);\n            ax._m = ax._length / (rl1 - rl0);\n            ax._b = -ax._m * rl0;\n        }\n\n        // set of \"N\" disjoint rangebreaks inside the range\n        ax._rangebreaks = [];\n        // length of these rangebreaks in value space - negative on reversed axes\n        ax._lBreaks = 0;\n        // l2p slope (same for all intervals)\n        ax._m2 = 0;\n        // set of l2p offsets (one for each of the (N+1) piecewise intervals)\n        ax._B = [];\n\n        if(ax.rangebreaks) {\n            var i, brk;\n\n            ax._rangebreaks = ax.locateBreaks(\n                Math.min(rl0, rl1),\n                Math.max(rl0, rl1)\n            );\n\n            if(ax._rangebreaks.length) {\n                for(i = 0; i < ax._rangebreaks.length; i++) {\n                    brk = ax._rangebreaks[i];\n                    ax._lBreaks += Math.abs(brk.max - brk.min);\n                }\n\n                var flip = isY;\n                if(rl0 > rl1) flip = !flip;\n                if(flip) ax._rangebreaks.reverse();\n                var sign = flip ? -1 : 1;\n\n                ax._m2 = sign * ax._length / (Math.abs(rl1 - rl0) - ax._lBreaks);\n                ax._B.push(-ax._m2 * (isY ? rl1 : rl0));\n                for(i = 0; i < ax._rangebreaks.length; i++) {\n                    brk = ax._rangebreaks[i];\n                    ax._B.push(\n                        ax._B[ax._B.length - 1] -\n                        sign * ax._m2 * (brk.max - brk.min)\n                    );\n                }\n\n                // fill pixel (i.e. 'p') min/max here,\n                // to not have to loop through the _rangebreaks twice during `p2l`\n                for(i = 0; i < ax._rangebreaks.length; i++) {\n                    brk = ax._rangebreaks[i];\n                    brk.pmin = l2p(brk.min);\n                    brk.pmax = l2p(brk.max);\n                }\n            }\n        }\n\n        if(!isFinite(ax._m) || !isFinite(ax._b) || ax._length < 0) {\n            fullLayout._replotting = false;\n            throw new Error('Something went wrong with axis scaling');\n        }\n    };\n\n    ax.maskBreaks = function(v) {\n        var rangebreaksIn = ax.rangebreaks || [];\n        var bnds, b0, b1, vb, vDate;\n\n        for(var i = 0; i < rangebreaksIn.length; i++) {\n            var brk = rangebreaksIn[i];\n\n            if(brk.enabled) {\n                if(brk.bounds) {\n                    var pattern = brk.pattern;\n                    bnds = Lib.simpleMap(brk.bounds, pattern ?\n                        cleanNumber :\n                        ax.d2c // case of pattern: ''\n                    );\n                    b0 = bnds[0];\n                    b1 = bnds[1];\n\n                    switch(pattern) {\n                        case WEEKDAY_PATTERN:\n                            vDate = new Date(v);\n                            vb = vDate.getUTCDay();\n\n                            if(b0 > b1) {\n                                b1 += 7;\n                                if(vb < b0) vb += 7;\n                            }\n\n                            break;\n                        case HOUR_PATTERN:\n                            vDate = new Date(v);\n                            var hours = vDate.getUTCHours();\n                            var minutes = vDate.getUTCMinutes();\n                            var seconds = vDate.getUTCSeconds();\n                            var milliseconds = vDate.getUTCMilliseconds();\n\n                            vb = hours + (\n                                minutes / 60 +\n                                seconds / 3600 +\n                                milliseconds / 3600000\n                            );\n\n                            if(b0 > b1) {\n                                b1 += 24;\n                                if(vb < b0) vb += 24;\n                            }\n\n                            break;\n                        case '':\n                            // N.B. should work on date axes as well!\n                            // e.g. { bounds: ['2020-01-04', '2020-01-05 23:59'] }\n                            // TODO should work with reversed-range axes\n                            vb = v;\n                            break;\n                    }\n\n                    if(vb >= b0 && vb < b1) return BADNUM;\n                } else {\n                    var vals = Lib.simpleMap(brk.values, ax.d2c).sort(Lib.sorterAsc);\n                    for(var j = 0; j < vals.length; j++) {\n                        b0 = vals[j];\n                        b1 = b0 + brk.dvalue;\n                        if(v >= b0 && v < b1) return BADNUM;\n                    }\n                }\n            }\n        }\n        return v;\n    };\n\n    ax.locateBreaks = function(r0, r1) {\n        var i, bnds, b0, b1;\n\n        var rangebreaksOut = [];\n        if(!ax.rangebreaks) return rangebreaksOut;\n\n        var rangebreaksIn = ax.rangebreaks.slice().sort(function(a, b) {\n            if(a.pattern === WEEKDAY_PATTERN && b.pattern === HOUR_PATTERN) return -1;\n            if(b.pattern === WEEKDAY_PATTERN && a.pattern === HOUR_PATTERN) return 1;\n            return 0;\n        });\n\n        var addBreak = function(min, max) {\n            min = Lib.constrain(min, r0, r1);\n            max = Lib.constrain(max, r0, r1);\n            if(min === max) return;\n\n            var isNewBreak = true;\n            for(var j = 0; j < rangebreaksOut.length; j++) {\n                var brkj = rangebreaksOut[j];\n                if(min < brkj.max && max >= brkj.min) {\n                    if(min < brkj.min) {\n                        brkj.min = min;\n                    }\n                    if(max > brkj.max) {\n                        brkj.max = max;\n                    }\n                    isNewBreak = false;\n                }\n            }\n            if(isNewBreak) {\n                rangebreaksOut.push({min: min, max: max});\n            }\n        };\n\n        for(i = 0; i < rangebreaksIn.length; i++) {\n            var brk = rangebreaksIn[i];\n\n            if(brk.enabled) {\n                if(brk.bounds) {\n                    var t0 = r0;\n                    var t1 = r1;\n                    if(brk.pattern) {\n                        // to remove decimal (most often found in auto ranges)\n                        t0 = Math.floor(t0);\n                    }\n\n                    bnds = Lib.simpleMap(brk.bounds, brk.pattern ? cleanNumber : ax.r2l);\n                    b0 = bnds[0];\n                    b1 = bnds[1];\n\n                    // r0 value as date\n                    var t0Date = new Date(t0);\n                    // r0 value for break pattern\n                    var bndDelta;\n                    // step in ms between rangebreaks\n                    var step;\n\n                    switch(brk.pattern) {\n                        case WEEKDAY_PATTERN:\n                            step = 7 * ONEDAY;\n\n                            bndDelta = (\n                                (b1 < b0 ? 7 : 0) +\n                                (b1 - b0)\n                            ) * ONEDAY;\n\n                            t0 += b0 * ONEDAY - (\n                                t0Date.getUTCDay() * ONEDAY +\n                                t0Date.getUTCHours() * ONEHOUR +\n                                t0Date.getUTCMinutes() * ONEMIN +\n                                t0Date.getUTCSeconds() * ONESEC +\n                                t0Date.getUTCMilliseconds()\n                            );\n                            break;\n                        case HOUR_PATTERN:\n                            step = ONEDAY;\n\n                            bndDelta = (\n                                (b1 < b0 ? 24 : 0) +\n                                (b1 - b0)\n                            ) * ONEHOUR;\n\n                            t0 += b0 * ONEHOUR - (\n                                t0Date.getUTCHours() * ONEHOUR +\n                                t0Date.getUTCMinutes() * ONEMIN +\n                                t0Date.getUTCSeconds() * ONESEC +\n                                t0Date.getUTCMilliseconds()\n                            );\n                            break;\n                        default:\n                            t0 = Math.min(bnds[0], bnds[1]);\n                            t1 = Math.max(bnds[0], bnds[1]);\n                            step = t1 - t0;\n                            bndDelta = step;\n                    }\n\n                    for(var t = t0; t < t1; t += step) {\n                        addBreak(t, t + bndDelta);\n                    }\n                } else {\n                    var vals = Lib.simpleMap(brk.values, ax.d2c);\n                    for(var j = 0; j < vals.length; j++) {\n                        b0 = vals[j];\n                        b1 = b0 + brk.dvalue;\n                        addBreak(b0, b1);\n                    }\n                }\n            }\n        }\n\n        rangebreaksOut.sort(function(a, b) { return a.min - b.min; });\n\n        return rangebreaksOut;\n    };\n\n    // makeCalcdata: takes an x or y array and converts it\n    // to a position on the axis object \"ax\"\n    // inputs:\n    //      trace - a data object from gd.data\n    //      axLetter - a string, either 'x' or 'y', for which item\n    //          to convert (TODO: is this now always the same as\n    //          the first letter of ax._id?)\n    // in case the expected data isn't there, make a list of\n    // integers based on the opposite data\n    ax.makeCalcdata = function(trace, axLetter, opts) {\n        var arrayIn, arrayOut, i, len;\n\n        var axType = ax.type;\n        var cal = axType === 'date' && trace[axLetter + 'calendar'];\n\n        if(axLetter in trace) {\n            arrayIn = trace[axLetter];\n            len = trace._length || Lib.minRowLength(arrayIn);\n\n            if(Lib.isTypedArray(arrayIn) && (axType === 'linear' || axType === 'log')) {\n                if(len === arrayIn.length) {\n                    return arrayIn;\n                } else if(arrayIn.subarray) {\n                    return arrayIn.subarray(0, len);\n                }\n            }\n\n            if(axType === 'multicategory') {\n                return setMultiCategoryIndex(arrayIn, len);\n            }\n\n            arrayOut = new Array(len);\n            for(i = 0; i < len; i++) {\n                arrayOut[i] = ax.d2c(arrayIn[i], 0, cal, opts);\n            }\n        } else {\n            var v0 = ((axLetter + '0') in trace) ? ax.d2c(trace[axLetter + '0'], 0, cal) : 0;\n            var dv = (trace['d' + axLetter]) ? Number(trace['d' + axLetter]) : 1;\n\n            // the opposing data, for size if we have x and dx etc\n            arrayIn = trace[{x: 'y', y: 'x'}[axLetter]];\n            len = trace._length || arrayIn.length;\n            arrayOut = new Array(len);\n\n            for(i = 0; i < len; i++) {\n                arrayOut[i] = v0 + i * dv;\n            }\n        }\n\n        // mask (i.e. set to BADNUM) coords that fall inside rangebreaks\n        if(ax.rangebreaks) {\n            for(i = 0; i < len; i++) {\n                arrayOut[i] = ax.maskBreaks(arrayOut[i]);\n            }\n        }\n\n        return arrayOut;\n    };\n\n    ax.isValidRange = function(range) {\n        return (\n            Array.isArray(range) &&\n            range.length === 2 &&\n            isNumeric(ax.r2l(range[0])) &&\n            isNumeric(ax.r2l(range[1]))\n        );\n    };\n\n    ax.isPtWithinRange = function(d, calendar) {\n        var coord = ax.c2l(d[axLetter], null, calendar);\n        var r0 = ax.r2l(ax.range[0]);\n        var r1 = ax.r2l(ax.range[1]);\n\n        if(r0 < r1) {\n            return r0 <= coord && coord <= r1;\n        } else {\n            // Reversed axis case.\n            return r1 <= coord && coord <= r0;\n        }\n    };\n\n    ax._emptyCategories = function() {\n        ax._categories = [];\n        ax._categoriesMap = {};\n    };\n\n    // should skip if not category nor multicategory\n    ax.clearCalc = function() {\n        var matchGroups = fullLayout._axisMatchGroups;\n\n        if(matchGroups && matchGroups.length) {\n            var found = false;\n\n            for(var i = 0; i < matchGroups.length; i++) {\n                var group = matchGroups[i];\n\n                if(group[axId]) {\n                    found = true;\n                    var categories = null;\n                    var categoriesMap = null;\n\n                    for(var axId2 in group) {\n                        var ax2 = fullLayout[axisIds.id2name(axId2)];\n                        if(ax2._categories) {\n                            categories = ax2._categories;\n                            categoriesMap = ax2._categoriesMap;\n                            break;\n                        }\n                    }\n\n                    if(categories && categoriesMap) {\n                        ax._categories = categories;\n                        ax._categoriesMap = categoriesMap;\n                    } else {\n                        ax._emptyCategories();\n                    }\n                    break;\n                }\n            }\n            if(!found) ax._emptyCategories();\n        } else {\n            ax._emptyCategories();\n        }\n\n        if(ax._initialCategories) {\n            for(var j = 0; j < ax._initialCategories.length; j++) {\n                setCategoryIndex(ax._initialCategories[j]);\n            }\n        }\n    };\n\n    // sort the axis (and all the matching ones) by _initialCategories\n    // returns the indices of the traces affected by the reordering\n    ax.sortByInitialCategories = function() {\n        var affectedTraces = [];\n\n        ax._emptyCategories();\n\n        if(ax._initialCategories) {\n            for(var j = 0; j < ax._initialCategories.length; j++) {\n                setCategoryIndex(ax._initialCategories[j]);\n            }\n        }\n\n        affectedTraces = affectedTraces.concat(ax._traceIndices);\n\n        // Propagate to matching axes\n        var group = ax._matchGroup;\n        for(var axId2 in group) {\n            if(axId === axId2) continue;\n            var ax2 = fullLayout[axisIds.id2name(axId2)];\n            ax2._categories = ax._categories;\n            ax2._categoriesMap = ax._categoriesMap;\n            affectedTraces = affectedTraces.concat(ax2._traceIndices);\n        }\n        return affectedTraces;\n    };\n\n    // Propagate localization into the axis so that\n    // methods in Axes can use it w/o having to pass fullLayout\n    // Default (non-d3) number formatting uses separators directly\n    // dates and d3-formatted numbers use the d3 locale\n    // Fall back on default format for dummy axes that don't care about formatting\n    var locale = fullLayout._d3locale;\n    if(ax.type === 'date') {\n        ax._dateFormat = locale ? locale.timeFormat.utc : d3.time.format.utc;\n        ax._extraFormat = fullLayout._extraFormat;\n    }\n    // occasionally we need _numFormat to pass through\n    // even though it won't be needed by this axis\n    ax._separators = fullLayout.separators;\n    ax._numFormat = locale ? locale.numberFormat : d3.format;\n\n    // and for bar charts and box plots: reset forced minimum tick spacing\n    delete ax._minDtick;\n    delete ax._forceTick0;\n};\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"./axis_ids\":225,\"./constants\":228,\"d3\":16,\"fast-isnumeric\":18}],243:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar handleArrayContainerDefaults = _dereq_('../array_container_defaults');\n\nmodule.exports = function handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options, config) {\n    if(!config || config.pass === 1) {\n        handlePrefixSuffix(containerIn, containerOut, coerce, axType, options);\n    }\n\n    if(!config || config.pass === 2) {\n        handleOtherDefaults(containerIn, containerOut, coerce, axType, options);\n    }\n};\n\nfunction handlePrefixSuffix(containerIn, containerOut, coerce, axType, options) {\n    var showAttrDflt = getShowAttrDflt(containerIn);\n\n    var tickPrefix = coerce('tickprefix');\n    if(tickPrefix) coerce('showtickprefix', showAttrDflt);\n\n    var tickSuffix = coerce('ticksuffix', options.tickSuffixDflt);\n    if(tickSuffix) coerce('showticksuffix', showAttrDflt);\n}\n\nfunction handleOtherDefaults(containerIn, containerOut, coerce, axType, options) {\n    var showAttrDflt = getShowAttrDflt(containerIn);\n\n    var tickPrefix = coerce('tickprefix');\n    if(tickPrefix) coerce('showtickprefix', showAttrDflt);\n\n    var tickSuffix = coerce('ticksuffix', options.tickSuffixDflt);\n    if(tickSuffix) coerce('showticksuffix', showAttrDflt);\n\n    var showTickLabels = coerce('showticklabels');\n    if(showTickLabels) {\n        var font = options.font || {};\n        var contColor = containerOut.color;\n        // as with titlefont.color, inherit axis.color only if one was\n        // explicitly provided\n        var dfltFontColor = (contColor && contColor !== layoutAttributes.color.dflt) ?\n            contColor : font.color;\n        Lib.coerceFont(coerce, 'tickfont', {\n            family: font.family,\n            size: font.size,\n            color: dfltFontColor\n        });\n        coerce('tickangle');\n\n        if(axType !== 'category') {\n            var tickFormat = coerce('tickformat');\n\n            handleArrayContainerDefaults(containerIn, containerOut, {\n                name: 'tickformatstops',\n                inclusionAttr: 'enabled',\n                handleItemDefaults: tickformatstopDefaults\n            });\n            if(!containerOut.tickformatstops.length) {\n                delete containerOut.tickformatstops;\n            }\n\n            if(!tickFormat && axType !== 'date') {\n                coerce('showexponent', showAttrDflt);\n                coerce('exponentformat');\n                coerce('separatethousands');\n            }\n        }\n    }\n}\n\n/*\n * Attributes 'showexponent', 'showtickprefix' and 'showticksuffix'\n * share values.\n *\n * If only 1 attribute is set,\n * the remaining attributes inherit that value.\n *\n * If 2 attributes are set to the same value,\n * the remaining attribute inherits that value.\n *\n * If 2 attributes are set to different values,\n * the remaining is set to its dflt value.\n *\n */\nfunction getShowAttrDflt(containerIn) {\n    var showAttrsAll = ['showexponent', 'showtickprefix', 'showticksuffix'];\n    var showAttrs = showAttrsAll.filter(function(a) {\n        return containerIn[a] !== undefined;\n    });\n    var sameVal = function(a) {\n        return containerIn[a] === containerIn[showAttrs[0]];\n    };\n\n    if(showAttrs.every(sameVal) || showAttrs.length === 1) {\n        return containerIn[showAttrs[0]];\n    }\n}\n\nfunction tickformatstopDefaults(valueIn, valueOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(valueIn, valueOut, layoutAttributes.tickformatstops, attr, dflt);\n    }\n\n    var enabled = coerce('enabled');\n    if(enabled) {\n        coerce('dtickrange');\n        coerce('value');\n    }\n}\n\n},{\"../../lib\":178,\"../array_container_defaults\":218,\"./layout_attributes\":236}],244:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\n\n\n/**\n * options: inherits outerTicks from axes.handleAxisDefaults\n */\nmodule.exports = function handleTickDefaults(containerIn, containerOut, coerce, options) {\n    var tickLen = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'ticklen');\n    var tickWidth = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'tickwidth');\n    var tickColor = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'tickcolor', containerOut.color);\n    var showTicks = coerce('ticks', (options.outerTicks || tickLen || tickWidth || tickColor) ? 'outside' : '');\n\n    if(!showTicks) {\n        delete containerOut.ticklen;\n        delete containerOut.tickwidth;\n        delete containerOut.tickcolor;\n    }\n};\n\n},{\"../../lib\":178,\"./layout_attributes\":236}],245:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar cleanTicks = _dereq_('./clean_ticks');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\nmodule.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType) {\n    function readInput(attr) {\n        var v = containerIn[attr];\n        return (\n            v !== undefined\n        ) ? v : (containerOut._template || {})[attr];\n    }\n\n    var _tick0 = readInput('tick0');\n    var _dtick = readInput('dtick');\n    var _tickvals = readInput('tickvals');\n\n    var tickmodeDefault = isArrayOrTypedArray(_tickvals) ? 'array' :\n        _dtick ? 'linear' :\n        'auto';\n    var tickmode = coerce('tickmode', tickmodeDefault);\n\n    if(tickmode === 'auto') coerce('nticks');\n    else if(tickmode === 'linear') {\n        // dtick is usually a positive number, but there are some\n        // special strings available for log or date axes\n        // tick0 also has special logic\n        var dtick = containerOut.dtick = cleanTicks.dtick(\n            _dtick, axType);\n        containerOut.tick0 = cleanTicks.tick0(\n            _tick0, axType, containerOut.calendar, dtick);\n    } else if(axType !== 'multicategory') {\n        var tickvals = coerce('tickvals');\n        if(tickvals === undefined) containerOut.tickmode = 'auto';\n        else coerce('ticktext');\n    }\n};\n\n},{\"../../lib\":178,\"./clean_ticks\":227}],246:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar Axes = _dereq_('./axes');\n\n/**\n * transitionAxes\n *\n * transition axes from one set of ranges to another, using a svg\n * transformations, similar to during panning.\n *\n * @param {DOM element | object} gd\n * @param {array} edits : array of 'edits', each item with\n * - plotinfo {object} subplot object\n * - xr0 {array} initial x-range\n * - xr1 {array} end x-range\n * - yr0 {array} initial y-range\n * - yr1 {array} end y-range\n * @param {object} transitionOpts\n * @param {function} makeOnCompleteCallback\n */\nmodule.exports = function transitionAxes(gd, edits, transitionOpts, makeOnCompleteCallback) {\n    var fullLayout = gd._fullLayout;\n\n    // special case for redraw:false Plotly.animate that relies on this\n    // to update axis-referenced layout components\n    if(edits.length === 0) {\n        Axes.redrawComponents(gd);\n        return;\n    }\n\n    function unsetSubplotTransform(subplot) {\n        var xa = subplot.xaxis;\n        var ya = subplot.yaxis;\n\n        fullLayout._defs.select('#' + subplot.clipId + '> rect')\n            .call(Drawing.setTranslate, 0, 0)\n            .call(Drawing.setScale, 1, 1);\n\n        subplot.plot\n            .call(Drawing.setTranslate, xa._offset, ya._offset)\n            .call(Drawing.setScale, 1, 1);\n\n        var traceGroups = subplot.plot.selectAll('.scatterlayer .trace');\n\n        // This is specifically directed at scatter traces, applying an inverse\n        // scale to individual points to counteract the scale of the trace\n        // as a whole:\n        traceGroups.selectAll('.point')\n            .call(Drawing.setPointGroupScale, 1, 1);\n        traceGroups.selectAll('.textpoint')\n            .call(Drawing.setTextPointsScale, 1, 1);\n        traceGroups\n            .call(Drawing.hideOutsideRangePoints, subplot);\n    }\n\n    function updateSubplot(edit, progress) {\n        var plotinfo = edit.plotinfo;\n        var xa = plotinfo.xaxis;\n        var ya = plotinfo.yaxis;\n        var xlen = xa._length;\n        var ylen = ya._length;\n        var editX = !!edit.xr1;\n        var editY = !!edit.yr1;\n        var viewBox = [];\n\n        if(editX) {\n            var xr0 = Lib.simpleMap(edit.xr0, xa.r2l);\n            var xr1 = Lib.simpleMap(edit.xr1, xa.r2l);\n            var dx0 = xr0[1] - xr0[0];\n            var dx1 = xr1[1] - xr1[0];\n            viewBox[0] = (xr0[0] * (1 - progress) + progress * xr1[0] - xr0[0]) / (xr0[1] - xr0[0]) * xlen;\n            viewBox[2] = xlen * ((1 - progress) + progress * dx1 / dx0);\n            xa.range[0] = xa.l2r(xr0[0] * (1 - progress) + progress * xr1[0]);\n            xa.range[1] = xa.l2r(xr0[1] * (1 - progress) + progress * xr1[1]);\n        } else {\n            viewBox[0] = 0;\n            viewBox[2] = xlen;\n        }\n\n        if(editY) {\n            var yr0 = Lib.simpleMap(edit.yr0, ya.r2l);\n            var yr1 = Lib.simpleMap(edit.yr1, ya.r2l);\n            var dy0 = yr0[1] - yr0[0];\n            var dy1 = yr1[1] - yr1[0];\n            viewBox[1] = (yr0[1] * (1 - progress) + progress * yr1[1] - yr0[1]) / (yr0[0] - yr0[1]) * ylen;\n            viewBox[3] = ylen * ((1 - progress) + progress * dy1 / dy0);\n            ya.range[0] = xa.l2r(yr0[0] * (1 - progress) + progress * yr1[0]);\n            ya.range[1] = ya.l2r(yr0[1] * (1 - progress) + progress * yr1[1]);\n        } else {\n            viewBox[1] = 0;\n            viewBox[3] = ylen;\n        }\n\n        Axes.drawOne(gd, xa, {skipTitle: true});\n        Axes.drawOne(gd, ya, {skipTitle: true});\n        Axes.redrawComponents(gd, [xa._id, ya._id]);\n\n        var xScaleFactor = editX ? xlen / viewBox[2] : 1;\n        var yScaleFactor = editY ? ylen / viewBox[3] : 1;\n        var clipDx = editX ? viewBox[0] : 0;\n        var clipDy = editY ? viewBox[1] : 0;\n        var fracDx = editX ? (viewBox[0] / viewBox[2] * xlen) : 0;\n        var fracDy = editY ? (viewBox[1] / viewBox[3] * ylen) : 0;\n        var plotDx = xa._offset - fracDx;\n        var plotDy = ya._offset - fracDy;\n\n        plotinfo.clipRect\n            .call(Drawing.setTranslate, clipDx, clipDy)\n            .call(Drawing.setScale, 1 / xScaleFactor, 1 / yScaleFactor);\n\n        plotinfo.plot\n            .call(Drawing.setTranslate, plotDx, plotDy)\n            .call(Drawing.setScale, xScaleFactor, yScaleFactor);\n\n        // apply an inverse scale to individual points to counteract\n        // the scale of the trace group.\n        Drawing.setPointGroupScale(plotinfo.zoomScalePts, 1 / xScaleFactor, 1 / yScaleFactor);\n        Drawing.setTextPointsScale(plotinfo.zoomScaleTxt, 1 / xScaleFactor, 1 / yScaleFactor);\n    }\n\n    var onComplete;\n    if(makeOnCompleteCallback) {\n        // This module makes the choice whether or not it notifies Plotly.transition\n        // about completion:\n        onComplete = makeOnCompleteCallback();\n    }\n\n    function transitionComplete() {\n        var aobj = {};\n\n        for(var i = 0; i < edits.length; i++) {\n            var edit = edits[i];\n            var xa = edit.plotinfo.xaxis;\n            var ya = edit.plotinfo.yaxis;\n            if(edit.xr1) aobj[xa._name + '.range'] = edit.xr1.slice();\n            if(edit.yr1) aobj[ya._name + '.range'] = edit.yr1.slice();\n        }\n\n        // Signal that this transition has completed:\n        onComplete && onComplete();\n\n        return Registry.call('relayout', gd, aobj).then(function() {\n            for(var i = 0; i < edits.length; i++) {\n                unsetSubplotTransform(edits[i].plotinfo);\n            }\n        });\n    }\n\n    function transitionInterrupt() {\n        var aobj = {};\n\n        for(var i = 0; i < edits.length; i++) {\n            var edit = edits[i];\n            var xa = edit.plotinfo.xaxis;\n            var ya = edit.plotinfo.yaxis;\n            if(edit.xr0) aobj[xa._name + '.range'] = edit.xr0.slice();\n            if(edit.yr0) aobj[ya._name + '.range'] = edit.yr0.slice();\n        }\n\n        return Registry.call('relayout', gd, aobj).then(function() {\n            for(var i = 0; i < edits.length; i++) {\n                unsetSubplotTransform(edits[i].plotinfo);\n            }\n        });\n    }\n\n    var t1, t2, raf;\n    var easeFn = d3.ease(transitionOpts.easing);\n\n    gd._transitionData._interruptCallbacks.push(function() {\n        window.cancelAnimationFrame(raf);\n        raf = null;\n        return transitionInterrupt();\n    });\n\n    function doFrame() {\n        t2 = Date.now();\n\n        var tInterp = Math.min(1, (t2 - t1) / transitionOpts.duration);\n        var progress = easeFn(tInterp);\n\n        for(var i = 0; i < edits.length; i++) {\n            updateSubplot(edits[i], progress);\n        }\n\n        if(t2 - t1 > transitionOpts.duration) {\n            transitionComplete();\n            raf = window.cancelAnimationFrame(doFrame);\n        } else {\n            raf = window.requestAnimationFrame(doFrame);\n        }\n    }\n\n    t1 = Date.now();\n    raf = window.requestAnimationFrame(doFrame);\n\n    return Promise.resolve();\n};\n\n},{\"../../components/drawing\":74,\"../../lib\":178,\"../../registry\":269,\"./axes\":222,\"d3\":16}],247:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar traceIs = _dereq_('../../registry').traceIs;\nvar autoType = _dereq_('./axis_autotype');\n\n/*\n *  data: the plot data to use in choosing auto type\n *  name: axis object name (ie 'xaxis') if one should be stored\n */\nmodule.exports = function handleTypeDefaults(containerIn, containerOut, coerce, options) {\n    var axType = coerce('type', (options.splomStash || {}).type);\n\n    if(axType === '-') {\n        setAutoType(containerOut, options.data);\n\n        if(containerOut.type === '-') {\n            containerOut.type = 'linear';\n        } else {\n            // copy autoType back to input axis\n            // note that if this object didn't exist\n            // in the input layout, we have to put it in\n            // this happens in the main supplyDefaults function\n            containerIn.type = containerOut.type;\n        }\n    }\n};\n\nfunction setAutoType(ax, data) {\n    // new logic: let people specify any type they want,\n    // only autotype if type is '-'\n    if(ax.type !== '-') return;\n\n    var id = ax._id;\n    var axLetter = id.charAt(0);\n    var i;\n\n    // support 3d\n    if(id.indexOf('scene') !== -1) id = axLetter;\n\n    var d0 = getFirstNonEmptyTrace(data, id, axLetter);\n    if(!d0) return;\n\n    // first check for histograms, as the count direction\n    // should always default to a linear axis\n    if(d0.type === 'histogram' &&\n        axLetter === {v: 'y', h: 'x'}[d0.orientation || 'v']\n    ) {\n        ax.type = 'linear';\n        return;\n    }\n\n    var calAttr = axLetter + 'calendar';\n    var calendar = d0[calAttr];\n    var opts = {noMultiCategory: !traceIs(d0, 'cartesian') || traceIs(d0, 'noMultiCategory')};\n\n    // To not confuse 2D x/y used for per-box sample points for multicategory coordinates\n    if(d0.type === 'box' && d0._hasPreCompStats &&\n        axLetter === {h: 'x', v: 'y'}[d0.orientation || 'v']\n    ) {\n        opts.noMultiCategory = true;\n    }\n\n    // check all boxes on this x axis to see\n    // if they're dates, numbers, or categories\n    if(isBoxWithoutPositionCoords(d0, axLetter)) {\n        var posLetter = getBoxPosLetter(d0);\n        var boxPositions = [];\n\n        for(i = 0; i < data.length; i++) {\n            var trace = data[i];\n            if(!traceIs(trace, 'box-violin') || (trace[axLetter + 'axis'] || axLetter) !== id) continue;\n\n            if(trace[posLetter] !== undefined) boxPositions.push(trace[posLetter][0]);\n            else if(trace.name !== undefined) boxPositions.push(trace.name);\n            else boxPositions.push('text');\n\n            if(trace[calAttr] !== calendar) calendar = undefined;\n        }\n\n        ax.type = autoType(boxPositions, calendar, opts);\n    } else if(d0.type === 'splom') {\n        var dimensions = d0.dimensions;\n        var dim = dimensions[d0._axesDim[id]];\n        if(dim.visible) ax.type = autoType(dim.values, calendar, opts);\n    } else {\n        ax.type = autoType(d0[axLetter] || [d0[axLetter + '0']], calendar, opts);\n    }\n}\n\nfunction getFirstNonEmptyTrace(data, id, axLetter) {\n    for(var i = 0; i < data.length; i++) {\n        var trace = data[i];\n\n        if(trace.type === 'splom' &&\n                trace._length > 0 &&\n                (trace['_' + axLetter + 'axes'] || {})[id]\n        ) {\n            return trace;\n        }\n\n        if((trace[axLetter + 'axis'] || axLetter) === id) {\n            if(isBoxWithoutPositionCoords(trace, axLetter)) {\n                return trace;\n            } else if((trace[axLetter] || []).length || trace[axLetter + '0']) {\n                return trace;\n            }\n        }\n    }\n}\n\nfunction getBoxPosLetter(trace) {\n    return {v: 'x', h: 'y'}[trace.orientation || 'v'];\n}\n\nfunction isBoxWithoutPositionCoords(trace, axLetter) {\n    var posLetter = getBoxPosLetter(trace);\n    var isBox = traceIs(trace, 'box-violin');\n    var isCandlestick = traceIs(trace._fullInput || {}, 'candlestick');\n\n    return (\n        isBox &&\n        !isCandlestick &&\n        axLetter === posLetter &&\n        trace[posLetter] === undefined &&\n        trace[posLetter + '0'] === undefined\n    );\n}\n\n},{\"../../registry\":269,\"./axis_autotype\":223}],248:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\n\n/*\n * Create or update an observer. This function is designed to be\n * idempotent so that it can be called over and over as the component\n * updates, and will attach and detach listeners as needed.\n *\n * @param {optional object} container\n *      An object on which the observer is stored. This is the mechanism\n *      by which it is idempotent. If it already exists, another won't be\n *      added. Each time it's called, the value lookup table is updated.\n * @param {array} commandList\n *      An array of commands, following either `buttons` of `updatemenus`\n *      or `steps` of `sliders`.\n * @param {function} onchange\n *      A listener called when the value is changed. Receives data object\n *      with information about the new state.\n */\nexports.manageCommandObserver = function(gd, container, commandList, onchange) {\n    var ret = {};\n    var enabled = true;\n\n    if(container && container._commandObserver) {\n        ret = container._commandObserver;\n    }\n\n    if(!ret.cache) {\n        ret.cache = {};\n    }\n\n    // Either create or just recompute this:\n    ret.lookupTable = {};\n\n    var binding = exports.hasSimpleAPICommandBindings(gd, commandList, ret.lookupTable);\n\n    if(container && container._commandObserver) {\n        if(!binding) {\n            // If container exists and there are no longer any bindings,\n            // remove existing:\n            if(container._commandObserver.remove) {\n                container._commandObserver.remove();\n                container._commandObserver = null;\n                return ret;\n            }\n        } else {\n            // If container exists and there *are* bindings, then the lookup\n            // table should have been updated and check is already attached,\n            // so there's nothing to be done:\n            return ret;\n        }\n    }\n\n    // Determine whether there's anything to do for this binding:\n\n    if(binding) {\n        // Build the cache:\n        bindingValueHasChanged(gd, binding, ret.cache);\n\n        ret.check = function check() {\n            if(!enabled) return;\n\n            var update = bindingValueHasChanged(gd, binding, ret.cache);\n\n            if(update.changed && onchange) {\n                // Disable checks for the duration of this command in order to avoid\n                // infinite loops:\n                if(ret.lookupTable[update.value] !== undefined) {\n                    ret.disable();\n                    Promise.resolve(onchange({\n                        value: update.value,\n                        type: binding.type,\n                        prop: binding.prop,\n                        traces: binding.traces,\n                        index: ret.lookupTable[update.value]\n                    })).then(ret.enable, ret.enable);\n                }\n            }\n\n            return update.changed;\n        };\n\n        var checkEvents = [\n            'plotly_relayout',\n            'plotly_redraw',\n            'plotly_restyle',\n            'plotly_update',\n            'plotly_animatingframe',\n            'plotly_afterplot'\n        ];\n\n        for(var i = 0; i < checkEvents.length; i++) {\n            gd._internalOn(checkEvents[i], ret.check);\n        }\n\n        ret.remove = function() {\n            for(var i = 0; i < checkEvents.length; i++) {\n                gd._removeInternalListener(checkEvents[i], ret.check);\n            }\n        };\n    } else {\n        // TODO: It'd be really neat to actually give a *reason* for this, but at least a warning\n        // is a start\n        Lib.log('Unable to automatically bind plot updates to API command');\n\n        ret.lookupTable = {};\n        ret.remove = function() {};\n    }\n\n    ret.disable = function disable() {\n        enabled = false;\n    };\n\n    ret.enable = function enable() {\n        enabled = true;\n    };\n\n    if(container) {\n        container._commandObserver = ret;\n    }\n\n    return ret;\n};\n\n/*\n * This function checks to see if an array of objects containing\n * method and args properties is compatible with automatic two-way\n * binding. The criteria right now are that\n *\n *   1. multiple traces may be affected\n *   2. only one property may be affected\n *   3. the same property must be affected by all commands\n */\nexports.hasSimpleAPICommandBindings = function(gd, commandList, bindingsByValue) {\n    var i;\n    var n = commandList.length;\n\n    var refBinding;\n\n    for(i = 0; i < n; i++) {\n        var binding;\n        var command = commandList[i];\n        var method = command.method;\n        var args = command.args;\n\n        if(!Array.isArray(args)) args = [];\n\n        // If any command has no method, refuse to bind:\n        if(!method) {\n            return false;\n        }\n        var bindings = exports.computeAPICommandBindings(gd, method, args);\n\n        // Right now, handle one and *only* one property being set:\n        if(bindings.length !== 1) {\n            return false;\n        }\n\n        if(!refBinding) {\n            refBinding = bindings[0];\n            if(Array.isArray(refBinding.traces)) {\n                refBinding.traces.sort();\n            }\n        } else {\n            binding = bindings[0];\n            if(binding.type !== refBinding.type) {\n                return false;\n            }\n            if(binding.prop !== refBinding.prop) {\n                return false;\n            }\n            if(Array.isArray(refBinding.traces)) {\n                if(Array.isArray(binding.traces)) {\n                    binding.traces.sort();\n                    for(var j = 0; j < refBinding.traces.length; j++) {\n                        if(refBinding.traces[j] !== binding.traces[j]) {\n                            return false;\n                        }\n                    }\n                } else {\n                    return false;\n                }\n            } else {\n                if(binding.prop !== refBinding.prop) {\n                    return false;\n                }\n            }\n        }\n\n        binding = bindings[0];\n        var value = binding.value;\n        if(Array.isArray(value)) {\n            if(value.length === 1) {\n                value = value[0];\n            } else {\n                return false;\n            }\n        }\n        if(bindingsByValue) {\n            bindingsByValue[value] = i;\n        }\n    }\n\n    return refBinding;\n};\n\nfunction bindingValueHasChanged(gd, binding, cache) {\n    var container, value, obj;\n    var changed = false;\n\n    if(binding.type === 'data') {\n        // If it's data, we need to get a trace. Based on the limited scope\n        // of what we cover, we can just take the first trace from the list,\n        // or otherwise just the first trace:\n        container = gd._fullData[binding.traces !== null ? binding.traces[0] : 0];\n    } else if(binding.type === 'layout') {\n        container = gd._fullLayout;\n    } else {\n        return false;\n    }\n\n    value = Lib.nestedProperty(container, binding.prop).get();\n\n    obj = cache[binding.type] = cache[binding.type] || {};\n\n    if(obj.hasOwnProperty(binding.prop)) {\n        if(obj[binding.prop] !== value) {\n            changed = true;\n        }\n    }\n\n    obj[binding.prop] = value;\n\n    return {\n        changed: changed,\n        value: value\n    };\n}\n\n/*\n * Execute an API command. There's really not much to this; it just provides\n * a common hook so that implementations don't need to be synchronized across\n * multiple components with the ability to invoke API commands.\n *\n * @param {string} method\n *      The name of the plotly command to execute. Must be one of 'animate',\n *      'restyle', 'relayout', 'update'.\n * @param {array} args\n *      A list of arguments passed to the API command\n */\nexports.executeAPICommand = function(gd, method, args) {\n    if(method === 'skip') return Promise.resolve();\n\n    var _method = Registry.apiMethodRegistry[method];\n    var allArgs = [gd];\n    if(!Array.isArray(args)) args = [];\n\n    for(var i = 0; i < args.length; i++) {\n        allArgs.push(args[i]);\n    }\n\n    return _method.apply(null, allArgs).catch(function(err) {\n        Lib.warn('API call to Plotly.' + method + ' rejected.', err);\n        return Promise.reject(err);\n    });\n};\n\nexports.computeAPICommandBindings = function(gd, method, args) {\n    var bindings;\n\n    if(!Array.isArray(args)) args = [];\n\n    switch(method) {\n        case 'restyle':\n            bindings = computeDataBindings(gd, args);\n            break;\n        case 'relayout':\n            bindings = computeLayoutBindings(gd, args);\n            break;\n        case 'update':\n            bindings = computeDataBindings(gd, [args[0], args[2]])\n                .concat(computeLayoutBindings(gd, [args[1]]));\n            break;\n        case 'animate':\n            bindings = computeAnimateBindings(gd, args);\n            break;\n        default:\n            // This is the case where intelligent logic about what affects\n            // this command is not implemented. It causes no ill effects.\n            // For example, addFrames simply won't bind to a control component.\n            bindings = [];\n    }\n    return bindings;\n};\n\nfunction computeAnimateBindings(gd, args) {\n    // We'll assume that the only relevant modification an animation\n    // makes that's meaningfully tracked is the frame:\n    if(Array.isArray(args[0]) && args[0].length === 1 && ['string', 'number'].indexOf(typeof args[0][0]) !== -1) {\n        return [{type: 'layout', prop: '_currentFrame', value: args[0][0].toString()}];\n    } else {\n        return [];\n    }\n}\n\nfunction computeLayoutBindings(gd, args) {\n    var bindings = [];\n\n    var astr = args[0];\n    var aobj = {};\n    if(typeof astr === 'string') {\n        aobj[astr] = args[1];\n    } else if(Lib.isPlainObject(astr)) {\n        aobj = astr;\n    } else {\n        return bindings;\n    }\n\n    crawl(aobj, function(path, attrName, attr) {\n        bindings.push({type: 'layout', prop: path, value: attr});\n    }, '', 0);\n\n    return bindings;\n}\n\nfunction computeDataBindings(gd, args) {\n    var traces, astr, val, aobj;\n    var bindings = [];\n\n    // Logic copied from Plotly.restyle:\n    astr = args[0];\n    val = args[1];\n    traces = args[2];\n    aobj = {};\n    if(typeof astr === 'string') {\n        aobj[astr] = val;\n    } else if(Lib.isPlainObject(astr)) {\n        // the 3-arg form\n        aobj = astr;\n\n        if(traces === undefined) {\n            traces = val;\n        }\n    } else {\n        return bindings;\n    }\n\n    if(traces === undefined) {\n        // Explicitly assign this to null instead of undefined:\n        traces = null;\n    }\n\n    crawl(aobj, function(path, attrName, _attr) {\n        var thisTraces;\n        var attr;\n\n        if(Array.isArray(_attr)) {\n            attr = _attr.slice();\n\n            var nAttr = Math.min(attr.length, gd.data.length);\n            if(traces) {\n                nAttr = Math.min(nAttr, traces.length);\n            }\n            thisTraces = [];\n            for(var j = 0; j < nAttr; j++) {\n                thisTraces[j] = traces ? traces[j] : j;\n            }\n        } else {\n            attr = _attr;\n            thisTraces = traces ? traces.slice() : null;\n        }\n\n        // Convert [7] to just 7 when traces is null:\n        if(thisTraces === null) {\n            if(Array.isArray(attr)) {\n                attr = attr[0];\n            }\n        } else if(Array.isArray(thisTraces)) {\n            if(!Array.isArray(attr)) {\n                var tmp = attr;\n                attr = [];\n                for(var i = 0; i < thisTraces.length; i++) {\n                    attr[i] = tmp;\n                }\n            }\n            attr.length = Math.min(thisTraces.length, attr.length);\n        }\n\n        bindings.push({\n            type: 'data',\n            prop: path,\n            traces: thisTraces,\n            value: attr\n        });\n    }, '', 0);\n\n    return bindings;\n}\n\nfunction crawl(attrs, callback, path, depth) {\n    Object.keys(attrs).forEach(function(attrName) {\n        var attr = attrs[attrName];\n\n        if(attrName[0] === '_') return;\n\n        var thisPath = path + (depth > 0 ? '.' : '') + attrName;\n\n        if(Lib.isPlainObject(attr)) {\n            crawl(attr, callback, thisPath, depth + 1);\n        } else {\n            // Only execute the callback on leaf nodes:\n            callback(thisPath, attrName, attr);\n        }\n    });\n}\n\n},{\"../lib\":178,\"../registry\":269}],249:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar extendFlat = _dereq_('../lib/extend').extendFlat;\n\n/**\n * Make a xy domain attribute group\n *\n * @param {object} opts\n *   @param {string}\n *     opts.name: name to be inserted in the default description\n *   @param {boolean}\n *     opts.trace: set to true for trace containers\n *   @param {string}\n *     opts.editType: editType for all pieces\n *   @param {boolean}\n *     opts.noGridCell: set to true to omit `row` and `column`\n *\n * @param {object} extra\n *   @param {string}\n *     extra.description: extra description. N.B we use\n *     a separate extra container to make it compatible with\n *     the compress_attributes transform.\n *\n * @return {object} attributes object containing {x,y} as specified\n */\nexports.attributes = function(opts, extra) {\n    opts = opts || {};\n    extra = extra || {};\n\n    var base = {\n        valType: 'info_array',\n        \n        editType: opts.editType,\n        items: [\n            {valType: 'number', min: 0, max: 1, editType: opts.editType},\n            {valType: 'number', min: 0, max: 1, editType: opts.editType}\n        ],\n        dflt: [0, 1]\n    };\n\n    var namePart = opts.name ? opts.name + ' ' : '';\n    var contPart = opts.trace ? 'trace ' : 'subplot ';\n    var descPart = extra.description ? ' ' + extra.description : '';\n\n    var out = {\n        x: extendFlat({}, base, {\n            \n        }),\n        y: extendFlat({}, base, {\n            \n        }),\n        editType: opts.editType\n    };\n\n    if(!opts.noGridCell) {\n        out.row = {\n            valType: 'integer',\n            min: 0,\n            dflt: 0,\n            \n            editType: opts.editType,\n            \n        };\n        out.column = {\n            valType: 'integer',\n            min: 0,\n            dflt: 0,\n            \n            editType: opts.editType,\n            \n        };\n    }\n\n    return out;\n};\n\nexports.defaults = function(containerOut, layout, coerce, dfltDomains) {\n    var dfltX = (dfltDomains && dfltDomains.x) || [0, 1];\n    var dfltY = (dfltDomains && dfltDomains.y) || [0, 1];\n\n    var grid = layout.grid;\n    if(grid) {\n        var column = coerce('domain.column');\n        if(column !== undefined) {\n            if(column < grid.columns) dfltX = grid._domains.x[column];\n            else delete containerOut.domain.column;\n        }\n\n        var row = coerce('domain.row');\n        if(row !== undefined) {\n            if(row < grid.rows) dfltY = grid._domains.y[row];\n            else delete containerOut.domain.row;\n        }\n    }\n\n    var x = coerce('domain.x', dfltX);\n    var y = coerce('domain.y', dfltY);\n\n    // don't accept bad input data\n    if(!(x[0] < x[1])) containerOut.domain.x = dfltX.slice();\n    if(!(y[0] < y[1])) containerOut.domain.y = dfltY.slice();\n};\n\n},{\"../lib/extend\":173}],250:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * make a font attribute group\n *\n * @param {object} opts\n *   @param {string}\n *     opts.description: where & how this font is used\n *   @param {optional bool} arrayOk:\n *     should each part (family, size, color) be arrayOk? default false.\n *   @param {string} editType:\n *     the editType for all pieces of this font\n *   @param {optional string} colorEditType:\n *     a separate editType just for color\n *\n * @return {object} attributes object containing {family, size, color} as specified\n */\nmodule.exports = function(opts) {\n    var editType = opts.editType;\n    var colorEditType = opts.colorEditType;\n    if(colorEditType === undefined) colorEditType = editType;\n    var attrs = {\n        family: {\n            valType: 'string',\n            \n            noBlank: true,\n            strict: true,\n            editType: editType,\n            \n        },\n        size: {\n            valType: 'number',\n            \n            min: 1,\n            editType: editType\n        },\n        color: {\n            valType: 'color',\n            \n            editType: colorEditType\n        },\n        editType: editType,\n        // blank strings so compress_attributes can remove\n        // TODO - that's uber hacky... better solution?\n        \n    };\n\n    if(opts.arrayOk) {\n        attrs.family.arrayOk = true;\n        attrs.size.arrayOk = true;\n        attrs.color.arrayOk = true;\n    }\n\n    return attrs;\n};\n\n},{}],251:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    _isLinkedToArray: 'frames_entry',\n\n    group: {\n        valType: 'string',\n        \n        \n    },\n    name: {\n        valType: 'string',\n        \n        \n    },\n    traces: {\n        valType: 'any',\n        \n        \n    },\n    baseframe: {\n        valType: 'string',\n        \n        \n    },\n    data: {\n        valType: 'any',\n        \n        \n    },\n    layout: {\n        valType: 'any',\n        \n        \n    }\n};\n\n},{}],252:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\nvar SUBPLOT_PATTERN = _dereq_('./cartesian/constants').SUBPLOT_PATTERN;\n\n/**\n * Get calcdata trace(s) associated with a given subplot\n *\n * @param {array} calcData: as in gd.calcdata\n * @param {string} type: subplot type\n * @param {string} subplotId: subplot id to look for\n *\n * @return {array} array of calcdata traces\n */\nexports.getSubplotCalcData = function(calcData, type, subplotId) {\n    var basePlotModule = Registry.subplotsRegistry[type];\n    if(!basePlotModule) return [];\n\n    var attr = basePlotModule.attr;\n    var subplotCalcData = [];\n\n    for(var i = 0; i < calcData.length; i++) {\n        var calcTrace = calcData[i];\n        var trace = calcTrace[0].trace;\n\n        if(trace[attr] === subplotId) subplotCalcData.push(calcTrace);\n    }\n\n    return subplotCalcData;\n};\n/**\n * Get calcdata trace(s) that can be plotted with a given module\n * NOTE: this isn't necessarily just exactly matching trace type,\n * if multiple trace types use the same plotting routine, they will be\n * collected here.\n * In order to not plot the same thing multiple times, we return two arrays,\n * the calcdata we *will* plot with this module, and the ones we *won't*\n *\n * @param {array} calcdata: as in gd.calcdata\n * @param {object|string|fn} arg1:\n *  the plotting module, or its name, or its plot method\n *\n * @return {array[array]} [foundCalcdata, remainingCalcdata]\n */\nexports.getModuleCalcData = function(calcdata, arg1) {\n    var moduleCalcData = [];\n    var remainingCalcData = [];\n\n    var plotMethod;\n    if(typeof arg1 === 'string') {\n        plotMethod = Registry.getModule(arg1).plot;\n    } else if(typeof arg1 === 'function') {\n        plotMethod = arg1;\n    } else {\n        plotMethod = arg1.plot;\n    }\n    if(!plotMethod) {\n        return [moduleCalcData, calcdata];\n    }\n\n    for(var i = 0; i < calcdata.length; i++) {\n        var cd = calcdata[i];\n        var trace = cd[0].trace;\n        // N.B.\n        // - 'legendonly' traces do not make it past here\n        // - skip over 'visible' traces that got trimmed completely during calc transforms\n        if(trace.visible !== true || trace._length === 0) continue;\n\n        // group calcdata trace not by 'module' (as the name of this function\n        // would suggest), but by 'module plot method' so that if some traces\n        // share the same module plot method (e.g. bar and histogram), we\n        // only call it one!\n        if(trace._module.plot === plotMethod) {\n            moduleCalcData.push(cd);\n        } else {\n            remainingCalcData.push(cd);\n        }\n    }\n\n    return [moduleCalcData, remainingCalcData];\n};\n\n/**\n * Get the data trace(s) associated with a given subplot.\n *\n * @param {array} data  plotly full data array.\n * @param {string} type subplot type to look for.\n * @param {string} subplotId subplot id to look for.\n *\n * @return {array} list of trace objects.\n *\n */\nexports.getSubplotData = function getSubplotData(data, type, subplotId) {\n    if(!Registry.subplotsRegistry[type]) return [];\n\n    var attr = Registry.subplotsRegistry[type].attr;\n    var subplotData = [];\n    var trace, subplotX, subplotY;\n\n    if(type === 'gl2d') {\n        var spmatch = subplotId.match(SUBPLOT_PATTERN);\n        subplotX = 'x' + spmatch[1];\n        subplotY = 'y' + spmatch[2];\n    }\n\n    for(var i = 0; i < data.length; i++) {\n        trace = data[i];\n\n        if(type === 'gl2d' && Registry.traceIs(trace, 'gl2d')) {\n            if(trace[attr[0]] === subplotX && trace[attr[1]] === subplotY) {\n                subplotData.push(trace);\n            }\n        } else {\n            if(trace[attr] === subplotId) subplotData.push(trace);\n        }\n    }\n\n    return subplotData;\n};\n\n},{\"../registry\":269,\"./cartesian/constants\":228}],253:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nfunction xformMatrix(m, v) {\n    var out = [0, 0, 0, 0];\n    var i, j;\n\n    for(i = 0; i < 4; ++i) {\n        for(j = 0; j < 4; ++j) {\n            out[j] += m[4 * i + j] * v[i];\n        }\n    }\n\n    return out;\n}\n\nfunction project(camera, v) {\n    var p = xformMatrix(camera.projection,\n        xformMatrix(camera.view,\n        xformMatrix(camera.model, [v[0], v[1], v[2], 1])));\n    return p;\n}\n\nmodule.exports = project;\n\n},{}],254:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('./font_attributes');\nvar animationAttrs = _dereq_('./animation_attributes');\nvar colorAttrs = _dereq_('../components/color/attributes');\nvar drawNewShapeAttrs = _dereq_('../components/shapes/draw_newshape/attributes');\nvar padAttrs = _dereq_('./pad_attributes');\nvar extendFlat = _dereq_('../lib/extend').extendFlat;\n\nvar globalFont = fontAttrs({\n    editType: 'calc',\n    \n});\nglobalFont.family.dflt = '\"Open Sans\", verdana, arial, sans-serif';\nglobalFont.size.dflt = 12;\nglobalFont.color.dflt = colorAttrs.defaultLine;\n\nmodule.exports = {\n    font: globalFont,\n    title: {\n        text: {\n            valType: 'string',\n            \n            editType: 'layoutstyle',\n            \n        },\n        font: fontAttrs({\n            editType: 'layoutstyle',\n            \n        }),\n        xref: {\n            valType: 'enumerated',\n            dflt: 'container',\n            values: ['container', 'paper'],\n            \n            editType: 'layoutstyle',\n            \n        },\n        yref: {\n            valType: 'enumerated',\n            dflt: 'container',\n            values: ['container', 'paper'],\n            \n            editType: 'layoutstyle',\n            \n        },\n        x: {\n            valType: 'number',\n            min: 0,\n            max: 1,\n            dflt: 0.5,\n            \n            editType: 'layoutstyle',\n            \n        },\n        y: {\n            valType: 'number',\n            min: 0,\n            max: 1,\n            dflt: 'auto',\n            \n            editType: 'layoutstyle',\n            \n        },\n        xanchor: {\n            valType: 'enumerated',\n            dflt: 'auto',\n            values: ['auto', 'left', 'center', 'right'],\n            \n            editType: 'layoutstyle',\n            \n        },\n        yanchor: {\n            valType: 'enumerated',\n            dflt: 'auto',\n            values: ['auto', 'top', 'middle', 'bottom'],\n            \n            editType: 'layoutstyle',\n            \n        },\n        pad: extendFlat(padAttrs({editType: 'layoutstyle'}), {\n            \n        }),\n        editType: 'layoutstyle'\n    },\n    uniformtext: {\n        mode: {\n            valType: 'enumerated',\n            values: [false, 'hide', 'show'],\n            dflt: false,\n            \n            editType: 'plot',\n            \n        },\n        minsize: {\n            valType: 'number',\n            min: 0,\n            dflt: 0,\n            \n            editType: 'plot',\n            \n        },\n        editType: 'plot'\n    },\n    autosize: {\n        valType: 'boolean',\n        \n        dflt: false,\n        // autosize, width, and height get special editType treatment in _relayout\n        // so we can handle noop resizes more efficiently\n        editType: 'none',\n        \n    },\n    width: {\n        valType: 'number',\n        \n        min: 10,\n        dflt: 700,\n        editType: 'plot',\n        \n    },\n    height: {\n        valType: 'number',\n        \n        min: 10,\n        dflt: 450,\n        editType: 'plot',\n        \n    },\n    margin: {\n        l: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 80,\n            editType: 'plot',\n            \n        },\n        r: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 80,\n            editType: 'plot',\n            \n        },\n        t: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 100,\n            editType: 'plot',\n            \n        },\n        b: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 80,\n            editType: 'plot',\n            \n        },\n        pad: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 0,\n            editType: 'plot',\n            \n        },\n        autoexpand: {\n            valType: 'boolean',\n            \n            dflt: true,\n            editType: 'plot',\n            \n        },\n        editType: 'plot'\n    },\n    paper_bgcolor: {\n        valType: 'color',\n        \n        dflt: colorAttrs.background,\n        editType: 'plot',\n        \n    },\n    plot_bgcolor: {\n        // defined here, but set in cartesian.supplyLayoutDefaults\n        // because it needs to know if there are (2D) axes or not\n        valType: 'color',\n        \n        dflt: colorAttrs.background,\n        editType: 'layoutstyle',\n        \n    },\n    separators: {\n        valType: 'string',\n        \n        editType: 'plot',\n        \n    },\n    hidesources: {\n        valType: 'boolean',\n        \n        dflt: false,\n        editType: 'plot',\n        \n    },\n    showlegend: {\n        // handled in legend.supplyLayoutDefaults\n        // but included here because it's not in the legend object\n        valType: 'boolean',\n        \n        editType: 'legend',\n        \n    },\n    colorway: {\n        valType: 'colorlist',\n        dflt: colorAttrs.defaults,\n        \n        editType: 'calc',\n        \n    },\n    datarevision: {\n        valType: 'any',\n        \n        editType: 'calc',\n        \n    },\n    uirevision: {\n        valType: 'any',\n        \n        editType: 'none',\n        \n    },\n    editrevision: {\n        valType: 'any',\n        \n        editType: 'none',\n        \n    },\n    selectionrevision: {\n        valType: 'any',\n        \n        editType: 'none',\n        \n    },\n    template: {\n        valType: 'any',\n        \n        editType: 'calc',\n        \n    },\n    modebar: {\n        orientation: {\n            valType: 'enumerated',\n            values: ['v', 'h'],\n            dflt: 'h',\n            \n            editType: 'modebar',\n            \n        },\n        bgcolor: {\n            valType: 'color',\n            \n            editType: 'modebar',\n            \n        },\n        color: {\n            valType: 'color',\n            \n            editType: 'modebar',\n            \n        },\n        activecolor: {\n            valType: 'color',\n            \n            editType: 'modebar',\n            \n        },\n        uirevision: {\n            valType: 'any',\n            \n            editType: 'none',\n            \n        },\n        editType: 'modebar'\n    },\n\n    newshape: drawNewShapeAttrs.newshape,\n    activeshape: drawNewShapeAttrs.activeshape,\n\n    meta: {\n        valType: 'any',\n        arrayOk: true,\n        \n        editType: 'plot',\n        \n    },\n\n    transition: extendFlat({}, animationAttrs.transition, {\n        \n        editType: 'none'\n    }),\n    _deprecated: {\n        title: {\n            valType: 'string',\n            \n            editType: 'layoutstyle',\n            \n        },\n        titlefont: fontAttrs({\n            editType: 'layoutstyle',\n            \n        })\n    }\n};\n\n},{\"../components/color/attributes\":51,\"../components/shapes/draw_newshape/attributes\":134,\"../lib/extend\":173,\"./animation_attributes\":217,\"./font_attributes\":250,\"./pad_attributes\":255}],255:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Creates a set of padding attributes.\n *\n * @param {object} opts\n *   @param {string} editType:\n *     the editType for all pieces of this padding definition\n *\n * @return {object} attributes object containing {t, r, b, l} as specified\n */\nmodule.exports = function(opts) {\n    var editType = opts.editType;\n    return {\n        t: {\n            valType: 'number',\n            dflt: 0,\n            \n            editType: editType,\n            \n        },\n        r: {\n            valType: 'number',\n            dflt: 0,\n            \n            editType: editType,\n            \n        },\n        b: {\n            valType: 'number',\n            dflt: 0,\n            \n            editType: editType,\n            \n        },\n        l: {\n            valType: 'number',\n            dflt: 0,\n            \n            editType: editType,\n            \n        },\n        editType: editType\n    };\n};\n\n},{}],256:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Registry = _dereq_('../registry');\nvar PlotSchema = _dereq_('../plot_api/plot_schema');\nvar Template = _dereq_('../plot_api/plot_template');\nvar Lib = _dereq_('../lib');\nvar Color = _dereq_('../components/color');\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\nvar axisIDs = _dereq_('./cartesian/axis_ids');\nvar clearSelect = _dereq_('./cartesian/handle_outline').clearSelect;\n\nvar animationAttrs = _dereq_('./animation_attributes');\nvar frameAttrs = _dereq_('./frame_attributes');\n\nvar getModuleCalcData = _dereq_('../plots/get_data').getModuleCalcData;\n\nvar relinkPrivateKeys = Lib.relinkPrivateKeys;\nvar _ = Lib._;\n\nvar plots = module.exports = {};\n\n// Expose registry methods on Plots for backward-compatibility\nLib.extendFlat(plots, Registry);\n\nplots.attributes = _dereq_('./attributes');\nplots.attributes.type.values = plots.allTypes;\nplots.fontAttrs = _dereq_('./font_attributes');\nplots.layoutAttributes = _dereq_('./layout_attributes');\n\n// TODO make this a plot attribute?\nplots.fontWeight = 'normal';\n\nvar transformsRegistry = plots.transformsRegistry;\n\nvar commandModule = _dereq_('./command');\nplots.executeAPICommand = commandModule.executeAPICommand;\nplots.computeAPICommandBindings = commandModule.computeAPICommandBindings;\nplots.manageCommandObserver = commandModule.manageCommandObserver;\nplots.hasSimpleAPICommandBindings = commandModule.hasSimpleAPICommandBindings;\n\n// in some cases the browser doesn't seem to know how big\n// the text is at first, so it needs to draw it,\n// then wait a little, then draw it again\nplots.redrawText = function(gd) {\n    gd = Lib.getGraphDiv(gd);\n\n    var fullLayout = gd._fullLayout || {};\n    var hasPolar = fullLayout._has && fullLayout._has('polar');\n    var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;\n\n    // do not work if polar is present\n    if(hasLegacyPolar) return;\n\n    return new Promise(function(resolve) {\n        setTimeout(function() {\n            Registry.getComponentMethod('annotations', 'draw')(gd);\n            Registry.getComponentMethod('legend', 'draw')(gd);\n            Registry.getComponentMethod('colorbar', 'draw')(gd);\n            resolve(plots.previousPromises(gd));\n        }, 300);\n    });\n};\n\n// resize plot about the container size\nplots.resize = function(gd) {\n    gd = Lib.getGraphDiv(gd);\n\n    var resolveLastResize;\n    var p = new Promise(function(resolve, reject) {\n        if(!gd || Lib.isHidden(gd)) {\n            reject(new Error('Resize must be passed a displayed plot div element.'));\n        }\n\n        if(gd._redrawTimer) clearTimeout(gd._redrawTimer);\n        if(gd._resolveResize) resolveLastResize = gd._resolveResize;\n        gd._resolveResize = resolve;\n\n        gd._redrawTimer = setTimeout(function() {\n            // return if there is nothing to resize or is hidden\n            if(!gd.layout || (gd.layout.width && gd.layout.height) || Lib.isHidden(gd)) {\n                resolve(gd);\n                return;\n            }\n\n            delete gd.layout.width;\n            delete gd.layout.height;\n\n            // autosizing doesn't count as a change that needs saving\n            var oldchanged = gd.changed;\n\n            // nor should it be included in the undo queue\n            gd.autoplay = true;\n\n            Registry.call('relayout', gd, {autosize: true}).then(function() {\n                gd.changed = oldchanged;\n                // Only resolve if a new call hasn't been made!\n                if(gd._resolveResize === resolve) {\n                    delete gd._resolveResize;\n                    resolve(gd);\n                }\n            });\n        }, 100);\n    });\n\n    if(resolveLastResize) resolveLastResize(p);\n    return p;\n};\n\n\n// for use in Lib.syncOrAsync, check if there are any\n// pending promises in this plot and wait for them\nplots.previousPromises = function(gd) {\n    if((gd._promises || []).length) {\n        return Promise.all(gd._promises)\n            .then(function() { gd._promises = []; });\n    }\n};\n\n/**\n * Adds the 'Edit chart' link.\n * Note that now Plotly.plot() calls this so it can regenerate whenever it replots\n *\n * Add source links to your graph inside the 'showSources' config argument.\n */\nplots.addLinks = function(gd) {\n    // Do not do anything if showLink and showSources are not set to true in config\n    if(!gd._context.showLink && !gd._context.showSources) return;\n\n    var fullLayout = gd._fullLayout;\n\n    var linkContainer = Lib.ensureSingle(fullLayout._paper, 'text', 'js-plot-link-container', function(s) {\n        s.style({\n            'font-family': '\"Open Sans\", Arial, sans-serif',\n            'font-size': '12px',\n            'fill': Color.defaultLine,\n            'pointer-events': 'all'\n        })\n        .each(function() {\n            var links = d3.select(this);\n            links.append('tspan').classed('js-link-to-tool', true);\n            links.append('tspan').classed('js-link-spacer', true);\n            links.append('tspan').classed('js-sourcelinks', true);\n        });\n    });\n\n    // The text node inside svg\n    var text = linkContainer.node();\n    var attrs = {y: fullLayout._paper.attr('height') - 9};\n\n    // If text's width is bigger than the layout\n    // Check that text is a child node or document.body\n    // because otherwise IE/Edge might throw an exception\n    // when calling getComputedTextLength().\n    // Apparently offsetParent is null for invisibles.\n    if(document.body.contains(text) && text.getComputedTextLength() >= (fullLayout.width - 20)) {\n        // Align the text at the left\n        attrs['text-anchor'] = 'start';\n        attrs.x = 5;\n    } else {\n        // Align the text at the right\n        attrs['text-anchor'] = 'end';\n        attrs.x = fullLayout._paper.attr('width') - 7;\n    }\n\n    linkContainer.attr(attrs);\n\n    var toolspan = linkContainer.select('.js-link-to-tool');\n    var spacespan = linkContainer.select('.js-link-spacer');\n    var sourcespan = linkContainer.select('.js-sourcelinks');\n\n    if(gd._context.showSources) gd._context.showSources(gd);\n\n    // 'view in plotly' link for embedded plots\n    if(gd._context.showLink) positionPlayWithData(gd, toolspan);\n\n    // separator if we have both sources and tool link\n    spacespan.text((toolspan.text() && sourcespan.text()) ? ' - ' : '');\n};\n\n// note that now this function is only adding the brand in\n// iframes and 3rd-party apps\nfunction positionPlayWithData(gd, container) {\n    container.text('');\n    var link = container.append('a')\n        .attr({\n            'xlink:xlink:href': '#',\n            'class': 'link--impt link--embedview',\n            'font-weight': 'bold'\n        })\n        .text(gd._context.linkText + ' ' + String.fromCharCode(187));\n\n    if(gd._context.sendData) {\n        link.on('click', function() {\n            plots.sendDataToCloud(gd);\n        });\n    } else {\n        var path = window.location.pathname.split('/');\n        var query = window.location.search;\n        link.attr({\n            'xlink:xlink:show': 'new',\n            'xlink:xlink:href': '/' + path[2].split('.')[0] + '/' + path[1] + query\n        });\n    }\n}\n\nplots.sendDataToCloud = function(gd) {\n    var baseUrl = (window.PLOTLYENV || {}).BASE_URL || gd._context.plotlyServerURL;\n    if(!baseUrl) return;\n\n    gd.emit('plotly_beforeexport');\n\n    var hiddenformDiv = d3.select(gd)\n        .append('div')\n        .attr('id', 'hiddenform')\n        .style('display', 'none');\n\n    var hiddenform = hiddenformDiv\n        .append('form')\n        .attr({\n            action: baseUrl + '/external',\n            method: 'post',\n            target: '_blank'\n        });\n\n    var hiddenformInput = hiddenform\n        .append('input')\n        .attr({\n            type: 'text',\n            name: 'data'\n        });\n\n    hiddenformInput.node().value = plots.graphJson(gd, false, 'keepdata');\n    hiddenform.node().submit();\n    hiddenformDiv.remove();\n\n    gd.emit('plotly_afterexport');\n    return false;\n};\n\nvar d3FormatKeys = [\n    'days', 'shortDays', 'months', 'shortMonths', 'periods',\n    'dateTime', 'date', 'time',\n    'decimal', 'thousands', 'grouping', 'currency'\n];\n\nvar extraFormatKeys = [\n    'year', 'month', 'dayMonth', 'dayMonthYear'\n];\n\n/*\n * Fill in default values\n * @param {DOM element} gd\n * @param {object} opts\n * @param {boolean} opts.skipUpdateCalc: normally if the existing gd.calcdata looks\n *   compatible with the new gd._fullData we finish by linking the new _fullData traces\n *   to the old gd.calcdata, so it's correctly set if we're not going to recalc. But also,\n *   if there are calcTransforms on the trace, we first remap data arrays from the old full\n *   trace into the new one. Use skipUpdateCalc to defer this (needed by Plotly.react)\n *\n * gd.data, gd.layout:\n *   are precisely what the user specified (except as modified by cleanData/cleanLayout),\n *   these fields shouldn't be modified (except for filling in some auto values)\n *   nor used directly after the supply defaults step.\n *\n * gd._fullData, gd._fullLayout:\n *   are complete descriptions of how to draw the plot,\n *   use these fields in all required computations.\n *\n * gd._fullLayout._modules\n *   is a list of all the trace modules required to draw the plot.\n *\n * gd._fullLayout._visibleModules\n *   subset of _modules, a list of modules corresponding to visible:true traces.\n *\n * gd._fullLayout._basePlotModules\n *   is a list of all the plot modules required to draw the plot.\n *\n * gd._fullLayout._transformModules\n *   is a list of all the transform modules invoked.\n *\n */\nplots.supplyDefaults = function(gd, opts) {\n    var skipUpdateCalc = opts && opts.skipUpdateCalc;\n    var oldFullLayout = gd._fullLayout || {};\n\n    if(oldFullLayout._skipDefaults) {\n        delete oldFullLayout._skipDefaults;\n        return;\n    }\n\n    var newFullLayout = gd._fullLayout = {};\n    var newLayout = gd.layout || {};\n\n    var oldFullData = gd._fullData || [];\n    var newFullData = gd._fullData = [];\n    var newData = gd.data || [];\n\n    var oldCalcdata = gd.calcdata || [];\n\n    var context = gd._context || {};\n\n    var i;\n\n    // Create all the storage space for frames, but only if doesn't already exist\n    if(!gd._transitionData) plots.createTransitionData(gd);\n\n    // So we only need to do this once (and since we have gd here)\n    // get the translated placeholder titles.\n    // These ones get used as default values so need to be known at supplyDefaults\n    // others keep their blank defaults but render the placeholder as desired later\n    // TODO: make these work the same way, only inserting the placeholder text at draw time?\n    // The challenge is that this has slightly different behavior right now in editable mode:\n    // using the placeholder as default makes this text permanently (but lightly) visible,\n    // but explicit '' for these titles gives you a placeholder that's hidden until you mouse\n    // over it - so you're not distracted by it if you really don't want a title, but if you do\n    // and you're new to plotly you may not be able to find it.\n    // When editable=false the two behave the same, no title is drawn.\n    newFullLayout._dfltTitle = {\n        plot: _(gd, 'Click to enter Plot title'),\n        x: _(gd, 'Click to enter X axis title'),\n        y: _(gd, 'Click to enter Y axis title'),\n        colorbar: _(gd, 'Click to enter Colorscale title'),\n        annotation: _(gd, 'new text')\n    };\n    newFullLayout._traceWord = _(gd, 'trace');\n\n    var formatObj = getFormatObj(gd, d3FormatKeys);\n\n    // stash the token from context so mapbox subplots can use it as default\n    newFullLayout._mapboxAccessToken = context.mapboxAccessToken;\n\n    // first fill in what we can of layout without looking at data\n    // because fullData needs a few things from layout\n    if(oldFullLayout._initialAutoSizeIsDone) {\n        // coerce the updated layout while preserving width and height\n        var oldWidth = oldFullLayout.width;\n        var oldHeight = oldFullLayout.height;\n\n        plots.supplyLayoutGlobalDefaults(newLayout, newFullLayout, formatObj);\n\n        if(!newLayout.width) newFullLayout.width = oldWidth;\n        if(!newLayout.height) newFullLayout.height = oldHeight;\n        plots.sanitizeMargins(newFullLayout);\n    } else {\n        // coerce the updated layout and autosize if needed\n        plots.supplyLayoutGlobalDefaults(newLayout, newFullLayout, formatObj);\n\n        var missingWidthOrHeight = (!newLayout.width || !newLayout.height);\n        var autosize = newFullLayout.autosize;\n        var autosizable = context.autosizable;\n        var initialAutoSize = missingWidthOrHeight && (autosize || autosizable);\n\n        if(initialAutoSize) plots.plotAutoSize(gd, newLayout, newFullLayout);\n        else if(missingWidthOrHeight) plots.sanitizeMargins(newFullLayout);\n\n        // for backwards-compatibility with Plotly v1.x.x\n        if(!autosize && missingWidthOrHeight) {\n            newLayout.width = newFullLayout.width;\n            newLayout.height = newFullLayout.height;\n        }\n    }\n\n    newFullLayout._d3locale = getFormatter(formatObj, newFullLayout.separators);\n    newFullLayout._extraFormat = getFormatObj(gd, extraFormatKeys);\n\n    newFullLayout._initialAutoSizeIsDone = true;\n\n    // keep track of how many traces are inputted\n    newFullLayout._dataLength = newData.length;\n\n    // clear the lists of trace and baseplot modules, and subplots\n    newFullLayout._modules = [];\n    newFullLayout._visibleModules = [];\n    newFullLayout._basePlotModules = [];\n    var subplots = newFullLayout._subplots = emptySubplotLists();\n\n    // initialize axis and subplot hash objects for splom-generated grids\n    var splomAxes = newFullLayout._splomAxes = {x: {}, y: {}};\n    var splomSubplots = newFullLayout._splomSubplots = {};\n    // initialize splom grid defaults\n    newFullLayout._splomGridDflt = {};\n\n    // for stacked area traces to share config across traces\n    newFullLayout._scatterStackOpts = {};\n    // for the first scatter trace on each subplot (so it knows tonext->tozero)\n    newFullLayout._firstScatter = {};\n    // for grouped bar/box/violin trace to share config across traces\n    newFullLayout._alignmentOpts = {};\n    // track color axes referenced in the data\n    newFullLayout._colorAxes = {};\n\n    // for traces to request a default rangeslider on their x axes\n    // eg set `_requestRangeslider.x2 = true` for xaxis2\n    newFullLayout._requestRangeslider = {};\n\n    // pull uids from old data to use as new defaults\n    newFullLayout._traceUids = getTraceUids(oldFullData, newData);\n\n    // then do the data\n    newFullLayout._globalTransforms = (gd._context || {}).globalTransforms;\n    plots.supplyDataDefaults(newData, newFullData, newLayout, newFullLayout);\n\n    // redo grid size defaults with info about splom x/y axes,\n    // and fill in generated cartesian axes and subplots\n    var splomXa = Object.keys(splomAxes.x);\n    var splomYa = Object.keys(splomAxes.y);\n    if(splomXa.length > 1 && splomYa.length > 1) {\n        Registry.getComponentMethod('grid', 'sizeDefaults')(newLayout, newFullLayout);\n\n        for(i = 0; i < splomXa.length; i++) {\n            Lib.pushUnique(subplots.xaxis, splomXa[i]);\n        }\n        for(i = 0; i < splomYa.length; i++) {\n            Lib.pushUnique(subplots.yaxis, splomYa[i]);\n        }\n        for(var k in splomSubplots) {\n            Lib.pushUnique(subplots.cartesian, k);\n        }\n    }\n\n    // attach helper method to check whether a plot type is present on graph\n    newFullLayout._has = plots._hasPlotType.bind(newFullLayout);\n\n    if(oldFullData.length === newFullData.length) {\n        for(i = 0; i < newFullData.length; i++) {\n            relinkPrivateKeys(newFullData[i], oldFullData[i]);\n        }\n    }\n\n    // finally, fill in the pieces of layout that may need to look at data\n    plots.supplyLayoutModuleDefaults(newLayout, newFullLayout, newFullData, gd._transitionData);\n\n    // Special cases that introduce interactions between traces.\n    // This is after relinkPrivateKeys so we can use those in crossTraceDefaults\n    // and after layout module defaults, so we can use eg barmode\n    var _modules = newFullLayout._visibleModules;\n    var crossTraceDefaultsFuncs = [];\n    for(i = 0; i < _modules.length; i++) {\n        var funci = _modules[i].crossTraceDefaults;\n        // some trace types share crossTraceDefaults (ie histogram2d, histogram2dcontour)\n        if(funci) Lib.pushUnique(crossTraceDefaultsFuncs, funci);\n    }\n    for(i = 0; i < crossTraceDefaultsFuncs.length; i++) {\n        crossTraceDefaultsFuncs[i](newFullData, newFullLayout);\n    }\n\n    // turn on flag to optimize large splom-only graphs\n    // mostly by omitting SVG layers during Cartesian.drawFramework\n    newFullLayout._hasOnlyLargeSploms = (\n        newFullLayout._basePlotModules.length === 1 &&\n        newFullLayout._basePlotModules[0].name === 'splom' &&\n        splomXa.length > 15 &&\n        splomYa.length > 15 &&\n        newFullLayout.shapes.length === 0 &&\n        newFullLayout.images.length === 0\n    );\n\n    // TODO remove in v2.0.0\n    // add has-plot-type refs to fullLayout for backward compatibility\n    newFullLayout._hasCartesian = newFullLayout._has('cartesian');\n    newFullLayout._hasGeo = newFullLayout._has('geo');\n    newFullLayout._hasGL3D = newFullLayout._has('gl3d');\n    newFullLayout._hasGL2D = newFullLayout._has('gl2d');\n    newFullLayout._hasTernary = newFullLayout._has('ternary');\n    newFullLayout._hasPie = newFullLayout._has('pie');\n\n    // relink / initialize subplot axis objects\n    plots.linkSubplots(newFullData, newFullLayout, oldFullData, oldFullLayout);\n\n    // clean subplots and other artifacts from previous plot calls\n    plots.cleanPlot(newFullData, newFullLayout, oldFullData, oldFullLayout);\n\n    var hadGL2D = !!(oldFullLayout._has && oldFullLayout._has('gl2d'));\n    var hasGL2D = !!(newFullLayout._has && newFullLayout._has('gl2d'));\n    var hadCartesian = !!(oldFullLayout._has && oldFullLayout._has('cartesian'));\n    var hasCartesian = !!(newFullLayout._has && newFullLayout._has('cartesian'));\n    var hadBgLayer = hadCartesian || hadGL2D;\n    var hasBgLayer = hasCartesian || hasGL2D;\n    if(hadBgLayer && !hasBgLayer) {\n        // remove bgLayer\n        oldFullLayout._bgLayer.remove();\n    } else if(hasBgLayer && !hadBgLayer) {\n        // create bgLayer\n        newFullLayout._shouldCreateBgLayer = true;\n    }\n\n    // clear selection outline until we implement persistent selection,\n    // don't clear them though when drag handlers (e.g. listening to\n    // `plotly_selecting`) update the graph.\n    // we should try to come up with a better solution when implementing\n    // https://github.com/plotly/plotly.js/issues/1851\n    if(oldFullLayout._zoomlayer && !gd._dragging) {\n        clearSelect({ // mock old gd\n            _fullLayout: oldFullLayout\n        });\n    }\n\n\n    // fill in meta helpers\n    fillMetaTextHelpers(newFullData, newFullLayout);\n\n    // relink functions and _ attributes to promote consistency between plots\n    relinkPrivateKeys(newFullLayout, oldFullLayout);\n\n    // colorscale crossTraceDefaults needs newFullLayout with relinked keys\n    Registry.getComponentMethod('colorscale', 'crossTraceDefaults')(newFullData, newFullLayout);\n\n    // For persisting GUI-driven changes in layout\n    // _preGUI and _tracePreGUI were already copied over in relinkPrivateKeys\n    if(!newFullLayout._preGUI) newFullLayout._preGUI = {};\n    // track trace GUI changes by uid rather than by trace index\n    if(!newFullLayout._tracePreGUI) newFullLayout._tracePreGUI = {};\n    var tracePreGUI = newFullLayout._tracePreGUI;\n    var uids = {};\n    var uid;\n    for(uid in tracePreGUI) uids[uid] = 'old';\n    for(i = 0; i < newFullData.length; i++) {\n        uid = newFullData[i]._fullInput.uid;\n        if(!uids[uid]) tracePreGUI[uid] = {};\n        uids[uid] = 'new';\n    }\n    for(uid in uids) {\n        if(uids[uid] === 'old') delete tracePreGUI[uid];\n    }\n\n    // set up containers for margin calculations\n    initMargins(newFullLayout);\n\n    // collect and do some initial calculations for rangesliders\n    Registry.getComponentMethod('rangeslider', 'makeData')(newFullLayout);\n\n    // update object references in calcdata\n    if(!skipUpdateCalc && oldCalcdata.length === newFullData.length) {\n        plots.supplyDefaultsUpdateCalc(oldCalcdata, newFullData);\n    }\n};\n\nplots.supplyDefaultsUpdateCalc = function(oldCalcdata, newFullData) {\n    for(var i = 0; i < newFullData.length; i++) {\n        var newTrace = newFullData[i];\n        var cd0 = (oldCalcdata[i] || [])[0];\n        if(cd0 && cd0.trace) {\n            var oldTrace = cd0.trace;\n            if(oldTrace._hasCalcTransform) {\n                var arrayAttrs = oldTrace._arrayAttrs;\n                var j, astr, oldArrayVal;\n\n                for(j = 0; j < arrayAttrs.length; j++) {\n                    astr = arrayAttrs[j];\n                    oldArrayVal = Lib.nestedProperty(oldTrace, astr).get().slice();\n                    Lib.nestedProperty(newTrace, astr).set(oldArrayVal);\n                }\n            }\n            cd0.trace = newTrace;\n        }\n    }\n};\n\n/**\n * Create a list of uid strings satisfying (in this order of importance):\n * 1. all unique, all strings\n * 2. matches input uids if provided\n * 3. matches previous data uids\n */\nfunction getTraceUids(oldFullData, newData) {\n    var len = newData.length;\n    var oldFullInput = [];\n    var i, prevFullInput;\n    for(i = 0; i < oldFullData.length; i++) {\n        var thisFullInput = oldFullData[i]._fullInput;\n        if(thisFullInput !== prevFullInput) oldFullInput.push(thisFullInput);\n        prevFullInput = thisFullInput;\n    }\n    var oldLen = oldFullInput.length;\n    var out = new Array(len);\n    var seenUids = {};\n\n    function setUid(uid, i) {\n        out[i] = uid;\n        seenUids[uid] = 1;\n    }\n\n    function tryUid(uid, i) {\n        if(uid && typeof uid === 'string' && !seenUids[uid]) {\n            setUid(uid, i);\n            return true;\n        }\n    }\n\n    for(i = 0; i < len; i++) {\n        var newUid = newData[i].uid;\n        if(typeof newUid === 'number') newUid = String(newUid);\n\n        if(tryUid(newUid, i)) continue;\n        if(i < oldLen && tryUid(oldFullInput[i].uid, i)) continue;\n        setUid(Lib.randstr(seenUids), i);\n    }\n\n    return out;\n}\n\n/**\n * Make a container for collecting subplots we need to display.\n *\n * Finds all subplot types we need to enumerate once and caches it,\n * but makes a new output object each time.\n * Single-trace subplots (which have no `id`) such as pie, table, etc\n * do not need to be collected because we just draw all visible traces.\n */\nfunction emptySubplotLists() {\n    var collectableSubplotTypes = Registry.collectableSubplotTypes;\n    var out = {};\n    var i, j;\n\n    if(!collectableSubplotTypes) {\n        collectableSubplotTypes = [];\n\n        var subplotsRegistry = Registry.subplotsRegistry;\n\n        for(var subplotType in subplotsRegistry) {\n            var subplotModule = subplotsRegistry[subplotType];\n            var subplotAttr = subplotModule.attr;\n\n            if(subplotAttr) {\n                collectableSubplotTypes.push(subplotType);\n\n                // special case, currently just for cartesian:\n                // we need to enumerate axes, not just subplots\n                if(Array.isArray(subplotAttr)) {\n                    for(j = 0; j < subplotAttr.length; j++) {\n                        Lib.pushUnique(collectableSubplotTypes, subplotAttr[j]);\n                    }\n                }\n            }\n        }\n    }\n\n    for(i = 0; i < collectableSubplotTypes.length; i++) {\n        out[collectableSubplotTypes[i]] = [];\n    }\n    return out;\n}\n\n/**\n * getFormatObj: use _context to get the format object from locale.\n * Used to get d3.locale argument object and extraFormat argument object\n *\n * Regarding d3.locale argument :\n * decimal and thousands can be overridden later by layout.separators\n * grouping and currency are not presently used by our automatic number\n * formatting system but can be used by custom formats.\n *\n * @returns {object} d3.locale format object\n */\nfunction getFormatObj(gd, formatKeys) {\n    var locale = gd._context.locale;\n    if(!locale) locale === 'en-US';\n\n    var formatDone = false;\n    var formatObj = {};\n\n    function includeFormat(newFormat) {\n        var formatFinished = true;\n        for(var i = 0; i < formatKeys.length; i++) {\n            var formatKey = formatKeys[i];\n            if(!formatObj[formatKey]) {\n                if(newFormat[formatKey]) {\n                    formatObj[formatKey] = newFormat[formatKey];\n                } else formatFinished = false;\n            }\n        }\n        if(formatFinished) formatDone = true;\n    }\n\n    // same as localize, look for format parts in each format spec in the chain\n    for(var i = 0; i < 2; i++) {\n        var locales = gd._context.locales;\n        for(var j = 0; j < 2; j++) {\n            var formatj = (locales[locale] || {}).format;\n            if(formatj) {\n                includeFormat(formatj);\n                if(formatDone) break;\n            }\n            locales = Registry.localeRegistry;\n        }\n\n        var baseLocale = locale.split('-')[0];\n        if(formatDone || baseLocale === locale) break;\n        locale = baseLocale;\n    }\n\n    // lastly pick out defaults from english (non-US, as DMY is so much more common)\n    if(!formatDone) includeFormat(Registry.localeRegistry.en.format);\n\n    return formatObj;\n}\n\n/**\n * getFormatter: combine the final separators with the locale formatting object\n * we pulled earlier to generate number and time formatters\n * TODO: remove separators in v2, only use locale, so we don't need this step?\n *\n * @param {object} formatObj: d3.locale format object\n * @param {string} separators: length-2 string to override decimal and thousands\n *   separators in number formatting\n *\n * @returns {object} {numberFormat, timeFormat} d3 formatter factory functions\n *   for numbers and time\n */\nfunction getFormatter(formatObj, separators) {\n    formatObj.decimal = separators.charAt(0);\n    formatObj.thousands = separators.charAt(1);\n\n    return d3.locale(formatObj);\n}\n\nfunction fillMetaTextHelpers(newFullData, newFullLayout) {\n    var _meta;\n    var meta4data = [];\n\n    if(newFullLayout.meta) {\n        _meta = newFullLayout._meta = {\n            meta: newFullLayout.meta,\n            layout: {meta: newFullLayout.meta}\n        };\n    }\n\n    for(var i = 0; i < newFullData.length; i++) {\n        var trace = newFullData[i];\n\n        if(trace.meta) {\n            meta4data[trace.index] = trace._meta = {meta: trace.meta};\n        } else if(newFullLayout.meta) {\n            trace._meta = {meta: newFullLayout.meta};\n        }\n        if(newFullLayout.meta) {\n            trace._meta.layout = {meta: newFullLayout.meta};\n        }\n    }\n\n    if(meta4data.length) {\n        if(!_meta) {\n            _meta = newFullLayout._meta = {};\n        }\n        _meta.data = meta4data;\n    }\n}\n\n// Create storage for all of the data related to frames and transitions:\nplots.createTransitionData = function(gd) {\n    // Set up the default keyframe if it doesn't exist:\n    if(!gd._transitionData) {\n        gd._transitionData = {};\n    }\n\n    if(!gd._transitionData._frames) {\n        gd._transitionData._frames = [];\n    }\n\n    if(!gd._transitionData._frameHash) {\n        gd._transitionData._frameHash = {};\n    }\n\n    if(!gd._transitionData._counter) {\n        gd._transitionData._counter = 0;\n    }\n\n    if(!gd._transitionData._interruptCallbacks) {\n        gd._transitionData._interruptCallbacks = [];\n    }\n};\n\n// helper function to be bound to fullLayout to check\n// whether a certain plot type is present on plot\n// or trace has a category\nplots._hasPlotType = function(category) {\n    var i;\n\n    // check base plot modules\n    var basePlotModules = this._basePlotModules || [];\n    for(i = 0; i < basePlotModules.length; i++) {\n        if(basePlotModules[i].name === category) return true;\n    }\n\n    // check trace modules (including non-visible:true)\n    var modules = this._modules || [];\n    for(i = 0; i < modules.length; i++) {\n        var name = modules[i].name;\n        if(name === category) return true;\n        // N.B. this is modules[i] along with 'categories' as a hash object\n        var _module = Registry.modules[name];\n        if(_module && _module.categories[category]) return true;\n    }\n\n    return false;\n};\n\nplots.cleanPlot = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n    var i, j;\n\n    var basePlotModules = oldFullLayout._basePlotModules || [];\n    for(i = 0; i < basePlotModules.length; i++) {\n        var _module = basePlotModules[i];\n\n        if(_module.clean) {\n            _module.clean(newFullData, newFullLayout, oldFullData, oldFullLayout);\n        }\n    }\n\n    var hadGl = oldFullLayout._has && oldFullLayout._has('gl');\n    var hasGl = newFullLayout._has && newFullLayout._has('gl');\n\n    if(hadGl && !hasGl) {\n        if(oldFullLayout._glcontainer !== undefined) {\n            oldFullLayout._glcontainer.selectAll('.gl-canvas').remove();\n            oldFullLayout._glcontainer.selectAll('.no-webgl').remove();\n            oldFullLayout._glcanvas = null;\n        }\n    }\n\n    var hasInfoLayer = !!oldFullLayout._infolayer;\n\n    oldLoop:\n    for(i = 0; i < oldFullData.length; i++) {\n        var oldTrace = oldFullData[i];\n        var oldUid = oldTrace.uid;\n\n        for(j = 0; j < newFullData.length; j++) {\n            var newTrace = newFullData[j];\n\n            if(oldUid === newTrace.uid) continue oldLoop;\n        }\n\n        // clean old colorbars\n        if(hasInfoLayer) {\n            oldFullLayout._infolayer.select('.cb' + oldUid).remove();\n        }\n    }\n};\n\nplots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n    var i, j;\n\n    var oldSubplots = oldFullLayout._plots || {};\n    var newSubplots = newFullLayout._plots = {};\n    var newSubplotList = newFullLayout._subplots;\n\n    var mockGd = {\n        _fullData: newFullData,\n        _fullLayout: newFullLayout\n    };\n\n    var ids = newSubplotList.cartesian.concat(newSubplotList.gl2d || []);\n\n    for(i = 0; i < ids.length; i++) {\n        var id = ids[i];\n        var oldSubplot = oldSubplots[id];\n        var xaxis = axisIDs.getFromId(mockGd, id, 'x');\n        var yaxis = axisIDs.getFromId(mockGd, id, 'y');\n        var plotinfo;\n\n        // link or create subplot object\n        if(oldSubplot) {\n            plotinfo = newSubplots[id] = oldSubplot;\n        } else {\n            plotinfo = newSubplots[id] = {};\n            plotinfo.id = id;\n        }\n\n        // add these axis ids to each others' subplot lists\n        xaxis._counterAxes.push(yaxis._id);\n        yaxis._counterAxes.push(xaxis._id);\n        xaxis._subplotsWith.push(id);\n        yaxis._subplotsWith.push(id);\n\n        // update x and y axis layout object refs\n        plotinfo.xaxis = xaxis;\n        plotinfo.yaxis = yaxis;\n\n        // By default, we clip at the subplot level,\n        // but if one trace on a given subplot has *cliponaxis* set to false,\n        // we need to clip at the trace module layer level;\n        // find this out here, once of for all.\n        plotinfo._hasClipOnAxisFalse = false;\n\n        for(j = 0; j < newFullData.length; j++) {\n            var trace = newFullData[j];\n\n            if(\n                trace.xaxis === plotinfo.xaxis._id &&\n                trace.yaxis === plotinfo.yaxis._id &&\n                trace.cliponaxis === false\n            ) {\n                plotinfo._hasClipOnAxisFalse = true;\n                break;\n            }\n        }\n    }\n\n    // while we're at it, link overlaying axes to their main axes and\n    // anchored axes to the axes they're anchored to\n    var axList = axisIDs.list(mockGd, null, true);\n    var ax;\n    for(i = 0; i < axList.length; i++) {\n        ax = axList[i];\n        var mainAx = null;\n\n        if(ax.overlaying) {\n            mainAx = axisIDs.getFromId(mockGd, ax.overlaying);\n\n            // you cannot overlay an axis that's already overlaying another\n            if(mainAx && mainAx.overlaying) {\n                ax.overlaying = false;\n                mainAx = null;\n            }\n        }\n        ax._mainAxis = mainAx || ax;\n\n        /*\n         * For now force overlays to overlay completely... so they\n         * can drag together correctly and share backgrounds.\n         * Later perhaps we make separate axis domain and\n         * tick/line domain or something, so they can still share\n         * the (possibly larger) dragger and background but don't\n         * have to both be drawn over that whole domain\n         */\n        if(mainAx) ax.domain = mainAx.domain.slice();\n\n        ax._anchorAxis = ax.anchor === 'free' ?\n            null :\n            axisIDs.getFromId(mockGd, ax.anchor);\n    }\n\n    // finally, we can find the main subplot for each axis\n    // (on which the ticks & labels are drawn)\n    for(i = 0; i < axList.length; i++) {\n        ax = axList[i];\n        ax._counterAxes.sort(axisIDs.idSort);\n        ax._subplotsWith.sort(Lib.subplotSort);\n        ax._mainSubplot = findMainSubplot(ax, newFullLayout);\n\n        // find \"full\" domain span of counter axes,\n        // this loop can be costly, so only compute it when required\n        if(ax._counterAxes.length && (\n            (ax.spikemode && ax.spikemode.indexOf('across') !== -1) ||\n            (ax.automargin && ax.mirror && ax.anchor !== 'free') ||\n            Registry.getComponentMethod('rangeslider', 'isVisible')(ax)\n        )) {\n            var min = 1;\n            var max = 0;\n            for(j = 0; j < ax._counterAxes.length; j++) {\n                var ax2 = axisIDs.getFromId(mockGd, ax._counterAxes[j]);\n                min = Math.min(min, ax2.domain[0]);\n                max = Math.max(max, ax2.domain[1]);\n            }\n            if(min < max) {\n                ax._counterDomainMin = min;\n                ax._counterDomainMax = max;\n            }\n        }\n    }\n};\n\nfunction findMainSubplot(ax, fullLayout) {\n    var mockGd = {_fullLayout: fullLayout};\n\n    var isX = ax._id.charAt(0) === 'x';\n    var anchorAx = ax._mainAxis._anchorAxis;\n    var mainSubplotID = '';\n    var nextBestMainSubplotID = '';\n    var anchorID = '';\n\n    // First try the main ID with the anchor\n    if(anchorAx) {\n        anchorID = anchorAx._mainAxis._id;\n        mainSubplotID = isX ? (ax._id + anchorID) : (anchorID + ax._id);\n    }\n\n    // Then look for a subplot with the counteraxis overlaying the anchor\n    // If that fails just use the first subplot including this axis\n    if(!mainSubplotID || !fullLayout._plots[mainSubplotID]) {\n        mainSubplotID = '';\n\n        var counterIDs = ax._counterAxes;\n        for(var j = 0; j < counterIDs.length; j++) {\n            var counterPart = counterIDs[j];\n            var id = isX ? (ax._id + counterPart) : (counterPart + ax._id);\n            if(!nextBestMainSubplotID) nextBestMainSubplotID = id;\n            var counterAx = axisIDs.getFromId(mockGd, counterPart);\n            if(anchorID && counterAx.overlaying === anchorID) {\n                mainSubplotID = id;\n                break;\n            }\n        }\n    }\n\n    return mainSubplotID || nextBestMainSubplotID;\n}\n\n// This function clears any trace attributes with valType: color and\n// no set dflt filed in the plot schema. This is needed because groupby (which\n// is the only transform for which this currently applies) supplies parent\n// trace defaults, then expanded trace defaults. The result is that `null`\n// colors are default-supplied and inherited as a color instead of a null.\n// The result is that expanded trace default colors have no effect, with\n// the final result that groups are indistinguishable. This function clears\n// those colors so that individual groupby groups get unique colors.\nplots.clearExpandedTraceDefaultColors = function(trace) {\n    var colorAttrs, path, i;\n\n    // This uses weird closure state in order to satisfy the linter rule\n    // that we can't create functions in a loop.\n    function locateColorAttrs(attr, attrName, attrs, level) {\n        path[level] = attrName;\n        path.length = level + 1;\n        if(attr.valType === 'color' && attr.dflt === undefined) {\n            colorAttrs.push(path.join('.'));\n        }\n    }\n\n    path = [];\n\n    // Get the cached colorAttrs:\n    colorAttrs = trace._module._colorAttrs;\n\n    // Or else compute and cache the colorAttrs on the module:\n    if(!colorAttrs) {\n        trace._module._colorAttrs = colorAttrs = [];\n        PlotSchema.crawl(\n            trace._module.attributes,\n            locateColorAttrs\n        );\n    }\n\n    for(i = 0; i < colorAttrs.length; i++) {\n        var origprop = Lib.nestedProperty(trace, '_input.' + colorAttrs[i]);\n\n        if(!origprop.get()) {\n            Lib.nestedProperty(trace, colorAttrs[i]).set(null);\n        }\n    }\n};\n\n\nplots.supplyDataDefaults = function(dataIn, dataOut, layout, fullLayout) {\n    var modules = fullLayout._modules;\n    var visibleModules = fullLayout._visibleModules;\n    var basePlotModules = fullLayout._basePlotModules;\n    var cnt = 0;\n    var colorCnt = 0;\n\n    var i, fullTrace, trace;\n\n    fullLayout._transformModules = [];\n\n    function pushModule(fullTrace) {\n        dataOut.push(fullTrace);\n\n        var _module = fullTrace._module;\n        if(!_module) return;\n\n        Lib.pushUnique(modules, _module);\n        if(fullTrace.visible === true) Lib.pushUnique(visibleModules, _module);\n        Lib.pushUnique(basePlotModules, fullTrace._module.basePlotModule);\n        cnt++;\n\n        // TODO: do we really want color not to increment for explicitly invisible traces?\n        // This logic is weird, but matches previous behavior: traces that you explicitly\n        // set to visible:false do not increment the color, but traces WE determine to be\n        // empty or invalid (and thus set to visible:false) DO increment color.\n        // I kind of think we should just let all traces increment color, visible or not.\n        // see mock: axes-autotype-empty vs. a test of restyling visible: false that\n        // I can't find right now...\n        if(fullTrace._input.visible !== false) colorCnt++;\n    }\n\n    var carpetIndex = {};\n    var carpetDependents = [];\n    var dataTemplate = (layout.template || {}).data || {};\n    var templater = Template.traceTemplater(dataTemplate);\n\n    for(i = 0; i < dataIn.length; i++) {\n        trace = dataIn[i];\n\n        // reuse uid we may have pulled out of oldFullData\n        // Note: templater supplies trace type\n        fullTrace = templater.newTrace(trace);\n        fullTrace.uid = fullLayout._traceUids[i];\n        plots.supplyTraceDefaults(trace, fullTrace, colorCnt, fullLayout, i);\n\n        fullTrace.index = i;\n        fullTrace._input = trace;\n        fullTrace._expandedIndex = cnt;\n\n        if(fullTrace.transforms && fullTrace.transforms.length) {\n            var sdInvisible = trace.visible !== false && fullTrace.visible === false;\n\n            var expandedTraces = applyTransforms(fullTrace, dataOut, layout, fullLayout);\n\n            for(var j = 0; j < expandedTraces.length; j++) {\n                var expandedTrace = expandedTraces[j];\n\n                // No further templating during transforms.\n                var fullExpandedTrace = {\n                    _template: fullTrace._template,\n                    type: fullTrace.type,\n                    // set uid using parent uid and expanded index\n                    // to promote consistency between update calls\n                    uid: fullTrace.uid + j\n                };\n\n                // If the first supplyDefaults created `visible: false`,\n                // clear it before running supplyDefaults a second time,\n                // because sometimes there are items we still want to coerce\n                // inside trace modules before determining that the trace is\n                // again `visible: false`, for example partial visibilities\n                // in `splom` traces.\n                if(sdInvisible && expandedTrace.visible === false) {\n                    delete expandedTrace.visible;\n                }\n\n                plots.supplyTraceDefaults(expandedTrace, fullExpandedTrace, cnt, fullLayout, i);\n\n                // relink private (i.e. underscore) keys expanded trace to full expanded trace so\n                // that transform supply-default methods can set _ keys for future use.\n                relinkPrivateKeys(fullExpandedTrace, expandedTrace);\n\n                // add info about parent data trace\n                fullExpandedTrace.index = i;\n                fullExpandedTrace._input = trace;\n                fullExpandedTrace._fullInput = fullTrace;\n\n                // add info about the expanded data\n                fullExpandedTrace._expandedIndex = cnt;\n                fullExpandedTrace._expandedInput = expandedTrace;\n\n                pushModule(fullExpandedTrace);\n            }\n        } else {\n            // add identify refs for consistency with transformed traces\n            fullTrace._fullInput = fullTrace;\n            fullTrace._expandedInput = fullTrace;\n\n            pushModule(fullTrace);\n        }\n\n        if(Registry.traceIs(fullTrace, 'carpetAxis')) {\n            carpetIndex[fullTrace.carpet] = fullTrace;\n        }\n\n        if(Registry.traceIs(fullTrace, 'carpetDependent')) {\n            carpetDependents.push(i);\n        }\n    }\n\n    for(i = 0; i < carpetDependents.length; i++) {\n        fullTrace = dataOut[carpetDependents[i]];\n\n        if(!fullTrace.visible) continue;\n\n        var carpetAxis = carpetIndex[fullTrace.carpet];\n        fullTrace._carpet = carpetAxis;\n\n        if(!carpetAxis || !carpetAxis.visible) {\n            fullTrace.visible = false;\n            continue;\n        }\n\n        fullTrace.xaxis = carpetAxis.xaxis;\n        fullTrace.yaxis = carpetAxis.yaxis;\n    }\n};\n\nplots.supplyAnimationDefaults = function(opts) {\n    opts = opts || {};\n    var i;\n    var optsOut = {};\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(opts || {}, optsOut, animationAttrs, attr, dflt);\n    }\n\n    coerce('mode');\n    coerce('direction');\n    coerce('fromcurrent');\n\n    if(Array.isArray(opts.frame)) {\n        optsOut.frame = [];\n        for(i = 0; i < opts.frame.length; i++) {\n            optsOut.frame[i] = plots.supplyAnimationFrameDefaults(opts.frame[i] || {});\n        }\n    } else {\n        optsOut.frame = plots.supplyAnimationFrameDefaults(opts.frame || {});\n    }\n\n    if(Array.isArray(opts.transition)) {\n        optsOut.transition = [];\n        for(i = 0; i < opts.transition.length; i++) {\n            optsOut.transition[i] = plots.supplyAnimationTransitionDefaults(opts.transition[i] || {});\n        }\n    } else {\n        optsOut.transition = plots.supplyAnimationTransitionDefaults(opts.transition || {});\n    }\n\n    return optsOut;\n};\n\nplots.supplyAnimationFrameDefaults = function(opts) {\n    var optsOut = {};\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(opts || {}, optsOut, animationAttrs.frame, attr, dflt);\n    }\n\n    coerce('duration');\n    coerce('redraw');\n\n    return optsOut;\n};\n\nplots.supplyAnimationTransitionDefaults = function(opts) {\n    var optsOut = {};\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(opts || {}, optsOut, animationAttrs.transition, attr, dflt);\n    }\n\n    coerce('duration');\n    coerce('easing');\n\n    return optsOut;\n};\n\nplots.supplyFrameDefaults = function(frameIn) {\n    var frameOut = {};\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(frameIn, frameOut, frameAttrs, attr, dflt);\n    }\n\n    coerce('group');\n    coerce('name');\n    coerce('traces');\n    coerce('baseframe');\n    coerce('data');\n    coerce('layout');\n\n    return frameOut;\n};\n\nplots.supplyTraceDefaults = function(traceIn, traceOut, colorIndex, layout, traceInIndex) {\n    var colorway = layout.colorway || Color.defaults;\n    var defaultColor = colorway[colorIndex % colorway.length];\n\n    var i;\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, plots.attributes, attr, dflt);\n    }\n\n    var visible = coerce('visible');\n\n    coerce('type');\n    coerce('name', layout._traceWord + ' ' + traceInIndex);\n\n    coerce('uirevision', layout.uirevision);\n\n    // we want even invisible traces to make their would-be subplots visible\n    // so coerce the subplot id(s) now no matter what\n    var _module = plots.getModule(traceOut);\n\n    traceOut._module = _module;\n    if(_module) {\n        var basePlotModule = _module.basePlotModule;\n        var subplotAttr = basePlotModule.attr;\n        var subplotAttrs = basePlotModule.attributes;\n        if(subplotAttr && subplotAttrs) {\n            var subplots = layout._subplots;\n            var subplotId = '';\n\n            if(\n                visible ||\n                basePlotModule.name !== 'gl2d' // for now just drop empty gl2d subplots\n                // TODO - currently if we draw an empty gl2d subplot, it draws\n                // nothing then gets stuck and you can't get it back without newPlot\n                // sort this out in the regl refactor?\n            ) {\n                if(Array.isArray(subplotAttr)) {\n                    for(i = 0; i < subplotAttr.length; i++) {\n                        var attri = subplotAttr[i];\n                        var vali = Lib.coerce(traceIn, traceOut, subplotAttrs, attri);\n\n                        if(subplots[attri]) Lib.pushUnique(subplots[attri], vali);\n                        subplotId += vali;\n                    }\n                } else {\n                    subplotId = Lib.coerce(traceIn, traceOut, subplotAttrs, subplotAttr);\n                }\n\n                if(subplots[basePlotModule.name]) {\n                    Lib.pushUnique(subplots[basePlotModule.name], subplotId);\n                }\n            }\n        }\n    }\n\n    if(visible) {\n        coerce('customdata');\n        coerce('ids');\n        coerce('meta');\n\n        if(Registry.traceIs(traceOut, 'showLegend')) {\n            Lib.coerce(traceIn, traceOut,\n                _module.attributes.showlegend ? _module.attributes : plots.attributes,\n                'showlegend'\n            );\n\n            coerce('legendgroup');\n\n            traceOut._dfltShowLegend = true;\n        } else {\n            traceOut._dfltShowLegend = false;\n        }\n\n        if(_module) {\n            _module.supplyDefaults(traceIn, traceOut, defaultColor, layout);\n        }\n\n        if(!Registry.traceIs(traceOut, 'noOpacity')) {\n            coerce('opacity');\n        }\n\n        if(Registry.traceIs(traceOut, 'notLegendIsolatable')) {\n            // This clears out the legendonly state for traces like carpet that\n            // cannot be isolated in the legend\n            traceOut.visible = !!traceOut.visible;\n        }\n\n        if(!Registry.traceIs(traceOut, 'noHover')) {\n            if(!traceOut.hovertemplate) Lib.coerceHoverinfo(traceIn, traceOut, layout);\n\n            // parcats support hover, but not hoverlabel stylings (yet)\n            if(traceOut.type !== 'parcats') {\n                Registry.getComponentMethod('fx', 'supplyDefaults')(traceIn, traceOut, defaultColor, layout);\n            }\n        }\n\n        if(_module && _module.selectPoints) {\n            coerce('selectedpoints');\n        }\n\n        plots.supplyTransformDefaults(traceIn, traceOut, layout);\n    }\n\n    return traceOut;\n};\n\n/**\n * hasMakesDataTransform: does this trace have a transform that makes its own\n * data, either by grabbing it from somewhere else or by creating it from input\n * parameters? If so, we should still keep going with supplyDefaults\n * even if the trace is invisible, which may just be because it has no data yet.\n */\nfunction hasMakesDataTransform(trace) {\n    var transforms = trace.transforms;\n    if(Array.isArray(transforms) && transforms.length) {\n        for(var i = 0; i < transforms.length; i++) {\n            var ti = transforms[i];\n            var _module = ti._module || transformsRegistry[ti.type];\n            if(_module && _module.makesData) return true;\n        }\n    }\n    return false;\n}\n\nplots.hasMakesDataTransform = hasMakesDataTransform;\n\nplots.supplyTransformDefaults = function(traceIn, traceOut, layout) {\n    // For now we only allow transforms on 1D traces, ie those that specify a _length.\n    // If we were to implement 2D transforms, we'd need to have each transform\n    // describe its own applicability and disable itself when it doesn't apply.\n    // Also allow transforms that make their own data, but not in globalTransforms\n    if(!(traceOut._length || hasMakesDataTransform(traceIn))) return;\n\n    var globalTransforms = layout._globalTransforms || [];\n    var transformModules = layout._transformModules || [];\n\n    if(!Array.isArray(traceIn.transforms) && globalTransforms.length === 0) return;\n\n    var containerIn = traceIn.transforms || [];\n    var transformList = globalTransforms.concat(containerIn);\n    var containerOut = traceOut.transforms = [];\n\n    for(var i = 0; i < transformList.length; i++) {\n        var transformIn = transformList[i];\n        var type = transformIn.type;\n        var _module = transformsRegistry[type];\n        var transformOut;\n\n        /*\n         * Supply defaults may run twice. First pass runs all supply defaults steps\n         * and adds the _module to any output transforms.\n         * If transforms exist another pass is run so that any generated traces also\n         * go through supply defaults. This has the effect of rerunning\n         * supplyTransformDefaults. If the transform does not have a `transform`\n         * function it could not have generated any new traces and the second stage\n         * is unnecessary. We detect this case with the following variables.\n         */\n        var isFirstStage = !(transformIn._module && transformIn._module === _module);\n        var doLaterStages = _module && typeof _module.transform === 'function';\n\n        if(!_module) Lib.warn('Unrecognized transform type ' + type + '.');\n\n        if(_module && _module.supplyDefaults && (isFirstStage || doLaterStages)) {\n            transformOut = _module.supplyDefaults(transformIn, traceOut, layout, traceIn);\n            transformOut.type = type;\n            transformOut._module = _module;\n\n            Lib.pushUnique(transformModules, _module);\n        } else {\n            transformOut = Lib.extendFlat({}, transformIn);\n        }\n\n        containerOut.push(transformOut);\n    }\n};\n\nfunction applyTransforms(fullTrace, fullData, layout, fullLayout) {\n    var container = fullTrace.transforms;\n    var dataOut = [fullTrace];\n\n    for(var i = 0; i < container.length; i++) {\n        var transform = container[i];\n        var _module = transformsRegistry[transform.type];\n\n        if(_module && _module.transform) {\n            dataOut = _module.transform(dataOut, {\n                transform: transform,\n                fullTrace: fullTrace,\n                fullData: fullData,\n                layout: layout,\n                fullLayout: fullLayout,\n                transformIndex: i\n            });\n        }\n    }\n\n    return dataOut;\n}\n\nplots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(layoutIn, layoutOut, plots.layoutAttributes, attr, dflt);\n    }\n\n    var template = layoutIn.template;\n    if(Lib.isPlainObject(template)) {\n        layoutOut.template = template;\n        layoutOut._template = template.layout;\n        layoutOut._dataTemplate = template.data;\n    }\n\n    var globalFont = Lib.coerceFont(coerce, 'font');\n\n    coerce('title.text', layoutOut._dfltTitle.plot);\n\n    Lib.coerceFont(coerce, 'title.font', {\n        family: globalFont.family,\n        size: Math.round(globalFont.size * 1.4),\n        color: globalFont.color\n    });\n\n    coerce('title.xref');\n    coerce('title.yref');\n    coerce('title.x');\n    coerce('title.y');\n    coerce('title.xanchor');\n    coerce('title.yanchor');\n    coerce('title.pad.t');\n    coerce('title.pad.r');\n    coerce('title.pad.b');\n    coerce('title.pad.l');\n\n    var uniformtextMode = coerce('uniformtext.mode');\n    if(uniformtextMode) {\n        coerce('uniformtext.minsize');\n    }\n\n    // Make sure that autosize is defaulted to *true*\n    // on layouts with no set width and height for backward compatibly,\n    // in particular https://plotly.com/javascript/responsive-fluid-layout/\n    //\n    // Before https://github.com/plotly/plotly.js/pull/635 ,\n    // layouts with no set width and height were set temporary set to 'initial'\n    // to pass through the autosize routine\n    //\n    // This behavior is subject to change in v2.\n    coerce('autosize', !(layoutIn.width && layoutIn.height));\n\n    coerce('width');\n    coerce('height');\n    coerce('margin.l');\n    coerce('margin.r');\n    coerce('margin.t');\n    coerce('margin.b');\n    coerce('margin.pad');\n    coerce('margin.autoexpand');\n\n    if(layoutIn.width && layoutIn.height) plots.sanitizeMargins(layoutOut);\n\n    Registry.getComponentMethod('grid', 'sizeDefaults')(layoutIn, layoutOut);\n\n    coerce('paper_bgcolor');\n\n    coerce('separators', formatObj.decimal + formatObj.thousands);\n    coerce('hidesources');\n\n    coerce('colorway');\n\n    coerce('datarevision');\n    var uirevision = coerce('uirevision');\n    coerce('editrevision', uirevision);\n    coerce('selectionrevision', uirevision);\n\n    coerce('modebar.orientation');\n    coerce('modebar.bgcolor', Color.addOpacity(layoutOut.paper_bgcolor, 0.5));\n    var modebarDefaultColor = Color.contrast(Color.rgb(layoutOut.modebar.bgcolor));\n    coerce('modebar.color', Color.addOpacity(modebarDefaultColor, 0.3));\n    coerce('modebar.activecolor', Color.addOpacity(modebarDefaultColor, 0.7));\n    coerce('modebar.uirevision', uirevision);\n\n    Registry.getComponentMethod(\n        'shapes',\n        'supplyDrawNewShapeDefaults'\n    )(layoutIn, layoutOut, coerce);\n\n    coerce('meta');\n\n    // do not include defaults in fullLayout when users do not set transition\n    if(Lib.isPlainObject(layoutIn.transition)) {\n        coerce('transition.duration');\n        coerce('transition.easing');\n        coerce('transition.ordering');\n    }\n\n    Registry.getComponentMethod(\n        'calendars',\n        'handleDefaults'\n    )(layoutIn, layoutOut, 'calendar');\n\n    Registry.getComponentMethod(\n        'fx',\n        'supplyLayoutGlobalDefaults'\n    )(layoutIn, layoutOut, coerce);\n};\n\nfunction getComputedSize(attr) {\n    return (\n        (typeof attr === 'string') &&\n        (attr.substr(attr.length - 2) === 'px') &&\n        parseFloat(attr)\n    );\n}\n\n\nplots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) {\n    var context = gd._context || {};\n    var frameMargins = context.frameMargins;\n    var newWidth;\n    var newHeight;\n\n    var isPlotDiv = Lib.isPlotDiv(gd);\n\n    if(isPlotDiv) gd.emit('plotly_autosize');\n\n    // embedded in an iframe - just take the full iframe size\n    // if we get to this point, with no aspect ratio restrictions\n    if(context.fillFrame) {\n        newWidth = window.innerWidth;\n        newHeight = window.innerHeight;\n\n        // somehow we get a few extra px height sometimes...\n        // just hide it\n        document.body.style.overflow = 'hidden';\n    } else {\n        // plotly.js - let the developers do what they want, either\n        // provide height and width for the container div,\n        // specify size in layout, or take the defaults,\n        // but don't enforce any ratio restrictions\n        var computedStyle = isPlotDiv ? window.getComputedStyle(gd) : {};\n\n        newWidth = getComputedSize(computedStyle.width) || getComputedSize(computedStyle.maxWidth) || fullLayout.width;\n        newHeight = getComputedSize(computedStyle.height) || getComputedSize(computedStyle.maxHeight) || fullLayout.height;\n\n        if(isNumeric(frameMargins) && frameMargins > 0) {\n            var factor = 1 - 2 * frameMargins;\n            newWidth = Math.round(factor * newWidth);\n            newHeight = Math.round(factor * newHeight);\n        }\n    }\n\n    var minWidth = plots.layoutAttributes.width.min;\n    var minHeight = plots.layoutAttributes.height.min;\n    if(newWidth < minWidth) newWidth = minWidth;\n    if(newHeight < minHeight) newHeight = minHeight;\n\n    var widthHasChanged = !layout.width &&\n        (Math.abs(fullLayout.width - newWidth) > 1);\n    var heightHasChanged = !layout.height &&\n        (Math.abs(fullLayout.height - newHeight) > 1);\n\n    if(heightHasChanged || widthHasChanged) {\n        if(widthHasChanged) fullLayout.width = newWidth;\n        if(heightHasChanged) fullLayout.height = newHeight;\n    }\n\n    // cache initial autosize value, used in relayout when\n    // width or height values are set to null\n    if(!gd._initialAutoSize) {\n        gd._initialAutoSize = { width: newWidth, height: newHeight };\n    }\n\n    plots.sanitizeMargins(fullLayout);\n};\n\nplots.supplyLayoutModuleDefaults = function(layoutIn, layoutOut, fullData, transitionData) {\n    var componentsRegistry = Registry.componentsRegistry;\n    var basePlotModules = layoutOut._basePlotModules;\n    var component, i, _module;\n\n    var Cartesian = Registry.subplotsRegistry.cartesian;\n\n    // check if any components need to add more base plot modules\n    // that weren't captured by traces\n    for(component in componentsRegistry) {\n        _module = componentsRegistry[component];\n\n        if(_module.includeBasePlot) {\n            _module.includeBasePlot(layoutIn, layoutOut);\n        }\n    }\n\n    // make sure we *at least* have some cartesian axes\n    if(!basePlotModules.length) {\n        basePlotModules.push(Cartesian);\n    }\n\n    // ensure all cartesian axes have at least one subplot\n    if(layoutOut._has('cartesian')) {\n        Registry.getComponentMethod('grid', 'contentDefaults')(layoutIn, layoutOut);\n        Cartesian.finalizeSubplots(layoutIn, layoutOut);\n    }\n\n    // sort subplot lists\n    for(var subplotType in layoutOut._subplots) {\n        layoutOut._subplots[subplotType].sort(Lib.subplotSort);\n    }\n\n    // base plot module layout defaults\n    for(i = 0; i < basePlotModules.length; i++) {\n        _module = basePlotModules[i];\n\n        // e.g. pie does not have a layout-defaults step\n        if(_module.supplyLayoutDefaults) {\n            _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n        }\n    }\n\n    // trace module layout defaults\n    // use _modules rather than _visibleModules so that even\n    // legendonly traces can include settings - eg barmode, which affects\n    // legend.traceorder default value.\n    var modules = layoutOut._modules;\n    for(i = 0; i < modules.length; i++) {\n        _module = modules[i];\n\n        if(_module.supplyLayoutDefaults) {\n            _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n        }\n    }\n\n    // transform module layout defaults\n    var transformModules = layoutOut._transformModules;\n    for(i = 0; i < transformModules.length; i++) {\n        _module = transformModules[i];\n\n        if(_module.supplyLayoutDefaults) {\n            _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData, transitionData);\n        }\n    }\n\n    for(component in componentsRegistry) {\n        _module = componentsRegistry[component];\n\n        if(_module.supplyLayoutDefaults) {\n            _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n        }\n    }\n};\n\n// Remove all plotly attributes from a div so it can be replotted fresh\n// TODO: these really need to be encapsulated into a much smaller set...\nplots.purge = function(gd) {\n    // note: we DO NOT remove _context because it doesn't change when we insert\n    // a new plot, and may have been set outside of our scope.\n\n    var fullLayout = gd._fullLayout || {};\n    if(fullLayout._glcontainer !== undefined) {\n        fullLayout._glcontainer.selectAll('.gl-canvas').remove();\n        fullLayout._glcontainer.remove();\n        fullLayout._glcanvas = null;\n    }\n\n    // remove modebar\n    if(fullLayout._modeBar) fullLayout._modeBar.destroy();\n\n    if(gd._transitionData) {\n        // Ensure any dangling callbacks are simply dropped if the plot is purged.\n        // This is more or less only actually important for testing.\n        if(gd._transitionData._interruptCallbacks) {\n            gd._transitionData._interruptCallbacks.length = 0;\n        }\n\n        if(gd._transitionData._animationRaf) {\n            window.cancelAnimationFrame(gd._transitionData._animationRaf);\n        }\n    }\n\n    // remove any planned throttles\n    Lib.clearThrottle();\n\n    // remove responsive handler\n    Lib.clearResponsive(gd);\n\n    // data and layout\n    delete gd.data;\n    delete gd.layout;\n    delete gd._fullData;\n    delete gd._fullLayout;\n    delete gd.calcdata;\n    delete gd.framework;\n    delete gd.empty;\n\n    delete gd.fid;\n\n    delete gd.undoqueue; // action queue\n    delete gd.undonum;\n    delete gd.autoplay; // are we doing an action that doesn't go in undo queue?\n    delete gd.changed;\n\n    // these get recreated on Plotly.plot anyway, but just to be safe\n    // (and to have a record of them...)\n    delete gd._promises;\n    delete gd._redrawTimer;\n    delete gd._hmlumcount;\n    delete gd._hmpixcount;\n    delete gd._transitionData;\n    delete gd._transitioning;\n    delete gd._initialAutoSize;\n    delete gd._transitioningWithDuration;\n\n    // created during certain events, that *should* clean them up\n    // themselves, but may not if there was an error\n    delete gd._dragging;\n    delete gd._dragged;\n    delete gd._dragdata;\n    delete gd._hoverdata;\n    delete gd._snapshotInProgress;\n    delete gd._editing;\n    delete gd._mouseDownTime;\n    delete gd._legendMouseDownTime;\n\n    // remove all event listeners\n    if(gd.removeAllListeners) gd.removeAllListeners();\n};\n\nplots.style = function(gd) {\n    var _modules = gd._fullLayout._visibleModules;\n    var styleModules = [];\n    var i;\n\n    // some trace modules reuse the same style method,\n    // make sure to not unnecessary call them multiple times.\n\n    for(i = 0; i < _modules.length; i++) {\n        var _module = _modules[i];\n        if(_module.style) {\n            Lib.pushUnique(styleModules, _module.style);\n        }\n    }\n\n    for(i = 0; i < styleModules.length; i++) {\n        styleModules[i](gd);\n    }\n};\n\nplots.sanitizeMargins = function(fullLayout) {\n    // polar doesn't do margins...\n    if(!fullLayout || !fullLayout.margin) return;\n\n    var width = fullLayout.width;\n    var height = fullLayout.height;\n    var margin = fullLayout.margin;\n    var plotWidth = width - (margin.l + margin.r);\n    var plotHeight = height - (margin.t + margin.b);\n    var correction;\n\n    // if margin.l + margin.r = 0 then plotWidth > 0\n    // as width >= 10 by supplyDefaults\n    // similarly for margin.t + margin.b\n\n    if(plotWidth < 0) {\n        correction = (width - 1) / (margin.l + margin.r);\n        margin.l = Math.floor(correction * margin.l);\n        margin.r = Math.floor(correction * margin.r);\n    }\n\n    if(plotHeight < 0) {\n        correction = (height - 1) / (margin.t + margin.b);\n        margin.t = Math.floor(correction * margin.t);\n        margin.b = Math.floor(correction * margin.b);\n    }\n};\n\nplots.clearAutoMarginIds = function(gd) {\n    gd._fullLayout._pushmarginIds = {};\n};\n\nplots.allowAutoMargin = function(gd, id) {\n    gd._fullLayout._pushmarginIds[id] = 1;\n};\n\nfunction initMargins(fullLayout) {\n    var margin = fullLayout.margin;\n\n    if(!fullLayout._size) {\n        var gs = fullLayout._size = {\n            l: Math.round(margin.l),\n            r: Math.round(margin.r),\n            t: Math.round(margin.t),\n            b: Math.round(margin.b),\n            p: Math.round(margin.pad)\n        };\n        gs.w = Math.round(fullLayout.width) - gs.l - gs.r;\n        gs.h = Math.round(fullLayout.height) - gs.t - gs.b;\n    }\n    if(!fullLayout._pushmargin) fullLayout._pushmargin = {};\n    if(!fullLayout._pushmarginIds) fullLayout._pushmarginIds = {};\n}\n\n/**\n * autoMargin: called by components that may need to expand the margins to\n * be rendered on-plot.\n *\n * @param {DOM element} gd\n * @param {string} id - an identifier unique (within this plot) to this object,\n *     so we can remove a previous margin expansion from the same object.\n * @param {object} o - the margin requirements of this object, or omit to delete\n *     this entry (like if it's hidden). Keys are:\n *     x, y: plot fraction of the anchor point.\n *     xl, xr, yt, yb: if the object has an extent defined in plot fraction,\n *         you can specify both edges as plot fractions in each dimension\n *     l, r, t, b: the pixels to pad past the plot fraction x[l|r] and y[t|b]\n *     pad: extra pixels to add in all directions, default 12 (why?)\n */\nplots.autoMargin = function(gd, id, o) {\n    var fullLayout = gd._fullLayout;\n\n    var pushMargin = fullLayout._pushmargin;\n    var pushMarginIds = fullLayout._pushmarginIds;\n\n    if(fullLayout.margin.autoexpand !== false) {\n        if(!o) {\n            delete pushMargin[id];\n            delete pushMarginIds[id];\n        } else {\n            var pad = o.pad;\n            if(pad === undefined) {\n                var margin = fullLayout.margin;\n                // if no explicit pad is given, use 12px unless there's a\n                // specified margin that's smaller than that\n                pad = Math.min(12, margin.l, margin.r, margin.t, margin.b);\n            }\n\n            // if the item is too big, just give it enough automargin to\n            // make sure you can still grab it and bring it back\n            if(o.l + o.r > fullLayout.width * 0.5) {\n                Lib.log('Margin push', id, 'is too big in x, dropping');\n                o.l = o.r = 0;\n            }\n            if(o.b + o.t > fullLayout.height * 0.5) {\n                Lib.log('Margin push', id, 'is too big in y, dropping');\n                o.b = o.t = 0;\n            }\n\n            var xl = o.xl !== undefined ? o.xl : o.x;\n            var xr = o.xr !== undefined ? o.xr : o.x;\n            var yt = o.yt !== undefined ? o.yt : o.y;\n            var yb = o.yb !== undefined ? o.yb : o.y;\n\n            pushMargin[id] = {\n                l: {val: xl, size: o.l + pad},\n                r: {val: xr, size: o.r + pad},\n                b: {val: yb, size: o.b + pad},\n                t: {val: yt, size: o.t + pad}\n            };\n            pushMarginIds[id] = 1;\n        }\n\n        if(!fullLayout._replotting) {\n            return plots.doAutoMargin(gd);\n        }\n    }\n};\n\nplots.doAutoMargin = function(gd) {\n    var fullLayout = gd._fullLayout;\n    if(!fullLayout._size) fullLayout._size = {};\n    initMargins(fullLayout);\n\n    var gs = fullLayout._size;\n    var margin = fullLayout.margin;\n    var oldMargins = Lib.extendFlat({}, gs);\n\n    // adjust margins for outside components\n    // fullLayout.margin is the requested margin,\n    // fullLayout._size has margins and plotsize after adjustment\n    var ml = margin.l;\n    var mr = margin.r;\n    var mt = margin.t;\n    var mb = margin.b;\n    var width = fullLayout.width;\n    var height = fullLayout.height;\n    var pushMargin = fullLayout._pushmargin;\n    var pushMarginIds = fullLayout._pushmarginIds;\n\n    if(fullLayout.margin.autoexpand !== false) {\n        for(var k in pushMargin) {\n            if(!pushMarginIds[k]) delete pushMargin[k];\n        }\n\n        // fill in the requested margins\n        pushMargin.base = {\n            l: {val: 0, size: ml},\n            r: {val: 1, size: mr},\n            t: {val: 1, size: mt},\n            b: {val: 0, size: mb}\n        };\n\n        // now cycle through all the combinations of l and r\n        // (and t and b) to find the required margins\n\n        for(var k1 in pushMargin) {\n            var pushleft = pushMargin[k1].l || {};\n            var pushbottom = pushMargin[k1].b || {};\n            var fl = pushleft.val;\n            var pl = pushleft.size;\n            var fb = pushbottom.val;\n            var pb = pushbottom.size;\n\n            for(var k2 in pushMargin) {\n                if(isNumeric(pl) && pushMargin[k2].r) {\n                    var fr = pushMargin[k2].r.val;\n                    var pr = pushMargin[k2].r.size;\n\n                    if(fr > fl) {\n                        var newL = (pl * fr + (pr - width) * fl) / (fr - fl);\n                        var newR = (pr * (1 - fl) + (pl - width) * (1 - fr)) / (fr - fl);\n                        if(newL >= 0 && newR >= 0 && width - (newL + newR) > 0 && newL + newR > ml + mr) {\n                            ml = newL;\n                            mr = newR;\n                        }\n                    }\n                }\n\n                if(isNumeric(pb) && pushMargin[k2].t) {\n                    var ft = pushMargin[k2].t.val;\n                    var pt = pushMargin[k2].t.size;\n\n                    if(ft > fb) {\n                        var newB = (pb * ft + (pt - height) * fb) / (ft - fb);\n                        var newT = (pt * (1 - fb) + (pb - height) * (1 - ft)) / (ft - fb);\n                        if(newB >= 0 && newT >= 0 && height - (newT + newB) > 0 && newB + newT > mb + mt) {\n                            mb = newB;\n                            mt = newT;\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    gs.l = Math.round(ml);\n    gs.r = Math.round(mr);\n    gs.t = Math.round(mt);\n    gs.b = Math.round(mb);\n    gs.p = Math.round(margin.pad);\n    gs.w = Math.round(width) - gs.l - gs.r;\n    gs.h = Math.round(height) - gs.t - gs.b;\n\n    // if things changed and we're not already redrawing, trigger a redraw\n    if(!fullLayout._replotting && plots.didMarginChange(oldMargins, gs)) {\n        if('_redrawFromAutoMarginCount' in fullLayout) {\n            fullLayout._redrawFromAutoMarginCount++;\n        } else {\n            fullLayout._redrawFromAutoMarginCount = 1;\n        }\n\n        // Always allow at least one redraw and give each margin-push\n        // call 3 loops to converge. Of course, for most cases this way too many,\n        // but let's keep things on the safe side until we fix our\n        // auto-margin pipeline problems:\n        // https://github.com/plotly/plotly.js/issues/2704\n        var maxNumberOfRedraws = 3 * (1 + Object.keys(pushMarginIds).length);\n\n        if(fullLayout._redrawFromAutoMarginCount < maxNumberOfRedraws) {\n            return Registry.call('plot', gd);\n        } else {\n            Lib.warn('Too many auto-margin redraws.');\n        }\n    }\n};\n\nvar marginKeys = ['l', 'r', 't', 'b', 'p', 'w', 'h'];\n\nplots.didMarginChange = function(margin0, margin1) {\n    for(var i = 0; i < marginKeys.length; i++) {\n        var k = marginKeys[i];\n        var m0 = margin0[k];\n        var m1 = margin1[k];\n        // use 1px tolerance in case we old/new differ only\n        // by rounding errors, which can lead to infinite loops\n        if(!isNumeric(m0) || Math.abs(m1 - m0) > 1) {\n            return true;\n        }\n    }\n    return false;\n};\n\n/**\n * JSONify the graph data and layout\n *\n * This function needs to recurse because some src can be inside\n * sub-objects.\n *\n * It also strips out functions and private (starts with _) elements.\n * Therefore, we can add temporary things to data and layout that don't\n * get saved.\n *\n * @param gd The graphDiv\n * @param {Boolean} dataonly If true, don't return layout.\n * @param {'keepref'|'keepdata'|'keepall'} [mode='keepref'] Filter what's kept\n *      keepref: remove data for which there's a src present\n *          eg if there's xsrc present (and xsrc is well-formed,\n *          ie has : and some chars before it), strip out x\n *      keepdata: remove all src tags, don't remove the data itself\n *      keepall: keep data and src\n * @param {String} output If you specify 'object', the result will not be stringified\n * @param {Boolean} useDefaults If truthy, use _fullLayout and _fullData\n * @param {Boolean} includeConfig If truthy, include _context\n * @returns {Object|String}\n */\nplots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfig) {\n    // if the defaults aren't supplied yet, we need to do that...\n    if((useDefaults && dataonly && !gd._fullData) ||\n            (useDefaults && !dataonly && !gd._fullLayout)) {\n        plots.supplyDefaults(gd);\n    }\n\n    var data = (useDefaults) ? gd._fullData : gd.data;\n    var layout = (useDefaults) ? gd._fullLayout : gd.layout;\n    var frames = (gd._transitionData || {})._frames;\n\n    function stripObj(d, keepFunction) {\n        if(typeof d === 'function') {\n            return keepFunction ? '_function_' : null;\n        }\n        if(Lib.isPlainObject(d)) {\n            var o = {};\n            var src;\n            Object.keys(d).sort().forEach(function(v) {\n                // remove private elements and functions\n                // _ is for private, [ is a mistake ie [object Object]\n                if(['_', '['].indexOf(v.charAt(0)) !== -1) return;\n\n                // if a function, add if necessary then move on\n                if(typeof d[v] === 'function') {\n                    if(keepFunction) o[v] = '_function';\n                    return;\n                }\n\n                // look for src/data matches and remove the appropriate one\n                if(mode === 'keepdata') {\n                    // keepdata: remove all ...src tags\n                    if(v.substr(v.length - 3) === 'src') {\n                        return;\n                    }\n                } else if(mode === 'keepstream') {\n                    // keep sourced data if it's being streamed.\n                    // similar to keepref, but if the 'stream' object exists\n                    // in a trace, we will keep the data array.\n                    src = d[v + 'src'];\n                    if(typeof src === 'string' && src.indexOf(':') > 0) {\n                        if(!Lib.isPlainObject(d.stream)) {\n                            return;\n                        }\n                    }\n                } else if(mode !== 'keepall') {\n                    // keepref: remove sourced data but only\n                    // if the source tag is well-formed\n                    src = d[v + 'src'];\n                    if(typeof src === 'string' && src.indexOf(':') > 0) {\n                        return;\n                    }\n                }\n\n                // OK, we're including this... recurse into it\n                o[v] = stripObj(d[v], keepFunction);\n            });\n            return o;\n        }\n\n        if(Array.isArray(d)) {\n            return d.map(function(x) {return stripObj(x, keepFunction);});\n        }\n\n        if(Lib.isTypedArray(d)) {\n            return Lib.simpleMap(d, Lib.identity);\n        }\n\n        // convert native dates to date strings...\n        // mostly for external users exporting to plotly\n        if(Lib.isJSDate(d)) return Lib.ms2DateTimeLocal(+d);\n\n        return d;\n    }\n\n    var obj = {\n        data: (data || []).map(function(v) {\n            var d = stripObj(v);\n            // fit has some little arrays in it that don't contain data,\n            // just fit params and meta\n            if(dataonly) { delete d.fit; }\n            return d;\n        })\n    };\n    if(!dataonly) { obj.layout = stripObj(layout); }\n\n    if(gd.framework && gd.framework.isPolar) obj = gd.framework.getConfig();\n\n    if(frames) obj.frames = stripObj(frames);\n\n    if(includeConfig) obj.config = stripObj(gd._context, true);\n\n    return (output === 'object') ? obj : JSON.stringify(obj);\n};\n\n/**\n * Modify a keyframe using a list of operations:\n *\n * @param {array of objects} operations\n *      Sequence of operations to be performed on the keyframes\n */\nplots.modifyFrames = function(gd, operations) {\n    var i, op, frame;\n    var _frames = gd._transitionData._frames;\n    var _frameHash = gd._transitionData._frameHash;\n\n    for(i = 0; i < operations.length; i++) {\n        op = operations[i];\n\n        switch(op.type) {\n            // No reason this couldn't exist, but is currently unused/untested:\n            /* case 'rename':\n                frame = _frames[op.index];\n                delete _frameHash[frame.name];\n                _frameHash[op.name] = frame;\n                frame.name = op.name;\n                break;*/\n            case 'replace':\n                frame = op.value;\n                var oldName = (_frames[op.index] || {}).name;\n                var newName = frame.name;\n                _frames[op.index] = _frameHash[newName] = frame;\n\n                if(newName !== oldName) {\n                    // If name has changed in addition to replacement, then update\n                    // the lookup table:\n                    delete _frameHash[oldName];\n                    _frameHash[newName] = frame;\n                }\n\n                break;\n            case 'insert':\n                frame = op.value;\n                _frameHash[frame.name] = frame;\n                _frames.splice(op.index, 0, frame);\n                break;\n            case 'delete':\n                frame = _frames[op.index];\n                delete _frameHash[frame.name];\n                _frames.splice(op.index, 1);\n                break;\n        }\n    }\n\n    return Promise.resolve();\n};\n\n/*\n * Compute a keyframe. Merge a keyframe into its base frame(s) and\n * expand properties.\n *\n * @param {object} frameLookup\n *      An object containing frames keyed by name (i.e. gd._transitionData._frameHash)\n * @param {string} frame\n *      The name of the keyframe to be computed\n *\n * Returns: a new object with the merged content\n */\nplots.computeFrame = function(gd, frameName) {\n    var frameLookup = gd._transitionData._frameHash;\n    var i, traceIndices, traceIndex, destIndex;\n\n    // Null or undefined will fail on .toString(). We'll allow numbers since we\n    // make it clear frames must be given string names, but we'll allow numbers\n    // here since they're otherwise fine for looking up frames as long as they're\n    // properly cast to strings. We really just want to ensure here that this\n    // 1) doesn't fail, and\n    // 2) doens't give an incorrect answer (which String(frameName) would)\n    if(!frameName) {\n        throw new Error('computeFrame must be given a string frame name');\n    }\n\n    var framePtr = frameLookup[frameName.toString()];\n\n    // Return false if the name is invalid:\n    if(!framePtr) {\n        return false;\n    }\n\n    var frameStack = [framePtr];\n    var frameNameStack = [framePtr.name];\n\n    // Follow frame pointers:\n    while(framePtr.baseframe && (framePtr = frameLookup[framePtr.baseframe.toString()])) {\n        // Avoid infinite loops:\n        if(frameNameStack.indexOf(framePtr.name) !== -1) break;\n\n        frameStack.push(framePtr);\n        frameNameStack.push(framePtr.name);\n    }\n\n    // A new object for the merged result:\n    var result = {};\n\n    // Merge, starting with the last and ending with the desired frame:\n    while((framePtr = frameStack.pop())) {\n        if(framePtr.layout) {\n            result.layout = plots.extendLayout(result.layout, framePtr.layout);\n        }\n\n        if(framePtr.data) {\n            if(!result.data) {\n                result.data = [];\n            }\n            traceIndices = framePtr.traces;\n\n            if(!traceIndices) {\n                // If not defined, assume serial order starting at zero\n                traceIndices = [];\n                for(i = 0; i < framePtr.data.length; i++) {\n                    traceIndices[i] = i;\n                }\n            }\n\n            if(!result.traces) {\n                result.traces = [];\n            }\n\n            for(i = 0; i < framePtr.data.length; i++) {\n                // Loop through this frames data, find out where it should go,\n                // and merge it!\n                traceIndex = traceIndices[i];\n                if(traceIndex === undefined || traceIndex === null) {\n                    continue;\n                }\n\n                destIndex = result.traces.indexOf(traceIndex);\n                if(destIndex === -1) {\n                    destIndex = result.data.length;\n                    result.traces[destIndex] = traceIndex;\n                }\n\n                result.data[destIndex] = plots.extendTrace(result.data[destIndex], framePtr.data[i]);\n            }\n        }\n    }\n\n    return result;\n};\n\n/*\n * Recompute the lookup table that maps frame name -> frame object. addFrames/\n * deleteFrames already manages this data one at a time, so the only time this\n * is necessary is if you poke around manually in `gd._transitionData._frames`\n * and create and haven't updated the lookup table.\n */\nplots.recomputeFrameHash = function(gd) {\n    var hash = gd._transitionData._frameHash = {};\n    var frames = gd._transitionData._frames;\n    for(var i = 0; i < frames.length; i++) {\n        var frame = frames[i];\n        if(frame && frame.name) {\n            hash[frame.name] = frame;\n        }\n    }\n};\n\n/**\n * Extend an object, treating container arrays very differently by extracting\n * their contents and merging them separately.\n *\n * This exists so that we can extendDeepNoArrays and avoid stepping into data\n * arrays without knowledge of the plot schema, but so that we may also manually\n * recurse into known container arrays, such as transforms.\n *\n * See extendTrace and extendLayout below for usage.\n */\nplots.extendObjectWithContainers = function(dest, src, containerPaths) {\n    var containerProp, containerVal, i, j, srcProp, destProp, srcContainer, destContainer;\n    var copy = Lib.extendDeepNoArrays({}, src || {});\n    var expandedObj = Lib.expandObjectPaths(copy);\n    var containerObj = {};\n\n    // Step through and extract any container properties. Otherwise extendDeepNoArrays\n    // will clobber any existing properties with an empty array and then supplyDefaults\n    // will reset everything to defaults.\n    if(containerPaths && containerPaths.length) {\n        for(i = 0; i < containerPaths.length; i++) {\n            containerProp = Lib.nestedProperty(expandedObj, containerPaths[i]);\n            containerVal = containerProp.get();\n\n            if(containerVal === undefined) {\n                Lib.nestedProperty(containerObj, containerPaths[i]).set(null);\n            } else {\n                containerProp.set(null);\n                Lib.nestedProperty(containerObj, containerPaths[i]).set(containerVal);\n            }\n        }\n    }\n\n    dest = Lib.extendDeepNoArrays(dest || {}, expandedObj);\n\n    if(containerPaths && containerPaths.length) {\n        for(i = 0; i < containerPaths.length; i++) {\n            srcProp = Lib.nestedProperty(containerObj, containerPaths[i]);\n            srcContainer = srcProp.get();\n\n            if(!srcContainer) continue;\n\n            destProp = Lib.nestedProperty(dest, containerPaths[i]);\n            destContainer = destProp.get();\n\n            if(!Array.isArray(destContainer)) {\n                destContainer = [];\n                destProp.set(destContainer);\n            }\n\n            for(j = 0; j < srcContainer.length; j++) {\n                var srcObj = srcContainer[j];\n\n                if(srcObj === null) destContainer[j] = null;\n                else {\n                    destContainer[j] = plots.extendObjectWithContainers(destContainer[j], srcObj);\n                }\n            }\n\n            destProp.set(destContainer);\n        }\n    }\n\n    return dest;\n};\n\nplots.dataArrayContainers = ['transforms', 'dimensions'];\nplots.layoutArrayContainers = Registry.layoutArrayContainers;\n\n/*\n * Extend a trace definition. This method:\n *\n *  1. directly transfers any array references\n *  2. manually recurses into container arrays like transforms\n *\n * The result is the original object reference with the new contents merged in.\n */\nplots.extendTrace = function(destTrace, srcTrace) {\n    return plots.extendObjectWithContainers(destTrace, srcTrace, plots.dataArrayContainers);\n};\n\n/*\n * Extend a layout definition. This method:\n *\n *  1. directly transfers any array references (not critically important for\n *     layout since there aren't really data arrays)\n *  2. manually recurses into container arrays like annotations\n *\n * The result is the original object reference with the new contents merged in.\n */\nplots.extendLayout = function(destLayout, srcLayout) {\n    return plots.extendObjectWithContainers(destLayout, srcLayout, plots.layoutArrayContainers);\n};\n\n/**\n * Transition to a set of new data and layout properties from Plotly.animate\n *\n * @param {DOM element} gd\n * @param {Object[]} data\n *      an array of data objects following the normal Plotly data definition format\n * @param {Object} layout\n *      a layout object, following normal Plotly layout format\n * @param {Number[]} traces\n *      indices of the corresponding traces specified in `data`\n * @param {Object} frameOpts\n *      options for the frame (i.e. whether to redraw post-transition)\n * @param {Object} transitionOpts\n *      options for the transition\n */\nplots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts) {\n    var opts = {redraw: frameOpts.redraw};\n    var transitionedTraces = {};\n    var axEdits = [];\n\n    opts.prepareFn = function() {\n        var dataLength = Array.isArray(data) ? data.length : 0;\n        var traceIndices = traces.slice(0, dataLength);\n\n        for(var i = 0; i < traceIndices.length; i++) {\n            var traceIdx = traceIndices[i];\n            var trace = gd._fullData[traceIdx];\n            var _module = trace._module;\n\n            // There's nothing to do if this module is not defined:\n            if(!_module) continue;\n\n            // Don't register the trace as transitioned if it doesn't know what to do.\n            // If it *is* registered, it will receive a callback that it's responsible\n            // for calling in order to register the transition as having completed.\n            if(_module.animatable) {\n                var n = _module.basePlotModule.name;\n                if(!transitionedTraces[n]) transitionedTraces[n] = [];\n                transitionedTraces[n].push(traceIdx);\n            }\n\n            gd.data[traceIndices[i]] = plots.extendTrace(gd.data[traceIndices[i]], data[i]);\n        }\n\n        // Follow the same procedure. Clone it so we don't mangle the input, then\n        // expand any object paths so we can merge deep into gd.layout:\n        var layoutUpdate = Lib.expandObjectPaths(Lib.extendDeepNoArrays({}, layout));\n\n        // Before merging though, we need to modify the incoming layout. We only\n        // know how to *transition* layout ranges, so it's imperative that a new\n        // range not be sent to the layout before the transition has started. So\n        // we must remove the things we can transition:\n        var axisAttrRe = /^[xy]axis[0-9]*$/;\n        for(var attr in layoutUpdate) {\n            if(!axisAttrRe.test(attr)) continue;\n            delete layoutUpdate[attr].range;\n        }\n\n        plots.extendLayout(gd.layout, layoutUpdate);\n\n        // Supply defaults after applying the incoming properties. Note that any attempt\n        // to simplify this step and reduce the amount of work resulted in the reconstruction\n        // of essentially the whole supplyDefaults step, so that it seems sensible to just use\n        // supplyDefaults even though it's heavier than would otherwise be desired for\n        // transitions:\n\n        // first delete calcdata so supplyDefaults knows a calc step is coming\n        delete gd.calcdata;\n\n        plots.supplyDefaults(gd);\n        plots.doCalcdata(gd);\n\n        var newLayout = Lib.expandObjectPaths(layout);\n\n        if(newLayout) {\n            var subplots = gd._fullLayout._plots;\n\n            for(var k in subplots) {\n                var plotinfo = subplots[k];\n                var xa = plotinfo.xaxis;\n                var ya = plotinfo.yaxis;\n                var xr0 = xa.range.slice();\n                var yr0 = ya.range.slice();\n\n                var xr1 = null;\n                var yr1 = null;\n                var editX = null;\n                var editY = null;\n\n                if(Array.isArray(newLayout[xa._name + '.range'])) {\n                    xr1 = newLayout[xa._name + '.range'].slice();\n                } else if(Array.isArray((newLayout[xa._name] || {}).range)) {\n                    xr1 = newLayout[xa._name].range.slice();\n                }\n                if(Array.isArray(newLayout[ya._name + '.range'])) {\n                    yr1 = newLayout[ya._name + '.range'].slice();\n                } else if(Array.isArray((newLayout[ya._name] || {}).range)) {\n                    yr1 = newLayout[ya._name].range.slice();\n                }\n\n                if(xr0 && xr1 &&\n                    (xa.r2l(xr0[0]) !== xa.r2l(xr1[0]) || xa.r2l(xr0[1]) !== xa.r2l(xr1[1]))\n                ) {\n                    editX = {xr0: xr0, xr1: xr1};\n                }\n                if(yr0 && yr1 &&\n                    (ya.r2l(yr0[0]) !== ya.r2l(yr1[0]) || ya.r2l(yr0[1]) !== ya.r2l(yr1[1]))\n                ) {\n                    editY = {yr0: yr0, yr1: yr1};\n                }\n\n                if(editX || editY) {\n                    axEdits.push(Lib.extendFlat({plotinfo: plotinfo}, editX, editY));\n                }\n            }\n        }\n\n        return Promise.resolve();\n    };\n\n    opts.runFn = function(makeCallback) {\n        var traceTransitionOpts;\n        var basePlotModules = gd._fullLayout._basePlotModules;\n        var hasAxisTransition = axEdits.length;\n        var i;\n\n        if(layout) {\n            for(i = 0; i < basePlotModules.length; i++) {\n                if(basePlotModules[i].transitionAxes) {\n                    basePlotModules[i].transitionAxes(gd, axEdits, transitionOpts, makeCallback);\n                }\n            }\n        }\n\n        // Here handle the exception that we refuse to animate scales and axes at the same\n        // time. In other words, if there's an axis transition, then set the data transition\n        // to instantaneous.\n        if(hasAxisTransition) {\n            traceTransitionOpts = Lib.extendFlat({}, transitionOpts);\n            traceTransitionOpts.duration = 0;\n            // This means do not transition cartesian traces,\n            // this happens on layout-only (e.g. axis range) animations\n            delete transitionedTraces.cartesian;\n        } else {\n            traceTransitionOpts = transitionOpts;\n        }\n\n        // Note that we pass a callback to *create* the callback that must be invoked on completion.\n        // This is since not all traces know about transitions, so it greatly simplifies matters if\n        // the trace is responsible for creating a callback, if needed, and then executing it when\n        // the time is right.\n        for(var n in transitionedTraces) {\n            var traceIndices = transitionedTraces[n];\n            var _module = gd._fullData[traceIndices[0]]._module;\n            _module.basePlotModule.plot(gd, traceIndices, traceTransitionOpts, makeCallback);\n        }\n    };\n\n    return _transition(gd, transitionOpts, opts);\n};\n\n/**\n * Transition to a set of new data and layout properties from Plotly.react\n *\n * @param {DOM element} gd\n * @param {object} restyleFlags\n * - anim {'all'|'some'}\n * @param {object} relayoutFlags\n * - anim {'all'|'some'}\n * @param {object} oldFullLayout : old (pre Plotly.react) fullLayout\n */\nplots.transitionFromReact = function(gd, restyleFlags, relayoutFlags, oldFullLayout) {\n    var fullLayout = gd._fullLayout;\n    var transitionOpts = fullLayout.transition;\n    var opts = {};\n    var axEdits = [];\n\n    opts.prepareFn = function() {\n        var subplots = fullLayout._plots;\n\n        // no need to redraw at end of transition,\n        // if all changes are animatable\n        opts.redraw = false;\n        if(restyleFlags.anim === 'some') opts.redraw = true;\n        if(relayoutFlags.anim === 'some') opts.redraw = true;\n\n        for(var k in subplots) {\n            var plotinfo = subplots[k];\n            var xa = plotinfo.xaxis;\n            var ya = plotinfo.yaxis;\n            var xr0 = oldFullLayout[xa._name].range.slice();\n            var yr0 = oldFullLayout[ya._name].range.slice();\n            var xr1 = xa.range.slice();\n            var yr1 = ya.range.slice();\n\n            xa.setScale();\n            ya.setScale();\n\n            var editX = null;\n            var editY = null;\n\n            if(xa.r2l(xr0[0]) !== xa.r2l(xr1[0]) || xa.r2l(xr0[1]) !== xa.r2l(xr1[1])) {\n                editX = {xr0: xr0, xr1: xr1};\n            }\n            if(ya.r2l(yr0[0]) !== ya.r2l(yr1[0]) || ya.r2l(yr0[1]) !== ya.r2l(yr1[1])) {\n                editY = {yr0: yr0, yr1: yr1};\n            }\n\n            if(editX || editY) {\n                axEdits.push(Lib.extendFlat({plotinfo: plotinfo}, editX, editY));\n            }\n        }\n\n        return Promise.resolve();\n    };\n\n    opts.runFn = function(makeCallback) {\n        var fullData = gd._fullData;\n        var fullLayout = gd._fullLayout;\n        var basePlotModules = fullLayout._basePlotModules;\n\n        var axisTransitionOpts;\n        var traceTransitionOpts;\n        var transitionedTraces;\n\n        var allTraceIndices = [];\n        for(var i = 0; i < fullData.length; i++) {\n            allTraceIndices.push(i);\n        }\n\n        function transitionAxes() {\n            for(var j = 0; j < basePlotModules.length; j++) {\n                if(basePlotModules[j].transitionAxes) {\n                    basePlotModules[j].transitionAxes(gd, axEdits, axisTransitionOpts, makeCallback);\n                }\n            }\n        }\n\n        function transitionTraces() {\n            for(var j = 0; j < basePlotModules.length; j++) {\n                basePlotModules[j].plot(gd, transitionedTraces, traceTransitionOpts, makeCallback);\n            }\n        }\n\n        if(axEdits.length && restyleFlags.anim) {\n            if(transitionOpts.ordering === 'traces first') {\n                axisTransitionOpts = Lib.extendFlat({}, transitionOpts, {duration: 0});\n                transitionedTraces = allTraceIndices;\n                traceTransitionOpts = transitionOpts;\n                setTimeout(transitionAxes, transitionOpts.duration);\n                transitionTraces();\n            } else {\n                axisTransitionOpts = transitionOpts;\n                transitionedTraces = null;\n                traceTransitionOpts = Lib.extendFlat({}, transitionOpts, {duration: 0});\n                setTimeout(transitionTraces, axisTransitionOpts.duration);\n                transitionAxes();\n            }\n        } else if(axEdits.length) {\n            axisTransitionOpts = transitionOpts;\n            transitionAxes();\n        } else if(restyleFlags.anim) {\n            transitionedTraces = allTraceIndices;\n            traceTransitionOpts = transitionOpts;\n            transitionTraces();\n        }\n    };\n\n    return _transition(gd, transitionOpts, opts);\n};\n\n/**\n * trace/layout transition wrapper that works\n * for transitions initiated by Plotly.animate and Plotly.react.\n *\n * @param {DOM element} gd\n * @param {object} transitionOpts\n * @param {object} opts\n * - redraw {boolean}\n * - prepareFn {function} *should return a Promise*\n * - runFn {function} ran inside executeTransitions\n */\nfunction _transition(gd, transitionOpts, opts) {\n    var aborted = false;\n\n    function executeCallbacks(list) {\n        var p = Promise.resolve();\n        if(!list) return p;\n        while(list.length) {\n            p = p.then((list.shift()));\n        }\n        return p;\n    }\n\n    function flushCallbacks(list) {\n        if(!list) return;\n        while(list.length) {\n            list.shift();\n        }\n    }\n\n    function executeTransitions() {\n        gd.emit('plotly_transitioning', []);\n\n        return new Promise(function(resolve) {\n            // This flag is used to disabled things like autorange:\n            gd._transitioning = true;\n\n            // When instantaneous updates are coming through quickly, it's too much to simply disable\n            // all interaction, so store this flag so we can disambiguate whether mouse interactions\n            // should be fully disabled or not:\n            if(transitionOpts.duration > 0) {\n                gd._transitioningWithDuration = true;\n            }\n\n            // If another transition is triggered, this callback will be executed simply because it's\n            // in the interruptCallbacks queue. If this transition completes, it will instead flush\n            // that queue and forget about this callback.\n            gd._transitionData._interruptCallbacks.push(function() {\n                aborted = true;\n            });\n\n            if(opts.redraw) {\n                gd._transitionData._interruptCallbacks.push(function() {\n                    return Registry.call('redraw', gd);\n                });\n            }\n\n            // Emit this and make sure it happens last:\n            gd._transitionData._interruptCallbacks.push(function() {\n                gd.emit('plotly_transitioninterrupted', []);\n            });\n\n            // Construct callbacks that are executed on transition end. This ensures the d3 transitions\n            // are *complete* before anything else is done.\n            var numCallbacks = 0;\n            var numCompleted = 0;\n            function makeCallback() {\n                numCallbacks++;\n                return function() {\n                    numCompleted++;\n                    // When all are complete, perform a redraw:\n                    if(!aborted && numCompleted === numCallbacks) {\n                        completeTransition(resolve);\n                    }\n                };\n            }\n\n            opts.runFn(makeCallback);\n\n            // If nothing else creates a callback, then this will trigger the completion in the next tick:\n            setTimeout(makeCallback());\n        });\n    }\n\n    function completeTransition(callback) {\n        // This a simple workaround for tests which purge the graph before animations\n        // have completed. That's not a very common case, so this is the simplest\n        // fix.\n        if(!gd._transitionData) return;\n\n        flushCallbacks(gd._transitionData._interruptCallbacks);\n\n        return Promise.resolve().then(function() {\n            if(opts.redraw) {\n                return Registry.call('redraw', gd);\n            }\n        }).then(function() {\n            // Set transitioning false again once the redraw has occurred. This is used, for example,\n            // to prevent the trailing redraw from autoranging:\n            gd._transitioning = false;\n            gd._transitioningWithDuration = false;\n\n            gd.emit('plotly_transitioned', []);\n        }).then(callback);\n    }\n\n    function interruptPreviousTransitions() {\n        // Fail-safe against purged plot:\n        if(!gd._transitionData) return;\n\n        // If a transition is interrupted, set this to false. At the moment, the only thing that would\n        // interrupt a transition is another transition, so that it will momentarily be set to true\n        // again, but this determines whether autorange or dragbox work, so it's for the sake of\n        // cleanliness:\n        gd._transitioning = false;\n\n        return executeCallbacks(gd._transitionData._interruptCallbacks);\n    }\n\n    var seq = [\n        plots.previousPromises,\n        interruptPreviousTransitions,\n        opts.prepareFn,\n        plots.rehover,\n        executeTransitions\n    ];\n\n    var transitionStarting = Lib.syncOrAsync(seq, gd);\n\n    if(!transitionStarting || !transitionStarting.then) {\n        transitionStarting = Promise.resolve();\n    }\n\n    return transitionStarting.then(function() { return gd; });\n}\n\nplots.doCalcdata = function(gd, traces) {\n    var axList = axisIDs.list(gd);\n    var fullData = gd._fullData;\n    var fullLayout = gd._fullLayout;\n\n    var trace, _module, i, j;\n\n    // XXX: Is this correct? Needs a closer look so that *some* traces can be recomputed without\n    // *all* needing doCalcdata:\n    var calcdata = new Array(fullData.length);\n    var oldCalcdata = (gd.calcdata || []).slice();\n    gd.calcdata = calcdata;\n\n    // extra helper variables\n\n    // how many box/violins plots do we have (in case they're grouped)\n    fullLayout._numBoxes = 0;\n    fullLayout._numViolins = 0;\n\n    // initialize violin per-scale-group stats container\n    fullLayout._violinScaleGroupStats = {};\n\n    // for calculating avg luminosity of heatmaps\n    gd._hmpixcount = 0;\n    gd._hmlumcount = 0;\n\n    // for sharing colors across pies / sunbursts / treemap / funnelarea (and for legend)\n    fullLayout._piecolormap = {};\n    fullLayout._sunburstcolormap = {};\n    fullLayout._treemapcolormap = {};\n    fullLayout._funnelareacolormap = {};\n\n    // If traces were specified and this trace was not included,\n    // then transfer it over from the old calcdata:\n    for(i = 0; i < fullData.length; i++) {\n        if(Array.isArray(traces) && traces.indexOf(i) === -1) {\n            calcdata[i] = oldCalcdata[i];\n            continue;\n        }\n    }\n\n    for(i = 0; i < fullData.length; i++) {\n        trace = fullData[i];\n\n        trace._arrayAttrs = PlotSchema.findArrayAttributes(trace);\n\n        // keep track of trace extremes (for autorange) in here\n        trace._extremes = {};\n    }\n\n    // add polar axes to axis list\n    var polarIds = fullLayout._subplots.polar || [];\n    for(i = 0; i < polarIds.length; i++) {\n        axList.push(\n            fullLayout[polarIds[i]].radialaxis,\n            fullLayout[polarIds[i]].angularaxis\n        );\n    }\n\n    // clear relinked cmin/cmax values in shared axes to start aggregation from scratch\n    for(var k in fullLayout._colorAxes) {\n        var cOpts = fullLayout[k];\n        if(cOpts.cauto !== false) {\n            delete cOpts.cmin;\n            delete cOpts.cmax;\n        }\n    }\n\n    var hasCalcTransform = false;\n\n    function transformCalci(i) {\n        trace = fullData[i];\n        _module = trace._module;\n\n        if(trace.visible === true && trace.transforms) {\n            // we need one round of trace module calc before\n            // the calc transform to 'fill in' the categories list\n            // used for example in the data-to-coordinate method\n            if(_module && _module.calc) {\n                var cdi = _module.calc(gd, trace);\n\n                // must clear scene 'batches', so that 2nd\n                // _module.calc call starts from scratch\n                if(cdi[0] && cdi[0].t && cdi[0].t._scene) {\n                    delete cdi[0].t._scene.dirty;\n                }\n            }\n\n            for(j = 0; j < trace.transforms.length; j++) {\n                var transform = trace.transforms[j];\n\n                _module = transformsRegistry[transform.type];\n                if(_module && _module.calcTransform) {\n                    trace._hasCalcTransform = true;\n                    hasCalcTransform = true;\n                    _module.calcTransform(gd, trace, transform);\n                }\n            }\n        }\n    }\n\n    function calci(i, isContainer) {\n        trace = fullData[i];\n        _module = trace._module;\n\n        if(!!_module.isContainer !== isContainer) return;\n\n        var cd = [];\n\n        if(trace.visible === true && trace._length !== 0) {\n            // clear existing ref in case it got relinked\n            delete trace._indexToPoints;\n            // keep ref of index-to-points map object of the *last* enabled transform,\n            // this index-to-points map object is required to determine the calcdata indices\n            // that correspond to input indices (e.g. from 'selectedpoints')\n            var transforms = trace.transforms || [];\n            for(j = transforms.length - 1; j >= 0; j--) {\n                if(transforms[j].enabled) {\n                    trace._indexToPoints = transforms[j]._indexToPoints;\n                    break;\n                }\n            }\n\n            if(_module && _module.calc) {\n                cd = _module.calc(gd, trace);\n            }\n        }\n\n        // Make sure there is a first point.\n        //\n        // This ensures there is a calcdata item for every trace,\n        // even if cartesian logic doesn't handle it (for things like legends).\n        if(!Array.isArray(cd) || !cd[0]) {\n            cd = [{x: BADNUM, y: BADNUM}];\n        }\n\n        // add the trace-wide properties to the first point,\n        // per point properties to every point\n        // t is the holder for trace-wide properties\n        if(!cd[0].t) cd[0].t = {};\n        cd[0].trace = trace;\n\n        calcdata[i] = cd;\n    }\n\n    setupAxisCategories(axList, fullData, fullLayout);\n\n    // 'transform' loop - must calc container traces first\n    // so that if their dependent traces can get transform properly\n    for(i = 0; i < fullData.length; i++) calci(i, true);\n    for(i = 0; i < fullData.length; i++) transformCalci(i);\n\n    // clear stuff that should recomputed in 'regular' loop\n    if(hasCalcTransform) setupAxisCategories(axList, fullData, fullLayout);\n\n    // 'regular' loop - make sure container traces (eg carpet) calc before\n    // contained traces (eg contourcarpet)\n    for(i = 0; i < fullData.length; i++) calci(i, true);\n    for(i = 0; i < fullData.length; i++) calci(i, false);\n\n    doCrossTraceCalc(gd);\n\n    // Sort axis categories per value if specified\n    var sorted = sortAxisCategoriesByValue(axList, gd);\n    if(sorted.length) {\n        // how many box/violins plots do we have (in case they're grouped)\n        fullLayout._numBoxes = 0;\n        fullLayout._numViolins = 0;\n        // If a sort operation was performed, run calc() again\n        for(i = 0; i < sorted.length; i++) calci(sorted[i], true);\n        for(i = 0; i < sorted.length; i++) calci(sorted[i], false);\n        doCrossTraceCalc(gd);\n    }\n\n    Registry.getComponentMethod('fx', 'calc')(gd);\n    Registry.getComponentMethod('errorbars', 'calc')(gd);\n};\n\nvar sortAxisCategoriesByValueRegex = /(total|sum|min|max|mean|median) (ascending|descending)/;\n\nfunction sortAxisCategoriesByValue(axList, gd) {\n    var affectedTraces = [];\n    var i, j, k, l, o;\n\n    function zMapCategory(type, ax, value) {\n        var axLetter = ax._id.charAt(0);\n        if(type === 'histogram2dcontour') {\n            var counterAxLetter = ax._counterAxes[0];\n            var counterAx = axisIDs.getFromId(gd, counterAxLetter);\n\n            var xCategorical = axLetter === 'x' || (counterAxLetter === 'x' && counterAx.type === 'category');\n            var yCategorical = axLetter === 'y' || (counterAxLetter === 'y' && counterAx.type === 'category');\n\n            return function(o, l) {\n                if(o === 0 || l === 0) return -1; // Skip first row and column\n                if(xCategorical && o === value[l].length - 1) return -1;\n                if(yCategorical && l === value.length - 1) return -1;\n\n                return (axLetter === 'y' ? l : o) - 1;\n            };\n        } else {\n            return function(o, l) {\n                return axLetter === 'y' ? l : o;\n            };\n        }\n    }\n\n    var aggFn = {\n        'min': function(values) {return Lib.aggNums(Math.min, null, values);},\n        'max': function(values) {return Lib.aggNums(Math.max, null, values);},\n        'sum': function(values) {return Lib.aggNums(function(a, b) { return a + b;}, null, values);},\n        'total': function(values) {return Lib.aggNums(function(a, b) { return a + b;}, null, values);},\n        'mean': function(values) {return Lib.mean(values);},\n        'median': function(values) {return Lib.median(values);}\n    };\n\n    for(i = 0; i < axList.length; i++) {\n        var ax = axList[i];\n        if(ax.type !== 'category') continue;\n\n        // Order by value\n        var match = ax.categoryorder.match(sortAxisCategoriesByValueRegex);\n        if(match) {\n            var aggregator = match[1];\n            var order = match[2];\n\n            // Store values associated with each category\n            var categoriesValue = [];\n            for(j = 0; j < ax._categories.length; j++) {\n                categoriesValue.push([ax._categories[j], []]);\n            }\n\n            // Collect values across traces\n            for(j = 0; j < ax._traceIndices.length; j++) {\n                var traceIndex = ax._traceIndices[j];\n                var fullTrace = gd._fullData[traceIndex];\n                var axLetter = ax._id.charAt(0);\n\n                // Skip over invisible traces\n                if(fullTrace.visible !== true) continue;\n\n                var type = fullTrace.type;\n                if(Registry.traceIs(fullTrace, 'histogram')) {\n                    delete fullTrace._xautoBinFinished;\n                    delete fullTrace._yautoBinFinished;\n                }\n\n                var cd = gd.calcdata[traceIndex];\n                for(k = 0; k < cd.length; k++) {\n                    var cdi = cd[k];\n                    var cat, catIndex, value;\n\n                    if(type === 'splom') {\n                        // If `splom`, collect values across dimensions\n                        // Find which dimension the current axis is representing\n                        var currentDimensionIndex = fullTrace._axesDim[ax._id];\n\n                        // Apply logic to associated x axis if it's defined\n                        if(axLetter === 'y') {\n                            var associatedXAxisID = fullTrace._diag[currentDimensionIndex][0];\n                            if(associatedXAxisID) ax = gd._fullLayout[axisIDs.id2name(associatedXAxisID)];\n                        }\n\n                        var categories = cdi.trace.dimensions[currentDimensionIndex].values;\n                        for(l = 0; l < categories.length; l++) {\n                            cat = categories[l];\n                            catIndex = ax._categoriesMap[cat];\n\n                            // Collect associated values at index `l` over all other dimensions\n                            for(o = 0; o < cdi.trace.dimensions.length; o++) {\n                                if(o === currentDimensionIndex) continue;\n                                var dimension = cdi.trace.dimensions[o];\n                                categoriesValue[catIndex][1].push(dimension.values[l]);\n                            }\n                        }\n                    } else if(type === 'scattergl') {\n                        // If `scattergl`, collect all values stashed under cdi.t\n                        for(l = 0; l < cdi.t.x.length; l++) {\n                            if(axLetter === 'x') {\n                                cat = cdi.t.x[l];\n                                catIndex = cat;\n                                value = cdi.t.y[l];\n                            }\n\n                            if(axLetter === 'y') {\n                                cat = cdi.t.y[l];\n                                catIndex = cat;\n                                value = cdi.t.x[l];\n                            }\n                            categoriesValue[catIndex][1].push(value);\n                        }\n                        // must clear scene 'batches', so that 2nd\n                        // _module.calc call starts from scratch\n                        if(cdi.t && cdi.t._scene) {\n                            delete cdi.t._scene.dirty;\n                        }\n                    } else if(cdi.hasOwnProperty('z')) {\n                        // If 2dMap, collect values in `z`\n                        value = cdi.z;\n                        var mapping = zMapCategory(fullTrace.type, ax, value);\n\n                        for(l = 0; l < value.length; l++) {\n                            for(o = 0; o < value[l].length; o++) {\n                                catIndex = mapping(o, l);\n                                if(catIndex + 1) categoriesValue[catIndex][1].push(value[l][o]);\n                            }\n                        }\n                    } else {\n                        // For all other 2d cartesian traces\n                        if(axLetter === 'x') {\n                            cat = cdi.p + 1 ? cdi.p : cdi.x;\n                            value = cdi.s || cdi.v || cdi.y;\n                        } else if(axLetter === 'y') {\n                            cat = cdi.p + 1 ? cdi.p : cdi.y;\n                            value = cdi.s || cdi.v || cdi.x;\n                        }\n                        if(!Array.isArray(value)) value = [value];\n                        for(l = 0; l < value.length; l++) {\n                            categoriesValue[cat][1].push(value[l]);\n                        }\n                    }\n                }\n            }\n\n            ax._categoriesValue = categoriesValue;\n\n            var categoriesAggregatedValue = [];\n            for(j = 0; j < categoriesValue.length; j++) {\n                categoriesAggregatedValue.push([\n                    categoriesValue[j][0],\n                    aggFn[aggregator](categoriesValue[j][1])\n                ]);\n            }\n\n            // Sort by aggregated value\n            categoriesAggregatedValue.sort(function(a, b) {\n                return a[1] - b[1];\n            });\n\n            ax._categoriesAggregatedValue = categoriesAggregatedValue;\n\n            // Set new category order\n            ax._initialCategories = categoriesAggregatedValue.map(function(c) {\n                return c[0];\n            });\n\n            // Reverse if descending\n            if(order === 'descending') {\n                ax._initialCategories.reverse();\n            }\n\n            // Sort all matching axes\n            affectedTraces = affectedTraces.concat(ax.sortByInitialCategories());\n        }\n    }\n    return affectedTraces;\n}\n\nfunction setupAxisCategories(axList, fullData, fullLayout) {\n    var axLookup = {};\n    var i, ax, axId;\n\n    for(i = 0; i < axList.length; i++) {\n        ax = axList[i];\n        axId = ax._id;\n\n        ax.clearCalc();\n        if(ax.type === 'multicategory') {\n            ax.setupMultiCategory(fullData);\n        }\n\n        axLookup[ax._id] = 1;\n    }\n\n    // look into match groups for 'missing' axes\n    var matchGroups = fullLayout._axisMatchGroups || [];\n    for(i = 0; i < matchGroups.length; i++) {\n        for(axId in matchGroups[i]) {\n            if(!axLookup[axId]) {\n                ax = fullLayout[axisIDs.id2name(axId)];\n                ax.clearCalc();\n            }\n        }\n    }\n}\n\nfunction doCrossTraceCalc(gd) {\n    var fullLayout = gd._fullLayout;\n    var modules = fullLayout._visibleModules;\n    var hash = {};\n    var i, j, k;\n\n    // position and range calculations for traces that\n    // depend on each other ie bars (stacked or grouped)\n    // and boxes (grouped) push each other out of the way\n\n    for(j = 0; j < modules.length; j++) {\n        var _module = modules[j];\n        var fn = _module.crossTraceCalc;\n        if(fn) {\n            var spType = _module.basePlotModule.name;\n            if(hash[spType]) {\n                Lib.pushUnique(hash[spType], fn);\n            } else {\n                hash[spType] = [fn];\n            }\n        }\n    }\n\n    for(k in hash) {\n        var methods = hash[k];\n        var subplots = fullLayout._subplots[k];\n\n        if(Array.isArray(subplots)) {\n            for(i = 0; i < subplots.length; i++) {\n                var sp = subplots[i];\n                var spInfo = k === 'cartesian' ?\n                    fullLayout._plots[sp] :\n                    fullLayout[sp];\n\n                for(j = 0; j < methods.length; j++) {\n                    methods[j](gd, spInfo, sp);\n                }\n            }\n        } else {\n            for(j = 0; j < methods.length; j++) {\n                methods[j](gd);\n            }\n        }\n    }\n}\n\nplots.rehover = function(gd) {\n    if(gd._fullLayout._rehover) {\n        gd._fullLayout._rehover();\n    }\n};\n\nplots.redrag = function(gd) {\n    if(gd._fullLayout._redrag) {\n        gd._fullLayout._redrag();\n    }\n};\n\nplots.generalUpdatePerTraceModule = function(gd, subplot, subplotCalcData, subplotLayout) {\n    var traceHashOld = subplot.traceHash;\n    var traceHash = {};\n    var i;\n\n    // build up moduleName -> calcData hash\n    for(i = 0; i < subplotCalcData.length; i++) {\n        var calcTraces = subplotCalcData[i];\n        var trace = calcTraces[0].trace;\n\n        // skip over visible === false traces\n        // as they don't have `_module` ref\n        if(trace.visible) {\n            traceHash[trace.type] = traceHash[trace.type] || [];\n            traceHash[trace.type].push(calcTraces);\n        }\n    }\n\n    // when a trace gets deleted, make sure that its module's\n    // plot method is called so that it is properly\n    // removed from the DOM.\n    for(var moduleNameOld in traceHashOld) {\n        if(!traceHash[moduleNameOld]) {\n            var fakeCalcTrace = traceHashOld[moduleNameOld][0];\n            var fakeTrace = fakeCalcTrace[0].trace;\n\n            fakeTrace.visible = false;\n            traceHash[moduleNameOld] = [fakeCalcTrace];\n        }\n    }\n\n    // call module plot method\n    for(var moduleName in traceHash) {\n        var moduleCalcData = traceHash[moduleName];\n        var _module = moduleCalcData[0][0].trace._module;\n\n        _module.plot(gd, subplot, Lib.filterVisible(moduleCalcData), subplotLayout);\n    }\n\n    // update moduleName -> calcData hash\n    subplot.traceHash = traceHash;\n};\n\nplots.plotBasePlot = function(desiredType, gd, traces, transitionOpts, makeOnCompleteCallback) {\n    var _module = Registry.getModule(desiredType);\n    var cdmodule = getModuleCalcData(gd.calcdata, _module)[0];\n    _module.plot(gd, cdmodule, transitionOpts, makeOnCompleteCallback);\n};\n\nplots.cleanBasePlot = function(desiredType, newFullData, newFullLayout, oldFullData, oldFullLayout) {\n    var had = (oldFullLayout._has && oldFullLayout._has(desiredType));\n    var has = (newFullLayout._has && newFullLayout._has(desiredType));\n\n    if(had && !has) {\n        oldFullLayout['_' + desiredType + 'layer'].selectAll('g.trace').remove();\n    }\n};\n\n},{\"../components/color\":52,\"../constants/numerical\":158,\"../lib\":178,\"../plot_api/plot_schema\":211,\"../plot_api/plot_template\":212,\"../plots/get_data\":252,\"../registry\":269,\"./animation_attributes\":217,\"./attributes\":219,\"./cartesian/axis_ids\":225,\"./cartesian/handle_outline\":232,\"./command\":248,\"./font_attributes\":250,\"./frame_attributes\":251,\"./layout_attributes\":254,\"d3\":16,\"fast-isnumeric\":18}],257:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../../../traces/scatter/attributes');\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar extendFlat = _dereq_('../../../lib/extend').extendFlat;\n\nvar deprecationWarning = [\n    'Area traces are deprecated!',\n    'Please switch to the *barpolar* trace type.'\n].join(' ');\n\nmodule.exports = {\n    r: extendFlat({}, scatterAttrs.r, {\n        \n    }),\n    t: extendFlat({}, scatterAttrs.t, {\n        \n    }),\n    marker: {\n        color: extendFlat({}, scatterMarkerAttrs.color, {\n            \n        }),\n        size: extendFlat({}, scatterMarkerAttrs.size, {\n            \n        }),\n        symbol: extendFlat({}, scatterMarkerAttrs.symbol, {\n            \n        }),\n        opacity: extendFlat({}, scatterMarkerAttrs.opacity, {\n            \n        }),\n        editType: 'calc'\n    }\n};\n\n},{\"../../../lib/extend\":173,\"../../../traces/scatter/attributes\":389}],258:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar axesAttrs = _dereq_('../../cartesian/layout_attributes');\nvar extendFlat = _dereq_('../../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../../plot_api/edit_types').overrideAll;\n\nvar deprecationWarning = [\n    'Legacy polar charts are deprecated!',\n    'Please switch to *polar* subplots.'\n].join(' ');\n\nvar domainAttr = extendFlat({}, axesAttrs.domain, {\n    \n});\n\nfunction mergeAttrs(axisName, nonCommonAttrs) {\n    var commonAttrs = {\n        showline: {\n            valType: 'boolean',\n            \n            \n        },\n        showticklabels: {\n            valType: 'boolean',\n            \n            \n        },\n        tickorientation: {\n            valType: 'enumerated',\n            values: ['horizontal', 'vertical'],\n            \n            \n        },\n        ticklen: {\n            valType: 'number',\n            min: 0,\n            \n            \n        },\n        tickcolor: {\n            valType: 'color',\n            \n            \n        },\n        ticksuffix: {\n            valType: 'string',\n            \n            \n        },\n        endpadding: {\n            valType: 'number',\n            \n            description: deprecationWarning,\n        },\n        visible: {\n            valType: 'boolean',\n            \n            \n        }\n    };\n\n    return extendFlat({}, nonCommonAttrs, commonAttrs);\n}\n\nmodule.exports = overrideAll({\n    radialaxis: mergeAttrs('radial', {\n        range: {\n            valType: 'info_array',\n            \n            items: [\n                { valType: 'number' },\n                { valType: 'number' }\n            ],\n            \n        },\n        domain: domainAttr,\n        orientation: {\n            valType: 'number',\n            \n            \n        }\n    }),\n\n    angularaxis: mergeAttrs('angular', {\n        range: {\n            valType: 'info_array',\n            \n            items: [\n                { valType: 'number', dflt: 0 },\n                { valType: 'number', dflt: 360 }\n            ],\n            \n        },\n        domain: domainAttr\n    }),\n\n    // attributes that appear at layout root\n    layout: {\n        direction: {\n            valType: 'enumerated',\n            values: ['clockwise', 'counterclockwise'],\n            \n            \n        },\n        orientation: {\n            valType: 'angle',\n            \n            \n        }\n    }\n}, 'plot', 'nested');\n\n},{\"../../../lib/extend\":173,\"../../../plot_api/edit_types\":205,\"../../cartesian/layout_attributes\":236}],259:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Polar = module.exports = _dereq_('./micropolar');\n\nPolar.manager = _dereq_('./micropolar_manager');\n\n},{\"./micropolar\":260,\"./micropolar_manager\":261}],260:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../../lib');\nvar extendDeepAll = Lib.extendDeepAll;\nvar MID_SHIFT = _dereq_('../../../constants/alignment').MID_SHIFT;\n\nvar µ = module.exports = { version: '0.2.2' };\n\nµ.Axis = function module() {\n    var config = {\n        data: [],\n        layout: {}\n    }, inputConfig = {}, liveConfig = {};\n    var svg, container, dispatch = d3.dispatch('hover'), radialScale, angularScale;\n    var exports = {};\n    function render(_container) {\n        container = _container || container;\n        var data = config.data;\n        var axisConfig = config.layout;\n        if (typeof container == 'string' || container.nodeName) container = d3.select(container);\n        container.datum(data).each(function(_data, _index) {\n            var dataOriginal = _data.slice();\n            liveConfig = {\n                data: µ.util.cloneJson(dataOriginal),\n                layout: µ.util.cloneJson(axisConfig)\n            };\n            var colorIndex = 0;\n            dataOriginal.forEach(function(d, i) {\n                if (!d.color) {\n                    d.color = axisConfig.defaultColorRange[colorIndex];\n                    colorIndex = (colorIndex + 1) % axisConfig.defaultColorRange.length;\n                }\n                if (!d.strokeColor) {\n                    d.strokeColor = d.geometry === 'LinePlot' ? d.color : d3.rgb(d.color).darker().toString();\n                }\n                liveConfig.data[i].color = d.color;\n                liveConfig.data[i].strokeColor = d.strokeColor;\n                liveConfig.data[i].strokeDash = d.strokeDash;\n                liveConfig.data[i].strokeSize = d.strokeSize;\n            });\n            var data = dataOriginal.filter(function(d, i) {\n                var visible = d.visible;\n                return typeof visible === 'undefined' || visible === true;\n            });\n            var isStacked = false;\n            var dataWithGroupId = data.map(function(d, i) {\n                isStacked = isStacked || typeof d.groupId !== 'undefined';\n                return d;\n            });\n            if (isStacked) {\n                var grouped = d3.nest().key(function(d, i) {\n                    return typeof d.groupId != 'undefined' ? d.groupId : 'unstacked';\n                }).entries(dataWithGroupId);\n                var dataYStack = [];\n                var stacked = grouped.map(function(d, i) {\n                    if (d.key === 'unstacked') return d.values; else {\n                        var prevArray = d.values[0].r.map(function(d, i) {\n                            return 0;\n                        });\n                        d.values.forEach(function(d, i, a) {\n                            d.yStack = [ prevArray ];\n                            dataYStack.push(prevArray);\n                            prevArray = µ.util.sumArrays(d.r, prevArray);\n                        });\n                        return d.values;\n                    }\n                });\n                data = d3.merge(stacked);\n            }\n            data.forEach(function(d, i) {\n                d.t = Array.isArray(d.t[0]) ? d.t : [ d.t ];\n                d.r = Array.isArray(d.r[0]) ? d.r : [ d.r ];\n            });\n            var radius = Math.min(axisConfig.width - axisConfig.margin.left - axisConfig.margin.right, axisConfig.height - axisConfig.margin.top - axisConfig.margin.bottom) / 2;\n            radius = Math.max(10, radius);\n            var chartCenter = [ axisConfig.margin.left + radius, axisConfig.margin.top + radius ];\n            var extent;\n            if (isStacked) {\n                var highestStackedValue = d3.max(µ.util.sumArrays(µ.util.arrayLast(data).r[0], µ.util.arrayLast(dataYStack)));\n                extent = [ 0, highestStackedValue ];\n            } else extent = d3.extent(µ.util.flattenArray(data.map(function(d, i) {\n                return d.r;\n            })));\n            if (axisConfig.radialAxis.domain != µ.DATAEXTENT) extent[0] = 0;\n            radialScale = d3.scale.linear().domain(axisConfig.radialAxis.domain != µ.DATAEXTENT && axisConfig.radialAxis.domain ? axisConfig.radialAxis.domain : extent).range([ 0, radius ]);\n            liveConfig.layout.radialAxis.domain = radialScale.domain();\n            var angularDataMerged = µ.util.flattenArray(data.map(function(d, i) {\n                return d.t;\n            }));\n            var isOrdinal = typeof angularDataMerged[0] === 'string';\n            var ticks;\n            if (isOrdinal) {\n                angularDataMerged = µ.util.deduplicate(angularDataMerged);\n                ticks = angularDataMerged.slice();\n                angularDataMerged = d3.range(angularDataMerged.length);\n                data = data.map(function(d, i) {\n                    var result = d;\n                    d.t = [ angularDataMerged ];\n                    if (isStacked) result.yStack = d.yStack;\n                    return result;\n                });\n            }\n            var hasOnlyLineOrDotPlot = data.filter(function(d, i) {\n                return d.geometry === 'LinePlot' || d.geometry === 'DotPlot';\n            }).length === data.length;\n            var needsEndSpacing = axisConfig.needsEndSpacing === null ? isOrdinal || !hasOnlyLineOrDotPlot : axisConfig.needsEndSpacing;\n            var useProvidedDomain = axisConfig.angularAxis.domain && axisConfig.angularAxis.domain != µ.DATAEXTENT && !isOrdinal && axisConfig.angularAxis.domain[0] >= 0;\n            var angularDomain = useProvidedDomain ? axisConfig.angularAxis.domain : d3.extent(angularDataMerged);\n            var angularDomainStep = Math.abs(angularDataMerged[1] - angularDataMerged[0]);\n            if (hasOnlyLineOrDotPlot && !isOrdinal) angularDomainStep = 0;\n            var angularDomainWithPadding = angularDomain.slice();\n            if (needsEndSpacing && isOrdinal) angularDomainWithPadding[1] += angularDomainStep;\n            var tickCount = axisConfig.angularAxis.ticksCount || 4;\n            if (tickCount > 8) tickCount = tickCount / (tickCount / 8) + tickCount % 8;\n            if (axisConfig.angularAxis.ticksStep) {\n                tickCount = (angularDomainWithPadding[1] - angularDomainWithPadding[0]) / tickCount;\n            }\n            var angularTicksStep = axisConfig.angularAxis.ticksStep || (angularDomainWithPadding[1] - angularDomainWithPadding[0]) / (tickCount * (axisConfig.minorTicks + 1));\n            if (ticks) angularTicksStep = Math.max(Math.round(angularTicksStep), 1);\n            if (!angularDomainWithPadding[2]) angularDomainWithPadding[2] = angularTicksStep;\n            var angularAxisRange = d3.range.apply(this, angularDomainWithPadding);\n            angularAxisRange = angularAxisRange.map(function(d, i) {\n                return parseFloat(d.toPrecision(12));\n            });\n            angularScale = d3.scale.linear().domain(angularDomainWithPadding.slice(0, 2)).range(axisConfig.direction === 'clockwise' ? [ 0, 360 ] : [ 360, 0 ]);\n            liveConfig.layout.angularAxis.domain = angularScale.domain();\n            liveConfig.layout.angularAxis.endPadding = needsEndSpacing ? angularDomainStep : 0;\n            svg = d3.select(this).select('svg.chart-root');\n            if (typeof svg === 'undefined' || svg.empty()) {\n                var skeleton = \"<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>\";\n                var doc = new DOMParser().parseFromString(skeleton, 'application/xml');\n                var newSvg = this.appendChild(this.ownerDocument.importNode(doc.documentElement, true));\n                svg = d3.select(newSvg);\n            }\n            svg.select('.guides-group').style({\n                'pointer-events': 'none'\n            });\n            svg.select('.angular.axis-group').style({\n                'pointer-events': 'none'\n            });\n            svg.select('.radial.axis-group').style({\n                'pointer-events': 'none'\n            });\n            var chartGroup = svg.select('.chart-group');\n            var lineStyle = {\n                fill: 'none',\n                stroke: axisConfig.tickColor\n            };\n            var fontStyle = {\n                'font-size': axisConfig.font.size,\n                'font-family': axisConfig.font.family,\n                fill: axisConfig.font.color,\n                'text-shadow': [ '-1px 0px', '1px -1px', '-1px 1px', '1px 1px' ].map(function(d, i) {\n                    return ' ' + d + ' 0 ' + axisConfig.font.outlineColor;\n                }).join(',')\n            };\n            var legendContainer;\n            if (axisConfig.showLegend) {\n                legendContainer = svg.select('.legend-group').attr({\n                    transform: 'translate(' + [ radius, axisConfig.margin.top ] + ')'\n                }).style({\n                    display: 'block'\n                });\n                var elements = data.map(function(d, i) {\n                    var datumClone = µ.util.cloneJson(d);\n                    datumClone.symbol = d.geometry === 'DotPlot' ? d.dotType || 'circle' : d.geometry != 'LinePlot' ? 'square' : 'line';\n                    datumClone.visibleInLegend = typeof d.visibleInLegend === 'undefined' || d.visibleInLegend;\n                    datumClone.color = d.geometry === 'LinePlot' ? d.strokeColor : d.color;\n                    return datumClone;\n                });\n\n                µ.Legend().config({\n                    data: data.map(function(d, i) {\n                        return d.name || 'Element' + i;\n                    }),\n                    legendConfig: extendDeepAll({},\n                        µ.Legend.defaultConfig().legendConfig,\n                        {\n                            container: legendContainer,\n                            elements: elements,\n                            reverseOrder: axisConfig.legend.reverseOrder\n                        }\n                    )\n                })();\n\n                var legendBBox = legendContainer.node().getBBox();\n                radius = Math.min(axisConfig.width - legendBBox.width - axisConfig.margin.left - axisConfig.margin.right, axisConfig.height - axisConfig.margin.top - axisConfig.margin.bottom) / 2;\n                radius = Math.max(10, radius);\n                chartCenter = [ axisConfig.margin.left + radius, axisConfig.margin.top + radius ];\n                radialScale.range([ 0, radius ]);\n                liveConfig.layout.radialAxis.domain = radialScale.domain();\n                legendContainer.attr('transform', 'translate(' + [ chartCenter[0] + radius, chartCenter[1] - radius ] + ')');\n            } else {\n                legendContainer = svg.select('.legend-group').style({\n                    display: 'none'\n                });\n            }\n            svg.attr({\n                width: axisConfig.width,\n                height: axisConfig.height\n            }).style({\n                opacity: axisConfig.opacity\n            });\n            chartGroup.attr('transform', 'translate(' + chartCenter + ')').style({\n                cursor: 'crosshair'\n            });\n            var centeringOffset = [ (axisConfig.width - (axisConfig.margin.left + axisConfig.margin.right + radius * 2 + (legendBBox ? legendBBox.width : 0))) / 2, (axisConfig.height - (axisConfig.margin.top + axisConfig.margin.bottom + radius * 2)) / 2 ];\n            centeringOffset[0] = Math.max(0, centeringOffset[0]);\n            centeringOffset[1] = Math.max(0, centeringOffset[1]);\n            svg.select('.outer-group').attr('transform', 'translate(' + centeringOffset + ')');\n            if (axisConfig.title && axisConfig.title.text) {\n                var title = svg.select('g.title-group text').style(fontStyle).text(axisConfig.title.text);\n                var titleBBox = title.node().getBBox();\n                title.attr({\n                    x: chartCenter[0] - titleBBox.width / 2,\n                    y: chartCenter[1] - radius - 20\n                });\n            }\n            var radialAxis = svg.select('.radial.axis-group');\n            if (axisConfig.radialAxis.gridLinesVisible) {\n                var gridCircles = radialAxis.selectAll('circle.grid-circle').data(radialScale.ticks(5));\n                gridCircles.enter().append('circle').attr({\n                    'class': 'grid-circle'\n                }).style(lineStyle);\n                gridCircles.attr('r', radialScale);\n                gridCircles.exit().remove();\n            }\n            radialAxis.select('circle.outside-circle').attr({\n                r: radius\n            }).style(lineStyle);\n            var backgroundCircle = svg.select('circle.background-circle').attr({\n                r: radius\n            }).style({\n                fill: axisConfig.backgroundColor,\n                stroke: axisConfig.stroke\n            });\n            function currentAngle(d, i) {\n                return angularScale(d) % 360 + axisConfig.orientation;\n            }\n            if (axisConfig.radialAxis.visible) {\n                var axis = d3.svg.axis().scale(radialScale).ticks(5).tickSize(5);\n                radialAxis.call(axis).attr({\n                    transform: 'rotate(' + axisConfig.radialAxis.orientation + ')'\n                });\n                radialAxis.selectAll('.domain').style(lineStyle);\n                radialAxis.selectAll('g>text').text(function(d, i) {\n                    return this.textContent + axisConfig.radialAxis.ticksSuffix;\n                }).style(fontStyle).style({\n                    'text-anchor': 'start'\n                }).attr({\n                    x: 0,\n                    y: 0,\n                    dx: 0,\n                    dy: 0,\n                    transform: function(d, i) {\n                        if (axisConfig.radialAxis.tickOrientation === 'horizontal') {\n                            return 'rotate(' + -axisConfig.radialAxis.orientation + ') translate(' + [ 0, fontStyle['font-size'] ] + ')';\n                        } else return 'translate(' + [ 0, fontStyle['font-size'] ] + ')';\n                    }\n                });\n                radialAxis.selectAll('g>line').style({\n                    stroke: 'black'\n                });\n            }\n            var angularAxis = svg.select('.angular.axis-group').selectAll('g.angular-tick').data(angularAxisRange);\n            var angularAxisEnter = angularAxis.enter().append('g').classed('angular-tick', true);\n            angularAxis.attr({\n                transform: function(d, i) {\n                    return 'rotate(' + currentAngle(d, i) + ')';\n                }\n            }).style({\n                display: axisConfig.angularAxis.visible ? 'block' : 'none'\n            });\n            angularAxis.exit().remove();\n            angularAxisEnter.append('line').classed('grid-line', true).classed('major', function(d, i) {\n                return i % (axisConfig.minorTicks + 1) == 0;\n            }).classed('minor', function(d, i) {\n                return !(i % (axisConfig.minorTicks + 1) == 0);\n            }).style(lineStyle);\n            angularAxisEnter.selectAll('.minor').style({\n                stroke: axisConfig.minorTickColor\n            });\n            angularAxis.select('line.grid-line').attr({\n                x1: axisConfig.tickLength ? radius - axisConfig.tickLength : 0,\n                x2: radius\n            }).style({\n                display: axisConfig.angularAxis.gridLinesVisible ? 'block' : 'none'\n            });\n            angularAxisEnter.append('text').classed('axis-text', true).style(fontStyle);\n            var ticksText = angularAxis.select('text.axis-text').attr({\n                x: radius + axisConfig.labelOffset,\n                dy: MID_SHIFT + 'em',\n                transform: function(d, i) {\n                    var angle = currentAngle(d, i);\n                    var rad = radius + axisConfig.labelOffset;\n                    var orient = axisConfig.angularAxis.tickOrientation;\n                    if (orient == 'horizontal') return 'rotate(' + -angle + ' ' + rad + ' 0)'; else if (orient == 'radial') return angle < 270 && angle > 90 ? 'rotate(180 ' + rad + ' 0)' : null; else return 'rotate(' + (angle <= 180 && angle > 0 ? -90 : 90) + ' ' + rad + ' 0)';\n                }\n            }).style({\n                'text-anchor': 'middle',\n                display: axisConfig.angularAxis.labelsVisible ? 'block' : 'none'\n            }).text(function(d, i) {\n                if (i % (axisConfig.minorTicks + 1) != 0) return '';\n                if (ticks) {\n                    return ticks[d] + axisConfig.angularAxis.ticksSuffix;\n                } else return d + axisConfig.angularAxis.ticksSuffix;\n            }).style(fontStyle);\n            if (axisConfig.angularAxis.rewriteTicks) ticksText.text(function(d, i) {\n                if (i % (axisConfig.minorTicks + 1) != 0) return '';\n                return axisConfig.angularAxis.rewriteTicks(this.textContent, i);\n            });\n            var rightmostTickEndX = d3.max(chartGroup.selectAll('.angular-tick text')[0].map(function(d, i) {\n                return d.getCTM().e + d.getBBox().width;\n            }));\n            legendContainer.attr({\n                transform: 'translate(' + [ radius + rightmostTickEndX, axisConfig.margin.top ] + ')'\n            });\n            var hasGeometry = svg.select('g.geometry-group').selectAll('g').size() > 0;\n            var geometryContainer = svg.select('g.geometry-group').selectAll('g.geometry').data(data);\n            geometryContainer.enter().append('g').attr({\n                'class': function(d, i) {\n                    return 'geometry geometry' + i;\n                }\n            });\n            geometryContainer.exit().remove();\n            if (data[0] || hasGeometry) {\n                var geometryConfigs = [];\n                data.forEach(function(d, i) {\n                    var geometryConfig = {};\n                    geometryConfig.radialScale = radialScale;\n                    geometryConfig.angularScale = angularScale;\n                    geometryConfig.container = geometryContainer.filter(function(dB, iB) {\n                        return iB == i;\n                    });\n                    geometryConfig.geometry = d.geometry;\n                    geometryConfig.orientation = axisConfig.orientation;\n                    geometryConfig.direction = axisConfig.direction;\n                    geometryConfig.index = i;\n                    geometryConfigs.push({\n                        data: d,\n                        geometryConfig: geometryConfig\n                    });\n                });\n                var geometryConfigsGrouped = d3.nest().key(function(d, i) {\n                    return typeof d.data.groupId != 'undefined' || 'unstacked';\n                }).entries(geometryConfigs);\n                var geometryConfigsGrouped2 = [];\n                geometryConfigsGrouped.forEach(function(d, i) {\n                    if (d.key === 'unstacked') geometryConfigsGrouped2 = geometryConfigsGrouped2.concat(d.values.map(function(d, i) {\n                        return [ d ];\n                    })); else geometryConfigsGrouped2.push(d.values);\n                });\n                geometryConfigsGrouped2.forEach(function(d, i) {\n                    var geometry;\n                    if (Array.isArray(d)) geometry = d[0].geometryConfig.geometry; else geometry = d.geometryConfig.geometry;\n                    var finalGeometryConfig = d.map(function(dB, iB) {\n                        return extendDeepAll(µ[geometry].defaultConfig(), dB);\n                    });\n                    µ[geometry]().config(finalGeometryConfig)();\n                });\n            }\n            var guides = svg.select('.guides-group');\n            var tooltipContainer = svg.select('.tooltips-group');\n            var angularTooltip = µ.tooltipPanel().config({\n                container: tooltipContainer,\n                fontSize: 8\n            })();\n            var radialTooltip = µ.tooltipPanel().config({\n                container: tooltipContainer,\n                fontSize: 8\n            })();\n            var geometryTooltip = µ.tooltipPanel().config({\n                container: tooltipContainer,\n                hasTick: true\n            })();\n            var angularValue, radialValue;\n            if (!isOrdinal) {\n                var angularGuideLine = guides.select('line').attr({\n                    x1: 0,\n                    y1: 0,\n                    y2: 0\n                }).style({\n                    stroke: 'grey',\n                    'pointer-events': 'none'\n                });\n                chartGroup.on('mousemove.angular-guide', function(d, i) {\n                    var mouseAngle = µ.util.getMousePos(backgroundCircle).angle;\n                    angularGuideLine.attr({\n                        x2: -radius,\n                        transform: 'rotate(' + mouseAngle + ')'\n                    }).style({\n                        opacity: .5\n                    });\n                    var angleWithOriginOffset = (mouseAngle + 180 + 360 - axisConfig.orientation) % 360;\n                    angularValue = angularScale.invert(angleWithOriginOffset);\n                    var pos = µ.util.convertToCartesian(radius + 12, mouseAngle + 180);\n                    angularTooltip.text(µ.util.round(angularValue)).move([ pos[0] + chartCenter[0], pos[1] + chartCenter[1] ]);\n                }).on('mouseout.angular-guide', function(d, i) {\n                    guides.select('line').style({\n                        opacity: 0\n                    });\n                });\n            }\n            var angularGuideCircle = guides.select('circle').style({\n                stroke: 'grey',\n                fill: 'none'\n            });\n            chartGroup.on('mousemove.radial-guide', function(d, i) {\n                var r = µ.util.getMousePos(backgroundCircle).radius;\n                angularGuideCircle.attr({\n                    r: r\n                }).style({\n                    opacity: .5\n                });\n                radialValue = radialScale.invert(µ.util.getMousePos(backgroundCircle).radius);\n                var pos = µ.util.convertToCartesian(r, axisConfig.radialAxis.orientation);\n                radialTooltip.text(µ.util.round(radialValue)).move([ pos[0] + chartCenter[0], pos[1] + chartCenter[1] ]);\n            }).on('mouseout.radial-guide', function(d, i) {\n                angularGuideCircle.style({\n                    opacity: 0\n                });\n                geometryTooltip.hide();\n                angularTooltip.hide();\n                radialTooltip.hide();\n            });\n            svg.selectAll('.geometry-group .mark').on('mouseover.tooltip', function(d, i) {\n                var el = d3.select(this);\n                var color = this.style.fill;\n                var newColor = 'black';\n                var opacity = this.style.opacity || 1;\n                el.attr({\n                    'data-opacity': opacity\n                });\n                if (color && color !== 'none') {\n                    el.attr({\n                        'data-fill': color\n                    });\n                    newColor = d3.hsl(color).darker().toString();\n                    el.style({\n                        fill: newColor,\n                        opacity: 1\n                    });\n                    var textData = {\n                        t: µ.util.round(d[0]),\n                        r: µ.util.round(d[1])\n                    };\n                    if (isOrdinal) textData.t = ticks[d[0]];\n                    var text = 't: ' + textData.t + ', r: ' + textData.r;\n                    var bbox = this.getBoundingClientRect();\n                    var svgBBox = svg.node().getBoundingClientRect();\n                    var pos = [ bbox.left + bbox.width / 2 - centeringOffset[0] - svgBBox.left, bbox.top + bbox.height / 2 - centeringOffset[1] - svgBBox.top ];\n                    geometryTooltip.config({\n                        color: newColor\n                    }).text(text);\n                    geometryTooltip.move(pos);\n                } else {\n                    color = this.style.stroke || 'black';\n                    el.attr({\n                        'data-stroke': color\n                    });\n                    newColor = d3.hsl(color).darker().toString();\n                    el.style({\n                        stroke: newColor,\n                        opacity: 1\n                    });\n                }\n            }).on('mousemove.tooltip', function(d, i) {\n                if (d3.event.which != 0) return false;\n                if (d3.select(this).attr('data-fill')) geometryTooltip.show();\n            }).on('mouseout.tooltip', function(d, i) {\n                geometryTooltip.hide();\n                var el = d3.select(this);\n                var fillColor = el.attr('data-fill');\n                if (fillColor) el.style({\n                    fill: fillColor,\n                    opacity: el.attr('data-opacity')\n                }); else el.style({\n                    stroke: el.attr('data-stroke'),\n                    opacity: el.attr('data-opacity')\n                });\n            });\n        });\n        return exports;\n    }\n    exports.render = function(_container) {\n        render(_container);\n        return this;\n    };\n    exports.config = function(_x) {\n        if (!arguments.length) return config;\n        var xClone = µ.util.cloneJson(_x);\n        xClone.data.forEach(function(d, i) {\n            if (!config.data[i]) config.data[i] = {};\n            extendDeepAll(config.data[i], µ.Axis.defaultConfig().data[0]);\n            extendDeepAll(config.data[i], d);\n        });\n        extendDeepAll(config.layout, µ.Axis.defaultConfig().layout);\n        extendDeepAll(config.layout, xClone.layout);\n        return this;\n    };\n    exports.getLiveConfig = function() {\n        return liveConfig;\n    };\n    exports.getinputConfig = function() {\n        return inputConfig;\n    };\n    exports.radialScale = function(_x) {\n        return radialScale;\n    };\n    exports.angularScale = function(_x) {\n        return angularScale;\n    };\n    exports.svg = function() {\n        return svg;\n    };\n    d3.rebind(exports, dispatch, 'on');\n    return exports;\n};\n\nµ.Axis.defaultConfig = function(d, i) {\n    var config = {\n        data: [ {\n            t: [ 1, 2, 3, 4 ],\n            r: [ 10, 11, 12, 13 ],\n            name: 'Line1',\n            geometry: 'LinePlot',\n            color: null,\n            strokeDash: 'solid',\n            strokeColor: null,\n            strokeSize: '1',\n            visibleInLegend: true,\n            opacity: 1\n        } ],\n        layout: {\n            defaultColorRange: d3.scale.category10().range(),\n            title: null,\n            height: 450,\n            width: 500,\n            margin: {\n                top: 40,\n                right: 40,\n                bottom: 40,\n                left: 40\n            },\n            font: {\n                size: 12,\n                color: 'gray',\n                outlineColor: 'white',\n                family: 'Tahoma, sans-serif'\n            },\n            direction: 'clockwise',\n            orientation: 0,\n            labelOffset: 10,\n            radialAxis: {\n                domain: null,\n                orientation: -45,\n                ticksSuffix: '',\n                visible: true,\n                gridLinesVisible: true,\n                tickOrientation: 'horizontal',\n                rewriteTicks: null\n            },\n            angularAxis: {\n                domain: [ 0, 360 ],\n                ticksSuffix: '',\n                visible: true,\n                gridLinesVisible: true,\n                labelsVisible: true,\n                tickOrientation: 'horizontal',\n                rewriteTicks: null,\n                ticksCount: null,\n                ticksStep: null\n            },\n            minorTicks: 0,\n            tickLength: null,\n            tickColor: 'silver',\n            minorTickColor: '#eee',\n            backgroundColor: 'none',\n            needsEndSpacing: null,\n            showLegend: true,\n            legend: {\n                reverseOrder: false\n            },\n            opacity: 1\n        }\n    };\n    return config;\n};\n\nµ.util = {};\n\nµ.DATAEXTENT = 'dataExtent';\n\nµ.AREA = 'AreaChart';\n\nµ.LINE = 'LinePlot';\n\nµ.DOT = 'DotPlot';\n\nµ.BAR = 'BarChart';\n\nµ.util._override = function(_objA, _objB) {\n    for (var x in _objA) if (x in _objB) _objB[x] = _objA[x];\n};\n\nµ.util._extend = function(_objA, _objB) {\n    for (var x in _objA) _objB[x] = _objA[x];\n};\n\nµ.util._rndSnd = function() {\n    return Math.random() * 2 - 1 + (Math.random() * 2 - 1) + (Math.random() * 2 - 1);\n};\n\nµ.util.dataFromEquation2 = function(_equation, _step) {\n    var step = _step || 6;\n    var data = d3.range(0, 360 + step, step).map(function(deg, index) {\n        var theta = deg * Math.PI / 180;\n        var radius = _equation(theta);\n        return [ deg, radius ];\n    });\n    return data;\n};\n\nµ.util.dataFromEquation = function(_equation, _step, _name) {\n    var step = _step || 6;\n    var t = [], r = [];\n    d3.range(0, 360 + step, step).forEach(function(deg, index) {\n        var theta = deg * Math.PI / 180;\n        var radius = _equation(theta);\n        t.push(deg);\n        r.push(radius);\n    });\n    var result = {\n        t: t,\n        r: r\n    };\n    if (_name) result.name = _name;\n    return result;\n};\n\nµ.util.ensureArray = function(_val, _count) {\n    if (typeof _val === 'undefined') return null;\n    var arr = [].concat(_val);\n    return d3.range(_count).map(function(d, i) {\n        return arr[i] || arr[0];\n    });\n};\n\nµ.util.fillArrays = function(_obj, _valueNames, _count) {\n    _valueNames.forEach(function(d, i) {\n        _obj[d] = µ.util.ensureArray(_obj[d], _count);\n    });\n    return _obj;\n};\n\nµ.util.cloneJson = function(json) {\n    return JSON.parse(JSON.stringify(json));\n};\n\nµ.util.validateKeys = function(obj, keys) {\n    if (typeof keys === 'string') keys = keys.split('.');\n    var next = keys.shift();\n    return obj[next] && (!keys.length || objHasKeys(obj[next], keys));\n};\n\nµ.util.sumArrays = function(a, b) {\n    return d3.zip(a, b).map(function(d, i) {\n        return d3.sum(d);\n    });\n};\n\nµ.util.arrayLast = function(a) {\n    return a[a.length - 1];\n};\n\nµ.util.arrayEqual = function(a, b) {\n    var i = Math.max(a.length, b.length, 1);\n    while (i-- >= 0 && a[i] === b[i]) ;\n    return i === -2;\n};\n\nµ.util.flattenArray = function(arr) {\n    var r = [];\n    while (!µ.util.arrayEqual(r, arr)) {\n        r = arr;\n        arr = [].concat.apply([], arr);\n    }\n    return arr;\n};\n\nµ.util.deduplicate = function(arr) {\n    return arr.filter(function(v, i, a) {\n        return a.indexOf(v) == i;\n    });\n};\n\nµ.util.convertToCartesian = function(radius, theta) {\n    var thetaRadians = theta * Math.PI / 180;\n    var x = radius * Math.cos(thetaRadians);\n    var y = radius * Math.sin(thetaRadians);\n    return [ x, y ];\n};\n\nµ.util.round = function(_value, _digits) {\n    var digits = _digits || 2;\n    var mult = Math.pow(10, digits);\n    return Math.round(_value * mult) / mult;\n};\n\nµ.util.getMousePos = function(_referenceElement) {\n    var mousePos = d3.mouse(_referenceElement.node());\n    var mouseX = mousePos[0];\n    var mouseY = mousePos[1];\n    var mouse = {};\n    mouse.x = mouseX;\n    mouse.y = mouseY;\n    mouse.pos = mousePos;\n    mouse.angle = (Math.atan2(mouseY, mouseX) + Math.PI) * 180 / Math.PI;\n    mouse.radius = Math.sqrt(mouseX * mouseX + mouseY * mouseY);\n    return mouse;\n};\n\nµ.util.duplicatesCount = function(arr) {\n    var uniques = {}, val;\n    var dups = {};\n    for (var i = 0, len = arr.length; i < len; i++) {\n        val = arr[i];\n        if (val in uniques) {\n            uniques[val]++;\n            dups[val] = uniques[val];\n        } else {\n            uniques[val] = 1;\n        }\n    }\n    return dups;\n};\n\nµ.util.duplicates = function(arr) {\n    return Object.keys(µ.util.duplicatesCount(arr));\n};\n\nµ.util.translator = function(obj, sourceBranch, targetBranch, reverse) {\n    if (reverse) {\n        var targetBranchCopy = targetBranch.slice();\n        targetBranch = sourceBranch;\n        sourceBranch = targetBranchCopy;\n    }\n    var value = sourceBranch.reduce(function(previousValue, currentValue) {\n        if (typeof previousValue != 'undefined') return previousValue[currentValue];\n    }, obj);\n    if (typeof value === 'undefined') return;\n    sourceBranch.reduce(function(previousValue, currentValue, index) {\n        if (typeof previousValue == 'undefined') return;\n        if (index === sourceBranch.length - 1) delete previousValue[currentValue];\n        return previousValue[currentValue];\n    }, obj);\n    targetBranch.reduce(function(previousValue, currentValue, index) {\n        if (typeof previousValue[currentValue] === 'undefined') previousValue[currentValue] = {};\n        if (index === targetBranch.length - 1) previousValue[currentValue] = value;\n        return previousValue[currentValue];\n    }, obj);\n};\n\nµ.PolyChart = function module() {\n    var config = [ µ.PolyChart.defaultConfig() ];\n    var dispatch = d3.dispatch('hover');\n    var dashArray = {\n        solid: 'none',\n        dash: [ 5, 2 ],\n        dot: [ 2, 5 ]\n    };\n    var colorScale;\n    function exports() {\n        var geometryConfig = config[0].geometryConfig;\n        var container = geometryConfig.container;\n        if (typeof container == 'string') container = d3.select(container);\n        container.datum(config).each(function(_config, _index) {\n            var isStack = !!_config[0].data.yStack;\n            var data = _config.map(function(d, i) {\n                if (isStack) return d3.zip(d.data.t[0], d.data.r[0], d.data.yStack[0]); else return d3.zip(d.data.t[0], d.data.r[0]);\n            });\n            var angularScale = geometryConfig.angularScale;\n            var domainMin = geometryConfig.radialScale.domain()[0];\n            var generator = {};\n            generator.bar = function(d, i, pI) {\n                var dataConfig = _config[pI].data;\n                var h = geometryConfig.radialScale(d[1]) - geometryConfig.radialScale(0);\n                var stackTop = geometryConfig.radialScale(d[2] || 0);\n                var w = dataConfig.barWidth;\n                d3.select(this).attr({\n                    'class': 'mark bar',\n                    d: 'M' + [ [ h + stackTop, -w / 2 ], [ h + stackTop, w / 2 ], [ stackTop, w / 2 ], [ stackTop, -w / 2 ] ].join('L') + 'Z',\n                    transform: function(d, i) {\n                        return 'rotate(' + (geometryConfig.orientation + angularScale(d[0])) + ')';\n                    }\n                });\n            };\n            generator.dot = function(d, i, pI) {\n                var stackedData = d[2] ? [ d[0], d[1] + d[2] ] : d;\n                var symbol = d3.svg.symbol().size(_config[pI].data.dotSize).type(_config[pI].data.dotType)(d, i);\n                d3.select(this).attr({\n                    'class': 'mark dot',\n                    d: symbol,\n                    transform: function(d, i) {\n                        var coord = convertToCartesian(getPolarCoordinates(stackedData));\n                        return 'translate(' + [ coord.x, coord.y ] + ')';\n                    }\n                });\n            };\n            var line = d3.svg.line.radial().interpolate(_config[0].data.lineInterpolation).radius(function(d) {\n                return geometryConfig.radialScale(d[1]);\n            }).angle(function(d) {\n                return geometryConfig.angularScale(d[0]) * Math.PI / 180;\n            });\n            generator.line = function(d, i, pI) {\n                var lineData = d[2] ? data[pI].map(function(d, i) {\n                    return [ d[0], d[1] + d[2] ];\n                }) : data[pI];\n                d3.select(this).each(generator['dot']).style({\n                    opacity: function(dB, iB) {\n                        return +_config[pI].data.dotVisible;\n                    },\n                    fill: markStyle.stroke(d, i, pI)\n                }).attr({\n                    'class': 'mark dot'\n                });\n                if (i > 0) return;\n                var lineSelection = d3.select(this.parentNode).selectAll('path.line').data([ 0 ]);\n                lineSelection.enter().insert('path');\n                lineSelection.attr({\n                    'class': 'line',\n                    d: line(lineData),\n                    transform: function(dB, iB) {\n                        return 'rotate(' + (geometryConfig.orientation + 90) + ')';\n                    },\n                    'pointer-events': 'none'\n                }).style({\n                    fill: function(dB, iB) {\n                        return markStyle.fill(d, i, pI);\n                    },\n                    'fill-opacity': 0,\n                    stroke: function(dB, iB) {\n                        return markStyle.stroke(d, i, pI);\n                    },\n                    'stroke-width': function(dB, iB) {\n                        return markStyle['stroke-width'](d, i, pI);\n                    },\n                    'stroke-dasharray': function(dB, iB) {\n                        return markStyle['stroke-dasharray'](d, i, pI);\n                    },\n                    opacity: function(dB, iB) {\n                        return markStyle.opacity(d, i, pI);\n                    },\n                    display: function(dB, iB) {\n                        return markStyle.display(d, i, pI);\n                    }\n                });\n            };\n            var angularRange = geometryConfig.angularScale.range();\n            var triangleAngle = Math.abs(angularRange[1] - angularRange[0]) / data[0].length * Math.PI / 180;\n            var arc = d3.svg.arc().startAngle(function(d) {\n                return -triangleAngle / 2;\n            }).endAngle(function(d) {\n                return triangleAngle / 2;\n            }).innerRadius(function(d) {\n                return geometryConfig.radialScale(domainMin + (d[2] || 0));\n            }).outerRadius(function(d) {\n                return geometryConfig.radialScale(domainMin + (d[2] || 0)) + geometryConfig.radialScale(d[1]);\n            });\n            generator.arc = function(d, i, pI) {\n                d3.select(this).attr({\n                    'class': 'mark arc',\n                    d: arc,\n                    transform: function(d, i) {\n                        return 'rotate(' + (geometryConfig.orientation + angularScale(d[0]) + 90) + ')';\n                    }\n                });\n            };\n            var markStyle = {\n                fill: function(d, i, pI) {\n                    return _config[pI].data.color;\n                },\n                stroke: function(d, i, pI) {\n                    return _config[pI].data.strokeColor;\n                },\n                'stroke-width': function(d, i, pI) {\n                    return _config[pI].data.strokeSize + 'px';\n                },\n                'stroke-dasharray': function(d, i, pI) {\n                    return dashArray[_config[pI].data.strokeDash];\n                },\n                opacity: function(d, i, pI) {\n                    return _config[pI].data.opacity;\n                },\n                display: function(d, i, pI) {\n                    return typeof _config[pI].data.visible === 'undefined' || _config[pI].data.visible ? 'block' : 'none';\n                }\n            };\n            var geometryLayer = d3.select(this).selectAll('g.layer').data(data);\n            geometryLayer.enter().append('g').attr({\n                'class': 'layer'\n            });\n            var geometry = geometryLayer.selectAll('path.mark').data(function(d, i) {\n                return d;\n            });\n            geometry.enter().append('path').attr({\n                'class': 'mark'\n            });\n            geometry.style(markStyle).each(generator[geometryConfig.geometryType]);\n            geometry.exit().remove();\n            geometryLayer.exit().remove();\n            function getPolarCoordinates(d, i) {\n                var r = geometryConfig.radialScale(d[1]);\n                var t = (geometryConfig.angularScale(d[0]) + geometryConfig.orientation) * Math.PI / 180;\n                return {\n                    r: r,\n                    t: t\n                };\n            }\n            function convertToCartesian(polarCoordinates) {\n                var x = polarCoordinates.r * Math.cos(polarCoordinates.t);\n                var y = polarCoordinates.r * Math.sin(polarCoordinates.t);\n                return {\n                    x: x,\n                    y: y\n                };\n            }\n        });\n    }\n    exports.config = function(_x) {\n        if (!arguments.length) return config;\n        _x.forEach(function(d, i) {\n            if (!config[i]) config[i] = {};\n            extendDeepAll(config[i], µ.PolyChart.defaultConfig());\n            extendDeepAll(config[i], d);\n        });\n        return this;\n    };\n    exports.getColorScale = function() {\n        return colorScale;\n    };\n    d3.rebind(exports, dispatch, 'on');\n    return exports;\n};\n\nµ.PolyChart.defaultConfig = function() {\n    var config = {\n        data: {\n            name: 'geom1',\n            t: [ [ 1, 2, 3, 4 ] ],\n            r: [ [ 1, 2, 3, 4 ] ],\n            dotType: 'circle',\n            dotSize: 64,\n            dotVisible: false,\n            barWidth: 20,\n            color: '#ffa500',\n            strokeSize: 1,\n            strokeColor: 'silver',\n            strokeDash: 'solid',\n            opacity: 1,\n            index: 0,\n            visible: true,\n            visibleInLegend: true\n        },\n        geometryConfig: {\n            geometry: 'LinePlot',\n            geometryType: 'arc',\n            direction: 'clockwise',\n            orientation: 0,\n            container: 'body',\n            radialScale: null,\n            angularScale: null,\n            colorScale: d3.scale.category20()\n        }\n    };\n    return config;\n};\n\nµ.BarChart = function module() {\n    return µ.PolyChart();\n};\n\nµ.BarChart.defaultConfig = function() {\n    var config = {\n        geometryConfig: {\n            geometryType: 'bar'\n        }\n    };\n    return config;\n};\n\nµ.AreaChart = function module() {\n    return µ.PolyChart();\n};\n\nµ.AreaChart.defaultConfig = function() {\n    var config = {\n        geometryConfig: {\n            geometryType: 'arc'\n        }\n    };\n    return config;\n};\n\nµ.DotPlot = function module() {\n    return µ.PolyChart();\n};\n\nµ.DotPlot.defaultConfig = function() {\n    var config = {\n        geometryConfig: {\n            geometryType: 'dot',\n            dotType: 'circle'\n        }\n    };\n    return config;\n};\n\nµ.LinePlot = function module() {\n    return µ.PolyChart();\n};\n\nµ.LinePlot.defaultConfig = function() {\n    var config = {\n        geometryConfig: {\n            geometryType: 'line'\n        }\n    };\n    return config;\n};\n\nµ.Legend = function module() {\n    var config = µ.Legend.defaultConfig();\n    var dispatch = d3.dispatch('hover');\n    function exports() {\n        var legendConfig = config.legendConfig;\n        var flattenData = config.data.map(function(d, i) {\n            return [].concat(d).map(function(dB, iB) {\n                var element = extendDeepAll({}, legendConfig.elements[i]);\n                element.name = dB;\n                element.color = [].concat(legendConfig.elements[i].color)[iB];\n                return element;\n            });\n        });\n        var data = d3.merge(flattenData);\n        data = data.filter(function(d, i) {\n            return legendConfig.elements[i] && (legendConfig.elements[i].visibleInLegend || typeof legendConfig.elements[i].visibleInLegend === 'undefined');\n        });\n        if (legendConfig.reverseOrder) data = data.reverse();\n        var container = legendConfig.container;\n        if (typeof container == 'string' || container.nodeName) container = d3.select(container);\n        var colors = data.map(function(d, i) {\n            return d.color;\n        });\n        var lineHeight = legendConfig.fontSize;\n        var isContinuous = legendConfig.isContinuous == null ? typeof data[0] === 'number' : legendConfig.isContinuous;\n        var height = isContinuous ? legendConfig.height : lineHeight * data.length;\n        var legendContainerGroup = container.classed('legend-group', true);\n        var svg = legendContainerGroup.selectAll('svg').data([ 0 ]);\n        var svgEnter = svg.enter().append('svg').attr({\n            width: 300,\n            height: height + lineHeight,\n            xmlns: 'http://www.w3.org/2000/svg',\n            'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n            version: '1.1'\n        });\n        svgEnter.append('g').classed('legend-axis', true);\n        svgEnter.append('g').classed('legend-marks', true);\n        var dataNumbered = d3.range(data.length);\n        var colorScale = d3.scale[isContinuous ? 'linear' : 'ordinal']().domain(dataNumbered).range(colors);\n        var dataScale = d3.scale[isContinuous ? 'linear' : 'ordinal']().domain(dataNumbered)[isContinuous ? 'range' : 'rangePoints']([ 0, height ]);\n        var shapeGenerator = function(_type, _size) {\n            var squareSize = _size * 3;\n            if (_type === 'line') {\n                return 'M' + [ [ -_size / 2, -_size / 12 ], [ _size / 2, -_size / 12 ], [ _size / 2, _size / 12 ], [ -_size / 2, _size / 12 ] ] + 'Z';\n            } else if (d3.svg.symbolTypes.indexOf(_type) != -1) return d3.svg.symbol().type(_type).size(squareSize)(); else return d3.svg.symbol().type('square').size(squareSize)();\n        };\n        if (isContinuous) {\n            var gradient = svg.select('.legend-marks').append('defs').append('linearGradient').attr({\n                id: 'grad1',\n                x1: '0%',\n                y1: '0%',\n                x2: '0%',\n                y2: '100%'\n            }).selectAll('stop').data(colors);\n            gradient.enter().append('stop');\n            gradient.attr({\n                offset: function(d, i) {\n                    return i / (colors.length - 1) * 100 + '%';\n                }\n            }).style({\n                'stop-color': function(d, i) {\n                    return d;\n                }\n            });\n            svg.append('rect').classed('legend-mark', true).attr({\n                height: legendConfig.height,\n                width: legendConfig.colorBandWidth,\n                fill: 'url(#grad1)'\n            });\n        } else {\n            var legendElement = svg.select('.legend-marks').selectAll('path.legend-mark').data(data);\n            legendElement.enter().append('path').classed('legend-mark', true);\n            legendElement.attr({\n                transform: function(d, i) {\n                    return 'translate(' + [ lineHeight / 2, dataScale(i) + lineHeight / 2 ] + ')';\n                },\n                d: function(d, i) {\n                    var symbolType = d.symbol;\n                    return shapeGenerator(symbolType, lineHeight);\n                },\n                fill: function(d, i) {\n                    return colorScale(i);\n                }\n            });\n            legendElement.exit().remove();\n        }\n        var legendAxis = d3.svg.axis().scale(dataScale).orient('right');\n        var axis = svg.select('g.legend-axis').attr({\n            transform: 'translate(' + [ isContinuous ? legendConfig.colorBandWidth : lineHeight, lineHeight / 2 ] + ')'\n        }).call(legendAxis);\n        axis.selectAll('.domain').style({\n            fill: 'none',\n            stroke: 'none'\n        });\n        axis.selectAll('line').style({\n            fill: 'none',\n            stroke: isContinuous ? legendConfig.textColor : 'none'\n        });\n        axis.selectAll('text').style({\n            fill: legendConfig.textColor,\n            'font-size': legendConfig.fontSize\n        }).text(function(d, i) {\n            return data[i].name;\n        });\n        return exports;\n    }\n    exports.config = function(_x) {\n        if (!arguments.length) return config;\n        extendDeepAll(config, _x);\n        return this;\n    };\n    d3.rebind(exports, dispatch, 'on');\n    return exports;\n};\n\nµ.Legend.defaultConfig = function(d, i) {\n    var config = {\n        data: [ 'a', 'b', 'c' ],\n        legendConfig: {\n            elements: [ {\n                symbol: 'line',\n                color: 'red'\n            }, {\n                symbol: 'square',\n                color: 'yellow'\n            }, {\n                symbol: 'diamond',\n                color: 'limegreen'\n            } ],\n            height: 150,\n            colorBandWidth: 30,\n            fontSize: 12,\n            container: 'body',\n            isContinuous: null,\n            textColor: 'grey',\n            reverseOrder: false\n        }\n    };\n    return config;\n};\n\nµ.tooltipPanel = function() {\n    var tooltipEl, tooltipTextEl, backgroundEl;\n    var config = {\n        container: null,\n        hasTick: false,\n        fontSize: 12,\n        color: 'white',\n        padding: 5\n    };\n    var id = 'tooltip-' + µ.tooltipPanel.uid++;\n    var tickSize = 10;\n    var exports = function() {\n        tooltipEl = config.container.selectAll('g.' + id).data([ 0 ]);\n        var tooltipEnter = tooltipEl.enter().append('g').classed(id, true).style({\n            'pointer-events': 'none',\n            display: 'none'\n        });\n        backgroundEl = tooltipEnter.append('path').style({\n            fill: 'white',\n            'fill-opacity': .9\n        }).attr({\n            d: 'M0 0'\n        });\n        tooltipTextEl = tooltipEnter.append('text').attr({\n            dx: config.padding + tickSize,\n            dy: +config.fontSize * .3\n        });\n        return exports;\n    };\n    exports.text = function(_text) {\n        var l = d3.hsl(config.color).l;\n        var strokeColor = l >= .5 ? '#aaa' : 'white';\n        var fillColor = l >= .5 ? 'black' : 'white';\n        var text = _text || '';\n        tooltipTextEl.style({\n            fill: fillColor,\n            'font-size': config.fontSize + 'px'\n        }).text(text);\n        var padding = config.padding;\n        var bbox = tooltipTextEl.node().getBBox();\n        var boxStyle = {\n            fill: config.color,\n            stroke: strokeColor,\n            'stroke-width': '2px'\n        };\n        var backGroundW = bbox.width + padding * 2 + tickSize;\n        var backGroundH = bbox.height + padding * 2;\n        backgroundEl.attr({\n            d: 'M' + [ [ tickSize, -backGroundH / 2 ], [ tickSize, -backGroundH / 4 ], [ config.hasTick ? 0 : tickSize, 0 ], [ tickSize, backGroundH / 4 ], [ tickSize, backGroundH / 2 ], [ backGroundW, backGroundH / 2 ], [ backGroundW, -backGroundH / 2 ] ].join('L') + 'Z'\n        }).style(boxStyle);\n        tooltipEl.attr({\n            transform: 'translate(' + [ tickSize, -backGroundH / 2 + padding * 2 ] + ')'\n        });\n        tooltipEl.style({\n            display: 'block'\n        });\n        return exports;\n    };\n    exports.move = function(_pos) {\n        if (!tooltipEl) return;\n        tooltipEl.attr({\n            transform: 'translate(' + [ _pos[0], _pos[1] ] + ')'\n        }).style({\n            display: 'block'\n        });\n        return exports;\n    };\n    exports.hide = function() {\n        if (!tooltipEl) return;\n        tooltipEl.style({\n            display: 'none'\n        });\n        return exports;\n    };\n    exports.show = function() {\n        if (!tooltipEl) return;\n        tooltipEl.style({\n            display: 'block'\n        });\n        return exports;\n    };\n    exports.config = function(_x) {\n        extendDeepAll(config, _x);\n        return exports;\n    };\n    return exports;\n};\n\nµ.tooltipPanel.uid = 1;\n\nµ.adapter = {};\n\nµ.adapter.plotly = function module() {\n    var exports = {};\n    exports.convert = function(_inputConfig, reverse) {\n        var outputConfig = {};\n        if (_inputConfig.data) {\n            outputConfig.data = _inputConfig.data.map(function(d, i) {\n                var r = extendDeepAll({}, d);\n                var toTranslate = [\n                    [ r, [ 'marker', 'color' ], [ 'color' ] ],\n                    [ r, [ 'marker', 'opacity' ], [ 'opacity' ] ],\n                    [ r, [ 'marker', 'line', 'color' ], [ 'strokeColor' ] ],\n                    [ r, [ 'marker', 'line', 'dash' ], [ 'strokeDash' ] ],\n                    [ r, [ 'marker', 'line', 'width' ], [ 'strokeSize' ] ],\n                    [ r, [ 'marker', 'symbol' ], [ 'dotType' ] ],\n                    [ r, [ 'marker', 'size' ], [ 'dotSize' ] ],\n                    [ r, [ 'marker', 'barWidth' ], [ 'barWidth' ] ],\n                    [ r, [ 'line', 'interpolation' ], [ 'lineInterpolation' ] ],\n                    [ r, [ 'showlegend' ], [ 'visibleInLegend' ] ]\n                ];\n                toTranslate.forEach(function(d, i) {\n                    µ.util.translator.apply(null, d.concat(reverse));\n                });\n\n                if (!reverse) delete r.marker;\n                if (reverse) delete r.groupId;\n                if (!reverse) {\n                    if (r.type === 'scatter') {\n                        if (r.mode === 'lines') r.geometry = 'LinePlot'; else if (r.mode === 'markers') r.geometry = 'DotPlot'; else if (r.mode === 'lines+markers') {\n                            r.geometry = 'LinePlot';\n                            r.dotVisible = true;\n                        }\n                    } else if (r.type === 'area') r.geometry = 'AreaChart'; else if (r.type === 'bar') r.geometry = 'BarChart';\n                    delete r.mode;\n                    delete r.type;\n                } else {\n                    if (r.geometry === 'LinePlot') {\n                        r.type = 'scatter';\n                        if (r.dotVisible === true) {\n                            delete r.dotVisible;\n                            r.mode = 'lines+markers';\n                        } else r.mode = 'lines';\n                    } else if (r.geometry === 'DotPlot') {\n                        r.type = 'scatter';\n                        r.mode = 'markers';\n                    } else if (r.geometry === 'AreaChart') r.type = 'area'; else if (r.geometry === 'BarChart') r.type = 'bar';\n                    delete r.geometry;\n                }\n                return r;\n            });\n            if (!reverse && _inputConfig.layout && _inputConfig.layout.barmode === 'stack') {\n                var duplicates = µ.util.duplicates(outputConfig.data.map(function(d, i) {\n                    return d.geometry;\n                }));\n                outputConfig.data.forEach(function(d, i) {\n                    var idx = duplicates.indexOf(d.geometry);\n                    if (idx != -1) outputConfig.data[i].groupId = idx;\n                });\n            }\n        }\n        if (_inputConfig.layout) {\n            var r = extendDeepAll({}, _inputConfig.layout);\n            var toTranslate = [\n                [ r, [ 'plot_bgcolor' ], [ 'backgroundColor' ] ],\n                [ r, [ 'showlegend' ], [ 'showLegend' ] ],\n                [ r, [ 'radialaxis' ], [ 'radialAxis' ] ],\n                [ r, [ 'angularaxis' ], [ 'angularAxis' ] ],\n                [ r.angularaxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n                [ r.angularaxis, [ 'showticklabels' ], [ 'labelsVisible' ] ],\n                [ r.angularaxis, [ 'nticks' ], [ 'ticksCount' ] ],\n                [ r.angularaxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n                [ r.angularaxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n                [ r.angularaxis, [ 'range' ], [ 'domain' ] ],\n                [ r.angularaxis, [ 'endpadding' ], [ 'endPadding' ] ],\n                [ r.radialaxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n                [ r.radialaxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n                [ r.radialaxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n                [ r.radialaxis, [ 'range' ], [ 'domain' ] ],\n                [ r.angularAxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n                [ r.angularAxis, [ 'showticklabels' ], [ 'labelsVisible' ] ],\n                [ r.angularAxis, [ 'nticks' ], [ 'ticksCount' ] ],\n                [ r.angularAxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n                [ r.angularAxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n                [ r.angularAxis, [ 'range' ], [ 'domain' ] ],\n                [ r.angularAxis, [ 'endpadding' ], [ 'endPadding' ] ],\n                [ r.radialAxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n                [ r.radialAxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n                [ r.radialAxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n                [ r.radialAxis, [ 'range' ], [ 'domain' ] ],\n                [ r.font, [ 'outlinecolor' ], [ 'outlineColor' ] ],\n                [ r.legend, [ 'traceorder' ], [ 'reverseOrder' ] ],\n                [ r, [ 'labeloffset' ], [ 'labelOffset' ] ],\n                [ r, [ 'defaultcolorrange' ], [ 'defaultColorRange' ] ]\n            ];\n            toTranslate.forEach(function(d, i) {\n                µ.util.translator.apply(null, d.concat(reverse));\n            });\n\n            if (!reverse) {\n                if (r.angularAxis && typeof r.angularAxis.ticklen !== 'undefined') r.tickLength = r.angularAxis.ticklen;\n                if (r.angularAxis && typeof r.angularAxis.tickcolor !== 'undefined') r.tickColor = r.angularAxis.tickcolor;\n            } else {\n                if (typeof r.tickLength !== 'undefined') {\n                    r.angularaxis.ticklen = r.tickLength;\n                    delete r.tickLength;\n                }\n                if (r.tickColor) {\n                    r.angularaxis.tickcolor = r.tickColor;\n                    delete r.tickColor;\n                }\n            }\n            if (r.legend && typeof r.legend.reverseOrder != 'boolean') {\n                r.legend.reverseOrder = r.legend.reverseOrder != 'normal';\n            }\n            if (r.legend && typeof r.legend.traceorder == 'boolean') {\n                r.legend.traceorder = r.legend.traceorder ? 'reversed' : 'normal';\n                delete r.legend.reverseOrder;\n            }\n            if (r.margin && typeof r.margin.t != 'undefined') {\n                var source = [ 't', 'r', 'b', 'l', 'pad' ];\n                var target = [ 'top', 'right', 'bottom', 'left', 'pad' ];\n                var margin = {};\n                d3.entries(r.margin).forEach(function(dB, iB) {\n                    margin[target[source.indexOf(dB.key)]] = dB.value;\n                });\n                r.margin = margin;\n            }\n            if (reverse) {\n                delete r.needsEndSpacing;\n                delete r.minorTickColor;\n                delete r.minorTicks;\n                delete r.angularaxis.ticksCount;\n                delete r.angularaxis.ticksCount;\n                delete r.angularaxis.ticksStep;\n                delete r.angularaxis.rewriteTicks;\n                delete r.angularaxis.nticks;\n                delete r.radialaxis.ticksCount;\n                delete r.radialaxis.ticksCount;\n                delete r.radialaxis.ticksStep;\n                delete r.radialaxis.rewriteTicks;\n                delete r.radialaxis.nticks;\n            }\n            outputConfig.layout = r;\n        }\n        return outputConfig;\n    };\n    return exports;\n};\n\n},{\"../../../constants/alignment\":154,\"../../../lib\":178,\"d3\":16}],261:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n/* eslint-disable new-cap */\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../../lib');\nvar Color = _dereq_('../../../components/color');\n\nvar micropolar = _dereq_('./micropolar');\nvar UndoManager = _dereq_('./undo_manager');\nvar extendDeepAll = Lib.extendDeepAll;\n\nvar manager = module.exports = {};\n\nmanager.framework = function(_gd) {\n    var config, previousConfigClone, plot, convertedInput, container;\n    var undoManager = new UndoManager();\n\n    function exports(_inputConfig, _container) {\n        if(_container) container = _container;\n        d3.select(d3.select(container).node().parentNode).selectAll('.svg-container>*:not(.chart-root)').remove();\n\n        config = (!config) ?\n            _inputConfig :\n            extendDeepAll(config, _inputConfig);\n\n        if(!plot) plot = micropolar.Axis();\n        convertedInput = micropolar.adapter.plotly().convert(config);\n        plot.config(convertedInput).render(container);\n        _gd.data = config.data;\n        _gd.layout = config.layout;\n        manager.fillLayout(_gd);\n        return config;\n    }\n    exports.isPolar = true;\n    exports.svg = function() { return plot.svg(); };\n    exports.getConfig = function() { return config; };\n    exports.getLiveConfig = function() {\n        return micropolar.adapter.plotly().convert(plot.getLiveConfig(), true);\n    };\n    exports.getLiveScales = function() { return {t: plot.angularScale(), r: plot.radialScale()}; };\n    exports.setUndoPoint = function() {\n        var that = this;\n        var configClone = micropolar.util.cloneJson(config);\n        (function(_configClone, _previousConfigClone) {\n            undoManager.add({\n                undo: function() {\n                    if(_previousConfigClone) that(_previousConfigClone);\n                },\n                redo: function() {\n                    that(_configClone);\n                }\n            });\n        })(configClone, previousConfigClone);\n        previousConfigClone = micropolar.util.cloneJson(configClone);\n    };\n    exports.undo = function() { undoManager.undo(); };\n    exports.redo = function() { undoManager.redo(); };\n    return exports;\n};\n\nmanager.fillLayout = function(_gd) {\n    var container = d3.select(_gd).selectAll('.plot-container');\n    var paperDiv = container.selectAll('.svg-container');\n    var paper = _gd.framework && _gd.framework.svg && _gd.framework.svg();\n    var dflts = {\n        width: 800,\n        height: 600,\n        paper_bgcolor: Color.background,\n        _container: container,\n        _paperdiv: paperDiv,\n        _paper: paper\n    };\n\n    _gd._fullLayout = extendDeepAll(dflts, _gd.layout);\n};\n\n},{\"../../../components/color\":52,\"../../../lib\":178,\"./micropolar\":260,\"./undo_manager\":262,\"d3\":16}],262:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Modified from https://github.com/ArthurClemens/Javascript-Undo-Manager\n// Copyright (c) 2010-2013 Arthur Clemens, arthur@visiblearea.com\nmodule.exports = function UndoManager() {\n    var undoCommands = [];\n    var index = -1;\n    var isExecuting = false;\n    var callback;\n\n    function execute(command, action) {\n        if(!command) return this;\n\n        isExecuting = true;\n        command[action]();\n        isExecuting = false;\n\n        return this;\n    }\n\n    return {\n        add: function(command) {\n            if(isExecuting) return this;\n            undoCommands.splice(index + 1, undoCommands.length - index);\n            undoCommands.push(command);\n            index = undoCommands.length - 1;\n            return this;\n        },\n        setCallback: function(callbackFunc) { callback = callbackFunc; },\n        undo: function() {\n            var command = undoCommands[index];\n            if(!command) return this;\n            execute(command, 'undo');\n            index -= 1;\n            if(callback) callback(command.undo);\n            return this;\n        },\n        redo: function() {\n            var command = undoCommands[index + 1];\n            if(!command) return this;\n            execute(command, 'redo');\n            index += 1;\n            if(callback) callback(command.redo);\n            return this;\n        },\n        clear: function() {\n            undoCommands = [];\n            index = -1;\n        },\n        hasUndo: function() { return index !== -1; },\n        hasRedo: function() { return index < (undoCommands.length - 1); },\n        getCommands: function() { return undoCommands; },\n        getPreviousCommand: function() { return undoCommands[index - 1]; },\n        getIndex: function() { return index; }\n    };\n};\n\n},{}],263:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar Template = _dereq_('../plot_api/plot_template');\nvar handleDomainDefaults = _dereq_('./domain').defaults;\n\n\n/**\n * Find and supply defaults to all subplots of a given type\n * This handles subplots that are contained within one container - so\n * gl3d, geo, ternary... but not 2d axes which have separate x and y axes\n * finds subplots, coerces their `domain` attributes, then calls the\n * given handleDefaults function to fill in everything else.\n *\n * layoutIn: the complete user-supplied input layout\n * layoutOut: the complete finished layout\n * fullData: the finished data array, used only to find subplots\n * opts: {\n *  type: subplot type string\n *  attributes: subplot attributes object\n *  partition: 'x' or 'y', which direction to divide domain space by default\n *      (default 'x', ie side-by-side subplots)\n *      TODO: this option is only here because 3D and geo made opposite\n *      choices in this regard previously and I didn't want to change it.\n *      Instead we should do:\n *      - something consistent\n *      - something more square (4 cuts 2x2, 5/6 cuts 2x3, etc.)\n *      - something that includes all subplot types in one arrangement,\n *        now that we can have them together!\n *  handleDefaults: function of (subplotLayoutIn, subplotLayoutOut, coerce, opts)\n *      this opts object is passed through to handleDefaults, so attach any\n *      additional items needed by this function here as well\n * }\n */\nmodule.exports = function handleSubplotDefaults(layoutIn, layoutOut, fullData, opts) {\n    var subplotType = opts.type;\n    var subplotAttributes = opts.attributes;\n    var handleDefaults = opts.handleDefaults;\n    var partition = opts.partition || 'x';\n\n    var ids = layoutOut._subplots[subplotType];\n    var idsLength = ids.length;\n\n    var baseId = idsLength && ids[0].replace(/\\d+$/, '');\n\n    var subplotLayoutIn, subplotLayoutOut;\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(subplotLayoutIn, subplotLayoutOut, subplotAttributes, attr, dflt);\n    }\n\n    for(var i = 0; i < idsLength; i++) {\n        var id = ids[i];\n\n        // ternary traces get a layout ternary for free!\n        if(layoutIn[id]) subplotLayoutIn = layoutIn[id];\n        else subplotLayoutIn = layoutIn[id] = {};\n\n        subplotLayoutOut = Template.newContainer(layoutOut, id, baseId);\n\n        // All subplot containers get a `uirevision` inheriting from the base.\n        // Currently all subplots containers have some user interaction\n        // attributes, but if we ever add one that doesn't, we would need an\n        // option to skip this step.\n        coerce('uirevision', layoutOut.uirevision);\n\n        var dfltDomains = {};\n        dfltDomains[partition] = [i / idsLength, (i + 1) / idsLength];\n        handleDomainDefaults(subplotLayoutOut, layoutOut, coerce, dfltDomains);\n\n        opts.id = id;\n        handleDefaults(subplotLayoutIn, subplotLayoutOut, coerce, opts);\n    }\n};\n\n},{\"../lib\":178,\"../plot_api/plot_template\":212,\"./domain\":249}],264:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar FORMAT_LINK = _dereq_('../constants/docs').FORMAT_LINK;\nvar DATE_FORMAT_LINK = _dereq_('../constants/docs').DATE_FORMAT_LINK;\n\nvar templateFormatStringDescription = [\n    'Variables are inserted using %{variable}, for example \"y: %{y}\".',\n    'Numbers are formatted using d3-format\\'s syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\".',\n    FORMAT_LINK,\n    'for details on the formatting syntax.',\n    'Dates are formatted using d3-time-format\\'s syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\".',\n    DATE_FORMAT_LINK,\n    'for details on the date formatting syntax.'\n].join(' ');\n\nfunction describeVariables(extra) {\n    var descPart = extra.description ? ' ' + extra.description : '';\n    var keys = extra.keys || [];\n    if(keys.length > 0) {\n        var quotedKeys = [];\n        for(var i = 0; i < keys.length; i++) {\n            quotedKeys[i] = '`' + keys[i] + '`';\n        }\n        descPart = descPart + 'Finally, the template string has access to ';\n        if(keys.length === 1) {\n            descPart = 'variable ' + quotedKeys[0];\n        } else {\n            descPart = 'variables ' + quotedKeys.slice(0, -1).join(', ') + ' and ' + quotedKeys.slice(-1) + '.';\n        }\n    }\n    return descPart;\n}\n\nexports.hovertemplateAttrs = function(opts, extra) {\n    opts = opts || {};\n    extra = extra || {};\n\n    var descPart = describeVariables(extra);\n\n    var hovertemplate = {\n        valType: 'string',\n        \n        dflt: '',\n        editType: opts.editType || 'none',\n        \n    };\n\n    if(opts.arrayOk !== false) {\n        hovertemplate.arrayOk = true;\n    }\n\n    return hovertemplate;\n};\n\nexports.texttemplateAttrs = function(opts, extra) {\n    opts = opts || {};\n    extra = extra || {};\n\n    var descPart = describeVariables(extra);\n\n    var texttemplate = {\n        valType: 'string',\n        \n        dflt: '',\n        editType: opts.editType || 'calc',\n        \n    };\n\n    if(opts.arrayOk !== false) {\n        texttemplate.arrayOk = true;\n    }\n    return texttemplate;\n};\n\n},{\"../constants/docs\":155}],265:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Ternary = _dereq_('./ternary');\n\nvar getSubplotCalcData = _dereq_('../../plots/get_data').getSubplotCalcData;\nvar counterRegex = _dereq_('../../lib').counterRegex;\nvar TERNARY = 'ternary';\n\nexports.name = TERNARY;\n\nvar attr = exports.attr = 'subplot';\n\nexports.idRoot = TERNARY;\n\nexports.idRegex = exports.attrRegex = counterRegex(TERNARY);\n\nvar attributes = exports.attributes = {};\nattributes[attr] = {\n    valType: 'subplotid',\n    \n    dflt: 'ternary',\n    editType: 'calc',\n    \n};\n\nexports.layoutAttributes = _dereq_('./layout_attributes');\n\nexports.supplyLayoutDefaults = _dereq_('./layout_defaults');\n\nexports.plot = function plot(gd) {\n    var fullLayout = gd._fullLayout;\n    var calcData = gd.calcdata;\n    var ternaryIds = fullLayout._subplots[TERNARY];\n\n    for(var i = 0; i < ternaryIds.length; i++) {\n        var ternaryId = ternaryIds[i];\n        var ternaryCalcData = getSubplotCalcData(calcData, TERNARY, ternaryId);\n        var ternary = fullLayout[ternaryId]._subplot;\n\n        // If ternary is not instantiated, create one!\n        if(!ternary) {\n            ternary = new Ternary({\n                id: ternaryId,\n                graphDiv: gd,\n                container: fullLayout._ternarylayer.node()\n            },\n                fullLayout\n            );\n\n            fullLayout[ternaryId]._subplot = ternary;\n        }\n\n        ternary.plot(ternaryCalcData, fullLayout, gd._promises);\n    }\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n    var oldTernaryKeys = oldFullLayout._subplots[TERNARY] || [];\n\n    for(var i = 0; i < oldTernaryKeys.length; i++) {\n        var oldTernaryKey = oldTernaryKeys[i];\n        var oldTernary = oldFullLayout[oldTernaryKey]._subplot;\n\n        if(!newFullLayout[oldTernaryKey] && !!oldTernary) {\n            oldTernary.plotContainer.remove();\n            oldTernary.clipDef.remove();\n            oldTernary.clipDefRelative.remove();\n            oldTernary.layers['a-title'].remove();\n            oldTernary.layers['b-title'].remove();\n            oldTernary.layers['c-title'].remove();\n        }\n    }\n};\n\n},{\"../../lib\":178,\"../../plots/get_data\":252,\"./layout_attributes\":266,\"./layout_defaults\":267,\"./ternary\":268}],266:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar domainAttrs = _dereq_('../domain').attributes;\nvar axesAttrs = _dereq_('../cartesian/layout_attributes');\n\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar ternaryAxesAttrs = {\n    title: {\n        text: axesAttrs.title.text,\n        font: axesAttrs.title.font\n        // TODO does standoff here make sense?\n    },\n    color: axesAttrs.color,\n    // ticks\n    tickmode: axesAttrs.tickmode,\n    nticks: extendFlat({}, axesAttrs.nticks, {dflt: 6, min: 1}),\n    tick0: axesAttrs.tick0,\n    dtick: axesAttrs.dtick,\n    tickvals: axesAttrs.tickvals,\n    ticktext: axesAttrs.ticktext,\n    ticks: axesAttrs.ticks,\n    ticklen: axesAttrs.ticklen,\n    tickwidth: axesAttrs.tickwidth,\n    tickcolor: axesAttrs.tickcolor,\n    showticklabels: axesAttrs.showticklabels,\n    showtickprefix: axesAttrs.showtickprefix,\n    tickprefix: axesAttrs.tickprefix,\n    showticksuffix: axesAttrs.showticksuffix,\n    ticksuffix: axesAttrs.ticksuffix,\n    showexponent: axesAttrs.showexponent,\n    exponentformat: axesAttrs.exponentformat,\n    separatethousands: axesAttrs.separatethousands,\n    tickfont: axesAttrs.tickfont,\n    tickangle: axesAttrs.tickangle,\n    tickformat: axesAttrs.tickformat,\n    tickformatstops: axesAttrs.tickformatstops,\n    hoverformat: axesAttrs.hoverformat,\n    // lines and grids\n    showline: extendFlat({}, axesAttrs.showline, {dflt: true}),\n    linecolor: axesAttrs.linecolor,\n    linewidth: axesAttrs.linewidth,\n    showgrid: extendFlat({}, axesAttrs.showgrid, {dflt: true}),\n    gridcolor: axesAttrs.gridcolor,\n    gridwidth: axesAttrs.gridwidth,\n    layer: axesAttrs.layer,\n    // range\n    min: {\n        valType: 'number',\n        dflt: 0,\n        \n        min: 0,\n        \n    },\n    _deprecated: {\n        title: axesAttrs._deprecated.title,\n        titlefont: axesAttrs._deprecated.titlefont\n    }\n};\n\nvar attrs = module.exports = overrideAll({\n    domain: domainAttrs({name: 'ternary'}),\n\n    bgcolor: {\n        valType: 'color',\n        \n        dflt: colorAttrs.background,\n        \n    },\n    sum: {\n        valType: 'number',\n        \n        dflt: 1,\n        min: 0,\n        \n    },\n    aaxis: ternaryAxesAttrs,\n    baxis: ternaryAxesAttrs,\n    caxis: ternaryAxesAttrs\n}, 'plot', 'from-root');\n\n// set uirevisions outside of `overrideAll` so we can get `editType: none`\nattrs.uirevision = {\n    valType: 'any',\n    \n    editType: 'none',\n    \n};\n\nattrs.aaxis.uirevision = attrs.baxis.uirevision = attrs.caxis.uirevision = {\n    valType: 'any',\n    \n    editType: 'none',\n    \n};\n\n},{\"../../components/color/attributes\":51,\"../../lib/extend\":173,\"../../plot_api/edit_types\":205,\"../cartesian/layout_attributes\":236,\"../domain\":249}],267:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar Template = _dereq_('../../plot_api/plot_template');\nvar Lib = _dereq_('../../lib');\n\nvar handleSubplotDefaults = _dereq_('../subplot_defaults');\nvar handleTickLabelDefaults = _dereq_('../cartesian/tick_label_defaults');\nvar handleTickMarkDefaults = _dereq_('../cartesian/tick_mark_defaults');\nvar handleTickValueDefaults = _dereq_('../cartesian/tick_value_defaults');\nvar handleLineGridDefaults = _dereq_('../cartesian/line_grid_defaults');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nvar axesNames = ['aaxis', 'baxis', 'caxis'];\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n    handleSubplotDefaults(layoutIn, layoutOut, fullData, {\n        type: 'ternary',\n        attributes: layoutAttributes,\n        handleDefaults: handleTernaryDefaults,\n        font: layoutOut.font,\n        paper_bgcolor: layoutOut.paper_bgcolor\n    });\n};\n\nfunction handleTernaryDefaults(ternaryLayoutIn, ternaryLayoutOut, coerce, options) {\n    var bgColor = coerce('bgcolor');\n    var sum = coerce('sum');\n    options.bgColor = Color.combine(bgColor, options.paper_bgcolor);\n    var axName, containerIn, containerOut;\n\n    // TODO: allow most (if not all) axis attributes to be set\n    // in the outer container and used as defaults in the individual axes?\n\n    for(var j = 0; j < axesNames.length; j++) {\n        axName = axesNames[j];\n        containerIn = ternaryLayoutIn[axName] || {};\n        containerOut = Template.newContainer(ternaryLayoutOut, axName);\n        containerOut._name = axName;\n\n        handleAxisDefaults(containerIn, containerOut, options, ternaryLayoutOut);\n    }\n\n    // if the min values contradict each other, set them all to default (0)\n    // and delete *all* the inputs so the user doesn't get confused later by\n    // changing one and having them all change.\n    var aaxis = ternaryLayoutOut.aaxis;\n    var baxis = ternaryLayoutOut.baxis;\n    var caxis = ternaryLayoutOut.caxis;\n    if(aaxis.min + baxis.min + caxis.min >= sum) {\n        aaxis.min = 0;\n        baxis.min = 0;\n        caxis.min = 0;\n        if(ternaryLayoutIn.aaxis) delete ternaryLayoutIn.aaxis.min;\n        if(ternaryLayoutIn.baxis) delete ternaryLayoutIn.baxis.min;\n        if(ternaryLayoutIn.caxis) delete ternaryLayoutIn.caxis.min;\n    }\n}\n\nfunction handleAxisDefaults(containerIn, containerOut, options, ternaryLayoutOut) {\n    var axAttrs = layoutAttributes[containerOut._name];\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(containerIn, containerOut, axAttrs, attr, dflt);\n    }\n\n    coerce('uirevision', ternaryLayoutOut.uirevision);\n\n    containerOut.type = 'linear'; // no other types allowed for ternary\n\n    var dfltColor = coerce('color');\n    // if axis.color was provided, use it for fonts too; otherwise,\n    // inherit from global font color in case that was provided.\n    var dfltFontColor = (dfltColor !== axAttrs.color.dflt) ? dfltColor : options.font.color;\n\n    var axName = containerOut._name;\n    var letterUpper = axName.charAt(0).toUpperCase();\n    var dfltTitle = 'Component ' + letterUpper;\n\n    var title = coerce('title.text', dfltTitle);\n    containerOut._hovertitle = title === dfltTitle ? title : letterUpper;\n\n    Lib.coerceFont(coerce, 'title.font', {\n        family: options.font.family,\n        size: Math.round(options.font.size * 1.2),\n        color: dfltFontColor\n    });\n\n    // range is just set by 'min' - max is determined by the other axes mins\n    coerce('min');\n\n    handleTickValueDefaults(containerIn, containerOut, coerce, 'linear');\n    handleTickLabelDefaults(containerIn, containerOut, coerce, 'linear', {});\n    handleTickMarkDefaults(containerIn, containerOut, coerce,\n        { outerTicks: true });\n\n    var showTickLabels = coerce('showticklabels');\n    if(showTickLabels) {\n        Lib.coerceFont(coerce, 'tickfont', {\n            family: options.font.family,\n            size: options.font.size,\n            color: dfltFontColor\n        });\n        coerce('tickangle');\n        coerce('tickformat');\n    }\n\n    handleLineGridDefaults(containerIn, containerOut, coerce, {\n        dfltColor: dfltColor,\n        bgColor: options.bgColor,\n        // default grid color is darker here (60%, vs cartesian default ~91%)\n        // because the grid is not square so the eye needs heavier cues to follow\n        blend: 60,\n        showLine: true,\n        showGrid: true,\n        noZeroLine: true,\n        attributes: axAttrs\n    });\n\n    coerce('hoverformat');\n    coerce('layer');\n}\n\n},{\"../../components/color\":52,\"../../lib\":178,\"../../plot_api/plot_template\":212,\"../cartesian/line_grid_defaults\":238,\"../cartesian/tick_label_defaults\":243,\"../cartesian/tick_mark_defaults\":244,\"../cartesian/tick_value_defaults\":245,\"../subplot_defaults\":263,\"./layout_attributes\":266}],268:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar _ = Lib._;\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar setConvert = _dereq_('../cartesian/set_convert');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar Plots = _dereq_('../plots');\nvar Axes = _dereq_('../cartesian/axes');\nvar dragElement = _dereq_('../../components/dragelement');\nvar Fx = _dereq_('../../components/fx');\nvar dragHelpers = _dereq_('../../components/dragelement/helpers');\nvar freeMode = dragHelpers.freeMode;\nvar rectMode = dragHelpers.rectMode;\nvar Titles = _dereq_('../../components/titles');\nvar prepSelect = _dereq_('../cartesian/select').prepSelect;\nvar selectOnClick = _dereq_('../cartesian/select').selectOnClick;\nvar clearSelect = _dereq_('../cartesian/select').clearSelect;\nvar clearSelectionsCache = _dereq_('../cartesian/select').clearSelectionsCache;\nvar constants = _dereq_('../cartesian/constants');\n\nfunction Ternary(options, fullLayout) {\n    this.id = options.id;\n    this.graphDiv = options.graphDiv;\n    this.init(fullLayout);\n    this.makeFramework(fullLayout);\n\n    // unfortunately, we have to keep track of some axis tick settings\n    // as ternary subplots do not implement the 'ticks' editType\n    this.aTickLayout = null;\n    this.bTickLayout = null;\n    this.cTickLayout = null;\n}\n\nmodule.exports = Ternary;\n\nvar proto = Ternary.prototype;\n\nproto.init = function(fullLayout) {\n    this.container = fullLayout._ternarylayer;\n    this.defs = fullLayout._defs;\n    this.layoutId = fullLayout._uid;\n    this.traceHash = {};\n    this.layers = {};\n};\n\nproto.plot = function(ternaryCalcData, fullLayout) {\n    var _this = this;\n    var ternaryLayout = fullLayout[_this.id];\n    var graphSize = fullLayout._size;\n\n    _this._hasClipOnAxisFalse = false;\n    for(var i = 0; i < ternaryCalcData.length; i++) {\n        var trace = ternaryCalcData[i][0].trace;\n\n        if(trace.cliponaxis === false) {\n            _this._hasClipOnAxisFalse = true;\n            break;\n        }\n    }\n\n    _this.updateLayers(ternaryLayout);\n    _this.adjustLayout(ternaryLayout, graphSize);\n    Plots.generalUpdatePerTraceModule(_this.graphDiv, _this, ternaryCalcData, ternaryLayout);\n    _this.layers.plotbg.select('path').call(Color.fill, ternaryLayout.bgcolor);\n};\n\nproto.makeFramework = function(fullLayout) {\n    var _this = this;\n    var gd = _this.graphDiv;\n    var ternaryLayout = fullLayout[_this.id];\n\n    var clipId = _this.clipId = 'clip' + _this.layoutId + _this.id;\n    var clipIdRelative = _this.clipIdRelative = 'clip-relative' + _this.layoutId + _this.id;\n\n    // clippath for this ternary subplot\n    _this.clipDef = Lib.ensureSingleById(fullLayout._clips, 'clipPath', clipId, function(s) {\n        s.append('path').attr('d', 'M0,0Z');\n    });\n\n    // 'relative' clippath (i.e. no translation) for this ternary subplot\n    _this.clipDefRelative = Lib.ensureSingleById(fullLayout._clips, 'clipPath', clipIdRelative, function(s) {\n        s.append('path').attr('d', 'M0,0Z');\n    });\n\n    // container for everything in this ternary subplot\n    _this.plotContainer = Lib.ensureSingle(_this.container, 'g', _this.id);\n    _this.updateLayers(ternaryLayout);\n\n    Drawing.setClipUrl(_this.layers.backplot, clipId, gd);\n    Drawing.setClipUrl(_this.layers.grids, clipId, gd);\n};\n\nproto.updateLayers = function(ternaryLayout) {\n    var _this = this;\n    var layers = _this.layers;\n\n    // inside that container, we have one container for the data, and\n    // one each for the three axes around it.\n\n    var plotLayers = ['draglayer', 'plotbg', 'backplot', 'grids'];\n\n    if(ternaryLayout.aaxis.layer === 'below traces') {\n        plotLayers.push('aaxis', 'aline');\n    }\n    if(ternaryLayout.baxis.layer === 'below traces') {\n        plotLayers.push('baxis', 'bline');\n    }\n    if(ternaryLayout.caxis.layer === 'below traces') {\n        plotLayers.push('caxis', 'cline');\n    }\n\n    plotLayers.push('frontplot');\n\n    if(ternaryLayout.aaxis.layer === 'above traces') {\n        plotLayers.push('aaxis', 'aline');\n    }\n    if(ternaryLayout.baxis.layer === 'above traces') {\n        plotLayers.push('baxis', 'bline');\n    }\n    if(ternaryLayout.caxis.layer === 'above traces') {\n        plotLayers.push('caxis', 'cline');\n    }\n\n    var toplevel = _this.plotContainer.selectAll('g.toplevel')\n        .data(plotLayers, String);\n\n    var grids = ['agrid', 'bgrid', 'cgrid'];\n\n    toplevel.enter().append('g')\n        .attr('class', function(d) { return 'toplevel ' + d; })\n        .each(function(d) {\n            var s = d3.select(this);\n            layers[d] = s;\n\n            // containers for different trace types.\n            // NOTE - this is different from cartesian, where all traces\n            // are in front of grids. Here I'm putting maps behind the grids\n            // so the grids will always be visible if they're requested.\n            // Perhaps we want that for cartesian too?\n            if(d === 'frontplot') {\n                s.append('g').classed('scatterlayer', true);\n            } else if(d === 'backplot') {\n                s.append('g').classed('maplayer', true);\n            } else if(d === 'plotbg') {\n                s.append('path').attr('d', 'M0,0Z');\n            } else if(d === 'aline' || d === 'bline' || d === 'cline') {\n                s.append('path');\n            } else if(d === 'grids') {\n                grids.forEach(function(d) {\n                    layers[d] = s.append('g').classed('grid ' + d, true);\n                });\n            }\n        });\n\n    toplevel.order();\n};\n\nvar whRatio = Math.sqrt(4 / 3);\n\nproto.adjustLayout = function(ternaryLayout, graphSize) {\n    var _this = this;\n    var domain = ternaryLayout.domain;\n    var xDomainCenter = (domain.x[0] + domain.x[1]) / 2;\n    var yDomainCenter = (domain.y[0] + domain.y[1]) / 2;\n    var xDomain = domain.x[1] - domain.x[0];\n    var yDomain = domain.y[1] - domain.y[0];\n    var wmax = xDomain * graphSize.w;\n    var hmax = yDomain * graphSize.h;\n    var sum = ternaryLayout.sum;\n    var amin = ternaryLayout.aaxis.min;\n    var bmin = ternaryLayout.baxis.min;\n    var cmin = ternaryLayout.caxis.min;\n\n    var x0, y0, w, h, xDomainFinal, yDomainFinal;\n\n    if(wmax > whRatio * hmax) {\n        h = hmax;\n        w = h * whRatio;\n    } else {\n        w = wmax;\n        h = w / whRatio;\n    }\n\n    xDomainFinal = xDomain * w / wmax;\n    yDomainFinal = yDomain * h / hmax;\n\n    x0 = graphSize.l + graphSize.w * xDomainCenter - w / 2;\n    y0 = graphSize.t + graphSize.h * (1 - yDomainCenter) - h / 2;\n\n    _this.x0 = x0;\n    _this.y0 = y0;\n    _this.w = w;\n    _this.h = h;\n    _this.sum = sum;\n\n    // set up the x and y axis objects we'll use to lay out the points\n    _this.xaxis = {\n        type: 'linear',\n        range: [amin + 2 * cmin - sum, sum - amin - 2 * bmin],\n        domain: [\n            xDomainCenter - xDomainFinal / 2,\n            xDomainCenter + xDomainFinal / 2\n        ],\n        _id: 'x'\n    };\n    setConvert(_this.xaxis, _this.graphDiv._fullLayout);\n    _this.xaxis.setScale();\n    _this.xaxis.isPtWithinRange = function(d) {\n        return (\n            d.a >= _this.aaxis.range[0] &&\n            d.a <= _this.aaxis.range[1] &&\n            d.b >= _this.baxis.range[1] &&\n            d.b <= _this.baxis.range[0] &&\n            d.c >= _this.caxis.range[1] &&\n            d.c <= _this.caxis.range[0]\n        );\n    };\n\n    _this.yaxis = {\n        type: 'linear',\n        range: [amin, sum - bmin - cmin],\n        domain: [\n            yDomainCenter - yDomainFinal / 2,\n            yDomainCenter + yDomainFinal / 2\n        ],\n        _id: 'y'\n    };\n    setConvert(_this.yaxis, _this.graphDiv._fullLayout);\n    _this.yaxis.setScale();\n    _this.yaxis.isPtWithinRange = function() { return true; };\n\n    // set up the modified axes for tick drawing\n    var yDomain0 = _this.yaxis.domain[0];\n\n    // aaxis goes up the left side. Set it up as a y axis, but with\n    // fictitious angles and domain, but then rotate and translate\n    // it into place at the end\n    var aaxis = _this.aaxis = extendFlat({}, ternaryLayout.aaxis, {\n        range: [amin, sum - bmin - cmin],\n        side: 'left',\n        // tickangle = 'auto' means 0 anyway for a y axis, need to coerce to 0 here\n        // so we can shift by 30.\n        tickangle: (+ternaryLayout.aaxis.tickangle || 0) - 30,\n        domain: [yDomain0, yDomain0 + yDomainFinal * whRatio],\n        anchor: 'free',\n        position: 0,\n        _id: 'y',\n        _length: w\n    });\n    setConvert(aaxis, _this.graphDiv._fullLayout);\n    aaxis.setScale();\n\n    // baxis goes across the bottom (backward). We can set it up as an x axis\n    // without any enclosing transformation.\n    var baxis = _this.baxis = extendFlat({}, ternaryLayout.baxis, {\n        range: [sum - amin - cmin, bmin],\n        side: 'bottom',\n        domain: _this.xaxis.domain,\n        anchor: 'free',\n        position: 0,\n        _id: 'x',\n        _length: w\n    });\n    setConvert(baxis, _this.graphDiv._fullLayout);\n    baxis.setScale();\n\n    // caxis goes down the right side. Set it up as a y axis, with\n    // post-transformation similar to aaxis\n    var caxis = _this.caxis = extendFlat({}, ternaryLayout.caxis, {\n        range: [sum - amin - bmin, cmin],\n        side: 'right',\n        tickangle: (+ternaryLayout.caxis.tickangle || 0) + 30,\n        domain: [yDomain0, yDomain0 + yDomainFinal * whRatio],\n        anchor: 'free',\n        position: 0,\n        _id: 'y',\n        _length: w\n    });\n    setConvert(caxis, _this.graphDiv._fullLayout);\n    caxis.setScale();\n\n    var triangleClip = 'M' + x0 + ',' + (y0 + h) + 'h' + w + 'l-' + (w / 2) + ',-' + h + 'Z';\n    _this.clipDef.select('path').attr('d', triangleClip);\n    _this.layers.plotbg.select('path').attr('d', triangleClip);\n\n    var triangleClipRelative = 'M0,' + h + 'h' + w + 'l-' + (w / 2) + ',-' + h + 'Z';\n    _this.clipDefRelative.select('path').attr('d', triangleClipRelative);\n\n    var plotTransform = 'translate(' + x0 + ',' + y0 + ')';\n    _this.plotContainer.selectAll('.scatterlayer,.maplayer')\n        .attr('transform', plotTransform);\n\n    _this.clipDefRelative.select('path').attr('transform', null);\n\n    // TODO: shift axes to accommodate linewidth*sin(30) tick mark angle\n\n    // TODO: there's probably an easier way to handle these translations/offsets now...\n    var bTransform = 'translate(' + (x0 - baxis._offset) + ',' + (y0 + h) + ')';\n\n    _this.layers.baxis.attr('transform', bTransform);\n    _this.layers.bgrid.attr('transform', bTransform);\n\n    var aTransform = 'translate(' + (x0 + w / 2) + ',' + y0 +\n        ')rotate(30)translate(0,' + -aaxis._offset + ')';\n    _this.layers.aaxis.attr('transform', aTransform);\n    _this.layers.agrid.attr('transform', aTransform);\n\n    var cTransform = 'translate(' + (x0 + w / 2) + ',' + y0 +\n        ')rotate(-30)translate(0,' + -caxis._offset + ')';\n    _this.layers.caxis.attr('transform', cTransform);\n    _this.layers.cgrid.attr('transform', cTransform);\n\n    _this.drawAxes(true);\n\n    _this.layers.aline.select('path')\n        .attr('d', aaxis.showline ?\n            'M' + x0 + ',' + (y0 + h) + 'l' + (w / 2) + ',-' + h : 'M0,0')\n        .call(Color.stroke, aaxis.linecolor || '#000')\n        .style('stroke-width', (aaxis.linewidth || 0) + 'px');\n    _this.layers.bline.select('path')\n        .attr('d', baxis.showline ?\n            'M' + x0 + ',' + (y0 + h) + 'h' + w : 'M0,0')\n        .call(Color.stroke, baxis.linecolor || '#000')\n        .style('stroke-width', (baxis.linewidth || 0) + 'px');\n    _this.layers.cline.select('path')\n        .attr('d', caxis.showline ?\n            'M' + (x0 + w / 2) + ',' + y0 + 'l' + (w / 2) + ',' + h : 'M0,0')\n        .call(Color.stroke, caxis.linecolor || '#000')\n        .style('stroke-width', (caxis.linewidth || 0) + 'px');\n\n    if(!_this.graphDiv._context.staticPlot) {\n        _this.initInteractions();\n    }\n\n    Drawing.setClipUrl(\n        _this.layers.frontplot,\n        _this._hasClipOnAxisFalse ? null : _this.clipId,\n        _this.graphDiv\n    );\n};\n\nproto.drawAxes = function(doTitles) {\n    var _this = this;\n    var gd = _this.graphDiv;\n    var titlesuffix = _this.id.substr(7) + 'title';\n    var layers = _this.layers;\n    var aaxis = _this.aaxis;\n    var baxis = _this.baxis;\n    var caxis = _this.caxis;\n\n    _this.drawAx(aaxis);\n    _this.drawAx(baxis);\n    _this.drawAx(caxis);\n\n    if(doTitles) {\n        var apad = Math.max(aaxis.showticklabels ? aaxis.tickfont.size / 2 : 0,\n            (caxis.showticklabels ? caxis.tickfont.size * 0.75 : 0) +\n            (caxis.ticks === 'outside' ? caxis.ticklen * 0.87 : 0));\n        var bpad = (baxis.showticklabels ? baxis.tickfont.size : 0) +\n            (baxis.ticks === 'outside' ? baxis.ticklen : 0) + 3;\n\n        layers['a-title'] = Titles.draw(gd, 'a' + titlesuffix, {\n            propContainer: aaxis,\n            propName: _this.id + '.aaxis.title',\n            placeholder: _(gd, 'Click to enter Component A title'),\n            attributes: {\n                x: _this.x0 + _this.w / 2,\n                y: _this.y0 - aaxis.title.font.size / 3 - apad,\n                'text-anchor': 'middle'\n            }\n        });\n        layers['b-title'] = Titles.draw(gd, 'b' + titlesuffix, {\n            propContainer: baxis,\n            propName: _this.id + '.baxis.title',\n            placeholder: _(gd, 'Click to enter Component B title'),\n            attributes: {\n                x: _this.x0 - bpad,\n                y: _this.y0 + _this.h + baxis.title.font.size * 0.83 + bpad,\n                'text-anchor': 'middle'\n            }\n        });\n        layers['c-title'] = Titles.draw(gd, 'c' + titlesuffix, {\n            propContainer: caxis,\n            propName: _this.id + '.caxis.title',\n            placeholder: _(gd, 'Click to enter Component C title'),\n            attributes: {\n                x: _this.x0 + _this.w + bpad,\n                y: _this.y0 + _this.h + caxis.title.font.size * 0.83 + bpad,\n                'text-anchor': 'middle'\n            }\n        });\n    }\n};\n\nproto.drawAx = function(ax) {\n    var _this = this;\n    var gd = _this.graphDiv;\n    var axName = ax._name;\n    var axLetter = axName.charAt(0);\n    var axId = ax._id;\n    var axLayer = _this.layers[axName];\n    var counterAngle = 30;\n\n    var stashKey = axLetter + 'tickLayout';\n    var newTickLayout = strTickLayout(ax);\n    if(_this[stashKey] !== newTickLayout) {\n        axLayer.selectAll('.' + axId + 'tick').remove();\n        _this[stashKey] = newTickLayout;\n    }\n\n    ax.setScale();\n\n    var vals = Axes.calcTicks(ax);\n    var valsClipped = Axes.clipEnds(ax, vals);\n    var transFn = Axes.makeTransFn(ax);\n    var tickSign = Axes.getTickSigns(ax)[2];\n\n    var caRad = Lib.deg2rad(counterAngle);\n    var pad = tickSign * (ax.linewidth || 1) / 2;\n    var len = tickSign * ax.ticklen;\n    var w = _this.w;\n    var h = _this.h;\n\n    var tickPath = axLetter === 'b' ?\n        'M0,' + pad + 'l' + (Math.sin(caRad) * len) + ',' + (Math.cos(caRad) * len) :\n        'M' + pad + ',0l' + (Math.cos(caRad) * len) + ',' + (-Math.sin(caRad) * len);\n\n    var gridPath = {\n        a: 'M0,0l' + h + ',-' + (w / 2),\n        b: 'M0,0l-' + (w / 2) + ',-' + h,\n        c: 'M0,0l-' + h + ',' + (w / 2)\n    }[axLetter];\n\n    Axes.drawTicks(gd, ax, {\n        vals: ax.ticks === 'inside' ? valsClipped : vals,\n        layer: axLayer,\n        path: tickPath,\n        transFn: transFn,\n        crisp: false\n    });\n\n    Axes.drawGrid(gd, ax, {\n        vals: valsClipped,\n        layer: _this.layers[axLetter + 'grid'],\n        path: gridPath,\n        transFn: transFn,\n        crisp: false\n    });\n\n    Axes.drawLabels(gd, ax, {\n        vals: vals,\n        layer: axLayer,\n        transFn: transFn,\n        labelFns: Axes.makeLabelFns(ax, 0, counterAngle)\n    });\n};\n\nfunction strTickLayout(axLayout) {\n    return axLayout.ticks + String(axLayout.ticklen) + String(axLayout.showticklabels);\n}\n\n// hard coded paths for zoom corners\n// uses the same sizing as cartesian, length is MINZOOM/2, width is 3px\nvar CLEN = constants.MINZOOM / 2 + 0.87;\nvar BLPATH = 'm-0.87,.5h' + CLEN + 'v3h-' + (CLEN + 5.2) +\n    'l' + (CLEN / 2 + 2.6) + ',-' + (CLEN * 0.87 + 4.5) +\n    'l2.6,1.5l-' + (CLEN / 2) + ',' + (CLEN * 0.87) + 'Z';\nvar BRPATH = 'm0.87,.5h-' + CLEN + 'v3h' + (CLEN + 5.2) +\n    'l-' + (CLEN / 2 + 2.6) + ',-' + (CLEN * 0.87 + 4.5) +\n    'l-2.6,1.5l' + (CLEN / 2) + ',' + (CLEN * 0.87) + 'Z';\nvar TOPPATH = 'm0,1l' + (CLEN / 2) + ',' + (CLEN * 0.87) +\n    'l2.6,-1.5l-' + (CLEN / 2 + 2.6) + ',-' + (CLEN * 0.87 + 4.5) +\n    'l-' + (CLEN / 2 + 2.6) + ',' + (CLEN * 0.87 + 4.5) +\n    'l2.6,1.5l' + (CLEN / 2) + ',-' + (CLEN * 0.87) + 'Z';\nvar STARTMARKER = 'm0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z';\n\n// I guess this could be shared with cartesian... but for now it's separate.\nvar SHOWZOOMOUTTIP = true;\n\nproto.clearSelect = function() {\n    clearSelectionsCache(this.dragOptions);\n    clearSelect(this.dragOptions.gd);\n};\n\nproto.initInteractions = function() {\n    var _this = this;\n    var dragger = _this.layers.plotbg.select('path').node();\n    var gd = _this.graphDiv;\n    var zoomLayer = gd._fullLayout._zoomlayer;\n\n    // use plotbg for the main interactions\n    this.dragOptions = {\n        element: dragger,\n        gd: gd,\n        plotinfo: {\n            id: _this.id,\n            domain: gd._fullLayout[_this.id].domain,\n            xaxis: _this.xaxis,\n            yaxis: _this.yaxis\n        },\n        subplot: _this.id,\n        prepFn: function(e, startX, startY) {\n            // these aren't available yet when initInteractions\n            // is called\n            _this.dragOptions.xaxes = [_this.xaxis];\n            _this.dragOptions.yaxes = [_this.yaxis];\n\n            var dragModeNow = _this.dragOptions.dragmode = gd._fullLayout.dragmode;\n\n            if(freeMode(dragModeNow)) _this.dragOptions.minDrag = 1;\n            else _this.dragOptions.minDrag = undefined;\n\n            if(dragModeNow === 'zoom') {\n                _this.dragOptions.moveFn = zoomMove;\n                _this.dragOptions.clickFn = clickZoomPan;\n                _this.dragOptions.doneFn = zoomDone;\n                zoomPrep(e, startX, startY);\n            } else if(dragModeNow === 'pan') {\n                _this.dragOptions.moveFn = plotDrag;\n                _this.dragOptions.clickFn = clickZoomPan;\n                _this.dragOptions.doneFn = dragDone;\n                panPrep();\n                _this.clearSelect(gd);\n            } else if(rectMode(dragModeNow) || freeMode(dragModeNow)) {\n                prepSelect(e, startX, startY, _this.dragOptions, dragModeNow);\n            }\n        }\n    };\n\n    var x0, y0, mins0, span0, mins, lum, path0, dimmed, zb, corners;\n\n    function makeUpdate(_mins) {\n        var attrs = {};\n        attrs[_this.id + '.aaxis.min'] = _mins.a;\n        attrs[_this.id + '.baxis.min'] = _mins.b;\n        attrs[_this.id + '.caxis.min'] = _mins.c;\n        return attrs;\n    }\n\n    function clickZoomPan(numClicks, evt) {\n        var clickMode = gd._fullLayout.clickmode;\n\n        removeZoombox(gd);\n\n        if(numClicks === 2) {\n            gd.emit('plotly_doubleclick', null);\n            Registry.call('_guiRelayout', gd, makeUpdate({a: 0, b: 0, c: 0}));\n        }\n\n        if(clickMode.indexOf('select') > -1 && numClicks === 1) {\n            selectOnClick(evt, gd, [_this.xaxis], [_this.yaxis], _this.id, _this.dragOptions);\n        }\n\n        if(clickMode.indexOf('event') > -1) {\n            Fx.click(gd, evt, _this.id);\n        }\n    }\n\n    function zoomPrep(e, startX, startY) {\n        var dragBBox = dragger.getBoundingClientRect();\n        x0 = startX - dragBBox.left;\n        y0 = startY - dragBBox.top;\n        mins0 = {\n            a: _this.aaxis.range[0],\n            b: _this.baxis.range[1],\n            c: _this.caxis.range[1]\n        };\n        mins = mins0;\n        span0 = _this.aaxis.range[1] - mins0.a;\n        lum = tinycolor(_this.graphDiv._fullLayout[_this.id].bgcolor).getLuminance();\n        path0 = 'M0,' + _this.h + 'L' + (_this.w / 2) + ', 0L' + _this.w + ',' + _this.h + 'Z';\n        dimmed = false;\n\n        zb = zoomLayer.append('path')\n            .attr('class', 'zoombox')\n            .attr('transform', 'translate(' + _this.x0 + ', ' + _this.y0 + ')')\n            .style({\n                'fill': lum > 0.2 ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)',\n                'stroke-width': 0\n            })\n            .attr('d', path0);\n\n        corners = zoomLayer.append('path')\n            .attr('class', 'zoombox-corners')\n            .attr('transform', 'translate(' + _this.x0 + ', ' + _this.y0 + ')')\n            .style({\n                fill: Color.background,\n                stroke: Color.defaultLine,\n                'stroke-width': 1,\n                opacity: 0\n            })\n            .attr('d', 'M0,0Z');\n\n        _this.clearSelect(gd);\n    }\n\n    function getAFrac(x, y) { return 1 - (y / _this.h); }\n    function getBFrac(x, y) { return 1 - ((x + (_this.h - y) / Math.sqrt(3)) / _this.w); }\n    function getCFrac(x, y) { return ((x - (_this.h - y) / Math.sqrt(3)) / _this.w); }\n\n    function zoomMove(dx0, dy0) {\n        var x1 = x0 + dx0;\n        var y1 = y0 + dy0;\n        var afrac = Math.max(0, Math.min(1, getAFrac(x0, y0), getAFrac(x1, y1)));\n        var bfrac = Math.max(0, Math.min(1, getBFrac(x0, y0), getBFrac(x1, y1)));\n        var cfrac = Math.max(0, Math.min(1, getCFrac(x0, y0), getCFrac(x1, y1)));\n        var xLeft = ((afrac / 2) + cfrac) * _this.w;\n        var xRight = (1 - (afrac / 2) - bfrac) * _this.w;\n        var xCenter = (xLeft + xRight) / 2;\n        var xSpan = xRight - xLeft;\n        var yBottom = (1 - afrac) * _this.h;\n        var yTop = yBottom - xSpan / whRatio;\n\n        if(xSpan < constants.MINZOOM) {\n            mins = mins0;\n            zb.attr('d', path0);\n            corners.attr('d', 'M0,0Z');\n        } else {\n            mins = {\n                a: mins0.a + afrac * span0,\n                b: mins0.b + bfrac * span0,\n                c: mins0.c + cfrac * span0\n            };\n            zb.attr('d', path0 + 'M' + xLeft + ',' + yBottom +\n                'H' + xRight + 'L' + xCenter + ',' + yTop +\n                'L' + xLeft + ',' + yBottom + 'Z');\n            corners.attr('d', 'M' + x0 + ',' + y0 + STARTMARKER +\n                'M' + xLeft + ',' + yBottom + BLPATH +\n                'M' + xRight + ',' + yBottom + BRPATH +\n                'M' + xCenter + ',' + yTop + TOPPATH);\n        }\n\n        if(!dimmed) {\n            zb.transition()\n                .style('fill', lum > 0.2 ? 'rgba(0,0,0,0.4)' :\n                    'rgba(255,255,255,0.3)')\n                .duration(200);\n            corners.transition()\n                .style('opacity', 1)\n                .duration(200);\n            dimmed = true;\n        }\n\n        gd.emit('plotly_relayouting', makeUpdate(mins));\n    }\n\n    function zoomDone() {\n        removeZoombox(gd);\n\n        if(mins === mins0) return;\n\n        Registry.call('_guiRelayout', gd, makeUpdate(mins));\n\n        if(SHOWZOOMOUTTIP && gd.data && gd._context.showTips) {\n            Lib.notifier(_(gd, 'Double-click to zoom back out'), 'long');\n            SHOWZOOMOUTTIP = false;\n        }\n    }\n\n    function panPrep() {\n        mins0 = {\n            a: _this.aaxis.range[0],\n            b: _this.baxis.range[1],\n            c: _this.caxis.range[1]\n        };\n        mins = mins0;\n    }\n\n    function plotDrag(dx, dy) {\n        var dxScaled = dx / _this.xaxis._m;\n        var dyScaled = dy / _this.yaxis._m;\n        mins = {\n            a: mins0.a - dyScaled,\n            b: mins0.b + (dxScaled + dyScaled) / 2,\n            c: mins0.c - (dxScaled - dyScaled) / 2\n        };\n        var minsorted = [mins.a, mins.b, mins.c].sort(Lib.sorterAsc);\n        var minindices = {\n            a: minsorted.indexOf(mins.a),\n            b: minsorted.indexOf(mins.b),\n            c: minsorted.indexOf(mins.c)\n        };\n        if(minsorted[0] < 0) {\n            if(minsorted[1] + minsorted[0] / 2 < 0) {\n                minsorted[2] += minsorted[0] + minsorted[1];\n                minsorted[0] = minsorted[1] = 0;\n            } else {\n                minsorted[2] += minsorted[0] / 2;\n                minsorted[1] += minsorted[0] / 2;\n                minsorted[0] = 0;\n            }\n            mins = {\n                a: minsorted[minindices.a],\n                b: minsorted[minindices.b],\n                c: minsorted[minindices.c]\n            };\n            dy = (mins0.a - mins.a) * _this.yaxis._m;\n            dx = (mins0.c - mins.c - mins0.b + mins.b) * _this.xaxis._m;\n        }\n\n        // move the data (translate, don't redraw)\n        var plotTransform = 'translate(' + (_this.x0 + dx) + ',' + (_this.y0 + dy) + ')';\n        _this.plotContainer.selectAll('.scatterlayer,.maplayer')\n            .attr('transform', plotTransform);\n\n        var plotTransform2 = 'translate(' + -dx + ',' + -dy + ')';\n        _this.clipDefRelative.select('path').attr('transform', plotTransform2);\n\n        // move the ticks\n        _this.aaxis.range = [mins.a, _this.sum - mins.b - mins.c];\n        _this.baxis.range = [_this.sum - mins.a - mins.c, mins.b];\n        _this.caxis.range = [_this.sum - mins.a - mins.b, mins.c];\n\n        _this.drawAxes(false);\n\n        if(_this._hasClipOnAxisFalse) {\n            _this.plotContainer\n                .select('.scatterlayer').selectAll('.trace')\n                .call(Drawing.hideOutsideRangePoints, _this);\n        }\n\n        gd.emit('plotly_relayouting', makeUpdate(mins));\n    }\n\n    function dragDone() {\n        Registry.call('_guiRelayout', gd, makeUpdate(mins));\n    }\n\n    // finally, set up hover and click\n    // these event handlers must already be set before dragElement.init\n    // so it can stash them and override them.\n    dragger.onmousemove = function(evt) {\n        Fx.hover(gd, evt, _this.id);\n        gd._fullLayout._lasthover = dragger;\n        gd._fullLayout._hoversubplot = _this.id;\n    };\n\n    dragger.onmouseout = function(evt) {\n        if(gd._dragging) return;\n\n        dragElement.unhover(gd, evt);\n    };\n\n    dragElement.init(this.dragOptions);\n};\n\nfunction removeZoombox(gd) {\n    d3.select(gd)\n        .selectAll('.zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners')\n        .remove();\n}\n\n},{\"../../components/color\":52,\"../../components/dragelement\":71,\"../../components/dragelement/helpers\":70,\"../../components/drawing\":74,\"../../components/fx\":92,\"../../components/titles\":147,\"../../lib\":178,\"../../lib/extend\":173,\"../../registry\":269,\"../cartesian/axes\":222,\"../cartesian/constants\":228,\"../cartesian/select\":241,\"../cartesian/set_convert\":242,\"../plots\":256,\"d3\":16,\"tinycolor2\":35}],269:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Loggers = _dereq_('./lib/loggers');\nvar noop = _dereq_('./lib/noop');\nvar pushUnique = _dereq_('./lib/push_unique');\nvar isPlainObject = _dereq_('./lib/is_plain_object');\nvar addStyleRule = _dereq_('./lib/dom').addStyleRule;\nvar ExtendModule = _dereq_('./lib/extend');\n\nvar basePlotAttributes = _dereq_('./plots/attributes');\nvar baseLayoutAttributes = _dereq_('./plots/layout_attributes');\n\nvar extendFlat = ExtendModule.extendFlat;\nvar extendDeepAll = ExtendModule.extendDeepAll;\n\nexports.modules = {};\nexports.allCategories = {};\nexports.allTypes = [];\nexports.subplotsRegistry = {};\nexports.transformsRegistry = {};\nexports.componentsRegistry = {};\nexports.layoutArrayContainers = [];\nexports.layoutArrayRegexes = [];\nexports.traceLayoutAttributes = {};\nexports.localeRegistry = {};\nexports.apiMethodRegistry = {};\nexports.collectableSubplotTypes = null;\n\n/**\n * Top-level register routine, exported as Plotly.register\n *\n * @param {object array or array of objects} _modules :\n *  module object or list of module object to register.\n *\n *  A valid `moduleType: 'trace'` module has fields:\n *  - name {string} : the trace type\n *  - categories {array} : categories associated with this trace type,\n *                         tested with Register.traceIs()\n *  - meta {object} : meta info (mostly for plot-schema)\n *\n *  A valid `moduleType: 'locale'` module has fields:\n *  - name {string} : the locale name. Should be a 2-digit language string ('en', 'de')\n *                    optionally with a country/region code ('en-GB', 'de-CH'). If a country\n *                    code is used but the base language locale has not yet been supplied,\n *                    we will use this locale for the base as well.\n *  - dictionary {object} : the dictionary mapping input strings to localized strings\n *                          generally the keys should be the literal input strings, but\n *                          if default translations are provided you can use any string as a key.\n *  - format {object} : a `d3.locale` format specifier for this locale\n *                      any omitted keys we'll fall back on en-US.\n *\n *  A valid `moduleType: 'transform'` module has fields:\n *  - name {string} : transform name\n *  - transform {function} : default-level transform function\n *  - calcTransform {function} : calc-level transform function\n *  - attributes {object} : transform attributes declarations\n *  - supplyDefaults {function} : attributes default-supply function\n *\n *  A valid `moduleType: 'component'` module has fields:\n *  - name {string} : the component name, used it with Register.getComponentMethod()\n *                    to employ component method.\n *\n *  A valid `moduleType: 'apiMethod'` module has fields:\n *  - name {string} : the api method name.\n *  - fn {function} : the api method called with Register.call();\n *\n */\nexports.register = function register(_modules) {\n    exports.collectableSubplotTypes = null;\n\n    if(!_modules) {\n        throw new Error('No argument passed to Plotly.register.');\n    } else if(_modules && !Array.isArray(_modules)) {\n        _modules = [_modules];\n    }\n\n    for(var i = 0; i < _modules.length; i++) {\n        var newModule = _modules[i];\n\n        if(!newModule) {\n            throw new Error('Invalid module was attempted to be registered!');\n        }\n\n        switch(newModule.moduleType) {\n            case 'trace':\n                registerTraceModule(newModule);\n                break;\n            case 'transform':\n                registerTransformModule(newModule);\n                break;\n            case 'component':\n                registerComponentModule(newModule);\n                break;\n            case 'locale':\n                registerLocale(newModule);\n                break;\n            case 'apiMethod':\n                var name = newModule.name;\n                exports.apiMethodRegistry[name] = newModule.fn;\n                break;\n            default:\n                throw new Error('Invalid module was attempted to be registered!');\n        }\n    }\n};\n\n/**\n * Get registered module using trace object or trace type\n *\n * @param {object||string} trace\n *  trace object with prop 'type' or trace type as a string\n * @return {object}\n *  module object corresponding to trace type\n */\nexports.getModule = function(trace) {\n    var _module = exports.modules[getTraceType(trace)];\n    if(!_module) return false;\n    return _module._module;\n};\n\n/**\n * Determine if this trace type is in a given category\n *\n * @param {object||string} traceType\n *  a trace (object) or trace type (string)\n * @param {string} category\n *  category in question\n * @return {boolean}\n */\nexports.traceIs = function(traceType, category) {\n    traceType = getTraceType(traceType);\n\n    // old Chart Studio Cloud workspace hack, nothing to see here\n    if(traceType === 'various') return false;\n\n    var _module = exports.modules[traceType];\n\n    if(!_module) {\n        if(traceType && traceType !== 'area') {\n            Loggers.log('Unrecognized trace type ' + traceType + '.');\n        }\n\n        _module = exports.modules[basePlotAttributes.type.dflt];\n    }\n\n    return !!_module.categories[category];\n};\n\n/**\n * Determine if this trace has a transform of the given type and return\n * array of matching indices.\n *\n * @param {object} data\n *  a trace object (member of data or fullData)\n * @param {string} type\n *  type of trace to test\n * @return {array}\n *  array of matching indices. If none found, returns []\n */\nexports.getTransformIndices = function(data, type) {\n    var indices = [];\n    var transforms = data.transforms || [];\n    for(var i = 0; i < transforms.length; i++) {\n        if(transforms[i].type === type) {\n            indices.push(i);\n        }\n    }\n    return indices;\n};\n\n/**\n * Determine if this trace has a transform of the given type\n *\n * @param {object} data\n *  a trace object (member of data or fullData)\n * @param {string} type\n *  type of trace to test\n * @return {boolean}\n */\nexports.hasTransform = function(data, type) {\n    var transforms = data.transforms || [];\n    for(var i = 0; i < transforms.length; i++) {\n        if(transforms[i].type === type) {\n            return true;\n        }\n    }\n    return false;\n};\n\n/**\n * Retrieve component module method. Falls back on noop if either the\n * module or the method is missing, so the result can always be safely called\n *\n * @param {string} name\n *  name of component (as declared in component module)\n * @param {string} method\n *  name of component module method\n * @return {function}\n */\nexports.getComponentMethod = function(name, method) {\n    var _module = exports.componentsRegistry[name];\n\n    if(!_module) return noop;\n    return _module[method] || noop;\n};\n\n/**\n * Call registered api method.\n *\n * @param {string} name : api method name\n * @param {...array} args : arguments passed to api method\n * @return {any} : returns api method output\n */\nexports.call = function() {\n    var name = arguments[0];\n    var args = [].slice.call(arguments, 1);\n    return exports.apiMethodRegistry[name].apply(null, args);\n};\n\nfunction registerTraceModule(_module) {\n    var thisType = _module.name;\n    var categoriesIn = _module.categories;\n    var meta = _module.meta;\n\n    if(exports.modules[thisType]) {\n        Loggers.log('Type ' + thisType + ' already registered');\n        return;\n    }\n\n    if(!exports.subplotsRegistry[_module.basePlotModule.name]) {\n        registerSubplot(_module.basePlotModule);\n    }\n\n    var categoryObj = {};\n    for(var i = 0; i < categoriesIn.length; i++) {\n        categoryObj[categoriesIn[i]] = true;\n        exports.allCategories[categoriesIn[i]] = true;\n    }\n\n    exports.modules[thisType] = {\n        _module: _module,\n        categories: categoryObj\n    };\n\n    if(meta && Object.keys(meta).length) {\n        exports.modules[thisType].meta = meta;\n    }\n\n    exports.allTypes.push(thisType);\n\n    for(var componentName in exports.componentsRegistry) {\n        mergeComponentAttrsToTrace(componentName, thisType);\n    }\n\n    /*\n     * Collect all trace layout attributes in one place for easier lookup later\n     * but don't merge them into the base schema as it would confuse the docs\n     * (at least after https://github.com/plotly/documentation/issues/202 gets done!)\n     */\n    if(_module.layoutAttributes) {\n        extendFlat(exports.traceLayoutAttributes, _module.layoutAttributes);\n    }\n\n    var basePlotModule = _module.basePlotModule;\n    var bpmName = basePlotModule.name;\n\n    // add mapbox-gl CSS here to avoid console warning on instantiation\n    if(bpmName === 'mapbox') {\n        var styleRules = basePlotModule.constants.styleRules;\n        for(var k in styleRules) {\n            addStyleRule('.js-plotly-plot .plotly .mapboxgl-' + k, styleRules[k]);\n        }\n    }\n\n    // if `plotly-geo-assets.js` is not included,\n    // add `PlotlyGeoAssets` global to stash references to all fetched\n    // topojson / geojson data\n    if((bpmName === 'geo' || bpmName === 'mapbox') &&\n        (typeof window !== undefined && window.PlotlyGeoAssets === undefined)\n    ) {\n        window.PlotlyGeoAssets = {topojson: {}};\n    }\n}\n\nfunction registerSubplot(_module) {\n    var plotType = _module.name;\n\n    if(exports.subplotsRegistry[plotType]) {\n        Loggers.log('Plot type ' + plotType + ' already registered.');\n        return;\n    }\n\n    // relayout array handling will look for component module methods with this\n    // name and won't find them because this is a subplot module... but that\n    // should be fine, it will just fall back on redrawing the plot.\n    findArrayRegexps(_module);\n\n    // not sure what's best for the 'cartesian' type at this point\n    exports.subplotsRegistry[plotType] = _module;\n\n    for(var componentName in exports.componentsRegistry) {\n        mergeComponentAttrsToSubplot(componentName, _module.name);\n    }\n}\n\nfunction registerComponentModule(_module) {\n    if(typeof _module.name !== 'string') {\n        throw new Error('Component module *name* must be a string.');\n    }\n\n    var name = _module.name;\n    exports.componentsRegistry[name] = _module;\n\n    if(_module.layoutAttributes) {\n        if(_module.layoutAttributes._isLinkedToArray) {\n            pushUnique(exports.layoutArrayContainers, name);\n        }\n        findArrayRegexps(_module);\n    }\n\n    for(var traceType in exports.modules) {\n        mergeComponentAttrsToTrace(name, traceType);\n    }\n\n    for(var subplotName in exports.subplotsRegistry) {\n        mergeComponentAttrsToSubplot(name, subplotName);\n    }\n\n    for(var transformType in exports.transformsRegistry) {\n        mergeComponentAttrsToTransform(name, transformType);\n    }\n\n    if(_module.schema && _module.schema.layout) {\n        extendDeepAll(baseLayoutAttributes, _module.schema.layout);\n    }\n}\n\nfunction registerTransformModule(_module) {\n    if(typeof _module.name !== 'string') {\n        throw new Error('Transform module *name* must be a string.');\n    }\n\n    var prefix = 'Transform module ' + _module.name;\n    var hasTransform = typeof _module.transform === 'function';\n    var hasCalcTransform = typeof _module.calcTransform === 'function';\n\n    if(!hasTransform && !hasCalcTransform) {\n        throw new Error(prefix + ' is missing a *transform* or *calcTransform* method.');\n    }\n    if(hasTransform && hasCalcTransform) {\n        Loggers.log([\n            prefix + ' has both a *transform* and *calcTransform* methods.',\n            'Please note that all *transform* methods are executed',\n            'before all *calcTransform* methods.'\n        ].join(' '));\n    }\n    if(!isPlainObject(_module.attributes)) {\n        Loggers.log(prefix + ' registered without an *attributes* object.');\n    }\n    if(typeof _module.supplyDefaults !== 'function') {\n        Loggers.log(prefix + ' registered without a *supplyDefaults* method.');\n    }\n\n    exports.transformsRegistry[_module.name] = _module;\n\n    for(var componentName in exports.componentsRegistry) {\n        mergeComponentAttrsToTransform(componentName, _module.name);\n    }\n}\n\nfunction registerLocale(_module) {\n    var locale = _module.name;\n    var baseLocale = locale.split('-')[0];\n\n    var newDict = _module.dictionary;\n    var newFormat = _module.format;\n    var hasDict = newDict && Object.keys(newDict).length;\n    var hasFormat = newFormat && Object.keys(newFormat).length;\n\n    var locales = exports.localeRegistry;\n\n    var localeObj = locales[locale];\n    if(!localeObj) locales[locale] = localeObj = {};\n\n    // Should we use this dict for the base locale?\n    // In case we're overwriting a previous dict for this locale, check\n    // whether the base matches the full locale dict now. If we're not\n    // overwriting, locales[locale] is undefined so this just checks if\n    // baseLocale already had a dict or not.\n    // Same logic for dateFormats\n    if(baseLocale !== locale) {\n        var baseLocaleObj = locales[baseLocale];\n        if(!baseLocaleObj) locales[baseLocale] = baseLocaleObj = {};\n\n        if(hasDict && baseLocaleObj.dictionary === localeObj.dictionary) {\n            baseLocaleObj.dictionary = newDict;\n        }\n        if(hasFormat && baseLocaleObj.format === localeObj.format) {\n            baseLocaleObj.format = newFormat;\n        }\n    }\n\n    if(hasDict) localeObj.dictionary = newDict;\n    if(hasFormat) localeObj.format = newFormat;\n}\n\nfunction findArrayRegexps(_module) {\n    if(_module.layoutAttributes) {\n        var arrayAttrRegexps = _module.layoutAttributes._arrayAttrRegexps;\n        if(arrayAttrRegexps) {\n            for(var i = 0; i < arrayAttrRegexps.length; i++) {\n                pushUnique(exports.layoutArrayRegexes, arrayAttrRegexps[i]);\n            }\n        }\n    }\n}\n\nfunction mergeComponentAttrsToTrace(componentName, traceType) {\n    var componentSchema = exports.componentsRegistry[componentName].schema;\n    if(!componentSchema || !componentSchema.traces) return;\n\n    var traceAttrs = componentSchema.traces[traceType];\n    if(traceAttrs) {\n        extendDeepAll(exports.modules[traceType]._module.attributes, traceAttrs);\n    }\n}\n\nfunction mergeComponentAttrsToTransform(componentName, transformType) {\n    var componentSchema = exports.componentsRegistry[componentName].schema;\n    if(!componentSchema || !componentSchema.transforms) return;\n\n    var transformAttrs = componentSchema.transforms[transformType];\n    if(transformAttrs) {\n        extendDeepAll(exports.transformsRegistry[transformType].attributes, transformAttrs);\n    }\n}\n\nfunction mergeComponentAttrsToSubplot(componentName, subplotName) {\n    var componentSchema = exports.componentsRegistry[componentName].schema;\n    if(!componentSchema || !componentSchema.subplots) return;\n\n    var subplotModule = exports.subplotsRegistry[subplotName];\n    var subplotAttrs = subplotModule.layoutAttributes;\n    var subplotAttr = subplotModule.attr === 'subplot' ? subplotModule.name : subplotModule.attr;\n    if(Array.isArray(subplotAttr)) subplotAttr = subplotAttr[0];\n\n    var componentLayoutAttrs = componentSchema.subplots[subplotAttr];\n    if(subplotAttrs && componentLayoutAttrs) {\n        extendDeepAll(subplotAttrs, componentLayoutAttrs);\n    }\n}\n\nfunction getTraceType(traceType) {\n    if(typeof traceType === 'object') traceType = traceType.type;\n    return traceType;\n}\n\n},{\"./lib/dom\":171,\"./lib/extend\":173,\"./lib/is_plain_object\":179,\"./lib/loggers\":182,\"./lib/noop\":187,\"./lib/push_unique\":191,\"./plots/attributes\":219,\"./plots/layout_attributes\":254}],270:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\n\nvar extendFlat = Lib.extendFlat;\nvar extendDeep = Lib.extendDeep;\n\n// Put default plotTile layouts here\nfunction cloneLayoutOverride(tileClass) {\n    var override;\n\n    switch(tileClass) {\n        case 'themes__thumb':\n            override = {\n                autosize: true,\n                width: 150,\n                height: 150,\n                title: {text: ''},\n                showlegend: false,\n                margin: {l: 5, r: 5, t: 5, b: 5, pad: 0},\n                annotations: []\n            };\n            break;\n\n        case 'thumbnail':\n            override = {\n                title: {text: ''},\n                hidesources: true,\n                showlegend: false,\n                borderwidth: 0,\n                bordercolor: '',\n                margin: {l: 1, r: 1, t: 1, b: 1, pad: 0},\n                annotations: []\n            };\n            break;\n\n        default:\n            override = {};\n    }\n\n\n    return override;\n}\n\nfunction keyIsAxis(keyName) {\n    var types = ['xaxis', 'yaxis', 'zaxis'];\n    return (types.indexOf(keyName.slice(0, 5)) > -1);\n}\n\n\nmodule.exports = function clonePlot(graphObj, options) {\n    // Polar plot compatibility\n    if(graphObj.framework && graphObj.framework.isPolar) {\n        graphObj = graphObj.framework.getConfig();\n    }\n\n    var i;\n    var oldData = graphObj.data;\n    var oldLayout = graphObj.layout;\n    var newData = extendDeep([], oldData);\n    var newLayout = extendDeep({}, oldLayout, cloneLayoutOverride(options.tileClass));\n    var context = graphObj._context || {};\n\n    if(options.width) newLayout.width = options.width;\n    if(options.height) newLayout.height = options.height;\n\n    if(options.tileClass === 'thumbnail' || options.tileClass === 'themes__thumb') {\n        // kill annotations\n        newLayout.annotations = [];\n        var keys = Object.keys(newLayout);\n\n        for(i = 0; i < keys.length; i++) {\n            if(keyIsAxis(keys[i])) {\n                newLayout[keys[i]].title = {text: ''};\n            }\n        }\n\n        // kill colorbar and pie labels\n        for(i = 0; i < newData.length; i++) {\n            var trace = newData[i];\n            trace.showscale = false;\n            if(trace.marker) trace.marker.showscale = false;\n            if(Registry.traceIs(trace, 'pie-like')) trace.textposition = 'none';\n        }\n    }\n\n    if(Array.isArray(options.annotations)) {\n        for(i = 0; i < options.annotations.length; i++) {\n            newLayout.annotations.push(options.annotations[i]);\n        }\n    }\n\n    // TODO: does this scene modification really belong here?\n    // If we still need it, can it move into the gl3d module?\n    var sceneIds = Object.keys(newLayout).filter(function(key) {\n        return key.match(/^scene\\d*$/);\n    });\n    if(sceneIds.length) {\n        var axesImageOverride = {};\n        if(options.tileClass === 'thumbnail') {\n            axesImageOverride = {\n                title: {text: ''},\n                showaxeslabels: false,\n                showticklabels: false,\n                linetickenable: false\n            };\n        }\n        for(i = 0; i < sceneIds.length; i++) {\n            var scene = newLayout[sceneIds[i]];\n\n            if(!scene.xaxis) {\n                scene.xaxis = {};\n            }\n\n            if(!scene.yaxis) {\n                scene.yaxis = {};\n            }\n\n            if(!scene.zaxis) {\n                scene.zaxis = {};\n            }\n\n            extendFlat(scene.xaxis, axesImageOverride);\n            extendFlat(scene.yaxis, axesImageOverride);\n            extendFlat(scene.zaxis, axesImageOverride);\n\n            // TODO what does this do?\n            scene._scene = null;\n        }\n    }\n\n    var gd = document.createElement('div');\n    if(options.tileClass) gd.className = options.tileClass;\n\n    var plotTile = {\n        gd: gd,\n        td: gd, // for external (image server) compatibility\n        layout: newLayout,\n        data: newData,\n        config: {\n            staticPlot: (options.staticPlot === undefined) ?\n                true :\n                options.staticPlot,\n            plotGlPixelRatio: (options.plotGlPixelRatio === undefined) ?\n                2 :\n                options.plotGlPixelRatio,\n            displaylogo: options.displaylogo || false,\n            showLink: options.showLink || false,\n            showTips: options.showTips || false,\n            mapboxAccessToken: context.mapboxAccessToken\n        }\n    };\n\n    if(options.setBackground !== 'transparent') {\n        plotTile.config.setBackground = options.setBackground || 'opaque';\n    }\n\n    // attaching the default Layout the gd, so you can grab it later\n    plotTile.gd.defaultLayout = cloneLayoutOverride(options.tileClass);\n\n    return plotTile;\n};\n\n},{\"../lib\":178,\"../registry\":269}],271:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\n\nvar toImage = _dereq_('../plot_api/to_image');\n\nvar fileSaver = _dereq_('./filesaver');\nvar helpers = _dereq_('./helpers');\n\n/**\n * Plotly.downloadImage\n *\n * @param {object | string | HTML div} gd\n *   can either be a data/layout/config object\n *   or an existing graph <div>\n *   or an id to an existing graph <div>\n * @param {object} opts (see Plotly.toImage in ../plot_api/to_image)\n * @return {promise}\n */\nfunction downloadImage(gd, opts) {\n    var _gd;\n    if(!Lib.isPlainObject(gd)) _gd = Lib.getGraphDiv(gd);\n\n    opts = opts || {};\n    opts.format = opts.format || 'png';\n    opts.imageDataOnly = true;\n\n    return new Promise(function(resolve, reject) {\n        if(_gd && _gd._snapshotInProgress) {\n            reject(new Error('Snapshotting already in progress.'));\n        }\n\n        // see comments within svgtoimg for additional\n        //   discussion of problems with IE\n        //   can now draw to canvas, but CORS tainted canvas\n        //   does not allow toDataURL\n        //   svg format will work though\n        if(Lib.isIE() && opts.format !== 'svg') {\n            reject(new Error(helpers.MSG_IE_BAD_FORMAT));\n        }\n\n        if(_gd) _gd._snapshotInProgress = true;\n        var promise = toImage(gd, opts);\n\n        var filename = opts.filename || gd.fn || 'newplot';\n        filename += '.' + opts.format.replace('-', '.');\n\n        promise.then(function(result) {\n            if(_gd) _gd._snapshotInProgress = false;\n            return fileSaver(result, filename, opts.format);\n        }).then(function(name) {\n            resolve(name);\n        }).catch(function(err) {\n            if(_gd) _gd._snapshotInProgress = false;\n            reject(err);\n        });\n    });\n}\n\nmodule.exports = downloadImage;\n\n},{\"../lib\":178,\"../plot_api/to_image\":215,\"./filesaver\":272,\"./helpers\":273}],272:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar helpers = _dereq_('./helpers');\n\n/*\n* substantial portions of this code from FileSaver.js\n* https://github.com/eligrey/FileSaver.js\n* License: https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n* FileSaver.js\n* A saveAs() FileSaver implementation.\n* 1.1.20160328\n*\n* By Eli Grey, http://eligrey.com\n* License: MIT\n*   See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n*/\nfunction fileSaver(url, name, format) {\n    var saveLink = document.createElement('a');\n    var canUseSaveLink = 'download' in saveLink;\n\n    var promise = new Promise(function(resolve, reject) {\n        var blob;\n        var objectUrl;\n\n        if(Lib.isIE9orBelow()) {\n            reject(new Error('IE < 10 unsupported'));\n        }\n\n        // Safari doesn't allow downloading of blob urls\n        if(Lib.isSafari()) {\n            var prefix = format === 'svg' ? ',' : ';base64,';\n            helpers.octetStream(prefix + encodeURIComponent(url));\n            return resolve(name);\n        }\n\n        // IE 10+ (native saveAs)\n        if(Lib.isIE()) {\n            // At this point we are only dealing with a decoded SVG as\n            // a data URL (since IE only supports SVG)\n            blob = helpers.createBlob(url, 'svg');\n            window.navigator.msSaveBlob(blob, name);\n            blob = null;\n            return resolve(name);\n        }\n\n        if(canUseSaveLink) {\n            blob = helpers.createBlob(url, format);\n            objectUrl = helpers.createObjectURL(blob);\n\n            saveLink.href = objectUrl;\n            saveLink.download = name;\n            document.body.appendChild(saveLink);\n            saveLink.click();\n\n            document.body.removeChild(saveLink);\n            helpers.revokeObjectURL(objectUrl);\n            blob = null;\n\n            return resolve(name);\n        }\n\n        reject(new Error('download error'));\n    });\n\n    return promise;\n}\n\n\nmodule.exports = fileSaver;\n\n},{\"../lib\":178,\"./helpers\":273}],273:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\n\nexports.getDelay = function(fullLayout) {\n    if(!fullLayout._has) return 0;\n\n    return (\n        fullLayout._has('gl3d') ||\n        fullLayout._has('gl2d') ||\n        fullLayout._has('mapbox')\n    ) ? 500 : 0;\n};\n\nexports.getRedrawFunc = function(gd) {\n    return function() {\n        var fullLayout = gd._fullLayout || {};\n        var hasPolar = fullLayout._has && fullLayout._has('polar');\n        var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;\n\n        if(!hasLegacyPolar) {\n            Registry.getComponentMethod('colorbar', 'draw')(gd);\n        }\n    };\n};\n\nexports.encodeSVG = function(svg) {\n    return 'data:image/svg+xml,' + encodeURIComponent(svg);\n};\n\nexports.encodeJSON = function(json) {\n    return 'data:application/json,' + encodeURIComponent(json);\n};\n\nvar DOM_URL = window.URL || window.webkitURL;\n\nexports.createObjectURL = function(blob) {\n    return DOM_URL.createObjectURL(blob);\n};\n\nexports.revokeObjectURL = function(url) {\n    return DOM_URL.revokeObjectURL(url);\n};\n\nexports.createBlob = function(url, format) {\n    if(format === 'svg') {\n        return new window.Blob([url], {type: 'image/svg+xml;charset=utf-8'});\n    } else if(format === 'full-json') {\n        return new window.Blob([url], {type: 'application/json;charset=utf-8'});\n    } else {\n        var binary = fixBinary(window.atob(url));\n        return new window.Blob([binary], {type: 'image/' + format});\n    }\n};\n\nexports.octetStream = function(s) {\n    document.location.href = 'data:application/octet-stream' + s;\n};\n\n// Taken from https://bl.ocks.org/nolanlawson/0eac306e4dac2114c752\nfunction fixBinary(b) {\n    var len = b.length;\n    var buf = new ArrayBuffer(len);\n    var arr = new Uint8Array(buf);\n    for(var i = 0; i < len; i++) {\n        arr[i] = b.charCodeAt(i);\n    }\n    return buf;\n}\n\nexports.IMAGE_URL_PREFIX = /^data:image\\/\\w+;base64,/;\n\nexports.MSG_IE_BAD_FORMAT = 'Sorry IE does not support downloading from canvas. Try {format:\\'svg\\'} instead.';\n\n},{\"../registry\":269}],274:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar helpers = _dereq_('./helpers');\n\nvar Snapshot = {\n    getDelay: helpers.getDelay,\n    getRedrawFunc: helpers.getRedrawFunc,\n    clone: _dereq_('./cloneplot'),\n    toSVG: _dereq_('./tosvg'),\n    svgToImg: _dereq_('./svgtoimg'),\n    toImage: _dereq_('./toimage'),\n    downloadImage: _dereq_('./download')\n};\n\nmodule.exports = Snapshot;\n\n},{\"./cloneplot\":270,\"./download\":271,\"./helpers\":273,\"./svgtoimg\":275,\"./toimage\":276,\"./tosvg\":277}],275:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar EventEmitter = _dereq_('events').EventEmitter;\n\nvar helpers = _dereq_('./helpers');\n\nfunction svgToImg(opts) {\n    var ev = opts.emitter || new EventEmitter();\n\n    var promise = new Promise(function(resolve, reject) {\n        var Image = window.Image;\n        var svg = opts.svg;\n        var format = opts.format || 'png';\n\n        // IE only support svg\n        if(Lib.isIE() && format !== 'svg') {\n            var ieSvgError = new Error(helpers.MSG_IE_BAD_FORMAT);\n            reject(ieSvgError);\n            // eventually remove the ev\n            //  in favor of promises\n            if(!opts.promise) {\n                return ev.emit('error', ieSvgError);\n            } else {\n                return promise;\n            }\n        }\n\n        var canvas = opts.canvas;\n        var scale = opts.scale || 1;\n        var w0 = opts.width || 300;\n        var h0 = opts.height || 150;\n        var w1 = scale * w0;\n        var h1 = scale * h0;\n\n        var ctx = canvas.getContext('2d');\n        var img = new Image();\n        var svgBlob, url;\n\n        if(format === 'svg' || Lib.isIE9orBelow() || Lib.isSafari()) {\n            url = helpers.encodeSVG(svg);\n        } else {\n            svgBlob = helpers.createBlob(svg, 'svg');\n            url = helpers.createObjectURL(svgBlob);\n        }\n\n        canvas.width = w1;\n        canvas.height = h1;\n\n        img.onload = function() {\n            var imgData;\n\n            svgBlob = null;\n            helpers.revokeObjectURL(url);\n\n            // don't need to draw to canvas if svg\n            //  save some time and also avoid failure on IE\n            if(format !== 'svg') {\n                ctx.drawImage(img, 0, 0, w1, h1);\n            }\n\n            switch(format) {\n                case 'jpeg':\n                    imgData = canvas.toDataURL('image/jpeg');\n                    break;\n                case 'png':\n                    imgData = canvas.toDataURL('image/png');\n                    break;\n                case 'webp':\n                    imgData = canvas.toDataURL('image/webp');\n                    break;\n                case 'svg':\n                    imgData = url;\n                    break;\n                default:\n                    var errorMsg = 'Image format is not jpeg, png, svg or webp.';\n                    reject(new Error(errorMsg));\n                    // eventually remove the ev\n                    //  in favor of promises\n                    if(!opts.promise) {\n                        return ev.emit('error', errorMsg);\n                    }\n            }\n            resolve(imgData);\n            // eventually remove the ev\n            //  in favor of promises\n            if(!opts.promise) {\n                ev.emit('success', imgData);\n            }\n        };\n\n        img.onerror = function(err) {\n            svgBlob = null;\n            helpers.revokeObjectURL(url);\n\n            reject(err);\n            // eventually remove the ev\n            //  in favor of promises\n            if(!opts.promise) {\n                return ev.emit('error', err);\n            }\n        };\n\n        img.src = url;\n    });\n\n    // temporary for backward compatibility\n    //  move to only Promise in 2.0.0\n    //  and eliminate the EventEmitter\n    if(opts.promise) {\n        return promise;\n    }\n\n    return ev;\n}\n\nmodule.exports = svgToImg;\n\n},{\"../lib\":178,\"./helpers\":273,\"events\":15}],276:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar EventEmitter = _dereq_('events').EventEmitter;\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\n\nvar helpers = _dereq_('./helpers');\nvar clonePlot = _dereq_('./cloneplot');\nvar toSVG = _dereq_('./tosvg');\nvar svgToImg = _dereq_('./svgtoimg');\n\n/**\n * @param {object} gd figure Object\n * @param {object} opts option object\n * @param opts.format 'jpeg' | 'png' | 'webp' | 'svg'\n */\nfunction toImage(gd, opts) {\n    // first clone the GD so we can operate in a clean environment\n    var ev = new EventEmitter();\n\n    var clone = clonePlot(gd, {format: 'png'});\n    var clonedGd = clone.gd;\n\n    // put the cloned div somewhere off screen before attaching to DOM\n    clonedGd.style.position = 'absolute';\n    clonedGd.style.left = '-5000px';\n    document.body.appendChild(clonedGd);\n\n    function wait() {\n        var delay = helpers.getDelay(clonedGd._fullLayout);\n\n        setTimeout(function() {\n            var svg = toSVG(clonedGd);\n\n            var canvas = document.createElement('canvas');\n            canvas.id = Lib.randstr();\n\n            ev = svgToImg({\n                format: opts.format,\n                width: clonedGd._fullLayout.width,\n                height: clonedGd._fullLayout.height,\n                canvas: canvas,\n                emitter: ev,\n                svg: svg\n            });\n\n            ev.clean = function() {\n                if(clonedGd) document.body.removeChild(clonedGd);\n            };\n        }, delay);\n    }\n\n    var redrawFunc = helpers.getRedrawFunc(clonedGd);\n\n    Registry.call('plot', clonedGd, clone.data, clone.layout, clone.config)\n        .then(redrawFunc)\n        .then(wait)\n        .catch(function(err) {\n            ev.emit('error', err);\n        });\n\n\n    return ev;\n}\n\nmodule.exports = toImage;\n\n},{\"../lib\":178,\"../registry\":269,\"./cloneplot\":270,\"./helpers\":273,\"./svgtoimg\":275,\"./tosvg\":277,\"events\":15}],277:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../lib');\nvar Drawing = _dereq_('../components/drawing');\nvar Color = _dereq_('../components/color');\n\nvar xmlnsNamespaces = _dereq_('../constants/xmlns_namespaces');\nvar DOUBLEQUOTE_REGEX = /\"/g;\nvar DUMMY_SUB = 'TOBESTRIPPED';\nvar DUMMY_REGEX = new RegExp('(\"' + DUMMY_SUB + ')|(' + DUMMY_SUB + '\")', 'g');\n\nfunction htmlEntityDecode(s) {\n    var hiddenDiv = d3.select('body').append('div').style({display: 'none'}).html('');\n    var replaced = s.replace(/(&[^;]*;)/gi, function(d) {\n        if(d === '&lt;') { return '&#60;'; } // special handling for brackets\n        if(d === '&rt;') { return '&#62;'; }\n        if(d.indexOf('<') !== -1 || d.indexOf('>') !== -1) { return ''; }\n        return hiddenDiv.html(d).text(); // everything else, let the browser decode it to unicode\n    });\n    hiddenDiv.remove();\n    return replaced;\n}\n\nfunction xmlEntityEncode(str) {\n    return str.replace(/&(?!\\w+;|\\#[0-9]+;| \\#x[0-9A-F]+;)/g, '&amp;');\n}\n\nmodule.exports = function toSVG(gd, format, scale) {\n    var fullLayout = gd._fullLayout;\n    var svg = fullLayout._paper;\n    var toppaper = fullLayout._toppaper;\n    var width = fullLayout.width;\n    var height = fullLayout.height;\n    var i;\n\n    // make background color a rect in the svg, then revert after scraping\n    // all other alterations have been dealt with by properly preparing the svg\n    // in the first place... like setting cursors with css classes so we don't\n    // have to remove them, and providing the right namespaces in the svg to\n    // begin with\n    svg.insert('rect', ':first-child')\n        .call(Drawing.setRect, 0, 0, width, height)\n        .call(Color.fill, fullLayout.paper_bgcolor);\n\n    // subplot-specific to-SVG methods\n    // which notably add the contents of the gl-container\n    // into the main svg node\n    var basePlotModules = fullLayout._basePlotModules || [];\n    for(i = 0; i < basePlotModules.length; i++) {\n        var _module = basePlotModules[i];\n\n        if(_module.toSVG) _module.toSVG(gd);\n    }\n\n    // add top items above them assumes everything in toppaper is either\n    // a group or a defs, and if it's empty (like hoverlayer) we can ignore it.\n    if(toppaper) {\n        var nodes = toppaper.node().childNodes;\n\n        // make copy of nodes as childNodes prop gets mutated in loop below\n        var topGroups = Array.prototype.slice.call(nodes);\n\n        for(i = 0; i < topGroups.length; i++) {\n            var topGroup = topGroups[i];\n\n            if(topGroup.childNodes.length) svg.node().appendChild(topGroup);\n        }\n    }\n\n    // remove draglayer for Adobe Illustrator compatibility\n    if(fullLayout._draggers) {\n        fullLayout._draggers.remove();\n    }\n\n    // in case the svg element had an explicit background color, remove this\n    // we want the rect to get the color so it's the right size; svg bg will\n    // fill whatever container it's displayed in regardless of plot size.\n    svg.node().style.background = '';\n\n    svg.selectAll('text')\n        .attr({'data-unformatted': null, 'data-math': null})\n        .each(function() {\n            var txt = d3.select(this);\n\n            // hidden text is pre-formatting mathjax, the browser ignores it\n            // but in a static plot it's useless and it can confuse batik\n            // we've tried to standardize on display:none but make sure we still\n            // catch visibility:hidden if it ever arises\n            if(this.style.visibility === 'hidden' || this.style.display === 'none') {\n                txt.remove();\n                return;\n            } else {\n                // clear other visibility/display values to default\n                // to not potentially confuse non-browser SVG implementations\n                txt.style({visibility: null, display: null});\n            }\n\n            // Font family styles break things because of quotation marks,\n            // so we must remove them *after* the SVG DOM has been serialized\n            // to a string (browsers convert singles back)\n            var ff = this.style.fontFamily;\n            if(ff && ff.indexOf('\"') !== -1) {\n                txt.style('font-family', ff.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));\n            }\n        });\n\n\n    if(fullLayout._gradientUrlQueryParts) {\n        var queryParts = [];\n        for(var k in fullLayout._gradientUrlQueryParts) queryParts.push(k);\n\n        if(queryParts.length) {\n            svg.selectAll(queryParts.join(',')).each(function() {\n                var pt = d3.select(this);\n\n                // similar to font family styles above,\n                // we must remove \" after the SVG DOM has been serialized\n                var fill = this.style.fill;\n                if(fill && fill.indexOf('url(') !== -1) {\n                    pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));\n                }\n\n                var stroke = this.style.stroke;\n                if(stroke && stroke.indexOf('url(') !== -1) {\n                    pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));\n                }\n            });\n        }\n    }\n\n    if(format === 'pdf' || format === 'eps') {\n        // these formats make the extra line MathJax adds around symbols look super thick in some cases\n        // it looks better if this is removed entirely.\n        svg.selectAll('#MathJax_SVG_glyphs path')\n            .attr('stroke-width', 0);\n    }\n\n    // fix for IE namespacing quirk?\n    // http://stackoverflow.com/questions/19610089/unwanted-namespaces-on-svg-markup-when-using-xmlserializer-in-javascript-with-ie\n    svg.node().setAttributeNS(xmlnsNamespaces.xmlns, 'xmlns', xmlnsNamespaces.svg);\n    svg.node().setAttributeNS(xmlnsNamespaces.xmlns, 'xmlns:xlink', xmlnsNamespaces.xlink);\n\n    if(format === 'svg' && scale) {\n        svg.attr('width', scale * width);\n        svg.attr('height', scale * height);\n        svg.attr('viewBox', '0 0 ' + width + ' ' + height);\n    }\n\n    var s = new window.XMLSerializer().serializeToString(svg.node());\n    s = htmlEntityDecode(s);\n    s = xmlEntityEncode(s);\n\n    // Fix quotations around font strings and gradient URLs\n    s = s.replace(DUMMY_REGEX, '\\'');\n\n    // IE is very strict, so we will need to clean\n    //  svg with the following regex\n    //  yes this is messy, but do not know a better way\n    // Even with this IE will not work due to tainted canvas\n    //  see https://github.com/kangax/fabric.js/issues/1957\n    //      http://stackoverflow.com/questions/18112047/canvas-todataurl-working-in-all-browsers-except-ie10\n    // Leave here just in case the CORS/tainted IE issue gets resolved\n    if(Lib.isIE()) {\n        // replace double quote with single quote\n        s = s.replace(/\"/gi, '\\'');\n        // url in svg are single quoted\n        //   since we changed double to single\n        //   we'll need to change these to double-quoted\n        s = s.replace(/(\\('#)([^']*)('\\))/gi, '(\\\"#$2\\\")');\n        // font names with spaces will be escaped single-quoted\n        //   we'll need to change these to double-quoted\n        s = s.replace(/(\\\\')/gi, '\\\"');\n    }\n\n    return s;\n};\n\n},{\"../components/color\":52,\"../components/drawing\":74,\"../constants/xmlns_namespaces\":159,\"../lib\":178,\"d3\":16}],278:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// arrayOk attributes, merge them into calcdata array\nmodule.exports = function arraysToCalcdata(cd, trace) {\n    for(var i = 0; i < cd.length; i++) cd[i].i = i;\n\n    Lib.mergeArray(trace.text, cd, 'tx');\n    Lib.mergeArray(trace.hovertext, cd, 'htx');\n\n    var marker = trace.marker;\n    if(marker) {\n        Lib.mergeArray(marker.opacity, cd, 'mo', true);\n        Lib.mergeArray(marker.color, cd, 'mc');\n\n        var markerLine = marker.line;\n        if(markerLine) {\n            Lib.mergeArray(markerLine.color, cd, 'mlc');\n            Lib.mergeArrayCastPositive(markerLine.width, cd, 'mlw');\n        }\n    }\n};\n\n},{\"../../lib\":178}],279:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar constants = _dereq_('./constants');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar textFontAttrs = fontAttrs({\n    editType: 'calc',\n    arrayOk: true,\n    colorEditType: 'style',\n    \n});\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nvar markerLineWidth = extendFlat({},\n    scatterMarkerLineAttrs.width, { dflt: 0 });\n\nvar markerLine = extendFlat({\n    width: markerLineWidth,\n    editType: 'calc'\n}, colorScaleAttrs('marker.line'));\n\nvar marker = extendFlat({\n    line: markerLine,\n    editType: 'calc'\n}, colorScaleAttrs('marker'), {\n    opacity: {\n        valType: 'number',\n        arrayOk: true,\n        dflt: 1,\n        min: 0,\n        max: 1,\n        \n        editType: 'style',\n        \n    }\n});\n\nmodule.exports = {\n    x: scatterAttrs.x,\n    x0: scatterAttrs.x0,\n    dx: scatterAttrs.dx,\n    y: scatterAttrs.y,\n    y0: scatterAttrs.y0,\n    dy: scatterAttrs.dy,\n\n    text: scatterAttrs.text,\n    texttemplate: texttemplateAttrs({editType: 'plot'}, {\n        keys: constants.eventDataKeys\n    }),\n    hovertext: scatterAttrs.hovertext,\n    hovertemplate: hovertemplateAttrs({}, {\n        keys: constants.eventDataKeys\n    }),\n\n    textposition: {\n        valType: 'enumerated',\n        \n        values: ['inside', 'outside', 'auto', 'none'],\n        dflt: 'none',\n        arrayOk: true,\n        editType: 'calc',\n        \n    },\n\n    insidetextanchor: {\n        valType: 'enumerated',\n        values: ['end', 'middle', 'start'],\n        dflt: 'end',\n        \n        editType: 'plot',\n        \n    },\n\n    textangle: {\n        valType: 'angle',\n        dflt: 'auto',\n        \n        editType: 'plot',\n        \n    },\n\n    textfont: extendFlat({}, textFontAttrs, {\n        \n    }),\n\n    insidetextfont: extendFlat({}, textFontAttrs, {\n        \n    }),\n\n    outsidetextfont: extendFlat({}, textFontAttrs, {\n        \n    }),\n\n    constraintext: {\n        valType: 'enumerated',\n        values: ['inside', 'outside', 'both', 'none'],\n        \n        dflt: 'both',\n        editType: 'calc',\n        \n    },\n\n    cliponaxis: extendFlat({}, scatterAttrs.cliponaxis, {\n        \n    }),\n\n    orientation: {\n        valType: 'enumerated',\n        \n        values: ['v', 'h'],\n        editType: 'calc+clearAxisTypes',\n        \n    },\n\n    base: {\n        valType: 'any',\n        dflt: null,\n        arrayOk: true,\n        \n        editType: 'calc',\n        \n    },\n\n    offset: {\n        valType: 'number',\n        dflt: null,\n        arrayOk: true,\n        \n        editType: 'calc',\n        \n    },\n\n    width: {\n        valType: 'number',\n        dflt: null,\n        min: 0,\n        arrayOk: true,\n        \n        editType: 'calc',\n        \n    },\n\n    marker: marker,\n\n    offsetgroup: {\n        valType: 'string',\n        \n        dflt: '',\n        editType: 'calc',\n        \n    },\n    alignmentgroup: {\n        valType: 'string',\n        \n        dflt: '',\n        editType: 'calc',\n        \n    },\n\n    selected: {\n        marker: {\n            opacity: scatterAttrs.selected.marker.opacity,\n            color: scatterAttrs.selected.marker.color,\n            editType: 'style'\n        },\n        textfont: scatterAttrs.selected.textfont,\n        editType: 'style'\n    },\n    unselected: {\n        marker: {\n            opacity: scatterAttrs.unselected.marker.opacity,\n            color: scatterAttrs.unselected.marker.color,\n            editType: 'style'\n        },\n        textfont: scatterAttrs.unselected.textfont,\n        editType: 'style'\n    },\n\n    r: scatterAttrs.r,\n    t: scatterAttrs.t,\n\n    _deprecated: {\n        bardir: {\n            valType: 'enumerated',\n            \n            editType: 'calc',\n            values: ['v', 'h'],\n            \n        }\n    }\n};\n\n},{\"../../components/colorscale/attributes\":59,\"../../lib/extend\":173,\"../../plots/font_attributes\":250,\"../../plots/template_attributes\":264,\"../scatter/attributes\":389,\"./constants\":281}],280:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar arraysToCalcdata = _dereq_('./arrays_to_calcdata');\nvar calcSelection = _dereq_('../scatter/calc_selection');\n\nmodule.exports = function calc(gd, trace) {\n    var xa = Axes.getFromId(gd, trace.xaxis || 'x');\n    var ya = Axes.getFromId(gd, trace.yaxis || 'y');\n    var size, pos;\n\n    var sizeOpts = {\n        msUTC: !!(trace.base || trace.base === 0)\n    };\n\n    if(trace.orientation === 'h') {\n        size = xa.makeCalcdata(trace, 'x', sizeOpts);\n        pos = ya.makeCalcdata(trace, 'y');\n    } else {\n        size = ya.makeCalcdata(trace, 'y', sizeOpts);\n        pos = xa.makeCalcdata(trace, 'x');\n    }\n\n    // create the \"calculated data\" to plot\n    var serieslen = Math.min(pos.length, size.length);\n    var cd = new Array(serieslen);\n\n    // set position and size\n    for(var i = 0; i < serieslen; i++) {\n        cd[i] = { p: pos[i], s: size[i] };\n\n        if(trace.ids) {\n            cd[i].id = String(trace.ids[i]);\n        }\n    }\n\n    // auto-z and autocolorscale if applicable\n    if(hasColorscale(trace, 'marker')) {\n        colorscaleCalc(gd, trace, {\n            vals: trace.marker.color,\n            containerStr: 'marker',\n            cLetter: 'c'\n        });\n    }\n    if(hasColorscale(trace, 'marker.line')) {\n        colorscaleCalc(gd, trace, {\n            vals: trace.marker.line.color,\n            containerStr: 'marker.line',\n            cLetter: 'c'\n        });\n    }\n\n    arraysToCalcdata(cd, trace);\n    calcSelection(cd, trace);\n\n    return cd;\n};\n\n},{\"../../components/colorscale/calc\":60,\"../../components/colorscale/helpers\":63,\"../../plots/cartesian/axes\":222,\"../scatter/calc_selection\":391,\"./arrays_to_calcdata\":278}],281:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n    // padding in pixels around text\n    TEXTPAD: 3,\n    // 'value' and 'label' are not really necessary for bar traces,\n    // but they were made available to `texttemplate` (maybe by accident)\n    // via tokens `%{value}` and `%{label}` starting in 1.50.0,\n    // so let's include them in the event data also.\n    eventDataKeys: ['value', 'label']\n};\n\n},{}],282:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar getAxisGroup = _dereq_('../../plots/cartesian/axis_ids').getAxisGroup;\nvar Sieve = _dereq_('./sieve.js');\n\n/*\n * Bar chart stacking/grouping positioning and autoscaling calculations\n * for each direction separately calculate the ranges and positions\n * note that this handles histograms too\n * now doing this one subplot at a time\n */\n\nfunction crossTraceCalc(gd, plotinfo) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    var fullLayout = gd._fullLayout;\n    var fullTraces = gd._fullData;\n    var calcTraces = gd.calcdata;\n    var calcTracesHorz = [];\n    var calcTracesVert = [];\n\n    for(var i = 0; i < fullTraces.length; i++) {\n        var fullTrace = fullTraces[i];\n        if(\n            fullTrace.visible === true &&\n            Registry.traceIs(fullTrace, 'bar') &&\n            fullTrace.xaxis === xa._id &&\n            fullTrace.yaxis === ya._id\n        ) {\n            if(fullTrace.orientation === 'h') {\n                calcTracesHorz.push(calcTraces[i]);\n            } else {\n                calcTracesVert.push(calcTraces[i]);\n            }\n\n            if(fullTrace._computePh) {\n                var cd = gd.calcdata[i];\n                for(var j = 0; j < cd.length; j++) {\n                    if(typeof cd[j].ph0 === 'function') cd[j].ph0 = cd[j].ph0();\n                    if(typeof cd[j].ph1 === 'function') cd[j].ph1 = cd[j].ph1();\n                }\n            }\n        }\n    }\n\n    var opts = {\n        mode: fullLayout.barmode,\n        norm: fullLayout.barnorm,\n        gap: fullLayout.bargap,\n        groupgap: fullLayout.bargroupgap\n    };\n\n    setGroupPositions(gd, xa, ya, calcTracesVert, opts);\n    setGroupPositions(gd, ya, xa, calcTracesHorz, opts);\n}\n\nfunction setGroupPositions(gd, pa, sa, calcTraces, opts) {\n    if(!calcTraces.length) return;\n\n    var excluded;\n    var included;\n    var i, calcTrace, fullTrace;\n\n    initBase(sa, calcTraces);\n\n    switch(opts.mode) {\n        case 'overlay':\n            setGroupPositionsInOverlayMode(pa, sa, calcTraces, opts);\n            break;\n\n        case 'group':\n            // exclude from the group those traces for which the user set an offset\n            excluded = [];\n            included = [];\n            for(i = 0; i < calcTraces.length; i++) {\n                calcTrace = calcTraces[i];\n                fullTrace = calcTrace[0].trace;\n\n                if(fullTrace.offset === undefined) included.push(calcTrace);\n                else excluded.push(calcTrace);\n            }\n\n            if(included.length) {\n                setGroupPositionsInGroupMode(gd, pa, sa, included, opts);\n            }\n            if(excluded.length) {\n                setGroupPositionsInOverlayMode(pa, sa, excluded, opts);\n            }\n            break;\n\n        case 'stack':\n        case 'relative':\n            // exclude from the stack those traces for which the user set a base\n            excluded = [];\n            included = [];\n            for(i = 0; i < calcTraces.length; i++) {\n                calcTrace = calcTraces[i];\n                fullTrace = calcTrace[0].trace;\n\n                if(fullTrace.base === undefined) included.push(calcTrace);\n                else excluded.push(calcTrace);\n            }\n\n            if(included.length) {\n                setGroupPositionsInStackOrRelativeMode(gd, pa, sa, included, opts);\n            }\n            if(excluded.length) {\n                setGroupPositionsInOverlayMode(pa, sa, excluded, opts);\n            }\n            break;\n    }\n\n    collectExtents(calcTraces, pa);\n}\n\nfunction initBase(sa, calcTraces) {\n    var i, j;\n\n    for(i = 0; i < calcTraces.length; i++) {\n        var cd = calcTraces[i];\n        var trace = cd[0].trace;\n        var base = (trace.type === 'funnel') ? trace._base : trace.base;\n        var b;\n\n        // not sure if it really makes sense to have dates for bar size data...\n        // ideally if we want to make gantt charts or something we'd treat\n        // the actual size (trace.x or y) as time delta but base as absolute\n        // time. But included here for completeness.\n        var scalendar = trace.orientation === 'h' ? trace.xcalendar : trace.ycalendar;\n\n        // 'base' on categorical axes makes no sense\n        var d2c = sa.type === 'category' || sa.type === 'multicategory' ?\n            function() { return null; } :\n            sa.d2c;\n\n        if(isArrayOrTypedArray(base)) {\n            for(j = 0; j < Math.min(base.length, cd.length); j++) {\n                b = d2c(base[j], 0, scalendar);\n                if(isNumeric(b)) {\n                    cd[j].b = +b;\n                    cd[j].hasB = 1;\n                } else cd[j].b = 0;\n            }\n            for(; j < cd.length; j++) {\n                cd[j].b = 0;\n            }\n        } else {\n            b = d2c(base, 0, scalendar);\n            var hasBase = isNumeric(b);\n            b = hasBase ? b : 0;\n            for(j = 0; j < cd.length; j++) {\n                cd[j].b = b;\n                if(hasBase) cd[j].hasB = 1;\n            }\n        }\n    }\n}\n\nfunction setGroupPositionsInOverlayMode(pa, sa, calcTraces, opts) {\n    // update position axis and set bar offsets and widths\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n\n        var sieve = new Sieve([calcTrace], {\n            sepNegVal: false,\n            overlapNoMerge: !opts.norm\n        });\n\n        // set bar offsets and widths, and update position axis\n        setOffsetAndWidth(pa, sieve, opts);\n\n        // set bar bases and sizes, and update size axis\n        //\n        // (note that `setGroupPositionsInOverlayMode` handles the case barnorm\n        // is defined, because this function is also invoked for traces that\n        // can't be grouped or stacked)\n        if(opts.norm) {\n            sieveBars(sieve);\n            normalizeBars(sa, sieve, opts);\n        } else {\n            setBaseAndTop(sa, sieve);\n        }\n    }\n}\n\nfunction setGroupPositionsInGroupMode(gd, pa, sa, calcTraces, opts) {\n    var sieve = new Sieve(calcTraces, {\n        sepNegVal: false,\n        overlapNoMerge: !opts.norm\n    });\n\n    // set bar offsets and widths, and update position axis\n    setOffsetAndWidthInGroupMode(gd, pa, sieve, opts);\n\n    // relative-stack bars within the same trace that would otherwise\n    // be hidden\n    unhideBarsWithinTrace(sieve);\n\n    // set bar bases and sizes, and update size axis\n    if(opts.norm) {\n        sieveBars(sieve);\n        normalizeBars(sa, sieve, opts);\n    } else {\n        setBaseAndTop(sa, sieve);\n    }\n}\n\nfunction setGroupPositionsInStackOrRelativeMode(gd, pa, sa, calcTraces, opts) {\n    var sieve = new Sieve(calcTraces, {\n        sepNegVal: opts.mode === 'relative',\n        overlapNoMerge: !(opts.norm || opts.mode === 'stack' || opts.mode === 'relative')\n    });\n\n    // set bar offsets and widths, and update position axis\n    setOffsetAndWidth(pa, sieve, opts);\n\n    // set bar bases and sizes, and update size axis\n    stackBars(sa, sieve, opts);\n\n    // flag the outmost bar (for text display purposes)\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n\n        for(var j = 0; j < calcTrace.length; j++) {\n            var bar = calcTrace[j];\n\n            if(bar.s !== BADNUM) {\n                var isOutmostBar = ((bar.b + bar.s) === sieve.get(bar.p, bar.s));\n                if(isOutmostBar) bar._outmost = true;\n            }\n        }\n    }\n\n    // Note that marking the outmost bars has to be done\n    // before `normalizeBars` changes `bar.b` and `bar.s`.\n    if(opts.norm) normalizeBars(sa, sieve, opts);\n}\n\nfunction setOffsetAndWidth(pa, sieve, opts) {\n    var minDiff = sieve.minDiff;\n    var calcTraces = sieve.traces;\n\n    // set bar offsets and widths\n    var barGroupWidth = minDiff * (1 - opts.gap);\n    var barWidthPlusGap = barGroupWidth;\n    var barWidth = barWidthPlusGap * (1 - (opts.groupgap || 0));\n\n    // computer bar group center and bar offset\n    var offsetFromCenter = -barWidth / 2;\n\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n        var t = calcTrace[0].t;\n\n        // store bar width and offset for this trace\n        t.barwidth = barWidth;\n        t.poffset = offsetFromCenter;\n        t.bargroupwidth = barGroupWidth;\n        t.bardelta = minDiff;\n    }\n\n    // stack bars that only differ by rounding\n    sieve.binWidth = calcTraces[0][0].t.barwidth / 100;\n\n    // if defined, apply trace offset and width\n    applyAttributes(sieve);\n\n    // store the bar center in each calcdata item\n    setBarCenterAndWidth(pa, sieve);\n\n    // update position axes\n    updatePositionAxis(pa, sieve);\n}\n\nfunction setOffsetAndWidthInGroupMode(gd, pa, sieve, opts) {\n    var fullLayout = gd._fullLayout;\n    var positions = sieve.positions;\n    var distinctPositions = sieve.distinctPositions;\n    var minDiff = sieve.minDiff;\n    var calcTraces = sieve.traces;\n    var nTraces = calcTraces.length;\n\n    // if there aren't any overlapping positions,\n    // let them have full width even if mode is group\n    var overlap = (positions.length !== distinctPositions.length);\n    var barGroupWidth = minDiff * (1 - opts.gap);\n\n    var groupId = getAxisGroup(fullLayout, pa._id) + calcTraces[0][0].trace.orientation;\n    var alignmentGroups = fullLayout._alignmentOpts[groupId] || {};\n\n    for(var i = 0; i < nTraces; i++) {\n        var calcTrace = calcTraces[i];\n        var trace = calcTrace[0].trace;\n\n        var alignmentGroupOpts = alignmentGroups[trace.alignmentgroup] || {};\n        var nOffsetGroups = Object.keys(alignmentGroupOpts.offsetGroups || {}).length;\n\n        var barWidthPlusGap;\n        if(nOffsetGroups) {\n            barWidthPlusGap = barGroupWidth / nOffsetGroups;\n        } else {\n            barWidthPlusGap = overlap ? barGroupWidth / nTraces : barGroupWidth;\n        }\n\n        var barWidth = barWidthPlusGap * (1 - (opts.groupgap || 0));\n\n        var offsetFromCenter;\n        if(nOffsetGroups) {\n            offsetFromCenter = ((2 * trace._offsetIndex + 1 - nOffsetGroups) * barWidthPlusGap - barWidth) / 2;\n        } else {\n            offsetFromCenter = overlap ?\n                ((2 * i + 1 - nTraces) * barWidthPlusGap - barWidth) / 2 :\n                -barWidth / 2;\n        }\n\n        var t = calcTrace[0].t;\n        t.barwidth = barWidth;\n        t.poffset = offsetFromCenter;\n        t.bargroupwidth = barGroupWidth;\n        t.bardelta = minDiff;\n    }\n\n    // stack bars that only differ by rounding\n    sieve.binWidth = calcTraces[0][0].t.barwidth / 100;\n\n    // if defined, apply trace width\n    applyAttributes(sieve);\n\n    // store the bar center in each calcdata item\n    setBarCenterAndWidth(pa, sieve);\n\n    // update position axes\n    updatePositionAxis(pa, sieve, overlap);\n}\n\nfunction applyAttributes(sieve) {\n    var calcTraces = sieve.traces;\n    var i, j;\n\n    for(i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n        var calcTrace0 = calcTrace[0];\n        var fullTrace = calcTrace0.trace;\n        var t = calcTrace0.t;\n        var offset = fullTrace._offset || fullTrace.offset;\n        var initialPoffset = t.poffset;\n        var newPoffset;\n\n        if(isArrayOrTypedArray(offset)) {\n            // if offset is an array, then clone it into t.poffset.\n            newPoffset = Array.prototype.slice.call(offset, 0, calcTrace.length);\n\n            // guard against non-numeric items\n            for(j = 0; j < newPoffset.length; j++) {\n                if(!isNumeric(newPoffset[j])) {\n                    newPoffset[j] = initialPoffset;\n                }\n            }\n\n            // if the length of the array is too short,\n            // then extend it with the initial value of t.poffset\n            for(j = newPoffset.length; j < calcTrace.length; j++) {\n                newPoffset.push(initialPoffset);\n            }\n\n            t.poffset = newPoffset;\n        } else if(offset !== undefined) {\n            t.poffset = offset;\n        }\n\n        var width = fullTrace._width || fullTrace.width;\n        var initialBarwidth = t.barwidth;\n\n        if(isArrayOrTypedArray(width)) {\n            // if width is an array, then clone it into t.barwidth.\n            var newBarwidth = Array.prototype.slice.call(width, 0, calcTrace.length);\n\n            // guard against non-numeric items\n            for(j = 0; j < newBarwidth.length; j++) {\n                if(!isNumeric(newBarwidth[j])) newBarwidth[j] = initialBarwidth;\n            }\n\n            // if the length of the array is too short,\n            // then extend it with the initial value of t.barwidth\n            for(j = newBarwidth.length; j < calcTrace.length; j++) {\n                newBarwidth.push(initialBarwidth);\n            }\n\n            t.barwidth = newBarwidth;\n\n            // if user didn't set offset,\n            // then correct t.poffset to ensure bars remain centered\n            if(offset === undefined) {\n                newPoffset = [];\n                for(j = 0; j < calcTrace.length; j++) {\n                    newPoffset.push(\n                        initialPoffset + (initialBarwidth - newBarwidth[j]) / 2\n                    );\n                }\n                t.poffset = newPoffset;\n            }\n        } else if(width !== undefined) {\n            t.barwidth = width;\n\n            // if user didn't set offset,\n            // then correct t.poffset to ensure bars remain centered\n            if(offset === undefined) {\n                t.poffset = initialPoffset + (initialBarwidth - width) / 2;\n            }\n        }\n    }\n}\n\nfunction setBarCenterAndWidth(pa, sieve) {\n    var calcTraces = sieve.traces;\n    var pLetter = getAxisLetter(pa);\n\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n        var t = calcTrace[0].t;\n        var poffset = t.poffset;\n        var poffsetIsArray = Array.isArray(poffset);\n        var barwidth = t.barwidth;\n        var barwidthIsArray = Array.isArray(barwidth);\n\n        for(var j = 0; j < calcTrace.length; j++) {\n            var calcBar = calcTrace[j];\n\n            // store the actual bar width and position, for use by hover\n            var width = calcBar.w = barwidthIsArray ? barwidth[j] : barwidth;\n            calcBar[pLetter] = calcBar.p + (poffsetIsArray ? poffset[j] : poffset) + width / 2;\n        }\n    }\n}\n\nfunction updatePositionAxis(pa, sieve, allowMinDtick) {\n    var calcTraces = sieve.traces;\n    var minDiff = sieve.minDiff;\n    var vpad = minDiff / 2;\n\n    Axes.minDtick(pa, sieve.minDiff, sieve.distinctPositions[0], allowMinDtick);\n\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n        var calcTrace0 = calcTrace[0];\n        var fullTrace = calcTrace0.trace;\n        var pts = [];\n        var bar, l, r, j;\n\n        for(j = 0; j < calcTrace.length; j++) {\n            bar = calcTrace[j];\n            l = bar.p - vpad;\n            r = bar.p + vpad;\n            pts.push(l, r);\n        }\n\n        if(fullTrace.width || fullTrace.offset) {\n            var t = calcTrace0.t;\n            var poffset = t.poffset;\n            var barwidth = t.barwidth;\n            var poffsetIsArray = Array.isArray(poffset);\n            var barwidthIsArray = Array.isArray(barwidth);\n\n            for(j = 0; j < calcTrace.length; j++) {\n                bar = calcTrace[j];\n                var calcBarOffset = poffsetIsArray ? poffset[j] : poffset;\n                var calcBarWidth = barwidthIsArray ? barwidth[j] : barwidth;\n                l = bar.p + calcBarOffset;\n                r = l + calcBarWidth;\n                pts.push(l, r);\n            }\n        }\n\n        fullTrace._extremes[pa._id] = Axes.findExtremes(pa, pts, {padded: false});\n    }\n}\n\n// store these bar bases and tops in calcdata\n// and make sure the size axis includes zero,\n// along with the bases and tops of each bar.\nfunction setBaseAndTop(sa, sieve) {\n    var calcTraces = sieve.traces;\n    var sLetter = getAxisLetter(sa);\n\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n        var fullTrace = calcTrace[0].trace;\n        var pts = [];\n        var tozero = false;\n\n        for(var j = 0; j < calcTrace.length; j++) {\n            var bar = calcTrace[j];\n            var base = bar.b;\n            var top = base + bar.s;\n\n            bar[sLetter] = top;\n            pts.push(top);\n            if(bar.hasB) pts.push(base);\n\n            if(!bar.hasB || !bar.b) {\n                tozero = true;\n            }\n        }\n\n        fullTrace._extremes[sa._id] = Axes.findExtremes(sa, pts, {\n            tozero: tozero,\n            padded: true\n        });\n    }\n}\n\nfunction stackBars(sa, sieve, opts) {\n    var sLetter = getAxisLetter(sa);\n    var calcTraces = sieve.traces;\n    var calcTrace;\n    var fullTrace;\n    var isFunnel;\n    var i, j;\n    var bar;\n\n    for(i = 0; i < calcTraces.length; i++) {\n        calcTrace = calcTraces[i];\n        fullTrace = calcTrace[0].trace;\n\n        if(fullTrace.type === 'funnel') {\n            for(j = 0; j < calcTrace.length; j++) {\n                bar = calcTrace[j];\n\n                if(bar.s !== BADNUM) {\n                    // create base of funnels\n                    sieve.put(bar.p, -0.5 * bar.s);\n                }\n            }\n        }\n    }\n\n    for(i = 0; i < calcTraces.length; i++) {\n        calcTrace = calcTraces[i];\n        fullTrace = calcTrace[0].trace;\n\n        isFunnel = (fullTrace.type === 'funnel');\n\n        var pts = [];\n\n        for(j = 0; j < calcTrace.length; j++) {\n            bar = calcTrace[j];\n\n            if(bar.s !== BADNUM) {\n                // stack current bar and get previous sum\n                var value;\n                if(isFunnel) {\n                    value = bar.s;\n                } else {\n                    value = bar.s + bar.b;\n                }\n\n                var base = sieve.put(bar.p, value);\n\n                var top = base + value;\n\n                // store the bar base and top in each calcdata item\n                bar.b = base;\n                bar[sLetter] = top;\n\n                if(!opts.norm) {\n                    pts.push(top);\n                    if(bar.hasB) {\n                        pts.push(base);\n                    }\n                }\n            }\n        }\n\n        // if barnorm is set, let normalizeBars update the axis range\n        if(!opts.norm) {\n            fullTrace._extremes[sa._id] = Axes.findExtremes(sa, pts, {\n                // N.B. we don't stack base with 'base',\n                // so set tozero:true always!\n                tozero: true,\n                padded: true\n            });\n        }\n    }\n}\n\nfunction sieveBars(sieve) {\n    var calcTraces = sieve.traces;\n\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n\n        for(var j = 0; j < calcTrace.length; j++) {\n            var bar = calcTrace[j];\n\n            if(bar.s !== BADNUM) {\n                sieve.put(bar.p, bar.b + bar.s);\n            }\n        }\n    }\n}\n\nfunction unhideBarsWithinTrace(sieve) {\n    var calcTraces = sieve.traces;\n\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n        var fullTrace = calcTrace[0].trace;\n\n        if(fullTrace.base === undefined) {\n            var inTraceSieve = new Sieve([calcTrace], {\n                sepNegVal: true,\n                overlapNoMerge: true\n            });\n\n            for(var j = 0; j < calcTrace.length; j++) {\n                var bar = calcTrace[j];\n\n                if(bar.p !== BADNUM) {\n                    // stack current bar and get previous sum\n                    var base = inTraceSieve.put(bar.p, bar.b + bar.s);\n\n                    // if previous sum if non-zero, this means:\n                    // multiple bars have same starting point are potentially hidden,\n                    // shift them vertically so that all bars are visible by default\n                    if(base) bar.b = base;\n                }\n            }\n        }\n    }\n}\n\n// Note:\n//\n// normalizeBars requires that either sieveBars or stackBars has been\n// previously invoked.\nfunction normalizeBars(sa, sieve, opts) {\n    var calcTraces = sieve.traces;\n    var sLetter = getAxisLetter(sa);\n    var sTop = opts.norm === 'fraction' ? 1 : 100;\n    var sTiny = sTop / 1e9; // in case of rounding error in sum\n    var sMin = sa.l2c(sa.c2l(0));\n    var sMax = opts.mode === 'stack' ? sTop : sMin;\n\n    function needsPadding(v) {\n        return (\n            isNumeric(sa.c2l(v)) &&\n            ((v < sMin - sTiny) || (v > sMax + sTiny) || !isNumeric(sMin))\n        );\n    }\n\n    for(var i = 0; i < calcTraces.length; i++) {\n        var calcTrace = calcTraces[i];\n        var fullTrace = calcTrace[0].trace;\n        var pts = [];\n        var tozero = false;\n        var padded = false;\n\n        for(var j = 0; j < calcTrace.length; j++) {\n            var bar = calcTrace[j];\n\n            if(bar.s !== BADNUM) {\n                var scale = Math.abs(sTop / sieve.get(bar.p, bar.s));\n                bar.b *= scale;\n                bar.s *= scale;\n\n                var base = bar.b;\n                var top = base + bar.s;\n\n                bar[sLetter] = top;\n                pts.push(top);\n                padded = padded || needsPadding(top);\n\n                if(bar.hasB) {\n                    pts.push(base);\n                    padded = padded || needsPadding(base);\n                }\n\n                if(!bar.hasB || !bar.b) {\n                    tozero = true;\n                }\n            }\n        }\n\n        fullTrace._extremes[sa._id] = Axes.findExtremes(sa, pts, {\n            tozero: tozero,\n            padded: padded\n        });\n    }\n}\n\n// find the full position span of bars at each position\n// for use by hover, to ensure labels move in if bars are\n// narrower than the space they're in.\n// run once per trace group (subplot & direction) and\n// the same mapping is attached to all calcdata traces\nfunction collectExtents(calcTraces, pa) {\n    var pLetter = getAxisLetter(pa);\n    var extents = {};\n    var i, j, cd;\n\n    var pMin = Infinity;\n    var pMax = -Infinity;\n\n    for(i = 0; i < calcTraces.length; i++) {\n        cd = calcTraces[i];\n        for(j = 0; j < cd.length; j++) {\n            var p = cd[j].p;\n            if(isNumeric(p)) {\n                pMin = Math.min(pMin, p);\n                pMax = Math.max(pMax, p);\n            }\n        }\n    }\n\n    // this is just for positioning of hover labels, and nobody will care if\n    // the label is 1px too far out; so round positions to 1/10K in case\n    // position values don't exactly match from trace to trace\n    var roundFactor = 10000 / (pMax - pMin);\n    var round = extents.round = function(p) {\n        return String(Math.round(roundFactor * (p - pMin)));\n    };\n\n    for(i = 0; i < calcTraces.length; i++) {\n        cd = calcTraces[i];\n        cd[0].t.extents = extents;\n\n        var poffset = cd[0].t.poffset;\n        var poffsetIsArray = Array.isArray(poffset);\n\n        for(j = 0; j < cd.length; j++) {\n            var di = cd[j];\n            var p0 = di[pLetter] - di.w / 2;\n\n            if(isNumeric(p0)) {\n                var p1 = di[pLetter] + di.w / 2;\n                var pVal = round(di.p);\n                if(extents[pVal]) {\n                    extents[pVal] = [Math.min(p0, extents[pVal][0]), Math.max(p1, extents[pVal][1])];\n                } else {\n                    extents[pVal] = [p0, p1];\n                }\n            }\n\n            di.p0 = di.p + (poffsetIsArray ? poffset[j] : poffset);\n            di.p1 = di.p0 + di.w;\n            di.s0 = di.b;\n            di.s1 = di.s0 + di.s;\n        }\n    }\n}\n\nfunction getAxisLetter(ax) {\n    return ax._id.charAt(0);\n}\n\nmodule.exports = {\n    crossTraceCalc: crossTraceCalc,\n    setGroupPositions: setGroupPositions\n};\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../../plots/cartesian/axis_ids\":225,\"../../registry\":269,\"./sieve.js\":292,\"fast-isnumeric\":18}],283:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar Registry = _dereq_('../../registry');\n\nvar handleXYDefaults = _dereq_('../scatter/xy_defaults');\nvar handleStyleDefaults = _dereq_('./style_defaults');\nvar getAxisGroup = _dereq_('../../plots/cartesian/axis_ids').getAxisGroup;\nvar attributes = _dereq_('./attributes');\n\nvar coerceFont = Lib.coerceFont;\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    var len = handleXYDefaults(traceIn, traceOut, layout, coerce);\n    if(!len) {\n        traceOut.visible = false;\n        return;\n    }\n\n    coerce('orientation', (traceOut.x && !traceOut.y) ? 'h' : 'v');\n    coerce('base');\n    coerce('offset');\n    coerce('width');\n\n    coerce('text');\n    coerce('hovertext');\n    coerce('hovertemplate');\n\n    var textposition = coerce('textposition');\n    handleText(traceIn, traceOut, layout, coerce, textposition, {\n        moduleHasSelected: true,\n        moduleHasUnselected: true,\n        moduleHasConstrain: true,\n        moduleHasCliponaxis: true,\n        moduleHasTextangle: true,\n        moduleHasInsideanchor: true\n    });\n\n    handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout);\n\n    var lineColor = (traceOut.marker.line || {}).color;\n\n    // override defaultColor for error bars with defaultLine\n    var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');\n    errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'y'});\n    errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'});\n\n    Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n}\n\nfunction handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce) {\n    var orientation = traceOut.orientation;\n    // N.B. grouping is done across all trace types that support it\n    var posAxId = traceOut[{v: 'x', h: 'y'}[orientation] + 'axis'];\n    var groupId = getAxisGroup(fullLayout, posAxId) + orientation;\n\n    var alignmentOpts = fullLayout._alignmentOpts || {};\n    var alignmentgroup = coerce('alignmentgroup');\n\n    var alignmentGroups = alignmentOpts[groupId];\n    if(!alignmentGroups) alignmentGroups = alignmentOpts[groupId] = {};\n\n    var alignmentGroupOpts = alignmentGroups[alignmentgroup];\n\n    if(alignmentGroupOpts) {\n        alignmentGroupOpts.traces.push(traceOut);\n    } else {\n        alignmentGroupOpts = alignmentGroups[alignmentgroup] = {\n            traces: [traceOut],\n            alignmentIndex: Object.keys(alignmentGroups).length,\n            offsetGroups: {}\n        };\n    }\n\n    var offsetgroup = coerce('offsetgroup');\n    var offsetGroups = alignmentGroupOpts.offsetGroups;\n    var offsetGroupOpts = offsetGroups[offsetgroup];\n\n    if(offsetgroup) {\n        if(!offsetGroupOpts) {\n            offsetGroupOpts = offsetGroups[offsetgroup] = {\n                offsetIndex: Object.keys(offsetGroups).length\n            };\n        }\n\n        traceOut._offsetIndex = offsetGroupOpts.offsetIndex;\n    }\n}\n\nfunction crossTraceDefaults(fullData, fullLayout) {\n    var traceIn, traceOut;\n\n    function coerce(attr) {\n        return Lib.coerce(traceOut._input, traceOut, attributes, attr);\n    }\n\n    if(fullLayout.barmode === 'group') {\n        for(var i = 0; i < fullData.length; i++) {\n            traceOut = fullData[i];\n\n            if(traceOut.type === 'bar') {\n                traceIn = traceOut._input;\n                handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);\n            }\n        }\n    }\n}\n\nfunction handleText(traceIn, traceOut, layout, coerce, textposition, opts) {\n    opts = opts || {};\n    var moduleHasSelected = !(opts.moduleHasSelected === false);\n    var moduleHasUnselected = !(opts.moduleHasUnselected === false);\n    var moduleHasConstrain = !(opts.moduleHasConstrain === false);\n    var moduleHasCliponaxis = !(opts.moduleHasCliponaxis === false);\n    var moduleHasTextangle = !(opts.moduleHasTextangle === false);\n    var moduleHasInsideanchor = !(opts.moduleHasInsideanchor === false);\n    var hasPathbar = !!opts.hasPathbar;\n\n    var hasBoth = Array.isArray(textposition) || textposition === 'auto';\n    var hasInside = hasBoth || textposition === 'inside';\n    var hasOutside = hasBoth || textposition === 'outside';\n\n    if(hasInside || hasOutside) {\n        var dfltFont = coerceFont(coerce, 'textfont', layout.font);\n\n        // Note that coercing `insidetextfont` is always needed –\n        // even if `textposition` is `outside` for each trace – since\n        // an outside label can become an inside one, for example because\n        // of a bar being stacked on top of it.\n        var insideTextFontDefault = Lib.extendFlat({}, dfltFont);\n        var isTraceTextfontColorSet = traceIn.textfont && traceIn.textfont.color;\n        var isColorInheritedFromLayoutFont = !isTraceTextfontColorSet;\n        if(isColorInheritedFromLayoutFont) {\n            delete insideTextFontDefault.color;\n        }\n        coerceFont(coerce, 'insidetextfont', insideTextFontDefault);\n\n        if(hasPathbar) {\n            var pathbarTextFontDefault = Lib.extendFlat({}, dfltFont);\n            if(isColorInheritedFromLayoutFont) {\n                delete pathbarTextFontDefault.color;\n            }\n            coerceFont(coerce, 'pathbar.textfont', pathbarTextFontDefault);\n        }\n\n        if(hasOutside) coerceFont(coerce, 'outsidetextfont', dfltFont);\n\n        if(moduleHasSelected) coerce('selected.textfont.color');\n        if(moduleHasUnselected) coerce('unselected.textfont.color');\n        if(moduleHasConstrain) coerce('constraintext');\n        if(moduleHasCliponaxis) coerce('cliponaxis');\n        if(moduleHasTextangle) coerce('textangle');\n\n        coerce('texttemplate');\n    }\n\n    if(hasInside) {\n        if(moduleHasInsideanchor) coerce('insidetextanchor');\n    }\n}\n\nmodule.exports = {\n    supplyDefaults: supplyDefaults,\n    crossTraceDefaults: crossTraceDefaults,\n    handleGroupingDefaults: handleGroupingDefaults,\n    handleText: handleText\n};\n\n},{\"../../components/color\":52,\"../../lib\":178,\"../../plots/cartesian/axis_ids\":225,\"../../registry\":269,\"../scatter/xy_defaults\":415,\"./attributes\":279,\"./style_defaults\":294}],284:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt, trace) {\n    // standard cartesian event data\n    out.x = 'xVal' in pt ? pt.xVal : pt.x;\n    out.y = 'yVal' in pt ? pt.yVal : pt.y;\n    if(pt.xa) out.xaxis = pt.xa;\n    if(pt.ya) out.yaxis = pt.ya;\n\n    if(trace.orientation === 'h') {\n        out.label = out.y;\n        out.value = out.x;\n    } else {\n        out.label = out.x;\n        out.value = out.y;\n    }\n\n    return out;\n};\n\n},{}],285:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\nexports.coerceString = function(attributeDefinition, value, defaultValue) {\n    if(typeof value === 'string') {\n        if(value || !attributeDefinition.noBlank) return value;\n    } else if(typeof value === 'number' || value === true) {\n        if(!attributeDefinition.strict) return String(value);\n    }\n\n    return (defaultValue !== undefined) ?\n      defaultValue :\n      attributeDefinition.dflt;\n};\n\nexports.coerceNumber = function(attributeDefinition, value, defaultValue) {\n    if(isNumeric(value)) {\n        value = +value;\n\n        var min = attributeDefinition.min;\n        var max = attributeDefinition.max;\n        var isOutOfBounds = (min !== undefined && value < min) ||\n              (max !== undefined && value > max);\n\n        if(!isOutOfBounds) return value;\n    }\n\n    return (defaultValue !== undefined) ?\n      defaultValue :\n      attributeDefinition.dflt;\n};\n\nexports.coerceColor = function(attributeDefinition, value, defaultValue) {\n    if(tinycolor(value).isValid()) return value;\n\n    return (defaultValue !== undefined) ?\n      defaultValue :\n      attributeDefinition.dflt;\n};\n\nexports.coerceEnumerated = function(attributeDefinition, value, defaultValue) {\n    if(attributeDefinition.coerceNumber) value = +value;\n\n    if(attributeDefinition.values.indexOf(value) !== -1) return value;\n\n    return (defaultValue !== undefined) ?\n      defaultValue :\n      attributeDefinition.dflt;\n};\n\nexports.getValue = function(arrayOrScalar, index) {\n    var value;\n    if(!Array.isArray(arrayOrScalar)) value = arrayOrScalar;\n    else if(index < arrayOrScalar.length) value = arrayOrScalar[index];\n    return value;\n};\n\nexports.getLineWidth = function(trace, di) {\n    var w =\n        (0 < di.mlw) ? di.mlw :\n        !isArrayOrTypedArray(trace.marker.line.width) ? trace.marker.line.width :\n        0;\n\n    return w;\n};\n\n},{\"../../lib\":178,\"fast-isnumeric\":18,\"tinycolor2\":35}],286:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar Registry = _dereq_('../../registry');\nvar Color = _dereq_('../../components/color');\n\nvar fillText = _dereq_('../../lib').fillText;\nvar getLineWidth = _dereq_('./helpers').getLineWidth;\nvar hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nfunction hoverPoints(pointData, xval, yval, hovermode) {\n    var barPointData = hoverOnBars(pointData, xval, yval, hovermode);\n\n    if(barPointData) {\n        var cd = barPointData.cd;\n        var trace = cd[0].trace;\n        var di = cd[barPointData.index];\n\n        barPointData.color = getTraceColor(trace, di);\n        Registry.getComponentMethod('errorbars', 'hoverInfo')(di, trace, barPointData);\n\n        return [barPointData];\n    }\n}\n\nfunction hoverOnBars(pointData, xval, yval, hovermode) {\n    var cd = pointData.cd;\n    var trace = cd[0].trace;\n    var t = cd[0].t;\n    var isClosest = (hovermode === 'closest');\n    var isWaterfall = (trace.type === 'waterfall');\n    var maxHoverDistance = pointData.maxHoverDistance;\n\n    var posVal, sizeVal, posLetter, sizeLetter, dx, dy, pRangeCalc;\n\n    function thisBarMinPos(di) { return di[posLetter] - di.w / 2; }\n    function thisBarMaxPos(di) { return di[posLetter] + di.w / 2; }\n\n    var minPos = isClosest ?\n        thisBarMinPos :\n        function(di) {\n            /*\n             * In compare mode, accept a bar if you're on it *or* its group.\n             * Nearly always it's the group that matters, but in case the bar\n             * was explicitly set wider than its group we'd better accept the\n             * whole bar.\n             *\n             * use `bardelta` instead of `bargroupwidth` so we accept hover\n             * in the gap. That way hover doesn't flash on and off as you\n             * mouse over the plot in compare modes.\n             * In 'closest' mode though the flashing seems inevitable,\n             * without far more complex logic\n             */\n            return Math.min(thisBarMinPos(di), di.p - t.bardelta / 2);\n        };\n\n    var maxPos = isClosest ?\n        thisBarMaxPos :\n        function(di) {\n            return Math.max(thisBarMaxPos(di), di.p + t.bardelta / 2);\n        };\n\n    function _positionFn(_minPos, _maxPos) {\n        // add a little to the pseudo-distance for wider bars, so that like scatter,\n        // if you are over two overlapping bars, the narrower one wins.\n        return Fx.inbox(_minPos - posVal, _maxPos - posVal,\n            maxHoverDistance + Math.min(1, Math.abs(_maxPos - _minPos) / pRangeCalc) - 1);\n    }\n\n    function positionFn(di) {\n        return _positionFn(minPos(di), maxPos(di));\n    }\n\n    function thisBarPositionFn(di) {\n        return _positionFn(thisBarMinPos(di), thisBarMaxPos(di));\n    }\n\n    function sizeFn(di) {\n        var v = sizeVal;\n        var b = di.b;\n        var s = di[sizeLetter];\n\n        if(isWaterfall) {\n            var rawS = Math.abs(di.rawS) || 0;\n            if(v > 0) {\n                s += rawS;\n            } else if(v < 0) {\n                s -= rawS;\n            }\n        }\n\n        // add a gradient so hovering near the end of a\n        // bar makes it a little closer match\n        return Fx.inbox(b - v, s - v, maxHoverDistance + (s - v) / (s - b) - 1);\n    }\n\n    if(trace.orientation === 'h') {\n        posVal = yval;\n        sizeVal = xval;\n        posLetter = 'y';\n        sizeLetter = 'x';\n        dx = sizeFn;\n        dy = positionFn;\n    } else {\n        posVal = xval;\n        sizeVal = yval;\n        posLetter = 'x';\n        sizeLetter = 'y';\n        dy = sizeFn;\n        dx = positionFn;\n    }\n\n    var pa = pointData[posLetter + 'a'];\n    var sa = pointData[sizeLetter + 'a'];\n\n    pRangeCalc = Math.abs(pa.r2c(pa.range[1]) - pa.r2c(pa.range[0]));\n\n    function dxy(di) { return (dx(di) + dy(di)) / 2; }\n    var distfn = Fx.getDistanceFunction(hovermode, dx, dy, dxy);\n    Fx.getClosest(cd, distfn, pointData);\n\n    // skip the rest (for this trace) if we didn't find a close point\n    if(pointData.index === false) return;\n\n    // skip points inside axis rangebreaks\n    if(cd[pointData.index].p === BADNUM) return;\n\n    // if we get here and we're not in 'closest' mode, push min/max pos back\n    // onto the group - even though that means occasionally the mouse will be\n    // over the hover label.\n    if(!isClosest) {\n        minPos = function(di) {\n            return Math.min(thisBarMinPos(di), di.p - t.bargroupwidth / 2);\n        };\n        maxPos = function(di) {\n            return Math.max(thisBarMaxPos(di), di.p + t.bargroupwidth / 2);\n        };\n    }\n\n    // the closest data point\n    var index = pointData.index;\n    var di = cd[index];\n\n    var size = (trace.base) ? di.b + di.s : di.s;\n    pointData[sizeLetter + '0'] = pointData[sizeLetter + '1'] = sa.c2p(di[sizeLetter], true);\n    pointData[sizeLetter + 'LabelVal'] = size;\n\n    var extent = t.extents[t.extents.round(di.p)];\n    pointData[posLetter + '0'] = pa.c2p(isClosest ? minPos(di) : extent[0], true);\n    pointData[posLetter + '1'] = pa.c2p(isClosest ? maxPos(di) : extent[1], true);\n    pointData[posLetter + 'LabelVal'] = di.p;\n\n    pointData.labelLabel = hoverLabelText(pa, pointData[posLetter + 'LabelVal']);\n    pointData.valueLabel = hoverLabelText(sa, pointData[sizeLetter + 'LabelVal']);\n\n    // spikelines always want \"closest\" distance regardless of hovermode\n    pointData.spikeDistance = (sizeFn(di) + thisBarPositionFn(di)) / 2 - maxHoverDistance;\n    // they also want to point to the data value, regardless of where the label goes\n    // in case of bars shifted within groups\n    pointData[posLetter + 'Spike'] = pa.c2p(di.p, true);\n\n    fillText(di, trace, pointData);\n    pointData.hovertemplate = trace.hovertemplate;\n\n    return pointData;\n}\n\nfunction getTraceColor(trace, di) {\n    var mc = di.mcc || trace.marker.color;\n    var mlc = di.mlcc || trace.marker.line.color;\n    var mlw = getLineWidth(trace, di);\n\n    if(Color.opacity(mc)) return mc;\n    else if(Color.opacity(mlc) && mlw) return mlc;\n}\n\nmodule.exports = {\n    hoverPoints: hoverPoints,\n    hoverOnBars: hoverOnBars,\n    getTraceColor: getTraceColor\n};\n\n},{\"../../components/color\":52,\"../../components/fx\":92,\"../../constants/numerical\":158,\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../../registry\":269,\"./helpers\":285}],287:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    layoutAttributes: _dereq_('./layout_attributes'),\n    supplyDefaults: _dereq_('./defaults').supplyDefaults,\n    crossTraceDefaults: _dereq_('./defaults').crossTraceDefaults,\n    supplyLayoutDefaults: _dereq_('./layout_defaults'),\n    calc: _dereq_('./calc'),\n    crossTraceCalc: _dereq_('./cross_trace_calc').crossTraceCalc,\n    colorbar: _dereq_('../scatter/marker_colorbar'),\n    arraysToCalcdata: _dereq_('./arrays_to_calcdata'),\n    plot: _dereq_('./plot').plot,\n    style: _dereq_('./style').style,\n    styleOnSelect: _dereq_('./style').styleOnSelect,\n    hoverPoints: _dereq_('./hover').hoverPoints,\n    eventData: _dereq_('./event_data'),\n    selectPoints: _dereq_('./select'),\n\n    moduleType: 'trace',\n    name: 'bar',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['bar-like', 'cartesian', 'svg', 'bar', 'oriented', 'errorBarsOK', 'showLegend', 'zoomScale'],\n    animatable: true,\n    meta: {\n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"../scatter/marker_colorbar\":407,\"./arrays_to_calcdata\":278,\"./attributes\":279,\"./calc\":280,\"./cross_trace_calc\":282,\"./defaults\":283,\"./event_data\":284,\"./hover\":286,\"./layout_attributes\":288,\"./layout_defaults\":289,\"./plot\":290,\"./select\":291,\"./style\":293}],288:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n    barmode: {\n        valType: 'enumerated',\n        values: ['stack', 'group', 'overlay', 'relative'],\n        dflt: 'group',\n        \n        editType: 'calc',\n        \n    },\n    barnorm: {\n        valType: 'enumerated',\n        values: ['', 'fraction', 'percent'],\n        dflt: '',\n        \n        editType: 'calc',\n        \n    },\n    bargap: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        \n        editType: 'calc',\n        \n    },\n    bargroupgap: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        dflt: 0,\n        \n        editType: 'calc',\n        \n    }\n};\n\n},{}],289:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nmodule.exports = function(layoutIn, layoutOut, fullData) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n    }\n\n    var hasBars = false;\n    var shouldBeGapless = false;\n    var gappedAnyway = false;\n    var usedSubplots = {};\n\n    var mode = coerce('barmode');\n\n    for(var i = 0; i < fullData.length; i++) {\n        var trace = fullData[i];\n        if(Registry.traceIs(trace, 'bar') && trace.visible) hasBars = true;\n        else continue;\n\n        // if we have at least 2 grouped bar traces on the same subplot,\n        // we should default to a gap anyway, even if the data is histograms\n        if(mode === 'group') {\n            var subploti = trace.xaxis + trace.yaxis;\n            if(usedSubplots[subploti]) gappedAnyway = true;\n            usedSubplots[subploti] = true;\n        }\n\n        if(trace.visible && trace.type === 'histogram') {\n            var pa = Axes.getFromId({_fullLayout: layoutOut},\n                        trace[trace.orientation === 'v' ? 'xaxis' : 'yaxis']);\n            if(pa.type !== 'category') shouldBeGapless = true;\n        }\n    }\n\n    if(!hasBars) {\n        delete layoutOut.barmode;\n        return;\n    }\n\n    if(mode !== 'overlay') coerce('barnorm');\n\n    coerce('bargap', (shouldBeGapless && !gappedAnyway) ? 0 : 0.2);\n    coerce('bargroupgap');\n};\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../../registry\":269,\"./layout_attributes\":288}],290:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Registry = _dereq_('../../registry');\nvar tickText = _dereq_('../../plots/cartesian/axes').tickText;\n\nvar uniformText = _dereq_('./uniform_text');\nvar recordMinTextSize = uniformText.recordMinTextSize;\nvar clearMinTextSize = uniformText.clearMinTextSize;\n\nvar style = _dereq_('./style');\nvar helpers = _dereq_('./helpers');\nvar constants = _dereq_('./constants');\nvar attributes = _dereq_('./attributes');\n\nvar attributeText = attributes.text;\nvar attributeTextPosition = attributes.textposition;\n\nvar appendArrayPointValue = _dereq_('../../components/fx/helpers').appendArrayPointValue;\n\nvar TEXTPAD = constants.TEXTPAD;\n\nfunction keyFunc(d) {return d.id;}\nfunction getKeyFunc(trace) {\n    if(trace.ids) {\n        return keyFunc;\n    }\n}\n\nfunction dirSign(a, b) {\n    return (a < b) ? 1 : -1;\n}\n\nfunction getXY(di, xa, ya, isHorizontal) {\n    var s = [];\n    var p = [];\n\n    var sAxis = isHorizontal ? xa : ya;\n    var pAxis = isHorizontal ? ya : xa;\n\n    s[0] = sAxis.c2p(di.s0, true);\n    p[0] = pAxis.c2p(di.p0, true);\n\n    s[1] = sAxis.c2p(di.s1, true);\n    p[1] = pAxis.c2p(di.p1, true);\n\n    return isHorizontal ? [s, p] : [p, s];\n}\n\nfunction transition(selection, fullLayout, opts, makeOnCompleteCallback) {\n    if(!fullLayout.uniformtext.mode && hasTransition(opts)) {\n        var onComplete;\n        if(makeOnCompleteCallback) {\n            onComplete = makeOnCompleteCallback();\n        }\n        return selection\n          .transition()\n          .duration(opts.duration)\n          .ease(opts.easing)\n          .each('end', function() { onComplete && onComplete(); })\n          .each('interrupt', function() { onComplete && onComplete(); });\n    } else {\n        return selection;\n    }\n}\n\nfunction hasTransition(transitionOpts) {\n    return transitionOpts && transitionOpts.duration > 0;\n}\n\nfunction plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n    var fullLayout = gd._fullLayout;\n\n    if(!opts) {\n        opts = {\n            mode: fullLayout.barmode,\n            norm: fullLayout.barmode,\n            gap: fullLayout.bargap,\n            groupgap: fullLayout.bargroupgap\n        };\n\n        // don't clear bar when this is called from waterfall or funnel\n        clearMinTextSize('bar', fullLayout);\n    }\n\n    var bartraces = Lib.makeTraceGroups(traceLayer, cdModule, 'trace bars').each(function(cd) {\n        var plotGroup = d3.select(this);\n        var trace = cd[0].trace;\n        var isWaterfall = (trace.type === 'waterfall');\n        var isFunnel = (trace.type === 'funnel');\n        var isBar = (trace.type === 'bar');\n        var shouldDisplayZeros = (isBar || isFunnel);\n\n        var adjustPixel = 0;\n        if(isWaterfall && trace.connector.visible && trace.connector.mode === 'between') {\n            adjustPixel = trace.connector.line.width / 2;\n        }\n\n        var isHorizontal = (trace.orientation === 'h');\n        var withTransition = hasTransition(opts);\n\n        var pointGroup = Lib.ensureSingle(plotGroup, 'g', 'points');\n\n        var keyFunc = getKeyFunc(trace);\n        var bars = pointGroup.selectAll('g.point').data(Lib.identity, keyFunc);\n\n        bars.enter().append('g')\n            .classed('point', true);\n\n        bars.exit().remove();\n\n        bars.each(function(di, i) {\n            var bar = d3.select(this);\n\n            // now display the bar\n            // clipped xf/yf (2nd arg true): non-positive\n            // log values go off-screen by plotwidth\n            // so you see them continue if you drag the plot\n            var xy = getXY(di, xa, ya, isHorizontal);\n\n            var x0 = xy[0][0];\n            var x1 = xy[0][1];\n            var y0 = xy[1][0];\n            var y1 = xy[1][1];\n\n            // empty bars\n            var isBlank = (isHorizontal ? x1 - x0 : y1 - y0) === 0;\n\n            // display zeros if line.width > 0\n            if(isBlank && shouldDisplayZeros && helpers.getLineWidth(trace, di)) {\n                isBlank = false;\n            }\n\n            // skip nulls\n            if(!isBlank) {\n                isBlank = (\n                    !isNumeric(x0) ||\n                    !isNumeric(x1) ||\n                    !isNumeric(y0) ||\n                    !isNumeric(y1)\n                );\n            }\n\n            // record isBlank\n            di.isBlank = isBlank;\n\n            // for blank bars, ensure start and end positions are equal - important for smooth transitions\n            if(isBlank) {\n                if(isHorizontal) {\n                    x1 = x0;\n                } else {\n                    y1 = y0;\n                }\n            }\n\n            // in waterfall mode `between` we need to adjust bar end points to match the connector width\n            if(adjustPixel && !isBlank) {\n                if(isHorizontal) {\n                    x0 -= dirSign(x0, x1) * adjustPixel;\n                    x1 += dirSign(x0, x1) * adjustPixel;\n                } else {\n                    y0 -= dirSign(y0, y1) * adjustPixel;\n                    y1 += dirSign(y0, y1) * adjustPixel;\n                }\n            }\n\n            var lw;\n            var mc;\n\n            if(trace.type === 'waterfall') {\n                if(!isBlank) {\n                    var cont = trace[di.dir].marker;\n                    lw = cont.line.width;\n                    mc = cont.color;\n                }\n            } else {\n                lw = helpers.getLineWidth(trace, di);\n                mc = di.mc || trace.marker.color;\n            }\n\n            function roundWithLine(v) {\n                var offset = d3.round((lw / 2) % 1, 2);\n\n                // if there are explicit gaps, don't round,\n                // it can make the gaps look crappy\n                return (opts.gap === 0 && opts.groupgap === 0) ?\n                    d3.round(Math.round(v) - offset, 2) : v;\n            }\n\n            function expandToVisible(v, vc, hideZeroSpan) {\n                if(hideZeroSpan && v === vc) {\n                    // should not expand zero span bars\n                    // when start and end positions are identical\n                    // i.e. for vertical when y0 === y1\n                    // and for horizontal when x0 === x1\n                    return v;\n                }\n\n                // if it's not in danger of disappearing entirely,\n                // round more precisely\n                return Math.abs(v - vc) >= 2 ? roundWithLine(v) :\n                // but if it's very thin, expand it so it's\n                // necessarily visible, even if it might overlap\n                // its neighbor\n                (v > vc ? Math.ceil(v) : Math.floor(v));\n            }\n\n            if(!gd._context.staticPlot) {\n                // if bars are not fully opaque or they have a line\n                // around them, round to integer pixels, mainly for\n                // safari so we prevent overlaps from its expansive\n                // pixelation. if the bars ARE fully opaque and have\n                // no line, expand to a full pixel to make sure we\n                // can see them\n\n                var op = Color.opacity(mc);\n                var fixpx = (op < 1 || lw > 0.01) ? roundWithLine : expandToVisible;\n\n                x0 = fixpx(x0, x1, isHorizontal);\n                x1 = fixpx(x1, x0, isHorizontal);\n                y0 = fixpx(y0, y1, !isHorizontal);\n                y1 = fixpx(y1, y0, !isHorizontal);\n            }\n\n            var sel = transition(Lib.ensureSingle(bar, 'path'), fullLayout, opts, makeOnCompleteCallback);\n            sel\n                .style('vector-effect', 'non-scaling-stroke')\n                .attr('d', isNaN((x1 - x0) * (y1 - y0)) ? 'M0,0Z' : 'M' + x0 + ',' + y0 + 'V' + y1 + 'H' + x1 + 'V' + y0 + 'Z')\n                .call(Drawing.setClipUrl, plotinfo.layerClipId, gd);\n\n            if(!fullLayout.uniformtext.mode && withTransition) {\n                var styleFns = Drawing.makePointStyleFns(trace);\n                Drawing.singlePointStyle(di, sel, trace, styleFns, gd);\n            }\n\n            appendBarText(gd, plotinfo, bar, cd, i, x0, x1, y0, y1, opts, makeOnCompleteCallback);\n\n            if(plotinfo.layerClipId) {\n                Drawing.hideOutsideRangePoint(di, bar.select('text'), xa, ya, trace.xcalendar, trace.ycalendar);\n            }\n        });\n\n        // lastly, clip points groups of `cliponaxis !== false` traces\n        // on `plotinfo._hasClipOnAxisFalse === true` subplots\n        var hasClipOnAxisFalse = trace.cliponaxis === false;\n        Drawing.setClipUrl(plotGroup, hasClipOnAxisFalse ? null : plotinfo.layerClipId, gd);\n    });\n\n    // error bars are on the top\n    Registry.getComponentMethod('errorbars', 'plot')(gd, bartraces, plotinfo, opts);\n}\n\nfunction appendBarText(gd, plotinfo, bar, cd, i, x0, x1, y0, y1, opts, makeOnCompleteCallback) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    var fullLayout = gd._fullLayout;\n    var textPosition;\n\n    function appendTextNode(bar, text, font) {\n        var textSelection = Lib.ensureSingle(bar, 'text')\n            .text(text)\n            .attr({\n                'class': 'bartext bartext-' + textPosition,\n                'text-anchor': 'middle',\n                // prohibit tex interpretation until we can handle\n                // tex and regular text together\n                'data-notex': 1\n            })\n            .call(Drawing.font, font)\n            .call(svgTextUtils.convertToTspans, gd);\n\n        return textSelection;\n    }\n\n    // get trace attributes\n    var trace = cd[0].trace;\n    var isHorizontal = (trace.orientation === 'h');\n\n    var text = getText(fullLayout, cd, i, xa, ya);\n    textPosition = getTextPosition(trace, i);\n\n    // compute text position\n    var inStackOrRelativeMode =\n        opts.mode === 'stack' ||\n        opts.mode === 'relative';\n\n    var calcBar = cd[i];\n    var isOutmostBar = !inStackOrRelativeMode || calcBar._outmost;\n\n    if(!text ||\n        textPosition === 'none' ||\n        ((calcBar.isBlank || x0 === x1 || y0 === y1) && (\n            textPosition === 'auto' ||\n            textPosition === 'inside'))) {\n        bar.select('text').remove();\n        return;\n    }\n\n    var layoutFont = fullLayout.font;\n    var barColor = style.getBarColor(cd[i], trace);\n    var insideTextFont = style.getInsideTextFont(trace, i, layoutFont, barColor);\n    var outsideTextFont = style.getOutsideTextFont(trace, i, layoutFont);\n\n    // Special case: don't use the c2p(v, true) value on log size axes,\n    // so that we can get correctly inside text scaling\n    var di = bar.datum();\n    if(isHorizontal) {\n        if(xa.type === 'log' && di.s0 <= 0) {\n            if(xa.range[0] < xa.range[1]) {\n                x0 = 0;\n            } else {\n                x0 = xa._length;\n            }\n        }\n    } else {\n        if(ya.type === 'log' && di.s0 <= 0) {\n            if(ya.range[0] < ya.range[1]) {\n                y0 = ya._length;\n            } else {\n                y0 = 0;\n            }\n        }\n    }\n\n    // padding excluded\n    var barWidth = Math.abs(x1 - x0) - 2 * TEXTPAD;\n    var barHeight = Math.abs(y1 - y0) - 2 * TEXTPAD;\n\n    var textSelection;\n    var textBB;\n    var textWidth;\n    var textHeight;\n    var font;\n\n    if(textPosition === 'outside') {\n        if(!isOutmostBar && !calcBar.hasB) textPosition = 'inside';\n    }\n\n    if(textPosition === 'auto') {\n        if(isOutmostBar) {\n            // draw text using insideTextFont and check if it fits inside bar\n            textPosition = 'inside';\n\n            font = Lib.ensureUniformFontSize(gd, insideTextFont);\n\n            textSelection = appendTextNode(bar, text, font);\n\n            textBB = Drawing.bBox(textSelection.node()),\n            textWidth = textBB.width,\n            textHeight = textBB.height;\n\n            var textHasSize = (textWidth > 0 && textHeight > 0);\n            var fitsInside = (textWidth <= barWidth && textHeight <= barHeight);\n            var fitsInsideIfRotated = (textWidth <= barHeight && textHeight <= barWidth);\n            var fitsInsideIfShrunk = (isHorizontal) ?\n                (barWidth >= textWidth * (barHeight / textHeight)) :\n                (barHeight >= textHeight * (barWidth / textWidth));\n\n            if(textHasSize && (\n                fitsInside ||\n                fitsInsideIfRotated ||\n                fitsInsideIfShrunk)\n            ) {\n                textPosition = 'inside';\n            } else {\n                textPosition = 'outside';\n                textSelection.remove();\n                textSelection = null;\n            }\n        } else {\n            textPosition = 'inside';\n        }\n    }\n\n    if(!textSelection) {\n        font = Lib.ensureUniformFontSize(gd, (textPosition === 'outside') ? outsideTextFont : insideTextFont);\n\n        textSelection = appendTextNode(bar, text, font);\n\n        var currentTransform = textSelection.attr('transform');\n        textSelection.attr('transform', '');\n        textBB = Drawing.bBox(textSelection.node()),\n        textWidth = textBB.width,\n        textHeight = textBB.height;\n        textSelection.attr('transform', currentTransform);\n\n        if(textWidth <= 0 || textHeight <= 0) {\n            textSelection.remove();\n            return;\n        }\n    }\n\n    var angle = trace.textangle;\n\n    // compute text transform\n    var transform, constrained;\n    if(textPosition === 'outside') {\n        constrained =\n            trace.constraintext === 'both' ||\n            trace.constraintext === 'outside';\n\n        transform = toMoveOutsideBar(x0, x1, y0, y1, textBB, {\n            isHorizontal: isHorizontal,\n            constrained: constrained,\n            angle: angle\n        });\n    } else {\n        constrained =\n            trace.constraintext === 'both' ||\n            trace.constraintext === 'inside';\n\n        transform = toMoveInsideBar(x0, x1, y0, y1, textBB, {\n            isHorizontal: isHorizontal,\n            constrained: constrained,\n            angle: angle,\n            anchor: trace.insidetextanchor\n        });\n    }\n\n    transform.fontSize = font.size;\n    recordMinTextSize(trace.type, transform, fullLayout);\n    calcBar.transform = transform;\n\n    transition(textSelection, fullLayout, opts, makeOnCompleteCallback)\n        .attr('transform', Lib.getTextTransform(transform));\n}\n\nfunction getRotateFromAngle(angle) {\n    return (angle === 'auto') ? 0 : angle;\n}\n\nfunction getRotatedTextSize(textBB, rotate) {\n    var a = Math.PI / 180 * rotate;\n    var absSin = Math.abs(Math.sin(a));\n    var absCos = Math.abs(Math.cos(a));\n\n    return {\n        x: textBB.width * absCos + textBB.height * absSin,\n        y: textBB.width * absSin + textBB.height * absCos\n    };\n}\n\nfunction toMoveInsideBar(x0, x1, y0, y1, textBB, opts) {\n    var isHorizontal = !!opts.isHorizontal;\n    var constrained = !!opts.constrained;\n    var angle = opts.angle || 0;\n    var anchor = opts.anchor || 'end';\n    var isEnd = anchor === 'end';\n    var isStart = anchor === 'start';\n    var leftToRight = opts.leftToRight || 0; // left: -1, center: 0, right: 1\n    var toRight = (leftToRight + 1) / 2;\n    var toLeft = 1 - toRight;\n\n    var textWidth = textBB.width;\n    var textHeight = textBB.height;\n    var lx = Math.abs(x1 - x0);\n    var ly = Math.abs(y1 - y0);\n\n    // compute remaining space\n    var textpad = (\n        lx > (2 * TEXTPAD) &&\n        ly > (2 * TEXTPAD)\n    ) ? TEXTPAD : 0;\n\n    lx -= 2 * textpad;\n    ly -= 2 * textpad;\n\n    var rotate = getRotateFromAngle(angle);\n    if((angle === 'auto') &&\n        !(textWidth <= lx && textHeight <= ly) &&\n        (textWidth > lx || textHeight > ly) && (\n        !(textWidth > ly || textHeight > lx) ||\n        ((textWidth < textHeight) !== (lx < ly))\n    )) {\n        rotate += 90;\n    }\n\n    var t = getRotatedTextSize(textBB, rotate);\n\n    var scale = 1;\n    if(constrained) {\n        scale = Math.min(\n            1,\n            lx / t.x,\n            ly / t.y\n        );\n    }\n\n    // compute text and target positions\n    var textX = (\n        textBB.left * toLeft +\n        textBB.right * toRight\n    );\n    var textY = (textBB.top + textBB.bottom) / 2;\n    var targetX = (\n        (x0 + TEXTPAD) * toLeft +\n        (x1 - TEXTPAD) * toRight\n    );\n    var targetY = (y0 + y1) / 2;\n    var anchorX = 0;\n    var anchorY = 0;\n    if(isStart || isEnd) {\n        var extrapad = (isHorizontal ? t.x : t.y) / 2;\n        var dir = isHorizontal ? dirSign(x0, x1) : dirSign(y0, y1);\n\n        if(isHorizontal) {\n            if(isStart) {\n                targetX = x0 + dir * textpad;\n                anchorX = -dir * extrapad;\n            } else {\n                targetX = x1 - dir * textpad;\n                anchorX = dir * extrapad;\n            }\n        } else {\n            if(isStart) {\n                targetY = y0 + dir * textpad;\n                anchorY = -dir * extrapad;\n            } else {\n                targetY = y1 - dir * textpad;\n                anchorY = dir * extrapad;\n            }\n        }\n    }\n\n    return {\n        textX: textX,\n        textY: textY,\n        targetX: targetX,\n        targetY: targetY,\n        anchorX: anchorX,\n        anchorY: anchorY,\n        scale: scale,\n        rotate: rotate\n    };\n}\n\nfunction toMoveOutsideBar(x0, x1, y0, y1, textBB, opts) {\n    var isHorizontal = !!opts.isHorizontal;\n    var constrained = !!opts.constrained;\n    var angle = opts.angle || 0;\n\n    var textWidth = textBB.width;\n    var textHeight = textBB.height;\n    var lx = Math.abs(x1 - x0);\n    var ly = Math.abs(y1 - y0);\n\n    var textpad;\n    // Keep the padding so the text doesn't sit right against\n    // the bars, but don't factor it into barWidth\n    if(isHorizontal) {\n        textpad = (ly > 2 * TEXTPAD) ? TEXTPAD : 0;\n    } else {\n        textpad = (lx > 2 * TEXTPAD) ? TEXTPAD : 0;\n    }\n\n    // compute rotate and scale\n    var scale = 1;\n    if(constrained) {\n        scale = (isHorizontal) ?\n            Math.min(1, ly / textHeight) :\n            Math.min(1, lx / textWidth);\n    }\n\n    var rotate = getRotateFromAngle(angle);\n    var t = getRotatedTextSize(textBB, rotate);\n\n    // compute text and target positions\n    var extrapad = (isHorizontal ? t.x : t.y) / 2;\n    var textX = (textBB.left + textBB.right) / 2;\n    var textY = (textBB.top + textBB.bottom) / 2;\n    var targetX = (x0 + x1) / 2;\n    var targetY = (y0 + y1) / 2;\n    var anchorX = 0;\n    var anchorY = 0;\n\n    var dir = isHorizontal ? dirSign(x1, x0) : dirSign(y0, y1);\n    if(isHorizontal) {\n        targetX = x1 - dir * textpad;\n        anchorX = dir * extrapad;\n    } else {\n        targetY = y1 + dir * textpad;\n        anchorY = -dir * extrapad;\n    }\n\n    return {\n        textX: textX,\n        textY: textY,\n        targetX: targetX,\n        targetY: targetY,\n        anchorX: anchorX,\n        anchorY: anchorY,\n        scale: scale,\n        rotate: rotate\n    };\n}\n\nfunction getText(fullLayout, cd, index, xa, ya) {\n    var trace = cd[0].trace;\n    var texttemplate = trace.texttemplate;\n\n    var value;\n    if(texttemplate) {\n        value = calcTexttemplate(fullLayout, cd, index, xa, ya);\n    } else if(trace.textinfo) {\n        value = calcTextinfo(cd, index, xa, ya);\n    } else {\n        value = helpers.getValue(trace.text, index);\n    }\n\n    return helpers.coerceString(attributeText, value);\n}\n\nfunction getTextPosition(trace, index) {\n    var value = helpers.getValue(trace.textposition, index);\n    return helpers.coerceEnumerated(attributeTextPosition, value);\n}\n\nfunction calcTexttemplate(fullLayout, cd, index, xa, ya) {\n    var trace = cd[0].trace;\n    var texttemplate = Lib.castOption(trace, index, 'texttemplate');\n    if(!texttemplate) return '';\n    var isWaterfall = (trace.type === 'waterfall');\n    var isFunnel = (trace.type === 'funnel');\n\n    var pLetter, pAxis;\n    var vLetter, vAxis;\n    if(trace.orientation === 'h') {\n        pLetter = 'y';\n        pAxis = ya;\n        vLetter = 'x';\n        vAxis = xa;\n    } else {\n        pLetter = 'x';\n        pAxis = xa;\n        vLetter = 'y';\n        vAxis = ya;\n    }\n\n    function formatLabel(u) {\n        return tickText(pAxis, u, true).text;\n    }\n\n    function formatNumber(v) {\n        return tickText(vAxis, +v, true).text;\n    }\n\n    var cdi = cd[index];\n    var obj = {};\n\n    obj.label = cdi.p;\n    obj.labelLabel = obj[pLetter + 'Label'] = formatLabel(cdi.p);\n\n    var tx = Lib.castOption(trace, cdi.i, 'text');\n    if(tx === 0 || tx) obj.text = tx;\n\n    obj.value = cdi.s;\n    obj.valueLabel = obj[vLetter + 'Label'] = formatNumber(cdi.s);\n\n    var pt = {};\n    appendArrayPointValue(pt, trace, cdi.i);\n\n    if(isWaterfall) {\n        obj.delta = +cdi.rawS || cdi.s;\n        obj.deltaLabel = formatNumber(obj.delta);\n        obj.final = cdi.v;\n        obj.finalLabel = formatNumber(obj.final);\n        obj.initial = obj.final - obj.delta;\n        obj.initialLabel = formatNumber(obj.initial);\n    }\n\n    if(isFunnel) {\n        obj.value = cdi.s;\n        obj.valueLabel = formatNumber(obj.value);\n\n        obj.percentInitial = cdi.begR;\n        obj.percentInitialLabel = Lib.formatPercent(cdi.begR);\n        obj.percentPrevious = cdi.difR;\n        obj.percentPreviousLabel = Lib.formatPercent(cdi.difR);\n        obj.percentTotal = cdi.sumR;\n        obj.percenTotalLabel = Lib.formatPercent(cdi.sumR);\n    }\n\n    var customdata = Lib.castOption(trace, cdi.i, 'customdata');\n    if(customdata) obj.customdata = customdata;\n    return Lib.texttemplateString(texttemplate, obj, fullLayout._d3locale, pt, obj, trace._meta || {});\n}\n\nfunction calcTextinfo(cd, index, xa, ya) {\n    var trace = cd[0].trace;\n    var isHorizontal = (trace.orientation === 'h');\n    var isWaterfall = (trace.type === 'waterfall');\n    var isFunnel = (trace.type === 'funnel');\n\n    function formatLabel(u) {\n        var pAxis = isHorizontal ? ya : xa;\n        return tickText(pAxis, u, true).text;\n    }\n\n    function formatNumber(v) {\n        var sAxis = isHorizontal ? xa : ya;\n        return tickText(sAxis, +v, true).text;\n    }\n\n    var textinfo = trace.textinfo;\n    var cdi = cd[index];\n\n    var parts = textinfo.split('+');\n    var text = [];\n    var tx;\n\n    var hasFlag = function(flag) { return parts.indexOf(flag) !== -1; };\n\n    if(hasFlag('label')) {\n        text.push(formatLabel(cd[index].p));\n    }\n\n    if(hasFlag('text')) {\n        tx = Lib.castOption(trace, cdi.i, 'text');\n        if(tx === 0 || tx) text.push(tx);\n    }\n\n    if(isWaterfall) {\n        var delta = +cdi.rawS || cdi.s;\n        var final = cdi.v;\n        var initial = final - delta;\n\n        if(hasFlag('initial')) text.push(formatNumber(initial));\n        if(hasFlag('delta')) text.push(formatNumber(delta));\n        if(hasFlag('final')) text.push(formatNumber(final));\n    }\n\n    if(isFunnel) {\n        if(hasFlag('value')) text.push(formatNumber(cdi.s));\n\n        var nPercent = 0;\n        if(hasFlag('percent initial')) nPercent++;\n        if(hasFlag('percent previous')) nPercent++;\n        if(hasFlag('percent total')) nPercent++;\n\n        var hasMultiplePercents = nPercent > 1;\n\n        if(hasFlag('percent initial')) {\n            tx = Lib.formatPercent(cdi.begR);\n            if(hasMultiplePercents) tx += ' of initial';\n            text.push(tx);\n        }\n        if(hasFlag('percent previous')) {\n            tx = Lib.formatPercent(cdi.difR);\n            if(hasMultiplePercents) tx += ' of previous';\n            text.push(tx);\n        }\n        if(hasFlag('percent total')) {\n            tx = Lib.formatPercent(cdi.sumR);\n            if(hasMultiplePercents) tx += ' of total';\n            text.push(tx);\n        }\n    }\n\n    return text.join('<br>');\n}\n\nmodule.exports = {\n    plot: plot,\n    toMoveInsideBar: toMoveInsideBar\n};\n\n},{\"../../components/color\":52,\"../../components/drawing\":74,\"../../components/fx/helpers\":88,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../plots/cartesian/axes\":222,\"../../registry\":269,\"./attributes\":279,\"./constants\":281,\"./helpers\":285,\"./style\":293,\"./uniform_text\":295,\"d3\":16,\"fast-isnumeric\":18}],291:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function selectPoints(searchInfo, selectionTester) {\n    var cd = searchInfo.cd;\n    var xa = searchInfo.xaxis;\n    var ya = searchInfo.yaxis;\n    var trace = cd[0].trace;\n    var isFunnel = (trace.type === 'funnel');\n    var isHorizontal = (trace.orientation === 'h');\n    var selection = [];\n    var i;\n\n    if(selectionTester === false) {\n        // clear selection\n        for(i = 0; i < cd.length; i++) {\n            cd[i].selected = 0;\n        }\n    } else {\n        for(i = 0; i < cd.length; i++) {\n            var di = cd[i];\n            var ct = 'ct' in di ? di.ct : getCentroid(di, xa, ya, isHorizontal, isFunnel);\n\n            if(selectionTester.contains(ct, false, i, searchInfo)) {\n                selection.push({\n                    pointNumber: i,\n                    x: xa.c2d(di.x),\n                    y: ya.c2d(di.y)\n                });\n                di.selected = 1;\n            } else {\n                di.selected = 0;\n            }\n        }\n    }\n\n    return selection;\n};\n\nfunction getCentroid(d, xa, ya, isHorizontal, isFunnel) {\n    var x0 = xa.c2p(isHorizontal ? d.s0 : d.p0, true);\n    var x1 = xa.c2p(isHorizontal ? d.s1 : d.p1, true);\n    var y0 = ya.c2p(isHorizontal ? d.p0 : d.s0, true);\n    var y1 = ya.c2p(isHorizontal ? d.p1 : d.s1, true);\n\n    if(isFunnel) {\n        return [(x0 + x1) / 2, (y0 + y1) / 2];\n    } else {\n        if(isHorizontal) {\n            return [x1, (y0 + y1) / 2];\n        } else {\n            return [(x0 + x1) / 2, y1];\n        }\n    }\n}\n\n},{}],292:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = Sieve;\n\nvar distinctVals = _dereq_('../../lib').distinctVals;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\n/**\n * Helper class to sieve data from traces into bins\n *\n * @class\n *\n * @param {Array} traces\n*   Array of calculated traces\n * @param {object} opts\n *  - @param {boolean} [sepNegVal]\n *      If true, then split data at the same position into a bar\n *      for positive values and another for negative values\n *  - @param {boolean} [overlapNoMerge]\n *     If true, then don't merge overlapping bars into a single bar\n */\nfunction Sieve(traces, opts) {\n    this.traces = traces;\n    this.sepNegVal = opts.sepNegVal;\n    this.overlapNoMerge = opts.overlapNoMerge;\n\n    // for single-bin histograms - see histogram/calc\n    var width1 = Infinity;\n\n    var positions = [];\n    for(var i = 0; i < traces.length; i++) {\n        var trace = traces[i];\n        for(var j = 0; j < trace.length; j++) {\n            var bar = trace[j];\n            if(bar.p !== BADNUM) positions.push(bar.p);\n        }\n        if(trace[0] && trace[0].width1) {\n            width1 = Math.min(trace[0].width1, width1);\n        }\n    }\n    this.positions = positions;\n\n    var dv = distinctVals(positions);\n    this.distinctPositions = dv.vals;\n    if(dv.vals.length === 1 && width1 !== Infinity) this.minDiff = width1;\n    else this.minDiff = Math.min(dv.minDiff, width1);\n\n    this.binWidth = this.minDiff;\n\n    this.bins = {};\n}\n\n/**\n * Sieve datum\n *\n * @method\n * @param {number} position\n * @param {number} value\n * @returns {number} Previous bin value\n */\nSieve.prototype.put = function put(position, value) {\n    var label = this.getLabel(position, value);\n    var oldValue = this.bins[label] || 0;\n\n    this.bins[label] = oldValue + value;\n\n    return oldValue;\n};\n\n/**\n * Get current bin value for a given datum\n *\n * @method\n * @param {number} position  Position of datum\n * @param {number} [value]   Value of datum\n *                           (required if this.sepNegVal is true)\n * @returns {number} Current bin value\n */\nSieve.prototype.get = function get(position, value) {\n    var label = this.getLabel(position, value);\n    return this.bins[label] || 0;\n};\n\n/**\n * Get bin label for a given datum\n *\n * @method\n * @param {number} position  Position of datum\n * @param {number} [value]   Value of datum\n *                           (required if this.sepNegVal is true)\n * @returns {string} Bin label\n * (prefixed with a 'v' if value is negative and this.sepNegVal is\n * true; otherwise prefixed with '^')\n */\nSieve.prototype.getLabel = function getLabel(position, value) {\n    var prefix = (value < 0 && this.sepNegVal) ? 'v' : '^';\n    var label = (this.overlapNoMerge) ?\n        position :\n        Math.round(position / this.binWidth);\n    return prefix + label;\n};\n\n},{\"../../constants/numerical\":158,\"../../lib\":178}],293:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nvar resizeText = _dereq_('./uniform_text').resizeText;\nvar attributes = _dereq_('./attributes');\nvar attributeTextFont = attributes.textfont;\nvar attributeInsideTextFont = attributes.insidetextfont;\nvar attributeOutsideTextFont = attributes.outsidetextfont;\nvar helpers = _dereq_('./helpers');\n\nfunction style(gd) {\n    var s = d3.select(gd).selectAll('g.barlayer').selectAll('g.trace');\n    resizeText(gd, s, 'bar');\n\n    var barcount = s.size();\n    var fullLayout = gd._fullLayout;\n\n    // trace styling\n    s.style('opacity', function(d) { return d[0].trace.opacity; })\n\n    // for gapless (either stacked or neighboring grouped) bars use\n    // crispEdges to turn off antialiasing so an artificial gap\n    // isn't introduced.\n    .each(function(d) {\n        if((fullLayout.barmode === 'stack' && barcount > 1) ||\n                (fullLayout.bargap === 0 &&\n                 fullLayout.bargroupgap === 0 &&\n                 !d[0].trace.marker.line.width)) {\n            d3.select(this).attr('shape-rendering', 'crispEdges');\n        }\n    });\n\n    s.selectAll('g.points').each(function(d) {\n        var sel = d3.select(this);\n        var trace = d[0].trace;\n        stylePoints(sel, trace, gd);\n    });\n\n    Registry.getComponentMethod('errorbars', 'style')(s);\n}\n\nfunction stylePoints(sel, trace, gd) {\n    Drawing.pointStyle(sel.selectAll('path'), trace, gd);\n    styleTextPoints(sel, trace, gd);\n}\n\nfunction styleTextPoints(sel, trace, gd) {\n    sel.selectAll('text').each(function(d) {\n        var tx = d3.select(this);\n        var font = Lib.ensureUniformFontSize(gd, determineFont(tx, d, trace, gd));\n\n        Drawing.font(tx, font);\n    });\n}\n\nfunction styleOnSelect(gd, cd, sel) {\n    var trace = cd[0].trace;\n\n    if(trace.selectedpoints) {\n        stylePointsInSelectionMode(sel, trace, gd);\n    } else {\n        stylePoints(sel, trace, gd);\n        Registry.getComponentMethod('errorbars', 'style')(sel);\n    }\n}\n\nfunction stylePointsInSelectionMode(s, trace, gd) {\n    Drawing.selectedPointStyle(s.selectAll('path'), trace);\n    styleTextInSelectionMode(s.selectAll('text'), trace, gd);\n}\n\nfunction styleTextInSelectionMode(txs, trace, gd) {\n    txs.each(function(d) {\n        var tx = d3.select(this);\n        var font;\n\n        if(d.selected) {\n            font = Lib.ensureUniformFontSize(gd, determineFont(tx, d, trace, gd));\n\n            var selectedFontColor = trace.selected.textfont && trace.selected.textfont.color;\n            if(selectedFontColor) {\n                font.color = selectedFontColor;\n            }\n\n            Drawing.font(tx, font);\n        } else {\n            Drawing.selectedTextStyle(tx, trace);\n        }\n    });\n}\n\nfunction determineFont(tx, d, trace, gd) {\n    var layoutFont = gd._fullLayout.font;\n    var textFont = trace.textfont;\n\n    if(tx.classed('bartext-inside')) {\n        var barColor = getBarColor(d, trace);\n        textFont = getInsideTextFont(trace, d.i, layoutFont, barColor);\n    } else if(tx.classed('bartext-outside')) {\n        textFont = getOutsideTextFont(trace, d.i, layoutFont);\n    }\n\n    return textFont;\n}\n\nfunction getTextFont(trace, index, defaultValue) {\n    return getFontValue(\n      attributeTextFont, trace.textfont, index, defaultValue);\n}\n\nfunction getInsideTextFont(trace, index, layoutFont, barColor) {\n    var defaultFont = getTextFont(trace, index, layoutFont);\n\n    var wouldFallBackToLayoutFont =\n      (trace._input.textfont === undefined || trace._input.textfont.color === undefined) ||\n      (Array.isArray(trace.textfont.color) && trace.textfont.color[index] === undefined);\n    if(wouldFallBackToLayoutFont) {\n        defaultFont = {\n            color: Color.contrast(barColor),\n            family: defaultFont.family,\n            size: defaultFont.size\n        };\n    }\n\n    return getFontValue(\n      attributeInsideTextFont, trace.insidetextfont, index, defaultFont);\n}\n\nfunction getOutsideTextFont(trace, index, layoutFont) {\n    var defaultFont = getTextFont(trace, index, layoutFont);\n    return getFontValue(\n      attributeOutsideTextFont, trace.outsidetextfont, index, defaultFont);\n}\n\nfunction getFontValue(attributeDefinition, attributeValue, index, defaultValue) {\n    attributeValue = attributeValue || {};\n\n    var familyValue = helpers.getValue(attributeValue.family, index);\n    var sizeValue = helpers.getValue(attributeValue.size, index);\n    var colorValue = helpers.getValue(attributeValue.color, index);\n\n    return {\n        family: helpers.coerceString(\n          attributeDefinition.family, familyValue, defaultValue.family),\n        size: helpers.coerceNumber(\n          attributeDefinition.size, sizeValue, defaultValue.size),\n        color: helpers.coerceColor(\n          attributeDefinition.color, colorValue, defaultValue.color)\n    };\n}\n\nfunction getBarColor(cd, trace) {\n    if(trace.type === 'waterfall') {\n        return trace[cd.dir].marker.color;\n    }\n    return cd.mc || trace.marker.color;\n}\n\nmodule.exports = {\n    style: style,\n    styleTextPoints: styleTextPoints,\n    styleOnSelect: styleOnSelect,\n    getInsideTextFont: getInsideTextFont,\n    getOutsideTextFont: getOutsideTextFont,\n    getBarColor: getBarColor,\n    resizeText: resizeText\n};\n\n},{\"../../components/color\":52,\"../../components/drawing\":74,\"../../lib\":178,\"../../registry\":269,\"./attributes\":279,\"./helpers\":285,\"./uniform_text\":295,\"d3\":16}],294:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\n\nmodule.exports = function handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout) {\n    coerce('marker.color', defaultColor);\n\n    if(hasColorscale(traceIn, 'marker')) {\n        colorscaleDefaults(\n            traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'}\n        );\n    }\n\n    coerce('marker.line.color', Color.defaultLine);\n\n    if(hasColorscale(traceIn, 'marker.line')) {\n        colorscaleDefaults(\n            traceIn, traceOut, layout, coerce, {prefix: 'marker.line.', cLetter: 'c'}\n        );\n    }\n\n    coerce('marker.line.width');\n    coerce('marker.opacity');\n    coerce('selected.marker.color');\n    coerce('unselected.marker.color');\n};\n\n},{\"../../components/color\":52,\"../../components/colorscale/defaults\":62,\"../../components/colorscale/helpers\":63}],295:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\n\nfunction resizeText(gd, gTrace, traceType) {\n    var fullLayout = gd._fullLayout;\n    var minSize = fullLayout['_' + traceType + 'Text_minsize'];\n    if(minSize) {\n        var shouldHide = fullLayout.uniformtext.mode === 'hide';\n\n        var selector;\n        switch(traceType) {\n            case 'funnelarea' :\n            case 'pie' :\n            case 'sunburst' :\n                selector = 'g.slice';\n                break;\n            case 'treemap' :\n                selector = 'g.slice, g.pathbar';\n                break;\n            default :\n                selector = 'g.points > g.point';\n        }\n\n        gTrace.selectAll(selector).each(function(d) {\n            var transform = d.transform;\n            if(transform) {\n                transform.scale = (shouldHide && transform.hide) ? 0 : minSize / transform.fontSize;\n\n                var el = d3.select(this).select('text');\n                el.attr('transform', Lib.getTextTransform(transform));\n            }\n        });\n    }\n}\n\nfunction recordMinTextSize(\n    traceType, // in\n    transform, // inout\n    fullLayout // inout\n) {\n    if(fullLayout.uniformtext.mode) {\n        var minKey = getMinKey(traceType);\n        var minSize = fullLayout.uniformtext.minsize;\n        var size = transform.scale * transform.fontSize;\n\n        transform.hide = size < minSize;\n\n        fullLayout[minKey] = fullLayout[minKey] || Infinity;\n        if(!transform.hide) {\n            fullLayout[minKey] = Math.min(\n                fullLayout[minKey],\n                Math.max(size, minSize)\n            );\n        }\n    }\n}\n\nfunction clearMinTextSize(\n    traceType, // in\n    fullLayout // inout\n) {\n    var minKey = getMinKey(traceType);\n    fullLayout[minKey] = undefined;\n}\n\nfunction getMinKey(traceType) {\n    return '_' + traceType + 'Text_minsize';\n}\n\nmodule.exports = {\n    recordMinTextSize: recordMinTextSize,\n    clearMinTextSize: clearMinTextSize,\n    resizeText: resizeText\n};\n\n},{\"../../lib\":178,\"d3\":16}],296:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar barAttrs = _dereq_('../bar/attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nmodule.exports = {\n    y: {\n        valType: 'data_array',\n        editType: 'calc+clearAxisTypes',\n        \n    },\n    x: {\n        valType: 'data_array',\n        editType: 'calc+clearAxisTypes',\n        \n    },\n    x0: {\n        valType: 'any',\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n    y0: {\n        valType: 'any',\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n\n    dx: {\n        valType: 'number',\n        \n        editType: 'calc',\n        \n    },\n    dy: {\n        valType: 'number',\n        \n        editType: 'calc',\n        \n    },\n\n    name: {\n        valType: 'string',\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n\n    q1: {\n        valType: 'data_array',\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n    median: {\n        valType: 'data_array',\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n    q3: {\n        valType: 'data_array',\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n    lowerfence: {\n        valType: 'data_array',\n        \n        editType: 'calc',\n        \n    },\n    upperfence: {\n        valType: 'data_array',\n        \n        editType: 'calc',\n        \n    },\n\n    notched: {\n        valType: 'boolean',\n        \n        editType: 'calc',\n        \n    },\n    notchwidth: {\n        valType: 'number',\n        min: 0,\n        max: 0.5,\n        dflt: 0.25,\n        \n        editType: 'calc',\n        \n    },\n    notchspan: {\n        valType: 'data_array',\n        \n        editType: 'calc',\n        \n    },\n\n    // TODO\n    // maybe add\n    // - loweroutlierbound / upperoutlierbound\n    // - lowersuspectedoutlierbound / uppersuspectedoutlierbound\n\n    boxpoints: {\n        valType: 'enumerated',\n        values: ['all', 'outliers', 'suspectedoutliers', false],\n        \n        editType: 'calc',\n        \n    },\n    jitter: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        \n        editType: 'calc',\n        \n    },\n    pointpos: {\n        valType: 'number',\n        min: -2,\n        max: 2,\n        \n        editType: 'calc',\n        \n    },\n\n    boxmean: {\n        valType: 'enumerated',\n        values: [true, 'sd', false],\n        \n        editType: 'calc',\n        \n    },\n    mean: {\n        valType: 'data_array',\n        \n        editType: 'calc',\n        \n    },\n    sd: {\n        valType: 'data_array',\n        \n        editType: 'calc',\n        \n    },\n\n    orientation: {\n        valType: 'enumerated',\n        values: ['v', 'h'],\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n\n    quartilemethod: {\n        valType: 'enumerated',\n        values: ['linear', 'exclusive', 'inclusive'],\n        dflt: 'linear',\n        \n        editType: 'calc',\n        \n    },\n\n    width: {\n        valType: 'number',\n        min: 0,\n        \n        dflt: 0,\n        editType: 'calc',\n        \n    },\n\n    marker: {\n        outliercolor: {\n            valType: 'color',\n            dflt: 'rgba(0, 0, 0, 0)',\n            \n            editType: 'style',\n            \n        },\n        symbol: extendFlat({}, scatterMarkerAttrs.symbol,\n            {arrayOk: false, editType: 'plot'}),\n        opacity: extendFlat({}, scatterMarkerAttrs.opacity,\n            {arrayOk: false, dflt: 1, editType: 'style'}),\n        size: extendFlat({}, scatterMarkerAttrs.size,\n            {arrayOk: false, editType: 'calc'}),\n        color: extendFlat({}, scatterMarkerAttrs.color,\n            {arrayOk: false, editType: 'style'}),\n        line: {\n            color: extendFlat({}, scatterMarkerLineAttrs.color,\n                {arrayOk: false, dflt: colorAttrs.defaultLine, editType: 'style'}\n            ),\n            width: extendFlat({}, scatterMarkerLineAttrs.width,\n                {arrayOk: false, dflt: 0, editType: 'style'}\n            ),\n            outliercolor: {\n                valType: 'color',\n                \n                editType: 'style',\n                \n            },\n            outlierwidth: {\n                valType: 'number',\n                min: 0,\n                dflt: 1,\n                \n                editType: 'style',\n                \n            },\n            editType: 'style'\n        },\n        editType: 'plot'\n    },\n\n    line: {\n        color: {\n            valType: 'color',\n            \n            editType: 'style',\n            \n        },\n        width: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 2,\n            editType: 'style',\n            \n        },\n        editType: 'plot'\n    },\n\n    fillcolor: scatterAttrs.fillcolor,\n\n    whiskerwidth: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        dflt: 0.5,\n        \n        editType: 'calc',\n        \n    },\n\n    offsetgroup: barAttrs.offsetgroup,\n    alignmentgroup: barAttrs.alignmentgroup,\n\n    selected: {\n        marker: scatterAttrs.selected.marker,\n        editType: 'style'\n    },\n    unselected: {\n        marker: scatterAttrs.unselected.marker,\n        editType: 'style'\n    },\n\n    text: extendFlat({}, scatterAttrs.text, {\n        \n    }),\n    hovertext: extendFlat({}, scatterAttrs.hovertext, {\n        \n    }),\n    hovertemplate: hovertemplateAttrs({\n        \n    }),\n\n    hoveron: {\n        valType: 'flaglist',\n        flags: ['boxes', 'points'],\n        dflt: 'boxes+points',\n        \n        editType: 'style',\n        \n    }\n};\n\n},{\"../../components/color/attributes\":51,\"../../lib/extend\":173,\"../../plots/template_attributes\":264,\"../bar/attributes\":279,\"../scatter/attributes\":389}],297:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\n\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\nvar _ = Lib._;\n\nmodule.exports = function calc(gd, trace) {\n    var fullLayout = gd._fullLayout;\n    var xa = Axes.getFromId(gd, trace.xaxis || 'x');\n    var ya = Axes.getFromId(gd, trace.yaxis || 'y');\n    var cd = [];\n\n    // N.B. violin reuses same Box.calc\n    var numKey = trace.type === 'violin' ? '_numViolins' : '_numBoxes';\n\n    var i, j;\n    var valAxis, valLetter;\n    var posAxis, posLetter;\n\n    if(trace.orientation === 'h') {\n        valAxis = xa;\n        valLetter = 'x';\n        posAxis = ya;\n        posLetter = 'y';\n    } else {\n        valAxis = ya;\n        valLetter = 'y';\n        posAxis = xa;\n        posLetter = 'x';\n    }\n\n    var posArray = getPos(trace, posLetter, posAxis, fullLayout[numKey]);\n    var dv = Lib.distinctVals(posArray);\n    var posDistinct = dv.vals;\n    var dPos = dv.minDiff / 2;\n\n    // item in trace calcdata\n    var cdi;\n    // array of {v: v, i, i} sample pts\n    var pts;\n    // values of the `pts` array of objects\n    var boxVals;\n    // length of sample\n    var N;\n    // single sample point\n    var pt;\n    // single sample value\n    var v;\n\n    // filter function for outlier pts\n    // outlier definition based on http://www.physics.csbsju.edu/stats/box2.html\n    var ptFilterFn = (trace.boxpoints || trace.points) === 'all' ?\n        Lib.identity :\n        function(pt) { return (pt.v < cdi.lf || pt.v > cdi.uf); };\n\n    if(trace._hasPreCompStats) {\n        var valArrayRaw = trace[valLetter];\n        var d2c = function(k) { return valAxis.d2c((trace[k] || [])[i]); };\n        var minVal = Infinity;\n        var maxVal = -Infinity;\n\n        for(i = 0; i < trace._length; i++) {\n            var posi = posArray[i];\n            if(!isNumeric(posi)) continue;\n\n            cdi = {};\n            cdi.pos = cdi[posLetter] = posi;\n\n            cdi.q1 = d2c('q1');\n            cdi.med = d2c('median');\n            cdi.q3 = d2c('q3');\n\n            pts = [];\n            if(valArrayRaw && Lib.isArrayOrTypedArray(valArrayRaw[i])) {\n                for(j = 0; j < valArrayRaw[i].length; j++) {\n                    v = valAxis.d2c(valArrayRaw[i][j]);\n                    if(v !== BADNUM) {\n                        pt = {v: v, i: [i, j]};\n                        arraysToCalcdata(pt, trace, [i, j]);\n                        pts.push(pt);\n                    }\n                }\n            }\n            cdi.pts = pts.sort(sortByVal);\n            boxVals = cdi[valLetter] = pts.map(extractVal);\n            N = boxVals.length;\n\n            if(cdi.med !== BADNUM && cdi.q1 !== BADNUM && cdi.q3 !== BADNUM &&\n                cdi.med >= cdi.q1 && cdi.q3 >= cdi.med\n            ) {\n                var lf = d2c('lowerfence');\n                cdi.lf = (lf !== BADNUM && lf <= cdi.q1) ?\n                    lf :\n                    computeLowerFence(cdi, boxVals, N);\n\n                var uf = d2c('upperfence');\n                cdi.uf = (uf !== BADNUM && uf >= cdi.q3) ?\n                    uf :\n                    computeUpperFence(cdi, boxVals, N);\n\n                var mean = d2c('mean');\n                cdi.mean = (mean !== BADNUM) ?\n                    mean :\n                    (N ? Lib.mean(boxVals, N) : (cdi.q1 + cdi.q3) / 2);\n\n                var sd = d2c('sd');\n                cdi.sd = (mean !== BADNUM && sd >= 0) ?\n                    sd :\n                    (N ? Lib.stdev(boxVals, N, cdi.mean) : (cdi.q3 - cdi.q1));\n\n                cdi.lo = computeLowerOutlierBound(cdi);\n                cdi.uo = computeUpperOutlierBound(cdi);\n\n                var ns = d2c('notchspan');\n                ns = (ns !== BADNUM && ns > 0) ? ns : computeNotchSpan(cdi, N);\n                cdi.ln = cdi.med - ns;\n                cdi.un = cdi.med + ns;\n\n                var imin = cdi.lf;\n                var imax = cdi.uf;\n                if(trace.boxpoints && boxVals.length) {\n                    imin = Math.min(imin, boxVals[0]);\n                    imax = Math.max(imax, boxVals[N - 1]);\n                }\n                if(trace.notched) {\n                    imin = Math.min(imin, cdi.ln);\n                    imax = Math.max(imax, cdi.un);\n                }\n                cdi.min = imin;\n                cdi.max = imax;\n            } else {\n                Lib.warn([\n                    'Invalid input - make sure that q1 <= median <= q3',\n                    'q1 = ' + cdi.q1,\n                    'median = ' + cdi.med,\n                    'q3 = ' + cdi.q3\n                ].join('\\n'));\n\n                var v0;\n                if(cdi.med !== BADNUM) {\n                    v0 = cdi.med;\n                } else if(cdi.q1 !== BADNUM) {\n                    if(cdi.q3 !== BADNUM) v0 = (cdi.q1 + cdi.q3) / 2;\n                    else v0 = cdi.q1;\n                } else if(cdi.q3 !== BADNUM) {\n                    v0 = cdi.q3;\n                } else {\n                    v0 = 0;\n                }\n\n                // draw box as line segment\n                cdi.med = v0;\n                cdi.q1 = cdi.q3 = v0;\n                cdi.lf = cdi.uf = v0;\n                cdi.mean = cdi.sd = v0;\n                cdi.ln = cdi.un = v0;\n                cdi.min = cdi.max = v0;\n            }\n\n            minVal = Math.min(minVal, cdi.min);\n            maxVal = Math.max(maxVal, cdi.max);\n\n            cdi.pts2 = pts.filter(ptFilterFn);\n\n            cd.push(cdi);\n        }\n\n        trace._extremes[valAxis._id] = Axes.findExtremes(valAxis,\n            [minVal, maxVal],\n            {padded: true}\n        );\n    } else {\n        var valArray = valAxis.makeCalcdata(trace, valLetter);\n        var posBins = makeBins(posDistinct, dPos);\n        var pLen = posDistinct.length;\n        var ptsPerBin = initNestedArray(pLen);\n\n        // bin pts info per position bins\n        for(i = 0; i < trace._length; i++) {\n            v = valArray[i];\n            if(!isNumeric(v)) continue;\n\n            var n = Lib.findBin(posArray[i], posBins);\n            if(n >= 0 && n < pLen) {\n                pt = {v: v, i: i};\n                arraysToCalcdata(pt, trace, i);\n                ptsPerBin[n].push(pt);\n            }\n        }\n\n        var minLowerNotch = Infinity;\n        var maxUpperNotch = -Infinity;\n\n        var quartilemethod = trace.quartilemethod;\n        var usesExclusive = quartilemethod === 'exclusive';\n        var usesInclusive = quartilemethod === 'inclusive';\n\n        // build calcdata trace items, one item per distinct position\n        for(i = 0; i < pLen; i++) {\n            if(ptsPerBin[i].length > 0) {\n                cdi = {};\n                cdi.pos = cdi[posLetter] = posDistinct[i];\n\n                pts = cdi.pts = ptsPerBin[i].sort(sortByVal);\n                boxVals = cdi[valLetter] = pts.map(extractVal);\n                N = boxVals.length;\n\n                cdi.min = boxVals[0];\n                cdi.max = boxVals[N - 1];\n                cdi.mean = Lib.mean(boxVals, N);\n                cdi.sd = Lib.stdev(boxVals, N, cdi.mean);\n                cdi.med = Lib.interp(boxVals, 0.5);\n\n                if((N % 2) && (usesExclusive || usesInclusive)) {\n                    var lower;\n                    var upper;\n\n                    if(usesExclusive) {\n                        // do NOT include the median in either half\n                        lower = boxVals.slice(0, N / 2);\n                        upper = boxVals.slice(N / 2 + 1);\n                    } else if(usesInclusive) {\n                        // include the median in either half\n                        lower = boxVals.slice(0, N / 2 + 1);\n                        upper = boxVals.slice(N / 2);\n                    }\n\n                    cdi.q1 = Lib.interp(lower, 0.5);\n                    cdi.q3 = Lib.interp(upper, 0.5);\n                } else {\n                    cdi.q1 = Lib.interp(boxVals, 0.25);\n                    cdi.q3 = Lib.interp(boxVals, 0.75);\n                }\n\n                // lower and upper fences\n                cdi.lf = computeLowerFence(cdi, boxVals, N);\n                cdi.uf = computeUpperFence(cdi, boxVals, N);\n\n                // lower and upper outliers bounds\n                cdi.lo = computeLowerOutlierBound(cdi);\n                cdi.uo = computeUpperOutlierBound(cdi);\n\n                // lower and upper notches\n                var mci = computeNotchSpan(cdi, N);\n                cdi.ln = cdi.med - mci;\n                cdi.un = cdi.med + mci;\n                minLowerNotch = Math.min(minLowerNotch, cdi.ln);\n                maxUpperNotch = Math.max(maxUpperNotch, cdi.un);\n\n                cdi.pts2 = pts.filter(ptFilterFn);\n\n                cd.push(cdi);\n            }\n        }\n\n        trace._extremes[valAxis._id] = Axes.findExtremes(valAxis,\n            trace.notched ? valArray.concat([minLowerNotch, maxUpperNotch]) : valArray,\n            {padded: true}\n        );\n    }\n\n    calcSelection(cd, trace);\n\n    if(cd.length > 0) {\n        cd[0].t = {\n            num: fullLayout[numKey],\n            dPos: dPos,\n            posLetter: posLetter,\n            valLetter: valLetter,\n            labels: {\n                med: _(gd, 'median:'),\n                min: _(gd, 'min:'),\n                q1: _(gd, 'q1:'),\n                q3: _(gd, 'q3:'),\n                max: _(gd, 'max:'),\n                mean: trace.boxmean === 'sd' ? _(gd, 'mean ± σ:') : _(gd, 'mean:'),\n                lf: _(gd, 'lower fence:'),\n                uf: _(gd, 'upper fence:')\n            }\n        };\n\n        fullLayout[numKey]++;\n        return cd;\n    } else {\n        return [{t: {empty: true}}];\n    }\n};\n\n// In vertical (horizontal) box plots:\n// if no x (y) data, use x0 (y0), or name\n// so if you want one box\n// per trace, set x0 (y0) to the x (y) value or category for this trace\n// (or set x (y) to a constant array matching y (x))\nfunction getPos(trace, posLetter, posAxis, num) {\n    var hasPosArray = posLetter in trace;\n    var hasPos0 = posLetter + '0' in trace;\n    var hasPosStep = 'd' + posLetter in trace;\n\n    if(hasPosArray || (hasPos0 && hasPosStep)) {\n        return posAxis.makeCalcdata(trace, posLetter);\n    }\n\n    var pos0;\n    if(hasPos0) {\n        pos0 = trace[posLetter + '0'];\n    } else if('name' in trace && (\n        posAxis.type === 'category' || (\n            isNumeric(trace.name) &&\n            ['linear', 'log'].indexOf(posAxis.type) !== -1\n        ) || (\n            Lib.isDateTime(trace.name) &&\n            posAxis.type === 'date'\n        )\n    )) {\n        pos0 = trace.name;\n    } else {\n        pos0 = num;\n    }\n\n    var pos0c = posAxis.type === 'multicategory' ?\n        posAxis.r2c_just_indices(pos0) :\n        posAxis.d2c(pos0, 0, trace[posLetter + 'calendar']);\n\n    var len = trace._length;\n    var out = new Array(len);\n    for(var i = 0; i < len; i++) out[i] = pos0c;\n\n    return out;\n}\n\nfunction makeBins(x, dx) {\n    var len = x.length;\n    var bins = new Array(len + 1);\n\n    for(var i = 0; i < len; i++) {\n        bins[i] = x[i] - dx;\n    }\n    bins[len] = x[len - 1] + dx;\n\n    return bins;\n}\n\nfunction initNestedArray(len) {\n    var arr = new Array(len);\n    for(var i = 0; i < len; i++) {\n        arr[i] = [];\n    }\n    return arr;\n}\n\nvar TRACE_TO_CALC = {\n    text: 'tx',\n    hovertext: 'htx'\n};\n\nfunction arraysToCalcdata(pt, trace, ptNumber) {\n    for(var k in TRACE_TO_CALC) {\n        if(Lib.isArrayOrTypedArray(trace[k])) {\n            if(Array.isArray(ptNumber)) {\n                if(Lib.isArrayOrTypedArray(trace[k][ptNumber[0]])) {\n                    pt[TRACE_TO_CALC[k]] = trace[k][ptNumber[0]][ptNumber[1]];\n                }\n            } else {\n                pt[TRACE_TO_CALC[k]] = trace[k][ptNumber];\n            }\n        }\n    }\n}\n\nfunction calcSelection(cd, trace) {\n    if(Lib.isArrayOrTypedArray(trace.selectedpoints)) {\n        for(var i = 0; i < cd.length; i++) {\n            var pts = cd[i].pts || [];\n            var ptNumber2cdIndex = {};\n\n            for(var j = 0; j < pts.length; j++) {\n                ptNumber2cdIndex[pts[j].i] = j;\n            }\n\n            Lib.tagSelected(pts, trace, ptNumber2cdIndex);\n        }\n    }\n}\n\nfunction sortByVal(a, b) { return a.v - b.v; }\n\nfunction extractVal(o) { return o.v; }\n\n// last point below 1.5 * IQR\nfunction computeLowerFence(cdi, boxVals, N) {\n    if(N === 0) return cdi.q1;\n    return Math.min(\n        cdi.q1,\n        boxVals[Math.min(\n            Lib.findBin(2.5 * cdi.q1 - 1.5 * cdi.q3, boxVals, true) + 1,\n            N - 1\n        )]\n    );\n}\n\n// last point above 1.5 * IQR\nfunction computeUpperFence(cdi, boxVals, N) {\n    if(N === 0) return cdi.q3;\n    return Math.max(\n        cdi.q3,\n        boxVals[Math.max(\n            Lib.findBin(2.5 * cdi.q3 - 1.5 * cdi.q1, boxVals),\n            0\n        )]\n    );\n}\n\n// 3 IQR below (don't clip to max/min,\n// this is only for discriminating suspected & far outliers)\nfunction computeLowerOutlierBound(cdi) {\n    return 4 * cdi.q1 - 3 * cdi.q3;\n}\n\n// 3 IQR above (don't clip to max/min,\n// this is only for discriminating suspected & far outliers)\nfunction computeUpperOutlierBound(cdi) {\n    return 4 * cdi.q3 - 3 * cdi.q1;\n}\n\n// 95% confidence intervals for median\nfunction computeNotchSpan(cdi, N) {\n    if(N === 0) return 0;\n    return 1.57 * (cdi.q3 - cdi.q1) / Math.sqrt(N);\n}\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"fast-isnumeric\":18}],298:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\nvar getAxisGroup = _dereq_('../../plots/cartesian/axis_ids').getAxisGroup;\n\nvar orientations = ['v', 'h'];\n\nfunction crossTraceCalc(gd, plotinfo) {\n    var calcdata = gd.calcdata;\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    for(var i = 0; i < orientations.length; i++) {\n        var orientation = orientations[i];\n        var posAxis = orientation === 'h' ? ya : xa;\n        var boxList = [];\n\n        // make list of boxes / candlesticks\n        // For backward compatibility, candlesticks are treated as if they *are* box traces here\n        for(var j = 0; j < calcdata.length; j++) {\n            var cd = calcdata[j];\n            var t = cd[0].t;\n            var trace = cd[0].trace;\n\n            if(trace.visible === true &&\n                    (trace.type === 'box' || trace.type === 'candlestick') &&\n                    !t.empty &&\n                    (trace.orientation || 'v') === orientation &&\n                    trace.xaxis === xa._id &&\n                    trace.yaxis === ya._id\n              ) {\n                boxList.push(j);\n            }\n        }\n\n        setPositionOffset('box', gd, boxList, posAxis);\n    }\n}\n\nfunction setPositionOffset(traceType, gd, boxList, posAxis) {\n    var calcdata = gd.calcdata;\n    var fullLayout = gd._fullLayout;\n    var axId = posAxis._id;\n    var axLetter = axId.charAt(0);\n\n    var i, j, calcTrace;\n    var pointList = [];\n    var shownPts = 0;\n\n    // make list of box points\n    for(i = 0; i < boxList.length; i++) {\n        calcTrace = calcdata[boxList[i]];\n        for(j = 0; j < calcTrace.length; j++) {\n            pointList.push(posAxis.c2l(calcTrace[j].pos, true));\n            shownPts += (calcTrace[j].pts2 || []).length;\n        }\n    }\n\n    if(!pointList.length) return;\n\n    // box plots - update dPos based on multiple traces\n    var boxdv = Lib.distinctVals(pointList);\n    var dPos0 = boxdv.minDiff / 2;\n\n    // check for forced minimum dtick\n    Axes.minDtick(posAxis, boxdv.minDiff, boxdv.vals[0], true);\n\n    var numKey = traceType === 'violin' ? '_numViolins' : '_numBoxes';\n    var numTotal = fullLayout[numKey];\n    var group = fullLayout[traceType + 'mode'] === 'group' && numTotal > 1;\n    var groupFraction = 1 - fullLayout[traceType + 'gap'];\n    var groupGapFraction = 1 - fullLayout[traceType + 'groupgap'];\n\n    for(i = 0; i < boxList.length; i++) {\n        calcTrace = calcdata[boxList[i]];\n\n        var trace = calcTrace[0].trace;\n        var t = calcTrace[0].t;\n        var width = trace.width;\n        var side = trace.side;\n\n        // position coordinate delta\n        var dPos;\n        // box half width;\n        var bdPos;\n        // box center offset\n        var bPos;\n        // half-width within which to accept hover for this box/violin\n        // always split the distance to the closest box/violin\n        var wHover;\n\n        if(width) {\n            dPos = bdPos = wHover = width / 2;\n            bPos = 0;\n        } else {\n            dPos = dPos0;\n\n            if(group) {\n                var groupId = getAxisGroup(fullLayout, posAxis._id) + trace.orientation;\n                var alignmentGroups = fullLayout._alignmentOpts[groupId] || {};\n                var alignmentGroupOpts = alignmentGroups[trace.alignmentgroup] || {};\n                var nOffsetGroups = Object.keys(alignmentGroupOpts.offsetGroups || {}).length;\n                var num = nOffsetGroups || numTotal;\n                var shift = nOffsetGroups ? trace._offsetIndex : t.num;\n\n                bdPos = dPos * groupFraction * groupGapFraction / num;\n                bPos = 2 * dPos * (-0.5 + (shift + 0.5) / num) * groupFraction;\n                wHover = dPos * groupFraction / num;\n            } else {\n                bdPos = dPos * groupFraction * groupGapFraction;\n                bPos = 0;\n                wHover = dPos;\n            }\n        }\n        t.dPos = dPos;\n        t.bPos = bPos;\n        t.bdPos = bdPos;\n        t.wHover = wHover;\n\n        // box/violin-only value-space push value\n        var pushplus;\n        var pushminus;\n        // edge of box/violin\n        var edge = bPos + bdPos;\n        var edgeplus;\n        var edgeminus;\n        // value-space padding\n        var vpadplus;\n        var vpadminus;\n        // pixel-space padding\n        var ppadplus;\n        var ppadminus;\n        // do we add 5% of both sides (more logic for points beyond box/violin below)\n        var padded = Boolean(width);\n        // does this trace show points?\n        var hasPts = (trace.boxpoints || trace.points) && (shownPts > 0);\n\n        if(side === 'positive') {\n            pushplus = dPos * (width ? 1 : 0.5);\n            edgeplus = edge;\n            pushminus = edgeplus = bPos;\n        } else if(side === 'negative') {\n            pushplus = edgeplus = bPos;\n            pushminus = dPos * (width ? 1 : 0.5);\n            edgeminus = edge;\n        } else {\n            pushplus = pushminus = dPos;\n            edgeplus = edgeminus = edge;\n        }\n\n        if(hasPts) {\n            var pointpos = trace.pointpos;\n            var jitter = trace.jitter;\n            var ms = trace.marker.size / 2;\n\n            var pp = 0;\n            if((pointpos + jitter) >= 0) {\n                pp = edge * (pointpos + jitter);\n                if(pp > pushplus) {\n                    // (++) beyond plus-value, use pp\n                    padded = true;\n                    ppadplus = ms;\n                    vpadplus = pp;\n                } else if(pp > edgeplus) {\n                    // (+), use push-value (it's bigger), but add px-pad\n                    ppadplus = ms;\n                    vpadplus = pushplus;\n                }\n            }\n            if(pp <= pushplus) {\n                // (->) fallback to push value\n                vpadplus = pushplus;\n            }\n\n            var pm = 0;\n            if((pointpos - jitter) <= 0) {\n                pm = -edge * (pointpos - jitter);\n                if(pm > pushminus) {\n                    // (--) beyond plus-value, use pp\n                    padded = true;\n                    ppadminus = ms;\n                    vpadminus = pm;\n                } else if(pm > edgeminus) {\n                    // (-), use push-value (it's bigger), but add px-pad\n                    ppadminus = ms;\n                    vpadminus = pushminus;\n                }\n            }\n            if(pm <= pushminus) {\n                // (<-) fallback to push value\n                vpadminus = pushminus;\n            }\n        } else {\n            vpadplus = pushplus;\n            vpadminus = pushminus;\n        }\n\n        var pos = new Array(calcTrace.length);\n        for(j = 0; j < calcTrace.length; j++) {\n            pos[j] = calcTrace[j].pos;\n        }\n\n        trace._extremes[axId] = Axes.findExtremes(posAxis, pos, {\n            padded: padded,\n            vpadminus: vpadminus,\n            vpadplus: vpadplus,\n            vpadLinearized: true,\n            // N.B. SVG px-space positive/negative\n            ppadminus: {x: ppadminus, y: ppadplus}[axLetter],\n            ppadplus: {x: ppadplus, y: ppadminus}[axLetter],\n        });\n    }\n}\n\nmodule.exports = {\n    crossTraceCalc: crossTraceCalc,\n    setPositionOffset: setPositionOffset\n};\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../../plots/cartesian/axis_ids\":225}],299:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\nvar Color = _dereq_('../../components/color');\nvar handleGroupingDefaults = _dereq_('../bar/defaults').handleGroupingDefaults;\nvar autoType = _dereq_('../../plots/cartesian/axis_autotype');\nvar attributes = _dereq_('./attributes');\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    handleSampleDefaults(traceIn, traceOut, coerce, layout);\n    if(traceOut.visible === false) return;\n\n    var hasPreCompStats = traceOut._hasPreCompStats;\n\n    if(hasPreCompStats) {\n        coerce('lowerfence');\n        coerce('upperfence');\n    }\n\n    coerce('line.color', (traceIn.marker || {}).color || defaultColor);\n    coerce('line.width');\n    coerce('fillcolor', Color.addOpacity(traceOut.line.color, 0.5));\n\n    var boxmeanDflt = false;\n    if(hasPreCompStats) {\n        var mean = coerce('mean');\n        var sd = coerce('sd');\n        if(mean && mean.length) {\n            boxmeanDflt = true;\n            if(sd && sd.length) boxmeanDflt = 'sd';\n        }\n    }\n    coerce('boxmean', boxmeanDflt);\n\n    coerce('whiskerwidth');\n    coerce('width');\n    coerce('quartilemethod');\n\n    var notchedDflt = false;\n    if(hasPreCompStats) {\n        var notchspan = coerce('notchspan');\n        if(notchspan && notchspan.length) {\n            notchedDflt = true;\n        }\n    } else if(Lib.validate(traceIn.notchwidth, attributes.notchwidth)) {\n        notchedDflt = true;\n    }\n    var notched = coerce('notched', notchedDflt);\n    if(notched) coerce('notchwidth');\n\n    handlePointsDefaults(traceIn, traceOut, coerce, {prefix: 'box'});\n}\n\nfunction handleSampleDefaults(traceIn, traceOut, coerce, layout) {\n    function getDims(arr) {\n        var dims = 0;\n        if(arr && arr.length) {\n            dims += 1;\n            if(Lib.isArrayOrTypedArray(arr[0]) && arr[0].length) {\n                dims += 1;\n            }\n        }\n        return dims;\n    }\n\n    function valid(astr) {\n        return Lib.validate(traceIn[astr], attributes[astr]);\n    }\n\n    var y = coerce('y');\n    var x = coerce('x');\n\n    var sLen;\n    if(traceOut.type === 'box') {\n        var q1 = coerce('q1');\n        var median = coerce('median');\n        var q3 = coerce('q3');\n\n        traceOut._hasPreCompStats = (\n            q1 && q1.length &&\n            median && median.length &&\n            q3 && q3.length\n        );\n        sLen = Math.min(\n            Lib.minRowLength(q1),\n            Lib.minRowLength(median),\n            Lib.minRowLength(q3)\n        );\n    }\n\n    var yDims = getDims(y);\n    var xDims = getDims(x);\n    var yLen = yDims && Lib.minRowLength(y);\n    var xLen = xDims && Lib.minRowLength(x);\n\n    var defaultOrientation, len;\n    if(traceOut._hasPreCompStats) {\n        switch(String(xDims) + String(yDims)) {\n            // no x / no y\n            case '00':\n                var setInX = valid('x0') || valid('dx');\n                var setInY = valid('y0') || valid('dy');\n\n                if(setInY && !setInX) {\n                    defaultOrientation = 'h';\n                } else {\n                    defaultOrientation = 'v';\n                }\n\n                len = sLen;\n                break;\n            // just x\n            case '10':\n                defaultOrientation = 'v';\n                len = Math.min(sLen, xLen);\n                break;\n            case '20':\n                defaultOrientation = 'h';\n                len = Math.min(sLen, x.length);\n                break;\n            // just y\n            case '01':\n                defaultOrientation = 'h';\n                len = Math.min(sLen, yLen);\n                break;\n            case '02':\n                defaultOrientation = 'v';\n                len = Math.min(sLen, y.length);\n                break;\n            // both\n            case '12':\n                defaultOrientation = 'v';\n                len = Math.min(sLen, xLen, y.length);\n                break;\n            case '21':\n                defaultOrientation = 'h';\n                len = Math.min(sLen, x.length, yLen);\n                break;\n            case '11':\n                // this one is ill-defined\n                len = 0;\n                break;\n            case '22':\n                var hasCategories = false;\n                var i;\n                for(i = 0; i < x.length; i++) {\n                    if(autoType(x[i]) === 'category') {\n                        hasCategories = true;\n                        break;\n                    }\n                }\n\n                if(hasCategories) {\n                    defaultOrientation = 'v';\n                    len = Math.min(sLen, xLen, y.length);\n                } else {\n                    for(i = 0; i < y.length; i++) {\n                        if(autoType(y[i]) === 'category') {\n                            hasCategories = true;\n                            break;\n                        }\n                    }\n\n                    if(hasCategories) {\n                        defaultOrientation = 'h';\n                        len = Math.min(sLen, x.length, yLen);\n                    } else {\n                        defaultOrientation = 'v';\n                        len = Math.min(sLen, xLen, y.length);\n                    }\n                }\n                break;\n        }\n    } else if(yDims > 0) {\n        defaultOrientation = 'v';\n        if(xDims > 0) {\n            len = Math.min(xLen, yLen);\n        } else {\n            len = Math.min(yLen);\n        }\n    } else if(xDims > 0) {\n        defaultOrientation = 'h';\n        len = Math.min(xLen);\n    } else {\n        len = 0;\n    }\n\n    if(!len) {\n        traceOut.visible = false;\n        return;\n    }\n    traceOut._length = len;\n\n    var orientation = coerce('orientation', defaultOrientation);\n\n    // these are just used for positioning, they never define the sample\n    if(traceOut._hasPreCompStats) {\n        if(orientation === 'v' && xDims === 0) {\n            coerce('x0', 0);\n            coerce('dx', 1);\n        } else if(orientation === 'h' && yDims === 0) {\n            coerce('y0', 0);\n            coerce('dy', 1);\n        }\n    } else {\n        if(orientation === 'v' && xDims === 0) {\n            coerce('x0');\n        } else if(orientation === 'h' && yDims === 0) {\n            coerce('y0');\n        }\n    }\n\n    var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n    handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n}\n\nfunction handlePointsDefaults(traceIn, traceOut, coerce, opts) {\n    var prefix = opts.prefix;\n\n    var outlierColorDflt = Lib.coerce2(traceIn, traceOut, attributes, 'marker.outliercolor');\n    var lineoutliercolor = coerce('marker.line.outliercolor');\n\n    var modeDflt = 'outliers';\n    if(traceOut._hasPreCompStats) {\n        modeDflt = 'all';\n    } else if(outlierColorDflt || lineoutliercolor) {\n        modeDflt = 'suspectedoutliers';\n    }\n\n    var mode = coerce(prefix + 'points', modeDflt);\n\n    if(mode) {\n        coerce('jitter', mode === 'all' ? 0.3 : 0);\n        coerce('pointpos', mode === 'all' ? -1.5 : 0);\n\n        coerce('marker.symbol');\n        coerce('marker.opacity');\n        coerce('marker.size');\n        coerce('marker.color', traceOut.line.color);\n        coerce('marker.line.color');\n        coerce('marker.line.width');\n\n        if(mode === 'suspectedoutliers') {\n            coerce('marker.line.outliercolor', traceOut.marker.color);\n            coerce('marker.line.outlierwidth');\n        }\n\n        coerce('selected.marker.color');\n        coerce('unselected.marker.color');\n        coerce('selected.marker.size');\n        coerce('unselected.marker.size');\n\n        coerce('text');\n        coerce('hovertext');\n    } else {\n        delete traceOut.marker;\n    }\n\n    var hoveron = coerce('hoveron');\n    if(hoveron === 'all' || hoveron.indexOf('points') !== -1) {\n        coerce('hovertemplate');\n    }\n\n    Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n}\n\nfunction crossTraceDefaults(fullData, fullLayout) {\n    var traceIn, traceOut;\n\n    function coerce(attr) {\n        return Lib.coerce(traceOut._input, traceOut, attributes, attr);\n    }\n\n    for(var i = 0; i < fullData.length; i++) {\n        traceOut = fullData[i];\n        var traceType = traceOut.type;\n\n        if(traceType === 'box' || traceType === 'violin') {\n            traceIn = traceOut._input;\n            if(fullLayout[traceType + 'mode'] === 'group') {\n                handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);\n            }\n        }\n    }\n}\n\nmodule.exports = {\n    supplyDefaults: supplyDefaults,\n    crossTraceDefaults: crossTraceDefaults,\n\n    handleSampleDefaults: handleSampleDefaults,\n    handlePointsDefaults: handlePointsDefaults\n};\n\n},{\"../../components/color\":52,\"../../lib\":178,\"../../plots/cartesian/axis_autotype\":223,\"../../registry\":269,\"../bar/defaults\":283,\"./attributes\":296}],300:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt) {\n    // Note: hoverOnBox property is needed for click-to-select\n    // to ignore when a box was clicked. This is the reason box\n    // implements this custom eventData function.\n    if(pt.hoverOnBox) out.hoverOnBox = pt.hoverOnBox;\n\n    if('xVal' in pt) out.x = pt.xVal;\n    if('yVal' in pt) out.y = pt.yVal;\n    if(pt.xa) out.xaxis = pt.xa;\n    if(pt.ya) out.yaxis = pt.ya;\n\n    return out;\n};\n\n},{}],301:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\nvar Fx = _dereq_('../../components/fx');\nvar Color = _dereq_('../../components/color');\nvar fillText = Lib.fillText;\n\nfunction hoverPoints(pointData, xval, yval, hovermode) {\n    var cd = pointData.cd;\n    var trace = cd[0].trace;\n    var hoveron = trace.hoveron;\n    var closeBoxData = [];\n    var closePtData;\n\n    if(hoveron.indexOf('boxes') !== -1) {\n        closeBoxData = closeBoxData.concat(hoverOnBoxes(pointData, xval, yval, hovermode));\n    }\n\n    if(hoveron.indexOf('points') !== -1) {\n        closePtData = hoverOnPoints(pointData, xval, yval);\n    }\n\n    // If there's a point in range and hoveron has points, show the best single point only.\n    // If hoveron has boxes and there's no point in range (or hoveron doesn't have points), show the box stats.\n    if(hovermode === 'closest') {\n        if(closePtData) return [closePtData];\n        return closeBoxData;\n    }\n\n    // Otherwise in compare mode, allow a point AND the box stats to be labeled\n    // If there are multiple boxes in range (ie boxmode = 'overlay') we'll see stats for all of them.\n    if(closePtData) {\n        closeBoxData.push(closePtData);\n        return closeBoxData;\n    }\n    return closeBoxData;\n}\n\nfunction hoverOnBoxes(pointData, xval, yval, hovermode) {\n    var cd = pointData.cd;\n    var xa = pointData.xa;\n    var ya = pointData.ya;\n    var trace = cd[0].trace;\n    var t = cd[0].t;\n    var isViolin = trace.type === 'violin';\n    var closeBoxData = [];\n\n    var pLetter, vLetter, pAxis, vAxis, vVal, pVal, dx, dy, dPos,\n        hoverPseudoDistance, spikePseudoDistance;\n\n    var boxDelta = t.bdPos;\n    var boxDeltaPos, boxDeltaNeg;\n    var posAcceptance = t.wHover;\n    var shiftPos = function(di) { return pAxis.c2l(di.pos) + t.bPos - pAxis.c2l(pVal); };\n\n    if(isViolin && trace.side !== 'both') {\n        if(trace.side === 'positive') {\n            dPos = function(di) {\n                var pos = shiftPos(di);\n                return Fx.inbox(pos, pos + posAcceptance, hoverPseudoDistance);\n            };\n            boxDeltaPos = boxDelta;\n            boxDeltaNeg = 0;\n        }\n        if(trace.side === 'negative') {\n            dPos = function(di) {\n                var pos = shiftPos(di);\n                return Fx.inbox(pos - posAcceptance, pos, hoverPseudoDistance);\n            };\n            boxDeltaPos = 0;\n            boxDeltaNeg = boxDelta;\n        }\n    } else {\n        dPos = function(di) {\n            var pos = shiftPos(di);\n            return Fx.inbox(pos - posAcceptance, pos + posAcceptance, hoverPseudoDistance);\n        };\n        boxDeltaPos = boxDeltaNeg = boxDelta;\n    }\n\n    var dVal;\n\n    if(isViolin) {\n        dVal = function(di) {\n            return Fx.inbox(di.span[0] - vVal, di.span[1] - vVal, hoverPseudoDistance);\n        };\n    } else {\n        dVal = function(di) {\n            return Fx.inbox(di.min - vVal, di.max - vVal, hoverPseudoDistance);\n        };\n    }\n\n    if(trace.orientation === 'h') {\n        vVal = xval;\n        pVal = yval;\n        dx = dVal;\n        dy = dPos;\n        pLetter = 'y';\n        pAxis = ya;\n        vLetter = 'x';\n        vAxis = xa;\n    } else {\n        vVal = yval;\n        pVal = xval;\n        dx = dPos;\n        dy = dVal;\n        pLetter = 'x';\n        pAxis = xa;\n        vLetter = 'y';\n        vAxis = ya;\n    }\n\n    // if two boxes are overlaying, let the narrowest one win\n    var pseudoDistance = Math.min(1, boxDelta / Math.abs(pAxis.r2c(pAxis.range[1]) - pAxis.r2c(pAxis.range[0])));\n    hoverPseudoDistance = pointData.maxHoverDistance - pseudoDistance;\n    spikePseudoDistance = pointData.maxSpikeDistance - pseudoDistance;\n\n    function dxy(di) { return (dx(di) + dy(di)) / 2; }\n    var distfn = Fx.getDistanceFunction(hovermode, dx, dy, dxy);\n    Fx.getClosest(cd, distfn, pointData);\n\n    // skip the rest (for this trace) if we didn't find a close point\n    // and create the item(s) in closedata for this point\n    if(pointData.index === false) return [];\n\n    var di = cd[pointData.index];\n    var lc = trace.line.color;\n    var mc = (trace.marker || {}).color;\n\n    if(Color.opacity(lc) && trace.line.width) pointData.color = lc;\n    else if(Color.opacity(mc) && trace.boxpoints) pointData.color = mc;\n    else pointData.color = trace.fillcolor;\n\n    pointData[pLetter + '0'] = pAxis.c2p(di.pos + t.bPos - boxDeltaNeg, true);\n    pointData[pLetter + '1'] = pAxis.c2p(di.pos + t.bPos + boxDeltaPos, true);\n\n    pointData[pLetter + 'LabelVal'] = di.pos;\n\n    var spikePosAttr = pLetter + 'Spike';\n    pointData.spikeDistance = dxy(di) * spikePseudoDistance / hoverPseudoDistance;\n    pointData[spikePosAttr] = pAxis.c2p(di.pos, true);\n\n    // box plots: each \"point\" gets many labels\n    var usedVals = {};\n    var attrs = ['med', 'q1', 'q3', 'min', 'max'];\n\n    if(trace.boxmean || (trace.meanline || {}).visible) {\n        attrs.push('mean');\n    }\n    if(trace.boxpoints || trace.points) {\n        attrs.push('lf', 'uf');\n    }\n\n    for(var i = 0; i < attrs.length; i++) {\n        var attr = attrs[i];\n\n        if(!(attr in di) || (di[attr] in usedVals)) continue;\n        usedVals[di[attr]] = true;\n\n        // copy out to a new object for each value to label\n        var val = di[attr];\n        var valPx = vAxis.c2p(val, true);\n        var pointData2 = Lib.extendFlat({}, pointData);\n\n        pointData2.attr = attr;\n        pointData2[vLetter + '0'] = pointData2[vLetter + '1'] = valPx;\n        pointData2[vLetter + 'LabelVal'] = val;\n        pointData2[vLetter + 'Label'] = (t.labels ? t.labels[attr] + ' ' : '') + Axes.hoverLabelText(vAxis, val);\n\n        // Note: introduced to be able to distinguish a\n        // clicked point from a box during click-to-select\n        pointData2.hoverOnBox = true;\n\n        if(attr === 'mean' && ('sd' in di) && trace.boxmean === 'sd') {\n            pointData2[vLetter + 'err'] = di.sd;\n        }\n\n        // only keep name and spikes on the first item (median)\n        pointData.name = '';\n        pointData.spikeDistance = undefined;\n        pointData[spikePosAttr] = undefined;\n\n        // no hovertemplate support yet\n        pointData2.hovertemplate = false;\n\n        closeBoxData.push(pointData2);\n    }\n\n    return closeBoxData;\n}\n\nfunction hoverOnPoints(pointData, xval, yval) {\n    var cd = pointData.cd;\n    var xa = pointData.xa;\n    var ya = pointData.ya;\n    var trace = cd[0].trace;\n    var xPx = xa.c2p(xval);\n    var yPx = ya.c2p(yval);\n    var closePtData;\n\n    var dx = function(di) {\n        var rad = Math.max(3, di.mrc || 0);\n        return Math.max(Math.abs(xa.c2p(di.x) - xPx) - rad, 1 - 3 / rad);\n    };\n    var dy = function(di) {\n        var rad = Math.max(3, di.mrc || 0);\n        return Math.max(Math.abs(ya.c2p(di.y) - yPx) - rad, 1 - 3 / rad);\n    };\n    var distfn = Fx.quadrature(dx, dy);\n\n    // show one point per trace\n    var ijClosest = false;\n    var di, pt;\n\n    for(var i = 0; i < cd.length; i++) {\n        di = cd[i];\n\n        for(var j = 0; j < (di.pts || []).length; j++) {\n            pt = di.pts[j];\n\n            var newDistance = distfn(pt);\n            if(newDistance <= pointData.distance) {\n                pointData.distance = newDistance;\n                ijClosest = [i, j];\n            }\n        }\n    }\n\n    if(!ijClosest) return false;\n\n    di = cd[ijClosest[0]];\n    pt = di.pts[ijClosest[1]];\n\n    var xc = xa.c2p(pt.x, true);\n    var yc = ya.c2p(pt.y, true);\n    var rad = pt.mrc || 1;\n\n    closePtData = Lib.extendFlat({}, pointData, {\n        // corresponds to index in x/y input data array\n        index: pt.i,\n        color: (trace.marker || {}).color,\n        name: trace.name,\n        x0: xc - rad,\n        x1: xc + rad,\n        y0: yc - rad,\n        y1: yc + rad,\n        spikeDistance: pointData.distance,\n        hovertemplate: trace.hovertemplate\n    });\n\n    var pa;\n    if(trace.orientation === 'h') {\n        pa = ya;\n        closePtData.xLabelVal = pt.x;\n        closePtData.yLabelVal = di.pos;\n    } else {\n        pa = xa;\n        closePtData.xLabelVal = di.pos;\n        closePtData.yLabelVal = pt.y;\n    }\n\n    var pLetter = pa._id.charAt(0);\n    closePtData[pLetter + 'Spike'] = pa.c2p(di.pos, true);\n\n    fillText(pt, trace, closePtData);\n\n    return closePtData;\n}\n\nmodule.exports = {\n    hoverPoints: hoverPoints,\n    hoverOnBoxes: hoverOnBoxes,\n    hoverOnPoints: hoverOnPoints\n};\n\n},{\"../../components/color\":52,\"../../components/fx\":92,\"../../lib\":178,\"../../plots/cartesian/axes\":222}],302:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    layoutAttributes: _dereq_('./layout_attributes'),\n    supplyDefaults: _dereq_('./defaults').supplyDefaults,\n    crossTraceDefaults: _dereq_('./defaults').crossTraceDefaults,\n    supplyLayoutDefaults: _dereq_('./layout_defaults').supplyLayoutDefaults,\n    calc: _dereq_('./calc'),\n    crossTraceCalc: _dereq_('./cross_trace_calc').crossTraceCalc,\n    plot: _dereq_('./plot').plot,\n    style: _dereq_('./style').style,\n    styleOnSelect: _dereq_('./style').styleOnSelect,\n    hoverPoints: _dereq_('./hover').hoverPoints,\n    eventData: _dereq_('./event_data'),\n    selectPoints: _dereq_('./select'),\n\n    moduleType: 'trace',\n    name: 'box',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'boxLayout', 'zoomScale'],\n    meta: {\n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"./attributes\":296,\"./calc\":297,\"./cross_trace_calc\":298,\"./defaults\":299,\"./event_data\":300,\"./hover\":301,\"./layout_attributes\":303,\"./layout_defaults\":304,\"./plot\":305,\"./select\":306,\"./style\":307}],303:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n    boxmode: {\n        valType: 'enumerated',\n        values: ['group', 'overlay'],\n        dflt: 'overlay',\n        \n        editType: 'calc',\n        \n    },\n    boxgap: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        dflt: 0.3,\n        \n        editType: 'calc',\n        \n    },\n    boxgroupgap: {\n        valType: 'number',\n        min: 0,\n        max: 1,\n        dflt: 0.3,\n        \n        editType: 'calc',\n        \n    }\n};\n\n},{}],304:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nfunction _supply(layoutIn, layoutOut, fullData, coerce, traceType) {\n    var category = traceType + 'Layout';\n    var hasTraceType = false;\n\n    for(var i = 0; i < fullData.length; i++) {\n        var trace = fullData[i];\n\n        if(Registry.traceIs(trace, category)) {\n            hasTraceType = true;\n            break;\n        }\n    }\n    if(!hasTraceType) return;\n\n    coerce(traceType + 'mode');\n    coerce(traceType + 'gap');\n    coerce(traceType + 'groupgap');\n}\n\nfunction supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n    }\n    _supply(layoutIn, layoutOut, fullData, coerce, 'box');\n}\n\nmodule.exports = {\n    supplyLayoutDefaults: supplyLayoutDefaults,\n    _supply: _supply\n};\n\n},{\"../../lib\":178,\"../../registry\":269,\"./layout_attributes\":303}],305:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\n\n// constants for dynamic jitter (ie less jitter for sparser points)\nvar JITTERCOUNT = 5; // points either side of this to include\nvar JITTERSPREAD = 0.01; // fraction of IQR to count as \"dense\"\n\nfunction plot(gd, plotinfo, cdbox, boxLayer) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    Lib.makeTraceGroups(boxLayer, cdbox, 'trace boxes').each(function(cd) {\n        var plotGroup = d3.select(this);\n        var cd0 = cd[0];\n        var t = cd0.t;\n        var trace = cd0.trace;\n\n        // whisker width\n        t.wdPos = t.bdPos * trace.whiskerwidth;\n\n        if(trace.visible !== true || t.empty) {\n            plotGroup.remove();\n            return;\n        }\n\n        var posAxis, valAxis;\n\n        if(trace.orientation === 'h') {\n            posAxis = ya;\n            valAxis = xa;\n        } else {\n            posAxis = xa;\n            valAxis = ya;\n        }\n\n        plotBoxAndWhiskers(plotGroup, {pos: posAxis, val: valAxis}, trace, t);\n        plotPoints(plotGroup, {x: xa, y: ya}, trace, t);\n        plotBoxMean(plotGroup, {pos: posAxis, val: valAxis}, trace, t);\n    });\n}\n\nfunction plotBoxAndWhiskers(sel, axes, trace, t) {\n    var isHorizontal = trace.orientation === 'h';\n    var valAxis = axes.val;\n    var posAxis = axes.pos;\n    var posHasRangeBreaks = !!posAxis.rangebreaks;\n\n    var bPos = t.bPos;\n    var wdPos = t.wdPos || 0;\n    var bPosPxOffset = t.bPosPxOffset || 0;\n    var whiskerWidth = trace.whiskerwidth || 0;\n    var notched = trace.notched || false;\n    var nw = notched ? 1 - 2 * trace.notchwidth : 1;\n\n    // to support for one-sided box\n    var bdPos0;\n    var bdPos1;\n    if(Array.isArray(t.bdPos)) {\n        bdPos0 = t.bdPos[0];\n        bdPos1 = t.bdPos[1];\n    } else {\n        bdPos0 = t.bdPos;\n        bdPos1 = t.bdPos;\n    }\n\n    var paths = sel.selectAll('path.box').data((\n        trace.type !== 'violin' ||\n        trace.box.visible\n    ) ? Lib.identity : []);\n\n    paths.enter().append('path')\n        .style('vector-effect', 'non-scaling-stroke')\n        .attr('class', 'box');\n\n    paths.exit().remove();\n\n    paths.each(function(d) {\n        if(d.empty) return 'M0,0Z';\n\n        var lcenter = posAxis.c2l(d.pos + bPos, true);\n\n        var pos0 = posAxis.l2p(lcenter - bdPos0) + bPosPxOffset;\n        var pos1 = posAxis.l2p(lcenter + bdPos1) + bPosPxOffset;\n        var posc = posHasRangeBreaks ? (pos0 + pos1) / 2 : posAxis.l2p(lcenter) + bPosPxOffset;\n\n        var r = trace.whiskerwidth;\n        var posw0 = posHasRangeBreaks ? pos0 * r + (1 - r) * posc : posAxis.l2p(lcenter - wdPos) + bPosPxOffset;\n        var posw1 = posHasRangeBreaks ? pos1 * r + (1 - r) * posc : posAxis.l2p(lcenter + wdPos) + bPosPxOffset;\n\n        var posm0 = posAxis.l2p(lcenter - bdPos0 * nw) + bPosPxOffset;\n        var posm1 = posAxis.l2p(lcenter + bdPos1 * nw) + bPosPxOffset;\n        var q1 = valAxis.c2p(d.q1, true);\n        var q3 = valAxis.c2p(d.q3, true);\n        // make sure median isn't identical to either of the\n        // quartiles, so we can see it\n        var m = Lib.constrain(\n            valAxis.c2p(d.med, true),\n            Math.min(q1, q3) + 1, Math.max(q1, q3) - 1\n        );\n\n        // for compatibility with box, violin, and candlestick\n        // perhaps we should put this into cd0.t instead so it's more explicit,\n        // but what we have now is:\n        // - box always has d.lf, but boxpoints can be anything\n        // - violin has d.lf and should always use it (boxpoints is undefined)\n        // - candlestick has only min/max\n        var useExtremes = (d.lf === undefined) || (trace.boxpoints === false);\n        var lf = valAxis.c2p(useExtremes ? d.min : d.lf, true);\n        var uf = valAxis.c2p(useExtremes ? d.max : d.uf, true);\n        var ln = valAxis.c2p(d.ln, true);\n        var un = valAxis.c2p(d.un, true);\n\n        if(isHorizontal) {\n            d3.select(this).attr('d',\n                'M' + m + ',' + posm0 + 'V' + posm1 + // median line\n                'M' + q1 + ',' + pos0 + 'V' + pos1 + // left edge\n                (notched ?\n                    'H' + ln + 'L' + m + ',' + posm1 + 'L' + un + ',' + pos1 :\n                    ''\n                ) + // top notched edge\n                'H' + q3 + // end of the top edge\n                'V' + pos0 + // right edge\n                (notched ? 'H' + un + 'L' + m + ',' + posm0 + 'L' + ln + ',' + pos0 : '') + // bottom notched edge\n                'Z' + // end of the box\n                'M' + q1 + ',' + posc + 'H' + lf + 'M' + q3 + ',' + posc + 'H' + uf + // whiskers\n                (whiskerWidth === 0 ?\n                    '' : // whisker caps\n                    'M' + lf + ',' + posw0 + 'V' + posw1 + 'M' + uf + ',' + posw0 + 'V' + posw1\n                )\n            );\n        } else {\n            d3.select(this).attr('d',\n                'M' + posm0 + ',' + m + 'H' + posm1 + // median line\n                'M' + pos0 + ',' + q1 + 'H' + pos1 + // top of the box\n                (notched ?\n                    'V' + ln + 'L' + posm1 + ',' + m + 'L' + pos1 + ',' + un :\n                    ''\n                ) + // notched right edge\n                'V' + q3 + // end of the right edge\n                'H' + pos0 + // bottom of the box\n                (notched ?\n                    'V' + un + 'L' + posm0 + ',' + m + 'L' + pos0 + ',' + ln :\n                    ''\n                ) + // notched left edge\n                'Z' + // end of the box\n                'M' + posc + ',' + q1 + 'V' + lf + 'M' + posc + ',' + q3 + 'V' + uf + // whiskers\n                (whiskerWidth === 0 ?\n                    '' : // whisker caps\n                    'M' + posw0 + ',' + lf + 'H' + posw1 + 'M' + posw0 + ',' + uf + 'H' + posw1\n                )\n            );\n        }\n    });\n}\n\nfunction plotPoints(sel, axes, trace, t) {\n    var xa = axes.x;\n    var ya = axes.y;\n    var bdPos = t.bdPos;\n    var bPos = t.bPos;\n\n    // to support violin points\n    var mode = trace.boxpoints || trace.points;\n\n    // repeatable pseudo-random number generator\n    Lib.seedPseudoRandom();\n\n    // since box plot points get an extra level of nesting, each\n    // box needs the trace styling info\n    var fn = function(d) {\n        d.forEach(function(v) {\n            v.t = t;\n            v.trace = trace;\n        });\n        return d;\n    };\n\n    var gPoints = sel.selectAll('g.points')\n        .data(mode ? fn : []);\n\n    gPoints.enter().append('g')\n        .attr('class', 'points');\n\n    gPoints.exit().remove();\n\n    var paths = gPoints.selectAll('path')\n        .data(function(d) {\n            var i;\n            var pts = d.pts2;\n\n            // normally use IQR, but if this is 0 or too small, use max-min\n            var typicalSpread = Math.max((d.max - d.min) / 10, d.q3 - d.q1);\n            var minSpread = typicalSpread * 1e-9;\n            var spreadLimit = typicalSpread * JITTERSPREAD;\n            var jitterFactors = [];\n            var maxJitterFactor = 0;\n            var newJitter;\n\n            // dynamic jitter\n            if(trace.jitter) {\n                if(typicalSpread === 0) {\n                    // edge case of no spread at all: fall back to max jitter\n                    maxJitterFactor = 1;\n                    jitterFactors = new Array(pts.length);\n                    for(i = 0; i < pts.length; i++) {\n                        jitterFactors[i] = 1;\n                    }\n                } else {\n                    for(i = 0; i < pts.length; i++) {\n                        var i0 = Math.max(0, i - JITTERCOUNT);\n                        var pmin = pts[i0].v;\n                        var i1 = Math.min(pts.length - 1, i + JITTERCOUNT);\n                        var pmax = pts[i1].v;\n\n                        if(mode !== 'all') {\n                            if(pts[i].v < d.lf) pmax = Math.min(pmax, d.lf);\n                            else pmin = Math.max(pmin, d.uf);\n                        }\n\n                        var jitterFactor = Math.sqrt(spreadLimit * (i1 - i0) / (pmax - pmin + minSpread)) || 0;\n                        jitterFactor = Lib.constrain(Math.abs(jitterFactor), 0, 1);\n\n                        jitterFactors.push(jitterFactor);\n                        maxJitterFactor = Math.max(jitterFactor, maxJitterFactor);\n                    }\n                }\n                newJitter = trace.jitter * 2 / (maxJitterFactor || 1);\n            }\n\n            // fills in 'x' and 'y' in calcdata 'pts' item\n            for(i = 0; i < pts.length; i++) {\n                var pt = pts[i];\n                var v = pt.v;\n\n                var jitterOffset = trace.jitter ?\n                    (newJitter * jitterFactors[i] * (Lib.pseudoRandom() - 0.5)) :\n                    0;\n\n                var posPx = d.pos + bPos + bdPos * (trace.pointpos + jitterOffset);\n\n                if(trace.orientation === 'h') {\n                    pt.y = posPx;\n                    pt.x = v;\n                } else {\n                    pt.x = posPx;\n                    pt.y = v;\n                }\n\n                // tag suspected outliers\n                if(mode === 'suspectedoutliers' && v < d.uo && v > d.lo) {\n                    pt.so = true;\n                }\n            }\n\n            return pts;\n        });\n\n    paths.enter().append('path')\n        .classed('point', true);\n\n    paths.exit().remove();\n\n    paths.call(Drawing.translatePoints, xa, ya);\n}\n\nfunction plotBoxMean(sel, axes, trace, t) {\n    var valAxis = axes.val;\n    var posAxis = axes.pos;\n    var posHasRangeBreaks = !!posAxis.rangebreaks;\n\n    var bPos = t.bPos;\n    var bPosPxOffset = t.bPosPxOffset || 0;\n\n    // to support violin mean lines\n    var mode = trace.boxmean || (trace.meanline || {}).visible;\n\n    // to support for one-sided box\n    var bdPos0;\n    var bdPos1;\n    if(Array.isArray(t.bdPos)) {\n        bdPos0 = t.bdPos[0];\n        bdPos1 = t.bdPos[1];\n    } else {\n        bdPos0 = t.bdPos;\n        bdPos1 = t.bdPos;\n    }\n\n    var paths = sel.selectAll('path.mean').data((\n        (trace.type === 'box' && trace.boxmean) ||\n        (trace.type === 'violin' && trace.box.visible && trace.meanline.visible)\n    ) ? Lib.identity : []);\n\n    paths.enter().append('path')\n        .attr('class', 'mean')\n        .style({\n            fill: 'none',\n            'vector-effect': 'non-scaling-stroke'\n        });\n\n    paths.exit().remove();\n\n    paths.each(function(d) {\n        var lcenter = posAxis.c2l(d.pos + bPos, true);\n\n        var pos0 = posAxis.l2p(lcenter - bdPos0) + bPosPxOffset;\n        var pos1 = posAxis.l2p(lcenter + bdPos1) + bPosPxOffset;\n        var posc = posHasRangeBreaks ? (pos0 + pos1) / 2 : posAxis.l2p(lcenter) + bPosPxOffset;\n\n        var m = valAxis.c2p(d.mean, true);\n        var sl = valAxis.c2p(d.mean - d.sd, true);\n        var sh = valAxis.c2p(d.mean + d.sd, true);\n\n        if(trace.orientation === 'h') {\n            d3.select(this).attr('d',\n                'M' + m + ',' + pos0 + 'V' + pos1 +\n                (mode === 'sd' ?\n                    'm0,0L' + sl + ',' + posc + 'L' + m + ',' + pos0 + 'L' + sh + ',' + posc + 'Z' :\n                    '')\n            );\n        } else {\n            d3.select(this).attr('d',\n                'M' + pos0 + ',' + m + 'H' + pos1 +\n                (mode === 'sd' ?\n                    'm0,0L' + posc + ',' + sl + 'L' + pos0 + ',' + m + 'L' + posc + ',' + sh + 'Z' :\n                    '')\n            );\n        }\n    });\n}\n\nmodule.exports = {\n    plot: plot,\n    plotBoxAndWhiskers: plotBoxAndWhiskers,\n    plotPoints: plotPoints,\n    plotBoxMean: plotBoxMean\n};\n\n},{\"../../components/drawing\":74,\"../../lib\":178,\"d3\":16}],306:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function selectPoints(searchInfo, selectionTester) {\n    var cd = searchInfo.cd;\n    var xa = searchInfo.xaxis;\n    var ya = searchInfo.yaxis;\n    var selection = [];\n    var i, j;\n\n    if(selectionTester === false) {\n        for(i = 0; i < cd.length; i++) {\n            for(j = 0; j < (cd[i].pts || []).length; j++) {\n                // clear selection\n                cd[i].pts[j].selected = 0;\n            }\n        }\n    } else {\n        for(i = 0; i < cd.length; i++) {\n            for(j = 0; j < (cd[i].pts || []).length; j++) {\n                var pt = cd[i].pts[j];\n                var x = xa.c2p(pt.x);\n                var y = ya.c2p(pt.y);\n\n                if(selectionTester.contains([x, y], null, pt.i, searchInfo)) {\n                    selection.push({\n                        pointNumber: pt.i,\n                        x: xa.c2d(pt.x),\n                        y: ya.c2d(pt.y)\n                    });\n                    pt.selected = 1;\n                } else {\n                    pt.selected = 0;\n                }\n            }\n        }\n    }\n\n    return selection;\n};\n\n},{}],307:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\n\nfunction style(gd, cd, sel) {\n    var s = sel ? sel : d3.select(gd).selectAll('g.trace.boxes');\n\n    s.style('opacity', function(d) { return d[0].trace.opacity; });\n\n    s.each(function(d) {\n        var el = d3.select(this);\n        var trace = d[0].trace;\n        var lineWidth = trace.line.width;\n\n        function styleBox(boxSel, lineWidth, lineColor, fillColor) {\n            boxSel.style('stroke-width', lineWidth + 'px')\n                .call(Color.stroke, lineColor)\n                .call(Color.fill, fillColor);\n        }\n\n        var allBoxes = el.selectAll('path.box');\n\n        if(trace.type === 'candlestick') {\n            allBoxes.each(function(boxData) {\n                if(boxData.empty) return;\n\n                var thisBox = d3.select(this);\n                var container = trace[boxData.dir]; // dir = 'increasing' or 'decreasing'\n                styleBox(thisBox, container.line.width, container.line.color, container.fillcolor);\n                // TODO: custom selection style for candlesticks\n                thisBox.style('opacity', trace.selectedpoints && !boxData.selected ? 0.3 : 1);\n            });\n        } else {\n            styleBox(allBoxes, lineWidth, trace.line.color, trace.fillcolor);\n            el.selectAll('path.mean')\n                .style({\n                    'stroke-width': lineWidth,\n                    'stroke-dasharray': (2 * lineWidth) + 'px,' + lineWidth + 'px'\n                })\n                .call(Color.stroke, trace.line.color);\n\n            var pts = el.selectAll('path.point');\n            Drawing.pointStyle(pts, trace, gd);\n        }\n    });\n}\n\nfunction styleOnSelect(gd, cd, sel) {\n    var trace = cd[0].trace;\n    var pts = sel.selectAll('path.point');\n\n    if(trace.selectedpoints) {\n        Drawing.selectedPointStyle(pts, trace);\n    } else {\n        Drawing.pointStyle(pts, trace, gd);\n    }\n}\n\nmodule.exports = {\n    style: style,\n    styleOnSelect: styleOnSelect\n};\n\n},{\"../../components/color\":52,\"../../components/drawing\":74,\"d3\":16}],308:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar heatmapAttrs = _dereq_('../heatmap/attributes');\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar filterOps = _dereq_('../../constants/filter_ops');\nvar COMPARISON_OPS2 = filterOps.COMPARISON_OPS2;\nvar INTERVAL_OPS = filterOps.INTERVAL_OPS;\n\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\n\nvar scatterLineAttrs = scatterAttrs.line;\n\nmodule.exports = extendFlat({\n    z: heatmapAttrs.z,\n    x: heatmapAttrs.x,\n    x0: heatmapAttrs.x0,\n    dx: heatmapAttrs.dx,\n    y: heatmapAttrs.y,\n    y0: heatmapAttrs.y0,\n    dy: heatmapAttrs.dy,\n    text: heatmapAttrs.text,\n    hovertext: heatmapAttrs.hovertext,\n    transpose: heatmapAttrs.transpose,\n    xtype: heatmapAttrs.xtype,\n    ytype: heatmapAttrs.ytype,\n    zhoverformat: heatmapAttrs.zhoverformat,\n    hovertemplate: heatmapAttrs.hovertemplate,\n    hoverongaps: heatmapAttrs.hoverongaps,\n    connectgaps: extendFlat({}, heatmapAttrs.connectgaps, {\n        \n    }),\n\n    fillcolor: {\n        valType: 'color',\n        \n        editType: 'calc',\n        \n    },\n\n    autocontour: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'calc',\n        impliedEdits: {\n            'contours.start': undefined,\n            'contours.end': undefined,\n            'contours.size': undefined\n        },\n        \n    },\n    ncontours: {\n        valType: 'integer',\n        dflt: 15,\n        min: 1,\n        \n        editType: 'calc',\n        \n    },\n\n    contours: {\n        type: {\n            valType: 'enumerated',\n            values: ['levels', 'constraint'],\n            dflt: 'levels',\n            \n            editType: 'calc',\n            \n        },\n        start: {\n            valType: 'number',\n            dflt: null,\n            \n            editType: 'plot',\n            impliedEdits: {'^autocontour': false},\n            \n        },\n        end: {\n            valType: 'number',\n            dflt: null,\n            \n            editType: 'plot',\n            impliedEdits: {'^autocontour': false},\n            \n        },\n        size: {\n            valType: 'number',\n            dflt: null,\n            min: 0,\n            \n            editType: 'plot',\n            impliedEdits: {'^autocontour': false},\n            \n        },\n        coloring: {\n            valType: 'enumerated',\n            values: ['fill', 'heatmap', 'lines', 'none'],\n            dflt: 'fill',\n            \n            editType: 'calc',\n            \n        },\n        showlines: {\n            valType: 'boolean',\n            dflt: true,\n            \n            editType: 'plot',\n            \n        },\n        showlabels: {\n            valType: 'boolean',\n            dflt: false,\n            \n            editType: 'plot',\n            \n        },\n        labelfont: fontAttrs({\n            editType: 'plot',\n            colorEditType: 'style',\n            \n        }),\n        labelformat: {\n            valType: 'string',\n            dflt: '',\n            \n            editType: 'plot',\n            \n        },\n        operation: {\n            valType: 'enumerated',\n            values: [].concat(COMPARISON_OPS2).concat(INTERVAL_OPS),\n            \n            dflt: '=',\n            editType: 'calc',\n            \n        },\n        value: {\n            valType: 'any',\n            dflt: 0,\n            \n            editType: 'calc',\n            \n        },\n        editType: 'calc',\n        impliedEdits: {'autocontour': false}\n    },\n\n    line: {\n        color: extendFlat({}, scatterLineAttrs.color, {\n            editType: 'style+colorbars',\n            \n        }),\n        width: {\n            valType: 'number',\n            min: 0,\n            \n            editType: 'style+colorbars',\n            \n        },\n        dash: dash,\n        smoothing: extendFlat({}, scatterLineAttrs.smoothing, {\n            \n        }),\n        editType: 'plot'\n    }\n},\n    colorScaleAttrs('', {\n        cLetter: 'z',\n        autoColorDflt: false,\n        editTypeOverride: 'calc'\n    })\n);\n\n},{\"../../components/colorscale/attributes\":59,\"../../components/drawing/attributes\":73,\"../../constants/docs\":155,\"../../constants/filter_ops\":156,\"../../lib/extend\":173,\"../../plots/font_attributes\":250,\"../heatmap/attributes\":330,\"../scatter/attributes\":389}],309:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Colorscale = _dereq_('../../components/colorscale');\n\nvar heatmapCalc = _dereq_('../heatmap/calc');\nvar setContours = _dereq_('./set_contours');\nvar endPlus = _dereq_('./end_plus');\n\n// most is the same as heatmap calc, then adjust it\n// though a few things inside heatmap calc still look for\n// contour maps, because the makeBoundArray calls are too entangled\nmodule.exports = function calc(gd, trace) {\n    var cd = heatmapCalc(gd, trace);\n\n    var zOut = cd[0].z;\n    setContours(trace, zOut);\n\n    var contours = trace.contours;\n    var cOpts = Colorscale.extractOpts(trace);\n    var cVals;\n\n    if(contours.coloring === 'heatmap' && cOpts.auto && trace.autocontour === false) {\n        var start = contours.start;\n        var end = endPlus(contours);\n        var cs = contours.size || 1;\n        var nc = Math.floor((end - start) / cs) + 1;\n\n        if(!isFinite(cs)) {\n            cs = 1;\n            nc = 1;\n        }\n\n        var min0 = start - cs / 2;\n        var max0 = min0 + nc * cs;\n        cVals = [min0, max0];\n    } else {\n        cVals = zOut;\n    }\n\n    Colorscale.calc(gd, trace, {vals: cVals, cLetter: 'z'});\n\n    return cd;\n};\n\n},{\"../../components/colorscale\":64,\"../heatmap/calc\":331,\"./end_plus\":319,\"./set_contours\":327}],310:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function(pathinfo, contours) {\n    var pi0 = pathinfo[0];\n    var z = pi0.z;\n    var i;\n\n    switch(contours.type) {\n        case 'levels':\n            // Why (just) use z[0][0] and z[0][1]?\n            //\n            // N.B. using boundaryMin instead of edgeVal2 here makes the\n            //      `contour_scatter` mock fail\n            var edgeVal2 = Math.min(z[0][0], z[0][1]);\n\n            for(i = 0; i < pathinfo.length; i++) {\n                var pi = pathinfo[i];\n                pi.prefixBoundary = !pi.edgepaths.length &&\n                    (edgeVal2 > pi.level || pi.starts.length && edgeVal2 === pi.level);\n            }\n            break;\n        case 'constraint':\n            // after convertToConstraints, pathinfo has length=0\n            pi0.prefixBoundary = false;\n\n            // joinAllPaths does enough already when edgepaths are present\n            if(pi0.edgepaths.length) return;\n\n            var na = pi0.x.length;\n            var nb = pi0.y.length;\n            var boundaryMax = -Infinity;\n            var boundaryMin = Infinity;\n\n            for(i = 0; i < nb; i++) {\n                boundaryMin = Math.min(boundaryMin, z[i][0]);\n                boundaryMin = Math.min(boundaryMin, z[i][na - 1]);\n                boundaryMax = Math.max(boundaryMax, z[i][0]);\n                boundaryMax = Math.max(boundaryMax, z[i][na - 1]);\n            }\n            for(i = 1; i < na - 1; i++) {\n                boundaryMin = Math.min(boundaryMin, z[0][i]);\n                boundaryMin = Math.min(boundaryMin, z[nb - 1][i]);\n                boundaryMax = Math.max(boundaryMax, z[0][i]);\n                boundaryMax = Math.max(boundaryMax, z[nb - 1][i]);\n            }\n\n            var contoursValue = contours.value;\n            var v1, v2;\n\n            switch(contours._operation) {\n                case '>':\n                    if(contoursValue > boundaryMax) {\n                        pi0.prefixBoundary = true;\n                    }\n                    break;\n                case '<':\n                    if(contoursValue < boundaryMin ||\n                        (pi0.starts.length && contoursValue === boundaryMin)) {\n                        pi0.prefixBoundary = true;\n                    }\n                    break;\n                case '[]':\n                    v1 = Math.min(contoursValue[0], contoursValue[1]);\n                    v2 = Math.max(contoursValue[0], contoursValue[1]);\n                    if(v2 < boundaryMin || v1 > boundaryMax ||\n                        (pi0.starts.length && v2 === boundaryMin)) {\n                        pi0.prefixBoundary = true;\n                    }\n                    break;\n                case '][':\n                    v1 = Math.min(contoursValue[0], contoursValue[1]);\n                    v2 = Math.max(contoursValue[0], contoursValue[1]);\n                    if(v1 < boundaryMin && v2 > boundaryMax) {\n                        pi0.prefixBoundary = true;\n                    }\n                    break;\n            }\n            break;\n    }\n};\n\n},{}],311:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Colorscale = _dereq_('../../components/colorscale');\nvar makeColorMap = _dereq_('./make_color_map');\nvar endPlus = _dereq_('./end_plus');\n\nfunction calc(gd, trace, opts) {\n    var contours = trace.contours;\n    var line = trace.line;\n    var cs = contours.size || 1;\n    var coloring = contours.coloring;\n    var colorMap = makeColorMap(trace, {isColorbar: true});\n\n    if(coloring === 'heatmap') {\n        var cOpts = Colorscale.extractOpts(trace);\n        opts._fillgradient = cOpts.reversescale ?\n            Colorscale.flipScale(cOpts.colorscale) :\n            cOpts.colorscale;\n        opts._zrange = [cOpts.min, cOpts.max];\n    } else if(coloring === 'fill') {\n        opts._fillcolor = colorMap;\n    }\n\n    opts._line = {\n        color: coloring === 'lines' ? colorMap : line.color,\n        width: contours.showlines !== false ? line.width : 0,\n        dash: line.dash\n    };\n\n    opts._levels = {\n        start: contours.start,\n        end: endPlus(contours),\n        size: cs\n    };\n}\n\nmodule.exports = {\n    min: 'zmin',\n    max: 'zmax',\n    calc: calc\n};\n\n},{\"../../components/colorscale\":64,\"./end_plus\":319,\"./make_color_map\":324}],312:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\nmodule.exports = {\n    // some constants to help with marching squares algorithm\n    // where does the path start for each index?\n    BOTTOMSTART: [1, 9, 13, 104, 713],\n    TOPSTART: [4, 6, 7, 104, 713],\n    LEFTSTART: [8, 12, 14, 208, 1114],\n    RIGHTSTART: [2, 3, 11, 208, 1114],\n\n    // which way [dx,dy] do we leave a given index?\n    // saddles are already disambiguated\n    NEWDELTA: [\n        null, [-1, 0], [0, -1], [-1, 0],\n        [1, 0], null, [0, -1], [-1, 0],\n        [0, 1], [0, 1], null, [0, 1],\n        [1, 0], [1, 0], [0, -1]\n    ],\n\n    // for each saddle, the first index here is used\n    // for dx||dy<0, the second for dx||dy>0\n    CHOOSESADDLE: {\n        104: [4, 1],\n        208: [2, 8],\n        713: [7, 13],\n        1114: [11, 14]\n    },\n\n    // after one index has been used for a saddle, which do we\n    // substitute to be used up later?\n    SADDLEREMAINDER: {1: 4, 2: 8, 4: 1, 7: 13, 8: 2, 11: 14, 13: 7, 14: 11},\n\n    // length of a contour, as a multiple of the plot area diagonal, per label\n    LABELDISTANCE: 2,\n\n    // number of contour levels after which we start increasing the number of\n    // labels we draw. Many contours means they will generally be close\n    // together, so it will be harder to follow a long way to find a label\n    LABELINCREASE: 10,\n\n    // minimum length of a contour line, as a multiple of the label length,\n    // at which we draw *any* labels\n    LABELMIN: 3,\n\n    // max number of labels to draw on a single contour path, no matter how long\n    LABELMAX: 10,\n\n    // constants for the label position cost function\n    LABELOPTIMIZER: {\n        // weight given to edge proximity\n        EDGECOST: 1,\n        // weight given to the angle off horizontal\n        ANGLECOST: 1,\n        // weight given to distance from already-placed labels\n        NEIGHBORCOST: 5,\n        // cost multiplier for labels on the same level\n        SAMELEVELFACTOR: 10,\n        // minimum distance (as a multiple of the label length)\n        // for labels on the same level\n        SAMELEVELDISTANCE: 5,\n        // maximum cost before we won't even place the label\n        MAXCOST: 100,\n        // number of evenly spaced points to look at in the first\n        // iteration of the search\n        INITIALSEARCHPOINTS: 10,\n        // number of binary search iterations after the initial wide search\n        ITERATIONS: 5\n    }\n};\n\n},{}],313:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar handleLabelDefaults = _dereq_('./label_defaults');\n\nvar Color = _dereq_('../../components/color');\nvar addOpacity = Color.addOpacity;\nvar opacity = Color.opacity;\n\nvar filterOps = _dereq_('../../constants/filter_ops');\nvar CONSTRAINT_REDUCTION = filterOps.CONSTRAINT_REDUCTION;\nvar COMPARISON_OPS2 = filterOps.COMPARISON_OPS2;\n\nmodule.exports = function handleConstraintDefaults(traceIn, traceOut, coerce, layout, defaultColor, opts) {\n    var contours = traceOut.contours;\n    var showLines, lineColor, fillColor;\n\n    var operation = coerce('contours.operation');\n    contours._operation = CONSTRAINT_REDUCTION[operation];\n\n    handleConstraintValueDefaults(coerce, contours);\n\n    if(operation === '=') {\n        showLines = contours.showlines = true;\n    } else {\n        showLines = coerce('contours.showlines');\n        fillColor = coerce('fillcolor', addOpacity(\n            (traceIn.line || {}).color || defaultColor, 0.5\n        ));\n    }\n\n    if(showLines) {\n        var lineDfltColor = fillColor && opacity(fillColor) ?\n            addOpacity(traceOut.fillcolor, 1) :\n            defaultColor;\n        lineColor = coerce('line.color', lineDfltColor);\n        coerce('line.width', 2);\n        coerce('line.dash');\n    }\n\n    coerce('line.smoothing');\n\n    handleLabelDefaults(coerce, layout, lineColor, opts);\n};\n\nfunction handleConstraintValueDefaults(coerce, contours) {\n    var zvalue;\n\n    if(COMPARISON_OPS2.indexOf(contours.operation) === -1) {\n        // Requires an array of two numbers:\n        coerce('contours.value', [0, 1]);\n\n        if(!Array.isArray(contours.value)) {\n            if(isNumeric(contours.value)) {\n                zvalue = parseFloat(contours.value);\n                contours.value = [zvalue, zvalue + 1];\n            }\n        } else if(contours.value.length > 2) {\n            contours.value = contours.value.slice(2);\n        } else if(contours.length === 0) {\n            contours.value = [0, 1];\n        } else if(contours.length < 2) {\n            zvalue = parseFloat(contours.value[0]);\n            contours.value = [zvalue, zvalue + 1];\n        } else {\n            contours.value = [\n                parseFloat(contours.value[0]),\n                parseFloat(contours.value[1])\n            ];\n        }\n    } else {\n        // Requires a single scalar:\n        coerce('contours.value', 0);\n\n        if(!isNumeric(contours.value)) {\n            if(Array.isArray(contours.value)) {\n                contours.value = parseFloat(contours.value[0]);\n            } else {\n                contours.value = 0;\n            }\n        }\n    }\n}\n\n},{\"../../components/color\":52,\"../../constants/filter_ops\":156,\"./label_defaults\":323,\"fast-isnumeric\":18}],314:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar filterOps = _dereq_('../../constants/filter_ops');\nvar isNumeric = _dereq_('fast-isnumeric');\n\n// This syntax conforms to the existing filter transform syntax, but we don't care\n// about open vs. closed intervals for simply drawing contours constraints:\nmodule.exports = {\n    '[]': makeRangeSettings('[]'),\n    '][': makeRangeSettings(']['),\n    '>': makeInequalitySettings('>'),\n    '<': makeInequalitySettings('<'),\n    '=': makeInequalitySettings('=')\n};\n\n// This does not in any way shape or form support calendars. It's adapted from\n// transforms/filter.js.\nfunction coerceValue(operation, value) {\n    var hasArrayValue = Array.isArray(value);\n\n    var coercedValue;\n\n    function coerce(value) {\n        return isNumeric(value) ? (+value) : null;\n    }\n\n    if(filterOps.COMPARISON_OPS2.indexOf(operation) !== -1) {\n        coercedValue = hasArrayValue ? coerce(value[0]) : coerce(value);\n    } else if(filterOps.INTERVAL_OPS.indexOf(operation) !== -1) {\n        coercedValue = hasArrayValue ?\n            [coerce(value[0]), coerce(value[1])] :\n            [coerce(value), coerce(value)];\n    } else if(filterOps.SET_OPS.indexOf(operation) !== -1) {\n        coercedValue = hasArrayValue ? value.map(coerce) : [coerce(value)];\n    }\n\n    return coercedValue;\n}\n\n// Returns a parabola scaled so that the min/max is either +/- 1 and zero at the two values\n// provided. The data is mapped by this function when constructing intervals so that it's\n// very easy to construct contours as normal.\nfunction makeRangeSettings(operation) {\n    return function(value) {\n        value = coerceValue(operation, value);\n\n        // Ensure proper ordering:\n        var min = Math.min(value[0], value[1]);\n        var max = Math.max(value[0], value[1]);\n\n        return {\n            start: min,\n            end: max,\n            size: max - min\n        };\n    };\n}\n\nfunction makeInequalitySettings(operation) {\n    return function(value) {\n        value = coerceValue(operation, value);\n\n        return {\n            start: value,\n            end: Infinity,\n            size: Infinity\n        };\n    };\n}\n\n},{\"../../constants/filter_ops\":156,\"fast-isnumeric\":18}],315:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function handleContourDefaults(traceIn, traceOut, coerce, coerce2) {\n    var contourStart = coerce2('contours.start');\n    var contourEnd = coerce2('contours.end');\n    var missingEnd = (contourStart === false) || (contourEnd === false);\n\n    // normally we only need size if autocontour is off. But contour.calc\n    // pushes its calculated contour size back to the input trace, so for\n    // things like restyle that can call supplyDefaults without calc\n    // after the initial draw, we can just reuse the previous calculation\n    var contourSize = coerce('contours.size');\n    var autoContour;\n\n    if(missingEnd) autoContour = traceOut.autocontour = true;\n    else autoContour = coerce('autocontour', false);\n\n    if(autoContour || !contourSize) coerce('ncontours');\n};\n\n},{}],316:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// The contour extraction is great, except it totally fails for constraints because we\n// need weird range loops and flipped contours instead of the usual format. This function\n// does some weird manipulation of the extracted pathinfo data such that it magically\n// draws contours correctly *as* constraints.\n//\n// ** I do not know which \"weird range loops\" the comment above is referring to.\nmodule.exports = function(pathinfo, operation) {\n    var i, pi0, pi1;\n\n    var op0 = function(arr) { return arr.reverse(); };\n    var op1 = function(arr) { return arr; };\n\n    switch(operation) {\n        case '=':\n        case '<':\n            return pathinfo;\n        case '>':\n            if(pathinfo.length !== 1) {\n                Lib.warn('Contour data invalid for the specified inequality operation.');\n            }\n\n            // In this case there should be exactly one contour levels in pathinfo.\n            // We flip all of the data. This will draw the contour as closed.\n            pi0 = pathinfo[0];\n\n            for(i = 0; i < pi0.edgepaths.length; i++) {\n                pi0.edgepaths[i] = op0(pi0.edgepaths[i]);\n            }\n            for(i = 0; i < pi0.paths.length; i++) {\n                pi0.paths[i] = op0(pi0.paths[i]);\n            }\n            for(i = 0; i < pi0.starts.length; i++) {\n                pi0.starts[i] = op0(pi0.starts[i]);\n            }\n\n            return pathinfo;\n        case '][':\n            var tmp = op0;\n            op0 = op1;\n            op1 = tmp;\n            // It's a nice rule, except this definitely *is* what's intended here.\n            /* eslint-disable: no-fallthrough */\n        case '[]':\n            /* eslint-enable: no-fallthrough */\n            if(pathinfo.length !== 2) {\n                Lib.warn('Contour data invalid for the specified inequality range operation.');\n            }\n\n            // In this case there should be exactly two contour levels in pathinfo.\n            // - We concatenate the info into one pathinfo.\n            // - We must also flip all of the data in the `[]` case.\n            // This will draw the contours as closed.\n            pi0 = copyPathinfo(pathinfo[0]);\n            pi1 = copyPathinfo(pathinfo[1]);\n\n            for(i = 0; i < pi0.edgepaths.length; i++) {\n                pi0.edgepaths[i] = op0(pi0.edgepaths[i]);\n            }\n            for(i = 0; i < pi0.paths.length; i++) {\n                pi0.paths[i] = op0(pi0.paths[i]);\n            }\n            for(i = 0; i < pi0.starts.length; i++) {\n                pi0.starts[i] = op0(pi0.starts[i]);\n            }\n\n            while(pi1.edgepaths.length) {\n                pi0.edgepaths.push(op1(pi1.edgepaths.shift()));\n            }\n            while(pi1.paths.length) {\n                pi0.paths.push(op1(pi1.paths.shift()));\n            }\n            while(pi1.starts.length) {\n                pi0.starts.push(op1(pi1.starts.shift()));\n            }\n\n            return [pi0];\n    }\n};\n\nfunction copyPathinfo(pi) {\n    return Lib.extendFlat({}, pi, {\n        edgepaths: Lib.extendDeep([], pi.edgepaths),\n        paths: Lib.extendDeep([], pi.paths),\n        starts: Lib.extendDeep([], pi.starts)\n    });\n}\n\n},{\"../../lib\":178}],317:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleXYZDefaults = _dereq_('../heatmap/xyz_defaults');\nvar handleConstraintDefaults = _dereq_('./constraint_defaults');\nvar handleContoursDefaults = _dereq_('./contours_defaults');\nvar handleStyleDefaults = _dereq_('./style_defaults');\nvar attributes = _dereq_('./attributes');\n\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    function coerce2(attr) {\n        return Lib.coerce2(traceIn, traceOut, attributes, attr);\n    }\n\n    var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);\n    if(!len) {\n        traceOut.visible = false;\n        return;\n    }\n\n    coerce('text');\n    coerce('hovertext');\n    coerce('hovertemplate');\n    coerce('hoverongaps');\n\n    var isConstraint = (coerce('contours.type') === 'constraint');\n    coerce('connectgaps', Lib.isArray1D(traceOut.z));\n\n    if(isConstraint) {\n        handleConstraintDefaults(traceIn, traceOut, coerce, layout, defaultColor);\n    } else {\n        handleContoursDefaults(traceIn, traceOut, coerce, coerce2);\n        handleStyleDefaults(traceIn, traceOut, coerce, layout);\n    }\n};\n\n},{\"../../lib\":178,\"../heatmap/xyz_defaults\":344,\"./attributes\":308,\"./constraint_defaults\":313,\"./contours_defaults\":315,\"./style_defaults\":329}],318:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar constraintMapping = _dereq_('./constraint_mapping');\nvar endPlus = _dereq_('./end_plus');\n\nmodule.exports = function emptyPathinfo(contours, plotinfo, cd0) {\n    var contoursFinal = (contours.type === 'constraint') ?\n        constraintMapping[contours._operation](contours.value) :\n        contours;\n\n    var cs = contoursFinal.size;\n    var pathinfo = [];\n    var end = endPlus(contoursFinal);\n\n    var carpet = cd0.trace._carpetTrace;\n\n    var basePathinfo = carpet ? {\n        // store axes so we can convert to px\n        xaxis: carpet.aaxis,\n        yaxis: carpet.baxis,\n        // full data arrays to use for interpolation\n        x: cd0.a,\n        y: cd0.b\n    } : {\n        xaxis: plotinfo.xaxis,\n        yaxis: plotinfo.yaxis,\n        x: cd0.x,\n        y: cd0.y\n    };\n\n    for(var ci = contoursFinal.start; ci < end; ci += cs) {\n        pathinfo.push(Lib.extendFlat({\n            level: ci,\n            // all the cells with nontrivial marching index\n            crossings: {},\n            // starting points on the edges of the lattice for each contour\n            starts: [],\n            // all unclosed paths (may have less items than starts,\n            // if a path is closed by rounding)\n            edgepaths: [],\n            // all closed paths\n            paths: [],\n            z: cd0.z,\n            smoothing: cd0.trace.line.smoothing\n        }, basePathinfo));\n\n        if(pathinfo.length > 1000) {\n            Lib.warn('Too many contours, clipping at 1000', contours);\n            break;\n        }\n    }\n    return pathinfo;\n};\n\n},{\"../../lib\":178,\"./constraint_mapping\":314,\"./end_plus\":319}],319:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/*\n * tiny helper to move the end of the contours a little to prevent\n * losing the last contour to rounding errors\n */\nmodule.exports = function endPlus(contours) {\n    return contours.end + contours.size / 1e6;\n};\n\n},{}],320:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar constants = _dereq_('./constants');\n\nmodule.exports = function findAllPaths(pathinfo, xtol, ytol) {\n    var cnt,\n        startLoc,\n        i,\n        pi,\n        j;\n\n    // Default just passes these values through as they were before:\n    xtol = xtol || 0.01;\n    ytol = ytol || 0.01;\n\n    for(i = 0; i < pathinfo.length; i++) {\n        pi = pathinfo[i];\n\n        for(j = 0; j < pi.starts.length; j++) {\n            startLoc = pi.starts[j];\n            makePath(pi, startLoc, 'edge', xtol, ytol);\n        }\n\n        cnt = 0;\n        while(Object.keys(pi.crossings).length && cnt < 10000) {\n            cnt++;\n            startLoc = Object.keys(pi.crossings)[0].split(',').map(Number);\n            makePath(pi, startLoc, undefined, xtol, ytol);\n        }\n        if(cnt === 10000) Lib.log('Infinite loop in contour?');\n    }\n};\n\nfunction equalPts(pt1, pt2, xtol, ytol) {\n    return Math.abs(pt1[0] - pt2[0]) < xtol &&\n           Math.abs(pt1[1] - pt2[1]) < ytol;\n}\n\n// distance in index units - uses the 3rd and 4th items in points\nfunction ptDist(pt1, pt2) {\n    var dx = pt1[2] - pt2[2];\n    var dy = pt1[3] - pt2[3];\n    return Math.sqrt(dx * dx + dy * dy);\n}\n\nfunction makePath(pi, loc, edgeflag, xtol, ytol) {\n    var locStr = loc.join(',');\n    var mi = pi.crossings[locStr];\n    var marchStep = getStartStep(mi, edgeflag, loc);\n    // start by going backward a half step and finding the crossing point\n    var pts = [getInterpPx(pi, loc, [-marchStep[0], -marchStep[1]])];\n    var m = pi.z.length;\n    var n = pi.z[0].length;\n    var startLoc = loc.slice();\n    var startStep = marchStep.slice();\n    var cnt;\n\n    // now follow the path\n    for(cnt = 0; cnt < 10000; cnt++) { // just to avoid infinite loops\n        if(mi > 20) {\n            mi = constants.CHOOSESADDLE[mi][(marchStep[0] || marchStep[1]) < 0 ? 0 : 1];\n            pi.crossings[locStr] = constants.SADDLEREMAINDER[mi];\n        } else {\n            delete pi.crossings[locStr];\n        }\n\n        marchStep = constants.NEWDELTA[mi];\n        if(!marchStep) {\n            Lib.log('Found bad marching index:', mi, loc, pi.level);\n            break;\n        }\n\n        // find the crossing a half step forward, and then take the full step\n        pts.push(getInterpPx(pi, loc, marchStep));\n        loc[0] += marchStep[0];\n        loc[1] += marchStep[1];\n        locStr = loc.join(',');\n\n        // don't include the same point multiple times\n        if(equalPts(pts[pts.length - 1], pts[pts.length - 2], xtol, ytol)) pts.pop();\n\n        var atEdge = (marchStep[0] && (loc[0] < 0 || loc[0] > n - 2)) ||\n                (marchStep[1] && (loc[1] < 0 || loc[1] > m - 2));\n\n        var closedLoop = loc[0] === startLoc[0] && loc[1] === startLoc[1] &&\n                marchStep[0] === startStep[0] && marchStep[1] === startStep[1];\n\n        // have we completed a loop, or reached an edge?\n        if((closedLoop) || (edgeflag && atEdge)) break;\n\n        mi = pi.crossings[locStr];\n    }\n\n    if(cnt === 10000) {\n        Lib.log('Infinite loop in contour?');\n    }\n    var closedpath = equalPts(pts[0], pts[pts.length - 1], xtol, ytol);\n    var totaldist = 0;\n    var distThresholdFactor = 0.2 * pi.smoothing;\n    var alldists = [];\n    var cropstart = 0;\n    var distgroup, cnt2, cnt3, newpt, ptcnt, ptavg, thisdist,\n        i, j, edgepathi, edgepathj;\n\n    /*\n     * Check for points that are too close together (<1/5 the average dist\n     * *in grid index units* (important for log axes and nonuniform grids),\n     * less if less smoothed) and just take the center (or avg of center 2).\n     * This cuts down on funny behavior when a point is very close to a\n     * contour level.\n     */\n    for(cnt = 1; cnt < pts.length; cnt++) {\n        thisdist = ptDist(pts[cnt], pts[cnt - 1]);\n        totaldist += thisdist;\n        alldists.push(thisdist);\n    }\n\n    var distThreshold = totaldist / alldists.length * distThresholdFactor;\n\n    function getpt(i) { return pts[i % pts.length]; }\n\n    for(cnt = pts.length - 2; cnt >= cropstart; cnt--) {\n        distgroup = alldists[cnt];\n        if(distgroup < distThreshold) {\n            cnt3 = 0;\n            for(cnt2 = cnt - 1; cnt2 >= cropstart; cnt2--) {\n                if(distgroup + alldists[cnt2] < distThreshold) {\n                    distgroup += alldists[cnt2];\n                } else break;\n            }\n\n            // closed path with close points wrapping around the boundary?\n            if(closedpath && cnt === pts.length - 2) {\n                for(cnt3 = 0; cnt3 < cnt2; cnt3++) {\n                    if(distgroup + alldists[cnt3] < distThreshold) {\n                        distgroup += alldists[cnt3];\n                    } else break;\n                }\n            }\n            ptcnt = cnt - cnt2 + cnt3 + 1;\n            ptavg = Math.floor((cnt + cnt2 + cnt3 + 2) / 2);\n\n            // either endpoint included: keep the endpoint\n            if(!closedpath && cnt === pts.length - 2) newpt = pts[pts.length - 1];\n            else if(!closedpath && cnt2 === -1) newpt = pts[0];\n\n            // odd # of points - just take the central one\n            else if(ptcnt % 2) newpt = getpt(ptavg);\n\n            // even # of pts - average central two\n            else {\n                newpt = [(getpt(ptavg)[0] + getpt(ptavg + 1)[0]) / 2,\n                    (getpt(ptavg)[1] + getpt(ptavg + 1)[1]) / 2];\n            }\n\n            pts.splice(cnt2 + 1, cnt - cnt2 + 1, newpt);\n            cnt = cnt2 + 1;\n            if(cnt3) cropstart = cnt3;\n            if(closedpath) {\n                if(cnt === pts.length - 2) pts[cnt3] = pts[pts.length - 1];\n                else if(cnt === 0) pts[pts.length - 1] = pts[0];\n            }\n        }\n    }\n    pts.splice(0, cropstart);\n\n    // done with the index parts - remove them so path generation works right\n    // because it depends on only having [xpx, ypx]\n    for(cnt = 0; cnt < pts.length; cnt++) pts[cnt].length = 2;\n\n    // don't return single-point paths (ie all points were the same\n    // so they got deleted?)\n    if(pts.length < 2) return;\n    else if(closedpath) {\n        pts.pop();\n        pi.paths.push(pts);\n    } else {\n        if(!edgeflag) {\n            Lib.log('Unclosed interior contour?',\n                pi.level, startLoc.join(','), pts.join('L'));\n        }\n\n        // edge path - does it start where an existing edge path ends, or vice versa?\n        var merged = false;\n        for(i = 0; i < pi.edgepaths.length; i++) {\n            edgepathi = pi.edgepaths[i];\n            if(!merged && equalPts(edgepathi[0], pts[pts.length - 1], xtol, ytol)) {\n                pts.pop();\n                merged = true;\n\n                // now does it ALSO meet the end of another (or the same) path?\n                var doublemerged = false;\n                for(j = 0; j < pi.edgepaths.length; j++) {\n                    edgepathj = pi.edgepaths[j];\n                    if(equalPts(edgepathj[edgepathj.length - 1], pts[0], xtol, ytol)) {\n                        doublemerged = true;\n                        pts.shift();\n                        pi.edgepaths.splice(i, 1);\n                        if(j === i) {\n                            // the path is now closed\n                            pi.paths.push(pts.concat(edgepathj));\n                        } else {\n                            if(j > i) j--;\n                            pi.edgepaths[j] = edgepathj.concat(pts, edgepathi);\n                        }\n                        break;\n                    }\n                }\n                if(!doublemerged) {\n                    pi.edgepaths[i] = pts.concat(edgepathi);\n                }\n            }\n        }\n        for(i = 0; i < pi.edgepaths.length; i++) {\n            if(merged) break;\n            edgepathi = pi.edgepaths[i];\n            if(equalPts(edgepathi[edgepathi.length - 1], pts[0], xtol, ytol)) {\n                pts.shift();\n                pi.edgepaths[i] = edgepathi.concat(pts);\n                merged = true;\n            }\n        }\n\n        if(!merged) pi.edgepaths.push(pts);\n    }\n}\n\n// special function to get the marching step of the\n// first point in the path (leading to loc)\nfunction getStartStep(mi, edgeflag, loc) {\n    var dx = 0;\n    var dy = 0;\n    if(mi > 20 && edgeflag) {\n        // these saddles start at +/- x\n        if(mi === 208 || mi === 1114) {\n            // if we're starting at the left side, we must be going right\n            dx = loc[0] === 0 ? 1 : -1;\n        } else {\n            // if we're starting at the bottom, we must be going up\n            dy = loc[1] === 0 ? 1 : -1;\n        }\n    } else if(constants.BOTTOMSTART.indexOf(mi) !== -1) dy = 1;\n    else if(constants.LEFTSTART.indexOf(mi) !== -1) dx = 1;\n    else if(constants.TOPSTART.indexOf(mi) !== -1) dy = -1;\n    else dx = -1;\n    return [dx, dy];\n}\n\n/*\n * Find the pixel coordinates of a particular crossing\n *\n * @param {object} pi: the pathinfo object at this level\n * @param {array} loc: the grid index [x, y] of the crossing\n * @param {array} step: the direction [dx, dy] we're moving on the grid\n *\n * @return {array} [xpx, ypx, xi, yi]: the first two are the pixel location,\n *   the next two are the interpolated grid indices, which we use for\n *   distance calculations to delete points that are too close together.\n *   This is important when the grid is nonuniform (and most dramatically when\n *   we're on log axes and include invalid (0 or negative) values.\n *   It's crucial to delete these extra two before turning an array of these\n *   points into a path, because those routines require length-2 points.\n */\nfunction getInterpPx(pi, loc, step) {\n    var locx = loc[0] + Math.max(step[0], 0);\n    var locy = loc[1] + Math.max(step[1], 0);\n    var zxy = pi.z[locy][locx];\n    var xa = pi.xaxis;\n    var ya = pi.yaxis;\n\n    if(step[1]) {\n        var dx = (pi.level - zxy) / (pi.z[locy][locx + 1] - zxy);\n\n        return [xa.c2p((1 - dx) * pi.x[locx] + dx * pi.x[locx + 1], true),\n            ya.c2p(pi.y[locy], true),\n            locx + dx, locy];\n    } else {\n        var dy = (pi.level - zxy) / (pi.z[locy + 1][locx] - zxy);\n        return [xa.c2p(pi.x[locx], true),\n            ya.c2p((1 - dy) * pi.y[locy] + dy * pi.y[locy + 1], true),\n            locx, locy + dy];\n    }\n}\n\n},{\"../../lib\":178,\"./constants\":312}],321:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\n\nvar heatmapHoverPoints = _dereq_('../heatmap/hover');\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLayer) {\n    var hoverData = heatmapHoverPoints(pointData, xval, yval, hovermode, hoverLayer, true);\n\n    if(hoverData) {\n        hoverData.forEach(function(hoverPt) {\n            var trace = hoverPt.trace;\n            if(trace.contours.type === 'constraint') {\n                if(trace.fillcolor && Color.opacity(trace.fillcolor)) {\n                    hoverPt.color = Color.addOpacity(trace.fillcolor, 1);\n                } else if(trace.contours.showlines && Color.opacity(trace.line.color)) {\n                    hoverPt.color = Color.addOpacity(trace.line.color, 1);\n                }\n            }\n        });\n    }\n\n    return hoverData;\n};\n\n},{\"../../components/color\":52,\"../heatmap/hover\":337}],322:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    calc: _dereq_('./calc'),\n    plot: _dereq_('./plot').plot,\n    style: _dereq_('./style'),\n    colorbar: _dereq_('./colorbar'),\n    hoverPoints: _dereq_('./hover'),\n\n    moduleType: 'trace',\n    name: 'contour',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['cartesian', 'svg', '2dMap', 'contour', 'showLegend'],\n    meta: {\n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"./attributes\":308,\"./calc\":309,\"./colorbar\":311,\"./defaults\":317,\"./hover\":321,\"./plot\":326,\"./style\":328}],323:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function handleLabelDefaults(coerce, layout, lineColor, opts) {\n    if(!opts) opts = {};\n    var showLabels = coerce('contours.showlabels');\n    if(showLabels) {\n        var globalFont = layout.font;\n        Lib.coerceFont(coerce, 'contours.labelfont', {\n            family: globalFont.family,\n            size: globalFont.size,\n            color: lineColor\n        });\n        coerce('contours.labelformat');\n    }\n\n    if(opts.hasHover !== false) coerce('zhoverformat');\n};\n\n},{\"../../lib\":178}],324:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Colorscale = _dereq_('../../components/colorscale');\nvar endPlus = _dereq_('./end_plus');\n\nmodule.exports = function makeColorMap(trace) {\n    var contours = trace.contours;\n    var start = contours.start;\n    var end = endPlus(contours);\n    var cs = contours.size || 1;\n    var nc = Math.floor((end - start) / cs) + 1;\n    var extra = contours.coloring === 'lines' ? 0 : 1;\n    var cOpts = Colorscale.extractOpts(trace);\n\n    if(!isFinite(cs)) {\n        cs = 1;\n        nc = 1;\n    }\n\n    var scl = cOpts.reversescale ?\n        Colorscale.flipScale(cOpts.colorscale) :\n        cOpts.colorscale;\n\n    var len = scl.length;\n    var domain = new Array(len);\n    var range = new Array(len);\n\n    var si, i;\n\n    if(contours.coloring === 'heatmap') {\n        var zmin0 = cOpts.min;\n        var zmax0 = cOpts.max;\n\n        for(i = 0; i < len; i++) {\n            si = scl[i];\n            domain[i] = si[0] * (zmax0 - zmin0) + zmin0;\n            range[i] = si[1];\n        }\n\n        // do the contours extend beyond the colorscale?\n        // if so, extend the colorscale with constants\n        var zRange = d3.extent([\n            zmin0,\n            zmax0,\n            contours.start,\n            contours.start + cs * (nc - 1)\n        ]);\n        var zmin = zRange[zmin0 < zmax0 ? 0 : 1];\n        var zmax = zRange[zmin0 < zmax0 ? 1 : 0];\n\n        if(zmin !== zmin0) {\n            domain.splice(0, 0, zmin);\n            range.splice(0, 0, range[0]);\n        }\n\n        if(zmax !== zmax0) {\n            domain.push(zmax);\n            range.push(range[range.length - 1]);\n        }\n    } else {\n        for(i = 0; i < len; i++) {\n            si = scl[i];\n            domain[i] = (si[0] * (nc + extra - 1) - (extra / 2)) * cs + start;\n            range[i] = si[1];\n        }\n    }\n\n    return Colorscale.makeColorScaleFunc(\n        {domain: domain, range: range},\n        {noNumericCheck: true}\n    );\n};\n\n},{\"../../components/colorscale\":64,\"./end_plus\":319,\"d3\":16}],325:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = _dereq_('./constants');\n\n// Calculate all the marching indices, for ALL levels at once.\n// since we want to be exhaustive we'll check for contour crossings\n// at every intersection, rather than just following a path\n// TODO: shorten the inner loop to only the relevant levels\nmodule.exports = function makeCrossings(pathinfo) {\n    var z = pathinfo[0].z;\n    var m = z.length;\n    var n = z[0].length; // we already made sure z isn't ragged in interp2d\n    var twoWide = m === 2 || n === 2;\n    var xi;\n    var yi;\n    var startIndices;\n    var ystartIndices;\n    var label;\n    var corners;\n    var mi;\n    var pi;\n    var i;\n\n    for(yi = 0; yi < m - 1; yi++) {\n        ystartIndices = [];\n        if(yi === 0) ystartIndices = ystartIndices.concat(constants.BOTTOMSTART);\n        if(yi === m - 2) ystartIndices = ystartIndices.concat(constants.TOPSTART);\n\n        for(xi = 0; xi < n - 1; xi++) {\n            startIndices = ystartIndices.slice();\n            if(xi === 0) startIndices = startIndices.concat(constants.LEFTSTART);\n            if(xi === n - 2) startIndices = startIndices.concat(constants.RIGHTSTART);\n\n            label = xi + ',' + yi;\n            corners = [[z[yi][xi], z[yi][xi + 1]],\n                       [z[yi + 1][xi], z[yi + 1][xi + 1]]];\n            for(i = 0; i < pathinfo.length; i++) {\n                pi = pathinfo[i];\n                mi = getMarchingIndex(pi.level, corners);\n                if(!mi) continue;\n\n                pi.crossings[label] = mi;\n                if(startIndices.indexOf(mi) !== -1) {\n                    pi.starts.push([xi, yi]);\n                    if(twoWide && startIndices.indexOf(mi,\n                            startIndices.indexOf(mi) + 1) !== -1) {\n                        // the same square has starts from opposite sides\n                        // it's not possible to have starts on opposite edges\n                        // of a corner, only a start and an end...\n                        // but if the array is only two points wide (either way)\n                        // you can have starts on opposite sides.\n                        pi.starts.push([xi, yi]);\n                    }\n                }\n            }\n        }\n    }\n};\n\n// modified marching squares algorithm,\n// so we disambiguate the saddle points from the start\n// and we ignore the cases with no crossings\n// the index I'm using is based on:\n// http://en.wikipedia.org/wiki/Marching_squares\n// except that the saddles bifurcate and I represent them\n// as the decimal combination of the two appropriate\n// non-saddle indices\nfunction getMarchingIndex(val, corners) {\n    var mi = (corners[0][0] > val ? 0 : 1) +\n             (corners[0][1] > val ? 0 : 2) +\n             (corners[1][1] > val ? 0 : 4) +\n             (corners[1][0] > val ? 0 : 8);\n    if(mi === 5 || mi === 10) {\n        var avg = (corners[0][0] + corners[0][1] +\n                   corners[1][0] + corners[1][1]) / 4;\n        // two peaks with a big valley\n        if(val > avg) return (mi === 5) ? 713 : 1114;\n        // two valleys with a big ridge\n        return (mi === 5) ? 104 : 208;\n    }\n    return (mi === 15) ? 0 : mi;\n}\n\n},{\"./constants\":312}],326:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar Colorscale = _dereq_('../../components/colorscale');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar setConvert = _dereq_('../../plots/cartesian/set_convert');\n\nvar heatmapPlot = _dereq_('../heatmap/plot');\nvar makeCrossings = _dereq_('./make_crossings');\nvar findAllPaths = _dereq_('./find_all_paths');\nvar emptyPathinfo = _dereq_('./empty_pathinfo');\nvar convertToConstraints = _dereq_('./convert_to_constraints');\nvar closeBoundaries = _dereq_('./close_boundaries');\nvar constants = _dereq_('./constants');\nvar costConstants = constants.LABELOPTIMIZER;\n\nexports.plot = function plot(gd, plotinfo, cdcontours, contourLayer) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    Lib.makeTraceGroups(contourLayer, cdcontours, 'contour').each(function(cd) {\n        var plotGroup = d3.select(this);\n        var cd0 = cd[0];\n        var trace = cd0.trace;\n        var x = cd0.x;\n        var y = cd0.y;\n        var contours = trace.contours;\n        var pathinfo = emptyPathinfo(contours, plotinfo, cd0);\n\n        // use a heatmap to fill - draw it behind the lines\n        var heatmapColoringLayer = Lib.ensureSingle(plotGroup, 'g', 'heatmapcoloring');\n        var cdheatmaps = [];\n        if(contours.coloring === 'heatmap') {\n            cdheatmaps = [cd];\n        }\n        heatmapPlot(gd, plotinfo, cdheatmaps, heatmapColoringLayer);\n\n        makeCrossings(pathinfo);\n        findAllPaths(pathinfo);\n\n        var leftedge = xa.c2p(x[0], true);\n        var rightedge = xa.c2p(x[x.length - 1], true);\n        var bottomedge = ya.c2p(y[0], true);\n        var topedge = ya.c2p(y[y.length - 1], true);\n        var perimeter = [\n            [leftedge, topedge],\n            [rightedge, topedge],\n            [rightedge, bottomedge],\n            [leftedge, bottomedge]\n        ];\n\n        var fillPathinfo = pathinfo;\n        if(contours.type === 'constraint') {\n            // N.B. this also mutates pathinfo\n            fillPathinfo = convertToConstraints(pathinfo, contours._operation);\n        }\n\n        // draw everything\n        makeBackground(plotGroup, perimeter, contours);\n        makeFills(plotGroup, fillPathinfo, perimeter, contours);\n        makeLinesAndLabels(plotGroup, pathinfo, gd, cd0, contours);\n        clipGaps(plotGroup, plotinfo, gd, cd0, perimeter);\n    });\n};\n\nfunction makeBackground(plotgroup, perimeter, contours) {\n    var bggroup = Lib.ensureSingle(plotgroup, 'g', 'contourbg');\n\n    var bgfill = bggroup.selectAll('path')\n        .data(contours.coloring === 'fill' ? [0] : []);\n    bgfill.enter().append('path');\n    bgfill.exit().remove();\n    bgfill\n        .attr('d', 'M' + perimeter.join('L') + 'Z')\n        .style('stroke', 'none');\n}\n\nfunction makeFills(plotgroup, pathinfo, perimeter, contours) {\n    var hasFills = contours.coloring === 'fill' || (contours.type === 'constraint' && contours._operation !== '=');\n    var boundaryPath = 'M' + perimeter.join('L') + 'Z';\n\n    // fills prefixBoundary in pathinfo items\n    if(hasFills) {\n        closeBoundaries(pathinfo, contours);\n    }\n\n    var fillgroup = Lib.ensureSingle(plotgroup, 'g', 'contourfill');\n\n    var fillitems = fillgroup.selectAll('path').data(hasFills ? pathinfo : []);\n    fillitems.enter().append('path');\n    fillitems.exit().remove();\n    fillitems.each(function(pi) {\n        // join all paths for this level together into a single path\n        // first follow clockwise around the perimeter to close any open paths\n        // if the whole perimeter is above this level, start with a path\n        // enclosing the whole thing. With all that, the parity should mean\n        // that we always fill everything above the contour, nothing below\n        var fullpath = (pi.prefixBoundary ? boundaryPath : '') +\n            joinAllPaths(pi, perimeter);\n\n        if(!fullpath) {\n            d3.select(this).remove();\n        } else {\n            d3.select(this)\n                .attr('d', fullpath)\n                .style('stroke', 'none');\n        }\n    });\n}\n\nfunction joinAllPaths(pi, perimeter) {\n    var fullpath = '';\n    var i = 0;\n    var startsleft = pi.edgepaths.map(function(v, i) { return i; });\n    var newloop = true;\n    var endpt;\n    var newendpt;\n    var cnt;\n    var nexti;\n    var possiblei;\n    var addpath;\n\n    function istop(pt) { return Math.abs(pt[1] - perimeter[0][1]) < 0.01; }\n    function isbottom(pt) { return Math.abs(pt[1] - perimeter[2][1]) < 0.01; }\n    function isleft(pt) { return Math.abs(pt[0] - perimeter[0][0]) < 0.01; }\n    function isright(pt) { return Math.abs(pt[0] - perimeter[2][0]) < 0.01; }\n\n    while(startsleft.length) {\n        addpath = Drawing.smoothopen(pi.edgepaths[i], pi.smoothing);\n        fullpath += newloop ? addpath : addpath.replace(/^M/, 'L');\n        startsleft.splice(startsleft.indexOf(i), 1);\n        endpt = pi.edgepaths[i][pi.edgepaths[i].length - 1];\n        nexti = -1;\n\n        // now loop through sides, moving our endpoint until we find a new start\n        for(cnt = 0; cnt < 4; cnt++) { // just to prevent infinite loops\n            if(!endpt) {\n                Lib.log('Missing end?', i, pi);\n                break;\n            }\n\n            if(istop(endpt) && !isright(endpt)) newendpt = perimeter[1]; // right top\n            else if(isleft(endpt)) newendpt = perimeter[0]; // left top\n            else if(isbottom(endpt)) newendpt = perimeter[3]; // right bottom\n            else if(isright(endpt)) newendpt = perimeter[2]; // left bottom\n\n            for(possiblei = 0; possiblei < pi.edgepaths.length; possiblei++) {\n                var ptNew = pi.edgepaths[possiblei][0];\n                // is ptNew on the (horz. or vert.) segment from endpt to newendpt?\n                if(Math.abs(endpt[0] - newendpt[0]) < 0.01) {\n                    if(Math.abs(endpt[0] - ptNew[0]) < 0.01 &&\n                            (ptNew[1] - endpt[1]) * (newendpt[1] - ptNew[1]) >= 0) {\n                        newendpt = ptNew;\n                        nexti = possiblei;\n                    }\n                } else if(Math.abs(endpt[1] - newendpt[1]) < 0.01) {\n                    if(Math.abs(endpt[1] - ptNew[1]) < 0.01 &&\n                            (ptNew[0] - endpt[0]) * (newendpt[0] - ptNew[0]) >= 0) {\n                        newendpt = ptNew;\n                        nexti = possiblei;\n                    }\n                } else {\n                    Lib.log('endpt to newendpt is not vert. or horz.',\n                        endpt, newendpt, ptNew);\n                }\n            }\n\n            endpt = newendpt;\n\n            if(nexti >= 0) break;\n            fullpath += 'L' + newendpt;\n        }\n\n        if(nexti === pi.edgepaths.length) {\n            Lib.log('unclosed perimeter path');\n            break;\n        }\n\n        i = nexti;\n\n        // if we closed back on a loop we already included,\n        // close it and start a new loop\n        newloop = (startsleft.indexOf(i) === -1);\n        if(newloop) {\n            i = startsleft[0];\n            fullpath += 'Z';\n        }\n    }\n\n    // finally add the interior paths\n    for(i = 0; i < pi.paths.length; i++) {\n        fullpath += Drawing.smoothclosed(pi.paths[i], pi.smoothing);\n    }\n\n    return fullpath;\n}\n\nfunction makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours) {\n    var lineContainer = Lib.ensureSingle(plotgroup, 'g', 'contourlines');\n    var showLines = contours.showlines !== false;\n    var showLabels = contours.showlabels;\n    var clipLinesForLabels = showLines && showLabels;\n\n    // Even if we're not going to show lines, we need to create them\n    // if we're showing labels, because the fill paths include the perimeter\n    // so can't be used to position the labels correctly.\n    // In this case we'll remove the lines after making the labels.\n    var linegroup = exports.createLines(lineContainer, showLines || showLabels, pathinfo);\n\n    var lineClip = exports.createLineClip(lineContainer, clipLinesForLabels, gd, cd0.trace.uid);\n\n    var labelGroup = plotgroup.selectAll('g.contourlabels')\n        .data(showLabels ? [0] : []);\n\n    labelGroup.exit().remove();\n\n    labelGroup.enter().append('g')\n        .classed('contourlabels', true);\n\n    if(showLabels) {\n        var labelClipPathData = [];\n        var labelData = [];\n\n        // invalidate the getTextLocation cache in case paths changed\n        Lib.clearLocationCache();\n\n        var contourFormat = exports.labelFormatter(gd, cd0);\n\n        var dummyText = Drawing.tester.append('text')\n            .attr('data-notex', 1)\n            .call(Drawing.font, contours.labelfont);\n\n        var xa = pathinfo[0].xaxis;\n        var ya = pathinfo[0].yaxis;\n        var xLen = xa._length;\n        var yLen = ya._length;\n        var xRng = xa.range;\n        var yRng = ya.range;\n        var xMin = Lib.aggNums(Math.min, null, cd0.x);\n        var xMax = Lib.aggNums(Math.max, null, cd0.x);\n        var yMin = Lib.aggNums(Math.min, null, cd0.y);\n        var yMax = Lib.aggNums(Math.max, null, cd0.y);\n        var x0 = Math.max(xa.c2p(xMin, true), 0);\n        var x1 = Math.min(xa.c2p(xMax, true), xLen);\n        var y0 = Math.max(ya.c2p(yMax, true), 0);\n        var y1 = Math.min(ya.c2p(yMin, true), yLen);\n\n        // visible bounds of the contour trace (and the midpoints, to\n        // help with cost calculations)\n        var bounds = {};\n\n        if(xRng[0] < xRng[1]) {\n            bounds.left = x0;\n            bounds.right = x1;\n        } else {\n            bounds.left = x1;\n            bounds.right = x0;\n        }\n\n        if(yRng[0] < yRng[1]) {\n            bounds.top = y0;\n            bounds.bottom = y1;\n        } else {\n            bounds.top = y1;\n            bounds.bottom = y0;\n        }\n\n        bounds.middle = (bounds.top + bounds.bottom) / 2;\n        bounds.center = (bounds.left + bounds.right) / 2;\n\n        labelClipPathData.push([\n            [bounds.left, bounds.top],\n            [bounds.right, bounds.top],\n            [bounds.right, bounds.bottom],\n            [bounds.left, bounds.bottom]\n        ]);\n\n        var plotDiagonal = Math.sqrt(xLen * xLen + yLen * yLen);\n\n        // the path length to use to scale the number of labels to draw:\n        var normLength = constants.LABELDISTANCE * plotDiagonal /\n            Math.max(1, pathinfo.length / constants.LABELINCREASE);\n\n        linegroup.each(function(d) {\n            var textOpts = exports.calcTextOpts(d.level, contourFormat, dummyText, gd);\n\n            d3.select(this).selectAll('path').each(function() {\n                var path = this;\n                var pathBounds = Lib.getVisibleSegment(path, bounds, textOpts.height / 2);\n                if(!pathBounds) return;\n\n                if(pathBounds.len < (textOpts.width + textOpts.height) * constants.LABELMIN) return;\n\n                var maxLabels = Math.min(Math.ceil(pathBounds.len / normLength),\n                    constants.LABELMAX);\n\n                for(var i = 0; i < maxLabels; i++) {\n                    var loc = exports.findBestTextLocation(path, pathBounds, textOpts,\n                        labelData, bounds);\n\n                    if(!loc) break;\n\n                    exports.addLabelData(loc, textOpts, labelData, labelClipPathData);\n                }\n            });\n        });\n\n        dummyText.remove();\n\n        exports.drawLabels(labelGroup, labelData, gd, lineClip,\n            clipLinesForLabels ? labelClipPathData : null);\n    }\n\n    if(showLabels && !showLines) linegroup.remove();\n}\n\nexports.createLines = function(lineContainer, makeLines, pathinfo) {\n    var smoothing = pathinfo[0].smoothing;\n\n    var linegroup = lineContainer.selectAll('g.contourlevel')\n        .data(makeLines ? pathinfo : []);\n\n    linegroup.exit().remove();\n    linegroup.enter().append('g')\n        .classed('contourlevel', true);\n\n    if(makeLines) {\n        // pedgepaths / ppaths are used by contourcarpet, for the paths transformed from a/b to x/y\n        // edgepaths / paths are used by contour since it's in x/y from the start\n        var opencontourlines = linegroup.selectAll('path.openline')\n            .data(function(d) { return d.pedgepaths || d.edgepaths; });\n\n        opencontourlines.exit().remove();\n        opencontourlines.enter().append('path')\n            .classed('openline', true);\n\n        opencontourlines\n            .attr('d', function(d) {\n                return Drawing.smoothopen(d, smoothing);\n            })\n            .style('stroke-miterlimit', 1)\n            .style('vector-effect', 'non-scaling-stroke');\n\n        var closedcontourlines = linegroup.selectAll('path.closedline')\n            .data(function(d) { return d.ppaths || d.paths; });\n\n        closedcontourlines.exit().remove();\n        closedcontourlines.enter().append('path')\n            .classed('closedline', true);\n\n        closedcontourlines\n            .attr('d', function(d) {\n                return Drawing.smoothclosed(d, smoothing);\n            })\n            .style('stroke-miterlimit', 1)\n            .style('vector-effect', 'non-scaling-stroke');\n    }\n\n    return linegroup;\n};\n\nexports.createLineClip = function(lineContainer, clipLinesForLabels, gd, uid) {\n    var clips = gd._fullLayout._clips;\n    var clipId = clipLinesForLabels ? ('clipline' + uid) : null;\n\n    var lineClip = clips.selectAll('#' + clipId)\n        .data(clipLinesForLabels ? [0] : []);\n    lineClip.exit().remove();\n\n    lineClip.enter().append('clipPath')\n        .classed('contourlineclip', true)\n        .attr('id', clipId);\n\n    Drawing.setClipUrl(lineContainer, clipId, gd);\n\n    return lineClip;\n};\n\nexports.labelFormatter = function(gd, cd0) {\n    var fullLayout = gd._fullLayout;\n    var trace = cd0.trace;\n    var contours = trace.contours;\n\n    var formatAxis = {\n        type: 'linear',\n        _id: 'ycontour',\n        showexponent: 'all',\n        exponentformat: 'B'\n    };\n\n    if(contours.labelformat) {\n        formatAxis.tickformat = contours.labelformat;\n        setConvert(formatAxis, fullLayout);\n    } else {\n        var cOpts = Colorscale.extractOpts(trace);\n        if(cOpts && cOpts.colorbar && cOpts.colorbar._axis) {\n            formatAxis = cOpts.colorbar._axis;\n        } else {\n            if(contours.type === 'constraint') {\n                var value = contours.value;\n                if(Array.isArray(value)) {\n                    formatAxis.range = [value[0], value[value.length - 1]];\n                } else formatAxis.range = [value, value];\n            } else {\n                formatAxis.range = [contours.start, contours.end];\n                formatAxis.nticks = (contours.end - contours.start) / contours.size;\n            }\n\n            if(formatAxis.range[0] === formatAxis.range[1]) {\n                formatAxis.range[1] += formatAxis.range[0] || 1;\n            }\n            if(!formatAxis.nticks) formatAxis.nticks = 1000;\n\n            setConvert(formatAxis, fullLayout);\n            Axes.prepTicks(formatAxis);\n            formatAxis._tmin = null;\n            formatAxis._tmax = null;\n        }\n    }\n\n    return function(v) { return Axes.tickText(formatAxis, v).text; };\n};\n\nexports.calcTextOpts = function(level, contourFormat, dummyText, gd) {\n    var text = contourFormat(level);\n    dummyText.text(text)\n        .call(svgTextUtils.convertToTspans, gd);\n\n    var el = dummyText.node();\n    var bBox = Drawing.bBox(el, true);\n\n    return {\n        text: text,\n        width: bBox.width,\n        height: bBox.height,\n        fontSize: +(el.style['font-size'].replace('px', '')),\n        level: level,\n        dy: (bBox.top + bBox.bottom) / 2\n    };\n};\n\nexports.findBestTextLocation = function(path, pathBounds, textOpts, labelData, plotBounds) {\n    var textWidth = textOpts.width;\n\n    var p0, dp, pMax, pMin, loc;\n    if(pathBounds.isClosed) {\n        dp = pathBounds.len / costConstants.INITIALSEARCHPOINTS;\n        p0 = pathBounds.min + dp / 2;\n        pMax = pathBounds.max;\n    } else {\n        dp = (pathBounds.len - textWidth) / (costConstants.INITIALSEARCHPOINTS + 1);\n        p0 = pathBounds.min + dp + textWidth / 2;\n        pMax = pathBounds.max - (dp + textWidth) / 2;\n    }\n\n    var cost = Infinity;\n    for(var j = 0; j < costConstants.ITERATIONS; j++) {\n        for(var p = p0; p < pMax; p += dp) {\n            var newLocation = Lib.getTextLocation(path, pathBounds.total, p, textWidth);\n            var newCost = locationCost(newLocation, textOpts, labelData, plotBounds);\n            if(newCost < cost) {\n                cost = newCost;\n                loc = newLocation;\n                pMin = p;\n            }\n        }\n        if(cost > costConstants.MAXCOST * 2) break;\n\n        // subsequent iterations just look half steps away from the\n        // best we found in the previous iteration\n        if(j) dp /= 2;\n        p0 = pMin - dp / 2;\n        pMax = p0 + dp * 1.5;\n    }\n    if(cost <= costConstants.MAXCOST) return loc;\n};\n\n/*\n * locationCost: a cost function for label locations\n * composed of three kinds of penalty:\n * - for open paths, being close to the end of the path\n * - the angle away from horizontal\n * - being too close to already placed neighbors\n */\nfunction locationCost(loc, textOpts, labelData, bounds) {\n    var halfWidth = textOpts.width / 2;\n    var halfHeight = textOpts.height / 2;\n    var x = loc.x;\n    var y = loc.y;\n    var theta = loc.theta;\n    var dx = Math.cos(theta) * halfWidth;\n    var dy = Math.sin(theta) * halfWidth;\n\n    // cost for being near an edge\n    var normX = ((x > bounds.center) ? (bounds.right - x) : (x - bounds.left)) /\n        (dx + Math.abs(Math.sin(theta) * halfHeight));\n    var normY = ((y > bounds.middle) ? (bounds.bottom - y) : (y - bounds.top)) /\n        (Math.abs(dy) + Math.cos(theta) * halfHeight);\n    if(normX < 1 || normY < 1) return Infinity;\n    var cost = costConstants.EDGECOST * (1 / (normX - 1) + 1 / (normY - 1));\n\n    // cost for not being horizontal\n    cost += costConstants.ANGLECOST * theta * theta;\n\n    // cost for being close to other labels\n    var x1 = x - dx;\n    var y1 = y - dy;\n    var x2 = x + dx;\n    var y2 = y + dy;\n    for(var i = 0; i < labelData.length; i++) {\n        var labeli = labelData[i];\n        var dxd = Math.cos(labeli.theta) * labeli.width / 2;\n        var dyd = Math.sin(labeli.theta) * labeli.width / 2;\n        var dist = Lib.segmentDistance(\n            x1, y1,\n            x2, y2,\n            labeli.x - dxd, labeli.y - dyd,\n            labeli.x + dxd, labeli.y + dyd\n        ) * 2 / (textOpts.height + labeli.height);\n\n        var sameLevel = labeli.level === textOpts.level;\n        var distOffset = sameLevel ? costConstants.SAMELEVELDISTANCE : 1;\n\n        if(dist <= distOffset) return Infinity;\n\n        var distFactor = costConstants.NEIGHBORCOST *\n            (sameLevel ? costConstants.SAMELEVELFACTOR : 1);\n\n        cost += distFactor / (dist - distOffset);\n    }\n\n    return cost;\n}\n\nexports.addLabelData = function(loc, textOpts, labelData, labelClipPathData) {\n    var fontSize = textOpts.fontSize;\n    var w = textOpts.width + fontSize / 3;\n    var h = Math.max(0, textOpts.height - fontSize / 3);\n\n    var x = loc.x;\n    var y = loc.y;\n    var theta = loc.theta;\n\n    var sin = Math.sin(theta);\n    var cos = Math.cos(theta);\n\n    var rotateXY = function(dx, dy) {\n        return [\n            x + dx * cos - dy * sin,\n            y + dx * sin + dy * cos\n        ];\n    };\n\n    var bBoxPts = [\n        rotateXY(-w / 2, -h / 2),\n        rotateXY(-w / 2, h / 2),\n        rotateXY(w / 2, h / 2),\n        rotateXY(w / 2, -h / 2)\n    ];\n\n    labelData.push({\n        text: textOpts.text,\n        x: x,\n        y: y,\n        dy: textOpts.dy,\n        theta: theta,\n        level: textOpts.level,\n        width: w,\n        height: h\n    });\n\n    labelClipPathData.push(bBoxPts);\n};\n\nexports.drawLabels = function(labelGroup, labelData, gd, lineClip, labelClipPathData) {\n    var labels = labelGroup.selectAll('text')\n        .data(labelData, function(d) {\n            return d.text + ',' + d.x + ',' + d.y + ',' + d.theta;\n        });\n\n    labels.exit().remove();\n\n    labels.enter().append('text')\n        .attr({\n            'data-notex': 1,\n            'text-anchor': 'middle'\n        })\n        .each(function(d) {\n            var x = d.x + Math.sin(d.theta) * d.dy;\n            var y = d.y - Math.cos(d.theta) * d.dy;\n            d3.select(this)\n                .text(d.text)\n                .attr({\n                    x: x,\n                    y: y,\n                    transform: 'rotate(' + (180 * d.theta / Math.PI) + ' ' + x + ' ' + y + ')'\n                })\n                .call(svgTextUtils.convertToTspans, gd);\n        });\n\n    if(labelClipPathData) {\n        var clipPath = '';\n        for(var i = 0; i < labelClipPathData.length; i++) {\n            clipPath += 'M' + labelClipPathData[i].join('L') + 'Z';\n        }\n\n        var lineClipPath = Lib.ensureSingle(lineClip, 'path', '');\n        lineClipPath.attr('d', clipPath);\n    }\n};\n\nfunction clipGaps(plotGroup, plotinfo, gd, cd0, perimeter) {\n    var trace = cd0.trace;\n    var clips = gd._fullLayout._clips;\n    var clipId = 'clip' + trace.uid;\n\n    var clipPath = clips.selectAll('#' + clipId)\n        .data(trace.connectgaps ? [] : [0]);\n    clipPath.enter().append('clipPath')\n        .classed('contourclip', true)\n        .attr('id', clipId);\n    clipPath.exit().remove();\n\n    if(trace.connectgaps === false) {\n        var clipPathInfo = {\n            // fraction of the way from missing to present point\n            // to draw the boundary.\n            // if you make this 1 (or 1-epsilon) then a point in\n            // a sea of missing data will disappear entirely.\n            level: 0.9,\n            crossings: {},\n            starts: [],\n            edgepaths: [],\n            paths: [],\n            xaxis: plotinfo.xaxis,\n            yaxis: plotinfo.yaxis,\n            x: cd0.x,\n            y: cd0.y,\n            // 0 = no data, 1 = data\n            z: makeClipMask(cd0),\n            smoothing: 0\n        };\n\n        makeCrossings([clipPathInfo]);\n        findAllPaths([clipPathInfo]);\n        closeBoundaries([clipPathInfo], {type: 'levels'});\n\n        var path = Lib.ensureSingle(clipPath, 'path', '');\n        path.attr('d',\n            (clipPathInfo.prefixBoundary ? 'M' + perimeter.join('L') + 'Z' : '') +\n            joinAllPaths(clipPathInfo, perimeter)\n        );\n    } else clipId = null;\n\n    Drawing.setClipUrl(plotGroup, clipId, gd);\n}\n\nfunction makeClipMask(cd0) {\n    var empties = cd0.trace._emptypoints;\n    var z = [];\n    var m = cd0.z.length;\n    var n = cd0.z[0].length;\n    var i;\n    var row = [];\n    var emptyPoint;\n\n    for(i = 0; i < n; i++) row.push(1);\n    for(i = 0; i < m; i++) z.push(row.slice());\n    for(i = 0; i < empties.length; i++) {\n        emptyPoint = empties[i];\n        z[emptyPoint[0]][emptyPoint[1]] = 0;\n    }\n    // save this mask to determine whether to show this data in hover\n    cd0.zmask = z;\n    return z;\n}\n\n},{\"../../components/colorscale\":64,\"../../components/drawing\":74,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../plots/cartesian/axes\":222,\"../../plots/cartesian/set_convert\":242,\"../heatmap/plot\":341,\"./close_boundaries\":310,\"./constants\":312,\"./convert_to_constraints\":316,\"./empty_pathinfo\":318,\"./find_all_paths\":320,\"./make_crossings\":325,\"d3\":16}],327:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function setContours(trace, vals) {\n    var contours = trace.contours;\n\n    // check if we need to auto-choose contour levels\n    if(trace.autocontour) {\n        // N.B. do not try to use coloraxis cmin/cmax,\n        // these values here are meant to remain \"per-trace\" for now\n        var zmin = trace.zmin;\n        var zmax = trace.zmax;\n        if(trace.zauto || zmin === undefined) {\n            zmin = Lib.aggNums(Math.min, null, vals);\n        }\n        if(trace.zauto || zmax === undefined) {\n            zmax = Lib.aggNums(Math.max, null, vals);\n        }\n\n        var dummyAx = autoContours(zmin, zmax, trace.ncontours);\n        contours.size = dummyAx.dtick;\n        contours.start = Axes.tickFirst(dummyAx);\n        dummyAx.range.reverse();\n        contours.end = Axes.tickFirst(dummyAx);\n\n        if(contours.start === zmin) contours.start += contours.size;\n        if(contours.end === zmax) contours.end -= contours.size;\n\n        // if you set a small ncontours, *and* the ends are exactly on zmin/zmax\n        // there's an edge case where start > end now. Make sure there's at least\n        // one meaningful contour, put it midway between the crossed values\n        if(contours.start > contours.end) {\n            contours.start = contours.end = (contours.start + contours.end) / 2;\n        }\n\n        // copy auto-contour info back to the source data.\n        // previously we copied the whole contours object back, but that had\n        // other info (coloring, showlines) that should be left to supplyDefaults\n        if(!trace._input.contours) trace._input.contours = {};\n        Lib.extendFlat(trace._input.contours, {\n            start: contours.start,\n            end: contours.end,\n            size: contours.size\n        });\n        trace._input.autocontour = true;\n    } else if(contours.type !== 'constraint') {\n        // sanity checks on manually-supplied start/end/size\n        var start = contours.start;\n        var end = contours.end;\n        var inputContours = trace._input.contours;\n\n        if(start > end) {\n            contours.start = inputContours.start = end;\n            end = contours.end = inputContours.end = start;\n            start = contours.start;\n        }\n\n        if(!(contours.size > 0)) {\n            var sizeOut;\n            if(start === end) sizeOut = 1;\n            else sizeOut = autoContours(start, end, trace.ncontours).dtick;\n\n            inputContours.size = contours.size = sizeOut;\n        }\n    }\n};\n\n\n/*\n * autoContours: make a dummy axis object with dtick we can use\n * as contours.size, and if needed we can use Axes.tickFirst\n * with this axis object to calculate the start and end too\n *\n * start: the value to start the contours at\n * end: the value to end at (must be > start)\n * ncontours: max number of contours to make, like roughDTick\n *\n * returns: an axis object\n */\nfunction autoContours(start, end, ncontours) {\n    var dummyAx = {\n        type: 'linear',\n        range: [start, end]\n    };\n\n    Axes.autoTicks(\n        dummyAx,\n        (end - start) / (ncontours || 15)\n    );\n\n    return dummyAx;\n}\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222}],328:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Drawing = _dereq_('../../components/drawing');\nvar heatmapStyle = _dereq_('../heatmap/style');\n\nvar makeColorMap = _dereq_('./make_color_map');\n\n\nmodule.exports = function style(gd) {\n    var contours = d3.select(gd).selectAll('g.contour');\n\n    contours.style('opacity', function(d) {\n        return d[0].trace.opacity;\n    });\n\n    contours.each(function(d) {\n        var c = d3.select(this);\n        var trace = d[0].trace;\n        var contours = trace.contours;\n        var line = trace.line;\n        var cs = contours.size || 1;\n        var start = contours.start;\n\n        // for contourcarpet only - is this a constraint-type contour trace?\n        var isConstraintType = contours.type === 'constraint';\n        var colorLines = !isConstraintType && contours.coloring === 'lines';\n        var colorFills = !isConstraintType && contours.coloring === 'fill';\n\n        var colorMap = (colorLines || colorFills) ? makeColorMap(trace) : null;\n\n        c.selectAll('g.contourlevel').each(function(d) {\n            d3.select(this).selectAll('path')\n                .call(Drawing.lineGroupStyle,\n                    line.width,\n                    colorLines ? colorMap(d.level) : line.color,\n                    line.dash);\n        });\n\n        var labelFont = contours.labelfont;\n        c.selectAll('g.contourlabels text').each(function(d) {\n            Drawing.font(d3.select(this), {\n                family: labelFont.family,\n                size: labelFont.size,\n                color: labelFont.color || (colorLines ? colorMap(d.level) : line.color)\n            });\n        });\n\n        if(isConstraintType) {\n            c.selectAll('g.contourfill path')\n                .style('fill', trace.fillcolor);\n        } else if(colorFills) {\n            var firstFill;\n\n            c.selectAll('g.contourfill path')\n                .style('fill', function(d) {\n                    if(firstFill === undefined) firstFill = d.level;\n                    return colorMap(d.level + 0.5 * cs);\n                });\n\n            if(firstFill === undefined) firstFill = start;\n\n            c.selectAll('g.contourbg path')\n                .style('fill', colorMap(firstFill - 0.5 * cs));\n        }\n    });\n\n    heatmapStyle(gd);\n};\n\n},{\"../../components/drawing\":74,\"../heatmap/style\":342,\"./make_color_map\":324,\"d3\":16}],329:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar handleLabelDefaults = _dereq_('./label_defaults');\n\n\nmodule.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout, opts) {\n    var coloring = coerce('contours.coloring');\n\n    var showLines;\n    var lineColor = '';\n    if(coloring === 'fill') showLines = coerce('contours.showlines');\n\n    if(showLines !== false) {\n        if(coloring !== 'lines') lineColor = coerce('line.color', '#000');\n        coerce('line.width', 0.5);\n        coerce('line.dash');\n    }\n\n    if(coloring !== 'none') {\n        // plots/plots always coerces showlegend to true, but in this case\n        // we default to false and (by default) show a colorbar instead\n        if(traceIn.showlegend !== true) traceOut.showlegend = false;\n        traceOut._dfltShowLegend = false;\n\n        colorscaleDefaults(\n            traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}\n        );\n    }\n\n    coerce('line.smoothing');\n\n    handleLabelDefaults(coerce, layout, lineColor, opts);\n};\n\n},{\"../../components/colorscale/defaults\":62,\"./label_defaults\":323}],330:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat({\n    z: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    x: extendFlat({}, scatterAttrs.x, {impliedEdits: {xtype: 'array'}}),\n    x0: extendFlat({}, scatterAttrs.x0, {impliedEdits: {xtype: 'scaled'}}),\n    dx: extendFlat({}, scatterAttrs.dx, {impliedEdits: {xtype: 'scaled'}}),\n    y: extendFlat({}, scatterAttrs.y, {impliedEdits: {ytype: 'array'}}),\n    y0: extendFlat({}, scatterAttrs.y0, {impliedEdits: {ytype: 'scaled'}}),\n    dy: extendFlat({}, scatterAttrs.dy, {impliedEdits: {ytype: 'scaled'}}),\n\n    text: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    hovertext: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    transpose: {\n        valType: 'boolean',\n        dflt: false,\n        \n        editType: 'calc',\n        \n    },\n    xtype: {\n        valType: 'enumerated',\n        values: ['array', 'scaled'],\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n    ytype: {\n        valType: 'enumerated',\n        values: ['array', 'scaled'],\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n    zsmooth: {\n        valType: 'enumerated',\n        values: ['fast', 'best', false],\n        dflt: false,\n        \n        editType: 'calc',\n        \n    },\n    hoverongaps: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'none',\n        \n    },\n    connectgaps: {\n        valType: 'boolean',\n        \n        editType: 'calc',\n        \n    },\n    xgap: {\n        valType: 'number',\n        dflt: 0,\n        min: 0,\n        \n        editType: 'plot',\n        \n    },\n    ygap: {\n        valType: 'number',\n        dflt: 0,\n        min: 0,\n        \n        editType: 'plot',\n        \n    },\n    zhoverformat: {\n        valType: 'string',\n        dflt: '',\n        \n        editType: 'none',\n        \n    },\n    hovertemplate: hovertemplateAttrs(),\n    showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n}, {\n    transforms: undefined\n},\n    colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})\n);\n\n},{\"../../components/colorscale/attributes\":59,\"../../constants/docs\":155,\"../../lib/extend\":173,\"../../plots/attributes\":219,\"../../plots/template_attributes\":264,\"../scatter/attributes\":389}],331:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar histogram2dCalc = _dereq_('../histogram2d/calc');\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar convertColumnData = _dereq_('./convert_column_xyz');\nvar clean2dArray = _dereq_('./clean_2d_array');\nvar interp2d = _dereq_('./interp2d');\nvar findEmpties = _dereq_('./find_empties');\nvar makeBoundArray = _dereq_('./make_bound_array');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function calc(gd, trace) {\n    // prepare the raw data\n    // run makeCalcdata on x and y even for heatmaps, in case of category mappings\n    var xa = Axes.getFromId(gd, trace.xaxis || 'x');\n    var ya = Axes.getFromId(gd, trace.yaxis || 'y');\n    var isContour = Registry.traceIs(trace, 'contour');\n    var isHist = Registry.traceIs(trace, 'histogram');\n    var isGL2D = Registry.traceIs(trace, 'gl2d');\n    var zsmooth = isContour ? 'best' : trace.zsmooth;\n    var x;\n    var x0;\n    var dx;\n    var y;\n    var y0;\n    var dy;\n    var z;\n    var i;\n    var binned;\n\n    // cancel minimum tick spacings (only applies to bars and boxes)\n    xa._minDtick = 0;\n    ya._minDtick = 0;\n\n    if(isHist) {\n        binned = histogram2dCalc(gd, trace);\n        x = binned.x;\n        x0 = binned.x0;\n        dx = binned.dx;\n        y = binned.y;\n        y0 = binned.y0;\n        dy = binned.dy;\n        z = binned.z;\n    } else {\n        var zIn = trace.z;\n        if(Lib.isArray1D(zIn)) {\n            convertColumnData(trace, xa, ya, 'x', 'y', ['z']);\n            x = trace._x;\n            y = trace._y;\n            zIn = trace._z;\n        } else {\n            x = trace._x = trace.x ? xa.makeCalcdata(trace, 'x') : [];\n            y = trace._y = trace.y ? ya.makeCalcdata(trace, 'y') : [];\n        }\n\n        x0 = trace.x0;\n        dx = trace.dx;\n        y0 = trace.y0;\n        dy = trace.dy;\n\n        z = clean2dArray(zIn, trace, xa, ya);\n    }\n\n    if(xa.rangebreaks || ya.rangebreaks) {\n        z = dropZonBreaks(x, y, z);\n\n        if(!isHist) {\n            x = skipBreaks(x);\n            y = skipBreaks(y);\n\n            trace._x = x;\n            trace._y = y;\n        }\n    }\n\n    if(!isHist && (isContour || trace.connectgaps)) {\n        trace._emptypoints = findEmpties(z);\n        interp2d(z, trace._emptypoints);\n    }\n\n    function noZsmooth(msg) {\n        zsmooth = trace._input.zsmooth = trace.zsmooth = false;\n        Lib.warn('cannot use zsmooth: \"fast\": ' + msg);\n    }\n\n    // check whether we really can smooth (ie all boxes are about the same size)\n    if(zsmooth === 'fast') {\n        if(xa.type === 'log' || ya.type === 'log') {\n            noZsmooth('log axis found');\n        } else if(!isHist) {\n            if(x.length) {\n                var avgdx = (x[x.length - 1] - x[0]) / (x.length - 1);\n                var maxErrX = Math.abs(avgdx / 100);\n                for(i = 0; i < x.length - 1; i++) {\n                    if(Math.abs(x[i + 1] - x[i] - avgdx) > maxErrX) {\n                        noZsmooth('x scale is not linear');\n                        break;\n                    }\n                }\n            }\n            if(y.length && zsmooth === 'fast') {\n                var avgdy = (y[y.length - 1] - y[0]) / (y.length - 1);\n                var maxErrY = Math.abs(avgdy / 100);\n                for(i = 0; i < y.length - 1; i++) {\n                    if(Math.abs(y[i + 1] - y[i] - avgdy) > maxErrY) {\n                        noZsmooth('y scale is not linear');\n                        break;\n                    }\n                }\n            }\n        }\n    }\n\n    // create arrays of brick boundaries, to be used by autorange and heatmap.plot\n    var xlen = Lib.maxRowLength(z);\n    var xIn = trace.xtype === 'scaled' ? '' : x;\n    var xArray = makeBoundArray(trace, xIn, x0, dx, xlen, xa);\n    var yIn = trace.ytype === 'scaled' ? '' : y;\n    var yArray = makeBoundArray(trace, yIn, y0, dy, z.length, ya);\n\n    // handled in gl2d convert step\n    if(!isGL2D) {\n        trace._extremes[xa._id] = Axes.findExtremes(xa, xArray);\n        trace._extremes[ya._id] = Axes.findExtremes(ya, yArray);\n    }\n\n    var cd0 = {\n        x: xArray,\n        y: yArray,\n        z: z,\n        text: trace._text || trace.text,\n        hovertext: trace._hovertext || trace.hovertext\n    };\n\n    if(xIn && xIn.length === xArray.length - 1) cd0.xCenter = xIn;\n    if(yIn && yIn.length === yArray.length - 1) cd0.yCenter = yIn;\n\n    if(isHist) {\n        cd0.xRanges = binned.xRanges;\n        cd0.yRanges = binned.yRanges;\n        cd0.pts = binned.pts;\n    }\n\n    if(!isContour) {\n        colorscaleCalc(gd, trace, {vals: z, cLetter: 'z'});\n    }\n\n    if(isContour && trace.contours && trace.contours.coloring === 'heatmap') {\n        var dummyTrace = {\n            type: trace.type === 'contour' ? 'heatmap' : 'histogram2d',\n            xcalendar: trace.xcalendar,\n            ycalendar: trace.ycalendar\n        };\n        cd0.xfill = makeBoundArray(dummyTrace, xIn, x0, dx, xlen, xa);\n        cd0.yfill = makeBoundArray(dummyTrace, yIn, y0, dy, z.length, ya);\n    }\n\n    return [cd0];\n};\n\nfunction skipBreaks(a) {\n    var b = [];\n    var len = a.length;\n    for(var i = 0; i < len; i++) {\n        var v = a[i];\n        if(v !== BADNUM) b.push(v);\n    }\n    return b;\n}\n\nfunction dropZonBreaks(x, y, z) {\n    var newZ = [];\n    var k = -1;\n    for(var i = 0; i < z.length; i++) {\n        if(y[i] === BADNUM) continue;\n        k++;\n        newZ[k] = [];\n        for(var j = 0; j < z[i].length; j++) {\n            if(x[j] === BADNUM) continue;\n\n            newZ[k].push(z[i][j]);\n        }\n    }\n    return newZ;\n}\n\n},{\"../../components/colorscale/calc\":60,\"../../constants/numerical\":158,\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../../registry\":269,\"../histogram2d/calc\":359,\"./clean_2d_array\":332,\"./convert_column_xyz\":334,\"./find_empties\":336,\"./interp2d\":339,\"./make_bound_array\":340}],332:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function clean2dArray(zOld, trace, xa, ya) {\n    var rowlen, collen, getCollen, old2new, i, j;\n\n    function cleanZvalue(v) {\n        if(!isNumeric(v)) return undefined;\n        return +v;\n    }\n\n    if(trace && trace.transpose) {\n        rowlen = 0;\n        for(i = 0; i < zOld.length; i++) rowlen = Math.max(rowlen, zOld[i].length);\n        if(rowlen === 0) return false;\n        getCollen = function(zOld) { return zOld.length; };\n        old2new = function(zOld, i, j) { return (zOld[j] || [])[i]; };\n    } else {\n        rowlen = zOld.length;\n        getCollen = function(zOld, i) { return zOld[i].length; };\n        old2new = function(zOld, i, j) { return (zOld[i] || [])[j]; };\n    }\n\n    var padOld2new = function(zOld, i, j) {\n        if(i === BADNUM || j === BADNUM) return BADNUM;\n        return old2new(zOld, i, j);\n    };\n\n    function axisMapping(ax) {\n        if(trace && trace.type !== 'carpet' && trace.type !== 'contourcarpet' &&\n            ax && ax.type === 'category' && trace['_' + ax._id.charAt(0)].length) {\n            var axLetter = ax._id.charAt(0);\n            var axMapping = {};\n            var traceCategories = trace['_' + axLetter + 'CategoryMap'] || trace[axLetter];\n            for(i = 0; i < traceCategories.length; i++) {\n                axMapping[traceCategories[i]] = i;\n            }\n            return function(i) {\n                var ind = axMapping[ax._categories[i]];\n                return ind + 1 ? ind : BADNUM;\n            };\n        } else {\n            return Lib.identity;\n        }\n    }\n\n    var xMap = axisMapping(xa);\n    var yMap = axisMapping(ya);\n\n    if(ya && ya.type === 'category') rowlen = ya._categories.length;\n    var zNew = new Array(rowlen);\n\n    for(i = 0; i < rowlen; i++) {\n        if(xa && xa.type === 'category') {\n            collen = xa._categories.length;\n        } else {\n            collen = getCollen(zOld, i);\n        }\n        zNew[i] = new Array(collen);\n        for(j = 0; j < collen; j++) zNew[i][j] = cleanZvalue(padOld2new(zOld, yMap(i), xMap(j)));\n    }\n\n    return zNew;\n};\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"fast-isnumeric\":18}],333:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    min: 'zmin',\n    max: 'zmax'\n};\n\n},{}],334:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function convertColumnData(trace, ax1, ax2, var1Name, var2Name, arrayVarNames) {\n    var colLen = trace._length;\n    var col1 = ax1.makeCalcdata(trace, var1Name);\n    var col2 = ax2.makeCalcdata(trace, var2Name);\n    var textCol = trace.text;\n    var hasColumnText = (textCol !== undefined && Lib.isArray1D(textCol));\n    var hoverTextCol = trace.hovertext;\n    var hasColumnHoverText = (hoverTextCol !== undefined && Lib.isArray1D(hoverTextCol));\n    var i, j;\n\n    var col1dv = Lib.distinctVals(col1);\n    var col1vals = col1dv.vals;\n    var col2dv = Lib.distinctVals(col2);\n    var col2vals = col2dv.vals;\n    var newArrays = [];\n    var text;\n    var hovertext;\n\n    var nI = col2vals.length;\n    var nJ = col1vals.length;\n\n    for(i = 0; i < arrayVarNames.length; i++) {\n        newArrays[i] = Lib.init2dArray(nI, nJ);\n    }\n\n    if(hasColumnText) {\n        text = Lib.init2dArray(nI, nJ);\n    }\n    if(hasColumnHoverText) {\n        hovertext = Lib.init2dArray(nI, nJ);\n    }\n\n    var after2before = Lib.init2dArray(nI, nJ);\n\n    for(i = 0; i < colLen; i++) {\n        if(col1[i] !== BADNUM && col2[i] !== BADNUM) {\n            var i1 = Lib.findBin(col1[i] + col1dv.minDiff / 2, col1vals);\n            var i2 = Lib.findBin(col2[i] + col2dv.minDiff / 2, col2vals);\n\n            for(j = 0; j < arrayVarNames.length; j++) {\n                var arrayVarName = arrayVarNames[j];\n                var arrayVar = trace[arrayVarName];\n                var newArray = newArrays[j];\n                newArray[i2][i1] = arrayVar[i];\n                after2before[i2][i1] = i;\n            }\n\n            if(hasColumnText) text[i2][i1] = textCol[i];\n            if(hasColumnHoverText) hovertext[i2][i1] = hoverTextCol[i];\n        }\n    }\n\n    trace['_' + var1Name] = col1vals;\n    trace['_' + var2Name] = col2vals;\n    for(j = 0; j < arrayVarNames.length; j++) {\n        trace['_' + arrayVarNames[j]] = newArrays[j];\n    }\n    if(hasColumnText) trace._text = text;\n    if(hasColumnHoverText) trace._hovertext = hovertext;\n\n    if(ax1 && ax1.type === 'category') {\n        trace['_' + var1Name + 'CategoryMap'] = col1vals.map(function(v) { return ax1._categories[v];});\n    }\n\n    if(ax2 && ax2.type === 'category') {\n        trace['_' + var2Name + 'CategoryMap'] = col2vals.map(function(v) { return ax2._categories[v];});\n    }\n\n    trace._after2before = after2before;\n};\n\n},{\"../../constants/numerical\":158,\"../../lib\":178}],335:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleXYZDefaults = _dereq_('./xyz_defaults');\nvar handleStyleDefaults = _dereq_('./style_defaults');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\n\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    var validData = handleXYZDefaults(traceIn, traceOut, coerce, layout);\n    if(!validData) {\n        traceOut.visible = false;\n        return;\n    }\n\n    coerce('text');\n    coerce('hovertext');\n    coerce('hovertemplate');\n\n    handleStyleDefaults(traceIn, traceOut, coerce, layout);\n\n    coerce('hoverongaps');\n    coerce('connectgaps', Lib.isArray1D(traceOut.z) && (traceOut.zsmooth !== false));\n\n    colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});\n};\n\n},{\"../../components/colorscale/defaults\":62,\"../../lib\":178,\"./attributes\":330,\"./style_defaults\":343,\"./xyz_defaults\":344}],336:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar maxRowLength = _dereq_('../../lib').maxRowLength;\n\n/* Return a list of empty points in 2D array z\n * each empty point z[i][j] gives an array [i, j, neighborCount]\n * neighborCount is the count of 4 nearest neighbors that DO exist\n * this is to give us an order of points to evaluate for interpolation.\n * if no neighbors exist, we iteratively look for neighbors that HAVE\n * neighbors, and add a fractional neighborCount\n */\nmodule.exports = function findEmpties(z) {\n    var empties = [];\n    var neighborHash = {};\n    var noNeighborList = [];\n    var nextRow = z[0];\n    var row = [];\n    var blank = [0, 0, 0];\n    var rowLength = maxRowLength(z);\n    var prevRow;\n    var i;\n    var j;\n    var thisPt;\n    var p;\n    var neighborCount;\n    var newNeighborHash;\n    var foundNewNeighbors;\n\n    for(i = 0; i < z.length; i++) {\n        prevRow = row;\n        row = nextRow;\n        nextRow = z[i + 1] || [];\n        for(j = 0; j < rowLength; j++) {\n            if(row[j] === undefined) {\n                neighborCount = (row[j - 1] !== undefined ? 1 : 0) +\n                    (row[j + 1] !== undefined ? 1 : 0) +\n                    (prevRow[j] !== undefined ? 1 : 0) +\n                    (nextRow[j] !== undefined ? 1 : 0);\n\n                if(neighborCount) {\n                    // for this purpose, don't count off-the-edge points\n                    // as undefined neighbors\n                    if(i === 0) neighborCount++;\n                    if(j === 0) neighborCount++;\n                    if(i === z.length - 1) neighborCount++;\n                    if(j === row.length - 1) neighborCount++;\n\n                    // if all neighbors that could exist do, we don't\n                    // need this for finding farther neighbors\n                    if(neighborCount < 4) {\n                        neighborHash[[i, j]] = [i, j, neighborCount];\n                    }\n\n                    empties.push([i, j, neighborCount]);\n                } else noNeighborList.push([i, j]);\n            }\n        }\n    }\n\n    while(noNeighborList.length) {\n        newNeighborHash = {};\n        foundNewNeighbors = false;\n\n        // look for cells that now have neighbors but didn't before\n        for(p = noNeighborList.length - 1; p >= 0; p--) {\n            thisPt = noNeighborList[p];\n            i = thisPt[0];\n            j = thisPt[1];\n\n            neighborCount = ((neighborHash[[i - 1, j]] || blank)[2] +\n                (neighborHash[[i + 1, j]] || blank)[2] +\n                (neighborHash[[i, j - 1]] || blank)[2] +\n                (neighborHash[[i, j + 1]] || blank)[2]) / 20;\n\n            if(neighborCount) {\n                newNeighborHash[thisPt] = [i, j, neighborCount];\n                noNeighborList.splice(p, 1);\n                foundNewNeighbors = true;\n            }\n        }\n\n        if(!foundNewNeighbors) {\n            throw 'findEmpties iterated with no new neighbors';\n        }\n\n        // put these new cells into the main neighbor list\n        for(thisPt in newNeighborHash) {\n            neighborHash[thisPt] = newNeighborHash[thisPt];\n            empties.push(newNeighborHash[thisPt]);\n        }\n    }\n\n    // sort the full list in descending order of neighbor count\n    return empties.sort(function(a, b) { return b[2] - a[2]; });\n};\n\n},{\"../../lib\":178}],337:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar extractOpts = _dereq_('../../components/colorscale').extractOpts;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLayer, contour) {\n    var cd0 = pointData.cd[0];\n    var trace = cd0.trace;\n    var xa = pointData.xa;\n    var ya = pointData.ya;\n    var x = cd0.x;\n    var y = cd0.y;\n    var z = cd0.z;\n    var xc = cd0.xCenter;\n    var yc = cd0.yCenter;\n    var zmask = cd0.zmask;\n    var zhoverformat = trace.zhoverformat;\n    var x2 = x;\n    var y2 = y;\n\n    var xl, yl, nx, ny;\n\n    if(pointData.index !== false) {\n        try {\n            nx = Math.round(pointData.index[1]);\n            ny = Math.round(pointData.index[0]);\n        } catch(e) {\n            Lib.error('Error hovering on heatmap, ' +\n                'pointNumber must be [row,col], found:', pointData.index);\n            return;\n        }\n        if(nx < 0 || nx >= z[0].length || ny < 0 || ny > z.length) {\n            return;\n        }\n    } else if(Fx.inbox(xval - x[0], xval - x[x.length - 1], 0) > 0 ||\n            Fx.inbox(yval - y[0], yval - y[y.length - 1], 0) > 0) {\n        return;\n    } else {\n        if(contour) {\n            var i2;\n            x2 = [2 * x[0] - x[1]];\n\n            for(i2 = 1; i2 < x.length; i2++) {\n                x2.push((x[i2] + x[i2 - 1]) / 2);\n            }\n            x2.push([2 * x[x.length - 1] - x[x.length - 2]]);\n\n            y2 = [2 * y[0] - y[1]];\n            for(i2 = 1; i2 < y.length; i2++) {\n                y2.push((y[i2] + y[i2 - 1]) / 2);\n            }\n            y2.push([2 * y[y.length - 1] - y[y.length - 2]]);\n        }\n        nx = Math.max(0, Math.min(x2.length - 2, Lib.findBin(xval, x2)));\n        ny = Math.max(0, Math.min(y2.length - 2, Lib.findBin(yval, y2)));\n    }\n\n    var x0 = xa.c2p(x[nx]);\n    var x1 = xa.c2p(x[nx + 1]);\n    var y0 = ya.c2p(y[ny]);\n    var y1 = ya.c2p(y[ny + 1]);\n\n    if(contour) {\n        x1 = x0;\n        xl = x[nx];\n        y1 = y0;\n        yl = y[ny];\n    } else {\n        xl = xc ? xc[nx] : ((x[nx] + x[nx + 1]) / 2);\n        yl = yc ? yc[ny] : ((y[ny] + y[ny + 1]) / 2);\n\n        if(xa && xa.type === 'category') xl = x[nx];\n        if(ya && ya.type === 'category') yl = y[ny];\n\n        if(trace.zsmooth) {\n            x0 = x1 = xa.c2p(xl);\n            y0 = y1 = ya.c2p(yl);\n        }\n    }\n\n    var zVal = z[ny][nx];\n    if(zmask && !zmask[ny][nx]) zVal = undefined;\n\n    if(zVal === undefined && !trace.hoverongaps) return;\n\n    var text;\n    if(Array.isArray(cd0.hovertext) && Array.isArray(cd0.hovertext[ny])) {\n        text = cd0.hovertext[ny][nx];\n    } else if(Array.isArray(cd0.text) && Array.isArray(cd0.text[ny])) {\n        text = cd0.text[ny][nx];\n    }\n\n    // dummy axis for formatting the z value\n    var cOpts = extractOpts(trace);\n    var dummyAx = {\n        type: 'linear',\n        range: [cOpts.min, cOpts.max],\n        hoverformat: zhoverformat,\n        _separators: xa._separators,\n        _numFormat: xa._numFormat\n    };\n    var zLabel = Axes.tickText(dummyAx, zVal, 'hover').text;\n\n    return [Lib.extendFlat(pointData, {\n        index: trace._after2before ? trace._after2before[ny][nx] : [ny, nx],\n        // never let a 2D override 1D type as closest point\n        distance: pointData.maxHoverDistance,\n        spikeDistance: pointData.maxSpikeDistance,\n        x0: x0,\n        x1: x1,\n        y0: y0,\n        y1: y1,\n        xLabelVal: xl,\n        yLabelVal: yl,\n        zLabelVal: zVal,\n        zLabel: zLabel,\n        text: text\n    })];\n};\n\n},{\"../../components/colorscale\":64,\"../../components/fx\":92,\"../../lib\":178,\"../../plots/cartesian/axes\":222}],338:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    calc: _dereq_('./calc'),\n    plot: _dereq_('./plot'),\n    colorbar: _dereq_('./colorbar'),\n    style: _dereq_('./style'),\n    hoverPoints: _dereq_('./hover'),\n\n    moduleType: 'trace',\n    name: 'heatmap',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['cartesian', 'svg', '2dMap', 'showLegend'],\n    meta: {\n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"./attributes\":330,\"./calc\":331,\"./colorbar\":333,\"./defaults\":335,\"./hover\":337,\"./plot\":341,\"./style\":342}],339:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar INTERPTHRESHOLD = 1e-2;\nvar NEIGHBORSHIFTS = [[-1, 0], [1, 0], [0, -1], [0, 1]];\n\nfunction correctionOvershoot(maxFractionalChange) {\n    // start with less overshoot, until we know it's converging,\n    // then ramp up the overshoot for faster convergence\n    return 0.5 - 0.25 * Math.min(1, maxFractionalChange * 0.5);\n}\n\n/*\n * interp2d: Fill in missing data from a 2D array using an iterative\n *   poisson equation solver with zero-derivative BC at edges.\n *   Amazingly, this just amounts to repeatedly averaging all the existing\n *   nearest neighbors, at least if we don't take x/y scaling into account,\n *   which is the right approach here where x and y may not even have the\n *   same units.\n *\n * @param {array of arrays} z\n *      The 2D array to fill in. Will be mutated here. Assumed to already be\n *      cleaned, so all entries are numbers except gaps, which are `undefined`.\n * @param {array of arrays} emptyPoints\n *      Each entry [i, j, neighborCount] for empty points z[i][j] and the number\n *      of neighbors that are *not* missing. Assumed to be sorted from most to\n *      least neighbors, as produced by heatmap/find_empties.\n */\nmodule.exports = function interp2d(z, emptyPoints) {\n    var maxFractionalChange = 1;\n    var i;\n\n    // one pass to fill in a starting value for all the empties\n    iterateInterp2d(z, emptyPoints);\n\n    // we're don't need to iterate lone empties - remove them\n    for(i = 0; i < emptyPoints.length; i++) {\n        if(emptyPoints[i][2] < 4) break;\n    }\n    // but don't remove these points from the original array,\n    // we'll use them for masking, so make a copy.\n    emptyPoints = emptyPoints.slice(i);\n\n    for(i = 0; i < 100 && maxFractionalChange > INTERPTHRESHOLD; i++) {\n        maxFractionalChange = iterateInterp2d(z, emptyPoints,\n            correctionOvershoot(maxFractionalChange));\n    }\n    if(maxFractionalChange > INTERPTHRESHOLD) {\n        Lib.log('interp2d didn\\'t converge quickly', maxFractionalChange);\n    }\n\n    return z;\n};\n\nfunction iterateInterp2d(z, emptyPoints, overshoot) {\n    var maxFractionalChange = 0;\n    var thisPt;\n    var i;\n    var j;\n    var p;\n    var q;\n    var neighborShift;\n    var neighborRow;\n    var neighborVal;\n    var neighborCount;\n    var neighborSum;\n    var initialVal;\n    var minNeighbor;\n    var maxNeighbor;\n\n    for(p = 0; p < emptyPoints.length; p++) {\n        thisPt = emptyPoints[p];\n        i = thisPt[0];\n        j = thisPt[1];\n        initialVal = z[i][j];\n        neighborSum = 0;\n        neighborCount = 0;\n\n        for(q = 0; q < 4; q++) {\n            neighborShift = NEIGHBORSHIFTS[q];\n            neighborRow = z[i + neighborShift[0]];\n            if(!neighborRow) continue;\n            neighborVal = neighborRow[j + neighborShift[1]];\n            if(neighborVal !== undefined) {\n                if(neighborSum === 0) {\n                    minNeighbor = maxNeighbor = neighborVal;\n                } else {\n                    minNeighbor = Math.min(minNeighbor, neighborVal);\n                    maxNeighbor = Math.max(maxNeighbor, neighborVal);\n                }\n                neighborCount++;\n                neighborSum += neighborVal;\n            }\n        }\n\n        if(neighborCount === 0) {\n            throw 'iterateInterp2d order is wrong: no defined neighbors';\n        }\n\n        // this is the laplace equation interpolation:\n        // each point is just the average of its neighbors\n        // note that this ignores differential x/y scaling\n        // which I think is the right approach, since we\n        // don't know what that scaling means\n        z[i][j] = neighborSum / neighborCount;\n\n        if(initialVal === undefined) {\n            if(neighborCount < 4) maxFractionalChange = 1;\n        } else {\n            // we can make large empty regions converge faster\n            // if we overshoot the change vs the previous value\n            z[i][j] = (1 + overshoot) * z[i][j] - overshoot * initialVal;\n\n            if(maxNeighbor > minNeighbor) {\n                maxFractionalChange = Math.max(maxFractionalChange,\n                    Math.abs(z[i][j] - initialVal) / (maxNeighbor - minNeighbor));\n            }\n        }\n    }\n\n    return maxFractionalChange;\n}\n\n},{\"../../lib\":178}],340:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\nmodule.exports = function makeBoundArray(trace, arrayIn, v0In, dvIn, numbricks, ax) {\n    var arrayOut = [];\n    var isContour = Registry.traceIs(trace, 'contour');\n    var isHist = Registry.traceIs(trace, 'histogram');\n    var isGL2D = Registry.traceIs(trace, 'gl2d');\n    var v0;\n    var dv;\n    var i;\n\n    var isArrayOfTwoItemsOrMore = isArrayOrTypedArray(arrayIn) && arrayIn.length > 1;\n\n    if(isArrayOfTwoItemsOrMore && !isHist && (ax.type !== 'category')) {\n        var len = arrayIn.length;\n\n        // given vals are brick centers\n        // hopefully length === numbricks, but use this method even if too few are supplied\n        // and extend it linearly based on the last two points\n        if(len <= numbricks) {\n            // contour plots only want the centers\n            if(isContour || isGL2D) arrayOut = arrayIn.slice(0, numbricks);\n            else if(numbricks === 1) {\n                arrayOut = [arrayIn[0] - 0.5, arrayIn[0] + 0.5];\n            } else {\n                arrayOut = [1.5 * arrayIn[0] - 0.5 * arrayIn[1]];\n\n                for(i = 1; i < len; i++) {\n                    arrayOut.push((arrayIn[i - 1] + arrayIn[i]) * 0.5);\n                }\n\n                arrayOut.push(1.5 * arrayIn[len - 1] - 0.5 * arrayIn[len - 2]);\n            }\n\n            if(len < numbricks) {\n                var lastPt = arrayOut[arrayOut.length - 1];\n                var delta = lastPt - arrayOut[arrayOut.length - 2];\n\n                for(i = len; i < numbricks; i++) {\n                    lastPt += delta;\n                    arrayOut.push(lastPt);\n                }\n            }\n        } else {\n            // hopefully length === numbricks+1, but do something regardless:\n            // given vals are brick boundaries\n            return isContour ?\n                arrayIn.slice(0, numbricks) :  // we must be strict for contours\n                arrayIn.slice(0, numbricks + 1);\n        }\n    } else {\n        var calendar = trace[ax._id.charAt(0) + 'calendar'];\n\n        if(isHist) {\n            v0 = ax.r2c(v0In, 0, calendar);\n        } else {\n            if(isArrayOrTypedArray(arrayIn) && arrayIn.length === 1) {\n                v0 = arrayIn[0];\n            } else if(v0In === undefined) {\n                v0 = 0;\n            } else {\n                var fn = ax.type === 'log' ? ax.d2c : ax.r2c;\n                v0 = fn(v0In, 0, calendar);\n            }\n        }\n\n        dv = dvIn || 1;\n\n        for(i = (isContour || isGL2D) ? 0 : -0.5; i < numbricks; i++) {\n            arrayOut.push(v0 + dv * i);\n        }\n    }\n\n    return arrayOut;\n};\n\n},{\"../../lib\":178,\"../../registry\":269}],341:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar makeColorScaleFuncFromTrace = _dereq_('../../components/colorscale').makeColorScaleFuncFromTrace;\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\n\nmodule.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    Lib.makeTraceGroups(heatmapLayer, cdheatmaps, 'hm').each(function(cd) {\n        var plotGroup = d3.select(this);\n        var cd0 = cd[0];\n        var trace = cd0.trace;\n\n        var z = cd0.z;\n        var x = cd0.x;\n        var y = cd0.y;\n        var xc = cd0.xCenter;\n        var yc = cd0.yCenter;\n        var isContour = Registry.traceIs(trace, 'contour');\n        var zsmooth = isContour ? 'best' : trace.zsmooth;\n\n        // get z dims\n        var m = z.length;\n        var n = Lib.maxRowLength(z);\n        var xrev = false;\n        var yrev = false;\n\n        var left, right, temp, top, bottom, i;\n\n        // TODO: if there are multiple overlapping categorical heatmaps,\n        // or if we allow category sorting, then the categories may not be\n        // sequential... may need to reorder and/or expand z\n\n        // Get edges of png in pixels (xa.c2p() maps axes coordinates to pixel coordinates)\n        // figure out if either axis is reversed (y is usually reversed, in pixel coords)\n        // also clip the image to maximum 50% outside the visible plot area\n        // bigger image lets you pan more naturally, but slows performance.\n        // TODO: use low-resolution images outside the visible plot for panning\n        // these while loops find the first and last brick bounds that are defined\n        // (in case of log of a negative)\n        i = 0;\n        while(left === undefined && i < x.length - 1) {\n            left = xa.c2p(x[i]);\n            i++;\n        }\n        i = x.length - 1;\n        while(right === undefined && i > 0) {\n            right = xa.c2p(x[i]);\n            i--;\n        }\n\n        if(right < left) {\n            temp = right;\n            right = left;\n            left = temp;\n            xrev = true;\n        }\n\n        i = 0;\n        while(top === undefined && i < y.length - 1) {\n            top = ya.c2p(y[i]);\n            i++;\n        }\n        i = y.length - 1;\n        while(bottom === undefined && i > 0) {\n            bottom = ya.c2p(y[i]);\n            i--;\n        }\n\n        if(bottom < top) {\n            temp = top;\n            top = bottom;\n            bottom = temp;\n            yrev = true;\n        }\n\n        // for contours with heatmap fill, we generate the boundaries based on\n        // brick centers but then use the brick edges for drawing the bricks\n        if(isContour) {\n            xc = x;\n            yc = y;\n            x = cd0.xfill;\n            y = cd0.yfill;\n        }\n\n        // make an image that goes at most half a screen off either side, to keep\n        // time reasonable when you zoom in. if zsmooth is true/fast, don't worry\n        // about this, because zooming doesn't increase number of pixels\n        // if zsmooth is best, don't include anything off screen because it takes too long\n        if(zsmooth !== 'fast') {\n            var extra = zsmooth === 'best' ? 0 : 0.5;\n            left = Math.max(-extra * xa._length, left);\n            right = Math.min((1 + extra) * xa._length, right);\n            top = Math.max(-extra * ya._length, top);\n            bottom = Math.min((1 + extra) * ya._length, bottom);\n        }\n\n        var imageWidth = Math.round(right - left);\n        var imageHeight = Math.round(bottom - top);\n\n        // setup image nodes\n\n        // if image is entirely off-screen, don't even draw it\n        var isOffScreen = (imageWidth <= 0 || imageHeight <= 0);\n\n        if(isOffScreen) {\n            var noImage = plotGroup.selectAll('image').data([]);\n            noImage.exit().remove();\n            return;\n        }\n\n        // generate image data\n\n        var canvasW, canvasH;\n        if(zsmooth === 'fast') {\n            canvasW = n;\n            canvasH = m;\n        } else {\n            canvasW = imageWidth;\n            canvasH = imageHeight;\n        }\n\n        var canvas = document.createElement('canvas');\n        canvas.width = canvasW;\n        canvas.height = canvasH;\n        var context = canvas.getContext('2d');\n\n        var sclFunc = makeColorScaleFuncFromTrace(trace, {noNumericCheck: true, returnArray: true});\n\n        // map brick boundaries to image pixels\n        var xpx,\n            ypx;\n        if(zsmooth === 'fast') {\n            xpx = xrev ?\n                function(index) { return n - 1 - index; } :\n                Lib.identity;\n            ypx = yrev ?\n                function(index) { return m - 1 - index; } :\n                Lib.identity;\n        } else {\n            xpx = function(index) {\n                return Lib.constrain(Math.round(xa.c2p(x[index]) - left),\n                    0, imageWidth);\n            };\n            ypx = function(index) {\n                return Lib.constrain(Math.round(ya.c2p(y[index]) - top),\n                    0, imageHeight);\n            };\n        }\n\n        // build the pixel map brick-by-brick\n        // cruise through z-matrix row-by-row\n        // build a brick at each z-matrix value\n        var yi = ypx(0);\n        var yb = [yi, yi];\n        var xbi = xrev ? 0 : 1;\n        var ybi = yrev ? 0 : 1;\n        // for collecting an average luminosity of the heatmap\n        var pixcount = 0;\n        var rcount = 0;\n        var gcount = 0;\n        var bcount = 0;\n\n        var xb, j, xi, v, row, c;\n\n        function setColor(v, pixsize) {\n            if(v !== undefined) {\n                var c = sclFunc(v);\n                c[0] = Math.round(c[0]);\n                c[1] = Math.round(c[1]);\n                c[2] = Math.round(c[2]);\n\n                pixcount += pixsize;\n                rcount += c[0] * pixsize;\n                gcount += c[1] * pixsize;\n                bcount += c[2] * pixsize;\n                return c;\n            }\n            return [0, 0, 0, 0];\n        }\n\n        function interpColor(r0, r1, xinterp, yinterp) {\n            var z00 = r0[xinterp.bin0];\n            if(z00 === undefined) return setColor(undefined, 1);\n\n            var z01 = r0[xinterp.bin1];\n            var z10 = r1[xinterp.bin0];\n            var z11 = r1[xinterp.bin1];\n            var dx = (z01 - z00) || 0;\n            var dy = (z10 - z00) || 0;\n            var dxy;\n\n            // the bilinear interpolation term needs different calculations\n            // for all the different permutations of missing data\n            // among the neighbors of the main point, to ensure\n            // continuity across brick boundaries.\n            if(z01 === undefined) {\n                if(z11 === undefined) dxy = 0;\n                else if(z10 === undefined) dxy = 2 * (z11 - z00);\n                else dxy = (2 * z11 - z10 - z00) * 2 / 3;\n            } else if(z11 === undefined) {\n                if(z10 === undefined) dxy = 0;\n                else dxy = (2 * z00 - z01 - z10) * 2 / 3;\n            } else if(z10 === undefined) dxy = (2 * z11 - z01 - z00) * 2 / 3;\n            else dxy = (z11 + z00 - z01 - z10);\n\n            return setColor(z00 + xinterp.frac * dx + yinterp.frac * (dy + xinterp.frac * dxy));\n        }\n\n        if(zsmooth) { // best or fast, works fastest with imageData\n            var pxIndex = 0;\n            var pixels;\n\n            try {\n                pixels = new Uint8Array(imageWidth * imageHeight * 4);\n            } catch(e) {\n                pixels = new Array(imageWidth * imageHeight * 4);\n            }\n\n            if(zsmooth === 'best') {\n                var xForPx = xc || x;\n                var yForPx = yc || y;\n                var xPixArray = new Array(xForPx.length);\n                var yPixArray = new Array(yForPx.length);\n                var xinterpArray = new Array(imageWidth);\n                var findInterpX = xc ? findInterpFromCenters : findInterp;\n                var findInterpY = yc ? findInterpFromCenters : findInterp;\n                var yinterp, r0, r1;\n\n                // first make arrays of x and y pixel locations of brick boundaries\n                for(i = 0; i < xForPx.length; i++) xPixArray[i] = Math.round(xa.c2p(xForPx[i]) - left);\n                for(i = 0; i < yForPx.length; i++) yPixArray[i] = Math.round(ya.c2p(yForPx[i]) - top);\n\n                // then make arrays of interpolations\n                // (bin0=closest, bin1=next, frac=fractional dist.)\n                for(i = 0; i < imageWidth; i++) xinterpArray[i] = findInterpX(i, xPixArray);\n\n                // now do the interpolations and fill the png\n                for(j = 0; j < imageHeight; j++) {\n                    yinterp = findInterpY(j, yPixArray);\n                    r0 = z[yinterp.bin0];\n                    r1 = z[yinterp.bin1];\n                    for(i = 0; i < imageWidth; i++, pxIndex += 4) {\n                        c = interpColor(r0, r1, xinterpArray[i], yinterp);\n                        putColor(pixels, pxIndex, c);\n                    }\n                }\n            } else { // zsmooth = fast\n                for(j = 0; j < m; j++) {\n                    row = z[j];\n                    yb = ypx(j);\n                    for(i = 0; i < imageWidth; i++) {\n                        c = setColor(row[i], 1);\n                        pxIndex = (yb * imageWidth + xpx(i)) * 4;\n                        putColor(pixels, pxIndex, c);\n                    }\n                }\n            }\n\n            var imageData = context.createImageData(imageWidth, imageHeight);\n            try {\n                imageData.data.set(pixels);\n            } catch(e) {\n                var pxArray = imageData.data;\n                var dlen = pxArray.length;\n                for(j = 0; j < dlen; j ++) {\n                    pxArray[j] = pixels[j];\n                }\n            }\n\n            context.putImageData(imageData, 0, 0);\n        } else { // zsmooth = false -> filling potentially large bricks works fastest with fillRect\n            // gaps do not need to be exact integers, but if they *are* we will get\n            // cleaner edges by rounding at least one edge\n            var xGap = trace.xgap;\n            var yGap = trace.ygap;\n            var xGapLeft = Math.floor(xGap / 2);\n            var yGapTop = Math.floor(yGap / 2);\n\n            for(j = 0; j < m; j++) {\n                row = z[j];\n                yb.reverse();\n                yb[ybi] = ypx(j + 1);\n                if(yb[0] === yb[1] || yb[0] === undefined || yb[1] === undefined) {\n                    continue;\n                }\n                xi = xpx(0);\n                xb = [xi, xi];\n                for(i = 0; i < n; i++) {\n                    // build one color brick!\n                    xb.reverse();\n                    xb[xbi] = xpx(i + 1);\n                    if(xb[0] === xb[1] || xb[0] === undefined || xb[1] === undefined) {\n                        continue;\n                    }\n                    v = row[i];\n                    c = setColor(v, (xb[1] - xb[0]) * (yb[1] - yb[0]));\n                    context.fillStyle = 'rgba(' + c.join(',') + ')';\n\n                    context.fillRect(xb[0] + xGapLeft, yb[0] + yGapTop,\n                        xb[1] - xb[0] - xGap, yb[1] - yb[0] - yGap);\n                }\n            }\n        }\n\n        rcount = Math.round(rcount / pixcount);\n        gcount = Math.round(gcount / pixcount);\n        bcount = Math.round(bcount / pixcount);\n        var avgColor = tinycolor('rgb(' + rcount + ',' + gcount + ',' + bcount + ')');\n\n        gd._hmpixcount = (gd._hmpixcount||0) + pixcount;\n        gd._hmlumcount = (gd._hmlumcount||0) + pixcount * avgColor.getLuminance();\n\n        var image3 = plotGroup.selectAll('image')\n            .data(cd);\n\n        image3.enter().append('svg:image').attr({\n            xmlns: xmlnsNamespaces.svg,\n            preserveAspectRatio: 'none'\n        });\n\n        image3.attr({\n            height: imageHeight,\n            width: imageWidth,\n            x: left,\n            y: top,\n            'xlink:href': canvas.toDataURL('image/png')\n        });\n    });\n};\n\n// get interpolated bin value. Returns {bin0:closest bin, frac:fractional dist to next, bin1:next bin}\nfunction findInterp(pixel, pixArray) {\n    var maxBin = pixArray.length - 2;\n    var bin = Lib.constrain(Lib.findBin(pixel, pixArray), 0, maxBin);\n    var pix0 = pixArray[bin];\n    var pix1 = pixArray[bin + 1];\n    var interp = Lib.constrain(bin + (pixel - pix0) / (pix1 - pix0) - 0.5, 0, maxBin);\n    var bin0 = Math.round(interp);\n    var frac = Math.abs(interp - bin0);\n\n    if(!interp || interp === maxBin || !frac) {\n        return {\n            bin0: bin0,\n            bin1: bin0,\n            frac: 0\n        };\n    }\n    return {\n        bin0: bin0,\n        frac: frac,\n        bin1: Math.round(bin0 + frac / (interp - bin0))\n    };\n}\n\nfunction findInterpFromCenters(pixel, centerPixArray) {\n    var maxBin = centerPixArray.length - 1;\n    var bin = Lib.constrain(Lib.findBin(pixel, centerPixArray), 0, maxBin);\n    var pix0 = centerPixArray[bin];\n    var pix1 = centerPixArray[bin + 1];\n    var frac = ((pixel - pix0) / (pix1 - pix0)) || 0;\n    if(frac <= 0) {\n        return {\n            bin0: bin,\n            bin1: bin,\n            frac: 0\n        };\n    }\n    if(frac < 0.5) {\n        return {\n            bin0: bin,\n            bin1: bin + 1,\n            frac: frac\n        };\n    }\n    return {\n        bin0: bin + 1,\n        bin1: bin,\n        frac: 1 - frac\n    };\n}\n\nfunction putColor(pixels, pxIndex, c) {\n    pixels[pxIndex] = c[0];\n    pixels[pxIndex + 1] = c[1];\n    pixels[pxIndex + 2] = c[2];\n    pixels[pxIndex + 3] = Math.round(c[3] * 255);\n}\n\n},{\"../../components/colorscale\":64,\"../../constants/xmlns_namespaces\":159,\"../../lib\":178,\"../../registry\":269,\"d3\":16,\"tinycolor2\":35}],342:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nmodule.exports = function style(gd) {\n    d3.select(gd).selectAll('.hm image')\n        .style('opacity', function(d) {\n            return d.trace.opacity;\n        });\n};\n\n},{\"d3\":16}],343:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = function handleStyleDefaults(traceIn, traceOut, coerce) {\n    var zsmooth = coerce('zsmooth');\n    if(zsmooth === false) {\n        // ensure that xgap and ygap are coerced only when zsmooth allows them to have an effect.\n        coerce('xgap');\n        coerce('ygap');\n    }\n\n    coerce('zhoverformat');\n};\n\n},{}],344:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\n\nvar Registry = _dereq_('../../registry');\n\nmodule.exports = function handleXYZDefaults(traceIn, traceOut, coerce, layout, xName, yName) {\n    var z = coerce('z');\n    xName = xName || 'x';\n    yName = yName || 'y';\n    var x, y;\n\n    if(z === undefined || !z.length) return 0;\n\n    if(Lib.isArray1D(traceIn.z)) {\n        x = coerce(xName);\n        y = coerce(yName);\n\n        var xlen = Lib.minRowLength(x);\n        var ylen = Lib.minRowLength(y);\n\n        // column z must be accompanied by xName and yName arrays\n        if(xlen === 0 || ylen === 0) return 0;\n\n        traceOut._length = Math.min(xlen, ylen, z.length);\n    } else {\n        x = coordDefaults(xName, coerce);\n        y = coordDefaults(yName, coerce);\n\n        // TODO put z validation elsewhere\n        if(!isValidZ(z)) return 0;\n\n        coerce('transpose');\n\n        traceOut._length = null;\n    }\n\n    if(\n        traceIn.type === 'heatmapgl' ||\n        traceIn.type === 'contourgl'\n    ) return true; // skip calendars until we handle them in those traces\n\n    var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n    handleCalendarDefaults(traceIn, traceOut, [xName, yName], layout);\n\n    return true;\n};\n\nfunction coordDefaults(coordStr, coerce) {\n    var coord = coerce(coordStr);\n    var coordType = coord ? coerce(coordStr + 'type', 'array') : 'scaled';\n\n    if(coordType === 'scaled') {\n        coerce(coordStr + '0');\n        coerce('d' + coordStr);\n    }\n\n    return coord;\n}\n\nfunction isValidZ(z) {\n    var allRowsAreArrays = true;\n    var oneRowIsFilled = false;\n    var hasOneNumber = false;\n    var zi;\n\n    /*\n     * Without this step:\n     *\n     * hasOneNumber = false breaks contour but not heatmap\n     * allRowsAreArrays = false breaks contour but not heatmap\n     * oneRowIsFilled = false breaks both\n     */\n\n    for(var i = 0; i < z.length; i++) {\n        zi = z[i];\n        if(!Lib.isArrayOrTypedArray(zi)) {\n            allRowsAreArrays = false;\n            break;\n        }\n        if(zi.length > 0) oneRowIsFilled = true;\n        for(var j = 0; j < zi.length; j++) {\n            if(isNumeric(zi[j])) {\n                hasOneNumber = true;\n                break;\n            }\n        }\n    }\n\n    return (allRowsAreArrays && oneRowIsFilled && hasOneNumber);\n}\n\n},{\"../../lib\":178,\"../../registry\":269,\"fast-isnumeric\":18}],345:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar barAttrs = _dereq_('../bar/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar makeBinAttrs = _dereq_('./bin_attributes');\nvar constants = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n    x: {\n        valType: 'data_array',\n        editType: 'calc+clearAxisTypes',\n        \n    },\n    y: {\n        valType: 'data_array',\n        editType: 'calc+clearAxisTypes',\n        \n    },\n\n    text: extendFlat({}, barAttrs.text, {\n        \n    }),\n    hovertext: extendFlat({}, barAttrs.hovertext, {\n        \n    }),\n    orientation: barAttrs.orientation,\n\n    histfunc: {\n        valType: 'enumerated',\n        values: ['count', 'sum', 'avg', 'min', 'max'],\n        \n        dflt: 'count',\n        editType: 'calc',\n        \n    },\n    histnorm: {\n        valType: 'enumerated',\n        values: ['', 'percent', 'probability', 'density', 'probability density'],\n        dflt: '',\n        \n        editType: 'calc',\n        \n    },\n\n    cumulative: {\n        enabled: {\n            valType: 'boolean',\n            dflt: false,\n            \n            editType: 'calc',\n            \n        },\n\n        direction: {\n            valType: 'enumerated',\n            values: ['increasing', 'decreasing'],\n            dflt: 'increasing',\n            \n            editType: 'calc',\n            \n        },\n\n        currentbin: {\n            valType: 'enumerated',\n            values: ['include', 'exclude', 'half'],\n            dflt: 'include',\n            \n            editType: 'calc',\n            \n        },\n        editType: 'calc'\n    },\n    nbinsx: {\n        valType: 'integer',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'calc',\n        \n    },\n    xbins: makeBinAttrs('x', true),\n\n    nbinsy: {\n        valType: 'integer',\n        min: 0,\n        dflt: 0,\n        \n        editType: 'calc',\n        \n    },\n    ybins: makeBinAttrs('y', true),\n    autobinx: {\n        valType: 'boolean',\n        dflt: null,\n        \n        editType: 'calc',\n        \n    },\n    autobiny: {\n        valType: 'boolean',\n        dflt: null,\n        \n        editType: 'calc',\n        \n    },\n\n    bingroup: {\n        valType: 'string',\n        \n        dflt: '',\n        editType: 'calc',\n        \n    },\n\n    hovertemplate: hovertemplateAttrs({}, {\n        keys: constants.eventDataKeys\n    }),\n\n    marker: barAttrs.marker,\n\n    offsetgroup: barAttrs.offsetgroup,\n    alignmentgroup: barAttrs.alignmentgroup,\n\n    selected: barAttrs.selected,\n    unselected: barAttrs.unselected,\n\n    _deprecated: {\n        bardir: barAttrs._deprecated.bardir\n    }\n};\n\n},{\"../../lib/extend\":173,\"../../plots/template_attributes\":264,\"../bar/attributes\":279,\"./bin_attributes\":347,\"./constants\":351}],346:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = function doAvg(size, counts) {\n    var nMax = size.length;\n    var total = 0;\n    for(var i = 0; i < nMax; i++) {\n        if(counts[i]) {\n            size[i] /= counts[i];\n            total += size[i];\n        } else size[i] = null;\n    }\n    return total;\n};\n\n},{}],347:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function makeBinAttrs(axLetter, match) {\n    return {\n        start: {\n            valType: 'any', // for date axes\n            \n            editType: 'calc',\n            \n        },\n        end: {\n            valType: 'any', // for date axes\n            \n            editType: 'calc',\n            \n        },\n        size: {\n            valType: 'any', // for date axes\n            \n            editType: 'calc',\n            \n        },\n        editType: 'calc'\n    };\n};\n\n},{}],348:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\n\nmodule.exports = {\n    count: function(n, i, size) {\n        size[n]++;\n        return 1;\n    },\n\n    sum: function(n, i, size, counterData) {\n        var v = counterData[i];\n        if(isNumeric(v)) {\n            v = Number(v);\n            size[n] += v;\n            return v;\n        }\n        return 0;\n    },\n\n    avg: function(n, i, size, counterData, counts) {\n        var v = counterData[i];\n        if(isNumeric(v)) {\n            v = Number(v);\n            size[n] += v;\n            counts[n]++;\n        }\n        return 0;\n    },\n\n    min: function(n, i, size, counterData) {\n        var v = counterData[i];\n        if(isNumeric(v)) {\n            v = Number(v);\n            if(!isNumeric(size[n])) {\n                size[n] = v;\n                return v;\n            } else if(size[n] > v) {\n                var delta = v - size[n];\n                size[n] = v;\n                return delta;\n            }\n        }\n        return 0;\n    },\n\n    max: function(n, i, size, counterData) {\n        var v = counterData[i];\n        if(isNumeric(v)) {\n            v = Number(v);\n            if(!isNumeric(size[n])) {\n                size[n] = v;\n                return v;\n            } else if(size[n] < v) {\n                var delta = v - size[n];\n                size[n] = v;\n                return delta;\n            }\n        }\n        return 0;\n    }\n};\n\n},{\"fast-isnumeric\":18}],349:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar numConstants = _dereq_('../../constants/numerical');\nvar oneYear = numConstants.ONEAVGYEAR;\nvar oneMonth = numConstants.ONEAVGMONTH;\nvar oneDay = numConstants.ONEDAY;\nvar oneHour = numConstants.ONEHOUR;\nvar oneMin = numConstants.ONEMIN;\nvar oneSec = numConstants.ONESEC;\nvar tickIncrement = _dereq_('../../plots/cartesian/axes').tickIncrement;\n\n\n/*\n * make a function that will find rounded bin edges\n * @param {number} leftGap: how far from the left edge of any bin is the closest data value?\n * @param {number} rightGap: how far from the right edge of any bin is the closest data value?\n * @param {Array[number]} binEdges: the actual edge values used in binning\n * @param {object} pa: the position axis\n * @param {string} calendar: the data calendar\n *\n * @return {function(v, isRightEdge)}:\n *   find the start (isRightEdge is falsy) or end (truthy) label value for a bin edge `v`\n */\nmodule.exports = function getBinSpanLabelRound(leftGap, rightGap, binEdges, pa, calendar) {\n    // the rounding digit is the largest digit that changes in *all* of 4 regions:\n    // - inside the rightGap before binEdges[0] (shifted 10% to the left)\n    // - inside the leftGap after binEdges[0] (expanded by 10% of rightGap on each end)\n    // - same for binEdges[1]\n    var dv0 = -1.1 * rightGap;\n    var dv1 = -0.1 * rightGap;\n    var dv2 = leftGap - dv1;\n    var edge0 = binEdges[0];\n    var edge1 = binEdges[1];\n    var leftDigit = Math.min(\n        biggestDigitChanged(edge0 + dv1, edge0 + dv2, pa, calendar),\n        biggestDigitChanged(edge1 + dv1, edge1 + dv2, pa, calendar)\n    );\n    var rightDigit = Math.min(\n        biggestDigitChanged(edge0 + dv0, edge0 + dv1, pa, calendar),\n        biggestDigitChanged(edge1 + dv0, edge1 + dv1, pa, calendar)\n    );\n\n    // normally we try to make the label for the right edge different from\n    // the left edge label, so it's unambiguous which bin gets data on the edge.\n    // but if this results in more than 3 extra digits (or for dates, more than\n    // 2 fields ie hr&min or min&sec, which is 3600x), it'll be more clutter than\n    // useful so keep the label cleaner instead\n    var digit, disambiguateEdges;\n    if(leftDigit > rightDigit && rightDigit < Math.abs(edge1 - edge0) / 4000) {\n        digit = leftDigit;\n        disambiguateEdges = false;\n    } else {\n        digit = Math.min(leftDigit, rightDigit);\n        disambiguateEdges = true;\n    }\n\n    if(pa.type === 'date' && digit > oneDay) {\n        var dashExclude = (digit === oneYear) ? 1 : 6;\n        var increment = (digit === oneYear) ? 'M12' : 'M1';\n\n        return function(v, isRightEdge) {\n            var dateStr = pa.c2d(v, oneYear, calendar);\n            var dashPos = dateStr.indexOf('-', dashExclude);\n            if(dashPos > 0) dateStr = dateStr.substr(0, dashPos);\n            var roundedV = pa.d2c(dateStr, 0, calendar);\n\n            if(roundedV < v) {\n                var nextV = tickIncrement(roundedV, increment, false, calendar);\n                if((roundedV + nextV) / 2 < v + leftGap) roundedV = nextV;\n            }\n\n            if(isRightEdge && disambiguateEdges) {\n                return tickIncrement(roundedV, increment, true, calendar);\n            }\n\n            return roundedV;\n        };\n    }\n\n    return function(v, isRightEdge) {\n        var roundedV = digit * Math.round(v / digit);\n        // if we rounded down and we could round up and still be < leftGap\n        // (or what leftGap values round to), do that\n        if(roundedV + (digit / 10) < v && roundedV + (digit * 0.9) < v + leftGap) {\n            roundedV += digit;\n        }\n        // finally for the right edge back off one digit - but only if we can do that\n        // and not clip off any data that's potentially in the bin\n        if(isRightEdge && disambiguateEdges) {\n            roundedV -= digit;\n        }\n        return roundedV;\n    };\n};\n\n/*\n * Find the largest digit that changes within a (calcdata) region [v1, v2]\n * if dates, \"digit\" means date/time part when it's bigger than a second\n * returns the unit value to round to this digit, eg 0.01 to round to hundredths, or\n * 100 to round to hundreds. returns oneMonth or oneYear for month or year rounding,\n * so that Math.min will work, rather than 'M1' and 'M12'\n */\nfunction biggestDigitChanged(v1, v2, pa, calendar) {\n    // are we crossing zero? can't say anything.\n    // in principle this doesn't apply to dates but turns out this doesn't matter.\n    if(v1 * v2 <= 0) return Infinity;\n\n    var dv = Math.abs(v2 - v1);\n    var isDate = pa.type === 'date';\n    var digit = biggestGuaranteedDigitChanged(dv, isDate);\n    // see if a larger digit also changed\n    for(var i = 0; i < 10; i++) {\n        // numbers: next digit needs to be >10x but <100x then gets rounded down.\n        // dates: next digit can be as much as 60x (then rounded down)\n        var nextDigit = biggestGuaranteedDigitChanged(digit * 80, isDate);\n        // if we get to years, the chain stops\n        if(digit === nextDigit) break;\n        if(didDigitChange(nextDigit, v1, v2, isDate, pa, calendar)) digit = nextDigit;\n        else break;\n    }\n    return digit;\n}\n\n/*\n * Find the largest digit that *definitely* changes in a region [v, v + dv] for any v\n * for nonuniform date regions (months/years) pick the largest\n */\nfunction biggestGuaranteedDigitChanged(dv, isDate) {\n    if(isDate && dv > oneSec) {\n        // this is supposed to be the biggest *guaranteed* change\n        // so compare to the longest month and year across any calendar,\n        // and we'll iterate back up later\n        // note: does not support rounding larger than one year. We could add\n        // that if anyone wants it, but seems unusual and not strictly necessary.\n        if(dv > oneDay) {\n            if(dv > oneYear * 1.1) return oneYear;\n            if(dv > oneMonth * 1.1) return oneMonth;\n            return oneDay;\n        }\n\n        if(dv > oneHour) return oneHour;\n        if(dv > oneMin) return oneMin;\n        return oneSec;\n    }\n    return Math.pow(10, Math.floor(Math.log(dv) / Math.LN10));\n}\n\nfunction didDigitChange(digit, v1, v2, isDate, pa, calendar) {\n    if(isDate && digit > oneDay) {\n        var dateParts1 = dateParts(v1, pa, calendar);\n        var dateParts2 = dateParts(v2, pa, calendar);\n        var parti = (digit === oneYear) ? 0 : 1;\n        return dateParts1[parti] !== dateParts2[parti];\n    }\n    return Math.floor(v2 / digit) - Math.floor(v1 / digit) > 0.1;\n}\n\nfunction dateParts(v, pa, calendar) {\n    var parts = pa.c2d(v, oneYear, calendar).split('-');\n    if(parts[0] === '') {\n        parts.unshift();\n        parts[0] = '-' + parts[0];\n    }\n    return parts;\n}\n\n},{\"../../constants/numerical\":158,\"../../plots/cartesian/axes\":222}],350:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar arraysToCalcdata = _dereq_('../bar/arrays_to_calcdata');\nvar binFunctions = _dereq_('./bin_functions');\nvar normFunctions = _dereq_('./norm_functions');\nvar doAvg = _dereq_('./average');\nvar getBinSpanLabelRound = _dereq_('./bin_label_vals');\n\nfunction calc(gd, trace) {\n    var pos = [];\n    var size = [];\n    var pa = Axes.getFromId(gd, trace.orientation === 'h' ? trace.yaxis : trace.xaxis);\n    var mainData = trace.orientation === 'h' ? 'y' : 'x';\n    var counterData = {x: 'y', y: 'x'}[mainData];\n    var calendar = trace[mainData + 'calendar'];\n    var cumulativeSpec = trace.cumulative;\n    var i;\n\n    var binsAndPos = calcAllAutoBins(gd, trace, pa, mainData);\n    var binSpec = binsAndPos[0];\n    var pos0 = binsAndPos[1];\n\n    var nonuniformBins = typeof binSpec.size === 'string';\n    var binEdges = [];\n    var bins = nonuniformBins ? binEdges : binSpec;\n    // make the empty bin array\n    var inc = [];\n    var counts = [];\n    var inputPoints = [];\n    var total = 0;\n    var norm = trace.histnorm;\n    var func = trace.histfunc;\n    var densityNorm = norm.indexOf('density') !== -1;\n    var i2, binEnd, n;\n\n    if(cumulativeSpec.enabled && densityNorm) {\n        // we treat \"cumulative\" like it means \"integral\" if you use a density norm,\n        // which in the end means it's the same as without \"density\"\n        norm = norm.replace(/ ?density$/, '');\n        densityNorm = false;\n    }\n\n    var extremeFunc = func === 'max' || func === 'min';\n    var sizeInit = extremeFunc ? null : 0;\n    var binFunc = binFunctions.count;\n    var normFunc = normFunctions[norm];\n    var isAvg = false;\n    var pr2c = function(v) { return pa.r2c(v, 0, calendar); };\n    var rawCounterData;\n\n    if(Lib.isArrayOrTypedArray(trace[counterData]) && func !== 'count') {\n        rawCounterData = trace[counterData];\n        isAvg = func === 'avg';\n        binFunc = binFunctions[func];\n    }\n\n    // create the bins (and any extra arrays needed)\n    // assume more than 1e6 bins is an error, so we don't crash the browser\n    i = pr2c(binSpec.start);\n\n    // decrease end a little in case of rounding errors\n    binEnd = pr2c(binSpec.end) + (i - Axes.tickIncrement(i, binSpec.size, false, calendar)) / 1e6;\n\n    while(i < binEnd && pos.length < 1e6) {\n        i2 = Axes.tickIncrement(i, binSpec.size, false, calendar);\n        pos.push((i + i2) / 2);\n        size.push(sizeInit);\n        inputPoints.push([]);\n        // nonuniform bins (like months) we need to search,\n        // rather than straight calculate the bin we're in\n        binEdges.push(i);\n        // nonuniform bins also need nonuniform normalization factors\n        if(densityNorm) inc.push(1 / (i2 - i));\n        if(isAvg) counts.push(0);\n        // break to avoid infinite loops\n        if(i2 <= i) break;\n        i = i2;\n    }\n    binEdges.push(i);\n\n    // for date axes we need bin bounds to be calcdata. For nonuniform bins\n    // we already have this, but uniform with start/end/size they're still strings.\n    if(!nonuniformBins && pa.type === 'date') {\n        bins = {\n            start: pr2c(bins.start),\n            end: pr2c(bins.end),\n            size: bins.size\n        };\n    }\n\n    // stash left and right gaps by group\n    if(!gd._fullLayout._roundFnOpts) gd._fullLayout._roundFnOpts = {};\n    var groupName = trace['_' + mainData + 'bingroup'];\n    var roundFnOpts = {leftGap: Infinity, rightGap: Infinity};\n    if(groupName) {\n        if(!gd._fullLayout._roundFnOpts[groupName]) gd._fullLayout._roundFnOpts[groupName] = roundFnOpts;\n        roundFnOpts = gd._fullLayout._roundFnOpts[groupName];\n    }\n\n    // bin the data\n    // and make histogram-specific pt-number-to-cd-index map object\n    var nMax = size.length;\n    var uniqueValsPerBin = true;\n    var leftGap = roundFnOpts.leftGap;\n    var rightGap = roundFnOpts.rightGap;\n    var ptNumber2cdIndex = {};\n    for(i = 0; i < pos0.length; i++) {\n        var posi = pos0[i];\n        n = Lib.findBin(posi, bins);\n        if(n >= 0 && n < nMax) {\n            total += binFunc(n, i, size, rawCounterData, counts);\n            if(uniqueValsPerBin && inputPoints[n].length && posi !== pos0[inputPoints[n][0]]) {\n                uniqueValsPerBin = false;\n            }\n            inputPoints[n].push(i);\n            ptNumber2cdIndex[i] = n;\n\n            leftGap = Math.min(leftGap, posi - binEdges[n]);\n            rightGap = Math.min(rightGap, binEdges[n + 1] - posi);\n        }\n    }\n    roundFnOpts.leftGap = leftGap;\n    roundFnOpts.rightGap = rightGap;\n\n    var roundFn;\n    if(!uniqueValsPerBin) {\n        roundFn = function(v, isRightEdge) {\n            return function() {\n                var roundFnOpts = gd._fullLayout._roundFnOpts[groupName];\n                return getBinSpanLabelRound(\n                    roundFnOpts.leftGap,\n                    roundFnOpts.rightGap,\n                    binEdges, pa, calendar\n                )(v, isRightEdge);\n            };\n        };\n    }\n\n    // average and/or normalize the data, if needed\n    if(isAvg) total = doAvg(size, counts);\n    if(normFunc) normFunc(size, total, inc);\n\n    // after all normalization etc, now we can accumulate if desired\n    if(cumulativeSpec.enabled) cdf(size, cumulativeSpec.direction, cumulativeSpec.currentbin);\n\n    var seriesLen = Math.min(pos.length, size.length);\n    var cd = [];\n    var firstNonzero = 0;\n    var lastNonzero = seriesLen - 1;\n\n    // look for empty bins at the ends to remove, so autoscale omits them\n    for(i = 0; i < seriesLen; i++) {\n        if(size[i]) {\n            firstNonzero = i;\n            break;\n        }\n    }\n    for(i = seriesLen - 1; i >= firstNonzero; i--) {\n        if(size[i]) {\n            lastNonzero = i;\n            break;\n        }\n    }\n\n    // create the \"calculated data\" to plot\n    for(i = firstNonzero; i <= lastNonzero; i++) {\n        if((isNumeric(pos[i]) && isNumeric(size[i]))) {\n            var cdi = {\n                p: pos[i],\n                s: size[i],\n                b: 0\n            };\n\n            // setup hover and event data fields,\n            // N.B. pts and \"hover\" positions ph0/ph1 don't seem to make much sense\n            // for cumulative distributions\n            if(!cumulativeSpec.enabled) {\n                cdi.pts = inputPoints[i];\n                if(uniqueValsPerBin) {\n                    cdi.ph0 = cdi.ph1 = (inputPoints[i].length) ? pos0[inputPoints[i][0]] : pos[i];\n                } else {\n                    // Defer evaluation of ph(0|1) in crossTraceCalc\n                    trace._computePh = true;\n                    cdi.ph0 = roundFn(binEdges[i]);\n                    cdi.ph1 = roundFn(binEdges[i + 1], true);\n                }\n            }\n            cd.push(cdi);\n        }\n    }\n\n    if(cd.length === 1) {\n        // when we collapse to a single bin, calcdata no longer describes bin size\n        // so we need to explicitly specify it\n        cd[0].width1 = Axes.tickIncrement(cd[0].p, binSpec.size, false, calendar) - cd[0].p;\n    }\n\n    arraysToCalcdata(cd, trace);\n\n    if(Lib.isArrayOrTypedArray(trace.selectedpoints)) {\n        Lib.tagSelected(cd, trace, ptNumber2cdIndex);\n    }\n\n    return cd;\n}\n\n/*\n * calcAllAutoBins: we want all histograms inside the same bingroup\n * (see logic in Histogram.crossTraceDefaults) to share bin specs\n *\n * If the user has explicitly specified differing\n * bin specs, there's nothing we can do, but if possible we will try to use the\n * smallest bins of any of the auto values for all histograms inside the same\n * bingroup.\n */\nfunction calcAllAutoBins(gd, trace, pa, mainData, _overlayEdgeCase) {\n    var binAttr = mainData + 'bins';\n    var fullLayout = gd._fullLayout;\n    var groupName = trace['_' + mainData + 'bingroup'];\n    var binOpts = fullLayout._histogramBinOpts[groupName];\n    var isOverlay = fullLayout.barmode === 'overlay';\n    var i, traces, tracei, calendar, pos0, autoVals, cumulativeSpec;\n\n    var r2c = function(v) { return pa.r2c(v, 0, calendar); };\n    var c2r = function(v) { return pa.c2r(v, 0, calendar); };\n\n    var cleanBound = pa.type === 'date' ?\n        function(v) { return (v || v === 0) ? Lib.cleanDate(v, null, calendar) : null; } :\n        function(v) { return isNumeric(v) ? Number(v) : null; };\n\n    function setBound(attr, bins, newBins) {\n        if(bins[attr + 'Found']) {\n            bins[attr] = cleanBound(bins[attr]);\n            if(bins[attr] === null) bins[attr] = newBins[attr];\n        } else {\n            autoVals[attr] = bins[attr] = newBins[attr];\n            Lib.nestedProperty(traces[0], binAttr + '.' + attr).set(newBins[attr]);\n        }\n    }\n\n    // all but the first trace in this group has already been marked finished\n    // clear this flag, so next time we run calc we will run autobin again\n    if(trace['_' + mainData + 'autoBinFinished']) {\n        delete trace['_' + mainData + 'autoBinFinished'];\n    } else {\n        traces = binOpts.traces;\n        var allPos = [];\n\n        // Note: we're including `legendonly` traces here for autobin purposes,\n        // so that showing & hiding from the legend won't affect bins.\n        // But this complicates things a bit since those traces don't `calc`,\n        // hence `isFirstVisible`.\n        var isFirstVisible = true;\n        var has2dMap = false;\n        var hasHist2dContour = false;\n        for(i = 0; i < traces.length; i++) {\n            tracei = traces[i];\n\n            if(tracei.visible) {\n                var mainDatai = binOpts.dirs[i];\n                pos0 = tracei['_' + mainDatai + 'pos0'] = pa.makeCalcdata(tracei, mainDatai);\n\n                allPos = Lib.concat(allPos, pos0);\n                delete tracei['_' + mainData + 'autoBinFinished'];\n\n                if(trace.visible === true) {\n                    if(isFirstVisible) {\n                        isFirstVisible = false;\n                    } else {\n                        delete tracei._autoBin;\n                        tracei['_' + mainData + 'autoBinFinished'] = 1;\n                    }\n                    if(Registry.traceIs(tracei, '2dMap')) {\n                        has2dMap = true;\n                    }\n                    if(tracei.type === 'histogram2dcontour') {\n                        hasHist2dContour = true;\n                    }\n                }\n            }\n        }\n\n        calendar = traces[0][mainData + 'calendar'];\n        var newBinSpec = Axes.autoBin(allPos, pa, binOpts.nbins, has2dMap, calendar, binOpts.sizeFound && binOpts.size);\n\n        var autoBin = traces[0]._autoBin = {};\n        autoVals = autoBin[binOpts.dirs[0]] = {};\n\n        if(hasHist2dContour) {\n            // the \"true\" 2nd argument reverses the tick direction (which we can't\n            // just do with a minus sign because of month bins)\n            if(!binOpts.size) {\n                newBinSpec.start = c2r(Axes.tickIncrement(\n                    r2c(newBinSpec.start), newBinSpec.size, true, calendar));\n            }\n            if(binOpts.end === undefined) {\n                newBinSpec.end = c2r(Axes.tickIncrement(\n                    r2c(newBinSpec.end), newBinSpec.size, false, calendar));\n            }\n        }\n\n        // Edge case: single-valued histogram overlaying others\n        // Use them all together to calculate the bin size for the single-valued one\n        if(isOverlay && !Registry.traceIs(trace, '2dMap') && newBinSpec._dataSpan === 0 &&\n            pa.type !== 'category' && pa.type !== 'multicategory') {\n            // Several single-valued histograms! Stop infinite recursion,\n            // just return an extra flag that tells handleSingleValueOverlays\n            // to sort out this trace too\n            if(_overlayEdgeCase) return [newBinSpec, pos0, true];\n\n            newBinSpec = handleSingleValueOverlays(gd, trace, pa, mainData, binAttr);\n        }\n\n        // adjust for CDF edge cases\n        cumulativeSpec = tracei.cumulative || {};\n        if(cumulativeSpec.enabled && (cumulativeSpec.currentbin !== 'include')) {\n            if(cumulativeSpec.direction === 'decreasing') {\n                newBinSpec.start = c2r(Axes.tickIncrement(\n                    r2c(newBinSpec.start), newBinSpec.size, true, calendar));\n            } else {\n                newBinSpec.end = c2r(Axes.tickIncrement(\n                    r2c(newBinSpec.end), newBinSpec.size, false, calendar));\n            }\n        }\n\n        binOpts.size = newBinSpec.size;\n        if(!binOpts.sizeFound) {\n            autoVals.size = newBinSpec.size;\n            Lib.nestedProperty(traces[0], binAttr + '.size').set(newBinSpec.size);\n        }\n\n        setBound('start', binOpts, newBinSpec);\n        setBound('end', binOpts, newBinSpec);\n    }\n\n    pos0 = trace['_' + mainData + 'pos0'];\n    delete trace['_' + mainData + 'pos0'];\n\n    // Each trace can specify its own start/end, or if omitted\n    // we ensure they're beyond the bounds of this trace's data,\n    // and we need to make sure start is aligned with the main start\n    var traceInputBins = trace._input[binAttr] || {};\n    var traceBinOptsCalc = Lib.extendFlat({}, binOpts);\n    var mainStart = binOpts.start;\n    var startIn = pa.r2l(traceInputBins.start);\n    var hasStart = startIn !== undefined;\n    if((binOpts.startFound || hasStart) && startIn !== pa.r2l(mainStart)) {\n        // We have an explicit start to reconcile across traces\n        // if this trace has an explicit start, shift it down to a bin edge\n        // if another trace had an explicit start, shift it down to a\n        // bin edge past our data\n        var traceStart = hasStart ?\n            startIn :\n            Lib.aggNums(Math.min, null, pos0);\n\n        var dummyAx = {\n            type: (pa.type === 'category' || pa.type === 'multicategory') ? 'linear' : pa.type,\n            r2l: pa.r2l,\n            dtick: binOpts.size,\n            tick0: mainStart,\n            calendar: calendar,\n            range: ([traceStart, Axes.tickIncrement(traceStart, binOpts.size, false, calendar)]).map(pa.l2r)\n        };\n        var newStart = Axes.tickFirst(dummyAx);\n        if(newStart > pa.r2l(traceStart)) {\n            newStart = Axes.tickIncrement(newStart, binOpts.size, true, calendar);\n        }\n        traceBinOptsCalc.start = pa.l2r(newStart);\n        if(!hasStart) Lib.nestedProperty(trace, binAttr + '.start').set(traceBinOptsCalc.start);\n    }\n\n    var mainEnd = binOpts.end;\n    var endIn = pa.r2l(traceInputBins.end);\n    var hasEnd = endIn !== undefined;\n    if((binOpts.endFound || hasEnd) && endIn !== pa.r2l(mainEnd)) {\n        // Reconciling an explicit end is easier, as it doesn't need to\n        // match bin edges\n        var traceEnd = hasEnd ?\n            endIn :\n            Lib.aggNums(Math.max, null, pos0);\n\n        traceBinOptsCalc.end = pa.l2r(traceEnd);\n        if(!hasEnd) Lib.nestedProperty(trace, binAttr + '.start').set(traceBinOptsCalc.end);\n    }\n\n    // Backward compatibility for one-time autobinning.\n    // autobin: true is handled in cleanData, but autobin: false\n    // needs to be here where we have determined the values.\n    var autoBinAttr = 'autobin' + mainData;\n    if(trace._input[autoBinAttr] === false) {\n        trace._input[binAttr] = Lib.extendFlat({}, trace[binAttr] || {});\n        delete trace._input[autoBinAttr];\n        delete trace[autoBinAttr];\n    }\n\n    return [traceBinOptsCalc, pos0];\n}\n\n/*\n * Adjust single-value histograms in overlay mode to make as good a\n * guess as we can at autobin values the user would like.\n *\n * Returns the binSpec for the trace that sparked all this\n */\nfunction handleSingleValueOverlays(gd, trace, pa, mainData, binAttr) {\n    var fullLayout = gd._fullLayout;\n    var overlaidTraceGroup = getConnectedHistograms(gd, trace);\n    var pastThisTrace = false;\n    var minSize = Infinity;\n    var singleValuedTraces = [trace];\n    var i, tracei, binOpts;\n\n    // first collect all the:\n    // - min bin size from all multi-valued traces\n    // - single-valued traces\n    for(i = 0; i < overlaidTraceGroup.length; i++) {\n        tracei = overlaidTraceGroup[i];\n\n        if(tracei === trace) {\n            pastThisTrace = true;\n        } else if(!pastThisTrace) {\n            // This trace has already had its autobins calculated, so either:\n            // - it is part of a bingroup\n            // - it is NOT a single-valued trace\n            binOpts = fullLayout._histogramBinOpts[tracei['_' + mainData + 'bingroup']];\n            minSize = Math.min(minSize, binOpts.size || tracei[binAttr].size);\n        } else {\n            var resulti = calcAllAutoBins(gd, tracei, pa, mainData, true);\n            var binSpeci = resulti[0];\n            var isSingleValued = resulti[2];\n\n            // so we can use this result when we get to tracei in the normal\n            // course of events, mark it as done and put _pos0 back\n            tracei['_' + mainData + 'autoBinFinished'] = 1;\n            tracei['_' + mainData + 'pos0'] = resulti[1];\n\n            if(isSingleValued) {\n                singleValuedTraces.push(tracei);\n            } else {\n                minSize = Math.min(minSize, binSpeci.size);\n            }\n        }\n    }\n\n    // find the real data values for each single-valued trace\n    // hunt through pos0 for the first valid value\n    var dataVals = new Array(singleValuedTraces.length);\n    for(i = 0; i < singleValuedTraces.length; i++) {\n        var pos0 = singleValuedTraces[i]['_' + mainData + 'pos0'];\n        for(var j = 0; j < pos0.length; j++) {\n            if(pos0[j] !== undefined) {\n                dataVals[i] = pos0[j];\n                break;\n            }\n        }\n    }\n\n    // are ALL traces are single-valued? use the min difference between\n    // all of their values (which defaults to 1 if there's still only one)\n    if(!isFinite(minSize)) {\n        minSize = Lib.distinctVals(dataVals).minDiff;\n    }\n\n    // now apply the min size we found to all single-valued traces\n    for(i = 0; i < singleValuedTraces.length; i++) {\n        tracei = singleValuedTraces[i];\n        var calendar = tracei[mainData + 'calendar'];\n\n        var newBins = {\n            start: pa.c2r(dataVals[i] - minSize / 2, 0, calendar),\n            end: pa.c2r(dataVals[i] + minSize / 2, 0, calendar),\n            size: minSize\n        };\n\n        tracei._input[binAttr] = tracei[binAttr] = newBins;\n\n        binOpts = fullLayout._histogramBinOpts[tracei['_' + mainData + 'bingroup']];\n        if(binOpts) Lib.extendFlat(binOpts, newBins);\n    }\n\n    return trace[binAttr];\n}\n\n/*\n * Return an array of histograms that share axes and orientation.\n *\n * Only considers histograms. In principle we could include bars in a\n * similar way to how we do manually binned histograms, though this\n * would have tons of edge cases and value judgments to make.\n */\nfunction getConnectedHistograms(gd, trace) {\n    var xid = trace.xaxis;\n    var yid = trace.yaxis;\n    var orientation = trace.orientation;\n\n    var out = [];\n    var fullData = gd._fullData;\n    for(var i = 0; i < fullData.length; i++) {\n        var tracei = fullData[i];\n        if(tracei.type === 'histogram' &&\n            tracei.visible === true &&\n            tracei.orientation === orientation &&\n            tracei.xaxis === xid && tracei.yaxis === yid\n        ) {\n            out.push(tracei);\n        }\n    }\n\n    return out;\n}\n\nfunction cdf(size, direction, currentBin) {\n    var i, vi, prevSum;\n\n    function firstHalfPoint(i) {\n        prevSum = size[i];\n        size[i] /= 2;\n    }\n\n    function nextHalfPoint(i) {\n        vi = size[i];\n        size[i] = prevSum + vi / 2;\n        prevSum += vi;\n    }\n\n    if(currentBin === 'half') {\n        if(direction === 'increasing') {\n            firstHalfPoint(0);\n            for(i = 1; i < size.length; i++) {\n                nextHalfPoint(i);\n            }\n        } else {\n            firstHalfPoint(size.length - 1);\n            for(i = size.length - 2; i >= 0; i--) {\n                nextHalfPoint(i);\n            }\n        }\n    } else if(direction === 'increasing') {\n        for(i = 1; i < size.length; i++) {\n            size[i] += size[i - 1];\n        }\n\n        // 'exclude' is identical to 'include' just shifted one bin over\n        if(currentBin === 'exclude') {\n            size.unshift(0);\n            size.pop();\n        }\n    } else {\n        for(i = size.length - 2; i >= 0; i--) {\n            size[i] += size[i + 1];\n        }\n\n        if(currentBin === 'exclude') {\n            size.push(0);\n            size.shift();\n        }\n    }\n}\n\nmodule.exports = {\n    calc: calc,\n    calcAllAutoBins: calcAllAutoBins\n};\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../../registry\":269,\"../bar/arrays_to_calcdata\":278,\"./average\":346,\"./bin_functions\":348,\"./bin_label_vals\":349,\"./norm_functions\":357,\"fast-isnumeric\":18}],351:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n    eventDataKeys: ['binNumber']\n};\n\n},{}],352:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar axisIds = _dereq_('../../plots/cartesian/axis_ids');\n\nvar traceIs = _dereq_('../../registry').traceIs;\nvar handleGroupingDefaults = _dereq_('../bar/defaults').handleGroupingDefaults;\n\nvar nestedProperty = Lib.nestedProperty;\nvar getAxisGroup = axisIds.getAxisGroup;\n\nvar BINATTRS = [\n    {aStr: {x: 'xbins.start', y: 'ybins.start'}, name: 'start'},\n    {aStr: {x: 'xbins.end', y: 'ybins.end'}, name: 'end'},\n    {aStr: {x: 'xbins.size', y: 'ybins.size'}, name: 'size'},\n    {aStr: {x: 'nbinsx', y: 'nbinsy'}, name: 'nbins'}\n];\n\nvar BINDIRECTIONS = ['x', 'y'];\n\n// handle bin attrs and relink auto-determined values so fullData is complete\nmodule.exports = function crossTraceDefaults(fullData, fullLayout) {\n    var allBinOpts = fullLayout._histogramBinOpts = {};\n    var histTraces = [];\n    var mustMatchTracesLookup = {};\n    var otherTracesList = [];\n\n    var traceOut, traces, groupName, binDir;\n    var i, j, k;\n\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceOut._input, traceOut, traceOut._module.attributes, attr, dflt);\n    }\n\n    function orientation2binDir(traceOut) {\n        return traceOut.orientation === 'v' ? 'x' : 'y';\n    }\n\n    function getAxisType(traceOut, binDir) {\n        var ax = axisIds.getFromTrace({_fullLayout: fullLayout}, traceOut, binDir);\n        return ax.type;\n    }\n\n    function fillBinOpts(traceOut, groupName, binDir) {\n        // N.B. group traces that don't have a bingroup with themselves\n        var fallbackGroupName = traceOut.uid + '__' + binDir;\n        if(!groupName) groupName = fallbackGroupName;\n\n        var axType = getAxisType(traceOut, binDir);\n        var calendar = traceOut[binDir + 'calendar'] || '';\n        var binOpts = allBinOpts[groupName];\n        var needsNewItem = true;\n\n        if(binOpts) {\n            if(axType === binOpts.axType && calendar === binOpts.calendar) {\n                needsNewItem = false;\n                binOpts.traces.push(traceOut);\n                binOpts.dirs.push(binDir);\n            } else {\n                groupName = fallbackGroupName;\n\n                if(axType !== binOpts.axType) {\n                    Lib.warn([\n                        'Attempted to group the bins of trace', traceOut.index,\n                        'set on a', 'type:' + axType, 'axis',\n                        'with bins on', 'type:' + binOpts.axType, 'axis.'\n                    ].join(' '));\n                }\n                if(calendar !== binOpts.calendar) {\n                    // prohibit bingroup for traces using different calendar,\n                    // there's probably a way to make this work, but skip for now\n                    Lib.warn([\n                        'Attempted to group the bins of trace', traceOut.index,\n                        'set with a', calendar, 'calendar',\n                        'with bins',\n                        (binOpts.calendar ? 'on a ' + binOpts.calendar + ' calendar' : 'w/o a set calendar')\n                    ].join(' '));\n                }\n            }\n        }\n\n        if(needsNewItem) {\n            allBinOpts[groupName] = {\n                traces: [traceOut],\n                dirs: [binDir],\n                axType: axType,\n                calendar: traceOut[binDir + 'calendar'] || ''\n            };\n        }\n        traceOut['_' + binDir + 'bingroup'] = groupName;\n    }\n\n    for(i = 0; i < fullData.length; i++) {\n        traceOut = fullData[i];\n\n        if(traceIs(traceOut, 'histogram')) {\n            histTraces.push(traceOut);\n\n            // TODO: this shouldn't be relinked as it's only used within calc\n            // https://github.com/plotly/plotly.js/issues/749\n            delete traceOut._xautoBinFinished;\n            delete traceOut._yautoBinFinished;\n\n            // N.B. need to coerce *alignmentgroup* before *bingroup*, as traces\n            // in same alignmentgroup \"have to match\"\n            if(!traceIs(traceOut, '2dMap')) {\n                handleGroupingDefaults(traceOut._input, traceOut, fullLayout, coerce);\n            }\n        }\n    }\n\n    var alignmentOpts = fullLayout._alignmentOpts || {};\n\n    // Look for traces that \"have to match\", that is:\n    // - 1d histogram traces on the same subplot with same orientation under barmode:stack,\n    // - 1d histogram traces on the same subplot with same orientation under barmode:group\n    // - 1d histogram traces on the same position axis with the same orientation\n    //   and the same *alignmentgroup* (coerced under barmode:group)\n    // - Once `stackgroup` gets implemented (see https://github.com/plotly/plotly.js/issues/3614),\n    //   traces within the same stackgroup will also \"have to match\"\n    for(i = 0; i < histTraces.length; i++) {\n        traceOut = histTraces[i];\n        groupName = '';\n\n        if(!traceIs(traceOut, '2dMap')) {\n            binDir = orientation2binDir(traceOut);\n\n            if(fullLayout.barmode === 'group' && traceOut.alignmentgroup) {\n                var pa = traceOut[binDir + 'axis'];\n                var aGroupId = getAxisGroup(fullLayout, pa) + traceOut.orientation;\n                if((alignmentOpts[aGroupId] || {})[traceOut.alignmentgroup]) {\n                    groupName = aGroupId;\n                }\n            }\n\n            if(!groupName && fullLayout.barmode !== 'overlay') {\n                groupName = (\n                    getAxisGroup(fullLayout, traceOut.xaxis) +\n                    getAxisGroup(fullLayout, traceOut.yaxis) +\n                    orientation2binDir(traceOut)\n                );\n            }\n        }\n\n        if(groupName) {\n            if(!mustMatchTracesLookup[groupName]) {\n                mustMatchTracesLookup[groupName] = [];\n            }\n            mustMatchTracesLookup[groupName].push(traceOut);\n        } else {\n            otherTracesList.push(traceOut);\n        }\n    }\n\n    // Setup binOpts for traces that have to match,\n    // if the traces have a valid bingroup, use that\n    // if not use axis+binDir groupName\n    for(groupName in mustMatchTracesLookup) {\n        traces = mustMatchTracesLookup[groupName];\n\n        // no need to 'force' anything when a single\n        // trace is detected as \"must match\"\n        if(traces.length === 1) {\n            otherTracesList.push(traces[0]);\n            continue;\n        }\n\n        var binGroupFound = false;\n        for(i = 0; i < traces.length; i++) {\n            traceOut = traces[i];\n            binGroupFound = coerce('bingroup');\n            break;\n        }\n\n        groupName = binGroupFound || groupName;\n\n        for(i = 0; i < traces.length; i++) {\n            traceOut = traces[i];\n            var bingroupIn = traceOut._input.bingroup;\n            if(bingroupIn && bingroupIn !== groupName) {\n                Lib.warn([\n                    'Trace', traceOut.index, 'must match',\n                    'within bingroup', groupName + '.',\n                    'Ignoring its bingroup:', bingroupIn, 'setting.'\n                ].join(' '));\n            }\n            traceOut.bingroup = groupName;\n\n            // N.B. no need to worry about 2dMap case\n            // (where both bin direction are set in each trace)\n            // as 2dMap trace never \"have to match\"\n            fillBinOpts(traceOut, groupName, orientation2binDir(traceOut));\n        }\n    }\n\n    // setup binOpts for traces that can but don't have to match,\n    // notice that these traces can be matched with traces that have to match\n    for(i = 0; i < otherTracesList.length; i++) {\n        traceOut = otherTracesList[i];\n\n        var binGroup = coerce('bingroup');\n\n        if(traceIs(traceOut, '2dMap')) {\n            for(k = 0; k < 2; k++) {\n                binDir = BINDIRECTIONS[k];\n                var binGroupInDir = coerce(binDir + 'bingroup',\n                    binGroup ? binGroup + '__' + binDir : null\n                );\n                fillBinOpts(traceOut, binGroupInDir, binDir);\n            }\n        } else {\n            fillBinOpts(traceOut, binGroup, orientation2binDir(traceOut));\n        }\n    }\n\n    // coerce bin attrs!\n    for(groupName in allBinOpts) {\n        var binOpts = allBinOpts[groupName];\n        traces = binOpts.traces;\n\n        for(j = 0; j < BINATTRS.length; j++) {\n            var attrSpec = BINATTRS[j];\n            var attr = attrSpec.name;\n            var aStr;\n            var autoVals;\n\n            // nbins(x|y) is moot if we have a size. This depends on\n            // nbins coming after size in binAttrs.\n            if(attr === 'nbins' && binOpts.sizeFound) continue;\n\n            for(i = 0; i < traces.length; i++) {\n                traceOut = traces[i];\n                binDir = binOpts.dirs[i];\n                aStr = attrSpec.aStr[binDir];\n\n                if(nestedProperty(traceOut._input, aStr).get() !== undefined) {\n                    binOpts[attr] = coerce(aStr);\n                    binOpts[attr + 'Found'] = true;\n                    break;\n                }\n\n                autoVals = (traceOut._autoBin || {})[binDir] || {};\n                if(autoVals[attr]) {\n                    // if this is the *first* autoval\n                    nestedProperty(traceOut, aStr).set(autoVals[attr]);\n                }\n            }\n\n            // start and end we need to coerce anyway, after having collected the\n            // first of each into binOpts, in case a trace wants to restrict its\n            // data to a certain range\n            if(attr === 'start' || attr === 'end') {\n                for(; i < traces.length; i++) {\n                    traceOut = traces[i];\n                    if(traceOut['_' + binDir + 'bingroup']) {\n                        autoVals = (traceOut._autoBin || {})[binDir] || {};\n                        coerce(aStr, autoVals[attr]);\n                    }\n                }\n            }\n\n            if(attr === 'nbins' && !binOpts.sizeFound && !binOpts.nbinsFound) {\n                traceOut = traces[0];\n                binOpts[attr] = coerce(aStr);\n            }\n        }\n    }\n};\n\n},{\"../../lib\":178,\"../../plots/cartesian/axis_ids\":225,\"../../registry\":269,\"../bar/defaults\":283}],353:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\n\nvar handleStyleDefaults = _dereq_('../bar/style_defaults');\nvar attributes = _dereq_('./attributes');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    var x = coerce('x');\n    var y = coerce('y');\n\n    var cumulative = coerce('cumulative.enabled');\n    if(cumulative) {\n        coerce('cumulative.direction');\n        coerce('cumulative.currentbin');\n    }\n\n    coerce('text');\n    coerce('hovertext');\n    coerce('hovertemplate');\n\n    var orientation = coerce('orientation', (y && !x) ? 'h' : 'v');\n    var sampleLetter = orientation === 'v' ? 'x' : 'y';\n    var aggLetter = orientation === 'v' ? 'y' : 'x';\n\n    var len = (x && y) ?\n        Math.min(Lib.minRowLength(x) && Lib.minRowLength(y)) :\n        Lib.minRowLength(traceOut[sampleLetter] || []);\n\n    if(!len) {\n        traceOut.visible = false;\n        return;\n    }\n\n    traceOut._length = len;\n\n    var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n    handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n\n    var hasAggregationData = traceOut[aggLetter];\n    if(hasAggregationData) coerce('histfunc');\n    coerce('histnorm');\n\n    // Note: bin defaults are now handled in Histogram.crossTraceDefaults\n    // autobin(x|y) are only included here to appease Plotly.validate\n    coerce('autobin' + sampleLetter);\n\n    handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout);\n\n    Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n\n    var lineColor = (traceOut.marker.line || {}).color;\n\n    // override defaultColor for error bars with defaultLine\n    var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');\n    errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'y'});\n    errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'});\n};\n\n},{\"../../components/color\":52,\"../../lib\":178,\"../../registry\":269,\"../bar/style_defaults\":294,\"./attributes\":345}],354:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt, trace, cd, pointNumber) {\n    // standard cartesian event data\n    out.x = 'xVal' in pt ? pt.xVal : pt.x;\n    out.y = 'yVal' in pt ? pt.yVal : pt.y;\n\n    // for 2d histograms\n    if('zLabelVal' in pt) out.z = pt.zLabelVal;\n\n    if(pt.xa) out.xaxis = pt.xa;\n    if(pt.ya) out.yaxis = pt.ya;\n\n    // specific to histogram - CDFs do not have pts (yet?)\n    if(!(trace.cumulative || {}).enabled) {\n        var pts = Array.isArray(pointNumber) ?\n            cd[0].pts[pointNumber[0]][pointNumber[1]] :\n            cd[pointNumber].pts;\n\n        out.pointNumbers = pts;\n        out.binNumber = out.pointNumber;\n        delete out.pointNumber;\n        delete out.pointIndex;\n\n        var pointIndices;\n        if(trace._indexToPoints) {\n            pointIndices = [];\n            for(var i = 0; i < pts.length; i++) {\n                pointIndices = pointIndices.concat(trace._indexToPoints[pts[i]]);\n            }\n        } else {\n            pointIndices = pts;\n        }\n\n        out.pointIndices = pointIndices;\n    }\n\n    return out;\n};\n\n},{}],355:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar barHover = _dereq_('../bar/hover').hoverPoints;\nvar hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n    var pts = barHover(pointData, xval, yval, hovermode);\n\n    if(!pts) return;\n\n    pointData = pts[0];\n    var di = pointData.cd[pointData.index];\n    var trace = pointData.cd[0].trace;\n\n    if(!trace.cumulative.enabled) {\n        var posLetter = trace.orientation === 'h' ? 'y' : 'x';\n\n        pointData[posLetter + 'Label'] = hoverLabelText(pointData[posLetter + 'a'], di.ph0, di.ph1);\n    }\n\n    return pts;\n};\n\n},{\"../../plots/cartesian/axes\":222,\"../bar/hover\":286}],356:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Histogram has its own attribute, defaults and calc steps,\n * but uses bar's plot to display\n * and bar's crossTraceCalc (formerly known as setPositions) for stacking and grouping\n */\n\n/**\n * histogram errorBarsOK is debatable, but it's put in for backward compat.\n * there are use cases for it - sqrt for a simple histogram works right now,\n * constant and % work but they're not so meaningful. I guess it could be cool\n * to allow quadrature combination of errors in summed histograms...\n */\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    layoutAttributes: _dereq_('../bar/layout_attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    crossTraceDefaults: _dereq_('./cross_trace_defaults'),\n    supplyLayoutDefaults: _dereq_('../bar/layout_defaults'),\n    calc: _dereq_('./calc').calc,\n    crossTraceCalc: _dereq_('../bar/cross_trace_calc').crossTraceCalc,\n    plot: _dereq_('../bar/plot').plot,\n    layerName: 'barlayer',\n    style: _dereq_('../bar/style').style,\n    styleOnSelect: _dereq_('../bar/style').styleOnSelect,\n    colorbar: _dereq_('../scatter/marker_colorbar'),\n    hoverPoints: _dereq_('./hover'),\n    selectPoints: _dereq_('../bar/select'),\n    eventData: _dereq_('./event_data'),\n\n    moduleType: 'trace',\n    name: 'histogram',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['bar-like', 'cartesian', 'svg', 'bar', 'histogram', 'oriented', 'errorBarsOK', 'showLegend'],\n    meta: {\n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"../bar/cross_trace_calc\":282,\"../bar/layout_attributes\":288,\"../bar/layout_defaults\":289,\"../bar/plot\":290,\"../bar/select\":291,\"../bar/style\":293,\"../scatter/marker_colorbar\":407,\"./attributes\":345,\"./calc\":350,\"./cross_trace_defaults\":352,\"./defaults\":353,\"./event_data\":354,\"./hover\":355}],357:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = {\n    percent: function(size, total) {\n        var nMax = size.length;\n        var norm = 100 / total;\n        for(var n = 0; n < nMax; n++) size[n] *= norm;\n    },\n    probability: function(size, total) {\n        var nMax = size.length;\n        for(var n = 0; n < nMax; n++) size[n] /= total;\n    },\n    density: function(size, total, inc, yinc) {\n        var nMax = size.length;\n        yinc = yinc || 1;\n        for(var n = 0; n < nMax; n++) size[n] *= inc[n] * yinc;\n    },\n    'probability density': function(size, total, inc, yinc) {\n        var nMax = size.length;\n        if(yinc) total /= yinc;\n        for(var n = 0; n < nMax; n++) size[n] *= inc[n] / total;\n    }\n};\n\n},{}],358:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar histogramAttrs = _dereq_('../histogram/attributes');\nvar makeBinAttrs = _dereq_('../histogram/bin_attributes');\nvar heatmapAttrs = _dereq_('../heatmap/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat(\n    {\n        x: histogramAttrs.x,\n        y: histogramAttrs.y,\n\n        z: {\n            valType: 'data_array',\n            editType: 'calc',\n            \n        },\n        marker: {\n            color: {\n                valType: 'data_array',\n                editType: 'calc',\n                \n            },\n            editType: 'calc'\n        },\n\n        histnorm: histogramAttrs.histnorm,\n        histfunc: histogramAttrs.histfunc,\n        nbinsx: histogramAttrs.nbinsx,\n        xbins: makeBinAttrs('x'),\n        nbinsy: histogramAttrs.nbinsy,\n        ybins: makeBinAttrs('y'),\n        autobinx: histogramAttrs.autobinx,\n        autobiny: histogramAttrs.autobiny,\n\n        bingroup: extendFlat({}, histogramAttrs.bingroup, {\n            \n        }),\n        xbingroup: extendFlat({}, histogramAttrs.bingroup, {\n            \n        }),\n        ybingroup: extendFlat({}, histogramAttrs.bingroup, {\n            \n        }),\n\n        xgap: heatmapAttrs.xgap,\n        ygap: heatmapAttrs.ygap,\n        zsmooth: heatmapAttrs.zsmooth,\n        zhoverformat: heatmapAttrs.zhoverformat,\n        hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),\n        showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n    },\n    colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})\n);\n\n},{\"../../components/colorscale/attributes\":59,\"../../lib/extend\":173,\"../../plots/attributes\":219,\"../../plots/template_attributes\":264,\"../heatmap/attributes\":330,\"../histogram/attributes\":345,\"../histogram/bin_attributes\":347}],359:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar binFunctions = _dereq_('../histogram/bin_functions');\nvar normFunctions = _dereq_('../histogram/norm_functions');\nvar doAvg = _dereq_('../histogram/average');\nvar getBinSpanLabelRound = _dereq_('../histogram/bin_label_vals');\nvar calcAllAutoBins = _dereq_('../histogram/calc').calcAllAutoBins;\n\nmodule.exports = function calc(gd, trace) {\n    var xa = Axes.getFromId(gd, trace.xaxis);\n    var ya = Axes.getFromId(gd, trace.yaxis);\n\n    var xcalendar = trace.xcalendar;\n    var ycalendar = trace.ycalendar;\n    var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };\n    var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };\n    var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };\n    var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };\n\n    var i, j, n, m;\n\n    // calculate the bins\n    var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');\n    var xBinSpec = xBinsAndPos[0];\n    var xPos0 = xBinsAndPos[1];\n    var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');\n    var yBinSpec = yBinsAndPos[0];\n    var yPos0 = yBinsAndPos[1];\n\n    var serieslen = trace._length;\n    if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);\n    if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);\n\n    // make the empty bin array & scale the map\n    var z = [];\n    var onecol = [];\n    var zerocol = [];\n    var nonuniformBinsX = typeof xBinSpec.size === 'string';\n    var nonuniformBinsY = typeof yBinSpec.size === 'string';\n    var xEdges = [];\n    var yEdges = [];\n    var xbins = nonuniformBinsX ? xEdges : xBinSpec;\n    var ybins = nonuniformBinsY ? yEdges : yBinSpec;\n    var total = 0;\n    var counts = [];\n    var inputPoints = [];\n    var norm = trace.histnorm;\n    var func = trace.histfunc;\n    var densitynorm = norm.indexOf('density') !== -1;\n    var extremefunc = func === 'max' || func === 'min';\n    var sizeinit = extremefunc ? null : 0;\n    var binfunc = binFunctions.count;\n    var normfunc = normFunctions[norm];\n    var doavg = false;\n    var xinc = [];\n    var yinc = [];\n\n    // set a binning function other than count?\n    // for binning functions: check first for 'z',\n    // then 'mc' in case we had a colored scatter plot\n    // and want to transfer these colors to the 2D histo\n    // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?\n    var rawCounterData = ('z' in trace) ?\n        trace.z :\n        (('marker' in trace && Array.isArray(trace.marker.color)) ?\n            trace.marker.color : '');\n    if(rawCounterData && func !== 'count') {\n        doavg = func === 'avg';\n        binfunc = binFunctions[func];\n    }\n\n    // decrease end a little in case of rounding errors\n    var xBinSize = xBinSpec.size;\n    var xBinStart = xr2c(xBinSpec.start);\n    var xBinEnd = xr2c(xBinSpec.end) +\n        (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;\n\n    for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {\n        onecol.push(sizeinit);\n        xEdges.push(i);\n        if(doavg) zerocol.push(0);\n    }\n    xEdges.push(i);\n\n    var nx = onecol.length;\n    var dx = (i - xBinStart) / nx;\n    var x0 = xc2r(xBinStart + dx / 2);\n\n    var yBinSize = yBinSpec.size;\n    var yBinStart = yr2c(yBinSpec.start);\n    var yBinEnd = yr2c(yBinSpec.end) +\n        (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;\n\n    for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {\n        z.push(onecol.slice());\n        yEdges.push(i);\n        var ipCol = new Array(nx);\n        for(j = 0; j < nx; j++) ipCol[j] = [];\n        inputPoints.push(ipCol);\n        if(doavg) counts.push(zerocol.slice());\n    }\n    yEdges.push(i);\n\n    var ny = z.length;\n    var dy = (i - yBinStart) / ny;\n    var y0 = yc2r(yBinStart + dy / 2);\n\n    if(densitynorm) {\n        xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);\n        yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);\n    }\n\n    // for date axes we need bin bounds to be calcdata. For nonuniform bins\n    // we already have this, but uniform with start/end/size they're still strings.\n    if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);\n    if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);\n\n    // put data into bins\n    var uniqueValsPerX = true;\n    var uniqueValsPerY = true;\n    var xVals = new Array(nx);\n    var yVals = new Array(ny);\n    var xGapLow = Infinity;\n    var xGapHigh = Infinity;\n    var yGapLow = Infinity;\n    var yGapHigh = Infinity;\n    for(i = 0; i < serieslen; i++) {\n        var xi = xPos0[i];\n        var yi = yPos0[i];\n        n = Lib.findBin(xi, xbins);\n        m = Lib.findBin(yi, ybins);\n        if(n >= 0 && n < nx && m >= 0 && m < ny) {\n            total += binfunc(n, i, z[m], rawCounterData, counts[m]);\n            inputPoints[m][n].push(i);\n\n            if(uniqueValsPerX) {\n                if(xVals[n] === undefined) xVals[n] = xi;\n                else if(xVals[n] !== xi) uniqueValsPerX = false;\n            }\n            if(uniqueValsPerY) {\n                if(yVals[m] === undefined) yVals[m] = yi;\n                else if(yVals[m] !== yi) uniqueValsPerY = false;\n            }\n\n            xGapLow = Math.min(xGapLow, xi - xEdges[n]);\n            xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);\n            yGapLow = Math.min(yGapLow, yi - yEdges[m]);\n            yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);\n        }\n    }\n    // normalize, if needed\n    if(doavg) {\n        for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);\n    }\n    if(normfunc) {\n        for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);\n    }\n\n    return {\n        x: xPos0,\n        xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),\n        x0: x0,\n        dx: dx,\n        y: yPos0,\n        yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),\n        y0: y0,\n        dy: dy,\n        z: z,\n        pts: inputPoints\n    };\n};\n\nfunction makeIncrements(len, bins, dv, nonuniform) {\n    var out = new Array(len);\n    var i;\n    if(nonuniform) {\n        for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);\n    } else {\n        var inc = 1 / dv;\n        for(i = 0; i < len; i++) out[i] = inc;\n    }\n    return out;\n}\n\nfunction binsToCalc(r2c, bins) {\n    return {\n        start: r2c(bins.start),\n        end: r2c(bins.end),\n        size: bins.size\n    };\n}\n\nfunction getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {\n    var i;\n    var len = edges.length - 1;\n    var out = new Array(len);\n    var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);\n\n    for(i = 0; i < len; i++) {\n        var v = (uniqueVals || [])[i];\n        out[i] = v === undefined ?\n            [roundFn(edges[i]), roundFn(edges[i + 1], true)] :\n            [v, v];\n    }\n    return out;\n}\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../histogram/average\":346,\"../histogram/bin_functions\":348,\"../histogram/bin_label_vals\":349,\"../histogram/calc\":350,\"../histogram/norm_functions\":357}],360:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleSampleDefaults = _dereq_('./sample_defaults');\nvar handleStyleDefaults = _dereq_('../heatmap/style_defaults');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\n\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    handleSampleDefaults(traceIn, traceOut, coerce, layout);\n    if(traceOut.visible === false) return;\n\n    handleStyleDefaults(traceIn, traceOut, coerce, layout);\n    colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});\n    coerce('hovertemplate');\n};\n\n},{\"../../components/colorscale/defaults\":62,\"../../lib\":178,\"../heatmap/style_defaults\":343,\"./attributes\":358,\"./sample_defaults\":363}],361:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar heatmapHover = _dereq_('../heatmap/hover');\nvar hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLayer, contour) {\n    var pts = heatmapHover(pointData, xval, yval, hovermode, hoverLayer, contour);\n\n    if(!pts) return;\n\n    pointData = pts[0];\n    var indices = pointData.index;\n    var ny = indices[0];\n    var nx = indices[1];\n    var cd0 = pointData.cd[0];\n    var xRange = cd0.xRanges[nx];\n    var yRange = cd0.yRanges[ny];\n\n    pointData.xLabel = hoverLabelText(pointData.xa, xRange[0], xRange[1]);\n    pointData.yLabel = hoverLabelText(pointData.ya, yRange[0], yRange[1]);\n\n    return pts;\n};\n\n},{\"../../plots/cartesian/axes\":222,\"../heatmap/hover\":337}],362:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    crossTraceDefaults: _dereq_('../histogram/cross_trace_defaults'),\n    calc: _dereq_('../heatmap/calc'),\n    plot: _dereq_('../heatmap/plot'),\n    layerName: 'heatmaplayer',\n    colorbar: _dereq_('../heatmap/colorbar'),\n    style: _dereq_('../heatmap/style'),\n    hoverPoints: _dereq_('./hover'),\n    eventData: _dereq_('../histogram/event_data'),\n\n    moduleType: 'trace',\n    name: 'histogram2d',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],\n    meta: {\n        \n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"../heatmap/calc\":331,\"../heatmap/colorbar\":333,\"../heatmap/plot\":341,\"../heatmap/style\":342,\"../histogram/cross_trace_defaults\":352,\"../histogram/event_data\":354,\"./attributes\":358,\"./defaults\":360,\"./hover\":361}],363:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {\n    var x = coerce('x');\n    var y = coerce('y');\n    var xlen = Lib.minRowLength(x);\n    var ylen = Lib.minRowLength(y);\n\n    // we could try to accept x0 and dx, etc...\n    // but that's a pretty weird use case.\n    // for now require both x and y explicitly specified.\n    if(!xlen || !ylen) {\n        traceOut.visible = false;\n        return;\n    }\n\n    traceOut._length = Math.min(xlen, ylen);\n\n    var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n    handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n\n    // if marker.color is an array, we can use it in aggregation instead of z\n    var hasAggregationData = coerce('z') || coerce('marker.color');\n\n    if(hasAggregationData) coerce('histfunc');\n    coerce('histnorm');\n\n    // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults\n    // autobin(x|y) are only included here to appease Plotly.validate\n    coerce('autobinx');\n    coerce('autobiny');\n};\n\n},{\"../../lib\":178,\"../../registry\":269}],364:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar histogram2dAttrs = _dereq_('../histogram2d/attributes');\nvar contourAttrs = _dereq_('../contour/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat({\n    x: histogram2dAttrs.x,\n    y: histogram2dAttrs.y,\n    z: histogram2dAttrs.z,\n    marker: histogram2dAttrs.marker,\n\n    histnorm: histogram2dAttrs.histnorm,\n    histfunc: histogram2dAttrs.histfunc,\n    nbinsx: histogram2dAttrs.nbinsx,\n    xbins: histogram2dAttrs.xbins,\n    nbinsy: histogram2dAttrs.nbinsy,\n    ybins: histogram2dAttrs.ybins,\n    autobinx: histogram2dAttrs.autobinx,\n    autobiny: histogram2dAttrs.autobiny,\n\n    bingroup: histogram2dAttrs.bingroup,\n    xbingroup: histogram2dAttrs.xbingroup,\n    ybingroup: histogram2dAttrs.ybingroup,\n\n    autocontour: contourAttrs.autocontour,\n    ncontours: contourAttrs.ncontours,\n    contours: contourAttrs.contours,\n    line: {\n        color: contourAttrs.line.color,\n        width: extendFlat({}, contourAttrs.line.width, {\n            dflt: 0.5,\n            \n        }),\n        dash: contourAttrs.line.dash,\n        smoothing: contourAttrs.line.smoothing,\n        editType: 'plot'\n    },\n    zhoverformat: histogram2dAttrs.zhoverformat,\n    hovertemplate: histogram2dAttrs.hovertemplate\n},\n    colorScaleAttrs('', {\n        cLetter: 'z',\n        editTypeOverride: 'calc'\n    })\n);\n\n},{\"../../components/colorscale/attributes\":59,\"../../lib/extend\":173,\"../contour/attributes\":308,\"../histogram2d/attributes\":358}],365:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleSampleDefaults = _dereq_('../histogram2d/sample_defaults');\nvar handleContoursDefaults = _dereq_('../contour/contours_defaults');\nvar handleStyleDefaults = _dereq_('../contour/style_defaults');\nvar attributes = _dereq_('./attributes');\n\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    function coerce2(attr) {\n        return Lib.coerce2(traceIn, traceOut, attributes, attr);\n    }\n\n    handleSampleDefaults(traceIn, traceOut, coerce, layout);\n    if(traceOut.visible === false) return;\n\n    handleContoursDefaults(traceIn, traceOut, coerce, coerce2);\n    handleStyleDefaults(traceIn, traceOut, coerce, layout);\n    coerce('hovertemplate');\n};\n\n},{\"../../lib\":178,\"../contour/contours_defaults\":315,\"../contour/style_defaults\":329,\"../histogram2d/sample_defaults\":363,\"./attributes\":364}],366:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    crossTraceDefaults: _dereq_('../histogram/cross_trace_defaults'),\n    calc: _dereq_('../contour/calc'),\n    plot: _dereq_('../contour/plot').plot,\n    layerName: 'contourlayer',\n    style: _dereq_('../contour/style'),\n    colorbar: _dereq_('../contour/colorbar'),\n    hoverPoints: _dereq_('../contour/hover'),\n\n    moduleType: 'trace',\n    name: 'histogram2dcontour',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],\n    meta: {\n        \n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"../contour/calc\":309,\"../contour/colorbar\":311,\"../contour/hover\":321,\"../contour/plot\":326,\"../contour/style\":328,\"../histogram/cross_trace_defaults\":352,\"./attributes\":364,\"./defaults\":365}],367:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar colormodel = _dereq_('./constants').colormodel;\n\nvar cm = ['rgb', 'rgba', 'hsl', 'hsla'];\nvar zminDesc = [];\nvar zmaxDesc = [];\nfor(var i = 0; i < cm.length; i++) {\n    zminDesc.push('For the `' + cm[i] + '` colormodel, it is [' + colormodel[cm[i]].min.join(', ') + '].');\n    zmaxDesc.push('For the `' + cm[i] + '` colormodel, it is [' + colormodel[cm[i]].max.join(', ') + '].');\n}\n\nmodule.exports = extendFlat({\n    z: {\n        valType: 'data_array',\n        \n        editType: 'calc',\n        \n    },\n    colormodel: {\n        valType: 'enumerated',\n        values: cm,\n        dflt: 'rgb',\n        \n        editType: 'calc',\n        \n    },\n    zmin: {\n        valType: 'info_array',\n        items: [\n            {valType: 'number', editType: 'calc'},\n            {valType: 'number', editType: 'calc'},\n            {valType: 'number', editType: 'calc'},\n            {valType: 'number', editType: 'calc'}\n        ],\n        \n        editType: 'calc',\n        \n    },\n    zmax: {\n        valType: 'info_array',\n        items: [\n            {valType: 'number', editType: 'calc'},\n            {valType: 'number', editType: 'calc'},\n            {valType: 'number', editType: 'calc'},\n            {valType: 'number', editType: 'calc'}\n        ],\n        \n        editType: 'calc',\n        \n    },\n    x0: {\n        valType: 'any',\n        dflt: 0,\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n    y0: {\n        valType: 'any',\n        dflt: 0,\n        \n        editType: 'calc+clearAxisTypes',\n        \n    },\n    dx: {\n        valType: 'number',\n        dflt: 1,\n        \n        editType: 'calc',\n        \n    },\n    dy: {\n        valType: 'number',\n        dflt: 1,\n        \n        editType: 'calc',\n        \n    },\n    text: {\n        valType: 'data_array',\n        editType: 'plot',\n        \n    },\n    hovertext: {\n        valType: 'data_array',\n        editType: 'plot',\n        \n    },\n    hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n        flags: ['x', 'y', 'z', 'color', 'name', 'text'],\n        dflt: 'x+y+z+text+name'\n    }),\n    hovertemplate: hovertemplateAttrs({}, {\n        keys: ['z', 'color', 'colormodel']\n    }),\n\n    transforms: undefined\n});\n\n},{\"../../lib/extend\":173,\"../../plots/attributes\":219,\"../../plots/template_attributes\":264,\"./constants\":369}],368:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar constants = _dereq_('./constants');\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar maxRowLength = _dereq_('../../lib').maxRowLength;\n\nmodule.exports = function calc(gd, trace) {\n    var xa = Axes.getFromId(gd, trace.xaxis || 'x');\n    var ya = Axes.getFromId(gd, trace.yaxis || 'y');\n\n    var x0 = xa.d2c(trace.x0) - trace.dx / 2;\n    var y0 = ya.d2c(trace.y0) - trace.dy / 2;\n    var h = trace.z.length;\n    var w = maxRowLength(trace.z);\n\n    // Set axis range\n    var i;\n    var xrange = [x0, x0 + w * trace.dx];\n    var yrange = [y0, y0 + h * trace.dy];\n    if(xa && xa.type === 'log') for(i = 0; i < w; i++) xrange.push(x0 + i * trace.dx);\n    if(ya && ya.type === 'log') for(i = 0; i < h; i++) yrange.push(y0 + i * trace.dy);\n    trace._extremes[xa._id] = Axes.findExtremes(xa, xrange);\n    trace._extremes[ya._id] = Axes.findExtremes(ya, yrange);\n    trace._scaler = makeScaler(trace);\n\n    var cd0 = {\n        x0: x0,\n        y0: y0,\n        z: trace.z,\n        w: w,\n        h: h\n    };\n    return [cd0];\n};\n\nfunction scale(zero, ratio, min, max) {\n    return function(c) {\n        return Lib.constrain((c - zero) * ratio, min, max);\n    };\n}\n\nfunction constrain(min, max) {\n    return function(c) { return Lib.constrain(c, min, max);};\n}\n\n// Generate a function to scale color components according to zmin/zmax and the colormodel\nfunction makeScaler(trace) {\n    var colormodel = trace.colormodel;\n    var n = colormodel.length;\n    var cr = constants.colormodel[colormodel];\n\n    trace._sArray = [];\n    // Loop over all color components\n    for(var k = 0; k < n; k++) {\n        if(cr.min[k] !== trace.zmin[k] || cr.max[k] !== trace.zmax[k]) {\n            trace._sArray.push(scale(\n                trace.zmin[k],\n                (cr.max[k] - cr.min[k]) / (trace.zmax[k] - trace.zmin[k]),\n                cr.min[k],\n                cr.max[k]\n            ));\n        } else {\n            trace._sArray.push(constrain(cr.min[k], cr.max[k]));\n        }\n    }\n\n    return function(pixel) {\n        var c = pixel.slice(0, n);\n        for(var k = 0; k < n; k++) {\n            var ck = c[k];\n            if(!isNumeric(ck)) return false;\n            c[k] = trace._sArray[k](ck);\n        }\n        return c;\n    };\n}\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"./constants\":369,\"fast-isnumeric\":18}],369:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    colormodel: {\n        rgb: {\n            min: [0, 0, 0],\n            max: [255, 255, 255],\n            fmt: function(c) {return c.slice(0, 3);},\n            suffix: ['', '', '']\n        },\n        rgba: {\n            min: [0, 0, 0, 0],\n            max: [255, 255, 255, 1],\n            fmt: function(c) {return c.slice(0, 4);},\n            suffix: ['', '', '', '']\n        },\n        hsl: {\n            min: [0, 0, 0],\n            max: [360, 100, 100],\n            fmt: function(c) {\n                var p = c.slice(0, 3);\n                p[1] = p[1] + '%';\n                p[2] = p[2] + '%';\n                return p;\n            },\n            suffix: ['°', '%', '%']\n        },\n        hsla: {\n            min: [0, 0, 0, 0],\n            max: [360, 100, 100, 1],\n            fmt: function(c) {\n                var p = c.slice(0, 4);\n                p[1] = p[1] + '%';\n                p[2] = p[2] + '%';\n                return p;\n            },\n            suffix: ['°', '%', '%', '']\n        }\n    }\n};\n\n},{}],370:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar constants = _dereq_('./constants');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n    var z = coerce('z');\n    if(z === undefined || !z.length || !z[0] || !z[0].length) {\n        traceOut.visible = false;\n        return;\n    }\n\n    coerce('x0');\n    coerce('y0');\n    coerce('dx');\n    coerce('dy');\n    var colormodel = coerce('colormodel');\n\n    coerce('zmin', constants.colormodel[colormodel].min);\n    coerce('zmax', constants.colormodel[colormodel].max);\n\n    coerce('text');\n    coerce('hovertext');\n    coerce('hovertemplate');\n\n    traceOut._length = null;\n};\n\n},{\"../../lib\":178,\"./attributes\":367,\"./constants\":369}],371:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt) {\n    if('xVal' in pt) out.x = pt.xVal;\n    if('yVal' in pt) out.y = pt.yVal;\n    if(pt.xa) out.xaxis = pt.xa;\n    if(pt.ya) out.yaxis = pt.ya;\n    out.color = pt.color;\n    out.colormodel = pt.trace.colormodel;\n    return out;\n};\n\n},{}],372:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar Lib = _dereq_('../../lib');\nvar constants = _dereq_('./constants');\n\nmodule.exports = function hoverPoints(pointData, xval, yval) {\n    var cd0 = pointData.cd[0];\n    var trace = cd0.trace;\n    var xa = pointData.xa;\n    var ya = pointData.ya;\n\n    // Return early if not on image\n    if(Fx.inbox(xval - cd0.x0, xval - (cd0.x0 + cd0.w * trace.dx), 0) > 0 ||\n            Fx.inbox(yval - cd0.y0, yval - (cd0.y0 + cd0.h * trace.dy), 0) > 0) {\n        return;\n    }\n\n    // Find nearest pixel's index\n    var nx = Math.floor((xval - cd0.x0) / trace.dx);\n    var ny = Math.floor(Math.abs(yval - cd0.y0) / trace.dy);\n\n    // return early if pixel is undefined\n    if(!cd0.z[ny][nx]) return;\n\n    var hoverinfo = cd0.hi || trace.hoverinfo;\n    var fmtColor;\n    if(hoverinfo) {\n        var parts = hoverinfo.split('+');\n        if(parts.indexOf('all') !== -1) parts = ['color'];\n        if(parts.indexOf('color') !== -1) fmtColor = true;\n    }\n\n    var colormodel = trace.colormodel;\n    var dims = colormodel.length;\n    var c = trace._scaler(cd0.z[ny][nx]);\n    var s = constants.colormodel[colormodel].suffix;\n\n    var colorstring = [];\n    if(trace.hovertemplate || fmtColor) {\n        colorstring.push('[' + [c[0] + s[0], c[1] + s[1], c[2] + s[2]].join(', '));\n        if(dims === 4) colorstring.push(', ' + c[3] + s[3]);\n        colorstring.push(']');\n        colorstring = colorstring.join('');\n        pointData.extraText = colormodel.toUpperCase() + ': ' + colorstring;\n    }\n\n    var text;\n    if(Array.isArray(trace.hovertext) && Array.isArray(trace.hovertext[ny])) {\n        text = trace.hovertext[ny][nx];\n    } else if(Array.isArray(trace.text) && Array.isArray(trace.text[ny])) {\n        text = trace.text[ny][nx];\n    }\n\n    // TODO: for color model with 3 dims, display something useful for hovertemplate `%{color[3]}`\n    var py = ya.c2p(cd0.y0 + (ny + 0.5) * trace.dy);\n    var xVal = cd0.x0 + (nx + 0.5) * trace.dx;\n    var yVal = cd0.y0 + (ny + 0.5) * trace.dy;\n    var zLabel = '[' + cd0.z[ny][nx].slice(0, trace.colormodel.length).join(', ') + ']';\n    return [Lib.extendFlat(pointData, {\n        index: [ny, nx],\n        x0: xa.c2p(cd0.x0 + nx * trace.dx),\n        x1: xa.c2p(cd0.x0 + (nx + 1) * trace.dx),\n        y0: py,\n        y1: py,\n        color: c,\n        xVal: xVal,\n        xLabelVal: xVal,\n        yVal: yVal,\n        yLabelVal: yVal,\n        zLabelVal: zLabel,\n        text: text,\n        hovertemplateLabels: {\n            'zLabel': zLabel,\n            'colorLabel': colorstring,\n            'color[0]Label': c[0] + s[0],\n            'color[1]Label': c[1] + s[1],\n            'color[2]Label': c[2] + s[2],\n            'color[3]Label': c[3] + s[3]\n        }\n    })];\n};\n\n},{\"../../components/fx\":92,\"../../lib\":178,\"./constants\":369}],373:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    calc: _dereq_('./calc'),\n    plot: _dereq_('./plot'),\n    style: _dereq_('./style'),\n    hoverPoints: _dereq_('./hover'),\n    eventData: _dereq_('./event_data'),\n\n    moduleType: 'trace',\n    name: 'image',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['cartesian', 'svg', '2dMap', 'noSortingByValue'],\n    animatable: false,\n    meta: {\n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"./attributes\":367,\"./calc\":368,\"./defaults\":370,\"./event_data\":371,\"./hover\":372,\"./plot\":374,\"./style\":375}],374:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\nvar constants = _dereq_('./constants');\n\nmodule.exports = function plot(gd, plotinfo, cdimage, imageLayer) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    Lib.makeTraceGroups(imageLayer, cdimage, 'im').each(function(cd) {\n        var plotGroup = d3.select(this);\n        var cd0 = cd[0];\n        var trace = cd0.trace;\n\n        var z = cd0.z;\n        var x0 = cd0.x0;\n        var y0 = cd0.y0;\n        var w = cd0.w;\n        var h = cd0.h;\n        var dx = trace.dx;\n        var dy = trace.dy;\n\n        var left, right, temp, top, bottom, i;\n        // in case of log of a negative\n        i = 0;\n        while(left === undefined && i < w) {\n            left = xa.c2p(x0 + i * dx);\n            i++;\n        }\n        i = w;\n        while(right === undefined && i > 0) {\n            right = xa.c2p(x0 + i * dx);\n            i--;\n        }\n        i = 0;\n        while(top === undefined && i < h) {\n            top = ya.c2p(y0 + i * dy);\n            i++;\n        }\n        i = h;\n        while(bottom === undefined && i > 0) {\n            bottom = ya.c2p(y0 + i * dy);\n            i--;\n        }\n\n        if(right < left) {\n            temp = right;\n            right = left;\n            left = temp;\n        }\n\n        if(bottom < top) {\n            temp = top;\n            top = bottom;\n            bottom = temp;\n        }\n\n        // Reduce image size when zoomed in to save memory\n        var extra = 0.5; // half the axis size\n        left = Math.max(-extra * xa._length, left);\n        right = Math.min((1 + extra) * xa._length, right);\n        top = Math.max(-extra * ya._length, top);\n        bottom = Math.min((1 + extra) * ya._length, bottom);\n        var imageWidth = Math.round(right - left);\n        var imageHeight = Math.round(bottom - top);\n\n        // if image is entirely off-screen, don't even draw it\n        var isOffScreen = (imageWidth <= 0 || imageHeight <= 0);\n        if(isOffScreen) {\n            var noImage = plotGroup.selectAll('image').data([]);\n            noImage.exit().remove();\n            return;\n        }\n\n        // Draw each pixel\n        var canvas = document.createElement('canvas');\n        canvas.width = imageWidth;\n        canvas.height = imageHeight;\n        var context = canvas.getContext('2d');\n\n        var ipx = function(i) {return Lib.constrain(Math.round(xa.c2p(x0 + i * dx) - left), 0, imageWidth);};\n        var jpx = function(j) {return Lib.constrain(Math.round(ya.c2p(y0 + j * dy) - top), 0, imageHeight);};\n\n        var fmt = constants.colormodel[trace.colormodel].fmt;\n        var c;\n        for(i = 0; i < cd0.w; i++) {\n            var ipx0 = ipx(i); var ipx1 = ipx(i + 1);\n            if(ipx1 === ipx0 || isNaN(ipx1) || isNaN(ipx0)) continue;\n            for(var j = 0; j < cd0.h; j++) {\n                var jpx0 = jpx(j); var jpx1 = jpx(j + 1);\n                if(jpx1 === jpx0 || isNaN(jpx1) || isNaN(jpx0) || !z[j][i]) continue;\n                c = trace._scaler(z[j][i]);\n                if(c) {\n                    context.fillStyle = trace.colormodel + '(' + fmt(c).join(',') + ')';\n                } else {\n                    // Return a transparent pixel\n                    context.fillStyle = 'rgba(0,0,0,0)';\n                }\n                context.fillRect(ipx0, jpx0, ipx1 - ipx0, jpx1 - jpx0);\n            }\n        }\n\n        var image3 = plotGroup.selectAll('image')\n            .data(cd);\n\n        image3.enter().append('svg:image').attr({\n            xmlns: xmlnsNamespaces.svg,\n            preserveAspectRatio: 'none'\n        });\n\n        image3.attr({\n            height: imageHeight,\n            width: imageWidth,\n            x: left,\n            y: top,\n            'xlink:href': canvas.toDataURL('image/png')\n        });\n    });\n};\n\n},{\"../../constants/xmlns_namespaces\":159,\"../../lib\":178,\"./constants\":369,\"d3\":16}],375:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nmodule.exports = function style(gd) {\n    d3.select(gd).selectAll('.im image')\n        .style('opacity', function(d) {\n            return d.trace.opacity;\n        });\n};\n\n},{\"d3\":16}],376:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar textFontAttrs = fontAttrs({\n    editType: 'plot',\n    arrayOk: true,\n    colorEditType: 'plot',\n    \n});\n\nmodule.exports = {\n    labels: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    // equivalent of x0 and dx, if label is missing\n    label0: {\n        valType: 'number',\n        \n        dflt: 0,\n        editType: 'calc',\n        \n    },\n    dlabel: {\n        valType: 'number',\n        \n        dflt: 1,\n        editType: 'calc',\n        \n    },\n\n    values: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n\n    marker: {\n        colors: {\n            valType: 'data_array',  // TODO 'color_array' ?\n            editType: 'calc',\n            \n        },\n\n        line: {\n            color: {\n                valType: 'color',\n                \n                dflt: colorAttrs.defaultLine,\n                arrayOk: true,\n                editType: 'style',\n                \n            },\n            width: {\n                valType: 'number',\n                \n                min: 0,\n                dflt: 0,\n                arrayOk: true,\n                editType: 'style',\n                \n            },\n            editType: 'calc'\n        },\n        editType: 'calc'\n    },\n\n    text: {\n        valType: 'data_array',\n        editType: 'plot',\n        \n    },\n    hovertext: {\n        valType: 'string',\n        \n        dflt: '',\n        arrayOk: true,\n        editType: 'style',\n        \n    },\n\n// 'see eg:'\n// 'https://www.e-education.psu.edu/natureofgeoinfo/sites/www.e-education.psu.edu.natureofgeoinfo/files/image/hisp_pies.gif',\n// '(this example involves a map too - may someday be a whole trace type',\n// 'of its own. but the point is the size of the whole pie is important.)'\n    scalegroup: {\n        valType: 'string',\n        \n        dflt: '',\n        editType: 'calc',\n        \n    },\n\n    // labels (legend is handled by plots.attributes.showlegend and layout.hiddenlabels)\n    textinfo: {\n        valType: 'flaglist',\n        \n        flags: ['label', 'text', 'value', 'percent'],\n        extras: ['none'],\n        editType: 'calc',\n        \n    },\n    hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n        flags: ['label', 'text', 'value', 'percent', 'name']\n    }),\n    hovertemplate: hovertemplateAttrs({}, {\n        keys: ['label', 'color', 'value', 'percent', 'text']\n    }),\n    texttemplate: texttemplateAttrs({editType: 'plot'}, {\n        keys: ['label', 'color', 'value', 'percent', 'text']\n    }),\n    textposition: {\n        valType: 'enumerated',\n        \n        values: ['inside', 'outside', 'auto', 'none'],\n        dflt: 'auto',\n        arrayOk: true,\n        editType: 'plot',\n        \n    },\n    textfont: extendFlat({}, textFontAttrs, {\n        \n    }),\n    insidetextorientation: {\n        valType: 'enumerated',\n        \n        values: ['horizontal', 'radial', 'tangential', 'auto'],\n        dflt: 'auto',\n        editType: 'plot',\n        \n    },\n    insidetextfont: extendFlat({}, textFontAttrs, {\n        \n    }),\n    outsidetextfont: extendFlat({}, textFontAttrs, {\n        \n    }),\n    automargin: {\n        valType: 'boolean',\n        dflt: false,\n        \n        editType: 'plot',\n        \n    },\n\n    title: {\n        text: {\n            valType: 'string',\n            dflt: '',\n            \n            editType: 'plot',\n            \n        },\n        font: extendFlat({}, textFontAttrs, {\n            \n        }),\n        position: {\n            valType: 'enumerated',\n            values: [\n                'top left', 'top center', 'top right',\n                'middle center',\n                'bottom left', 'bottom center', 'bottom right'\n            ],\n            \n            editType: 'plot',\n            \n        },\n\n        editType: 'plot'\n    },\n\n    // position and shape\n    domain: domainAttrs({name: 'pie', trace: true, editType: 'calc'}),\n\n    hole: {\n        valType: 'number',\n        \n        min: 0,\n        max: 1,\n        dflt: 0,\n        editType: 'calc',\n        \n    },\n\n    // ordering and direction\n    sort: {\n        valType: 'boolean',\n        \n        dflt: true,\n        editType: 'calc',\n        \n    },\n    direction: {\n        /**\n         * there are two common conventions, both of which place the first\n         * (largest, if sorted) slice with its left edge at 12 o'clock but\n         * succeeding slices follow either cw or ccw from there.\n         *\n         * see http://visage.co/data-visualization-101-pie-charts/\n         */\n        valType: 'enumerated',\n        values: ['clockwise', 'counterclockwise'],\n        \n        dflt: 'counterclockwise',\n        editType: 'calc',\n        \n    },\n    rotation: {\n        valType: 'number',\n        \n        min: -360,\n        max: 360,\n        dflt: 0,\n        editType: 'calc',\n        \n    },\n\n    pull: {\n        valType: 'number',\n        \n        min: 0,\n        max: 1,\n        dflt: 0,\n        arrayOk: true,\n        editType: 'calc',\n        \n    },\n\n    _deprecated: {\n        title: {\n            valType: 'string',\n            dflt: '',\n            \n            editType: 'calc',\n            \n        },\n        titlefont: extendFlat({}, textFontAttrs, {\n            \n        }),\n        titleposition: {\n            valType: 'enumerated',\n            values: [\n                'top left', 'top center', 'top right',\n                'middle center',\n                'bottom left', 'bottom center', 'bottom right'\n            ],\n            \n            editType: 'calc',\n            \n        }\n    }\n};\n\n},{\"../../components/color/attributes\":51,\"../../lib/extend\":173,\"../../plots/attributes\":219,\"../../plots/domain\":249,\"../../plots/font_attributes\":250,\"../../plots/template_attributes\":264}],377:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar plots = _dereq_('../../plots/plots');\n\nexports.name = 'pie';\n\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n    plots.plotBasePlot(exports.name, gd, traces, transitionOpts, makeOnCompleteCallback);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n    plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout);\n};\n\n},{\"../../plots/plots\":256}],378:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Color = _dereq_('../../components/color');\n\nvar extendedColorWayList = {};\n\nfunction calc(gd, trace) {\n    var cd = [];\n\n    var fullLayout = gd._fullLayout;\n    var hiddenLabels = fullLayout.hiddenlabels || [];\n\n    var labels = trace.labels;\n    var colors = trace.marker.colors || [];\n    var vals = trace.values;\n    var len = trace._length;\n    var hasValues = trace._hasValues && len;\n\n    var i, pt;\n\n    if(trace.dlabel) {\n        labels = new Array(len);\n        for(i = 0; i < len; i++) {\n            labels[i] = String(trace.label0 + i * trace.dlabel);\n        }\n    }\n\n    var allThisTraceLabels = {};\n    var pullColor = makePullColorFn(fullLayout['_' + trace.type + 'colormap']);\n    var vTotal = 0;\n    var isAggregated = false;\n\n    for(i = 0; i < len; i++) {\n        var v, label, hidden;\n        if(hasValues) {\n            v = vals[i];\n            if(!isNumeric(v)) continue;\n            v = +v;\n            if(v < 0) continue;\n        } else v = 1;\n\n        label = labels[i];\n        if(label === undefined || label === '') label = i;\n        label = String(label);\n\n        var thisLabelIndex = allThisTraceLabels[label];\n        if(thisLabelIndex === undefined) {\n            allThisTraceLabels[label] = cd.length;\n\n            hidden = hiddenLabels.indexOf(label) !== -1;\n\n            if(!hidden) vTotal += v;\n\n            cd.push({\n                v: v,\n                label: label,\n                color: pullColor(colors[i], label),\n                i: i,\n                pts: [i],\n                hidden: hidden\n            });\n        } else {\n            isAggregated = true;\n\n            pt = cd[thisLabelIndex];\n            pt.v += v;\n            pt.pts.push(i);\n            if(!pt.hidden) vTotal += v;\n\n            if(pt.color === false && colors[i]) {\n                pt.color = pullColor(colors[i], label);\n            }\n        }\n    }\n\n    var shouldSort = (trace.type === 'funnelarea') ? isAggregated : trace.sort;\n    if(shouldSort) cd.sort(function(a, b) { return b.v - a.v; });\n\n    // include the sum of all values in the first point\n    if(cd[0]) cd[0].vTotal = vTotal;\n\n    return cd;\n}\n\nfunction makePullColorFn(colorMap) {\n    return function pullColor(color, id) {\n        if(!color) return false;\n\n        color = tinycolor(color);\n        if(!color.isValid()) return false;\n\n        color = Color.addOpacity(color, color.getAlpha());\n        if(!colorMap[id]) colorMap[id] = color;\n\n        return color;\n    };\n}\n\n/*\n * `calc` filled in (and collated) explicit colors.\n * Now we need to propagate these explicit colors to other traces,\n * and fill in default colors.\n * This is done after sorting, so we pick defaults\n * in the order slices will be displayed\n */\nfunction crossTraceCalc(gd, plotinfo) { // TODO: should we name the second argument opts?\n    var desiredType = (plotinfo || {}).type;\n    if(!desiredType) desiredType = 'pie';\n\n    var fullLayout = gd._fullLayout;\n    var calcdata = gd.calcdata;\n    var colorWay = fullLayout[desiredType + 'colorway'];\n    var colorMap = fullLayout['_' + desiredType + 'colormap'];\n\n    if(fullLayout['extend' + desiredType + 'colors']) {\n        colorWay = generateExtendedColors(colorWay, extendedColorWayList);\n    }\n    var dfltColorCount = 0;\n\n    for(var i = 0; i < calcdata.length; i++) {\n        var cd = calcdata[i];\n        var traceType = cd[0].trace.type;\n        if(traceType !== desiredType) continue;\n\n        for(var j = 0; j < cd.length; j++) {\n            var pt = cd[j];\n            if(pt.color === false) {\n                // have we seen this label and assigned a color to it in a previous trace?\n                if(colorMap[pt.label]) {\n                    pt.color = colorMap[pt.label];\n                } else {\n                    colorMap[pt.label] = pt.color = colorWay[dfltColorCount % colorWay.length];\n                    dfltColorCount++;\n                }\n            }\n        }\n    }\n}\n\n/**\n * pick a default color from the main default set, augmented by\n * itself lighter then darker before repeating\n */\nfunction generateExtendedColors(colorList, extendedColorWays) {\n    var i;\n    var colorString = JSON.stringify(colorList);\n    var colors = extendedColorWays[colorString];\n    if(!colors) {\n        colors = colorList.slice();\n\n        for(i = 0; i < colorList.length; i++) {\n            colors.push(tinycolor(colorList[i]).lighten(20).toHexString());\n        }\n\n        for(i = 0; i < colorList.length; i++) {\n            colors.push(tinycolor(colorList[i]).darken(20).toHexString());\n        }\n        extendedColorWays[colorString] = colors;\n    }\n\n    return colors;\n}\n\nmodule.exports = {\n    calc: calc,\n    crossTraceCalc: crossTraceCalc,\n\n    makePullColorFn: makePullColorFn,\n    generateExtendedColors: generateExtendedColors\n};\n\n},{\"../../components/color\":52,\"fast-isnumeric\":18,\"tinycolor2\":35}],379:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar handleText = _dereq_('../bar/defaults').handleText;\n\nfunction handleLabelsAndValues(labels, values) {\n    var hasLabels = Array.isArray(labels);\n    var hasValues = Lib.isArrayOrTypedArray(values);\n    var len = Math.min(\n        hasLabels ? labels.length : Infinity,\n        hasValues ? values.length : Infinity\n    );\n\n    if(!isFinite(len)) len = 0;\n\n    if(len && hasValues) {\n        var hasPositive;\n        for(var i = 0; i < len; i++) {\n            var v = values[i];\n            if(isNumeric(v) && v > 0) {\n                hasPositive = true;\n                break;\n            }\n        }\n        if(!hasPositive) len = 0;\n    }\n\n    return {\n        hasLabels: hasLabels,\n        hasValues: hasValues,\n        len: len\n    };\n}\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    var labels = coerce('labels');\n    var values = coerce('values');\n\n    var res = handleLabelsAndValues(labels, values);\n    var len = res.len;\n    traceOut._hasLabels = res.hasLabels;\n    traceOut._hasValues = res.hasValues;\n\n    if(!traceOut._hasLabels &&\n        traceOut._hasValues\n    ) {\n        coerce('label0');\n        coerce('dlabel');\n    }\n\n    if(!len) {\n        traceOut.visible = false;\n        return;\n    }\n    traceOut._length = len;\n\n    var lineWidth = coerce('marker.line.width');\n    if(lineWidth) coerce('marker.line.color');\n\n    coerce('marker.colors');\n\n    coerce('scalegroup');\n    // TODO: hole needs to be coerced to the same value within a scaleegroup\n\n    var textData = coerce('text');\n    var textTemplate = coerce('texttemplate');\n    var textInfo;\n    if(!textTemplate) textInfo = coerce('textinfo', Array.isArray(textData) ? 'text+percent' : 'percent');\n\n    coerce('hovertext');\n    coerce('hovertemplate');\n\n    if(textTemplate || (textInfo && textInfo !== 'none')) {\n        var textposition = coerce('textposition');\n        handleText(traceIn, traceOut, layout, coerce, textposition, {\n            moduleHasSelected: false,\n            moduleHasUnselected: false,\n            moduleHasConstrain: false,\n            moduleHasCliponaxis: false,\n            moduleHasTextangle: false,\n            moduleHasInsideanchor: false\n        });\n\n        var hasBoth = Array.isArray(textposition) || textposition === 'auto';\n        var hasOutside = hasBoth || textposition === 'outside';\n        if(hasOutside) {\n            coerce('automargin');\n        }\n\n        if(textposition === 'inside' || textposition === 'auto' || Array.isArray(textposition)) {\n            coerce('insidetextorientation');\n        }\n    }\n\n    handleDomainDefaults(traceOut, layout, coerce);\n\n    var hole = coerce('hole');\n    var title = coerce('title.text');\n    if(title) {\n        var titlePosition = coerce('title.position', hole ? 'middle center' : 'top center');\n        if(!hole && titlePosition === 'middle center') traceOut.title.position = 'top center';\n        Lib.coerceFont(coerce, 'title.font', layout.font);\n    }\n\n    coerce('sort');\n    coerce('direction');\n    coerce('rotation');\n    coerce('pull');\n}\n\nmodule.exports = {\n    handleLabelsAndValues: handleLabelsAndValues,\n    supplyDefaults: supplyDefaults\n};\n\n},{\"../../lib\":178,\"../../plots/domain\":249,\"../bar/defaults\":283,\"./attributes\":376,\"fast-isnumeric\":18}],380:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar appendArrayMultiPointValues = _dereq_('../../components/fx/helpers').appendArrayMultiPointValues;\n\n// Note: like other eventData routines, this creates the data for hover/unhover/click events\n// but it has a different API and goes through a totally different pathway.\n// So to ensure it doesn't get misused, it's not attached to the Pie module.\nmodule.exports = function eventData(pt, trace) {\n    var out = {\n        curveNumber: trace.index,\n        pointNumbers: pt.pts,\n        data: trace._input,\n        fullData: trace,\n        label: pt.label,\n        color: pt.color,\n        value: pt.v,\n        percent: pt.percent,\n        text: pt.text,\n\n        // pt.v (and pt.i below) for backward compatibility\n        v: pt.v\n    };\n\n    // Only include pointNumber if it's unambiguous\n    if(pt.pts.length === 1) out.pointNumber = out.i = pt.pts[0];\n\n    // Add extra data arrays to the output\n    // notice that this is the multi-point version ('s' on the end!)\n    // so added data will be arrays matching the pointNumbers array.\n    appendArrayMultiPointValues(out, trace, pt.pts);\n\n    // don't include obsolete fields in new funnelarea traces\n    if(trace.type === 'funnelarea') {\n        delete out.v;\n        delete out.i;\n    }\n\n    return out;\n};\n\n},{\"../../components/fx/helpers\":88}],381:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nexports.formatPiePercent = function formatPiePercent(v, separators) {\n    var vRounded = (v * 100).toPrecision(3);\n    if(vRounded.lastIndexOf('.') !== -1) {\n        vRounded = vRounded.replace(/[.]?0+$/, '');\n    }\n    return Lib.numSeparate(vRounded, separators) + '%';\n};\n\nexports.formatPieValue = function formatPieValue(v, separators) {\n    var vRounded = v.toPrecision(10);\n    if(vRounded.lastIndexOf('.') !== -1) {\n        vRounded = vRounded.replace(/[.]?0+$/, '');\n    }\n    return Lib.numSeparate(vRounded, separators);\n};\n\nexports.getFirstFilled = function getFirstFilled(array, indices) {\n    if(!Array.isArray(array)) return;\n    for(var i = 0; i < indices.length; i++) {\n        var v = array[indices[i]];\n        if(v || v === 0 || v === '') return v;\n    }\n};\n\nexports.castOption = function castOption(item, indices) {\n    if(Array.isArray(item)) return exports.getFirstFilled(item, indices);\n    else if(item) return item;\n};\n\n},{\"../../lib\":178}],382:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults').supplyDefaults,\n    supplyLayoutDefaults: _dereq_('./layout_defaults'),\n    layoutAttributes: _dereq_('./layout_attributes'),\n\n    calc: _dereq_('./calc').calc,\n    crossTraceCalc: _dereq_('./calc').crossTraceCalc,\n\n    plot: _dereq_('./plot').plot,\n    style: _dereq_('./style'),\n    styleOne: _dereq_('./style_one'),\n\n    moduleType: 'trace',\n    name: 'pie',\n    basePlotModule: _dereq_('./base_plot'),\n    categories: ['pie-like', 'pie', 'showLegend'],\n    meta: {\n        \n    }\n};\n\n},{\"./attributes\":376,\"./base_plot\":377,\"./calc\":378,\"./defaults\":379,\"./layout_attributes\":383,\"./layout_defaults\":384,\"./plot\":385,\"./style\":386,\"./style_one\":387}],383:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    hiddenlabels: {\n        valType: 'data_array',\n        \n        editType: 'calc',\n        \n    },\n    piecolorway: {\n        valType: 'colorlist',\n        \n        editType: 'calc',\n        \n    },\n    extendpiecolors: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'calc',\n        \n    }\n};\n\n},{}],384:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n    }\n\n    coerce('hiddenlabels');\n    coerce('piecolorway', layoutOut.colorway);\n    coerce('extendpiecolors');\n};\n\n},{\"../../lib\":178,\"./layout_attributes\":383}],385:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Plots = _dereq_('../../plots/plots');\nvar Fx = _dereq_('../../components/fx');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar uniformText = _dereq_('../bar/uniform_text');\nvar recordMinTextSize = uniformText.recordMinTextSize;\nvar clearMinTextSize = uniformText.clearMinTextSize;\nvar TEXTPAD = _dereq_('../bar/constants').TEXTPAD;\n\nvar helpers = _dereq_('./helpers');\nvar eventData = _dereq_('./event_data');\nvar isValidTextValue = _dereq_('../../lib').isValidTextValue;\n\nfunction plot(gd, cdModule) {\n    var fullLayout = gd._fullLayout;\n    var gs = fullLayout._size;\n\n    clearMinTextSize('pie', fullLayout);\n\n    prerenderTitles(cdModule, gd);\n    layoutAreas(cdModule, gs);\n\n    var plotGroups = Lib.makeTraceGroups(fullLayout._pielayer, cdModule, 'trace').each(function(cd) {\n        var plotGroup = d3.select(this);\n        var cd0 = cd[0];\n        var trace = cd0.trace;\n\n        setCoords(cd);\n\n        // TODO: miter might look better but can sometimes cause problems\n        // maybe miter with a small-ish stroke-miterlimit?\n        plotGroup.attr('stroke-linejoin', 'round');\n\n        plotGroup.each(function() {\n            var slices = d3.select(this).selectAll('g.slice').data(cd);\n\n            slices.enter().append('g')\n                .classed('slice', true);\n            slices.exit().remove();\n\n            var quadrants = [\n                [[], []], // y<0: x<0, x>=0\n                [[], []] // y>=0: x<0, x>=0\n            ];\n            var hasOutsideText = false;\n\n            slices.each(function(pt, i) {\n                if(pt.hidden) {\n                    d3.select(this).selectAll('path,g').remove();\n                    return;\n                }\n\n                // to have consistent event data compared to other traces\n                pt.pointNumber = pt.i;\n                pt.curveNumber = trace.index;\n\n                quadrants[pt.pxmid[1] < 0 ? 0 : 1][pt.pxmid[0] < 0 ? 0 : 1].push(pt);\n\n                var cx = cd0.cx;\n                var cy = cd0.cy;\n                var sliceTop = d3.select(this);\n                var slicePath = sliceTop.selectAll('path.surface').data([pt]);\n\n                slicePath.enter().append('path')\n                    .classed('surface', true)\n                    .style({'pointer-events': 'all'});\n\n                sliceTop.call(attachFxHandlers, gd, cd);\n\n                if(trace.pull) {\n                    var pull = +helpers.castOption(trace.pull, pt.pts) || 0;\n                    if(pull > 0) {\n                        cx += pull * pt.pxmid[0];\n                        cy += pull * pt.pxmid[1];\n                    }\n                }\n\n                pt.cxFinal = cx;\n                pt.cyFinal = cy;\n\n                function arc(start, finish, cw, scale) {\n                    var dx = scale * (finish[0] - start[0]);\n                    var dy = scale * (finish[1] - start[1]);\n\n                    return 'a' +\n                        (scale * cd0.r) + ',' + (scale * cd0.r) + ' 0 ' +\n                        pt.largeArc + (cw ? ' 1 ' : ' 0 ') + dx + ',' + dy;\n                }\n\n                var hole = trace.hole;\n                if(pt.v === cd0.vTotal) { // 100% fails bcs arc start and end are identical\n                    var outerCircle = 'M' + (cx + pt.px0[0]) + ',' + (cy + pt.px0[1]) +\n                        arc(pt.px0, pt.pxmid, true, 1) +\n                        arc(pt.pxmid, pt.px0, true, 1) + 'Z';\n                    if(hole) {\n                        slicePath.attr('d',\n                            'M' + (cx + hole * pt.px0[0]) + ',' + (cy + hole * pt.px0[1]) +\n                            arc(pt.px0, pt.pxmid, false, hole) +\n                            arc(pt.pxmid, pt.px0, false, hole) +\n                            'Z' + outerCircle);\n                    } else slicePath.attr('d', outerCircle);\n                } else {\n                    var outerArc = arc(pt.px0, pt.px1, true, 1);\n\n                    if(hole) {\n                        var rim = 1 - hole;\n                        slicePath.attr('d',\n                            'M' + (cx + hole * pt.px1[0]) + ',' + (cy + hole * pt.px1[1]) +\n                            arc(pt.px1, pt.px0, false, hole) +\n                            'l' + (rim * pt.px0[0]) + ',' + (rim * pt.px0[1]) +\n                            outerArc +\n                            'Z');\n                    } else {\n                        slicePath.attr('d',\n                            'M' + cx + ',' + cy +\n                            'l' + pt.px0[0] + ',' + pt.px0[1] +\n                            outerArc +\n                            'Z');\n                    }\n                }\n\n                // add text\n                formatSliceLabel(gd, pt, cd0);\n                var textPosition = helpers.castOption(trace.textposition, pt.pts);\n                var sliceTextGroup = sliceTop.selectAll('g.slicetext')\n                    .data(pt.text && (textPosition !== 'none') ? [0] : []);\n\n                sliceTextGroup.enter().append('g')\n                    .classed('slicetext', true);\n                sliceTextGroup.exit().remove();\n\n                sliceTextGroup.each(function() {\n                    var sliceText = Lib.ensureSingle(d3.select(this), 'text', '', function(s) {\n                        // prohibit tex interpretation until we can handle\n                        // tex and regular text together\n                        s.attr('data-notex', 1);\n                    });\n\n                    var font = Lib.ensureUniformFontSize(gd, textPosition === 'outside' ?\n                        determineOutsideTextFont(trace, pt, fullLayout.font) :\n                        determineInsideTextFont(trace, pt, fullLayout.font)\n                    );\n\n                    sliceText.text(pt.text)\n                        .attr({\n                            'class': 'slicetext',\n                            transform: '',\n                            'text-anchor': 'middle'\n                        })\n                        .call(Drawing.font, font)\n                        .call(svgTextUtils.convertToTspans, gd);\n\n                    // position the text relative to the slice\n                    var textBB = Drawing.bBox(sliceText.node());\n                    var transform;\n\n                    if(textPosition === 'outside') {\n                        transform = transformOutsideText(textBB, pt);\n                    } else {\n                        transform = transformInsideText(textBB, pt, cd0);\n                        if(textPosition === 'auto' && transform.scale < 1) {\n                            var newFont = Lib.ensureUniformFontSize(gd, trace.outsidetextfont);\n\n                            sliceText.call(Drawing.font, newFont);\n                            textBB = Drawing.bBox(sliceText.node());\n\n                            transform = transformOutsideText(textBB, pt);\n                        }\n                    }\n\n                    var textPosAngle = transform.textPosAngle;\n                    var textXY = textPosAngle === undefined ? pt.pxmid : getCoords(cd0.r, textPosAngle);\n                    transform.targetX = cx + textXY[0] * transform.rCenter + (transform.x || 0);\n                    transform.targetY = cy + textXY[1] * transform.rCenter + (transform.y || 0);\n                    computeTransform(transform, textBB);\n\n                    // save some stuff to use later ensure no labels overlap\n                    if(transform.outside) {\n                        var targetY = transform.targetY;\n                        pt.yLabelMin = targetY - textBB.height / 2;\n                        pt.yLabelMid = targetY;\n                        pt.yLabelMax = targetY + textBB.height / 2;\n                        pt.labelExtraX = 0;\n                        pt.labelExtraY = 0;\n                        hasOutsideText = true;\n                    }\n\n                    transform.fontSize = font.size;\n                    recordMinTextSize(trace.type, transform, fullLayout);\n                    cd[i].transform = transform;\n\n                    sliceText.attr('transform', Lib.getTextTransform(transform));\n                });\n            });\n\n            // add the title\n            var titleTextGroup = d3.select(this).selectAll('g.titletext')\n                .data(trace.title.text ? [0] : []);\n\n            titleTextGroup.enter().append('g')\n                .classed('titletext', true);\n            titleTextGroup.exit().remove();\n\n            titleTextGroup.each(function() {\n                var titleText = Lib.ensureSingle(d3.select(this), 'text', '', function(s) {\n                    // prohibit tex interpretation as above\n                    s.attr('data-notex', 1);\n                });\n\n                var txt = trace.title.text;\n                if(trace._meta) {\n                    txt = Lib.templateString(txt, trace._meta);\n                }\n\n                titleText.text(txt)\n                    .attr({\n                        'class': 'titletext',\n                        transform: '',\n                        'text-anchor': 'middle',\n                    })\n                .call(Drawing.font, trace.title.font)\n                .call(svgTextUtils.convertToTspans, gd);\n\n                var transform;\n\n                if(trace.title.position === 'middle center') {\n                    transform = positionTitleInside(cd0);\n                } else {\n                    transform = positionTitleOutside(cd0, gs);\n                }\n\n                titleText.attr('transform',\n                    'translate(' + transform.x + ',' + transform.y + ')' +\n                    (transform.scale < 1 ? ('scale(' + transform.scale + ')') : '') +\n                    'translate(' + transform.tx + ',' + transform.ty + ')');\n            });\n\n            // now make sure no labels overlap (at least within one pie)\n            if(hasOutsideText) scootLabels(quadrants, trace);\n\n            plotTextLines(slices, trace);\n\n            if(hasOutsideText && trace.automargin) {\n                // TODO if we ever want to improve perf,\n                // we could reuse the textBB computed above together\n                // with the sliceText transform info\n                var traceBbox = Drawing.bBox(plotGroup.node());\n\n                var domain = trace.domain;\n                var vpw = gs.w * (domain.x[1] - domain.x[0]);\n                var vph = gs.h * (domain.y[1] - domain.y[0]);\n                var xgap = (0.5 * vpw - cd0.r) / gs.w;\n                var ygap = (0.5 * vph - cd0.r) / gs.h;\n\n                Plots.autoMargin(gd, 'pie.' + trace.uid + '.automargin', {\n                    xl: domain.x[0] - xgap,\n                    xr: domain.x[1] + xgap,\n                    yb: domain.y[0] - ygap,\n                    yt: domain.y[1] + ygap,\n                    l: Math.max(cd0.cx - cd0.r - traceBbox.left, 0),\n                    r: Math.max(traceBbox.right - (cd0.cx + cd0.r), 0),\n                    b: Math.max(traceBbox.bottom - (cd0.cy + cd0.r), 0),\n                    t: Math.max(cd0.cy - cd0.r - traceBbox.top, 0),\n                    pad: 5\n                });\n            }\n        });\n    });\n\n    // This is for a bug in Chrome (as of 2015-07-22, and does not affect FF)\n    // if insidetextfont and outsidetextfont are different sizes, sometimes the size\n    // of an \"em\" gets taken from the wrong element at first so lines are\n    // spaced wrong. You just have to tell it to try again later and it gets fixed.\n    // I have no idea why we haven't seen this in other contexts. Also, sometimes\n    // it gets the initial draw correct but on redraw it gets confused.\n    setTimeout(function() {\n        plotGroups.selectAll('tspan').each(function() {\n            var s = d3.select(this);\n            if(s.attr('dy')) s.attr('dy', s.attr('dy'));\n        });\n    }, 0);\n}\n\n// TODO add support for transition\nfunction plotTextLines(slices, trace) {\n    slices.each(function(pt) {\n        var sliceTop = d3.select(this);\n\n        if(!pt.labelExtraX && !pt.labelExtraY) {\n            sliceTop.select('path.textline').remove();\n            return;\n        }\n\n        // first move the text to its new location\n        var sliceText = sliceTop.select('g.slicetext text');\n\n        pt.transform.targetX += pt.labelExtraX;\n        pt.transform.targetY += pt.labelExtraY;\n\n        sliceText.attr('transform', Lib.getTextTransform(pt.transform));\n\n        // then add a line to the new location\n        var lineStartX = pt.cxFinal + pt.pxmid[0];\n        var lineStartY = pt.cyFinal + pt.pxmid[1];\n        var textLinePath = 'M' + lineStartX + ',' + lineStartY;\n        var finalX = (pt.yLabelMax - pt.yLabelMin) * (pt.pxmid[0] < 0 ? -1 : 1) / 4;\n\n        if(pt.labelExtraX) {\n            var yFromX = pt.labelExtraX * pt.pxmid[1] / pt.pxmid[0];\n            var yNet = pt.yLabelMid + pt.labelExtraY - (pt.cyFinal + pt.pxmid[1]);\n\n            if(Math.abs(yFromX) > Math.abs(yNet)) {\n                textLinePath +=\n                    'l' + (yNet * pt.pxmid[0] / pt.pxmid[1]) + ',' + yNet +\n                    'H' + (lineStartX + pt.labelExtraX + finalX);\n            } else {\n                textLinePath += 'l' + pt.labelExtraX + ',' + yFromX +\n                    'v' + (yNet - yFromX) +\n                    'h' + finalX;\n            }\n        } else {\n            textLinePath +=\n                'V' + (pt.yLabelMid + pt.labelExtraY) +\n                'h' + finalX;\n        }\n\n        Lib.ensureSingle(sliceTop, 'path', 'textline')\n            .call(Color.stroke, trace.outsidetextfont.color)\n            .attr({\n                'stroke-width': Math.min(2, trace.outsidetextfont.size / 8),\n                d: textLinePath,\n                fill: 'none'\n            });\n    });\n}\n\nfunction attachFxHandlers(sliceTop, gd, cd) {\n    var cd0 = cd[0];\n    var trace = cd0.trace;\n    var cx = cd0.cx;\n    var cy = cd0.cy;\n\n    // hover state vars\n    // have we drawn a hover label, so it should be cleared later\n    if(!('_hasHoverLabel' in trace)) trace._hasHoverLabel = false;\n    // have we emitted a hover event, so later an unhover event should be emitted\n    // note that click events do not depend on this - you can still get them\n    // with hovermode: false or if you were earlier dragging, then clicked\n    // in the same slice that you moused up in\n    if(!('_hasHoverEvent' in trace)) trace._hasHoverEvent = false;\n\n    sliceTop.on('mouseover', function(pt) {\n        // in case fullLayout or fullData has changed without a replot\n        var fullLayout2 = gd._fullLayout;\n        var trace2 = gd._fullData[trace.index];\n\n        if(gd._dragging || fullLayout2.hovermode === false) return;\n\n        var hoverinfo = trace2.hoverinfo;\n        if(Array.isArray(hoverinfo)) {\n            // super hacky: we need to pull out the *first* hoverinfo from\n            // pt.pts, then put it back into an array in a dummy trace\n            // and call castHoverinfo on that.\n            // TODO: do we want to have Fx.castHoverinfo somehow handle this?\n            // it already takes an array for index, for 2D, so this seems tricky.\n            hoverinfo = Fx.castHoverinfo({\n                hoverinfo: [helpers.castOption(hoverinfo, pt.pts)],\n                _module: trace._module\n            }, fullLayout2, 0);\n        }\n\n        if(hoverinfo === 'all') hoverinfo = 'label+text+value+percent+name';\n\n        // in case we dragged over the pie from another subplot,\n        // or if hover is turned off\n        if(trace2.hovertemplate || (hoverinfo !== 'none' && hoverinfo !== 'skip' && hoverinfo)) {\n            var rInscribed = pt.rInscribed || 0;\n            var hoverCenterX = cx + pt.pxmid[0] * (1 - rInscribed);\n            var hoverCenterY = cy + pt.pxmid[1] * (1 - rInscribed);\n            var separators = fullLayout2.separators;\n            var text = [];\n\n            if(hoverinfo && hoverinfo.indexOf('label') !== -1) text.push(pt.label);\n            pt.text = helpers.castOption(trace2.hovertext || trace2.text, pt.pts);\n            if(hoverinfo && hoverinfo.indexOf('text') !== -1) {\n                var tx = pt.text;\n                if(Lib.isValidTextValue(tx)) text.push(tx);\n            }\n            pt.value = pt.v;\n            pt.valueLabel = helpers.formatPieValue(pt.v, separators);\n            if(hoverinfo && hoverinfo.indexOf('value') !== -1) text.push(pt.valueLabel);\n            pt.percent = pt.v / cd0.vTotal;\n            pt.percentLabel = helpers.formatPiePercent(pt.percent, separators);\n            if(hoverinfo && hoverinfo.indexOf('percent') !== -1) text.push(pt.percentLabel);\n\n            var hoverLabel = trace2.hoverlabel;\n            var hoverFont = hoverLabel.font;\n\n            Fx.loneHover({\n                trace: trace,\n                x0: hoverCenterX - rInscribed * cd0.r,\n                x1: hoverCenterX + rInscribed * cd0.r,\n                y: hoverCenterY,\n                text: text.join('<br>'),\n                name: (trace2.hovertemplate || hoverinfo.indexOf('name') !== -1) ? trace2.name : undefined,\n                idealAlign: pt.pxmid[0] < 0 ? 'left' : 'right',\n                color: helpers.castOption(hoverLabel.bgcolor, pt.pts) || pt.color,\n                borderColor: helpers.castOption(hoverLabel.bordercolor, pt.pts),\n                fontFamily: helpers.castOption(hoverFont.family, pt.pts),\n                fontSize: helpers.castOption(hoverFont.size, pt.pts),\n                fontColor: helpers.castOption(hoverFont.color, pt.pts),\n                nameLength: helpers.castOption(hoverLabel.namelength, pt.pts),\n                textAlign: helpers.castOption(hoverLabel.align, pt.pts),\n                hovertemplate: helpers.castOption(trace2.hovertemplate, pt.pts),\n                hovertemplateLabels: pt,\n                eventData: [eventData(pt, trace2)]\n            }, {\n                container: fullLayout2._hoverlayer.node(),\n                outerContainer: fullLayout2._paper.node(),\n                gd: gd\n            });\n\n            trace._hasHoverLabel = true;\n        }\n\n        trace._hasHoverEvent = true;\n        gd.emit('plotly_hover', {\n            points: [eventData(pt, trace2)],\n            event: d3.event\n        });\n    });\n\n    sliceTop.on('mouseout', function(evt) {\n        var fullLayout2 = gd._fullLayout;\n        var trace2 = gd._fullData[trace.index];\n        var pt = d3.select(this).datum();\n\n        if(trace._hasHoverEvent) {\n            evt.originalEvent = d3.event;\n            gd.emit('plotly_unhover', {\n                points: [eventData(pt, trace2)],\n                event: d3.event\n            });\n            trace._hasHoverEvent = false;\n        }\n\n        if(trace._hasHoverLabel) {\n            Fx.loneUnhover(fullLayout2._hoverlayer.node());\n            trace._hasHoverLabel = false;\n        }\n    });\n\n    sliceTop.on('click', function(pt) {\n        // TODO: this does not support right-click. If we want to support it, we\n        // would likely need to change pie to use dragElement instead of straight\n        // mapbox event binding. Or perhaps better, make a simple wrapper with the\n        // right mousedown, mousemove, and mouseup handlers just for a left/right click\n        // mapbox would use this too.\n        var fullLayout2 = gd._fullLayout;\n        var trace2 = gd._fullData[trace.index];\n\n        if(gd._dragging || fullLayout2.hovermode === false) return;\n\n        gd._hoverdata = [eventData(pt, trace2)];\n        Fx.click(gd, d3.event);\n    });\n}\n\nfunction determineOutsideTextFont(trace, pt, layoutFont) {\n    var color =\n        helpers.castOption(trace.outsidetextfont.color, pt.pts) ||\n        helpers.castOption(trace.textfont.color, pt.pts) ||\n        layoutFont.color;\n\n    var family =\n        helpers.castOption(trace.outsidetextfont.family, pt.pts) ||\n        helpers.castOption(trace.textfont.family, pt.pts) ||\n        layoutFont.family;\n\n    var size =\n        helpers.castOption(trace.outsidetextfont.size, pt.pts) ||\n        helpers.castOption(trace.textfont.size, pt.pts) ||\n        layoutFont.size;\n\n    return {\n        color: color,\n        family: family,\n        size: size\n    };\n}\n\nfunction determineInsideTextFont(trace, pt, layoutFont) {\n    var customColor = helpers.castOption(trace.insidetextfont.color, pt.pts);\n    if(!customColor && trace._input.textfont) {\n        // Why not simply using trace.textfont? Because if not set, it\n        // defaults to layout.font which has a default color. But if\n        // textfont.color and insidetextfont.color don't supply a value,\n        // a contrasting color shall be used.\n        customColor = helpers.castOption(trace._input.textfont.color, pt.pts);\n    }\n\n    var family =\n        helpers.castOption(trace.insidetextfont.family, pt.pts) ||\n        helpers.castOption(trace.textfont.family, pt.pts) ||\n        layoutFont.family;\n\n    var size =\n        helpers.castOption(trace.insidetextfont.size, pt.pts) ||\n        helpers.castOption(trace.textfont.size, pt.pts) ||\n        layoutFont.size;\n\n    return {\n        color: customColor || Color.contrast(pt.color),\n        family: family,\n        size: size\n    };\n}\n\nfunction prerenderTitles(cdModule, gd) {\n    var cd0, trace;\n\n    // Determine the width and height of the title for each pie.\n    for(var i = 0; i < cdModule.length; i++) {\n        cd0 = cdModule[i][0];\n        trace = cd0.trace;\n\n        if(trace.title.text) {\n            var txt = trace.title.text;\n            if(trace._meta) {\n                txt = Lib.templateString(txt, trace._meta);\n            }\n\n            var dummyTitle = Drawing.tester.append('text')\n              .attr('data-notex', 1)\n              .text(txt)\n              .call(Drawing.font, trace.title.font)\n              .call(svgTextUtils.convertToTspans, gd);\n            var bBox = Drawing.bBox(dummyTitle.node(), true);\n            cd0.titleBox = {\n                width: bBox.width,\n                height: bBox.height,\n            };\n            dummyTitle.remove();\n        }\n    }\n}\n\nfunction transformInsideText(textBB, pt, cd0) {\n    var r = cd0.r || pt.rpx1;\n    var rInscribed = pt.rInscribed;\n\n    var isEmpty = pt.startangle === pt.stopangle;\n    if(isEmpty) {\n        return {\n            rCenter: 1 - rInscribed,\n            scale: 0,\n            rotate: 0,\n            textPosAngle: 0\n        };\n    }\n\n    var ring = pt.ring;\n    var isCircle = (ring === 1) && (Math.abs(pt.startangle - pt.stopangle) === Math.PI * 2);\n\n    var halfAngle = pt.halfangle;\n    var midAngle = pt.midangle;\n\n    var orientation = cd0.trace.insidetextorientation;\n    var isHorizontal = orientation === 'horizontal';\n    var isTangential = orientation === 'tangential';\n    var isRadial = orientation === 'radial';\n    var isAuto = orientation === 'auto';\n\n    var allTransforms = [];\n    var newT;\n\n    if(!isAuto) {\n        // max size if text is placed (horizontally) at the top or bottom of the arc\n\n        var considerCrossing = function(angle, key) {\n            if(isCrossing(pt, angle)) {\n                var dStart = Math.abs(angle - pt.startangle);\n                var dStop = Math.abs(angle - pt.stopangle);\n\n                var closestEdge = dStart < dStop ? dStart : dStop;\n\n                if(key === 'tan') {\n                    newT = calcTanTransform(textBB, r, ring, closestEdge, 0);\n                } else { // case of 'rad'\n                    newT = calcRadTransform(textBB, r, ring, closestEdge, Math.PI / 2);\n                }\n                newT.textPosAngle = angle;\n\n                allTransforms.push(newT);\n            }\n        };\n\n        // to cover all cases with trace.rotation added\n        var i;\n        if(isHorizontal || isTangential) {\n            // top\n            for(i = 4; i >= -4; i -= 2) considerCrossing(Math.PI * i, 'tan');\n            // bottom\n            for(i = 4; i >= -4; i -= 2) considerCrossing(Math.PI * (i + 1), 'tan');\n        }\n        if(isHorizontal || isRadial) {\n            // left\n            for(i = 4; i >= -4; i -= 2) considerCrossing(Math.PI * (i + 1.5), 'rad');\n            // right\n            for(i = 4; i >= -4; i -= 2) considerCrossing(Math.PI * (i + 0.5), 'rad');\n        }\n    }\n\n    if(isCircle || isAuto || isHorizontal) {\n        // max size text can be inserted inside without rotating it\n        // this inscribes the text rectangle in a circle, which is then inscribed\n        // in the slice, so it will be an underestimate, which some day we may want\n        // to improve so this case can get more use\n        var textDiameter = Math.sqrt(textBB.width * textBB.width + textBB.height * textBB.height);\n\n        newT = {\n            scale: rInscribed * r * 2 / textDiameter,\n\n            // and the center position and rotation in this case\n            rCenter: 1 - rInscribed,\n            rotate: 0\n        };\n\n        newT.textPosAngle = (pt.startangle + pt.stopangle) / 2;\n        if(newT.scale >= 1) return newT;\n\n        allTransforms.push(newT);\n    }\n\n    if(isAuto || isRadial) {\n        newT = calcRadTransform(textBB, r, ring, halfAngle, midAngle);\n        newT.textPosAngle = (pt.startangle + pt.stopangle) / 2;\n        allTransforms.push(newT);\n    }\n\n    if(isAuto || isTangential) {\n        newT = calcTanTransform(textBB, r, ring, halfAngle, midAngle);\n        newT.textPosAngle = (pt.startangle + pt.stopangle) / 2;\n        allTransforms.push(newT);\n    }\n\n    var id = 0;\n    var maxScale = 0;\n    for(var k = 0; k < allTransforms.length; k++) {\n        var s = allTransforms[k].scale;\n        if(maxScale < s) {\n            maxScale = s;\n            id = k;\n        }\n\n        if(!isAuto && maxScale >= 1) {\n            // respect test order for non-auto options\n            break;\n        }\n    }\n    return allTransforms[id];\n}\n\nfunction isCrossing(pt, angle) {\n    var start = pt.startangle;\n    var stop = pt.stopangle;\n    return (\n        (start > angle && angle > stop) ||\n        (start < angle && angle < stop)\n    );\n}\n\nfunction calcRadTransform(textBB, r, ring, halfAngle, midAngle) {\n    r = Math.max(0, r - 2 * TEXTPAD);\n\n    // max size if text is rotated radially\n    var a = textBB.width / textBB.height;\n    var s = calcMaxHalfSize(a, halfAngle, r, ring);\n    return {\n        scale: s * 2 / textBB.height,\n        rCenter: calcRCenter(a, s / r),\n        rotate: calcRotate(midAngle)\n    };\n}\n\nfunction calcTanTransform(textBB, r, ring, halfAngle, midAngle) {\n    r = Math.max(0, r - 2 * TEXTPAD);\n\n    // max size if text is rotated tangentially\n    var a = textBB.height / textBB.width;\n    var s = calcMaxHalfSize(a, halfAngle, r, ring);\n    return {\n        scale: s * 2 / textBB.width,\n        rCenter: calcRCenter(a, s / r),\n        rotate: calcRotate(midAngle + Math.PI / 2)\n    };\n}\n\nfunction calcRCenter(a, b) {\n    return Math.cos(b) - a * b;\n}\n\nfunction calcRotate(t) {\n    return (180 / Math.PI * t + 720) % 180 - 90;\n}\n\nfunction calcMaxHalfSize(a, halfAngle, r, ring) {\n    var q = a + 1 / (2 * Math.tan(halfAngle));\n    return r * Math.min(\n        1 / (Math.sqrt(q * q + 0.5) + q),\n        ring / (Math.sqrt(a * a + ring / 2) + a)\n    );\n}\n\nfunction getInscribedRadiusFraction(pt, cd0) {\n    if(pt.v === cd0.vTotal && !cd0.trace.hole) return 1;// special case of 100% with no hole\n\n    return Math.min(1 / (1 + 1 / Math.sin(pt.halfangle)), pt.ring / 2);\n}\n\nfunction transformOutsideText(textBB, pt) {\n    var x = pt.pxmid[0];\n    var y = pt.pxmid[1];\n    var dx = textBB.width / 2;\n    var dy = textBB.height / 2;\n\n    if(x < 0) dx *= -1;\n    if(y < 0) dy *= -1;\n\n    return {\n        scale: 1,\n        rCenter: 1,\n        rotate: 0,\n        x: dx + Math.abs(dy) * (dx > 0 ? 1 : -1) / 2,\n        y: dy / (1 + x * x / (y * y)),\n        outside: true\n    };\n}\n\nfunction positionTitleInside(cd0) {\n    var textDiameter =\n        Math.sqrt(cd0.titleBox.width * cd0.titleBox.width + cd0.titleBox.height * cd0.titleBox.height);\n    return {\n        x: cd0.cx,\n        y: cd0.cy,\n        scale: cd0.trace.hole * cd0.r * 2 / textDiameter,\n        tx: 0,\n        ty: - cd0.titleBox.height / 2 + cd0.trace.title.font.size\n    };\n}\n\nfunction positionTitleOutside(cd0, plotSize) {\n    var scaleX = 1;\n    var scaleY = 1;\n    var maxPull;\n\n    var trace = cd0.trace;\n    // position of the baseline point of the text box in the plot, before scaling.\n    // we anchored the text in the middle, so the baseline is on the bottom middle\n    // of the first line of text.\n    var topMiddle = {\n        x: cd0.cx,\n        y: cd0.cy\n    };\n    // relative translation of the text box after scaling\n    var translate = {\n        tx: 0,\n        ty: 0\n    };\n\n    // we reason below as if the baseline is the top middle point of the text box.\n    // so we must add the font size to approximate the y-coord. of the top.\n    // note that this correction must happen after scaling.\n    translate.ty += trace.title.font.size;\n    maxPull = getMaxPull(trace);\n\n    if(trace.title.position.indexOf('top') !== -1) {\n        topMiddle.y -= (1 + maxPull) * cd0.r;\n        translate.ty -= cd0.titleBox.height;\n    } else if(trace.title.position.indexOf('bottom') !== -1) {\n        topMiddle.y += (1 + maxPull) * cd0.r;\n    }\n\n    var rx = applyAspectRatio(cd0.r, cd0.trace.aspectratio);\n\n    var maxWidth = plotSize.w * (trace.domain.x[1] - trace.domain.x[0]) / 2;\n    if(trace.title.position.indexOf('left') !== -1) {\n        // we start the text at the left edge of the pie\n        maxWidth = maxWidth + rx;\n        topMiddle.x -= (1 + maxPull) * rx;\n        translate.tx += cd0.titleBox.width / 2;\n    } else if(trace.title.position.indexOf('center') !== -1) {\n        maxWidth *= 2;\n    } else if(trace.title.position.indexOf('right') !== -1) {\n        maxWidth = maxWidth + rx;\n        topMiddle.x += (1 + maxPull) * rx;\n        translate.tx -= cd0.titleBox.width / 2;\n    }\n    scaleX = maxWidth / cd0.titleBox.width;\n    scaleY = getTitleSpace(cd0, plotSize) / cd0.titleBox.height;\n    return {\n        x: topMiddle.x,\n        y: topMiddle.y,\n        scale: Math.min(scaleX, scaleY),\n        tx: translate.tx,\n        ty: translate.ty\n    };\n}\n\nfunction applyAspectRatio(x, aspectratio) {\n    return x / ((aspectratio === undefined) ? 1 : aspectratio);\n}\n\nfunction getTitleSpace(cd0, plotSize) {\n    var trace = cd0.trace;\n    var pieBoxHeight = plotSize.h * (trace.domain.y[1] - trace.domain.y[0]);\n    // use at most half of the plot for the title\n    return Math.min(cd0.titleBox.height, pieBoxHeight / 2);\n}\n\nfunction getMaxPull(trace) {\n    var maxPull = trace.pull;\n    if(!maxPull) return 0;\n\n    var j;\n    if(Array.isArray(maxPull)) {\n        maxPull = 0;\n        for(j = 0; j < trace.pull.length; j++) {\n            if(trace.pull[j] > maxPull) maxPull = trace.pull[j];\n        }\n    }\n    return maxPull;\n}\n\nfunction scootLabels(quadrants, trace) {\n    var xHalf, yHalf, equatorFirst, farthestX, farthestY,\n        xDiffSign, yDiffSign, thisQuad, oppositeQuad,\n        wholeSide, i, thisQuadOutside, firstOppositeOutsidePt;\n\n    function topFirst(a, b) { return a.pxmid[1] - b.pxmid[1]; }\n    function bottomFirst(a, b) { return b.pxmid[1] - a.pxmid[1]; }\n\n    function scootOneLabel(thisPt, prevPt) {\n        if(!prevPt) prevPt = {};\n\n        var prevOuterY = prevPt.labelExtraY + (yHalf ? prevPt.yLabelMax : prevPt.yLabelMin);\n        var thisInnerY = yHalf ? thisPt.yLabelMin : thisPt.yLabelMax;\n        var thisOuterY = yHalf ? thisPt.yLabelMax : thisPt.yLabelMin;\n        var thisSliceOuterY = thisPt.cyFinal + farthestY(thisPt.px0[1], thisPt.px1[1]);\n        var newExtraY = prevOuterY - thisInnerY;\n\n        var xBuffer, i, otherPt, otherOuterY, otherOuterX, newExtraX;\n\n        // make sure this label doesn't overlap other labels\n        // this *only* has us move these labels vertically\n        if(newExtraY * yDiffSign > 0) thisPt.labelExtraY = newExtraY;\n\n        // make sure this label doesn't overlap any slices\n        if(!Array.isArray(trace.pull)) return; // this can only happen with array pulls\n\n        for(i = 0; i < wholeSide.length; i++) {\n            otherPt = wholeSide[i];\n\n            // overlap can only happen if the other point is pulled more than this one\n            if(otherPt === thisPt || (\n                (helpers.castOption(trace.pull, thisPt.pts) || 0) >=\n                (helpers.castOption(trace.pull, otherPt.pts) || 0))\n            ) {\n                continue;\n            }\n\n            if((thisPt.pxmid[1] - otherPt.pxmid[1]) * yDiffSign > 0) {\n                // closer to the equator - by construction all of these happen first\n                // move the text vertically to get away from these slices\n                otherOuterY = otherPt.cyFinal + farthestY(otherPt.px0[1], otherPt.px1[1]);\n                newExtraY = otherOuterY - thisInnerY - thisPt.labelExtraY;\n\n                if(newExtraY * yDiffSign > 0) thisPt.labelExtraY += newExtraY;\n            } else if((thisOuterY + thisPt.labelExtraY - thisSliceOuterY) * yDiffSign > 0) {\n                // farther from the equator - happens after we've done all the\n                // vertical moving we're going to do\n                // move horizontally to get away from these more polar slices\n\n                // if we're moving horz. based on a slice that's several slices away from this one\n                // then we need some extra space for the lines to labels between them\n                xBuffer = 3 * xDiffSign * Math.abs(i - wholeSide.indexOf(thisPt));\n\n                otherOuterX = otherPt.cxFinal + farthestX(otherPt.px0[0], otherPt.px1[0]);\n                newExtraX = otherOuterX + xBuffer - (thisPt.cxFinal + thisPt.pxmid[0]) - thisPt.labelExtraX;\n\n                if(newExtraX * xDiffSign > 0) thisPt.labelExtraX += newExtraX;\n            }\n        }\n    }\n\n    for(yHalf = 0; yHalf < 2; yHalf++) {\n        equatorFirst = yHalf ? topFirst : bottomFirst;\n        farthestY = yHalf ? Math.max : Math.min;\n        yDiffSign = yHalf ? 1 : -1;\n\n        for(xHalf = 0; xHalf < 2; xHalf++) {\n            farthestX = xHalf ? Math.max : Math.min;\n            xDiffSign = xHalf ? 1 : -1;\n\n            // first sort the array\n            // note this is a copy of cd, so cd itself doesn't get sorted\n            // but we can still modify points in place.\n            thisQuad = quadrants[yHalf][xHalf];\n            thisQuad.sort(equatorFirst);\n\n            oppositeQuad = quadrants[1 - yHalf][xHalf];\n            wholeSide = oppositeQuad.concat(thisQuad);\n\n            thisQuadOutside = [];\n            for(i = 0; i < thisQuad.length; i++) {\n                if(thisQuad[i].yLabelMid !== undefined) thisQuadOutside.push(thisQuad[i]);\n            }\n\n            firstOppositeOutsidePt = false;\n            for(i = 0; yHalf && i < oppositeQuad.length; i++) {\n                if(oppositeQuad[i].yLabelMid !== undefined) {\n                    firstOppositeOutsidePt = oppositeQuad[i];\n                    break;\n                }\n            }\n\n            // each needs to avoid the previous\n            for(i = 0; i < thisQuadOutside.length; i++) {\n                var prevPt = i && thisQuadOutside[i - 1];\n                // bottom half needs to avoid the first label of the top half\n                // top half we still need to call scootOneLabel on the first slice\n                // so we can avoid other slices, but we don't pass a prevPt\n                if(firstOppositeOutsidePt && !i) prevPt = firstOppositeOutsidePt;\n                scootOneLabel(thisQuadOutside[i], prevPt);\n            }\n        }\n    }\n}\n\nfunction layoutAreas(cdModule, plotSize) {\n    var scaleGroups = [];\n\n    // figure out the center and maximum radius\n    for(var i = 0; i < cdModule.length; i++) {\n        var cd0 = cdModule[i][0];\n        var trace = cd0.trace;\n\n        var domain = trace.domain;\n        var width = plotSize.w * (domain.x[1] - domain.x[0]);\n        var height = plotSize.h * (domain.y[1] - domain.y[0]);\n        // leave some space for the title, if it will be displayed outside\n        if(trace.title.text && trace.title.position !== 'middle center') {\n            height -= getTitleSpace(cd0, plotSize);\n        }\n\n        var rx = width / 2;\n        var ry = height / 2;\n        if(trace.type === 'funnelarea' && !trace.scalegroup) {\n            ry /= trace.aspectratio;\n        }\n\n        cd0.r = Math.min(rx, ry) / (1 + getMaxPull(trace));\n\n        cd0.cx = plotSize.l + plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;\n        cd0.cy = plotSize.t + plotSize.h * (1 - trace.domain.y[0]) - height / 2;\n        if(trace.title.text && trace.title.position.indexOf('bottom') !== -1) {\n            cd0.cy -= getTitleSpace(cd0, plotSize);\n        }\n\n        if(trace.scalegroup && scaleGroups.indexOf(trace.scalegroup) === -1) {\n            scaleGroups.push(trace.scalegroup);\n        }\n    }\n\n    groupScale(cdModule, scaleGroups);\n}\n\nfunction groupScale(cdModule, scaleGroups) {\n    var cd0, i, trace;\n\n    // scale those that are grouped\n    for(var k = 0; k < scaleGroups.length; k++) {\n        var min = Infinity;\n        var g = scaleGroups[k];\n\n        for(i = 0; i < cdModule.length; i++) {\n            cd0 = cdModule[i][0];\n            trace = cd0.trace;\n\n            if(trace.scalegroup === g) {\n                var area;\n                if(trace.type === 'pie') {\n                    area = cd0.r * cd0.r;\n                } else if(trace.type === 'funnelarea') {\n                    var rx, ry;\n\n                    if(trace.aspectratio > 1) {\n                        rx = cd0.r;\n                        ry = rx / trace.aspectratio;\n                    } else {\n                        ry = cd0.r;\n                        rx = ry * trace.aspectratio;\n                    }\n\n                    rx *= (1 + trace.baseratio) / 2;\n\n                    area = rx * ry;\n                }\n\n                min = Math.min(min, area / cd0.vTotal);\n            }\n        }\n\n        for(i = 0; i < cdModule.length; i++) {\n            cd0 = cdModule[i][0];\n            trace = cd0.trace;\n            if(trace.scalegroup === g) {\n                var v = min * cd0.vTotal;\n                if(trace.type === 'funnelarea') {\n                    v /= (1 + trace.baseratio) / 2;\n                    v /= trace.aspectratio;\n                }\n\n                cd0.r = Math.sqrt(v);\n            }\n        }\n    }\n}\n\nfunction setCoords(cd) {\n    var cd0 = cd[0];\n    var r = cd0.r;\n    var trace = cd0.trace;\n    var currentAngle = trace.rotation * Math.PI / 180;\n    var angleFactor = 2 * Math.PI / cd0.vTotal;\n    var firstPt = 'px0';\n    var lastPt = 'px1';\n\n    var i, cdi, currentCoords;\n\n    if(trace.direction === 'counterclockwise') {\n        for(i = 0; i < cd.length; i++) {\n            if(!cd[i].hidden) break; // find the first non-hidden slice\n        }\n        if(i === cd.length) return; // all slices hidden\n\n        currentAngle += angleFactor * cd[i].v;\n        angleFactor *= -1;\n        firstPt = 'px1';\n        lastPt = 'px0';\n    }\n\n    currentCoords = getCoords(r, currentAngle);\n\n    for(i = 0; i < cd.length; i++) {\n        cdi = cd[i];\n        if(cdi.hidden) continue;\n\n        cdi[firstPt] = currentCoords;\n\n        cdi.startangle = currentAngle;\n        currentAngle += angleFactor * cdi.v / 2;\n        cdi.pxmid = getCoords(r, currentAngle);\n        cdi.midangle = currentAngle;\n        currentAngle += angleFactor * cdi.v / 2;\n        currentCoords = getCoords(r, currentAngle);\n        cdi.stopangle = currentAngle;\n\n        cdi[lastPt] = currentCoords;\n\n        cdi.largeArc = (cdi.v > cd0.vTotal / 2) ? 1 : 0;\n\n        cdi.halfangle = Math.PI * Math.min(cdi.v / cd0.vTotal, 0.5);\n        cdi.ring = 1 - trace.hole;\n        cdi.rInscribed = getInscribedRadiusFraction(cdi, cd0);\n    }\n}\n\nfunction getCoords(r, angle) {\n    return [r * Math.sin(angle), -r * Math.cos(angle)];\n}\n\nfunction formatSliceLabel(gd, pt, cd0) {\n    var fullLayout = gd._fullLayout;\n    var trace = cd0.trace;\n    // look for textemplate\n    var texttemplate = trace.texttemplate;\n\n    // now insert text\n    var textinfo = trace.textinfo;\n    if(!texttemplate && textinfo && textinfo !== 'none') {\n        var parts = textinfo.split('+');\n        var hasFlag = function(flag) { return parts.indexOf(flag) !== -1; };\n        var hasLabel = hasFlag('label');\n        var hasText = hasFlag('text');\n        var hasValue = hasFlag('value');\n        var hasPercent = hasFlag('percent');\n\n        var separators = fullLayout.separators;\n        var text;\n\n        text = hasLabel ? [pt.label] : [];\n        if(hasText) {\n            var tx = helpers.getFirstFilled(trace.text, pt.pts);\n            if(isValidTextValue(tx)) text.push(tx);\n        }\n        if(hasValue) text.push(helpers.formatPieValue(pt.v, separators));\n        if(hasPercent) text.push(helpers.formatPiePercent(pt.v / cd0.vTotal, separators));\n        pt.text = text.join('<br>');\n    }\n\n    function makeTemplateVariables(pt) {\n        return {\n            label: pt.label,\n            value: pt.v,\n            valueLabel: helpers.formatPieValue(pt.v, fullLayout.separators),\n            percent: pt.v / cd0.vTotal,\n            percentLabel: helpers.formatPiePercent(pt.v / cd0.vTotal, fullLayout.separators),\n            color: pt.color,\n            text: pt.text,\n            customdata: Lib.castOption(trace, pt.i, 'customdata')\n        };\n    }\n\n    if(texttemplate) {\n        var txt = Lib.castOption(trace, pt.i, 'texttemplate');\n        if(!txt) {\n            pt.text = '';\n        } else {\n            var obj = makeTemplateVariables(pt);\n            var ptTx = helpers.getFirstFilled(trace.text, pt.pts);\n            if(isValidTextValue(ptTx) || ptTx === '') obj.text = ptTx;\n            pt.text = Lib.texttemplateString(txt, obj, gd._fullLayout._d3locale, obj, trace._meta || {});\n        }\n    }\n}\n\nfunction computeTransform(\n    transform,  // inout\n    textBB      // in\n) {\n    var a = transform.rotate * Math.PI / 180;\n    var cosA = Math.cos(a);\n    var sinA = Math.sin(a);\n    var midX = (textBB.left + textBB.right) / 2;\n    var midY = (textBB.top + textBB.bottom) / 2;\n    transform.textX = midX * cosA - midY * sinA;\n    transform.textY = midX * sinA + midY * cosA;\n    transform.noCenter = true;\n}\n\nmodule.exports = {\n    plot: plot,\n    formatSliceLabel: formatSliceLabel,\n    transformInsideText: transformInsideText,\n    determineInsideTextFont: determineInsideTextFont,\n    positionTitleOutside: positionTitleOutside,\n    prerenderTitles: prerenderTitles,\n    layoutAreas: layoutAreas,\n    attachFxHandlers: attachFxHandlers,\n    computeTransform: computeTransform\n};\n\n},{\"../../components/color\":52,\"../../components/drawing\":74,\"../../components/fx\":92,\"../../lib\":178,\"../../lib/svg_text_utils\":199,\"../../plots/plots\":256,\"../bar/constants\":281,\"../bar/uniform_text\":295,\"./event_data\":380,\"./helpers\":381,\"d3\":16}],386:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar styleOne = _dereq_('./style_one');\nvar resizeText = _dereq_('../bar/uniform_text').resizeText;\n\nmodule.exports = function style(gd) {\n    var s = gd._fullLayout._pielayer.selectAll('.trace');\n    resizeText(gd, s, 'pie');\n\n    s.each(function(cd) {\n        var cd0 = cd[0];\n        var trace = cd0.trace;\n        var traceSelection = d3.select(this);\n\n        traceSelection.style({opacity: trace.opacity});\n\n        traceSelection.selectAll('path.surface').each(function(pt) {\n            d3.select(this).call(styleOne, pt, trace);\n        });\n    });\n};\n\n},{\"../bar/uniform_text\":295,\"./style_one\":387,\"d3\":16}],387:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar castOption = _dereq_('./helpers').castOption;\n\nmodule.exports = function styleOne(s, pt, trace) {\n    var line = trace.marker.line;\n    var lineColor = castOption(line.color, pt.pts) || Color.defaultLine;\n    var lineWidth = castOption(line.width, pt.pts) || 0;\n\n    s.style('stroke-width', lineWidth)\n        .call(Color.fill, pt.color)\n        .call(Color.stroke, lineColor);\n};\n\n},{\"../../components/color\":52,\"./helpers\":381}],388:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n\n// arrayOk attributes, merge them into calcdata array\nmodule.exports = function arraysToCalcdata(cd, trace) {\n    // so each point knows which index it originally came from\n    for(var i = 0; i < cd.length; i++) cd[i].i = i;\n\n    Lib.mergeArray(trace.text, cd, 'tx');\n    Lib.mergeArray(trace.texttemplate, cd, 'txt');\n    Lib.mergeArray(trace.hovertext, cd, 'htx');\n    Lib.mergeArray(trace.customdata, cd, 'data');\n    Lib.mergeArray(trace.textposition, cd, 'tp');\n    if(trace.textfont) {\n        Lib.mergeArrayCastPositive(trace.textfont.size, cd, 'ts');\n        Lib.mergeArray(trace.textfont.color, cd, 'tc');\n        Lib.mergeArray(trace.textfont.family, cd, 'tf');\n    }\n\n    var marker = trace.marker;\n    if(marker) {\n        Lib.mergeArrayCastPositive(marker.size, cd, 'ms');\n        Lib.mergeArrayCastPositive(marker.opacity, cd, 'mo');\n        Lib.mergeArray(marker.symbol, cd, 'mx');\n        Lib.mergeArray(marker.color, cd, 'mc');\n\n        var markerLine = marker.line;\n        if(marker.line) {\n            Lib.mergeArray(markerLine.color, cd, 'mlc');\n            Lib.mergeArrayCastPositive(markerLine.width, cd, 'mlw');\n        }\n\n        var markerGradient = marker.gradient;\n        if(markerGradient && markerGradient.type !== 'none') {\n            Lib.mergeArray(markerGradient.type, cd, 'mgt');\n            Lib.mergeArray(markerGradient.color, cd, 'mgc');\n        }\n    }\n};\n\n},{\"../../lib\":178}],389:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\n\nvar Drawing = _dereq_('../../components/drawing');\nvar constants = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n    x: {\n        valType: 'data_array',\n        editType: 'calc+clearAxisTypes',\n        anim: true,\n        \n    },\n    x0: {\n        valType: 'any',\n        dflt: 0,\n        \n        editType: 'calc+clearAxisTypes',\n        anim: true,\n        \n    },\n    dx: {\n        valType: 'number',\n        dflt: 1,\n        \n        editType: 'calc',\n        anim: true,\n        \n    },\n    y: {\n        valType: 'data_array',\n        editType: 'calc+clearAxisTypes',\n        anim: true,\n        \n    },\n    y0: {\n        valType: 'any',\n        dflt: 0,\n        \n        editType: 'calc+clearAxisTypes',\n        anim: true,\n        \n    },\n    dy: {\n        valType: 'number',\n        dflt: 1,\n        \n        editType: 'calc',\n        anim: true,\n        \n    },\n\n    stackgroup: {\n        valType: 'string',\n        \n        dflt: '',\n        editType: 'calc',\n        \n    },\n    orientation: {\n        valType: 'enumerated',\n        \n        values: ['v', 'h'],\n        editType: 'calc',\n        \n    },\n    groupnorm: {\n        valType: 'enumerated',\n        values: ['', 'fraction', 'percent'],\n        dflt: '',\n        \n        editType: 'calc',\n        \n    },\n    stackgaps: {\n        valType: 'enumerated',\n        values: ['infer zero', 'interpolate'],\n        dflt: 'infer zero',\n        \n        editType: 'calc',\n        \n    },\n\n    text: {\n        valType: 'string',\n        \n        dflt: '',\n        arrayOk: true,\n        editType: 'calc',\n        \n    },\n\n    texttemplate: texttemplateAttrs({}, {\n\n    }),\n    hovertext: {\n        valType: 'string',\n        \n        dflt: '',\n        arrayOk: true,\n        editType: 'style',\n        \n    },\n    mode: {\n        valType: 'flaglist',\n        flags: ['lines', 'markers', 'text'],\n        extras: ['none'],\n        \n        editType: 'calc',\n        \n    },\n    hoveron: {\n        valType: 'flaglist',\n        flags: ['points', 'fills'],\n        \n        editType: 'style',\n        \n    },\n    hovertemplate: hovertemplateAttrs({}, {\n        keys: constants.eventDataKeys\n    }),\n    line: {\n        color: {\n            valType: 'color',\n            \n            editType: 'style',\n            anim: true,\n            \n        },\n        width: {\n            valType: 'number',\n            min: 0,\n            dflt: 2,\n            \n            editType: 'style',\n            anim: true,\n            \n        },\n        shape: {\n            valType: 'enumerated',\n            values: ['linear', 'spline', 'hv', 'vh', 'hvh', 'vhv'],\n            dflt: 'linear',\n            \n            editType: 'plot',\n            \n        },\n        smoothing: {\n            valType: 'number',\n            min: 0,\n            max: 1.3,\n            dflt: 1,\n            \n            editType: 'plot',\n            \n        },\n        dash: extendFlat({}, dash, {editType: 'style'}),\n        simplify: {\n            valType: 'boolean',\n            dflt: true,\n            \n            editType: 'plot',\n            \n        },\n        editType: 'plot'\n    },\n\n    connectgaps: {\n        valType: 'boolean',\n        dflt: false,\n        \n        editType: 'calc',\n        \n    },\n    cliponaxis: {\n        valType: 'boolean',\n        dflt: true,\n        \n        editType: 'plot',\n        \n    },\n\n    fill: {\n        valType: 'enumerated',\n        values: ['none', 'tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'],\n        \n        editType: 'calc',\n        \n    },\n    fillcolor: {\n        valType: 'color',\n        \n        editType: 'style',\n        anim: true,\n        \n    },\n    marker: extendFlat({\n        symbol: {\n            valType: 'enumerated',\n            values: Drawing.symbolList,\n            dflt: 'circle',\n            arrayOk: true,\n            \n            editType: 'style',\n            \n        },\n        opacity: {\n            valType: 'number',\n            min: 0,\n            max: 1,\n            arrayOk: true,\n            \n            editType: 'style',\n            anim: true,\n            \n        },\n        size: {\n            valType: 'number',\n            min: 0,\n            dflt: 6,\n            arrayOk: true,\n            \n            editType: 'calc',\n            anim: true,\n            \n        },\n        maxdisplayed: {\n            valType: 'number',\n            min: 0,\n            dflt: 0,\n            \n            editType: 'plot',\n            \n        },\n        sizeref: {\n            valType: 'number',\n            dflt: 1,\n            \n            editType: 'calc',\n            \n        },\n        sizemin: {\n            valType: 'number',\n            min: 0,\n            dflt: 0,\n            \n            editType: 'calc',\n            \n        },\n        sizemode: {\n            valType: 'enumerated',\n            values: ['diameter', 'area'],\n            dflt: 'diameter',\n            \n            editType: 'calc',\n            \n        },\n\n        line: extendFlat({\n            width: {\n                valType: 'number',\n                min: 0,\n                arrayOk: true,\n                \n                editType: 'style',\n                anim: true,\n                \n            },\n            editType: 'calc'\n        },\n            colorScaleAttrs('marker.line', {anim: true})\n        ),\n        gradient: {\n            type: {\n                valType: 'enumerated',\n                values: ['radial', 'horizontal', 'vertical', 'none'],\n                arrayOk: true,\n                dflt: 'none',\n                \n                editType: 'calc',\n                \n            },\n            color: {\n                valType: 'color',\n                arrayOk: true,\n                \n                editType: 'calc',\n                \n            },\n            editType: 'calc'\n        },\n        editType: 'calc'\n    },\n        colorScaleAttrs('marker', {anim: true})\n    ),\n    selected: {\n        marker: {\n            opacity: {\n                valType: 'number',\n                min: 0,\n                max: 1,\n                \n                editType: 'style',\n                \n            },\n            color: {\n                valType: 'color',\n                \n                editType: 'style',\n                \n            },\n            size: {\n                valType: 'number',\n                min: 0,\n                \n                editType: 'style',\n                \n            },\n            editType: 'style'\n        },\n        textfont: {\n            color: {\n                valType: 'color',\n                \n                editType: 'style',\n                \n            },\n            editType: 'style'\n        },\n        editType: 'style'\n    },\n    unselected: {\n        marker: {\n            opacity: {\n                valType: 'number',\n                min: 0,\n                max: 1,\n                \n                editType: 'style',\n                \n            },\n            color: {\n                valType: 'color',\n                \n                editType: 'style',\n                \n            },\n            size: {\n                valType: 'number',\n                min: 0,\n                \n                editType: 'style',\n                \n            },\n            editType: 'style'\n        },\n        textfont: {\n            color: {\n                valType: 'color',\n                \n                editType: 'style',\n                \n            },\n            editType: 'style'\n        },\n        editType: 'style'\n    },\n\n    textposition: {\n        valType: 'enumerated',\n        values: [\n            'top left', 'top center', 'top right',\n            'middle left', 'middle center', 'middle right',\n            'bottom left', 'bottom center', 'bottom right'\n        ],\n        dflt: 'middle center',\n        arrayOk: true,\n        \n        editType: 'calc',\n        \n    },\n    textfont: fontAttrs({\n        editType: 'calc',\n        colorEditType: 'style',\n        arrayOk: true,\n        \n    }),\n\n    r: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    t: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    }\n};\n\n},{\"../../components/colorscale/attributes\":59,\"../../components/drawing\":74,\"../../components/drawing/attributes\":73,\"../../lib/extend\":173,\"../../plots/font_attributes\":250,\"../../plots/template_attributes\":264,\"./constants\":393}],390:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar subTypes = _dereq_('./subtypes');\nvar calcColorscale = _dereq_('./colorscale_calc');\nvar arraysToCalcdata = _dereq_('./arrays_to_calcdata');\nvar calcSelection = _dereq_('./calc_selection');\n\nfunction calc(gd, trace) {\n    var fullLayout = gd._fullLayout;\n    var xa = Axes.getFromId(gd, trace.xaxis || 'x');\n    var ya = Axes.getFromId(gd, trace.yaxis || 'y');\n    var x = xa.makeCalcdata(trace, 'x');\n    var y = ya.makeCalcdata(trace, 'y');\n    var serieslen = trace._length;\n    var cd = new Array(serieslen);\n    var ids = trace.ids;\n    var stackGroupOpts = getStackOpts(trace, fullLayout, xa, ya);\n    var interpolateGaps = false;\n    var isV, i, j, k, interpolate, vali;\n\n    setFirstScatter(fullLayout, trace);\n\n    var xAttr = 'x';\n    var yAttr = 'y';\n    var posAttr;\n    if(stackGroupOpts) {\n        Lib.pushUnique(stackGroupOpts.traceIndices, trace._expandedIndex);\n        isV = stackGroupOpts.orientation === 'v';\n\n        // size, like we use for bar\n        if(isV) {\n            yAttr = 's';\n            posAttr = 'x';\n        } else {\n            xAttr = 's';\n            posAttr = 'y';\n        }\n        interpolate = stackGroupOpts.stackgaps === 'interpolate';\n    } else {\n        var ppad = calcMarkerSize(trace, serieslen);\n        calcAxisExpansion(gd, trace, xa, ya, x, y, ppad);\n    }\n\n    for(i = 0; i < serieslen; i++) {\n        var cdi = cd[i] = {};\n        var xValid = isNumeric(x[i]);\n        var yValid = isNumeric(y[i]);\n        if(xValid && yValid) {\n            cdi[xAttr] = x[i];\n            cdi[yAttr] = y[i];\n        } else if(stackGroupOpts && (isV ? xValid : yValid)) {\n            // if we're stacking we need to hold on to all valid positions\n            // even with invalid sizes\n\n            cdi[posAttr] = isV ? x[i] : y[i];\n            cdi.gap = true;\n            if(interpolate) {\n                cdi.s = BADNUM;\n                interpolateGaps = true;\n            } else {\n                cdi.s = 0;\n            }\n        } else {\n            cdi[xAttr] = cdi[yAttr] = BADNUM;\n        }\n\n        if(ids) {\n            cdi.id = String(ids[i]);\n        }\n    }\n\n    arraysToCalcdata(cd, trace);\n    calcColorscale(gd, trace);\n    calcSelection(cd, trace);\n\n    if(stackGroupOpts) {\n        // remove bad positions and sort\n        // note that original indices get added to cd in arraysToCalcdata\n        i = 0;\n        while(i < cd.length) {\n            if(cd[i][posAttr] === BADNUM) {\n                cd.splice(i, 1);\n            } else i++;\n        }\n\n        Lib.sort(cd, function(a, b) {\n            return (a[posAttr] - b[posAttr]) || (a.i - b.i);\n        });\n\n        if(interpolateGaps) {\n            // first fill the beginning with constant from the first point\n            i = 0;\n            while(i < cd.length - 1 && cd[i].gap) {\n                i++;\n            }\n            vali = cd[i].s;\n            if(!vali) vali = cd[i].s = 0; // in case of no data AT ALL in this trace - use 0\n            for(j = 0; j < i; j++) {\n                cd[j].s = vali;\n            }\n            // then fill the end with constant from the last point\n            k = cd.length - 1;\n            while(k > i && cd[k].gap) {\n                k--;\n            }\n            vali = cd[k].s;\n            for(j = cd.length - 1; j > k; j--) {\n                cd[j].s = vali;\n            }\n            // now interpolate internal gaps linearly\n            while(i < k) {\n                i++;\n                if(cd[i].gap) {\n                    j = i + 1;\n                    while(cd[j].gap) {\n                        j++;\n                    }\n                    var pos0 = cd[i - 1][posAttr];\n                    var size0 = cd[i - 1].s;\n                    var m = (cd[j].s - size0) / (cd[j][posAttr] - pos0);\n                    while(i < j) {\n                        cd[i].s = size0 + (cd[i][posAttr] - pos0) * m;\n                        i++;\n                    }\n                }\n            }\n        }\n    }\n\n    return cd;\n}\n\nfunction calcAxisExpansion(gd, trace, xa, ya, x, y, ppad) {\n    var serieslen = trace._length;\n    var fullLayout = gd._fullLayout;\n    var xId = xa._id;\n    var yId = ya._id;\n    var firstScatter = fullLayout._firstScatter[firstScatterGroup(trace)] === trace.uid;\n    var stackOrientation = (getStackOpts(trace, fullLayout, xa, ya) || {}).orientation;\n    var fill = trace.fill;\n\n    // cancel minimum tick spacings (only applies to bars and boxes)\n    xa._minDtick = 0;\n    ya._minDtick = 0;\n\n    // check whether bounds should be tight, padded, extended to zero...\n    // most cases both should be padded on both ends, so start with that.\n    var xOptions = {padded: true};\n    var yOptions = {padded: true};\n\n    if(ppad) {\n        xOptions.ppad = yOptions.ppad = ppad;\n    }\n\n    // TODO: text size\n\n    var openEnded = serieslen < 2 || (x[0] !== x[serieslen - 1]) || (y[0] !== y[serieslen - 1]);\n\n    if(openEnded && (\n        (fill === 'tozerox') ||\n        ((fill === 'tonextx') && (firstScatter || stackOrientation === 'h'))\n    )) {\n        // include zero (tight) and extremes (padded) if fill to zero\n        // (unless the shape is closed, then it's just filling the shape regardless)\n\n        xOptions.tozero = true;\n    } else if(!(trace.error_y || {}).visible && (\n        // if no error bars, markers or text, or fill to y=0 remove x padding\n\n            (fill === 'tonexty' || fill === 'tozeroy') ||\n            (!subTypes.hasMarkers(trace) && !subTypes.hasText(trace))\n        )) {\n        xOptions.padded = false;\n        xOptions.ppad = 0;\n    }\n\n    if(openEnded && (\n        (fill === 'tozeroy') ||\n        ((fill === 'tonexty') && (firstScatter || stackOrientation === 'v'))\n    )) {\n        // now check for y - rather different logic, though still mostly padded both ends\n        // include zero (tight) and extremes (padded) if fill to zero\n        // (unless the shape is closed, then it's just filling the shape regardless)\n\n        yOptions.tozero = true;\n    } else if(fill === 'tonextx' || fill === 'tozerox') {\n        // tight y: any x fill\n\n        yOptions.padded = false;\n    }\n\n    // N.B. asymmetric splom traces call this with blank {} xa or ya\n    if(xId) trace._extremes[xId] = Axes.findExtremes(xa, x, xOptions);\n    if(yId) trace._extremes[yId] = Axes.findExtremes(ya, y, yOptions);\n}\n\nfunction calcMarkerSize(trace, serieslen) {\n    if(!subTypes.hasMarkers(trace)) return;\n\n    // Treat size like x or y arrays --- Run d2c\n    // this needs to go before ppad computation\n    var marker = trace.marker;\n    var sizeref = 1.6 * (trace.marker.sizeref || 1);\n    var markerTrans;\n\n    if(trace.marker.sizemode === 'area') {\n        markerTrans = function(v) {\n            return Math.max(Math.sqrt((v || 0) / sizeref), 3);\n        };\n    } else {\n        markerTrans = function(v) {\n            return Math.max((v || 0) / sizeref, 3);\n        };\n    }\n\n    if(Lib.isArrayOrTypedArray(marker.size)) {\n        // I tried auto-type but category and dates dont make much sense.\n        var ax = {type: 'linear'};\n        Axes.setConvert(ax);\n\n        var s = ax.makeCalcdata(trace.marker, 'size');\n\n        var sizeOut = new Array(serieslen);\n        for(var i = 0; i < serieslen; i++) {\n            sizeOut[i] = markerTrans(s[i]);\n        }\n        return sizeOut;\n    } else {\n        return markerTrans(marker.size);\n    }\n}\n\n/**\n * mark the first scatter trace for each subplot\n * note that scatter and scattergl each get their own first trace\n * note also that I'm doing this during calc rather than supplyDefaults\n * so I don't need to worry about transforms, but if we ever do\n * per-trace calc this will get confused.\n */\nfunction setFirstScatter(fullLayout, trace) {\n    var group = firstScatterGroup(trace);\n    var firstScatter = fullLayout._firstScatter;\n    if(!firstScatter[group]) firstScatter[group] = trace.uid;\n}\n\nfunction firstScatterGroup(trace) {\n    var stackGroup = trace.stackgroup;\n    return trace.xaxis + trace.yaxis + trace.type +\n        (stackGroup ? '-' + stackGroup : '');\n}\n\nfunction getStackOpts(trace, fullLayout, xa, ya) {\n    var stackGroup = trace.stackgroup;\n    if(!stackGroup) return;\n    var stackOpts = fullLayout._scatterStackOpts[xa._id + ya._id][stackGroup];\n    var stackAx = stackOpts.orientation === 'v' ? ya : xa;\n    // Allow stacking only on numeric axes\n    // calc is a little late to be figuring this out, but during supplyDefaults\n    // we don't know the axis type yet\n    if(stackAx.type === 'linear' || stackAx.type === 'log') return stackOpts;\n}\n\nmodule.exports = {\n    calc: calc,\n    calcMarkerSize: calcMarkerSize,\n    calcAxisExpansion: calcAxisExpansion,\n    setFirstScatter: setFirstScatter,\n    getStackOpts: getStackOpts\n};\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"./arrays_to_calcdata\":388,\"./calc_selection\":391,\"./colorscale_calc\":392,\"./subtypes\":413,\"fast-isnumeric\":18}],391:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function calcSelection(cd, trace) {\n    if(Lib.isArrayOrTypedArray(trace.selectedpoints)) {\n        Lib.tagSelected(cd, trace);\n    }\n};\n\n},{\"../../lib\":178}],392:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar calcColorscale = _dereq_('../../components/colorscale/calc');\n\nvar subTypes = _dereq_('./subtypes');\n\nmodule.exports = function calcMarkerColorscale(gd, trace) {\n    if(subTypes.hasLines(trace) && hasColorscale(trace, 'line')) {\n        calcColorscale(gd, trace, {\n            vals: trace.line.color,\n            containerStr: 'line',\n            cLetter: 'c'\n        });\n    }\n\n    if(subTypes.hasMarkers(trace)) {\n        if(hasColorscale(trace, 'marker')) {\n            calcColorscale(gd, trace, {\n                vals: trace.marker.color,\n                containerStr: 'marker',\n                cLetter: 'c'\n            });\n        }\n        if(hasColorscale(trace, 'marker.line')) {\n            calcColorscale(gd, trace, {\n                vals: trace.marker.line.color,\n                containerStr: 'marker.line',\n                cLetter: 'c'\n            });\n        }\n    }\n};\n\n},{\"../../components/colorscale/calc\":60,\"../../components/colorscale/helpers\":63,\"./subtypes\":413}],393:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n    PTS_LINESONLY: 20,\n\n    // fixed parameters of clustering and clipping algorithms\n\n    // fraction of clustering tolerance \"so close we don't even consider it a new point\"\n    minTolerance: 0.2,\n    // how fast does clustering tolerance increase as you get away from the visible region\n    toleranceGrowth: 10,\n\n    // number of viewport sizes away from the visible region\n    // at which we clip all lines to the perimeter\n    maxScreensAway: 20,\n\n    eventDataKeys: []\n};\n\n},{}],394:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar calc = _dereq_('./calc');\n\n/*\n * Scatter stacking & normalization calculations\n * runs per subplot, and can handle multiple stacking groups\n */\n\nmodule.exports = function crossTraceCalc(gd, plotinfo) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n    var subplot = xa._id + ya._id;\n\n    var subplotStackOpts = gd._fullLayout._scatterStackOpts[subplot];\n    if(!subplotStackOpts) return;\n\n    var calcTraces = gd.calcdata;\n\n    var i, j, k, i2, cd, cd0, posj, sumj, norm;\n    var groupOpts, interpolate, groupnorm, posAttr, valAttr;\n    var hasAnyBlanks;\n\n    for(var stackGroup in subplotStackOpts) {\n        groupOpts = subplotStackOpts[stackGroup];\n        var indices = groupOpts.traceIndices;\n\n        // can get here with no indices if the stack axis is non-numeric\n        if(!indices.length) continue;\n\n        interpolate = groupOpts.stackgaps === 'interpolate';\n        groupnorm = groupOpts.groupnorm;\n        if(groupOpts.orientation === 'v') {\n            posAttr = 'x';\n            valAttr = 'y';\n        } else {\n            posAttr = 'y';\n            valAttr = 'x';\n        }\n        hasAnyBlanks = new Array(indices.length);\n        for(i = 0; i < hasAnyBlanks.length; i++) {\n            hasAnyBlanks[i] = false;\n        }\n\n        // Collect the complete set of all positions across ALL traces.\n        // Start with the first trace, then interleave items from later traces\n        // as needed.\n        // Fill in mising items as we go.\n        cd0 = calcTraces[indices[0]];\n        var allPositions = new Array(cd0.length);\n        for(i = 0; i < cd0.length; i++) {\n            allPositions[i] = cd0[i][posAttr];\n        }\n\n        for(i = 1; i < indices.length; i++) {\n            cd = calcTraces[indices[i]];\n\n            for(j = k = 0; j < cd.length; j++) {\n                posj = cd[j][posAttr];\n                for(; posj > allPositions[k] && k < allPositions.length; k++) {\n                    // the current trace is missing a position from some previous trace(s)\n                    insertBlank(cd, j, allPositions[k], i, hasAnyBlanks, interpolate, posAttr);\n                    j++;\n                }\n                if(posj !== allPositions[k]) {\n                    // previous trace(s) are missing a position from the current trace\n                    for(i2 = 0; i2 < i; i2++) {\n                        insertBlank(calcTraces[indices[i2]], k, posj, i2, hasAnyBlanks, interpolate, posAttr);\n                    }\n                    allPositions.splice(k, 0, posj);\n                }\n                k++;\n            }\n            for(; k < allPositions.length; k++) {\n                insertBlank(cd, j, allPositions[k], i, hasAnyBlanks, interpolate, posAttr);\n                j++;\n            }\n        }\n\n        var serieslen = allPositions.length;\n\n        // stack (and normalize)!\n        for(j = 0; j < cd0.length; j++) {\n            sumj = cd0[j][valAttr] = cd0[j].s;\n            for(i = 1; i < indices.length; i++) {\n                cd = calcTraces[indices[i]];\n                cd[0].trace._rawLength = cd[0].trace._length;\n                cd[0].trace._length = serieslen;\n                sumj += cd[j].s;\n                cd[j][valAttr] = sumj;\n            }\n\n            if(groupnorm) {\n                norm = ((groupnorm === 'fraction') ? sumj : (sumj / 100)) || 1;\n                for(i = 0; i < indices.length; i++) {\n                    var cdj = calcTraces[indices[i]][j];\n                    cdj[valAttr] /= norm;\n                    cdj.sNorm = cdj.s / norm;\n                }\n            }\n        }\n\n        // autorange\n        for(i = 0; i < indices.length; i++) {\n            cd = calcTraces[indices[i]];\n            var trace = cd[0].trace;\n            var ppad = calc.calcMarkerSize(trace, trace._rawLength);\n            var arrayPad = Array.isArray(ppad);\n            if((ppad && hasAnyBlanks[i]) || arrayPad) {\n                var ppadRaw = ppad;\n                ppad = new Array(serieslen);\n                for(j = 0; j < serieslen; j++) {\n                    ppad[j] = cd[j].gap ? 0 : (arrayPad ? ppadRaw[cd[j].i] : ppadRaw);\n                }\n            }\n            var x = new Array(serieslen);\n            var y = new Array(serieslen);\n            for(j = 0; j < serieslen; j++) {\n                x[j] = cd[j].x;\n                y[j] = cd[j].y;\n            }\n            calc.calcAxisExpansion(gd, trace, xa, ya, x, y, ppad);\n\n            // while we're here (in a loop over all traces in the stack)\n            // record the orientation, so hover can find it easily\n            cd[0].t.orientation = groupOpts.orientation;\n        }\n    }\n};\n\nfunction insertBlank(calcTrace, index, position, traceIndex, hasAnyBlanks, interpolate, posAttr) {\n    hasAnyBlanks[traceIndex] = true;\n    var newEntry = {\n        i: null,\n        gap: true,\n        s: 0\n    };\n    newEntry[posAttr] = position;\n    calcTrace.splice(index, 0, newEntry);\n    // Even if we're not interpolating, if one trace has multiple\n    // values at the same position and this trace only has one value there,\n    // we just duplicate that one value rather than insert a zero.\n    // We also make it look like a real point - because it's ambiguous which\n    // one really is the real one!\n    if(index && position === calcTrace[index - 1][posAttr]) {\n        var prevEntry = calcTrace[index - 1];\n        newEntry.s = prevEntry.s;\n        // TODO is it going to cause any problems to have multiple\n        // calcdata points with the same index?\n        newEntry.i = prevEntry.i;\n        newEntry.gap = prevEntry.gap;\n    } else if(interpolate) {\n        newEntry.s = getInterp(calcTrace, index, position, posAttr);\n    }\n    if(!index) {\n        // t and trace need to stay on the first cd entry\n        calcTrace[0].t = calcTrace[1].t;\n        calcTrace[0].trace = calcTrace[1].trace;\n        delete calcTrace[1].t;\n        delete calcTrace[1].trace;\n    }\n}\n\nfunction getInterp(calcTrace, index, position, posAttr) {\n    var pt0 = calcTrace[index - 1];\n    var pt1 = calcTrace[index + 1];\n    if(!pt1) return pt0.s;\n    if(!pt0) return pt1.s;\n    return pt0.s + (pt1.s - pt0.s) * (position - pt0[posAttr]) / (pt1[posAttr] - pt0[posAttr]);\n}\n\n},{\"./calc\":390}],395:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n// remove opacity for any trace that has a fill or is filled to\nmodule.exports = function crossTraceDefaults(fullData) {\n    for(var i = 0; i < fullData.length; i++) {\n        var tracei = fullData[i];\n        if(tracei.type !== 'scatter') continue;\n\n        var filli = tracei.fill;\n        if(filli === 'none' || filli === 'toself') continue;\n\n        tracei.opacity = undefined;\n\n        if(filli === 'tonexty' || filli === 'tonextx') {\n            for(var j = i - 1; j >= 0; j--) {\n                var tracej = fullData[j];\n\n                if((tracej.type === 'scatter') &&\n                        (tracej.xaxis === tracei.xaxis) &&\n                        (tracej.yaxis === tracei.yaxis)) {\n                    tracej.opacity = undefined;\n                    break;\n                }\n            }\n        }\n    }\n};\n\n},{}],396:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nvar attributes = _dereq_('./attributes');\nvar constants = _dereq_('./constants');\nvar subTypes = _dereq_('./subtypes');\nvar handleXYDefaults = _dereq_('./xy_defaults');\nvar handleStackDefaults = _dereq_('./stack_defaults');\nvar handleMarkerDefaults = _dereq_('./marker_defaults');\nvar handleLineDefaults = _dereq_('./line_defaults');\nvar handleLineShapeDefaults = _dereq_('./line_shape_defaults');\nvar handleTextDefaults = _dereq_('./text_defaults');\nvar handleFillColorDefaults = _dereq_('./fillcolor_defaults');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    var len = handleXYDefaults(traceIn, traceOut, layout, coerce);\n    if(!len) traceOut.visible = false;\n\n    if(!traceOut.visible) return;\n\n    var stackGroupOpts = handleStackDefaults(traceIn, traceOut, layout, coerce);\n\n    var defaultMode = !stackGroupOpts && (len < constants.PTS_LINESONLY) ?\n        'lines+markers' : 'lines';\n    coerce('text');\n    coerce('hovertext');\n    coerce('mode', defaultMode);\n\n    if(subTypes.hasLines(traceOut)) {\n        handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n        handleLineShapeDefaults(traceIn, traceOut, coerce);\n        coerce('connectgaps');\n        coerce('line.simplify');\n    }\n\n    if(subTypes.hasMarkers(traceOut)) {\n        handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});\n    }\n\n    if(subTypes.hasText(traceOut)) {\n        coerce('texttemplate');\n        handleTextDefaults(traceIn, traceOut, layout, coerce);\n    }\n\n    var dfltHoverOn = [];\n\n    if(subTypes.hasMarkers(traceOut) || subTypes.hasText(traceOut)) {\n        coerce('cliponaxis');\n        coerce('marker.maxdisplayed');\n        dfltHoverOn.push('points');\n    }\n\n    // It's possible for this default to be changed by a later trace.\n    // We handle that case in some hacky code inside handleStackDefaults.\n    coerce('fill', stackGroupOpts ? stackGroupOpts.fillDflt : 'none');\n    if(traceOut.fill !== 'none') {\n        handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n        if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);\n    }\n\n    var lineColor = (traceOut.line || {}).color;\n    var markerColor = (traceOut.marker || {}).color;\n\n    if(traceOut.fill === 'tonext' || traceOut.fill === 'toself') {\n        dfltHoverOn.push('fills');\n    }\n    coerce('hoveron', dfltHoverOn.join('+') || 'points');\n    if(traceOut.hoveron !== 'fills') coerce('hovertemplate');\n    var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');\n    errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y'});\n    errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'y'});\n\n    Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":178,\"../../registry\":269,\"./attributes\":389,\"./constants\":393,\"./fillcolor_defaults\":397,\"./line_defaults\":402,\"./line_shape_defaults\":404,\"./marker_defaults\":408,\"./stack_defaults\":411,\"./subtypes\":413,\"./text_defaults\":414,\"./xy_defaults\":415}],397:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\nmodule.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coerce) {\n    var inheritColorFromMarker = false;\n\n    if(traceOut.marker) {\n        // don't try to inherit a color array\n        var markerColor = traceOut.marker.color;\n        var markerLineColor = (traceOut.marker.line || {}).color;\n\n        if(markerColor && !isArrayOrTypedArray(markerColor)) {\n            inheritColorFromMarker = markerColor;\n        } else if(markerLineColor && !isArrayOrTypedArray(markerLineColor)) {\n            inheritColorFromMarker = markerLineColor;\n        }\n    }\n\n    coerce('fillcolor', Color.addOpacity(\n        (traceOut.line || {}).color ||\n        inheritColorFromMarker ||\n        defaultColor, 0.5\n    ));\n};\n\n},{\"../../components/color\":52,\"../../lib\":178}],398:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n    var labels = {};\n\n    var mockGd = {_fullLayout: fullLayout};\n    var xa = Axes.getFromTrace(mockGd, trace, 'x');\n    var ya = Axes.getFromTrace(mockGd, trace, 'y');\n\n    labels.xLabel = Axes.tickText(xa, cdi.x, true).text;\n    labels.yLabel = Axes.tickText(ya, cdi.y, true).text;\n\n    return labels;\n};\n\n},{\"../../plots/cartesian/axes\":222}],399:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar subtypes = _dereq_('./subtypes');\n\n\nmodule.exports = function getTraceColor(trace, di) {\n    var lc, tc;\n\n    // TODO: text modes\n\n    if(trace.mode === 'lines') {\n        lc = trace.line.color;\n        return (lc && Color.opacity(lc)) ?\n            lc : trace.fillcolor;\n    } else if(trace.mode === 'none') {\n        return trace.fill ? trace.fillcolor : '';\n    } else {\n        var mc = di.mcc || (trace.marker || {}).color;\n        var mlc = di.mlcc || ((trace.marker || {}).line || {}).color;\n\n        tc = (mc && Color.opacity(mc)) ? mc :\n            (mlc && Color.opacity(mlc) &&\n                (di.mlw || ((trace.marker || {}).line || {}).width)) ? mlc : '';\n\n        if(tc) {\n            // make sure the points aren't TOO transparent\n            if(Color.opacity(tc) < 0.3) {\n                return Color.addOpacity(tc, 0.3);\n            } else return tc;\n        } else {\n            lc = (trace.line || {}).color;\n            return (lc && Color.opacity(lc) &&\n                subtypes.hasLines(trace) && trace.line.width) ?\n                    lc : trace.fillcolor;\n        }\n    }\n};\n\n},{\"../../components/color\":52,\"./subtypes\":413}],400:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Fx = _dereq_('../../components/fx');\nvar Registry = _dereq_('../../registry');\nvar getTraceColor = _dereq_('./get_trace_color');\nvar Color = _dereq_('../../components/color');\nvar fillText = Lib.fillText;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n    var cd = pointData.cd;\n    var trace = cd[0].trace;\n    var xa = pointData.xa;\n    var ya = pointData.ya;\n    var xpx = xa.c2p(xval);\n    var ypx = ya.c2p(yval);\n    var pt = [xpx, ypx];\n    var hoveron = trace.hoveron || '';\n    var minRad = (trace.mode.indexOf('markers') !== -1) ? 3 : 0.5;\n\n    // look for points to hover on first, then take fills only if we\n    // didn't find a point\n    if(hoveron.indexOf('points') !== -1) {\n        var dx = function(di) {\n            // dx and dy are used in compare modes - here we want to always\n            // prioritize the closest data point, at least as long as markers are\n            // the same size or nonexistent, but still try to prioritize small markers too.\n            var rad = Math.max(3, di.mrc || 0);\n            var kink = 1 - 1 / rad;\n            var dxRaw = Math.abs(xa.c2p(di.x) - xpx);\n            var d = (dxRaw < rad) ? (kink * dxRaw / rad) : (dxRaw - rad + kink);\n            return d;\n        };\n        var dy = function(di) {\n            var rad = Math.max(3, di.mrc || 0);\n            var kink = 1 - 1 / rad;\n            var dyRaw = Math.abs(ya.c2p(di.y) - ypx);\n            return (dyRaw < rad) ? (kink * dyRaw / rad) : (dyRaw - rad + kink);\n        };\n        var dxy = function(di) {\n            // scatter points: d.mrc is the calculated marker radius\n            // adjust the distance so if you're inside the marker it\n            // always will show up regardless of point size, but\n            // prioritize smaller points\n            var rad = Math.max(minRad, di.mrc || 0);\n            var dx = xa.c2p(di.x) - xpx;\n            var dy = ya.c2p(di.y) - ypx;\n            return Math.max(Math.sqrt(dx * dx + dy * dy) - rad, 1 - minRad / rad);\n        };\n        var distfn = Fx.getDistanceFunction(hovermode, dx, dy, dxy);\n\n        Fx.getClosest(cd, distfn, pointData);\n\n        // skip the rest (for this trace) if we didn't find a close point\n        if(pointData.index !== false) {\n            // the closest data point\n            var di = cd[pointData.index];\n            var xc = xa.c2p(di.x, true);\n            var yc = ya.c2p(di.y, true);\n            var rad = di.mrc || 1;\n\n            // now we're done using the whole `calcdata` array, replace the\n            // index with the original index (in case of inserted point from\n            // stacked area)\n            pointData.index = di.i;\n\n            var orientation = cd[0].t.orientation;\n            // TODO: for scatter and bar, option to show (sub)totals and\n            // raw data? Currently stacked and/or normalized bars just show\n            // the normalized individual sizes, so that's what I'm doing here\n            // for now.\n            var sizeVal = orientation && (di.sNorm || di.s);\n            var xLabelVal = (orientation === 'h') ? sizeVal : di.x;\n            var yLabelVal = (orientation === 'v') ? sizeVal : di.y;\n\n            Lib.extendFlat(pointData, {\n                color: getTraceColor(trace, di),\n\n                x0: xc - rad,\n                x1: xc + rad,\n                xLabelVal: xLabelVal,\n\n                y0: yc - rad,\n                y1: yc + rad,\n                yLabelVal: yLabelVal,\n\n                spikeDistance: dxy(di),\n                hovertemplate: trace.hovertemplate\n            });\n\n            fillText(di, trace, pointData);\n            Registry.getComponentMethod('errorbars', 'hoverInfo')(di, trace, pointData);\n\n            return [pointData];\n        }\n    }\n\n    // even if hoveron is 'fills', only use it if we have polygons too\n    if(hoveron.indexOf('fills') !== -1 && trace._polygons) {\n        var polygons = trace._polygons;\n        var polygonsIn = [];\n        var inside = false;\n        var xmin = Infinity;\n        var xmax = -Infinity;\n        var ymin = Infinity;\n        var ymax = -Infinity;\n\n        var i, j, polygon, pts, xCross, x0, x1, y0, y1;\n\n        for(i = 0; i < polygons.length; i++) {\n            polygon = polygons[i];\n            // TODO: this is not going to work right for curved edges, it will\n            // act as though they're straight. That's probably going to need\n            // the elements themselves to capture the events. Worth it?\n            if(polygon.contains(pt)) {\n                inside = !inside;\n                // TODO: need better than just the overall bounding box\n                polygonsIn.push(polygon);\n                ymin = Math.min(ymin, polygon.ymin);\n                ymax = Math.max(ymax, polygon.ymax);\n            }\n        }\n\n        if(inside) {\n            // constrain ymin/max to the visible plot, so the label goes\n            // at the middle of the piece you can see\n            ymin = Math.max(ymin, 0);\n            ymax = Math.min(ymax, ya._length);\n\n            // find the overall left-most and right-most points of the\n            // polygon(s) we're inside at their combined vertical midpoint.\n            // This is where we will draw the hover label.\n            // Note that this might not be the vertical midpoint of the\n            // whole trace, if it's disjoint.\n            var yAvg = (ymin + ymax) / 2;\n            for(i = 0; i < polygonsIn.length; i++) {\n                pts = polygonsIn[i].pts;\n                for(j = 1; j < pts.length; j++) {\n                    y0 = pts[j - 1][1];\n                    y1 = pts[j][1];\n                    if((y0 > yAvg) !== (y1 >= yAvg)) {\n                        x0 = pts[j - 1][0];\n                        x1 = pts[j][0];\n                        if(y1 - y0) {\n                            xCross = x0 + (x1 - x0) * (yAvg - y0) / (y1 - y0);\n                            xmin = Math.min(xmin, xCross);\n                            xmax = Math.max(xmax, xCross);\n                        }\n                    }\n                }\n            }\n\n            // constrain xmin/max to the visible plot now too\n            xmin = Math.max(xmin, 0);\n            xmax = Math.min(xmax, xa._length);\n\n            // get only fill or line color for the hover color\n            var color = Color.defaultLine;\n            if(Color.opacity(trace.fillcolor)) color = trace.fillcolor;\n            else if(Color.opacity((trace.line || {}).color)) {\n                color = trace.line.color;\n            }\n\n            Lib.extendFlat(pointData, {\n                // never let a 2D override 1D type as closest point\n                // also: no spikeDistance, it's not allowed for fills\n                distance: pointData.maxHoverDistance,\n                x0: xmin,\n                x1: xmax,\n                y0: yAvg,\n                y1: yAvg,\n                color: color,\n                hovertemplate: false\n            });\n\n            delete pointData.index;\n\n            if(trace.text && !Array.isArray(trace.text)) {\n                pointData.text = String(trace.text);\n            } else pointData.text = trace.name;\n\n            return [pointData];\n        }\n    }\n};\n\n},{\"../../components/color\":52,\"../../components/fx\":92,\"../../lib\":178,\"../../registry\":269,\"./get_trace_color\":399}],401:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar subtypes = _dereq_('./subtypes');\n\nmodule.exports = {\n    hasLines: subtypes.hasLines,\n    hasMarkers: subtypes.hasMarkers,\n    hasText: subtypes.hasText,\n    isBubble: subtypes.isBubble,\n\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    crossTraceDefaults: _dereq_('./cross_trace_defaults'),\n    calc: _dereq_('./calc').calc,\n    crossTraceCalc: _dereq_('./cross_trace_calc'),\n    arraysToCalcdata: _dereq_('./arrays_to_calcdata'),\n    plot: _dereq_('./plot'),\n    colorbar: _dereq_('./marker_colorbar'),\n    formatLabels: _dereq_('./format_labels'),\n    style: _dereq_('./style').style,\n    styleOnSelect: _dereq_('./style').styleOnSelect,\n    hoverPoints: _dereq_('./hover'),\n    selectPoints: _dereq_('./select'),\n    animatable: true,\n\n    moduleType: 'trace',\n    name: 'scatter',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: [\n        'cartesian', 'svg', 'symbols', 'errorBarsOK', 'showLegend', 'scatter-like',\n        'zoomScale'\n    ],\n    meta: {\n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"./arrays_to_calcdata\":388,\"./attributes\":389,\"./calc\":390,\"./cross_trace_calc\":394,\"./cross_trace_defaults\":395,\"./defaults\":396,\"./format_labels\":398,\"./hover\":400,\"./marker_colorbar\":407,\"./plot\":409,\"./select\":410,\"./style\":412,\"./subtypes\":413}],402:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\n\nmodule.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout, coerce, opts) {\n    var markerColor = (traceIn.marker || {}).color;\n\n    coerce('line.color', defaultColor);\n\n    if(hasColorscale(traceIn, 'line')) {\n        colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'});\n    } else {\n        var lineColorDflt = (isArrayOrTypedArray(markerColor) ? false : markerColor) || defaultColor;\n        coerce('line.color', lineColorDflt);\n    }\n\n    coerce('line.width');\n    if(!(opts || {}).noDash) coerce('line.dash');\n};\n\n},{\"../../components/colorscale/defaults\":62,\"../../components/colorscale/helpers\":63,\"../../lib\":178}],403:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar numConstants = _dereq_('../../constants/numerical');\nvar BADNUM = numConstants.BADNUM;\nvar LOG_CLIP = numConstants.LOG_CLIP;\nvar LOG_CLIP_PLUS = LOG_CLIP + 0.5;\nvar LOG_CLIP_MINUS = LOG_CLIP - 0.5;\nvar Lib = _dereq_('../../lib');\nvar segmentsIntersect = Lib.segmentsIntersect;\nvar constrain = Lib.constrain;\nvar constants = _dereq_('./constants');\n\n\nmodule.exports = function linePoints(d, opts) {\n    var xa = opts.xaxis;\n    var ya = opts.yaxis;\n    var xLog = xa.type === 'log';\n    var yLog = ya.type === 'log';\n    var xLen = xa._length;\n    var yLen = ya._length;\n    var connectGaps = opts.connectGaps;\n    var baseTolerance = opts.baseTolerance;\n    var shape = opts.shape;\n    var linear = shape === 'linear';\n    var fill = opts.fill && opts.fill !== 'none';\n    var segments = [];\n    var minTolerance = constants.minTolerance;\n    var len = d.length;\n    var pts = new Array(len);\n    var pti = 0;\n\n    var i;\n\n    // pt variables are pixel coordinates [x,y] of one point\n    // these four are the outputs of clustering on a line\n    var clusterStartPt, clusterEndPt, clusterHighPt, clusterLowPt;\n\n    // \"this\" is the next point we're considering adding to the cluster\n    var thisPt;\n\n    // did we encounter the high point first, then a low point, or vice versa?\n    var clusterHighFirst;\n\n    // the first two points in the cluster determine its unit vector\n    // so the second is always in the \"High\" direction\n    var clusterUnitVector;\n\n    // the pixel delta from clusterStartPt\n    var thisVector;\n\n    // val variables are (signed) pixel distances along the cluster vector\n    var clusterRefDist, clusterHighVal, clusterLowVal, thisVal;\n\n    // deviation variables are (signed) pixel distances normal to the cluster vector\n    var clusterMinDeviation, clusterMaxDeviation, thisDeviation;\n\n    // turn one calcdata point into pixel coordinates\n    function getPt(index) {\n        var di = d[index];\n        if(!di) return false;\n        var x = opts.linearized ? xa.l2p(di.x) : xa.c2p(di.x);\n        var y = opts.linearized ? ya.l2p(di.y) : ya.c2p(di.y);\n\n        // if non-positive log values, set them VERY far off-screen\n        // so the line looks essentially straight from the previous point.\n        if(x === BADNUM) {\n            if(xLog) x = xa.c2p(di.x, true);\n            if(x === BADNUM) return false;\n            // If BOTH were bad log values, make the line follow a constant\n            // exponent rather than a constant slope\n            if(yLog && y === BADNUM) {\n                x *= Math.abs(xa._m * yLen * (xa._m > 0 ? LOG_CLIP_PLUS : LOG_CLIP_MINUS) /\n                    (ya._m * xLen * (ya._m > 0 ? LOG_CLIP_PLUS : LOG_CLIP_MINUS)));\n            }\n            x *= 1000;\n        }\n        if(y === BADNUM) {\n            if(yLog) y = ya.c2p(di.y, true);\n            if(y === BADNUM) return false;\n            y *= 1000;\n        }\n        return [x, y];\n    }\n\n    function crossesViewport(xFrac0, yFrac0, xFrac1, yFrac1) {\n        var dx = xFrac1 - xFrac0;\n        var dy = yFrac1 - yFrac0;\n        var dx0 = 0.5 - xFrac0;\n        var dy0 = 0.5 - yFrac0;\n        var norm2 = dx * dx + dy * dy;\n        var dot = dx * dx0 + dy * dy0;\n        if(dot > 0 && dot < norm2) {\n            var cross = dx0 * dy - dy0 * dx;\n            if(cross * cross < norm2) return true;\n        }\n    }\n\n    var latestXFrac, latestYFrac;\n    // if we're off-screen, increase tolerance over baseTolerance\n    function getTolerance(pt, nextPt) {\n        var xFrac = pt[0] / xLen;\n        var yFrac = pt[1] / yLen;\n        var offScreenFraction = Math.max(0, -xFrac, xFrac - 1, -yFrac, yFrac - 1);\n        if(offScreenFraction && (latestXFrac !== undefined) &&\n            crossesViewport(xFrac, yFrac, latestXFrac, latestYFrac)\n        ) {\n            offScreenFraction = 0;\n        }\n        if(offScreenFraction && nextPt &&\n            crossesViewport(xFrac, yFrac, nextPt[0] / xLen, nextPt[1] / yLen)\n        ) {\n            offScreenFraction = 0;\n        }\n\n        return (1 + constants.toleranceGrowth * offScreenFraction) * baseTolerance;\n    }\n\n    function ptDist(pt1, pt2) {\n        var dx = pt1[0] - pt2[0];\n        var dy = pt1[1] - pt2[1];\n        return Math.sqrt(dx * dx + dy * dy);\n    }\n\n    // last bit of filtering: clip paths that are VERY far off-screen\n    // so we don't get near the browser's hard limit (+/- 2^29 px in Chrome and FF)\n\n    var maxScreensAway = constants.maxScreensAway;\n\n    // find the intersections between the segment from pt1 to pt2\n    // and the large rectangle maxScreensAway around the viewport\n    // if one of pt1 and pt2 is inside and the other outside, there\n    // will be only one intersection.\n    // if both are outside there will be 0 or 2 intersections\n    // (or 1 if it's right at a corner - we'll treat that like 0)\n    // returns an array of intersection pts\n    var xEdge0 = -xLen * maxScreensAway;\n    var xEdge1 = xLen * (1 + maxScreensAway);\n    var yEdge0 = -yLen * maxScreensAway;\n    var yEdge1 = yLen * (1 + maxScreensAway);\n    var edges = [\n        [xEdge0, yEdge0, xEdge1, yEdge0],\n        [xEdge1, yEdge0, xEdge1, yEdge1],\n        [xEdge1, yEdge1, xEdge0, yEdge1],\n        [xEdge0, yEdge1, xEdge0, yEdge0]\n    ];\n    var xEdge, yEdge, lastXEdge, lastYEdge, lastFarPt, edgePt;\n\n    // for linear line shape, edge intersections should be linearly interpolated\n    // spline uses this too, which isn't precisely correct but is actually pretty\n    // good, because Catmull-Rom weights far-away points less in creating the curvature\n    function getLinearEdgeIntersections(pt1, pt2) {\n        var out = [];\n        var ptCount = 0;\n        for(var i = 0; i < 4; i++) {\n            var edge = edges[i];\n            var ptInt = segmentsIntersect(\n                pt1[0], pt1[1], pt2[0], pt2[1],\n                edge[0], edge[1], edge[2], edge[3]\n            );\n            if(ptInt && (!ptCount ||\n                Math.abs(ptInt.x - out[0][0]) > 1 ||\n                Math.abs(ptInt.y - out[0][1]) > 1\n            )) {\n                ptInt = [ptInt.x, ptInt.y];\n                // if we have 2 intersections, make sure the closest one to pt1 comes first\n                if(ptCount && ptDist(ptInt, pt1) < ptDist(out[0], pt1)) out.unshift(ptInt);\n                else out.push(ptInt);\n                ptCount++;\n            }\n        }\n        return out;\n    }\n\n    function onlyConstrainedPoint(pt) {\n        if(pt[0] < xEdge0 || pt[0] > xEdge1 || pt[1] < yEdge0 || pt[1] > yEdge1) {\n            return [constrain(pt[0], xEdge0, xEdge1), constrain(pt[1], yEdge0, yEdge1)];\n        }\n    }\n\n    function sameEdge(pt1, pt2) {\n        if(pt1[0] === pt2[0] && (pt1[0] === xEdge0 || pt1[0] === xEdge1)) return true;\n        if(pt1[1] === pt2[1] && (pt1[1] === yEdge0 || pt1[1] === yEdge1)) return true;\n    }\n\n    // for line shapes hv and vh, movement in the two dimensions is decoupled,\n    // so all we need to do is constrain each dimension independently\n    function getHVEdgeIntersections(pt1, pt2) {\n        var out = [];\n        var ptInt1 = onlyConstrainedPoint(pt1);\n        var ptInt2 = onlyConstrainedPoint(pt2);\n        if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n        if(ptInt1) out.push(ptInt1);\n        if(ptInt2) out.push(ptInt2);\n        return out;\n    }\n\n    // hvh and vhv we sometimes have to move one of the intersection points\n    // out BEYOND the clipping rect, by a maximum of a factor of 2, so that\n    // the midpoint line is drawn in the right place\n    function getABAEdgeIntersections(dim, limit0, limit1) {\n        return function(pt1, pt2) {\n            var ptInt1 = onlyConstrainedPoint(pt1);\n            var ptInt2 = onlyConstrainedPoint(pt2);\n\n            var out = [];\n            if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n            if(ptInt1) out.push(ptInt1);\n            if(ptInt2) out.push(ptInt2);\n\n            var midShift = 2 * Lib.constrain((pt1[dim] + pt2[dim]) / 2, limit0, limit1) -\n                ((ptInt1 || pt1)[dim] + (ptInt2 || pt2)[dim]);\n            if(midShift) {\n                var ptToAlter;\n                if(ptInt1 && ptInt2) {\n                    ptToAlter = (midShift > 0 === ptInt1[dim] > ptInt2[dim]) ? ptInt1 : ptInt2;\n                } else ptToAlter = ptInt1 || ptInt2;\n\n                ptToAlter[dim] += midShift;\n            }\n\n            return out;\n        };\n    }\n\n    var getEdgeIntersections;\n    if(shape === 'linear' || shape === 'spline') {\n        getEdgeIntersections = getLinearEdgeIntersections;\n    } else if(shape === 'hv' || shape === 'vh') {\n        getEdgeIntersections = getHVEdgeIntersections;\n    } else if(shape === 'hvh') getEdgeIntersections = getABAEdgeIntersections(0, xEdge0, xEdge1);\n    else if(shape === 'vhv') getEdgeIntersections = getABAEdgeIntersections(1, yEdge0, yEdge1);\n\n    // a segment pt1->pt2 entirely outside the nearby region:\n    // find the corner it gets closest to touching\n    function getClosestCorner(pt1, pt2) {\n        var dx = pt2[0] - pt1[0];\n        var m = (pt2[1] - pt1[1]) / dx;\n        var b = (pt1[1] * pt2[0] - pt2[1] * pt1[0]) / dx;\n\n        if(b > 0) return [m > 0 ? xEdge0 : xEdge1, yEdge1];\n        else return [m > 0 ? xEdge1 : xEdge0, yEdge0];\n    }\n\n    function updateEdge(pt) {\n        var x = pt[0];\n        var y = pt[1];\n        var xSame = x === pts[pti - 1][0];\n        var ySame = y === pts[pti - 1][1];\n        // duplicate point?\n        if(xSame && ySame) return;\n        if(pti > 1) {\n            // backtracking along an edge?\n            var xSame2 = x === pts[pti - 2][0];\n            var ySame2 = y === pts[pti - 2][1];\n            if(xSame && (x === xEdge0 || x === xEdge1) && xSame2) {\n                if(ySame2) pti--; // backtracking exactly - drop prev pt and don't add\n                else pts[pti - 1] = pt; // not exact: replace the prev pt\n            } else if(ySame && (y === yEdge0 || y === yEdge1) && ySame2) {\n                if(xSame2) pti--;\n                else pts[pti - 1] = pt;\n            } else pts[pti++] = pt;\n        } else pts[pti++] = pt;\n    }\n\n    function updateEdgesForReentry(pt) {\n        // if we're outside the nearby region and going back in,\n        // we may need to loop around a corner point\n        if(pts[pti - 1][0] !== pt[0] && pts[pti - 1][1] !== pt[1]) {\n            updateEdge([lastXEdge, lastYEdge]);\n        }\n        updateEdge(pt);\n        lastFarPt = null;\n        lastXEdge = lastYEdge = 0;\n    }\n\n    function addPt(pt) {\n        latestXFrac = pt[0] / xLen;\n        latestYFrac = pt[1] / yLen;\n        // Are we more than maxScreensAway off-screen any direction?\n        // if so, clip to this box, but in such a way that on-screen\n        // drawing is unchanged\n        xEdge = (pt[0] < xEdge0) ? xEdge0 : (pt[0] > xEdge1) ? xEdge1 : 0;\n        yEdge = (pt[1] < yEdge0) ? yEdge0 : (pt[1] > yEdge1) ? yEdge1 : 0;\n        if(xEdge || yEdge) {\n            if(!pti) {\n                // to get fills right - if first point is far, push it toward the\n                // screen in whichever direction(s) are far\n\n                pts[pti++] = [xEdge || pt[0], yEdge || pt[1]];\n            } else if(lastFarPt) {\n                // both this point and the last are outside the nearby region\n                // check if we're crossing the nearby region\n                var intersections = getEdgeIntersections(lastFarPt, pt);\n                if(intersections.length > 1) {\n                    updateEdgesForReentry(intersections[0]);\n                    pts[pti++] = intersections[1];\n                }\n            } else {\n                // we're leaving the nearby region - add the point where we left it\n\n                edgePt = getEdgeIntersections(pts[pti - 1], pt)[0];\n                pts[pti++] = edgePt;\n            }\n\n            var lastPt = pts[pti - 1];\n            if(xEdge && yEdge && (lastPt[0] !== xEdge || lastPt[1] !== yEdge)) {\n                // we've gone out beyond a new corner: add the corner too\n                // so that the next point will take the right winding\n                if(lastFarPt) {\n                    if(lastXEdge !== xEdge && lastYEdge !== yEdge) {\n                        if(lastXEdge && lastYEdge) {\n                            // we've gone around to an opposite corner - we\n                            // need to add the correct extra corner\n                            // in order to get the right winding\n                            updateEdge(getClosestCorner(lastFarPt, pt));\n                        } else {\n                            // we're coming from a far edge - the extra corner\n                            // we need is determined uniquely by the sectors\n                            updateEdge([lastXEdge || xEdge, lastYEdge || yEdge]);\n                        }\n                    } else if(lastXEdge && lastYEdge) {\n                        updateEdge([lastXEdge, lastYEdge]);\n                    }\n                }\n                updateEdge([xEdge, yEdge]);\n            } else if((lastXEdge - xEdge) && (lastYEdge - yEdge)) {\n                // we're coming from an edge or far corner to an edge - again the\n                // extra corner we need is uniquely determined by the sectors\n                updateEdge([xEdge || lastXEdge, yEdge || lastYEdge]);\n            }\n            lastFarPt = pt;\n            lastXEdge = xEdge;\n            lastYEdge = yEdge;\n        } else {\n            if(lastFarPt) {\n                // this point is in range but the previous wasn't: add its entry pt first\n                updateEdgesForReentry(getEdgeIntersections(lastFarPt, pt)[0]);\n            }\n\n            pts[pti++] = pt;\n        }\n    }\n\n    // loop over ALL points in this trace\n    for(i = 0; i < len; i++) {\n        clusterStartPt = getPt(i);\n        if(!clusterStartPt) continue;\n\n        pti = 0;\n        lastFarPt = null;\n        addPt(clusterStartPt);\n\n        // loop over one segment of the trace\n        for(i++; i < len; i++) {\n            clusterHighPt = getPt(i);\n            if(!clusterHighPt) {\n                if(connectGaps) continue;\n                else break;\n            }\n\n            // can't decimate if nonlinear line shape\n            // TODO: we *could* decimate [hv]{2,3} shapes if we restricted clusters to horz or vert again\n            // but spline would be verrry awkward to decimate\n            if(!linear || !opts.simplify) {\n                addPt(clusterHighPt);\n                continue;\n            }\n\n            var nextPt = getPt(i + 1);\n\n            clusterRefDist = ptDist(clusterHighPt, clusterStartPt);\n\n            // #3147 - always include the very first and last points for fills\n            if(!(fill && (pti === 0 || pti === len - 1)) &&\n                clusterRefDist < getTolerance(clusterHighPt, nextPt) * minTolerance) continue;\n\n            clusterUnitVector = [\n                (clusterHighPt[0] - clusterStartPt[0]) / clusterRefDist,\n                (clusterHighPt[1] - clusterStartPt[1]) / clusterRefDist\n            ];\n\n            clusterLowPt = clusterStartPt;\n            clusterHighVal = clusterRefDist;\n            clusterLowVal = clusterMinDeviation = clusterMaxDeviation = 0;\n            clusterHighFirst = false;\n            clusterEndPt = clusterHighPt;\n\n            // loop over one cluster of points that collapse onto one line\n            for(i++; i < d.length; i++) {\n                thisPt = nextPt;\n                nextPt = getPt(i + 1);\n                if(!thisPt) {\n                    if(connectGaps) continue;\n                    else break;\n                }\n                thisVector = [\n                    thisPt[0] - clusterStartPt[0],\n                    thisPt[1] - clusterStartPt[1]\n                ];\n                // cross product (or dot with normal to the cluster vector)\n                thisDeviation = thisVector[0] * clusterUnitVector[1] - thisVector[1] * clusterUnitVector[0];\n                clusterMinDeviation = Math.min(clusterMinDeviation, thisDeviation);\n                clusterMaxDeviation = Math.max(clusterMaxDeviation, thisDeviation);\n\n                if(clusterMaxDeviation - clusterMinDeviation > getTolerance(thisPt, nextPt)) break;\n\n                clusterEndPt = thisPt;\n                thisVal = thisVector[0] * clusterUnitVector[0] + thisVector[1] * clusterUnitVector[1];\n\n                if(thisVal > clusterHighVal) {\n                    clusterHighVal = thisVal;\n                    clusterHighPt = thisPt;\n                    clusterHighFirst = false;\n                } else if(thisVal < clusterLowVal) {\n                    clusterLowVal = thisVal;\n                    clusterLowPt = thisPt;\n                    clusterHighFirst = true;\n                }\n            }\n\n            // insert this cluster into pts\n            // we've already inserted the start pt, now check if we have high and low pts\n            if(clusterHighFirst) {\n                addPt(clusterHighPt);\n                if(clusterEndPt !== clusterLowPt) addPt(clusterLowPt);\n            } else {\n                if(clusterLowPt !== clusterStartPt) addPt(clusterLowPt);\n                if(clusterEndPt !== clusterHighPt) addPt(clusterHighPt);\n            }\n            // and finally insert the end pt\n            addPt(clusterEndPt);\n\n            // have we reached the end of this segment?\n            if(i >= d.length || !thisPt) break;\n\n            // otherwise we have an out-of-cluster point to insert as next clusterStartPt\n            addPt(thisPt);\n            clusterStartPt = thisPt;\n        }\n\n        // to get fills right - repeat what we did at the start\n        if(lastFarPt) updateEdge([lastXEdge || lastFarPt[0], lastYEdge || lastFarPt[1]]);\n\n        segments.push(pts.slice(0, pti));\n    }\n\n    return segments;\n};\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"./constants\":393}],404:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n// common to 'scatter' and 'scatterternary'\nmodule.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) {\n    var shape = coerce('line.shape');\n    if(shape === 'spline') coerce('line.smoothing');\n};\n\n},{}],405:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar LINKEDFILLS = {tonextx: 1, tonexty: 1, tonext: 1};\n\nmodule.exports = function linkTraces(gd, plotinfo, cdscatter) {\n    var trace, i, group, prevtrace, groupIndex;\n\n    // first sort traces to keep stacks & filled-together groups together\n    var groupIndices = {};\n    var needsSort = false;\n    var prevGroupIndex = -1;\n    var nextGroupIndex = 0;\n    var prevUnstackedGroupIndex = -1;\n    for(i = 0; i < cdscatter.length; i++) {\n        trace = cdscatter[i][0].trace;\n        group = trace.stackgroup || '';\n        if(group) {\n            if(group in groupIndices) {\n                groupIndex = groupIndices[group];\n            } else {\n                groupIndex = groupIndices[group] = nextGroupIndex;\n                nextGroupIndex++;\n            }\n        } else if(trace.fill in LINKEDFILLS && prevUnstackedGroupIndex >= 0) {\n            groupIndex = prevUnstackedGroupIndex;\n        } else {\n            groupIndex = prevUnstackedGroupIndex = nextGroupIndex;\n            nextGroupIndex++;\n        }\n\n        if(groupIndex < prevGroupIndex) needsSort = true;\n        trace._groupIndex = prevGroupIndex = groupIndex;\n    }\n\n    var cdscatterSorted = cdscatter.slice();\n    if(needsSort) {\n        cdscatterSorted.sort(function(a, b) {\n            var traceA = a[0].trace;\n            var traceB = b[0].trace;\n            return (traceA._groupIndex - traceB._groupIndex) ||\n                (traceA.index - traceB.index);\n        });\n    }\n\n    // now link traces to each other\n    var prevtraces = {};\n    for(i = 0; i < cdscatterSorted.length; i++) {\n        trace = cdscatterSorted[i][0].trace;\n        group = trace.stackgroup || '';\n\n        // Note: The check which ensures all cdscatter here are for the same axis and\n        // are either cartesian or scatterternary has been removed. This code assumes\n        // the passed scattertraces have been filtered to the proper plot types and\n        // the proper subplots.\n        if(trace.visible === true) {\n            trace._nexttrace = null;\n\n            if(trace.fill in LINKEDFILLS) {\n                prevtrace = prevtraces[group];\n                trace._prevtrace = prevtrace || null;\n\n                if(prevtrace) {\n                    prevtrace._nexttrace = trace;\n                }\n            }\n\n            trace._ownfill = (trace.fill && (\n                trace.fill.substr(0, 6) === 'tozero' ||\n                trace.fill === 'toself' ||\n                (trace.fill.substr(0, 2) === 'to' && !trace._prevtrace)\n            ));\n\n            prevtraces[group] = trace;\n        } else {\n            trace._prevtrace = trace._nexttrace = trace._ownfill = null;\n        }\n    }\n\n    return cdscatterSorted;\n};\n\n},{}],406:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\n\n// used in the drawing step for 'scatter' and 'scattegeo' and\n// in the convert step for 'scatter3d'\nmodule.exports = function makeBubbleSizeFn(trace) {\n    var marker = trace.marker;\n    var sizeRef = marker.sizeref || 1;\n    var sizeMin = marker.sizemin || 0;\n\n    // for bubble charts, allow scaling the provided value linearly\n    // and by area or diameter.\n    // Note this only applies to the array-value sizes\n\n    var baseFn = (marker.sizemode === 'area') ?\n        function(v) { return Math.sqrt(v / sizeRef); } :\n        function(v) { return v / sizeRef; };\n\n    // TODO add support for position/negative bubbles?\n    // TODO add 'sizeoffset' attribute?\n    return function(v) {\n        var baseSize = baseFn(v / 2);\n\n        // don't show non-numeric and negative sizes\n        return (isNumeric(baseSize) && (baseSize > 0)) ?\n            Math.max(baseSize, sizeMin) :\n            0;\n    };\n};\n\n},{\"fast-isnumeric\":18}],407:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n    container: 'marker',\n    min: 'cmin',\n    max: 'cmax'\n};\n\n},{}],408:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\n\nvar subTypes = _dereq_('./subtypes');\n\n/*\n * opts: object of flags to control features not all marker users support\n *   noLine: caller does not support marker lines\n *   gradient: caller supports gradients\n *   noSelect: caller does not support selected/unselected attribute containers\n */\nmodule.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout, coerce, opts) {\n    var isBubble = subTypes.isBubble(traceIn);\n    var lineColor = (traceIn.line || {}).color;\n    var defaultMLC;\n\n    opts = opts || {};\n\n    // marker.color inherit from line.color (even if line.color is an array)\n    if(lineColor) defaultColor = lineColor;\n\n    coerce('marker.symbol');\n    coerce('marker.opacity', isBubble ? 0.7 : 1);\n    coerce('marker.size');\n\n    coerce('marker.color', defaultColor);\n    if(hasColorscale(traceIn, 'marker')) {\n        colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'});\n    }\n\n    if(!opts.noSelect) {\n        coerce('selected.marker.color');\n        coerce('unselected.marker.color');\n        coerce('selected.marker.size');\n        coerce('unselected.marker.size');\n    }\n\n    if(!opts.noLine) {\n        // if there's a line with a different color than the marker, use\n        // that line color as the default marker line color\n        // (except when it's an array)\n        // mostly this is for transparent markers to behave nicely\n        if(lineColor && !Array.isArray(lineColor) && (traceOut.marker.color !== lineColor)) {\n            defaultMLC = lineColor;\n        } else if(isBubble) defaultMLC = Color.background;\n        else defaultMLC = Color.defaultLine;\n\n        coerce('marker.line.color', defaultMLC);\n        if(hasColorscale(traceIn, 'marker.line')) {\n            colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.line.', cLetter: 'c'});\n        }\n\n        coerce('marker.line.width', isBubble ? 1 : 0);\n    }\n\n    if(isBubble) {\n        coerce('marker.sizeref');\n        coerce('marker.sizemin');\n        coerce('marker.sizemode');\n    }\n\n    if(opts.gradient) {\n        var gradientType = coerce('marker.gradient.type');\n        if(gradientType !== 'none') {\n            coerce('marker.gradient.color');\n        }\n    }\n};\n\n},{\"../../components/color\":52,\"../../components/colorscale/defaults\":62,\"../../components/colorscale/helpers\":63,\"./subtypes\":413}],409:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar ensureSingle = Lib.ensureSingle;\nvar identity = Lib.identity;\nvar Drawing = _dereq_('../../components/drawing');\n\nvar subTypes = _dereq_('./subtypes');\nvar linePoints = _dereq_('./line_points');\nvar linkTraces = _dereq_('./link_traces');\nvar polygonTester = _dereq_('../../lib/polygon').tester;\n\nmodule.exports = function plot(gd, plotinfo, cdscatter, scatterLayer, transitionOpts, makeOnCompleteCallback) {\n    var join, onComplete;\n\n    // If transition config is provided, then it is only a partial replot and traces not\n    // updated are removed.\n    var isFullReplot = !transitionOpts;\n    var hasTransition = !!transitionOpts && transitionOpts.duration > 0;\n\n    // Link traces so the z-order of fill layers is correct\n    var cdscatterSorted = linkTraces(gd, plotinfo, cdscatter);\n\n    join = scatterLayer.selectAll('g.trace')\n        .data(cdscatterSorted, function(d) { return d[0].trace.uid; });\n\n    // Append new traces:\n    join.enter().append('g')\n        .attr('class', function(d) {\n            return 'trace scatter trace' + d[0].trace.uid;\n        })\n        .style('stroke-miterlimit', 2);\n    join.order();\n\n    createFills(gd, join, plotinfo);\n\n    if(hasTransition) {\n        if(makeOnCompleteCallback) {\n            // If it was passed a callback to register completion, make a callback. If\n            // this is created, then it must be executed on completion, otherwise the\n            // pos-transition redraw will not execute:\n            onComplete = makeOnCompleteCallback();\n        }\n\n        var transition = d3.transition()\n            .duration(transitionOpts.duration)\n            .ease(transitionOpts.easing)\n            .each('end', function() {\n                onComplete && onComplete();\n            })\n            .each('interrupt', function() {\n                onComplete && onComplete();\n            });\n\n        transition.each(function() {\n            // Must run the selection again since otherwise enters/updates get grouped together\n            // and these get executed out of order. Except we need them in order!\n            scatterLayer.selectAll('g.trace').each(function(d, i) {\n                plotOne(gd, i, plotinfo, d, cdscatterSorted, this, transitionOpts);\n            });\n        });\n    } else {\n        join.each(function(d, i) {\n            plotOne(gd, i, plotinfo, d, cdscatterSorted, this, transitionOpts);\n        });\n    }\n\n    if(isFullReplot) {\n        join.exit().remove();\n    }\n\n    // remove paths that didn't get used\n    scatterLayer.selectAll('path:not([d])').remove();\n};\n\nfunction createFills(gd, traceJoin, plotinfo) {\n    traceJoin.each(function(d) {\n        var fills = ensureSingle(d3.select(this), 'g', 'fills');\n        Drawing.setClipUrl(fills, plotinfo.layerClipId, gd);\n\n        var trace = d[0].trace;\n\n        var fillData = [];\n        if(trace._ownfill) fillData.push('_ownFill');\n        if(trace._nexttrace) fillData.push('_nextFill');\n\n        var fillJoin = fills.selectAll('g').data(fillData, identity);\n\n        fillJoin.enter().append('g');\n\n        fillJoin.exit()\n            .each(function(d) { trace[d] = null; })\n            .remove();\n\n        fillJoin.order().each(function(d) {\n            // make a path element inside the fill group, just so\n            // we can give it its own data later on and the group can\n            // keep its simple '_*Fill' data\n            trace[d] = ensureSingle(d3.select(this), 'path', 'js-fill');\n        });\n    });\n}\n\nfunction plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transitionOpts) {\n    var i;\n\n    // Since this has been reorganized and we're executing this on individual traces,\n    // we need to pass it the full list of cdscatter as well as this trace's index (idx)\n    // since it does an internal n^2 loop over comparisons with other traces:\n    selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll);\n\n    var hasTransition = !!transitionOpts && transitionOpts.duration > 0;\n\n    function transition(selection) {\n        return hasTransition ? selection.transition() : selection;\n    }\n\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    var trace = cdscatter[0].trace;\n    var line = trace.line;\n    var tr = d3.select(element);\n\n    var errorBarGroup = ensureSingle(tr, 'g', 'errorbars');\n    var lines = ensureSingle(tr, 'g', 'lines');\n    var points = ensureSingle(tr, 'g', 'points');\n    var text = ensureSingle(tr, 'g', 'text');\n\n    // error bars are at the bottom\n    Registry.getComponentMethod('errorbars', 'plot')(gd, errorBarGroup, plotinfo, transitionOpts);\n\n    if(trace.visible !== true) return;\n\n    transition(tr).style('opacity', trace.opacity);\n\n    // BUILD LINES AND FILLS\n    var ownFillEl3, tonext;\n    var ownFillDir = trace.fill.charAt(trace.fill.length - 1);\n    if(ownFillDir !== 'x' && ownFillDir !== 'y') ownFillDir = '';\n\n    // store node for tweaking by selectPoints\n    cdscatter[0][plotinfo.isRangePlot ? 'nodeRangePlot3' : 'node3'] = tr;\n\n    var prevRevpath = '';\n    var prevPolygons = [];\n    var prevtrace = trace._prevtrace;\n\n    if(prevtrace) {\n        prevRevpath = prevtrace._prevRevpath || '';\n        tonext = prevtrace._nextFill;\n        prevPolygons = prevtrace._polygons;\n    }\n\n    var thispath;\n    var thisrevpath;\n    // fullpath is all paths for this curve, joined together straight\n    // across gaps, for filling\n    var fullpath = '';\n    // revpath is fullpath reversed, for fill-to-next\n    var revpath = '';\n    // functions for converting a point array to a path\n    var pathfn, revpathbase, revpathfn;\n    // variables used before and after the data join\n    var pt0, lastSegment, pt1, thisPolygons;\n\n    // initialize line join data / method\n    var segments = [];\n    var makeUpdate = Lib.noop;\n\n    ownFillEl3 = trace._ownFill;\n\n    if(subTypes.hasLines(trace) || trace.fill !== 'none') {\n        if(tonext) {\n            // This tells .style which trace to use for fill information:\n            tonext.datum(cdscatter);\n        }\n\n        if(['hv', 'vh', 'hvh', 'vhv'].indexOf(line.shape) !== -1) {\n            pathfn = Drawing.steps(line.shape);\n            revpathbase = Drawing.steps(\n                line.shape.split('').reverse().join('')\n            );\n        } else if(line.shape === 'spline') {\n            pathfn = revpathbase = function(pts) {\n                var pLast = pts[pts.length - 1];\n                if(pts.length > 1 && pts[0][0] === pLast[0] && pts[0][1] === pLast[1]) {\n                    // identical start and end points: treat it as a\n                    // closed curve so we don't get a kink\n                    return Drawing.smoothclosed(pts.slice(1), line.smoothing);\n                } else {\n                    return Drawing.smoothopen(pts, line.smoothing);\n                }\n            };\n        } else {\n            pathfn = revpathbase = function(pts) {\n                return 'M' + pts.join('L');\n            };\n        }\n\n        revpathfn = function(pts) {\n            // note: this is destructive (reverses pts in place) so can't use pts after this\n            return revpathbase(pts.reverse());\n        };\n\n        segments = linePoints(cdscatter, {\n            xaxis: xa,\n            yaxis: ya,\n            connectGaps: trace.connectgaps,\n            baseTolerance: Math.max(line.width || 1, 3) / 4,\n            shape: line.shape,\n            simplify: line.simplify,\n            fill: trace.fill\n        });\n\n        // since we already have the pixel segments here, use them to make\n        // polygons for hover on fill\n        // TODO: can we skip this if hoveron!=fills? That would mean we\n        // need to redraw when you change hoveron...\n        thisPolygons = trace._polygons = new Array(segments.length);\n        for(i = 0; i < segments.length; i++) {\n            trace._polygons[i] = polygonTester(segments[i]);\n        }\n\n        if(segments.length) {\n            pt0 = segments[0][0];\n            lastSegment = segments[segments.length - 1];\n            pt1 = lastSegment[lastSegment.length - 1];\n        }\n\n        makeUpdate = function(isEnter) {\n            return function(pts) {\n                thispath = pathfn(pts);\n                thisrevpath = revpathfn(pts);\n                if(!fullpath) {\n                    fullpath = thispath;\n                    revpath = thisrevpath;\n                } else if(ownFillDir) {\n                    fullpath += 'L' + thispath.substr(1);\n                    revpath = thisrevpath + ('L' + revpath.substr(1));\n                } else {\n                    fullpath += 'Z' + thispath;\n                    revpath = thisrevpath + 'Z' + revpath;\n                }\n\n                if(subTypes.hasLines(trace) && pts.length > 1) {\n                    var el = d3.select(this);\n\n                    // This makes the coloring work correctly:\n                    el.datum(cdscatter);\n\n                    if(isEnter) {\n                        transition(el.style('opacity', 0)\n                            .attr('d', thispath)\n                            .call(Drawing.lineGroupStyle))\n                                .style('opacity', 1);\n                    } else {\n                        var sel = transition(el);\n                        sel.attr('d', thispath);\n                        Drawing.singleLineStyle(cdscatter, sel);\n                    }\n                }\n            };\n        };\n    }\n\n    var lineJoin = lines.selectAll('.js-line').data(segments);\n\n    transition(lineJoin.exit())\n        .style('opacity', 0)\n        .remove();\n\n    lineJoin.each(makeUpdate(false));\n\n    lineJoin.enter().append('path')\n        .classed('js-line', true)\n        .style('vector-effect', 'non-scaling-stroke')\n        .call(Drawing.lineGroupStyle)\n        .each(makeUpdate(true));\n\n    Drawing.setClipUrl(lineJoin, plotinfo.layerClipId, gd);\n\n    function clearFill(selection) {\n        transition(selection).attr('d', 'M0,0Z');\n    }\n\n    if(segments.length) {\n        if(ownFillEl3) {\n            ownFillEl3.datum(cdscatter);\n            if(pt0 && pt1) {\n                if(ownFillDir) {\n                    if(ownFillDir === 'y') {\n                        pt0[1] = pt1[1] = ya.c2p(0, true);\n                    } else if(ownFillDir === 'x') {\n                        pt0[0] = pt1[0] = xa.c2p(0, true);\n                    }\n\n                    // fill to zero: full trace path, plus extension of\n                    // the endpoints to the appropriate axis\n                    // For the sake of animations, wrap the points around so that\n                    // the points on the axes are the first two points. Otherwise\n                    // animations get a little crazy if the number of points changes.\n                    transition(ownFillEl3).attr('d', 'M' + pt1 + 'L' + pt0 + 'L' + fullpath.substr(1))\n                        .call(Drawing.singleFillStyle);\n                } else {\n                    // fill to self: just join the path to itself\n                    transition(ownFillEl3).attr('d', fullpath + 'Z')\n                        .call(Drawing.singleFillStyle);\n                }\n            }\n        } else if(tonext) {\n            if(trace.fill.substr(0, 6) === 'tonext' && fullpath && prevRevpath) {\n                // fill to next: full trace path, plus the previous path reversed\n                if(trace.fill === 'tonext') {\n                    // tonext: for use by concentric shapes, like manually constructed\n                    // contours, we just add the two paths closed on themselves.\n                    // This makes strange results if one path is *not* entirely\n                    // inside the other, but then that is a strange usage.\n                    transition(tonext).attr('d', fullpath + 'Z' + prevRevpath + 'Z')\n                        .call(Drawing.singleFillStyle);\n                } else {\n                    // tonextx/y: for now just connect endpoints with lines. This is\n                    // the correct behavior if the endpoints are at the same value of\n                    // y/x, but if they *aren't*, we should ideally do more complicated\n                    // things depending on whether the new endpoint projects onto the\n                    // existing curve or off the end of it\n                    transition(tonext).attr('d', fullpath + 'L' + prevRevpath.substr(1) + 'Z')\n                        .call(Drawing.singleFillStyle);\n                }\n                trace._polygons = trace._polygons.concat(prevPolygons);\n            } else {\n                clearFill(tonext);\n                trace._polygons = null;\n            }\n        }\n        trace._prevRevpath = revpath;\n        trace._prevPolygons = thisPolygons;\n    } else {\n        if(ownFillEl3) clearFill(ownFillEl3);\n        else if(tonext) clearFill(tonext);\n        trace._polygons = trace._prevRevpath = trace._prevPolygons = null;\n    }\n\n\n    function visFilter(d) {\n        return d.filter(function(v) { return !v.gap && v.vis; });\n    }\n\n    function visFilterWithGaps(d) {\n        return d.filter(function(v) { return v.vis; });\n    }\n\n    function gapFilter(d) {\n        return d.filter(function(v) { return !v.gap; });\n    }\n\n    function keyFunc(d) {\n        return d.id;\n    }\n\n    // Returns a function if the trace is keyed, otherwise returns undefined\n    function getKeyFunc(trace) {\n        if(trace.ids) {\n            return keyFunc;\n        }\n    }\n\n    function hideFilter() {\n        return false;\n    }\n\n    function makePoints(points, text, cdscatter) {\n        var join, selection, hasNode;\n\n        var trace = cdscatter[0].trace;\n        var showMarkers = subTypes.hasMarkers(trace);\n        var showText = subTypes.hasText(trace);\n\n        var keyFunc = getKeyFunc(trace);\n        var markerFilter = hideFilter;\n        var textFilter = hideFilter;\n\n        if(showMarkers || showText) {\n            var showFilter = identity;\n            // if we're stacking, \"infer zero\" gap mode gets markers in the\n            // gap points - because we've inferred a zero there - but other\n            // modes (currently \"interpolate\", later \"interrupt\" hopefully)\n            // we don't draw generated markers\n            var stackGroup = trace.stackgroup;\n            var isInferZero = stackGroup && (\n                gd._fullLayout._scatterStackOpts[xa._id + ya._id][stackGroup].stackgaps === 'infer zero');\n            if(trace.marker.maxdisplayed || trace._needsCull) {\n                showFilter = isInferZero ? visFilterWithGaps : visFilter;\n            } else if(stackGroup && !isInferZero) {\n                showFilter = gapFilter;\n            }\n\n            if(showMarkers) markerFilter = showFilter;\n            if(showText) textFilter = showFilter;\n        }\n\n        // marker points\n\n        selection = points.selectAll('path.point');\n\n        join = selection.data(markerFilter, keyFunc);\n\n        var enter = join.enter().append('path')\n            .classed('point', true);\n\n        if(hasTransition) {\n            enter\n                .call(Drawing.pointStyle, trace, gd)\n                .call(Drawing.translatePoints, xa, ya)\n                .style('opacity', 0)\n                .transition()\n                .style('opacity', 1);\n        }\n\n        join.order();\n\n        var styleFns;\n        if(showMarkers) {\n            styleFns = Drawing.makePointStyleFns(trace);\n        }\n\n        join.each(function(d) {\n            var el = d3.select(this);\n            var sel = transition(el);\n            hasNode = Drawing.translatePoint(d, sel, xa, ya);\n\n            if(hasNode) {\n                Drawing.singlePointStyle(d, sel, trace, styleFns, gd);\n\n                if(plotinfo.layerClipId) {\n                    Drawing.hideOutsideRangePoint(d, sel, xa, ya, trace.xcalendar, trace.ycalendar);\n                }\n\n                if(trace.customdata) {\n                    el.classed('plotly-customdata', d.data !== null && d.data !== undefined);\n                }\n            } else {\n                sel.remove();\n            }\n        });\n\n        if(hasTransition) {\n            join.exit().transition()\n                .style('opacity', 0)\n                .remove();\n        } else {\n            join.exit().remove();\n        }\n\n        // text points\n        selection = text.selectAll('g');\n        join = selection.data(textFilter, keyFunc);\n\n        // each text needs to go in its own 'g' in case\n        // it gets converted to mathjax\n        join.enter().append('g').classed('textpoint', true).append('text');\n\n        join.order();\n\n        join.each(function(d) {\n            var g = d3.select(this);\n            var sel = transition(g.select('text'));\n            hasNode = Drawing.translatePoint(d, sel, xa, ya);\n\n            if(hasNode) {\n                if(plotinfo.layerClipId) {\n                    Drawing.hideOutsideRangePoint(d, g, xa, ya, trace.xcalendar, trace.ycalendar);\n                }\n            } else {\n                g.remove();\n            }\n        });\n\n        join.selectAll('text')\n            .call(Drawing.textPointStyle, trace, gd)\n            .each(function(d) {\n                // This just *has* to be totally custom becuase of SVG text positioning :(\n                // It's obviously copied from translatePoint; we just can't use that\n                var x = xa.c2p(d.x);\n                var y = ya.c2p(d.y);\n\n                d3.select(this).selectAll('tspan.line').each(function() {\n                    transition(d3.select(this)).attr({x: x, y: y});\n                });\n            });\n\n        join.exit().remove();\n    }\n\n    points.datum(cdscatter);\n    text.datum(cdscatter);\n    makePoints(points, text, cdscatter);\n\n    // lastly, clip points groups of `cliponaxis !== false` traces\n    // on `plotinfo._hasClipOnAxisFalse === true` subplots\n    var hasClipOnAxisFalse = trace.cliponaxis === false;\n    var clipUrl = hasClipOnAxisFalse ? null : plotinfo.layerClipId;\n    Drawing.setClipUrl(points, clipUrl, gd);\n    Drawing.setClipUrl(text, clipUrl, gd);\n}\n\nfunction selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) {\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n    var xr = d3.extent(Lib.simpleMap(xa.range, xa.r2c));\n    var yr = d3.extent(Lib.simpleMap(ya.range, ya.r2c));\n\n    var trace = cdscatter[0].trace;\n    if(!subTypes.hasMarkers(trace)) return;\n    // if marker.maxdisplayed is used, select a maximum of\n    // mnum markers to show, from the set that are in the viewport\n    var mnum = trace.marker.maxdisplayed;\n\n    // TODO: remove some as we get away from the viewport?\n    if(mnum === 0) return;\n\n    var cd = cdscatter.filter(function(v) {\n        return v.x >= xr[0] && v.x <= xr[1] && v.y >= yr[0] && v.y <= yr[1];\n    });\n    var inc = Math.ceil(cd.length / mnum);\n    var tnum = 0;\n    cdscatterAll.forEach(function(cdj, j) {\n        var tracei = cdj[0].trace;\n        if(subTypes.hasMarkers(tracei) &&\n                tracei.marker.maxdisplayed > 0 && j < idx) {\n            tnum++;\n        }\n    });\n\n    // if multiple traces use maxdisplayed, stagger which markers we\n    // display this formula offsets successive traces by 1/3 of the\n    // increment, adding an extra small amount after each triplet so\n    // it's not quite periodic\n    var i0 = Math.round(tnum * inc / 3 + Math.floor(tnum / 3) * inc / 7.1);\n\n    // for error bars: save in cd which markers to show\n    // so we don't have to repeat this\n    cdscatter.forEach(function(v) { delete v.vis; });\n    cd.forEach(function(v, i) {\n        if(Math.round((i + i0) % inc) === 0) v.vis = true;\n    });\n}\n\n},{\"../../components/drawing\":74,\"../../lib\":178,\"../../lib/polygon\":190,\"../../registry\":269,\"./line_points\":403,\"./link_traces\":405,\"./subtypes\":413,\"d3\":16}],410:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar subtypes = _dereq_('./subtypes');\n\nmodule.exports = function selectPoints(searchInfo, selectionTester) {\n    var cd = searchInfo.cd;\n    var xa = searchInfo.xaxis;\n    var ya = searchInfo.yaxis;\n    var selection = [];\n    var trace = cd[0].trace;\n    var i;\n    var di;\n    var x;\n    var y;\n\n    var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace));\n    if(hasOnlyLines) return [];\n\n    if(selectionTester === false) { // clear selection\n        for(i = 0; i < cd.length; i++) {\n            cd[i].selected = 0;\n        }\n    } else {\n        for(i = 0; i < cd.length; i++) {\n            di = cd[i];\n            x = xa.c2p(di.x);\n            y = ya.c2p(di.y);\n\n            if((di.i !== null) && selectionTester.contains([x, y], false, i, searchInfo)) {\n                selection.push({\n                    pointNumber: di.i,\n                    x: xa.c2d(di.x),\n                    y: ya.c2d(di.y)\n                });\n                di.selected = 1;\n            } else {\n                di.selected = 0;\n            }\n        }\n    }\n\n    return selection;\n};\n\n},{\"./subtypes\":413}],411:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar perStackAttrs = ['orientation', 'groupnorm', 'stackgaps'];\n\nmodule.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce) {\n    var stackOpts = layout._scatterStackOpts;\n\n    var stackGroup = coerce('stackgroup');\n    if(stackGroup) {\n        // use independent stacking options per subplot\n        var subplot = traceOut.xaxis + traceOut.yaxis;\n        var subplotStackOpts = stackOpts[subplot];\n        if(!subplotStackOpts) subplotStackOpts = stackOpts[subplot] = {};\n\n        var groupOpts = subplotStackOpts[stackGroup];\n        var firstTrace = false;\n        if(groupOpts) {\n            groupOpts.traces.push(traceOut);\n        } else {\n            groupOpts = subplotStackOpts[stackGroup] = {\n                // keep track of trace indices for use during stacking calculations\n                // this will be filled in during `calc` and used during `crossTraceCalc`\n                // so it's OK if we don't recreate it during a non-calc edit\n                traceIndices: [],\n                // Hold on to the whole set of prior traces\n                // First one is most important, so we can clear defaults\n                // there if we find explicit values only in later traces.\n                // We're only going to *use* the values stored in groupOpts,\n                // but for the editor and validate we want things self-consistent\n                // The full set of traces is used only to fix `fill` default if\n                // we find `orientation: 'h'` beyond the first trace\n                traces: [traceOut]\n            };\n            firstTrace = true;\n        }\n        // TODO: how is this going to work with groupby transforms?\n        // in principle it should be OK I guess, as long as explicit group styles\n        // don't override explicit base-trace styles?\n\n        var dflts = {\n            orientation: (traceOut.x && !traceOut.y) ? 'h' : 'v'\n        };\n\n        for(var i = 0; i < perStackAttrs.length; i++) {\n            var attr = perStackAttrs[i];\n            var attrFound = attr + 'Found';\n            if(!groupOpts[attrFound]) {\n                var traceHasAttr = traceIn[attr] !== undefined;\n                var isOrientation = attr === 'orientation';\n                if(traceHasAttr || firstTrace) {\n                    groupOpts[attr] = coerce(attr, dflts[attr]);\n\n                    if(isOrientation) {\n                        groupOpts.fillDflt = groupOpts[attr] === 'h' ?\n                            'tonextx' : 'tonexty';\n                    }\n\n                    if(traceHasAttr) {\n                        // Note: this will show a value here even if it's invalid\n                        // in which case it will revert to default.\n                        groupOpts[attrFound] = true;\n\n                        // Note: only one trace in the stack will get a _fullData\n                        // entry for a given stack-wide attribute. If no traces\n                        // (or the first trace) specify that attribute, the\n                        // first trace will get it. If the first trace does NOT\n                        // specify it but some later trace does, then it gets\n                        // removed from the first trace and only included in the\n                        // one that specified it. This is mostly important for\n                        // editors (that want to see the full values to know\n                        // what settings are available) and Plotly.react diffing.\n                        // Editors may want to use fullLayout._scatterStackOpts\n                        // directly and make these settings available from all\n                        // traces in the stack... then set the new value into\n                        // the first trace, and clear all later traces.\n                        if(!firstTrace) {\n                            delete groupOpts.traces[0][attr];\n\n                            // orientation can affect default fill of previous traces\n                            if(isOrientation) {\n                                for(var j = 0; j < groupOpts.traces.length - 1; j++) {\n                                    var trace2 = groupOpts.traces[j];\n                                    if(trace2._input.fill !== trace2.fill) {\n                                        trace2.fill = groupOpts.fillDflt;\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        return groupOpts;\n    }\n};\n\n},{}],412:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Drawing = _dereq_('../../components/drawing');\nvar Registry = _dereq_('../../registry');\n\nfunction style(gd) {\n    var s = d3.select(gd).selectAll('g.trace.scatter');\n\n    s.style('opacity', function(d) {\n        return d[0].trace.opacity;\n    });\n\n    s.selectAll('g.points').each(function(d) {\n        var sel = d3.select(this);\n        var trace = d.trace || d[0].trace;\n        stylePoints(sel, trace, gd);\n    });\n\n    s.selectAll('g.text').each(function(d) {\n        var sel = d3.select(this);\n        var trace = d.trace || d[0].trace;\n        styleText(sel, trace, gd);\n    });\n\n    s.selectAll('g.trace path.js-line')\n        .call(Drawing.lineGroupStyle);\n\n    s.selectAll('g.trace path.js-fill')\n        .call(Drawing.fillGroupStyle);\n\n    Registry.getComponentMethod('errorbars', 'style')(s);\n}\n\nfunction stylePoints(sel, trace, gd) {\n    Drawing.pointStyle(sel.selectAll('path.point'), trace, gd);\n}\n\nfunction styleText(sel, trace, gd) {\n    Drawing.textPointStyle(sel.selectAll('text'), trace, gd);\n}\n\nfunction styleOnSelect(gd, cd, sel) {\n    var trace = cd[0].trace;\n\n    if(trace.selectedpoints) {\n        Drawing.selectedPointStyle(sel.selectAll('path.point'), trace);\n        Drawing.selectedTextStyle(sel.selectAll('text'), trace);\n    } else {\n        stylePoints(sel, trace, gd);\n        styleText(sel, trace, gd);\n    }\n}\n\nmodule.exports = {\n    style: style,\n    stylePoints: stylePoints,\n    styleText: styleText,\n    styleOnSelect: styleOnSelect\n};\n\n},{\"../../components/drawing\":74,\"../../registry\":269,\"d3\":16}],413:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = {\n    hasLines: function(trace) {\n        return trace.visible && trace.mode &&\n            trace.mode.indexOf('lines') !== -1;\n    },\n\n    hasMarkers: function(trace) {\n        return trace.visible && (\n            (trace.mode && trace.mode.indexOf('markers') !== -1) ||\n            // until splom implements 'mode'\n            trace.type === 'splom'\n        );\n    },\n\n    hasText: function(trace) {\n        return trace.visible && trace.mode &&\n            trace.mode.indexOf('text') !== -1;\n    },\n\n    isBubble: function(trace) {\n        return Lib.isPlainObject(trace.marker) &&\n            Lib.isArrayOrTypedArray(trace.marker.size);\n    }\n};\n\n},{\"../../lib\":178}],414:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n/*\n * opts: object of flags to control features not all text users support\n *   noSelect: caller does not support selected/unselected attribute containers\n */\nmodule.exports = function(traceIn, traceOut, layout, coerce, opts) {\n    opts = opts || {};\n\n    coerce('textposition');\n    Lib.coerceFont(coerce, 'textfont', layout.font);\n\n    if(!opts.noSelect) {\n        coerce('selected.textfont.color');\n        coerce('unselected.textfont.color');\n    }\n};\n\n},{\"../../lib\":178}],415:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nmodule.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {\n    var x = coerce('x');\n    var y = coerce('y');\n    var len;\n\n    var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n    handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n\n    if(x) {\n        var xlen = Lib.minRowLength(x);\n        if(y) {\n            len = Math.min(xlen, Lib.minRowLength(y));\n        } else {\n            len = xlen;\n            coerce('y0');\n            coerce('dy');\n        }\n    } else {\n        if(!y) return 0;\n\n        len = Lib.minRowLength(y);\n        coerce('x0');\n        coerce('dx');\n    }\n\n    traceOut._length = len;\n\n    return len;\n};\n\n},{\"../../lib\":178,\"../../registry\":269}],416:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterLineAttrs = scatterAttrs.line;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nmodule.exports = {\n    a: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    b: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    c: {\n        valType: 'data_array',\n        editType: 'calc',\n        \n    },\n    sum: {\n        valType: 'number',\n        \n        dflt: 0,\n        min: 0,\n        editType: 'calc',\n        \n    },\n    mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}),\n    text: extendFlat({}, scatterAttrs.text, {\n        \n    }),\n    texttemplate: texttemplateAttrs({editType: 'plot'}, {\n        keys: ['a', 'b', 'c', 'text']\n    }),\n    hovertext: extendFlat({}, scatterAttrs.hovertext, {\n        \n    }),\n    line: {\n        color: scatterLineAttrs.color,\n        width: scatterLineAttrs.width,\n        dash: dash,\n        shape: extendFlat({}, scatterLineAttrs.shape,\n            {values: ['linear', 'spline']}),\n        smoothing: scatterLineAttrs.smoothing,\n        editType: 'calc'\n    },\n    connectgaps: scatterAttrs.connectgaps,\n    cliponaxis: scatterAttrs.cliponaxis,\n    fill: extendFlat({}, scatterAttrs.fill, {\n        values: ['none', 'toself', 'tonext'],\n        dflt: 'none',\n        \n    }),\n    fillcolor: scatterAttrs.fillcolor,\n    marker: extendFlat({\n        symbol: scatterMarkerAttrs.symbol,\n        opacity: scatterMarkerAttrs.opacity,\n        maxdisplayed: scatterMarkerAttrs.maxdisplayed,\n        size: scatterMarkerAttrs.size,\n        sizeref: scatterMarkerAttrs.sizeref,\n        sizemin: scatterMarkerAttrs.sizemin,\n        sizemode: scatterMarkerAttrs.sizemode,\n        line: extendFlat({\n            width: scatterMarkerLineAttrs.width,\n            editType: 'calc'\n        },\n            colorScaleAttrs('marker.line')\n        ),\n        gradient: scatterMarkerAttrs.gradient,\n        editType: 'calc'\n    },\n        colorScaleAttrs('marker')\n    ),\n\n    textfont: scatterAttrs.textfont,\n    textposition: scatterAttrs.textposition,\n\n    selected: scatterAttrs.selected,\n    unselected: scatterAttrs.unselected,\n\n    hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n        flags: ['a', 'b', 'c', 'text', 'name']\n    }),\n    hoveron: scatterAttrs.hoveron,\n    hovertemplate: hovertemplateAttrs(),\n};\n\n},{\"../../components/colorscale/attributes\":59,\"../../components/drawing/attributes\":73,\"../../lib/extend\":173,\"../../plots/attributes\":219,\"../../plots/template_attributes\":264,\"../scatter/attributes\":389}],417:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\nvar arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata');\nvar calcSelection = _dereq_('../scatter/calc_selection');\nvar calcMarkerSize = _dereq_('../scatter/calc').calcMarkerSize;\n\nvar dataArrays = ['a', 'b', 'c'];\nvar arraysToFill = {a: ['b', 'c'], b: ['a', 'c'], c: ['a', 'b']};\n\nmodule.exports = function calc(gd, trace) {\n    var ternary = gd._fullLayout[trace.subplot];\n    var displaySum = ternary.sum;\n    var normSum = trace.sum || displaySum;\n    var arrays = {a: trace.a, b: trace.b, c: trace.c};\n\n    var i, j, dataArray, newArray, fillArray1, fillArray2;\n\n    // fill in one missing component\n    for(i = 0; i < dataArrays.length; i++) {\n        dataArray = dataArrays[i];\n        if(arrays[dataArray]) continue;\n\n        fillArray1 = arrays[arraysToFill[dataArray][0]];\n        fillArray2 = arrays[arraysToFill[dataArray][1]];\n        newArray = new Array(fillArray1.length);\n        for(j = 0; j < fillArray1.length; j++) {\n            newArray[j] = normSum - fillArray1[j] - fillArray2[j];\n        }\n        arrays[dataArray] = newArray;\n    }\n\n    // make the calcdata array\n    var serieslen = trace._length;\n    var cd = new Array(serieslen);\n    var a, b, c, norm, x, y;\n    for(i = 0; i < serieslen; i++) {\n        a = arrays.a[i];\n        b = arrays.b[i];\n        c = arrays.c[i];\n        if(isNumeric(a) && isNumeric(b) && isNumeric(c)) {\n            a = +a;\n            b = +b;\n            c = +c;\n            norm = displaySum / (a + b + c);\n            if(norm !== 1) {\n                a *= norm;\n                b *= norm;\n                c *= norm;\n            }\n            // map a, b, c onto x and y where the full scale of y\n            // is [0, sum], and x is [-sum, sum]\n            // TODO: this makes `a` always the top, `b` the bottom left,\n            // and `c` the bottom right. Do we want options to rearrange\n            // these?\n            y = a;\n            x = c - b;\n            cd[i] = {x: x, y: y, a: a, b: b, c: c};\n        } else cd[i] = {x: false, y: false};\n    }\n\n    calcMarkerSize(trace, serieslen);\n    calcColorscale(gd, trace);\n    arraysToCalcdata(cd, trace);\n    calcSelection(cd, trace);\n\n    return cd;\n};\n\n},{\"../scatter/arrays_to_calcdata\":388,\"../scatter/calc\":390,\"../scatter/calc_selection\":391,\"../scatter/colorscale_calc\":392,\"fast-isnumeric\":18}],418:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar constants = _dereq_('../scatter/constants');\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleLineShapeDefaults = _dereq_('../scatter/line_shape_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\nvar handleFillColorDefaults = _dereq_('../scatter/fillcolor_defaults');\n\nvar attributes = _dereq_('./attributes');\n\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    var a = coerce('a');\n    var b = coerce('b');\n    var c = coerce('c');\n    var len;\n\n    // allow any one array to be missing, len is the minimum length of those\n    // present. Note that after coerce data_array's are either Arrays (which\n    // are truthy even if empty) or undefined. As in scatter, an empty array\n    // is different from undefined, because it can signify that this data is\n    // not known yet but expected in the future\n    if(a) {\n        len = a.length;\n        if(b) {\n            len = Math.min(len, b.length);\n            if(c) len = Math.min(len, c.length);\n        } else if(c) len = Math.min(len, c.length);\n        else len = 0;\n    } else if(b && c) {\n        len = Math.min(b.length, c.length);\n    }\n\n    if(!len) {\n        traceOut.visible = false;\n        return;\n    }\n\n    traceOut._length = len;\n\n    coerce('sum');\n\n    coerce('text');\n    coerce('hovertext');\n    if(traceOut.hoveron !== 'fills') coerce('hovertemplate');\n\n    var defaultMode = len < constants.PTS_LINESONLY ? 'lines+markers' : 'lines';\n    coerce('mode', defaultMode);\n\n    if(subTypes.hasLines(traceOut)) {\n        handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n        handleLineShapeDefaults(traceIn, traceOut, coerce);\n        coerce('connectgaps');\n    }\n\n    if(subTypes.hasMarkers(traceOut)) {\n        handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});\n    }\n\n    if(subTypes.hasText(traceOut)) {\n        coerce('texttemplate');\n        handleTextDefaults(traceIn, traceOut, layout, coerce);\n    }\n\n    var dfltHoverOn = [];\n\n    if(subTypes.hasMarkers(traceOut) || subTypes.hasText(traceOut)) {\n        coerce('cliponaxis');\n        coerce('marker.maxdisplayed');\n        dfltHoverOn.push('points');\n    }\n\n    coerce('fill');\n    if(traceOut.fill !== 'none') {\n        handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n        if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);\n    }\n\n    if(traceOut.fill === 'tonext' || traceOut.fill === 'toself') {\n        dfltHoverOn.push('fills');\n    }\n    coerce('hoveron', dfltHoverOn.join('+') || 'points');\n\n    Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":178,\"../scatter/constants\":393,\"../scatter/fillcolor_defaults\":397,\"../scatter/line_defaults\":402,\"../scatter/line_shape_defaults\":404,\"../scatter/marker_defaults\":408,\"../scatter/subtypes\":413,\"../scatter/text_defaults\":414,\"./attributes\":416}],419:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt, trace, cd, pointNumber) {\n    if(pt.xa) out.xaxis = pt.xa;\n    if(pt.ya) out.yaxis = pt.ya;\n\n    if(cd[pointNumber]) {\n        var cdi = cd[pointNumber];\n\n        // N.B. These are the normalized coordinates.\n        out.a = cdi.a;\n        out.b = cdi.b;\n        out.c = cdi.c;\n    } else {\n        // for fill-hover only\n        out.a = pt.a;\n        out.b = pt.b;\n        out.c = pt.c;\n    }\n\n    return out;\n};\n\n},{}],420:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n    var labels = {};\n\n    var subplot = fullLayout[trace.subplot]._subplot;\n    labels.aLabel = Axes.tickText(subplot.aaxis, cdi.a, true).text;\n    labels.bLabel = Axes.tickText(subplot.baxis, cdi.b, true).text;\n    labels.cLabel = Axes.tickText(subplot.caxis, cdi.c, true).text;\n\n    return labels;\n};\n\n},{\"../../plots/cartesian/axes\":222}],421:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterHover = _dereq_('../scatter/hover');\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n    var scatterPointData = scatterHover(pointData, xval, yval, hovermode);\n    if(!scatterPointData || scatterPointData[0].index === false) return;\n\n    var newPointData = scatterPointData[0];\n\n    // if hovering on a fill, we don't show any point data so the label is\n    // unchanged from what scatter gives us - except that it needs to\n    // be constrained to the trianglular plot area, not just the rectangular\n    // area defined by the synthetic x and y axes\n    // TODO: in some cases the vertical middle of the shape is not within\n    // the triangular viewport at all, so the label can become disconnected\n    // from the shape entirely. But calculating what portion of the shape\n    // is actually visible, as constrained by the diagonal axis lines, is not\n    // so easy and anyway we lost the information we would have needed to do\n    // this inside scatterHover.\n    if(newPointData.index === undefined) {\n        var yFracUp = 1 - (newPointData.y0 / pointData.ya._length);\n        var xLen = pointData.xa._length;\n        var xMin = xLen * yFracUp / 2;\n        var xMax = xLen - xMin;\n        newPointData.x0 = Math.max(Math.min(newPointData.x0, xMax), xMin);\n        newPointData.x1 = Math.max(Math.min(newPointData.x1, xMax), xMin);\n        return scatterPointData;\n    }\n\n    var cdi = newPointData.cd[newPointData.index];\n    var trace = newPointData.trace;\n    var subplot = newPointData.subplot;\n\n    newPointData.a = cdi.a;\n    newPointData.b = cdi.b;\n    newPointData.c = cdi.c;\n\n    newPointData.xLabelVal = undefined;\n    newPointData.yLabelVal = undefined;\n\n    var fullLayout = {};\n    fullLayout[trace.subplot] = {_subplot: subplot};\n    var labels = trace._module.formatLabels(cdi, trace, fullLayout);\n    newPointData.aLabel = labels.aLabel;\n    newPointData.bLabel = labels.bLabel;\n    newPointData.cLabel = labels.cLabel;\n\n    var hoverinfo = cdi.hi || trace.hoverinfo;\n    var text = [];\n    function textPart(ax, val) {\n        text.push(ax._hovertitle + ': ' + val);\n    }\n    if(!trace.hovertemplate) {\n        var parts = hoverinfo.split('+');\n        if(parts.indexOf('all') !== -1) parts = ['a', 'b', 'c'];\n        if(parts.indexOf('a') !== -1) textPart(subplot.aaxis, newPointData.aLabel);\n        if(parts.indexOf('b') !== -1) textPart(subplot.baxis, newPointData.bLabel);\n        if(parts.indexOf('c') !== -1) textPart(subplot.caxis, newPointData.cLabel);\n    }\n    newPointData.extraText = text.join('<br>');\n    newPointData.hovertemplate = trace.hovertemplate;\n    return scatterPointData;\n};\n\n},{\"../scatter/hover\":400}],422:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    colorbar: _dereq_('../scatter/marker_colorbar'),\n    formatLabels: _dereq_('./format_labels'),\n    calc: _dereq_('./calc'),\n    plot: _dereq_('./plot'),\n    style: _dereq_('../scatter/style').style,\n    styleOnSelect: _dereq_('../scatter/style').styleOnSelect,\n    hoverPoints: _dereq_('./hover'),\n    selectPoints: _dereq_('../scatter/select'),\n    eventData: _dereq_('./event_data'),\n\n    moduleType: 'trace',\n    name: 'scatterternary',\n    basePlotModule: _dereq_('../../plots/ternary'),\n    categories: ['ternary', 'symbols', 'showLegend', 'scatter-like'],\n    meta: {\n        \n        \n    }\n};\n\n},{\"../../plots/ternary\":265,\"../scatter/marker_colorbar\":407,\"../scatter/select\":410,\"../scatter/style\":412,\"./attributes\":416,\"./calc\":417,\"./defaults\":418,\"./event_data\":419,\"./format_labels\":420,\"./hover\":421,\"./plot\":423}],423:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar scatterPlot = _dereq_('../scatter/plot');\n\nmodule.exports = function plot(gd, ternary, moduleCalcData) {\n    var plotContainer = ternary.plotContainer;\n\n    // remove all nodes inside the scatter layer\n    plotContainer.select('.scatterlayer').selectAll('*').remove();\n\n    // mimic cartesian plotinfo\n    var plotinfo = {\n        xaxis: ternary.xaxis,\n        yaxis: ternary.yaxis,\n        plot: plotContainer,\n        layerClipId: ternary._hasClipOnAxisFalse ? ternary.clipIdRelative : null\n    };\n\n    var scatterLayer = ternary.layers.frontplot.select('g.scatterlayer');\n\n    scatterPlot(gd, plotinfo, moduleCalcData, scatterLayer);\n};\n\n},{\"../scatter/plot\":409}],424:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar boxAttrs = _dereq_('../box/attributes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n    y: boxAttrs.y,\n    x: boxAttrs.x,\n    x0: boxAttrs.x0,\n    y0: boxAttrs.y0,\n    name: extendFlat({}, boxAttrs.name, {\n        \n    }),\n    orientation: extendFlat({}, boxAttrs.orientation, {\n        \n    }),\n\n    bandwidth: {\n        valType: 'number',\n        min: 0,\n        \n        editType: 'calc',\n        \n    },\n\n    scalegroup: {\n        valType: 'string',\n        \n        dflt: '',\n        editType: 'calc',\n        \n    },\n    scalemode: {\n        valType: 'enumerated',\n        values: ['width', 'count'],\n        dflt: 'width',\n        \n        editType: 'calc',\n        \n    },\n\n    spanmode: {\n        valType: 'enumerated',\n        values: ['soft', 'hard', 'manual'],\n        dflt: 'soft',\n        \n        editType: 'calc',\n        \n    },\n    span: {\n        valType: 'info_array',\n        items: [\n            {valType: 'any', editType: 'calc'},\n            {valType: 'any', editType: 'calc'}\n        ],\n        \n        editType: 'calc',\n        \n    },\n\n    line: {\n        color: {\n            valType: 'color',\n            \n            editType: 'style',\n            \n        },\n        width: {\n            valType: 'number',\n            \n            min: 0,\n            dflt: 2,\n            editType: 'style',\n            \n        },\n        editType: 'plot'\n    },\n    fillcolor: boxAttrs.fillcolor,\n\n    points: extendFlat({}, boxAttrs.boxpoints, {\n        \n    }),\n    jitter: extendFlat({}, boxAttrs.jitter, {\n        \n    }),\n    pointpos: extendFlat({}, boxAttrs.pointpos, {\n        \n    }),\n\n    width: extendFlat({}, boxAttrs.width, {\n        \n    }),\n\n    marker: boxAttrs.marker,\n    text: boxAttrs.text,\n    hovertext: boxAttrs.hovertext,\n    hovertemplate: boxAttrs.hovertemplate,\n\n    box: {\n        visible: {\n            valType: 'boolean',\n            dflt: false,\n            \n            editType: 'plot',\n            \n        },\n        width: {\n            valType: 'number',\n            min: 0,\n            max: 1,\n            dflt: 0.25,\n            \n            editType: 'plot',\n            \n        },\n        fillcolor: {\n            valType: 'color',\n            \n            editType: 'style',\n            \n        },\n        line: {\n            color: {\n                valType: 'color',\n                \n                editType: 'style',\n                \n            },\n            width: {\n                valType: 'number',\n                min: 0,\n                \n                editType: 'style',\n                \n            },\n            editType: 'style'\n        },\n        editType: 'plot'\n    },\n\n    meanline: {\n        visible: {\n            valType: 'boolean',\n            dflt: false,\n            \n            editType: 'plot',\n            \n        },\n        color: {\n            valType: 'color',\n            \n            editType: 'style',\n            \n        },\n        width: {\n            valType: 'number',\n            min: 0,\n            \n            editType: 'style',\n            \n        },\n        editType: 'plot'\n    },\n\n    side: {\n        valType: 'enumerated',\n        values: ['both', 'positive', 'negative'],\n        dflt: 'both',\n        \n        editType: 'calc',\n        \n    },\n\n    offsetgroup: boxAttrs.offsetgroup,\n    alignmentgroup: boxAttrs.alignmentgroup,\n\n    selected: boxAttrs.selected,\n    unselected: boxAttrs.unselected,\n\n    hoveron: {\n        valType: 'flaglist',\n        flags: ['violins', 'points', 'kde'],\n        dflt: 'violins+points+kde',\n        extras: ['all'],\n        \n        editType: 'style',\n        \n    }\n};\n\n},{\"../../lib/extend\":173,\"../box/attributes\":296}],425:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar boxCalc = _dereq_('../box/calc');\nvar helpers = _dereq_('./helpers');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function calc(gd, trace) {\n    var cd = boxCalc(gd, trace);\n\n    if(cd[0].t.empty) return cd;\n\n    var fullLayout = gd._fullLayout;\n    var valAxis = Axes.getFromId(\n        gd,\n        trace[trace.orientation === 'h' ? 'xaxis' : 'yaxis']\n    );\n\n    var spanMin = Infinity;\n    var spanMax = -Infinity;\n    var maxKDE = 0;\n    var maxCount = 0;\n\n    for(var i = 0; i < cd.length; i++) {\n        var cdi = cd[i];\n        var vals = cdi.pts.map(helpers.extractVal);\n\n        var bandwidth = cdi.bandwidth = calcBandwidth(trace, cdi, vals);\n        var span = cdi.span = calcSpan(trace, cdi, valAxis, bandwidth);\n\n        if(cdi.min === cdi.max && bandwidth === 0) {\n            // if span is zero and bandwidth is zero, we want a violin with zero width\n            span = cdi.span = [cdi.min, cdi.max];\n            cdi.density = [{v: 1, t: span[0]}];\n            cdi.bandwidth = bandwidth;\n            maxKDE = Math.max(maxKDE, 1);\n        } else {\n            // step that well covers the bandwidth and is multiple of span distance\n            var dist = span[1] - span[0];\n            var n = Math.ceil(dist / (bandwidth / 3));\n            var step = dist / n;\n\n            if(!isFinite(step) || !isFinite(n)) {\n                Lib.error('Something went wrong with computing the violin span');\n                cd[0].t.empty = true;\n                return cd;\n            }\n\n            var kde = helpers.makeKDE(cdi, trace, vals);\n            cdi.density = new Array(n);\n\n            for(var k = 0, t = span[0]; t < (span[1] + step / 2); k++, t += step) {\n                var v = kde(t);\n                cdi.density[k] = {v: v, t: t};\n                maxKDE = Math.max(maxKDE, v);\n            }\n        }\n\n        maxCount = Math.max(maxCount, vals.length);\n        spanMin = Math.min(spanMin, span[0]);\n        spanMax = Math.max(spanMax, span[1]);\n    }\n\n    var extremes = Axes.findExtremes(valAxis, [spanMin, spanMax], {padded: true});\n    trace._extremes[valAxis._id] = extremes;\n\n    if(trace.width) {\n        cd[0].t.maxKDE = maxKDE;\n    } else {\n        var violinScaleGroupStats = fullLayout._violinScaleGroupStats;\n        var scaleGroup = trace.scalegroup;\n        var groupStats = violinScaleGroupStats[scaleGroup];\n\n        if(groupStats) {\n            groupStats.maxKDE = Math.max(groupStats.maxKDE, maxKDE);\n            groupStats.maxCount = Math.max(groupStats.maxCount, maxCount);\n        } else {\n            violinScaleGroupStats[scaleGroup] = {\n                maxKDE: maxKDE,\n                maxCount: maxCount\n            };\n        }\n    }\n\n    cd[0].t.labels.kde = Lib._(gd, 'kde:');\n\n    return cd;\n};\n\n// Default to Silveman's rule of thumb\n// - https://stats.stackexchange.com/a/6671\n// - https://en.wikipedia.org/wiki/Kernel_density_estimation#A_rule-of-thumb_bandwidth_estimator\n// - https://github.com/statsmodels/statsmodels/blob/master/statsmodels/nonparametric/bandwidths.py\nfunction silvermanRule(len, ssd, iqr) {\n    var a = Math.min(ssd, iqr / 1.349);\n    return 1.059 * a * Math.pow(len, -0.2);\n}\n\nfunction calcBandwidth(trace, cdi, vals) {\n    var span = cdi.max - cdi.min;\n\n    // If span is zero\n    if(!span) {\n        if(trace.bandwidth) {\n            return trace.bandwidth;\n        } else {\n            // if span is zero and no bandwidth is specified\n            // it returns zero bandwidth which is a special case\n            return 0;\n        }\n    }\n\n    // Limit how small the bandwidth can be.\n    //\n    // Silverman's rule of thumb can be \"very\" small\n    // when IQR does a poor job at describing the spread\n    // of the distribution.\n    // We also want to limit custom bandwidths\n    // to not blow up kde computations.\n\n    if(trace.bandwidth) {\n        return Math.max(trace.bandwidth, span / 1e4);\n    } else {\n        var len = vals.length;\n        var ssd = Lib.stdev(vals, len - 1, cdi.mean);\n        return Math.max(\n            silvermanRule(len, ssd, cdi.q3 - cdi.q1),\n            span / 100\n        );\n    }\n}\n\nfunction calcSpan(trace, cdi, valAxis, bandwidth) {\n    var spanmode = trace.spanmode;\n    var spanIn = trace.span || [];\n    var spanTight = [cdi.min, cdi.max];\n    var spanLoose = [cdi.min - 2 * bandwidth, cdi.max + 2 * bandwidth];\n    var spanOut;\n\n    function calcSpanItem(index) {\n        var s = spanIn[index];\n        var sc = valAxis.type === 'multicategory' ?\n            valAxis.r2c(s) :\n            valAxis.d2c(s, 0, trace[cdi.valLetter + 'calendar']);\n        return sc === BADNUM ? spanLoose[index] : sc;\n    }\n\n    if(spanmode === 'soft') {\n        spanOut = spanLoose;\n    } else if(spanmode === 'hard') {\n        spanOut = spanTight;\n    } else {\n        spanOut = [calcSpanItem(0), calcSpanItem(1)];\n    }\n\n    // to reuse the equal-range-item block\n    var dummyAx = {\n        type: 'linear',\n        range: spanOut\n    };\n    Axes.setConvert(dummyAx);\n    dummyAx.cleanRange();\n\n    return spanOut;\n}\n\n},{\"../../constants/numerical\":158,\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../box/calc\":297,\"./helpers\":428}],426:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar setPositionOffset = _dereq_('../box/cross_trace_calc').setPositionOffset;\nvar orientations = ['v', 'h'];\n\nmodule.exports = function crossTraceCalc(gd, plotinfo) {\n    var calcdata = gd.calcdata;\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    for(var i = 0; i < orientations.length; i++) {\n        var orientation = orientations[i];\n        var posAxis = orientation === 'h' ? ya : xa;\n        var violinList = [];\n\n        for(var j = 0; j < calcdata.length; j++) {\n            var cd = calcdata[j];\n            var t = cd[0].t;\n            var trace = cd[0].trace;\n\n            if(trace.visible === true && trace.type === 'violin' &&\n                    !t.empty &&\n                    trace.orientation === orientation &&\n                    trace.xaxis === xa._id &&\n                    trace.yaxis === ya._id\n              ) {\n                violinList.push(j);\n            }\n        }\n\n        setPositionOffset('violin', gd, violinList, posAxis);\n    }\n};\n\n},{\"../box/cross_trace_calc\":298}],427:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\n\nvar boxDefaults = _dereq_('../box/defaults');\nvar attributes = _dereq_('./attributes');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n    }\n    function coerce2(attr, dflt) {\n        return Lib.coerce2(traceIn, traceOut, attributes, attr, dflt);\n    }\n\n    boxDefaults.handleSampleDefaults(traceIn, traceOut, coerce, layout);\n    if(traceOut.visible === false) return;\n\n    coerce('bandwidth');\n    coerce('side');\n\n    var width = coerce('width');\n    if(!width) {\n        coerce('scalegroup', traceOut.name);\n        coerce('scalemode');\n    }\n\n    var span = coerce('span');\n    var spanmodeDflt;\n    if(Array.isArray(span)) spanmodeDflt = 'manual';\n    coerce('spanmode', spanmodeDflt);\n\n    var lineColor = coerce('line.color', (traceIn.marker || {}).color || defaultColor);\n    var lineWidth = coerce('line.width');\n    var fillColor = coerce('fillcolor', Color.addOpacity(traceOut.line.color, 0.5));\n\n    boxDefaults.handlePointsDefaults(traceIn, traceOut, coerce, {prefix: ''});\n\n    var boxWidth = coerce2('box.width');\n    var boxFillColor = coerce2('box.fillcolor', fillColor);\n    var boxLineColor = coerce2('box.line.color', lineColor);\n    var boxLineWidth = coerce2('box.line.width', lineWidth);\n    var boxVisible = coerce('box.visible', Boolean(boxWidth || boxFillColor || boxLineColor || boxLineWidth));\n    if(!boxVisible) traceOut.box = {visible: false};\n\n    var meanLineColor = coerce2('meanline.color', lineColor);\n    var meanLineWidth = coerce2('meanline.width', lineWidth);\n    var meanLineVisible = coerce('meanline.visible', Boolean(meanLineColor || meanLineWidth));\n    if(!meanLineVisible) traceOut.meanline = {visible: false};\n};\n\n},{\"../../components/color\":52,\"../../lib\":178,\"../box/defaults\":299,\"./attributes\":424}],428:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// Maybe add kernels more down the road,\n// but note that the default `spanmode: 'soft'` bounds might have\n// to become kernel-dependent\nvar kernels = {\n    gaussian: function(v) {\n        return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(-0.5 * v * v);\n    }\n};\n\nexports.makeKDE = function(calcItem, trace, vals) {\n    var len = vals.length;\n    var kernel = kernels.gaussian;\n    var bandwidth = calcItem.bandwidth;\n    var factor = 1 / (len * bandwidth);\n\n    // don't use Lib.aggNums to skip isNumeric checks\n    return function(x) {\n        var sum = 0;\n        for(var i = 0; i < len; i++) {\n            sum += kernel((x - vals[i]) / bandwidth);\n        }\n        return factor * sum;\n    };\n};\n\nexports.getPositionOnKdePath = function(calcItem, trace, valuePx) {\n    var posLetter, valLetter;\n\n    if(trace.orientation === 'h') {\n        posLetter = 'y';\n        valLetter = 'x';\n    } else {\n        posLetter = 'x';\n        valLetter = 'y';\n    }\n\n    var pointOnPath = Lib.findPointOnPath(\n        calcItem.path,\n        valuePx,\n        valLetter,\n        {pathLength: calcItem.pathLength}\n    );\n\n    var posCenterPx = calcItem.posCenterPx;\n    var posOnPath0 = pointOnPath[posLetter];\n    var posOnPath1 = trace.side === 'both' ?\n        2 * posCenterPx - posOnPath0 :\n        posCenterPx;\n\n    return [posOnPath0, posOnPath1];\n};\n\nexports.getKdeValue = function(calcItem, trace, valueDist) {\n    var vals = calcItem.pts.map(exports.extractVal);\n    var kde = exports.makeKDE(calcItem, trace, vals);\n    return kde(valueDist) / calcItem.posDensityScale;\n};\n\nexports.extractVal = function(o) { return o.v; };\n\n},{\"../../lib\":178}],429:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar boxHoverPoints = _dereq_('../box/hover');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLayer) {\n    var cd = pointData.cd;\n    var trace = cd[0].trace;\n    var hoveron = trace.hoveron;\n    var hasHoveronViolins = hoveron.indexOf('violins') !== -1;\n    var hasHoveronKDE = hoveron.indexOf('kde') !== -1;\n    var closeData = [];\n    var closePtData;\n    var violinLineAttrs;\n\n    if(hasHoveronViolins || hasHoveronKDE) {\n        var closeBoxData = boxHoverPoints.hoverOnBoxes(pointData, xval, yval, hovermode);\n\n        if(hasHoveronKDE && closeBoxData.length > 0) {\n            var xa = pointData.xa;\n            var ya = pointData.ya;\n            var pLetter, vLetter, pAxis, vAxis, vVal;\n\n            if(trace.orientation === 'h') {\n                vVal = xval;\n                pLetter = 'y';\n                pAxis = ya;\n                vLetter = 'x';\n                vAxis = xa;\n            } else {\n                vVal = yval;\n                pLetter = 'x';\n                pAxis = xa;\n                vLetter = 'y';\n                vAxis = ya;\n            }\n\n            var di = cd[pointData.index];\n\n            if(vVal >= di.span[0] && vVal <= di.span[1]) {\n                var kdePointData = Lib.extendFlat({}, pointData);\n                var vValPx = vAxis.c2p(vVal, true);\n                var kdeVal = helpers.getKdeValue(di, trace, vVal);\n                var pOnPath = helpers.getPositionOnKdePath(di, trace, vValPx);\n                var paOffset = pAxis._offset;\n                var paLength = pAxis._length;\n\n                kdePointData[pLetter + '0'] = pOnPath[0];\n                kdePointData[pLetter + '1'] = pOnPath[1];\n                kdePointData[vLetter + '0'] = kdePointData[vLetter + '1'] = vValPx;\n                kdePointData[vLetter + 'Label'] = vLetter + ': ' + Axes.hoverLabelText(vAxis, vVal) + ', ' + cd[0].t.labels.kde + ' ' + kdeVal.toFixed(3);\n\n                // move the spike to the KDE point\n                kdePointData.spikeDistance = closeBoxData[0].spikeDistance;\n                var spikePosAttr = pLetter + 'Spike';\n                kdePointData[spikePosAttr] = closeBoxData[0][spikePosAttr];\n                closeBoxData[0].spikeDistance = undefined;\n                closeBoxData[0][spikePosAttr] = undefined;\n\n                // no hovertemplate support yet\n                kdePointData.hovertemplate = false;\n\n                closeData.push(kdePointData);\n\n                violinLineAttrs = {stroke: pointData.color};\n                violinLineAttrs[pLetter + '1'] = Lib.constrain(paOffset + pOnPath[0], paOffset, paOffset + paLength);\n                violinLineAttrs[pLetter + '2'] = Lib.constrain(paOffset + pOnPath[1], paOffset, paOffset + paLength);\n                violinLineAttrs[vLetter + '1'] = violinLineAttrs[vLetter + '2'] = vAxis._offset + vValPx;\n            }\n        }\n\n        if(hasHoveronViolins) {\n            closeData = closeData.concat(closeBoxData);\n        }\n    }\n\n    if(hoveron.indexOf('points') !== -1) {\n        closePtData = boxHoverPoints.hoverOnPoints(pointData, xval, yval);\n    }\n\n    // update violin line (if any)\n    var violinLine = hoverLayer.selectAll('.violinline-' + trace.uid)\n        .data(violinLineAttrs ? [0] : []);\n    violinLine.enter().append('line')\n        .classed('violinline-' + trace.uid, true)\n        .attr('stroke-width', 1.5);\n    violinLine.exit().remove();\n    violinLine.attr(violinLineAttrs);\n\n    // same combine logic as box hoverPoints\n    if(hovermode === 'closest') {\n        if(closePtData) return [closePtData];\n        return closeData;\n    }\n    if(closePtData) {\n        closeData.push(closePtData);\n        return closeData;\n    }\n    return closeData;\n};\n\n},{\"../../lib\":178,\"../../plots/cartesian/axes\":222,\"../box/hover\":301,\"./helpers\":428}],430:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n    attributes: _dereq_('./attributes'),\n    layoutAttributes: _dereq_('./layout_attributes'),\n    supplyDefaults: _dereq_('./defaults'),\n    crossTraceDefaults: _dereq_('../box/defaults').crossTraceDefaults,\n    supplyLayoutDefaults: _dereq_('./layout_defaults'),\n    calc: _dereq_('./calc'),\n    crossTraceCalc: _dereq_('./cross_trace_calc'),\n    plot: _dereq_('./plot'),\n    style: _dereq_('./style'),\n    styleOnSelect: _dereq_('../scatter/style').styleOnSelect,\n    hoverPoints: _dereq_('./hover'),\n    selectPoints: _dereq_('../box/select'),\n\n    moduleType: 'trace',\n    name: 'violin',\n    basePlotModule: _dereq_('../../plots/cartesian'),\n    categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'violinLayout', 'zoomScale'],\n    meta: {\n        \n    }\n};\n\n},{\"../../plots/cartesian\":235,\"../box/defaults\":299,\"../box/select\":306,\"../scatter/style\":412,\"./attributes\":424,\"./calc\":425,\"./cross_trace_calc\":426,\"./defaults\":427,\"./hover\":429,\"./layout_attributes\":431,\"./layout_defaults\":432,\"./plot\":433,\"./style\":434}],431:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar boxLayoutAttrs = _dereq_('../box/layout_attributes');\nvar extendFlat = _dereq_('../../lib').extendFlat;\n\nmodule.exports = {\n    violinmode: extendFlat({}, boxLayoutAttrs.boxmode, {\n        \n    }),\n    violingap: extendFlat({}, boxLayoutAttrs.boxgap, {\n        \n    }),\n    violingroupgap: extendFlat({}, boxLayoutAttrs.boxgroupgap, {\n        \n    })\n};\n\n},{\"../../lib\":178,\"../box/layout_attributes\":303}],432:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar boxLayoutDefaults = _dereq_('../box/layout_defaults');\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n    }\n    boxLayoutDefaults._supply(layoutIn, layoutOut, fullData, coerce, 'violin');\n};\n\n},{\"../../lib\":178,\"../box/layout_defaults\":304,\"./layout_attributes\":431}],433:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\n\nvar boxPlot = _dereq_('../box/plot');\nvar linePoints = _dereq_('../scatter/line_points');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = function plot(gd, plotinfo, cdViolins, violinLayer) {\n    var fullLayout = gd._fullLayout;\n    var xa = plotinfo.xaxis;\n    var ya = plotinfo.yaxis;\n\n    function makePath(pts) {\n        var segments = linePoints(pts, {\n            xaxis: xa,\n            yaxis: ya,\n            connectGaps: true,\n            baseTolerance: 0.75,\n            shape: 'spline',\n            simplify: true,\n            linearized: true\n        });\n        return Drawing.smoothopen(segments[0], 1);\n    }\n\n    Lib.makeTraceGroups(violinLayer, cdViolins, 'trace violins').each(function(cd) {\n        var plotGroup = d3.select(this);\n        var cd0 = cd[0];\n        var t = cd0.t;\n        var trace = cd0.trace;\n\n        if(trace.visible !== true || t.empty) {\n            plotGroup.remove();\n            return;\n        }\n\n        var bPos = t.bPos;\n        var bdPos = t.bdPos;\n        var valAxis = plotinfo[t.valLetter + 'axis'];\n        var posAxis = plotinfo[t.posLetter + 'axis'];\n        var hasBothSides = trace.side === 'both';\n        var hasPositiveSide = hasBothSides || trace.side === 'positive';\n        var hasNegativeSide = hasBothSides || trace.side === 'negative';\n\n        var violins = plotGroup.selectAll('path.violin').data(Lib.identity);\n\n        violins.enter().append('path')\n            .style('vector-effect', 'non-scaling-stroke')\n            .attr('class', 'violin');\n\n        violins.exit().remove();\n\n        violins.each(function(d) {\n            var pathSel = d3.select(this);\n            var density = d.density;\n            var len = density.length;\n            var posCenter = posAxis.c2l(d.pos + bPos, true);\n            var posCenterPx = posAxis.l2p(posCenter);\n\n            var scale;\n            if(trace.width) {\n                scale = t.maxKDE / bdPos;\n            } else {\n                var groupStats = fullLayout._violinScaleGroupStats[trace.scalegroup];\n                scale = trace.scalemode === 'count' ?\n                    (groupStats.maxKDE / bdPos) * (groupStats.maxCount / d.pts.length) :\n                    groupStats.maxKDE / bdPos;\n            }\n\n            var pathPos, pathNeg, path;\n            var i, k, pts, pt;\n\n            if(hasPositiveSide) {\n                pts = new Array(len);\n                for(i = 0; i < len; i++) {\n                    pt = pts[i] = {};\n                    pt[t.posLetter] = posCenter + (density[i].v / scale);\n                    pt[t.valLetter] = valAxis.c2l(density[i].t, true);\n                }\n                pathPos = makePath(pts);\n            }\n\n            if(hasNegativeSide) {\n                pts = new Array(len);\n                for(k = 0, i = len - 1; k < len; k++, i--) {\n                    pt = pts[k] = {};\n                    pt[t.posLetter] = posCenter - (density[i].v / scale);\n                    pt[t.valLetter] = valAxis.c2l(density[i].t, true);\n                }\n                pathNeg = makePath(pts);\n            }\n\n            if(hasBothSides) {\n                path = pathPos + 'L' + pathNeg.substr(1) + 'Z';\n            } else {\n                var startPt = [posCenterPx, valAxis.c2p(density[0].t)];\n                var endPt = [posCenterPx, valAxis.c2p(density[len - 1].t)];\n\n                if(trace.orientation === 'h') {\n                    startPt.reverse();\n                    endPt.reverse();\n                }\n\n                if(hasPositiveSide) {\n                    path = 'M' + startPt + 'L' + pathPos.substr(1) + 'L' + endPt;\n                } else {\n                    path = 'M' + endPt + 'L' + pathNeg.substr(1) + 'L' + startPt;\n                }\n            }\n            pathSel.attr('d', path);\n\n            // save a few things used in getPositionOnKdePath, getKdeValue\n            // on hover and for meanline draw block below\n            d.posCenterPx = posCenterPx;\n            d.posDensityScale = scale * bdPos;\n            d.path = pathSel.node();\n            d.pathLength = d.path.getTotalLength() / (hasBothSides ? 2 : 1);\n        });\n\n        var boxAttrs = trace.box;\n        var boxWidth = boxAttrs.width;\n        var boxLineWidth = (boxAttrs.line || {}).width;\n        var bdPosScaled;\n        var bPosPxOffset;\n\n        if(hasBothSides) {\n            bdPosScaled = bdPos * boxWidth;\n            bPosPxOffset = 0;\n        } else if(hasPositiveSide) {\n            bdPosScaled = [0, bdPos * boxWidth / 2];\n            bPosPxOffset = boxLineWidth * {x: 1, y: -1}[t.posLetter];\n        } else {\n            bdPosScaled = [bdPos * boxWidth / 2, 0];\n            bPosPxOffset = boxLineWidth * {x: -1, y: 1}[t.posLetter];\n        }\n\n        // inner box\n        boxPlot.plotBoxAndWhiskers(plotGroup, {pos: posAxis, val: valAxis}, trace, {\n            bPos: bPos,\n            bdPos: bdPosScaled,\n            bPosPxOffset: bPosPxOffset\n        });\n\n        // meanline insider box\n        boxPlot.plotBoxMean(plotGroup, {pos: posAxis, val: valAxis}, trace, {\n            bPos: bPos,\n            bdPos: bdPosScaled,\n            bPosPxOffset: bPosPxOffset\n        });\n\n        var fn;\n        if(!trace.box.visible && trace.meanline.visible) {\n            fn = Lib.identity;\n        }\n\n        // N.B. use different class name than boxPlot.plotBoxMean,\n        // to avoid selectAll conflict\n        var meanPaths = plotGroup.selectAll('path.meanline').data(fn || []);\n        meanPaths.enter().append('path')\n            .attr('class', 'meanline')\n            .style('fill', 'none')\n            .style('vector-effect', 'non-scaling-stroke');\n        meanPaths.exit().remove();\n        meanPaths.each(function(d) {\n            var v = valAxis.c2p(d.mean, true);\n            var p = helpers.getPositionOnKdePath(d, trace, v);\n\n            d3.select(this).attr('d',\n                trace.orientation === 'h' ?\n                    'M' + v + ',' + p[0] + 'V' + p[1] :\n                    'M' + p[0] + ',' + v + 'H' + p[1]\n            );\n        });\n\n        boxPlot.plotPoints(plotGroup, {x: xa, y: ya}, trace, t);\n    });\n};\n\n},{\"../../components/drawing\":74,\"../../lib\":178,\"../box/plot\":305,\"../scatter/line_points\":403,\"./helpers\":428,\"d3\":16}],434:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar stylePoints = _dereq_('../scatter/style').stylePoints;\n\nmodule.exports = function style(gd) {\n    var s = d3.select(gd).selectAll('g.trace.violins');\n\n    s.style('opacity', function(d) { return d[0].trace.opacity; });\n\n    s.each(function(d) {\n        var trace = d[0].trace;\n        var sel = d3.select(this);\n        var box = trace.box || {};\n        var boxLine = box.line || {};\n        var meanline = trace.meanline || {};\n        var meanLineWidth = meanline.width;\n\n        sel.selectAll('path.violin')\n            .style('stroke-width', trace.line.width + 'px')\n            .call(Color.stroke, trace.line.color)\n            .call(Color.fill, trace.fillcolor);\n\n        sel.selectAll('path.box')\n            .style('stroke-width', boxLine.width + 'px')\n            .call(Color.stroke, boxLine.color)\n            .call(Color.fill, box.fillcolor);\n\n        var meanLineStyle = {\n            'stroke-width': meanLineWidth + 'px',\n            'stroke-dasharray': (2 * meanLineWidth) + 'px,' + meanLineWidth + 'px'\n        };\n\n        sel.selectAll('path.mean')\n            .style(meanLineStyle)\n            .call(Color.stroke, meanline.color);\n\n        sel.selectAll('path.meanline')\n            .style(meanLineStyle)\n            .call(Color.stroke, meanline.color);\n\n        stylePoints(sel, trace, gd);\n    });\n};\n\n},{\"../../components/color\":52,\"../scatter/style\":412,\"d3\":16}],435:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// package version injected by `npm run preprocess`\nexports.version = '1.54.6';\n\n},{}]},{},[11])(11)\n});\n\n\n//# sourceURL=webpack://frontend/./node_modules/plotly.js-cartesian-dist/plotly-cartesian.js?");

/***/ }),

/***/ "./node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2":
/*!********************************************************************************!*\
  !*** ./node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 ***!
  \********************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
eval("module.exports = __webpack_require__.p + \"fonts/fa-solid-900.woff2\";\n\n//# sourceURL=webpack://frontend/./node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2?");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			loaded: false,
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/node module decorator */
/******/ 	(() => {
/******/ 		__webpack_require__.nmd = (module) => {
/******/ 			module.paths = [];
/******/ 			if (!module.children) module.children = [];
/******/ 			return module;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/publicPath */
/******/ 	(() => {
/******/ 		__webpack_require__.p = "/static/";
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	__webpack_require__("./js/app.js");
/******/ 	var __webpack_exports__ = __webpack_require__("./sass/app.scss");
/******/ 	
/******/ })()
;