{"version":3,"file":"index.esm.mjs","sources":["../src/utils/isCheckBoxInput.ts","../src/utils/isDateObject.ts","../src/utils/isNullOrUndefined.ts","../src/utils/isObject.ts","../src/logic/getEventValue.ts","../src/logic/getNodeParentName.ts","../src/logic/isNameInFieldArray.ts","../src/utils/compact.ts","../src/utils/isUndefined.ts","../src/utils/get.ts","../src/constants.ts","../src/useFormContext.tsx","../src/logic/getProxyFormState.ts","../src/utils/isEmptyObject.ts","../src/logic/shouldRenderFormState.ts","../src/utils/convertToArrayPayload.ts","../src/logic/shouldSubscribeByName.ts","../src/useSubscribe.ts","../src/useFormState.ts","../src/utils/isString.ts","../src/logic/generateWatchOutput.ts","../src/utils/isFunction.ts","../src/utils/objectHasFunction.ts","../src/useWatch.ts","../src/useController.ts","../src/controller.tsx","../src/logic/appendErrors.ts","../src/utils/isKey.ts","../src/utils/stringToPath.ts","../src/utils/set.ts","../src/logic/focusFieldBy.ts","../src/logic/generateId.ts","../src/logic/getFocusFieldName.ts","../src/logic/isWatched.ts","../src/utils/append.ts","../src/utils/isWeb.ts","../src/utils/cloneObject.ts","../src/utils/fillEmptyArray.ts","../src/utils/insert.ts","../src/utils/move.ts","../src/utils/prepend.ts","../src/utils/remove.ts","../src/utils/swap.ts","../src/utils/unset.ts","../src/utils/update.ts","../src/useFieldArray.ts","../src/utils/createSubject.ts","../src/utils/isPrimitive.ts","../src/utils/deepEqual.ts","../src/utils/getValidationModes.ts","../src/utils/isBoolean.ts","../src/utils/isFileInput.ts","../src/utils/isHTMLElement.ts","../src/utils/isMultipleSelect.ts","../src/utils/isRadioInput.ts","../src/utils/isRadioOrCheckbox.ts","../src/utils/live.ts","../src/logic/getDirtyFields.ts","../src/logic/getCheckboxValue.ts","../src/logic/getFieldValueAs.ts","../src/logic/getRadioValue.ts","../src/logic/getFieldValue.ts","../src/logic/getResolverOptions.ts","../src/utils/isRegex.ts","../src/logic/getRuleValue.ts","../src/logic/hasValidation.ts","../src/logic/schemaErrorLookup.ts","../src/logic/skipValidation.ts","../src/logic/unsetEmptyArray.ts","../src/utils/isMessage.ts","../src/logic/getValidateError.ts","../src/logic/getValueAndMessage.ts","../src/logic/validateField.ts","../src/logic/createFormControl.ts","../src/useForm.ts"],"sourcesContent":["import { FieldElement } from '../types';\n\nexport default (element: FieldElement): element is HTMLInputElement =>\n element.type === 'checkbox';\n","export default (value: unknown): value is Date => value instanceof Date;\n","export default (value: unknown): value is null | undefined => value == null;\n","import isDateObject from './isDateObject';\nimport isNullOrUndefined from './isNullOrUndefined';\n\nexport const isObjectType = (value: unknown) => typeof value === 'object';\n\nexport default (value: unknown): value is T =>\n !isNullOrUndefined(value) &&\n !Array.isArray(value) &&\n isObjectType(value) &&\n !isDateObject(value);\n","import isCheckBoxInput from '../utils/isCheckBoxInput';\nimport isObject from '../utils/isObject';\n\ntype Event = { target: any };\n\nexport default (event: unknown) =>\n isObject(event) && (event as Event).target\n ? isCheckBoxInput((event as Event).target)\n ? (event as Event).target.checked\n : (event as Event).target.value\n : event;\n","export default (name: string) =>\n name.substring(0, name.search(/\\.\\d+(\\.|$)/)) || name;\n","import { InternalFieldName } from '../types';\n\nimport getNodeParentName from './getNodeParentName';\n\nexport default (names: Set, name: InternalFieldName) =>\n names.has(getNodeParentName(name));\n","export default (value: TValue[]) =>\n Array.isArray(value) ? value.filter(Boolean) : [];\n","export default (val: unknown): val is undefined => val === undefined;\n","import compact from './compact';\nimport isNullOrUndefined from './isNullOrUndefined';\nimport isObject from './isObject';\nimport isUndefined from './isUndefined';\n\nexport default (obj: T, path: string, defaultValue?: unknown): any => {\n if (!path || !isObject(obj)) {\n return defaultValue;\n }\n\n const result = compact(path.split(/[,[\\].]+?/)).reduce(\n (result, key) =>\n isNullOrUndefined(result) ? result : result[key as keyof {}],\n obj,\n );\n\n return isUndefined(result) || result === obj\n ? isUndefined(obj[path as keyof T])\n ? defaultValue\n : obj[path as keyof T]\n : result;\n};\n","import { ValidationMode } from './types';\n\nexport const EVENTS = {\n BLUR: 'blur',\n FOCUS_OUT: 'focusout',\n CHANGE: 'change',\n};\n\nexport const VALIDATION_MODE: ValidationMode = {\n onBlur: 'onBlur',\n onChange: 'onChange',\n onSubmit: 'onSubmit',\n onTouched: 'onTouched',\n all: 'all',\n};\n\nexport const INPUT_VALIDATION_RULES = {\n max: 'max',\n min: 'min',\n maxLength: 'maxLength',\n minLength: 'minLength',\n pattern: 'pattern',\n required: 'required',\n validate: 'validate',\n};\n","import React from 'react';\n\nimport { FieldValues, FormProviderProps, UseFormReturn } from './types';\n\nconst HookFormContext = React.createContext(null);\n\n/**\n * This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.\n *\n * @remarks\n * [API](https://react-hook-form.com/api/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)\n *\n * @returns return all useForm methods\n *\n * @example\n * ```tsx\n * function App() {\n * const methods = useForm();\n * const onSubmit = data => console.log(data);\n *\n * return (\n * \n *
\n * \n * \n * \n *
\n * );\n * }\n *\n * function NestedInput() {\n * const { register } = useFormContext(); // retrieve all hook methods\n * return ;\n * }\n * ```\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues,\n>(): UseFormReturn =>\n React.useContext(HookFormContext) as unknown as UseFormReturn;\n\n/**\n * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}.\n *\n * @remarks\n * [API](https://react-hook-form.com/api/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)\n *\n * @param props - all useFrom methods\n *\n * @example\n * ```tsx\n * function App() {\n * const methods = useForm();\n * const onSubmit = data => console.log(data);\n *\n * return (\n * \n *
\n * \n * \n * \n *
\n * );\n * }\n *\n * function NestedInput() {\n * const { register } = useFormContext(); // retrieve all hook methods\n * return ;\n * }\n * ```\n */\nexport const FormProvider = (\n props: FormProviderProps,\n) => {\n const { children, ...data } = props;\n return (\n \n {children}\n \n );\n};\n","import { VALIDATION_MODE } from '../constants';\nimport { FieldValues, FormState, ReadFormState } from '../types';\n\nexport default (\n formState: FormState,\n _proxyFormState: ReadFormState,\n localProxyFormState?: ReadFormState,\n isRoot = true,\n) => {\n const result = {} as typeof formState;\n\n for (const key in formState) {\n Object.defineProperty(result, key, {\n get: () => {\n const _key = key as keyof FormState & keyof ReadFormState;\n\n if (_proxyFormState[_key] !== VALIDATION_MODE.all) {\n _proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;\n }\n\n localProxyFormState && (localProxyFormState[_key] = true);\n return formState[_key];\n },\n });\n }\n\n return result;\n};\n","import { EmptyObject } from '../types';\n\nimport isObject from './isObject';\n\nexport default (value: unknown): value is EmptyObject =>\n isObject(value) && !Object.keys(value).length;\n","import { VALIDATION_MODE } from '../constants';\nimport { ReadFormState } from '../types';\nimport isEmptyObject from '../utils/isEmptyObject';\n\nexport default , K extends ReadFormState>(\n formStateData: T,\n _proxyFormState: K,\n isRoot?: boolean,\n) => {\n const { name, ...formState } = formStateData;\n\n return (\n isEmptyObject(formState) ||\n Object.keys(formState).length >= Object.keys(_proxyFormState).length ||\n Object.keys(formState).find(\n (key) =>\n _proxyFormState[key as keyof ReadFormState] ===\n (!isRoot || VALIDATION_MODE.all),\n )\n );\n};\n","export default (value: T) => (Array.isArray(value) ? value : [value]);\n","import convertToArrayPayload from '../utils/convertToArrayPayload';\n\nexport default (\n name?: T,\n signalName?: string,\n exact?: boolean,\n) =>\n exact && signalName\n ? name === signalName\n : !name ||\n !signalName ||\n name === signalName ||\n convertToArrayPayload(name).some(\n (currentName) =>\n currentName &&\n (currentName.startsWith(signalName) ||\n signalName.startsWith(currentName)),\n );\n","import React from 'react';\n\nimport { Subject, Subscription } from './utils/createSubject';\n\ntype Props = {\n disabled?: boolean;\n subject: Subject;\n callback: (value: T) => void;\n};\n\nexport function useSubscribe(props: Props) {\n const _props = React.useRef(props);\n _props.current = props;\n\n React.useEffect(() => {\n const tearDown = (subscription: Subscription | false) => {\n if (subscription) {\n subscription.unsubscribe();\n }\n };\n\n const subscription =\n !props.disabled &&\n _props.current.subject.subscribe({\n next: _props.current.callback,\n });\n\n return () => tearDown(subscription);\n }, [props.disabled]);\n}\n","import React from 'react';\n\nimport getProxyFormState from './logic/getProxyFormState';\nimport shouldRenderFormState from './logic/shouldRenderFormState';\nimport shouldSubscribeByName from './logic/shouldSubscribeByName';\nimport {\n FieldValues,\n InternalFieldName,\n UseFormStateProps,\n UseFormStateReturn,\n} from './types';\nimport { useFormContext } from './useFormContext';\nimport { useSubscribe } from './useSubscribe';\n\n/**\n * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.\n *\n * @remarks\n * [API](https://react-hook-form.com/api/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)\n *\n * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, handleSubmit, control } = useForm({\n * defaultValues: {\n * firstName: \"firstName\"\n * }});\n * const { dirtyFields } = useFormState({\n * control\n * });\n * const onSubmit = (data) => console.log(data);\n *\n * return (\n *
\n * \n * {dirtyFields.firstName &&

Field is dirty.

}\n * \n *
\n * );\n * }\n * ```\n */\nfunction useFormState(\n props?: UseFormStateProps,\n): UseFormStateReturn {\n const methods = useFormContext();\n const { control = methods.control, disabled, name, exact } = props || {};\n const [formState, updateFormState] = React.useState(control._formState);\n const _localProxyFormState = React.useRef({\n isDirty: false,\n dirtyFields: false,\n touchedFields: false,\n isValidating: false,\n isValid: false,\n errors: false,\n });\n const _name = React.useRef(name);\n const _mounted = React.useRef(true);\n\n _name.current = name;\n\n const callback = React.useCallback(\n (value: { name?: InternalFieldName }) =>\n _mounted.current &&\n shouldSubscribeByName(\n _name.current as InternalFieldName,\n value.name,\n exact,\n ) &&\n shouldRenderFormState(value, _localProxyFormState.current) &&\n updateFormState({\n ...control._formState,\n ...value,\n }),\n [control, exact],\n );\n\n useSubscribe({\n disabled,\n callback,\n subject: control._subjects.state,\n });\n\n React.useEffect(() => {\n _mounted.current = true;\n return () => {\n _mounted.current = false;\n };\n }, []);\n\n return getProxyFormState(\n formState,\n control._proxyFormState,\n _localProxyFormState.current,\n false,\n );\n}\n\nexport { useFormState };\n","export default (value: unknown): value is string => typeof value === 'string';\n","import { FieldValues, InternalFieldName, Names } from '../types';\nimport get from '../utils/get';\nimport isString from '../utils/isString';\n\nexport default (\n names: string | string[] | undefined,\n _names: Names,\n formValues?: FieldValues,\n isGlobal?: boolean,\n) => {\n const isArray = Array.isArray(names);\n if (isString(names)) {\n isGlobal && _names.watch.add(names as InternalFieldName);\n return get(formValues, names as InternalFieldName);\n }\n\n if (isArray) {\n return names.map(\n (fieldName) => (\n isGlobal && _names.watch.add(fieldName as InternalFieldName),\n get(formValues, fieldName as InternalFieldName)\n ),\n );\n }\n\n isGlobal && (_names.watchAll = true);\n return formValues;\n};\n","export default (value: unknown): value is Function =>\n typeof value === 'function';\n","import isFunction from './isFunction';\n\nexport default (data: T): boolean => {\n for (const key in data) {\n if (isFunction(data[key])) {\n return true;\n }\n }\n return false;\n};\n","import React from 'react';\n\nimport generateWatchOutput from './logic/generateWatchOutput';\nimport shouldSubscribeByName from './logic/shouldSubscribeByName';\nimport isObject from './utils/isObject';\nimport isUndefined from './utils/isUndefined';\nimport objectHasFunction from './utils/objectHasFunction';\nimport {\n Control,\n DeepPartialSkipArrayKey,\n FieldPath,\n FieldPathValue,\n FieldPathValues,\n FieldValues,\n InternalFieldName,\n UnpackNestedValue,\n UseWatchProps,\n} from './types';\nimport { useFormContext } from './useFormContext';\nimport { useSubscribe } from './useSubscribe';\n\n/**\n * Subscribe to the entire form values change and re-render at the hook level.\n *\n * @remarks\n *\n * [API](https://react-hook-form.com/api/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)\n *\n * @param props - defaultValue, disable subscription and match exact name.\n *\n * @example\n * ```tsx\n * const { watch } = useForm();\n * const values = useWatch({\n * control,\n * defaultValue: {\n * name: \"data\"\n * },\n * exact: false,\n * })\n * ```\n */\nexport function useWatch<\n TFieldValues extends FieldValues = FieldValues,\n>(props: {\n defaultValue?: DeepPartialSkipArrayKey;\n control?: Control;\n disabled?: boolean;\n exact?: boolean;\n}): DeepPartialSkipArrayKey;\n/**\n * Custom hook to subscribe to field change and isolate re-rendering at the component level.\n *\n * @remarks\n *\n * [API](https://react-hook-form.com/api/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)\n *\n * @param props - defaultValue, disable subscription and match exact name.\n *\n * @example\n * ```tsx\n * const { watch } = useForm();\n * const values = useWatch({\n * control,\n * name: \"fieldA\",\n * defaultValue: \"default value\",\n * exact: false,\n * })\n * ```\n */\nexport function useWatch<\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath = FieldPath,\n>(props: {\n name: TFieldName;\n defaultValue?: FieldPathValue;\n control?: Control;\n disabled?: boolean;\n exact?: boolean;\n}): FieldPathValue;\n/**\n * Custom hook to subscribe to field change and isolate re-rendering at the component level.\n *\n * @remarks\n *\n * [API](https://react-hook-form.com/api/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)\n *\n * @param props - defaultValue, disable subscription and match exact name.\n *\n * @example\n * ```tsx\n * const { watch } = useForm();\n * const values = useWatch({\n * control,\n * name: [\"fieldA\", \"fieldB\"],\n * defaultValue: {\n * fieldA: \"data\",\n * fieldB: \"data\"\n * },\n * exact: false,\n * })\n * ```\n */\nexport function useWatch<\n TFieldValues extends FieldValues = FieldValues,\n TFieldNames extends readonly FieldPath[] = readonly FieldPath[],\n>(props: {\n name: readonly [...TFieldNames];\n defaultValue?: UnpackNestedValue>;\n control?: Control;\n disabled?: boolean;\n exact?: boolean;\n}): FieldPathValues;\n/**\n * Custom hook to subscribe to field change and isolate re-rendering at the component level.\n *\n * @remarks\n *\n * [API](https://react-hook-form.com/api/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)\n *\n * @example\n * ```tsx\n * // can skip passing down the control into useWatch if the form is wrapped with the FormProvider\n * const values = useWatch()\n * ```\n */\nexport function useWatch<\n TFieldValues extends FieldValues = FieldValues,\n TFieldNames extends FieldPath[] = FieldPath[],\n>(): FieldPathValues;\n/**\n * Custom hook to subscribe to field change and isolate re-rendering at the component level.\n *\n * @remarks\n *\n * [API](https://react-hook-form.com/api/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)\n *\n * @example\n * ```tsx\n * const { watch } = useForm();\n * const values = useWatch({\n * name: \"fieldName\"\n * control,\n * })\n * ```\n */\nexport function useWatch(\n props?: UseWatchProps,\n) {\n const methods = useFormContext();\n const {\n control = methods.control,\n name,\n defaultValue,\n disabled,\n exact,\n } = props || {};\n const _name = React.useRef(name);\n\n _name.current = name;\n\n const callback = React.useCallback(\n (formState: { name?: InternalFieldName; values?: FieldValues }) => {\n if (\n shouldSubscribeByName(\n _name.current as InternalFieldName,\n formState.name,\n exact,\n )\n ) {\n const fieldValues = generateWatchOutput(\n _name.current as InternalFieldName | InternalFieldName[],\n control._names,\n formState.values || control._formValues,\n );\n\n updateValue(\n isUndefined(_name.current) ||\n (isObject(fieldValues) && !objectHasFunction(fieldValues))\n ? { ...fieldValues }\n : Array.isArray(fieldValues)\n ? [...fieldValues]\n : isUndefined(fieldValues)\n ? defaultValue\n : fieldValues,\n );\n }\n },\n [control, exact, defaultValue],\n );\n\n useSubscribe({\n disabled,\n subject: control._subjects.watch,\n callback,\n });\n\n const [value, updateValue] = React.useState(\n isUndefined(defaultValue)\n ? control._getWatch(name as InternalFieldName)\n : defaultValue,\n );\n\n React.useEffect(() => {\n control._removeUnmounted();\n });\n\n return value;\n}\n","import React from 'react';\n\nimport getEventValue from './logic/getEventValue';\nimport isNameInFieldArray from './logic/isNameInFieldArray';\nimport get from './utils/get';\nimport { EVENTS } from './constants';\nimport {\n ControllerFieldState,\n Field,\n FieldPath,\n FieldPathValue,\n FieldValues,\n InternalFieldName,\n UseControllerProps,\n UseControllerReturn,\n} from './types';\nimport { useFormContext } from './useFormContext';\nimport { useFormState } from './useFormState';\nimport { useWatch } from './useWatch';\n\n/**\n * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.\n *\n * @remarks\n * [API](https://react-hook-form.com/api/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px)\n *\n * @param props - the path name to the form field value, and validation rules.\n *\n * @returns field properties, field and form state. {@link UseControllerReturn}\n *\n * @example\n * ```tsx\n * function Input(props) {\n * const { field, fieldState, formState } = useController(props);\n * return (\n *
\n * \n *

{fieldState.isTouched && \"Touched\"}

\n *

{formState.isSubmitted ? \"submitted\" : \"\"}

\n *
\n * );\n * }\n * ```\n */\nexport function useController<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath = FieldPath,\n>(\n props: UseControllerProps,\n): UseControllerReturn {\n const methods = useFormContext();\n const { name, control = methods.control, shouldUnregister } = props;\n const isArrayField = isNameInFieldArray(control._names.array, name);\n const value = useWatch({\n control,\n name,\n defaultValue: get(\n control._formValues,\n name,\n get(control._defaultValues, name, props.defaultValue),\n ),\n exact: true,\n }) as FieldPathValue;\n const formState = useFormState({\n control,\n name,\n });\n\n const _registerProps = React.useRef(\n control.register(name, {\n ...props.rules,\n value,\n }),\n );\n\n React.useEffect(() => {\n const updateMounted = (name: InternalFieldName, value: boolean) => {\n const field: Field = get(control._fields, name);\n\n if (field) {\n field._f.mount = value;\n }\n };\n\n updateMounted(name, true);\n\n return () => {\n const _shouldUnregisterField =\n control._options.shouldUnregister || shouldUnregister;\n\n (\n isArrayField\n ? _shouldUnregisterField && !control._stateFlags.action\n : _shouldUnregisterField\n )\n ? control.unregister(name)\n : updateMounted(name, false);\n };\n }, [name, control, isArrayField, shouldUnregister]);\n\n return {\n field: {\n name,\n value,\n onChange: React.useCallback(\n (event) => {\n _registerProps.current.onChange({\n target: {\n value: getEventValue(event),\n name: name as InternalFieldName,\n },\n type: EVENTS.CHANGE,\n });\n },\n [name],\n ),\n onBlur: React.useCallback(() => {\n _registerProps.current.onBlur({\n target: {\n value: get(control._formValues, name),\n name: name as InternalFieldName,\n },\n type: EVENTS.BLUR,\n });\n }, [name, control]),\n ref: React.useCallback(\n (elm) => {\n const field = get(control._fields, name);\n\n if (elm && field && elm.focus) {\n field._f.ref = {\n focus: () => elm.focus(),\n select: () => elm.select(),\n setCustomValidity: (message: string) =>\n elm.setCustomValidity(message),\n reportValidity: () => elm.reportValidity(),\n };\n }\n },\n [name, control._fields],\n ),\n },\n formState,\n fieldState: Object.defineProperties(\n {},\n {\n invalid: {\n get: () => !!get(formState.errors, name),\n },\n isDirty: {\n get: () => !!get(formState.dirtyFields, name),\n },\n isTouched: {\n get: () => !!get(formState.touchedFields, name),\n },\n error: {\n get: () => get(formState.errors, name),\n },\n },\n ) as ControllerFieldState,\n };\n}\n","import { ControllerProps, FieldPath, FieldValues } from './types';\nimport { useController } from './useController';\n\n/**\n * Component based on `useController` hook to work with controlled component.\n *\n * @remarks\n * [API](https://react-hook-form.com/api/usecontroller/controller) • [Demo](https://codesandbox.io/s/react-hook-form-v6-controller-ts-jwyzw) • [Video](https://www.youtube.com/watch?v=N2UNk_UCVyA)\n *\n * @param props - the path name to the form field value, and validation rules.\n *\n * @returns provide field handler functions, field and form state.\n *\n * @example\n * ```tsx\n * function App() {\n * const { control } = useForm({\n * defaultValues: {\n * test: \"\"\n * }\n * });\n *\n * return (\n *
\n * (\n * <>\n * \n *

{formState.isSubmitted ? \"submitted\" : \"\"}

\n *

{fieldState.isTouched ? \"touched\" : \"\"}

\n * \n * )}\n * />\n * \n * );\n * }\n * ```\n */\nconst Controller = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath = FieldPath,\n>(\n props: ControllerProps,\n) => props.render(useController(props));\n\nexport { Controller };\n","import {\n InternalFieldErrors,\n InternalFieldName,\n ValidateResult,\n} from '../types';\n\nexport default (\n name: InternalFieldName,\n validateAllFieldCriteria: boolean,\n errors: InternalFieldErrors,\n type: string,\n message: ValidateResult,\n) =>\n validateAllFieldCriteria\n ? {\n ...errors[name],\n types: {\n ...(errors[name] && errors[name]!.types ? errors[name]!.types : {}),\n [type]: message || true,\n },\n }\n : {};\n","export default (value: string) => /^\\w*$/.test(value);\n","import compact from './compact';\n\nexport default (input: string): string[] =>\n compact(input.replace(/[\"|']|\\]/g, '').split(/\\.|\\[/));\n","import { FieldValues } from '../types';\n\nimport isKey from './isKey';\nimport isObject from './isObject';\nimport stringToPath from './stringToPath';\n\nexport default function set(\n object: FieldValues,\n path: string,\n value?: unknown,\n) {\n let index = -1;\n const tempPath = isKey(path) ? [path] : stringToPath(path);\n const length = tempPath.length;\n const lastIndex = length - 1;\n\n while (++index < length) {\n const key = tempPath[index];\n let newValue = value;\n\n if (index !== lastIndex) {\n const objValue = object[key];\n newValue =\n isObject(objValue) || Array.isArray(objValue)\n ? objValue\n : !isNaN(+tempPath[index + 1])\n ? []\n : {};\n }\n object[key] = newValue;\n object = object[key];\n }\n return object;\n}\n","import { FieldRefs, InternalFieldName } from '../types';\nimport { get } from '../utils';\nimport isObject from '../utils/isObject';\nimport isUndefined from '../utils/isUndefined';\n\nconst focusFieldBy = (\n fields: FieldRefs,\n callback: (name: string) => boolean,\n fieldsNames?: Set | InternalFieldName[],\n) => {\n for (const key of fieldsNames || Object.keys(fields)) {\n const field = get(fields, key);\n\n if (field) {\n const { _f, ...currentField } = field;\n\n if (_f && callback(_f.name)) {\n if (_f.ref.focus && isUndefined(_f.ref.focus())) {\n break;\n } else if (_f.refs) {\n _f.refs[0].focus();\n break;\n }\n } else if (isObject(currentField)) {\n focusFieldBy(currentField, callback);\n }\n }\n }\n};\n\nexport default focusFieldBy;\n","export default () => {\n const d =\n typeof performance === 'undefined' ? Date.now() : performance.now() * 1000;\n\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16 + d) % 16 | 0;\n\n return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n","import { FieldArrayMethodProps, InternalFieldName } from '../types';\nimport isUndefined from '../utils/isUndefined';\n\nexport default (\n name: InternalFieldName,\n index: number,\n options: FieldArrayMethodProps = {},\n): string =>\n options.shouldFocus || isUndefined(options.shouldFocus)\n ? options.focusName ||\n `${name}.${isUndefined(options.focusIndex) ? index : options.focusIndex}.`\n : '';\n","import { InternalFieldName, Names } from '../types';\n\nexport default (\n name: InternalFieldName,\n _names: Names,\n isBlurEvent?: boolean,\n) =>\n !isBlurEvent &&\n (_names.watchAll ||\n _names.watch.has(name) ||\n [..._names.watch].some(\n (watchName) =>\n name.startsWith(watchName) &&\n /^\\.\\w+/.test(name.slice(watchName.length)),\n ));\n","import convertToArrayPayload from './convertToArrayPayload';\n\nexport default function append(data: T[], value: T | T[]): T[] {\n return [...data, ...convertToArrayPayload(value)];\n}\n","export default typeof window !== 'undefined' &&\n typeof window.HTMLElement !== 'undefined' &&\n typeof document !== 'undefined';\n","import isFunction from './isFunction';\nimport isObject from './isObject';\nimport isWeb from './isWeb';\n\nexport default function cloneObject(data: T): T {\n let copy: any;\n const isArray = Array.isArray(data);\n\n if (data instanceof Date) {\n copy = new Date(data);\n } else if (data instanceof Set) {\n copy = new Set(data);\n } else if (\n !(isWeb && (data instanceof Blob || data instanceof FileList)) &&\n (isArray || isObject(data))\n ) {\n copy = isArray ? [] : {};\n for (const key in data) {\n if (isFunction(data[key])) {\n copy = data;\n break;\n }\n copy[key] = cloneObject(data[key]);\n }\n } else {\n return data;\n }\n\n return copy;\n}\n","export default (value: T | T[]): undefined[] | undefined =>\n Array.isArray(value) ? value.map(() => undefined) : undefined;\n","import convertToArrayPayload from './convertToArrayPayload';\n\nexport default function insert(data: T[], index: number): (T | undefined)[];\nexport default function insert(\n data: T[],\n index: number,\n value: T | T[],\n): T[];\nexport default function insert(\n data: T[],\n index: number,\n value?: T | T[],\n): (T | undefined)[] {\n return [\n ...data.slice(0, index),\n ...convertToArrayPayload(value),\n ...data.slice(index),\n ];\n}\n","import isUndefined from './isUndefined';\n\nexport default (\n data: (T | undefined)[],\n from: number,\n to: number,\n): (T | undefined)[] => {\n if (!Array.isArray(data)) {\n return [];\n }\n\n if (isUndefined(data[to])) {\n data[to] = undefined;\n }\n data.splice(to, 0, data.splice(from, 1)[0]);\n\n return data;\n};\n","import convertToArrayPayload from './convertToArrayPayload';\n\nexport default function prepend(data: T[], value: T | T[]): T[] {\n return [...convertToArrayPayload(value), ...convertToArrayPayload(data)];\n}\n","import compact from './compact';\nimport convertToArrayPayload from './convertToArrayPayload';\nimport isUndefined from './isUndefined';\n\nfunction removeAtIndexes(data: T[], indexes: number[]): T[] {\n let i = 0;\n const temp = [...data];\n\n for (const index of indexes) {\n temp.splice(index - i, 1);\n i++;\n }\n\n return compact(temp).length ? temp : [];\n}\n\nexport default (data: T[], index?: number | number[]): T[] =>\n isUndefined(index)\n ? []\n : removeAtIndexes(\n data,\n (convertToArrayPayload(index) as number[]).sort((a, b) => a - b),\n );\n","export default (data: T[], indexA: number, indexB: number): void => {\n data[indexA] = [data[indexB], (data[indexB] = data[indexA])][0];\n};\n","import isEmptyObject from './isEmptyObject';\nimport isKey from './isKey';\nimport isObject from './isObject';\nimport isUndefined from './isUndefined';\nimport stringToPath from './stringToPath';\n\nfunction baseGet(object: any, updatePath: (string | number)[]) {\n const length = updatePath.slice(0, -1).length;\n let index = 0;\n\n while (index < length) {\n object = isUndefined(object) ? index++ : object[updatePath[index++]];\n }\n\n return object;\n}\n\nexport default function unset(object: any, path: string) {\n const updatePath = isKey(path) ? [path] : stringToPath(path);\n const childObject =\n updatePath.length == 1 ? object : baseGet(object, updatePath);\n const key = updatePath[updatePath.length - 1];\n let previousObjRef;\n\n if (childObject) {\n delete childObject[key];\n }\n\n for (let k = 0; k < updatePath.slice(0, -1).length; k++) {\n let index = -1;\n let objectRef;\n const currentPaths = updatePath.slice(0, -(k + 1));\n const currentPathsLength = currentPaths.length - 1;\n\n if (k > 0) {\n previousObjRef = object;\n }\n\n while (++index < currentPaths.length) {\n const item = currentPaths[index];\n objectRef = objectRef ? objectRef[item] : object[item];\n\n if (\n currentPathsLength === index &&\n ((isObject(objectRef) && isEmptyObject(objectRef)) ||\n (Array.isArray(objectRef) &&\n !objectRef.filter((data) => !isUndefined(data)).length))\n ) {\n previousObjRef ? delete previousObjRef[item] : delete object[item];\n }\n\n previousObjRef = objectRef;\n }\n }\n\n return object;\n}\n","export default (fieldValues: T[], index: number, value: T) => {\n fieldValues[index] = value;\n return fieldValues;\n};\n","import React from 'react';\n\nimport focusFieldBy from './logic/focusFieldBy';\nimport generateId from './logic/generateId';\nimport getFocusFieldName from './logic/getFocusFieldName';\nimport isWatched from './logic/isWatched';\nimport appendAt from './utils/append';\nimport cloneObject from './utils/cloneObject';\nimport convertToArrayPayload from './utils/convertToArrayPayload';\nimport fillEmptyArray from './utils/fillEmptyArray';\nimport get from './utils/get';\nimport insertAt from './utils/insert';\nimport moveArrayAt from './utils/move';\nimport prependAt from './utils/prepend';\nimport removeArrayAt from './utils/remove';\nimport set from './utils/set';\nimport swapArrayAt from './utils/swap';\nimport unset from './utils/unset';\nimport updateAt from './utils/update';\nimport {\n FieldArray,\n FieldArrayMethodProps,\n FieldArrayPath,\n FieldArrayWithId,\n FieldErrors,\n FieldPath,\n FieldValues,\n InternalFieldName,\n UseFieldArrayProps,\n UseFieldArrayReturn,\n} from './types';\nimport { useFormContext } from './useFormContext';\nimport { useSubscribe } from './useSubscribe';\n\n/**\n * A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc.\n *\n * @remarks\n * [API](https://react-hook-form.com/api/usefieldarray) • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn)\n *\n * @param props - useFieldArray props\n *\n * @returns methods - functions to manipulate with the Field Arrays (dynamic inputs) {@link UseFieldArrayReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, control, handleSubmit, reset, trigger, setError } = useForm({\n * defaultValues: {\n * test: []\n * }\n * });\n * const { fields, append } = useFieldArray({\n * control,\n * name: \"test\"\n * });\n *\n * return (\n *
console.log(data))}>\n * {fields.map((item, index) => (\n * \n * ))}\n * \n * \n *
\n * );\n * }\n * ```\n */\nexport function useFieldArray<\n TFieldValues extends FieldValues = FieldValues,\n TFieldArrayName extends FieldArrayPath = FieldArrayPath,\n TKeyName extends string = 'id',\n>(\n props: UseFieldArrayProps,\n): UseFieldArrayReturn {\n const methods = useFormContext();\n const {\n control = methods.control,\n name,\n keyName = 'id' as TKeyName,\n shouldUnregister,\n } = props;\n const [fields, setFields] = React.useState<\n Partial>[]\n >(control._getFieldArray(name));\n const ids = React.useRef(\n control._getFieldArray(name).map(generateId),\n );\n const _fieldIds = React.useRef(fields);\n const _name = React.useRef(name);\n const _actioned = React.useRef(false);\n\n _name.current = name;\n _fieldIds.current = fields;\n control._names.array.add(name);\n\n const callback = React.useCallback(\n ({\n values,\n name: fieldArrayName,\n }: {\n values?: FieldValues;\n name?: InternalFieldName;\n }) => {\n if (fieldArrayName === _name.current || !fieldArrayName) {\n const fieldValues = get(values, _name.current, []);\n setFields(fieldValues);\n ids.current = fieldValues.map(generateId);\n }\n },\n [],\n );\n\n useSubscribe({\n callback,\n subject: control._subjects.array,\n });\n\n const updateValues = React.useCallback(\n <\n T extends Partial<\n FieldArrayWithId\n >[],\n >(\n updatedFieldArrayValues: T,\n ) => {\n _actioned.current = true;\n control._updateFieldArray(name, updatedFieldArrayValues);\n },\n [control, name],\n );\n\n const append = (\n value:\n | Partial>\n | Partial>[],\n options?: FieldArrayMethodProps,\n ) => {\n const appendValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = appendAt(\n control._getFieldArray(name),\n appendValue,\n );\n control._names.focus = getFocusFieldName(\n name,\n updatedFieldArrayValues.length - 1,\n options,\n );\n ids.current = appendAt(ids.current, appendValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._updateFieldArray(name, updatedFieldArrayValues, appendAt, {\n argA: fillEmptyArray(value),\n });\n };\n\n const prepend = (\n value:\n | Partial>\n | Partial>[],\n options?: FieldArrayMethodProps,\n ) => {\n const prependValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = prependAt(\n control._getFieldArray(name),\n prependValue,\n );\n control._names.focus = getFocusFieldName(name, 0, options);\n ids.current = prependAt(ids.current, prependValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._updateFieldArray(name, updatedFieldArrayValues, prependAt, {\n argA: fillEmptyArray(value),\n });\n };\n\n const remove = (index?: number | number[]) => {\n const updatedFieldArrayValues: Partial<\n FieldArrayWithId\n >[] = removeArrayAt(control._getFieldArray(name), index);\n ids.current = removeArrayAt(ids.current, index);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._updateFieldArray(name, updatedFieldArrayValues, removeArrayAt, {\n argA: index,\n });\n };\n\n const insert = (\n index: number,\n value:\n | Partial>\n | Partial>[],\n options?: FieldArrayMethodProps,\n ) => {\n const insertValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = insertAt(\n control._getFieldArray(name),\n index,\n insertValue,\n );\n control._names.focus = getFocusFieldName(name, index, options);\n ids.current = insertAt(ids.current, index, insertValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._updateFieldArray(name, updatedFieldArrayValues, insertAt, {\n argA: index,\n argB: fillEmptyArray(value),\n });\n };\n\n const swap = (indexA: number, indexB: number) => {\n const updatedFieldArrayValues = control._getFieldArray(name);\n swapArrayAt(updatedFieldArrayValues, indexA, indexB);\n swapArrayAt(ids.current, indexA, indexB);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._updateFieldArray(\n name,\n updatedFieldArrayValues,\n swapArrayAt,\n {\n argA: indexA,\n argB: indexB,\n },\n false,\n );\n };\n\n const move = (from: number, to: number) => {\n const updatedFieldArrayValues = control._getFieldArray(name);\n moveArrayAt(updatedFieldArrayValues, from, to);\n moveArrayAt(ids.current, from, to);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._updateFieldArray(\n name,\n updatedFieldArrayValues,\n moveArrayAt,\n {\n argA: from,\n argB: to,\n },\n false,\n );\n };\n\n const update = (\n index: number,\n value: FieldArray,\n ) => {\n const updateValue = cloneObject(value);\n const updatedFieldArrayValues = updateAt(\n control._getFieldArray<\n FieldArrayWithId\n >(name),\n index,\n updateValue as FieldArrayWithId,\n );\n ids.current = [...updatedFieldArrayValues].map((item, i) =>\n !item || i === index ? generateId() : ids.current[i],\n );\n updateValues(updatedFieldArrayValues);\n setFields([...updatedFieldArrayValues]);\n control._updateFieldArray(\n name,\n updatedFieldArrayValues,\n updateAt,\n {\n argA: index,\n argB: updateValue,\n },\n true,\n false,\n );\n };\n\n const replace = (\n value:\n | Partial>\n | Partial>[],\n ) => {\n const updatedFieldArrayValues = convertToArrayPayload(cloneObject(value));\n ids.current = updatedFieldArrayValues.map(generateId);\n updateValues([...updatedFieldArrayValues]);\n setFields([...updatedFieldArrayValues]);\n control._updateFieldArray(\n name,\n [...updatedFieldArrayValues],\n (data: T): T => data,\n {},\n true,\n false,\n );\n };\n\n React.useEffect(() => {\n control._stateFlags.action = false;\n\n isWatched(name, control._names) && control._subjects.state.next({});\n\n if (_actioned.current) {\n control._executeSchema([name]).then((result) => {\n const error = get(result.errors, name);\n const existingError = get(control._formState.errors, name);\n\n if (\n existingError ? !error && existingError.type : error && error.type\n ) {\n error\n ? set(control._formState.errors, name, error)\n : unset(control._formState.errors, name);\n control._subjects.state.next({\n errors: control._formState.errors as FieldErrors,\n });\n }\n });\n }\n\n control._subjects.watch.next({\n name,\n values: control._formValues,\n });\n\n control._names.focus &&\n focusFieldBy(control._fields, (key: string) =>\n key.startsWith(control._names.focus),\n );\n\n control._names.focus = '';\n\n control._proxyFormState.isValid && control._updateValid();\n }, [fields, name, control]);\n\n React.useEffect(() => {\n !get(control._formValues, name) && control._updateFieldArray(name);\n\n return () => {\n (control._options.shouldUnregister || shouldUnregister) &&\n control.unregister(name as FieldPath);\n };\n }, [name, control, keyName, shouldUnregister]);\n\n return {\n swap: React.useCallback(swap, [updateValues, name, control]),\n move: React.useCallback(move, [updateValues, name, control]),\n prepend: React.useCallback(prepend, [updateValues, name, control]),\n append: React.useCallback(append, [updateValues, name, control]),\n remove: React.useCallback(remove, [updateValues, name, control]),\n insert: React.useCallback(insert, [updateValues, name, control]),\n update: React.useCallback(update, [updateValues, name, control]),\n replace: React.useCallback(replace, [updateValues, name, control]),\n fields: React.useMemo(\n () =>\n fields.map((field, index) => ({\n ...field,\n [keyName]: ids.current[index] || generateId(),\n })) as FieldArrayWithId[],\n [fields, keyName],\n ),\n };\n}\n","import { Noop } from '../types';\n\nexport type Observer = {\n next: (value: T) => void;\n};\n\nexport type Subscription = {\n unsubscribe: Noop;\n};\n\nexport type Subject = {\n readonly observers: Observer[];\n subscribe: (value: Observer) => Subscription;\n unsubscribe: Noop;\n} & Observer;\n\nexport default function createSubject(): Subject {\n let _observers: Observer[] = [];\n\n const next = (value: T) => {\n for (const observer of _observers) {\n observer.next(value);\n }\n };\n\n const subscribe = (observer: Observer): Subscription => {\n _observers.push(observer);\n return {\n unsubscribe: () => {\n _observers = _observers.filter((o) => o !== observer);\n },\n };\n };\n\n const unsubscribe = () => {\n _observers = [];\n };\n\n return {\n get observers() {\n return _observers;\n },\n next,\n subscribe,\n unsubscribe,\n };\n}\n","import { Primitive } from '../types';\n\nimport isNullOrUndefined from './isNullOrUndefined';\nimport { isObjectType } from './isObject';\n\nexport default (value: unknown): value is Primitive =>\n isNullOrUndefined(value) || !isObjectType(value);\n","import isObject from '../utils/isObject';\n\nimport isDateObject from './isDateObject';\nimport isPrimitive from './isPrimitive';\n\nexport default function deepEqual(object1: any, object2: any) {\n if (isPrimitive(object1) || isPrimitive(object2)) {\n return object1 === object2;\n }\n\n if (isDateObject(object1) && isDateObject(object2)) {\n return object1.getTime() === object2.getTime();\n }\n\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (const key of keys1) {\n const val1 = object1[key];\n\n if (!keys2.includes(key)) {\n return false;\n }\n\n if (key !== 'ref') {\n const val2 = object2[key];\n\n if (\n (isDateObject(val1) && isDateObject(val2)) ||\n (isObject(val1) && isObject(val2)) ||\n (Array.isArray(val1) && Array.isArray(val2))\n ? !deepEqual(val1, val2)\n : val1 !== val2\n ) {\n return false;\n }\n }\n }\n\n return true;\n}\n","import { VALIDATION_MODE } from '../constants';\nimport { Mode } from '../types';\n\nexport default (\n mode?: Mode,\n): {\n isOnSubmit: boolean;\n isOnBlur: boolean;\n isOnChange: boolean;\n isOnAll: boolean;\n isOnTouch: boolean;\n} => ({\n isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,\n isOnBlur: mode === VALIDATION_MODE.onBlur,\n isOnChange: mode === VALIDATION_MODE.onChange,\n isOnAll: mode === VALIDATION_MODE.all,\n isOnTouch: mode === VALIDATION_MODE.onTouched,\n});\n","export default (value: unknown): value is boolean => typeof value === 'boolean';\n","import { FieldElement } from '../types';\n\nexport default (element: FieldElement): element is HTMLInputElement =>\n element.type === 'file';\n","export default (value: unknown): value is HTMLElement => {\n const owner = value ? ((value as HTMLElement).ownerDocument as Document) : 0;\n const ElementClass =\n owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement;\n return value instanceof ElementClass;\n};\n","import { FieldElement } from '../types';\n\nexport default (element: FieldElement): element is HTMLSelectElement =>\n element.type === `select-multiple`;\n","import { FieldElement } from '../types';\n\nexport default (element: FieldElement): element is HTMLInputElement =>\n element.type === 'radio';\n","import { FieldElement } from '../types';\n\nimport isCheckBoxInput from './isCheckBoxInput';\nimport isRadioInput from './isRadioInput';\n\nexport default (ref: FieldElement): ref is HTMLInputElement =>\n isRadioInput(ref) || isCheckBoxInput(ref);\n","import { Ref } from '../types';\n\nimport isHTMLElement from './isHTMLElement';\n\nexport default (ref: Ref) => isHTMLElement(ref) && ref.isConnected;\n","import deepEqual from '../utils/deepEqual';\nimport isNullOrUndefined from '../utils/isNullOrUndefined';\nimport isObject from '../utils/isObject';\nimport isPrimitive from '../utils/isPrimitive';\nimport isUndefined from '../utils/isUndefined';\nimport objectHasFunction from '../utils/objectHasFunction';\n\nfunction markFieldsDirty(data: U, fields: Record = {}) {\n const isParentNodeArray = Array.isArray(data);\n\n if (isObject(data) || isParentNodeArray) {\n for (const key in data) {\n if (\n Array.isArray(data[key]) ||\n (isObject(data[key]) && !objectHasFunction(data[key]))\n ) {\n fields[key] = Array.isArray(data[key]) ? [] : {};\n markFieldsDirty(data[key], fields[key]);\n } else if (!isNullOrUndefined(data[key])) {\n fields[key] = true;\n }\n }\n }\n\n return fields;\n}\n\nfunction getDirtyFieldsFromDefaultValues(\n data: T,\n formValues: T,\n dirtyFieldsFromValues: any,\n) {\n const isParentNodeArray = Array.isArray(data);\n\n if (isObject(data) || isParentNodeArray) {\n for (const key in data) {\n if (\n Array.isArray(data[key]) ||\n (isObject(data[key]) && !objectHasFunction(data[key]))\n ) {\n if (\n isUndefined(formValues) ||\n isPrimitive(dirtyFieldsFromValues[key])\n ) {\n dirtyFieldsFromValues[key] = Array.isArray(data[key])\n ? markFieldsDirty(data[key], [])\n : { ...markFieldsDirty(data[key]) };\n } else {\n getDirtyFieldsFromDefaultValues(\n data[key],\n isNullOrUndefined(formValues) ? {} : formValues[key],\n dirtyFieldsFromValues[key],\n );\n }\n } else {\n dirtyFieldsFromValues[key] = !deepEqual(data[key], formValues[key]);\n }\n }\n }\n\n return dirtyFieldsFromValues;\n}\n\nexport default (defaultValues: T, formValues: T) =>\n getDirtyFieldsFromDefaultValues(\n defaultValues,\n formValues,\n markFieldsDirty(formValues),\n );\n","import isUndefined from '../utils/isUndefined';\n\ntype CheckboxFieldResult = {\n isValid: boolean;\n value: string | string[] | boolean | undefined;\n};\n\nconst defaultResult: CheckboxFieldResult = {\n value: false,\n isValid: false,\n};\n\nconst validResult = { value: true, isValid: true };\n\nexport default (options?: HTMLInputElement[]): CheckboxFieldResult => {\n if (Array.isArray(options)) {\n if (options.length > 1) {\n const values = options\n .filter((option) => option && option.checked && !option.disabled)\n .map((option) => option.value);\n return { value: values, isValid: !!values.length };\n }\n\n return options[0].checked && !options[0].disabled\n ? // @ts-expect-error expected to work in the browser\n options[0].attributes && !isUndefined(options[0].attributes.value)\n ? isUndefined(options[0].value) || options[0].value === ''\n ? validResult\n : { value: options[0].value, isValid: true }\n : validResult\n : defaultResult;\n }\n\n return defaultResult;\n};\n","import { Field, NativeFieldValue } from '../types';\nimport isNullOrUndefined from '../utils/isNullOrUndefined';\nimport isString from '../utils/isString';\nimport isUndefined from '../utils/isUndefined';\n\nexport default (\n value: T,\n { valueAsNumber, valueAsDate, setValueAs }: Field['_f'],\n) =>\n isUndefined(value)\n ? value\n : valueAsNumber\n ? value === '' || isNullOrUndefined(value)\n ? NaN\n : +value\n : valueAsDate && isString(value)\n ? new Date(value)\n : setValueAs\n ? setValueAs(value)\n : value;\n","type RadioFieldResult = {\n isValid: boolean;\n value: number | string | null;\n};\n\nconst defaultReturn: RadioFieldResult = {\n isValid: false,\n value: null,\n};\n\nexport default (options?: HTMLInputElement[]): RadioFieldResult =>\n Array.isArray(options)\n ? options.reduce(\n (previous, option): RadioFieldResult =>\n option && option.checked && !option.disabled\n ? {\n isValid: true,\n value: option.value,\n }\n : previous,\n defaultReturn,\n )\n : defaultReturn;\n","import { Field } from '../types';\nimport isCheckBox from '../utils/isCheckBoxInput';\nimport isFileInput from '../utils/isFileInput';\nimport isMultipleSelect from '../utils/isMultipleSelect';\nimport isRadioInput from '../utils/isRadioInput';\nimport isUndefined from '../utils/isUndefined';\n\nimport getCheckboxValue from './getCheckboxValue';\nimport getFieldValueAs from './getFieldValueAs';\nimport getRadioValue from './getRadioValue';\n\nexport default function getFieldValue(_f: Field['_f']) {\n const ref = _f.ref;\n\n if (_f.refs ? _f.refs.every((ref) => ref.disabled) : ref.disabled) {\n return;\n }\n\n if (isFileInput(ref)) {\n return ref.files;\n }\n\n if (isRadioInput(ref)) {\n return getRadioValue(_f.refs).value;\n }\n\n if (isMultipleSelect(ref)) {\n return [...ref.selectedOptions].map(({ value }) => value);\n }\n\n if (isCheckBox(ref)) {\n return getCheckboxValue(_f.refs).value;\n }\n\n return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);\n}\n","import {\n CriteriaMode,\n Field,\n FieldName,\n FieldRefs,\n FieldValues,\n InternalFieldName,\n} from '../types';\nimport { get } from '../utils';\nimport set from '../utils/set';\n\nexport default (\n fieldsNames: Set | InternalFieldName[],\n _fields: FieldRefs,\n criteriaMode?: CriteriaMode,\n shouldUseNativeValidation?: boolean | undefined,\n) => {\n const fields: Record = {};\n\n for (const name of fieldsNames) {\n const field: Field = get(_fields, name);\n\n field && set(fields, name, field._f);\n }\n\n return {\n criteriaMode,\n names: [...fieldsNames] as FieldName[],\n fields,\n shouldUseNativeValidation,\n };\n};\n","export default (value: unknown): value is RegExp => value instanceof RegExp;\n","import {\n ValidationRule,\n ValidationValue,\n ValidationValueMessage,\n} from '../types';\nimport isObject from '../utils/isObject';\nimport isRegex from '../utils/isRegex';\nimport isUndefined from '../utils/isUndefined';\n\nexport default (\n rule?: ValidationRule | ValidationValueMessage,\n) =>\n isUndefined(rule)\n ? undefined\n : isRegex(rule)\n ? rule.source\n : isObject(rule)\n ? isRegex(rule.value)\n ? rule.value.source\n : rule.value\n : rule;\n","import { Field } from '../types';\n\nexport default (options: Field['_f']) =>\n options.mount &&\n (options.required ||\n options.min ||\n options.max ||\n options.maxLength ||\n options.minLength ||\n options.pattern ||\n options.validate);\n","import { FieldError, FieldErrors, FieldValues } from '../types';\nimport get from '../utils/get';\nimport isKey from '../utils/isKey';\n\nexport default function schemaErrorLookup(\n errors: FieldErrors,\n _fields: FieldValues,\n name: string,\n): {\n error?: FieldError;\n name: string;\n} {\n const error = get(errors, name);\n\n if (error || isKey(name)) {\n return {\n error,\n name,\n };\n }\n\n const names = name.split('.');\n\n while (names.length) {\n const fieldName = names.join('.');\n const field = get(_fields, fieldName);\n const foundError = get(errors, fieldName);\n\n if (field && !Array.isArray(field) && name !== fieldName) {\n return { name };\n }\n\n if (foundError && foundError.type) {\n return {\n name: fieldName,\n error: foundError,\n };\n }\n\n names.pop();\n }\n\n return {\n name,\n };\n}\n","export default (\n isBlurEvent: boolean,\n isTouched: boolean,\n isSubmitted: boolean,\n reValidateMode: {\n isOnBlur: boolean;\n isOnChange: boolean;\n },\n mode: Partial<{\n isOnSubmit: boolean;\n isOnBlur: boolean;\n isOnChange: boolean;\n isOnTouch: boolean;\n isOnAll: boolean;\n }>,\n) => {\n if (mode.isOnAll) {\n return false;\n } else if (!isSubmitted && mode.isOnTouch) {\n return !(isTouched || isBlurEvent);\n } else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {\n return !isBlurEvent;\n } else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {\n return isBlurEvent;\n }\n return true;\n};\n","import compact from '../utils/compact';\nimport get from '../utils/get';\nimport unset from '../utils/unset';\n\nexport default (ref: T, name: string) =>\n !compact(get(ref, name)).length && unset(ref, name);\n","import React from 'react';\n\nimport { Message } from '../types';\nimport isString from '../utils/isString';\n\nexport default (value: unknown): value is Message =>\n isString(value) || React.isValidElement(value as JSX.Element);\n","import { FieldError, Ref, ValidateResult } from '../types';\nimport isBoolean from '../utils/isBoolean';\nimport isMessage from '../utils/isMessage';\n\nexport default function getValidateError(\n result: ValidateResult,\n ref: Ref,\n type = 'validate',\n): FieldError | void {\n if (\n isMessage(result) ||\n (Array.isArray(result) && result.every(isMessage)) ||\n (isBoolean(result) && !result)\n ) {\n return {\n type,\n message: isMessage(result) ? result : '',\n ref,\n };\n }\n}\n","import { ValidationRule } from '../types';\nimport isObject from '../utils/isObject';\nimport isRegex from '../utils/isRegex';\n\nexport default (validationData?: ValidationRule) =>\n isObject(validationData) && !isRegex(validationData)\n ? validationData\n : {\n value: validationData,\n message: '',\n };\n","import { INPUT_VALIDATION_RULES } from '../constants';\nimport {\n Field,\n FieldError,\n InternalFieldErrors,\n Message,\n NativeFieldValue,\n} from '../types';\nimport isBoolean from '../utils/isBoolean';\nimport isCheckBoxInput from '../utils/isCheckBoxInput';\nimport isEmptyObject from '../utils/isEmptyObject';\nimport isFileInput from '../utils/isFileInput';\nimport isFunction from '../utils/isFunction';\nimport isMessage from '../utils/isMessage';\nimport isNullOrUndefined from '../utils/isNullOrUndefined';\nimport isObject from '../utils/isObject';\nimport isRadioInput from '../utils/isRadioInput';\nimport isRegex from '../utils/isRegex';\nimport isString from '../utils/isString';\n\nimport appendErrors from './appendErrors';\nimport getCheckboxValue from './getCheckboxValue';\nimport getRadioValue from './getRadioValue';\nimport getValidateError from './getValidateError';\nimport getValueAndMessage from './getValueAndMessage';\n\nexport default async (\n field: Field,\n inputValue: T,\n validateAllFieldCriteria: boolean,\n shouldUseNativeValidation?: boolean,\n): Promise => {\n const {\n ref,\n refs,\n required,\n maxLength,\n minLength,\n min,\n max,\n pattern,\n validate,\n name,\n valueAsNumber,\n mount,\n disabled,\n } = field._f;\n if (!mount || disabled) {\n return {};\n }\n const inputRef: HTMLInputElement = refs ? refs[0] : (ref as HTMLInputElement);\n const setCustomValidity = (message?: string | boolean) => {\n if (shouldUseNativeValidation && inputRef.reportValidity) {\n inputRef.setCustomValidity(isBoolean(message) ? '' : message || ' ');\n inputRef.reportValidity();\n }\n };\n const error: InternalFieldErrors = {};\n const isRadio = isRadioInput(ref);\n const isCheckBox = isCheckBoxInput(ref);\n const isRadioOrCheckbox = isRadio || isCheckBox;\n const isEmpty =\n ((valueAsNumber || isFileInput(ref)) && !ref.value) ||\n inputValue === '' ||\n (Array.isArray(inputValue) && !inputValue.length);\n const appendErrorsCurry = appendErrors.bind(\n null,\n name,\n validateAllFieldCriteria,\n error,\n );\n const getMinMaxMessage = (\n exceedMax: boolean,\n maxLengthMessage: Message,\n minLengthMessage: Message,\n maxType = INPUT_VALIDATION_RULES.maxLength,\n minType = INPUT_VALIDATION_RULES.minLength,\n ) => {\n const message = exceedMax ? maxLengthMessage : minLengthMessage;\n error[name] = {\n type: exceedMax ? maxType : minType,\n message,\n ref,\n ...appendErrorsCurry(exceedMax ? maxType : minType, message),\n };\n };\n\n if (\n required &&\n ((!isRadioOrCheckbox && (isEmpty || isNullOrUndefined(inputValue))) ||\n (isBoolean(inputValue) && !inputValue) ||\n (isCheckBox && !getCheckboxValue(refs).isValid) ||\n (isRadio && !getRadioValue(refs).isValid))\n ) {\n const { value, message } = isMessage(required)\n ? { value: !!required, message: required }\n : getValueAndMessage(required);\n\n if (value) {\n error[name] = {\n type: INPUT_VALIDATION_RULES.required,\n message,\n ref: inputRef,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(message);\n return error;\n }\n }\n }\n\n if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) {\n let exceedMax;\n let exceedMin;\n const maxOutput = getValueAndMessage(max);\n const minOutput = getValueAndMessage(min);\n\n if (!isNullOrUndefined(inputValue) && !isNaN(inputValue as number)) {\n const valueNumber =\n (ref as HTMLInputElement).valueAsNumber || +inputValue;\n if (!isNullOrUndefined(maxOutput.value)) {\n exceedMax = valueNumber > maxOutput.value;\n }\n if (!isNullOrUndefined(minOutput.value)) {\n exceedMin = valueNumber < minOutput.value;\n }\n } else {\n const valueDate =\n (ref as HTMLInputElement).valueAsDate || new Date(inputValue as string);\n if (isString(maxOutput.value)) {\n exceedMax = valueDate > new Date(maxOutput.value);\n }\n if (isString(minOutput.value)) {\n exceedMin = valueDate < new Date(minOutput.value);\n }\n }\n\n if (exceedMax || exceedMin) {\n getMinMaxMessage(\n !!exceedMax,\n maxOutput.message,\n minOutput.message,\n INPUT_VALIDATION_RULES.max,\n INPUT_VALIDATION_RULES.min,\n );\n if (!validateAllFieldCriteria) {\n setCustomValidity(error[name]!.message);\n return error;\n }\n }\n }\n\n if ((maxLength || minLength) && !isEmpty && isString(inputValue)) {\n const maxLengthOutput = getValueAndMessage(maxLength);\n const minLengthOutput = getValueAndMessage(minLength);\n const exceedMax =\n !isNullOrUndefined(maxLengthOutput.value) &&\n inputValue.length > maxLengthOutput.value;\n const exceedMin =\n !isNullOrUndefined(minLengthOutput.value) &&\n inputValue.length < minLengthOutput.value;\n\n if (exceedMax || exceedMin) {\n getMinMaxMessage(\n exceedMax,\n maxLengthOutput.message,\n minLengthOutput.message,\n );\n if (!validateAllFieldCriteria) {\n setCustomValidity(error[name]!.message);\n return error;\n }\n }\n }\n\n if (pattern && !isEmpty && isString(inputValue)) {\n const { value: patternValue, message } = getValueAndMessage(pattern);\n\n if (isRegex(patternValue) && !inputValue.match(patternValue)) {\n error[name] = {\n type: INPUT_VALIDATION_RULES.pattern,\n message,\n ref,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(message);\n return error;\n }\n }\n }\n\n if (validate) {\n if (isFunction(validate)) {\n const result = await validate(inputValue);\n const validateError = getValidateError(result, inputRef);\n\n if (validateError) {\n error[name] = {\n ...validateError,\n ...appendErrorsCurry(\n INPUT_VALIDATION_RULES.validate,\n validateError.message,\n ),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(validateError.message);\n return error;\n }\n }\n } else if (isObject(validate)) {\n let validationResult = {} as FieldError;\n\n for (const key in validate) {\n if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {\n break;\n }\n\n const validateError = getValidateError(\n await validate[key](inputValue),\n inputRef,\n key,\n );\n\n if (validateError) {\n validationResult = {\n ...validateError,\n ...appendErrorsCurry(key, validateError.message),\n };\n\n setCustomValidity(validateError.message);\n\n if (validateAllFieldCriteria) {\n error[name] = validationResult;\n }\n }\n }\n\n if (!isEmptyObject(validationResult)) {\n error[name] = {\n ref: inputRef,\n ...validationResult,\n };\n if (!validateAllFieldCriteria) {\n return error;\n }\n }\n }\n }\n\n setCustomValidity(true);\n return error;\n};\n","import { EVENTS, VALIDATION_MODE } from '../constants';\nimport {\n BatchFieldArrayUpdate,\n ChangeHandler,\n DeepPartial,\n DelayCallback,\n EventType,\n Field,\n FieldError,\n FieldErrors,\n FieldNamesMarkedBoolean,\n FieldPath,\n FieldRefs,\n FieldValues,\n FormState,\n GetIsDirty,\n InternalFieldName,\n Names,\n Path,\n Ref,\n ResolverResult,\n SetFieldValue,\n SetValueConfig,\n Subjects,\n UseFormClearErrors,\n UseFormGetFieldState,\n UseFormGetValues,\n UseFormHandleSubmit,\n UseFormProps,\n UseFormRegister,\n UseFormReset,\n UseFormResetField,\n UseFormReturn,\n UseFormSetError,\n UseFormSetFocus,\n UseFormSetValue,\n UseFormTrigger,\n UseFormUnregister,\n UseFormWatch,\n WatchInternal,\n WatchObserver,\n} from '../types';\nimport cloneObject from '../utils/cloneObject';\nimport compact from '../utils/compact';\nimport convertToArrayPayload from '../utils/convertToArrayPayload';\nimport createSubject from '../utils/createSubject';\nimport deepEqual from '../utils/deepEqual';\nimport get from '../utils/get';\nimport getValidationModes from '../utils/getValidationModes';\nimport isBoolean from '../utils/isBoolean';\nimport isCheckBoxInput from '../utils/isCheckBoxInput';\nimport isDateObject from '../utils/isDateObject';\nimport isEmptyObject from '../utils/isEmptyObject';\nimport isFileInput from '../utils/isFileInput';\nimport isFunction from '../utils/isFunction';\nimport isHTMLElement from '../utils/isHTMLElement';\nimport isMultipleSelect from '../utils/isMultipleSelect';\nimport isNullOrUndefined from '../utils/isNullOrUndefined';\nimport isPrimitive from '../utils/isPrimitive';\nimport isRadioOrCheckbox from '../utils/isRadioOrCheckbox';\nimport isString from '../utils/isString';\nimport isUndefined from '../utils/isUndefined';\nimport isWeb from '../utils/isWeb';\nimport live from '../utils/live';\nimport set from '../utils/set';\nimport unset from '../utils/unset';\n\nimport focusFieldBy from './focusFieldBy';\nimport generateWatchOutput from './generateWatchOutput';\nimport getDirtyFields from './getDirtyFields';\nimport getEventValue from './getEventValue';\nimport getFieldValue from './getFieldValue';\nimport getFieldValueAs from './getFieldValueAs';\nimport getResolverOptions from './getResolverOptions';\nimport getRuleValue from './getRuleValue';\nimport hasValidation from './hasValidation';\nimport isNameInFieldArray from './isNameInFieldArray';\nimport isWatched from './isWatched';\nimport schemaErrorLookup from './schemaErrorLookup';\nimport skipValidation from './skipValidation';\nimport unsetEmptyArray from './unsetEmptyArray';\nimport validateField from './validateField';\n\nconst defaultOptions = {\n mode: VALIDATION_MODE.onSubmit,\n reValidateMode: VALIDATION_MODE.onChange,\n shouldFocusError: true,\n} as const;\n\nexport function createFormControl<\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n>(\n props: UseFormProps = {},\n): Omit, 'formState'> {\n let _options = {\n ...defaultOptions,\n ...props,\n };\n let _formState: FormState = {\n isDirty: false,\n isValidating: false,\n dirtyFields: {} as FieldNamesMarkedBoolean,\n isSubmitted: false,\n submitCount: 0,\n touchedFields: {} as FieldNamesMarkedBoolean,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n errors: {} as FieldErrors,\n };\n let _fields = {};\n let _defaultValues = cloneObject(_options.defaultValues) || {};\n let _formValues = _options.shouldUnregister\n ? {}\n : cloneObject(_defaultValues);\n let _stateFlags = {\n action: false,\n mount: false,\n watch: false,\n };\n let _names: Names = {\n mount: new Set(),\n unMount: new Set(),\n array: new Set(),\n watch: new Set(),\n } as Names;\n let delayErrorCallback: DelayCallback | null;\n let timer = 0;\n let validateFields: Record = {};\n const _proxyFormState = {\n isDirty: false,\n dirtyFields: false,\n touchedFields: false,\n isValidating: false,\n isValid: false,\n errors: false,\n };\n const _subjects: Subjects = {\n watch: createSubject(),\n array: createSubject(),\n state: createSubject(),\n };\n\n const validationModeBeforeSubmit = getValidationModes(_options.mode);\n const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);\n const shouldDisplayAllAssociatedErrors =\n _options.criteriaMode === VALIDATION_MODE.all;\n\n const debounce =\n (callback: T) =>\n (wait: number) => {\n clearTimeout(timer);\n timer = window.setTimeout(callback, wait);\n };\n\n const _updateValid = async (shouldSkipRender?: boolean) => {\n let isValid = false;\n\n if (_proxyFormState.isValid) {\n isValid = _options.resolver\n ? isEmptyObject((await _executeSchema()).errors)\n : await executeBuildInValidation(_fields, true);\n\n if (!shouldSkipRender && isValid !== _formState.isValid) {\n _formState.isValid = isValid;\n _subjects.state.next({\n isValid,\n });\n }\n }\n\n return isValid;\n };\n\n const _updateFieldArray: BatchFieldArrayUpdate = (\n name,\n values = [],\n method,\n args,\n shouldSetValues = true,\n shouldUpdateFieldsAndState = true,\n ) => {\n if (args && method) {\n _stateFlags.action = true;\n if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {\n const fieldValues = method(get(_fields, name), args.argA, args.argB);\n shouldSetValues && set(_fields, name, fieldValues);\n }\n\n if (\n _proxyFormState.errors &&\n shouldUpdateFieldsAndState &&\n Array.isArray(get(_formState.errors, name))\n ) {\n const errors = method(\n get(_formState.errors, name),\n args.argA,\n args.argB,\n );\n shouldSetValues && set(_formState.errors, name, errors);\n unsetEmptyArray(_formState.errors, name);\n }\n\n if (\n _proxyFormState.touchedFields &&\n shouldUpdateFieldsAndState &&\n Array.isArray(get(_formState.touchedFields, name))\n ) {\n const touchedFields = method(\n get(_formState.touchedFields, name),\n args.argA,\n args.argB,\n );\n shouldSetValues && set(_formState.touchedFields, name, touchedFields);\n }\n\n if (_proxyFormState.dirtyFields) {\n _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);\n }\n\n _subjects.state.next({\n isDirty: _getDirty(name, values),\n dirtyFields: _formState.dirtyFields,\n errors: _formState.errors,\n isValid: _formState.isValid,\n });\n } else {\n set(_formValues, name, values);\n }\n };\n\n const updateErrors = (name: InternalFieldName, error: FieldError) => {\n set(_formState.errors, name, error);\n _subjects.state.next({\n errors: _formState.errors,\n });\n };\n\n const updateValidAndValue = (\n name: InternalFieldName,\n shouldSkipSetValueAs: boolean,\n value?: unknown,\n ref?: Ref,\n ) => {\n const field: Field = get(_fields, name);\n\n if (field) {\n const defaultValue = get(\n _formValues,\n name,\n isUndefined(value) ? get(_defaultValues, name) : value,\n );\n\n isUndefined(defaultValue) ||\n (ref && (ref as HTMLInputElement).defaultChecked) ||\n shouldSkipSetValueAs\n ? set(\n _formValues,\n name,\n shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f),\n )\n : setFieldValue(name, defaultValue);\n\n _stateFlags.mount && _updateValid();\n }\n };\n\n const updateTouchAndDirty = (\n name: InternalFieldName,\n fieldValue: unknown,\n isBlurEvent?: boolean,\n shouldDirty?: boolean,\n shouldRender?: boolean,\n ): Partial<\n Pick, 'dirtyFields' | 'isDirty' | 'touchedFields'>\n > => {\n let isFieldDirty = false;\n const output: Partial> & { name: string } = {\n name,\n };\n const isPreviousFieldTouched = get(_formState.touchedFields, name);\n\n if (_proxyFormState.isDirty) {\n const isPreviousFormDirty = _formState.isDirty;\n\n _formState.isDirty = output.isDirty = _getDirty();\n isFieldDirty = isPreviousFormDirty !== output.isDirty;\n }\n\n if (_proxyFormState.dirtyFields && (!isBlurEvent || shouldDirty)) {\n const isPreviousFieldDirty = get(_formState.dirtyFields, name);\n const isCurrentFieldPristine = deepEqual(\n get(_defaultValues, name),\n fieldValue,\n );\n\n isCurrentFieldPristine\n ? unset(_formState.dirtyFields, name)\n : set(_formState.dirtyFields as TFieldValues, name, true);\n output.dirtyFields = _formState.dirtyFields;\n isFieldDirty =\n isFieldDirty ||\n isPreviousFieldDirty !== get(_formState.dirtyFields, name);\n }\n\n if (isBlurEvent && !isPreviousFieldTouched) {\n set(_formState.touchedFields as TFieldValues, name, isBlurEvent);\n output.touchedFields = _formState.touchedFields;\n isFieldDirty =\n isFieldDirty ||\n (_proxyFormState.touchedFields &&\n isPreviousFieldTouched !== isBlurEvent);\n }\n\n isFieldDirty && shouldRender && _subjects.state.next(output);\n\n return isFieldDirty ? output : {};\n };\n\n const shouldRenderByError = async (\n name: InternalFieldName,\n isValid: boolean,\n error?: FieldError,\n fieldState?: {\n dirty?: FieldNamesMarkedBoolean;\n isDirty?: boolean;\n touched?: FieldNamesMarkedBoolean;\n },\n ): Promise => {\n const previousFieldError = get(_formState.errors, name);\n const shouldUpdateValid =\n _proxyFormState.isValid && _formState.isValid !== isValid;\n\n if (props.delayError && error) {\n delayErrorCallback = debounce(() => updateErrors(name, error));\n delayErrorCallback(props.delayError);\n } else {\n clearTimeout(timer);\n delayErrorCallback = null;\n error\n ? set(_formState.errors, name, error)\n : unset(_formState.errors, name);\n }\n\n if (\n (error ? !deepEqual(previousFieldError, error) : previousFieldError) ||\n !isEmptyObject(fieldState) ||\n shouldUpdateValid\n ) {\n const updatedFormState = {\n ...fieldState,\n ...(shouldUpdateValid ? { isValid } : {}),\n errors: _formState.errors,\n name,\n };\n\n _formState = {\n ..._formState,\n ...updatedFormState,\n };\n\n _subjects.state.next(updatedFormState);\n }\n\n validateFields[name]--;\n\n if (\n _proxyFormState.isValidating &&\n !Object.values(validateFields).some((v) => v)\n ) {\n _subjects.state.next({\n isValidating: false,\n });\n validateFields = {};\n }\n };\n\n const _executeSchema = async (name?: InternalFieldName[]) =>\n _options.resolver\n ? await _options.resolver(\n { ..._formValues } as TFieldValues,\n _options.context,\n getResolverOptions(\n name || _names.mount,\n _fields,\n _options.criteriaMode,\n _options.shouldUseNativeValidation,\n ),\n )\n : ({} as ResolverResult);\n\n const executeSchemaAndUpdateState = async (names?: InternalFieldName[]) => {\n const { errors } = await _executeSchema();\n\n if (names) {\n for (const name of names) {\n const error = get(errors, name);\n error\n ? set(_formState.errors, name, error)\n : unset(_formState.errors, name);\n }\n } else {\n _formState.errors = errors as FieldErrors;\n }\n\n return errors;\n };\n\n const executeBuildInValidation = async (\n fields: FieldRefs,\n shouldOnlyCheckValid?: boolean,\n context = {\n valid: true,\n },\n ) => {\n for (const name in fields) {\n const field = fields[name];\n\n if (field) {\n const { _f: fieldReference, ...fieldValue } = field;\n\n if (fieldReference) {\n const fieldError = await validateField(\n field,\n get(_formValues, fieldReference.name),\n shouldDisplayAllAssociatedErrors,\n _options.shouldUseNativeValidation,\n );\n\n if (fieldError[fieldReference.name]) {\n context.valid = false;\n\n if (shouldOnlyCheckValid) {\n break;\n }\n }\n\n if (!shouldOnlyCheckValid) {\n fieldError[fieldReference.name]\n ? set(\n _formState.errors,\n fieldReference.name,\n fieldError[fieldReference.name],\n )\n : unset(_formState.errors, fieldReference.name);\n }\n }\n\n fieldValue &&\n (await executeBuildInValidation(\n fieldValue,\n shouldOnlyCheckValid,\n context,\n ));\n }\n }\n\n return context.valid;\n };\n\n const _removeUnmounted = () => {\n for (const name of _names.unMount) {\n const field: Field = get(_fields, name);\n\n field &&\n (field._f.refs\n ? field._f.refs.every((ref) => !live(ref))\n : !live(field._f.ref)) &&\n unregister(name as FieldPath);\n }\n\n _names.unMount = new Set();\n };\n\n const _getDirty: GetIsDirty = (name, data) => (\n name && data && set(_formValues, name, data),\n !deepEqual(getValues(), _defaultValues)\n );\n\n const _getWatch: WatchInternal = (\n names,\n defaultValue,\n isGlobal,\n ) => {\n const fieldValues = {\n ...(_stateFlags.mount\n ? _formValues\n : isUndefined(defaultValue)\n ? _defaultValues\n : isString(names)\n ? { [names]: defaultValue }\n : defaultValue),\n };\n\n return generateWatchOutput(names, _names, fieldValues, isGlobal);\n };\n\n const _getFieldArray = (\n name: InternalFieldName,\n ): Partial[] =>\n compact(\n get(\n _stateFlags.mount ? _formValues : _defaultValues,\n name,\n props.shouldUnregister ? get(_defaultValues, name, []) : [],\n ),\n );\n\n const setFieldValue = (\n name: InternalFieldName,\n value: SetFieldValue,\n options: SetValueConfig = {},\n ) => {\n const field: Field = get(_fields, name);\n let fieldValue: unknown = value;\n\n if (field) {\n const fieldReference = field._f;\n\n if (fieldReference) {\n !fieldReference.disabled &&\n set(_formValues, name, getFieldValueAs(value, fieldReference));\n\n fieldValue =\n isWeb && isHTMLElement(fieldReference.ref) && isNullOrUndefined(value)\n ? ''\n : value;\n\n if (isMultipleSelect(fieldReference.ref)) {\n [...fieldReference.ref.options].forEach(\n (selectRef) =>\n (selectRef.selected = (\n fieldValue as InternalFieldName[]\n ).includes(selectRef.value)),\n );\n } else if (fieldReference.refs) {\n if (isCheckBoxInput(fieldReference.ref)) {\n fieldReference.refs.length > 1\n ? fieldReference.refs.forEach(\n (checkboxRef) =>\n !checkboxRef.disabled &&\n (checkboxRef.checked = Array.isArray(fieldValue)\n ? !!(fieldValue as []).find(\n (data: string) => data === checkboxRef.value,\n )\n : fieldValue === checkboxRef.value),\n )\n : fieldReference.refs[0] &&\n (fieldReference.refs[0].checked = !!fieldValue);\n } else {\n fieldReference.refs.forEach(\n (radioRef: HTMLInputElement) =>\n (radioRef.checked = radioRef.value === fieldValue),\n );\n }\n } else if (isFileInput(fieldReference.ref)) {\n fieldReference.ref.value = '';\n } else {\n fieldReference.ref.value = fieldValue;\n\n if (!fieldReference.ref.type) {\n _subjects.watch.next({\n name,\n });\n }\n }\n }\n }\n\n (options.shouldDirty || options.shouldTouch) &&\n updateTouchAndDirty(\n name,\n fieldValue,\n options.shouldTouch,\n options.shouldDirty,\n true,\n );\n\n options.shouldValidate && trigger(name as Path);\n };\n\n const setValues = <\n T extends InternalFieldName,\n K extends SetFieldValue,\n U extends SetValueConfig,\n >(\n name: T,\n value: K,\n options: U,\n ) => {\n for (const fieldKey in value) {\n const fieldValue = value[fieldKey];\n const fieldName = `${name}.${fieldKey}` as Path;\n const field = get(_fields, fieldName);\n\n (_names.array.has(name) ||\n !isPrimitive(fieldValue) ||\n (field && !field._f)) &&\n !isDateObject(fieldValue)\n ? setValues(fieldName, fieldValue, options)\n : setFieldValue(fieldName, fieldValue, options);\n }\n };\n\n const setValue: UseFormSetValue = (\n name,\n value,\n options = {},\n ) => {\n const field = get(_fields, name);\n const isFieldArray = _names.array.has(name);\n const cloneValue = cloneObject(value);\n\n set(_formValues, name, cloneValue);\n\n if (isFieldArray) {\n _subjects.array.next({\n name,\n values: _formValues,\n });\n\n if (\n (_proxyFormState.isDirty || _proxyFormState.dirtyFields) &&\n options.shouldDirty\n ) {\n _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);\n\n _subjects.state.next({\n name,\n dirtyFields: _formState.dirtyFields,\n isDirty: _getDirty(name, cloneValue),\n });\n }\n } else {\n field && !field._f && !isNullOrUndefined(cloneValue)\n ? setValues(name, cloneValue, options)\n : setFieldValue(name, cloneValue, options);\n }\n\n isWatched(name, _names) && _subjects.state.next({});\n _subjects.watch.next({\n name,\n });\n };\n\n const onChange: ChangeHandler = async (event) => {\n const target = event.target;\n let name = target.name;\n const field: Field = get(_fields, name);\n\n if (field) {\n let error;\n let isValid;\n const fieldValue = target.type\n ? getFieldValue(field._f)\n : getEventValue(event);\n const isBlurEvent =\n event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;\n const shouldSkipValidation =\n (!hasValidation(field._f) &&\n !_options.resolver &&\n !get(_formState.errors, name) &&\n !field._f.deps) ||\n skipValidation(\n isBlurEvent,\n get(_formState.touchedFields, name),\n _formState.isSubmitted,\n validationModeAfterSubmit,\n validationModeBeforeSubmit,\n );\n const watched = isWatched(name, _names, isBlurEvent);\n\n set(_formValues, name, fieldValue);\n\n if (isBlurEvent) {\n field._f.onBlur && field._f.onBlur(event);\n delayErrorCallback && delayErrorCallback(0);\n } else if (field._f.onChange) {\n field._f.onChange(event);\n }\n\n const fieldState = updateTouchAndDirty(\n name,\n fieldValue,\n isBlurEvent,\n false,\n );\n\n const shouldRender = !isEmptyObject(fieldState) || watched;\n\n !isBlurEvent &&\n _subjects.watch.next({\n name,\n type: event.type,\n });\n\n if (shouldSkipValidation) {\n return (\n shouldRender &&\n _subjects.state.next({ name, ...(watched ? {} : fieldState) })\n );\n }\n\n !isBlurEvent && watched && _subjects.state.next({});\n\n validateFields[name] = validateFields[name] ? +1 : 1;\n\n _subjects.state.next({\n isValidating: true,\n });\n\n if (_options.resolver) {\n const { errors } = await _executeSchema([name]);\n const previousErrorLookupResult = schemaErrorLookup(\n _formState.errors,\n _fields,\n name,\n );\n const errorLookupResult = schemaErrorLookup(\n errors,\n _fields,\n previousErrorLookupResult.name || name,\n );\n\n error = errorLookupResult.error;\n name = errorLookupResult.name;\n\n isValid = isEmptyObject(errors);\n } else {\n error = (\n await validateField(\n field,\n get(_formValues, name),\n shouldDisplayAllAssociatedErrors,\n _options.shouldUseNativeValidation,\n )\n )[name];\n\n isValid = await _updateValid(true);\n }\n\n field._f.deps &&\n trigger(\n field._f.deps as FieldPath | FieldPath[],\n );\n\n shouldRenderByError(name, isValid, error, fieldState);\n }\n };\n\n const trigger: UseFormTrigger = async (name, options = {}) => {\n let isValid;\n let validationResult;\n const fieldNames = convertToArrayPayload(name) as InternalFieldName[];\n\n _subjects.state.next({\n isValidating: true,\n });\n\n if (_options.resolver) {\n const errors = await executeSchemaAndUpdateState(\n isUndefined(name) ? name : fieldNames,\n );\n\n isValid = isEmptyObject(errors);\n validationResult = name\n ? !fieldNames.some((name) => get(errors, name))\n : isValid;\n } else if (name) {\n validationResult = (\n await Promise.all(\n fieldNames.map(async (fieldName) => {\n const field = get(_fields, fieldName);\n return await executeBuildInValidation(\n field && field._f ? { [fieldName]: field } : field,\n );\n }),\n )\n ).every(Boolean);\n !(!validationResult && !_formState.isValid) && _updateValid();\n } else {\n validationResult = isValid = await executeBuildInValidation(_fields);\n }\n\n _subjects.state.next({\n ...(!isString(name) ||\n (_proxyFormState.isValid && isValid !== _formState.isValid)\n ? {}\n : { name }),\n ...(_options.resolver ? { isValid } : {}),\n errors: _formState.errors,\n isValidating: false,\n });\n\n options.shouldFocus &&\n !validationResult &&\n focusFieldBy(\n _fields,\n (key) => get(_formState.errors, key),\n name ? fieldNames : _names.mount,\n );\n\n return validationResult;\n };\n\n const getValues: UseFormGetValues = (\n fieldNames?:\n | FieldPath\n | ReadonlyArray>,\n ) => {\n const values = {\n ..._defaultValues,\n ...(_stateFlags.mount ? _formValues : {}),\n };\n\n return isUndefined(fieldNames)\n ? values\n : isString(fieldNames)\n ? get(values, fieldNames as InternalFieldName)\n : fieldNames.map((name) => get(values, name as InternalFieldName));\n };\n\n const getFieldState: UseFormGetFieldState = (\n name,\n formState,\n ) => ({\n invalid: !!get((formState || _formState).errors, name),\n isDirty: !!get((formState || _formState).dirtyFields, name),\n isTouched: !!get((formState || _formState).touchedFields, name),\n error: get((formState || _formState).errors, name),\n });\n\n const clearErrors: UseFormClearErrors = (name) => {\n name\n ? convertToArrayPayload(name).forEach((inputName) =>\n unset(_formState.errors, inputName),\n )\n : (_formState.errors = {} as FieldErrors);\n\n _subjects.state.next({\n errors: _formState.errors,\n });\n };\n\n const setError: UseFormSetError = (name, error, options) => {\n const ref = ((get(_fields, name, { _f: {} }) as Field)._f || {}).ref;\n\n set(_formState.errors, name, {\n ...error,\n ref,\n });\n\n _subjects.state.next({\n name,\n errors: _formState.errors,\n isValid: false,\n });\n\n options && options.shouldFocus && ref && ref.focus && ref.focus();\n };\n\n const watch: UseFormWatch = (\n name?:\n | FieldPath\n | ReadonlyArray>\n | WatchObserver,\n defaultValue?: unknown,\n ) =>\n isFunction(name)\n ? _subjects.watch.subscribe({\n next: (info) =>\n name(\n _getWatch(undefined, defaultValue as DeepPartial),\n info as {\n name?: FieldPath;\n type?: EventType;\n value?: unknown;\n },\n ),\n })\n : _getWatch(\n name as InternalFieldName | InternalFieldName[],\n defaultValue as DeepPartial,\n true,\n );\n\n const unregister: UseFormUnregister = (name, options = {}) => {\n for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {\n _names.mount.delete(fieldName);\n _names.array.delete(fieldName);\n\n if (get(_fields, fieldName)) {\n if (!options.keepValue) {\n unset(_fields, fieldName);\n unset(_formValues, fieldName);\n }\n\n !options.keepError && unset(_formState.errors, fieldName);\n !options.keepDirty && unset(_formState.dirtyFields, fieldName);\n !options.keepTouched && unset(_formState.touchedFields, fieldName);\n !_options.shouldUnregister &&\n !options.keepDefaultValue &&\n unset(_defaultValues, fieldName);\n }\n }\n\n _subjects.watch.next({});\n\n _subjects.state.next({\n ..._formState,\n ...(!options.keepDirty ? {} : { isDirty: _getDirty() }),\n });\n\n !options.keepIsValid && _updateValid();\n };\n\n const register: UseFormRegister = (name, options = {}) => {\n let field = get(_fields, name);\n const disabledIsDefined = isBoolean(options.disabled);\n\n set(_fields, name, {\n _f: {\n ...(field && field._f ? field._f : { ref: { name } }),\n name,\n mount: true,\n ...options,\n },\n });\n _names.mount.add(name);\n\n field\n ? disabledIsDefined &&\n set(\n _formValues,\n name,\n options.disabled\n ? undefined\n : get(_formValues, name, getFieldValue(field._f)),\n )\n : updateValidAndValue(name, true, options.value);\n\n return {\n ...(disabledIsDefined ? { disabled: options.disabled } : {}),\n ...(_options.shouldUseNativeValidation\n ? {\n required: !!options.required,\n min: getRuleValue(options.min),\n max: getRuleValue(options.max),\n minLength: getRuleValue(options.minLength) as number,\n maxLength: getRuleValue(options.maxLength) as number,\n pattern: getRuleValue(options.pattern) as string,\n }\n : {}),\n name,\n onChange,\n onBlur: onChange,\n ref: (ref: HTMLInputElement | null): void => {\n if (ref) {\n register(name, options);\n field = get(_fields, name);\n\n const fieldRef = isUndefined(ref.value)\n ? ref.querySelectorAll\n ? (ref.querySelectorAll('input,select,textarea')[0] as Ref) || ref\n : ref\n : ref;\n const radioOrCheckbox = isRadioOrCheckbox(fieldRef);\n const refs = field._f.refs || [];\n\n if (\n radioOrCheckbox\n ? refs.find((option: Ref) => option === fieldRef)\n : fieldRef === field._f.ref\n ) {\n return;\n }\n\n set(_fields, name, {\n _f: {\n ...field._f,\n ...(radioOrCheckbox\n ? {\n refs: [\n ...refs.filter(live),\n fieldRef,\n ...(!!Array.isArray(get(_defaultValues, name))\n ? [{}]\n : []),\n ],\n ref: { type: fieldRef.type, name },\n }\n : { ref: fieldRef }),\n },\n });\n\n updateValidAndValue(name, false, undefined, fieldRef);\n } else {\n field = get(_fields, name, {});\n\n if (field._f) {\n field._f.mount = false;\n }\n\n (_options.shouldUnregister || options.shouldUnregister) &&\n !(isNameInFieldArray(_names.array, name) && _stateFlags.action) &&\n _names.unMount.add(name);\n }\n },\n };\n };\n\n const handleSubmit: UseFormHandleSubmit =\n (onValid, onInvalid) => async (e) => {\n if (e) {\n e.preventDefault && e.preventDefault();\n e.persist && e.persist();\n }\n let hasNoPromiseError = true;\n let fieldValues: any = cloneObject(_formValues);\n\n _subjects.state.next({\n isSubmitting: true,\n });\n\n try {\n if (_options.resolver) {\n const { errors, values } = await _executeSchema();\n _formState.errors = errors as FieldErrors;\n fieldValues = values;\n } else {\n await executeBuildInValidation(_fields);\n }\n\n if (isEmptyObject(_formState.errors)) {\n _subjects.state.next({\n errors: {} as FieldErrors,\n isSubmitting: true,\n });\n await onValid(fieldValues, e);\n } else {\n if (onInvalid) {\n await onInvalid({ ..._formState.errors }, e);\n }\n\n _options.shouldFocusError &&\n focusFieldBy(\n _fields,\n (key) => get(_formState.errors, key),\n _names.mount,\n );\n }\n } catch (err) {\n hasNoPromiseError = false;\n throw err;\n } finally {\n _formState.isSubmitted = true;\n _subjects.state.next({\n isSubmitted: true,\n isSubmitting: false,\n isSubmitSuccessful:\n isEmptyObject(_formState.errors) && hasNoPromiseError,\n submitCount: _formState.submitCount + 1,\n errors: _formState.errors,\n });\n }\n };\n\n const resetField: UseFormResetField = (name, options = {}) => {\n if (get(_fields, name)) {\n if (isUndefined(options.defaultValue)) {\n setValue(name, get(_defaultValues, name));\n } else {\n setValue(name, options.defaultValue);\n set(_defaultValues, name, options.defaultValue);\n }\n\n if (!options.keepTouched) {\n unset(_formState.touchedFields, name);\n }\n\n if (!options.keepDirty) {\n unset(_formState.dirtyFields, name);\n _formState.isDirty = options.defaultValue\n ? _getDirty(name, get(_defaultValues, name))\n : _getDirty();\n }\n\n if (!options.keepError) {\n unset(_formState.errors, name);\n _proxyFormState.isValid && _updateValid();\n }\n\n _subjects.state.next({ ..._formState });\n }\n };\n\n const reset: UseFormReset = (\n formValues,\n keepStateOptions = {},\n ) => {\n const updatedValues = formValues || _defaultValues;\n const cloneUpdatedValues = cloneObject(updatedValues);\n const values =\n formValues && !isEmptyObject(formValues)\n ? cloneUpdatedValues\n : _defaultValues;\n\n if (!keepStateOptions.keepDefaultValues) {\n _defaultValues = updatedValues;\n }\n\n if (!keepStateOptions.keepValues) {\n if (keepStateOptions.keepDirtyValues) {\n for (const fieldName of _names.mount) {\n get(_formState.dirtyFields, fieldName)\n ? set(values, fieldName, get(_formValues, fieldName))\n : setValue(\n fieldName as FieldPath,\n get(values, fieldName),\n );\n }\n } else {\n if (isWeb && isUndefined(formValues)) {\n for (const name of _names.mount) {\n const field = get(_fields, name);\n if (field && field._f) {\n const fieldReference = Array.isArray(field._f.refs)\n ? field._f.refs[0]\n : field._f.ref;\n\n try {\n isHTMLElement(fieldReference) &&\n fieldReference.closest('form')!.reset();\n break;\n } catch {}\n }\n }\n }\n\n _fields = {};\n }\n\n _formValues = props.shouldUnregister\n ? keepStateOptions.keepDefaultValues\n ? cloneObject(_defaultValues)\n : {}\n : cloneUpdatedValues;\n\n _subjects.array.next({\n values,\n });\n\n _subjects.watch.next({\n values,\n });\n }\n\n _names = {\n mount: new Set(),\n unMount: new Set(),\n array: new Set(),\n watch: new Set(),\n watchAll: false,\n focus: '',\n };\n\n _stateFlags.mount =\n !_proxyFormState.isValid || !!keepStateOptions.keepIsValid;\n\n _stateFlags.watch = !!props.shouldUnregister;\n\n _subjects.state.next({\n submitCount: keepStateOptions.keepSubmitCount\n ? _formState.submitCount\n : 0,\n isDirty:\n keepStateOptions.keepDirty || keepStateOptions.keepDirtyValues\n ? _formState.isDirty\n : !!(\n keepStateOptions.keepDefaultValues &&\n !deepEqual(formValues, _defaultValues)\n ),\n isSubmitted: keepStateOptions.keepIsSubmitted\n ? _formState.isSubmitted\n : false,\n dirtyFields:\n keepStateOptions.keepDirty || keepStateOptions.keepDirtyValues\n ? _formState.dirtyFields\n : keepStateOptions.keepDefaultValues && formValues\n ? getDirtyFields(_defaultValues, formValues)\n : {},\n touchedFields: keepStateOptions.keepTouched\n ? _formState.touchedFields\n : ({} as FieldNamesMarkedBoolean),\n errors: keepStateOptions.keepErrors\n ? _formState.errors\n : ({} as FieldErrors),\n isSubmitting: false,\n isSubmitSuccessful: false,\n });\n };\n\n const setFocus: UseFormSetFocus = (name, options = {}) => {\n const field = get(_fields, name)._f;\n const fieldRef = field.refs ? field.refs[0] : field.ref;\n fieldRef.focus();\n options.shouldSelect && fieldRef.select();\n };\n\n return {\n control: {\n register,\n unregister,\n getFieldState,\n _executeSchema,\n _getWatch,\n _getDirty,\n _updateValid,\n _removeUnmounted,\n _updateFieldArray,\n _getFieldArray,\n _subjects,\n _proxyFormState,\n get _fields() {\n return _fields;\n },\n get _formValues() {\n return _formValues;\n },\n get _stateFlags() {\n return _stateFlags;\n },\n set _stateFlags(value) {\n _stateFlags = value;\n },\n get _defaultValues() {\n return _defaultValues;\n },\n get _names() {\n return _names;\n },\n set _names(value) {\n _names = value;\n },\n get _formState() {\n return _formState;\n },\n set _formState(value) {\n _formState = value;\n },\n get _options() {\n return _options;\n },\n set _options(value) {\n _options = {\n ..._options,\n ...value,\n };\n },\n },\n trigger,\n register,\n handleSubmit,\n watch,\n setValue,\n getValues,\n reset,\n resetField,\n clearErrors,\n unregister,\n setError,\n setFocus,\n getFieldState,\n };\n}\n","import React from 'react';\n\nimport { createFormControl } from './logic/createFormControl';\nimport getProxyFormState from './logic/getProxyFormState';\nimport shouldRenderFormState from './logic/shouldRenderFormState';\nimport {\n FieldErrors,\n FieldNamesMarkedBoolean,\n FieldValues,\n FormState,\n UseFormProps,\n UseFormReturn,\n} from './types';\nimport { useSubscribe } from './useSubscribe';\n\n/**\n * Custom hook to mange the entire form.\n *\n * @remarks\n * [API](https://react-hook-form.com/api/useform) • [Demo](https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm) • [Video](https://www.youtube.com/watch?v=RkXv4AXXC_4)\n *\n * @param props - form configuration and validation parameters.\n *\n * @returns methods - individual functions to manage the form state. {@link UseFormReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, handleSubmit, watch, formState: { errors } } = useForm();\n * const onSubmit = data => console.log(data);\n *\n * console.log(watch(\"example\"));\n *\n * return (\n *
\n * \n * \n * {errors.exampleRequired && This field is required}\n * \n *
\n * );\n * }\n * ```\n */\nexport function useForm<\n TFieldValues extends FieldValues = FieldValues,\n TContext extends object = object,\n>(\n props: UseFormProps = {},\n): UseFormReturn {\n const _formControl = React.useRef<\n UseFormReturn | undefined\n >();\n const [formState, updateFormState] = React.useState>({\n isDirty: false,\n isValidating: false,\n dirtyFields: {} as FieldNamesMarkedBoolean,\n isSubmitted: false,\n submitCount: 0,\n touchedFields: {} as FieldNamesMarkedBoolean,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n errors: {} as FieldErrors,\n });\n\n if (_formControl.current) {\n _formControl.current.control._options = props;\n } else {\n _formControl.current = {\n ...createFormControl(props),\n formState,\n };\n }\n\n const control = _formControl.current.control;\n\n const callback = React.useCallback(\n (value: FieldValues) => {\n if (shouldRenderFormState(value, control._proxyFormState, true)) {\n control._formState = {\n ...control._formState,\n ...value,\n };\n\n updateFormState({ ...control._formState });\n }\n },\n [control],\n );\n\n useSubscribe({\n subject: control._subjects.state,\n callback,\n });\n\n React.useEffect(() => {\n if (!control._stateFlags.mount) {\n control._proxyFormState.isValid && control._updateValid();\n control._stateFlags.mount = true;\n }\n if (control._stateFlags.watch) {\n control._stateFlags.watch = false;\n control._subjects.state.next({});\n }\n control._removeUnmounted();\n });\n\n _formControl.current.formState = getProxyFormState(\n formState,\n control._proxyFormState,\n );\n\n return _formControl.current;\n}\n"],"names":["append","appendAt","prepend","prependAt","insert","insertAt","isCheckBox"],"mappings":";;AAEA,sBAAe,CAAC,OAAqB,KACnC,OAAO,CAAC,IAAI,KAAK,UAAU;;ACH7B,mBAAe,CAAC,KAAc,KAAoB,KAAK,YAAY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