From 73d71f13efc7ca5545d901466a9438eb07826885 Mon Sep 17 00:00:00 2001 From: Chris Trombley Date: Mon, 12 Jul 2021 09:52:50 -0700 Subject: [PATCH] refactor: add SetValueFunc and case fold region values --- healthy-hair/.npmignore | 3 - healthy-hair/README.md | 22 - healthy-hair/launchers/launcher/nr1.json | 7 - healthy-hair/nerdlets/home/index.js | 9 - healthy-hair/nerdlets/home/nr1.json | 6 - healthy-hair/nerdlets/home/styles.scss | 3 - healthy-hair/node_modules/.bin/loose-envify | 1 - .../node_modules/js-tokens/CHANGELOG.md | 151 - healthy-hair/node_modules/js-tokens/LICENSE | 21 - healthy-hair/node_modules/js-tokens/README.md | 240 - healthy-hair/node_modules/js-tokens/index.js | 23 - .../node_modules/js-tokens/package.json | 64 - .../node_modules/loose-envify/LICENSE | 21 - .../node_modules/loose-envify/README.md | 45 - healthy-hair/node_modules/loose-envify/cli.js | 16 - .../node_modules/loose-envify/custom.js | 4 - .../node_modules/loose-envify/index.js | 3 - .../node_modules/loose-envify/loose-envify.js | 36 - .../node_modules/loose-envify/package.json | 70 - .../node_modules/loose-envify/replace.js | 65 - .../node_modules/object-assign/index.js | 90 - .../node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 77 - .../node_modules/object-assign/readme.md | 61 - .../node_modules/prop-types/CHANGELOG.md | 92 - healthy-hair/node_modules/prop-types/LICENSE | 21 - .../node_modules/prop-types/README.md | 296 - .../node_modules/prop-types/checkPropTypes.js | 102 - .../node_modules/prop-types/factory.js | 19 - .../prop-types/factoryWithThrowingShims.js | 64 - .../prop-types/factoryWithTypeCheckers.js | 591 - healthy-hair/node_modules/prop-types/index.js | 19 - .../prop-types/lib/ReactPropTypesSecret.js | 12 - .../node_modules/prop-types/package.json | 88 - .../node_modules/prop-types/prop-types.js | 1337 - .../node_modules/prop-types/prop-types.min.js | 1 - healthy-hair/node_modules/react-dom/LICENSE | 21 - healthy-hair/node_modules/react-dom/README.md | 54 - .../node_modules/react-dom/build-info.json | 8 - .../react-dom-server.browser.development.js | 4043 --- ...react-dom-server.browser.production.min.js | 54 - .../cjs/react-dom-server.node.development.js | 4085 --- .../react-dom-server.node.production.min.js | 55 - .../cjs/react-dom-test-utils.development.js | 1480 - .../react-dom-test-utils.production.min.js | 35 - ...t-dom-unstable-fizz.browser.development.js | 141 - ...om-unstable-fizz.browser.production.min.js | 11 - ...eact-dom-unstable-fizz.node.development.js | 162 - ...t-dom-unstable-fizz.node.production.min.js | 12 - ...nstable-native-dependencies.development.js | 1629 - ...able-native-dependencies.production.min.js | 31 - .../react-dom/cjs/react-dom.development.js | 25012 --------------- .../react-dom/cjs/react-dom.production.min.js | 292 - .../react-dom/cjs/react-dom.profiling.min.js | 299 - healthy-hair/node_modules/react-dom/index.js | 38 - .../node_modules/react-dom/package.json | 83 - .../node_modules/react-dom/profiling.js | 38 - .../node_modules/react-dom/server.browser.js | 7 - healthy-hair/node_modules/react-dom/server.js | 3 - .../node_modules/react-dom/server.node.js | 7 - .../node_modules/react-dom/test-utils.js | 7 - .../react-dom-server.browser.development.js | 4147 --- ...react-dom-server.browser.production.min.js | 45 - .../umd/react-dom-test-utils.development.js | 1499 - .../react-dom-test-utils.production.min.js | 30 - ...t-dom-unstable-fizz.browser.development.js | 141 - ...om-unstable-fizz.browser.production.min.js | 10 - ...nstable-native-dependencies.development.js | 1628 - ...able-native-dependencies.production.min.js | 28 - .../react-dom/umd/react-dom.development.js | 25147 ---------------- .../react-dom/umd/react-dom.production.min.js | 239 - .../react-dom/umd/react-dom.profiling.min.js | 247 - .../react-dom/unstable-fizz.browser.js | 7 - .../node_modules/react-dom/unstable-fizz.js | 3 - .../react-dom/unstable-fizz.node.js | 7 - .../react-dom/unstable-native-dependencies.js | 7 - healthy-hair/node_modules/react-is/LICENSE | 21 - healthy-hair/node_modules/react-is/README.md | 104 - .../node_modules/react-is/build-info.json | 8 - .../react-is/cjs/react-is.development.js | 181 - .../react-is/cjs/react-is.production.min.js | 15 - healthy-hair/node_modules/react-is/index.js | 7 - .../node_modules/react-is/package.json | 52 - .../react-is/umd/react-is.development.js | 181 - .../react-is/umd/react-is.production.min.js | 13 - healthy-hair/node_modules/react/LICENSE | 21 - healthy-hair/node_modules/react/README.md | 13 - .../node_modules/react/build-info.json | 8 - .../cjs/react-jsx-dev-runtime.development.js | 889 - .../react-jsx-dev-runtime.production.min.js | 9 - .../cjs/react-jsx-runtime.development.js | 911 - .../cjs/react-jsx-runtime.production.min.js | 10 - .../react/cjs/react.development.js | 1912 -- .../react/cjs/react.production.min.js | 25 - healthy-hair/node_modules/react/index.js | 7 - .../node_modules/react/jsx-dev-runtime.js | 7 - .../node_modules/react/jsx-runtime.js | 7 - healthy-hair/node_modules/react/package.json | 67 - .../react/umd/react.development.js | 3318 -- .../react/umd/react.production.min.js | 32 - .../react/umd/react.profiling.min.js | 39 - healthy-hair/node_modules/scheduler/LICENSE | 21 - healthy-hair/node_modules/scheduler/README.md | 9 - .../node_modules/scheduler/build-info.json | 8 - .../cjs/scheduler-tracing.development.js | 349 - .../cjs/scheduler-tracing.production.min.js | 10 - .../cjs/scheduler-tracing.profiling.min.js | 17 - .../scheduler-unstable_mock.development.js | 857 - .../scheduler-unstable_mock.production.min.js | 20 - .../scheduler/cjs/scheduler.development.js | 858 - .../scheduler/cjs/scheduler.production.min.js | 21 - healthy-hair/node_modules/scheduler/index.js | 7 - .../node_modules/scheduler/package.json | 64 - .../scheduler/tracing-profiling.js | 7 - .../node_modules/scheduler/tracing.js | 7 - .../umd/scheduler-tracing.development.js | 80 - .../umd/scheduler-tracing.production.min.js | 80 - .../umd/scheduler-tracing.profiling.min.js | 80 - .../scheduler-unstable_mock.development.js | 857 - .../scheduler-unstable_mock.production.min.js | 17 - .../scheduler/umd/scheduler.development.js | 152 - .../scheduler/umd/scheduler.production.min.js | 146 - .../scheduler/umd/scheduler.profiling.min.js | 146 - .../node_modules/scheduler/unstable_mock.js | 7 - healthy-hair/nr1.json | 6 - healthy-hair/package-lock.json | 71 - healthy-hair/package.json | 22 - internal/config/api/api.go | 2 +- internal/config/command/command.go | 2 +- internal/config/config.go | 5 +- internal/config/json_store.go | 30 + internal/config/json_store_test.go | 23 + 132 files changed, 58 insertions(+), 86273 deletions(-) delete mode 100644 healthy-hair/.npmignore delete mode 100644 healthy-hair/README.md delete mode 100644 healthy-hair/launchers/launcher/nr1.json delete mode 100644 healthy-hair/nerdlets/home/index.js delete mode 100644 healthy-hair/nerdlets/home/nr1.json delete mode 100644 healthy-hair/nerdlets/home/styles.scss delete mode 120000 healthy-hair/node_modules/.bin/loose-envify delete mode 100644 healthy-hair/node_modules/js-tokens/CHANGELOG.md delete mode 100644 healthy-hair/node_modules/js-tokens/LICENSE delete mode 100644 healthy-hair/node_modules/js-tokens/README.md delete mode 100644 healthy-hair/node_modules/js-tokens/index.js delete mode 100644 healthy-hair/node_modules/js-tokens/package.json delete mode 100644 healthy-hair/node_modules/loose-envify/LICENSE delete mode 100644 healthy-hair/node_modules/loose-envify/README.md delete mode 100755 healthy-hair/node_modules/loose-envify/cli.js delete mode 100644 healthy-hair/node_modules/loose-envify/custom.js delete mode 100644 healthy-hair/node_modules/loose-envify/index.js delete mode 100644 healthy-hair/node_modules/loose-envify/loose-envify.js delete mode 100644 healthy-hair/node_modules/loose-envify/package.json delete mode 100644 healthy-hair/node_modules/loose-envify/replace.js delete mode 100644 healthy-hair/node_modules/object-assign/index.js delete mode 100644 healthy-hair/node_modules/object-assign/license delete mode 100644 healthy-hair/node_modules/object-assign/package.json delete mode 100644 healthy-hair/node_modules/object-assign/readme.md delete mode 100644 healthy-hair/node_modules/prop-types/CHANGELOG.md delete mode 100644 healthy-hair/node_modules/prop-types/LICENSE delete mode 100644 healthy-hair/node_modules/prop-types/README.md delete mode 100644 healthy-hair/node_modules/prop-types/checkPropTypes.js delete mode 100644 healthy-hair/node_modules/prop-types/factory.js delete mode 100644 healthy-hair/node_modules/prop-types/factoryWithThrowingShims.js delete mode 100644 healthy-hair/node_modules/prop-types/factoryWithTypeCheckers.js delete mode 100644 healthy-hair/node_modules/prop-types/index.js delete mode 100644 healthy-hair/node_modules/prop-types/lib/ReactPropTypesSecret.js delete mode 100644 healthy-hair/node_modules/prop-types/package.json delete mode 100644 healthy-hair/node_modules/prop-types/prop-types.js delete mode 100644 healthy-hair/node_modules/prop-types/prop-types.min.js delete mode 100644 healthy-hair/node_modules/react-dom/LICENSE delete mode 100644 healthy-hair/node_modules/react-dom/README.md delete mode 100644 healthy-hair/node_modules/react-dom/build-info.json delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-server.browser.development.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-server.node.development.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-server.node.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-test-utils.development.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-unstable-fizz.browser.development.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-unstable-fizz.browser.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-unstable-fizz.node.development.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-unstable-fizz.node.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.development.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom.development.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/cjs/react-dom.profiling.min.js delete mode 100644 healthy-hair/node_modules/react-dom/index.js delete mode 100644 healthy-hair/node_modules/react-dom/package.json delete mode 100644 healthy-hair/node_modules/react-dom/profiling.js delete mode 100644 healthy-hair/node_modules/react-dom/server.browser.js delete mode 100644 healthy-hair/node_modules/react-dom/server.js delete mode 100644 healthy-hair/node_modules/react-dom/server.node.js delete mode 100644 healthy-hair/node_modules/react-dom/test-utils.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom-server.browser.development.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom-server.browser.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom-test-utils.development.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom-test-utils.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom-unstable-fizz.browser.development.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom-unstable-fizz.browser.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.development.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom.development.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom.production.min.js delete mode 100644 healthy-hair/node_modules/react-dom/umd/react-dom.profiling.min.js delete mode 100644 healthy-hair/node_modules/react-dom/unstable-fizz.browser.js delete mode 100644 healthy-hair/node_modules/react-dom/unstable-fizz.js delete mode 100644 healthy-hair/node_modules/react-dom/unstable-fizz.node.js delete mode 100644 healthy-hair/node_modules/react-dom/unstable-native-dependencies.js delete mode 100644 healthy-hair/node_modules/react-is/LICENSE delete mode 100644 healthy-hair/node_modules/react-is/README.md delete mode 100644 healthy-hair/node_modules/react-is/build-info.json delete mode 100644 healthy-hair/node_modules/react-is/cjs/react-is.development.js delete mode 100644 healthy-hair/node_modules/react-is/cjs/react-is.production.min.js delete mode 100644 healthy-hair/node_modules/react-is/index.js delete mode 100644 healthy-hair/node_modules/react-is/package.json delete mode 100644 healthy-hair/node_modules/react-is/umd/react-is.development.js delete mode 100644 healthy-hair/node_modules/react-is/umd/react-is.production.min.js delete mode 100644 healthy-hair/node_modules/react/LICENSE delete mode 100644 healthy-hair/node_modules/react/README.md delete mode 100644 healthy-hair/node_modules/react/build-info.json delete mode 100644 healthy-hair/node_modules/react/cjs/react-jsx-dev-runtime.development.js delete mode 100644 healthy-hair/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js delete mode 100644 healthy-hair/node_modules/react/cjs/react-jsx-runtime.development.js delete mode 100644 healthy-hair/node_modules/react/cjs/react-jsx-runtime.production.min.js delete mode 100644 healthy-hair/node_modules/react/cjs/react.development.js delete mode 100644 healthy-hair/node_modules/react/cjs/react.production.min.js delete mode 100644 healthy-hair/node_modules/react/index.js delete mode 100644 healthy-hair/node_modules/react/jsx-dev-runtime.js delete mode 100644 healthy-hair/node_modules/react/jsx-runtime.js delete mode 100644 healthy-hair/node_modules/react/package.json delete mode 100644 healthy-hair/node_modules/react/umd/react.development.js delete mode 100644 healthy-hair/node_modules/react/umd/react.production.min.js delete mode 100644 healthy-hair/node_modules/react/umd/react.profiling.min.js delete mode 100644 healthy-hair/node_modules/scheduler/LICENSE delete mode 100644 healthy-hair/node_modules/scheduler/README.md delete mode 100644 healthy-hair/node_modules/scheduler/build-info.json delete mode 100644 healthy-hair/node_modules/scheduler/cjs/scheduler-tracing.development.js delete mode 100644 healthy-hair/node_modules/scheduler/cjs/scheduler-tracing.production.min.js delete mode 100644 healthy-hair/node_modules/scheduler/cjs/scheduler-tracing.profiling.min.js delete mode 100644 healthy-hair/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js delete mode 100644 healthy-hair/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js delete mode 100644 healthy-hair/node_modules/scheduler/cjs/scheduler.development.js delete mode 100644 healthy-hair/node_modules/scheduler/cjs/scheduler.production.min.js delete mode 100644 healthy-hair/node_modules/scheduler/index.js delete mode 100644 healthy-hair/node_modules/scheduler/package.json delete mode 100644 healthy-hair/node_modules/scheduler/tracing-profiling.js delete mode 100644 healthy-hair/node_modules/scheduler/tracing.js delete mode 100644 healthy-hair/node_modules/scheduler/umd/scheduler-tracing.development.js delete mode 100644 healthy-hair/node_modules/scheduler/umd/scheduler-tracing.production.min.js delete mode 100644 healthy-hair/node_modules/scheduler/umd/scheduler-tracing.profiling.min.js delete mode 100644 healthy-hair/node_modules/scheduler/umd/scheduler-unstable_mock.development.js delete mode 100644 healthy-hair/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js delete mode 100644 healthy-hair/node_modules/scheduler/umd/scheduler.development.js delete mode 100644 healthy-hair/node_modules/scheduler/umd/scheduler.production.min.js delete mode 100644 healthy-hair/node_modules/scheduler/umd/scheduler.profiling.min.js delete mode 100644 healthy-hair/node_modules/scheduler/unstable_mock.js delete mode 100644 healthy-hair/nr1.json delete mode 100644 healthy-hair/package-lock.json delete mode 100644 healthy-hair/package.json diff --git a/healthy-hair/.npmignore b/healthy-hair/.npmignore deleted file mode 100644 index fe91bb4f0..000000000 --- a/healthy-hair/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -tmp -node_modules diff --git a/healthy-hair/README.md b/healthy-hair/README.md deleted file mode 100644 index a67b60274..000000000 --- a/healthy-hair/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# healthy-hair - -## Getting started - -Run the following scripts: - -``` -npm install -npm start -``` - -Visit https://one.newrelic.com/?nerdpacks=local and :sparkles: - -## Creating new artifacts - -If you want to create new artifacts run the following command: - -``` -nr1 create -``` - -> Example: `nr1 create --type nerdlet --name my-nerdlet`. diff --git a/healthy-hair/launchers/launcher/nr1.json b/healthy-hair/launchers/launcher/nr1.json deleted file mode 100644 index 9b32940b2..000000000 --- a/healthy-hair/launchers/launcher/nr1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "schemaType": "LAUNCHER", - "id": "launcher", - "displayName": "Launcher", - "description": "Describe me", - "rootNerdletId": "e5aae2ac-f591-413b-8639-7810baa8cbd8.home" -} diff --git a/healthy-hair/nerdlets/home/index.js b/healthy-hair/nerdlets/home/index.js deleted file mode 100644 index aedf60a72..000000000 --- a/healthy-hair/nerdlets/home/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; - -// https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction - -export default class HomeNerdlet extends React.Component { - render() { - return

