{"version":3,"file":"form-DXGjj5Yf.js","sources":["../../../node_modules/lodash-es/head.js","../../../node_modules/@mantine/form/esm/actions/actions.mjs","../../../node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs","../../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs","../../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs","../../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs","../../../node_modules/@mantine/form/esm/lists/change-error-indices.mjs","../../../node_modules/@mantine/form/esm/lists/reorder-errors.mjs","../../../node_modules/klona/full/index.mjs","../../../node_modules/@mantine/form/esm/paths/get-splitted-path.mjs","../../../node_modules/@mantine/form/esm/paths/get-path.mjs","../../../node_modules/@mantine/form/esm/paths/set-path.mjs","../../../node_modules/@mantine/form/esm/paths/reorder-path.mjs","../../../node_modules/@mantine/form/esm/paths/insert-path.mjs","../../../node_modules/@mantine/form/esm/paths/remove-path.mjs","../../../node_modules/@mantine/form/esm/paths/replace-path.mjs","../../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs","../../../node_modules/fast-deep-equal/index.js","../../../node_modules/@mantine/form/esm/get-status/get-status.mjs","../../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs","../../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs","../../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs","../../../node_modules/@mantine/form/esm/paths/get-data-path.mjs","../../../node_modules/@mantine/form/esm/validate/validate-values.mjs","../../../node_modules/@mantine/form/esm/validate/validate-field-value.mjs","../../../node_modules/@mantine/form/esm/form-index.mjs","../../../node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs","../../../node_modules/@mantine/form/esm/use-form.mjs","../../../node_modules/scroll-into-view/scrollIntoView.js","../../../app/helpers/inflect.ts","../../../app/helpers/form.tsx"],"sourcesContent":["/**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\nfunction head(array) {\n return (array && array.length) ? array[0] : undefined;\n}\n\nexport default head;\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nfunction dispatchEvent(type, detail) {\n window.dispatchEvent(new CustomEvent(type, { detail }));\n}\nfunction validateFormName(name) {\n if (!/^[0-9a-zA-Z-]+$/.test(name)) {\n throw new Error(\n `[@mantine/use-form] Form name \"${name}\" is invalid, it should contain only letters, numbers and dashes`\n );\n }\n}\nconst useIsomorphicEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nfunction createFormActions(name) {\n validateFormName(name);\n const setFieldValue = (path, value) => dispatchEvent(`mantine-form:${name}:set-field-value`, { path, value });\n const setValues = (values) => dispatchEvent(`mantine-form:${name}:set-values`, values);\n const setInitialValues = (values) => dispatchEvent(`mantine-form:${name}:set-initial-values`, values);\n const setErrors = (errors) => dispatchEvent(`mantine-form:${name}:set-errors`, errors);\n const setFieldError = (path, error) => dispatchEvent(`mantine-form:${name}:set-field-error`, { path, error });\n const clearFieldError = (path) => dispatchEvent(`mantine-form:${name}:clear-field-error`, path);\n const clearErrors = () => dispatchEvent(`mantine-form:${name}:clear-errors`);\n const reset = () => dispatchEvent(`mantine-form:${name}:reset`);\n const validate = () => dispatchEvent(`mantine-form:${name}:validate`);\n const validateField = (path) => dispatchEvent(`mantine-form:${name}:validate-field`, path);\n const reorderListItem = (path, payload) => dispatchEvent(`mantine-form:${name}:reorder-list-item`, { path, payload });\n const removeListItem = (path, index) => dispatchEvent(`mantine-form:${name}:remove-list-item`, { path, index });\n const insertListItem = (path, item, index) => dispatchEvent(`mantine-form:${name}:insert-list-item`, { path, index, item });\n const setDirty = (value) => dispatchEvent(`mantine-form:${name}:set-dirty`, value);\n const setTouched = (value) => dispatchEvent(`mantine-form:${name}:set-touched`, value);\n const resetDirty = (values) => dispatchEvent(`mantine-form:${name}:reset-dirty`, values);\n const resetTouched = () => dispatchEvent(`mantine-form:${name}:reset-touched`);\n return {\n setFieldValue,\n setValues,\n setInitialValues,\n setErrors,\n setFieldError,\n clearFieldError,\n clearErrors,\n reset,\n validate,\n validateField,\n reorderListItem,\n removeListItem,\n insertListItem,\n setDirty,\n setTouched,\n resetDirty,\n resetTouched\n };\n}\nfunction useFormEvent(eventKey, handler) {\n useIsomorphicEffect(() => {\n if (eventKey) {\n window.addEventListener(eventKey, handler);\n return () => window.removeEventListener(eventKey, handler);\n }\n return void 0;\n }, [eventKey]);\n}\nfunction useFormActions(name, form) {\n if (name) {\n validateFormName(name);\n }\n useFormEvent(\n `mantine-form:${name}:set-field-value`,\n (event) => form.setFieldValue(event.detail.path, event.detail.value)\n );\n useFormEvent(\n `mantine-form:${name}:set-values`,\n (event) => form.setValues(event.detail)\n );\n useFormEvent(\n `mantine-form:${name}:set-initial-values`,\n (event) => form.setInitialValues(event.detail)\n );\n useFormEvent(\n `mantine-form:${name}:set-errors`,\n (event) => form.setErrors(event.detail)\n );\n useFormEvent(\n `mantine-form:${name}:set-field-error`,\n (event) => form.setFieldError(event.detail.path, event.detail.error)\n );\n useFormEvent(\n `mantine-form:${name}:clear-field-error`,\n (event) => form.clearFieldError(event.detail)\n );\n useFormEvent(`mantine-form:${name}:clear-errors`, form.clearErrors);\n useFormEvent(`mantine-form:${name}:reset`, form.reset);\n useFormEvent(`mantine-form:${name}:validate`, form.validate);\n useFormEvent(\n `mantine-form:${name}:validate-field`,\n (event) => form.validateField(event.detail)\n );\n useFormEvent(\n `mantine-form:${name}:reorder-list-item`,\n (event) => form.reorderListItem(event.detail.path, event.detail.payload)\n );\n useFormEvent(\n `mantine-form:${name}:remove-list-item`,\n (event) => form.removeListItem(event.detail.path, event.detail.index)\n );\n useFormEvent(\n `mantine-form:${name}:insert-list-item`,\n (event) => form.insertListItem(event.detail.path, event.detail.item, event.detail.index)\n );\n useFormEvent(\n `mantine-form:${name}:set-dirty`,\n (event) => form.setDirty(event.detail)\n );\n useFormEvent(\n `mantine-form:${name}:set-touched`,\n (event) => form.setTouched(event.detail)\n );\n useFormEvent(\n `mantine-form:${name}:reset-dirty`,\n (event) => form.resetDirty(event.detail)\n );\n useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);\n}\n\nexport { createFormActions, useFormActions, useIsomorphicEffect };\n//# sourceMappingURL=actions.mjs.map\n","'use client';\nfunction getInputOnChange(setValue) {\n return (val) => {\n if (!val) {\n setValue(val);\n } else if (typeof val === \"function\") {\n setValue(val);\n } else if (typeof val === \"object\" && \"nativeEvent\" in val) {\n const { currentTarget } = val;\n if (currentTarget instanceof HTMLInputElement) {\n if (currentTarget.type === \"checkbox\") {\n setValue(currentTarget.checked);\n } else {\n setValue(currentTarget.value);\n }\n } else if (currentTarget instanceof HTMLTextAreaElement || currentTarget instanceof HTMLSelectElement) {\n setValue(currentTarget.value);\n }\n } else {\n setValue(val);\n }\n };\n}\n\nexport { getInputOnChange };\n//# sourceMappingURL=get-input-on-change.mjs.map\n","'use client';\nfunction filterErrors(errors) {\n if (errors === null || typeof errors !== \"object\") {\n return {};\n }\n return Object.keys(errors).reduce((acc, key) => {\n const errorValue = errors[key];\n if (errorValue !== void 0 && errorValue !== null && errorValue !== false) {\n acc[key] = errorValue;\n }\n return acc;\n }, {});\n}\n\nexport { filterErrors };\n//# sourceMappingURL=filter-errors.mjs.map\n","'use client';\nimport { useState, useRef, useCallback } from 'react';\nimport { filterErrors } from './filter-errors/filter-errors.mjs';\n\nfunction useFormErrors(initialErrors) {\n const [errorsState, setErrorsState] = useState(filterErrors(initialErrors));\n const errorsRef = useRef(errorsState);\n const setErrors = useCallback((errors) => {\n setErrorsState((current) => {\n const newErrors = filterErrors(typeof errors === \"function\" ? errors(current) : errors);\n errorsRef.current = newErrors;\n return newErrors;\n });\n }, []);\n const clearErrors = useCallback(() => setErrors({}), []);\n const clearFieldError = useCallback(\n (path) => {\n if (errorsRef.current[path] === void 0) {\n return;\n }\n setErrors((current) => {\n const errors = { ...current };\n delete errors[path];\n return errors;\n });\n },\n [errorsState]\n );\n const setFieldError = useCallback(\n (path, error) => {\n if (error == null || error === false) {\n clearFieldError(path);\n } else if (errorsRef.current[path] !== error) {\n setErrors((current) => ({ ...current, [path]: error }));\n }\n },\n [errorsState]\n );\n return {\n errorsState,\n setErrors,\n clearErrors,\n setFieldError,\n clearFieldError\n };\n}\n\nexport { useFormErrors };\n//# sourceMappingURL=use-form-errors.mjs.map\n","'use client';\nfunction clearListState(field, state) {\n if (state === null || typeof state !== \"object\") {\n return {};\n }\n const clone = { ...state };\n Object.keys(state).forEach((errorKey) => {\n if (errorKey.includes(`${String(field)}.`)) {\n delete clone[errorKey];\n }\n });\n return clone;\n}\n\nexport { clearListState };\n//# sourceMappingURL=clear-list-state.mjs.map\n","'use client';\nimport { clearListState } from './clear-list-state.mjs';\n\nfunction getIndexFromKeyAfterPath(key, path) {\n const split = key.substring(path.length + 1).split(\".\")[0];\n return parseInt(split, 10);\n}\nfunction changeErrorIndices(path, index, errors, change) {\n if (index === void 0) {\n return errors;\n }\n const pathString = `${String(path)}`;\n let clearedErrors = errors;\n if (change === -1) {\n clearedErrors = clearListState(`${pathString}.${index}`, clearedErrors);\n }\n const cloned = { ...clearedErrors };\n const changedKeys = /* @__PURE__ */ new Set();\n Object.entries(clearedErrors).filter(([key]) => {\n if (!key.startsWith(`${pathString}.`)) {\n return false;\n }\n const currIndex = getIndexFromKeyAfterPath(key, pathString);\n if (Number.isNaN(currIndex)) {\n return false;\n }\n return currIndex >= index;\n }).forEach(([key, value]) => {\n const currIndex = getIndexFromKeyAfterPath(key, pathString);\n const newKey = key.replace(\n `${pathString}.${currIndex}`,\n `${pathString}.${currIndex + change}`\n );\n cloned[newKey] = value;\n changedKeys.add(newKey);\n if (!changedKeys.has(key)) {\n delete cloned[key];\n }\n });\n return cloned;\n}\n\nexport { changeErrorIndices };\n//# sourceMappingURL=change-error-indices.mjs.map\n","'use client';\nfunction reorderErrors(path, { from, to }, errors) {\n const oldKeyStart = `${path}.${from}`;\n const newKeyStart = `${path}.${to}`;\n const clone = { ...errors };\n Object.keys(errors).every((key) => {\n let oldKey;\n let newKey;\n if (key.startsWith(oldKeyStart)) {\n oldKey = key;\n newKey = key.replace(oldKeyStart, newKeyStart);\n }\n if (key.startsWith(newKeyStart)) {\n oldKey = key.replace(newKeyStart, oldKeyStart);\n newKey = key;\n }\n if (oldKey && newKey) {\n const value1 = clone[oldKey];\n const value2 = clone[newKey];\n value2 === void 0 ? delete clone[oldKey] : clone[oldKey] = value2;\n value1 === void 0 ? delete clone[newKey] : clone[newKey] = value1;\n return false;\n }\n return true;\n });\n return clone;\n}\n\nexport { reorderErrors };\n//# sourceMappingURL=reorder-errors.mjs.map\n","function set(obj, key, val) {\n\tif (typeof val.value === 'object') val.value = klona(val.value);\n\tif (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {\n\t\tObject.defineProperty(obj, key, val);\n\t} else obj[key] = val.value;\n}\n\nexport function klona(x) {\n\tif (typeof x !== 'object') return x;\n\n\tvar i=0, k, list, tmp, str=Object.prototype.toString.call(x);\n\n\tif (str === '[object Object]') {\n\t\ttmp = Object.create(x.__proto__ || null);\n\t} else if (str === '[object Array]') {\n\t\ttmp = Array(x.length);\n\t} else if (str === '[object Set]') {\n\t\ttmp = new Set;\n\t\tx.forEach(function (val) {\n\t\t\ttmp.add(klona(val));\n\t\t});\n\t} else if (str === '[object Map]') {\n\t\ttmp = new Map;\n\t\tx.forEach(function (val, key) {\n\t\t\ttmp.set(klona(key), klona(val));\n\t\t});\n\t} else if (str === '[object Date]') {\n\t\ttmp = new Date(+x);\n\t} else if (str === '[object RegExp]') {\n\t\ttmp = new RegExp(x.source, x.flags);\n\t} else if (str === '[object DataView]') {\n\t\ttmp = new x.constructor( klona(x.buffer) );\n\t} else if (str === '[object ArrayBuffer]') {\n\t\ttmp = x.slice(0);\n\t} else if (str.slice(-6) === 'Array]') {\n\t\t// ArrayBuffer.isView(x)\n\t\t// ~> `new` bcuz `Buffer.slice` => ref\n\t\ttmp = new x.constructor(x);\n\t}\n\n\tif (tmp) {\n\t\tfor (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {\n\t\t\tset(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));\n\t\t}\n\n\t\tfor (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {\n\t\t\tif (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;\n\t\t\tset(tmp, k, Object.getOwnPropertyDescriptor(x, k));\n\t\t}\n\t}\n\n\treturn tmp || x;\n}\n","'use client';\nfunction getSplittedPath(path) {\n if (typeof path !== \"string\") {\n return [];\n }\n return path.split(\".\");\n}\n\nexport { getSplittedPath };\n//# sourceMappingURL=get-splitted-path.mjs.map\n","'use client';\nimport { getSplittedPath } from './get-splitted-path.mjs';\n\nfunction getPath(path, values) {\n const splittedPath = getSplittedPath(path);\n if (splittedPath.length === 0 || typeof values !== \"object\" || values === null) {\n return void 0;\n }\n let value = values[splittedPath[0]];\n for (let i = 1; i < splittedPath.length; i += 1) {\n if (value == null) {\n break;\n }\n value = value[splittedPath[i]];\n }\n return value;\n}\n\nexport { getPath };\n//# sourceMappingURL=get-path.mjs.map\n","'use client';\nimport { klona } from 'klona/full';\nimport { getSplittedPath } from './get-splitted-path.mjs';\n\nfunction setPath(path, value, values) {\n const splittedPath = getSplittedPath(path);\n if (splittedPath.length === 0) {\n return values;\n }\n const cloned = klona(values);\n if (splittedPath.length === 1) {\n cloned[splittedPath[0]] = value;\n return cloned;\n }\n let val = cloned[splittedPath[0]];\n for (let i = 1; i < splittedPath.length - 1; i += 1) {\n if (val === void 0) {\n return cloned;\n }\n val = val[splittedPath[i]];\n }\n val[splittedPath[splittedPath.length - 1]] = value;\n return cloned;\n}\n\nexport { setPath };\n//# sourceMappingURL=set-path.mjs.map\n","'use client';\nimport { getPath } from './get-path.mjs';\nimport { setPath } from './set-path.mjs';\n\nfunction reorderPath(path, { from, to }, values) {\n const currentValue = getPath(path, values);\n if (!Array.isArray(currentValue)) {\n return values;\n }\n const cloned = [...currentValue];\n const item = currentValue[from];\n cloned.splice(from, 1);\n cloned.splice(to, 0, item);\n return setPath(path, cloned, values);\n}\n\nexport { reorderPath };\n//# sourceMappingURL=reorder-path.mjs.map\n","'use client';\nimport { getPath } from './get-path.mjs';\nimport { setPath } from './set-path.mjs';\n\nfunction insertPath(path, value, index, values) {\n const currentValue = getPath(path, values);\n if (!Array.isArray(currentValue)) {\n return values;\n }\n const cloned = [...currentValue];\n cloned.splice(typeof index === \"number\" ? index : cloned.length, 0, value);\n return setPath(path, cloned, values);\n}\n\nexport { insertPath };\n//# sourceMappingURL=insert-path.mjs.map\n","'use client';\nimport { getPath } from './get-path.mjs';\nimport { setPath } from './set-path.mjs';\n\nfunction removePath(path, index, values) {\n const currentValue = getPath(path, values);\n if (!Array.isArray(currentValue)) {\n return values;\n }\n return setPath(\n path,\n currentValue.filter((_, itemIndex) => itemIndex !== index),\n values\n );\n}\n\nexport { removePath };\n//# sourceMappingURL=remove-path.mjs.map\n","'use client';\nimport { getPath } from './get-path.mjs';\nimport { setPath } from './set-path.mjs';\n\nfunction replacePath(path, item, index, values) {\n const currentValue = getPath(path, values);\n if (!Array.isArray(currentValue)) {\n return values;\n }\n if (currentValue.length <= index) {\n return values;\n }\n const cloned = [...currentValue];\n cloned[index] = item;\n return setPath(path, cloned, values);\n}\n\nexport { replacePath };\n//# sourceMappingURL=replace-path.mjs.map\n","'use client';\nimport { useCallback } from 'react';\nimport { changeErrorIndices } from '../../lists/change-error-indices.mjs';\nimport { reorderErrors } from '../../lists/reorder-errors.mjs';\nimport 'klona/full';\nimport { reorderPath } from '../../paths/reorder-path.mjs';\nimport { insertPath } from '../../paths/insert-path.mjs';\nimport { removePath } from '../../paths/remove-path.mjs';\nimport { replacePath } from '../../paths/replace-path.mjs';\n\nfunction useFormList({\n $values,\n $errors,\n $status\n}) {\n const reorderListItem = useCallback((path, payload) => {\n $status.clearFieldDirty(path);\n $errors.setErrors((errs) => reorderErrors(path, payload, errs));\n $values.setValues({\n values: reorderPath(path, payload, $values.refValues.current),\n updateState: true\n });\n }, []);\n const removeListItem = useCallback((path, index) => {\n $status.clearFieldDirty(path);\n $errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));\n $values.setValues({\n values: removePath(path, index, $values.refValues.current),\n updateState: true\n });\n }, []);\n const insertListItem = useCallback((path, item, index) => {\n $status.clearFieldDirty(path);\n $errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));\n $values.setValues({\n values: insertPath(path, item, index, $values.refValues.current),\n updateState: true\n });\n }, []);\n const replaceListItem = useCallback((path, index, item) => {\n $status.clearFieldDirty(path);\n $values.setValues({\n values: replacePath(path, item, index, $values.refValues.current),\n updateState: true\n });\n }, []);\n return { reorderListItem, removeListItem, insertListItem, replaceListItem };\n}\n\nexport { useFormList };\n//# sourceMappingURL=use-form-list.mjs.map\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use client';\nfunction getStatus(status, path) {\n const paths = Object.keys(status);\n if (typeof path === \"string\") {\n const nestedPaths = paths.filter((statusPath) => statusPath.startsWith(`${path}.`));\n return status[path] || nestedPaths.some((statusPath) => status[statusPath]) || false;\n }\n return paths.some((statusPath) => status[statusPath]);\n}\n\nexport { getStatus };\n//# sourceMappingURL=get-status.mjs.map\n","'use client';\nimport { useState, useRef, useCallback } from 'react';\nimport isEqual from 'fast-deep-equal';\nimport { getStatus } from '../../get-status/get-status.mjs';\nimport { clearListState } from '../../lists/clear-list-state.mjs';\nimport { getPath } from '../../paths/get-path.mjs';\nimport 'klona/full';\n\nfunction useFormStatus({\n initialDirty,\n initialTouched,\n mode,\n $values\n}) {\n const [touchedState, setTouchedState] = useState(initialTouched);\n const [dirtyState, setDirtyState] = useState(initialDirty);\n const touchedRef = useRef(initialTouched);\n const dirtyRef = useRef(initialDirty);\n const setTouched = useCallback((values) => {\n const resolvedValues = typeof values === \"function\" ? values(touchedRef.current) : values;\n touchedRef.current = resolvedValues;\n if (mode === \"controlled\") {\n setTouchedState(resolvedValues);\n }\n }, []);\n const setDirty = useCallback(\n (values, forceUpdate = false) => {\n const resolvedValues = typeof values === \"function\" ? values(dirtyRef.current) : values;\n dirtyRef.current = resolvedValues;\n if (mode === \"controlled\" || forceUpdate) {\n setDirtyState(resolvedValues);\n }\n },\n []\n );\n const resetTouched = useCallback(() => setTouched({}), []);\n const resetDirty = useCallback((values) => {\n const newSnapshot = values ? { ...$values.refValues.current, ...values } : $values.refValues.current;\n $values.setValuesSnapshot(newSnapshot);\n setDirty({});\n }, []);\n const setFieldTouched = useCallback((path, touched) => {\n setTouched((currentTouched) => {\n if (getStatus(currentTouched, path) === touched) {\n return currentTouched;\n }\n return { ...currentTouched, [path]: touched };\n });\n }, []);\n const setFieldDirty = useCallback((path, dirty, forceUpdate) => {\n setDirty((currentDirty) => {\n if (getStatus(currentDirty, path) === dirty) {\n return currentDirty;\n }\n return { ...currentDirty, [path]: dirty };\n }, forceUpdate);\n }, []);\n const setCalculatedFieldDirty = useCallback((path, value) => {\n const currentDirty = getStatus(dirtyRef.current, path);\n const dirty = !isEqual(getPath(path, $values.getValuesSnapshot()), value);\n const clearedState = clearListState(path, dirtyRef.current);\n clearedState[path] = dirty;\n setDirty(clearedState, currentDirty !== dirty);\n }, []);\n const isTouched = useCallback(\n (path) => getStatus(touchedRef.current, path),\n []\n );\n const clearFieldDirty = useCallback(\n (path) => setDirty((current) => {\n if (typeof path !== \"string\") {\n return current;\n }\n const result = clearListState(path, current);\n delete result[path];\n if (isEqual(result, current)) {\n return current;\n }\n return result;\n }),\n []\n );\n const isDirty = useCallback((path) => {\n if (path) {\n const overriddenValue = getPath(path, dirtyRef.current);\n if (typeof overriddenValue === \"boolean\") {\n return overriddenValue;\n }\n const sliceOfValues = getPath(path, $values.refValues.current);\n const sliceOfInitialValues = getPath(path, $values.valuesSnapshot.current);\n return !isEqual(sliceOfValues, sliceOfInitialValues);\n }\n const isOverridden = Object.keys(dirtyRef.current).length > 0;\n if (isOverridden) {\n return getStatus(dirtyRef.current);\n }\n return !isEqual($values.refValues.current, $values.valuesSnapshot.current);\n }, []);\n const getDirty = useCallback(() => dirtyRef.current, []);\n const getTouched = useCallback(() => touchedRef.current, []);\n return {\n touchedState,\n dirtyState,\n touchedRef,\n dirtyRef,\n setTouched,\n setDirty,\n resetDirty,\n resetTouched,\n isTouched,\n setFieldTouched,\n setFieldDirty,\n setTouchedState,\n setDirtyState,\n clearFieldDirty,\n isDirty,\n getDirty,\n getTouched,\n setCalculatedFieldDirty\n };\n}\n\nexport { useFormStatus };\n//# sourceMappingURL=use-form-status.mjs.map\n","'use client';\nimport { useRef, useState, useCallback } from 'react';\nimport { getPath } from '../../paths/get-path.mjs';\nimport { setPath } from '../../paths/set-path.mjs';\n\nfunction useFormValues({\n initialValues,\n onValuesChange,\n mode\n}) {\n const initialized = useRef(false);\n const [stateValues, setStateValues] = useState(initialValues || {});\n const refValues = useRef(stateValues);\n const valuesSnapshot = useRef(stateValues);\n const setValues = useCallback(\n ({\n values,\n subscribers,\n updateState = true,\n mergeWithPreviousValues = true\n }) => {\n const previousValues = refValues.current;\n const resolvedValues = values instanceof Function ? values(refValues.current) : values;\n const updatedValues = mergeWithPreviousValues ? { ...previousValues, ...resolvedValues } : resolvedValues;\n refValues.current = updatedValues;\n updateState && setStateValues(updatedValues);\n onValuesChange?.(updatedValues, previousValues);\n subscribers?.filter(Boolean).forEach((subscriber) => subscriber({ updatedValues, previousValues }));\n },\n [onValuesChange]\n );\n const setFieldValue = useCallback(\n (payload) => {\n const currentValue = getPath(payload.path, refValues.current);\n const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;\n if (currentValue !== updatedValue) {\n const previousValues = refValues.current;\n const updatedValues = setPath(payload.path, updatedValue, refValues.current);\n setValues({ values: updatedValues, updateState: payload.updateState });\n payload.subscribers?.filter(Boolean).forEach(\n (subscriber) => subscriber({ path: payload.path, updatedValues, previousValues })\n );\n }\n },\n [setValues]\n );\n const setValuesSnapshot = useCallback((payload) => {\n valuesSnapshot.current = payload;\n }, []);\n const initialize = useCallback(\n (values, onInitialize) => {\n if (!initialized.current) {\n initialized.current = true;\n setValues({ values, updateState: mode === \"controlled\" });\n setValuesSnapshot(values);\n onInitialize();\n }\n },\n [setValues]\n );\n const resetValues = useCallback(() => {\n setValues({\n values: valuesSnapshot.current,\n updateState: true,\n mergeWithPreviousValues: false\n });\n }, [setValues]);\n const getValues = useCallback(() => refValues.current, []);\n const getValuesSnapshot = useCallback(() => valuesSnapshot.current, []);\n return {\n initialized,\n stateValues,\n refValues,\n valuesSnapshot,\n setValues,\n setFieldValue,\n resetValues,\n setValuesSnapshot,\n initialize,\n getValues,\n getValuesSnapshot\n };\n}\n\nexport { useFormValues };\n//# sourceMappingURL=use-form-values.mjs.map\n","'use client';\nimport { useRef, useCallback, useEffect } from 'react';\nimport { getPath } from '../../paths/get-path.mjs';\nimport 'klona/full';\n\nfunction useFormWatch({\n $status\n}) {\n const subscribers = useRef(\n {}\n );\n const watch = useCallback((path, callback) => {\n useEffect(() => {\n subscribers.current[path] = subscribers.current[path] || [];\n subscribers.current[path].push(callback);\n return () => {\n subscribers.current[path] = subscribers.current[path].filter((cb) => cb !== callback);\n };\n }, [callback]);\n }, []);\n const getFieldSubscribers = useCallback((path) => {\n if (!subscribers.current[path]) {\n return [];\n }\n return subscribers.current[path].map(\n (callback) => (input) => callback({\n previousValue: getPath(path, input.previousValues),\n value: getPath(path, input.updatedValues),\n touched: $status.isTouched(path),\n dirty: $status.isDirty(path)\n })\n );\n }, []);\n return {\n subscribers,\n watch,\n getFieldSubscribers\n };\n}\n\nexport { useFormWatch };\n//# sourceMappingURL=use-form-watch.mjs.map\n","'use client';\nfunction getDataPath(formName, fieldPath) {\n return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();\n}\n\nexport { getDataPath };\n//# sourceMappingURL=get-data-path.mjs.map\n","'use client';\nimport { filterErrors } from '../hooks/use-form-errors/filter-errors/filter-errors.mjs';\nimport { getPath } from '../paths/get-path.mjs';\nimport 'klona/full';\n\nconst formRootRule = Symbol(\"root-rule\");\nfunction getValidationResults(errors) {\n const filteredErrors = filterErrors(errors);\n return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };\n}\nfunction validateRulesRecord(rules, values, path = \"\", errors = {}) {\n if (typeof rules !== \"object\" || rules === null) {\n return errors;\n }\n return Object.keys(rules).reduce((acc, ruleKey) => {\n const rule = rules[ruleKey];\n const rulePath = `${path === \"\" ? \"\" : `${path}.`}${ruleKey}`;\n const value = getPath(rulePath, values);\n let arrayValidation = false;\n if (typeof rule === \"function\") {\n acc[rulePath] = rule(value, values, rulePath);\n }\n if (typeof rule === \"object\" && Array.isArray(value)) {\n arrayValidation = true;\n value.forEach(\n (_item, index) => validateRulesRecord(rule, values, `${rulePath}.${index}`, acc)\n );\n if (formRootRule in rule) {\n acc[rulePath] = rule[formRootRule](value, values, rulePath);\n }\n }\n if (typeof rule === \"object\" && typeof value === \"object\" && value !== null) {\n if (!arrayValidation) {\n validateRulesRecord(rule, values, rulePath, acc);\n }\n if (formRootRule in rule) {\n acc[rulePath] = rule[formRootRule](value, values, rulePath);\n }\n }\n return acc;\n }, errors);\n}\nfunction validateValues(validate, values) {\n if (typeof validate === \"function\") {\n return getValidationResults(validate(values));\n }\n return getValidationResults(validateRulesRecord(validate, values));\n}\n\nexport { formRootRule, validateValues };\n//# sourceMappingURL=validate-values.mjs.map\n","'use client';\nimport { validateValues } from './validate-values.mjs';\n\nfunction validateFieldValue(path, rules, values) {\n if (typeof path !== \"string\") {\n return { hasError: false, error: null };\n }\n const results = validateValues(rules, values);\n const pathInError = Object.keys(results.errors).find(\n (errorKey) => path.split(\".\").every((pathPart, i) => pathPart === errorKey.split(\".\")[i])\n );\n return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };\n}\n\nexport { validateFieldValue };\n//# sourceMappingURL=validate-field-value.mjs.map\n","'use client';\nconst FORM_INDEX = \"__MANTINE_FORM_INDEX__\";\n\nexport { FORM_INDEX };\n//# sourceMappingURL=form-index.mjs.map\n","'use client';\nimport { FORM_INDEX } from '../form-index.mjs';\n\nfunction shouldValidateOnChange(path, validateInputOnChange) {\n if (!validateInputOnChange) {\n return false;\n }\n if (typeof validateInputOnChange === \"boolean\") {\n return validateInputOnChange;\n }\n if (Array.isArray(validateInputOnChange)) {\n return validateInputOnChange.includes(path.replace(/[.][0-9]+/g, `.${FORM_INDEX}`));\n }\n return false;\n}\n\nexport { shouldValidateOnChange };\n//# sourceMappingURL=should-validate-on-change.mjs.map\n","'use client';\nimport { useState, useCallback } from 'react';\nimport { useFormActions } from './actions/actions.mjs';\nimport { getInputOnChange } from './get-input-on-change/get-input-on-change.mjs';\nimport { useFormErrors } from './hooks/use-form-errors/use-form-errors.mjs';\nimport { useFormList } from './hooks/use-form-list/use-form-list.mjs';\nimport { useFormStatus } from './hooks/use-form-status/use-form-status.mjs';\nimport { useFormValues } from './hooks/use-form-values/use-form-values.mjs';\nimport { useFormWatch } from './hooks/use-form-watch/use-form-watch.mjs';\nimport { getPath } from './paths/get-path.mjs';\nimport 'klona/full';\nimport { getDataPath } from './paths/get-data-path.mjs';\nimport { validateValues } from './validate/validate-values.mjs';\nimport { validateFieldValue } from './validate/validate-field-value.mjs';\nimport { shouldValidateOnChange } from './validate/should-validate-on-change.mjs';\n\nfunction useForm({\n name,\n mode = \"controlled\",\n initialValues,\n initialErrors = {},\n initialDirty = {},\n initialTouched = {},\n clearInputErrorOnChange = true,\n validateInputOnChange = false,\n validateInputOnBlur = false,\n onValuesChange,\n transformValues = (values) => values,\n enhanceGetInputProps,\n validate: rules,\n onSubmitPreventDefault = \"always\",\n touchTrigger = \"change\"\n} = {}) {\n const $errors = useFormErrors(initialErrors);\n const $values = useFormValues({ initialValues, onValuesChange, mode });\n const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });\n const $list = useFormList({ $values, $errors, $status });\n const $watch = useFormWatch({ $status });\n const [formKey, setFormKey] = useState(0);\n const [fieldKeys, setFieldKeys] = useState({});\n const [submitting, setSubmitting] = useState(false);\n const reset = useCallback(() => {\n $values.resetValues();\n $errors.clearErrors();\n $status.resetDirty();\n $status.resetTouched();\n mode === \"uncontrolled\" && setFormKey((key2) => key2 + 1);\n }, []);\n const handleValuesChanges = useCallback(\n (previousValues) => {\n clearInputErrorOnChange && $errors.clearErrors();\n mode === \"uncontrolled\" && setFormKey((key2) => key2 + 1);\n Object.keys($watch.subscribers.current).forEach((path) => {\n const value = getPath(path, $values.refValues.current);\n const previousValue = getPath(path, previousValues);\n if (value !== previousValue) {\n $watch.getFieldSubscribers(path).forEach((cb) => cb({ previousValues, updatedValues: $values.refValues.current }));\n }\n });\n },\n [clearInputErrorOnChange]\n );\n const initialize = useCallback(\n (values) => {\n const previousValues = $values.refValues.current;\n $values.initialize(values, () => mode === \"uncontrolled\" && setFormKey((key2) => key2 + 1));\n handleValuesChanges(previousValues);\n },\n [handleValuesChanges]\n );\n const setFieldValue = useCallback(\n (path, value, options) => {\n const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);\n const resolvedValue = value instanceof Function ? value(getPath(path, $values.refValues.current)) : value;\n $status.setCalculatedFieldDirty(path, resolvedValue);\n touchTrigger === \"change\" && $status.setFieldTouched(path, true);\n !shouldValidate && clearInputErrorOnChange && $errors.clearFieldError(path);\n $values.setFieldValue({\n path,\n value,\n updateState: mode === \"controlled\",\n subscribers: [\n ...$watch.getFieldSubscribers(path),\n shouldValidate ? (payload) => {\n const validationResults = validateFieldValue(path, rules, payload.updatedValues);\n validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);\n } : null,\n options?.forceUpdate !== false && mode !== \"controlled\" ? () => setFieldKeys((keys) => ({\n ...keys,\n [path]: (keys[path] || 0) + 1\n })) : null\n ]\n });\n },\n [onValuesChange, rules]\n );\n const setValues = useCallback(\n (values) => {\n const previousValues = $values.refValues.current;\n $values.setValues({ values, updateState: mode === \"controlled\" });\n handleValuesChanges(previousValues);\n },\n [onValuesChange, handleValuesChanges]\n );\n const validate = useCallback(() => {\n const results = validateValues(rules, $values.refValues.current);\n $errors.setErrors(results.errors);\n return results;\n }, [rules]);\n const validateField = useCallback(\n (path) => {\n const results = validateFieldValue(path, rules, $values.refValues.current);\n results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);\n return results;\n },\n [rules]\n );\n const getInputProps = (path, { type = \"input\", withError = true, withFocus = true, ...otherOptions } = {}) => {\n const onChange = getInputOnChange(\n (value) => setFieldValue(path, value, { forceUpdate: false })\n );\n const payload = { onChange, \"data-path\": getDataPath(name, path) };\n if (withError) {\n payload.error = $errors.errorsState[path];\n }\n if (type === \"checkbox\") {\n payload[mode === \"controlled\" ? \"checked\" : \"defaultChecked\"] = getPath(\n path,\n $values.refValues.current\n );\n } else {\n payload[mode === \"controlled\" ? \"value\" : \"defaultValue\"] = getPath(\n path,\n $values.refValues.current\n );\n }\n if (withFocus) {\n payload.onFocus = () => $status.setFieldTouched(path, true);\n payload.onBlur = () => {\n if (shouldValidateOnChange(path, validateInputOnBlur)) {\n const validationResults = validateFieldValue(path, rules, $values.refValues.current);\n validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);\n }\n };\n }\n return Object.assign(\n payload,\n enhanceGetInputProps?.({\n inputProps: payload,\n field: path,\n options: { type, withError, withFocus, ...otherOptions },\n form\n })\n );\n };\n const onSubmit = (handleSubmit, handleValidationFailure) => (event) => {\n if (onSubmitPreventDefault === \"always\") {\n event?.preventDefault();\n }\n const results = validate();\n if (results.hasErrors) {\n if (onSubmitPreventDefault === \"validation-failed\") {\n event?.preventDefault();\n }\n handleValidationFailure?.(results.errors, $values.refValues.current, event);\n } else {\n const submitResult = handleSubmit?.(\n transformValues($values.refValues.current),\n event\n );\n if (submitResult instanceof Promise) {\n setSubmitting(true);\n submitResult.finally(() => setSubmitting(false));\n }\n }\n };\n const getTransformedValues = (input) => transformValues(input || $values.refValues.current);\n const onReset = useCallback((event) => {\n event.preventDefault();\n reset();\n }, []);\n const isValid = useCallback(\n (path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,\n [rules]\n );\n const key = (path) => `${formKey}-${path}-${fieldKeys[path] || 0}`;\n const getInputNode = useCallback(\n (path) => document.querySelector(`[data-path=\"${getDataPath(name, path)}\"]`),\n []\n );\n const form = {\n watch: $watch.watch,\n initialized: $values.initialized.current,\n values: $values.stateValues,\n getValues: $values.getValues,\n setInitialValues: $values.setValuesSnapshot,\n initialize,\n setValues,\n setFieldValue,\n submitting,\n setSubmitting,\n errors: $errors.errorsState,\n setErrors: $errors.setErrors,\n setFieldError: $errors.setFieldError,\n clearFieldError: $errors.clearFieldError,\n clearErrors: $errors.clearErrors,\n resetDirty: $status.resetDirty,\n setTouched: $status.setTouched,\n setDirty: $status.setDirty,\n isTouched: $status.isTouched,\n resetTouched: $status.resetTouched,\n isDirty: $status.isDirty,\n getTouched: $status.getTouched,\n getDirty: $status.getDirty,\n reorderListItem: $list.reorderListItem,\n insertListItem: $list.insertListItem,\n removeListItem: $list.removeListItem,\n replaceListItem: $list.replaceListItem,\n reset,\n validate,\n validateField,\n getInputProps,\n onSubmit,\n onReset,\n isValid,\n getTransformedValues,\n key,\n getInputNode\n };\n useFormActions(name, form);\n return form;\n}\n\nexport { useForm };\n//# sourceMappingURL=use-form.mjs.map\n","var COMPLETE = 'complete',\n CANCELED = 'canceled';\n\nfunction raf(task){\n if('requestAnimationFrame' in window){\n return window.requestAnimationFrame(task);\n }\n\n setTimeout(task, 16);\n}\n\nfunction setElementScroll(element, x, y){\n Math.max(0, x);\n Math.max(0, y);\n\n if(element.self === element){\n element.scrollTo(x, y);\n }else{\n element.scrollLeft = x;\n element.scrollTop = y;\n }\n}\n\nfunction getTargetScrollLocation(scrollSettings, parent){\n var align = scrollSettings.align,\n target = scrollSettings.target,\n targetPosition = target.getBoundingClientRect(),\n parentPosition,\n x,\n y,\n differenceX,\n differenceY,\n targetWidth,\n targetHeight,\n leftAlign = align && align.left != null ? align.left : 0.5,\n topAlign = align && align.top != null ? align.top : 0.5,\n leftOffset = align && align.leftOffset != null ? align.leftOffset : 0,\n topOffset = align && align.topOffset != null ? align.topOffset : 0,\n leftScalar = leftAlign,\n topScalar = topAlign;\n\n if(scrollSettings.isWindow(parent)){\n targetWidth = Math.min(targetPosition.width, parent.innerWidth);\n targetHeight = Math.min(targetPosition.height, parent.innerHeight);\n x = targetPosition.left + parent.pageXOffset - parent.innerWidth * leftScalar + targetWidth * leftScalar;\n y = targetPosition.top + parent.pageYOffset - parent.innerHeight * topScalar + targetHeight * topScalar;\n x -= leftOffset;\n y -= topOffset;\n x = scrollSettings.align.lockX ? parent.pageXOffset : x;\n y = scrollSettings.align.lockY ? parent.pageYOffset : y;\n differenceX = x - parent.pageXOffset;\n differenceY = y - parent.pageYOffset;\n }else{\n targetWidth = targetPosition.width;\n targetHeight = targetPosition.height;\n parentPosition = parent.getBoundingClientRect();\n var offsetLeft = targetPosition.left - (parentPosition.left - parent.scrollLeft);\n var offsetTop = targetPosition.top - (parentPosition.top - parent.scrollTop);\n x = offsetLeft + (targetWidth * leftScalar) - parent.clientWidth * leftScalar;\n y = offsetTop + (targetHeight * topScalar) - parent.clientHeight * topScalar;\n x -= leftOffset;\n y -= topOffset;\n x = Math.max(Math.min(x, parent.scrollWidth - parent.clientWidth), 0);\n y = Math.max(Math.min(y, parent.scrollHeight - parent.clientHeight), 0);\n x = scrollSettings.align.lockX ? parent.scrollLeft : x;\n y = scrollSettings.align.lockY ? parent.scrollTop : y;\n differenceX = x - parent.scrollLeft;\n differenceY = y - parent.scrollTop;\n }\n\n return {\n x: x,\n y: y,\n differenceX: differenceX,\n differenceY: differenceY\n };\n}\n\nfunction animate(parent){\n var scrollSettings = parent._scrollSettings;\n\n if(!scrollSettings){\n return;\n }\n\n var maxSynchronousAlignments = scrollSettings.maxSynchronousAlignments;\n\n var location = getTargetScrollLocation(scrollSettings, parent),\n time = Date.now() - scrollSettings.startTime,\n timeValue = Math.min(1 / scrollSettings.time * time, 1);\n\n if(scrollSettings.endIterations >= maxSynchronousAlignments){\n setElementScroll(parent, location.x, location.y);\n parent._scrollSettings = null;\n return scrollSettings.end(COMPLETE);\n }\n\n var easeValue = 1 - scrollSettings.ease(timeValue);\n\n setElementScroll(parent,\n location.x - location.differenceX * easeValue,\n location.y - location.differenceY * easeValue\n );\n\n if(time >= scrollSettings.time){\n scrollSettings.endIterations++;\n // Align ancestor synchronously\n scrollSettings.scrollAncestor && animate(scrollSettings.scrollAncestor);\n animate(parent);\n return;\n }\n\n raf(animate.bind(null, parent));\n}\n\nfunction defaultIsWindow(target){\n return target.self === target\n}\n\nfunction transitionScrollTo(target, parent, settings, scrollAncestor, callback){\n var idle = !parent._scrollSettings,\n lastSettings = parent._scrollSettings,\n now = Date.now(),\n cancelHandler,\n passiveOptions = { passive: true };\n\n if(lastSettings){\n lastSettings.end(CANCELED);\n }\n\n function end(endType){\n parent._scrollSettings = null;\n\n if(parent.parentElement && parent.parentElement._scrollSettings){\n parent.parentElement._scrollSettings.end(endType);\n }\n\n if(settings.debug){\n console.log('Scrolling ended with type', endType, 'for', parent)\n }\n\n callback(endType);\n if(cancelHandler){\n parent.removeEventListener('touchstart', cancelHandler, passiveOptions);\n parent.removeEventListener('wheel', cancelHandler, passiveOptions);\n }\n }\n\n var maxSynchronousAlignments = settings.maxSynchronousAlignments;\n\n if(maxSynchronousAlignments == null){\n maxSynchronousAlignments = 3;\n }\n\n parent._scrollSettings = {\n startTime: now,\n endIterations: 0,\n target: target,\n time: settings.time,\n ease: settings.ease,\n align: settings.align,\n isWindow: settings.isWindow || defaultIsWindow,\n maxSynchronousAlignments: maxSynchronousAlignments,\n end: end,\n scrollAncestor\n };\n\n if(!('cancellable' in settings) || settings.cancellable){\n cancelHandler = end.bind(null, CANCELED);\n parent.addEventListener('touchstart', cancelHandler, passiveOptions);\n parent.addEventListener('wheel', cancelHandler, passiveOptions);\n }\n\n if(idle){\n animate(parent);\n }\n\n return cancelHandler\n}\n\nfunction defaultIsScrollable(element){\n return (\n 'pageXOffset' in element ||\n (\n element.scrollHeight !== element.clientHeight ||\n element.scrollWidth !== element.clientWidth\n ) &&\n getComputedStyle(element).overflow !== 'hidden'\n );\n}\n\nfunction defaultValidTarget(){\n return true;\n}\n\nfunction findParentElement(el){\n if (el.assignedSlot) {\n return findParentElement(el.assignedSlot);\n }\n\n if (el.parentElement) {\n if(el.parentElement.tagName.toLowerCase() === 'body'){\n return el.parentElement.ownerDocument.defaultView || el.parentElement.ownerDocument.ownerWindow;\n }\n return el.parentElement;\n }\n\n if (el.getRootNode){\n var parent = el.getRootNode()\n if(parent.nodeType === 11) {\n return parent.host;\n }\n }\n}\n\nmodule.exports = function(target, settings, callback){\n if(!target){\n return;\n }\n\n if(typeof settings === 'function'){\n callback = settings;\n settings = null;\n }\n\n if(!settings){\n settings = {};\n }\n\n settings.time = isNaN(settings.time) ? 1000 : settings.time;\n settings.ease = settings.ease || function(v){return 1 - Math.pow(1 - v, v / 2);};\n settings.align = settings.align || {};\n\n var parent = findParentElement(target),\n parents = 1;\n\n function done(endType){\n parents--;\n if(!parents){\n callback && callback(endType);\n }\n }\n\n var validTarget = settings.validTarget || defaultValidTarget;\n var isScrollable = settings.isScrollable;\n\n if(settings.debug){\n console.log('About to scroll to', target)\n\n if(!parent){\n console.error('Target did not have a parent, is it mounted in the DOM?')\n }\n }\n\n var scrollingElements = [];\n\n while(parent){\n if(settings.debug){\n console.log('Scrolling parent node', parent)\n }\n\n if(validTarget(parent, parents) && (isScrollable ? isScrollable(parent, defaultIsScrollable) : defaultIsScrollable(parent))){\n parents++;\n scrollingElements.push(parent);\n }\n\n parent = findParentElement(parent);\n\n if(!parent){\n done(COMPLETE)\n break;\n }\n }\n\n return scrollingElements.reduce((cancel, parent, index) => transitionScrollTo(target, parent, settings, scrollingElements[index + 1], done), null);\n};\n","export const sentencify = (message: string): string => {\n if (!message) {\n return \"\";\n }\n if (message.endsWith(\".\")) {\n return message;\n }\n return `${message}.`;\n};\n","import { type Errors } from \"@inertiajs/core\";\nimport {\n type Method,\n type PathHelper,\n type ResponseError,\n} from \"@js-from-routes/client\";\nimport {\n useForm as useMantineForm,\n type UseFormInput,\n type UseFormReturnType,\n} from \"@mantine/form\";\nimport { type _TransformValues, type LooseKeys } from \"@mantine/form/lib/types\";\nimport { type FormEvent } from \"react\";\nimport scrollIntoView from \"scroll-into-view\";\nimport { toast } from \"sonner\";\n\nimport { sentencify } from \"./inflect\";\n\nexport const showFormErrorsAlert = <\n Values,\n TransformValues extends _TransformValues,\n>(\n form: Pick<\n UseFormReturnType,\n \"errors\" | \"getInputNode\"\n >,\n title: string,\n): void => {\n let firstErrorMessage = first(Object.values(form.errors));\n if (typeof firstErrorMessage === \"string\") {\n firstErrorMessage = sentencify(firstErrorMessage);\n }\n toast.error(title, {\n description: firstErrorMessage ?? \"An unknown error occurred.\",\n });\n const firstErrorPath = first(Object.keys(form.errors));\n if (firstErrorPath) {\n const input = form.getInputNode(firstErrorPath);\n if (input) {\n input.focus();\n scrollIntoView(input, {\n align: { top: 0, topOffset: calculateHeaderHeight() },\n });\n }\n }\n};\n\nexport const setFormErrorsAndShowAlert = <\n Values,\n TransformValues extends _TransformValues,\n>(\n form: Pick<\n UseFormReturnType,\n \"errors\" | \"setErrors\" | \"getInputNode\"\n >,\n errors: Errors,\n title: string,\n): void => {\n form.setErrors(errors);\n showFormErrorsAlert({ ...form, errors }, title);\n};\n\nconst calculateHeaderHeight = (): number => {\n const header = first(document.getElementsByTagName(\"header\"));\n return header ? header.clientHeight : 0;\n};\n\nexport const useFieldsFilled = (\n values: Values,\n ...fields: LooseKeys[]\n): boolean => {\n const checkFields = useCallback(\n (values: Values, fields: LooseKeys[]) => {\n const fieldsToCheck = isEmpty(fields) ? Object.keys(values) : fields;\n return fieldsToCheck.every(field => isFilledValue(get(values, field)));\n },\n [],\n );\n const [filled, setFilled] = useState(() => checkFields(values, fields));\n const firstRenderRef = useRef(true);\n useShallowEffect(() => {\n if (firstRenderRef.current) {\n firstRenderRef.current = false;\n } else {\n setFilled(checkFields(values, fields));\n }\n }, [values, fields, checkFields]);\n return filled;\n};\n\nexport const isFilledValue = (value: any): boolean => {\n switch (typeof value) {\n case \"string\":\n return value !== \"\";\n case \"number\":\n return Number.isFinite(value);\n default:\n return !!value;\n }\n};\n\ntype PartialFormHelper<\n Values,\n TransformValues extends (values: Values) => unknown,\n> = Omit, \"onSubmit\" | \"onReset\">;\n\nexport interface FormOptions<\n Data extends Record & { error?: never },\n Values,\n TransformValues extends (values: Values) => unknown,\n> extends UseFormInput {\n action: PathHelper;\n descriptor: string;\n params?: {\n query?: Record;\n [key: string]: any;\n };\n method?: Method;\n failSilently?: boolean;\n onSubmit?: (\n transformedValues: ReturnType,\n // submission: Promise,\n form: PartialFormHelper,\n ) => void;\n onSuccess?: (\n data: Data,\n form: PartialFormHelper,\n ) => void;\n onFailure?: (\n error: Error,\n form: PartialFormHelper,\n ) => void;\n onError?: (form: PartialFormHelper) => void;\n}\n\nexport interface FormHelper<\n Data,\n Values,\n TransformValues extends (values: Values) => unknown,\n> extends Omit<\n UseFormReturnType,\n \"setSubmitting\" | \"onSubmit\"\n > {\n data: Data | undefined;\n error: Error | undefined;\n submit: (event?: FormEvent) => void;\n}\n\nconst NO_BODY_METHODS: Method[] = [\n \"get\",\n \"GET\",\n \"delete\",\n \"DELETE\",\n \"head\",\n \"HEAD\",\n \"options\",\n \"OPTIONS\",\n];\n\nexport const useForm = <\n Data extends Record & { error?: never; errors?: never } = {},\n Values extends Record = {},\n TransformValues extends _TransformValues = (values: Values) => Values,\n>(\n options: FormOptions,\n): FormHelper => {\n const {\n action,\n method = action.httpMethod,\n descriptor,\n failSilently,\n onSubmit,\n onError,\n onFailure,\n onSuccess,\n params,\n transformValues,\n ...otherOptions\n } = options;\n const form = useMantineForm({\n ...otherOptions,\n transformValues,\n });\n const [data, setData] = useState();\n const [error, setError] = useState();\n const submit = form.onSubmit(\n transformedValues => {\n form.setSubmitting(true);\n onSubmit?.(transformedValues, form);\n action }>({\n params,\n method,\n data: NO_BODY_METHODS.includes(method) ? undefined : transformedValues,\n })\n .then(\n data => {\n setData(data);\n onSuccess?.(data, form);\n return data;\n },\n (responseError: ResponseError) => {\n if (responseError.body) {\n const body = responseError.body as {\n error?: string;\n errors?: Record;\n };\n if (typeof body.error === \"string\") {\n const error = new Error(body.error);\n setError(error);\n console.error(`failed to ${descriptor}`, error);\n if (!failSilently) {\n toast.error(`failed to ${descriptor}`, {\n description: sentencify(\n error.message || \"an unknown error occurred\",\n ),\n });\n }\n onFailure?.(error, form);\n } else if (typeof body.errors === \"object\") {\n const { errors } = body;\n form.setErrors(errors);\n console.warn(`couldn't ${descriptor}`, errors);\n const formWithErrors = { ...form, errors };\n if (!failSilently) {\n showFormErrorsAlert(formWithErrors, `couldn't ${descriptor}`);\n }\n onError?.(formWithErrors);\n }\n } else {\n console.error(\"unknown error response\", responseError);\n if (!failSilently) {\n toast.error(`failed to ${descriptor}`, {\n description: sentencify(\n responseError.message || \"an unknown error occurred\",\n ),\n });\n }\n onFailure?.(responseError, form);\n }\n throw responseError;\n },\n )\n .finally(() => {\n form.setSubmitting(false);\n });\n },\n errors => {\n const formWithErrors = { ...form, errors };\n onError?.(formWithErrors);\n showFormErrorsAlert(formWithErrors, `couldn't ${descriptor}`);\n },\n );\n return {\n ...form,\n submit,\n data,\n error,\n };\n};\n"],"names":["head","array","validateFormName","name","useIsomorphicEffect","useLayoutEffect","useEffect","useFormEvent","eventKey","handler","useFormActions","form","event","getInputOnChange","setValue","val","currentTarget","filterErrors","errors","acc","key","errorValue","useFormErrors","initialErrors","errorsState","setErrorsState","useState","errorsRef","useRef","setErrors","useCallback","current","newErrors","clearErrors","clearFieldError","path","setFieldError","error","clearListState","field","state","clone","errorKey","getIndexFromKeyAfterPath","split","changeErrorIndices","index","change","pathString","clearedErrors","cloned","changedKeys","currIndex","value","newKey","reorderErrors","from","to","oldKeyStart","newKeyStart","oldKey","value1","value2","set","obj","klona","x","i","k","list","tmp","str","getSplittedPath","getPath","values","splittedPath","setPath","reorderPath","currentValue","item","insertPath","removePath","_","itemIndex","replacePath","useFormList","$values","$errors","$status","reorderListItem","payload","errs","removeListItem","insertListItem","replaceListItem","fastDeepEqual","equal","a","b","length","keys","getStatus","status","paths","nestedPaths","statusPath","useFormStatus","initialDirty","initialTouched","mode","touchedState","setTouchedState","dirtyState","setDirtyState","touchedRef","dirtyRef","setTouched","resolvedValues","setDirty","forceUpdate","resetTouched","resetDirty","newSnapshot","setFieldTouched","touched","currentTouched","setFieldDirty","dirty","currentDirty","setCalculatedFieldDirty","isEqual","clearedState","isTouched","clearFieldDirty","result","isDirty","overriddenValue","sliceOfValues","sliceOfInitialValues","getDirty","getTouched","useFormValues","initialValues","onValuesChange","initialized","stateValues","setStateValues","refValues","valuesSnapshot","setValues","subscribers","updateState","mergeWithPreviousValues","previousValues","updatedValues","subscriber","setFieldValue","updatedValue","_a","setValuesSnapshot","initialize","onInitialize","resetValues","getValues","getValuesSnapshot","useFormWatch","watch","callback","cb","getFieldSubscribers","input","getDataPath","formName","fieldPath","formRootRule","getValidationResults","filteredErrors","validateRulesRecord","rules","ruleKey","rule","rulePath","arrayValidation","_item","validateValues","validate","validateFieldValue","results","pathInError","pathPart","FORM_INDEX","shouldValidateOnChange","validateInputOnChange","useForm","clearInputErrorOnChange","validateInputOnBlur","transformValues","enhanceGetInputProps","onSubmitPreventDefault","touchTrigger","$list","$watch","formKey","setFormKey","fieldKeys","setFieldKeys","submitting","setSubmitting","reset","key2","handleValuesChanges","previousValue","options","shouldValidate","resolvedValue","validationResults","validateField","getInputProps","type","withError","withFocus","otherOptions","onSubmit","handleSubmit","handleValidationFailure","submitResult","getTransformedValues","onReset","isValid","getInputNode","COMPLETE","CANCELED","raf","task","setElementScroll","element","y","getTargetScrollLocation","scrollSettings","parent","align","target","targetPosition","parentPosition","differenceX","differenceY","targetWidth","targetHeight","leftAlign","topAlign","leftOffset","topOffset","leftScalar","topScalar","offsetLeft","offsetTop","animate","maxSynchronousAlignments","location","time","timeValue","easeValue","defaultIsWindow","transitionScrollTo","settings","scrollAncestor","idle","lastSettings","now","cancelHandler","passiveOptions","end","endType","defaultIsScrollable","defaultValidTarget","findParentElement","el","scrollIntoView","v","parents","done","validTarget","isScrollable","scrollingElements","cancel","sentencify","message","showFormErrorsAlert","title","firstErrorMessage","first","Object","toast","description","firstErrorPath","focus","top","calculateHeaderHeight","header","document","getElementsByTagName","clientHeight","useFieldsFilled","fields","checkFields","isEmpty","every","isFilledValue","get","filled","setFilled","firstRenderRef","useShallowEffect","Number","isFinite","NO_BODY_METHODS","action","method","httpMethod","descriptor","failSilently","onError","onFailure","onSuccess","params","useMantineForm","data","setData","setError","submit","transformedValues","includes","undefined","then","responseError","body","Error","console","warn","formWithErrors","finally"],"mappings":"yJAkBA,SAASA,EAAKC,EAAO,CACnB,OAAQ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