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Bd,EACpCgB,EAAAF,EAAO,IAAM,EAAE,CAC1C,EAaEmB,WAXc,eAAwBnB,EAAAA,UAAAA,MAAAA,CAAAA,GAAAA,KAAAA,IAAAA,SAAAA,CAAAA,EAAAA,CAAAA,SAAAA,CAAAA,EAAAA,CAA4Bd,EAClEgB,EAAyBF,EAAO,GAC9BL,EAActN,KAAA,CAAM,EAAG2N,EAAMV,QAAA,GAAWQ,KAAK,EAEjD,EAQE7I,YAAaiJ,CACf","sources":["webpack://_N_E/./node_modules/fast-deep-equal/index.js","webpack://_N_E/../../components/TextInput/TextInput.tsx","webpack://_N_E/../../src/actions/actions.ts","webpack://_N_E/../../src/get-input-on-change/get-input-on-change.ts","webpack://_N_E/../../../../src/hooks/use-form-errors/filter-errors/filter-errors.ts","webpack://_N_E/../../hooks/use-form-errors/use-form-errors.ts","webpack://_N_E/../../src/lists/clear-list-state.ts","webpack://_N_E/../../src/lists/change-error-indices.ts","webpack://_N_E/../../src/lists/reorder-errors.ts","webpack://_N_E/../../src/paths/get-splitted-path.ts","webpack://_N_E/../../src/paths/get-path.ts","webpack://_N_E/./node_modules/klona/full/index.mjs","webpack://_N_E/../../src/paths/set-path.ts","webpack://_N_E/../../src/paths/reorder-path.ts","webpack://_N_E/../../src/paths/insert-path.ts","webpack://_N_E/../../src/paths/remove-path.ts","webpack://_N_E/../../src/paths/replace-path.ts","webpack://_N_E/../../hooks/use-form-list/use-form-list.ts","webpack://_N_E/../../src/get-status/get-status.ts","webpack://_N_E/../../hooks/use-form-status/use-form-status.ts","webpack://_N_E/../../hooks/use-form-values/use-form-values.ts","webpack://_N_E/../../hooks/use-form-watch/use-form-watch.ts","webpack://_N_E/../../src/paths/get-data-path.ts","webpack://_N_E/../../src/validate/validate-values.ts","webpack://_N_E/../../src/validate/validate-field-value.ts","webpack://_N_E/../src/form-index.ts","webpack://_N_E/../../src/validate/should-validate-on-change.ts","webpack://_N_E/../src/use-form.ts","webpack://_N_E/../src/store.ts","webpack://_N_E/../src/notifications.store.ts"],"sourcesContent":["'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","import { BoxProps, ElementProps, factory, Factory, StylesApiProps, useProps } from '../../core';\nimport { __BaseInputProps, __InputStylesNames, InputVariant } from '../Input';\nimport { InputBase } from '../InputBase';\n\nexport interface TextInputProps\n extends BoxProps,\n __BaseInputProps,\n StylesApiProps,\n ElementProps<'input', 'size'> {}\n\nexport type TextInputFactory = Factory<{\n props: TextInputProps;\n variant: InputVariant;\n ref: HTMLInputElement;\n stylesNames: __InputStylesNames;\n}>;\n\nconst defaultProps: Partial = {};\n\nexport const TextInput = factory((props, ref) => {\n const _props = useProps('TextInput', defaultProps, props);\n\n return ;\n});\n\nTextInput.classes = InputBase.classes;\nTextInput.displayName = '@mantine/core/TextInput';\n","import { useEffect, useLayoutEffect } from 'react';\nimport type {\n _TransformValues,\n ClearErrors,\n ClearFieldError,\n InsertListItem,\n RemoveListItem,\n ReorderListItem,\n Reset,\n ResetDirty,\n ResetStatus,\n SetErrors,\n SetFieldError,\n SetFieldValue,\n SetFormStatus,\n SetInitialValues,\n SetValues,\n UseFormReturnType,\n ValidateField,\n} from '../types';\n\nfunction dispatchEvent(type: string, detail?: any): any {\n window.dispatchEvent(new CustomEvent(type, { detail }));\n}\n\nfunction validateFormName(name: string) {\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}\n\nexport const useIsomorphicEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport function createFormActions = Record>(\n name: string\n) {\n validateFormName(name);\n\n const setFieldValue: SetFieldValue = (path, value) =>\n dispatchEvent(`mantine-form:${name}:set-field-value`, { path, value });\n\n const setValues: SetValues = (values) =>\n dispatchEvent(`mantine-form:${name}:set-values`, values);\n\n const setInitialValues: SetInitialValues = (values) =>\n dispatchEvent(`mantine-form:${name}:set-initial-values`, values);\n\n const setErrors: SetErrors = (errors) => dispatchEvent(`mantine-form:${name}:set-errors`, errors);\n\n const setFieldError: SetFieldError = (path, error) =>\n dispatchEvent(`mantine-form:${name}:set-field-error`, { path, error });\n\n const clearFieldError: ClearFieldError = (path) =>\n dispatchEvent(`mantine-form:${name}:clear-field-error`, path);\n\n const clearErrors: ClearErrors = () => dispatchEvent(`mantine-form:${name}:clear-errors`);\n\n const reset: Reset = () => dispatchEvent(`mantine-form:${name}:reset`);\n\n const validate: () => void = () => dispatchEvent(`mantine-form:${name}:validate`);\n\n const validateField: ValidateField = (path) =>\n dispatchEvent(`mantine-form:${name}:validate-field`, path);\n\n const reorderListItem: ReorderListItem = (path, payload) =>\n dispatchEvent(`mantine-form:${name}:reorder-list-item`, { path, payload });\n\n const removeListItem: RemoveListItem = (path, index) =>\n dispatchEvent(`mantine-form:${name}:remove-list-item`, { path, index });\n\n const insertListItem: InsertListItem = (path, item, index) =>\n dispatchEvent(`mantine-form:${name}:insert-list-item`, { path, index, item });\n\n const setDirty: SetFormStatus = (value) => dispatchEvent(`mantine-form:${name}:set-dirty`, value);\n\n const setTouched: SetFormStatus = (value) =>\n dispatchEvent(`mantine-form:${name}:set-touched`, value);\n\n const resetDirty: ResetDirty = (values) =>\n dispatchEvent(`mantine-form:${name}:reset-dirty`, values);\n\n const resetTouched: ResetStatus = () => dispatchEvent(`mantine-form:${name}:reset-touched`);\n\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}\n\nfunction useFormEvent(eventKey: string | undefined, handler: (event: any) => void) {\n useIsomorphicEffect(() => {\n if (eventKey) {\n window.addEventListener(eventKey, handler);\n return () => window.removeEventListener(eventKey, handler);\n }\n return undefined;\n }, [eventKey]);\n}\n\nexport function useFormActions<\n Values = Record,\n TransformValues extends _TransformValues = (values: Values) => Values,\n>(name: string | undefined, form: UseFormReturnType) {\n if (name) {\n validateFormName(name);\n }\n\n useFormEvent(`mantine-form:${name}:set-field-value`, (event: CustomEvent) =>\n form.setFieldValue(event.detail.path, event.detail.value)\n );\n\n useFormEvent(`mantine-form:${name}:set-values`, (event: CustomEvent) =>\n form.setValues(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:set-initial-values`, (event: CustomEvent) =>\n form.setInitialValues(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:set-errors`, (event: CustomEvent) =>\n form.setErrors(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:set-field-error`, (event: CustomEvent) =>\n form.setFieldError(event.detail.path, event.detail.error)\n );\n\n useFormEvent(`mantine-form:${name}:clear-field-error`, (event: CustomEvent) =>\n form.clearFieldError(event.detail)\n );\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\n useFormEvent(`mantine-form:${name}:validate-field`, (event: CustomEvent) =>\n form.validateField(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:reorder-list-item`, (event: CustomEvent) =>\n form.reorderListItem(event.detail.path, event.detail.payload)\n );\n\n useFormEvent(`mantine-form:${name}:remove-list-item`, (event: CustomEvent) =>\n form.removeListItem(event.detail.path, event.detail.index)\n );\n\n useFormEvent(`mantine-form:${name}:insert-list-item`, (event: CustomEvent) =>\n form.insertListItem(event.detail.path, event.detail.item, event.detail.index)\n );\n\n useFormEvent(`mantine-form:${name}:set-dirty`, (event: CustomEvent) =>\n form.setDirty(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:set-touched`, (event: CustomEvent) =>\n form.setTouched(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:reset-dirty`, (event: CustomEvent) =>\n form.resetDirty(event.detail)\n );\n\n useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);\n}\n","export function getInputOnChange(\n setValue: (value: Value | ((current: Value) => Value)) => void\n) {\n return (val: Value | React.ChangeEvent | ((current: Value) => Value)) => {\n if (!val) {\n setValue(val as Value);\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 as any);\n } else {\n setValue(currentTarget.value as any);\n }\n } else if (\n currentTarget instanceof HTMLTextAreaElement ||\n currentTarget instanceof HTMLSelectElement\n ) {\n setValue(currentTarget.value as any);\n }\n } else {\n setValue(val);\n }\n };\n}\n","import type { FormErrors } from '../../../types';\n\nexport function filterErrors(errors: FormErrors): FormErrors {\n if (errors === null || typeof errors !== 'object') {\n return {};\n }\n\n return Object.keys(errors).reduce((acc, key) => {\n const errorValue = errors[key];\n\n if (errorValue !== undefined && errorValue !== null && errorValue !== false) {\n acc[key] = errorValue;\n }\n\n return acc;\n }, {});\n}\n","import { useCallback, useRef, useState } from 'react';\nimport { ClearErrors, ClearFieldError, FormErrors, SetErrors, SetFieldError } from '../../types';\nimport { filterErrors } from './filter-errors/filter-errors';\n\nexport interface $FormErrors> {\n errorsState: FormErrors;\n setErrors: SetErrors;\n clearErrors: ClearErrors;\n setFieldError: SetFieldError;\n clearFieldError: ClearFieldError;\n}\n\nexport function useFormErrors>(\n initialErrors: FormErrors\n): $FormErrors {\n const [errorsState, setErrorsState] = useState(filterErrors(initialErrors));\n const errorsRef = useRef(errorsState);\n\n const setErrors: 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\n const clearErrors: ClearErrors = useCallback(() => setErrors({}), []);\n\n const clearFieldError: ClearFieldError = useCallback(\n (path) => {\n if (errorsRef.current[path as string] === undefined) {\n return;\n }\n\n setErrors((current) => {\n const errors = { ...current };\n delete errors[path as string];\n return errors;\n });\n },\n [errorsState]\n );\n\n const setFieldError: SetFieldError = useCallback(\n (path, error) => {\n if (error == null || error === false) {\n clearFieldError(path);\n } else if (errorsRef.current[path as string] !== error) {\n setErrors((current) => ({ ...current, [path]: error }));\n }\n },\n [errorsState]\n );\n\n return {\n errorsState,\n setErrors,\n clearErrors,\n setFieldError,\n clearFieldError,\n };\n}\n","export function clearListState>(\n field: PropertyKey,\n state: T\n): T {\n if (state === null || typeof state !== 'object') {\n return {} as T;\n }\n\n const clone = { ...state };\n Object.keys(state).forEach((errorKey) => {\n if (errorKey.includes(`${String(field)}.`)) {\n delete clone[errorKey];\n }\n });\n\n return clone;\n}\n","import { clearListState } from './clear-list-state';\n\n/**\n * Gets the part of the key after the path which can be an index\n */\nfunction getIndexFromKeyAfterPath(key: string, path: string): number {\n const split = key.substring(path.length + 1).split('.')[0];\n return parseInt(split, 10);\n}\n\n/**\n * Changes the indices of every error that is after the given `index` with the given `change` at the given `path`.\n * This requires that the errors are in the format of `path.index` and that the index is a number.\n */\nexport function changeErrorIndices>(\n path: PropertyKey,\n index: number | undefined,\n errors: T,\n change: 1 | -1\n): T {\n if (index === undefined) {\n return errors;\n }\n const pathString = `${String(path)}`;\n let clearedErrors = errors;\n // Remove all errors if the corresponding item was removed\n if (change === -1) {\n clearedErrors = clearListState(`${pathString}.${index}`, clearedErrors);\n }\n\n const cloned = { ...clearedErrors };\n const changedKeys = new Set();\n Object.entries(clearedErrors)\n .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 })\n .forEach(([key, value]) => {\n const currIndex = getIndexFromKeyAfterPath(key, pathString);\n\n const newKey: keyof T = 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\n return cloned;\n}\n","import { ReorderPayload } from '../types';\n\nexport function reorderErrors(path: unknown, { from, to }: ReorderPayload, errors: T): T {\n const oldKeyStart = `${path}.${from}`;\n const newKeyStart = `${path}.${to}`;\n\n const clone: any = { ...errors };\n Object.keys(errors as any).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 === undefined ? delete clone[oldKey] : (clone[oldKey] = value2);\n value1 === undefined ? delete clone[newKey] : (clone[newKey] = value1);\n return false;\n }\n return true;\n });\n\n return clone;\n}\n","export function getSplittedPath(path: unknown) {\n if (typeof path !== 'string') {\n return [];\n }\n\n return path.split('.');\n}\n","import { getSplittedPath } from './get-splitted-path';\n\nexport function getPath(path: unknown, values: unknown): unknown {\n const splittedPath = getSplittedPath(path);\n\n if (splittedPath.length === 0 || typeof values !== 'object' || values === null) {\n return undefined;\n }\n\n let value = values[splittedPath[0] as keyof typeof values];\n for (let i = 1; i < splittedPath.length; i += 1) {\n if (value == null) {\n break;\n }\n\n value = value[splittedPath[i]];\n }\n\n return value;\n}\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","import { klona } from 'klona/full';\nimport { getSplittedPath } from './get-splitted-path';\n\nexport function setPath(path: unknown, value: unknown, values: T): T {\n const splittedPath = getSplittedPath(path);\n\n if (splittedPath.length === 0) {\n return values;\n }\n\n const cloned: any = klona(values);\n\n if (splittedPath.length === 1) {\n cloned[splittedPath[0]] = value;\n return cloned;\n }\n\n let val = cloned[splittedPath[0]];\n\n for (let i = 1; i < splittedPath.length - 1; i += 1) {\n if (val === undefined) {\n return cloned;\n }\n\n val = val[splittedPath[i]];\n }\n\n val[splittedPath[splittedPath.length - 1]] = value;\n\n return cloned;\n}\n","import { ReorderPayload } from '../types';\nimport { getPath } from './get-path';\nimport { setPath } from './set-path';\n\nexport function reorderPath(path: unknown, { from, to }: ReorderPayload, values: T) {\n const currentValue = getPath(path, values);\n\n if (!Array.isArray(currentValue)) {\n return values;\n }\n\n const cloned = [...currentValue];\n const item = currentValue[from];\n cloned.splice(from, 1);\n cloned.splice(to, 0, item);\n\n return setPath(path, cloned, values);\n}\n","import { getPath } from './get-path';\nimport { setPath } from './set-path';\n\nexport function insertPath(path: unknown, value: unknown, index: number | undefined, values: T) {\n const currentValue = getPath(path, values);\n\n if (!Array.isArray(currentValue)) {\n return values;\n }\n\n const cloned = [...currentValue];\n cloned.splice(typeof index === 'number' ? index : cloned.length, 0, value);\n\n return setPath(path, cloned, values);\n}\n","import { getPath } from './get-path';\nimport { setPath } from './set-path';\n\nexport function removePath(path: unknown, index: number, values: T) {\n const currentValue = getPath(path, values);\n\n if (!Array.isArray(currentValue)) {\n return values;\n }\n\n return setPath(\n path,\n currentValue.filter((_, itemIndex) => itemIndex !== index),\n values\n );\n}\n","import { getPath } from './get-path';\nimport { setPath } from './set-path';\n\nexport function replacePath(path: unknown, item: unknown, index: number, values: T) {\n const currentValue = getPath(path, values);\n\n if (!Array.isArray(currentValue)) {\n return values;\n }\n\n if (currentValue.length <= index) {\n return values;\n }\n\n const cloned = [...currentValue];\n cloned[index] = item;\n\n return setPath(path, cloned, values);\n}\n","import { useCallback } from 'react';\nimport { changeErrorIndices, reorderErrors } from '../../lists';\nimport { insertPath, removePath, reorderPath, replacePath } from '../../paths';\nimport { InsertListItem, RemoveListItem, ReorderListItem, ReplaceListItem } from '../../types';\nimport type { $FormErrors } from '../use-form-errors/use-form-errors';\nimport type { $FormStatus } from '../use-form-status/use-form-status';\nimport type { $FormValues } from '../use-form-values/use-form-values';\n\ninterface UseFormListInput> {\n $values: $FormValues;\n $errors: $FormErrors;\n $status: $FormStatus;\n}\n\nexport function useFormList>({\n $values,\n $errors,\n $status,\n}: UseFormListInput) {\n const reorderListItem: 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\n const removeListItem: 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\n const insertListItem: 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\n const replaceListItem: 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\n return { reorderListItem, removeListItem, insertListItem, replaceListItem };\n}\n","import { FormStatus } from '../types';\n\nexport function getStatus(status: FormStatus, path?: unknown) {\n const paths = Object.keys(status);\n\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\n return paths.some((statusPath) => status[statusPath]);\n}\n","import { useCallback, useRef, useState } from 'react';\nimport isEqual from 'fast-deep-equal';\nimport { getStatus } from '../../get-status';\nimport { clearListState } from '../../lists';\nimport { getPath } from '../../paths';\nimport {\n ClearFieldDirty,\n FormMode,\n FormStatus,\n GetFieldStatus,\n ResetDirty,\n ResetStatus,\n SetCalculatedFieldDirty,\n SetFieldDirty,\n SetFieldTouched,\n} from '../../types';\nimport type { $FormValues } from '../use-form-values/use-form-values';\n\nexport interface $FormStatus> {\n touchedState: FormStatus;\n dirtyState: FormStatus;\n touchedRef: React.MutableRefObject;\n dirtyRef: React.MutableRefObject;\n setTouched: React.Dispatch>;\n setDirty: React.Dispatch>;\n resetDirty: ResetStatus;\n resetTouched: ResetStatus;\n isTouched: GetFieldStatus;\n setFieldTouched: SetFieldTouched;\n setFieldDirty: SetFieldDirty;\n setTouchedState: React.Dispatch>;\n setDirtyState: React.Dispatch>;\n clearFieldDirty: ClearFieldDirty;\n isDirty: GetFieldStatus;\n getDirty: () => FormStatus;\n getTouched: () => FormStatus;\n setCalculatedFieldDirty: SetCalculatedFieldDirty;\n}\n\ninterface UseFormStatusInput> {\n initialDirty: FormStatus;\n initialTouched: FormStatus;\n mode: FormMode;\n $values: $FormValues;\n}\n\nexport function useFormStatus>({\n initialDirty,\n initialTouched,\n mode,\n $values,\n}: UseFormStatusInput): $FormStatus {\n const [touchedState, setTouchedState] = useState(initialTouched);\n const [dirtyState, setDirtyState] = useState(initialDirty);\n\n const touchedRef = useRef(initialTouched);\n const dirtyRef = useRef(initialDirty);\n\n const setTouched = useCallback((values: FormStatus | ((current: FormStatus) => FormStatus)) => {\n const resolvedValues = typeof values === 'function' ? values(touchedRef.current) : values;\n touchedRef.current = resolvedValues;\n\n if (mode === 'controlled') {\n setTouchedState(resolvedValues);\n }\n }, []);\n\n const setDirty = useCallback(\n (values: FormStatus | ((current: FormStatus) => FormStatus), forceUpdate = false) => {\n const resolvedValues = typeof values === 'function' ? values(dirtyRef.current) : values;\n dirtyRef.current = resolvedValues;\n\n if (mode === 'controlled' || forceUpdate) {\n setDirtyState(resolvedValues);\n }\n },\n []\n );\n\n const resetTouched: ResetStatus = useCallback(() => setTouched({}), []);\n\n const resetDirty: ResetDirty = useCallback((values) => {\n const newSnapshot = values\n ? { ...$values.refValues.current, ...values }\n : $values.refValues.current;\n $values.setValuesSnapshot(newSnapshot);\n setDirty({});\n }, []);\n\n const setFieldTouched: SetFieldTouched = useCallback((path, touched) => {\n setTouched((currentTouched) => {\n if (getStatus(currentTouched, path) === touched) {\n return currentTouched;\n }\n\n return { ...currentTouched, [path]: touched };\n });\n }, []);\n\n const setFieldDirty: SetFieldDirty = useCallback((path, dirty, forceUpdate) => {\n setDirty((currentDirty) => {\n if (getStatus(currentDirty, path) === dirty) {\n return currentDirty;\n }\n\n return { ...currentDirty, [path]: dirty };\n }, forceUpdate);\n }, []);\n\n const setCalculatedFieldDirty: 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 as string] = dirty;\n setDirty(clearedState, currentDirty !== dirty);\n }, []);\n\n const isTouched: GetFieldStatus = useCallback(\n (path) => getStatus(touchedRef.current, path),\n []\n );\n\n const clearFieldDirty: ClearFieldDirty = useCallback(\n (path) =>\n setDirty((current) => {\n if (typeof path !== 'string') {\n return current;\n }\n\n const result = clearListState(path, current);\n delete result[path];\n\n if (isEqual(result, current)) {\n return current;\n }\n\n return result;\n }),\n []\n );\n\n const isDirty: GetFieldStatus = useCallback((path) => {\n if (path) {\n const overriddenValue = getPath(path, dirtyRef.current);\n if (typeof overriddenValue === 'boolean') {\n return overriddenValue;\n }\n\n const sliceOfValues = getPath(path, $values.refValues.current);\n const sliceOfInitialValues = getPath(path, $values.valuesSnapshot.current);\n return !isEqual(sliceOfValues, sliceOfInitialValues);\n }\n\n const isOverridden = Object.keys(dirtyRef.current).length > 0;\n if (isOverridden) {\n return getStatus(dirtyRef.current);\n }\n\n return !isEqual($values.refValues.current, $values.valuesSnapshot.current);\n }, []);\n\n const getDirty = useCallback(() => dirtyRef.current, []);\n const getTouched = useCallback(() => touchedRef.current, []);\n\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","import { useCallback, useRef, useState } from 'react';\nimport { getPath, setPath } from '../../paths';\nimport { FormMode } from '../../types';\n\nexport interface $FormValues> {\n initialized: React.MutableRefObject;\n stateValues: Values;\n refValues: React.MutableRefObject;\n valuesSnapshot: React.MutableRefObject;\n setValues: (payload: SetValuesInput) => void;\n setFieldValue: (payload: SetFieldValueInput) => void;\n resetValues: () => void;\n setValuesSnapshot: (payload: Values) => void;\n initialize: (values: Values, onInitialize: () => void) => void;\n getValues: () => Values;\n getValuesSnapshot: () => Values;\n}\n\nexport interface SetValuesSubscriberPayload {\n path?: PropertyKey;\n updatedValues: Values;\n previousValues: Values;\n}\n\nexport interface SetValuesInput {\n values: Partial | ((values: Values) => Partial);\n mergeWithPreviousValues?: boolean;\n updateState?: boolean;\n subscribers?: (SetFieldValueSubscriber | null | undefined)[];\n}\n\nexport type SetFieldValueSubscriber = (payload: SetValuesSubscriberPayload) => void;\n\nexport interface SetFieldValueInput {\n path: PropertyKey;\n value: any;\n updateState?: boolean;\n subscribers?: (SetFieldValueSubscriber | null | undefined)[];\n}\n\ninterface UseFormValuesInput> {\n initialValues: Values | undefined;\n mode: FormMode;\n onValuesChange?: ((values: Values, previousValues: Values) => void) | undefined;\n}\n\nexport function useFormValues>({\n initialValues,\n onValuesChange,\n mode,\n}: UseFormValuesInput): $FormValues {\n const initialized = useRef(false);\n const [stateValues, setStateValues] = useState(initialValues || ({} as Values));\n const refValues = useRef(stateValues);\n const valuesSnapshot = useRef(stateValues);\n\n const setValues = useCallback(\n ({\n values,\n subscribers,\n updateState = true,\n mergeWithPreviousValues = true,\n }: SetValuesInput) => {\n const previousValues = refValues.current;\n const resolvedValues = values instanceof Function ? values(refValues.current) : values;\n const updatedValues = mergeWithPreviousValues\n ? { ...previousValues, ...resolvedValues }\n : (resolvedValues as Values);\n refValues.current = updatedValues;\n updateState && setStateValues(updatedValues);\n onValuesChange?.(updatedValues, previousValues);\n subscribers\n ?.filter(Boolean)\n .forEach((subscriber) => subscriber!({ updatedValues, previousValues }));\n },\n [onValuesChange]\n );\n\n const setFieldValue = useCallback(\n (payload: SetFieldValueInput) => {\n const currentValue = getPath(payload.path, refValues.current);\n const updatedValue =\n payload.value instanceof Function ? payload.value(currentValue) : payload.value;\n\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\n payload.subscribers\n ?.filter(Boolean)\n .forEach((subscriber) =>\n subscriber!({ path: payload.path, updatedValues, previousValues })\n );\n }\n },\n [setValues]\n );\n\n const setValuesSnapshot = useCallback((payload: Values) => {\n valuesSnapshot.current = payload;\n }, []);\n\n const initialize = useCallback(\n (values: Values, onInitialize: () => void) => {\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\n const resetValues = useCallback(() => {\n setValues({\n values: valuesSnapshot.current,\n updateState: true,\n mergeWithPreviousValues: false,\n });\n }, [setValues]);\n\n const getValues = useCallback(() => refValues.current, []);\n const getValuesSnapshot = useCallback(() => valuesSnapshot.current, []);\n\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","import { useCallback, useEffect, useRef } from 'react';\nimport { getPath } from '../../paths';\nimport { FormFieldSubscriber, LooseKeys, Watch } from '../../types';\nimport { $FormStatus } from '../use-form-status/use-form-status';\nimport { SetValuesSubscriberPayload } from '../use-form-values/use-form-values';\n\ninterface UseFormWatchInput> {\n $status: $FormStatus;\n}\n\nexport function useFormWatch>({\n $status,\n}: UseFormWatchInput) {\n const subscribers = useRef, FormFieldSubscriber[]>>(\n {} as any\n );\n\n const watch: Watch = useCallback((path, callback) => {\n useEffect(() => {\n subscribers.current[path] = subscribers.current[path] || [];\n subscribers.current[path].push(callback);\n\n return () => {\n subscribers.current[path] = subscribers.current[path].filter((cb) => cb !== callback);\n };\n }, [callback]);\n }, []);\n\n const getFieldSubscribers = useCallback((path: LooseKeys) => {\n if (!subscribers.current[path]) {\n return [];\n }\n\n return subscribers.current[path].map(\n (callback) => (input: SetValuesSubscriberPayload) =>\n callback({\n previousValue: getPath(path, input.previousValues) as any,\n value: getPath(path, input.updatedValues) as any,\n touched: $status.isTouched(path),\n dirty: $status.isDirty(path),\n })\n );\n }, []);\n\n return {\n subscribers,\n watch,\n getFieldSubscribers,\n };\n}\n","export function getDataPath(formName: string | undefined, fieldPath: PropertyKey) {\n return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();\n}\n","import { filterErrors } from '../hooks/use-form-errors/filter-errors/filter-errors';\nimport { getPath } from '../paths';\nimport { FormErrors, FormRule, FormRulesRecord, FormValidateInput } from '../types';\n\nexport const formRootRule = Symbol('root-rule');\n\nfunction getValidationResults(errors: FormErrors) {\n const filteredErrors = filterErrors(errors);\n return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };\n}\n\nfunction validateRulesRecord(\n rules: FormRulesRecord | undefined,\n values: T,\n path = '',\n errors: FormErrors = {}\n) {\n if (typeof rules !== 'object' || rules === null) {\n return errors;\n }\n\n return Object.keys(rules).reduce((acc, ruleKey) => {\n const rule: FormRule = (rules as any)[ruleKey];\n const rulePath = `${path === '' ? '' : `${path}.`}${ruleKey}`;\n const value = getPath(rulePath, values);\n let arrayValidation = false;\n\n if (typeof rule === 'function') {\n acc[rulePath] = rule(value, values, rulePath);\n }\n\n if (typeof rule === 'object' && Array.isArray(value)) {\n arrayValidation = true;\n value.forEach((_item, index) =>\n validateRulesRecord(rule, values, `${rulePath}.${index}`, acc)\n );\n\n if (formRootRule in rule) {\n acc[rulePath] = (rule as any)[formRootRule](value, values, rulePath);\n }\n }\n\n if (typeof rule === 'object' && typeof value === 'object' && value !== null) {\n if (!arrayValidation) {\n validateRulesRecord(rule, values, rulePath, acc);\n }\n\n if (formRootRule in rule) {\n acc[rulePath] = (rule as any)[formRootRule](value, values, rulePath);\n }\n }\n\n return acc;\n }, errors);\n}\n\nexport function validateValues(validate: FormValidateInput | undefined, values: T) {\n if (typeof validate === 'function') {\n return getValidationResults(validate(values));\n }\n\n return getValidationResults(validateRulesRecord(validate, values));\n}\n","import { FormFieldValidationResult, FormValidateInput } from '../types';\nimport { validateValues } from './validate-values';\n\nexport function validateFieldValue(\n path: unknown,\n rules: FormValidateInput | undefined,\n values: T\n): FormFieldValidationResult {\n if (typeof path !== 'string') {\n return { hasError: false, error: null };\n }\n\n const results = validateValues(rules, values);\n const pathInError = Object.keys(results.errors).find((errorKey) =>\n path.split('.').every((pathPart, i) => pathPart === errorKey.split('.')[i])\n );\n return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };\n}\n","export const FORM_INDEX = '__MANTINE_FORM_INDEX__';\n","import { FORM_INDEX } from '../form-index';\n\nexport function shouldValidateOnChange(path: unknown, validateInputOnChange: boolean | unknown[]) {\n if (!validateInputOnChange) {\n return false;\n }\n\n if (typeof validateInputOnChange === 'boolean') {\n return validateInputOnChange;\n }\n\n if (Array.isArray(validateInputOnChange)) {\n return validateInputOnChange.includes((path as string).replace(/[.][0-9]+/g, `.${FORM_INDEX}`));\n }\n\n return false;\n}\n","import { useCallback, useState } from 'react';\nimport { useFormActions } from './actions';\nimport { getInputOnChange } from './get-input-on-change';\nimport { useFormErrors } from './hooks/use-form-errors/use-form-errors';\nimport { useFormList } from './hooks/use-form-list/use-form-list';\nimport { useFormStatus } from './hooks/use-form-status/use-form-status';\nimport { useFormValues } from './hooks/use-form-values/use-form-values';\nimport { useFormWatch } from './hooks/use-form-watch/use-form-watch';\nimport { getDataPath, getPath } from './paths';\nimport {\n _TransformValues,\n GetInputNode,\n GetInputProps,\n GetTransformedValues,\n Initialize,\n IsValid,\n Key,\n OnReset,\n OnSubmit,\n Reset,\n SetFieldValue,\n SetValues,\n UseFormInput,\n UseFormReturnType,\n Validate,\n ValidateField,\n} from './types';\nimport { shouldValidateOnChange, validateFieldValue, validateValues } from './validate';\n\nexport function useForm<\n Values extends Record = Record,\n TransformValues extends _TransformValues = (values: Values) => Values,\n>({\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) => values) as any,\n enhanceGetInputProps,\n validate: rules,\n onSubmitPreventDefault = 'always',\n touchTrigger = 'change',\n}: UseFormInput = {}): UseFormReturnType {\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\n const reset: Reset = useCallback(() => {\n $values.resetValues();\n $errors.clearErrors();\n $status.resetDirty();\n $status.resetTouched();\n mode === 'uncontrolled' && setFormKey((key) => key + 1);\n }, []);\n\n const handleValuesChanges = useCallback(\n (previousValues: Values) => {\n clearInputErrorOnChange && $errors.clearErrors();\n mode === 'uncontrolled' && setFormKey((key) => key + 1);\n\n Object.keys($watch.subscribers.current).forEach((path) => {\n const value = getPath(path, $values.refValues.current);\n const previousValue = getPath(path, previousValues);\n\n if (value !== previousValue) {\n $watch\n .getFieldSubscribers(path)\n .forEach((cb) => cb({ previousValues, updatedValues: $values.refValues.current }));\n }\n });\n },\n [clearInputErrorOnChange]\n );\n\n const initialize: Initialize = useCallback(\n (values) => {\n const previousValues = $values.refValues.current;\n $values.initialize(values, () => mode === 'uncontrolled' && setFormKey((key) => key + 1));\n handleValuesChanges(previousValues);\n },\n [handleValuesChanges]\n );\n\n const setFieldValue: SetFieldValue = useCallback(\n (path, value, options) => {\n const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);\n const resolvedValue =\n value instanceof Function ? value(getPath(path, $values.refValues.current) as any) : value;\n\n $status.setCalculatedFieldDirty(path, resolvedValue);\n touchTrigger === 'change' && $status.setFieldTouched(path, true);\n !shouldValidate && clearInputErrorOnChange && $errors.clearFieldError(path);\n\n $values.setFieldValue({\n path,\n value,\n updateState: mode === 'controlled',\n subscribers: [\n ...$watch.getFieldSubscribers(path),\n shouldValidate\n ? (payload) => {\n const validationResults = validateFieldValue(path, rules, payload.updatedValues);\n validationResults.hasError\n ? $errors.setFieldError(path, validationResults.error)\n : $errors.clearFieldError(path);\n }\n : null,\n options?.forceUpdate !== false && mode !== 'controlled'\n ? () =>\n setFieldKeys((keys) => ({\n ...keys,\n [path as string]: (keys[path as string] || 0) + 1,\n }))\n : null,\n ],\n });\n },\n [onValuesChange, rules]\n );\n\n const setValues: 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\n const validate: Validate = useCallback(() => {\n const results = validateValues(rules, $values.refValues.current);\n $errors.setErrors(results.errors);\n return results;\n }, [rules]);\n\n const validateField: 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\n const getInputProps: GetInputProps = (\n path,\n { type = 'input', withError = true, withFocus = true, ...otherOptions } = {}\n ) => {\n const onChange = getInputOnChange((value) =>\n setFieldValue(path, value as any, { forceUpdate: false })\n );\n\n const payload: any = { onChange, 'data-path': getDataPath(name, path) };\n\n if (withError) {\n payload.error = $errors.errorsState[path];\n }\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\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\n validationResults.hasError\n ? $errors.setFieldError(path, validationResults.error)\n : $errors.clearFieldError(path);\n }\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\n const onSubmit: OnSubmit =\n (handleSubmit, handleValidationFailure) => (event) => {\n if (onSubmitPreventDefault === 'always') {\n event?.preventDefault();\n }\n\n const results = validate();\n\n if (results.hasErrors) {\n if (onSubmitPreventDefault === 'validation-failed') {\n event?.preventDefault();\n }\n\n handleValidationFailure?.(results.errors, $values.refValues.current, event);\n } else {\n const submitResult = handleSubmit?.(\n transformValues($values.refValues.current) as any,\n event\n );\n\n if (submitResult instanceof Promise) {\n setSubmitting(true);\n submitResult.finally(() => setSubmitting(false));\n }\n }\n };\n\n const getTransformedValues: GetTransformedValues = (input) =>\n (transformValues as any)(input || $values.refValues.current);\n\n const onReset: OnReset = useCallback((event) => {\n event.preventDefault();\n reset();\n }, []);\n\n const isValid: IsValid = useCallback(\n (path) =>\n path\n ? !validateFieldValue(path, rules, $values.refValues.current).hasError\n : !validateValues(rules, $values.refValues.current).hasErrors,\n [rules]\n );\n\n const key: Key = (path) =>\n `${formKey}-${path as string}-${fieldKeys[path as string] || 0}`;\n\n const getInputNode: GetInputNode = useCallback(\n (path) => document.querySelector(`[data-path=\"${getDataPath(name, path)}\"]`),\n []\n );\n\n const form: UseFormReturnType = {\n watch: $watch.watch,\n\n initialized: $values.initialized.current,\n values: $values.stateValues,\n getValues: $values.getValues,\n setInitialValues: $values.setValuesSnapshot,\n initialize,\n setValues,\n setFieldValue,\n\n submitting,\n setSubmitting,\n\n errors: $errors.errorsState,\n setErrors: $errors.setErrors,\n setFieldError: $errors.setFieldError,\n clearFieldError: $errors.clearFieldError,\n clearErrors: $errors.clearErrors,\n\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\n reorderListItem: $list.reorderListItem,\n insertListItem: $list.insertListItem,\n removeListItem: $list.removeListItem,\n replaceListItem: $list.replaceListItem,\n\n reset,\n validate,\n validateField,\n getInputProps,\n onSubmit,\n onReset,\n isValid,\n getTransformedValues,\n key,\n\n getInputNode,\n };\n\n useFormActions(name, form);\n\n return form;\n}\n","import { useSyncExternalStore } from 'react';\n\nexport type MantineStoreSubscriber = (value: Value) => void;\ntype SetStateCallback = (value: Value) => Value;\n\nexport interface MantineStore {\n getState: () => Value;\n setState: (value: Value | SetStateCallback) => void;\n updateState: (value: Value | SetStateCallback) => void;\n initialize: (value: Value) => void;\n subscribe: (callback: MantineStoreSubscriber) => () => void;\n}\n\nexport type MantineStoreValue> = ReturnType;\n\nexport function createStore>(\n initialState: Value\n): MantineStore {\n let state = initialState;\n let initialized = false;\n const listeners = new Set>();\n\n return {\n getState() {\n return state;\n },\n\n updateState(value) {\n state = typeof value === 'function' ? value(state) : value;\n },\n\n setState(value) {\n this.updateState(value);\n listeners.forEach((listener) => listener(state));\n },\n\n initialize(value) {\n if (!initialized) {\n state = value;\n initialized = true;\n }\n },\n\n subscribe(callback) {\n listeners.add(callback);\n return () => listeners.delete(callback);\n },\n };\n}\n\nexport function useStore>(store: Store) {\n return useSyncExternalStore>(\n store.subscribe,\n () => store.getState(),\n () => store.getState()\n );\n}\n","import { NotificationProps } from '@mantine/core';\nimport { randomId } from '@mantine/hooks';\nimport { createStore, MantineStore, useStore } from '@mantine/store';\n\nexport type NotificationPosition =\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n\nexport interface NotificationData\n extends Omit,\n Record<`data-${string}`, any> {\n /** Notification id, can be used to close or update notification */\n id?: string;\n\n /** Position of the notification, if not set, the position is determined based on `position` prop on Notifications component */\n position?: NotificationPosition;\n\n /** Notification message, required for all notifications */\n message: React.ReactNode;\n\n /** Determines whether notification should be closed automatically,\n * number is auto close timeout in ms, overrides `autoClose` from `Notifications`\n * */\n autoClose?: boolean | number;\n\n /** Called when notification closes */\n onClose?: (props: NotificationData) => void;\n\n /** Called when notification opens */\n onOpen?: (props: NotificationData) => void;\n}\n\nexport interface NotificationsState {\n notifications: NotificationData[];\n queue: NotificationData[];\n defaultPosition: NotificationPosition;\n limit: number;\n}\n\nexport type NotificationsStore = MantineStore;\n\nfunction getDistributedNotifications(\n data: NotificationData[],\n defaultPosition: NotificationPosition,\n limit: number\n) {\n const queue: NotificationData[] = [];\n const notifications: NotificationData[] = [];\n const count: Record = {};\n\n for (const item of data) {\n const position = item.position || defaultPosition;\n count[position] = count[position] || 0;\n count[position] += 1;\n\n if (count[position] <= limit) {\n notifications.push(item);\n } else {\n queue.push(item);\n }\n }\n\n return { notifications, queue };\n}\n\nexport const createNotificationsStore = () =>\n createStore({\n notifications: [],\n queue: [],\n defaultPosition: 'bottom-right',\n limit: 5,\n });\n\nexport const notificationsStore = createNotificationsStore();\nexport const useNotifications = (store: NotificationsStore = notificationsStore) => useStore(store);\n\nexport function updateNotificationsState(\n store: NotificationsStore,\n update: (notifications: NotificationData[]) => NotificationData[]\n) {\n const state = store.getState();\n const notifications = update([...state.notifications, ...state.queue]);\n const updated = getDistributedNotifications(notifications, state.defaultPosition, state.limit);\n\n store.setState({\n notifications: updated.notifications,\n queue: updated.queue,\n limit: state.limit,\n defaultPosition: state.defaultPosition,\n });\n}\n\nexport function showNotification(\n notification: NotificationData,\n store: NotificationsStore = notificationsStore\n) {\n const id = notification.id || randomId();\n\n updateNotificationsState(store, (notifications) => {\n if (notification.id && notifications.some((n) => n.id === notification.id)) {\n return notifications;\n }\n\n return [...notifications, { ...notification, id }];\n });\n\n return id;\n}\n\nexport function hideNotification(id: string, store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, (notifications) =>\n notifications.filter((notification) => {\n if (notification.id === id) {\n notification.onClose?.(notification);\n return false;\n }\n\n return true;\n })\n );\n\n return id;\n}\n\nexport function updateNotification(\n notification: NotificationData,\n store: NotificationsStore = notificationsStore\n) {\n updateNotificationsState(store, (notifications) =>\n notifications.map((item) => {\n if (item.id === notification.id) {\n return { ...item, ...notification };\n }\n\n return item;\n })\n );\n\n return notification.id;\n}\n\nexport function cleanNotifications(store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, () => []);\n}\n\nexport function cleanNotificationsQueue(store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, (notifications) =>\n notifications.slice(0, store.getState().limit)\n );\n}\n\nexport const notifications = {\n show: showNotification,\n hide: hideNotification,\n update: updateNotification,\n clean: cleanNotifications,\n cleanQueue: cleanNotificationsQueue,\n updateState: updateNotificationsState,\n} as const;\n"],"names":["module","exports","equal","a","b","constructor","Array","isArray","length","i","RegExp","source","flags","valueOf","Object","prototype","toString","keys","hasOwnProperty","call","key","defaultProps","TextInput","factory","props","ref","_props","useProps","jsx","InputBase","component","__staticSelector","classes","displayName","useIsomorphicEffect","window","useLayoutEffect","useEffect","useFormEvent","eventKey","handler","addEventListener","removeEventListener","filterErrors","errors","reduce","acc","errorValue","clearListState","field","state","clone","forEach","errorKey","includes","concat","String","getIndexFromKeyAfterPath","path","parseInt","substring","split","changeErrorIndices","index","change","pathString","clearedErrors","cloned","changedKeys","Set","entries","filter","param","startsWith","currIndex","Number","isNaN","value","newKey","replace","add","has","getSplittedPath","getPath","values","splittedPath","set","obj","val","klona","enumerable","get","configurable","writable","defineProperty","x","k","list","tmp","str","create","__proto__","Map","Date","buffer","slice","getOwnPropertySymbols","getOwnPropertyDescriptor","getOwnPropertyNames","setPath","getStatus","status","paths","nestedPaths","statusPath","some","getDataPath","formName","fieldPath","formRootRule","Symbol","getValidationResults","filteredErrors","hasErrors","validateValues","validate","validateRulesRecord","rules","ruleKey","rule","rulePath","arrayValidation","_item","validateFieldValue","hasError","error","results","pathInError","find","every","pathPart","shouldValidateOnChange","validateInputOnChange","useForm","name","mode","initialValues","initialErrors","initialDirty","initialTouched","clearInputErrorOnChange","validateInputOnBlur","onValuesChange","transformValues","enhanceGetInputProps","onSubmitPreventDefault","touchTrigger","arguments","$errors","useFormErrors","errorsState","setErrorsState","useState","errorsRef","useRef","setErrors","useCallback","newErrors","current","clearErrors","clearFieldError","setFieldError","$values","useFormValues","initialized","stateValues","setStateValues","refValues","valuesSnapshot","setValues","subscribers","updateState","mergeWithPreviousValues","previousValues","resolvedValues","Function","updatedValues","Boolean","subscriber","setFieldValue","currentValue","payload","updatedValue","setValuesSnapshot","initialize","onInitialize","resetValues","getValues","getValuesSnapshot","$status","useFormStatus","touchedState","setTouchedState","dirtyState","setDirtyState","touchedRef","dirtyRef","setTouched","setDirty","forceUpdate","resetTouched","resetDirty","newSnapshot","setFieldTouched","touched","currentTouched","setFieldDirty","dirty","currentDirty","setCalculatedFieldDirty","isEqual","clearedState","isTouched","clearFieldDirty","result","isDirty","overriddenValue","getDirty","getTouched","$list","useFormList","reorderListItem","reorderErrors","from","to","oldKeyStart","newKeyStart","oldKey","value1","value2","errs","reorderPath","item","splice","removeListItem","removePath","_","itemIndex","insertListItem","insertPath","replaceListItem","replacePath","$watch","useFormWatch","watch","callback","push","cb","getFieldSubscribers","map","previousValue","input","formKey","setFormKey","fieldKeys","setFieldKeys","submitting","setSubmitting","reset","handleValuesChanges","options","shouldValidate","resolvedValue","validationResults","validateField","onReset","event","preventDefault","isValid","getInputNode","document","querySelector","form","setInitialValues","getInputProps","setValue","type","withError","withFocus","otherOptions","onChange","currentTarget","HTMLInputElement","checked","HTMLTextAreaElement","HTMLSelectElement","onFocus","onBlur","assign","inputProps","onSubmit","handleSubmit","handleValidationFailure","submitResult","Promise","finally","getTransformedValues","validateFormName","test","detail","notificationsStore","createStore","initialState","listeners","getState","setState","listener","subscribe","delete","notifications","queue","defaultPosition","limit","useNotifications","store","useSyncExternalStore","updateNotificationsState","update","updated","getDistributedNotifications","data","count","position","showNotification","notification","id","randomId","n","hideNotification","onClose","show","hide","clean","cleanQueue"],"sourceRoot":""}