Hello, home Nerdlet!

; - } -} diff --git a/healthy-hair/nerdlets/home/nr1.json b/healthy-hair/nerdlets/home/nr1.json deleted file mode 100644 index 5f3f4d03d..000000000 --- a/healthy-hair/nerdlets/home/nr1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "schemaType": "NERDLET", - "id": "home", - "displayName": "Home", - "description": "" -} diff --git a/healthy-hair/nerdlets/home/styles.scss b/healthy-hair/nerdlets/home/styles.scss deleted file mode 100644 index f89b611bf..000000000 --- a/healthy-hair/nerdlets/home/styles.scss +++ /dev/null @@ -1,3 +0,0 @@ -.my-nerdlet { - outline: 1px solid black; -} diff --git a/healthy-hair/node_modules/.bin/loose-envify b/healthy-hair/node_modules/.bin/loose-envify deleted file mode 120000 index ed9009c5a..000000000 --- a/healthy-hair/node_modules/.bin/loose-envify +++ /dev/null @@ -1 +0,0 @@ -../loose-envify/cli.js \ No newline at end of file diff --git a/healthy-hair/node_modules/js-tokens/CHANGELOG.md b/healthy-hair/node_modules/js-tokens/CHANGELOG.md deleted file mode 100644 index 755e6f6ec..000000000 --- a/healthy-hair/node_modules/js-tokens/CHANGELOG.md +++ /dev/null @@ -1,151 +0,0 @@ -### Version 4.0.0 (2018-01-28) ### - -- Added: Support for ES2018. The only change needed was recognizing the `s` - regex flag. -- Changed: _All_ tokens returned by the `matchToToken` function now have a - `closed` property. It is set to `undefined` for the tokens where “closed” - doesn’t make sense. This means that all tokens objects have the same shape, - which might improve performance. - -These are the breaking changes: - -- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but - `['/a/s']`. (There are of course other variations of this.) -- Code that rely on some token objects not having the `closed` property could - now behave differently. - - -### Version 3.0.2 (2017-06-28) ### - -- No code changes. Just updates to the readme. - - -### Version 3.0.1 (2017-01-30) ### - -- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched - correctly. - - -### Version 3.0.0 (2017-01-11) ### - -This release contains one breaking change, that should [improve performance in -V8][v8-perf]: - -> So how can you, as a JavaScript developer, ensure that your RegExps are fast? -> If you are not interested in hooking into RegExp internals, make sure that -> neither the RegExp instance, nor its prototype is modified in order to get the -> best performance: -> -> ```js -> var re = /./g; -> re.exec(''); // Fast path. -> re.new_property = 'slow'; -> ``` - -This module used to export a single regex, with `.matchToToken` bolted -on, just like in the above example. This release changes the exports of -the module to avoid this issue. - -Before: - -```js -import jsTokens from "js-tokens" -// or: -var jsTokens = require("js-tokens") -var matchToToken = jsTokens.matchToToken -``` - -After: - -```js -import jsTokens, {matchToToken} from "js-tokens" -// or: -var jsTokens = require("js-tokens").default -var matchToToken = require("js-tokens").matchToToken -``` - -[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html - - -### Version 2.0.0 (2016-06-19) ### - -- Added: Support for ES2016. In other words, support for the `**` exponentiation - operator. - -These are the breaking changes: - -- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. -- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. - - -### Version 1.0.3 (2016-03-27) ### - -- Improved: Made the regex ever so slightly smaller. -- Updated: The readme. - - -### Version 1.0.2 (2015-10-18) ### - -- Improved: Limited npm package contents for a smaller download. Thanks to - @zertosh! - - -### Version 1.0.1 (2015-06-20) ### - -- Fixed: Declared an undeclared variable. - - -### Version 1.0.0 (2015-02-26) ### - -- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That - type is now equivalent to the Punctuator token in the ECMAScript - specification. (Backwards-incompatible change.) -- Fixed: A `-` followed by a number is now correctly matched as a punctuator - followed by a number. It used to be matched as just a number, but there is no - such thing as negative number literals. (Possibly backwards-incompatible - change.) - - -### Version 0.4.1 (2015-02-21) ### - -- Added: Support for the regex `u` flag. - - -### Version 0.4.0 (2015-02-21) ### - -- Improved: `jsTokens.matchToToken` performance. -- Added: Support for octal and binary number literals. -- Added: Support for template strings. - - -### Version 0.3.1 (2015-01-06) ### - -- Fixed: Support for unicode spaces. They used to be allowed in names (which is - very confusing), and some unicode newlines were wrongly allowed in strings and - regexes. - - -### Version 0.3.0 (2014-12-19) ### - -- Changed: The `jsTokens.names` array has been replaced with the - `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no - longer part of the public API; instead use said function. See this [gist] for - an example. (Backwards-incompatible change.) -- Changed: The empty string is now considered an “invalid” token, instead an - “empty” token (its own group). (Backwards-incompatible change.) -- Removed: component support. (Backwards-incompatible change.) - -[gist]: https://gist.github.com/lydell/be49dbf80c382c473004 - - -### Version 0.2.0 (2014-06-19) ### - -- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own - category (“functionArrow”), for simplicity. (Backwards-incompatible change.) -- Added: ES6 splats (`...`) are now matched as an operator (instead of three - punctuations). (Backwards-incompatible change.) - - -### Version 0.1.0 (2014-03-08) ### - -- Initial release. diff --git a/healthy-hair/node_modules/js-tokens/LICENSE b/healthy-hair/node_modules/js-tokens/LICENSE deleted file mode 100644 index 54aef52f3..000000000 --- a/healthy-hair/node_modules/js-tokens/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/healthy-hair/node_modules/js-tokens/README.md b/healthy-hair/node_modules/js-tokens/README.md deleted file mode 100644 index 00cdf1634..000000000 --- a/healthy-hair/node_modules/js-tokens/README.md +++ /dev/null @@ -1,240 +0,0 @@ -Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) -======== - -A regex that tokenizes JavaScript. - -```js -var jsTokens = require("js-tokens").default - -var jsString = "var foo=opts.foo;\n..." - -jsString.match(jsTokens) -// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] -``` - - -Installation -============ - -`npm install js-tokens` - -```js -import jsTokens from "js-tokens" -// or: -var jsTokens = require("js-tokens").default -``` - - -Usage -===== - -### `jsTokens` ### - -A regex with the `g` flag that matches JavaScript tokens. - -The regex _always_ matches, even invalid JavaScript and the empty string. - -The next match is always directly after the previous. - -### `var token = matchToToken(match)` ### - -```js -import {matchToToken} from "js-tokens" -// or: -var matchToToken = require("js-tokens").matchToToken -``` - -Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: -String, value: String}` object. The following types are available: - -- string -- comment -- regex -- number -- name -- punctuator -- whitespace -- invalid - -Multi-line comments and strings also have a `closed` property indicating if the -token was closed or not (see below). - -Comments and strings both come in several flavors. To distinguish them, check if -the token starts with `//`, `/*`, `'`, `"` or `` ` ``. - -Names are ECMAScript IdentifierNames, that is, including both identifiers and -keywords. You may use [is-keyword-js] to tell them apart. - -Whitespace includes both line terminators and other whitespace. - -[is-keyword-js]: https://github.com/crissdev/is-keyword-js - - -ECMAScript support -================== - -The intention is to always support the latest ECMAScript version whose feature -set has been finalized. - -If adding support for a newer version requires changes, a new version with a -major verion bump will be released. - -Currently, ECMAScript 2018 is supported. - - -Invalid code handling -===================== - -Unterminated strings are still matched as strings. JavaScript strings cannot -contain (unescaped) newlines, so unterminated strings simply end at the end of -the line. Unterminated template strings can contain unescaped newlines, though, -so they go on to the end of input. - -Unterminated multi-line comments are also still matched as comments. They -simply go on to the end of the input. - -Unterminated regex literals are likely matched as division and whatever is -inside the regex. - -Invalid ASCII characters have their own capturing group. - -Invalid non-ASCII characters are treated as names, to simplify the matching of -names (except unicode spaces which are treated as whitespace). Note: See also -the [ES2018](#es2018) section. - -Regex literals may contain invalid regex syntax. They are still matched as -regex literals. They may also contain repeated regex flags, to keep the regex -simple. - -Strings may contain invalid escape sequences. - - -Limitations -=========== - -Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be -perfect. But that’s not the point either. - -You may compare jsTokens with [esprima] by using `esprima-compare.js`. -See `npm run esprima-compare`! - -[esprima]: http://esprima.org/ - -### Template string interpolation ### - -Template strings are matched as single tokens, from the starting `` ` `` to the -ending `` ` ``, including interpolations (whose tokens are not matched -individually). - -Matching template string interpolations requires recursive balancing of `{` and -`}`—something that JavaScript regexes cannot do. Only one level of nesting is -supported. - -### Division and regex literals collision ### - -Consider this example: - -```js -var g = 9.82 -var number = bar / 2/g - -var regex = / 2/g -``` - -A human can easily understand that in the `number` line we’re dealing with -division, and in the `regex` line we’re dealing with a regex literal. How come? -Because humans can look at the whole code to put the `/` characters in context. -A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also -look backwards. See the [ES2018](#es2018) section). - -When the `jsTokens` regex scans throught the above, it will see the following -at the end of both the `number` and `regex` rows: - -```js -/ 2/g -``` - -It is then impossible to know if that is a regex literal, or part of an -expression dealing with division. - -Here is a similar case: - -```js -foo /= 2/g -foo(/= 2/g) -``` - -The first line divides the `foo` variable with `2/g`. The second line calls the -`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only -sees forwards, it cannot tell the two cases apart. - -There are some cases where we _can_ tell division and regex literals apart, -though. - -First off, we have the simple cases where there’s only one slash in the line: - -```js -var foo = 2/g -foo /= 2 -``` - -Regex literals cannot contain newlines, so the above cases are correctly -identified as division. Things are only problematic when there are more than -one non-comment slash in a single line. - -Secondly, not every character is a valid regex flag. - -```js -var number = bar / 2/e -``` - -The above example is also correctly identified as division, because `e` is not a -valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` -(any letter) as flags, but it is not worth it since it increases the amount of -ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are -allowed. This means that the above example will be identified as division as -long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 -characters long. - -Lastly, we can look _forward_ for information. - -- If the token following what looks like a regex literal is not valid after a - regex literal, but is valid in a division expression, then the regex literal - is treated as division instead. For example, a flagless regex cannot be - followed by a string, number or name, but all of those three can be the - denominator of a division. -- Generally, if what looks like a regex literal is followed by an operator, the - regex literal is treated as division instead. This is because regexes are - seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division - could likely be part of such an expression. - -Please consult the regex source and the test cases for precise information on -when regex or division is matched (should you need to know). In short, you -could sum it up as: - -If the end of a statement looks like a regex literal (even if it isn’t), it -will be treated as one. Otherwise it should work as expected (if you write sane -code). - -### ES2018 ### - -ES2018 added some nice regex improvements to the language. - -- [Unicode property escapes] should allow telling names and invalid non-ASCII - characters apart without blowing up the regex size. -- [Lookbehind assertions] should allow matching telling division and regex - literals apart in more cases. -- [Named capture groups] might simplify some things. - -These things would be nice to do, but are not critical. They probably have to -wait until the oldest maintained Node.js LTS release supports those features. - -[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html -[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html -[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html - - -License -======= - -[MIT](LICENSE). diff --git a/healthy-hair/node_modules/js-tokens/index.js b/healthy-hair/node_modules/js-tokens/index.js deleted file mode 100644 index b23a4a0e7..000000000 --- a/healthy-hair/node_modules/js-tokens/index.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell -// License: MIT. (See LICENSE.) - -Object.defineProperty(exports, "__esModule", { - value: true -}) - -// This regex comes from regex.coffee, and is inserted here by generate-index.js -// (run `npm run build`). -exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g - -exports.matchToToken = function(match) { - var token = {type: "invalid", value: match[0], closed: undefined} - if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) - else if (match[ 5]) token.type = "comment" - else if (match[ 6]) token.type = "comment", token.closed = !!match[7] - else if (match[ 8]) token.type = "regex" - else if (match[ 9]) token.type = "number" - else if (match[10]) token.type = "name" - else if (match[11]) token.type = "punctuator" - else if (match[12]) token.type = "whitespace" - return token -} diff --git a/healthy-hair/node_modules/js-tokens/package.json b/healthy-hair/node_modules/js-tokens/package.json deleted file mode 100644 index 01402bd51..000000000 --- a/healthy-hair/node_modules/js-tokens/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "js-tokens@^3.0.0 || ^4.0.0", - "_id": "js-tokens@4.0.0", - "_inBundle": false, - "_integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "_location": "/js-tokens", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "js-tokens@^3.0.0 || ^4.0.0", - "name": "js-tokens", - "escapedName": "js-tokens", - "rawSpec": "^3.0.0 || ^4.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0 || ^4.0.0" - }, - "_requiredBy": [ - "/loose-envify" - ], - "_resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "_shasum": "19203fb59991df98e3a287050d4647cdeaf32499", - "_spec": "js-tokens@^3.0.0 || ^4.0.0", - "_where": "/Users/ctrombley/src/github.com/newrelic-cli/healthy-hair/node_modules/loose-envify", - "author": { - "name": "Simon Lydell" - }, - "bugs": { - "url": "https://github.com/lydell/js-tokens/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A regex that tokenizes JavaScript.", - "devDependencies": { - "coffeescript": "2.1.1", - "esprima": "4.0.0", - "everything.js": "1.0.3", - "mocha": "5.0.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/lydell/js-tokens#readme", - "keywords": [ - "JavaScript", - "js", - "token", - "tokenize", - "regex" - ], - "license": "MIT", - "name": "js-tokens", - "repository": { - "type": "git", - "url": "git+https://github.com/lydell/js-tokens.git" - }, - "scripts": { - "build": "node generate-index.js", - "dev": "npm run build && npm test", - "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", - "test": "mocha --ui tdd" - }, - "version": "4.0.0" -} diff --git a/healthy-hair/node_modules/loose-envify/LICENSE b/healthy-hair/node_modules/loose-envify/LICENSE deleted file mode 100644 index fbafb4875..000000000 --- a/healthy-hair/node_modules/loose-envify/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Andres Suarez - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/healthy-hair/node_modules/loose-envify/README.md b/healthy-hair/node_modules/loose-envify/README.md deleted file mode 100644 index 7f4e07b00..000000000 --- a/healthy-hair/node_modules/loose-envify/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# loose-envify - -[![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify) - -Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster. - -## Gotchas - -* Doesn't handle broken syntax. -* Doesn't look inside embedded expressions in template strings. - - **this won't work:** - ```js - console.log(`the current env is ${process.env.NODE_ENV}`); - ``` -* Doesn't replace oddly-spaced or oddly-commented expressions. - - **this won't work:** - ```js - console.log(process./*won't*/env./*work*/NODE_ENV); - ``` - -## Usage/Options - -loose-envify has the exact same interface as [envify](https://github.com/hughsk/envify), including the CLI. - -## Benchmark - -``` -envify: - - $ for i in {1..5}; do node bench/bench.js 'envify'; done - 708ms - 727ms - 791ms - 719ms - 720ms - -loose-envify: - - $ for i in {1..5}; do node bench/bench.js '../'; done - 51ms - 52ms - 52ms - 52ms - 52ms -``` diff --git a/healthy-hair/node_modules/loose-envify/cli.js b/healthy-hair/node_modules/loose-envify/cli.js deleted file mode 100755 index c0b63cb1d..000000000 --- a/healthy-hair/node_modules/loose-envify/cli.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var looseEnvify = require('./'); -var fs = require('fs'); - -if (process.argv[2]) { - fs.createReadStream(process.argv[2], {encoding: 'utf8'}) - .pipe(looseEnvify(process.argv[2])) - .pipe(process.stdout); -} else { - process.stdin.resume() - process.stdin - .pipe(looseEnvify(__filename)) - .pipe(process.stdout); -} diff --git a/healthy-hair/node_modules/loose-envify/custom.js b/healthy-hair/node_modules/loose-envify/custom.js deleted file mode 100644 index 6389bfac5..000000000 --- a/healthy-hair/node_modules/loose-envify/custom.js +++ /dev/null @@ -1,4 +0,0 @@ -// envify compatibility -'use strict'; - -module.exports = require('./loose-envify'); diff --git a/healthy-hair/node_modules/loose-envify/index.js b/healthy-hair/node_modules/loose-envify/index.js deleted file mode 100644 index 8cd8305dd..000000000 --- a/healthy-hair/node_modules/loose-envify/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./loose-envify')(process.env); diff --git a/healthy-hair/node_modules/loose-envify/loose-envify.js b/healthy-hair/node_modules/loose-envify/loose-envify.js deleted file mode 100644 index b5a5be220..000000000 --- a/healthy-hair/node_modules/loose-envify/loose-envify.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -var stream = require('stream'); -var util = require('util'); -var replace = require('./replace'); - -var jsonExtRe = /\.json$/; - -module.exports = function(rootEnv) { - rootEnv = rootEnv || process.env; - return function (file, trOpts) { - if (jsonExtRe.test(file)) { - return stream.PassThrough(); - } - var envs = trOpts ? [rootEnv, trOpts] : [rootEnv]; - return new LooseEnvify(envs); - }; -}; - -function LooseEnvify(envs) { - stream.Transform.call(this); - this._data = ''; - this._envs = envs; -} -util.inherits(LooseEnvify, stream.Transform); - -LooseEnvify.prototype._transform = function(buf, enc, cb) { - this._data += buf; - cb(); -}; - -LooseEnvify.prototype._flush = function(cb) { - var replaced = replace(this._data, this._envs); - this.push(replaced); - cb(); -}; diff --git a/healthy-hair/node_modules/loose-envify/package.json b/healthy-hair/node_modules/loose-envify/package.json deleted file mode 100644 index eae17e34e..000000000 --- a/healthy-hair/node_modules/loose-envify/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "loose-envify@^1.4.0", - "_id": "loose-envify@1.4.0", - "_inBundle": false, - "_integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "_location": "/loose-envify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "loose-envify@^1.4.0", - "name": "loose-envify", - "escapedName": "loose-envify", - "rawSpec": "^1.4.0", - "saveSpec": null, - "fetchSpec": "^1.4.0" - }, - "_requiredBy": [ - "/prop-types", - "/react", - "/react-dom", - "/scheduler" - ], - "_resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "_shasum": "71ee51fa7be4caec1a63839f7e682d8132d30caf", - "_spec": "loose-envify@^1.4.0", - "_where": "/Users/ctrombley/src/github.com/newrelic-cli/healthy-hair/node_modules/prop-types", - "author": { - "name": "Andres Suarez", - "email": "zertosh@gmail.com" - }, - "bin": { - "loose-envify": "cli.js" - }, - "bugs": { - "url": "https://github.com/zertosh/loose-envify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "deprecated": false, - "description": "Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST", - "devDependencies": { - "browserify": "^13.1.1", - "envify": "^3.4.0", - "tap": "^8.0.0" - }, - "homepage": "https://github.com/zertosh/loose-envify", - "keywords": [ - "environment", - "variables", - "browserify", - "browserify-transform", - "transform", - "source", - "configuration" - ], - "license": "MIT", - "main": "index.js", - "name": "loose-envify", - "repository": { - "type": "git", - "url": "git://github.com/zertosh/loose-envify.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.4.0" -} diff --git a/healthy-hair/node_modules/loose-envify/replace.js b/healthy-hair/node_modules/loose-envify/replace.js deleted file mode 100644 index ec15e81c2..000000000 --- a/healthy-hair/node_modules/loose-envify/replace.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -var jsTokens = require('js-tokens').default; - -var processEnvRe = /\bprocess\.env\.[_$a-zA-Z][$\w]+\b/; -var spaceOrCommentRe = /^(?:\s|\/[/*])/; - -function replace(src, envs) { - if (!processEnvRe.test(src)) { - return src; - } - - var out = []; - var purge = envs.some(function(env) { - return env._ && env._.indexOf('purge') !== -1; - }); - - jsTokens.lastIndex = 0 - var parts = src.match(jsTokens); - - for (var i = 0; i < parts.length; i++) { - if (parts[i ] === 'process' && - parts[i + 1] === '.' && - parts[i + 2] === 'env' && - parts[i + 3] === '.') { - var prevCodeToken = getAdjacentCodeToken(-1, parts, i); - var nextCodeToken = getAdjacentCodeToken(1, parts, i + 4); - var replacement = getReplacementString(envs, parts[i + 4], purge); - if (prevCodeToken !== '.' && - nextCodeToken !== '.' && - nextCodeToken !== '=' && - typeof replacement === 'string') { - out.push(replacement); - i += 4; - continue; - } - } - out.push(parts[i]); - } - - return out.join(''); -} - -function getAdjacentCodeToken(dir, parts, i) { - while (true) { - var part = parts[i += dir]; - if (!spaceOrCommentRe.test(part)) { - return part; - } - } -} - -function getReplacementString(envs, name, purge) { - for (var j = 0; j < envs.length; j++) { - var env = envs[j]; - if (typeof env[name] !== 'undefined') { - return JSON.stringify(env[name]); - } - } - if (purge) { - return 'undefined'; - } -} - -module.exports = replace; diff --git a/healthy-hair/node_modules/object-assign/index.js b/healthy-hair/node_modules/object-assign/index.js deleted file mode 100644 index 0930cf889..000000000 --- a/healthy-hair/node_modules/object-assign/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* 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'); - } - - return Object(val); -} - -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; - } - - // 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; - } - - // 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 (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/healthy-hair/node_modules/object-assign/license b/healthy-hair/node_modules/object-assign/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/healthy-hair/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/healthy-hair/node_modules/object-assign/package.json b/healthy-hair/node_modules/object-assign/package.json deleted file mode 100644 index 8d37a707c..000000000 --- a/healthy-hair/node_modules/object-assign/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "object-assign@^4.1.1", - "_id": "object-assign@4.1.1", - "_inBundle": false, - "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "_location": "/object-assign", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "object-assign@^4.1.1", - "name": "object-assign", - "escapedName": "object-assign", - "rawSpec": "^4.1.1", - "saveSpec": null, - "fetchSpec": "^4.1.1" - }, - "_requiredBy": [ - "/prop-types", - "/react", - "/react-dom", - "/scheduler" - ], - "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", - "_spec": "object-assign@^4.1.1", - "_where": "/Users/ctrombley/src/github.com/newrelic-cli/healthy-hair/node_modules/prop-types", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/object-assign/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ES2015 `Object.assign()` ponyfill", - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/object-assign#readme", - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "license": "MIT", - "name": "object-assign", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/object-assign.git" - }, - "scripts": { - "bench": "matcha bench.js", - "test": "xo && ava" - }, - "version": "4.1.1" -} diff --git a/healthy-hair/node_modules/object-assign/readme.md b/healthy-hair/node_modules/object-assign/readme.md deleted file mode 100644 index 1be09d35c..000000000 --- a/healthy-hair/node_modules/object-assign/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) - - -## Use the built-in - -Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), -support `Object.assign()` :tada:. If you target only those environments, then by all -means, use `Object.assign()` instead of this package. - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/healthy-hair/node_modules/prop-types/CHANGELOG.md b/healthy-hair/node_modules/prop-types/CHANGELOG.md deleted file mode 100644 index 025d2f40e..000000000 --- a/healthy-hair/node_modules/prop-types/CHANGELOG.md +++ /dev/null @@ -1,92 +0,0 @@ -## 15.7.2 -* [Fix] ensure nullish values in `oneOf` do not crash ([#256](https://github.com/facebook/prop-types/issues/256)) -* [Fix] move `loose-envify` back to production deps, for browerify usage ([#203](https://github.com/facebook/prop-types/issues/203)) - -## 15.7.1 -* [Fix] avoid template literal syntax ([#255](https://github.com/facebook/prop-types/issues/255), [#254](https://github.com/facebook/prop-types/issues/254)) - -## 15.7.0 -* [New] Add `.elementType` ([#211](https://github.com/facebook/prop-types/pull/211)) -* [New] add `PropTypes.resetWarningCache` ([#178](https://github.com/facebook/prop-types/pull/178)) -* `oneOf`: improve warning when multiple arguments are supplied ([#244](https://github.com/facebook/prop-types/pull/244)) -* Fix `oneOf` when used with Symbols ([#224](https://github.com/facebook/prop-types/pull/224)) -* Avoid relying on `hasOwnProperty` being present on values' prototypes ([#112](https://github.com/facebook/prop-types/pull/112), [#187](https://github.com/facebook/prop-types/pull/187)) -* Improve readme ([#248](https://github.com/facebook/prop-types/pull/248), [#233](https://github.com/facebook/prop-types/pull/233)) -* Clean up mistaken runtime dep, swap envify for loose-envify ([#204](https://github.com/facebook/prop-types/pull/204)) - -## 15.6.2 -* Remove the `fbjs` dependency by inlining some helpers from it ([#194](https://github.com/facebook/prop-types/pull/194))) - -## 15.6.1 -* Fix an issue where outdated BSD license headers were still present in the published bundle [#162](https://github.com/facebook/prop-types/issues/162) - -## 15.6.0 - -* Switch from BSD + Patents to MIT license -* Add PropTypes.exact, like PropTypes.shape but warns on extra object keys. ([@thejameskyle](https://github.com/thejameskyle) and [@aweary](https://github.com/aweary) in [#41](https://github.com/facebook/prop-types/pull/41) and [#87](https://github.com/facebook/prop-types/pull/87)) - -## 15.5.10 - -* Fix a false positive warning when using a production UMD build of a third-party library with a DEV version of React. ([@gaearon](https://github.com/gaearon) in [#50](https://github.com/facebook/prop-types/pull/50)) - -## 15.5.9 - -* Add `loose-envify` Browserify transform for users who don't envify globally. ([@mridgway](https://github.com/mridgway) in [#45](https://github.com/facebook/prop-types/pull/45)) - -## 15.5.8 - -* Limit the manual PropTypes call warning count because it has false positives with React versions earlier than 15.2.0 in the 15.x branch and 0.14.9 in the 0.14.x branch. ([@gaearon](https://github.com/gaearon) in [#26](https://github.com/facebook/prop-types/pull/26)) - -## 15.5.7 - -* **Critical Bugfix:** Fix an accidental breaking change that caused errors in production when used through `React.PropTypes`. ([@gaearon](https://github.com/gaearon) in [#20](https://github.com/facebook/prop-types/pull/20)) -* Improve the size of production UMD build. ([@aweary](https://github.com/aweary) in [38ba18](https://github.com/facebook/prop-types/commit/38ba18a4a8f705f4b2b33c88204573ddd604f2d6) and [7882a7](https://github.com/facebook/prop-types/commit/7882a7285293db5f284bcf559b869fd2cd4c44d4)) - -## 15.5.6 - -**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** - -* Fix a markdown issue in README. ([@bvaughn](https://github.com/bvaughn) in [174f77](https://github.com/facebook/prop-types/commit/174f77a50484fa628593e84b871fb40eed78b69a)) - -## 15.5.5 - -**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** - -* Add missing documentation and license files. ([@bvaughn](https://github.com/bvaughn) in [0a53d3](https://github.com/facebook/prop-types/commit/0a53d3a34283ae1e2d3aa396632b6dc2a2061e6a)) - -## 15.5.4 - -**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** - -* Reduce the size of the UMD Build. ([@acdlite](https://github.com/acdlite) in [31e9344](https://github.com/facebook/prop-types/commit/31e9344ca3233159928da66295da17dad82db1a8)) -* Remove bad package url. ([@ljharb](https://github.com/ljharb) in [158198f](https://github.com/facebook/prop-types/commit/158198fd6c468a3f6f742e0e355e622b3914048a)) -* Remove the accidentally included typechecking code from the production build. - -## 15.5.3 - -**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** - -* Remove the accidentally included React package code from the UMD bundle. ([@acdlite](https://github.com/acdlite) in [df318bb](https://github.com/facebook/prop-types/commit/df318bba8a89bc5aadbb0292822cf4ed71d27ace)) - -## 15.5.2 - -**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** - -* Remove dependency on React for CommonJS entry point. ([@acdlite](https://github.com/acdlite) in [cae72bb](https://github.com/facebook/prop-types/commit/cae72bb281a3766c765e3624f6088c3713567e6d)) - - -## 15.5.1 - -**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** - -* Remove accidental uncompiled ES6 syntax in the published package. ([@acdlite](https://github.com/acdlite) in [e191963](https://github.com/facebook/react/commit/e1919638b39dd65eedd250a8bb649773ca61b6f1)) - -## 15.5.0 - -**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** - -* Initial release. - -## Before 15.5.0 - -PropTypes was previously included in React, but is now a separate package. For earlier history of PropTypes [see the React change log.](https://github.com/facebook/react/blob/master/CHANGELOG.md) diff --git a/healthy-hair/node_modules/prop-types/LICENSE b/healthy-hair/node_modules/prop-types/LICENSE deleted file mode 100644 index 188fb2b0b..000000000 --- a/healthy-hair/node_modules/prop-types/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013-present, Facebook, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/healthy-hair/node_modules/prop-types/README.md b/healthy-hair/node_modules/prop-types/README.md deleted file mode 100644 index 1a23c9d98..000000000 --- a/healthy-hair/node_modules/prop-types/README.md +++ /dev/null @@ -1,296 +0,0 @@ -# prop-types [![Build Status](https://travis-ci.com/facebook/prop-types.svg?branch=master)](https://travis-ci.org/facebook/prop-types) - -Runtime type checking for React props and similar objects. - -You can use prop-types to document the intended types of properties passed to -components. React (and potentially other libraries—see the checkPropTypes() -reference below) will check props passed to your components against those -definitions, and warn in development if they don’t match. - -## Installation - -```shell -npm install --save prop-types -``` - -## Importing - -```js -import PropTypes from 'prop-types'; // ES6 -var PropTypes = require('prop-types'); // ES5 with npm -``` - -### CDN - -If you prefer to exclude `prop-types` from your application and use it -globally via `window.PropTypes`, the `prop-types` package provides -single-file distributions, which are hosted on the following CDNs: - -* [**unpkg**](https://unpkg.com/prop-types/) -```html - - - - - -``` - -* [**cdnjs**](https://cdnjs.com/libraries/prop-types) -```html - - - - - -``` - -To load a specific version of `prop-types` replace `15.6.0` with the version number. - -## Usage - -PropTypes was originally exposed as part of the React core module, and is -commonly used with React components. -Here is an example of using PropTypes with a React component, which also -documents the different validators provided: - -```js -import React from 'react'; -import PropTypes from 'prop-types'; - -class MyComponent extends React.Component { - render() { - // ... do things with the props - } -} - -MyComponent.propTypes = { - // You can declare that a prop is a specific JS primitive. By default, these - // are all optional. - optionalArray: PropTypes.array, - optionalBool: PropTypes.bool, - optionalFunc: PropTypes.func, - optionalNumber: PropTypes.number, - optionalObject: PropTypes.object, - optionalString: PropTypes.string, - optionalSymbol: PropTypes.symbol, - - // Anything that can be rendered: numbers, strings, elements or an array - // (or fragment) containing these types. - optionalNode: PropTypes.node, - - // A React element (ie. ). - optionalElement: PropTypes.element, - - // A React element type (ie. MyComponent). - optionalElementType: PropTypes.elementType, - - // You can also declare that a prop is an instance of a class. This uses - // JS's instanceof operator. - optionalMessage: PropTypes.instanceOf(Message), - - // You can ensure that your prop is limited to specific values by treating - // it as an enum. - optionalEnum: PropTypes.oneOf(['News', 'Photos']), - - // An object that could be one of many types - optionalUnion: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number, - PropTypes.instanceOf(Message) - ]), - - // An array of a certain type - optionalArrayOf: PropTypes.arrayOf(PropTypes.number), - - // An object with property values of a certain type - optionalObjectOf: PropTypes.objectOf(PropTypes.number), - - // You can chain any of the above with `isRequired` to make sure a warning - // is shown if the prop isn't provided. - - // An object taking on a particular shape - optionalObjectWithShape: PropTypes.shape({ - optionalProperty: PropTypes.string, - requiredProperty: PropTypes.number.isRequired - }), - - // An object with warnings on extra properties - optionalObjectWithStrictShape: PropTypes.exact({ - optionalProperty: PropTypes.string, - requiredProperty: PropTypes.number.isRequired - }), - - requiredFunc: PropTypes.func.isRequired, - - // A value of any data type - requiredAny: PropTypes.any.isRequired, - - // You can also specify a custom validator. It should return an Error - // object if the validation fails. Don't `console.warn` or throw, as this - // won't work inside `oneOfType`. - customProp: function(props, propName, componentName) { - if (!/matchme/.test(props[propName])) { - return new Error( - 'Invalid prop `' + propName + '` supplied to' + - ' `' + componentName + '`. Validation failed.' - ); - } - }, - - // You can also supply a custom validator to `arrayOf` and `objectOf`. - // It should return an Error object if the validation fails. The validator - // will be called for each key in the array or object. The first two - // arguments of the validator are the array or object itself, and the - // current item's key. - customArrayProp: PropTypes.arrayOf(function(propValue, key, componentName, location, propFullName) { - if (!/matchme/.test(propValue[key])) { - return new Error( - 'Invalid prop `' + propFullName + '` supplied to' + - ' `' + componentName + '`. Validation failed.' - ); - } - }) -}; -``` - -Refer to the [React documentation](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) for more information. - -## Migrating from React.PropTypes - -Check out [Migrating from React.PropTypes](https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) for details on how to migrate to `prop-types` from `React.PropTypes`. - -Note that this blog posts **mentions a codemod script that performs the conversion automatically**. - -There are also important notes below. - -## How to Depend on This Package? - -For apps, we recommend putting it in `dependencies` with a caret range. -For example: - -```js - "dependencies": { - "prop-types": "^15.5.7" - } -``` - -For libraries, we *also* recommend leaving it in `dependencies`: - -```js - "dependencies": { - "prop-types": "^15.5.7" - }, - "peerDependencies": { - "react": "^15.5.0" - } -``` - -**Note:** there are known issues in versions before 15.5.7 so we recommend using it as the minimal version. - -Make sure that the version range uses a caret (`^`) and thus is broad enough for npm to efficiently deduplicate packages. - -For UMD bundles of your components, make sure you **don’t** include `PropTypes` in the build. Usually this is done by marking it as an external (the specifics depend on your bundler), just like you do with React. - -## Compatibility - -### React 0.14 - -This package is compatible with **React 0.14.9**. Compared to 0.14.8 (which was released in March of 2016), there are no other changes in 0.14.9, so it should be a painless upgrade. - -```shell -# ATTENTION: Only run this if you still use React 0.14! -npm install --save react@^0.14.9 react-dom@^0.14.9 -``` - -### React 15+ - -This package is compatible with **React 15.3.0** and higher. - -``` -npm install --save react@^15.3.0 react-dom@^15.3.0 -``` - -### What happens on other React versions? - -It outputs warnings with the message below even though the developer doesn’t do anything wrong. Unfortunately there is no solution for this other than updating React to either 15.3.0 or higher, or 0.14.9 if you’re using React 0.14. - -## Difference from `React.PropTypes`: Don’t Call Validator Functions - -First of all, **which version of React are you using**? You might be seeing this message because a component library has updated to use `prop-types` package, but your version of React is incompatible with it. See the [above section](#compatibility) for more details. - -Are you using either React 0.14.9 or a version higher than React 15.3.0? Read on. - -When you migrate components to use the standalone `prop-types`, **all validator functions will start throwing an error if you call them directly**. This makes sure that nobody relies on them in production code, and it is safe to strip their implementations to optimize the bundle size. - -Code like this is still fine: - -```js -MyComponent.propTypes = { - myProp: PropTypes.bool -}; -``` - -However, code like this will not work with the `prop-types` package: - -```js -// Will not work with `prop-types` package! -var errorOrNull = PropTypes.bool(42, 'myProp', 'MyComponent', 'prop'); -``` - -It will throw an error: - -``` -Calling PropTypes validators directly is not supported by the `prop-types` package. -Use PropTypes.checkPropTypes() to call them. -``` - -(If you see **a warning** rather than an error with this message, please check the [above section about compatibility](#compatibility).) - -This is new behavior, and you will only encounter it when you migrate from `React.PropTypes` to the `prop-types` package. For the vast majority of components, this doesn’t matter, and if you didn’t see [this warning](https://facebook.github.io/react/warnings/dont-call-proptypes.html) in your components, your code is safe to migrate. This is not a breaking change in React because you are only opting into this change for a component by explicitly changing your imports to use `prop-types`. If you temporarily need the old behavior, you can keep using `React.PropTypes` until React 16. - -**If you absolutely need to trigger the validation manually**, call `PropTypes.checkPropTypes()`. Unlike the validators themselves, this function is safe to call in production, as it will be replaced by an empty function: - -```js -// Works with standalone PropTypes -PropTypes.checkPropTypes(MyComponent.propTypes, props, 'prop', 'MyComponent'); -``` -See below for more info. - -**You might also see this error** if you’re calling a `PropTypes` validator from your own custom `PropTypes` validator. In this case, the fix is to make sure that you are passing *all* of the arguments to the inner function. There is a more in-depth explanation of how to fix it [on this page](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes). Alternatively, you can temporarily keep using `React.PropTypes` until React 16, as it would still only warn in this case. - -If you use a bundler like Browserify or Webpack, don’t forget to [follow these instructions](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) to correctly bundle your application in development or production mode. Otherwise you’ll ship unnecessary code to your users. - -## PropTypes.checkPropTypes - -React will automatically check the propTypes you set on the component, but if -you are using PropTypes without React then you may want to manually call -`PropTypes.checkPropTypes`, like so: - -```js -const myPropTypes = { - name: PropTypes.string, - age: PropTypes.number, - // ... define your prop validations -}; - -const props = { - name: 'hello', // is valid - age: 'world', // not valid -}; - -// Let's say your component is called 'MyComponent' - -// Works with standalone PropTypes -PropTypes.checkPropTypes(myPropTypes, props, 'age', 'MyComponent'); -// This will warn as follows: -// Warning: Failed prop type: Invalid prop `age` of type `string` supplied to -// `MyComponent`, expected `number`. -``` - -## PropTypes.resetWarningCache() - -`PropTypes.checkPropTypes(...)` only `console.error.log(...)`s a given message once. To reset the cache while testing call `PropTypes.resetWarningCache()` - -### License - -prop-types is [MIT licensed](./LICENSE). diff --git a/healthy-hair/node_modules/prop-types/checkPropTypes.js b/healthy-hair/node_modules/prop-types/checkPropTypes.js deleted file mode 100644 index 49111df95..000000000 --- a/healthy-hair/node_modules/prop-types/checkPropTypes.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * 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. - */ - -'use strict'; - -var printWarning = function() {}; - -if (process.env.NODE_ENV !== 'production') { - var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); - var loggedTypeFailures = {}; - var has = Function.call.bind(Object.prototype.hasOwnProperty); - - 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) {} - }; -} - -/** - * 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 (process.env.NODE_ENV !== 'production') { - 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] + '`.' - ); - 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() : ''; - - printWarning( - 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') - ); - } - } - } - } -} - -/** - * Resets warning cache when testing. - * - * @private - */ -checkPropTypes.resetWarningCache = function() { - if (process.env.NODE_ENV !== 'production') { - loggedTypeFailures = {}; - } -} - -module.exports = checkPropTypes; diff --git a/healthy-hair/node_modules/prop-types/factory.js b/healthy-hair/node_modules/prop-types/factory.js deleted file mode 100644 index abdf8e6dc..000000000 --- a/healthy-hair/node_modules/prop-types/factory.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 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. - */ - -'use strict'; - -// React 15.5 references this module, and assumes PropTypes are still callable in production. -// Therefore we re-export development-only version with all the PropTypes checks here. -// However if one is migrating to the `prop-types` npm library, they will go through the -// `index.js` entry point, and it will branch depending on the environment. -var factory = require('./factoryWithTypeCheckers'); -module.exports = function(isValidElement) { - // It is still allowed in 15.5. - var throwOnDirectAccess = false; - return factory(isValidElement, throwOnDirectAccess); -}; diff --git a/healthy-hair/node_modules/prop-types/factoryWithThrowingShims.js b/healthy-hair/node_modules/prop-types/factoryWithThrowingShims.js deleted file mode 100644 index e5b2f9ce0..000000000 --- a/healthy-hair/node_modules/prop-types/factoryWithThrowingShims.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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. - */ - -'use strict'; - -var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); - -function emptyFunction() {} -function emptyFunctionWithReset() {} -emptyFunctionWithReset.resetWarningCache = emptyFunction; - -module.exports = function() { - function shim(props, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret) { - // It is still safe when called from React. - return; - } - 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; - }; - shim.isRequired = shim; - function getShim() { - return shim; - }; - // Important! - // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. - var ReactPropTypes = { - array: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, - - any: shim, - arrayOf: getShim, - element: shim, - elementType: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim, - exact: getShim, - - checkPropTypes: emptyFunctionWithReset, - resetWarningCache: emptyFunction - }; - - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; diff --git a/healthy-hair/node_modules/prop-types/factoryWithTypeCheckers.js b/healthy-hair/node_modules/prop-types/factoryWithTypeCheckers.js deleted file mode 100644 index 3711f0b6e..000000000 --- a/healthy-hair/node_modules/prop-types/factoryWithTypeCheckers.js +++ /dev/null @@ -1,591 +0,0 @@ -/** - * 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. - */ - -'use strict'; - -var ReactIs = require('react-is'); -var assign = require('object-assign'); - -var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); -var checkPropTypes = require('./checkPropTypes'); - -var has = Function.call.bind(Object.prototype.hasOwnProperty); -var printWarning = function() {}; - -if (process.env.NODE_ENV !== 'production') { - 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) {} - }; -} - -function emptyFunctionThatReturnsNull() { - return null; -} - -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - - /** - * 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; - } - } - - /** - * 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 ANONYMOUS = '<>'; - - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - elementType: createElementTypeTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker, - exact: createStrictShapeTypeChecker, - }; - - /** - * 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*/ - - /** - * 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) { - this.message = message; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; - - function createChainableTypeChecker(validate) { - if (process.env.NODE_ENV !== 'production') { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - - 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 (process.env.NODE_ENV !== 'production' && 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 chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; - } - - 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 + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunctionThatReturnsNull); - } - - 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 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 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); - } - - 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); - } - - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - if (process.env.NODE_ENV !== 'production') { - 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)) { - process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunctionThatReturnsNull; - } - - 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; - } - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - 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); - } - - 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 (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - 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 (!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); - } - - 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 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; - } - - return true; - default: - return false; - } - } - - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // falsy value can't be a Symbol - if (!propValue) { - return false; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; - } - - // 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; - } - - // 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; - } - - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; diff --git a/healthy-hair/node_modules/prop-types/index.js b/healthy-hair/node_modules/prop-types/index.js deleted file mode 100644 index e9ef51d6f..000000000 --- a/healthy-hair/node_modules/prop-types/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 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 (process.env.NODE_ENV !== 'production') { - var ReactIs = require('react-is'); - - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess); -} else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = require('./factoryWithThrowingShims')(); -} diff --git a/healthy-hair/node_modules/prop-types/lib/ReactPropTypesSecret.js b/healthy-hair/node_modules/prop-types/lib/ReactPropTypesSecret.js deleted file mode 100644 index f54525e7f..000000000 --- a/healthy-hair/node_modules/prop-types/lib/ReactPropTypesSecret.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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. - */ - -'use strict'; - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; diff --git a/healthy-hair/node_modules/prop-types/package.json b/healthy-hair/node_modules/prop-types/package.json deleted file mode 100644 index ad7b9fd95..000000000 --- a/healthy-hair/node_modules/prop-types/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_from": "prop-types@^15.6.2", - "_id": "prop-types@15.7.2", - "_inBundle": false, - "_integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", - "_location": "/prop-types", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "prop-types@^15.6.2", - "name": "prop-types", - "escapedName": "prop-types", - "rawSpec": "^15.6.2", - "saveSpec": null, - "fetchSpec": "^15.6.2" - }, - "_requiredBy": [ - "/", - "/react", - "/react-dom" - ], - "_resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "_shasum": "52c41e75b8c87e72b9d9360e0206b99dcbffa6c5", - "_spec": "prop-types@^15.6.2", - "_where": "/Users/ctrombley/src/github.com/newrelic-cli/healthy-hair", - "browserify": { - "transform": [ - "loose-envify" - ] - }, - "bugs": { - "url": "https://github.com/facebook/prop-types/issues" - }, - "bundleDependencies": false, - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.8.1" - }, - "deprecated": false, - "description": "Runtime type checking for React props and similar objects.", - "devDependencies": { - "babel-jest": "^19.0.0", - "babel-preset-react": "^6.24.1", - "browserify": "^16.2.3", - "bundle-collapser": "^1.2.1", - "eslint": "^5.13.0", - "jest": "^19.0.2", - "react": "^15.5.1", - "uglifyify": "^3.0.4", - "uglifyjs": "^2.4.10" - }, - "files": [ - "LICENSE", - "README.md", - "checkPropTypes.js", - "factory.js", - "factoryWithThrowingShims.js", - "factoryWithTypeCheckers.js", - "index.js", - "prop-types.js", - "prop-types.min.js", - "lib" - ], - "homepage": "https://facebook.github.io/react/", - "keywords": [ - "react" - ], - "license": "MIT", - "main": "index.js", - "name": "prop-types", - "repository": { - "type": "git", - "url": "git+https://github.com/facebook/prop-types.git" - }, - "scripts": { - "build": "yarn umd && yarn umd-min", - "lint": "eslint .", - "prepublish": "yarn build", - "pretest": "npm run lint", - "test": "npm run tests-only", - "tests-only": "jest", - "umd": "NODE_ENV=development browserify index.js -t loose-envify --standalone PropTypes -o prop-types.js", - "umd-min": "NODE_ENV=production browserify index.js -t loose-envify -t uglifyify --standalone PropTypes -p bundle-collapser/plugin -o | uglifyjs --compress unused,dead_code -o prop-types.min.js" - }, - "version": "15.7.2" -} diff --git a/healthy-hair/node_modules/prop-types/prop-types.js b/healthy-hair/node_modules/prop-types/prop-types.js deleted file mode 100644 index 867d6993c..000000000 --- a/healthy-hair/node_modules/prop-types/prop-types.js +++ /dev/null @@ -1,1337 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PropTypes = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 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)) { - "development" !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunctionThatReturnsNull; - } - - 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; - } - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - 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); - } - - 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 (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - 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 (!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); - } - - 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 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; - } - - return true; - default: - return false; - } - } - - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // falsy value can't be a Symbol - if (!propValue) { - return false; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; - } - - // 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; - } - - // 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; - } - - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - -},{"./checkPropTypes":1,"./lib/ReactPropTypesSecret":5,"object-assign":6,"react-is":10}],4:[function(require,module,exports){ -/** - * 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 ("development" !== 'production') { - var ReactIs = require('react-is'); - - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess); -} else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = require('./factoryWithThrowingShims')(); -} - -},{"./factoryWithThrowingShims":2,"./factoryWithTypeCheckers":3,"react-is":10}],5:[function(require,module,exports){ -/** - * 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. - */ - -'use strict'; - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - -},{}],6:[function(require,module,exports){ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* 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'); - } - - return Object(val); -} - -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; - } - - // 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; - } - - // 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 (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - -},{}],7:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],8:[function(require,module,exports){ -(function (process){ -/** @license React v16.8.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. - */ - -'use strict'; - - - -if (process.env.NODE_ENV !== "production") { - (function() { -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -// 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; -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_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; -var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; - -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 || 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); -} - -/** - * Forked from fbjs/warning: - * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js - * - * Only change is we use console.warn instead of console.error, - * and do nothing when 'console' is not supported. - * This really simplifies the code. - * --- - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var lowPriorityWarning = function () {}; - -{ - var printWarning = function (format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.warn(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) {} - }; - - lowPriorityWarning = function (condition, format) { - if (format === undefined) { - throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -var lowPriorityWarning$1 = lowPriorityWarning; - -function typeOf(object) { - if (typeof object === 'object' && object !== null) { - var $$typeof = object.$$typeof; - switch ($$typeof) { - case REACT_ELEMENT_TYPE: - var type = object.type; - - 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_PROVIDER_TYPE: - return $$typeofType; - default: - return $$typeof; - } - } - case REACT_LAZY_TYPE: - case REACT_MEMO_TYPE: - case REACT_PORTAL_TYPE: - return $$typeof; - } - } - - return undefined; -} - -// AsyncMode is deprecated along with isAsyncMode -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 -function isAsyncMode(object) { - { - if (!hasWarnedAboutDeprecatedIsAsyncMode) { - hasWarnedAboutDeprecatedIsAsyncMode = true; - lowPriorityWarning$1(false, '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.'); - } - } - 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.typeOf = typeOf; -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.isValidElementType = isValidElementType; -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; - })(); -} - -}).call(this,require('_process')) -},{"_process":7}],9:[function(require,module,exports){ -/** @license React v16.8.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict';Object.defineProperty(exports,"__esModule",{value:!0}); -var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"): -60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n; -exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k}; -exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f}; -exports.isSuspense=function(a){return t(a)===p}; - -},{}],10:[function(require,module,exports){ -(function (process){ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-is.production.min.js'); -} else { - module.exports = require('./cjs/react-is.development.js'); -} - -}).call(this,require('_process')) -},{"./cjs/react-is.development.js":8,"./cjs/react-is.production.min.js":9,"_process":7}]},{},[4])(4) -}); \ No newline at end of file diff --git a/healthy-hair/node_modules/prop-types/prop-types.min.js b/healthy-hair/node_modules/prop-types/prop-types.min.js deleted file mode 100644 index c90243315..000000000 --- a/healthy-hair/node_modules/prop-types/prop-types.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.PropTypes=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;oHello World; - } -} - -ReactDOM.render(, node); -``` - -### On the server - -```js -var React = require('react'); -var ReactDOMServer = require('react-dom/server'); - -class MyComponent extends React.Component { - render() { - return
Hello World
; - } -} - -ReactDOMServer.renderToString(); -``` - -## API - -### `react-dom` - -- `findDOMNode` -- `render` -- `unmountComponentAtNode` - -### `react-dom/server` - -- `renderToString` -- `renderToStaticMarkup` diff --git a/healthy-hair/node_modules/react-dom/build-info.json b/healthy-hair/node_modules/react-dom/build-info.json deleted file mode 100644 index 4094da67d..000000000 --- a/healthy-hair/node_modules/react-dom/build-info.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "branch": "pull/18344", - "buildNumber": "106499", - "checksum": "7fe5a2e", - "commit": "da834083c", - "environment": "ci", - "reactVersion": "16.12.0-da834083c" -} diff --git a/healthy-hair/node_modules/react-dom/cjs/react-dom-server.browser.development.js b/healthy-hair/node_modules/react-dom/cjs/react-dom-server.browser.development.js deleted file mode 100644 index 599bc94ed..000000000 --- a/healthy-hair/node_modules/react-dom/cjs/react-dom-server.browser.development.js +++ /dev/null @@ -1,4043 +0,0 @@ -/** @license React v16.14.0 - * react-dom-server.browser.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. - */ - -'use strict'; - - - -if (process.env.NODE_ENV !== "production") { - (function() { -'use strict'; - -var React = require('react'); -var _assign = require('object-assign'); -var checkPropTypes = require('prop-types/checkPropTypes'); - -// Do not require this module directly! Use normal `invariant` calls with -// template literal strings. The messages will be replaced with error codes -// during build. -function formatProdErrorMessage(code) { - var url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code; - - for (var i = 1; i < arguments.length; i++) { - url += '&args[]=' + encodeURIComponent(arguments[i]); - } - - return "Minified React error #" + code + "; visit " + url + " for the full message or " + 'use the non-minified dev environment for full errors and additional ' + 'helpful warnings.'; -} - -var ReactVersion = '16.14.0'; - -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 - }; -} - -// 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. - -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]; - } - - 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]; - } - - printWarning('error', format, args); - } -} - -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; - - if (!hasExistingStack) { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } - } - - var argsWithFormat = args.map(function (item) { - return '' + item; - }); // Careful: RN currently depends on this prefix - - 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 - - Function.prototype.apply.call(console[level], console, argsWithFormat); - - 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) {} - } -} - -// 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_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 REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; -var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; - -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); - } - } - - lazyComponent._status = Resolved; - lazyComponent._result = defaultExport; - } - }, function (error) { - if (lazyComponent._status === Pending) { - lazyComponent._status = Rejected; - lazyComponent._result = error; - } - }); - } -} - -function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); -} - -function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - { - if (typeof type.tag === 'number') { - error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - switch (type) { - case REACT_FRAGMENT_TYPE: - return 'Fragment'; - - case REACT_PORTAL_TYPE: - return 'Portal'; - - case REACT_PROFILER_TYPE: - return "Profiler"; - - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - - case REACT_SUSPENSE_TYPE: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - return 'Context.Consumer'; - - case REACT_PROVIDER_TYPE: - return 'Context.Provider'; - - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - - case REACT_MEMO_TYPE: - return getComponentName(type.type); - - 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; - } - } - } - - return null; -} - -var BEFORE_SLASH_RE = /^(.*)[\\\/]/; -function describeComponentFrame (name, source, ownerName) { - var sourceInfo = ''; - - if (source) { - var path = source.fileName; - var fileName = path.replace(BEFORE_SLASH_RE, ''); - - { - // 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); - - if (match) { - var pathBeforeSlash = match[1]; - - if (pathBeforeSlash) { - var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); - fileName = folderName + '/' + fileName; - } - } - } - } - - sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; - } else if (ownerName) { - sourceInfo = ' (created by ' + ownerName + ')'; - } - - return '\n in ' + (name || 'Unknown') + sourceInfo; -} - -var enableSuspenseServerRenderer = false; - -var enableDeprecatedFlareAPI = false; // Experimental Host Component support. - -var ReactDebugCurrentFrame; -var didWarnAboutInvalidateContextType; - -{ - ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - didWarnAboutInvalidateContextType = new Set(); -} - -var emptyObject = {}; - -{ - Object.freeze(emptyObject); -} - -function maskContext(type, context) { - var contextTypes = type.contextTypes; - - if (!contextTypes) { - return emptyObject; - } - - var maskedContext = {}; - - for (var contextName in contextTypes) { - maskedContext[contextName] = context[contextName]; - } - - return maskedContext; -} - -function checkContextTypes(typeSpecs, values, location) { - { - checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame.getCurrentStack); - } -} - -function validateContextBounds(context, threadID) { - // If we don't have enough slots in this context to store this threadID, - // fill it in without leaving any holes to ensure that the VM optimizes - // this as non-holey index properties. - // (Note: If `react` package is < 16.6, _threadCount is undefined.) - for (var i = context._threadCount | 0; i <= threadID; i++) { - // We assume that this is the same as the defaultValue which might not be - // true if we're rendering inside a secondary renderer but they are - // secondary because these use cases are very rare. - context[i] = context._currentValue2; - context._threadCount = i + 1; - } -} -function processContext(type, context, threadID, isClass) { - if (isClass) { - var contextType = type.contextType; - - { - if ('contextType' in type) { - var isValid = // Allow null for conditional declaration - contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a - - if (!isValid && !didWarnAboutInvalidateContextType.has(type)) { - didWarnAboutInvalidateContextType.add(type); - var addendum = ''; - - if (contextType === undefined) { - addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.'; - } else if (typeof contextType !== 'object') { - addendum = ' However, it is set to a ' + typeof contextType + '.'; - } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { - addendum = ' Did you accidentally pass the Context.Provider instead?'; - } else if (contextType._context !== undefined) { - // - addendum = ' Did you accidentally pass the Context.Consumer instead?'; - } else { - addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.'; - } - - error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum); - } - } - } - - if (typeof contextType === 'object' && contextType !== null) { - validateContextBounds(contextType, threadID); - return contextType[threadID]; - } - - { - var maskedContext = maskContext(type, context); - - { - if (type.contextTypes) { - checkContextTypes(type.contextTypes, maskedContext, 'context'); - } - } - - return maskedContext; - } - } else { - { - var _maskedContext = maskContext(type, context); - - { - if (type.contextTypes) { - checkContextTypes(type.contextTypes, _maskedContext, 'context'); - } - } - - return _maskedContext; - } - } -} - -var nextAvailableThreadIDs = new Uint16Array(16); - -for (var i = 0; i < 15; i++) { - nextAvailableThreadIDs[i] = i + 1; -} - -nextAvailableThreadIDs[15] = 0; - -function growThreadCountAndReturnNextAvailable() { - var oldArray = nextAvailableThreadIDs; - var oldSize = oldArray.length; - var newSize = oldSize * 2; - - if (!(newSize <= 0x10000)) { - { - throw Error( "Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic." ); - } - } - - var newArray = new Uint16Array(newSize); - newArray.set(oldArray); - nextAvailableThreadIDs = newArray; - nextAvailableThreadIDs[0] = oldSize + 1; - - for (var _i = oldSize; _i < newSize - 1; _i++) { - nextAvailableThreadIDs[_i] = _i + 1; - } - - nextAvailableThreadIDs[newSize - 1] = 0; - return oldSize; -} - -function allocThreadID() { - var nextID = nextAvailableThreadIDs[0]; - - if (nextID === 0) { - return growThreadCountAndReturnNextAvailable(); - } - - nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID]; - return nextID; -} -function freeThreadID(id) { - nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0]; - nextAvailableThreadIDs[0] = id; -} - -// 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. - -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. - -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. - -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; - } - - if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { - return false; - } - - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - - illegalAttributeNameCache[attributeName] = true; - - { - error('Invalid attribute name: `%s`', attributeName); - } - - return false; -} -function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null) { - return propertyInfo.type === RESERVED; - } - - if (isCustomComponentTag) { - return false; - } - - if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { - return true; - } - - return false; -} -function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null && propertyInfo.type === RESERVED) { - return false; - } - - switch (typeof value) { - case 'function': // $FlowIssue symbol is perfectly valid here - - case 'symbol': - // eslint-disable-line - return true; - - case 'boolean': - { - if (isCustomComponentTag) { - return false; - } - - if (propertyInfo !== null) { - return !propertyInfo.acceptsBooleans; - } else { - var prefix = name.toLowerCase().slice(0, 5); - return prefix !== 'data-' && prefix !== 'aria-'; - } - } - - default: - return false; - } -} -function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { - if (value === null || typeof value === 'undefined') { - return true; - } - - if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { - return true; - } - - if (isCustomComponentTag) { - return false; - } - - if (propertyInfo !== null) { - switch (propertyInfo.type) { - case BOOLEAN: - return !value; - - case OVERLOADED_BOOLEAN: - return value === false; - - case NUMERIC: - return isNaN(value); - - case POSITIVE_NUMERIC: - return isNaN(value) || value < 1; - } - } - - return false; -} -function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; -} - -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. - - -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. - -[['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). - -['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. - -['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. - -['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; - -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. - - -['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. - -['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. - -['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$1 = null; - -{ - ReactDebugCurrentFrame$1 = 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 */ - - -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; - -function sanitizeURL(url) { - { - if (!didWarn && isJavaScriptProtocol.test(url)) { - didWarn = true; - - 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)); - } - } -} - -// code copied and modified from escape-html - -/** - * Module variables. - * @private - */ -var matchHtmlRegExp = /["'&<>]/; -/** - * Escapes special characters and HTML entities in a given html string. - * - * @param {string} string HTML string to escape for later insertion - * @return {string} - * @public - */ - -function escapeHtml(string) { - var str = '' + string; - var match = matchHtmlRegExp.exec(str); - - if (!match) { - return str; - } - - var escape; - var html = ''; - var index; - var lastIndex = 0; - - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: - // " - escape = '"'; - break; - - case 38: - // & - escape = '&'; - break; - - case 39: - // ' - escape = '''; // modified from escape-html; used to be ''' - - break; - - case 60: - // < - escape = '<'; - break; - - case 62: - // > - escape = '>'; - break; - - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index ? html + str.substring(lastIndex, index) : html; -} // end code copied and modified from escape-html - -/** - * Escapes text to prevent scripting attacks. - * - * @param {*} text Text value to escape. - * @return {string} An escaped string. - */ - - -function escapeTextForBrowser(text) { - if (typeof text === 'boolean' || typeof text === 'number') { - // this shortcircuit helps perf for types that we know will never have - // special characters, especially given that this function is used often - // for numeric dom ids. - return '' + text; - } - - return escapeHtml(text); -} - -/** - * Escapes attribute value to prevent scripting attacks. - * - * @param {*} value Value to escape. - * @return {string} An escaped string. - */ - -function quoteAttributeValueForBrowser(value) { - return '"' + escapeTextForBrowser(value) + '"'; -} - -function createMarkupForRoot() { - return ROOT_ATTRIBUTE_NAME + '=""'; -} -/** - * Creates markup for a property. - * - * @param {string} name - * @param {*} value - * @return {?string} Markup string, or null if the property was invalid. - */ - -function createMarkupForProperty(name, value) { - var propertyInfo = getPropertyInfo(name); - - if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) { - return ''; - } - - if (shouldRemoveAttribute(name, value, propertyInfo, false)) { - return ''; - } - - if (propertyInfo !== null) { - var attributeName = propertyInfo.attributeName; - var type = propertyInfo.type; - - if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) { - return attributeName + '=""'; - } else { - if (propertyInfo.sanitizeURL) { - value = '' + value; - sanitizeURL(value); - } - - return attributeName + '=' + quoteAttributeValueForBrowser(value); - } - } else if (isAttributeNameSafe(name)) { - return name + '=' + quoteAttributeValueForBrowser(value); - } - - return ''; -} -/** - * Creates markup for a custom property. - * - * @param {string} name - * @param {*} value - * @return {string} Markup string, or empty string if the property was invalid. - */ - -function createMarkupForCustomAttribute(name, value) { - if (!isAttributeNameSafe(name) || value == null) { - return ''; - } - - return name + '=' + quoteAttributeValueForBrowser(value); -} - -/** - * 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 - */ -function is(x, y) { - return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare - ; -} - -var objectIs = typeof Object.is === 'function' ? Object.is : is; - -var currentlyRenderingComponent = null; -var firstWorkInProgressHook = null; -var workInProgressHook = null; // Whether the work-in-progress hook is a re-rendered hook - -var isReRender = false; // Whether an update was scheduled during the currently executing render pass. - -var didScheduleRenderPhaseUpdate = false; // Lazily created map of render-phase updates - -var renderPhaseUpdates = null; // Counter to prevent infinite loops. - -var numberOfReRenders = 0; -var RE_RENDER_LIMIT = 25; -var isInHookUserCodeInDev = false; // In DEV, this is the name of the currently executing primitive hook - -var currentHookNameInDev; - -function resolveCurrentlyRenderingComponent() { - if (!(currentlyRenderingComponent !== null)) { - { - throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem." ); - } - } - - { - if (isInHookUserCodeInDev) { - error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks'); - } - } - - return currentlyRenderingComponent; -} - -function areHookInputsEqual(nextDeps, prevDeps) { - if (prevDeps === null) { - { - error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev); - } - - return false; - } - - { - // Don't bother comparing lengths in prod because these arrays should be - // passed inline. - if (nextDeps.length !== prevDeps.length) { - error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + nextDeps.join(', ') + "]", "[" + prevDeps.join(', ') + "]"); - } - } - - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { - if (objectIs(nextDeps[i], prevDeps[i])) { - continue; - } - - return false; - } - - return true; -} - -function createHook() { - if (numberOfReRenders > 0) { - { - { - throw Error( "Rendered more hooks than during the previous render" ); - } - } - } - - return { - memoizedState: null, - queue: null, - next: null - }; -} - -function createWorkInProgressHook() { - if (workInProgressHook === null) { - // This is the first hook in the list - if (firstWorkInProgressHook === null) { - isReRender = false; - firstWorkInProgressHook = workInProgressHook = createHook(); - } else { - // There's already a work-in-progress. Reuse it. - isReRender = true; - workInProgressHook = firstWorkInProgressHook; - } - } else { - if (workInProgressHook.next === null) { - isReRender = false; // Append to the end of the list - - workInProgressHook = workInProgressHook.next = createHook(); - } else { - // There's already a work-in-progress. Reuse it. - isReRender = true; - workInProgressHook = workInProgressHook.next; - } - } - - return workInProgressHook; -} - -function prepareToUseHooks(componentIdentity) { - currentlyRenderingComponent = componentIdentity; - - { - isInHookUserCodeInDev = false; - } // The following should have already been reset - // didScheduleRenderPhaseUpdate = false; - // firstWorkInProgressHook = null; - // numberOfReRenders = 0; - // renderPhaseUpdates = null; - // workInProgressHook = null; - -} -function finishHooks(Component, props, children, refOrContext) { - // This must be called after every function component to prevent hooks from - // being used in classes. - while (didScheduleRenderPhaseUpdate) { - // Updates were scheduled during the render phase. They are stored in - // the `renderPhaseUpdates` map. Call the component again, reusing the - // work-in-progress hooks and applying the additional updates on top. Keep - // restarting until no more updates are scheduled. - didScheduleRenderPhaseUpdate = false; - numberOfReRenders += 1; // Start over from the beginning of the list - - workInProgressHook = null; - children = Component(props, refOrContext); - } - - currentlyRenderingComponent = null; - firstWorkInProgressHook = null; - numberOfReRenders = 0; - renderPhaseUpdates = null; - workInProgressHook = null; - - { - isInHookUserCodeInDev = false; - } // These were reset above - // currentlyRenderingComponent = null; - // didScheduleRenderPhaseUpdate = false; - // firstWorkInProgressHook = null; - // numberOfReRenders = 0; - // renderPhaseUpdates = null; - // workInProgressHook = null; - - - return children; -} - -function readContext(context, observedBits) { - var threadID = currentThreadID; - validateContextBounds(context, threadID); - - { - if (isInHookUserCodeInDev) { - error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); - } - } - - return context[threadID]; -} - -function useContext(context, observedBits) { - { - currentHookNameInDev = 'useContext'; - } - - resolveCurrentlyRenderingComponent(); - var threadID = currentThreadID; - validateContextBounds(context, threadID); - return context[threadID]; -} - -function basicStateReducer(state, action) { - // $FlowFixMe: Flow doesn't like mixed types - return typeof action === 'function' ? action(state) : action; -} - -function useState(initialState) { - { - currentHookNameInDev = 'useState'; - } - - return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers - initialState); -} -function useReducer(reducer, initialArg, init) { - { - if (reducer !== basicStateReducer) { - currentHookNameInDev = 'useReducer'; - } - } - - currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); - workInProgressHook = createWorkInProgressHook(); - - if (isReRender) { - // This is a re-render. Apply the new render phase updates to the previous - // current hook. - var queue = workInProgressHook.queue; - var dispatch = queue.dispatch; - - if (renderPhaseUpdates !== null) { - // Render phase updates are stored in a map of queue -> linked list - var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); - - if (firstRenderPhaseUpdate !== undefined) { - renderPhaseUpdates.delete(queue); - var newState = workInProgressHook.memoizedState; - var update = firstRenderPhaseUpdate; - - do { - // Process this render phase update. We don't have to check the - // priority because it will always be the same as the current - // render's. - var action = update.action; - - { - isInHookUserCodeInDev = true; - } - - newState = reducer(newState, action); - - { - isInHookUserCodeInDev = false; - } - - update = update.next; - } while (update !== null); - - workInProgressHook.memoizedState = newState; - return [newState, dispatch]; - } - } - - return [workInProgressHook.memoizedState, dispatch]; - } else { - { - isInHookUserCodeInDev = true; - } - - var initialState; - - if (reducer === basicStateReducer) { - // Special case for `useState`. - initialState = typeof initialArg === 'function' ? initialArg() : initialArg; - } else { - initialState = init !== undefined ? init(initialArg) : initialArg; - } - - { - isInHookUserCodeInDev = false; - } - - workInProgressHook.memoizedState = initialState; - - var _queue = workInProgressHook.queue = { - last: null, - dispatch: null - }; - - var _dispatch = _queue.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue); - - return [workInProgressHook.memoizedState, _dispatch]; - } -} - -function useMemo(nextCreate, deps) { - currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); - workInProgressHook = createWorkInProgressHook(); - var nextDeps = deps === undefined ? null : deps; - - if (workInProgressHook !== null) { - var prevState = workInProgressHook.memoizedState; - - if (prevState !== null) { - if (nextDeps !== null) { - var prevDeps = prevState[1]; - - if (areHookInputsEqual(nextDeps, prevDeps)) { - return prevState[0]; - } - } - } - } - - { - isInHookUserCodeInDev = true; - } - - var nextValue = nextCreate(); - - { - isInHookUserCodeInDev = false; - } - - workInProgressHook.memoizedState = [nextValue, nextDeps]; - return nextValue; -} - -function useRef(initialValue) { - currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); - workInProgressHook = createWorkInProgressHook(); - var previousRef = workInProgressHook.memoizedState; - - if (previousRef === null) { - var ref = { - current: initialValue - }; - - { - Object.seal(ref); - } - - workInProgressHook.memoizedState = ref; - return ref; - } else { - return previousRef; - } -} - -function useLayoutEffect(create, inputs) { - { - currentHookNameInDev = 'useLayoutEffect'; - - error('useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.'); - } -} - -function dispatchAction(componentIdentity, queue, action) { - if (!(numberOfReRenders < RE_RENDER_LIMIT)) { - { - throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." ); - } - } - - if (componentIdentity === currentlyRenderingComponent) { - // This is a render phase update. Stash it in a lazily-created map of - // queue -> linked list of updates. After this render pass, we'll restart - // and apply the stashed updates on top of the work-in-progress hook. - didScheduleRenderPhaseUpdate = true; - var update = { - action: action, - next: null - }; - - if (renderPhaseUpdates === null) { - renderPhaseUpdates = new Map(); - } - - var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); - - if (firstRenderPhaseUpdate === undefined) { - renderPhaseUpdates.set(queue, update); - } else { - // Append the update to the end of the list. - var lastRenderPhaseUpdate = firstRenderPhaseUpdate; - - while (lastRenderPhaseUpdate.next !== null) { - lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; - } - - lastRenderPhaseUpdate.next = update; - } - } -} - -function useCallback(callback, deps) { - // Callbacks are passed as they are in the server environment. - return callback; -} - -function useResponder(responder, props) { - return { - props: props, - responder: responder - }; -} - -function useDeferredValue(value, config) { - resolveCurrentlyRenderingComponent(); - return value; -} - -function useTransition(config) { - resolveCurrentlyRenderingComponent(); - - var startTransition = function (callback) { - callback(); - }; - - return [startTransition, false]; -} - -function noop() {} - -var currentThreadID = 0; -function setCurrentThreadID(threadID) { - currentThreadID = threadID; -} -var Dispatcher = { - readContext: readContext, - useContext: useContext, - useMemo: useMemo, - useReducer: useReducer, - useRef: useRef, - useState: useState, - useLayoutEffect: useLayoutEffect, - useCallback: useCallback, - // useImperativeHandle is not run in the server environment - useImperativeHandle: noop, - // Effects are not run in the server environment. - useEffect: noop, - // Debugging effect - useDebugValue: noop, - useResponder: useResponder, - useDeferredValue: useDeferredValue, - useTransition: useTransition -}; - -var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; -var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; -var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; -var Namespaces = { - html: HTML_NAMESPACE, - mathml: MATH_NAMESPACE, - svg: SVG_NAMESPACE -}; // Assumes there is no parent namespace. - -function getIntrinsicNamespace(type) { - switch (type) { - case 'svg': - return SVG_NAMESPACE; - - case 'math': - return MATH_NAMESPACE; - - default: - return HTML_NAMESPACE; - } -} -function getChildNamespace(parentNamespace, type) { - if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) { - // No (or default) parent namespace: potential entry point. - return getIntrinsicNamespace(type); - } - - if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') { - // We're leaving SVG. - return HTML_NAMESPACE; - } // By default, pass namespace below. - - - return parentNamespace; -} - -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; - } - - 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`.'); - } - }; - /** - * Provide a linked `value` attribute for controlled forms. You should not use - * this outside of the ReactDOM controlled form components. - */ - - ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { - checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); - }; -} - -// For HTML, certain tags should omit their close tag. We keep a whitelist for -// those special-case tags. -var omittedCloseTags = { - area: true, - base: true, - br: true, - col: true, - embed: true, - hr: true, - img: true, - input: true, - keygen: true, - link: true, - meta: true, - param: true, - source: true, - track: true, - wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems. - -}; - -// `omittedCloseTags` except that `menuitem` should still have its closing tag. - -var voidElementTags = _assign({ - menuitem: true -}, omittedCloseTags); - -var HTML = '__html'; -var ReactDebugCurrentFrame$3 = null; - -{ - ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame; -} - -function assertValidProps(tag, props) { - if (!props) { - return; - } // Note the use of `==` which checks for null or undefined. - - - if (voidElementTags[tag]) { - if (!(props.children == null && props.dangerouslySetInnerHTML == null)) { - { - throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) ); - } - } - } - - if (props.dangerouslySetInnerHTML != null) { - if (!(props.children == null)) { - { - throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." ); - } - } - - if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) { - { - throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information." ); - } - } - } - - { - if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) { - error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.'); - } - } - - if (!(props.style == null || typeof props.style === 'object')) { - { - throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) ); - } - } -} - -/** - * CSS properties which accept numbers but are not in units of "px". - */ -var isUnitlessNumber = { - animationIterationCount: true, - borderImageOutset: true, - borderImageSlice: true, - borderImageWidth: true, - boxFlex: true, - boxFlexGroup: true, - boxOrdinalGroup: true, - columnCount: true, - columns: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - flexOrder: true, - gridArea: true, - gridRow: true, - gridRowEnd: true, - gridRowSpan: true, - gridRowStart: true, - gridColumn: true, - gridColumnEnd: true, - gridColumnSpan: true, - gridColumnStart: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - tabSize: true, - widows: true, - zIndex: true, - zoom: true, - // SVG-related properties - fillOpacity: true, - floodOpacity: true, - stopOpacity: true, - strokeDasharray: true, - strokeDashoffset: true, - strokeMiterlimit: true, - strokeOpacity: true, - strokeWidth: true -}; -/** - * @param {string} prefix vendor-specific prefix, eg: Webkit - * @param {string} key style name, eg: transitionDuration - * @return {string} style name prefixed with `prefix`, properly camelCased, eg: - * WebkitTransitionDuration - */ - -function prefixKey(prefix, key) { - return prefix + key.charAt(0).toUpperCase() + key.substring(1); -} -/** - * Support style names that may come passed in prefixed by adding permutations - * of vendor prefixes. - */ - - -var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an -// infinite loop, because it iterates over the newly added props too. - -Object.keys(isUnitlessNumber).forEach(function (prop) { - prefixes.forEach(function (prefix) { - isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; - }); -}); - -/** - * Convert a value into the proper css writable value. The style name `name` - * should be logical (no hyphens), as specified - * in `CSSProperty.isUnitlessNumber`. - * - * @param {string} name CSS property name such as `topMargin`. - * @param {*} value CSS property value such as `10px`. - * @return {string} Normalized style value with dimensions applied. - */ - -function dangerousStyleValue(name, value, isCustomProperty) { - // Note that we've removed escapeTextForBrowser() calls here since the - // whole string will be escaped when the attribute is injected into - // the markup. If you provide unsafe user data here they can inject - // arbitrary CSS which may be problematic (I couldn't repro this): - // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet - // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ - // This is not an XSS hole but instead a potential CSS injection issue - // which has lead to a greater discussion about how we're going to - // trust URLs moving forward. See #2115901 - var isEmpty = value == null || typeof value === 'boolean' || value === ''; - - if (isEmpty) { - return ''; - } - - if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) { - return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers - } - - return ('' + value).trim(); -} - -var uppercasePattern = /([A-Z])/g; -var msPattern = /^ms-/; -/** - * Hyphenates a camelcased CSS property name, for example: - * - * > hyphenateStyleName('backgroundColor') - * < "background-color" - * > hyphenateStyleName('MozTransition') - * < "-moz-transition" - * > hyphenateStyleName('msTransition') - * < "-ms-transition" - * - * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix - * is converted to `-ms-`. - */ - -function hyphenateStyleName(name) { - return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); -} - -function isCustomComponent(tagName, props) { - if (tagName.indexOf('-') === -1) { - return typeof props.is === 'string'; - } - - switch (tagName) { - // These are reserved SVG and MathML elements. - // We don't mind this whitelist too much because we expect it to never grow. - // The alternative is to track the namespace in a few places which is convoluted. - // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts - case 'annotation-xml': - case 'color-profile': - case 'font-face': - case 'font-face-src': - case 'font-face-uri': - case 'font-face-format': - case 'font-face-name': - case 'missing-glyph': - return false; - - default: - return true; - } -} - -var warnValidStyle = function () {}; - -{ - // 'msTransform' is correct, but the other prefixes should be capitalized - var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; - var msPattern$1 = /^-ms-/; - var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon - - var badStyleValueWithSemicolonPattern = /;\s*$/; - var warnedStyleNames = {}; - var warnedStyleValues = {}; - var warnedForNaNValue = false; - var warnedForInfinityValue = false; - - var camelize = function (string) { - return string.replace(hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); - }; - - var warnHyphenatedStyleName = function (name) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - - error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests - // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix - // is converted to lowercase `ms`. - camelize(name.replace(msPattern$1, 'ms-'))); - }; - - var warnBadVendoredStyleName = function (name) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - - error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); - }; - - var warnStyleValueWithSemicolon = function (name, value) { - if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { - return; - } - - warnedStyleValues[value] = true; - - error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); - }; - - var warnStyleValueIsNaN = function (name, value) { - if (warnedForNaNValue) { - return; - } - - warnedForNaNValue = true; - - error('`NaN` is an invalid value for the `%s` css style property.', name); - }; - - var warnStyleValueIsInfinity = function (name, value) { - if (warnedForInfinityValue) { - return; - } - - warnedForInfinityValue = true; - - error('`Infinity` is an invalid value for the `%s` css style property.', name); - }; - - warnValidStyle = function (name, value) { - if (name.indexOf('-') > -1) { - warnHyphenatedStyleName(name); - } else if (badVendoredStyleNamePattern.test(name)) { - warnBadVendoredStyleName(name); - } else if (badStyleValueWithSemicolonPattern.test(value)) { - warnStyleValueWithSemicolon(name, value); - } - - if (typeof value === 'number') { - if (isNaN(value)) { - warnStyleValueIsNaN(name, value); - } else if (!isFinite(value)) { - warnStyleValueIsInfinity(name, value); - } - } - }; -} - -var warnValidStyle$1 = warnValidStyle; - -var ariaProperties = { - 'aria-current': 0, - // state - 'aria-details': 0, - 'aria-disabled': 0, - // state - 'aria-hidden': 0, - // state - 'aria-invalid': 0, - // state - 'aria-keyshortcuts': 0, - 'aria-label': 0, - 'aria-roledescription': 0, - // Widget Attributes - 'aria-autocomplete': 0, - 'aria-checked': 0, - 'aria-expanded': 0, - 'aria-haspopup': 0, - 'aria-level': 0, - 'aria-modal': 0, - 'aria-multiline': 0, - 'aria-multiselectable': 0, - 'aria-orientation': 0, - 'aria-placeholder': 0, - 'aria-pressed': 0, - 'aria-readonly': 0, - 'aria-required': 0, - 'aria-selected': 0, - 'aria-sort': 0, - 'aria-valuemax': 0, - 'aria-valuemin': 0, - 'aria-valuenow': 0, - 'aria-valuetext': 0, - // Live Region Attributes - 'aria-atomic': 0, - 'aria-busy': 0, - 'aria-live': 0, - 'aria-relevant': 0, - // Drag-and-Drop Attributes - 'aria-dropeffect': 0, - 'aria-grabbed': 0, - // Relationship Attributes - 'aria-activedescendant': 0, - 'aria-colcount': 0, - 'aria-colindex': 0, - 'aria-colspan': 0, - 'aria-controls': 0, - 'aria-describedby': 0, - 'aria-errormessage': 0, - 'aria-flowto': 0, - 'aria-labelledby': 0, - 'aria-owns': 0, - 'aria-posinset': 0, - 'aria-rowcount': 0, - 'aria-rowindex': 0, - 'aria-rowspan': 0, - 'aria-setsize': 0 -}; - -var warnedProperties = {}; -var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); -var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); -var hasOwnProperty$1 = Object.prototype.hasOwnProperty; - -function validateProperty(tagName, name) { - { - if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) { - return true; - } - - if (rARIACamel.test(name)) { - var ariaName = 'aria-' + name.slice(4).toLowerCase(); - var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - - if (correctName == null) { - error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); - - warnedProperties[name] = true; - return true; - } // aria-* attributes should be lowercase; suggest the lowercase version. - - - if (name !== correctName) { - error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); - - warnedProperties[name] = true; - return true; - } - } - - if (rARIA.test(name)) { - var lowerCasedName = name.toLowerCase(); - var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - - if (standardName == null) { - warnedProperties[name] = true; - return false; - } // aria-* attributes should be lowercase; suggest the lowercase version. - - - if (name !== standardName) { - error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); - - warnedProperties[name] = true; - return true; - } - } - } - - return true; -} - -function warnInvalidARIAProps(type, props) { - { - var invalidProps = []; - - for (var key in props) { - var isValid = validateProperty(type, key); - - if (!isValid) { - invalidProps.push(key); - } - } - - var unknownPropString = invalidProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (invalidProps.length === 1) { - error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); - } else if (invalidProps.length > 1) { - error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); - } - } -} - -function validateProperties(type, props) { - if (isCustomComponent(type, props)) { - return; - } - - warnInvalidARIAProps(type, props); -} - -var didWarnValueNull = false; -function validateProperties$1(type, props) { - { - if (type !== 'input' && type !== 'textarea' && type !== 'select') { - return; - } - - if (props != null && props.value === null && !didWarnValueNull) { - didWarnValueNull = true; - - if (type === 'select' && props.multiple) { - error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type); - } else { - error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); - } - } - } -} - -/** - * Mapping from registration name to plugin module - */ - -var registrationNameModules = {}; -/** - * 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 possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true - -// When adding attributes to the HTML or SVG whitelist, be sure to -// also add them to this module to ensure casing and incorrect name -// warnings. -var possibleStandardNames = { - // HTML - accept: 'accept', - acceptcharset: 'acceptCharset', - 'accept-charset': 'acceptCharset', - accesskey: 'accessKey', - action: 'action', - allowfullscreen: 'allowFullScreen', - alt: 'alt', - as: 'as', - async: 'async', - autocapitalize: 'autoCapitalize', - autocomplete: 'autoComplete', - autocorrect: 'autoCorrect', - autofocus: 'autoFocus', - autoplay: 'autoPlay', - autosave: 'autoSave', - capture: 'capture', - cellpadding: 'cellPadding', - cellspacing: 'cellSpacing', - challenge: 'challenge', - charset: 'charSet', - checked: 'checked', - children: 'children', - cite: 'cite', - class: 'className', - classid: 'classID', - classname: 'className', - cols: 'cols', - colspan: 'colSpan', - content: 'content', - contenteditable: 'contentEditable', - contextmenu: 'contextMenu', - controls: 'controls', - controlslist: 'controlsList', - coords: 'coords', - crossorigin: 'crossOrigin', - dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', - data: 'data', - datetime: 'dateTime', - default: 'default', - defaultchecked: 'defaultChecked', - defaultvalue: 'defaultValue', - defer: 'defer', - dir: 'dir', - disabled: 'disabled', - disablepictureinpicture: 'disablePictureInPicture', - download: 'download', - draggable: 'draggable', - enctype: 'encType', - for: 'htmlFor', - form: 'form', - formmethod: 'formMethod', - formaction: 'formAction', - formenctype: 'formEncType', - formnovalidate: 'formNoValidate', - formtarget: 'formTarget', - frameborder: 'frameBorder', - headers: 'headers', - height: 'height', - hidden: 'hidden', - high: 'high', - href: 'href', - hreflang: 'hrefLang', - htmlfor: 'htmlFor', - httpequiv: 'httpEquiv', - 'http-equiv': 'httpEquiv', - icon: 'icon', - id: 'id', - innerhtml: 'innerHTML', - inputmode: 'inputMode', - integrity: 'integrity', - is: 'is', - itemid: 'itemID', - itemprop: 'itemProp', - itemref: 'itemRef', - itemscope: 'itemScope', - itemtype: 'itemType', - keyparams: 'keyParams', - keytype: 'keyType', - kind: 'kind', - label: 'label', - lang: 'lang', - list: 'list', - loop: 'loop', - low: 'low', - manifest: 'manifest', - marginwidth: 'marginWidth', - marginheight: 'marginHeight', - max: 'max', - maxlength: 'maxLength', - media: 'media', - mediagroup: 'mediaGroup', - method: 'method', - min: 'min', - minlength: 'minLength', - multiple: 'multiple', - muted: 'muted', - name: 'name', - nomodule: 'noModule', - nonce: 'nonce', - novalidate: 'noValidate', - open: 'open', - optimum: 'optimum', - pattern: 'pattern', - placeholder: 'placeholder', - playsinline: 'playsInline', - poster: 'poster', - preload: 'preload', - profile: 'profile', - radiogroup: 'radioGroup', - readonly: 'readOnly', - referrerpolicy: 'referrerPolicy', - rel: 'rel', - required: 'required', - reversed: 'reversed', - role: 'role', - rows: 'rows', - rowspan: 'rowSpan', - sandbox: 'sandbox', - scope: 'scope', - scoped: 'scoped', - scrolling: 'scrolling', - seamless: 'seamless', - selected: 'selected', - shape: 'shape', - size: 'size', - sizes: 'sizes', - span: 'span', - spellcheck: 'spellCheck', - src: 'src', - srcdoc: 'srcDoc', - srclang: 'srcLang', - srcset: 'srcSet', - start: 'start', - step: 'step', - style: 'style', - summary: 'summary', - tabindex: 'tabIndex', - target: 'target', - title: 'title', - type: 'type', - usemap: 'useMap', - value: 'value', - width: 'width', - wmode: 'wmode', - wrap: 'wrap', - // SVG - about: 'about', - accentheight: 'accentHeight', - 'accent-height': 'accentHeight', - accumulate: 'accumulate', - additive: 'additive', - alignmentbaseline: 'alignmentBaseline', - 'alignment-baseline': 'alignmentBaseline', - allowreorder: 'allowReorder', - alphabetic: 'alphabetic', - amplitude: 'amplitude', - arabicform: 'arabicForm', - 'arabic-form': 'arabicForm', - ascent: 'ascent', - attributename: 'attributeName', - attributetype: 'attributeType', - autoreverse: 'autoReverse', - azimuth: 'azimuth', - basefrequency: 'baseFrequency', - baselineshift: 'baselineShift', - 'baseline-shift': 'baselineShift', - baseprofile: 'baseProfile', - bbox: 'bbox', - begin: 'begin', - bias: 'bias', - by: 'by', - calcmode: 'calcMode', - capheight: 'capHeight', - 'cap-height': 'capHeight', - clip: 'clip', - clippath: 'clipPath', - 'clip-path': 'clipPath', - clippathunits: 'clipPathUnits', - cliprule: 'clipRule', - 'clip-rule': 'clipRule', - color: 'color', - colorinterpolation: 'colorInterpolation', - 'color-interpolation': 'colorInterpolation', - colorinterpolationfilters: 'colorInterpolationFilters', - 'color-interpolation-filters': 'colorInterpolationFilters', - colorprofile: 'colorProfile', - 'color-profile': 'colorProfile', - colorrendering: 'colorRendering', - 'color-rendering': 'colorRendering', - contentscripttype: 'contentScriptType', - contentstyletype: 'contentStyleType', - cursor: 'cursor', - cx: 'cx', - cy: 'cy', - d: 'd', - datatype: 'datatype', - decelerate: 'decelerate', - descent: 'descent', - diffuseconstant: 'diffuseConstant', - direction: 'direction', - display: 'display', - divisor: 'divisor', - dominantbaseline: 'dominantBaseline', - 'dominant-baseline': 'dominantBaseline', - dur: 'dur', - dx: 'dx', - dy: 'dy', - edgemode: 'edgeMode', - elevation: 'elevation', - enablebackground: 'enableBackground', - 'enable-background': 'enableBackground', - end: 'end', - exponent: 'exponent', - externalresourcesrequired: 'externalResourcesRequired', - fill: 'fill', - fillopacity: 'fillOpacity', - 'fill-opacity': 'fillOpacity', - fillrule: 'fillRule', - 'fill-rule': 'fillRule', - filter: 'filter', - filterres: 'filterRes', - filterunits: 'filterUnits', - floodopacity: 'floodOpacity', - 'flood-opacity': 'floodOpacity', - floodcolor: 'floodColor', - 'flood-color': 'floodColor', - focusable: 'focusable', - fontfamily: 'fontFamily', - 'font-family': 'fontFamily', - fontsize: 'fontSize', - 'font-size': 'fontSize', - fontsizeadjust: 'fontSizeAdjust', - 'font-size-adjust': 'fontSizeAdjust', - fontstretch: 'fontStretch', - 'font-stretch': 'fontStretch', - fontstyle: 'fontStyle', - 'font-style': 'fontStyle', - fontvariant: 'fontVariant', - 'font-variant': 'fontVariant', - fontweight: 'fontWeight', - 'font-weight': 'fontWeight', - format: 'format', - from: 'from', - fx: 'fx', - fy: 'fy', - g1: 'g1', - g2: 'g2', - glyphname: 'glyphName', - 'glyph-name': 'glyphName', - glyphorientationhorizontal: 'glyphOrientationHorizontal', - 'glyph-orientation-horizontal': 'glyphOrientationHorizontal', - glyphorientationvertical: 'glyphOrientationVertical', - 'glyph-orientation-vertical': 'glyphOrientationVertical', - glyphref: 'glyphRef', - gradienttransform: 'gradientTransform', - gradientunits: 'gradientUnits', - hanging: 'hanging', - horizadvx: 'horizAdvX', - 'horiz-adv-x': 'horizAdvX', - horizoriginx: 'horizOriginX', - 'horiz-origin-x': 'horizOriginX', - ideographic: 'ideographic', - imagerendering: 'imageRendering', - 'image-rendering': 'imageRendering', - in2: 'in2', - in: 'in', - inlist: 'inlist', - intercept: 'intercept', - k1: 'k1', - k2: 'k2', - k3: 'k3', - k4: 'k4', - k: 'k', - kernelmatrix: 'kernelMatrix', - kernelunitlength: 'kernelUnitLength', - kerning: 'kerning', - keypoints: 'keyPoints', - keysplines: 'keySplines', - keytimes: 'keyTimes', - lengthadjust: 'lengthAdjust', - letterspacing: 'letterSpacing', - 'letter-spacing': 'letterSpacing', - lightingcolor: 'lightingColor', - 'lighting-color': 'lightingColor', - limitingconeangle: 'limitingConeAngle', - local: 'local', - markerend: 'markerEnd', - 'marker-end': 'markerEnd', - markerheight: 'markerHeight', - markermid: 'markerMid', - 'marker-mid': 'markerMid', - markerstart: 'markerStart', - 'marker-start': 'markerStart', - markerunits: 'markerUnits', - markerwidth: 'markerWidth', - mask: 'mask', - maskcontentunits: 'maskContentUnits', - maskunits: 'maskUnits', - mathematical: 'mathematical', - mode: 'mode', - numoctaves: 'numOctaves', - offset: 'offset', - opacity: 'opacity', - operator: 'operator', - order: 'order', - orient: 'orient', - orientation: 'orientation', - origin: 'origin', - overflow: 'overflow', - overlineposition: 'overlinePosition', - 'overline-position': 'overlinePosition', - overlinethickness: 'overlineThickness', - 'overline-thickness': 'overlineThickness', - paintorder: 'paintOrder', - 'paint-order': 'paintOrder', - panose1: 'panose1', - 'panose-1': 'panose1', - pathlength: 'pathLength', - patterncontentunits: 'patternContentUnits', - patterntransform: 'patternTransform', - patternunits: 'patternUnits', - pointerevents: 'pointerEvents', - 'pointer-events': 'pointerEvents', - points: 'points', - pointsatx: 'pointsAtX', - pointsaty: 'pointsAtY', - pointsatz: 'pointsAtZ', - prefix: 'prefix', - preservealpha: 'preserveAlpha', - preserveaspectratio: 'preserveAspectRatio', - primitiveunits: 'primitiveUnits', - property: 'property', - r: 'r', - radius: 'radius', - refx: 'refX', - refy: 'refY', - renderingintent: 'renderingIntent', - 'rendering-intent': 'renderingIntent', - repeatcount: 'repeatCount', - repeatdur: 'repeatDur', - requiredextensions: 'requiredExtensions', - requiredfeatures: 'requiredFeatures', - resource: 'resource', - restart: 'restart', - result: 'result', - results: 'results', - rotate: 'rotate', - rx: 'rx', - ry: 'ry', - scale: 'scale', - security: 'security', - seed: 'seed', - shaperendering: 'shapeRendering', - 'shape-rendering': 'shapeRendering', - slope: 'slope', - spacing: 'spacing', - specularconstant: 'specularConstant', - specularexponent: 'specularExponent', - speed: 'speed', - spreadmethod: 'spreadMethod', - startoffset: 'startOffset', - stddeviation: 'stdDeviation', - stemh: 'stemh', - stemv: 'stemv', - stitchtiles: 'stitchTiles', - stopcolor: 'stopColor', - 'stop-color': 'stopColor', - stopopacity: 'stopOpacity', - 'stop-opacity': 'stopOpacity', - strikethroughposition: 'strikethroughPosition', - 'strikethrough-position': 'strikethroughPosition', - strikethroughthickness: 'strikethroughThickness', - 'strikethrough-thickness': 'strikethroughThickness', - string: 'string', - stroke: 'stroke', - strokedasharray: 'strokeDasharray', - 'stroke-dasharray': 'strokeDasharray', - strokedashoffset: 'strokeDashoffset', - 'stroke-dashoffset': 'strokeDashoffset', - strokelinecap: 'strokeLinecap', - 'stroke-linecap': 'strokeLinecap', - strokelinejoin: 'strokeLinejoin', - 'stroke-linejoin': 'strokeLinejoin', - strokemiterlimit: 'strokeMiterlimit', - 'stroke-miterlimit': 'strokeMiterlimit', - strokewidth: 'strokeWidth', - 'stroke-width': 'strokeWidth', - strokeopacity: 'strokeOpacity', - 'stroke-opacity': 'strokeOpacity', - suppresscontenteditablewarning: 'suppressContentEditableWarning', - suppresshydrationwarning: 'suppressHydrationWarning', - surfacescale: 'surfaceScale', - systemlanguage: 'systemLanguage', - tablevalues: 'tableValues', - targetx: 'targetX', - targety: 'targetY', - textanchor: 'textAnchor', - 'text-anchor': 'textAnchor', - textdecoration: 'textDecoration', - 'text-decoration': 'textDecoration', - textlength: 'textLength', - textrendering: 'textRendering', - 'text-rendering': 'textRendering', - to: 'to', - transform: 'transform', - typeof: 'typeof', - u1: 'u1', - u2: 'u2', - underlineposition: 'underlinePosition', - 'underline-position': 'underlinePosition', - underlinethickness: 'underlineThickness', - 'underline-thickness': 'underlineThickness', - unicode: 'unicode', - unicodebidi: 'unicodeBidi', - 'unicode-bidi': 'unicodeBidi', - unicoderange: 'unicodeRange', - 'unicode-range': 'unicodeRange', - unitsperem: 'unitsPerEm', - 'units-per-em': 'unitsPerEm', - unselectable: 'unselectable', - valphabetic: 'vAlphabetic', - 'v-alphabetic': 'vAlphabetic', - values: 'values', - vectoreffect: 'vectorEffect', - 'vector-effect': 'vectorEffect', - version: 'version', - vertadvy: 'vertAdvY', - 'vert-adv-y': 'vertAdvY', - vertoriginx: 'vertOriginX', - 'vert-origin-x': 'vertOriginX', - vertoriginy: 'vertOriginY', - 'vert-origin-y': 'vertOriginY', - vhanging: 'vHanging', - 'v-hanging': 'vHanging', - videographic: 'vIdeographic', - 'v-ideographic': 'vIdeographic', - viewbox: 'viewBox', - viewtarget: 'viewTarget', - visibility: 'visibility', - vmathematical: 'vMathematical', - 'v-mathematical': 'vMathematical', - vocab: 'vocab', - widths: 'widths', - wordspacing: 'wordSpacing', - 'word-spacing': 'wordSpacing', - writingmode: 'writingMode', - 'writing-mode': 'writingMode', - x1: 'x1', - x2: 'x2', - x: 'x', - xchannelselector: 'xChannelSelector', - xheight: 'xHeight', - 'x-height': 'xHeight', - xlinkactuate: 'xlinkActuate', - 'xlink:actuate': 'xlinkActuate', - xlinkarcrole: 'xlinkArcrole', - 'xlink:arcrole': 'xlinkArcrole', - xlinkhref: 'xlinkHref', - 'xlink:href': 'xlinkHref', - xlinkrole: 'xlinkRole', - 'xlink:role': 'xlinkRole', - xlinkshow: 'xlinkShow', - 'xlink:show': 'xlinkShow', - xlinktitle: 'xlinkTitle', - 'xlink:title': 'xlinkTitle', - xlinktype: 'xlinkType', - 'xlink:type': 'xlinkType', - xmlbase: 'xmlBase', - 'xml:base': 'xmlBase', - xmllang: 'xmlLang', - 'xml:lang': 'xmlLang', - xmlns: 'xmlns', - 'xml:space': 'xmlSpace', - xmlnsxlink: 'xmlnsXlink', - 'xmlns:xlink': 'xmlnsXlink', - xmlspace: 'xmlSpace', - y1: 'y1', - y2: 'y2', - y: 'y', - ychannelselector: 'yChannelSelector', - z: 'z', - zoomandpan: 'zoomAndPan' -}; - -var validateProperty$1 = function () {}; - -{ - var warnedProperties$1 = {}; - var _hasOwnProperty = Object.prototype.hasOwnProperty; - var EVENT_NAME_REGEX = /^on./; - var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; - var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); - var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); - - validateProperty$1 = function (tagName, name, value, canUseEventSystem) { - if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) { - return true; - } - - var lowerCasedName = name.toLowerCase(); - - if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { - error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.'); - - warnedProperties$1[name] = true; - return true; - } // We can't rely on the event system being injected on the server. - - - if (canUseEventSystem) { - if (registrationNameModules.hasOwnProperty(name)) { - return true; - } - - var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; - - if (registrationName != null) { - error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); - - warnedProperties$1[name] = true; - return true; - } - - if (EVENT_NAME_REGEX.test(name)) { - error('Unknown event handler property `%s`. It will be ignored.', name); - - warnedProperties$1[name] = true; - return true; - } - } else if (EVENT_NAME_REGEX.test(name)) { - // If no event plugins have been injected, we are in a server environment. - // So we can't tell if the event name is correct for sure, but we can filter - // out known bad ones like `onclick`. We can't suggest a specific replacement though. - if (INVALID_EVENT_NAME_REGEX.test(name)) { - error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); - } - - warnedProperties$1[name] = true; - return true; - } // Let the ARIA attribute hook validate ARIA attributes - - - if (rARIA$1.test(name) || rARIACamel$1.test(name)) { - return true; - } - - if (lowerCasedName === 'innerhtml') { - error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); - - warnedProperties$1[name] = true; - return true; - } - - if (lowerCasedName === 'aria') { - error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); - - warnedProperties$1[name] = true; - return true; - } - - if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') { - error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); - - warnedProperties$1[name] = true; - return true; - } - - if (typeof value === 'number' && isNaN(value)) { - error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); - - warnedProperties$1[name] = true; - return true; - } - - var propertyInfo = getPropertyInfo(name); - var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config. - - if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { - var standardName = possibleStandardNames[lowerCasedName]; - - if (standardName !== name) { - error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); - - warnedProperties$1[name] = true; - return true; - } - } else if (!isReserved && name !== lowerCasedName) { - // Unknown attributes should have lowercase casing since that's how they - // will be cased anyway with server rendering. - error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName); - - warnedProperties$1[name] = true; - return true; - } - - if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { - if (value) { - error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name); - } else { - error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name); - } - - warnedProperties$1[name] = true; - return true; - } // Now that we've validated casing, do not validate - // data types for reserved props - - - if (isReserved) { - return true; - } // Warn when a known attribute is a bad type - - - if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { - warnedProperties$1[name] = true; - return false; - } // Warn when passing the strings 'false' or 'true' into a boolean prop - - - if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) { - error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value); - - warnedProperties$1[name] = true; - return true; - } - - return true; - }; -} - -var warnUnknownProperties = function (type, props, canUseEventSystem) { - { - var unknownProps = []; - - for (var key in props) { - var isValid = validateProperty$1(type, key, props[key], canUseEventSystem); - - if (!isValid) { - unknownProps.push(key); - } - } - - var unknownPropString = unknownProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (unknownProps.length === 1) { - error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type); - } else if (unknownProps.length > 1) { - error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type); - } - } -}; - -function validateProperties$2(type, props, canUseEventSystem) { - if (isCustomComponent(type, props)) { - return; - } - - warnUnknownProperties(type, props, canUseEventSystem); -} - -var toArray = React.Children.toArray; // This is only used in DEV. -// Each entry is `this.stack` from a currently executing renderer instance. -// (There may be more than one because ReactDOMServer is reentrant). -// Each stack is an array of frames which may contain nested stacks of elements. - -var currentDebugStacks = []; -var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; -var ReactDebugCurrentFrame$4; -var prevGetCurrentStackImpl = null; - -var getCurrentServerStackImpl = function () { - return ''; -}; - -var describeStackFrame = function (element) { - return ''; -}; - -var validatePropertiesInDevelopment = function (type, props) {}; - -var pushCurrentDebugStack = function (stack) {}; - -var pushElementToDebugStack = function (element) {}; - -var popCurrentDebugStack = function () {}; - -var hasWarnedAboutUsingContextAsConsumer = false; - -{ - ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame; - - validatePropertiesInDevelopment = function (type, props) { - validateProperties(type, props); - validateProperties$1(type, props); - validateProperties$2(type, props, - /* canUseEventSystem */ - false); - }; - - describeStackFrame = function (element) { - var source = element._source; - var type = element.type; - var name = getComponentName(type); - var ownerName = null; - return describeComponentFrame(name, source, ownerName); - }; - - pushCurrentDebugStack = function (stack) { - currentDebugStacks.push(stack); - - if (currentDebugStacks.length === 1) { - // We are entering a server renderer. - // Remember the previous (e.g. client) global stack implementation. - prevGetCurrentStackImpl = ReactDebugCurrentFrame$4.getCurrentStack; - ReactDebugCurrentFrame$4.getCurrentStack = getCurrentServerStackImpl; - } - }; - - pushElementToDebugStack = function (element) { - // For the innermost executing ReactDOMServer call, - var stack = currentDebugStacks[currentDebugStacks.length - 1]; // Take the innermost executing frame (e.g. ), - - var frame = stack[stack.length - 1]; // and record that it has one more element associated with it. - - frame.debugElementStack.push(element); // We only need this because we tail-optimize single-element - // children and directly handle them in an inner loop instead of - // creating separate frames for them. - }; - - popCurrentDebugStack = function () { - currentDebugStacks.pop(); - - if (currentDebugStacks.length === 0) { - // We are exiting the server renderer. - // Restore the previous (e.g. client) global stack implementation. - ReactDebugCurrentFrame$4.getCurrentStack = prevGetCurrentStackImpl; - prevGetCurrentStackImpl = null; - } - }; - - getCurrentServerStackImpl = function () { - if (currentDebugStacks.length === 0) { - // Nothing is currently rendering. - return ''; - } // ReactDOMServer is reentrant so there may be multiple calls at the same time. - // Take the frames from the innermost call which is the last in the array. - - - var frames = currentDebugStacks[currentDebugStacks.length - 1]; - var stack = ''; // Go through every frame in the stack from the innermost one. - - for (var i = frames.length - 1; i >= 0; i--) { - var frame = frames[i]; // Every frame might have more than one debug element stack entry associated with it. - // This is because single-child nesting doesn't create materialized frames. - // Instead it would push them through `pushElementToDebugStack()`. - - var debugElementStack = frame.debugElementStack; - - for (var ii = debugElementStack.length - 1; ii >= 0; ii--) { - stack += describeStackFrame(debugElementStack[ii]); - } - } - - return stack; - }; -} - -var didWarnDefaultInputValue = false; -var didWarnDefaultChecked = false; -var didWarnDefaultSelectValue = false; -var didWarnDefaultTextareaValue = false; -var didWarnInvalidOptionChildren = false; -var didWarnAboutNoopUpdateForComponent = {}; -var didWarnAboutBadClass = {}; -var didWarnAboutModulePatternComponent = {}; -var didWarnAboutDeprecatedWillMount = {}; -var didWarnAboutUndefinedDerivedState = {}; -var didWarnAboutUninitializedState = {}; -var valuePropNames = ['value', 'defaultValue']; -var newlineEatingTags = { - listing: true, - pre: true, - textarea: true -}; // We accept any tag to be rendered but since this gets injected into arbitrary -// HTML, we want to make sure that it's a safe tag. -// http://www.w3.org/TR/REC-xml/#NT-Name - -var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset - -var validatedTagCache = {}; - -function validateDangerousTag(tag) { - if (!validatedTagCache.hasOwnProperty(tag)) { - if (!VALID_TAG_REGEX.test(tag)) { - { - throw Error( "Invalid tag: " + tag ); - } - } - - validatedTagCache[tag] = true; - } -} - -var styleNameCache = {}; - -var processStyleName = function (styleName) { - if (styleNameCache.hasOwnProperty(styleName)) { - return styleNameCache[styleName]; - } - - var result = hyphenateStyleName(styleName); - styleNameCache[styleName] = result; - return result; -}; - -function createMarkupForStyles(styles) { - var serialized = ''; - var delimiter = ''; - - for (var styleName in styles) { - if (!styles.hasOwnProperty(styleName)) { - continue; - } - - var isCustomProperty = styleName.indexOf('--') === 0; - var styleValue = styles[styleName]; - - { - if (!isCustomProperty) { - warnValidStyle$1(styleName, styleValue); - } - } - - if (styleValue != null) { - serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':'; - serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty); - delimiter = ';'; - } - } - - return serialized || null; -} - -function warnNoop(publicInstance, callerName) { - { - var _constructor = publicInstance.constructor; - var componentName = _constructor && getComponentName(_constructor) || 'ReactClass'; - var warningKey = componentName + '.' + callerName; - - if (didWarnAboutNoopUpdateForComponent[warningKey]) { - return; - } - - error('%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName); - - didWarnAboutNoopUpdateForComponent[warningKey] = true; - } -} - -function shouldConstruct(Component) { - return Component.prototype && Component.prototype.isReactComponent; -} - -function getNonChildrenInnerMarkup(props) { - var innerHTML = props.dangerouslySetInnerHTML; - - if (innerHTML != null) { - if (innerHTML.__html != null) { - return innerHTML.__html; - } - } else { - var content = props.children; - - if (typeof content === 'string' || typeof content === 'number') { - return escapeTextForBrowser(content); - } - } - - return null; -} - -function flattenTopLevelChildren(children) { - if (!React.isValidElement(children)) { - return toArray(children); - } - - var element = children; - - if (element.type !== REACT_FRAGMENT_TYPE) { - return [element]; - } - - var fragmentChildren = element.props.children; - - if (!React.isValidElement(fragmentChildren)) { - return toArray(fragmentChildren); - } - - var fragmentChildElement = fragmentChildren; - return [fragmentChildElement]; -} - -function flattenOptionChildren(children) { - if (children === undefined || children === null) { - return children; - } - - var content = ''; // Flatten children and warn if they aren't strings or numbers; - // invalid types are ignored. - - React.Children.forEach(children, function (child) { - if (child == null) { - return; - } - - content += child; - - { - if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') { - didWarnInvalidOptionChildren = true; - - error('Only strings and numbers are supported as