diff --git a/.editorconfig b/.editorconfig index d7ea4c8..60411d1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,7 +10,8 @@ trim_trailing_whitespace = true [*.md] indent_style = space insert_final_newline = false +indent_size = 4 -[package.json] +[{*.yaml,*.yml,package.json}] indent_style = space indent_size = 2 diff --git a/.eslintignore b/.eslintignore index f900da5..501e4c1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,4 @@ node_modules dist coverage -example -docs +styleguide diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 45758a1..feb90ba 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,4 +8,4 @@ updates: - package-ecosystem: "npm" directory: "/" # Location of package manifests schedule: - interval: "daily" + interval: "weekly" diff --git a/.github/workflows/push.yml b/.github/workflows/coverage.yml similarity index 51% rename from .github/workflows/push.yml rename to .github/workflows/coverage.yml index 6376112..4d47ddc 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: Lint and test +name: Coverage on: push: @@ -8,37 +8,14 @@ on: - '**.md' branches: - main - pull_request: jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 16 - - run: npm ci - - run: npm run lint - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@master - with: - node-version: 16 - - run: npm ci - - run: npm run test:ci coverage: - needs: [ test ] - if: github.ref == 'refs/heads/main' name: Sending test coverage to Code Climate runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: 16 - run: npm ci diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..5385327 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,26 @@ +name: Publish documentation + +on: + workflow_call: + inputs: + targetFolder: + required: true + type: string + +jobs: + docs: + name: Build & publish documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm ci + - run: npm run build:docs + - uses: JamesIves/github-pages-deploy-action@4.1.5 + with: + branch: docs + folder: styleguide + target-folder: ${{ inputs.targetFolder }} + git-config-name: github-pages-deploy-action diff --git a/.github/workflows/release.yml b/.github/workflows/publish.yml similarity index 70% rename from .github/workflows/release.yml rename to .github/workflows/publish.yml index 4b78d94..40a9a91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/publish.yml @@ -1,35 +1,39 @@ -name: Lint, test, build and publish +name: Publish + on: release: types: [ published ] + jobs: lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: 16 - run: npm ci - run: npm run lint + test: name: Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: 16 - run: npm ci - run: npm run test:ci + publish: needs: [ lint, test ] - name: Build & publish + name: Build & publish package runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: 16 - run: npm ci @@ -37,3 +41,10 @@ jobs: - uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} + + docs: + needs: [ publish ] + steps: + - uses: ./.github/workflows/docs.yml + with: + targetFolder: docs diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..20d8728 --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,34 @@ +name: Verify + +on: + push: + tags-ignore: + - '*' + paths-ignore: + - '**.md' + branches: + - main + pull_request: + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm ci + - run: npm run lint + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm ci + - run: npm run test:ci diff --git a/.gitignore b/.gitignore index 9b574d2..353f2e4 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,5 @@ node_modules/ .npm dist/ - +styleguide/ *.code-workspace diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..897fdd7 --- /dev/null +++ b/.npmignore @@ -0,0 +1,8 @@ +* +.* +!CHANGELOG +!dist/*/* +!src/**/* +**/*.test.ts +**/*.spec.ts +**/.* diff --git a/.nvmrc b/.nvmrc index 2e0d662..b6a7d89 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.12 +16 diff --git a/.styleguidist/components/Button.js b/.styleguidist/components/Button.js new file mode 100644 index 0000000..3c17bb2 --- /dev/null +++ b/.styleguidist/components/Button.js @@ -0,0 +1,30 @@ +import React, {forwardRef, useMemo} from 'react'; + +const Button = forwardRef(({type, ...props}, ref) => { + const className = useMemo(() => { + const classes = ['btn me-3']; + + if (type === 'reset') { + classes.push('btn-secondary') + } + else { + classes.push('btn-primary') + } + + return classes.join(' '); + }, [type]); + + + return ( + - - {validity.isDirty() && (validity.isValid() ? "The form is Form is valid" : "The form is invalid")} - - ); -} +useValidation([{ + field: 'field-name', + rules: [ + validateFunc(asyncFunction, { + fail: ({payload}) => `Guessed wrong. It should have been ${payload.join(', ')}.` + }) + ], +}]); ``` diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..c4b9767 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,10 @@ +const presets = [ + '@babel/preset-env', + ['@babel/preset-react', {runtime: 'automatic'}], +]; + +const plugins = [ + '@babel/plugin-transform-runtime', +]; + +module.exports = {presets, plugins}; diff --git a/docs/asset-manifest.json b/docs/asset-manifest.json deleted file mode 100644 index 5412dff..0000000 --- a/docs/asset-manifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "files": { - "main.js": "/react-hook-form-validation/static/js/main.3c86f032.chunk.js", - "main.js.map": "/react-hook-form-validation/static/js/main.3c86f032.chunk.js.map", - "runtime-main.js": "/react-hook-form-validation/static/js/runtime-main.0659f3be.js", - "runtime-main.js.map": "/react-hook-form-validation/static/js/runtime-main.0659f3be.js.map", - "static/js/2.c09a7dfb.chunk.js": "/react-hook-form-validation/static/js/2.c09a7dfb.chunk.js", - "static/js/2.c09a7dfb.chunk.js.map": "/react-hook-form-validation/static/js/2.c09a7dfb.chunk.js.map", - "index.html": "/react-hook-form-validation/index.html", - "static/js/2.c09a7dfb.chunk.js.LICENSE.txt": "/react-hook-form-validation/static/js/2.c09a7dfb.chunk.js.LICENSE.txt" - }, - "entrypoints": [ - "static/js/runtime-main.0659f3be.js", - "static/js/2.c09a7dfb.chunk.js", - "static/js/main.3c86f032.chunk.js" - ] -} \ No newline at end of file diff --git a/docs/asyncFunction.md b/docs/asyncFunction.md new file mode 100644 index 0000000..24565d2 --- /dev/null +++ b/docs/asyncFunction.md @@ -0,0 +1,44 @@ +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateFunc} from 'react-hook-form-validation'; + +const FIELD_NAME = 'even-number'; + +function awaitSuccess(value) { + if (!value.trim()) { + return false; + } + return new Promise((resolve) => { + setTimeout(() => resolve(true), 1000); + }); +} + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateFunc(awaitSuccess, { + fail: 'Enter at least something', + success: 'All good', + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + event.preventDefault(); + const value = event.target[FIELD_NAME].value; + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` \ No newline at end of file diff --git a/docs/email.md b/docs/email.md new file mode 100644 index 0000000..68dafd4 --- /dev/null +++ b/docs/email.md @@ -0,0 +1,35 @@ +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateEmail} from 'react-hook-form-validation'; + +const FIELD_NAME = 'email'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateEmail({ + fail: 'The value is not similar to an email address', + success: 'All good', + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + event.preventDefault(); + const value = event.target[FIELD_NAME].value; + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` diff --git a/docs/favicon.ico b/docs/favicon.ico deleted file mode 100644 index a11777c..0000000 Binary files a/docs/favicon.ico and /dev/null differ diff --git a/docs/func.md b/docs/func.md new file mode 100644 index 0000000..a47a570 --- /dev/null +++ b/docs/func.md @@ -0,0 +1,89 @@ +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateFunc} from 'react-hook-form-validation'; + +const FIELD_NAME = 'even-number'; + +function isEven(input) { + const value = Number(input); + return !Number.isNaN(value) && value % 2 === 0; +} + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateFunc(isEven, { + fail: 'This is not an even number.', + success: 'All good', + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + event.preventDefault(); + const value = event.target[FIELD_NAME].value; + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` + +Sometimes you may need to print something more specific rather than just "valid" or "invalid". For that purpose you may return an array from your function. Where the first element should be a sign of validity, and the rest will be proxied into the message builder function. + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateFunc} from 'react-hook-form-validation'; + +const FIELD_NAME = 'fruit'; + +function guessFruit(input) { + if (typeof input !== 'string') { + return false; + } + const FRUITS = ['apple', 'banana', 'kiwi']; + if (FRUITS.includes(input.toLowerCase())) { + return true; + } + return [false, ...FRUITS]; +} + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateFunc(guessFruit, { + fail: ({input, payload}) => `Guessed wrong. It should have been ${payload.join(', ')}.`, + success: 'Correct', + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + event.preventDefault(); + const value = event.target[FIELD_NAME].value; + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 43b027f..0000000 --- a/docs/index.html +++ /dev/null @@ -1 +0,0 @@ -react-hook-form-validation examples
\ No newline at end of file diff --git a/docs/logo192.png b/docs/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/docs/logo192.png and /dev/null differ diff --git a/docs/logo512.png b/docs/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/docs/logo512.png and /dev/null differ diff --git a/docs/manifest.json b/docs/manifest.json deleted file mode 100644 index 080d6c7..0000000 --- a/docs/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/docs/maxLength.md b/docs/maxLength.md new file mode 100644 index 0000000..ba6fe65 --- /dev/null +++ b/docs/maxLength.md @@ -0,0 +1,103 @@ +#### String + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateMax} from 'react-hook-form-validation'; + +const FIELD_NAME = 'string'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateMax(7, 'length', { + fail: ({expected}) => `Should be shorter then ${expected} characters`, + success: 'All good' + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + // Prevent default event to not reload a page + event.preventDefault(); + /** + * Extract filed's value and cast it's type to a number. + * HTML forms always produce a strings. + */ + const value = event.target[FIELD_NAME].value; + /** + * Validate a form. + * - The value always should be passed as array. It's needed to be able to validate dynamic fields. + * - `validateForm` & `validateField` functions are asynchronous functions. So, if you need to + * really know their result, you have to define `await` or `.then(***`. + */ + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` + +#### Array + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateMax} from 'react-hook-form-validation'; + +const FIELD_NAME = 'array'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateMax(2, 'length', { + fail: ({expected}) => `Choose not more than ${expected}`, + success: 'All good' + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + // Prevent default event to not reload a page + event.preventDefault(); + // Extract filed's value + const fieldset = event.target[FIELD_NAME]; + const value = Array.from(fieldset.values()) + .filter(({checked}) => checked) + .map(({value}) => value); + /** + * Validate a form. + * - The value always should be passed as array. It's needed to be able to validate dynamic fields. + * - `validateForm` & `validateField` functions are asynchronous functions. So, if you need to + * really know their result, you have to define `await` or `.then(***`. + */ + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + + +``` diff --git a/docs/maxNumber.md b/docs/maxNumber.md new file mode 100644 index 0000000..cdd5c52 --- /dev/null +++ b/docs/maxNumber.md @@ -0,0 +1,37 @@ +The validator does completely the same as [`min`](#section-min) but opposit. + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateMax} from 'react-hook-form-validation'; + +const FIELD_NAME = 'number'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateMax(7, 'number', { + fail: ({expected}) => `Should'n be greater then ${expected}.`, + success: 'All good.', + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + event.preventDefault(); + const value = event.target[FIELD_NAME].value; + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` diff --git a/docs/minLength.md b/docs/minLength.md new file mode 100644 index 0000000..ff91f63 --- /dev/null +++ b/docs/minLength.md @@ -0,0 +1,103 @@ +#### String + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateMin} from 'react-hook-form-validation'; + +const FIELD_NAME = 'string'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateMin(12, 'length', { + fail: ({expected}) => `Should be longer then ${expected} characters`, + success: 'All good' + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + // Prevent default event to not reload a page + event.preventDefault(); + /** + * Extract filed's value and cast it's type to a number. + * HTML forms always produce a strings. + */ + const value = event.target[FIELD_NAME].value; + /** + * Validate a form. + * - The value always should be passed as array. It's needed to be able to validate dynamic fields. + * - `validateForm` & `validateField` functions are asynchronous functions. So, if you need to + * really know their result, you have to define `await` or `.then(***`. + */ + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` + +#### Array + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateMin} from 'react-hook-form-validation'; + +const FIELD_NAME = 'array'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateMin(3, 'length', { + fail: ({expected}) => `Choose at least ${expected}`, + success: 'All good' + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + // Prevent default event to not reload a page + event.preventDefault(); + // Extract filed's value + const fieldset = event.target[FIELD_NAME]; + const value = Array.from(fieldset.values()) + .filter(({checked}) => checked) + .map(({value}) => value); + /** + * Validate a form. + * - The value always should be passed as array. It's needed to be able to validate dynamic fields. + * - `validateForm` & `validateField` functions are asynchronous functions. So, if you need to + * really know their result, you have to define `await` or `.then(***`. + */ + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + + +``` diff --git a/docs/minNumber.md b/docs/minNumber.md new file mode 100644 index 0000000..cfc7325 --- /dev/null +++ b/docs/minNumber.md @@ -0,0 +1,38 @@ +The validator tries to cast a string to a number if possible and compares actual number with expected. + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateMin} from 'react-hook-form-validation'; + +const FIELD_NAME = 'number'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateMin(12, 'number', { + fail: ({expected}) => `Should'n be less then ${expected}.`, + success: 'All good.', + }) + ], +}]); + +const onSubmit = useCallback(async (event) => { + console.log(event, event.target) + event.preventDefault(); + const value = event.target[FIELD_NAME].value; + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` diff --git a/docs/pattern.md b/docs/pattern.md new file mode 100644 index 0000000..cadc018 --- /dev/null +++ b/docs/pattern.md @@ -0,0 +1,35 @@ +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validatePattern} from 'react-hook-form-validation'; + +const FIELD_NAME = 'postal-code'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validatePattern(/^(?!.*[DFIOQU])[A-VXY]\d[A-Z]\s?\d[A-Z]\d$/ui, { + fail: 'This is not a valid one.', + success: 'All good', + }), + ], +}]); + +const onSubmit = useCallback(async (event) => { + event.preventDefault(); + const value = event.target[FIELD_NAME].value; + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` diff --git a/docs/required.md b/docs/required.md new file mode 100644 index 0000000..28c2bcc --- /dev/null +++ b/docs/required.md @@ -0,0 +1,150 @@ +The validator will skip any numbers, such as positive negative and non-integers. +After that, it checks if it is a string. If so, then it trims the extra spaces from the edges, if any, +and checks if it is an empty string. If so, the check has failed. +If it is not a number or a string, the validator will use the [lodash/isEmpty](https://lodash.com/docs/4.17.15#isEmpty) logic. + +> Checks if value is an empty object, collection, map, or set. +> +> Objects are considered empty if they have no own enumerable string keyed properties. +> +> Array-like values such as arguments objects, arrays, buffers, strings, or jQuery-like collections are considered empty if they have a length of 0. Similarly, maps and sets are considered empty if they have a size of 0. + +#### Number + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateRequired} from 'react-hook-form-validation'; + +const FIELD_NAME = 'number'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateRequired({fail: 'The field is required', success: 'All good'}), + ], +}]); + +const onSubmit = useCallback(async (event) => { + // Prevent default event to not reload a page + event.preventDefault(); + /** + * Extract filed's value and cast it's type to a number. + * HTML forms always produce a strings. + */ + const value = Number(event.target[FIELD_NAME].value) || null; + /** + * Validate a form. + * - The value always should be passed as array. It's needed to be able to validate dynamic fields. + * - `validateForm` & `validateField` functions are asynchronous functions. So, if you need to + * really know their result, you have to define `await` or `.then(***`. + */ + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` + +#### String + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateRequired} from 'react-hook-form-validation'; + +const FIELD_NAME = 'string'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateRequired({fail: 'The field is required', success: 'All good'}), + ], +}]); + +const onSubmit = useCallback(async (event) => { + // Prevent default event to not reload a page + event.preventDefault(); + // Extract filed's value + const value = event.target[FIELD_NAME].value; + /** + * Validate a form. + * - The value always should be passed as array. It's needed to be able to validate dynamic fields. + * - `validateForm` & `validateField` functions are asynchronous functions. So, if you need to + * really know their result, you have to define `await` or `.then(***`. + */ + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + +
+``` + +#### Array + +```js +import {useMemo, useCallback} from 'react'; +import useValidation, {validateRequired} from 'react-hook-form-validation'; + +const FIELD_NAME = 'array'; + +const {validity, validateForm, resetForm} = useValidation([{ + field: FIELD_NAME, + rules: [ + validateRequired({fail: 'The field is required', success: 'All good'}), + ], +}]); + +const onSubmit = useCallback(async (event) => { + // Prevent default event to not reload a page + event.preventDefault(); + // Extract filed's value + const fieldset = event.target[FIELD_NAME]; + const value = Array.from(fieldset.values()) + .filter(({checked}) => checked) + .map(({value}) => value); + /** + * Validate a form. + * - The value always should be passed as array. It's needed to be able to validate dynamic fields. + * - `validateForm` & `validateField` functions are asynchronous functions. So, if you need to + * really know their result, you have to define `await` or `.then(***`. + */ + await validateForm({[FIELD_NAME]: [value]}); +}, [validateForm]); + +
+ + + + +``` diff --git a/docs/robots.txt b/docs/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/docs/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/docs/static/js/2.c09a7dfb.chunk.js b/docs/static/js/2.c09a7dfb.chunk.js deleted file mode 100644 index 9480b94..0000000 --- a/docs/static/js/2.c09a7dfb.chunk.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see 2.c09a7dfb.chunk.js.LICENSE.txt */ -(this["webpackJsonpreact-hook-form-validation-site"]=this["webpackJsonpreact-hook-form-validation-site"]||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(89)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";function r(e){var t,n,o="";if("string"===typeof e||"number"===typeof e)o+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var a=t.defaultTheme,l=t.withTheme,f=void 0!==l&&l,p=t.name,h=Object(o.a)(t,["defaultTheme","withTheme","name"]);var m=p,v=Object(s.a)(e,Object(r.a)({defaultTheme:a,Component:n,name:p||n.displayName,classNamePrefix:m},h)),b=i.a.forwardRef((function(e,t){e.classes;var l,u=e.innerRef,s=Object(o.a)(e,["classes","innerRef"]),h=v(Object(r.a)({},n.defaultProps,e)),m=s;return("string"===typeof p||f)&&(l=Object(d.a)()||a,p&&(m=Object(c.a)({theme:l,name:p,props:s})),f&&!m.theme&&(m.theme=l)),i.a.createElement(n,Object(r.a)({ref:u||t,classes:h},m))}));return u()(b,n),b}},p=n(27);t.a=function(e,t){return f(e,Object(r.a)({defaultTheme:p.a},t))}},function(e,t,n){e.exports=n(93)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(82);function o(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";e.exports=n(144)},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(16);function a(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(o.a)(e,n),Object(o.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(90)},function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return d}));var r=n(82);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function a(e){if(e.type)return e;if("#"===e.charAt(0))return a(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var o=e.substring(t+1,e.length-1).split(",");return{type:n,values:o=o.map((function(e){return parseFloat(e)}))}}function i(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function l(e,t){var n=u(e),r=u(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function u(e){var t="hsl"===(e=a(e)).type?a(function(e){var t=(e=a(e)).values,n=t[0],r=t[1]/100,o=t[2]/100,l=r*Math.min(o,1-o),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return o-l*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",c=[Math.round(255*u(0)),Math.round(255*u(8)),Math.round(255*u(4))];return"hsla"===e.type&&(s+="a",c.push(t[3])),i({type:s,values:c})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function s(e,t){return e=a(e),t=o(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,i(e)}function c(e,t){if(e=a(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return i(e)}function d(e,t){if(e=a(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return i(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FIELD_STATE=t.VALIDATION_MESSAGES=t.VALIDATORS=void 0,function(e){e.required="required",e.min="min",e.max="max",e.email="email",e.url="url",e.postalCodeCA="postalCodeCA",e.sinCA="sinCA",e.pattern="pattern",e.func="func"}(t.VALIDATORS||(t.VALIDATORS={})),function(e){e.required="required",e.min="min",e.max="max",e.email="email",e.url="url",e.postalCodeCA="postal-code-CA",e.sinCA="SIN-CA",e.pattern="pattern",e.invalid="invalid"}(t.VALIDATION_MESSAGES||(t.VALIDATION_MESSAGES={})),t.DEFAULT_FIELD_STATE={index:0,pristine:!0,error:!1,message:void 0}},function(e,t,n){"use strict";var r=n(61),o=n(63),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createValidationMessage=t.processFieldValidity=t.processFormValidity=t.extractFieldValue=t.createDefaultValidity=t.validateRuleSet=void 0;var i=a(n(50)),l=a(n(67)),u=n(13),s=a(n(103));t.validateRuleSet=function(e){if(!e||!e.length)throw new Error("No validation rules defined. It doesn't make sense to use validator without rules.");e.forEach((function(e){var t=e.field,n=e.rules;if(!t)throw new Error("Undefined field in a ruleset.");if(n&&!n.length)throw new Error('Field "'.concat(t,'" does not have validation rules defined.'));n&&n.forEach((function(e){var t=e.condition;t&&function(e){if(!Array.isArray(e))throw new TypeError("Condition property must be an array.");var t=o(e),n=t[0],r=t.slice(1);if(!i.default(n))throw new TypeError("Condition selector must be a function.");if(r.some((function(e){return!l.default(e)})))throw new TypeError("Defining fields in a condition must be a string only.")}(t)}))}))},t.createDefaultValidity=function(e){var t=e.map((function(e){var t=e.field;return Object.assign(Object.assign({},u.DEFAULT_FIELD_STATE),{name:t})}));return new s.default(t)},t.extractFieldValue=function(e,t,n){return e[t][n]},t.processFormValidity=function(e,t,n){var o=t.values().reduce((function(t,o){var a=o.name,i=o.index,l=e(n,a,i);return[].concat(r(t),[l])}),[]);return new s.default(o)},t.processFieldValidity=function(e,t,n,o,a){var i=t.values().filter((function(e){return e.name!==o||e.index!==a})),l=e(n,o,a);return new s.default([].concat(r(i),[l]))},t.createValidationMessage=function(e,t){return i.default(e)?e(t):e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function a(e){var t=r.useRef(e);return o((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return function(){return null}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){var r=n(65),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(34);var o=n(76),a=n(42);function i(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(o.a)(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,o=new Array(r),a=0;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(34);function o(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";var r=n(0),o=n.n(r).a.createContext(null);t.a=o},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for;t.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,l,u=i(e),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(145),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function u(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var s=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var i=c(n);d&&(i=i.concat(d(n)));for(var l=u(t),m=u(n),v=0;v0?r:e)-s/100).concat(a,")")},between:f,only:function(e){return f(e,e)},width:function(e){return n[e]}},c)}function s(e,t,n){var o;return Object(i.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),Object(i.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(i.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(o={minHeight:56},Object(r.a)(o,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(o,e.up("sm"),{minHeight:64}),o)},n)}var c=n(82),d={black:"#000",white:"#fff"},f={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},p={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},h={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},v={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},b={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},y={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},g=n(12),x={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:d.white,default:f[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:d.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:f[800],default:"#303030"},action:{active:d.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function k(e,t,n,r){var o=r.light||r,a=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(g.d)(e.main,o):"dark"===t&&(e.dark=Object(g.b)(e.main,a)))}function S(e){var t=e.primary,n=void 0===t?{light:p[300],main:p[500],dark:p[700]}:t,r=e.secondary,l=void 0===r?{light:h.A200,main:h.A400,dark:h.A700}:r,u=e.error,s=void 0===u?{light:m[300],main:m[500],dark:m[700]}:u,S=e.warning,O=void 0===S?{light:v[300],main:v[500],dark:v[700]}:S,E=e.info,C=void 0===E?{light:b[300],main:b[500],dark:b[700]}:E,j=e.success,P=void 0===j?{light:y[300],main:y[500],dark:y[700]}:j,R=e.type,_=void 0===R?"light":R,T=e.contrastThreshold,M=void 0===T?3:T,F=e.tonalOffset,N=void 0===F?.2:F,A=Object(o.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function D(e){return Object(g.c)(e,w.text.primary)>=M?w.text.primary:x.text.primary}var I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(i.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(c.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(c.a)(5,JSON.stringify(e.main)));return k(e,"light",n,N),k(e,"dark",r,N),e.contrastText||(e.contrastText=D(e.main)),e},L={dark:w,light:x};return Object(a.a)(Object(i.a)({common:d,type:_,primary:I(n),secondary:I(l,"A400","A200","A700"),error:I(s),warning:I(O),info:I(C),success:I(P),grey:f,contrastThreshold:M,getContrastText:D,augmentColor:I,tonalOffset:N},L[_]),A)}function O(e){return Math.round(1e5*e)/1e5}function E(e){return O(e)}var C={textTransform:"uppercase"},j='"Roboto", "Helvetica", "Arial", sans-serif';function P(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,l=void 0===r?j:r,u=n.fontSize,s=void 0===u?14:u,c=n.fontWeightLight,d=void 0===c?300:c,f=n.fontWeightRegular,p=void 0===f?400:f,h=n.fontWeightMedium,m=void 0===h?500:h,v=n.fontWeightBold,b=void 0===v?700:v,y=n.htmlFontSize,g=void 0===y?16:y,x=n.allVariants,w=n.pxToRem,k=Object(o.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var S=s/14,P=w||function(e){return"".concat(e/g*S,"rem")},R=function(e,t,n,r,o){return Object(i.a)({fontFamily:l,fontWeight:e,fontSize:P(t),lineHeight:n},l===j?{letterSpacing:"".concat(O(r/t),"em")}:{},o,x)},_={h1:R(d,96,1.167,-1.5),h2:R(d,60,1.2,-.5),h3:R(p,48,1.167,0),h4:R(p,34,1.235,.25),h5:R(p,24,1.334,0),h6:R(m,20,1.6,.15),subtitle1:R(p,16,1.75,.15),subtitle2:R(m,14,1.57,.1),body1:R(p,16,1.5,.15),body2:R(p,14,1.43,.15),button:R(m,14,1.75,.4,C),caption:R(p,12,1.66,.4),overline:R(p,12,2.66,1,C)};return Object(a.a)(Object(i.a)({htmlFontSize:g,pxToRem:P,round:E,fontFamily:l,fontSize:s,fontWeightLight:d,fontWeightRegular:p,fontWeightMedium:m,fontWeightBold:b},_),k,{clone:!1})}function R(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var _=["none",R(0,2,1,-1,0,1,1,0,0,1,3,0),R(0,3,1,-2,0,2,2,0,0,1,5,0),R(0,3,3,-2,0,3,4,0,0,1,8,0),R(0,2,4,-1,0,4,5,0,0,1,10,0),R(0,3,5,-1,0,5,8,0,0,1,14,0),R(0,3,5,-1,0,6,10,0,0,1,18,0),R(0,4,5,-2,0,7,10,1,0,2,16,1),R(0,5,5,-3,0,8,10,1,0,3,14,2),R(0,5,6,-3,0,9,12,1,0,3,16,2),R(0,6,6,-3,0,10,14,1,0,4,18,3),R(0,6,7,-4,0,11,15,1,0,4,20,3),R(0,7,8,-4,0,12,17,2,0,5,22,4),R(0,7,8,-4,0,13,19,2,0,5,24,4),R(0,7,9,-4,0,14,21,2,0,5,26,4),R(0,8,9,-5,0,15,22,2,0,6,28,5),R(0,8,10,-5,0,16,24,2,0,6,30,5),R(0,8,11,-5,0,17,26,2,0,6,32,5),R(0,9,11,-5,0,18,28,2,0,7,34,6),R(0,9,12,-6,0,19,29,2,0,7,36,6),R(0,10,13,-6,0,20,31,3,0,8,38,7),R(0,10,13,-6,0,21,33,3,0,8,40,7),R(0,10,14,-6,0,22,35,3,0,8,42,7),R(0,11,14,-7,0,23,36,3,0,9,44,8),R(0,11,15,-7,0,24,38,3,0,9,46,8)],T={borderRadius:4},M=n(29),F=(n(20),n(22));n(5);var N=function(e,t){return t?Object(a.a)(e,t,{clone:!1}):e},A={xs:0,sm:600,md:960,lg:1280,xl:1920},D={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(A[e],"px)")}};var I={m:"margin",p:"padding"},L={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},z={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},V=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){if(e.length>2){if(!z[e])return[e];e=z[e]}var t=e.split(""),n=Object(M.a)(t,2),r=n[0],o=n[1],a=I[r],i=L[o]||"";return Array.isArray(i)?i.map((function(e){return a+e})):[a+i]})),B=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function $(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function W(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function U(e){var t=$(e.theme);return Object.keys(e).map((function(n){if(-1===B.indexOf(n))return null;var r=W(V(n),t),o=e[n];return function(e,t,n){if(Array.isArray(t)){var r=e.theme.breakpoints||D;return t.reduce((function(e,o,a){return e[r.up(r.keys[a])]=n(t[a]),e}),{})}if("object"===Object(F.a)(t)){var o=e.theme.breakpoints||D;return Object.keys(t).reduce((function(e,r){return e[o.up(r)]=n(t[r]),e}),{})}return n(t)}(e,o,r)})).reduce(N,{})}U.propTypes={},U.filterProps=B;function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=$({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?K.standard:n,a=t.easing,i=void 0===a?q.easeInOut:a,l=t.delay,u=void 0===l?0:l;Object(o.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof r?r:Q(r)," ").concat(i," ").concat("string"===typeof u?u:Q(u))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},Y=n(43);function X(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,i=void 0===r?{}:r,l=e.palette,c=void 0===l?{}:l,d=e.spacing,f=e.typography,p=void 0===f?{}:f,h=Object(o.a)(e,["breakpoints","mixins","palette","spacing","typography"]),m=S(c),v=u(n),b=H(d),y=Object(a.a)({breakpoints:v,direction:"ltr",mixins:s(v,b,i),overrides:{},palette:m,props:{},shadows:_,typography:P(m,p),spacing:b,shape:T,transitions:G,zIndex:Y.a},h),g=arguments.length,x=new Array(g>1?g-1:0),w=1;w=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,o=void 0!==r&&r,a=t.center,l=void 0===a?i||t.pulsate:a,u=t.fakeElement,s=void 0!==u&&u;if("mousedown"===e.type&&b.current)b.current=!1;else{"touchstart"===e.type&&(b.current=!0);var c,d,f,p=s?null:x.current,h=p?p.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(l||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(h.width/2),d=Math.round(h.height/2);else{var m=e.touches?e.touches[0]:e,v=m.clientX,k=m.clientY;c=Math.round(v-h.left),d=Math.round(k-h.top)}if(l)(f=Math.sqrt((2*Math.pow(h.width,2)+Math.pow(h.height,2))/3))%2===0&&(f+=1);else{var S=2*Math.max(Math.abs((p?p.clientWidth:0)-c),c)+2,O=2*Math.max(Math.abs((p?p.clientHeight:0)-d),d)+2;f=Math.sqrt(Math.pow(S,2)+Math.pow(O,2))}e.touches?null===g.current&&(g.current=function(){w({pulsate:o,rippleX:c,rippleY:d,rippleSize:f,cb:n})},y.current=setTimeout((function(){g.current&&(g.current(),g.current=null)}),80)):w({pulsate:o,rippleX:c,rippleY:d,rippleSize:f,cb:n})}}),[i,w]),O=a.useCallback((function(){k({},{pulsate:!0})}),[k]),C=a.useCallback((function(e,t){if(clearTimeout(y.current),"touchend"===e.type&&g.current)return e.persist(),g.current(),g.current=null,void(y.current=setTimeout((function(){C(e,t)})));g.current=null,h((function(e){return e.length>0?e.slice(1):e})),v.current=t}),[]);return a.useImperativeHandle(t,(function(){return{pulsate:O,start:k,stop:C}}),[O,k,C]),a.createElement("span",Object(r.a)({className:Object(u.a)(l.root,s),ref:x},c),a.createElement(S,{component:null,exit:!0},f))})),j=Object(d.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(a.memo(C)),P=a.forwardRef((function(e,t){var n=e.action,i=e.buttonRef,d=e.centerRipple,p=void 0!==d&&d,h=e.children,m=e.classes,v=e.className,b=e.component,y=void 0===b?"button":b,g=e.disabled,x=void 0!==g&&g,w=e.disableRipple,k=void 0!==w&&w,S=e.disableTouchRipple,O=void 0!==S&&S,E=e.focusRipple,C=void 0!==E&&E,P=e.focusVisibleClassName,R=e.onBlur,_=e.onClick,T=e.onFocus,M=e.onFocusVisible,F=e.onKeyDown,N=e.onKeyUp,A=e.onMouseDown,D=e.onMouseLeave,I=e.onMouseUp,L=e.onTouchEnd,z=e.onTouchMove,V=e.onTouchStart,B=e.onDragLeave,$=e.tabIndex,W=void 0===$?0:$,U=e.TouchRippleProps,H=e.type,q=void 0===H?"button":H,K=Object(o.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),Q=a.useRef(null);var G=a.useRef(null),Y=a.useState(!1),X=Y[0],J=Y[1];x&&X&&J(!1);var Z=Object(f.a)(),ee=Z.isFocusVisible,te=Z.onBlurVisible,ne=Z.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O;return Object(c.a)((function(r){return t&&t(r),!n&&G.current&&G.current[e](r),!0}))}a.useImperativeHandle(n,(function(){return{focusVisible:function(){J(!0),Q.current.focus()}}}),[]),a.useEffect((function(){X&&C&&!k&&G.current.pulsate()}),[k,C,X]);var oe=re("start",A),ae=re("stop",B),ie=re("stop",I),le=re("stop",(function(e){X&&e.preventDefault(),D&&D(e)})),ue=re("start",V),se=re("stop",L),ce=re("stop",z),de=re("stop",(function(e){X&&(te(e),J(!1)),R&&R(e)}),!1),fe=Object(c.a)((function(e){Q.current||(Q.current=e.currentTarget),ee(e)&&(J(!0),M&&M(e)),T&&T(e)})),pe=function(){var e=l.findDOMNode(Q.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},he=a.useRef(!1),me=Object(c.a)((function(e){C&&!he.current&&X&&G.current&&" "===e.key&&(he.current=!0,e.persist(),G.current.stop(e,(function(){G.current.start(e)}))),e.target===e.currentTarget&&pe()&&" "===e.key&&e.preventDefault(),F&&F(e),e.target===e.currentTarget&&pe()&&"Enter"===e.key&&!x&&(e.preventDefault(),_&&_(e))})),ve=Object(c.a)((function(e){C&&" "===e.key&&G.current&&X&&!e.defaultPrevented&&(he.current=!1,e.persist(),G.current.stop(e,(function(){G.current.pulsate(e)}))),N&&N(e),_&&e.target===e.currentTarget&&pe()&&" "===e.key&&!e.defaultPrevented&&_(e)})),be=y;"button"===be&&K.href&&(be="a");var ye={};"button"===be?(ye.type=q,ye.disabled=x):("a"===be&&K.href||(ye.role="button"),ye["aria-disabled"]=x);var ge=Object(s.a)(i,t),xe=Object(s.a)(ne,Q),we=Object(s.a)(ge,xe),ke=a.useState(!1),Se=ke[0],Oe=ke[1];a.useEffect((function(){Oe(!0)}),[]);var Ee=Se&&!k&&!x;return a.createElement(be,Object(r.a)({className:Object(u.a)(m.root,v,X&&[m.focusVisible,P],x&&m.disabled),onBlur:de,onClick:_,onFocus:fe,onKeyDown:me,onKeyUp:ve,onMouseDown:oe,onMouseLeave:le,onMouseUp:ie,onDragLeave:ae,onTouchEnd:se,onTouchMove:ce,onTouchStart:ue,ref:we,tabIndex:x?-1:W},ye,K),h,Ee?a.createElement(j,Object(r.a)({ref:G,center:p},U)):null)}));t.a=Object(d.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(P)},,,,,,function(e,t,n){"use strict";var r=n(48),o=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var i=60109,l=60110,u=60112;t.Suspense=60113;var s=60115,c=60116;if("function"===typeof Symbol&&Symbol.for){var d=Symbol.for;o=d("react.element"),a=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),i=d("react.provider"),l=d("react.context"),u=d("react.forward_ref"),t.Suspense=d("react.suspense"),s=d("react.memo"),c=d("react.lazy")}var f="function"===typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n