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,EAAAA,GAfKtd,EAAS,KAAEud,EAAe,KAiB5BF,EAAa7b,UAChB6b,EAAa7b,SAAU,kBAClBsS,GAAkBxS,GAAO,kBAC1Bic,GAAgB,SAACvd,GAAS,iBAAWA,EAAS,GAAI,KACnD,IACDA,UAAAA,KAIJ,IAAMC,EAAUod,EAAa7b,QAAQvB,QA2CrC,OA1CAA,EAAQiP,SAAW5N,EAEnBD,EAAa,CACXM,QAAS1B,EAAQ0D,UAAUqL,MAC3BnN,KAAM,SAACxE,GACDmgB,EAAsBngB,EAAO4C,EAAQQ,iBAAiB,KACxDR,EAAQkP,YAAa,kBAChBlP,EAAQkP,YACR9R,GAGLkgB,GAAgB,UAAKtd,EAAQkP,a,IAKnCrP,EAAAA,WAAgB,WACTG,EAAQ4O,YAAYzF,QACvBnJ,EAAQQ,gBAAgBmH,SAAW3H,EAAQ2P,eAC3C3P,EAAQ4O,YAAYzF,OAAQ,GAG1BnJ,EAAQ4O,YAAY1M,QACtBlC,EAAQ4O,YAAY1M,OAAQ,EAC5BlC,EAAQ0D,UAAUqL,MAAMnN,KAAK,CAAC,IAGhC5B,EAAQmE,kBACV,IAEAtE,EAAAA,WAAgB,WACVwB,EAAMyC,SAAWyN,GAAUlQ,EAAMyC,OAAQ9D,EAAQI,iBACnDJ,EAAQ2a,OAAOtZ,EAAMyC,OAAQ9D,EAAQiP,SAASgF,a,GAE/C,CAAC5S,EAAMyC,OAAQ9D,IAElBH,EAAAA,WAAgB,WACdE,EAAUoU,aAAenU,EAAQ0a,a,GAChC,CAAC1a,EAASD,EAAUoU,cAEvBiJ,EAAa7b,QAAQxB,UAAYyd,EAAkBzd,EAAWC,GAEvDod,EAAa7b,OACtB,C","sources":["../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../node_modules/react-hook-form/src/utils/isCheckBoxInput.ts","../node_modules/react-hook-form/src/utils/isDateObject.ts","../node_modules/react-hook-form/src/utils/isNullOrUndefined.ts","../node_modules/react-hook-form/src/utils/isObject.ts","../node_modules/react-hook-form/src/logic/getEventValue.ts","../node_modules/react-hook-form/src/logic/isNameInFieldArray.ts","../node_modules/react-hook-form/src/logic/getNodeParentName.ts","../node_modules/react-hook-form/src/utils/compact.ts","../node_modules/react-hook-form/src/utils/isUndefined.ts","../node_modules/react-hook-form/src/utils/get.ts","../node_modules/react-hook-form/src/constants.ts","../node_modules/react-hook-form/src/useFormContext.tsx","../node_modules/react-hook-form/src/logic/getProxyFormState.ts","../node_modules/react-hook-form/src/utils/isEmptyObject.ts","../node_modules/react-hook-form/src/logic/shouldRenderFormState.ts","../node_modules/react-hook-form/src/utils/convertToArrayPayload.ts","../node_modules/react-hook-form/src/logic/shouldSubscribeByName.ts","../node_modules/react-hook-form/src/useSubscribe.ts","../node_modules/react-hook-form/src/utils/isString.ts","../node_modules/react-hook-form/src/logic/generateWatchOutput.ts","../node_modules/react-hook-form/src/utils/isPlainObject.ts","../node_modules/react-hook-form/src/utils/isWeb.ts","../node_modules/react-hook-form/src/utils/cloneObject.ts","../node_modules/react-hook-form/src/useWatch.ts","../node_modules/react-hook-form/src/controller.tsx","../node_modules/react-hook-form/src/logic/appendErrors.ts","../node_modules/react-hook-form/src/utils/isKey.ts","../node_modules/react-hook-form/src/utils/stringToPath.ts","../node_modules/react-hook-form/src/utils/set.ts","../node_modules/react-hook-form/src/logic/focusFieldBy.ts","../node_modules/react-hook-form/src/logic/generateId.ts","../node_modules/react-hook-form/src/logic/getFocusFieldName.ts","../node_modules/react-hook-form/src/logic/getValidationModes.ts","../node_modules/react-hook-form/src/logic/isWatched.ts","../node_modules/react-hook-form/src/logic/updateFieldArrayRootError.ts","../node_modules/react-hook-form/src/utils/isBoolean.ts","../node_modules/react-hook-form/src/utils/isFileInput.ts","../node_modules/react-hook-form/src/utils/isFunction.ts","../node_modules/react-hook-form/src/utils/isMessage.ts","../node_modules/react-hook-form/src/utils/isRadioInput.ts","../node_modules/react-hook-form/src/utils/isRegex.ts","../node_modules/react-hook-form/src/logic/getCheckboxValue.ts","../node_modules/react-hook-form/src/logic/getRadioValue.ts","../node_modules/react-hook-form/src/logic/getValidateError.ts","../node_modules/react-hook-form/src/logic/getValueAndMessage.ts","../node_modules/react-hook-form/src/logic/validateField.ts","../node_modules/react-hook-form/src/utils/append.ts","../node_modules/react-hook-form/src/utils/fillEmptyArray.ts","../node_modules/react-hook-form/src/utils/insert.ts","../node_modules/react-hook-form/src/utils/move.ts","../node_modules/react-hook-form/src/utils/prepend.ts","../node_modules/react-hook-form/src/utils/remove.ts","../node_modules/react-hook-form/src/utils/swap.ts","../node_modules/react-hook-form/src/utils/unset.ts","../node_modules/react-hook-form/src/utils/update.ts","../node_modules/react-hook-form/src/useFieldArray.ts","../node_modules/react-hook-form/src/utils/createSubject.ts","../node_modules/react-hook-form/src/utils/isPrimitive.ts","../node_modules/react-hook-form/src/utils/deepEqual.ts","../node_modules/react-hook-form/src/utils/isHTMLElement.ts","../node_modules/react-hook-form/src/utils/isMultipleSelect.ts","../node_modules/react-hook-form/src/utils/isRadioOrCheckbox.ts","../node_modules/react-hook-form/src/utils/live.ts","../node_modules/react-hook-form/src/utils/objectHasFunction.ts","../node_modules/react-hook-form/src/logic/getDirtyFields.ts","../node_modules/react-hook-form/src/logic/getFieldValueAs.ts","../node_modules/react-hook-form/src/logic/getFieldValue.ts","../node_modules/react-hook-form/src/logic/getResolverOptions.ts","../node_modules/react-hook-form/src/logic/getRuleValue.ts","../node_modules/react-hook-form/src/logic/hasValidation.ts","../node_modules/react-hook-form/src/logic/schemaErrorLookup.ts","../node_modules/react-hook-form/src/logic/skipValidation.ts","../node_modules/react-hook-form/src/logic/unsetEmptyArray.ts","../node_modules/react-hook-form/src/logic/createFormControl.ts","../node_modules/react-hook-form/src/useForm.ts"],"sourcesContent":["import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","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","import { InternalFieldName } from '../types';\n\nimport getNodeParentName from './getNodeParentName';\n\nexport default (names: Set, name: InternalFieldName) =>\n names.has(getNodeParentName(name));\n","export default (name: string) =>\n name.substring(0, name.search(/\\.\\d+(\\.|$)/)) || 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 { Control, FieldValues, FormState, ReadFormState } from '../types';\n\nexport default (\n formState: FormState,\n control: Control,\n localProxyFormState?: ReadFormState,\n isRoot = true,\n) => {\n const result = {\n defaultValues: control._defaultValues,\n } 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 (control._proxyFormState[_key] !== VALIDATION_MODE.all) {\n control._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 } from './utils/createSubject';\n\ntype Props = {\n disabled?: boolean;\n subject: Subject;\n next: (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 subscription =\n !props.disabled &&\n _props.current.subject.subscribe({\n next: _props.current.next,\n });\n\n return () => {\n subscription && subscription.unsubscribe();\n };\n }, [props.disabled]);\n}\n","export default (value: unknown): value is string => typeof value === 'string';\n","import { FieldValues, 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 if (isString(names)) {\n isGlobal && _names.watch.add(names);\n return get(formValues, names);\n }\n\n if (Array.isArray(names)) {\n return names.map(\n (fieldName) => (\n isGlobal && _names.watch.add(fieldName), get(formValues, fieldName)\n ),\n );\n }\n\n isGlobal && (_names.watchAll = true);\n\n return formValues;\n};\n","import isObject from './isObject';\n\nexport default (tempObject: object) => {\n const prototypeCopy =\n tempObject.constructor && tempObject.constructor.prototype;\n\n return (\n isObject(prototypeCopy) && prototypeCopy.hasOwnProperty('isPrototypeOf')\n );\n};\n","export default typeof window !== 'undefined' &&\n typeof window.HTMLElement !== 'undefined' &&\n typeof document !== 'undefined';\n","import isObject from './isObject';\nimport isPlainObject from './isPlainObject';\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\n if (!Array.isArray(data) && !isPlainObject(data)) {\n copy = data;\n } else {\n for (const key in data) {\n copy[key] = cloneObject(data[key]);\n }\n }\n } else {\n return data;\n }\n\n return copy;\n}\n","import React from 'react';\n\nimport generateWatchOutput from './logic/generateWatchOutput';\nimport shouldSubscribeByName from './logic/shouldSubscribeByName';\nimport cloneObject from './utils/cloneObject';\nimport isUndefined from './utils/isUndefined';\nimport {\n Control,\n DeepPartialSkipArrayKey,\n FieldPath,\n FieldPathValue,\n FieldPathValues,\n FieldValues,\n InternalFieldName,\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?: DeepPartialSkipArrayKey;\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>(): 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 * @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 useSubscribe({\n disabled,\n subject: control._subjects.watch,\n next: (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(fieldValues) ? defaultValue : cloneObject(fieldValues),\n );\n }\n },\n });\n\n const [value, updateValue] = React.useState(\n control._getWatch(\n name as InternalFieldName,\n defaultValue as DeepPartialSkipArrayKey,\n ),\n );\n\n React.useEffect(() => control._removeUnmounted());\n\n return value;\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';\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) {\n _f.ref.focus();\n break;\n } else if (_f.refs && _f.refs[0].focus) {\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 { 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","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 {\n FieldError,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n} from '../types';\nimport compact from '../utils/compact';\nimport get from '../utils/get';\nimport set from '../utils/set';\n\nexport default (\n errors: FieldErrors,\n error: Partial>,\n name: InternalFieldName,\n): FieldErrors => {\n const fieldArrayErrors = compact(get(errors, name));\n set(fieldArrayErrors, 'root', error[name]);\n set(errors, name, fieldArrayErrors);\n return errors;\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 Function =>\n typeof value === 'function';\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 { FieldElement } from '../types';\n\nexport default (element: FieldElement): element is HTMLInputElement =>\n element.type === 'radio';\n","export default (value: unknown): value is RegExp => value instanceof RegExp;\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","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 { 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';\nimport isUndefined from '../utils/isUndefined';\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 isFieldArray?: 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)) &&\n isUndefined(ref.value) &&\n isUndefined(inputValue)) ||\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 isFieldArray\n ? !Array.isArray(inputValue) || !inputValue.length\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 ||\n (inputValue ? +inputValue : 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 const convertTimeToDate = (time: unknown) =>\n new Date(new Date().toDateString() + ' ' + time);\n const isTime = ref.type == 'time';\n const isWeek = ref.type == 'week';\n\n if (isString(maxOutput.value) && inputValue) {\n exceedMax = isTime\n ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value)\n : isWeek\n ? inputValue > maxOutput.value\n : valueDate > new Date(maxOutput.value);\n }\n\n if (isString(minOutput.value) && inputValue) {\n exceedMin = isTime\n ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value)\n : isWeek\n ? inputValue < minOutput.value\n : 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 (\n (maxLength || minLength) &&\n !isEmpty &&\n (isString(inputValue) || (isFieldArray && Array.isArray(inputValue)))\n ) {\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 convertToArrayPayload from './convertToArrayPayload';\n\nexport default function append(data: T[], value: T | T[]): T[] {\n return [...data, ...convertToArrayPayload(value)];\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\nfunction isEmptyArray(obj: unknown[]) {\n for (const key in obj) {\n if (!isUndefined(obj[key])) {\n return false;\n }\n }\n return true;\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) && isEmptyArray(objectRef)))\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 getValidationModes from './logic/getValidationModes';\nimport isWatched from './logic/isWatched';\nimport updateFieldArrayRootError from './logic/updateFieldArrayRootError';\nimport validateField from './logic/validateField';\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 isEmptyObject from './utils/isEmptyObject';\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 { VALIDATION_MODE } from './constants';\nimport {\n Control,\n Field,\n FieldArray,\n FieldArrayMethodProps,\n FieldArrayPath,\n FieldArrayWithId,\n FieldErrors,\n FieldPath,\n FieldValues,\n InternalFieldName,\n RegisterOptions,\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. • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) • [Video](https://youtu.be/4MrbfGSFY2A)\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',\n shouldUnregister,\n } = props;\n const [fields, setFields] = React.useState(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 props.rules &&\n (control as Control).register(\n name as FieldPath,\n props.rules as RegisterOptions,\n );\n\n useSubscribe({\n next: ({\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 if (Array.isArray(fieldValues)) {\n setFields(fieldValues);\n ids.current = fieldValues.map(generateId);\n }\n }\n },\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 (\n _actioned.current &&\n (!getValidationModes(control._options.mode).isOnSubmit ||\n control._formState.isSubmitted)\n ) {\n if (control._options.resolver) {\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 } else {\n const field: Field = get(control._fields, name);\n if (field && field._f) {\n validateField(\n field,\n get(control._formValues, name),\n control._options.criteriaMode === VALIDATION_MODE.all,\n control._options.shouldUseNativeValidation,\n true,\n ).then(\n (error) =>\n !isEmptyObject(error) &&\n control._subjects.state.next({\n errors: updateFieldArrayRootError(\n control._formState.errors as FieldErrors,\n error,\n name,\n ) as FieldErrors,\n }),\n );\n }\n }\n }\n\n control._subjects.watch.next({\n name,\n values: control._formValues,\n });\n\n control._names.focus &&\n focusFieldBy(\n control._fields,\n (key) => !!key && 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","export default (value: unknown): value is HTMLElement => {\n const owner = value ? ((value as HTMLElement).ownerDocument as Document) : 0;\n return (\n value instanceof\n (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement)\n );\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\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 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 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 deepEqual(data[key], formValues[key])\n ? delete dirtyFieldsFromValues[key]\n : (dirtyFieldsFromValues[key] = true);\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 { Field, NativeFieldValue } from '../types';\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 === ''\n ? NaN\n : value\n ? +value\n : value\n : valueAsDate && isString(value)\n ? new Date(value)\n : setValueAs\n ? setValueAs(value)\n : value;\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","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 ? rule\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 { EVENTS, VALIDATION_MODE } from '../constants';\nimport {\n BatchFieldArrayUpdate,\n ChangeHandler,\n DeepPartial,\n DelayCallback,\n EventType,\n Field,\n FieldError,\n FieldNamesMarkedBoolean,\n FieldPath,\n FieldRefs,\n FieldValues,\n FormState,\n GetIsDirty,\n InternalFieldName,\n Names,\n Path,\n Ref,\n SetFieldValue,\n SetValueConfig,\n Subjects,\n UnPackAsyncDefaultValues,\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 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 isObject from '../utils/isObject';\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 getValidationModes from './getValidationModes';\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 updateFieldArrayRootError from './updateFieldArrayRootError';\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 flushRootRender: () => void,\n): Omit, 'formState'> {\n let _options = {\n ...defaultOptions,\n ...props,\n };\n const shouldCaptureDirtyFields =\n props.resetOptions && props.resetOptions.keepDirtyValues;\n let _formState: FormState = {\n submitCount: 0,\n isDirty: false,\n isLoading: true,\n isValidating: false,\n isSubmitted: false,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n touchedFields: {},\n dirtyFields: {},\n errors: {},\n };\n let _fields = {};\n let _defaultValues = isObject(_options.defaultValues)\n ? cloneObject(_options.defaultValues) || {}\n : {};\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 };\n let delayErrorCallback: DelayCallback | null;\n let timer = 0;\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 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 () => {\n if (_proxyFormState.isValid) {\n const isValid = _options.resolver\n ? isEmptyObject((await _executeSchema()).errors)\n : await executeBuiltInValidation(_fields, true);\n\n if (isValid !== _formState.isValid) {\n _formState.isValid = isValid;\n _subjects.state.next({\n isValid,\n });\n }\n }\n };\n\n const _updateIsValidating = (value: boolean) =>\n _proxyFormState.isValidating &&\n _subjects.state.next({\n isValidating: value,\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 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 name,\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 shouldUpdateField = false;\n let isPreviousDirty = false;\n const output: Partial> & { name: string } = {\n name,\n };\n\n if (!isBlurEvent || shouldDirty) {\n if (_proxyFormState.isDirty) {\n isPreviousDirty = _formState.isDirty;\n _formState.isDirty = output.isDirty = _getDirty();\n shouldUpdateField = isPreviousDirty !== output.isDirty;\n }\n\n const isCurrentFieldPristine = deepEqual(\n get(_defaultValues, name),\n fieldValue,\n );\n\n isPreviousDirty = get(_formState.dirtyFields, name);\n isCurrentFieldPristine\n ? unset(_formState.dirtyFields, name)\n : set(_formState.dirtyFields, name, true);\n output.dirtyFields = _formState.dirtyFields;\n shouldUpdateField =\n shouldUpdateField ||\n (_proxyFormState.dirtyFields &&\n isPreviousDirty !== !isCurrentFieldPristine);\n }\n\n if (isBlurEvent) {\n const isPreviousFieldTouched = get(_formState.touchedFields, name);\n\n if (!isPreviousFieldTouched) {\n set(_formState.touchedFields, name, isBlurEvent);\n output.touchedFields = _formState.touchedFields;\n shouldUpdateField =\n shouldUpdateField ||\n (_proxyFormState.touchedFields &&\n isPreviousFieldTouched !== isBlurEvent);\n }\n }\n\n shouldUpdateField && shouldRender && _subjects.state.next(output);\n\n return shouldUpdateField ? output : {};\n };\n\n const shouldRenderByError = (\n name: InternalFieldName,\n isValid?: boolean,\n error?: FieldError,\n fieldState?: {\n dirty?: FieldNamesMarkedBoolean;\n isDirty?: boolean;\n touched?: FieldNamesMarkedBoolean;\n },\n ) => {\n const previousFieldError = get(_formState.errors, name);\n const shouldUpdateValid =\n _proxyFormState.isValid &&\n isBoolean(isValid) &&\n _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 && isBoolean(isValid) ? { 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 _updateIsValidating(false);\n };\n\n const _executeSchema = async (name?: InternalFieldName[]) =>\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\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;\n }\n\n return errors;\n };\n\n const executeBuiltInValidation = async (\n fields: FieldRefs,\n shouldOnlyCheckValid?: boolean,\n context: {\n valid: boolean;\n } = {\n valid: true,\n },\n ) => {\n for (const name in fields) {\n const field = fields[name];\n\n if (field) {\n const { _f, ...fieldValue } = field;\n\n if (_f) {\n const isFieldArrayRoot = _names.array.has(_f.name);\n const fieldError = await validateField(\n field,\n get(_formValues, _f.name),\n shouldDisplayAllAssociatedErrors,\n _options.shouldUseNativeValidation,\n isFieldArrayRoot,\n );\n\n if (fieldError[_f.name]) {\n context.valid = false;\n if (shouldOnlyCheckValid) {\n break;\n }\n }\n\n !shouldOnlyCheckValid &&\n (get(fieldError, _f.name)\n ? isFieldArrayRoot\n ? updateFieldArrayRootError(\n _formState.errors,\n fieldError,\n _f.name,\n )\n : set(_formState.errors, _f.name, fieldError[_f.name])\n : unset(_formState.errors, _f.name));\n }\n\n fieldValue &&\n (await executeBuiltInValidation(\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 generateWatchOutput(\n names,\n _names,\n {\n ...(_stateFlags.mount\n ? _formValues\n : isUndefined(defaultValue)\n ? _defaultValues\n : isString(names)\n ? { [names]: defaultValue }\n : defaultValue),\n },\n 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 (optionRef) =>\n (optionRef.selected = (\n fieldValue as InternalFieldName[]\n ).includes(optionRef.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.defaultChecked || !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 &&\n 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}`;\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 !_stateFlags.mount && flushRootRender();\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 const getCurrentFieldValue = () =>\n target.type ? getFieldValue(field._f) : getEventValue(event);\n\n if (field) {\n let error;\n let isValid;\n const fieldValue = getCurrentFieldValue();\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 _proxyFormState.isValid && _updateValid();\n\n return (\n shouldRender &&\n _subjects.state.next({ name, ...(watched ? {} : fieldState) })\n );\n }\n\n !isBlurEvent && watched && _subjects.state.next({});\n\n _updateIsValidating(true);\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 if (error) {\n isValid = false;\n } else if (_proxyFormState.isValid) {\n isValid = await executeBuiltInValidation(_fields, true);\n }\n }\n\n if (!isPrimitive(fieldValue) || getCurrentFieldValue() === fieldValue) {\n field._f.deps &&\n trigger(\n field._f.deps as\n | FieldPath\n | FieldPath[],\n );\n shouldRenderByError(name, isValid, error, fieldState);\n } else {\n _updateIsValidating(false);\n }\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 _updateIsValidating(true);\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 executeBuiltInValidation(\n field && field._f ? { [fieldName]: field } : field,\n );\n }),\n )\n ).every(Boolean);\n !(!validationResult && !_formState.isValid) && _updateValid();\n } else {\n validationResult = isValid = await executeBuiltInValidation(_fields);\n }\n\n _subjects.state.next({\n ...(!isString(name) ||\n (_proxyFormState.isValid && isValid !== _formState.isValid)\n ? {}\n : { name }),\n ...(_options.resolver || !name ? { isValid } : {}),\n errors: _formState.errors,\n isValidating: false,\n });\n\n options.shouldFocus &&\n !validationResult &&\n focusFieldBy(\n _fields,\n (key) => 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)\n : fieldNames.map((name) => get(values, name));\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 = {});\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: {} })._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?: DeepPartial,\n ) =>\n isFunction(name)\n ? _subjects.watch.subscribe({\n next: (payload) =>\n name(\n _getWatch(undefined, defaultValue),\n payload as {\n name?: FieldPath;\n type?: EventType;\n value?: unknown;\n },\n ),\n })\n : _getWatch(\n name as InternalFieldName | InternalFieldName[],\n defaultValue,\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 ...(field || {}),\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 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 _focusError = () =>\n _options.shouldFocusError &&\n focusFieldBy(\n _fields,\n (key) => key && get(_formState.errors, key),\n _names.mount,\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;\n fieldValues = values;\n } else {\n await executeBuiltInValidation(_fields);\n }\n\n if (isEmptyObject(_formState.errors)) {\n _subjects.state.next({\n errors: {},\n isSubmitting: true,\n });\n await onValid(fieldValues, e);\n } else {\n if (onInvalid) {\n await onInvalid({ ..._formState.errors }, e);\n }\n\n _focusError();\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 || shouldCaptureDirtyFields) {\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 if (isHTMLElement(fieldReference)) {\n const form = fieldReference.closest('form');\n if (form) {\n form.reset();\n break;\n }\n }\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 && flushRootRender();\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 : {},\n errors: keepStateOptions.keepErrors ? _formState.errors : {},\n isSubmitting: false,\n isSubmitSuccessful: false,\n });\n };\n\n const reset: UseFormReset = (formValues, keepStateOptions) =>\n _reset(\n isFunction(formValues)\n ? formValues(_formValues as TFieldValues)\n : formValues,\n keepStateOptions,\n );\n\n const setFocus: UseFormSetFocus = (name, options = {}) => {\n const field = get(_fields, name);\n const fieldReference = field && field._f;\n\n if (fieldReference) {\n const fieldRef = fieldReference.refs\n ? fieldReference.refs[0]\n : fieldReference.ref;\n\n if (fieldRef.focus) {\n fieldRef.focus();\n options.shouldSelect && fieldRef.select();\n }\n }\n };\n\n if (isFunction(_options.defaultValues)) {\n _options.defaultValues().then((values) => {\n reset(values, _options.resetOptions);\n _subjects.state.next({\n isLoading: false,\n });\n });\n }\n\n return {\n control: {\n register,\n unregister,\n getFieldState,\n _executeSchema,\n _focusError,\n _getWatch,\n _getDirty,\n _updateValid,\n _removeUnmounted,\n _updateFieldArray,\n _getFieldArray,\n _reset,\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 deepEqual from './utils/deepEqual';\nimport isFunction from './utils/isFunction';\nimport { FieldValues, FormState, UseFormProps, UseFormReturn } from './types';\nimport { useSubscribe } from './useSubscribe';\n\n/**\n * Custom hook to manage 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 = any,\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 isLoading: true,\n isSubmitted: false,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n submitCount: 0,\n dirtyFields: {},\n touchedFields: {},\n errors: {},\n defaultValues: isFunction(props.defaultValues)\n ? undefined\n : props.defaultValues,\n });\n\n if (!_formControl.current) {\n _formControl.current = {\n ...createFormControl(props, () =>\n updateFormState((formState) => ({ ...formState })),\n ),\n formState,\n };\n }\n\n const control = _formControl.current.control;\n control._options = props;\n\n useSubscribe({\n subject: control._subjects.state,\n next: (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 });\n\n React.useEffect(() => {\n if (!control._stateFlags.mount) {\n control._proxyFormState.isValid && control._updateValid();\n control._stateFlags.mount = true;\n }\n\n if (control._stateFlags.watch) {\n control._stateFlags.watch = false;\n control._subjects.state.next({});\n }\n\n control._removeUnmounted();\n });\n\n React.useEffect(() => {\n if (props.values && !deepEqual(props.values, control._defaultValues)) {\n control._reset(props.values, control._options.resetOptions);\n }\n }, [props.values, control]);\n\n React.useEffect(() => {\n formState.submitCount && control._focusError();\n }, [control, formState.submitCount]);\n\n _formControl.current.formState = getProxyFormState(formState, control);\n\n return _formControl.current;\n}\n"],"names":["_objectWithoutProperties","source","excluded","key","i","target","Object","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","prototype","propertyIsEnumerable","call","element","type","value","Date","isObjectType","isNullOrUndefined","Array","isArray","isDateObject","event","isObject","isCheckBoxInput","checked","names","name","has","substring","search","getNodeParentName","filter","Boolean","val","undefined","obj","path","defaultValue","result","compact","split","reduce","isUndefined","EVENTS","BLUR","FOCUS_OUT","CHANGE","VALIDATION_MODE","onBlur","onChange","onSubmit","onTouched","all","INPUT_VALIDATION_RULES","HookFormContext","React","useFormContext","formState","control","localProxyFormState","isRoot","defaultValues","_defaultValues","defineProperty","get","_key","_proxyFormState","_loop","keys","formStateData","isEmptyObject","find","signalName","exact","convertToArrayPayload","some","currentName","startsWith","useSubscribe","props","_props","current","subscription","disabled","subject","subscribe","next","unsubscribe","_names","formValues","isGlobal","isString","watch","add","map","fieldName","watchAll","tempObject","prototypeCopy","constructor","hasOwnProperty","window","HTMLElement","document","cloneObject","data","copy","Set","isWeb","Blob","FileList","isPlainObject","useWatch","methods","_ref2$control","_name","_subjects","shouldSubscribeByName","fieldValues","generateWatchOutput","values","_formValues","updateValue","_getWatch","_React$useState4","_removeUnmounted","validateAllFieldCriteria","errors","message","types","test","input","replace","set","object","index","tempPath","isKey","stringToPath","lastIndex","newValue","objValue","isNaN","focusFieldBy","fields","callback","fieldsNames","_step","field","_f","currentField","ref","focus","refs","_iterator","d","performance","now","c","r","Math","random","toString","options","shouldFocus","focusName","focusIndex","mode","isOnSubmit","isOnBlur","isOnChange","isOnAll","isOnTouch","isBlurEvent","_toConsumableArray","watchName","slice","error","fieldArrayErrors","RegExp","defaultResult","isValid","validResult","option","attributes","defaultReturn","previous","getValidateError","isMessage","every","isBoolean","validationData","isRegex","inputValue","shouldUseNativeValidation","isFieldArray","_field$_f","required","maxLength","minLength","min","max","pattern","validate","valueAsNumber","mount","_context","inputRef","setCustomValidity","reportValidity","isRadio","isRadioInput","isCheckBox","isRadioOrCheckbox","isEmpty","isFileInput","appendErrorsCurry","appendErrors","bind","getMinMaxMessage","exceedMax","maxLengthMessage","minLengthMessage","maxType","minType","getCheckboxValue","getRadioValue","_ref4","getValueAndMessage","maxOutput","minOutput","valueDate","valueAsDate","convertTimeToDate","time","toDateString","isTime","isWeek","exceedMin","valueNumber","maxLengthOutput","minLengthOutput","_getValueAndMessage","patternValue","match","isFunction","validateError","validationResult","validateField","append","insert","from","to","splice","prepend","indexes","_step2","temp","_iterator2","removeAtIndexes","sort","a","b","indexA","indexB","isEmptyArray","unset","previousObjRef","updatePath","childObject","baseGet","k","objectRef","currentPaths","currentPathsLength","item","useFieldArray","_props$keyName","keyName","shouldUnregister","_getFieldArray","_React$useState6","setFields","ids","generateId","_fieldIds","_actioned","array","rules","register","fieldArrayName","updateValues","updatedFieldArrayValues","_updateFieldArray","_stateFlags","action","isWatched","state","getValidationModes","_options","_formState","isSubmitted","resolver","_executeSchema","then","existingError","_fields","criteriaMode","updateFieldArrayRootError","_updateValid","unregister","swap","swapArrayAt","argA","argB","move","moveArrayAt","prependValue","prependAt","getFocusFieldName","fillEmptyArray","appendValue","appendAt","remove","removeArrayAt","insertValue","insertAt","update","updateAt","createSubject","_observers","observers","_step3","_iterator3","observer","push","o","deepEqual","object1","object2","isPrimitive","getTime","keys1","keys2","val1","includes","val2","owner","ownerDocument","defaultView","isHTMLElement","isConnected","markFieldsDirty","isParentNodeArray","objectHasFunction","getDirtyFieldsFromDefaultValues","dirtyFieldsFromValues","setValueAs","NaN","getFieldValue","files","isMultipleSelect","selectedOptions","getFieldValueAs","_step4","_iterator4","rule","schemaErrorLookup","join","foundError","pop","isTouched","reValidateMode","defaultOptions","shouldFocusError","createFormControl","delayErrorCallback","flushRootRender","shouldCaptureDirtyFields","resetOptions","keepDirtyValues","submitCount","isDirty","isLoading","isValidating","isSubmitting","isSubmitSuccessful","touchedFields","dirtyFields","unMount","timer","validationModeBeforeSubmit","validationModeAfterSubmit","shouldDisplayAllAssociatedErrors","_context2","executeBuiltInValidation","_updateIsValidating","updateValidAndValue","shouldSkipSetValueAs","defaultChecked","setFieldValue","updateTouchAndDirty","fieldValue","shouldDirty","shouldRender","shouldUpdateField","isPreviousDirty","output","_getDirty","isCurrentFieldPristine","isPreviousFieldTouched","shouldRenderByError","fieldState","previousFieldError","shouldUpdateValid","delayError","updateErrors","wait","clearTimeout","setTimeout","updatedFormState","_context3","context","getResolverOptions","executeSchemaAndUpdateState","_context4","_yield$_executeSchema","_iterator5","shouldOnlyCheckValid","_name4","isFieldArrayRoot","fieldError","_args5","valid","_context5","getValues","fieldReference","forEach","optionRef","selected","checkboxRef","radioRef","shouldTouch","shouldValidate","trigger","setValues","fieldKey","setValue","cloneValue","getDirtyFields","getCurrentFieldValue","getEventValue","_context6","shouldSkipValidation","hasValidation","deps","skipValidation","watched","_yield$_executeSchema2","previousErrorLookupResult","errorLookupResult","fieldNames","_args8","_context8","Promise","_context7","getFieldState","invalid","_step7","delete","keepValue","keepError","keepDirty","keepTouched","keepDefaultValue","_iterator7","keepIsValid","disabledIsDefined","getRuleValue","fieldRef","querySelectorAll","radioOrCheckbox","live","isNameInFieldArray","_focusError","_reset","keepStateOptions","updatedValues","cloneUpdatedValues","keepDefaultValues","keepValues","_step8","_iterator8","_step9","form","closest","reset","_iterator9","keepSubmitCount","keepIsSubmitted","keepErrors","_step6","_iterator6","method","args","shouldSetValues","shouldUpdateFieldsAndState","unsetEmptyArray","handleSubmit","onValid","onInvalid","e","preventDefault","persist","hasNoPromiseError","_context9","_yield$_executeSchema3","payload","resetField","clearErrors","inputName","setError","setFocus","shouldSelect","select","useForm","_formControl","_React$useState8","updateFormState","shouldRenderFormState","getProxyFormState"],"sourceRoot":""}