diff --git a/.gitignore b/.gitignore index e7ba49b..009d36a 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,7 @@ app/assets/javascripts/bundle.js.map /app/assets/builds/* !/app/assets/builds/.keep + +bundle.js +bundle.js.map +bundle.js.LICENSE.txt diff --git a/.storybook/main.js b/.storybook/main.js new file mode 100644 index 0000000..ea2225f --- /dev/null +++ b/.storybook/main.js @@ -0,0 +1,14 @@ +module.exports = { + "stories": [ + "../stories/**/*.stories.mdx", + "../stories/**/*.stories.@(js|jsx|ts|tsx)" + ], + "addons": [ + "@storybook/addon-links", + "@storybook/addon-essentials", + "@storybook/addon-interactions", + "@storybook/addon-postcss", + "storybook-addon-designs/register" + ], + "framework": "@storybook/react" +} \ No newline at end of file diff --git a/.storybook/preview.js b/.storybook/preview.js new file mode 100644 index 0000000..48afd56 --- /dev/null +++ b/.storybook/preview.js @@ -0,0 +1,9 @@ +export const parameters = { + actions: { argTypesRegex: "^on[A-Z].*" }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/, + }, + }, +} \ No newline at end of file diff --git a/app/assets/javascripts/5786ac3aa2cf2bedabdc60118803b16b.jpg b/app/assets/javascripts/5786ac3aa2cf2bedabdc60118803b16b.jpg new file mode 100644 index 0000000..a442214 Binary files /dev/null and b/app/assets/javascripts/5786ac3aa2cf2bedabdc60118803b16b.jpg differ diff --git a/app/assets/javascripts/bundle.js b/app/assets/javascripts/bundle.js index 36e3f90..c63ba70 100644 --- a/app/assets/javascripts/bundle.js +++ b/app/assets/javascripts/bundle.js @@ -1,110 +1,26 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./frontend/daily_learning.jsx"); -/******/ }) -/************************************************************************/ -/******/ ({ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ /***/ "./frontend/actions/session_actions.js": /*!*********************************************!*\ !*** ./frontend/actions/session_actions.js ***! \*********************************************/ -/*! exports provided: RECEIVE_USER, RECEIVE_USER_SIGNIN, REMOVE_USER, RECEIVE_SESSION_ERRORS, CLEAR_SESSION_ERRORS, clearErrors, fetchUser, createUser, loginUser, logoutUser */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECEIVE_USER", function() { return RECEIVE_USER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECEIVE_USER_SIGNIN", function() { return RECEIVE_USER_SIGNIN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REMOVE_USER", function() { return REMOVE_USER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECEIVE_SESSION_ERRORS", function() { return RECEIVE_SESSION_ERRORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLEAR_SESSION_ERRORS", function() { return CLEAR_SESSION_ERRORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearErrors", function() { return clearErrors; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchUser", function() { return fetchUser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUser", function() { return createUser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loginUser", function() { return loginUser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logoutUser", function() { return logoutUser; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "CLEAR_SESSION_ERRORS": () => (/* binding */ CLEAR_SESSION_ERRORS), +/* harmony export */ "RECEIVE_SESSION_ERRORS": () => (/* binding */ RECEIVE_SESSION_ERRORS), +/* harmony export */ "RECEIVE_USER": () => (/* binding */ RECEIVE_USER), +/* harmony export */ "RECEIVE_USER_SIGNIN": () => (/* binding */ RECEIVE_USER_SIGNIN), +/* harmony export */ "REMOVE_USER": () => (/* binding */ REMOVE_USER), +/* harmony export */ "clearErrors": () => (/* binding */ clearErrors), +/* harmony export */ "createUser": () => (/* binding */ createUser), +/* harmony export */ "fetchUser": () => (/* binding */ fetchUser), +/* harmony export */ "loginUser": () => (/* binding */ loginUser), +/* harmony export */ "logoutUser": () => (/* binding */ logoutUser) +/* harmony export */ }); /* harmony import */ var _utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/auth_api_util */ "./frontend/utils/auth_api_util.js"); var RECEIVE_USER = "RECEIVE_USER"; @@ -148,7 +64,7 @@ var clearErrors = function clearErrors() { }; var fetchUser = function fetchUser(id) { return function (dispatch) { - return Object(_utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__["getUser"])(id).then(function (user) { + return (0,_utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__.getUser)(id).then(function (user) { return dispatch(receiveUser(user)); }, function (errors) { return dispatch(receiveErrors(errors.responseJSON)); @@ -157,7 +73,7 @@ var fetchUser = function fetchUser(id) { }; var createUser = function createUser(user) { return function (dispatch) { - return Object(_utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__["signup"])(user).then(function (user) { + return (0,_utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__.signup)(user).then(function (user) { return dispatch(receiveUserSignin(user)); }, function (errors) { return dispatch(receiveErrors(errors.responseJSON)); @@ -166,7 +82,7 @@ var createUser = function createUser(user) { }; var loginUser = function loginUser(user) { return function (dispatch) { - return Object(_utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__["login"])(user).then(function (user) { + return (0,_utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__.login)(user).then(function (user) { return dispatch(receiveUserSignin(user)); }, function (errors) { return dispatch(receiveErrors(errors.responseJSON)); @@ -175,7 +91,7 @@ var loginUser = function loginUser(user) { }; var logoutUser = function logoutUser(user) { return function (dispatch) { - return Object(_utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__["logout"])(user).then(function (user) { + return (0,_utils_auth_api_util__WEBPACK_IMPORTED_MODULE_0__.logout)(user).then(function (user) { return dispatch(removeUser(user.id)); }, function (errors) { return dispatch(receiveErrors(errors.responseJSON)); @@ -189,38 +105,24 @@ var logoutUser = function logoutUser(user) { /*!************************************!*\ !*** ./frontend/components/app.js ***! \************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); -/* harmony import */ var _actions_session_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/session_actions */ "./frontend/actions/session_actions.js"); -/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); -/* harmony import */ var _utils_route_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/route_util */ "./frontend/utils/route_util.js"); -/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components */ "./frontend/components/components.js"); - - +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/node_modules/react-router/esm/react-router.js"); +/* harmony import */ var _utils_route_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/route_util */ "./frontend/utils/route_util.js"); +/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components */ "./frontend/components/components.js"); +/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./header */ "./frontend/components/header.js"); -var mapStateToProps = function mapStateToProps(state) { - return { - loggedIn: Boolean(state.session.currentUser.id) - }; -}; - -var mapDispatchToProps = function mapDispatchToProps(dispatch) { - return { - logOut: function logOut() { - return dispatch(Object(_actions_session_actions__WEBPACK_IMPORTED_MODULE_2__["logoutUser"])()); - } - }; -}; var App = function App(props) { var links = { @@ -231,125 +133,130 @@ var App = function App(props) { "Rambam": "/rambam" }; var externalLinks = { - "Shnayim Mikra": "/shnayimmikra", - "Tikkun Korim": "/tikkun/online", - "Github": "/github" + "Shnayim Mikra": { + path: "/shnayimmikra", + url: "https://shafehorg.github.io/Shnayim-Mikra/" + }, + "Tikkun Korim": { + path: "/tikkun/online", + url: "https://www.sharshi.com/tikkunkorim/" + }, + "Github": { + path: "/github", + url: "https://github.com/ShafehOrg/daily-learning" + } }; - var nav = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("nav", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { + var nav = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("nav", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "internal-links" }, Object.keys(links).map(function (text) { var link = links[text]; - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: text - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"], { + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_4__.Link, { to: "".concat(link) }, " ", text, " ")); - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), "external:", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("br", null), "external:", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "external-links" }, Object.keys(externalLinks).map(function (text) { var link = externalLinks[text]; - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: text - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"], { - to: "".concat(link) + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", { + href: "".concat(link.url), + target: "_blank" }, " ", text, " ")); }))); - var session = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, props.loggedIn ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"], { - to: "/", - onClick: props.logOut - }, " Log out ") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"], { - to: "/login" - }, " Login "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"], { - to: "/signup" - }, " Sign Up "))); - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"], { - to: "/" - }, " Shafeh: Daily Learning "), session, nav, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("main", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Switch"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_header__WEBPACK_IMPORTED_MODULE_3__.Header, null), nav, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("main", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Switch, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { path: "/", exact: true, render: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"], { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_4__.Link, { to: "/sections" }, "Sections"); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_utils_route_util__WEBPACK_IMPORTED_MODULE_4__["AuthRoute"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_utils_route_util__WEBPACK_IMPORTED_MODULE_1__.AuthRoute, { path: "/login", component: function component() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["LogIn"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.LogIn, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_utils_route_util__WEBPACK_IMPORTED_MODULE_4__["AuthRoute"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_utils_route_util__WEBPACK_IMPORTED_MODULE_1__.AuthRoute, { path: "/signup", component: function component() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["SignUp"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.SignUp, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { path: "/sections", render: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["SectionsList"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.SectionsList, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { path: "/chumash", render: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["Chumash"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.Chumash, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { path: "/tehillim", render: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["Tehillim"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.Tehillim, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { path: "/tanya", render: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["Tanya"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.Tanya, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { path: "/hayomyom", render: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["HayomYom"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.HayomYom, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { path: "/rambam", render: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["Rambam"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.Rambam, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { exact: true, path: "/siddur", render: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["Siddur"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.Siddur, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_utils_route_util__WEBPACK_IMPORTED_MODULE_4__["ProtectedRoute"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_utils_route_util__WEBPACK_IMPORTED_MODULE_1__.ProtectedRoute, { exact: true, path: "/siddur/edit", component: function component() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components__WEBPACK_IMPORTED_MODULE_5__["SiddurEdit"], null); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components__WEBPACK_IMPORTED_MODULE_2__.SiddurEdit, null); } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { exact: true, path: "/shnayimmikra", render: function render() { return window.location = "https://shafehorg.github.io/Shnayim-Mikra/"; } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { exact: true, path: "/tikkun/online", render: function render() { return window.location = "https://www.sharshi.com/tikkunkorim/"; } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { exact: true, path: "/github", render: function render() { return window.location = "https://github.com/ShafehOrg/daily-learning"; } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Route"], { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, { component: function component() { return 404; } + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_4__.Link, { + to: { + pathname: "https://example.zendesk.com/hc/en-us/articles/123456789-Privacy-Policies" + }, + target: "_blank" })))); }; -/* harmony default export */ __webpack_exports__["default"] = (Object(react_redux__WEBPACK_IMPORTED_MODULE_1__["connect"])(mapStateToProps, mapDispatchToProps)(App)); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (App); /***/ }), @@ -357,17 +264,17 @@ var App = function App(props) { /*!****************************************!*\ !*** ./frontend/components/chumash.js ***! \****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Chumash; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Chumash) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function Chumash() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Chumash"); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Chumash"); } /***/ }), @@ -376,41 +283,32 @@ function Chumash() { /*!*******************************************!*\ !*** ./frontend/components/components.js ***! \*******************************************/ -/*! exports provided: SectionsList, LogIn, SignUp, Chumash, Tehillim, Tanya, HayomYom, Rambam, Siddur, SiddurEdit */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Chumash": () => (/* reexport safe */ _chumash__WEBPACK_IMPORTED_MODULE_3__["default"]), +/* harmony export */ "HayomYom": () => (/* reexport safe */ _hayomyom__WEBPACK_IMPORTED_MODULE_6__["default"]), +/* harmony export */ "LogIn": () => (/* reexport safe */ _log_in__WEBPACK_IMPORTED_MODULE_1__["default"]), +/* harmony export */ "Rambam": () => (/* reexport safe */ _rambam__WEBPACK_IMPORTED_MODULE_7__["default"]), +/* harmony export */ "SectionsList": () => (/* reexport safe */ _sections_list__WEBPACK_IMPORTED_MODULE_0__["default"]), +/* harmony export */ "Siddur": () => (/* reexport safe */ _siddur__WEBPACK_IMPORTED_MODULE_8__["default"]), +/* harmony export */ "SiddurEdit": () => (/* reexport safe */ _siddur_edit__WEBPACK_IMPORTED_MODULE_9__["default"]), +/* harmony export */ "SignUp": () => (/* reexport safe */ _sign_up__WEBPACK_IMPORTED_MODULE_2__["default"]), +/* harmony export */ "Tanya": () => (/* reexport safe */ _tanya__WEBPACK_IMPORTED_MODULE_5__["default"]), +/* harmony export */ "Tehillim": () => (/* reexport safe */ _tehillim__WEBPACK_IMPORTED_MODULE_4__["default"]) +/* harmony export */ }); /* harmony import */ var _sections_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sections_list */ "./frontend/components/sections_list.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SectionsList", function() { return _sections_list__WEBPACK_IMPORTED_MODULE_0__["default"]; }); - /* harmony import */ var _log_in__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./log_in */ "./frontend/components/log_in.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LogIn", function() { return _log_in__WEBPACK_IMPORTED_MODULE_1__["default"]; }); - /* harmony import */ var _sign_up__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sign_up */ "./frontend/components/sign_up.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SignUp", function() { return _sign_up__WEBPACK_IMPORTED_MODULE_2__["default"]; }); - /* harmony import */ var _chumash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chumash */ "./frontend/components/chumash.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Chumash", function() { return _chumash__WEBPACK_IMPORTED_MODULE_3__["default"]; }); - /* harmony import */ var _tehillim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tehillim */ "./frontend/components/tehillim.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tehillim", function() { return _tehillim__WEBPACK_IMPORTED_MODULE_4__["default"]; }); - /* harmony import */ var _tanya__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tanya */ "./frontend/components/tanya.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tanya", function() { return _tanya__WEBPACK_IMPORTED_MODULE_5__["default"]; }); - /* harmony import */ var _hayomyom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hayomyom */ "./frontend/components/hayomyom.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HayomYom", function() { return _hayomyom__WEBPACK_IMPORTED_MODULE_6__["default"]; }); - /* harmony import */ var _rambam__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rambam */ "./frontend/components/rambam.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Rambam", function() { return _rambam__WEBPACK_IMPORTED_MODULE_7__["default"]; }); - /* harmony import */ var _siddur__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./siddur */ "./frontend/components/siddur.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Siddur", function() { return _siddur__WEBPACK_IMPORTED_MODULE_8__["default"]; }); - /* harmony import */ var _siddur_edit__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./siddur_edit */ "./frontend/components/siddur_edit.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SiddurEdit", function() { return _siddur_edit__WEBPACK_IMPORTED_MODULE_9__["default"]; }); - @@ -429,35 +327,64 @@ __webpack_require__.r(__webpack_exports__); /*!*****************************************!*\ !*** ./frontend/components/hayomyom.js ***! \*****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HayomYom; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ HayomYom) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function HayomYom() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Hayom Yom"); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Hayom Yom"); } /***/ }), +/***/ "./frontend/components/header.js": +/*!***************************************!*\ + !*** ./frontend/components/header.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Header": () => (/* binding */ Header) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var _logo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logo */ "./frontend/components/logo.js"); +/* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./session */ "./frontend/components/session.js"); +/* harmony import */ var _header_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./header.css */ "./frontend/components/header.css"); +/* harmony import */ var _header_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_header_css__WEBPACK_IMPORTED_MODULE_3__); + + + + + +var Header = function Header() { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("header", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_logo__WEBPACK_IMPORTED_MODULE_1__.Logo, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Shafeh")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_session__WEBPACK_IMPORTED_MODULE_2__["default"], null))); +}; + +/***/ }), + /***/ "./frontend/components/log_in.js": /*!***************************************!*\ !*** ./frontend/components/log_in.js ***! \***************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); -/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); -/* harmony import */ var _actions_session_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actions/session_actions */ "./frontend/actions/session_actions.js"); +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/node_modules/react-router/esm/react-router.js"); +/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); +/* harmony import */ var _actions_session_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/session_actions */ "./frontend/actions/session_actions.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } @@ -490,22 +417,22 @@ var mstp = function mstp(state, ownProps) { var mdtp = function mdtp(dispatch) { return { login: function login(user) { - return dispatch(Object(_actions_session_actions__WEBPACK_IMPORTED_MODULE_3__["loginUser"])(user)); + return dispatch((0,_actions_session_actions__WEBPACK_IMPORTED_MODULE_2__.loginUser)(user)); }, clearErrors: function clearErrors() { - return dispatch(Object(_actions_session_actions__WEBPACK_IMPORTED_MODULE_3__["clearErrors"])()); + return dispatch((0,_actions_session_actions__WEBPACK_IMPORTED_MODULE_2__.clearErrors)()); } }; }; var LogIn = function LogIn(props) { - Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () { + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { return function cleanup() { props.clearErrors(); }; }, []); - var _useState = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])({ + var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({ email: "", password: "" }, []), @@ -528,9 +455,9 @@ var LogIn = function LogIn(props) { }; var errors = props.errors; - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Sign in"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Sign in"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("form", { onSubmit: handleSubmit - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { required: true, id: "email", label: "Email Address", @@ -538,7 +465,7 @@ var LogIn = function LogIn(props) { type: "email", onChange: handleInputChange, value: values.email - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { required: true, id: "password", label: "Password", @@ -546,12 +473,111 @@ var LogIn = function LogIn(props) { type: "password", onChange: handleInputChange, value: values.password - }), errors !== null && errors !== void 0 ? errors : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", null, "Sign In"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["Link"], { + }), errors !== null && errors !== void 0 ? errors : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("button", null, "Sign In"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Link, { to: "/signup" }, "Don't have an account? Sign Up"))); }; -/* harmony default export */ __webpack_exports__["default"] = (Object(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["withRouter"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mstp, mdtp)(LogIn))); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.withRouter)((0,react_redux__WEBPACK_IMPORTED_MODULE_1__.connect)(mstp, mdtp)(LogIn))); + +/***/ }), + +/***/ "./frontend/components/logo.js": +/*!*************************************!*\ + !*** ./frontend/components/logo.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Logo": () => (/* binding */ Logo) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _logo_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logo.css */ "./frontend/components/logo.css"); +/* harmony import */ var _logo_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_logo_css__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _assets_logo_jpg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assets/logo.jpg */ "./frontend/assets/logo.jpg"); +var _excluded = ["size", "alt"]; + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + +/** + * Primary UI component for the app logo + */ + +var Logo = function Logo(_ref) { + var size = _ref.size, + alt = _ref.alt, + props = _objectWithoutProperties(_ref, _excluded); + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", _extends({ + src: _assets_logo_jpg__WEBPACK_IMPORTED_MODULE_2__["default"], + alt: alt, + className: ['storybook-logo', "storybook-logo--".concat(size)].join(' ') + }, props)); +}; +Logo.propTypes = { + /** + * How large should the logo be? + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(['small', 'medium', 'large']), + + /** + * Optional click handler + */ + onClick: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), + + /** + * Optional alt text + * @default 'Logo' + */ + alt: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string) +}; +Logo.defaultProps = { + size: 'small', + onClick: undefined, + alt: 'Logo' +}; + +/***/ }), + +/***/ "./frontend/components/provider.js": +/*!*****************************************!*\ + !*** ./frontend/components/provider.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); + + + + +var ProviderWrapper = function ProviderWrapper(_ref) { + var children = _ref.children, + store = _ref.store; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_redux__WEBPACK_IMPORTED_MODULE_1__.Provider, { + store: store + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.HashRouter, null, children)); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProviderWrapper); /***/ }), @@ -559,17 +585,17 @@ var LogIn = function LogIn(props) { /*!***************************************!*\ !*** ./frontend/components/rambam.js ***! \***************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Rambam; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Rambam) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function Rambam() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Rambam"); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Rambam"); } /***/ }), @@ -578,42 +604,104 @@ function Rambam() { /*!**********************************************!*\ !*** ./frontend/components/sections_list.js ***! \**********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SectionsList; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SectionsList) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function SectionsList() { var list = [1, 2].map(function (item) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: item, className: "list" }, item); }); - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, list); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, list); } /***/ }), +/***/ "./frontend/components/session.js": +/*!****************************************!*\ + !*** ./frontend/components/session.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Session": () => (/* binding */ Session), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); +/* harmony import */ var _actions_session_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/session_actions */ "./frontend/actions/session_actions.js"); +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); + + + + + + +var mapStateToProps = function mapStateToProps(state) { + return { + loggedIn: Boolean(state.session.currentUser.name) + }; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + logOut: function logOut() { + return dispatch((0,_actions_session_actions__WEBPACK_IMPORTED_MODULE_2__.logoutUser)()); + } + }; +}; + +var Session = function Session(_ref) { + var loggedIn = _ref.loggedIn, + logOut = _ref.logOut; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, loggedIn ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Link, { + to: "/", + onClick: logOut + }, " Log out ") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Link, { + to: "/login" + }, " Login "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Link, { + to: "/signup" + }, " Sign Up "))); +}; +Session.propTypes = { + loggedIn: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool.isRequired), + logOut: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func.isRequired) +}; +Session.defaultProps = { + loggedIn: true, + logOut: function logOut() {} +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_redux__WEBPACK_IMPORTED_MODULE_1__.connect)(mapStateToProps, mapDispatchToProps)(Session)); + +/***/ }), + /***/ "./frontend/components/siddur.js": /*!***************************************!*\ !*** ./frontend/components/siddur.js ***! \***************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Siddur; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Siddur) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function Siddur() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Siddur"); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Siddur"); } /***/ }), @@ -622,17 +710,17 @@ function Siddur() { /*!********************************************!*\ !*** ./frontend/components/siddur_edit.js ***! \********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SiddurEdit; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SiddurEdit) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function SiddurEdit() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Siddur Edit"); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Siddur Edit"); } /***/ }), @@ -641,16 +729,18 @@ function SiddurEdit() { /*!****************************************!*\ !*** ./frontend/components/sign_up.js ***! \****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); -/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); -/* harmony import */ var _actions_session_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actions/session_actions */ "./frontend/actions/session_actions.js"); +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/node_modules/react-router/esm/react-router.js"); +/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); +/* harmony import */ var _actions_session_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/session_actions */ "./frontend/actions/session_actions.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } @@ -683,22 +773,22 @@ var mstp = function mstp(state, ownProps) { var mdtp = function mdtp(dispatch) { return { signup: function signup(user) { - return dispatch(Object(_actions_session_actions__WEBPACK_IMPORTED_MODULE_3__["createUser"])(user)); + return dispatch((0,_actions_session_actions__WEBPACK_IMPORTED_MODULE_2__.createUser)(user)); }, clearErrors: function clearErrors() { - return dispatch(Object(_actions_session_actions__WEBPACK_IMPORTED_MODULE_3__["clearErrors"])()); + return dispatch((0,_actions_session_actions__WEBPACK_IMPORTED_MODULE_2__.clearErrors)()); } }; }; var SignUp = function SignUp(props) { - Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () { + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { return function cleanup() { props.clearErrors(); }; }, []); - var _useState = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])({ + var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({ name: "", username: "", email: "", @@ -723,9 +813,9 @@ var SignUp = function SignUp(props) { }; var errors = props.errors; - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Sign Up"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Sign Up"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("form", { onSubmit: handleSubmit - }, "name", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { + }, "name", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { required: true, id: "name", label: "Name", @@ -733,7 +823,7 @@ var SignUp = function SignUp(props) { type: "text", onChange: handleInputChange, value: values.name - }), "username", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { + }), "username", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { required: true, id: "username", label: "Username", @@ -741,7 +831,7 @@ var SignUp = function SignUp(props) { type: "text", onChange: handleInputChange, value: values.username - }), "email", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { + }), "email", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { required: true, id: "email", label: "Email", @@ -749,7 +839,7 @@ var SignUp = function SignUp(props) { type: "email", onChange: handleInputChange, value: values.email - }), "password", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { + }), "password", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { required: true, id: "password", label: "Password", @@ -757,12 +847,12 @@ var SignUp = function SignUp(props) { type: "password", onChange: handleInputChange, value: values.password - }), errors !== null && errors !== void 0 ? errors : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", null, "Sign Up"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["Link"], { + }), errors !== null && errors !== void 0 ? errors : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("button", null, "Sign Up"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Link, { to: "/login" }, "Already joined? Log In"))); }; -/* harmony default export */ __webpack_exports__["default"] = (Object(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["withRouter"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mstp, mdtp)(SignUp))); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.withRouter)((0,react_redux__WEBPACK_IMPORTED_MODULE_1__.connect)(mstp, mdtp)(SignUp))); /***/ }), @@ -770,17 +860,17 @@ var SignUp = function SignUp(props) { /*!**************************************!*\ !*** ./frontend/components/tanya.js ***! \**************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Tanya; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Tanya) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function Tanya() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Tanya"); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Tanya"); } /***/ }), @@ -789,70 +879,43 @@ function Tanya() { /*!*****************************************!*\ !*** ./frontend/components/tehillim.js ***! \*****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Tehillim; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Tehillim) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function Tehillim() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", null, "Tehillim"); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, "Tehillim"); } /***/ }), -/***/ "./frontend/daily_learning.jsx": -/*!*************************************!*\ - !*** ./frontend/daily_learning.jsx ***! - \*************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); -/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _root__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./root */ "./frontend/root.js"); -/* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./store/store */ "./frontend/store/store.js"); - - - - -document.addEventListener("DOMContentLoaded", function () { - var store = Object(_store_store__WEBPACK_IMPORTED_MODULE_3__["default"])(); - var root = document.getElementById("root"); - react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_root__WEBPACK_IMPORTED_MODULE_2__["default"], { - store: store - }), root); -}); - -/***/ }), - /***/ "./frontend/reducers/root_reducer.js": /*!*******************************************!*\ !*** ./frontend/reducers/root_reducer.js ***! \*******************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js"); -/* harmony import */ var _session_reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./session_reducer */ "./frontend/reducers/session_reducer.js"); -/* harmony import */ var _session_errors_reducer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./session_errors_reducer */ "./frontend/reducers/session_errors_reducer.js"); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js"); +/* harmony import */ var _session_reducer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./session_reducer */ "./frontend/reducers/session_reducer.js"); +/* harmony import */ var _session_errors_reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./session_errors_reducer */ "./frontend/reducers/session_errors_reducer.js"); -var rootReducer = Object(redux__WEBPACK_IMPORTED_MODULE_0__["combineReducers"])({ - session: _session_reducer__WEBPACK_IMPORTED_MODULE_1__["default"], - errors: _session_errors_reducer__WEBPACK_IMPORTED_MODULE_2__["default"] +var rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_2__.combineReducers)({ + session: _session_reducer__WEBPACK_IMPORTED_MODULE_0__["default"], + errors: _session_errors_reducer__WEBPACK_IMPORTED_MODULE_1__["default"] }); -/* harmony default export */ __webpack_exports__["default"] = (rootReducer); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rootReducer); /***/ }), @@ -860,11 +923,13 @@ var rootReducer = Object(redux__WEBPACK_IMPORTED_MODULE_0__["combineReducers"])( /*!*****************************************************!*\ !*** ./frontend/reducers/session_errors_reducer.js ***! \*****************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); /* harmony import */ var _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actions/session_actions */ "./frontend/actions/session_actions.js"); var _default = { @@ -876,12 +941,12 @@ var errorsReducer = function errorsReducer() { var action = arguments.length > 1 ? arguments[1] : undefined; switch (action.type) { - case _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__["RECEIVE_SESSION_ERRORS"]: + case _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__.RECEIVE_SESSION_ERRORS: return { "login": action.errors }; - case _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__["CLEAR_SESSION_ERRORS"]: + case _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__.CLEAR_SESSION_ERRORS: return _default; default: @@ -889,7 +954,7 @@ var errorsReducer = function errorsReducer() { } }; -/* harmony default export */ __webpack_exports__["default"] = (errorsReducer); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (errorsReducer); /***/ }), @@ -897,16 +962,22 @@ var errorsReducer = function errorsReducer() { /*!**********************************************!*\ !*** ./frontend/reducers/session_reducer.js ***! \**********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); /* harmony import */ var _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actions/session_actions */ "./frontend/actions/session_actions.js"); +/** + * TODO: Save the session state to localStorage + */ + var defaultState = { currentUser: { - id: null, + name: null, username: null } }; @@ -916,15 +987,15 @@ var sessionReducer = function sessionReducer() { var action = arguments.length > 1 ? arguments[1] : undefined; switch (action.type) { - case _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__["RECEIVE_USER_SIGNIN"]: + case _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__.RECEIVE_USER_SIGNIN: return { currentUser: { - id: action.user.id, + name: action.user.name, username: action.user.username } }; - case _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__["REMOVE_USER"]: + case _actions_session_actions__WEBPACK_IMPORTED_MODULE_0__.REMOVE_USER: return defaultState; default: @@ -932,7 +1003,7 @@ var sessionReducer = function sessionReducer() { } }; -/* harmony default export */ __webpack_exports__["default"] = (sessionReducer); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (sessionReducer); /***/ }), @@ -940,67 +1011,28 @@ var sessionReducer = function sessionReducer() { /*!**************************!*\ !*** ./frontend/root.js ***! \**************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _components_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/app */ "./frontend/components/app.js"); -/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); -/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +/* harmony import */ var _components_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/provider */ "./frontend/components/provider.js"); -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - - - - - - -var Root = /*#__PURE__*/function (_React$Component) { - _inherits(Root, _React$Component); - - var _super = _createSuper(Root); - - function Root() { - _classCallCheck(this, Root); - - return _super.apply(this, arguments); - } - - _createClass(Root, [{ - key: "render", - value: function render() { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_redux__WEBPACK_IMPORTED_MODULE_2__["Provider"], { - store: this.props.store - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["HashRouter"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_app__WEBPACK_IMPORTED_MODULE_1__["default"], null))); - } - }]); - - return Root; -}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); +var Root = function Root(_ref) { + var store = _ref.store; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_provider__WEBPACK_IMPORTED_MODULE_2__["default"], { + store: store + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app__WEBPACK_IMPORTED_MODULE_1__["default"], null)); +}; -/* harmony default export */ __webpack_exports__["default"] = (Root); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Root); /***/ }), @@ -1008,18 +1040,19 @@ var Root = /*#__PURE__*/function (_React$Component) { /*!*********************************!*\ !*** ./frontend/store/store.js ***! \*********************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js"); -/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! redux-thunk */ "./node_modules/redux-thunk/es/index.js"); -/* harmony import */ var redux_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! redux-logger */ "./node_modules/redux-logger/dist/redux-logger.js"); -/* harmony import */ var redux_logger__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(redux_logger__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var redux_devtools_extension__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-devtools-extension */ "./node_modules/redux-devtools-extension/index.js"); -/* harmony import */ var redux_devtools_extension__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(redux_devtools_extension__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _reducers_root_reducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/root_reducer */ "./frontend/reducers/root_reducer.js"); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js"); +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "./node_modules/redux-thunk/es/index.js"); +/* harmony import */ var redux_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux-logger */ "./node_modules/redux-logger/dist/redux-logger.js"); +/* harmony import */ var redux_logger__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(redux_logger__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var redux_devtools_extension__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! redux-devtools-extension */ "./node_modules/redux-devtools-extension/index.js"); +/* harmony import */ var _reducers_root_reducer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../reducers/root_reducer */ "./frontend/reducers/root_reducer.js"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } @@ -1037,15 +1070,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len -var middleware = [redux_thunk__WEBPACK_IMPORTED_MODULE_1__["default"]]; +var middleware = [redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]]; if (true) { - middleware = middleware.concat(redux_logger__WEBPACK_IMPORTED_MODULE_2__["logger"]); + middleware = middleware.concat(redux_logger__WEBPACK_IMPORTED_MODULE_0__.logger); } -/* harmony default export */ __webpack_exports__["default"] = (function () { +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { var preloadedState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return Object(redux__WEBPACK_IMPORTED_MODULE_0__["createStore"])(_reducers_root_reducer__WEBPACK_IMPORTED_MODULE_4__["default"], preloadedState, Object(redux_devtools_extension__WEBPACK_IMPORTED_MODULE_3__["composeWithDevTools"])(redux__WEBPACK_IMPORTED_MODULE_0__["applyMiddleware"].apply(void 0, _toConsumableArray(middleware)))); + return (0,redux__WEBPACK_IMPORTED_MODULE_4__.createStore)(_reducers_root_reducer__WEBPACK_IMPORTED_MODULE_2__["default"], preloadedState, (0,redux_devtools_extension__WEBPACK_IMPORTED_MODULE_1__.composeWithDevTools)(redux__WEBPACK_IMPORTED_MODULE_4__.applyMiddleware.apply(void 0, _toConsumableArray(middleware)))); }); /***/ }), @@ -1054,15 +1087,16 @@ if (true) { /*!*****************************************!*\ !*** ./frontend/utils/auth_api_util.js ***! \*****************************************/ -/*! exports provided: getUser, signup, login, logout */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUser", function() { return getUser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "signup", function() { return signup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "login", function() { return login; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logout", function() { return logout; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getUser": () => (/* binding */ getUser), +/* harmony export */ "login": () => (/* binding */ login), +/* harmony export */ "logout": () => (/* binding */ logout), +/* harmony export */ "signup": () => (/* binding */ signup) +/* harmony export */ }); // AuthApiUtil /** @@ -1120,17 +1154,17 @@ var logout = function logout() { /*!**************************************!*\ !*** ./frontend/utils/route_util.js ***! \**************************************/ -/*! exports provided: AuthRoute, ProtectedRoute */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AuthRoute", function() { return AuthRoute; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProtectedRoute", function() { return ProtectedRoute; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "AuthRoute": () => (/* binding */ AuthRoute), +/* harmony export */ "ProtectedRoute": () => (/* binding */ ProtectedRoute) +/* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js"); -/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); +/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/node_modules/react-router/esm/react-router.js"); +/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); // not logged in @@ -1140,11 +1174,11 @@ var Auth = function Auth(_ref) { path = _ref.path, loggedIn = _ref.loggedIn, exact = _ref.exact; - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["Route"], { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, { path: path, exact: exact, render: function render(props) { - return !loggedIn ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Component, props) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["Redirect"], { + return !loggedIn ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, props) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Redirect, { to: "/" }); } @@ -1157,11 +1191,11 @@ var Protected = function Protected(_ref2) { path = _ref2.path, loggedIn = _ref2.loggedIn, exact = _ref2.exact; - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["Route"], { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, { path: path, exact: exact, render: function render(props) { - return loggedIn ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Component, props) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["Redirect"], { + return loggedIn ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, props) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Redirect, { to: "/login" }); } @@ -1174,7578 +1208,6638 @@ var mapStateToProps = function mapStateToProps(state) { }; }; -var AuthRoute = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["withRouter"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mapStateToProps)(Auth)); -var ProtectedRoute = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["withRouter"])(Object(react_redux__WEBPACK_IMPORTED_MODULE_2__["connect"])(mapStateToProps)(Protected)); +var AuthRoute = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.withRouter)((0,react_redux__WEBPACK_IMPORTED_MODULE_1__.connect)(mapStateToProps)(Auth)); +var ProtectedRoute = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.withRouter)((0,react_redux__WEBPACK_IMPORTED_MODULE_1__.connect)(mapStateToProps)(Protected)); /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! - \*******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/css-loader/dist/cjs.js!./frontend/components/header.css": +/*!******************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./frontend/components/header.css ***! + \******************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; }); -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ".wrapper {\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n padding: 15px 20px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\nsvg {\n display: inline-block;\n vertical-align: top;\n}\n\nh1 {\n font-weight: 900;\n font-size: 20px;\n line-height: 1;\n margin: 6px 0 6px 10px;\n display: inline-block;\n vertical-align: top;\n}\n\nbutton + button {\n margin-left: 10px;\n}\n\n.welcome {\n color: #333;\n font-size: 14px;\n margin-right: 10px;\n}\n", "",{"version":3,"sources":["webpack://./frontend/components/header.css"],"names":[],"mappings":"AAAA;EACE,0EAA0E;EAC1E,2CAA2C;EAC3C,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,8BAA8B;AAChC;;AAEA;EACE,qBAAqB;EACrB,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,cAAc;EACd,sBAAsB;EACtB,qBAAqB;EACrB,mBAAmB;AACrB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,WAAW;EACX,eAAe;EACf,kBAAkB;AACpB","sourcesContent":[".wrapper {\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n padding: 15px 20px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\nsvg {\n display: inline-block;\n vertical-align: top;\n}\n\nh1 {\n font-weight: 900;\n font-size: 20px;\n line-height: 1;\n margin: 6px 0 6px 10px;\n display: inline-block;\n vertical-align: top;\n}\n\nbutton + button {\n margin-left: 10px;\n}\n\n.welcome {\n color: #333;\n font-size: 14px;\n margin-right: 10px;\n}\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); - return obj; -} /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***! - \************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/css-loader/dist/cjs.js!./frontend/components/logo.css": +/*!****************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./frontend/components/logo.css ***! + \****************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; }); -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ".storybook-logo--small {\n width: 32px;\n height: 32px;\n}\n\n.storybook-logo--medium {\n width: 48px;\n height: 48px;\n}\n\n.storybook-logo--large {\n width: 64px;\n height: 64px;\n}\n", "",{"version":3,"sources":["webpack://./frontend/components/logo.css"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;AACd","sourcesContent":[".storybook-logo--small {\n width: 32px;\n height: 32px;\n}\n\n.storybook-logo--medium {\n width: 48px;\n height: 48px;\n}\n\n.storybook-logo--large {\n width: 64px;\n height: 64px;\n}\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); - return _extends.apply(this, arguments); -} /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***! - \******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/css-loader/dist/runtime/api.js": +/*!*****************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/api.js ***! + \*****************************************************/ +/***/ ((module) => { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inheritsLoose; }); -/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - Object(_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(subClass, superClass); -} -/***/ }), +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +module.exports = function (cssWithMappingToString) { + var list = []; // return the list of modules as css string -/***/ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***! - \******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + list.toString = function toString() { + return this.map(function (item) { + var content = ""; + var needLayer = typeof item[5] !== "undefined"; -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectSpread2; }); -/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); + if (item[4]) { + content += "@supports (".concat(item[4], ") {"); + } + if (item[2]) { + content += "@media ".concat(item[2], " {"); + } -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); + if (needLayer) { + content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {"); + } - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), keys.push.apply(keys, symbols); - } + content += cssWithMappingToString(item); - return keys; -} + if (needLayer) { + content += "}"; + } -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { - Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } + if (item[2]) { + content += "}"; + } - return target; -} + if (item[4]) { + content += "}"; + } + + return content; + }).join(""); + }; // import a list of modules into the list + + + list.i = function i(modules, media, dedupe, supports, layer) { + if (typeof modules === "string") { + modules = [[null, modules, undefined]]; + } + + var alreadyImportedModules = {}; + + if (dedupe) { + for (var k = 0; k < this.length; k++) { + var id = this[k][0]; + + if (id != null) { + alreadyImportedModules[id] = true; + } + } + } + + for (var _k = 0; _k < modules.length; _k++) { + var item = [].concat(modules[_k]); + + if (dedupe && alreadyImportedModules[item[0]]) { + continue; + } + + if (typeof layer !== "undefined") { + if (typeof item[5] === "undefined") { + item[5] = layer; + } else { + item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}"); + item[5] = layer; + } + } + + if (media) { + if (!item[2]) { + item[2] = media; + } else { + item[1] = "@media ".concat(item[2], " {").concat(item[1], "}"); + item[2] = media; + } + } + + if (supports) { + if (!item[4]) { + item[4] = "".concat(supports); + } else { + item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}"); + item[4] = supports; + } + } + + list.push(item); + } + }; + + return list; +}; /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***! - \*********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js": +/*!************************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***! + \************************************************************/ +/***/ ((module) => { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; }); -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; + +module.exports = function (item) { + var content = item[1]; + var cssMapping = item[3]; + + if (!cssMapping) { + return content; } - return target; -} + if (typeof btoa === "function") { + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping)))); + var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); + var sourceMapping = "/*# ".concat(data, " */"); + var sourceURLs = cssMapping.sources.map(function (source) { + return "/*# sourceURL=".concat(cssMapping.sourceRoot || "").concat(source, " */"); + }); + return [content].concat(sourceURLs).concat([sourceMapping]).join("\n"); + } + + return [content].join("\n"); +}; /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***! - \*******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./frontend/assets/logo.jpg": +/*!**********************************!*\ + !*** ./frontend/assets/logo.jpg ***! + \**********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _setPrototypeOf; }); -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); -} +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__webpack_require__.p + "5786ac3aa2cf2bedabdc60118803b16b.jpg"); /***/ }), -/***/ "./node_modules/history/esm/history.js": -/*!*********************************************!*\ - !*** ./node_modules/history/esm/history.js ***! - \*********************************************/ -/*! exports provided: createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js ***! + \**********************************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBrowserHistory", function() { return createBrowserHistory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createHashHistory", function() { return createHashHistory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMemoryHistory", function() { return createMemoryHistory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLocation", function() { return createLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "locationsAreEqual", function() { return locationsAreEqual; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parsePath", function() { return parsePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPath", function() { return createPath; }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); -/* harmony import */ var resolve_pathname__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! resolve-pathname */ "./node_modules/resolve-pathname/esm/resolve-pathname.js"); -/* harmony import */ var value_equal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! value-equal */ "./node_modules/value-equal/esm/value-equal.js"); -/* harmony import */ var tiny_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tiny-warning */ "./node_modules/tiny-warning/dist/tiny-warning.esm.js"); -/* harmony import */ var tiny_invariant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.esm.js"); +var reactIs = __webpack_require__(/*! react-is */ "./node_modules/hoist-non-react-statics/node_modules/react-is/index.js"); +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true +}; +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; +var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; +var MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true +}; +var TYPE_STATICS = {}; +TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; +TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; +function getStatics(component) { + // React v16.11 and below + if (reactIs.isMemo(component)) { + return MEMO_STATICS; + } // React v16.12 and above -function addLeadingSlash(path) { - return path.charAt(0) === '/' ? path : '/' + path; -} -function stripLeadingSlash(path) { - return path.charAt(0) === '/' ? path.substr(1) : path; -} -function hasBasename(path, prefix) { - return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1; -} -function stripBasename(path, prefix) { - return hasBasename(path, prefix) ? path.substr(prefix.length) : path; -} -function stripTrailingSlash(path) { - return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; } -function parsePath(path) { - var pathname = path || '/'; - var search = ''; - var hash = ''; - var hashIndex = pathname.indexOf('#'); - if (hashIndex !== -1) { - hash = pathname.substr(hashIndex); - pathname = pathname.substr(0, hashIndex); - } +var defineProperty = Object.defineProperty; +var getOwnPropertyNames = Object.getOwnPropertyNames; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var getPrototypeOf = Object.getPrototypeOf; +var objectPrototype = Object.prototype; +function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); - var searchIndex = pathname.indexOf('?'); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } - if (searchIndex !== -1) { - search = pathname.substr(searchIndex); - pathname = pathname.substr(0, searchIndex); - } + var keys = getOwnPropertyNames(sourceComponent); - return { - pathname: pathname, - search: search === '?' ? '' : search, - hash: hash === '#' ? '' : hash - }; -} -function createPath(location) { - var pathname = location.pathname, - search = location.search, - hash = location.hash; - var path = pathname || '/'; - if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search; - if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash; - return path; -} + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } -function createLocation(path, state, key, currentLocation) { - var location; + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); - if (typeof path === 'string') { - // Two-arg form: push(path, state) - location = parsePath(path); - location.state = state; - } else { - // One-arg form: push(location) - location = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, path); - if (location.pathname === undefined) location.pathname = ''; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; - if (location.search) { - if (location.search.charAt(0) !== '?') location.search = '?' + location.search; - } else { - location.search = ''; + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } } + } - if (location.hash) { - if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; - } else { - location.hash = ''; - } + return targetComponent; +} - if (state !== undefined && location.state === undefined) location.state = state; - } +module.exports = hoistNonReactStatics; - try { - location.pathname = decodeURI(location.pathname); - } catch (e) { - if (e instanceof URIError) { - throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); - } else { - throw e; - } - } - if (key) location.key = key; +/***/ }), - if (currentLocation) { - // Resolve incomplete/relative pathname relative to current location. - if (!location.pathname) { - location.pathname = currentLocation.pathname; - } else if (location.pathname.charAt(0) !== '/') { - location.pathname = Object(resolve_pathname__WEBPACK_IMPORTED_MODULE_1__["default"])(location.pathname, currentLocation.pathname); - } - } else { - // When there is no prior location and pathname is empty, set it to / - if (!location.pathname) { - location.pathname = '/'; - } - } +/***/ "./node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { - return location; -} -function locationsAreEqual(a, b) { - return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && Object(value_equal__WEBPACK_IMPORTED_MODULE_2__["default"])(a.state, b.state); +"use strict"; +/** @license React v16.13.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + + + +if (true) { + (function() { +'use strict'; + +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary +// (unstable) APIs that have been removed. Can we remove the symbols? + +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; +var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; +var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; +var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; +var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; + +function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } -function createTransitionManager() { - var prompt = null; +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; - function setPrompt(nextPrompt) { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(prompt == null, 'A history supports only one prompt at a time') : undefined; - prompt = nextPrompt; - return function () { - if (prompt === nextPrompt) prompt = null; - }; - } + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; - function confirmTransitionTo(location, action, getUserConfirmation, callback) { - // TODO: If another transition starts while we're still confirming - // the previous one, we may end up in a weird state. Figure out the - // best way to handle this. - if (prompt != null) { - var result = typeof prompt === 'function' ? prompt(location, action) : prompt; + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + + default: + return $$typeof; + } - if (typeof result === 'string') { - if (typeof getUserConfirmation === 'function') { - getUserConfirmation(result, callback); - } else { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : undefined; - callback(true); } - } else { - // Return false from a transition hook to cancel the transition. - callback(result !== false); - } - } else { - callback(true); + + case REACT_PORTAL_TYPE: + return $$typeof; } } - var listeners = []; - - function appendListener(fn) { - var isActive = true; + return undefined; +} // AsyncMode is deprecated along with isAsyncMode - function listener() { - if (isActive) fn.apply(void 0, arguments); - } +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; +var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated - listeners.push(listener); - return function () { - isActive = false; - listeners = listeners.filter(function (item) { - return item !== listener; - }); - }; - } +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint - function notifyListeners() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); } - - listeners.forEach(function (listener) { - return listener.apply(void 0, args); - }); } - return { - setPrompt: setPrompt, - confirmTransitionTo: confirmTransitionTo, - appendListener: appendListener, - notifyListeners: notifyListeners - }; + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } - -var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); -function getConfirmation(message, callback) { - callback(window.confirm(message)); // eslint-disable-line no-alert +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } -/** - * Returns true if the HTML5 history API is supported. Taken from Modernizr. - * - * https://github.com/Modernizr/Modernizr/blob/master/LICENSE - * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js - * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 - */ - -function supportsHistory() { - var ua = window.navigator.userAgent; - if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; - return window.history && 'pushState' in window.history; +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; } -/** - * Returns true if browser fires popstate on hash change. - * IE10 and IE11 do not. - */ - -function supportsPopStateOnHashChange() { - return window.navigator.userAgent.indexOf('Trident') === -1; +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; } -/** - * Returns false if using go(n) with hash history causes a full page reload. - */ - -function supportsGoWithoutReloadUsingHash() { - return window.navigator.userAgent.indexOf('Firefox') === -1; +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; } -/** - * Returns true if a given popstate event is an extraneous WebKit event. - * Accounts for the fact that Chrome on iOS fires real popstate events - * containing undefined state when pressing the back button. - */ -function isExtraneousPopstateEvent(event) { - return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; +exports.isValidElementType = isValidElementType; +exports.typeOf = typeOf; + })(); } -var PopStateEvent = 'popstate'; -var HashChangeEvent = 'hashchange'; -function getHistoryState() { - try { - return window.history.state || {}; - } catch (e) { - // IE 11 sometimes throws when accessing window.history.state - // See https://github.com/ReactTraining/history/pull/289 - return {}; - } +/***/ }), + +/***/ "./node_modules/hoist-non-react-statics/node_modules/react-is/index.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/hoist-non-react-statics/node_modules/react-is/index.js ***! + \*****************************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +if (false) {} else { + module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js"); } -/** - * Creates a history object that uses the HTML5 history API including - * pushState, replaceState, and the popstate event. - */ -function createBrowserHistory(props) { - if (props === void 0) { - props = {}; - } +/***/ }), - !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Browser history needs a DOM') : undefined : void 0; - var globalHistory = window.history; - var canUseHistory = supportsHistory(); - var needsHashChangeListener = !supportsPopStateOnHashChange(); - var _props = props, - _props$forceRefresh = _props.forceRefresh, - forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, - _props$getUserConfirm = _props.getUserConfirmation, - getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, - _props$keyLength = _props.keyLength, - keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; - var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; +/***/ "./node_modules/mini-create-react-context/dist/esm/index.js": +/*!******************************************************************!*\ + !*** ./node_modules/mini-create-react-context/dist/esm/index.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - function getDOMLocation(historyState) { - var _ref = historyState || {}, - key = _ref.key, - state = _ref.state; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var tiny_warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tiny-warning */ "./node_modules/tiny-warning/dist/tiny-warning.esm.js"); - var _window$location = window.location, - pathname = _window$location.pathname, - search = _window$location.search, - hash = _window$location.hash; - var path = pathname + search + hash; - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : undefined; - if (basename) path = stripBasename(path, basename); - return createLocation(path, state, key); - } - function createKey() { - return Math.random().toString(36).substr(2, keyLength); - } - var transitionManager = createTransitionManager(); - function setState(nextState) { - Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(history, nextState); - history.length = globalHistory.length; - transitionManager.notifyListeners(history.location, history.action); - } +var MAX_SIGNED_31_BIT_INT = 1073741823; +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : {}; - function handlePopState(event) { - // Ignore extraneous popstate events in WebKit. - if (isExtraneousPopstateEvent(event)) return; - handlePop(getDOMLocation(event.state)); - } +function getUniqueId() { + var key = '__global_unique_id__'; + return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1; +} - function handleHashChange() { - handlePop(getDOMLocation(getHistoryState())); +function objectIs(x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; } +} - var forceNextPop = false; - - function handlePop(location) { - if (forceNextPop) { - forceNextPop = false; - setState(); - } else { - var action = 'POP'; - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ - action: action, - location: location - }); - } else { - revertPop(location); - } +function createEventEmitter(value) { + var handlers = []; + return { + on: function on(handler) { + handlers.push(handler); + }, + off: function off(handler) { + handlers = handlers.filter(function (h) { + return h !== handler; + }); + }, + get: function get() { + return value; + }, + set: function set(newValue, changedBits) { + value = newValue; + handlers.forEach(function (handler) { + return handler(value, changedBits); }); } - } + }; +} - function revertPop(fromLocation) { - var toLocation = history.location; // TODO: We could probably make this more reliable by - // keeping a list of keys we've seen in sessionStorage. - // Instead, we just default to 0 for keys we don't know. +function onlyChild(children) { + return Array.isArray(children) ? children[0] : children; +} - var toIndex = allKeys.indexOf(toLocation.key); - if (toIndex === -1) toIndex = 0; - var fromIndex = allKeys.indexOf(fromLocation.key); - if (fromIndex === -1) fromIndex = 0; - var delta = toIndex - fromIndex; +function createReactContext(defaultValue, calculateChangedBits) { + var _Provider$childContex, _Consumer$contextType; - if (delta) { - forceNextPop = true; - go(delta); + var contextProp = '__create-react-context-' + getUniqueId() + '__'; + + var Provider = /*#__PURE__*/function (_Component) { + (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(Provider, _Component); + + function Provider() { + var _this; + + _this = _Component.apply(this, arguments) || this; + _this.emitter = createEventEmitter(_this.props.value); + return _this; } - } - var initialLocation = getDOMLocation(getHistoryState()); - var allKeys = [initialLocation.key]; // Public interface + var _proto = Provider.prototype; - function createHref(location) { - return basename + createPath(location); - } + _proto.getChildContext = function getChildContext() { + var _ref; - function push(path, state) { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined; - var action = 'PUSH'; - var location = createLocation(path, state, createKey(), history.location); - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - var href = createHref(location); - var key = location.key, - state = location.state; + return _ref = {}, _ref[contextProp] = this.emitter, _ref; + }; - if (canUseHistory) { - globalHistory.pushState({ - key: key, - state: state - }, null, href); + _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (this.props.value !== nextProps.value) { + var oldValue = this.props.value; + var newValue = nextProps.value; + var changedBits; - if (forceRefresh) { - window.location.href = href; + if (objectIs(oldValue, newValue)) { + changedBits = 0; } else { - var prevIndex = allKeys.indexOf(history.location.key); - var nextKeys = allKeys.slice(0, prevIndex + 1); - nextKeys.push(location.key); - allKeys = nextKeys; - setState({ - action: action, - location: location - }); - } - } else { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined; - window.location.href = href; - } - }); - } + changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; - function replace(path, state) { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined; - var action = 'REPLACE'; - var location = createLocation(path, state, createKey(), history.location); - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - var href = createHref(location); - var key = location.key, - state = location.state; + if (true) { + (0,tiny_warning__WEBPACK_IMPORTED_MODULE_2__["default"])((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits); + } - if (canUseHistory) { - globalHistory.replaceState({ - key: key, - state: state - }, null, href); + changedBits |= 0; - if (forceRefresh) { - window.location.replace(href); - } else { - var prevIndex = allKeys.indexOf(history.location.key); - if (prevIndex !== -1) allKeys[prevIndex] = location.key; - setState({ - action: action, - location: location - }); + if (changedBits !== 0) { + this.emitter.set(nextProps.value, changedBits); + } } - } else { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined; - window.location.replace(href); } - }); - } + }; - function go(n) { - globalHistory.go(n); - } + _proto.render = function render() { + return this.props.children; + }; - function goBack() { - go(-1); - } + return Provider; + }(react__WEBPACK_IMPORTED_MODULE_0__.Component); - function goForward() { - go(1); - } + Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object.isRequired), _Provider$childContex); - var listenerCount = 0; + var Consumer = /*#__PURE__*/function (_Component2) { + (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(Consumer, _Component2); - function checkDOMListeners(delta) { - listenerCount += delta; + function Consumer() { + var _this2; - if (listenerCount === 1 && delta === 1) { - window.addEventListener(PopStateEvent, handlePopState); - if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange); - } else if (listenerCount === 0) { - window.removeEventListener(PopStateEvent, handlePopState); - if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange); - } - } + _this2 = _Component2.apply(this, arguments) || this; + _this2.state = { + value: _this2.getValue() + }; - var isBlocked = false; + _this2.onUpdate = function (newValue, changedBits) { + var observedBits = _this2.observedBits | 0; - function block(prompt) { - if (prompt === void 0) { - prompt = false; + if ((observedBits & changedBits) !== 0) { + _this2.setState({ + value: _this2.getValue() + }); + } + }; + + return _this2; } - var unblock = transitionManager.setPrompt(prompt); + var _proto2 = Consumer.prototype; - if (!isBlocked) { - checkDOMListeners(1); - isBlocked = true; - } + _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var observedBits = nextProps.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; + }; - return function () { - if (isBlocked) { - isBlocked = false; - checkDOMListeners(-1); + _proto2.componentDidMount = function componentDidMount() { + if (this.context[contextProp]) { + this.context[contextProp].on(this.onUpdate); } - return unblock(); + var observedBits = this.props.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; }; - } - function listen(listener) { - var unlisten = transitionManager.appendListener(listener); - checkDOMListeners(1); - return function () { - checkDOMListeners(-1); - unlisten(); + _proto2.componentWillUnmount = function componentWillUnmount() { + if (this.context[contextProp]) { + this.context[contextProp].off(this.onUpdate); + } }; - } - var history = { - length: globalHistory.length, - action: 'POP', - location: initialLocation, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - block: block, - listen: listen + _proto2.getValue = function getValue() { + if (this.context[contextProp]) { + return this.context[contextProp].get(); + } else { + return defaultValue; + } + }; + + _proto2.render = function render() { + return onlyChild(this.props.children)(this.state.value); + }; + + return Consumer; + }(react__WEBPACK_IMPORTED_MODULE_0__.Component); + + Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object), _Consumer$contextType); + return { + Provider: Provider, + Consumer: Consumer }; - return history; } -var HashChangeEvent$1 = 'hashchange'; -var HashPathCoders = { - hashbang: { - encodePath: function encodePath(path) { - return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path); - }, - decodePath: function decodePath(path) { - return path.charAt(0) === '!' ? path.substr(1) : path; - } - }, - noslash: { - encodePath: stripLeadingSlash, - decodePath: addLeadingSlash - }, - slash: { - encodePath: addLeadingSlash, - decodePath: addLeadingSlash - } -}; +var index = react__WEBPACK_IMPORTED_MODULE_0__.createContext || createReactContext; -function stripHash(url) { - var hashIndex = url.indexOf('#'); - return hashIndex === -1 ? url : url.slice(0, hashIndex); -} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (index); -function getHashPath() { - // We can't use window.location.hash here because it's not - // consistent across browsers - Firefox will pre-decode it! - var href = window.location.href; - var hashIndex = href.indexOf('#'); - return hashIndex === -1 ? '' : href.substring(hashIndex + 1); -} -function pushHashPath(path) { - window.location.hash = path; -} +/***/ }), -function replaceHashPath(path) { - window.location.replace(stripHash(window.location.href) + '#' + path); -} +/***/ "./node_modules/object-assign/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object-assign/index.js ***! + \*********************************************/ +/***/ ((module) => { -function createHashHistory(props) { - if (props === void 0) { - props = {}; - } +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ - !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Hash history needs a DOM') : undefined : void 0; - var globalHistory = window.history; - var canGoWithoutReload = supportsGoWithoutReloadUsingHash(); - var _props = props, - _props$getUserConfirm = _props.getUserConfirmation, - getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, - _props$hashType = _props.hashType, - hashType = _props$hashType === void 0 ? 'slash' : _props$hashType; - var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; - var _HashPathCoders$hashT = HashPathCoders[hashType], - encodePath = _HashPathCoders$hashT.encodePath, - decodePath = _HashPathCoders$hashT.decodePath; - function getDOMLocation() { - var path = decodePath(getHashPath()); - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : undefined; - if (basename) path = stripBasename(path, basename); - return createLocation(path); - } +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; - var transitionManager = createTransitionManager(); +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } - function setState(nextState) { - Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(history, nextState); + return Object(val); +} - history.length = globalHistory.length; - transitionManager.notifyListeners(history.location, history.action); - } +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } - var forceNextPop = false; - var ignorePath = null; + // Detect buggy property enumeration order in older V8 versions. - function locationsAreEqual$$1(a, b) { - return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash; - } + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } - function handleHashChange() { - var path = getHashPath(); - var encodedPath = encodePath(path); + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } - if (path !== encodedPath) { - // Ensure we always have a properly-encoded hash. - replaceHashPath(encodedPath); - } else { - var location = getDOMLocation(); - var prevLocation = history.location; - if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change. + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } - if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace. + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} - ignorePath = null; - handlePop(location); - } - } +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; - function handlePop(location) { - if (forceNextPop) { - forceNextPop = false; - setState(); - } else { - var action = 'POP'; - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ - action: action, - location: location - }); - } else { - revertPop(location); - } - }); - } - } + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); - function revertPop(fromLocation) { - var toLocation = history.location; // TODO: We could probably make this more reliable by - // keeping a list of paths we've seen in sessionStorage. - // Instead, we just default to 0 for paths we don't know. + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } - var toIndex = allPaths.lastIndexOf(createPath(toLocation)); - if (toIndex === -1) toIndex = 0; - var fromIndex = allPaths.lastIndexOf(createPath(fromLocation)); - if (fromIndex === -1) fromIndex = 0; - var delta = toIndex - fromIndex; + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } - if (delta) { - forceNextPop = true; - go(delta); - } - } // Ensure the hash is encoded properly before doing anything else. + return to; +}; - var path = getHashPath(); - var encodedPath = encodePath(path); - if (path !== encodedPath) replaceHashPath(encodedPath); - var initialLocation = getDOMLocation(); - var allPaths = [createPath(initialLocation)]; // Public interface +/***/ }), - function createHref(location) { - var baseTag = document.querySelector('base'); - var href = ''; +/***/ "./node_modules/prop-types/checkPropTypes.js": +/*!***************************************************!*\ + !*** ./node_modules/prop-types/checkPropTypes.js ***! + \***************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - if (baseTag && baseTag.getAttribute('href')) { - href = stripHash(window.location.href); - } +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - return href + '#' + encodePath(basename + createPath(location)); - } - function push(path, state) { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(state === undefined, 'Hash history cannot push state; it is ignored') : undefined; - var action = 'PUSH'; - var location = createLocation(path, undefined, undefined, history.location); - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - var path = createPath(location); - var encodedPath = encodePath(basename + path); - var hashChanged = getHashPath() !== encodedPath; - if (hashChanged) { - // We cannot tell if a hashchange was caused by a PUSH, so we'd - // rather setState here and ignore the hashchange. The caveat here - // is that other hash histories in the page will consider it a POP. - ignorePath = path; - pushHashPath(encodedPath); - var prevIndex = allPaths.lastIndexOf(createPath(history.location)); - var nextPaths = allPaths.slice(0, prevIndex + 1); - nextPaths.push(path); - allPaths = nextPaths; - setState({ - action: action, - location: location - }); - } else { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : undefined; - setState(); - } - }); - } +var printWarning = function() {}; - function replace(path, state) { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(state === undefined, 'Hash history cannot replace state; it is ignored') : undefined; - var action = 'REPLACE'; - var location = createLocation(path, undefined, undefined, history.location); - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - var path = createPath(location); - var encodedPath = encodePath(basename + path); - var hashChanged = getHashPath() !== encodedPath; +if (true) { + var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); + var loggedTypeFailures = {}; + var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js"); - if (hashChanged) { - // We cannot tell if a hashchange was caused by a REPLACE, so we'd - // rather setState here and ignore the hashchange. The caveat here - // is that other hash histories in the page will consider it a POP. - ignorePath = path; - replaceHashPath(encodedPath); - } + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) { /**/ } + }; +} - var prevIndex = allPaths.indexOf(createPath(history.location)); - if (prevIndex !== -1) allPaths[prevIndex] = path; - setState({ - action: action, - location: location - }); - }); - } +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; - function go(n) { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : undefined; - globalHistory.go(n); - } + var stack = getStack ? getStack() : ''; - function goBack() { - go(-1); + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } } +} - function goForward() { - go(1); +/** + * Resets warning cache when testing. + * + * @private + */ +checkPropTypes.resetWarningCache = function() { + if (true) { + loggedTypeFailures = {}; } +} - var listenerCount = 0; +module.exports = checkPropTypes; - function checkDOMListeners(delta) { - listenerCount += delta; - if (listenerCount === 1 && delta === 1) { - window.addEventListener(HashChangeEvent$1, handleHashChange); - } else if (listenerCount === 0) { - window.removeEventListener(HashChangeEvent$1, handleHashChange); - } - } +/***/ }), - var isBlocked = false; +/***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": +/*!************************************************************!*\ + !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! + \************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - function block(prompt) { - if (prompt === void 0) { - prompt = false; - } +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - var unblock = transitionManager.setPrompt(prompt); - if (!isBlocked) { - checkDOMListeners(1); - isBlocked = true; - } - return function () { - if (isBlocked) { - isBlocked = false; - checkDOMListeners(-1); - } +var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/prop-types/node_modules/react-is/index.js"); +var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); - return unblock(); - }; - } +var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); +var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js"); +var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); - function listen(listener) { - var unlisten = transitionManager.appendListener(listener); - checkDOMListeners(1); - return function () { - checkDOMListeners(-1); - unlisten(); - }; - } +var printWarning = function() {}; - var history = { - length: globalHistory.length, - action: 'POP', - location: initialLocation, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - block: block, - listen: listen +if (true) { + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} }; - return history; } -function clamp(n, lowerBound, upperBound) { - return Math.min(Math.max(n, lowerBound), upperBound); +function emptyFunctionThatReturnsNull() { + return null; } -/** - * Creates a history object that stores locations in memory. - */ +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. -function createMemoryHistory(props) { - if (props === void 0) { - props = {}; + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } } - var _props = props, - getUserConfirmation = _props.getUserConfirmation, - _props$initialEntries = _props.initialEntries, - initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, - _props$initialIndex = _props.initialIndex, - initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, - _props$keyLength = _props.keyLength, - keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; - var transitionManager = createTransitionManager(); + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ - function setState(nextState) { - Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(history, nextState); + var ANONYMOUS = '<>'; - history.length = history.entries.length; - transitionManager.notifyListeners(history.location, history.action); - } + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bigint: createPrimitiveTypeChecker('bigint'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), - function createKey() { - return Math.random().toString(36).substr(2, keyLength); - } + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; - var index = clamp(initialIndex, 0, initialEntries.length - 1); - var entries = initialEntries.map(function (entry) { - return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey()); - }); // Public interface + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ - var createHref = createPath; + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message, data) { + this.message = message; + this.data = data && typeof data === 'object' ? data: {}; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; - function push(path, state) { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined; - var action = 'PUSH'; - var location = createLocation(path, state, createKey(), history.location); - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - var prevIndex = history.index; - var nextIndex = prevIndex + 1; - var nextEntries = history.entries.slice(0); + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; - if (nextEntries.length > nextIndex) { - nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if ( true && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; } else { - nextEntries.push(location); + return validate(props, propName, componentName, location, propFullName); } + } - setState({ - action: action, - location: location, - index: nextIndex, - entries: nextEntries - }); - }); - } + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); - function replace(path, state) { - true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined; - var action = 'REPLACE'; - var location = createLocation(path, state, createKey(), history.location); - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - history.entries[history.index] = location; - setState({ - action: action, - location: location - }); - }); + return chainedCheckType; } - function go(n) { - var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); - var action = 'POP'; - var location = history.entries[nextIndex]; - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ - action: action, - location: location, - index: nextIndex - }); - } else { - // Mimic the behavior of DOM histories by - // causing a render after a cancelled POP. - setState(); + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), + {expectedType: expectedType} + ); } - }); + return null; + } + return createChainableTypeChecker(validate); } - function goBack() { - go(-1); + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); } - function goForward() { - go(1); + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); } - function canGo(n) { - var nextIndex = history.index + n; - return nextIndex >= 0 && nextIndex < history.entries.length; + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); } - function block(prompt) { - if (prompt === void 0) { - prompt = false; + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); + } + return null; } - - return transitionManager.setPrompt(prompt); + return createChainableTypeChecker(validate); } - function listen(listener) { - return transitionManager.appendListener(listener); + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); } - var history = { - length: entries.length, - action: 'POP', - location: entries[index], - index: index, - entries: entries, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - canGo: canGo, - block: block, - listen: listen - }; - return history; -} + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + return emptyFunctionThatReturnsNull; + } + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } -/***/ }), + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0; + return emptyFunctionThatReturnsNull; + } -/***/ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js ***! - \**********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } -"use strict"; + function validate(props, propName, componentName, location, propFullName) { + var expectedTypes = []; + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); + if (checkerResult == null) { + return null; + } + if (checkerResult.data && has(checkerResult.data, 'expectedType')) { + expectedTypes.push(checkerResult.data.expectedType); + } + } + var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); + } + return createChainableTypeChecker(validate); + } + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } -var reactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); + function invalidValidatorError(componentName, location, propFullName, key, type) { + return new PropTypeError( + (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' + ); + } -/** - * Copyright 2015, Yahoo! Inc. - * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. - */ -var REACT_STATICS = { - childContextTypes: true, - contextType: true, - contextTypes: true, - defaultProps: true, - displayName: true, - getDefaultProps: true, - getDerivedStateFromError: true, - getDerivedStateFromProps: true, - mixins: true, - propTypes: true, - type: true -}; -var KNOWN_STATICS = { - name: true, - length: true, - prototype: true, - caller: true, - callee: true, - arguments: true, - arity: true -}; -var FORWARD_REF_STATICS = { - '$$typeof': true, - render: true, - defaultProps: true, - displayName: true, - propTypes: true -}; -var MEMO_STATICS = { - '$$typeof': true, - compare: true, - defaultProps: true, - displayName: true, - propTypes: true, - type: true -}; -var TYPE_STATICS = {}; -TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; -TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (typeof checker !== 'function') { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } -function getStatics(component) { - // React v16.11 and below - if (reactIs.isMemo(component)) { - return MEMO_STATICS; - } // React v16.12 and above + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (has(shapeTypes, key) && typeof checker !== 'function') { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } - return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; -} + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } -var defineProperty = Object.defineProperty; -var getOwnPropertyNames = Object.getOwnPropertyNames; -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; -var getPrototypeOf = Object.getPrototypeOf; -var objectPrototype = Object.prototype; -function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { - if (typeof sourceComponent !== 'string') { - // don't hoist over string (html) components - if (objectPrototype) { - var inheritedComponent = getPrototypeOf(sourceComponent); + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } - if (inheritedComponent && inheritedComponent !== objectPrototype) { - hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); - } + return true; + default: + return false; } + } - var keys = getOwnPropertyNames(sourceComponent); + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } - if (getOwnPropertySymbols) { - keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + // falsy value can't be a Symbol + if (!propValue) { + return false; } - var targetStatics = getStatics(targetComponent); - var sourceStatics = getStatics(sourceComponent); + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } - if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { - var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + return false; + } - try { - // Avoid failures from read-only properties - defineProperty(targetComponent, key, descriptor); - } catch (e) {} - } + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; } - return targetComponent; -} - -module.exports = hoistNonReactStatics; + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } -/***/ }), + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } -/***/ "./node_modules/isarray/index.js": -/*!***************************************!*\ - !*** ./node_modules/isarray/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; + return ReactPropTypes; }; /***/ }), -/***/ "./node_modules/mini-create-react-context/dist/esm/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/mini-create-react-context/dist/esm/index.js ***! - \******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); -/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var tiny_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tiny-warning */ "./node_modules/tiny-warning/dist/tiny-warning.esm.js"); +/***/ "./node_modules/prop-types/index.js": +/*!******************************************!*\ + !*** ./node_modules/prop-types/index.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +if (true) { + var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/prop-types/node_modules/react-is/index.js"); + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); +} else {} -var MAX_SIGNED_31_BIT_INT = 1073741823; -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}; +/***/ }), -function getUniqueId() { - var key = '__global_unique_id__'; - return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1; -} +/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": +/*!*************************************************************!*\ + !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! + \*************************************************************/ +/***/ ((module) => { -function objectIs(x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } else { - return x !== x && y !== y; - } -} +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ -function createEventEmitter(value) { - var handlers = []; - return { - on: function on(handler) { - handlers.push(handler); - }, - off: function off(handler) { - handlers = handlers.filter(function (h) { - return h !== handler; - }); - }, - get: function get() { - return value; - }, - set: function set(newValue, changedBits) { - value = newValue; - handlers.forEach(function (handler) { - return handler(value, changedBits); - }); - } - }; -} -function onlyChild(children) { - return Array.isArray(children) ? children[0] : children; -} -function createReactContext(defaultValue, calculateChangedBits) { - var _Provider$childContex, _Consumer$contextType; +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - var contextProp = '__create-react-context-' + getUniqueId() + '__'; +module.exports = ReactPropTypesSecret; - var Provider = /*#__PURE__*/function (_Component) { - Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(Provider, _Component); - function Provider() { - var _this; +/***/ }), - _this = _Component.apply(this, arguments) || this; - _this.emitter = createEventEmitter(_this.props.value); - return _this; - } +/***/ "./node_modules/prop-types/lib/has.js": +/*!********************************************!*\ + !*** ./node_modules/prop-types/lib/has.js ***! + \********************************************/ +/***/ ((module) => { - var _proto = Provider.prototype; +module.exports = Function.call.bind(Object.prototype.hasOwnProperty); - _proto.getChildContext = function getChildContext() { - var _ref; - return _ref = {}, _ref[contextProp] = this.emitter, _ref; - }; +/***/ }), - _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - if (this.props.value !== nextProps.value) { - var oldValue = this.props.value; - var newValue = nextProps.value; - var changedBits; +/***/ "./node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { - if (objectIs(oldValue, newValue)) { - changedBits = 0; - } else { - changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; +"use strict"; +/** @license React v16.13.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - if (true) { - Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__["default"])((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits); - } - changedBits |= 0; - if (changedBits !== 0) { - this.emitter.set(nextProps.value, changedBits); - } - } - } - }; - _proto.render = function render() { - return this.props.children; - }; - return Provider; - }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); +if (true) { + (function() { +'use strict'; - Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object.isRequired, _Provider$childContex); +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary +// (unstable) APIs that have been removed. Can we remove the symbols? - var Consumer = /*#__PURE__*/function (_Component2) { - Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(Consumer, _Component2); +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; +var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; +var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; +var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; +var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; - function Consumer() { - var _this2; +function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); +} - _this2 = _Component2.apply(this, arguments) || this; - _this2.state = { - value: _this2.getValue() - }; +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; - _this2.onUpdate = function (newValue, changedBits) { - var observedBits = _this2.observedBits | 0; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; - if ((observedBits & changedBits) !== 0) { - _this2.setState({ - value: _this2.getValue() - }); - } - }; + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; - return _this2; - } + default: + var $$typeofType = type && type.$$typeof; - var _proto2 = Consumer.prototype; + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; - _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - var observedBits = nextProps.observedBits; - this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; - }; + default: + return $$typeof; + } - _proto2.componentDidMount = function componentDidMount() { - if (this.context[contextProp]) { - this.context[contextProp].on(this.onUpdate); - } + } - var observedBits = this.props.observedBits; - this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; - }; + case REACT_PORTAL_TYPE: + return $$typeof; + } + } - _proto2.componentWillUnmount = function componentWillUnmount() { - if (this.context[contextProp]) { - this.context[contextProp].off(this.onUpdate); - } - }; + return undefined; +} // AsyncMode is deprecated along with isAsyncMode - _proto2.getValue = function getValue() { - if (this.context[contextProp]) { - return this.context[contextProp].get(); - } else { - return defaultValue; - } - }; +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; +var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated - _proto2.render = function render() { - return onlyChild(this.props.children)(this.state.value); - }; +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint - return Consumer; - }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); + console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } - Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object, _Consumer$contextType); - return { - Provider: Provider, - Consumer: Consumer - }; + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; +} +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; +} +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; +} +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; +} +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; +} + +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; +exports.isValidElementType = isValidElementType; +exports.typeOf = typeOf; + })(); } - -var index = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext || createReactContext; - -/* harmony default export */ __webpack_exports__["default"] = (index); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/object-assign/index.js": -/*!*********************************************!*\ - !*** ./node_modules/object-assign/index.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; +/***/ }), -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } +/***/ "./node_modules/prop-types/node_modules/react-is/index.js": +/*!****************************************************************!*\ + !*** ./node_modules/prop-types/node_modules/react-is/index.js ***! + \****************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - return Object(val); +"use strict"; + + +if (false) {} else { + module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"); } -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - // Detect buggy property enumeration order in older V8 versions. +/***/ }), - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } +/***/ "./node_modules/react-dom/cjs/react-dom.development.js": +/*!*************************************************************!*\ + !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } +"use strict"; +/** @license React v16.14.0 + * react-dom.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } +if (true) { + (function() { +'use strict'; - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } +var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); +var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/scheduler/index.js"); +var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); +var tracing = __webpack_require__(/*! scheduler/tracing */ "./node_modules/scheduler/tracing.js"); - return to; -}; +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. +// Current owner and dispatcher used to share the same ref, +// but PR #14548 split them out to better support the react-debug-tools package. +if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { + ReactSharedInternals.ReactCurrentDispatcher = { + current: null + }; +} -/***/ }), +if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { + ReactSharedInternals.ReactCurrentBatchConfig = { + suspense: null + }; +} -/***/ "./node_modules/path-to-regexp/index.js": -/*!**********************************************!*\ - !*** ./node_modules/path-to-regexp/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +// by calls to these methods by a Babel plugin. +// +// In PROD (or in packages without access to React internals), +// they are left as they are instead. -var isarray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js") +function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } -/** - * Expose `pathToRegexp`. - */ -module.exports = pathToRegexp -module.exports.parse = parse -module.exports.compile = compile -module.exports.tokensToFunction = tokensToFunction -module.exports.tokensToRegExp = tokensToRegExp + printWarning('warn', format, args); + } +} +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } -/** - * The main path matching regexp utility. - * - * @type {RegExp} - */ -var PATH_REGEXP = new RegExp([ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - '(\\\\.)', - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' -].join('|'), 'g') + printWarning('error', format, args); + } +} -/** - * Parse a string for the raw tokens. - * - * @param {string} str - * @param {Object=} options - * @return {!Array} - */ -function parse (str, options) { - var tokens = [] - var key = 0 - var index = 0 - var path = '' - var defaultDelimiter = options && options.delimiter || '/' - var res +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; - while ((res = PATH_REGEXP.exec(str)) != null) { - var m = res[0] - var escaped = res[1] - var offset = res.index - path += str.slice(index, offset) - index = offset + m.length + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); - // Ignore already escaped sequences. - if (escaped) { - path += escaped[1] - continue + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } } - var next = str[index] - var prefix = res[2] - var name = res[3] - var capture = res[4] - var group = res[5] - var modifier = res[6] - var asterisk = res[7] + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix - // Push the current path onto the tokens. - if (path) { - tokens.push(path) - path = '' - } + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging - var partial = prefix != null && next != null && next !== prefix - var repeat = modifier === '+' || modifier === '*' - var optional = modifier === '?' || modifier === '*' - var delimiter = res[2] || defaultDelimiter - var pattern = capture || group + Function.prototype.apply.call(console[level], console, argsWithFormat); - tokens.push({ - name: name || key++, - prefix: prefix || '', - delimiter: delimiter, - optional: optional, - repeat: repeat, - partial: partial, - asterisk: !!asterisk, - pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') - }) + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} } +} - // Match any characters still remaining. - if (index < str.length) { - path += str.substr(index) +if (!React) { + { + throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." ); } +} - // If the path exists, push it onto the end. - if (path) { - tokens.push(path) +var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) { + var funcArgs = Array.prototype.slice.call(arguments, 3); + + try { + func.apply(context, funcArgs); + } catch (error) { + this.onError(error); } +}; - return tokens -} +{ + // In DEV mode, we swap out invokeGuardedCallback for a special version + // that plays more nicely with the browser's DevTools. The idea is to preserve + // "Pause on exceptions" behavior. Because React wraps all user-provided + // functions in invokeGuardedCallback, and the production version of + // invokeGuardedCallback uses a try-catch, all user exceptions are treated + // like caught exceptions, and the DevTools won't pause unless the developer + // takes the extra step of enabling pause on caught exceptions. This is + // unintuitive, though, because even though React has caught the error, from + // the developer's perspective, the error is uncaught. + // + // To preserve the expected "Pause on exceptions" behavior, we don't use a + // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake + // DOM node, and call the user-provided callback from inside an event handler + // for that fake event. If the callback throws, the error is "captured" using + // a global event handler. But because the error happens in a different + // event loop context, it does not interrupt the normal program flow. + // Effectively, this gives us try-catch behavior without actually using + // try-catch. Neat! + // Check that the browser supports the APIs we need to implement our special + // DEV version of invokeGuardedCallback + if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { + var fakeNode = document.createElement('react'); -/** - * Compile a string to a template function for the path. - * - * @param {string} str - * @param {Object=} options - * @return {!function(Object=, Object=)} - */ -function compile (str, options) { - return tokensToFunction(parse(str, options), options) -} + var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) { + // If document doesn't exist we know for sure we will crash in this method + // when we call document.createEvent(). However this can cause confusing + // errors: https://github.com/facebookincubator/create-react-app/issues/3482 + // So we preemptively throw with a better message instead. + if (!(typeof document !== 'undefined')) { + { + throw Error( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." ); + } + } -/** - * Prettier encoding of URI path segments. - * - * @param {string} - * @return {string} - */ -function encodeURIComponentPretty (str) { - return encodeURI(str).replace(/[\/?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} + var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We + // set this to true at the beginning, then set it to false right after + // calling the function. If the function errors, `didError` will never be + // set to false. This strategy works even if the browser is flaky and + // fails to call our global error handler, because it doesn't rely on + // the error event at all. -/** - * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. - * - * @param {string} - * @return {string} - */ -function encodeAsterisk (str) { - return encodeURI(str).replace(/[?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} + var didError = true; // Keeps track of the value of window.event so that we can reset it + // during the callback to let user code access window.event in the + // browsers that support it. -/** - * Expose a method for transforming tokens into the path function. - */ -function tokensToFunction (tokens, options) { - // Compile all the tokens into regexps. - var matches = new Array(tokens.length) + var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event + // dispatching: https://github.com/facebook/react/issues/13688 - // Compile all the patterns before compilation. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] === 'object') { - matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options)) - } - } + var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously + // dispatch our fake event using `dispatchEvent`. Inside the handler, we + // call the user-provided callback. - return function (obj, opts) { - var path = '' - var data = obj || {} - var options = opts || {} - var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent + var funcArgs = Array.prototype.slice.call(arguments, 3); - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] + function callCallback() { + // We immediately remove the callback from event listeners so that + // nested `invokeGuardedCallback` calls do not clash. Otherwise, a + // nested call would trigger the fake event handlers of any call higher + // in the stack. + fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the + // window.event assignment in both IE <= 10 as they throw an error + // "Member not found" in strict mode, and in Firefox which does not + // support window.event. - if (typeof token === 'string') { - path += token + if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { + window.event = windowEvent; + } - continue - } + func.apply(context, funcArgs); + didError = false; + } // Create a global error event handler. We use this to capture the value + // that was thrown. It's possible that this error handler will fire more + // than once; for example, if non-React code also calls `dispatchEvent` + // and a handler for that event throws. We should be resilient to most of + // those cases. Even if our error event handler fires more than once, the + // last error event is always used. If the callback actually does error, + // we know that the last error event is the correct one, because it's not + // possible for anything else to have happened in between our callback + // erroring and the code that follows the `dispatchEvent` call below. If + // the callback doesn't error, but the error event was fired, we know to + // ignore it because `didError` will be false, as described above. - var value = data[token.name] - var segment - if (value == null) { - if (token.optional) { - // Prepend partial segment prefixes. - if (token.partial) { - path += token.prefix - } + var error; // Use this to track whether the error event is ever called. - continue - } else { - throw new TypeError('Expected "' + token.name + '" to be defined') - } - } + var didSetError = false; + var isCrossOriginError = false; - if (isarray(value)) { - if (!token.repeat) { - throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') - } + function handleWindowError(event) { + error = event.error; + didSetError = true; - if (value.length === 0) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to not be empty') - } + if (error === null && event.colno === 0 && event.lineno === 0) { + isCrossOriginError = true; } - for (var j = 0; j < value.length; j++) { - segment = encode(value[j]) - - if (!matches[i].test(segment)) { - throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') + if (event.defaultPrevented) { + // Some other error handler has prevented default. + // Browsers silence the error report if this happens. + // We'll remember this to later decide whether to log it or not. + if (error != null && typeof error === 'object') { + try { + error._suppressLogging = true; + } catch (inner) {// Ignore. + } } - - path += (j === 0 ? token.prefix : token.delimiter) + segment } + } // Create a fake event type. - continue - } - segment = token.asterisk ? encodeAsterisk(value) : encode(value) + var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers - if (!matches[i].test(segment)) { - throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') + window.addEventListener('error', handleWindowError); + fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function + // errors, it will trigger our global error handler. + + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + + if (windowEventDescriptor) { + Object.defineProperty(window, 'event', windowEventDescriptor); } - path += token.prefix + segment - } + if (didError) { + if (!didSetError) { + // The callback errored, but the error event never fired. + error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); + } else if (isCrossOriginError) { + error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.'); + } - return path + this.onError(error); + } // Remove our event listeners + + + window.removeEventListener('error', handleWindowError); + }; + + invokeGuardedCallbackImpl = invokeGuardedCallbackDev; } } -/** - * Escape a regular expression string. - * - * @param {string} str - * @return {string} - */ -function escapeString (str) { - return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') -} +var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; + +var hasError = false; +var caughtError = null; // Used by event system to capture/rethrow the first error. +var hasRethrowError = false; +var rethrowError = null; +var reporter = { + onError: function (error) { + hasError = true; + caughtError = error; + } +}; /** - * Escape the capturing group by escaping special characters and meaning. + * Call a function while guarding against errors that happens within it. + * Returns an error if it throws, otherwise null. * - * @param {string} group - * @return {string} + * In production, this is implemented using a try-catch. The reason we don't + * use a try-catch directly is so that we can swap out a different + * implementation in DEV mode. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function */ -function escapeGroup (group) { - return group.replace(/([=!:$\/()])/g, '\\$1') -} +function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { + hasError = false; + caughtError = null; + invokeGuardedCallbackImpl$1.apply(reporter, arguments); +} /** - * Attach the keys as a property of the regexp. + * Same as invokeGuardedCallback, but instead of returning an error, it stores + * it in a global so it can be rethrown by `rethrowCaughtError` later. + * TODO: See if caughtError and rethrowError can be unified. * - * @param {!RegExp} re - * @param {Array} keys - * @return {!RegExp} + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function */ -function attachKeys (re, keys) { - re.keys = keys - return re -} +function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback.apply(this, arguments); + + if (hasError) { + var error = clearCaughtError(); + + if (!hasRethrowError) { + hasRethrowError = true; + rethrowError = error; + } + } +} /** - * Get the flags for a regexp from the options. - * - * @param {Object} options - * @return {string} + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. */ -function flags (options) { - return options && options.sensitive ? '' : 'i' + +function rethrowCaughtError() { + if (hasRethrowError) { + var error = rethrowError; + hasRethrowError = false; + rethrowError = null; + throw error; + } +} +function hasCaughtError() { + return hasError; +} +function clearCaughtError() { + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + return error; + } else { + { + { + throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." ); + } + } + } } -/** - * Pull out keys from a regexp. - * - * @param {!RegExp} path - * @param {!Array} keys - * @return {!RegExp} - */ -function regexpToRegexp (path, keys) { - // Use a negative lookahead to match only capturing groups. - var groups = path.source.match(/\((?!\?)/g) +var getFiberCurrentPropsFromNode = null; +var getInstanceFromNode = null; +var getNodeFromInstance = null; +function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { + getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; + getInstanceFromNode = getInstanceFromNodeImpl; + getNodeFromInstance = getNodeFromInstanceImpl; - if (groups) { - for (var i = 0; i < groups.length; i++) { - keys.push({ - name: i, - prefix: null, - delimiter: null, - optional: false, - repeat: false, - partial: false, - asterisk: false, - pattern: null - }) + { + if (!getNodeFromInstance || !getInstanceFromNode) { + error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); } } +} +var validateEventDispatches; - return attachKeys(path, keys) +{ + validateEventDispatches = function (event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + var listenersIsArr = Array.isArray(dispatchListeners); + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + var instancesIsArr = Array.isArray(dispatchInstances); + var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + + if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { + error('EventPluginUtils: Invalid `event`.'); + } + }; } +/** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {function} listener Application-level callback + * @param {*} inst Internal component instance + */ + +function executeDispatch(event, listener, inst) { + var type = event.type || 'unknown-event'; + event.currentTarget = getNodeFromInstance(inst); + invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + event.currentTarget = null; +} /** - * Transform an array into a regexp. - * - * @param {!Array} path - * @param {Array} keys - * @param {!Object} options - * @return {!RegExp} + * Standard/simple iteration through an event's collected dispatches. */ -function arrayToRegexp (path, keys, options) { - var parts = [] - for (var i = 0; i < path.length; i++) { - parts.push(pathToRegexp(path[i], keys, options).source) +function executeDispatchesInOrder(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + + { + validateEventDispatches(event); } - var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } // Listeners and Instances are two parallel arrays that are always in sync. - return attachKeys(regexp, keys) + + executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, dispatchListeners, dispatchInstances); + } + + event._dispatchListeners = null; + event._dispatchInstances = null; } +var FunctionComponent = 0; +var ClassComponent = 1; +var IndeterminateComponent = 2; // Before we know whether it is function or class + +var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + +var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + +var HostComponent = 5; +var HostText = 6; +var Fragment = 7; +var Mode = 8; +var ContextConsumer = 9; +var ContextProvider = 10; +var ForwardRef = 11; +var Profiler = 12; +var SuspenseComponent = 13; +var MemoComponent = 14; +var SimpleMemoComponent = 15; +var LazyComponent = 16; +var IncompleteClassComponent = 17; +var DehydratedFragment = 18; +var SuspenseListComponent = 19; +var FundamentalComponent = 20; +var ScopeComponent = 21; +var Block = 22; + /** - * Create a path regexp from string input. - * - * @param {string} path - * @param {!Array} keys - * @param {!Object} options - * @return {!RegExp} + * Injectable ordering of event plugins. + */ +var eventPluginOrder = null; +/** + * Injectable mapping from names to event plugin modules. */ -function stringToRegexp (path, keys, options) { - return tokensToRegExp(parse(path, options), keys, options) -} +var namesToPlugins = {}; /** - * Expose a function for taking tokens and returning a RegExp. + * Recomputes the plugin list using the injected plugins and plugin ordering. * - * @param {!Array} tokens - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} + * @private */ -function tokensToRegExp (tokens, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } - - options = options || {} - var strict = options.strict - var end = options.end !== false - var route = '' +function recomputePluginOrdering() { + if (!eventPluginOrder) { + // Wait until an `eventPluginOrder` is injected. + return; + } - // Iterate over the tokens and create our regexp string. - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] + for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); - if (typeof token === 'string') { - route += escapeString(token) - } else { - var prefix = escapeString(token.prefix) - var capture = '(?:' + token.pattern + ')' + if (!(pluginIndex > -1)) { + { + throw Error( "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`." ); + } + } - keys.push(token) + if (plugins[pluginIndex]) { + continue; + } - if (token.repeat) { - capture += '(?:' + prefix + capture + ')*' + if (!pluginModule.extractEvents) { + { + throw Error( "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not." ); } + } - if (token.optional) { - if (!token.partial) { - capture = '(?:' + prefix + '(' + capture + '))?' - } else { - capture = prefix + '(' + capture + ')?' + plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + + for (var eventName in publishedEvents) { + if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { + { + throw Error( "EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`." ); } - } else { - capture = prefix + '(' + capture + ')' } - - route += capture } } +} +/** + * Publishes an event so that it can be dispatched by the supplied plugin. + * + * @param {object} dispatchConfig Dispatch configuration for the event. + * @param {object} PluginModule Plugin publishing the event. + * @return {boolean} True if the event was successfully published. + * @private + */ - var delimiter = escapeString(options.delimiter || '/') - var endsWithDelimiter = route.slice(-delimiter.length) === delimiter - // In non-strict mode we allow a slash at the end of match. If the path to - // match already ends with a slash, we remove it for consistency. The slash - // is valid at the end of a path match, not in the middle. This is important - // in non-ending mode, where "/test/" shouldn't match "/test//route". - if (!strict) { - route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' +function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { + { + throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName + "`." ); + } } - if (end) { - route += '$' - } else { - // In non-ending mode, we need the capturing groups to match as much as - // possible by using a positive lookahead to the end or next path segment. - route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' + eventNameDispatchConfigs[eventName] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + } + + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; } - return attachKeys(new RegExp('^' + route, flags(options)), keys) + return false; } - /** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * Publishes a registration name that is used to identify dispatched events. * - * @param {(string|RegExp|Array)} path - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private */ -function pathToRegexp (path, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } - options = options || {} - if (path instanceof RegExp) { - return regexpToRegexp(path, /** @type {!Array} */ (keys)) +function publishRegistrationName(registrationName, pluginModule, eventName) { + if (!!registrationNameModules[registrationName]) { + { + throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`." ); + } } - if (isarray(path)) { - return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) - } + registrationNameModules[registrationName] = pluginModule; + registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; - return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) + { + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + + if (registrationName === 'onDoubleClick') { + possibleRegistrationNames.ondblclick = registrationName; + } + } } +/** + * Registers plugins so that they can extract and dispatch events. + */ +/** + * Ordered list of injected plugins. + */ -/***/ }), -/***/ "./node_modules/prop-types/checkPropTypes.js": -/*!***************************************************!*\ - !*** ./node_modules/prop-types/checkPropTypes.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +var plugins = []; +/** + * Mapping from event name to dispatch config + */ -"use strict"; +var eventNameDispatchConfigs = {}; /** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. + * Mapping from registration name to plugin module */ +var registrationNameModules = {}; +/** + * Mapping from registration name to event name + */ +var registrationNameDependencies = {}; +/** + * Mapping from lowercase registration names to the properly cased version, + * used to warn in the case of missing event handlers. Available + * only in true. + * @type {Object} + */ -var printWarning = function() {}; +var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true -if (true) { - var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); - var loggedTypeFailures = {}; - var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js"); +/** + * Injects an ordering of plugins (by plugin name). This allows the ordering + * to be decoupled from injection of the actual plugins so that ordering is + * always deterministic regardless of packaging, on-the-fly injection, etc. + * + * @param {array} InjectedEventPluginOrder + * @internal + */ - printWarning = function(text) { - var message = 'Warning: ' + text; - if (typeof console !== 'undefined') { - console.error(message); +function injectEventPluginOrder(injectedEventPluginOrder) { + if (!!eventPluginOrder) { + { + throw Error( "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." ); } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) { /**/ } - }; -} + } // Clone the ordering so it cannot be dynamically mutated. + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); +} /** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. + * Injects plugins to be used by plugin event system. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + * @internal */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (true) { - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - if (typeof typeSpecs[typeSpecName] !== 'function') { - var err = Error( - (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + - 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + - 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' - ); - err.name = 'Invariant Violation'; - throw err; - } - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - if (error && !(error instanceof Error)) { - printWarning( - (componentName || 'React class') + ': type specification of ' + - location + ' `' + typeSpecName + '` is invalid; the type checker ' + - 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + - 'You may have forgotten to pass an argument to the type checker ' + - 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + - 'shape all require an argument).' - ); - } - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - var stack = getStack ? getStack() : ''; +function injectEventPluginsByName(injectedNamesToPlugins) { + var isOrderingDirty = false; - printWarning( - 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') - ); + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + + var pluginModule = injectedNamesToPlugins[pluginName]; + + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + if (!!namesToPlugins[pluginName]) { + { + throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`." ); } } + + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; } } -} -/** - * Resets warning cache when testing. - * - * @private - */ -checkPropTypes.resetWarningCache = function() { - if (true) { - loggedTypeFailures = {}; + if (isOrderingDirty) { + recomputePluginOrdering(); } } -module.exports = checkPropTypes; - +var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); -/***/ }), +var PLUGIN_EVENT_SYSTEM = 1; +var IS_REPLAYED = 1 << 5; +var IS_FIRST_ANCESTOR = 1 << 6; -/***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": -/*!************************************************************!*\ - !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +var restoreImpl = null; +var restoreTarget = null; +var restoreQueue = null; -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ +function restoreStateOfTarget(target) { + // We perform this translation at the end of the event loop so that we + // always receive the correct fiber here + var internalInstance = getInstanceFromNode(target); + if (!internalInstance) { + // Unmounted + return; + } + if (!(typeof restoreImpl === 'function')) { + { + throw Error( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." ); + } + } -var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); -var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); + var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted. -var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); -var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js"); -var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); + if (stateNode) { + var _props = getFiberCurrentPropsFromNode(stateNode); -var printWarning = function() {}; + restoreImpl(internalInstance.stateNode, internalInstance.type, _props); + } +} -if (true) { - printWarning = function(text) { - var message = 'Warning: ' + text; - if (typeof console !== 'undefined') { - console.error(message); +function setRestoreImplementation(impl) { + restoreImpl = impl; +} +function enqueueStateRestore(target) { + if (restoreTarget) { + if (restoreQueue) { + restoreQueue.push(target); + } else { + restoreQueue = [target]; } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; + } else { + restoreTarget = target; + } } - -function emptyFunctionThatReturnsNull() { - return null; +function needsStateRestore() { + return restoreTarget !== null || restoreQueue !== null; } +function restoreStateIfNeeded() { + if (!restoreTarget) { + return; + } -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + var target = restoreTarget; + var queuedTargets = restoreQueue; + restoreTarget = null; + restoreQueue = null; + restoreStateOfTarget(target); - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; + if (queuedTargets) { + for (var i = 0; i < queuedTargets.length; i++) { + restoreStateOfTarget(queuedTargets[i]); } } +} - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ +var enableProfilerTimer = true; // Trace which interactions trigger each commit. - var ANONYMOUS = '<>'; +var enableDeprecatedFlareAPI = false; // Experimental Host Component support. - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bigint: createPrimitiveTypeChecker('bigint'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), +var enableFundamentalAPI = false; // Experimental Scope support. +var warnAboutStringRefs = false; - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - elementType: createElementTypeTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker, - exact: createStrictShapeTypeChecker, - }; +// the renderer. Such as when we're dispatching events or if third party +// libraries need to call batchedUpdates. Eventually, this API will go away when +// everything is batched by default. We'll then have a similar API to opt-out of +// scheduled work and instead do synchronous work. +// Defaults - /** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ - /*eslint-disable no-self-compare*/ - function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } - } - /*eslint-enable no-self-compare*/ +var batchedUpdatesImpl = function (fn, bookkeeping) { + return fn(bookkeeping); +}; - /** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However, we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ - function PropTypeError(message, data) { - this.message = message; - this.data = data && typeof data === 'object' ? data: {}; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; +var discreteUpdatesImpl = function (fn, a, b, c, d) { + return fn(a, b, c, d); +}; - function createChainableTypeChecker(validate) { - if (true) { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; +var flushDiscreteUpdatesImpl = function () {}; - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - // New behavior only for users of `prop-types` package - var err = new Error( - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use `PropTypes.checkPropTypes()` to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - err.name = 'Invariant Violation'; - throw err; - } else if ( true && typeof console !== 'undefined') { - // Old behavior for people using React.PropTypes - var cacheKey = componentName + ':' + propName; - if ( - !manualPropTypeCallCache[cacheKey] && - // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3 - ) { - printWarning( - 'You are manually calling a React.PropTypes validation ' + - 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + - 'and will throw in the standalone `prop-types` package. ' + - 'You may be seeing this warning due to a third-party PropTypes ' + - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props[propName] == null) { - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } +var batchedEventUpdatesImpl = batchedUpdatesImpl; +var isInsideEventHandler = false; +var isBatchingEventUpdates = false; - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); +function finishEventHandler() { + // Here we wait until all updates have propagated, which is important + // when using controlled components within layers: + // https://github.com/facebook/react/issues/1698 + // Then we restore state of any controlled component. + var controlledComponentsHavePendingUpdates = needsStateRestore(); - return chainedCheckType; + if (controlledComponentsHavePendingUpdates) { + // If a controlled event was fired, we may need to restore the state of + // the DOM node back to the controlled value. This is necessary when React + // bails out of the update without touching the DOM. + flushDiscreteUpdatesImpl(); + restoreStateIfNeeded(); } +} - function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError( - 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), - {expectedType: expectedType} - ); - } - return null; - } - return createChainableTypeChecker(validate); +function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(bookkeeping); } - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunctionThatReturnsNull); - } + isInsideEventHandler = true; - function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + finishEventHandler(); } - - function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); +} +function batchedEventUpdates(fn, a, b) { + if (isBatchingEventUpdates) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(a, b); } - function createElementTypeTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!ReactIs.isValidElementType(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); - } - return null; - } - return createChainableTypeChecker(validate); - } + isBatchingEventUpdates = true; - function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); + try { + return batchedEventUpdatesImpl(fn, a, b); + } finally { + isBatchingEventUpdates = false; + finishEventHandler(); } +} // This is for the React Flare event system +function discreteUpdates(fn, a, b, c, d) { + var prevIsInsideEventHandler = isInsideEventHandler; + isInsideEventHandler = true; - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - if (true) { - if (arguments.length > 1) { - printWarning( - 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + - 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' - ); - } else { - printWarning('Invalid argument supplied to oneOf, expected an array.'); - } - } - return emptyFunctionThatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } + try { + return discreteUpdatesImpl(fn, a, b, c, d); + } finally { + isInsideEventHandler = prevIsInsideEventHandler; - var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { - var type = getPreciseType(value); - if (type === 'symbol') { - return String(value); - } - return value; - }); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + if (!isInsideEventHandler) { + finishEventHandler(); } - return createChainableTypeChecker(validate); } +} +function flushDiscreteUpdatesIfNeeded(timeStamp) { + // event.timeStamp isn't overly reliable due to inconsistencies in + // how different browsers have historically provided the time stamp. + // Some browsers provide high-resolution time stamps for all events, + // some provide low-resolution time stamps for all events. FF < 52 + // even mixes both time stamps together. Some browsers even report + // negative time stamps or time stamps that are 0 (iOS9) in some cases. + // Given we are only comparing two time stamps with equality (!==), + // we are safe from the resolution differences. If the time stamp is 0 + // we bail-out of preventing the flush, which can affect semantics, + // such as if an earlier flush removes or adds event listeners that + // are fired in the subsequent flush. However, this is the same + // behaviour as we had before this change, so the risks are low. + if (!isInsideEventHandler && (!enableDeprecatedFlareAPI )) { + flushDiscreteUpdatesImpl(); + } +} +function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) { + batchedUpdatesImpl = _batchedUpdatesImpl; + discreteUpdatesImpl = _discreteUpdatesImpl; + flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl; + batchedEventUpdatesImpl = _batchedEventUpdatesImpl; +} - function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (has(propValue, key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); - } +var DiscreteEvent = 0; +var UserBlockingEvent = 1; +var ContinuousEvent = 2; - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined; - return emptyFunctionThatReturnsNull; - } +// A reserved attribute. +// It is handled by React separately and shouldn't be written to the DOM. +var RESERVED = 0; // A simple string attribute. +// Attributes that aren't in the whitelist are presumed to have this type. - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== 'function') { - printWarning( - 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + - 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' - ); - return emptyFunctionThatReturnsNull; - } - } +var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called +// "enumerated" attributes with "true" and "false" as possible values. +// When true, it should be set to a "true" string. +// When false, it should be set to a "false" string. - function validate(props, propName, componentName, location, propFullName) { - var expectedTypes = []; - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); - if (checkerResult == null) { - return null; - } - if (checkerResult.data && has(checkerResult.data, 'expectedType')) { - expectedTypes.push(checkerResult.data.expectedType); - } - } - var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); - } - return createChainableTypeChecker(validate); - } +var BOOLEANISH_STRING = 2; // A real boolean attribute. +// When true, it should be present (set either to an empty string or its name). +// When false, it should be omitted. - function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); +var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. +// When true, it should be present (set either to an empty string or its name). +// When false, it should be omitted. +// For any other value, should be present with that value. + +var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. +// When falsy, it should be removed. + +var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. +// When falsy, it should be removed. + +var POSITIVE_NUMERIC = 6; + +/* eslint-disable max-len */ +var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; +/* eslint-enable max-len */ + +var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; +var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; +var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); +var hasOwnProperty = Object.prototype.hasOwnProperty; +var illegalAttributeNameCache = {}; +var validatedAttributeNameCache = {}; +function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { + return true; } - function invalidValidatorError(componentName, location, propFullName, key, type) { - return new PropTypeError( - (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + - 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' - ); + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { + return false; } - function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (typeof checker !== 'function') { - return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; } - function createStrictShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - // We need to check all keys in case some are required but missing from props. - var allKeys = assign({}, props[propName], shapeTypes); - for (var key in allKeys) { - var checker = shapeTypes[key]; - if (has(shapeTypes, key) && typeof checker !== 'function') { - return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); - } - if (!checker) { - return new PropTypeError( - 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + - '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + - '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') - ); - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } + illegalAttributeNameCache[attributeName] = true; - return createChainableTypeChecker(validate); + { + error('Invalid attribute name: `%s`', attributeName); } - function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || isValidElement(propValue)) { - return true; - } + return false; +} +function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null) { + return propertyInfo.type === RESERVED; + } - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } + if (isCustomComponentTag) { + return false; + } - return true; - default: - return false; - } + if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { + return true; } - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } + return false; +} +function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null && propertyInfo.type === RESERVED) { + return false; + } - // falsy value can't be a Symbol - if (!propValue) { - return false; - } + switch (typeof value) { + case 'function': // $FlowIssue symbol is perfectly valid here - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { + case 'symbol': + // eslint-disable-line return true; - } - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } + case 'boolean': + { + if (isCustomComponentTag) { + return false; + } - return false; - } + if (propertyInfo !== null) { + return !propertyInfo.acceptsBooleans; + } else { + var prefix = name.toLowerCase().slice(0, 5); + return prefix !== 'data-' && prefix !== 'aria-'; + } + } - // Equivalent of `typeof` but with special handling for array and regexp. - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; + default: + return false; } - - // This handles more types than `getPropType`. Only used for error messages. - // See `createPrimitiveTypeChecker`. - function getPreciseType(propValue) { - if (typeof propValue === 'undefined' || propValue === null) { - return '' + propValue; - } - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; +} +function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { + if (value === null || typeof value === 'undefined') { + return true; } - // Returns a string that is postfixed to a warning about an invalid type. - // For example, "undefined" or "of type array" - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case 'array': - case 'object': - return 'an ' + type; - case 'boolean': - case 'date': - case 'regexp': - return 'a ' + type; - default: - return type; - } + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { + return true; } - // Returns class name of the object, if any. - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; + if (isCustomComponentTag) { + return false; } - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; - ReactPropTypes.PropTypes = ReactPropTypes; + if (propertyInfo !== null) { + switch (propertyInfo.type) { + case BOOLEAN: + return !value; - return ReactPropTypes; -}; + case OVERLOADED_BOOLEAN: + return value === false; + case NUMERIC: + return isNaN(value); -/***/ }), + case POSITIVE_NUMERIC: + return isNaN(value) || value < 1; + } + } -/***/ "./node_modules/prop-types/index.js": -/*!******************************************!*\ - !*** ./node_modules/prop-types/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + return false; +} +function getPropertyInfo(name) { + return properties.hasOwnProperty(name) ? properties[name] : null; +} -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ +function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) { + this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + this.attributeName = attributeName; + this.attributeNamespace = attributeNamespace; + this.mustUseProperty = mustUseProperty; + this.propertyName = name; + this.type = type; + this.sanitizeURL = sanitizeURL; +} // When adding attributes to this list, be sure to also add them to +// the `possibleStandardNames` module to ensure casing and incorrect +// name warnings. -if (true) { - var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); -} else {} +var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. +var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular +// elements (not just inputs). Now that ReactDOMInput assigns to the +// defaultValue property -- do we need this? +'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']; -/***/ }), +reservedProps.forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // A few React string attributes have a different name. +// This is a mapping from React prop names to the attribute names. -/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": -/*!*************************************************************!*\ - !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { + var name = _ref[0], + attributeName = _ref[1]; + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, // attributeName + null, // attributeNamespace + false); +}); // These are "enumerated" HTML attributes that accept "true" and "false". +// In React, we let users pass `true` and `false` even though technically +// these aren't boolean attributes (they are coerced to strings). -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ +['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); +}); // These are "enumerated" SVG attributes that accept "true" and "false". +// In React, we let users pass `true` and `false` even though technically +// these aren't boolean attributes (they are coerced to strings). +// Since these are SVG attributes, their attribute names are case-sensitive. +['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // These are HTML boolean attributes. +['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM +// on the client side because the browsers are inconsistent. Instead we call focus(). +'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata +'itemScope'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); +}); // These are the few React props that we set as DOM properties +// rather than attributes. These are all booleans. -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; +['checked', // Note: `option.selected` is not updated if `select.multiple` is +// disabled with `removeAttribute`. We have special logic for handling this. +'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // These are HTML attributes that are "overloaded booleans": they behave like +// booleans, but can also accept a string value. -module.exports = ReactPropTypesSecret; +['capture', 'download' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // These are HTML attributes that must be positive numbers. +['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // These are HTML attributes that must be numbers. -/***/ }), +['rowSpan', 'start'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); +}); +var CAMELIZE = /[\-\:]([a-z])/g; -/***/ "./node_modules/prop-types/lib/has.js": -/*!********************************************!*\ - !*** ./node_modules/prop-types/lib/has.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +var capitalize = function (token) { + return token[1].toUpperCase(); +}; // This is a list of all SVG attributes that need special casing, namespacing, +// or boolean value assignment. Regular attributes that just accept strings +// and have the same names are omitted, just like in the HTML whitelist. +// Some of these attributes can be hard to find. This list was created by +// scraping the MDN documentation. -module.exports = Function.call.bind(Object.prototype.hasOwnProperty); +['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, null, // attributeNamespace + false); +}); // String SVG attributes with the xlink namespace. -/***/ }), +['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/1999/xlink', false); +}); // String SVG attributes with the xml namespace. -/***/ "./node_modules/react-dom/cjs/react-dom.development.js": -/*!*************************************************************!*\ - !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/XML/1998/namespace', false); +}); // These attribute exists both in HTML and SVG. +// The attribute name is case-sensitive in SVG so we can't just use +// the React name like we do for attributes that exist only in HTML. -"use strict"; -/** @license React v16.14.0 - * react-dom.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ +['tabIndex', 'crossOrigin'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + false); +}); // These attributes accept URLs. These must not allow javascript: URLS. +// These will also need to accept Trusted Types object in the future. +var xlinkHref = 'xlinkHref'; +properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty +'xlink:href', 'http://www.w3.org/1999/xlink', true); +['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + true); +}); +var ReactDebugCurrentFrame = null; +{ + ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; +} // A javascript: URL can contain leading C0 control or \u0020 SPACE, +// and any newline or tab are filtered out as if they're not part of the URL. +// https://url.spec.whatwg.org/#url-parsing +// Tab or newline are defined as \r\n\t: +// https://infra.spec.whatwg.org/#ascii-tab-or-newline +// A C0 control is a code point in the range \u0000 NULL to \u001F +// INFORMATION SEPARATOR ONE, inclusive: +// https://infra.spec.whatwg.org/#c0-control-or-space +/* eslint-disable max-len */ -if (true) { - (function() { -'use strict'; -var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); -var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/scheduler/index.js"); -var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); -var tracing = __webpack_require__(/*! scheduler/tracing */ "./node_modules/scheduler/tracing.js"); +var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; +var didWarn = false; -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. -// Current owner and dispatcher used to share the same ref, -// but PR #14548 split them out to better support the react-debug-tools package. +function sanitizeURL(url) { + { + if (!didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; -if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { - ReactSharedInternals.ReactCurrentDispatcher = { - current: null - }; + error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); + } + } } -if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { - ReactSharedInternals.ReactCurrentBatchConfig = { - suspense: null - }; -} +/** + * Get the value for a property on a node. Only used in DEV for SSR validation. + * The "expected" argument is used as a hint of what the expected value is. + * Some properties have multiple equivalent values. + */ +function getValueForProperty(node, name, expected, propertyInfo) { + { + if (propertyInfo.mustUseProperty) { + var propertyName = propertyInfo.propertyName; + return node[propertyName]; + } else { + if ( propertyInfo.sanitizeURL) { + // If we haven't fully disabled javascript: URLs, and if + // the hydration is successful of a javascript: URL, we + // still want to warn on the client. + sanitizeURL('' + expected); + } -// by calls to these methods by a Babel plugin. -// -// In PROD (or in packages without access to React internals), -// they are left as they are instead. + var attributeName = propertyInfo.attributeName; + var stringValue = null; -function warn(format) { - { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } + if (propertyInfo.type === OVERLOADED_BOOLEAN) { + if (node.hasAttribute(attributeName)) { + var value = node.getAttribute(attributeName); - printWarning('warn', format, args); + if (value === '') { + return true; + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return value; + } + + if (value === '' + expected) { + return expected; + } + + return value; + } + } else if (node.hasAttribute(attributeName)) { + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + // We had an attribute but shouldn't have had one, so read it + // for the error message. + return node.getAttribute(attributeName); + } + + if (propertyInfo.type === BOOLEAN) { + // If this was a boolean, it doesn't matter what the value is + // the fact that we have it is the same as the expected. + return expected; + } // Even if this property uses a namespace we use getAttribute + // because we assume its namespaced name is the same as our config. + // To use getAttributeNS we need the local name which we don't have + // in our config atm. + + + stringValue = node.getAttribute(attributeName); + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return stringValue === null ? expected : stringValue; + } else if (stringValue === '' + expected) { + return expected; + } else { + return stringValue; + } + } } } -function error(format) { +/** + * Get the value for a attribute on a node. Only used in DEV for SSR validation. + * The third argument is used as a hint of what the expected value is. Some + * attributes have multiple equivalent values. + */ + +function getValueForAttribute(node, name, expected) { { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; + if (!isAttributeNameSafe(name)) { + return; } - printWarning('error', format, args); + if (!node.hasAttribute(name)) { + return expected === undefined ? undefined : null; + } + + var value = node.getAttribute(name); + + if (value === '' + expected) { + return expected; + } + + return value; } } +/** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; +function setValueForProperty(node, name, value, isCustomComponentTag) { + var propertyInfo = getPropertyInfo(name); - if (!hasExistingStack) { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); + if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { + return; + } - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); + if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { + value = null; + } // If the prop isn't in the special list, treat it as a simple attribute. + + + if (isCustomComponentTag || propertyInfo === null) { + if (isAttributeNameSafe(name)) { + var _attributeName = name; + + if (value === null) { + node.removeAttribute(_attributeName); + } else { + node.setAttribute(_attributeName, '' + value); } } - var argsWithFormat = args.map(function (item) { - return '' + item; - }); // Careful: RN currently depends on this prefix + return; + } - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging + var mustUseProperty = propertyInfo.mustUseProperty; - Function.prototype.apply.call(console[level], console, argsWithFormat); + if (mustUseProperty) { + var propertyName = propertyInfo.propertyName; - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - throw new Error(message); - } catch (x) {} - } -} + if (value === null) { + var type = propertyInfo.type; + node[propertyName] = type === BOOLEAN ? false : ''; + } else { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propertyName] = value; + } -if (!React) { - { - throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." ); - } -} + return; + } // The rest are treated as attributes with special cases. -var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) { - var funcArgs = Array.prototype.slice.call(arguments, 3); - try { - func.apply(context, funcArgs); - } catch (error) { - this.onError(error); - } -}; + var attributeName = propertyInfo.attributeName, + attributeNamespace = propertyInfo.attributeNamespace; -{ - // In DEV mode, we swap out invokeGuardedCallback for a special version - // that plays more nicely with the browser's DevTools. The idea is to preserve - // "Pause on exceptions" behavior. Because React wraps all user-provided - // functions in invokeGuardedCallback, and the production version of - // invokeGuardedCallback uses a try-catch, all user exceptions are treated - // like caught exceptions, and the DevTools won't pause unless the developer - // takes the extra step of enabling pause on caught exceptions. This is - // unintuitive, though, because even though React has caught the error, from - // the developer's perspective, the error is uncaught. - // - // To preserve the expected "Pause on exceptions" behavior, we don't use a - // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake - // DOM node, and call the user-provided callback from inside an event handler - // for that fake event. If the callback throws, the error is "captured" using - // a global event handler. But because the error happens in a different - // event loop context, it does not interrupt the normal program flow. - // Effectively, this gives us try-catch behavior without actually using - // try-catch. Neat! - // Check that the browser supports the APIs we need to implement our special - // DEV version of invokeGuardedCallback - if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { - var fakeNode = document.createElement('react'); + if (value === null) { + node.removeAttribute(attributeName); + } else { + var _type = propertyInfo.type; + var attributeValue; - var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) { - // If document doesn't exist we know for sure we will crash in this method - // when we call document.createEvent(). However this can cause confusing - // errors: https://github.com/facebookincubator/create-react-app/issues/3482 - // So we preemptively throw with a better message instead. - if (!(typeof document !== 'undefined')) { - { - throw Error( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." ); - } + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + // If attribute type is boolean, we know for sure it won't be an execution sink + // and we won't require Trusted Type here. + attributeValue = ''; + } else { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + { + attributeValue = '' + value; } - var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We - // set this to true at the beginning, then set it to false right after - // calling the function. If the function errors, `didError` will never be - // set to false. This strategy works even if the browser is flaky and - // fails to call our global error handler, because it doesn't rely on - // the error event at all. + if (propertyInfo.sanitizeURL) { + sanitizeURL(attributeValue.toString()); + } + } - var didError = true; // Keeps track of the value of window.event so that we can reset it - // during the callback to let user code access window.event in the - // browsers that support it. + if (attributeNamespace) { + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } else { + node.setAttribute(attributeName, attributeValue); + } + } +} - var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event - // dispatching: https://github.com/facebook/react/issues/13688 +var BEFORE_SLASH_RE = /^(.*)[\\\/]/; +function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; - var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously - // dispatch our fake event using `dispatchEvent`. Inside the handler, we - // call the user-provided callback. + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); - var funcArgs = Array.prototype.slice.call(arguments, 3); + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); - function callCallback() { - // We immediately remove the callback from event listeners so that - // nested `invokeGuardedCallback` calls do not clash. Otherwise, a - // nested call would trigger the fake event handlers of any call higher - // in the stack. - fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the - // window.event assignment in both IE <= 10 as they throw an error - // "Member not found" in strict mode, and in Firefox which does not - // support window.event. + if (match) { + var pathBeforeSlash = match[1]; - if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { - window.event = windowEvent; + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } } + } + } - func.apply(context, funcArgs); - didError = false; - } // Create a global error event handler. We use this to capture the value - // that was thrown. It's possible that this error handler will fire more - // than once; for example, if non-React code also calls `dispatchEvent` - // and a handler for that event throws. We should be resilient to most of - // those cases. Even if our error event handler fires more than once, the - // last error event is always used. If the callback actually does error, - // we know that the last error event is the correct one, because it's not - // possible for anything else to have happened in between our callback - // erroring and the code that follows the `dispatchEvent` call below. If - // the callback doesn't error, but the error event was fired, we know to - // ignore it because `didError` will be false, as described above. + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + return '\n in ' + (name || 'Unknown') + sourceInfo; +} - var error; // Use this to track whether the error event is ever called. +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; +var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } - var didSetError = false; - var isCrossOriginError = false; + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - function handleWindowError(event) { - error = event.error; - didSetError = true; + if (typeof maybeIterator === 'function') { + return maybeIterator; + } - if (error === null && event.colno === 0 && event.lineno === 0) { - isCrossOriginError = true; - } + return null; +} - if (event.defaultPrevented) { - // Some other error handler has prevented default. - // Browsers silence the error report if this happens. - // We'll remember this to later decide whether to log it or not. - if (error != null && typeof error === 'object') { - try { - error._suppressLogging = true; - } catch (inner) {// Ignore. - } +var Uninitialized = -1; +var Pending = 0; +var Resolved = 1; +var Rejected = 2; +function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; +} +function initializeLazyComponentType(lazyComponent) { + if (lazyComponent._status === Uninitialized) { + lazyComponent._status = Pending; + var ctor = lazyComponent._ctor; + var thenable = ctor(); + lazyComponent._result = thenable; + thenable.then(function (moduleObject) { + if (lazyComponent._status === Pending) { + var defaultExport = moduleObject.default; + + { + if (defaultExport === undefined) { + error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); } } - } // Create a fake event type. + lazyComponent._status = Resolved; + lazyComponent._result = defaultExport; + } + }, function (error) { + if (lazyComponent._status === Pending) { + lazyComponent._status = Rejected; + lazyComponent._result = error; + } + }); + } +} - var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} - window.addEventListener('error', handleWindowError); - fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function - // errors, it will trigger our global error handler. +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } - evt.initEvent(evtType, false, false); - fakeNode.dispatchEvent(evt); + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } - if (windowEventDescriptor) { - Object.defineProperty(window, 'event', windowEventDescriptor); - } + if (typeof type === 'function') { + return type.displayName || type.name || null; + } - if (didError) { - if (!didSetError) { - // The callback errored, but the error event never fired. - error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); - } else if (isCrossOriginError) { - error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.'); - } + if (typeof type === 'string') { + return type; + } - this.onError(error); - } // Remove our event listeners + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + case REACT_PORTAL_TYPE: + return 'Portal'; - window.removeEventListener('error', handleWindowError); - }; + case REACT_PROFILER_TYPE: + return "Profiler"; - invokeGuardedCallbackImpl = invokeGuardedCallbackDev; - } -} + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; -var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; + case REACT_SUSPENSE_TYPE: + return 'Suspense'; -var hasError = false; -var caughtError = null; // Used by event system to capture/rethrow the first error. + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } -var hasRethrowError = false; -var rethrowError = null; -var reporter = { - onError: function (error) { - hasError = true; - caughtError = error; - } -}; -/** - * Call a function while guarding against errors that happens within it. - * Returns an error if it throws, otherwise null. - * - * In production, this is implemented using a try-catch. The reason we don't - * use a try-catch directly is so that we can swap out a different - * implementation in DEV mode. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; -function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { - hasError = false; - caughtError = null; - invokeGuardedCallbackImpl$1.apply(reporter, arguments); -} -/** - * Same as invokeGuardedCallback, but instead of returning an error, it stores - * it in a global so it can be rethrown by `rethrowCaughtError` later. - * TODO: See if caughtError and rethrowError can be unified. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; -function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { - invokeGuardedCallback.apply(this, arguments); + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); - if (hasError) { - var error = clearCaughtError(); + case REACT_MEMO_TYPE: + return getComponentName(type.type); - if (!hasRethrowError) { - hasRethrowError = true; - rethrowError = error; + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } } } -} -/** - * During execution of guarded functions we will capture the first error which - * we will rethrow to be handled by the top level error handler. - */ -function rethrowCaughtError() { - if (hasRethrowError) { - var error = rethrowError; - hasRethrowError = false; - rethrowError = null; - throw error; - } -} -function hasCaughtError() { - return hasError; + return null; } -function clearCaughtError() { - if (hasError) { - var error = caughtError; - hasError = false; - caughtError = null; - return error; - } else { - { - { - throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." ); + +var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + +function describeFiber(fiber) { + switch (fiber.tag) { + case HostRoot: + case HostPortal: + case HostText: + case Fragment: + case ContextProvider: + case ContextConsumer: + return ''; + + default: + var owner = fiber._debugOwner; + var source = fiber._debugSource; + var name = getComponentName(fiber.type); + var ownerName = null; + + if (owner) { + ownerName = getComponentName(owner.type); } - } + + return describeComponentFrame(name, source, ownerName); } } -var getFiberCurrentPropsFromNode = null; -var getInstanceFromNode = null; -var getNodeFromInstance = null; -function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { - getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; - getInstanceFromNode = getInstanceFromNodeImpl; - getNodeFromInstance = getNodeFromInstanceImpl; +function getStackByFiberInDevAndProd(workInProgress) { + var info = ''; + var node = workInProgress; + + do { + info += describeFiber(node); + node = node.return; + } while (node); + return info; +} +var current = null; +var isRendering = false; +function getCurrentFiberOwnerNameInDevOrNull() { { - if (!getNodeFromInstance || !getInstanceFromNode) { - error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); + if (current === null) { + return null; } - } -} -var validateEventDispatches; -{ - validateEventDispatches = function (event) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - var listenersIsArr = Array.isArray(dispatchListeners); - var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; - var instancesIsArr = Array.isArray(dispatchInstances); - var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + var owner = current._debugOwner; - if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { - error('EventPluginUtils: Invalid `event`.'); + if (owner !== null && typeof owner !== 'undefined') { + return getComponentName(owner.type); } - }; + } + + return null; } -/** - * Dispatch the event to the listener. - * @param {SyntheticEvent} event SyntheticEvent to handle - * @param {function} listener Application-level callback - * @param {*} inst Internal component instance - */ +function getCurrentFiberStackInDev() { + { + if (current === null) { + return ''; + } // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. -function executeDispatch(event, listener, inst) { - var type = event.type || 'unknown-event'; - event.currentTarget = getNodeFromInstance(inst); - invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); - event.currentTarget = null; + return getStackByFiberInDevAndProd(current); + } +} +function resetCurrentFiber() { + { + ReactDebugCurrentFrame$1.getCurrentStack = null; + current = null; + isRendering = false; + } +} +function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + isRendering = false; + } +} +function setIsRendering(rendering) { + { + isRendering = rendering; + } } -/** - * Standard/simple iteration through an event's collected dispatches. - */ -function executeDispatchesInOrder(event) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; +// Flow does not allow string concatenation of most non-string types. To work +// around this limitation, we use an opaque type that can only be obtained by +// passing the value through getToStringValue first. +function toString(value) { + return '' + value; +} +function getToStringValue(value) { + switch (typeof value) { + case 'boolean': + case 'number': + case 'object': + case 'string': + case 'undefined': + return value; - { - validateEventDispatches(event); + default: + // function, symbol are assigned as empty strings + return ''; } +} - if (Array.isArray(dispatchListeners)) { - for (var i = 0; i < dispatchListeners.length; i++) { - if (event.isPropagationStopped()) { - break; - } // Listeners and Instances are two parallel arrays that are always in sync. +var ReactDebugCurrentFrame$2 = null; +var ReactControlledValuePropTypes = { + checkPropTypes: null +}; + +{ + ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; + var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true + }; + var propTypes = { + value: function (props, propName, componentName) { + if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) { + return null; + } + return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + checked: function (props, propName, componentName) { + if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) { + return null; + } - executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); + return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); } - } else if (dispatchListeners) { - executeDispatch(event, dispatchListeners, dispatchInstances); - } + }; + /** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ - event._dispatchListeners = null; - event._dispatchInstances = null; + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { + checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); + }; } -var FunctionComponent = 0; -var ClassComponent = 1; -var IndeterminateComponent = 2; // Before we know whether it is function or class +function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); +} -var HostRoot = 3; // Root of a host tree. Could be nested inside another node. +function getTracker(node) { + return node._valueTracker; +} -var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. +function detachTracker(node) { + node._valueTracker = null; +} -var HostComponent = 5; -var HostText = 6; -var Fragment = 7; -var Mode = 8; -var ContextConsumer = 9; -var ContextProvider = 10; -var ForwardRef = 11; -var Profiler = 12; -var SuspenseComponent = 13; -var MemoComponent = 14; -var SimpleMemoComponent = 15; -var LazyComponent = 16; -var IncompleteClassComponent = 17; -var DehydratedFragment = 18; -var SuspenseListComponent = 19; -var FundamentalComponent = 20; -var ScopeComponent = 21; -var Block = 22; +function getValueFromNode(node) { + var value = ''; -/** - * Injectable ordering of event plugins. - */ -var eventPluginOrder = null; -/** - * Injectable mapping from names to event plugin modules. - */ + if (!node) { + return value; + } -var namesToPlugins = {}; -/** - * Recomputes the plugin list using the injected plugins and plugin ordering. - * - * @private - */ + if (isCheckable(node)) { + value = node.checked ? 'true' : 'false'; + } else { + value = node.value; + } -function recomputePluginOrdering() { - if (!eventPluginOrder) { - // Wait until an `eventPluginOrder` is injected. + return value; +} + +function trackValueOnNode(node) { + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail + // and don't track value will cause over reporting of changes, + // but it's better then a hard failure + // (needed for certain tests that spyOn input values and Safari) + + if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { return; } - for (var pluginName in namesToPlugins) { - var pluginModule = namesToPlugins[pluginName]; - var pluginIndex = eventPluginOrder.indexOf(pluginName); - - if (!(pluginIndex > -1)) { - { - throw Error( "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`." ); - } + var get = descriptor.get, + set = descriptor.set; + Object.defineProperty(node, valueField, { + configurable: true, + get: function () { + return get.call(this); + }, + set: function (value) { + currentValue = '' + value; + set.call(this, value); } + }); // We could've passed this the first time + // but it triggers a bug in IE11 and Edge 14/15. + // Calling defineProperty() again should be equivalent. + // https://github.com/facebook/react/issues/11768 - if (plugins[pluginIndex]) { - continue; + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + var tracker = { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(node); + delete node[valueField]; } + }; + return tracker; +} - if (!pluginModule.extractEvents) { - { - throw Error( "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not." ); - } - } +function track(node) { + if (getTracker(node)) { + return; + } // TODO: Once it's just Fiber we can move this to node._wrapperState - plugins[pluginIndex] = pluginModule; - var publishedEvents = pluginModule.eventTypes; - for (var eventName in publishedEvents) { - if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { - { - throw Error( "EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`." ); - } - } - } - } + node._valueTracker = trackValueOnNode(node); } -/** - * Publishes an event so that it can be dispatched by the supplied plugin. - * - * @param {object} dispatchConfig Dispatch configuration for the event. - * @param {object} PluginModule Plugin publishing the event. - * @return {boolean} True if the event was successfully published. - * @private - */ +function updateValueIfChanged(node) { + if (!node) { + return false; + } + var tracker = getTracker(node); // if there is no tracker at this point it's unlikely + // that trying again will succeed -function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { - { - throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName + "`." ); - } + if (!tracker) { + return true; } - eventNameDispatchConfigs[eventName] = dispatchConfig; - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - - if (phasedRegistrationNames) { - for (var phaseName in phasedRegistrationNames) { - if (phasedRegistrationNames.hasOwnProperty(phaseName)) { - var phasedRegistrationName = phasedRegistrationNames[phaseName]; - publishRegistrationName(phasedRegistrationName, pluginModule, eventName); - } - } + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(node); - return true; - } else if (dispatchConfig.registrationName) { - publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + if (nextValue !== lastValue) { + tracker.setValue(nextValue); return true; } return false; } + +var didWarnValueDefaultValue = false; +var didWarnCheckedDefaultChecked = false; +var didWarnControlledToUncontrolled = false; +var didWarnUncontrolledToControlled = false; + +function isControlled(props) { + var usesChecked = props.type === 'checkbox' || props.type === 'radio'; + return usesChecked ? props.checked != null : props.value != null; +} /** - * Publishes a registration name that is used to identify dispatched events. + * Implements an host component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. * - * @param {string} registrationName Registration name to add. - * @param {object} PluginModule Plugin publishing the event. - * @private + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html */ -function publishRegistrationName(registrationName, pluginModule, eventName) { - if (!!registrationNameModules[registrationName]) { - { - throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`." ); - } - } +function getHostProps(element, props) { + var node = element; + var checked = props.checked; - registrationNameModules[registrationName] = pluginModule; - registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + var hostProps = _assign({}, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: undefined, + checked: checked != null ? checked : node._wrapperState.initialChecked + }); + return hostProps; +} +function initWrapperState(element, props) { { - var lowerCasedName = registrationName.toLowerCase(); - possibleRegistrationNames[lowerCasedName] = registrationName; + ReactControlledValuePropTypes.checkPropTypes('input', props); - if (registrationName === 'onDoubleClick') { - possibleRegistrationNames.ondblclick = registrationName; - } - } -} -/** - * Registers plugins so that they can extract and dispatch events. - */ + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); -/** - * Ordered list of injected plugins. - */ + didWarnCheckedDefaultChecked = true; + } + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); -var plugins = []; -/** - * Mapping from event name to dispatch config - */ + didWarnValueDefaultValue = true; + } + } -var eventNameDispatchConfigs = {}; -/** - * Mapping from registration name to plugin module - */ - -var registrationNameModules = {}; -/** - * Mapping from registration name to event name - */ + var node = element; + var defaultValue = props.defaultValue == null ? '' : props.defaultValue; + node._wrapperState = { + initialChecked: props.checked != null ? props.checked : props.defaultChecked, + initialValue: getToStringValue(props.value != null ? props.value : defaultValue), + controlled: isControlled(props) + }; +} +function updateChecked(element, props) { + var node = element; + var checked = props.checked; -var registrationNameDependencies = {}; -/** - * Mapping from lowercase registration names to the properly cased version, - * used to warn in the case of missing event handlers. Available - * only in true. - * @type {Object} - */ + if (checked != null) { + setValueForProperty(node, 'checked', checked, false); + } +} +function updateWrapper(element, props) { + var node = element; -var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true + { + var controlled = isControlled(props); -/** - * Injects an ordering of plugins (by plugin name). This allows the ordering - * to be decoupled from injection of the actual plugins so that ordering is - * always deterministic regardless of packaging, on-the-fly injection, etc. - * - * @param {array} InjectedEventPluginOrder - * @internal - */ + if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { + error('A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); -function injectEventPluginOrder(injectedEventPluginOrder) { - if (!!eventPluginOrder) { - { - throw Error( "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." ); + didWarnUncontrolledToControlled = true; } - } // Clone the ordering so it cannot be dynamically mutated. - - - eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); - recomputePluginOrdering(); -} -/** - * Injects plugins to be used by plugin event system. The plugin names must be - * in the ordering injected by `injectEventPluginOrder`. - * - * Plugins can be injected as part of page initialization or on-the-fly. - * - * @param {object} injectedNamesToPlugins Map from names to plugin modules. - * @internal - */ -function injectEventPluginsByName(injectedNamesToPlugins) { - var isOrderingDirty = false; + if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { + error('A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); - for (var pluginName in injectedNamesToPlugins) { - if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { - continue; + didWarnControlledToUncontrolled = true; } + } - var pluginModule = injectedNamesToPlugins[pluginName]; + updateChecked(element, props); + var value = getToStringValue(props.value); + var type = props.type; - if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { - if (!!namesToPlugins[pluginName]) { - { - throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`." ); - } + if (value != null) { + if (type === 'number') { + if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value) { + node.value = toString(value); } + } else if (node.value !== toString(value)) { + node.value = toString(value); + } + } else if (type === 'submit' || type === 'reset') { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute('value'); + return; + } - namesToPlugins[pluginName] = pluginModule; - isOrderingDirty = true; + { + // When syncing the value attribute, the value comes from a cascade of + // properties: + // 1. The value React property + // 2. The defaultValue React property + // 3. Otherwise there should be no change + if (props.hasOwnProperty('value')) { + setDefaultValue(node, props.type, value); + } else if (props.hasOwnProperty('defaultValue')) { + setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); } } - if (isOrderingDirty) { - recomputePluginOrdering(); + { + // When syncing the checked attribute, it only changes when it needs + // to be removed, such as transitioning from a checkbox into a text input + if (props.checked == null && props.defaultChecked != null) { + node.defaultChecked = !!props.defaultChecked; + } } } +function postMountWrapper(element, props, isHydrating) { + var node = element; // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. -var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); - -var PLUGIN_EVENT_SYSTEM = 1; -var IS_REPLAYED = 1 << 5; -var IS_FIRST_ANCESTOR = 1 << 6; + if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { + var type = props.type; + var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the + // default value provided by the browser. See: #12872 -var restoreImpl = null; -var restoreTarget = null; -var restoreQueue = null; + if (isButton && (props.value === undefined || props.value === null)) { + return; + } -function restoreStateOfTarget(target) { - // We perform this translation at the end of the event loop so that we - // always receive the correct fiber here - var internalInstance = getInstanceFromNode(target); + var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. - if (!internalInstance) { - // Unmounted - return; - } + if (!isHydrating) { + { + // When syncing the value attribute, the value property should use + // the wrapperState._initialValue property. This uses: + // + // 1. The value React property when present + // 2. The defaultValue React property when present + // 3. An empty string + if (initialValue !== node.value) { + node.value = initialValue; + } + } + } - if (!(typeof restoreImpl === 'function')) { { - throw Error( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." ); + // Otherwise, the value attribute is synchronized to the property, + // so we assign defaultValue to the same thing as the value property + // assignment step above. + node.defaultValue = initialValue; } - } + } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug + // this is needed to work around a chrome bug where setting defaultChecked + // will sometimes influence the value of checked (even after detachment). + // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 + // We need to temporarily unset name to avoid disrupting radio button groups. - var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted. - if (stateNode) { - var _props = getFiberCurrentPropsFromNode(stateNode); + var name = node.name; - restoreImpl(internalInstance.stateNode, internalInstance.type, _props); + if (name !== '') { + node.name = ''; } -} -function setRestoreImplementation(impl) { - restoreImpl = impl; -} -function enqueueStateRestore(target) { - if (restoreTarget) { - if (restoreQueue) { - restoreQueue.push(target); - } else { - restoreQueue = [target]; - } - } else { - restoreTarget = target; + { + // When syncing the checked attribute, both the checked property and + // attribute are assigned at the same time using defaultChecked. This uses: + // + // 1. The checked React property when present + // 2. The defaultChecked React property when present + // 3. Otherwise, false + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !!node._wrapperState.initialChecked; + } + + if (name !== '') { + node.name = name; } } -function needsStateRestore() { - return restoreTarget !== null || restoreQueue !== null; +function restoreControlledState(element, props) { + var node = element; + updateWrapper(node, props); + updateNamedCousins(node, props); } -function restoreStateIfNeeded() { - if (!restoreTarget) { - return; - } - var target = restoreTarget; - var queuedTargets = restoreQueue; - restoreTarget = null; - restoreQueue = null; - restoreStateOfTarget(target); +function updateNamedCousins(rootNode, props) { + var name = props.name; - if (queuedTargets) { - for (var i = 0; i < queuedTargets.length; i++) { - restoreStateOfTarget(queuedTargets[i]); - } - } -} + if (props.type === 'radio' && name != null) { + var queryRoot = rootNode; -var enableProfilerTimer = true; // Trace which interactions trigger each commit. + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form. It might not even be in the + // document. Let's just use the local `querySelectorAll` to ensure we don't + // miss anything. -var enableDeprecatedFlareAPI = false; // Experimental Host Component support. -var enableFundamentalAPI = false; // Experimental Scope support. -var warnAboutStringRefs = false; + var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); -// the renderer. Such as when we're dispatching events or if third party -// libraries need to call batchedUpdates. Eventually, this API will go away when -// everything is batched by default. We'll then have a similar API to opt-out of -// scheduled work and instead do synchronous work. -// Defaults + for (var i = 0; i < group.length; i++) { + var otherNode = group[i]; -var batchedUpdatesImpl = function (fn, bookkeeping) { - return fn(bookkeeping); -}; + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React radio buttons with non-React ones. -var discreteUpdatesImpl = function (fn, a, b, c, d) { - return fn(a, b, c, d); -}; -var flushDiscreteUpdatesImpl = function () {}; + var otherProps = getFiberCurrentPropsFromNode$1(otherNode); -var batchedEventUpdatesImpl = batchedUpdatesImpl; -var isInsideEventHandler = false; -var isBatchingEventUpdates = false; + if (!otherProps) { + { + throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." ); + } + } // We need update the tracked value on the named cousin since the value + // was changed but the input saw no event or value set -function finishEventHandler() { - // Here we wait until all updates have propagated, which is important - // when using controlled components within layers: - // https://github.com/facebook/react/issues/1698 - // Then we restore state of any controlled component. - var controlledComponentsHavePendingUpdates = needsStateRestore(); - if (controlledComponentsHavePendingUpdates) { - // If a controlled event was fired, we may need to restore the state of - // the DOM node back to the controlled value. This is necessary when React - // bails out of the update without touching the DOM. - flushDiscreteUpdatesImpl(); - restoreStateIfNeeded(); - } -} + updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. -function batchedUpdates(fn, bookkeeping) { - if (isInsideEventHandler) { - // If we are currently inside another batch, we need to wait until it - // fully completes before restoring state. - return fn(bookkeeping); + updateWrapper(otherNode, otherProps); + } } +} // In Chrome, assigning defaultValue to certain input types triggers input validation. +// For number inputs, the display value loses trailing decimal points. For email inputs, +// Chrome raises "The specified value is not a valid email address". +// +// Here we check to see if the defaultValue has actually changed, avoiding these problems +// when the user is inputting text +// +// https://github.com/facebook/react/issues/7253 - isInsideEventHandler = true; - try { - return batchedUpdatesImpl(fn, bookkeeping); - } finally { - isInsideEventHandler = false; - finishEventHandler(); +function setDefaultValue(node, type, value) { + if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js + type !== 'number' || node.ownerDocument.activeElement !== node) { + if (value == null) { + node.defaultValue = toString(node._wrapperState.initialValue); + } else if (node.defaultValue !== toString(value)) { + node.defaultValue = toString(value); + } } } -function batchedEventUpdates(fn, a, b) { - if (isBatchingEventUpdates) { - // If we are currently inside another batch, we need to wait until it - // fully completes before restoring state. - return fn(a, b); - } - - isBatchingEventUpdates = true; - try { - return batchedEventUpdatesImpl(fn, a, b); - } finally { - isBatchingEventUpdates = false; - finishEventHandler(); - } -} // This is for the React Flare event system -function discreteUpdates(fn, a, b, c, d) { - var prevIsInsideEventHandler = isInsideEventHandler; - isInsideEventHandler = true; +var didWarnSelectedSetOnOption = false; +var didWarnInvalidChild = false; - try { - return discreteUpdatesImpl(fn, a, b, c, d); - } finally { - isInsideEventHandler = prevIsInsideEventHandler; +function flattenChildren(children) { + var content = ''; // Flatten children. We'll warn if they are invalid + // during validateProps() which runs for hydration too. + // Note that this would throw on non-element objects. + // Elements are stringified (which is normally irrelevant + // but matters for ). - if (!isInsideEventHandler) { - finishEventHandler(); + React.Children.forEach(children, function (child) { + if (child == null) { + return; } - } -} -function flushDiscreteUpdatesIfNeeded(timeStamp) { - // event.timeStamp isn't overly reliable due to inconsistencies in - // how different browsers have historically provided the time stamp. - // Some browsers provide high-resolution time stamps for all events, - // some provide low-resolution time stamps for all events. FF < 52 - // even mixes both time stamps together. Some browsers even report - // negative time stamps or time stamps that are 0 (iOS9) in some cases. - // Given we are only comparing two time stamps with equality (!==), - // we are safe from the resolution differences. If the time stamp is 0 - // we bail-out of preventing the flush, which can affect semantics, - // such as if an earlier flush removes or adds event listeners that - // are fired in the subsequent flush. However, this is the same - // behaviour as we had before this change, so the risks are low. - if (!isInsideEventHandler && (!enableDeprecatedFlareAPI )) { - flushDiscreteUpdatesImpl(); - } -} -function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) { - batchedUpdatesImpl = _batchedUpdatesImpl; - discreteUpdatesImpl = _discreteUpdatesImpl; - flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl; - batchedEventUpdatesImpl = _batchedEventUpdatesImpl; -} -var DiscreteEvent = 0; -var UserBlockingEvent = 1; -var ContinuousEvent = 2; + content += child; // Note: we don't warn about invalid children here. + // Instead, this is done separately below so that + // it happens during the hydration codepath too. + }); + return content; +} +/** + * Implements an