{"version":3,"file":"index.BJYpbjy5.js","sources":["../../../../../../../node_modules/react-hook-form/dist/index.esm.mjs","../../../../../../../node_modules/@babylon/ui-kit-forms/components/others/form/styled.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/others/form/index.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/panel-vehicle/utils/utils.js","../../../../../../../node_modules/lodash/_freeGlobal.js","../../../../../../../node_modules/lodash/_root.js","../../../../../../../node_modules/lodash/_Symbol.js","../../../../../../../node_modules/lodash/_getRawTag.js","../../../../../../../node_modules/lodash/_objectToString.js","../../../../../../../node_modules/lodash/_baseGetTag.js","../../../../../../../node_modules/lodash/isObject.js","../../../../../../../node_modules/lodash/isFunction.js","../../../../../../../node_modules/lodash/_coreJsData.js","../../../../../../../node_modules/lodash/_isMasked.js","../../../../../../../node_modules/lodash/_toSource.js","../../../../../../../node_modules/lodash/_baseIsNative.js","../../../../../../../node_modules/lodash/_getValue.js","../../../../../../../node_modules/lodash/_getNative.js","../../../../../../../node_modules/lodash/_nativeCreate.js","../../../../../../../node_modules/lodash/_hashClear.js","../../../../../../../node_modules/lodash/_hashDelete.js","../../../../../../../node_modules/lodash/_hashGet.js","../../../../../../../node_modules/lodash/_hashHas.js","../../../../../../../node_modules/lodash/_hashSet.js","../../../../../../../node_modules/lodash/_Hash.js","../../../../../../../node_modules/lodash/_listCacheClear.js","../../../../../../../node_modules/lodash/eq.js","../../../../../../../node_modules/lodash/_assocIndexOf.js","../../../../../../../node_modules/lodash/_listCacheDelete.js","../../../../../../../node_modules/lodash/_listCacheGet.js","../../../../../../../node_modules/lodash/_listCacheHas.js","../../../../../../../node_modules/lodash/_listCacheSet.js","../../../../../../../node_modules/lodash/_ListCache.js","../../../../../../../node_modules/lodash/_Map.js","../../../../../../../node_modules/lodash/_mapCacheClear.js","../../../../../../../node_modules/lodash/_isKeyable.js","../../../../../../../node_modules/lodash/_getMapData.js","../../../../../../../node_modules/lodash/_mapCacheDelete.js","../../../../../../../node_modules/lodash/_mapCacheGet.js","../../../../../../../node_modules/lodash/_mapCacheHas.js","../../../../../../../node_modules/lodash/_mapCacheSet.js","../../../../../../../node_modules/lodash/_MapCache.js","../../../../../../../node_modules/lodash/memoize.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/accommodation/components/panel-accommodation/types.js","../../../../../../../node_modules/@babylon/ui-kit-forms/helpers/validate.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/others/error-tooltip/styled.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/others/error-tooltip/index.js","../../../../../../../node_modules/@babylon/ui-kit-forms/hooks/useInput/utils.js","../../../../../../../node_modules/@babylon/ui-kit-forms/hooks/useInput/index.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/input/themes/styles/logitravel.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/input/themes/styles/partnershipsLiverpool.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/input/themes/styles/partnershipsUniversalMusic.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/input/themes/styles/veci.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/input/themes/index.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/input/styled.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/input/index.js"],"sourcesContent":["import React from 'react';\n\nvar isCheckBoxInput = (element) => element.type === 'checkbox';\n\nvar isDateObject = (value) => value instanceof Date;\n\nvar isNullOrUndefined = (value) => value == null;\n\nconst isObjectType = (value) => typeof value === 'object';\nvar isObject = (value) => !isNullOrUndefined(value) &&\n !Array.isArray(value) &&\n isObjectType(value) &&\n !isDateObject(value);\n\nvar getEventValue = (event) => isObject(event) && event.target\n ? isCheckBoxInput(event.target)\n ? event.target.checked\n : event.target.value\n : event;\n\nvar getNodeParentName = (name) => name.substring(0, name.search(/\\.\\d+(\\.|$)/)) || name;\n\nvar isNameInFieldArray = (names, name) => names.has(getNodeParentName(name));\n\nvar isPlainObject = (tempObject) => {\n const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;\n return (isObject(prototypeCopy) && prototypeCopy.hasOwnProperty('isPrototypeOf'));\n};\n\nvar isWeb = typeof window !== 'undefined' &&\n typeof window.HTMLElement !== 'undefined' &&\n typeof document !== 'undefined';\n\nfunction cloneObject(data) {\n let copy;\n const isArray = Array.isArray(data);\n if (data instanceof Date) {\n copy = new Date(data);\n }\n else if (data instanceof Set) {\n copy = new Set(data);\n }\n else if (!(isWeb && (data instanceof Blob || data instanceof FileList)) &&\n (isArray || isObject(data))) {\n copy = isArray ? [] : {};\n if (!isArray && !isPlainObject(data)) {\n copy = data;\n }\n else {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n copy[key] = cloneObject(data[key]);\n }\n }\n }\n }\n else {\n return data;\n }\n return copy;\n}\n\nvar compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];\n\nvar isUndefined = (val) => val === undefined;\n\nvar get = (object, path, defaultValue) => {\n if (!path || !isObject(object)) {\n return defaultValue;\n }\n const result = compact(path.split(/[,[\\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);\n return isUndefined(result) || result === object\n ? isUndefined(object[path])\n ? defaultValue\n : object[path]\n : result;\n};\n\nvar isBoolean = (value) => typeof value === 'boolean';\n\nvar isKey = (value) => /^\\w*$/.test(value);\n\nvar stringToPath = (input) => compact(input.replace(/[\"|']|\\]/g, '').split(/\\.|\\[/));\n\nvar set = (object, path, value) => {\n let index = -1;\n const tempPath = isKey(path) ? [path] : stringToPath(path);\n const length = tempPath.length;\n const lastIndex = length - 1;\n while (++index < length) {\n const key = tempPath[index];\n let newValue = value;\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 if (key === '__proto__') {\n return;\n }\n object[key] = newValue;\n object = object[key];\n }\n return object;\n};\n\nconst EVENTS = {\n BLUR: 'blur',\n FOCUS_OUT: 'focusout',\n CHANGE: 'change',\n};\nconst VALIDATION_MODE = {\n onBlur: 'onBlur',\n onChange: 'onChange',\n onSubmit: 'onSubmit',\n onTouched: 'onTouched',\n all: 'all',\n};\nconst 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\nconst HookFormContext = React.createContext(null);\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/docs/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 */\nconst useFormContext = () => React.useContext(HookFormContext);\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/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)\n *\n * @param props - 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 */\nconst FormProvider = (props) => {\n const { children, ...data } = props;\n return (React.createElement(HookFormContext.Provider, { value: data }, children));\n};\n\nvar getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {\n const result = {\n defaultValues: control._defaultValues,\n };\n for (const key in formState) {\n Object.defineProperty(result, key, {\n get: () => {\n const _key = key;\n if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {\n control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;\n }\n localProxyFormState && (localProxyFormState[_key] = true);\n return formState[_key];\n },\n });\n }\n return result;\n};\n\nvar isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;\n\nvar shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {\n updateFormState(formStateData);\n const { name, ...formState } = formStateData;\n return (isEmptyObject(formState) ||\n Object.keys(formState).length >= Object.keys(_proxyFormState).length ||\n Object.keys(formState).find((key) => _proxyFormState[key] ===\n (!isRoot || VALIDATION_MODE.all)));\n};\n\nvar convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);\n\nvar shouldSubscribeByName = (name, signalName, exact) => !name ||\n !signalName ||\n name === signalName ||\n convertToArrayPayload(name).some((currentName) => currentName &&\n (exact\n ? currentName === signalName\n : currentName.startsWith(signalName) ||\n signalName.startsWith(currentName)));\n\nfunction useSubscribe(props) {\n const _props = React.useRef(props);\n _props.current = props;\n React.useEffect(() => {\n const subscription = !props.disabled &&\n _props.current.subject &&\n _props.current.subject.subscribe({\n next: _props.current.next,\n });\n return () => {\n subscription && subscription.unsubscribe();\n };\n }, [props.disabled]);\n}\n\n/**\n * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)\n *\n * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, handleSubmit, control } = useForm({\n * defaultValues: {\n * firstName: \"firstName\"\n * }});\n * const { dirtyFields } = useFormState({\n * control\n * });\n * const onSubmit = (data) => console.log(data);\n *\n * return (\n *
\n * \n * {dirtyFields.firstName &&

Field is dirty.

}\n * \n *
\n * );\n * }\n * ```\n */\nfunction useFormState(props) {\n const methods = useFormContext();\n const { control = methods.control, disabled, name, exact } = props || {};\n const [formState, updateFormState] = React.useState(control._formState);\n const _mounted = React.useRef(true);\n const _localProxyFormState = React.useRef({\n isDirty: false,\n isLoading: false,\n dirtyFields: false,\n touchedFields: false,\n validatingFields: false,\n isValidating: false,\n isValid: false,\n errors: false,\n });\n const _name = React.useRef(name);\n _name.current = name;\n useSubscribe({\n disabled,\n next: (value) => _mounted.current &&\n shouldSubscribeByName(_name.current, value.name, exact) &&\n shouldRenderFormState(value, _localProxyFormState.current, control._updateFormState) &&\n updateFormState({\n ...control._formState,\n ...value,\n }),\n subject: control._subjects.state,\n });\n React.useEffect(() => {\n _mounted.current = true;\n _localProxyFormState.current.isValid && control._updateValid(true);\n return () => {\n _mounted.current = false;\n };\n }, [control]);\n return getProxyFormState(formState, control, _localProxyFormState.current, false);\n}\n\nvar isString = (value) => typeof value === 'string';\n\nvar generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {\n if (isString(names)) {\n isGlobal && _names.watch.add(names);\n return get(formValues, names, defaultValue);\n }\n if (Array.isArray(names)) {\n return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName), get(formValues, fieldName)));\n }\n isGlobal && (_names.watchAll = true);\n return formValues;\n};\n\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/docs/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)\n *\n * @example\n * ```tsx\n * const { control } = useForm();\n * const values = useWatch({\n * name: \"fieldName\"\n * control,\n * })\n * ```\n */\nfunction useWatch(props) {\n const methods = useFormContext();\n const { control = methods.control, name, defaultValue, disabled, exact, } = props || {};\n const _name = React.useRef(name);\n _name.current = name;\n useSubscribe({\n disabled,\n subject: control._subjects.values,\n next: (formState) => {\n if (shouldSubscribeByName(_name.current, formState.name, exact)) {\n updateValue(cloneObject(generateWatchOutput(_name.current, control._names, formState.values || control._formValues, false, defaultValue)));\n }\n },\n });\n const [value, updateValue] = React.useState(control._getWatch(name, defaultValue));\n React.useEffect(() => control._removeUnmounted());\n return value;\n}\n\n/**\n * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px)\n *\n * @param props - the path name to the form field value, and validation rules.\n *\n * @returns field properties, field and form state. {@link UseControllerReturn}\n *\n * @example\n * ```tsx\n * function Input(props) {\n * const { field, fieldState, formState } = useController(props);\n * return (\n *
\n * \n *

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

\n *

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

\n *
\n * );\n * }\n * ```\n */\nfunction useController(props) {\n const methods = useFormContext();\n const { name, disabled, control = methods.control, shouldUnregister } = props;\n const isArrayField = isNameInFieldArray(control._names.array, name);\n const value = useWatch({\n control,\n name,\n defaultValue: get(control._formValues, name, get(control._defaultValues, name, props.defaultValue)),\n exact: true,\n });\n const formState = useFormState({\n control,\n name,\n exact: true,\n });\n const _registerProps = React.useRef(control.register(name, {\n ...props.rules,\n value,\n ...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),\n }));\n React.useEffect(() => {\n const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;\n const updateMounted = (name, value) => {\n const field = get(control._fields, name);\n if (field && field._f) {\n field._f.mount = value;\n }\n };\n updateMounted(name, true);\n if (_shouldUnregisterField) {\n const value = cloneObject(get(control._options.defaultValues, name));\n set(control._defaultValues, name, value);\n if (isUndefined(get(control._formValues, name))) {\n set(control._formValues, name, value);\n }\n }\n return () => {\n (isArrayField\n ? _shouldUnregisterField && !control._state.action\n : _shouldUnregisterField)\n ? control.unregister(name)\n : updateMounted(name, false);\n };\n }, [name, control, isArrayField, shouldUnregister]);\n React.useEffect(() => {\n if (get(control._fields, name)) {\n control._updateDisabledField({\n disabled,\n fields: control._fields,\n name,\n value: get(control._fields, name)._f.value,\n });\n }\n }, [disabled, name, control]);\n return {\n field: {\n name,\n value,\n ...(isBoolean(disabled) || formState.disabled\n ? { disabled: formState.disabled || disabled }\n : {}),\n onChange: React.useCallback((event) => _registerProps.current.onChange({\n target: {\n value: getEventValue(event),\n name: name,\n },\n type: EVENTS.CHANGE,\n }), [name]),\n onBlur: React.useCallback(() => _registerProps.current.onBlur({\n target: {\n value: get(control._formValues, name),\n name: name,\n },\n type: EVENTS.BLUR,\n }), [name, control]),\n ref: React.useCallback((elm) => {\n const field = get(control._fields, name);\n if (field && elm) {\n field._f.ref = {\n focus: () => elm.focus(),\n select: () => elm.select(),\n setCustomValidity: (message) => elm.setCustomValidity(message),\n reportValidity: () => elm.reportValidity(),\n };\n }\n }, [control._fields, name]),\n },\n formState,\n fieldState: Object.defineProperties({}, {\n invalid: {\n enumerable: true,\n get: () => !!get(formState.errors, name),\n },\n isDirty: {\n enumerable: true,\n get: () => !!get(formState.dirtyFields, name),\n },\n isTouched: {\n enumerable: true,\n get: () => !!get(formState.touchedFields, name),\n },\n isValidating: {\n enumerable: true,\n get: () => !!get(formState.validatingFields, name),\n },\n error: {\n enumerable: true,\n get: () => get(formState.errors, name),\n },\n }),\n };\n}\n\n/**\n * Component based on `useController` hook to work with controlled component.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/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 = (props) => props.render(useController(props));\n\nconst flatten = (obj) => {\n const output = {};\n for (const key of Object.keys(obj)) {\n if (isObjectType(obj[key])) {\n const nested = flatten(obj[key]);\n for (const nestedKey of Object.keys(nested)) {\n output[`${key}.${nestedKey}`] = nested[nestedKey];\n }\n }\n else {\n output[key] = obj[key];\n }\n }\n return output;\n};\n\nconst POST_REQUEST = 'post';\n/**\n * Form component to manage submission.\n *\n * @param props - to setup submission detail. {@link FormProps}\n *\n * @returns form component or headless render prop.\n *\n * @example\n * ```tsx\n * function App() {\n * const { control, formState: { errors } } = useForm();\n *\n * return (\n *
\n * \n *

{errors?.root?.server && 'Server error'}

\n * \n *
\n * );\n * }\n * ```\n */\nfunction Form(props) {\n const methods = useFormContext();\n const [mounted, setMounted] = React.useState(false);\n const { control = methods.control, onSubmit, children, action, method = POST_REQUEST, headers, encType, onError, render, onSuccess, validateStatus, ...rest } = props;\n const submit = async (event) => {\n let hasError = false;\n let type = '';\n await control.handleSubmit(async (data) => {\n const formData = new FormData();\n let formDataJson = '';\n try {\n formDataJson = JSON.stringify(data);\n }\n catch (_a) { }\n const flattenFormValues = flatten(control._formValues);\n for (const key in flattenFormValues) {\n formData.append(key, flattenFormValues[key]);\n }\n if (onSubmit) {\n await onSubmit({\n data,\n event,\n method,\n formData,\n formDataJson,\n });\n }\n if (action) {\n try {\n const shouldStringifySubmissionData = [\n headers && headers['Content-Type'],\n encType,\n ].some((value) => value && value.includes('json'));\n const response = await fetch(action, {\n method,\n headers: {\n ...headers,\n ...(encType ? { 'Content-Type': encType } : {}),\n },\n body: shouldStringifySubmissionData ? formDataJson : formData,\n });\n if (response &&\n (validateStatus\n ? !validateStatus(response.status)\n : response.status < 200 || response.status >= 300)) {\n hasError = true;\n onError && onError({ response });\n type = String(response.status);\n }\n else {\n onSuccess && onSuccess({ response });\n }\n }\n catch (error) {\n hasError = true;\n onError && onError({ error });\n }\n }\n })(event);\n if (hasError && props.control) {\n props.control._subjects.state.next({\n isSubmitSuccessful: false,\n });\n props.control.setError('root.server', {\n type,\n });\n }\n };\n React.useEffect(() => {\n setMounted(true);\n }, []);\n return render ? (React.createElement(React.Fragment, null, render({\n submit,\n }))) : (React.createElement(\"form\", { noValidate: mounted, action: action, method: method, encType: encType, onSubmit: submit, ...rest }, children));\n}\n\nvar appendErrors = (name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria\n ? {\n ...errors[name],\n types: {\n ...(errors[name] && errors[name].types ? errors[name].types : {}),\n [type]: message || true,\n },\n }\n : {};\n\nvar generateId = () => {\n const d = typeof performance === 'undefined' ? Date.now() : performance.now() * 1000;\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16 + d) % 16 | 0;\n return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nvar getFocusFieldName = (name, index, options = {}) => options.shouldFocus || isUndefined(options.shouldFocus)\n ? options.focusName ||\n `${name}.${isUndefined(options.focusIndex) ? index : options.focusIndex}.`\n : '';\n\nvar getValidationModes = (mode) => ({\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\nvar isWatched = (name, _names, isBlurEvent) => !isBlurEvent &&\n (_names.watchAll ||\n _names.watch.has(name) ||\n [..._names.watch].some((watchName) => name.startsWith(watchName) &&\n /^\\.\\w+/.test(name.slice(watchName.length))));\n\nconst iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {\n for (const key of fieldsNames || Object.keys(fields)) {\n const field = get(fields, key);\n if (field) {\n const { _f, ...currentField } = field;\n if (_f) {\n if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) {\n return true;\n }\n else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) {\n return true;\n }\n else {\n if (iterateFieldsByAction(currentField, action)) {\n break;\n }\n }\n }\n else if (isObject(currentField)) {\n if (iterateFieldsByAction(currentField, action)) {\n break;\n }\n }\n }\n }\n return;\n};\n\nvar updateFieldArrayRootError = (errors, error, name) => {\n const fieldArrayErrors = convertToArrayPayload(get(errors, name));\n set(fieldArrayErrors, 'root', error[name]);\n set(errors, name, fieldArrayErrors);\n return errors;\n};\n\nvar isFileInput = (element) => element.type === 'file';\n\nvar isFunction = (value) => typeof value === 'function';\n\nvar isHTMLElement = (value) => {\n if (!isWeb) {\n return false;\n }\n const owner = value ? value.ownerDocument : 0;\n return (value instanceof\n (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement));\n};\n\nvar isMessage = (value) => isString(value);\n\nvar isRadioInput = (element) => element.type === 'radio';\n\nvar isRegex = (value) => value instanceof RegExp;\n\nconst defaultResult = {\n value: false,\n isValid: false,\n};\nconst validResult = { value: true, isValid: true };\nvar getCheckboxValue = (options) => {\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 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 return defaultResult;\n};\n\nconst defaultReturn = {\n isValid: false,\n value: null,\n};\nvar getRadioValue = (options) => Array.isArray(options)\n ? options.reduce((previous, option) => option && option.checked && !option.disabled\n ? {\n isValid: true,\n value: option.value,\n }\n : previous, defaultReturn)\n : defaultReturn;\n\nfunction getValidateError(result, ref, type = 'validate') {\n if (isMessage(result) ||\n (Array.isArray(result) && result.every(isMessage)) ||\n (isBoolean(result) && !result)) {\n return {\n type,\n message: isMessage(result) ? result : '',\n ref,\n };\n }\n}\n\nvar getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData)\n ? validationData\n : {\n value: validationData,\n message: '',\n };\n\nvar validateField = async (field, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {\n const { ref, refs, required, maxLength, minLength, min, max, pattern, validate, name, valueAsNumber, mount, disabled, } = field._f;\n const inputValue = get(formValues, name);\n if (!mount || disabled) {\n return {};\n }\n const inputRef = refs ? refs[0] : ref;\n const setCustomValidity = (message) => {\n if (shouldUseNativeValidation && inputRef.reportValidity) {\n inputRef.setCustomValidity(isBoolean(message) ? '' : message || '');\n inputRef.reportValidity();\n }\n };\n const error = {};\n const isRadio = isRadioInput(ref);\n const isCheckBox = isCheckBoxInput(ref);\n const isRadioOrCheckbox = isRadio || isCheckBox;\n const isEmpty = ((valueAsNumber || isFileInput(ref)) &&\n isUndefined(ref.value) &&\n isUndefined(inputValue)) ||\n (isHTMLElement(ref) && ref.value === '') ||\n inputValue === '' ||\n (Array.isArray(inputValue) && !inputValue.length);\n const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);\n const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {\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 if (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 const { value, message } = isMessage(required)\n ? { value: !!required, message: required }\n : getValueAndMessage(required);\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 if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) {\n let exceedMax;\n let exceedMin;\n const maxOutput = getValueAndMessage(max);\n const minOutput = getValueAndMessage(min);\n if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {\n const valueNumber = ref.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 }\n else {\n const valueDate = ref.valueAsDate || new Date(inputValue);\n const convertTimeToDate = (time) => new Date(new Date().toDateString() + ' ' + time);\n const isTime = ref.type == 'time';\n const isWeek = ref.type == 'week';\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 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 if (exceedMax || exceedMin) {\n getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);\n if (!validateAllFieldCriteria) {\n setCustomValidity(error[name].message);\n return error;\n }\n }\n }\n if ((maxLength || minLength) &&\n !isEmpty &&\n (isString(inputValue) || (isFieldArray && Array.isArray(inputValue)))) {\n const maxLengthOutput = getValueAndMessage(maxLength);\n const minLengthOutput = getValueAndMessage(minLength);\n const exceedMax = !isNullOrUndefined(maxLengthOutput.value) &&\n inputValue.length > +maxLengthOutput.value;\n const exceedMin = !isNullOrUndefined(minLengthOutput.value) &&\n inputValue.length < +minLengthOutput.value;\n if (exceedMax || exceedMin) {\n getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);\n if (!validateAllFieldCriteria) {\n setCustomValidity(error[name].message);\n return error;\n }\n }\n }\n if (pattern && !isEmpty && isString(inputValue)) {\n const { value: patternValue, message } = getValueAndMessage(pattern);\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 if (validate) {\n if (isFunction(validate)) {\n const result = await validate(inputValue, formValues);\n const validateError = getValidateError(result, inputRef);\n if (validateError) {\n error[name] = {\n ...validateError,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(validateError.message);\n return error;\n }\n }\n }\n else if (isObject(validate)) {\n let validationResult = {};\n for (const key in validate) {\n if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {\n break;\n }\n const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key);\n if (validateError) {\n validationResult = {\n ...validateError,\n ...appendErrorsCurry(key, validateError.message),\n };\n setCustomValidity(validateError.message);\n if (validateAllFieldCriteria) {\n error[name] = validationResult;\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 setCustomValidity(true);\n return error;\n};\n\nvar appendAt = (data, value) => [\n ...data,\n ...convertToArrayPayload(value),\n];\n\nvar fillEmptyArray = (value) => Array.isArray(value) ? value.map(() => undefined) : undefined;\n\nfunction insert(data, index, value) {\n return [\n ...data.slice(0, index),\n ...convertToArrayPayload(value),\n ...data.slice(index),\n ];\n}\n\nvar moveArrayAt = (data, from, to) => {\n if (!Array.isArray(data)) {\n return [];\n }\n if (isUndefined(data[to])) {\n data[to] = undefined;\n }\n data.splice(to, 0, data.splice(from, 1)[0]);\n return data;\n};\n\nvar prependAt = (data, value) => [\n ...convertToArrayPayload(value),\n ...convertToArrayPayload(data),\n];\n\nfunction removeAtIndexes(data, indexes) {\n let i = 0;\n const temp = [...data];\n for (const index of indexes) {\n temp.splice(index - i, 1);\n i++;\n }\n return compact(temp).length ? temp : [];\n}\nvar removeArrayAt = (data, index) => isUndefined(index)\n ? []\n : removeAtIndexes(data, convertToArrayPayload(index).sort((a, b) => a - b));\n\nvar swapArrayAt = (data, indexA, indexB) => {\n [data[indexA], data[indexB]] = [data[indexB], data[indexA]];\n};\n\nfunction baseGet(object, updatePath) {\n const length = updatePath.slice(0, -1).length;\n let index = 0;\n while (index < length) {\n object = isUndefined(object) ? index++ : object[updatePath[index++]];\n }\n return object;\n}\nfunction isEmptyArray(obj) {\n for (const key in obj) {\n if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {\n return false;\n }\n }\n return true;\n}\nfunction unset(object, path) {\n const paths = Array.isArray(path)\n ? path\n : isKey(path)\n ? [path]\n : stringToPath(path);\n const childObject = paths.length === 1 ? object : baseGet(object, paths);\n const index = paths.length - 1;\n const key = paths[index];\n if (childObject) {\n delete childObject[key];\n }\n if (index !== 0 &&\n ((isObject(childObject) && isEmptyObject(childObject)) ||\n (Array.isArray(childObject) && isEmptyArray(childObject)))) {\n unset(object, paths.slice(0, -1));\n }\n return object;\n}\n\nvar updateAt = (fieldValues, index, value) => {\n fieldValues[index] = value;\n return fieldValues;\n};\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/docs/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 */\nfunction useFieldArray(props) {\n const methods = useFormContext();\n const { control = methods.control, name, keyName = 'id', shouldUnregister, } = props;\n const [fields, setFields] = React.useState(control._getFieldArray(name));\n const ids = React.useRef(control._getFieldArray(name).map(generateId));\n const _fieldIds = React.useRef(fields);\n const _name = React.useRef(name);\n const _actioned = React.useRef(false);\n _name.current = name;\n _fieldIds.current = fields;\n control._names.array.add(name);\n props.rules &&\n control.register(name, props.rules);\n useSubscribe({\n next: ({ values, name: fieldArrayName, }) => {\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 const updateValues = React.useCallback((updatedFieldArrayValues) => {\n _actioned.current = true;\n control._updateFieldArray(name, updatedFieldArrayValues);\n }, [control, name]);\n const append = (value, options) => {\n const appendValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = appendAt(control._getFieldArray(name), appendValue);\n control._names.focus = getFocusFieldName(name, updatedFieldArrayValues.length - 1, options);\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 const prepend = (value, options) => {\n const prependValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = prependAt(control._getFieldArray(name), prependValue);\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 const remove = (index) => {\n const updatedFieldArrayValues = 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 const insert$1 = (index, value, options) => {\n const insertValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = insert(control._getFieldArray(name), index, insertValue);\n control._names.focus = getFocusFieldName(name, index, options);\n ids.current = insert(ids.current, index, insertValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._updateFieldArray(name, updatedFieldArrayValues, insert, {\n argA: index,\n argB: fillEmptyArray(value),\n });\n };\n const swap = (indexA, indexB) => {\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(name, updatedFieldArrayValues, swapArrayAt, {\n argA: indexA,\n argB: indexB,\n }, false);\n };\n const move = (from, to) => {\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(name, updatedFieldArrayValues, moveArrayAt, {\n argA: from,\n argB: to,\n }, false);\n };\n const update = (index, value) => {\n const updateValue = cloneObject(value);\n const updatedFieldArrayValues = updateAt(control._getFieldArray(name), index, updateValue);\n ids.current = [...updatedFieldArrayValues].map((item, i) => !item || i === index ? generateId() : ids.current[i]);\n updateValues(updatedFieldArrayValues);\n setFields([...updatedFieldArrayValues]);\n control._updateFieldArray(name, updatedFieldArrayValues, updateAt, {\n argA: index,\n argB: updateValue,\n }, true, false);\n };\n const replace = (value) => {\n const updatedFieldArrayValues = convertToArrayPayload(cloneObject(value));\n ids.current = updatedFieldArrayValues.map(generateId);\n updateValues([...updatedFieldArrayValues]);\n setFields([...updatedFieldArrayValues]);\n control._updateFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false);\n };\n React.useEffect(() => {\n control._state.action = false;\n isWatched(name, control._names) &&\n control._subjects.state.next({\n ...control._formState,\n });\n if (_actioned.current &&\n (!getValidationModes(control._options.mode).isOnSubmit ||\n control._formState.isSubmitted)) {\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 if (existingError\n ? (!error && existingError.type) ||\n (error &&\n (existingError.type !== error.type ||\n existingError.message !== error.message))\n : error && error.type) {\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,\n });\n }\n });\n }\n else {\n const field = get(control._fields, name);\n if (field &&\n field._f &&\n !(getValidationModes(control._options.reValidateMode).isOnSubmit &&\n getValidationModes(control._options.mode).isOnSubmit)) {\n validateField(field, control._formValues, control._options.criteriaMode === VALIDATION_MODE.all, control._options.shouldUseNativeValidation, true).then((error) => !isEmptyObject(error) &&\n control._subjects.state.next({\n errors: updateFieldArrayRootError(control._formState.errors, error, name),\n }));\n }\n }\n }\n control._subjects.values.next({\n name,\n values: { ...control._formValues },\n });\n control._names.focus &&\n iterateFieldsByAction(control._fields, (ref, key) => {\n if (control._names.focus &&\n key.startsWith(control._names.focus) &&\n ref.focus) {\n ref.focus();\n return 1;\n }\n return;\n });\n control._names.focus = '';\n control._updateValid();\n _actioned.current = false;\n }, [fields, name, control]);\n React.useEffect(() => {\n !get(control._formValues, name) && control._updateFieldArray(name);\n return () => {\n (control._options.shouldUnregister || shouldUnregister) &&\n control.unregister(name);\n };\n }, [name, control, keyName, shouldUnregister]);\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$1, [updateValues, name, control]),\n update: React.useCallback(update, [updateValues, name, control]),\n replace: React.useCallback(replace, [updateValues, name, control]),\n fields: React.useMemo(() => fields.map((field, index) => ({\n ...field,\n [keyName]: ids.current[index] || generateId(),\n })), [fields, keyName]),\n };\n}\n\nvar createSubject = () => {\n let _observers = [];\n const next = (value) => {\n for (const observer of _observers) {\n observer.next && observer.next(value);\n }\n };\n const subscribe = (observer) => {\n _observers.push(observer);\n return {\n unsubscribe: () => {\n _observers = _observers.filter((o) => o !== observer);\n },\n };\n };\n const unsubscribe = () => {\n _observers = [];\n };\n return {\n get observers() {\n return _observers;\n },\n next,\n subscribe,\n unsubscribe,\n };\n};\n\nvar isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);\n\nfunction deepEqual(object1, object2) {\n if (isPrimitive(object1) || isPrimitive(object2)) {\n return object1 === object2;\n }\n if (isDateObject(object1) && isDateObject(object2)) {\n return object1.getTime() === object2.getTime();\n }\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (const key of keys1) {\n const val1 = object1[key];\n if (!keys2.includes(key)) {\n return false;\n }\n if (key !== 'ref') {\n const val2 = object2[key];\n if ((isDateObject(val1) && isDateObject(val2)) ||\n (isObject(val1) && isObject(val2)) ||\n (Array.isArray(val1) && Array.isArray(val2))\n ? !deepEqual(val1, val2)\n : val1 !== val2) {\n return false;\n }\n }\n }\n return true;\n}\n\nvar isMultipleSelect = (element) => element.type === `select-multiple`;\n\nvar isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);\n\nvar live = (ref) => isHTMLElement(ref) && ref.isConnected;\n\nvar objectHasFunction = (data) => {\n for (const key in data) {\n if (isFunction(data[key])) {\n return true;\n }\n }\n return false;\n};\n\nfunction markFieldsDirty(data, fields = {}) {\n const isParentNodeArray = Array.isArray(data);\n if (isObject(data) || isParentNodeArray) {\n for (const key in data) {\n if (Array.isArray(data[key]) ||\n (isObject(data[key]) && !objectHasFunction(data[key]))) {\n fields[key] = Array.isArray(data[key]) ? [] : {};\n markFieldsDirty(data[key], fields[key]);\n }\n else if (!isNullOrUndefined(data[key])) {\n fields[key] = true;\n }\n }\n }\n return fields;\n}\nfunction getDirtyFieldsFromDefaultValues(data, formValues, dirtyFieldsFromValues) {\n const isParentNodeArray = Array.isArray(data);\n if (isObject(data) || isParentNodeArray) {\n for (const key in data) {\n if (Array.isArray(data[key]) ||\n (isObject(data[key]) && !objectHasFunction(data[key]))) {\n if (isUndefined(formValues) ||\n isPrimitive(dirtyFieldsFromValues[key])) {\n dirtyFieldsFromValues[key] = Array.isArray(data[key])\n ? markFieldsDirty(data[key], [])\n : { ...markFieldsDirty(data[key]) };\n }\n else {\n getDirtyFieldsFromDefaultValues(data[key], isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);\n }\n }\n else {\n dirtyFieldsFromValues[key] = !deepEqual(data[key], formValues[key]);\n }\n }\n }\n return dirtyFieldsFromValues;\n}\nvar getDirtyFields = (defaultValues, formValues) => getDirtyFieldsFromDefaultValues(defaultValues, formValues, markFieldsDirty(formValues));\n\nvar getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => 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\nfunction getFieldValue(_f) {\n const ref = _f.ref;\n if (_f.refs ? _f.refs.every((ref) => ref.disabled) : ref.disabled) {\n return;\n }\n if (isFileInput(ref)) {\n return ref.files;\n }\n if (isRadioInput(ref)) {\n return getRadioValue(_f.refs).value;\n }\n if (isMultipleSelect(ref)) {\n return [...ref.selectedOptions].map(({ value }) => value);\n }\n if (isCheckBoxInput(ref)) {\n return getCheckboxValue(_f.refs).value;\n }\n return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);\n}\n\nvar getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {\n const fields = {};\n for (const name of fieldsNames) {\n const field = get(_fields, name);\n field && set(fields, name, field._f);\n }\n return {\n criteriaMode,\n names: [...fieldsNames],\n fields,\n shouldUseNativeValidation,\n };\n};\n\nvar getRuleValue = (rule) => 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\nconst ASYNC_FUNCTION = 'AsyncFunction';\nvar hasPromiseValidation = (fieldReference) => (!fieldReference || !fieldReference.validate) &&\n !!((isFunction(fieldReference.validate) &&\n fieldReference.validate.constructor.name === ASYNC_FUNCTION) ||\n (isObject(fieldReference.validate) &&\n Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION)));\n\nvar hasValidation = (options) => options.mount &&\n (options.required ||\n options.min ||\n options.max ||\n options.maxLength ||\n options.minLength ||\n options.pattern ||\n options.validate);\n\nfunction schemaErrorLookup(errors, _fields, name) {\n const error = get(errors, name);\n if (error || isKey(name)) {\n return {\n error,\n name,\n };\n }\n const names = name.split('.');\n while (names.length) {\n const fieldName = names.join('.');\n const field = get(_fields, fieldName);\n const foundError = get(errors, fieldName);\n if (field && !Array.isArray(field) && name !== fieldName) {\n return { name };\n }\n if (foundError && foundError.type) {\n return {\n name: fieldName,\n error: foundError,\n };\n }\n names.pop();\n }\n return {\n name,\n };\n}\n\nvar skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {\n if (mode.isOnAll) {\n return false;\n }\n else if (!isSubmitted && mode.isOnTouch) {\n return !(isTouched || isBlurEvent);\n }\n else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {\n return !isBlurEvent;\n }\n else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {\n return isBlurEvent;\n }\n return true;\n};\n\nvar unsetEmptyArray = (ref, name) => !compact(get(ref, name)).length && unset(ref, name);\n\nconst defaultOptions = {\n mode: VALIDATION_MODE.onSubmit,\n reValidateMode: VALIDATION_MODE.onChange,\n shouldFocusError: true,\n};\nfunction createFormControl(props = {}) {\n let _options = {\n ...defaultOptions,\n ...props,\n };\n let _formState = {\n submitCount: 0,\n isDirty: false,\n isLoading: isFunction(_options.defaultValues),\n isValidating: false,\n isSubmitted: false,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n touchedFields: {},\n dirtyFields: {},\n validatingFields: {},\n errors: _options.errors || {},\n disabled: _options.disabled || false,\n };\n let _fields = {};\n let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)\n ? cloneObject(_options.defaultValues || _options.values) || {}\n : {};\n let _formValues = _options.shouldUnregister\n ? {}\n : cloneObject(_defaultValues);\n let _state = {\n action: false,\n mount: false,\n watch: false,\n };\n let _names = {\n mount: new Set(),\n unMount: new Set(),\n array: new Set(),\n watch: new Set(),\n };\n let delayErrorCallback;\n let timer = 0;\n const _proxyFormState = {\n isDirty: false,\n dirtyFields: false,\n validatingFields: false,\n touchedFields: false,\n isValidating: false,\n isValid: false,\n errors: false,\n };\n const _subjects = {\n values: createSubject(),\n array: createSubject(),\n state: createSubject(),\n };\n const validationModeBeforeSubmit = getValidationModes(_options.mode);\n const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);\n const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;\n const debounce = (callback) => (wait) => {\n clearTimeout(timer);\n timer = setTimeout(callback, wait);\n };\n const _updateValid = async (shouldUpdateValid) => {\n if (!props.disabled && (_proxyFormState.isValid || shouldUpdateValid)) {\n const isValid = _options.resolver\n ? isEmptyObject((await _executeSchema()).errors)\n : await executeBuiltInValidation(_fields, true);\n if (isValid !== _formState.isValid) {\n _subjects.state.next({\n isValid,\n });\n }\n }\n };\n const _updateIsValidating = (names, isValidating) => {\n if (!props.disabled &&\n (_proxyFormState.isValidating || _proxyFormState.validatingFields)) {\n (names || Array.from(_names.mount)).forEach((name) => {\n if (name) {\n isValidating\n ? set(_formState.validatingFields, name, isValidating)\n : unset(_formState.validatingFields, name);\n }\n });\n _subjects.state.next({\n validatingFields: _formState.validatingFields,\n isValidating: !isEmptyObject(_formState.validatingFields),\n });\n }\n };\n const _updateFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {\n if (args && method && !props.disabled) {\n _state.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 if (shouldUpdateFieldsAndState &&\n Array.isArray(get(_formState.errors, name))) {\n const errors = method(get(_formState.errors, name), args.argA, args.argB);\n shouldSetValues && set(_formState.errors, name, errors);\n unsetEmptyArray(_formState.errors, name);\n }\n if (_proxyFormState.touchedFields &&\n shouldUpdateFieldsAndState &&\n Array.isArray(get(_formState.touchedFields, name))) {\n const touchedFields = method(get(_formState.touchedFields, name), args.argA, args.argB);\n shouldSetValues && set(_formState.touchedFields, name, touchedFields);\n }\n if (_proxyFormState.dirtyFields) {\n _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);\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 }\n else {\n set(_formValues, name, values);\n }\n };\n const updateErrors = (name, error) => {\n set(_formState.errors, name, error);\n _subjects.state.next({\n errors: _formState.errors,\n });\n };\n const _setErrors = (errors) => {\n _formState.errors = errors;\n _subjects.state.next({\n errors: _formState.errors,\n isValid: false,\n });\n };\n const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => {\n const field = get(_fields, name);\n if (field) {\n const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);\n isUndefined(defaultValue) ||\n (ref && ref.defaultChecked) ||\n shouldSkipSetValueAs\n ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f))\n : setFieldValue(name, defaultValue);\n _state.mount && _updateValid();\n }\n };\n const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {\n let shouldUpdateField = false;\n let isPreviousDirty = false;\n const output = {\n name,\n };\n if (!props.disabled) {\n const disabledField = !!(get(_fields, name) &&\n get(_fields, name)._f &&\n get(_fields, name)._f.disabled);\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 const isCurrentFieldPristine = disabledField || deepEqual(get(_defaultValues, name), fieldValue);\n isPreviousDirty = !!(!disabledField && get(_formState.dirtyFields, name));\n isCurrentFieldPristine || disabledField\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 if (isBlurEvent) {\n const isPreviousFieldTouched = get(_formState.touchedFields, name);\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 shouldUpdateField && shouldRender && _subjects.state.next(output);\n }\n return shouldUpdateField ? output : {};\n };\n const shouldRenderByError = (name, isValid, error, fieldState) => {\n const previousFieldError = get(_formState.errors, name);\n const shouldUpdateValid = _proxyFormState.isValid &&\n isBoolean(isValid) &&\n _formState.isValid !== isValid;\n if (props.delayError && error) {\n delayErrorCallback = debounce(() => updateErrors(name, error));\n delayErrorCallback(props.delayError);\n }\n else {\n clearTimeout(timer);\n delayErrorCallback = null;\n error\n ? set(_formState.errors, name, error)\n : unset(_formState.errors, name);\n }\n if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) ||\n !isEmptyObject(fieldState) ||\n shouldUpdateValid) {\n const updatedFormState = {\n ...fieldState,\n ...(shouldUpdateValid && isBoolean(isValid) ? { isValid } : {}),\n errors: _formState.errors,\n name,\n };\n _formState = {\n ..._formState,\n ...updatedFormState,\n };\n _subjects.state.next(updatedFormState);\n }\n };\n const _executeSchema = async (name) => {\n _updateIsValidating(name, true);\n const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));\n _updateIsValidating(name);\n return result;\n };\n const executeSchemaAndUpdateState = async (names) => {\n const { errors } = await _executeSchema(names);\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 }\n else {\n _formState.errors = errors;\n }\n return errors;\n };\n const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context = {\n valid: true,\n }) => {\n for (const name in fields) {\n const field = fields[name];\n if (field) {\n const { _f, ...fieldValue } = field;\n if (_f) {\n const isFieldArrayRoot = _names.array.has(_f.name);\n const isPromiseFunction = field._f && hasPromiseValidation(field._f);\n if (isPromiseFunction && _proxyFormState.validatingFields) {\n _updateIsValidating([name], true);\n }\n const fieldError = await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot);\n if (isPromiseFunction && _proxyFormState.validatingFields) {\n _updateIsValidating([name]);\n }\n if (fieldError[_f.name]) {\n context.valid = false;\n if (shouldOnlyCheckValid) {\n break;\n }\n }\n !shouldOnlyCheckValid &&\n (get(fieldError, _f.name)\n ? isFieldArrayRoot\n ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name)\n : set(_formState.errors, _f.name, fieldError[_f.name])\n : unset(_formState.errors, _f.name));\n }\n !isEmptyObject(fieldValue) &&\n (await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context));\n }\n }\n return context.valid;\n };\n const _removeUnmounted = () => {\n for (const name of _names.unMount) {\n const field = get(_fields, name);\n field &&\n (field._f.refs\n ? field._f.refs.every((ref) => !live(ref))\n : !live(field._f.ref)) &&\n unregister(name);\n }\n _names.unMount = new Set();\n };\n const _getDirty = (name, data) => !props.disabled &&\n (name && data && set(_formValues, name, data),\n !deepEqual(getValues(), _defaultValues));\n const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {\n ...(_state.mount\n ? _formValues\n : isUndefined(defaultValue)\n ? _defaultValues\n : isString(names)\n ? { [names]: defaultValue }\n : defaultValue),\n }, isGlobal, defaultValue);\n const _getFieldArray = (name) => compact(get(_state.mount ? _formValues : _defaultValues, name, props.shouldUnregister ? get(_defaultValues, name, []) : []));\n const setFieldValue = (name, value, options = {}) => {\n const field = get(_fields, name);\n let fieldValue = value;\n if (field) {\n const fieldReference = field._f;\n if (fieldReference) {\n !fieldReference.disabled &&\n set(_formValues, name, getFieldValueAs(value, fieldReference));\n fieldValue =\n isHTMLElement(fieldReference.ref) && isNullOrUndefined(value)\n ? ''\n : value;\n if (isMultipleSelect(fieldReference.ref)) {\n [...fieldReference.ref.options].forEach((optionRef) => (optionRef.selected = fieldValue.includes(optionRef.value)));\n }\n else if (fieldReference.refs) {\n if (isCheckBoxInput(fieldReference.ref)) {\n fieldReference.refs.length > 1\n ? fieldReference.refs.forEach((checkboxRef) => (!checkboxRef.defaultChecked || !checkboxRef.disabled) &&\n (checkboxRef.checked = Array.isArray(fieldValue)\n ? !!fieldValue.find((data) => data === checkboxRef.value)\n : fieldValue === checkboxRef.value))\n : fieldReference.refs[0] &&\n (fieldReference.refs[0].checked = !!fieldValue);\n }\n else {\n fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue));\n }\n }\n else if (isFileInput(fieldReference.ref)) {\n fieldReference.ref.value = '';\n }\n else {\n fieldReference.ref.value = fieldValue;\n if (!fieldReference.ref.type) {\n _subjects.values.next({\n name,\n values: { ..._formValues },\n });\n }\n }\n }\n }\n (options.shouldDirty || options.shouldTouch) &&\n updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true);\n options.shouldValidate && trigger(name);\n };\n const setValues = (name, value, options) => {\n for (const fieldKey in value) {\n const fieldValue = value[fieldKey];\n const fieldName = `${name}.${fieldKey}`;\n const field = get(_fields, fieldName);\n (_names.array.has(name) ||\n isObject(fieldValue) ||\n (field && !field._f)) &&\n !isDateObject(fieldValue)\n ? setValues(fieldName, fieldValue, options)\n : setFieldValue(fieldName, fieldValue, options);\n }\n };\n const setValue = (name, value, options = {}) => {\n const field = get(_fields, name);\n const isFieldArray = _names.array.has(name);\n const cloneValue = cloneObject(value);\n set(_formValues, name, cloneValue);\n if (isFieldArray) {\n _subjects.array.next({\n name,\n values: { ..._formValues },\n });\n if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields) &&\n options.shouldDirty) {\n _subjects.state.next({\n name,\n dirtyFields: getDirtyFields(_defaultValues, _formValues),\n isDirty: _getDirty(name, cloneValue),\n });\n }\n }\n else {\n field && !field._f && !isNullOrUndefined(cloneValue)\n ? setValues(name, cloneValue, options)\n : setFieldValue(name, cloneValue, options);\n }\n isWatched(name, _names) && _subjects.state.next({ ..._formState });\n _subjects.values.next({\n name: _state.mount ? name : undefined,\n values: { ..._formValues },\n });\n };\n const onChange = async (event) => {\n _state.mount = true;\n const target = event.target;\n let name = target.name;\n let isFieldValueUpdated = true;\n const field = get(_fields, name);\n const getCurrentFieldValue = () => target.type ? getFieldValue(field._f) : getEventValue(event);\n const _updateIsFieldValueUpdated = (fieldValue) => {\n isFieldValueUpdated =\n Number.isNaN(fieldValue) ||\n (isDateObject(fieldValue) && isNaN(fieldValue.getTime())) ||\n deepEqual(fieldValue, get(_formValues, name, fieldValue));\n };\n if (field) {\n let error;\n let isValid;\n const fieldValue = getCurrentFieldValue();\n const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;\n const shouldSkipValidation = (!hasValidation(field._f) &&\n !_options.resolver &&\n !get(_formState.errors, name) &&\n !field._f.deps) ||\n skipValidation(isBlurEvent, get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);\n const watched = isWatched(name, _names, isBlurEvent);\n set(_formValues, name, fieldValue);\n if (isBlurEvent) {\n field._f.onBlur && field._f.onBlur(event);\n delayErrorCallback && delayErrorCallback(0);\n }\n else if (field._f.onChange) {\n field._f.onChange(event);\n }\n const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent, false);\n const shouldRender = !isEmptyObject(fieldState) || watched;\n !isBlurEvent &&\n _subjects.values.next({\n name,\n type: event.type,\n values: { ..._formValues },\n });\n if (shouldSkipValidation) {\n if (_proxyFormState.isValid) {\n if (props.mode === 'onBlur') {\n if (isBlurEvent) {\n _updateValid();\n }\n }\n else {\n _updateValid();\n }\n }\n return (shouldRender &&\n _subjects.state.next({ name, ...(watched ? {} : fieldState) }));\n }\n !isBlurEvent && watched && _subjects.state.next({ ..._formState });\n if (_options.resolver) {\n const { errors } = await _executeSchema([name]);\n _updateIsFieldValueUpdated(fieldValue);\n if (isFieldValueUpdated) {\n const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);\n const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);\n error = errorLookupResult.error;\n name = errorLookupResult.name;\n isValid = isEmptyObject(errors);\n }\n }\n else {\n _updateIsValidating([name], true);\n error = (await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];\n _updateIsValidating([name]);\n _updateIsFieldValueUpdated(fieldValue);\n if (isFieldValueUpdated) {\n if (error) {\n isValid = false;\n }\n else if (_proxyFormState.isValid) {\n isValid = await executeBuiltInValidation(_fields, true);\n }\n }\n }\n if (isFieldValueUpdated) {\n field._f.deps &&\n trigger(field._f.deps);\n shouldRenderByError(name, isValid, error, fieldState);\n }\n }\n };\n const _focusInput = (ref, key) => {\n if (get(_formState.errors, key) && ref.focus) {\n ref.focus();\n return 1;\n }\n return;\n };\n const trigger = async (name, options = {}) => {\n let isValid;\n let validationResult;\n const fieldNames = convertToArrayPayload(name);\n if (_options.resolver) {\n const errors = await executeSchemaAndUpdateState(isUndefined(name) ? name : fieldNames);\n isValid = isEmptyObject(errors);\n validationResult = name\n ? !fieldNames.some((name) => get(errors, name))\n : isValid;\n }\n else if (name) {\n validationResult = (await Promise.all(fieldNames.map(async (fieldName) => {\n const field = get(_fields, fieldName);\n return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);\n }))).every(Boolean);\n !(!validationResult && !_formState.isValid) && _updateValid();\n }\n else {\n validationResult = isValid = await executeBuiltInValidation(_fields);\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 });\n options.shouldFocus &&\n !validationResult &&\n iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount);\n return validationResult;\n };\n const getValues = (fieldNames) => {\n const values = {\n ...(_state.mount ? _formValues : _defaultValues),\n };\n return isUndefined(fieldNames)\n ? values\n : isString(fieldNames)\n ? get(values, fieldNames)\n : fieldNames.map((name) => get(values, name));\n };\n const getFieldState = (name, formState) => ({\n invalid: !!get((formState || _formState).errors, name),\n isDirty: !!get((formState || _formState).dirtyFields, name),\n error: get((formState || _formState).errors, name),\n isValidating: !!get(_formState.validatingFields, name),\n isTouched: !!get((formState || _formState).touchedFields, name),\n });\n const clearErrors = (name) => {\n name &&\n convertToArrayPayload(name).forEach((inputName) => unset(_formState.errors, inputName));\n _subjects.state.next({\n errors: name ? _formState.errors : {},\n });\n };\n const setError = (name, error, options) => {\n const ref = (get(_fields, name, { _f: {} })._f || {}).ref;\n const currentError = get(_formState.errors, name) || {};\n // Don't override existing error messages elsewhere in the object tree.\n const { ref: currentRef, message, type, ...restOfErrorTree } = currentError;\n set(_formState.errors, name, {\n ...restOfErrorTree,\n ...error,\n ref,\n });\n _subjects.state.next({\n name,\n errors: _formState.errors,\n isValid: false,\n });\n options && options.shouldFocus && ref && ref.focus && ref.focus();\n };\n const watch = (name, defaultValue) => isFunction(name)\n ? _subjects.values.subscribe({\n next: (payload) => name(_getWatch(undefined, defaultValue), payload),\n })\n : _getWatch(name, defaultValue, true);\n const unregister = (name, options = {}) => {\n for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {\n _names.mount.delete(fieldName);\n _names.array.delete(fieldName);\n if (!options.keepValue) {\n unset(_fields, fieldName);\n unset(_formValues, fieldName);\n }\n !options.keepError && unset(_formState.errors, fieldName);\n !options.keepDirty && unset(_formState.dirtyFields, fieldName);\n !options.keepTouched && unset(_formState.touchedFields, fieldName);\n !options.keepIsValidating &&\n unset(_formState.validatingFields, fieldName);\n !_options.shouldUnregister &&\n !options.keepDefaultValue &&\n unset(_defaultValues, fieldName);\n }\n _subjects.values.next({\n values: { ..._formValues },\n });\n _subjects.state.next({\n ..._formState,\n ...(!options.keepDirty ? {} : { isDirty: _getDirty() }),\n });\n !options.keepIsValid && _updateValid();\n };\n const _updateDisabledField = ({ disabled, name, field, fields, value, }) => {\n if ((isBoolean(disabled) && _state.mount) || !!disabled) {\n const inputValue = disabled\n ? undefined\n : isUndefined(value)\n ? getFieldValue(field ? field._f : get(fields, name)._f)\n : value;\n set(_formValues, name, inputValue);\n updateTouchAndDirty(name, inputValue, false, false, true);\n }\n };\n const register = (name, options = {}) => {\n let field = get(_fields, name);\n const disabledIsDefined = isBoolean(options.disabled) || isBoolean(props.disabled);\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 if (field) {\n _updateDisabledField({\n field,\n disabled: isBoolean(options.disabled)\n ? options.disabled\n : props.disabled,\n name,\n value: options.value,\n });\n }\n else {\n updateValidAndValue(name, true, options.value);\n }\n return {\n ...(disabledIsDefined\n ? { disabled: options.disabled || props.disabled }\n : {}),\n ...(_options.progressive\n ? {\n required: !!options.required,\n min: getRuleValue(options.min),\n max: getRuleValue(options.max),\n minLength: getRuleValue(options.minLength),\n maxLength: getRuleValue(options.maxLength),\n pattern: getRuleValue(options.pattern),\n }\n : {}),\n name,\n onChange,\n onBlur: onChange,\n ref: (ref) => {\n if (ref) {\n register(name, options);\n field = get(_fields, name);\n const fieldRef = isUndefined(ref.value)\n ? ref.querySelectorAll\n ? ref.querySelectorAll('input,select,textarea')[0] || ref\n : ref\n : ref;\n const radioOrCheckbox = isRadioOrCheckbox(fieldRef);\n const refs = field._f.refs || [];\n if (radioOrCheckbox\n ? refs.find((option) => option === fieldRef)\n : fieldRef === field._f.ref) {\n return;\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 updateValidAndValue(name, false, undefined, fieldRef);\n }\n else {\n field = get(_fields, name, {});\n if (field._f) {\n field._f.mount = false;\n }\n (_options.shouldUnregister || options.shouldUnregister) &&\n !(isNameInFieldArray(_names.array, name) && _state.action) &&\n _names.unMount.add(name);\n }\n },\n };\n };\n const _focusError = () => _options.shouldFocusError &&\n iterateFieldsByAction(_fields, _focusInput, _names.mount);\n const _disableForm = (disabled) => {\n if (isBoolean(disabled)) {\n _subjects.state.next({ disabled });\n iterateFieldsByAction(_fields, (ref, name) => {\n const currentField = get(_fields, name);\n if (currentField) {\n ref.disabled = currentField._f.disabled || disabled;\n if (Array.isArray(currentField._f.refs)) {\n currentField._f.refs.forEach((inputRef) => {\n inputRef.disabled = currentField._f.disabled || disabled;\n });\n }\n }\n }, 0, false);\n }\n };\n const handleSubmit = (onValid, onInvalid) => async (e) => {\n let onValidError = undefined;\n if (e) {\n e.preventDefault && e.preventDefault();\n e.persist && e.persist();\n }\n let fieldValues = cloneObject(_formValues);\n _subjects.state.next({\n isSubmitting: true,\n });\n if (_options.resolver) {\n const { errors, values } = await _executeSchema();\n _formState.errors = errors;\n fieldValues = values;\n }\n else {\n await executeBuiltInValidation(_fields);\n }\n unset(_formState.errors, 'root');\n if (isEmptyObject(_formState.errors)) {\n _subjects.state.next({\n errors: {},\n });\n try {\n await onValid(fieldValues, e);\n }\n catch (error) {\n onValidError = error;\n }\n }\n else {\n if (onInvalid) {\n await onInvalid({ ..._formState.errors }, e);\n }\n _focusError();\n setTimeout(_focusError);\n }\n _subjects.state.next({\n isSubmitted: true,\n isSubmitting: false,\n isSubmitSuccessful: isEmptyObject(_formState.errors) && !onValidError,\n submitCount: _formState.submitCount + 1,\n errors: _formState.errors,\n });\n if (onValidError) {\n throw onValidError;\n }\n };\n const resetField = (name, options = {}) => {\n if (get(_fields, name)) {\n if (isUndefined(options.defaultValue)) {\n setValue(name, cloneObject(get(_defaultValues, name)));\n }\n else {\n setValue(name, options.defaultValue);\n set(_defaultValues, name, cloneObject(options.defaultValue));\n }\n if (!options.keepTouched) {\n unset(_formState.touchedFields, name);\n }\n if (!options.keepDirty) {\n unset(_formState.dirtyFields, name);\n _formState.isDirty = options.defaultValue\n ? _getDirty(name, cloneObject(get(_defaultValues, name)))\n : _getDirty();\n }\n if (!options.keepError) {\n unset(_formState.errors, name);\n _proxyFormState.isValid && _updateValid();\n }\n _subjects.state.next({ ..._formState });\n }\n };\n const _reset = (formValues, keepStateOptions = {}) => {\n const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;\n const cloneUpdatedValues = cloneObject(updatedValues);\n const isEmptyResetValues = isEmptyObject(formValues);\n const values = isEmptyResetValues ? _defaultValues : cloneUpdatedValues;\n if (!keepStateOptions.keepDefaultValues) {\n _defaultValues = updatedValues;\n }\n if (!keepStateOptions.keepValues) {\n if (keepStateOptions.keepDirtyValues) {\n const fieldsToCheck = new Set([\n ..._names.mount,\n ...Object.keys(getDirtyFields(_defaultValues, _formValues)),\n ]);\n for (const fieldName of Array.from(fieldsToCheck)) {\n get(_formState.dirtyFields, fieldName)\n ? set(values, fieldName, get(_formValues, fieldName))\n : setValue(fieldName, 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 if (isHTMLElement(fieldReference)) {\n const form = fieldReference.closest('form');\n if (form) {\n form.reset();\n break;\n }\n }\n }\n }\n }\n _fields = {};\n }\n _formValues = props.shouldUnregister\n ? keepStateOptions.keepDefaultValues\n ? cloneObject(_defaultValues)\n : {}\n : cloneObject(values);\n _subjects.array.next({\n values: { ...values },\n });\n _subjects.values.next({\n values: { ...values },\n });\n }\n _names = {\n mount: keepStateOptions.keepDirtyValues ? _names.mount : new Set(),\n unMount: new Set(),\n array: new Set(),\n watch: new Set(),\n watchAll: false,\n focus: '',\n };\n _state.mount =\n !_proxyFormState.isValid ||\n !!keepStateOptions.keepIsValid ||\n !!keepStateOptions.keepDirtyValues;\n _state.watch = !!props.shouldUnregister;\n _subjects.state.next({\n submitCount: keepStateOptions.keepSubmitCount\n ? _formState.submitCount\n : 0,\n isDirty: isEmptyResetValues\n ? false\n : keepStateOptions.keepDirty\n ? _formState.isDirty\n : !!(keepStateOptions.keepDefaultValues &&\n !deepEqual(formValues, _defaultValues)),\n isSubmitted: keepStateOptions.keepIsSubmitted\n ? _formState.isSubmitted\n : false,\n dirtyFields: isEmptyResetValues\n ? {}\n : keepStateOptions.keepDirtyValues\n ? keepStateOptions.keepDefaultValues && _formValues\n ? getDirtyFields(_defaultValues, _formValues)\n : _formState.dirtyFields\n : keepStateOptions.keepDefaultValues && formValues\n ? getDirtyFields(_defaultValues, formValues)\n : keepStateOptions.keepDirty\n ? _formState.dirtyFields\n : {},\n touchedFields: keepStateOptions.keepTouched\n ? _formState.touchedFields\n : {},\n errors: keepStateOptions.keepErrors ? _formState.errors : {},\n isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful\n ? _formState.isSubmitSuccessful\n : false,\n isSubmitting: false,\n });\n };\n const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues)\n ? formValues(_formValues)\n : formValues, keepStateOptions);\n const setFocus = (name, options = {}) => {\n const field = get(_fields, name);\n const fieldReference = field && field._f;\n if (fieldReference) {\n const fieldRef = fieldReference.refs\n ? fieldReference.refs[0]\n : fieldReference.ref;\n if (fieldRef.focus) {\n fieldRef.focus();\n options.shouldSelect && fieldRef.select();\n }\n }\n };\n const _updateFormState = (updatedFormState) => {\n _formState = {\n ..._formState,\n ...updatedFormState,\n };\n };\n const _resetDefaultValues = () => isFunction(_options.defaultValues) &&\n _options.defaultValues().then((values) => {\n reset(values, _options.resetOptions);\n _subjects.state.next({\n isLoading: false,\n });\n });\n return {\n control: {\n register,\n unregister,\n getFieldState,\n handleSubmit,\n setError,\n _executeSchema,\n _getWatch,\n _getDirty,\n _updateValid,\n _removeUnmounted,\n _updateFieldArray,\n _updateDisabledField,\n _getFieldArray,\n _reset,\n _resetDefaultValues,\n _updateFormState,\n _disableForm,\n _subjects,\n _proxyFormState,\n _setErrors,\n get _fields() {\n return _fields;\n },\n get _formValues() {\n return _formValues;\n },\n get _state() {\n return _state;\n },\n set _state(value) {\n _state = 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\n/**\n * Custom hook to manage the entire form.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/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 */\nfunction useForm(props = {}) {\n const _formControl = React.useRef();\n const _values = React.useRef();\n const [formState, updateFormState] = React.useState({\n isDirty: false,\n isValidating: false,\n isLoading: isFunction(props.defaultValues),\n isSubmitted: false,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n submitCount: 0,\n dirtyFields: {},\n touchedFields: {},\n validatingFields: {},\n errors: props.errors || {},\n disabled: props.disabled || false,\n defaultValues: isFunction(props.defaultValues)\n ? undefined\n : props.defaultValues,\n });\n if (!_formControl.current) {\n _formControl.current = {\n ...createFormControl(props),\n formState,\n };\n }\n const control = _formControl.current.control;\n control._options = props;\n useSubscribe({\n subject: control._subjects.state,\n next: (value) => {\n if (shouldRenderFormState(value, control._proxyFormState, control._updateFormState, true)) {\n updateFormState({ ...control._formState });\n }\n },\n });\n React.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);\n React.useEffect(() => {\n if (control._proxyFormState.isDirty) {\n const isDirty = control._getDirty();\n if (isDirty !== formState.isDirty) {\n control._subjects.state.next({\n isDirty,\n });\n }\n }\n }, [control, formState.isDirty]);\n React.useEffect(() => {\n if (props.values && !deepEqual(props.values, _values.current)) {\n control._reset(props.values, control._options.resetOptions);\n _values.current = props.values;\n updateFormState((state) => ({ ...state }));\n }\n else {\n control._resetDefaultValues();\n }\n }, [props.values, control]);\n React.useEffect(() => {\n if (props.errors) {\n control._setErrors(props.errors);\n }\n }, [props.errors, control]);\n React.useEffect(() => {\n if (!control._state.mount) {\n control._updateValid();\n control._state.mount = true;\n }\n if (control._state.watch) {\n control._state.watch = false;\n control._subjects.state.next({ ...control._formState });\n }\n control._removeUnmounted();\n });\n React.useEffect(() => {\n props.shouldUnregister &&\n control._subjects.values.next({\n values: control._getWatch(),\n });\n }, [props.shouldUnregister, control]);\n React.useEffect(() => {\n if (_formControl.current) {\n _formControl.current.watch = _formControl.current.watch.bind({});\n }\n }, [formState]);\n _formControl.current.formState = getProxyFormState(formState, control);\n return _formControl.current;\n}\n\nexport { Controller, Form, FormProvider, appendErrors, get, set, useController, useFieldArray, useForm, useFormContext, useFormState, useWatch };\n//# sourceMappingURL=index.esm.mjs.map\n","import styled from 'styled-components';\n\nconst Form = /*#__PURE__*/ styled.form.withConfig({\n displayName: \"Form\"\n})([\n ``\n]);\n\nexport { Form };\n","import { jsxs, jsx } from 'react/jsx-runtime';\nimport FormDevTools from '../form-dev-tools/index.js';\nimport { forwardRef } from 'react';\nimport { useForm, FormProvider } from 'react-hook-form';\nimport { Form as Form$1 } from './styled.js';\n\nconst Form = /*#__PURE__*/ forwardRef(({ onSubmit, onError, formTag = 'form', children, criteriaMode = 'firstError', reValidateMode = 'onChange', shouldFocusError = true, mode = 'all', ...rest }, ref)=>{\n const formMethods = useForm({\n criteriaMode,\n reValidateMode,\n shouldFocusError,\n mode,\n ...rest\n });\n return /*#__PURE__*/ jsxs(FormProvider, {\n ...formMethods,\n children: [\n /*#__PURE__*/ jsx(Form$1, {\n \"data-testid\": \"Form\",\n ref: ref,\n as: formTag,\n onSubmit: formMethods.handleSubmit(onSubmit, onError),\n children: children\n }),\n process.env.NODE_ENV === 'development' && /*#__PURE__*/ jsx(FormDevTools, {})\n ]\n });\n});\nForm.displayName = 'Form';\n\nexport { Form as default };\n","import { defaultValuesVehicle } from './constants.js';\n\nconst getValueInputWithPet = (vehicle, pets, literals)=>{\n const { nothing = '', withPet = '' } = literals ?? {};\n let inputValue = '';\n if (vehicle?.value) {\n inputValue = vehicle?.label;\n if (pets?.value) {\n inputValue += ' ';\n }\n } else {\n if (!pets?.value) {\n inputValue = nothing;\n }\n }\n if (pets?.value) {\n inputValue += withPet;\n }\n return inputValue;\n};\nconst getValueInputWithoutPet = (vehicle, literals)=>{\n const { units = '', trailerInfo = '' } = literals ?? {};\n let title = '';\n if (vehicle) {\n title += vehicle.label;\n if (vehicle.trailer) {\n title += ', ' + (vehicle.length ?? defaultValuesVehicle.length) + units + ' x ' + (vehicle.height ?? defaultValuesVehicle.height) + units;\n if (vehicle.caravan && trailerInfo) title += ' + ' + trailerInfo;\n }\n }\n return title;\n};\nconst getValueInput = (vehicle, pets, literals, hasPets = false)=>hasPets ? getValueInputWithPet(vehicle, pets, literals) : getValueInputWithoutPet(vehicle, literals);\nconst getStringWithUnits = (str, unit)=>{\n if (str.indexOf(`(${unit})`) > -1 || !unit) return str;\n return `${str} (${unit})`;\n};\nconst transformItemToSelectOption = (item)=>({\n label: item.label,\n value: item.value,\n selected: item.selected\n });\nconst transformItemsToSelectOptions = (items)=>items.map(transformItemToSelectOption);\nconst checkPetValue = (value)=>value != undefined && (parseInt(value.toString()) < 1 || !value);\nconst setDefaultPetValue = (value, defaultValue)=>value === undefined ? defaultValue : value;\nconst getInputValue = (value, defaultValue)=>value !== undefined ? value.toString() : defaultValue?.toString();\nconst getHasError = (value)=>!!(value != undefined && (parseInt(value.toString()) < 1 || !value));\n\nexport { checkPetValue, getHasError, getInputValue, getStringWithUnits, getValueInput, getValueInputWithPet, getValueInputWithoutPet, setDefaultPetValue, transformItemToSelectOption, transformItemsToSelectOptions };\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var PersonRoomType;\n(function(PersonRoomType) {\n PersonRoomType[\"Senior\"] = \"senior\";\n PersonRoomType[\"Adult\"] = \"adult\";\n PersonRoomType[\"Child\"] = \"child\";\n})(PersonRoomType || (PersonRoomType = {}));\n\nexport { PersonRoomType };\n","import { checkPetValue } from '../components/inputs/panel-vehicle/utils/utils.js';\nimport { formatDateWithoutLocale } from '@babylon/ui-kit-helpers/date';\nimport isEqual from '@babylon/ui-kit-helpers/is-equal';\nimport { nullFunction } from '@babylon/ui-kit-helpers/null';\nimport lodashMemoize from 'lodash/memoize.js';\nimport { PersonRoomType } from '../components/inputs/accommodation/components/panel-accommodation/types.js';\n\n/* @link http://stackoverflow.com/questions/46155/validate-email-address-in-javascript */ const EMAIL_REGEX = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/; // eslint-disable-line no-useless-escape\nconst isEmpty = (value)=>typeof value === 'undefined' || value === null || value === '' || typeof value === 'number' && value < 0 || Array.isArray(value) && value.length === 0 || !Array.isArray(value) && typeof value === 'object' && isEmpty(value.value || value.rooms || value.code) && !(value instanceof Date);\n// type predicate, see https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates\nfunction isValidationErrorMessageWithArgs(error) {\n // eslint-disable-next-line no-prototype-builtins\n return error ? error.hasOwnProperty('message') : false;\n}\n// If we define validation functions directly in JSX, it will\n// result in a new function at every render, and then trigger infinite re-render.\n// Hence, we memoize every built-in validator to prevent a \"Maximum call stack\" error.\nconst memoize = (fn)=>lodashMemoize(fn, (...args)=>JSON.stringify(args));\nconst isFunction = (value)=>typeof value === 'function';\nconst combine2Validators = (validator1, validator2)=>(value, values)=>{\n const result1 = validator1(value, values);\n if (!result1) {\n return validator2(value, values);\n }\n if (typeof result1 === 'string' || isValidationErrorMessageWithArgs(result1)) {\n return result1;\n }\n return result1.then((resolvedResult1)=>{\n if (!resolvedResult1) {\n return validator2(value, values);\n }\n return resolvedResult1;\n });\n };\n// Compose multiple validators into a single one for use with react-hook-form\nconst composeValidators = (...validators)=>{\n const allValidators = (Array.isArray(validators[0]) ? validators[0] : validators).filter(isFunction);\n return allValidators.reduce(combine2Validators, nullFunction);\n};\n// Compose multiple validators into a single one for use with react-hook-form\nconst composeSyncValidators = (...validators)=>(value, values)=>{\n const allValidators = (Array.isArray(validators[0]) ? validators[0] : validators).filter(isFunction);\n for (const validator of allValidators){\n const error = validator(value, values);\n if (error) {\n return error;\n }\n }\n };\n/**\n * Required validator\n *\n * Returns an error if the value is null, undefined, or empty\n *\n * @param {string|Function} message\n *\n * @example\n *\n * const titleValidators = [required('The title is required')];\n * \n */ const required = memoize((message = ' ')=>Object.assign((value)=>isEmpty(value) || !value ? message : undefined, {\n isRequired: true\n }));\n/**\n * Minimum length validator\n *\n * Returns an error if the value has a length less than the parameter\n *\n * @param {integer} min\n * @param {string|Function} message\n *\n * @example\n *\n * const passwordValidators = [minLength(10, 'Should be at least 10 characters')];\n * \n */ const minLength = memoize((min, message = ' ')=>(value)=>!isEmpty(value) && value.length < min ? message : undefined);\n/**\n * Maximum length validator\n *\n * Returns an error if the value has a length higher than the parameter\n *\n * @param {integer} max\n * @param {string|Function} message\n *\n * @example\n *\n * const nameValidators = [maxLength(10, 'Should be at most 10 characters')];\n * \n */ const maxLength = memoize((max, message = ' ')=>(value)=>!isEmpty(value) && value.length > max ? message : undefined);\n/**\n * Minimum validator\n *\n * Returns an error if the value is less than the parameter\n *\n * @param {integer} min\n * @param {string|Function} message\n *\n * @example\n *\n * const fooValidators = [minValue(5, 'Should be more than 5')];\n * \n */ const minValue = memoize((min, message = ' ')=>(value)=>!isEmpty(value) && value < min ? message : undefined);\n/**\n * Maximum validator\n *\n * Returns an error if the value is higher than the parameter\n *\n * @param {integer} max\n * @param {string|Function} message\n *\n * @example\n *\n * const fooValidators = [maxValue(10, 'Should be less than 10')];\n * \n */ const maxValue = memoize((max, message = ' ')=>(value)=>!isEmpty(value) && value > max ? message : undefined);\n/**\n * Number validator\n *\n * Returns an error if the value is not a number\n *\n * @param {string|Function} message\n *\n * @example\n *\n * const ageValidators = [number('Must be a number')];\n * \n */ const number = memoize((message = ' ')=>(value)=>!isEmpty(value) && isNaN(Number(value)) ? message : undefined);\n/**\n * Regular expression validator\n *\n * Returns an error if the value does not match the pattern given as parameter\n *\n * @param {RegExp} pattern\n * @param {string|Function} message\n *\n * @example\n *\n * const zipValidators = [regex(/^\\d{5}(?:[-\\s]\\d{4})?$/, 'Must be a zip code')];\n * \n */ const regex = lodashMemoize((pattern, message = ' ')=>(value)=>!isEmpty(value) && typeof value === 'string' && !pattern.test(value) ? message : undefined, (pattern, message)=>pattern.toString() + message);\n/**\n * Email validator\n *\n * Returns an error if the value is not a valid email\n *\n * @param {string|Function} message\n *\n * @example\n *\n * const emailValidators = [email('Must be an email')];\n * \n */ const email = memoize((message = ' ')=>regex(EMAIL_REGEX, message));\n/**\n * Choices validator\n *\n * Returns an error if the value is not among the list passed as parameter\n *\n * @param {array} list\n * @param {string|Function} message\n *\n * @example\n *\n * const genderValidators = [choices(['male', 'female'], 'Must be either Male or Female')];\n * \n */ const choices = memoize((list, message = ' ')=>(value)=>!isEmpty(value) && list.indexOf(value) === -1 ? message : undefined);\n/**\n * Accommodation maxPeople validator\n *\n * Returns an error if the value is higher than the maxPeople of the accommodation\n *\n * @param {string|Function} message\n *\n * @example\n *\n * const maxPeopleValidators = [maxPeople('Must be less than the maxPeople of the accommodation')];\n * \n */ const maxPeople = memoize((message = ' ')=>(value)=>{\n if (!value.maxPeople) return;\n const totalPeople = value.rooms?.reduce((acc, room)=>{\n const adults = room.adults ?? 0;\n const children = room.children ?? 0;\n return acc + adults + children;\n }, 0) ?? 0;\n return !isEmpty(value) && value && totalPeople >= value.maxPeople ? message : undefined;\n });\n/**\n * Accommodation maxRooms validator\n *\n * Returns an error if the value is higher than the maxRooms of the accommodation\n *\n * @param {string|Function} message\n *\n * @example\n *\n * const maxRoomsValidators = [maxRooms('Must be less than the maxRooms of the accommodation')];\n * \n */ const maxRooms = memoize((message = ' ')=>(value)=>{\n if (!value.maxRooms) return;\n return !isEmpty(value) && value && !!value.rooms?.length && value.rooms.length >= value.maxRooms ? message : undefined;\n });\nconst notEqualValue = memoize((notEqualTo, message = ' ')=>(value, values)=>!isEmpty(value) && !isEmpty(values[notEqualTo]) && isEqual(value.value, values[notEqualTo].value) ? message : undefined);\nconst notEqual = memoize((notEqualTo, message = ' ')=>(value, values)=>!isEmpty(value) && !isEmpty(values[notEqualTo]) && isEqual(value, values[notEqualTo]) ? message : undefined);\nconst equal = memoize((equalTo, message = ' ')=>(value, values)=>!isEmpty(value) && !isEmpty(values[equalTo]) && !isEqual(value, values[equalTo]) ? message : undefined);\nconst notEqualValues = memoize((value1, value2, message = ' ')=>()=>!isEmpty(value1) && !isEmpty(value2) && isEqual(value1, value2) ? message : undefined);\n/**\n * Input vehicle validators\n *\n * Returns an error if the length or height is empty or negative\n *\n * @param {string|Function} message\n *\n */ const vehicleValidate = memoize((message = ' ')=>(value)=>{\n if (!value || value.value === '0') return;\n if (value.length != undefined && (parseInt(value.length.toString()) < 1 || !value.length)) {\n return message;\n }\n if (value.height != undefined && (parseInt(value.height.toString()) < 1 || !value.height)) {\n return message;\n }\n });\n/**\n * Input vehicle validators\n *\n * Returns an error if the trailer of a vehicle length or height is empty or negative\n *\n * @param {string|Function} message\n *\n */ const trailerValidate = memoize((message = ' ')=>(value)=>{\n if (!value) return;\n if (value.caravan && (!value.caravanLength || parseInt(value.caravanLength.toString()) < 1)) {\n return message;\n }\n if (value.caravan && (!value.caravanHeight || parseInt(value.caravanHeight.toString()) < 1)) {\n return message;\n }\n });\nconst petValidate = memoize((message = ' ')=>(value)=>{\n if (!value) return;\n if (checkPetValue(value.weight)) {\n return message;\n }\n if (value.carrier) {\n if (checkPetValue(value.height)) {\n return message;\n }\n if (checkPetValue(value.length)) {\n return message;\n }\n if (checkPetValue(value.width)) {\n return message;\n }\n }\n });\nconst requiredDate = memoize((message = ' ')=>(value)=>{\n if (!value || !Array.isArray(value) || value.length !== 1 || isEmpty(value[0])) return message;\n });\nconst requiredDates = memoize((message = ' ')=>(value)=>{\n if (!value || !Array.isArray(value) || value.length !== 2 || isEmpty(value[0]) || isEmpty(value[1])) return message;\n });\nconst minDate = memoize((minDate, message = ' ')=>(value)=>{\n if (isEmpty(value) || !Array.isArray(value) || value.length === 0 || value.length >= 1 && isEmpty(value[0]) || value.length === 2 && isEmpty(value[1]) || value.length >= 1 && formatDateWithoutLocale(value[0], 'YYYY-MM-DD') < (minDate === 'today' ? formatDateWithoutLocale(new Date(), 'YYYY-MM-DD') : minDate) || value.length === 2 && formatDateWithoutLocale(value[1], 'YYYY-MM-DD') < (minDate === 'today' ? formatDateWithoutLocale(new Date(), 'YYYY-MM-DD') : minDate)) return message;\n });\nconst requiredPassengersMinAdults = memoize((min = 1, message = ' ')=>(value)=>{\n if ((value?.senior?.value ?? 0) + (value?.adults?.value ?? 0) < min) return message;\n });\nconst checkAdultsPerRoom = (value)=>{\n let totalAdults = 0;\n value.people.forEach((person)=>{\n const type = person.type ?? '';\n if (type === PersonRoomType.Adult || type === PersonRoomType.Senior) totalAdults += person.value;\n });\n return totalAdults;\n};\nconst requiredAccomodationsMinAdults = memoize((min = 0, message = ' ')=>(value)=>value.rooms?.some((room)=>(room.adults ?? 0) + (room?.seniors ?? 0) < min) ? message : undefined);\n\nexport { checkAdultsPerRoom, choices, combine2Validators, composeSyncValidators, composeValidators, email, equal, maxLength, maxPeople, maxRooms, maxValue, memoize, minDate, minLength, minValue, notEqual, notEqualValue, notEqualValues, number, petValidate, regex, required, requiredAccomodationsMinAdults, requiredDate, requiredDates, requiredPassengersMinAdults, trailerValidate, vehicleValidate };\n","import Tooltip from '@babylon/ui-kit-base/components/others/tooltip';\nimport { TooltipContent, TooltipArrow } from '@babylon/ui-kit-base/components/others/tooltip/components/view/styled';\nimport { FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport { Padding } from '@babylon/ui-kit-styles/common/mixins/logical.styled';\nimport styled from 'styled-components';\n\nconst ErrorTooltip = /*#__PURE__*/ styled(Tooltip).withConfig({\n displayName: \"ErrorTooltip\"\n})([\n `--tooltip-background:`,\n `;--tooltip-color:`,\n `;--tooltip-popper-bottom-padding:8px;--tooltip-filter:0;`,\n ` --tooltip-max-width:100%;`,\n `{`,\n ` text-align:left;}`,\n `{transform:none !important;left:0;`,\n `}`\n], ({ theme })=>theme.colors.status.error, ({ theme })=>theme.colors.white.base, ({ $width })=>$width && `--tooltip-min-width: ${$width}px;`, TooltipContent, FontMixin({\n size: 'small',\n height: 'base',\n weight: 'regular'\n}), TooltipArrow, Padding({\n left: '18px'\n}));\n\nexport { ErrorTooltip };\n","import { jsx } from 'react/jsx-runtime';\nimport { useRef, useEffect } from 'react';\nimport { useResizeObserver } from 'usehooks-ts';\nimport { ErrorTooltip as ErrorTooltip$1 } from './styled.js';\n\nconst ErrorTooltipView = (props)=>{\n const { referenceElement, error } = props;\n const ref = useRef(referenceElement);\n const size = useResizeObserver({\n ref,\n box: 'border-box'\n });\n useEffect(()=>{\n ref.current = referenceElement;\n }, [\n referenceElement\n ]);\n if (!size.width) return null;\n return /*#__PURE__*/ jsx(ErrorTooltip$1, {\n referenceElement: referenceElement,\n placement: \"bottom\",\n $width: size.width,\n children: error\n });\n};\nconst ErrorTooltip = (props)=>{\n const { error, isVisible = false } = props;\n if (!isVisible || !error) return null;\n return /*#__PURE__*/ jsx(ErrorTooltipView, {\n ...props\n });\n};\n\nexport { ErrorTooltip as default };\n","import { jsxs, Fragment } from 'react/jsx-runtime';\nimport { composeValidators } from '../../helpers/validate.js';\n\nconst checkIsRequired = (validate)=>{\n if (!validate) return false;\n if ('isRequired' in validate) {\n return true;\n }\n if (Array.isArray(validate)) {\n return validate.some((it)=>'isRequired' in it);\n }\n return false;\n};\nconst getValidate = (validate, getValues)=>{\n const sanitizedValidate = Array.isArray(validate) ? composeValidators(validate) : validate;\n const rules = {\n validate: async (value)=>{\n if (!sanitizedValidate) return true;\n const error = await sanitizedValidate(value, getValues?.());\n if (!error) return true;\n return error;\n }\n };\n // @ts-ignore\n return rules;\n};\nconst getControllerProps = (props, control, rules)=>{\n const { name, shouldUnregister, value, defaultValue } = props;\n return {\n name,\n shouldUnregister,\n defaultValue: value || defaultValue,\n control,\n rules\n };\n};\n// replace null or undefined values by empty string to avoid controlled/uncontrolled input warning\nconst defaultFormat = (value)=>{\n if (value == null) return '';\n return value;\n};\nconst getCustomField = (props, field)=>{\n const { parse, format = defaultFormat } = props;\n const onBlur = (...event)=>{\n if (props.onBlur) {\n props.onBlur(...event);\n }\n field.onBlur();\n };\n const onChange = (...event)=>{\n const eventOrValue = props.type === 'checkbox' && event[0]?.target?.value === 'on' ? event[0].target.checked : event[0]?.target?.value || event[0];\n const newValue = parse ? parse(eventOrValue) : eventOrValue;\n field.onChange(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n };\n const value = format ? format(field.value) : field.value;\n return {\n value,\n onBlur,\n onChange\n };\n};\nconst getLabel = (props)=>{\n const { label, isRequired, isHiddenRequired = false } = props;\n if (!label) return;\n if (typeof label === 'string') return isRequired && !isHiddenRequired ? `${label} *` : label;\n return /*#__PURE__*/ jsxs(Fragment, {\n children: [\n label,\n \" *\"\n ]\n });\n};\nconst getCommonInputProps = (props, fieldState, formState)=>{\n const { type, label, isRequired, isHiddenRequired } = props;\n const { isTouched, invalid, isDirty, error } = fieldState;\n const { isSubmitted } = formState;\n const hasError = type === 'checkbox' ? (isTouched || isDirty || isSubmitted) && invalid : (isTouched || isSubmitted) && invalid;\n const finalLabel = getLabel({\n label,\n isRequired,\n isHiddenRequired\n });\n return {\n error: error?.message?.trim(),\n hasError,\n label: finalLabel\n };\n};\n\nexport { checkIsRequired, defaultFormat, getCommonInputProps, getControllerProps, getCustomField, getValidate };\n","import { useMemo } from 'react';\nimport { useFormContext, useController } from 'react-hook-form';\nimport { getValidate, getControllerProps, getCustomField, checkIsRequired, getCommonInputProps } from './utils.js';\n\nconst useInput = (props)=>{\n const { isRequired: isRequiredOption, validate, name = '', shouldUnregister, defaultValue, value: propsValue, type, label: propsLabel, isHiddenRequired, onBlur: propsOnBlur, onChange: propsOnChange, format, parse, disableErrors = false } = props ?? {};\n const { control, getValues } = useFormContext();\n const finalValidate = useMemo(()=>getValidate(validate, getValues), [\n getValues,\n validate\n ]);\n const controllerProps = useMemo(()=>getControllerProps({\n name,\n shouldUnregister,\n value: propsValue,\n defaultValue\n }, control, finalValidate), [\n control,\n defaultValue,\n finalValidate,\n name,\n shouldUnregister,\n propsValue\n ]);\n const { field: { ref, value, onBlur, onChange }, fieldState: { invalid, isDirty, isTouched, error: fieldError }, formState: { isSubmitted } } = useController(controllerProps);\n const finalField = useMemo(()=>getCustomField({\n format,\n parse,\n onBlur: propsOnBlur,\n onChange: propsOnChange\n }, {\n value,\n onBlur,\n onChange\n }), [\n format,\n onBlur,\n onChange,\n parse,\n propsOnBlur,\n propsOnChange,\n value\n ]);\n const isRequired = useMemo(()=>isRequiredOption ?? checkIsRequired(validate), [\n isRequiredOption,\n validate\n ]);\n const { error, hasError, label } = useMemo(()=>getCommonInputProps({\n type,\n label: propsLabel,\n isRequired,\n isHiddenRequired\n }, {\n invalid,\n isDirty,\n isTouched,\n error: fieldError\n }, {\n isSubmitted\n }), [\n fieldError,\n invalid,\n isDirty,\n isHiddenRequired,\n isRequired,\n isSubmitted,\n isTouched,\n propsLabel,\n type\n ]);\n return useMemo(()=>({\n field: {\n ref,\n ...finalField\n },\n fieldState: {\n invalid,\n isDirty,\n isTouched,\n error\n },\n formState: {\n isSubmitted\n },\n isRequired,\n error: !disableErrors ? error : undefined,\n hasError: !disableErrors && hasError,\n label\n }), [\n disableErrors,\n error,\n finalField,\n hasError,\n invalid,\n isDirty,\n isRequired,\n isSubmitted,\n isTouched,\n label,\n ref\n ]);\n};\n\nexport { useInput as default, useInput };\n","import { css } from 'styled-components';\n\nconst logitravelInputStyles = {\n InputLabel: ()=>/*#__PURE__*/ css([\n ``\n ])\n};\n\nexport { logitravelInputStyles as default };\n","import { FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport { BorderRadius, Padding } from '@babylon/ui-kit-styles/common/mixins/logical.styled';\nimport { css } from 'styled-components';\n\nconst liverpoolInputStyles = {\n InputIcon: ()=>/*#__PURE__*/ css([\n `width:fit-content;top:calc(50% - 8px);right:0px;left:12px;`,\n ` color:`,\n `;& i.nico-marker{`,\n ` color:`,\n `;}`,\n `{left:auto;right:14px;}`\n ], FontMixin({\n size: 'larger',\n height: 'base',\n weight: 'light'\n }), ({ theme })=>theme.colors.primary.lighter, FontMixin({\n size: 'larger',\n height: 'base',\n weight: 'light'\n }), ({ theme })=>theme.colors.primary.lighter, ({ theme })=>theme.media.phone.only),\n InputComponent: ()=>/*#__PURE__*/ css([\n ``,\n ` `,\n ` `,\n `{`,\n ` `,\n `}color:`,\n `;`\n ], BorderRadius({\n all: '8px'\n }), Padding({\n top: '36px',\n right: '42px',\n left: '48px',\n bottom: '12px'\n }), ({ theme })=>theme.media.phone.only, FontMixin({\n size: 'medium'\n }), Padding({\n left: '14px'\n }), ({ theme })=>theme.colors.grays.darker),\n InputIconWrapper: ()=>/*#__PURE__*/ css([\n ``\n ]),\n InputLabel: ()=>/*#__PURE__*/ css([\n ``,\n ` `,\n `{font-family:`,\n `;`,\n ` `,\n `}`,\n ` color:`,\n `;`,\n ``\n ], Padding({\n left: '48px'\n }), ({ theme })=>theme.media.phone.only, ({ theme })=>theme.font.family.secondary, FontMixin({\n size: 'small'\n }), Padding({\n left: '14px'\n }), FontMixin({\n size: 'medium',\n height: 'base',\n weight: 'light'\n }), ({ theme })=>theme.colors.grays.base, ({ $noValue })=>!$noValue && /*#__PURE__*/ css([\n ``,\n ``\n ], FontMixin({\n size: 'base'\n }))),\n InputWrapper: ()=>/*#__PURE__*/ css([\n `--input-height:66px;--outline-color-focused:`,\n `;`\n ], ({ theme })=>theme.colors.primary.base)\n};\n\nexport { liverpoolInputStyles as default };\n","import { FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport { css } from 'styled-components';\n\nconst universalMusicInputStyles = {\n InputLabel: ()=>/*#__PURE__*/ css([\n ``,\n ``\n ], FontMixin({\n size: 'medium',\n height: 'small',\n weight: 'regular'\n })),\n InputComponent: ()=>/*#__PURE__*/ css([\n ``,\n ` `,\n `{border:1px solid `,\n `;`,\n `}`\n ], FontMixin({\n size: 'medium',\n height: 'base',\n weight: 'regular'\n }), ({ theme })=>theme.media.phone.only, ({ theme })=>theme.colors.grays.light, FontMixin({\n size: 'base'\n })),\n InputIcon: ()=>/*#__PURE__*/ css([\n ``,\n ` color:`,\n `;`\n ], FontMixin({\n size: 'small'\n }), ({ theme })=>theme.colors.grays.darker)\n};\n\nexport { universalMusicInputStyles as default };\n","import { FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport { BorderRadius, Padding, Border } from '@babylon/ui-kit-styles/common/mixins/logical.styled';\nimport { css } from 'styled-components';\n\nconst veciInputStyles = {\n InputIcon: ()=>/*#__PURE__*/ css([\n `top:calc(50% - 6px);`,\n ` font-size:18px;color:`,\n `;& i.nico-marker{`,\n ` font-size:18px;color:`,\n `;}`\n ], FontMixin({\n height: 'base',\n weight: 'light'\n }), ({ theme })=>theme.colors.primary.base, FontMixin({\n height: 'base',\n weight: 'light'\n }), ({ theme })=>theme.colors.primary.base),\n InputComponent: ()=>/*#__PURE__*/ css([\n ``,\n ` `,\n ` `,\n ` color:`,\n `;font-family:`,\n `;`\n ], FontMixin({\n weight: 'regular',\n height: 'base'\n }), BorderRadius({\n all: '0px'\n }), Padding({\n left: '8px',\n bottom: '6px'\n }), ({ theme })=>theme.colors.grays.darkest, ({ theme })=>theme.font.family.primary),\n InputLabel: ()=>/*#__PURE__*/ css([\n ``,\n ` color:`,\n `;`\n ], Padding({\n left: '8px'\n }), ({ theme })=>theme.colors.grays.dark),\n InputWrapper: ()=>/*#__PURE__*/ css([\n ``,\n ` --input-height:52px;input{outline:none;`,\n `;}&.has-error{input{outline:none;`,\n `}}&.is-focused{input{`,\n ` outline:none;box-sizing:border-box;}}`\n ], BorderRadius({\n all: '4px'\n }), Border({\n bottom: `2px solid transparent`\n }), ({ theme })=>Border({\n bottom: `2px solid ${theme.colors.insurances?.secondary}`\n }), ({ theme })=>Border({\n bottom: `2px solid ${theme.colors.green?.base}`\n }))\n};\n\nexport { veciInputStyles as default };\n","import { createThemes } from '@babylon/ui-kit-styles/common/themes';\nimport { ThemeId } from '@babylon/ui-kit-styles/types/theme';\nimport logitravelInputStyles from './styles/logitravel.js';\nimport liverpoolInputStyles from './styles/partnershipsLiverpool.js';\nimport universalMusicInputStyles from './styles/partnershipsUniversalMusic.js';\nimport veciInputStyles from './styles/veci.js';\n\nconst inputThemes = createThemes({\n [ThemeId.veci]: veciInputStyles,\n [ThemeId.partnershipsUniversalMusic]: universalMusicInputStyles,\n [ThemeId.logitravel]: logitravelInputStyles,\n [ThemeId.partnershipsLiverpool]: liverpoolInputStyles\n});\n\nexport { inputThemes as default };\n","import { FlexMixin, FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport { Border, BorderRadius, Margin } from '@babylon/ui-kit-styles/common/mixins/logical.styled';\nimport { rgba } from 'polished';\nimport styled, { css } from 'styled-components';\nimport inputThemes from './themes/index.js';\n\nconst variantStylesLabel = (variant = 'default', isDesktop = true)=>({\n default: /*#__PURE__*/ css([\n ``,\n ` color:`,\n `;position:absolute;`,\n ``\n ], FontMixin({\n size: 'small',\n height: 'smaller',\n weight: isDesktop ? 'regular' : 'light'\n }), ({ theme })=>theme.colors.grays.base, ({ $focused })=>!$focused && /*#__PURE__*/ css([\n ``,\n ` top:calc((var(--input-height) / 2) - 0.5em);transition:all 0.2s linear;`\n ], FontMixin({\n size: 'medium',\n height: 'small',\n weight: 'regular'\n }))),\n horizontal: /*#__PURE__*/ css([\n ``,\n ` color:`,\n `;width:50%;margin-top:calc((var(--input-height) / 2) - 0.5rem);`\n ], FontMixin({\n size: 'base',\n height: 'base',\n weight: 'light'\n }), ({ theme })=>theme.colors.grays.dark)\n })[variant];\nconst variantStylesInput = (variant = 'default')=>({\n default: /*#__PURE__*/ css([\n ``,\n ` padding:24px 42px 8px 12px;color:`,\n `;`\n ], FontMixin({\n size: 'medium',\n height: 'medium',\n weight: 'regular'\n }), ({ theme })=>theme.colors.grays.darker),\n horizontal: /*#__PURE__*/ css([\n ``,\n ` color:`,\n `;`\n ], FontMixin({\n size: 'base',\n height: 'base',\n weight: 'regular'\n }), ({ theme })=>theme.colors.grays.darker)\n })[variant];\nconst InputWrapper = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"InputWrapper\"\n})([\n `--input-height:56px;--outline-color-default:`,\n `;--outline-color-error:`,\n `;--outline-color-focused:`,\n `;--outline-width:2px;`,\n ` `,\n ` color:`,\n `;position:relative;width:100%;&.has-error{input{outline:var(--outline-width) solid var(--outline-color-error);}}&.is-focused{input{outline:var(--outline-width) solid var(--outline-color-focused);`,\n `}}`,\n ``\n], ({ theme })=>theme.colors.white.base, ({ theme })=>theme.colors.status.error, ({ theme })=>theme.colors.primary.light, FlexMixin(), FontMixin({\n size: 'base',\n height: 'medium',\n weight: 'light'\n}), ({ theme })=>theme.colors.grays.darker, Border({\n all: '0'\n}), inputThemes('InputWrapper'));\nconst InputLabel = /*#__PURE__*/ styled.label.withConfig({\n displayName: \"InputLabel\"\n})([\n `cursor:default;margin:0;padding:0 0 0 14px;top:8px;transition:all 0.2s linear;z-index:1;`,\n ` `,\n ` `,\n ``\n], ({ $variant, $isDesktop })=>variantStylesLabel($variant, $isDesktop), ({ $disabled })=>$disabled ? `\n\t\topacity: 0.56;\n\t` : '', inputThemes('InputLabel'));\nconst InputIcon = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"InputIcon\"\n})([\n ``,\n ` color:`,\n `;margin:0;padding:0;position:absolute;right:12px;top:calc(50% - 8px);z-index:1;& i.nico-marker{`,\n ` color:`,\n `;font-family:nico;font-size:100%;height:24px;line-height:20px;margin:0;padding:0;}`,\n ` `,\n ``\n], FontMixin({\n size: 'large',\n height: 'base',\n weight: 'light'\n}), ({ theme })=>theme.colors.grays.base, FlexMixin(), ({ theme })=>theme.colors.grays.base, ({ $disabled })=>$disabled ? `\n\t\topacity: 0.56;\n\t` : '', inputThemes('InputIcon'));\nconst InputComponentWrapper = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"InputComponentWrapper\"\n})([\n `display:inline-block;margin:0;padding:0;`,\n ` `,\n ` `,\n ``\n], (props)=>props.$variant == 'default' && /*#__PURE__*/ css([\n `position:relative;width:100%;`\n ]), (props)=>props.$variant == 'horizontal' && /*#__PURE__*/ css([\n `width:50%;`\n ]), inputThemes('InputComponentWrapper'));\nconst InputIconWrapper = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"InputIconWrapper\"\n})([\n `position:relative;`,\n ``\n], inputThemes('InputIconWrapper'));\nconst InputComponent = /*#__PURE__*/ styled.input.withConfig({\n displayName: \"InputComponent\"\n})([\n `background-color:`,\n `;cursor:pointer;border-width:0;box-sizing:border-box;margin:0;min-height:var(--input-height);overflow:hidden;position:relative;text-align:left;text-overflow:ellipsis;vertical-align:top;width:100%;transition:outline 0.1s linear;`,\n ` `,\n `{padding-right:40px;}&.input-without-label{padding:16px 42px 16px 16px;}&:hover,&:active,&:focus{outline:none;}position:relative;vertical-align:top;&::placeholder{color:`,\n `;opacity:1;}`,\n ` `,\n ` `,\n ``\n], ({ theme })=>theme.colors.white.base, BorderRadius({\n all: '4px'\n}), ({ theme })=>theme.media.desktop.up, ({ theme })=>theme.colors.grays.base, ({ disabled, theme })=>disabled && /*#__PURE__*/ css([\n `color:`,\n `!important;`\n ], rgba(theme.colors.grays.darker, 0.56)), ({ $variant })=>variantStylesInput($variant), inputThemes('InputComponent'));\nconst ErrorText = /*#__PURE__*/ styled.p.withConfig({\n displayName: \"ErrorText\"\n})([\n ``,\n ` `,\n ` color:`,\n `;`\n], FontMixin({\n size: 'medium'\n}), Margin({\n y: '8px'\n}), ({ theme })=>theme.colors.status.error);\n\nexport { ErrorText, InputComponent, InputComponentWrapper, InputIcon, InputIconWrapper, InputLabel, InputWrapper };\n","import { jsxs, jsx } from 'react/jsx-runtime';\nimport Icon from '@babylon/ui-kit-base/components/icons/icon';\nimport ErrorTooltip from '../../others/error-tooltip/index.js';\nimport { useInput } from '../../../hooks/useInput/index.js';\nimport useIsDesktop from '@babylon/ui-kit-hooks/device/useIsDesktop';\nimport classNames from 'classnames';\nimport { forwardRef, useId, useRef, useImperativeHandle, useState, useCallback, useMemo } from 'react';\nimport { InputWrapper, InputLabel, InputComponentWrapper, InputIconWrapper, InputComponent, InputIcon, ErrorText } from './styled.js';\n\nconst Input = /*#__PURE__*/ forwardRef(({ label, value, id, disabled = false, icon = '', onBlur, onFocus, onClick, type = 'text', isFocused, hasError = false, error, variant = 'default', placeholder, disableInternalFocus = false, className = '', wrapperRef, // eslint-disable-next-line unused-imports/no-unused-vars\ndefaultValue, errorVariant = 'tooltip', ...rest }, ref)=>{\n const uniqueId = useId();\n const inputRef = useRef(null);\n useImperativeHandle(ref, ()=>inputRef.current);\n const inputWrapperRef = useRef(null);\n useImperativeHandle(wrapperRef, ()=>inputWrapperRef.current);\n const isDesktop = useIsDesktop();\n const [internalFocused, setInternalFocused] = useState(false);\n const finalFocused = isFocused ?? internalFocused;\n const internalOnBlur = useCallback((e)=>{\n setInternalFocused(false);\n if (onBlur) onBlur(e);\n }, [\n onBlur\n ]);\n const internalOnFocus = useCallback((e)=>{\n setInternalFocused(true);\n if (onFocus) onFocus(e);\n }, [\n onFocus\n ]);\n const inputId = useMemo(()=>`${uniqueId}-${id ?? 'input-text-' + label}`, [\n id,\n label,\n uniqueId\n ]);\n return /*#__PURE__*/ jsxs(InputWrapper, {\n \"data-testid\": \"Input\",\n ref: inputWrapperRef,\n className: classNames({\n [className]: !!className,\n 'has-error': hasError,\n 'is-focused': isDesktop && finalFocused\n }),\n children: [\n /*#__PURE__*/ jsx(InputLabel, {\n \"data-testid\": \"InputLabel\",\n $variant: variant,\n $isDesktop: isDesktop,\n $focused: internalFocused && !disableInternalFocus || !!value || !!placeholder,\n $disabled: disabled,\n htmlFor: inputId,\n $noValue: !!value,\n children: label\n }),\n /*#__PURE__*/ jsxs(InputComponentWrapper, {\n $variant: variant,\n children: [\n /*#__PURE__*/ jsxs(InputIconWrapper, {\n children: [\n /*#__PURE__*/ jsx(InputComponent, {\n $variant: variant,\n disabled: disabled,\n type: type,\n id: inputId,\n className: classNames({\n ['input-without-label']: !label\n }),\n value: value,\n onFocus: internalOnFocus,\n onBlur: internalOnBlur,\n placeholder: placeholder,\n ref: inputRef,\n onClick: onClick,\n role: type === 'button' ? 'button' : 'textbox',\n ...rest\n }),\n icon && /*#__PURE__*/ jsx(InputIcon, {\n className: classNames({\n ['icon-without-label']: !label\n }),\n $disabled: disabled,\n onClick: onClick,\n children: typeof icon === 'string' ? /*#__PURE__*/ jsx(Icon, {\n \"data-testid\": \"InputIcon\",\n className: `nico-${icon}`\n }) : icon\n })\n ]\n }),\n errorVariant === 'tooltip' && /*#__PURE__*/ jsx(ErrorTooltip, {\n referenceElement: inputRef.current,\n error: error,\n isVisible: !finalFocused && !!hasError\n }),\n errorVariant === 'text' && !!hasError && !!error && /*#__PURE__*/ jsx(ErrorText, {\n children: error\n })\n ]\n })\n ]\n });\n});\nInput.displayName = 'Input';\nconst FormInput = (props)=>{\n const { isHiddenRequired: _isHiddenRequired, ...rest } = props;\n const { field, error, hasError, label } = useInput(props);\n return /*#__PURE__*/ jsx(Input, {\n ...rest,\n ...field,\n hasError: hasError,\n label: label,\n error: error\n });\n};\n\nexport { FormInput, Input as default };\n"],"names":["isCheckBoxInput","element","isDateObject","value","isNullOrUndefined","isObjectType","isObject","getEventValue","event","getNodeParentName","name","isNameInFieldArray","names","isPlainObject","tempObject","prototypeCopy","isWeb","cloneObject","data","copy","isArray","key","compact","isUndefined","val","get","object","path","defaultValue","result","isBoolean","isKey","stringToPath","input","set","index","tempPath","length","lastIndex","newValue","objValue","EVENTS","VALIDATION_MODE","INPUT_VALIDATION_RULES","HookFormContext","React","useFormContext","FormProvider","props","children","getProxyFormState","formState","control","localProxyFormState","isRoot","_key","isEmptyObject","shouldRenderFormState","formStateData","_proxyFormState","updateFormState","convertToArrayPayload","shouldSubscribeByName","signalName","exact","currentName","useSubscribe","_props","subscription","useFormState","methods","disabled","_mounted","_localProxyFormState","_name","isString","generateWatchOutput","_names","formValues","isGlobal","fieldName","useWatch","updateValue","useController","shouldUnregister","isArrayField","_registerProps","_shouldUnregisterField","updateMounted","field","elm","message","appendErrors","validateAllFieldCriteria","errors","type","getValidationModes","mode","isWatched","isBlurEvent","watchName","iterateFieldsByAction","fields","action","fieldsNames","abortEarly","_f","currentField","updateFieldArrayRootError","error","fieldArrayErrors","isFileInput","isFunction","isHTMLElement","owner","isMessage","isRadioInput","isRegex","defaultResult","validResult","getCheckboxValue","options","values","option","defaultReturn","getRadioValue","previous","getValidateError","ref","getValueAndMessage","validationData","validateField","shouldUseNativeValidation","isFieldArray","refs","required","maxLength","minLength","min","max","pattern","validate","valueAsNumber","mount","inputValue","inputRef","setCustomValidity","isRadio","isCheckBox","isRadioOrCheckbox","isEmpty","appendErrorsCurry","getMinMaxMessage","exceedMax","maxLengthMessage","minLengthMessage","maxType","minType","exceedMin","maxOutput","minOutput","valueNumber","valueDate","convertTimeToDate","time","isTime","isWeek","maxLengthOutput","minLengthOutput","patternValue","validateError","validationResult","baseGet","updatePath","isEmptyArray","obj","unset","paths","childObject","createSubject","_observers","observer","o","isPrimitive","deepEqual","object1","object2","keys1","keys2","val1","val2","isMultipleSelect","live","objectHasFunction","markFieldsDirty","isParentNodeArray","getDirtyFieldsFromDefaultValues","dirtyFieldsFromValues","getDirtyFields","defaultValues","getFieldValueAs","valueAsDate","setValueAs","getFieldValue","getResolverOptions","_fields","criteriaMode","getRuleValue","rule","ASYNC_FUNCTION","hasPromiseValidation","fieldReference","validateFunction","hasValidation","schemaErrorLookup","foundError","skipValidation","isTouched","isSubmitted","reValidateMode","unsetEmptyArray","defaultOptions","createFormControl","_options","_formState","_defaultValues","_formValues","_state","delayErrorCallback","timer","_subjects","validationModeBeforeSubmit","validationModeAfterSubmit","shouldDisplayAllAssociatedErrors","debounce","callback","wait","_updateValid","shouldUpdateValid","isValid","_executeSchema","executeBuiltInValidation","_updateIsValidating","isValidating","_updateFieldArray","method","args","shouldSetValues","shouldUpdateFieldsAndState","fieldValues","touchedFields","_getDirty","updateErrors","_setErrors","updateValidAndValue","shouldSkipSetValueAs","setFieldValue","updateTouchAndDirty","fieldValue","shouldDirty","shouldRender","shouldUpdateField","isPreviousDirty","output","disabledField","isCurrentFieldPristine","isPreviousFieldTouched","shouldRenderByError","fieldState","previousFieldError","updatedFormState","executeSchemaAndUpdateState","shouldOnlyCheckValid","context","isFieldArrayRoot","isPromiseFunction","fieldError","_removeUnmounted","unregister","getValues","_getWatch","_getFieldArray","optionRef","checkboxRef","radioRef","trigger","setValues","fieldKey","setValue","cloneValue","onChange","target","isFieldValueUpdated","getCurrentFieldValue","_updateIsFieldValueUpdated","shouldSkipValidation","watched","previousErrorLookupResult","errorLookupResult","_focusInput","fieldNames","getFieldState","clearErrors","inputName","setError","currentError","currentRef","restOfErrorTree","watch","payload","_updateDisabledField","register","disabledIsDefined","fieldRef","radioOrCheckbox","_focusError","_disableForm","handleSubmit","onValid","onInvalid","e","onValidError","resetField","_reset","keepStateOptions","updatedValues","cloneUpdatedValues","isEmptyResetValues","fieldsToCheck","form","reset","useForm","_formControl","_values","isDirty","state","Form","styled","onSubmit","onError","formTag","shouldFocusError","rest","formMethods","Form$1","checkPetValue","freeGlobal","global","_freeGlobal","require$$0","freeSelf","root","_root","Symbol","_Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","isOwn","tag","unmasked","_getRawTag","objectToString","_objectToString","require$$1","require$$2","nullTag","undefinedTag","baseGetTag","_baseGetTag","isObject_1","asyncTag","funcTag","genTag","proxyTag","isFunction_1","coreJsData","_coreJsData","maskSrcKey","uid","isMasked","func","_isMasked","funcProto","funcToString","toSource","_toSource","require$$3","reRegExpChar","reIsHostCtor","reIsNative","baseIsNative","_baseIsNative","getValue","_getValue","getNative","_getNative","nativeCreate","_nativeCreate","hashClear","_hashClear","hashDelete","_hashDelete","HASH_UNDEFINED","hashGet","_hashGet","hashHas","_hashHas","hashSet","_hashSet","require$$4","Hash","entries","entry","_Hash","listCacheClear","_listCacheClear","eq","other","eq_1","assocIndexOf","array","_assocIndexOf","arrayProto","splice","listCacheDelete","_listCacheDelete","listCacheGet","_listCacheGet","listCacheHas","_listCacheHas","listCacheSet","_listCacheSet","ListCache","_ListCache","Map","_Map","mapCacheClear","_mapCacheClear","isKeyable","_isKeyable","getMapData","map","_getMapData","mapCacheDelete","_mapCacheDelete","mapCacheGet","_mapCacheGet","mapCacheHas","_mapCacheHas","mapCacheSet","size","_mapCacheSet","MapCache","_MapCache","FUNC_ERROR_TEXT","memoize","resolver","memoized","cache","memoize_1","PersonRoomType","EMAIL_REGEX","isValidationErrorMessageWithArgs","fn","lodashMemoize","combine2Validators","validator1","validator2","result1","resolvedResult1","composeValidators","validators","nullFunction","regex","email","list","totalPeople","_a","acc","room","adults","notEqualTo","isEqual","notEqual","equal","equalTo","value1","value2","requiredDate","requiredDates","minDate","formatDateWithoutLocale","_b","ErrorTooltip","Tooltip","theme","$width","TooltipContent","FontMixin","TooltipArrow","Padding","ErrorTooltipView","referenceElement","useRef","useResizeObserver","useEffect","jsx","ErrorTooltip$1","isVisible","checkIsRequired","it","getValidate","sanitizedValidate","getControllerProps","rules","defaultFormat","getCustomField","parse","format","onBlur","eventOrValue","_d","_c","getLabel","label","isRequired","isHiddenRequired","jsxs","Fragment","getCommonInputProps","invalid","hasError","finalLabel","useInput","isRequiredOption","propsValue","propsLabel","propsOnBlur","propsOnChange","disableErrors","finalValidate","useMemo","controllerProps","finalField","logitravelInputStyles","css","liverpoolInputStyles","BorderRadius","$noValue","universalMusicInputStyles","veciInputStyles","Border","inputThemes","createThemes","ThemeId","variantStylesLabel","variant","isDesktop","$focused","variantStylesInput","InputWrapper","FlexMixin","InputLabel","$variant","$isDesktop","$disabled","InputIcon","InputComponentWrapper","InputIconWrapper","InputComponent","rgba","ErrorText","Margin","Input","forwardRef","id","icon","onFocus","onClick","isFocused","placeholder","disableInternalFocus","className","wrapperRef","errorVariant","uniqueId","useId","useImperativeHandle","inputWrapperRef","useIsDesktop","internalFocused","setInternalFocused","useState","finalFocused","internalOnBlur","useCallback","internalOnFocus","inputId","classNames","Icon","FormInput","_isHiddenRequired"],"mappings":"iPAEA,IAAIA,GAAmBC,GAAYA,EAAQ,OAAS,WAEhDC,GAAgBC,GAAUA,aAAiB,KAE3CC,EAAqBD,GAAUA,GAAS,KAE5C,MAAME,GAAgBF,GAAU,OAAOA,GAAU,SACjD,IAAIG,EAAYH,GAAU,CAACC,EAAkBD,CAAK,GAC9C,CAAC,MAAM,QAAQA,CAAK,GACpBE,GAAaF,CAAK,GAClB,CAACD,GAAaC,CAAK,EAEnBI,GAAiBC,GAAUF,EAASE,CAAK,GAAKA,EAAM,OAClDR,GAAgBQ,EAAM,MAAM,EACxBA,EAAM,OAAO,QACbA,EAAM,OAAO,MACjBA,EAEFC,GAAqBC,GAASA,EAAK,UAAU,EAAGA,EAAK,OAAO,aAAa,CAAC,GAAKA,EAE/EC,GAAqB,CAACC,EAAOF,IAASE,EAAM,IAAIH,GAAkBC,CAAI,CAAC,EAEvEG,GAAiBC,GAAe,CAChC,MAAMC,EAAgBD,EAAW,aAAeA,EAAW,YAAY,UACvE,OAAQR,EAASS,CAAa,GAAKA,EAAc,eAAe,eAAe,CACnF,EAEIC,GAAQ,OAAO,OAAW,KAC1B,OAAO,OAAO,YAAgB,KAC9B,OAAO,SAAa,IAExB,SAASC,EAAYC,EAAM,CACvB,IAAIC,EACJ,MAAMC,EAAU,MAAM,QAAQF,CAAI,EAClC,GAAIA,aAAgB,KAChBC,EAAO,IAAI,KAAKD,CAAI,UAEfA,aAAgB,IACrBC,EAAO,IAAI,IAAID,CAAI,UAEd,EAAEF,KAAUE,aAAgB,MAAQA,aAAgB,aACxDE,GAAWd,EAASY,CAAI,GAEzB,GADAC,EAAOC,EAAU,CAAE,EAAG,GAClB,C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EACT,KAAMte,IAAS,SAAW,SAAW,UACrC,GAAGuP,CACnC,CAA6B,EACD6O,GAAsBtE,EAAG,IAAC4D,GAAW,CACjC,UAAWgC,GAAW,CACjB,qBAAuB,CAAC1E,CAC7D,CAAiC,EACD,UAAWxc,EACX,QAAS8f,EACT,SAAU,OAAOF,GAAS,SAAyBtE,EAAAA,IAAI6F,GAAM,CACzD,cAAe,YACf,UAAW,QAAQvB,CAAI,EAC1B,CAAA,EAAIA,CACrC,CAA6B,CACJ,CACzB,CAAqB,EACDQ,IAAiB,WAA2B9E,EAAG,IAACb,GAAc,CAC1D,iBAAkB/V,EAAS,QAC3B,MAAOpC,EACP,UAAW,CAACue,IAAgB,CAAC,CAAC9D,CACtD,CAAqB,EACDqD,IAAiB,QAAU,CAAC,CAACrD,GAAY,CAAC,CAACza,GAAuBgZ,EAAG,IAACiE,GAAW,CAC7E,SAAUjd,CAClC,CAAqB,CACJ,CACjB,CAAa,CACJ,CACT,CAAK,CACL,CAAC,EACDmd,GAAM,YAAc,QACf,MAAC2B,GAAa3iB,GAAQ,CACvB,KAAM,CAAE,iBAAkB4iB,EAAmB,GAAGtQ,CAAI,EAAKtS,EACnD,CAAE,MAAAyC,EAAO,MAAAoB,EAAO,SAAAya,EAAU,MAAAP,GAAUS,GAASxe,CAAK,EACxD,OAAqB6c,EAAAA,IAAImE,GAAO,CAC5B,GAAG1O,EACH,GAAG7P,EACH,SAAU6b,EACV,MAAOP,EACP,MAAOla,CACf,CAAK,CACL","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55]}