{"version":3,"file":"vee-validate.esm-3d577f2c.js","sources":["../../../node_modules/vee-validate/dist/vee-validate.esm.js"],"sourcesContent":["/**\n * vee-validate v4.11.8\n * (c) 2023 Abdelrahman Awad\n * @license MIT\n */\nimport { getCurrentInstance, inject, warn as warn$1, computed, toValue, ref, watch, nextTick, unref, isRef, reactive, onUnmounted, onMounted, provide, onBeforeUnmount, defineComponent, toRef, resolveDynamicComponent, h, readonly, watchEffect, shallowRef } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\nfunction isCallable(fn) {\n return typeof fn === 'function';\n}\nfunction isNullOrUndefined(value) {\n return value === null || value === undefined;\n}\nconst isObject = (obj) => obj !== null && !!obj && typeof obj === 'object' && !Array.isArray(obj);\nfunction isIndex(value) {\n return Number(value) >= 0;\n}\nfunction toNumber(value) {\n const n = parseFloat(value);\n return isNaN(n) ? value : n;\n}\nfunction isObjectLike(value) {\n return typeof value === 'object' && value !== null;\n}\nfunction getTag(value) {\n if (value == null) {\n return value === undefined ? '[object Undefined]' : '[object Null]';\n }\n return Object.prototype.toString.call(value);\n}\n// Reference: https://github.com/lodash/lodash/blob/master/isPlainObject.js\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || getTag(value) !== '[object Object]') {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n let proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n}\nfunction merge(target, source) {\n Object.keys(source).forEach(key => {\n if (isPlainObject(source[key])) {\n if (!target[key]) {\n target[key] = {};\n }\n merge(target[key], source[key]);\n return;\n }\n target[key] = source[key];\n });\n return target;\n}\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n */\nfunction normalizeFormPath(path) {\n const pathArr = path.split('.');\n if (!pathArr.length) {\n return '';\n }\n let fullPath = String(pathArr[0]);\n for (let i = 1; i < pathArr.length; i++) {\n if (isIndex(pathArr[i])) {\n fullPath += `[${pathArr[i]}]`;\n continue;\n }\n fullPath += `.${pathArr[i]}`;\n }\n return fullPath;\n}\n\nconst RULES = {};\n/**\n * Adds a custom validator to the list of validation rules.\n */\nfunction defineRule(id, validator) {\n // makes sure new rules are properly formatted.\n guardExtend(id, validator);\n RULES[id] = validator;\n}\n/**\n * Gets an already defined rule\n */\nfunction resolveRule(id) {\n return RULES[id];\n}\n/**\n * Guards from extension violations.\n */\nfunction guardExtend(id, validator) {\n if (isCallable(validator)) {\n return;\n }\n throw new Error(`Extension Error: The validator '${id}' must be a function.`);\n}\n\nfunction 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\nfunction 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\nconst FormContextKey = Symbol('vee-validate-form');\nconst FieldContextKey = Symbol('vee-validate-field-instance');\nconst IS_ABSENT = Symbol('Default empty value');\n\nconst isClient = typeof window !== 'undefined';\nfunction isLocator(value) {\n return isCallable(value) && !!value.__locatorRef;\n}\nfunction isTypedSchema(value) {\n return !!value && isCallable(value.parse) && value.__type === 'VVTypedSchema';\n}\nfunction isYupValidator(value) {\n return !!value && isCallable(value.validate);\n}\nfunction hasCheckedAttr(type) {\n return type === 'checkbox' || type === 'radio';\n}\nfunction isContainerValue(value) {\n return isObject(value) || Array.isArray(value);\n}\n/**\n * True if the value is an empty object or array\n */\nfunction isEmptyContainer(value) {\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n return isObject(value) && Object.keys(value).length === 0;\n}\n/**\n * Checks if the path opted out of nested fields using `[fieldName]` syntax\n */\nfunction isNotNestedPath(path) {\n return /^\\[.+\\]$/i.test(path);\n}\n/**\n * Checks if an element is a native HTML5 multi-select input element\n */\nfunction isNativeMultiSelect(el) {\n return isNativeSelect(el) && el.multiple;\n}\n/**\n * Checks if an element is a native HTML5 select input element\n */\nfunction isNativeSelect(el) {\n return el.tagName === 'SELECT';\n}\n/**\n * Checks if a tag name with attrs object will render a native multi-select element\n */\nfunction isNativeMultiSelectNode(tag, attrs) {\n // The falsy value array is the values that Vue won't add the `multiple` prop if it has one of these values\n const hasTruthyBindingValue = ![false, null, undefined, 0].includes(attrs.multiple) && !Number.isNaN(attrs.multiple);\n return tag === 'select' && 'multiple' in attrs && hasTruthyBindingValue;\n}\n/**\n * Checks if a node should have a `:value` binding or not\n *\n * These nodes should not have a value binding\n * For files, because they are not reactive\n * For multi-selects because the value binding will reset the value\n */\nfunction shouldHaveValueBinding(tag, attrs) {\n return !isNativeMultiSelectNode(tag, attrs) && attrs.type !== 'file' && !hasCheckedAttr(attrs.type);\n}\nfunction isFormSubmitEvent(evt) {\n return isEvent(evt) && evt.target && 'submit' in evt.target;\n}\nfunction isEvent(evt) {\n if (!evt) {\n return false;\n }\n if (typeof Event !== 'undefined' && isCallable(Event) && evt instanceof Event) {\n return true;\n }\n // this is for IE and Cypress #3161\n /* istanbul ignore next */\n if (evt && evt.srcElement) {\n return true;\n }\n return false;\n}\nfunction isPropPresent(obj, prop) {\n return prop in obj && obj[prop] !== IS_ABSENT;\n}\n/**\n * Compares if two values are the same borrowed from:\n * https://github.com/epoberezkin/fast-deep-equal\n * We added a case for file matching since `Object.keys` doesn't work with Files.\n * */\nfunction isEqual(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n if (a.constructor !== b.constructor)\n return false;\n // eslint-disable-next-line no-var\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n // eslint-disable-next-line eqeqeq\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (!isEqual(a[i], b[i]))\n return false;\n return true;\n }\n if (a instanceof Map && b instanceof Map) {\n if (a.size !== b.size)\n return false;\n for (i of a.entries())\n if (!b.has(i[0]))\n return false;\n for (i of a.entries())\n if (!isEqual(i[1], b.get(i[0])))\n return false;\n return true;\n }\n // We added this part for file comparison, arguably a little naive but should work for most cases.\n // #3911\n if (isFile(a) && isFile(b)) {\n if (a.size !== b.size)\n return false;\n if (a.name !== b.name)\n return false;\n if (a.lastModified !== b.lastModified)\n return false;\n if (a.type !== b.type)\n return false;\n return true;\n }\n if (a instanceof Set && b instanceof Set) {\n if (a.size !== b.size)\n return false;\n for (i of a.entries())\n if (!b.has(i[0]))\n return false;\n return true;\n }\n if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n // eslint-disable-next-line eqeqeq\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i])\n return false;\n return true;\n }\n if (a.constructor === RegExp)\n return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf)\n return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString)\n return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n for (i = length; i-- !== 0;) {\n // eslint-disable-next-line no-var\n var key = keys[i];\n if (!isEqual(a[key], b[key]))\n return false;\n }\n return true;\n }\n // true if both NaN, false otherwise\n // eslint-disable-next-line no-self-compare\n return a !== a && b !== b;\n}\nfunction isFile(a) {\n if (!isClient) {\n return false;\n }\n return a instanceof File;\n}\n\nfunction cleanupNonNestedPath(path) {\n if (isNotNestedPath(path)) {\n return path.replace(/\\[|\\]/gi, '');\n }\n return path;\n}\nfunction getFromPath(object, path, fallback) {\n if (!object) {\n return fallback;\n }\n if (isNotNestedPath(path)) {\n return object[cleanupNonNestedPath(path)];\n }\n const resolvedValue = (path || '')\n .split(/\\.|\\[(\\d+)\\]/)\n .filter(Boolean)\n .reduce((acc, propKey) => {\n if (isContainerValue(acc) && propKey in acc) {\n return acc[propKey];\n }\n return fallback;\n }, object);\n return resolvedValue;\n}\n/**\n * Sets a nested property value in a path, creates the path properties if it doesn't exist\n */\nfunction setInPath(object, path, value) {\n if (isNotNestedPath(path)) {\n object[cleanupNonNestedPath(path)] = value;\n return;\n }\n const keys = path.split(/\\.|\\[(\\d+)\\]/).filter(Boolean);\n let acc = object;\n for (let i = 0; i < keys.length; i++) {\n // Last key, set it\n if (i === keys.length - 1) {\n acc[keys[i]] = value;\n return;\n }\n // Key does not exist, create a container for it\n if (!(keys[i] in acc) || isNullOrUndefined(acc[keys[i]])) {\n // container can be either an object or an array depending on the next key if it exists\n acc[keys[i]] = isIndex(keys[i + 1]) ? [] : {};\n }\n acc = acc[keys[i]];\n }\n}\nfunction unset(object, key) {\n if (Array.isArray(object) && isIndex(key)) {\n object.splice(Number(key), 1);\n return;\n }\n if (isObject(object)) {\n delete object[key];\n }\n}\n/**\n * Removes a nested property from object\n */\nfunction unsetPath(object, path) {\n if (isNotNestedPath(path)) {\n delete object[cleanupNonNestedPath(path)];\n return;\n }\n const keys = path.split(/\\.|\\[(\\d+)\\]/).filter(Boolean);\n let acc = object;\n for (let i = 0; i < keys.length; i++) {\n // Last key, unset it\n if (i === keys.length - 1) {\n unset(acc, keys[i]);\n break;\n }\n // Key does not exist, exit\n if (!(keys[i] in acc) || isNullOrUndefined(acc[keys[i]])) {\n break;\n }\n acc = acc[keys[i]];\n }\n const pathValues = keys.map((_, idx) => {\n return getFromPath(object, keys.slice(0, idx).join('.'));\n });\n for (let i = pathValues.length - 1; i >= 0; i--) {\n if (!isEmptyContainer(pathValues[i])) {\n continue;\n }\n if (i === 0) {\n unset(object, keys[0]);\n continue;\n }\n unset(pathValues[i - 1], keys[i - 1]);\n }\n}\n/**\n * A typed version of Object.keys\n */\nfunction keysOf(record) {\n return Object.keys(record);\n}\n// Uses same component provide as its own injections\n// Due to changes in https://github.com/vuejs/vue-next/pull/2424\nfunction injectWithSelf(symbol, def = undefined) {\n const vm = getCurrentInstance();\n return (vm === null || vm === void 0 ? void 0 : vm.provides[symbol]) || inject(symbol, def);\n}\nfunction warn(message) {\n warn$1(`[vee-validate]: ${message}`);\n}\nfunction resolveNextCheckboxValue(currentValue, checkedValue, uncheckedValue) {\n if (Array.isArray(currentValue)) {\n const newVal = [...currentValue];\n // Use isEqual since checked object values can possibly fail the equality check #3883\n const idx = newVal.findIndex(v => isEqual(v, checkedValue));\n idx >= 0 ? newVal.splice(idx, 1) : newVal.push(checkedValue);\n return newVal;\n }\n return isEqual(currentValue, checkedValue) ? uncheckedValue : checkedValue;\n}\n/**\n * Creates a throttled function that only invokes the provided function (`func`) at most once per within a given number of milliseconds\n * (`limit`)\n */\nfunction throttle(func, limit) {\n let inThrottle;\n let lastResult;\n return function (...args) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const context = this;\n if (!inThrottle) {\n inThrottle = true;\n setTimeout(() => (inThrottle = false), limit);\n lastResult = func.apply(context, args);\n }\n return lastResult;\n };\n}\nfunction debounceAsync(inner, ms = 0) {\n let timer = null;\n let resolves = [];\n return function (...args) {\n // Run the function after a certain amount of time\n if (timer) {\n clearTimeout(timer);\n }\n // @ts-expect-error timer is a number\n timer = setTimeout(() => {\n // Get the result of the inner function, then apply it to the resolve function of\n // each promise that has been created since the last time the inner function was run\n const result = inner(...args);\n resolves.forEach(r => r(result));\n resolves = [];\n }, ms);\n return new Promise(resolve => resolves.push(resolve));\n };\n}\nfunction applyModelModifiers(value, modifiers) {\n if (!isObject(modifiers)) {\n return value;\n }\n if (modifiers.number) {\n return toNumber(value);\n }\n return value;\n}\nfunction withLatest(fn, onDone) {\n let latestRun;\n return async function runLatest(...args) {\n const pending = fn(...args);\n latestRun = pending;\n const result = await pending;\n if (pending !== latestRun) {\n return result;\n }\n latestRun = undefined;\n onDone(result, args);\n return result;\n };\n}\nfunction computedDeep({ get, set }) {\n const baseRef = ref(klona(get()));\n watch(get, newValue => {\n if (isEqual(newValue, baseRef.value)) {\n return;\n }\n baseRef.value = klona(newValue);\n }, {\n deep: true,\n });\n watch(baseRef, newValue => {\n if (isEqual(newValue, get())) {\n return;\n }\n set(klona(newValue));\n }, {\n deep: true,\n });\n return baseRef;\n}\nfunction normalizeErrorItem(message) {\n return Array.isArray(message) ? message : message ? [message] : [];\n}\nfunction resolveFieldOrPathState(path) {\n const form = injectWithSelf(FormContextKey);\n const state = path ? computed(() => form === null || form === void 0 ? void 0 : form.getPathState(toValue(path))) : undefined;\n const field = path ? undefined : inject(FieldContextKey);\n if (!field && !(state === null || state === void 0 ? void 0 : state.value)) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`field with name ${toValue(path)} was not found`);\n }\n }\n return state || field;\n}\nfunction omit(obj, keys) {\n const target = {};\n for (const key in obj) {\n if (!keys.includes(key)) {\n target[key] = obj[key];\n }\n }\n return target;\n}\nfunction debounceNextTick(inner) {\n let lastTick = null;\n let resolves = [];\n return function (...args) {\n // Run the function after a certain amount of time\n const thisTick = nextTick(() => {\n if (lastTick !== thisTick) {\n return;\n }\n // Get the result of the inner function, then apply it to the resolve function of\n // each promise that has been created since the last time the inner function was run\n const result = inner(...args);\n resolves.forEach(r => r(result));\n resolves = [];\n lastTick = null;\n });\n lastTick = thisTick;\n return new Promise(resolve => resolves.push(resolve));\n };\n}\n\nfunction normalizeChildren(tag, context, slotProps) {\n if (!context.slots.default) {\n return context.slots.default;\n }\n if (typeof tag === 'string' || !tag) {\n return context.slots.default(slotProps());\n }\n return {\n default: () => { var _a, _b; return (_b = (_a = context.slots).default) === null || _b === void 0 ? void 0 : _b.call(_a, slotProps()); },\n };\n}\n/**\n * Vue adds a `_value` prop at the moment on the input elements to store the REAL value on them, real values are different than the `value` attribute\n * as they do not get casted to strings unlike `el.value` which preserves user-code behavior\n */\nfunction getBoundValue(el) {\n if (hasValueBinding(el)) {\n return el._value;\n }\n return undefined;\n}\n/**\n * Vue adds a `_value` prop at the moment on the input elements to store the REAL value on them, real values are different than the `value` attribute\n * as they do not get casted to strings unlike `el.value` which preserves user-code behavior\n */\nfunction hasValueBinding(el) {\n return '_value' in el;\n}\n\nfunction parseInputValue(el) {\n if (el.type === 'number') {\n return Number.isNaN(el.valueAsNumber) ? el.value : el.valueAsNumber;\n }\n if (el.type === 'range') {\n return Number.isNaN(el.valueAsNumber) ? el.value : el.valueAsNumber;\n }\n return el.value;\n}\nfunction normalizeEventValue(value) {\n if (!isEvent(value)) {\n return value;\n }\n const input = value.target;\n // Vue sets the current bound value on `_value` prop\n // for checkboxes it it should fetch the value binding type as is (boolean instead of string)\n if (hasCheckedAttr(input.type) && hasValueBinding(input)) {\n return getBoundValue(input);\n }\n if (input.type === 'file' && input.files) {\n const files = Array.from(input.files);\n return input.multiple ? files : files[0];\n }\n if (isNativeMultiSelect(input)) {\n return Array.from(input.options)\n .filter(opt => opt.selected && !opt.disabled)\n .map(getBoundValue);\n }\n // makes sure we get the actual `option` bound value\n // #3440\n if (isNativeSelect(input)) {\n const selectedOption = Array.from(input.options).find(opt => opt.selected);\n return selectedOption ? getBoundValue(selectedOption) : input.value;\n }\n return parseInputValue(input);\n}\n\n/**\n * Normalizes the given rules expression.\n */\nfunction normalizeRules(rules) {\n const acc = {};\n Object.defineProperty(acc, '_$$isNormalized', {\n value: true,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n if (!rules) {\n return acc;\n }\n // Object is already normalized, skip.\n if (isObject(rules) && rules._$$isNormalized) {\n return rules;\n }\n if (isObject(rules)) {\n return Object.keys(rules).reduce((prev, curr) => {\n const params = normalizeParams(rules[curr]);\n if (rules[curr] !== false) {\n prev[curr] = buildParams(params);\n }\n return prev;\n }, acc);\n }\n /* istanbul ignore if */\n if (typeof rules !== 'string') {\n return acc;\n }\n return rules.split('|').reduce((prev, rule) => {\n const parsedRule = parseRule(rule);\n if (!parsedRule.name) {\n return prev;\n }\n prev[parsedRule.name] = buildParams(parsedRule.params);\n return prev;\n }, acc);\n}\n/**\n * Normalizes a rule param.\n */\nfunction normalizeParams(params) {\n if (params === true) {\n return [];\n }\n if (Array.isArray(params)) {\n return params;\n }\n if (isObject(params)) {\n return params;\n }\n return [params];\n}\nfunction buildParams(provided) {\n const mapValueToLocator = (value) => {\n // A target param using interpolation\n if (typeof value === 'string' && value[0] === '@') {\n return createLocator(value.slice(1));\n }\n return value;\n };\n if (Array.isArray(provided)) {\n return provided.map(mapValueToLocator);\n }\n // #3073\n if (provided instanceof RegExp) {\n return [provided];\n }\n return Object.keys(provided).reduce((prev, key) => {\n prev[key] = mapValueToLocator(provided[key]);\n return prev;\n }, {});\n}\n/**\n * Parses a rule string expression.\n */\nconst parseRule = (rule) => {\n let params = [];\n const name = rule.split(':')[0];\n if (rule.includes(':')) {\n params = rule.split(':').slice(1).join(':').split(',');\n }\n return { name, params };\n};\nfunction createLocator(value) {\n const locator = (crossTable) => {\n const val = getFromPath(crossTable, value) || crossTable[value];\n return val;\n };\n locator.__locatorRef = value;\n return locator;\n}\nfunction extractLocators(params) {\n if (Array.isArray(params)) {\n return params.filter(isLocator);\n }\n return keysOf(params)\n .filter(key => isLocator(params[key]))\n .map(key => params[key]);\n}\n\nconst DEFAULT_CONFIG = {\n generateMessage: ({ field }) => `${field} is not valid.`,\n bails: true,\n validateOnBlur: true,\n validateOnChange: true,\n validateOnInput: false,\n validateOnModelUpdate: true,\n};\nlet currentConfig = Object.assign({}, DEFAULT_CONFIG);\nconst getConfig = () => currentConfig;\nconst setConfig = (newConf) => {\n currentConfig = Object.assign(Object.assign({}, currentConfig), newConf);\n};\nconst configure = setConfig;\n\n/**\n * Validates a value against the rules.\n */\nasync function validate(value, rules, options = {}) {\n const shouldBail = options === null || options === void 0 ? void 0 : options.bails;\n const field = {\n name: (options === null || options === void 0 ? void 0 : options.name) || '{field}',\n rules,\n label: options === null || options === void 0 ? void 0 : options.label,\n bails: shouldBail !== null && shouldBail !== void 0 ? shouldBail : true,\n formData: (options === null || options === void 0 ? void 0 : options.values) || {},\n };\n const result = await _validate(field, value);\n const errors = result.errors;\n return {\n errors,\n valid: !errors.length,\n };\n}\n/**\n * Starts the validation process.\n */\nasync function _validate(field, value) {\n if (isTypedSchema(field.rules) || isYupValidator(field.rules)) {\n return validateFieldWithTypedSchema(value, field.rules);\n }\n // if a generic function or chain of generic functions\n if (isCallable(field.rules) || Array.isArray(field.rules)) {\n const ctx = {\n field: field.label || field.name,\n name: field.name,\n label: field.label,\n form: field.formData,\n value,\n };\n // Normalize the pipeline\n const pipeline = Array.isArray(field.rules) ? field.rules : [field.rules];\n const length = pipeline.length;\n const errors = [];\n for (let i = 0; i < length; i++) {\n const rule = pipeline[i];\n const result = await rule(value, ctx);\n const isValid = typeof result !== 'string' && !Array.isArray(result) && result;\n if (isValid) {\n continue;\n }\n if (Array.isArray(result)) {\n errors.push(...result);\n }\n else {\n const message = typeof result === 'string' ? result : _generateFieldError(ctx);\n errors.push(message);\n }\n if (field.bails) {\n return {\n errors,\n };\n }\n }\n return {\n errors,\n };\n }\n const normalizedContext = Object.assign(Object.assign({}, field), { rules: normalizeRules(field.rules) });\n const errors = [];\n const rulesKeys = Object.keys(normalizedContext.rules);\n const length = rulesKeys.length;\n for (let i = 0; i < length; i++) {\n const rule = rulesKeys[i];\n const result = await _test(normalizedContext, value, {\n name: rule,\n params: normalizedContext.rules[rule],\n });\n if (result.error) {\n errors.push(result.error);\n if (field.bails) {\n return {\n errors,\n };\n }\n }\n }\n return {\n errors,\n };\n}\nfunction isYupError(err) {\n return !!err && err.name === 'ValidationError';\n}\nfunction yupToTypedSchema(yupSchema) {\n const schema = {\n __type: 'VVTypedSchema',\n async parse(values) {\n var _a;\n try {\n const output = await yupSchema.validate(values, { abortEarly: false });\n return {\n output,\n errors: [],\n };\n }\n catch (err) {\n // Yup errors have a name prop one them.\n // https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n if (!isYupError(err)) {\n throw err;\n }\n if (!((_a = err.inner) === null || _a === void 0 ? void 0 : _a.length) && err.errors.length) {\n return { errors: [{ path: err.path, errors: err.errors }] };\n }\n const errors = err.inner.reduce((acc, curr) => {\n const path = curr.path || '';\n if (!acc[path]) {\n acc[path] = { errors: [], path };\n }\n acc[path].errors.push(...curr.errors);\n return acc;\n }, {});\n return { errors: Object.values(errors) };\n }\n },\n };\n return schema;\n}\n/**\n * Handles yup validation\n */\nasync function validateFieldWithTypedSchema(value, schema) {\n const typedSchema = isTypedSchema(schema) ? schema : yupToTypedSchema(schema);\n const result = await typedSchema.parse(value);\n const messages = [];\n for (const error of result.errors) {\n if (error.errors.length) {\n messages.push(...error.errors);\n }\n }\n return {\n errors: messages,\n };\n}\n/**\n * Tests a single input value against a rule.\n */\nasync function _test(field, value, rule) {\n const validator = resolveRule(rule.name);\n if (!validator) {\n throw new Error(`No such validator '${rule.name}' exists.`);\n }\n const params = fillTargetValues(rule.params, field.formData);\n const ctx = {\n field: field.label || field.name,\n name: field.name,\n label: field.label,\n value,\n form: field.formData,\n rule: Object.assign(Object.assign({}, rule), { params }),\n };\n const result = await validator(value, params, ctx);\n if (typeof result === 'string') {\n return {\n error: result,\n };\n }\n return {\n error: result ? undefined : _generateFieldError(ctx),\n };\n}\n/**\n * Generates error messages.\n */\nfunction _generateFieldError(fieldCtx) {\n const message = getConfig().generateMessage;\n if (!message) {\n return 'Field is invalid';\n }\n return message(fieldCtx);\n}\nfunction fillTargetValues(params, crossTable) {\n const normalize = (value) => {\n if (isLocator(value)) {\n return value(crossTable);\n }\n return value;\n };\n if (Array.isArray(params)) {\n return params.map(normalize);\n }\n return Object.keys(params).reduce((acc, param) => {\n acc[param] = normalize(params[param]);\n return acc;\n }, {});\n}\nasync function validateTypedSchema(schema, values) {\n const typedSchema = isTypedSchema(schema) ? schema : yupToTypedSchema(schema);\n const validationResult = await typedSchema.parse(klona(values));\n const results = {};\n const errors = {};\n for (const error of validationResult.errors) {\n const messages = error.errors;\n // Fixes issue with path mapping with Yup 1.0 including quotes around array indices\n const path = (error.path || '').replace(/\\[\"(\\d+)\"\\]/g, (_, m) => {\n return `[${m}]`;\n });\n results[path] = { valid: !messages.length, errors: messages };\n if (messages.length) {\n errors[path] = messages[0];\n }\n }\n return {\n valid: !validationResult.errors.length,\n results,\n errors,\n values: validationResult.value,\n };\n}\nasync function validateObjectSchema(schema, values, opts) {\n const paths = keysOf(schema);\n const validations = paths.map(async (path) => {\n var _a, _b, _c;\n const strings = (_a = opts === null || opts === void 0 ? void 0 : opts.names) === null || _a === void 0 ? void 0 : _a[path];\n const fieldResult = await validate(getFromPath(values, path), schema[path], {\n name: (strings === null || strings === void 0 ? void 0 : strings.name) || path,\n label: strings === null || strings === void 0 ? void 0 : strings.label,\n values: values,\n bails: (_c = (_b = opts === null || opts === void 0 ? void 0 : opts.bailsMap) === null || _b === void 0 ? void 0 : _b[path]) !== null && _c !== void 0 ? _c : true,\n });\n return Object.assign(Object.assign({}, fieldResult), { path });\n });\n let isAllValid = true;\n const validationResults = await Promise.all(validations);\n const results = {};\n const errors = {};\n for (const result of validationResults) {\n results[result.path] = {\n valid: result.valid,\n errors: result.errors,\n };\n if (!result.valid) {\n isAllValid = false;\n errors[result.path] = result.errors[0];\n }\n }\n return {\n valid: isAllValid,\n results,\n errors,\n };\n}\n\nlet ID_COUNTER = 0;\nfunction useFieldState(path, init) {\n const { value, initialValue, setInitialValue } = _useFieldValue(path, init.modelValue, init.form);\n if (!init.form) {\n const { errors, setErrors } = createFieldErrors();\n const id = ID_COUNTER >= Number.MAX_SAFE_INTEGER ? 0 : ++ID_COUNTER;\n const meta = createFieldMeta(value, initialValue, errors);\n function setState(state) {\n var _a;\n if ('value' in state) {\n value.value = state.value;\n }\n if ('errors' in state) {\n setErrors(state.errors);\n }\n if ('touched' in state) {\n meta.touched = (_a = state.touched) !== null && _a !== void 0 ? _a : meta.touched;\n }\n if ('initialValue' in state) {\n setInitialValue(state.initialValue);\n }\n }\n return {\n id,\n path,\n value,\n initialValue,\n meta,\n flags: { pendingUnmount: { [id]: false }, pendingReset: false },\n errors,\n setState,\n };\n }\n const state = init.form.createPathState(path, {\n bails: init.bails,\n label: init.label,\n type: init.type,\n validate: init.validate,\n });\n const errors = computed(() => state.errors);\n function setState(state) {\n var _a, _b, _c;\n if ('value' in state) {\n value.value = state.value;\n }\n if ('errors' in state) {\n (_a = init.form) === null || _a === void 0 ? void 0 : _a.setFieldError(unref(path), state.errors);\n }\n if ('touched' in state) {\n (_b = init.form) === null || _b === void 0 ? void 0 : _b.setFieldTouched(unref(path), (_c = state.touched) !== null && _c !== void 0 ? _c : false);\n }\n if ('initialValue' in state) {\n setInitialValue(state.initialValue);\n }\n }\n return {\n id: Array.isArray(state.id) ? state.id[state.id.length - 1] : state.id,\n path,\n value,\n errors,\n meta: state,\n initialValue,\n flags: state.__flags,\n setState,\n };\n}\n/**\n * Creates the field value and resolves the initial value\n */\nfunction _useFieldValue(path, modelValue, form) {\n const modelRef = ref(unref(modelValue));\n function resolveInitialValue() {\n if (!form) {\n return unref(modelRef);\n }\n return getFromPath(form.initialValues.value, unref(path), unref(modelRef));\n }\n function setInitialValue(value) {\n if (!form) {\n modelRef.value = value;\n return;\n }\n form.stageInitialValue(unref(path), value, true);\n }\n const initialValue = computed(resolveInitialValue);\n // if no form is associated, use a regular ref.\n if (!form) {\n const value = ref(resolveInitialValue());\n return {\n value,\n initialValue,\n setInitialValue,\n };\n }\n // to set the initial value, first check if there is a current value, if there is then use it.\n // otherwise use the configured initial value if it exists.\n // prioritize model value over form values\n // #3429\n const currentValue = resolveModelValue(modelValue, form, initialValue, path);\n form.stageInitialValue(unref(path), currentValue, true);\n // otherwise use a computed setter that triggers the `setFieldValue`\n const value = computed({\n get() {\n return getFromPath(form.values, unref(path));\n },\n set(newVal) {\n form.setFieldValue(unref(path), newVal, false);\n },\n });\n return {\n value,\n initialValue,\n setInitialValue,\n };\n}\n/*\n to set the initial value, first check if there is a current value, if there is then use it.\n otherwise use the configured initial value if it exists.\n prioritize model value over form values\n #3429\n*/\nfunction resolveModelValue(modelValue, form, initialValue, path) {\n if (isRef(modelValue)) {\n return unref(modelValue);\n }\n if (modelValue !== undefined) {\n return modelValue;\n }\n return getFromPath(form.values, unref(path), unref(initialValue));\n}\n/**\n * Creates meta flags state and some associated effects with them\n */\nfunction createFieldMeta(currentValue, initialValue, errors) {\n const meta = reactive({\n touched: false,\n pending: false,\n valid: true,\n validated: !!unref(errors).length,\n initialValue: computed(() => unref(initialValue)),\n dirty: computed(() => {\n return !isEqual(unref(currentValue), unref(initialValue));\n }),\n });\n watch(errors, value => {\n meta.valid = !value.length;\n }, {\n immediate: true,\n flush: 'sync',\n });\n return meta;\n}\n/**\n * Creates the error message state for the field state\n */\nfunction createFieldErrors() {\n const errors = ref([]);\n return {\n errors,\n setErrors: (messages) => {\n errors.value = normalizeErrorItem(messages);\n },\n };\n}\n\nfunction installDevtoolsPlugin(app) {\n if ((process.env.NODE_ENV !== 'production')) {\n setupDevtoolsPlugin({\n id: 'vee-validate-devtools-plugin',\n label: 'VeeValidate Plugin',\n packageName: 'vee-validate',\n homepage: 'https://vee-validate.logaretm.com/v4',\n app,\n logo: 'https://vee-validate.logaretm.com/v4/logo.png',\n }, setupApiHooks);\n }\n}\nconst DEVTOOLS_FORMS = {};\nconst DEVTOOLS_FIELDS = {};\nlet API;\nconst refreshInspector = throttle(() => {\n setTimeout(async () => {\n await nextTick();\n API === null || API === void 0 ? void 0 : API.sendInspectorState(INSPECTOR_ID);\n API === null || API === void 0 ? void 0 : API.sendInspectorTree(INSPECTOR_ID);\n }, 100);\n}, 100);\nfunction registerFormWithDevTools(form) {\n const vm = getCurrentInstance();\n if (!API) {\n const app = vm === null || vm === void 0 ? void 0 : vm.appContext.app;\n if (!app) {\n return;\n }\n installDevtoolsPlugin(app);\n }\n DEVTOOLS_FORMS[form.formId] = Object.assign({}, form);\n DEVTOOLS_FORMS[form.formId]._vm = vm;\n onUnmounted(() => {\n delete DEVTOOLS_FORMS[form.formId];\n refreshInspector();\n });\n refreshInspector();\n}\nfunction registerSingleFieldWithDevtools(field) {\n const vm = getCurrentInstance();\n if (!API) {\n const app = vm === null || vm === void 0 ? void 0 : vm.appContext.app;\n if (!app) {\n return;\n }\n installDevtoolsPlugin(app);\n }\n DEVTOOLS_FIELDS[field.id] = Object.assign({}, field);\n DEVTOOLS_FIELDS[field.id]._vm = vm;\n onUnmounted(() => {\n delete DEVTOOLS_FIELDS[field.id];\n refreshInspector();\n });\n refreshInspector();\n}\nconst INSPECTOR_ID = 'vee-validate-inspector';\nconst COLORS = {\n error: 0xbd4b4b,\n success: 0x06d77b,\n unknown: 0x54436b,\n white: 0xffffff,\n black: 0x000000,\n blue: 0x035397,\n purple: 0xb980f0,\n orange: 0xf5a962,\n gray: 0xbbbfca,\n};\nlet SELECTED_NODE = null;\nfunction setupApiHooks(api) {\n API = api;\n api.addInspector({\n id: INSPECTOR_ID,\n icon: 'rule',\n label: 'vee-validate',\n noSelectionText: 'Select a vee-validate node to inspect',\n actions: [\n {\n icon: 'done_outline',\n tooltip: 'Validate selected item',\n action: async () => {\n if (!SELECTED_NODE) {\n console.error('There is not a valid selected vee-validate node or component');\n return;\n }\n if (SELECTED_NODE.type === 'field') {\n await SELECTED_NODE.field.validate();\n return;\n }\n if (SELECTED_NODE.type === 'form') {\n await SELECTED_NODE.form.validate();\n return;\n }\n if (SELECTED_NODE.type === 'pathState') {\n await SELECTED_NODE.form.validateField(SELECTED_NODE.state.path);\n }\n },\n },\n {\n icon: 'delete_sweep',\n tooltip: 'Clear validation state of the selected item',\n action: () => {\n if (!SELECTED_NODE) {\n console.error('There is not a valid selected vee-validate node or component');\n return;\n }\n if (SELECTED_NODE.type === 'field') {\n SELECTED_NODE.field.resetField();\n return;\n }\n if (SELECTED_NODE.type === 'form') {\n SELECTED_NODE.form.resetForm();\n }\n if (SELECTED_NODE.type === 'pathState') {\n SELECTED_NODE.form.resetField(SELECTED_NODE.state.path);\n }\n },\n },\n ],\n });\n api.on.getInspectorTree(payload => {\n if (payload.inspectorId !== INSPECTOR_ID) {\n return;\n }\n const forms = Object.values(DEVTOOLS_FORMS);\n const fields = Object.values(DEVTOOLS_FIELDS);\n payload.rootNodes = [\n ...forms.map(mapFormForDevtoolsInspector),\n ...fields.map(field => mapFieldForDevtoolsInspector(field)),\n ];\n });\n api.on.getInspectorState((payload, ctx) => {\n if (payload.inspectorId !== INSPECTOR_ID || ctx.currentTab !== `custom-inspector:${INSPECTOR_ID}`) {\n return;\n }\n const { form, field, state, type } = decodeNodeId(payload.nodeId);\n if (form && type === 'form') {\n payload.state = buildFormState(form);\n SELECTED_NODE = { type: 'form', form };\n return;\n }\n if (state && type === 'pathState' && form) {\n payload.state = buildFieldState(state);\n SELECTED_NODE = { type: 'pathState', state, form };\n return;\n }\n if (field && type === 'field') {\n payload.state = buildFieldState({\n errors: field.errors.value,\n dirty: field.meta.dirty,\n valid: field.meta.valid,\n touched: field.meta.touched,\n value: field.value.value,\n initialValue: field.meta.initialValue,\n });\n SELECTED_NODE = { field, type: 'field' };\n return;\n }\n SELECTED_NODE = null;\n });\n}\nfunction mapFormForDevtoolsInspector(form) {\n const { textColor, bgColor } = getValidityColors(form.meta.value.valid);\n const formTreeNodes = {};\n Object.values(form.getAllPathStates()).forEach(state => {\n setInPath(formTreeNodes, unref(state.path), mapPathForDevtoolsInspector(state, form));\n });\n function buildFormTree(tree, path = []) {\n const key = [...path].pop();\n if ('id' in tree) {\n return Object.assign(Object.assign({}, tree), { label: key || tree.label });\n }\n if (isObject(tree)) {\n return {\n id: `${path.join('.')}`,\n label: key || '',\n children: Object.keys(tree).map(key => buildFormTree(tree[key], [...path, key])),\n };\n }\n if (Array.isArray(tree)) {\n return {\n id: `${path.join('.')}`,\n label: `${key}[]`,\n children: tree.map((c, idx) => buildFormTree(c, [...path, String(idx)])),\n };\n }\n return { id: '', label: '', children: [] };\n }\n const { children } = buildFormTree(formTreeNodes);\n return {\n id: encodeNodeId(form),\n label: 'Form',\n children,\n tags: [\n {\n label: 'Form',\n textColor,\n backgroundColor: bgColor,\n },\n {\n label: `${form.getAllPathStates().length} fields`,\n textColor: COLORS.white,\n backgroundColor: COLORS.unknown,\n },\n ],\n };\n}\nfunction mapPathForDevtoolsInspector(state, form) {\n return {\n id: encodeNodeId(form, state),\n label: unref(state.path),\n tags: getFieldNodeTags(state.multiple, state.fieldsCount, state.type, state.valid, form),\n };\n}\nfunction mapFieldForDevtoolsInspector(field, form) {\n return {\n id: encodeNodeId(form, field),\n label: unref(field.name),\n tags: getFieldNodeTags(false, 1, field.type, field.meta.valid, form),\n };\n}\nfunction getFieldNodeTags(multiple, fieldsCount, type, valid, form) {\n const { textColor, bgColor } = getValidityColors(valid);\n return [\n multiple\n ? undefined\n : {\n label: 'Field',\n textColor,\n backgroundColor: bgColor,\n },\n !form\n ? {\n label: 'Standalone',\n textColor: COLORS.black,\n backgroundColor: COLORS.gray,\n }\n : undefined,\n type === 'checkbox'\n ? {\n label: 'Checkbox',\n textColor: COLORS.white,\n backgroundColor: COLORS.blue,\n }\n : undefined,\n type === 'radio'\n ? {\n label: 'Radio',\n textColor: COLORS.white,\n backgroundColor: COLORS.purple,\n }\n : undefined,\n multiple\n ? {\n label: 'Multiple',\n textColor: COLORS.black,\n backgroundColor: COLORS.orange,\n }\n : undefined,\n ].filter(Boolean);\n}\nfunction encodeNodeId(form, stateOrField) {\n const type = stateOrField ? ('path' in stateOrField ? 'pathState' : 'field') : 'form';\n const fieldPath = stateOrField ? ('path' in stateOrField ? stateOrField === null || stateOrField === void 0 ? void 0 : stateOrField.path : unref(stateOrField === null || stateOrField === void 0 ? void 0 : stateOrField.name)) : '';\n const idObject = { f: form === null || form === void 0 ? void 0 : form.formId, ff: fieldPath, type };\n return btoa(encodeURIComponent(JSON.stringify(idObject)));\n}\nfunction decodeNodeId(nodeId) {\n try {\n const idObject = JSON.parse(decodeURIComponent(atob(nodeId)));\n const form = DEVTOOLS_FORMS[idObject.f];\n if (!form && idObject.ff) {\n const field = DEVTOOLS_FIELDS[idObject.ff];\n if (!field) {\n return {};\n }\n return {\n type: idObject.type,\n field,\n };\n }\n if (!form) {\n return {};\n }\n const state = form.getPathState(idObject.ff);\n return {\n type: idObject.type,\n form,\n state,\n };\n }\n catch (err) {\n // console.error(`Devtools: [vee-validate] Failed to parse node id ${nodeId}`);\n }\n return {};\n}\nfunction buildFieldState(state) {\n return {\n 'Field state': [\n { key: 'errors', value: state.errors },\n {\n key: 'initialValue',\n value: state.initialValue,\n },\n {\n key: 'currentValue',\n value: state.value,\n },\n {\n key: 'touched',\n value: state.touched,\n },\n {\n key: 'dirty',\n value: state.dirty,\n },\n {\n key: 'valid',\n value: state.valid,\n },\n ],\n };\n}\nfunction buildFormState(form) {\n const { errorBag, meta, values, isSubmitting, isValidating, submitCount } = form;\n return {\n 'Form state': [\n {\n key: 'submitCount',\n value: submitCount.value,\n },\n {\n key: 'isSubmitting',\n value: isSubmitting.value,\n },\n {\n key: 'isValidating',\n value: isValidating.value,\n },\n {\n key: 'touched',\n value: meta.value.touched,\n },\n {\n key: 'dirty',\n value: meta.value.dirty,\n },\n {\n key: 'valid',\n value: meta.value.valid,\n },\n {\n key: 'initialValues',\n value: meta.value.initialValues,\n },\n {\n key: 'currentValues',\n value: values,\n },\n {\n key: 'errors',\n value: keysOf(errorBag.value).reduce((acc, key) => {\n var _a;\n const message = (_a = errorBag.value[key]) === null || _a === void 0 ? void 0 : _a[0];\n if (message) {\n acc[key] = message;\n }\n return acc;\n }, {}),\n },\n ],\n };\n}\n/**\n * Resolves the tag color based on the form state\n */\nfunction getValidityColors(valid) {\n return {\n bgColor: valid ? COLORS.success : COLORS.error,\n textColor: valid ? COLORS.black : COLORS.white,\n };\n}\n\n/**\n * Creates a field composite.\n */\nfunction useField(path, rules, opts) {\n if (hasCheckedAttr(opts === null || opts === void 0 ? void 0 : opts.type)) {\n return useFieldWithChecked(path, rules, opts);\n }\n return _useField(path, rules, opts);\n}\nfunction _useField(path, rules, opts) {\n const { initialValue: modelValue, validateOnMount, bails, type, checkedValue, label, validateOnValueUpdate, uncheckedValue, controlled, keepValueOnUnmount, syncVModel, form: controlForm, } = normalizeOptions(opts);\n const injectedForm = controlled ? injectWithSelf(FormContextKey) : undefined;\n const form = controlForm || injectedForm;\n const name = computed(() => normalizeFormPath(toValue(path)));\n const validator = computed(() => {\n const schema = toValue(form === null || form === void 0 ? void 0 : form.schema);\n if (schema) {\n return undefined;\n }\n const rulesValue = unref(rules);\n if (isYupValidator(rulesValue) ||\n isTypedSchema(rulesValue) ||\n isCallable(rulesValue) ||\n Array.isArray(rulesValue)) {\n return rulesValue;\n }\n return normalizeRules(rulesValue);\n });\n const { id, value, initialValue, meta, setState, errors, flags } = useFieldState(name, {\n modelValue,\n form,\n bails,\n label,\n type,\n validate: validator.value ? validate$1 : undefined,\n });\n const errorMessage = computed(() => errors.value[0]);\n if (syncVModel) {\n useVModel({\n value,\n prop: syncVModel,\n handleChange,\n shouldValidate: () => validateOnValueUpdate && !flags.pendingReset,\n });\n }\n /**\n * Handles common onBlur meta update\n */\n const handleBlur = (evt, shouldValidate = false) => {\n meta.touched = true;\n if (shouldValidate) {\n validateWithStateMutation();\n }\n };\n async function validateCurrentValue(mode) {\n var _a, _b;\n if (form === null || form === void 0 ? void 0 : form.validateSchema) {\n return (_a = (await form.validateSchema(mode)).results[toValue(name)]) !== null && _a !== void 0 ? _a : { valid: true, errors: [] };\n }\n if (validator.value) {\n return validate(value.value, validator.value, {\n name: toValue(name),\n label: toValue(label),\n values: (_b = form === null || form === void 0 ? void 0 : form.values) !== null && _b !== void 0 ? _b : {},\n bails,\n });\n }\n return { valid: true, errors: [] };\n }\n const validateWithStateMutation = withLatest(async () => {\n meta.pending = true;\n meta.validated = true;\n return validateCurrentValue('validated-only');\n }, result => {\n if (flags.pendingUnmount[field.id]) {\n return;\n }\n setState({ errors: result.errors });\n meta.pending = false;\n meta.valid = result.valid;\n return result;\n });\n const validateValidStateOnly = withLatest(async () => {\n return validateCurrentValue('silent');\n }, result => {\n meta.valid = result.valid;\n return result;\n });\n function validate$1(opts) {\n if ((opts === null || opts === void 0 ? void 0 : opts.mode) === 'silent') {\n return validateValidStateOnly();\n }\n return validateWithStateMutation();\n }\n // Common input/change event handler\n function handleChange(e, shouldValidate = true) {\n const newValue = normalizeEventValue(e);\n setValue(newValue, shouldValidate);\n }\n // Runs the initial validation\n onMounted(() => {\n if (validateOnMount) {\n return validateWithStateMutation();\n }\n // validate self initially if no form was handling this\n // forms should have their own initial silent validation run to make things more efficient\n if (!form || !form.validateSchema) {\n validateValidStateOnly();\n }\n });\n function setTouched(isTouched) {\n meta.touched = isTouched;\n }\n function resetField(state) {\n var _a;\n const newValue = state && 'value' in state ? state.value : initialValue.value;\n setState({\n value: klona(newValue),\n initialValue: klona(newValue),\n touched: (_a = state === null || state === void 0 ? void 0 : state.touched) !== null && _a !== void 0 ? _a : false,\n errors: (state === null || state === void 0 ? void 0 : state.errors) || [],\n });\n meta.pending = false;\n meta.validated = false;\n validateValidStateOnly();\n }\n const vm = getCurrentInstance();\n function setValue(newValue, shouldValidate = true) {\n value.value = vm && syncVModel ? applyModelModifiers(newValue, vm.props.modelModifiers) : newValue;\n const validateFn = shouldValidate ? validateWithStateMutation : validateValidStateOnly;\n validateFn();\n }\n function setErrors(errors) {\n setState({ errors: Array.isArray(errors) ? errors : [errors] });\n }\n const valueProxy = computed({\n get() {\n return value.value;\n },\n set(newValue) {\n setValue(newValue, validateOnValueUpdate);\n },\n });\n if ((process.env.NODE_ENV !== 'production')) {\n watch(valueProxy, (value, oldValue) => {\n if (!isObject(value)) {\n return;\n }\n if (value === oldValue && isEqual(value, oldValue)) {\n warn$1('Detected a possible deep change on field `value` ref, for nested changes please either set the entire ref value or use `setValue` or `handleChange`.');\n }\n }, { deep: true });\n }\n const field = {\n id,\n name,\n label,\n value: valueProxy,\n meta,\n errors,\n errorMessage,\n type,\n checkedValue,\n uncheckedValue,\n bails,\n keepValueOnUnmount,\n resetField,\n handleReset: () => resetField(),\n validate: validate$1,\n handleChange,\n handleBlur,\n setState,\n setTouched,\n setErrors,\n setValue,\n };\n provide(FieldContextKey, field);\n if (isRef(rules) && typeof unref(rules) !== 'function') {\n watch(rules, (value, oldValue) => {\n if (isEqual(value, oldValue)) {\n return;\n }\n meta.validated ? validateWithStateMutation() : validateValidStateOnly();\n }, {\n deep: true,\n });\n }\n if ((process.env.NODE_ENV !== 'production')) {\n field._vm = getCurrentInstance();\n watch(() => (Object.assign(Object.assign({ errors: errors.value }, meta), { value: value.value })), refreshInspector, {\n deep: true,\n });\n if (!form) {\n registerSingleFieldWithDevtools(field);\n }\n }\n // if no associated form return the field API immediately\n if (!form) {\n return field;\n }\n // associate the field with the given form\n // extract cross-field dependencies in a computed prop\n const dependencies = computed(() => {\n const rulesVal = validator.value;\n // is falsy, a function schema or a yup schema\n if (!rulesVal ||\n isCallable(rulesVal) ||\n isYupValidator(rulesVal) ||\n isTypedSchema(rulesVal) ||\n Array.isArray(rulesVal)) {\n return {};\n }\n return Object.keys(rulesVal).reduce((acc, rule) => {\n const deps = extractLocators(rulesVal[rule])\n .map((dep) => dep.__locatorRef)\n .reduce((depAcc, depName) => {\n const depValue = getFromPath(form.values, depName) || form.values[depName];\n if (depValue !== undefined) {\n depAcc[depName] = depValue;\n }\n return depAcc;\n }, {});\n Object.assign(acc, deps);\n return acc;\n }, {});\n });\n // Adds a watcher that runs the validation whenever field dependencies change\n watch(dependencies, (deps, oldDeps) => {\n // Skip if no dependencies or if the field wasn't manipulated\n if (!Object.keys(deps).length) {\n return;\n }\n const shouldValidate = !isEqual(deps, oldDeps);\n if (shouldValidate) {\n meta.validated ? validateWithStateMutation() : validateValidStateOnly();\n }\n });\n onBeforeUnmount(() => {\n var _a;\n const shouldKeepValue = (_a = toValue(field.keepValueOnUnmount)) !== null && _a !== void 0 ? _a : toValue(form.keepValuesOnUnmount);\n const path = toValue(name);\n if (shouldKeepValue || !form || flags.pendingUnmount[field.id]) {\n form === null || form === void 0 ? void 0 : form.removePathState(path, id);\n return;\n }\n flags.pendingUnmount[field.id] = true;\n const pathState = form.getPathState(path);\n const matchesId = Array.isArray(pathState === null || pathState === void 0 ? void 0 : pathState.id) && (pathState === null || pathState === void 0 ? void 0 : pathState.multiple)\n ? pathState === null || pathState === void 0 ? void 0 : pathState.id.includes(field.id)\n : (pathState === null || pathState === void 0 ? void 0 : pathState.id) === field.id;\n if (!matchesId) {\n return;\n }\n if ((pathState === null || pathState === void 0 ? void 0 : pathState.multiple) && Array.isArray(pathState.value)) {\n const valueIdx = pathState.value.findIndex(i => isEqual(i, toValue(field.checkedValue)));\n if (valueIdx > -1) {\n const newVal = [...pathState.value];\n newVal.splice(valueIdx, 1);\n form.setFieldValue(path, newVal);\n }\n if (Array.isArray(pathState.id)) {\n pathState.id.splice(pathState.id.indexOf(field.id), 1);\n }\n }\n else {\n form.unsetPathValue(toValue(name));\n }\n form.removePathState(path, id);\n });\n return field;\n}\n/**\n * Normalizes partial field options to include the full options\n */\nfunction normalizeOptions(opts) {\n const defaults = () => ({\n initialValue: undefined,\n validateOnMount: false,\n bails: true,\n label: undefined,\n validateOnValueUpdate: true,\n keepValueOnUnmount: undefined,\n syncVModel: false,\n controlled: true,\n });\n const isVModelSynced = !!(opts === null || opts === void 0 ? void 0 : opts.syncVModel);\n const modelPropName = typeof (opts === null || opts === void 0 ? void 0 : opts.syncVModel) === 'string' ? opts.syncVModel : (opts === null || opts === void 0 ? void 0 : opts.modelPropName) || 'modelValue';\n const initialValue = isVModelSynced && !('initialValue' in (opts || {}))\n ? getCurrentModelValue(getCurrentInstance(), modelPropName)\n : opts === null || opts === void 0 ? void 0 : opts.initialValue;\n if (!opts) {\n return Object.assign(Object.assign({}, defaults()), { initialValue });\n }\n // TODO: Deprecate this in next major release\n const checkedValue = 'valueProp' in opts ? opts.valueProp : opts.checkedValue;\n const controlled = 'standalone' in opts ? !opts.standalone : opts.controlled;\n const syncVModel = (opts === null || opts === void 0 ? void 0 : opts.modelPropName) || (opts === null || opts === void 0 ? void 0 : opts.syncVModel) || false;\n return Object.assign(Object.assign(Object.assign({}, defaults()), (opts || {})), { initialValue, controlled: controlled !== null && controlled !== void 0 ? controlled : true, checkedValue,\n syncVModel });\n}\nfunction useFieldWithChecked(name, rules, opts) {\n const form = !(opts === null || opts === void 0 ? void 0 : opts.standalone) ? injectWithSelf(FormContextKey) : undefined;\n const checkedValue = opts === null || opts === void 0 ? void 0 : opts.checkedValue;\n const uncheckedValue = opts === null || opts === void 0 ? void 0 : opts.uncheckedValue;\n function patchCheckedApi(field) {\n const handleChange = field.handleChange;\n const checked = computed(() => {\n const currentValue = toValue(field.value);\n const checkedVal = toValue(checkedValue);\n return Array.isArray(currentValue)\n ? currentValue.findIndex(v => isEqual(v, checkedVal)) >= 0\n : isEqual(checkedVal, currentValue);\n });\n function handleCheckboxChange(e, shouldValidate = true) {\n var _a, _b;\n if (checked.value === ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.checked)) {\n if (shouldValidate) {\n field.validate();\n }\n return;\n }\n const path = toValue(name);\n const pathState = form === null || form === void 0 ? void 0 : form.getPathState(path);\n const value = normalizeEventValue(e);\n let newValue = (_b = toValue(checkedValue)) !== null && _b !== void 0 ? _b : value;\n if (form && (pathState === null || pathState === void 0 ? void 0 : pathState.multiple) && pathState.type === 'checkbox') {\n newValue = resolveNextCheckboxValue(getFromPath(form.values, path) || [], newValue, undefined);\n }\n else if ((opts === null || opts === void 0 ? void 0 : opts.type) === 'checkbox') {\n newValue = resolveNextCheckboxValue(toValue(field.value), newValue, toValue(uncheckedValue));\n }\n handleChange(newValue, shouldValidate);\n }\n return Object.assign(Object.assign({}, field), { checked,\n checkedValue,\n uncheckedValue, handleChange: handleCheckboxChange });\n }\n return patchCheckedApi(_useField(name, rules, opts));\n}\nfunction useVModel({ prop, value, handleChange, shouldValidate }) {\n const vm = getCurrentInstance();\n /* istanbul ignore next */\n if (!vm || !prop) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn('Failed to setup model events because `useField` was not called in setup.');\n }\n return;\n }\n const propName = typeof prop === 'string' ? prop : 'modelValue';\n const emitName = `update:${propName}`;\n // Component doesn't have a model prop setup (must be defined on the props)\n if (!(propName in vm.props)) {\n return;\n }\n watch(value, newValue => {\n if (isEqual(newValue, getCurrentModelValue(vm, propName))) {\n return;\n }\n vm.emit(emitName, newValue);\n });\n watch(() => getCurrentModelValue(vm, propName), propValue => {\n if (propValue === IS_ABSENT && value.value === undefined) {\n return;\n }\n const newValue = propValue === IS_ABSENT ? undefined : propValue;\n if (isEqual(newValue, value.value)) {\n return;\n }\n handleChange(newValue, shouldValidate());\n });\n}\nfunction getCurrentModelValue(vm, propName) {\n if (!vm) {\n return undefined;\n }\n return vm.props[propName];\n}\n\nconst FieldImpl = /** #__PURE__ */ defineComponent({\n name: 'Field',\n inheritAttrs: false,\n props: {\n as: {\n type: [String, Object],\n default: undefined,\n },\n name: {\n type: String,\n required: true,\n },\n rules: {\n type: [Object, String, Function],\n default: undefined,\n },\n validateOnMount: {\n type: Boolean,\n default: false,\n },\n validateOnBlur: {\n type: Boolean,\n default: undefined,\n },\n validateOnChange: {\n type: Boolean,\n default: undefined,\n },\n validateOnInput: {\n type: Boolean,\n default: undefined,\n },\n validateOnModelUpdate: {\n type: Boolean,\n default: undefined,\n },\n bails: {\n type: Boolean,\n default: () => getConfig().bails,\n },\n label: {\n type: String,\n default: undefined,\n },\n uncheckedValue: {\n type: null,\n default: undefined,\n },\n modelValue: {\n type: null,\n default: IS_ABSENT,\n },\n modelModifiers: {\n type: null,\n default: () => ({}),\n },\n 'onUpdate:modelValue': {\n type: null,\n default: undefined,\n },\n standalone: {\n type: Boolean,\n default: false,\n },\n keepValue: {\n type: Boolean,\n default: undefined,\n },\n },\n setup(props, ctx) {\n const rules = toRef(props, 'rules');\n const name = toRef(props, 'name');\n const label = toRef(props, 'label');\n const uncheckedValue = toRef(props, 'uncheckedValue');\n const keepValue = toRef(props, 'keepValue');\n const { errors, value, errorMessage, validate: validateField, handleChange, handleBlur, setTouched, resetField, handleReset, meta, checked, setErrors, } = useField(name, rules, {\n validateOnMount: props.validateOnMount,\n bails: props.bails,\n standalone: props.standalone,\n type: ctx.attrs.type,\n initialValue: resolveInitialValue(props, ctx),\n // Only for checkboxes and radio buttons\n checkedValue: ctx.attrs.value,\n uncheckedValue,\n label,\n validateOnValueUpdate: props.validateOnModelUpdate,\n keepValueOnUnmount: keepValue,\n syncVModel: true,\n });\n // If there is a v-model applied on the component we need to emit the `update:modelValue` whenever the value binding changes\n const onChangeHandler = function handleChangeWithModel(e, shouldValidate = true) {\n handleChange(e, shouldValidate);\n };\n const sharedProps = computed(() => {\n const { validateOnInput, validateOnChange, validateOnBlur, validateOnModelUpdate } = resolveValidationTriggers(props);\n function baseOnBlur(e) {\n handleBlur(e, validateOnBlur);\n if (isCallable(ctx.attrs.onBlur)) {\n ctx.attrs.onBlur(e);\n }\n }\n function baseOnInput(e) {\n onChangeHandler(e, validateOnInput);\n if (isCallable(ctx.attrs.onInput)) {\n ctx.attrs.onInput(e);\n }\n }\n function baseOnChange(e) {\n onChangeHandler(e, validateOnChange);\n if (isCallable(ctx.attrs.onChange)) {\n ctx.attrs.onChange(e);\n }\n }\n const attrs = {\n name: props.name,\n onBlur: baseOnBlur,\n onInput: baseOnInput,\n onChange: baseOnChange,\n };\n attrs['onUpdate:modelValue'] = e => onChangeHandler(e, validateOnModelUpdate);\n return attrs;\n });\n const fieldProps = computed(() => {\n const attrs = Object.assign({}, sharedProps.value);\n if (hasCheckedAttr(ctx.attrs.type) && checked) {\n attrs.checked = checked.value;\n }\n const tag = resolveTag(props, ctx);\n if (shouldHaveValueBinding(tag, ctx.attrs)) {\n attrs.value = value.value;\n }\n return attrs;\n });\n const componentProps = computed(() => {\n return Object.assign(Object.assign({}, sharedProps.value), { modelValue: value.value });\n });\n function slotProps() {\n return {\n field: fieldProps.value,\n componentField: componentProps.value,\n value: value.value,\n meta,\n errors: errors.value,\n errorMessage: errorMessage.value,\n validate: validateField,\n resetField,\n handleChange: onChangeHandler,\n handleInput: e => onChangeHandler(e, false),\n handleReset,\n handleBlur: sharedProps.value.onBlur,\n setTouched,\n setErrors,\n };\n }\n ctx.expose({\n setErrors,\n setTouched,\n reset: resetField,\n validate: validateField,\n handleChange,\n });\n return () => {\n const tag = resolveDynamicComponent(resolveTag(props, ctx));\n const children = normalizeChildren(tag, ctx, slotProps);\n if (tag) {\n return h(tag, Object.assign(Object.assign({}, ctx.attrs), fieldProps.value), children);\n }\n return children;\n };\n },\n});\nfunction resolveTag(props, ctx) {\n let tag = props.as || '';\n if (!props.as && !ctx.slots.default) {\n tag = 'input';\n }\n return tag;\n}\nfunction resolveValidationTriggers(props) {\n var _a, _b, _c, _d;\n const { validateOnInput, validateOnChange, validateOnBlur, validateOnModelUpdate } = getConfig();\n return {\n validateOnInput: (_a = props.validateOnInput) !== null && _a !== void 0 ? _a : validateOnInput,\n validateOnChange: (_b = props.validateOnChange) !== null && _b !== void 0 ? _b : validateOnChange,\n validateOnBlur: (_c = props.validateOnBlur) !== null && _c !== void 0 ? _c : validateOnBlur,\n validateOnModelUpdate: (_d = props.validateOnModelUpdate) !== null && _d !== void 0 ? _d : validateOnModelUpdate,\n };\n}\nfunction resolveInitialValue(props, ctx) {\n // Gets the initial value either from `value` prop/attr or `v-model` binding (modelValue)\n // For checkboxes and radio buttons it will always be the model value not the `value` attribute\n if (!hasCheckedAttr(ctx.attrs.type)) {\n return isPropPresent(props, 'modelValue') ? props.modelValue : ctx.attrs.value;\n }\n return isPropPresent(props, 'modelValue') ? props.modelValue : undefined;\n}\nconst Field = FieldImpl;\n\nlet FORM_COUNTER = 0;\nconst PRIVATE_PATH_STATE_KEYS = ['bails', 'fieldsCount', 'id', 'multiple', 'type', 'validate'];\nfunction resolveInitialValues(opts) {\n const providedValues = unref(opts === null || opts === void 0 ? void 0 : opts.initialValues) || {};\n const schema = unref(opts === null || opts === void 0 ? void 0 : opts.validationSchema);\n if (schema && isTypedSchema(schema) && isCallable(schema.cast)) {\n return klona(schema.cast(providedValues) || {});\n }\n return klona(providedValues);\n}\nfunction useForm(opts) {\n var _a;\n const formId = FORM_COUNTER++;\n // Prevents fields from double resetting their values, which causes checkboxes to toggle their initial value\n let FIELD_ID_COUNTER = 0;\n // If the form is currently submitting\n const isSubmitting = ref(false);\n // If the form is currently validating\n const isValidating = ref(false);\n // The number of times the user tried to submit the form\n const submitCount = ref(0);\n // field arrays managed by this form\n const fieldArrays = [];\n // a private ref for all form values\n const formValues = reactive(resolveInitialValues(opts));\n const pathStates = ref([]);\n const extraErrorsBag = ref({});\n const pathStateLookup = ref({});\n const rebuildPathLookup = debounceNextTick(() => {\n pathStateLookup.value = pathStates.value.reduce((names, state) => {\n names[normalizeFormPath(toValue(state.path))] = state;\n return names;\n }, {});\n });\n /**\n * Manually sets an error message on a specific field\n */\n function setFieldError(field, message) {\n const state = findPathState(field);\n if (!state) {\n if (typeof field === 'string') {\n extraErrorsBag.value[normalizeFormPath(field)] = normalizeErrorItem(message);\n }\n return;\n }\n // Move the error from the extras path if exists\n if (typeof field === 'string') {\n const normalizedPath = normalizeFormPath(field);\n if (extraErrorsBag.value[normalizedPath]) {\n delete extraErrorsBag.value[normalizedPath];\n }\n }\n state.errors = normalizeErrorItem(message);\n state.valid = !state.errors.length;\n }\n /**\n * Sets errors for the fields specified in the object\n */\n function setErrors(paths) {\n keysOf(paths).forEach(path => {\n setFieldError(path, paths[path]);\n });\n }\n if (opts === null || opts === void 0 ? void 0 : opts.initialErrors) {\n setErrors(opts.initialErrors);\n }\n const errorBag = computed(() => {\n const pathErrors = pathStates.value.reduce((acc, state) => {\n if (state.errors.length) {\n acc[state.path] = state.errors;\n }\n return acc;\n }, {});\n return Object.assign(Object.assign({}, extraErrorsBag.value), pathErrors);\n });\n // Gets the first error of each field\n const errors = computed(() => {\n return keysOf(errorBag.value).reduce((acc, key) => {\n const errors = errorBag.value[key];\n if (errors === null || errors === void 0 ? void 0 : errors.length) {\n acc[key] = errors[0];\n }\n return acc;\n }, {});\n });\n /**\n * Holds a computed reference to all fields names and labels\n */\n const fieldNames = computed(() => {\n return pathStates.value.reduce((names, state) => {\n names[state.path] = { name: state.path || '', label: state.label || '' };\n return names;\n }, {});\n });\n const fieldBailsMap = computed(() => {\n return pathStates.value.reduce((map, state) => {\n var _a;\n map[state.path] = (_a = state.bails) !== null && _a !== void 0 ? _a : true;\n return map;\n }, {});\n });\n // mutable non-reactive reference to initial errors\n // we need this to process initial errors then unset them\n const initialErrors = Object.assign({}, ((opts === null || opts === void 0 ? void 0 : opts.initialErrors) || {}));\n const keepValuesOnUnmount = (_a = opts === null || opts === void 0 ? void 0 : opts.keepValuesOnUnmount) !== null && _a !== void 0 ? _a : false;\n // initial form values\n const { initialValues, originalInitialValues, setInitialValues } = useFormInitialValues(pathStates, formValues, opts);\n // form meta aggregations\n const meta = useFormMeta(pathStates, formValues, originalInitialValues, errors);\n const controlledValues = computed(() => {\n return pathStates.value.reduce((acc, state) => {\n const value = getFromPath(formValues, state.path);\n setInPath(acc, state.path, value);\n return acc;\n }, {});\n });\n const schema = opts === null || opts === void 0 ? void 0 : opts.validationSchema;\n function createPathState(path, config) {\n var _a, _b;\n const initialValue = computed(() => getFromPath(initialValues.value, toValue(path)));\n const pathStateExists = pathStateLookup.value[toValue(path)];\n if (pathStateExists) {\n if ((config === null || config === void 0 ? void 0 : config.type) === 'checkbox' || (config === null || config === void 0 ? void 0 : config.type) === 'radio') {\n pathStateExists.multiple = true;\n }\n const id = FIELD_ID_COUNTER++;\n if (Array.isArray(pathStateExists.id)) {\n pathStateExists.id.push(id);\n }\n else {\n pathStateExists.id = [pathStateExists.id, id];\n }\n pathStateExists.fieldsCount++;\n pathStateExists.__flags.pendingUnmount[id] = false;\n return pathStateExists;\n }\n const currentValue = computed(() => getFromPath(formValues, toValue(path)));\n const pathValue = toValue(path);\n const id = FIELD_ID_COUNTER++;\n const state = reactive({\n id,\n path,\n touched: false,\n pending: false,\n valid: true,\n validated: !!((_a = initialErrors[pathValue]) === null || _a === void 0 ? void 0 : _a.length),\n initialValue,\n errors: shallowRef([]),\n bails: (_b = config === null || config === void 0 ? void 0 : config.bails) !== null && _b !== void 0 ? _b : false,\n label: config === null || config === void 0 ? void 0 : config.label,\n type: (config === null || config === void 0 ? void 0 : config.type) || 'default',\n value: currentValue,\n multiple: false,\n __flags: {\n pendingUnmount: { [id]: false },\n pendingReset: false,\n },\n fieldsCount: 1,\n validate: config === null || config === void 0 ? void 0 : config.validate,\n dirty: computed(() => {\n return !isEqual(unref(currentValue), unref(initialValue));\n }),\n });\n pathStates.value.push(state);\n pathStateLookup.value[pathValue] = state;\n rebuildPathLookup();\n if (errors.value[pathValue] && !initialErrors[pathValue]) {\n nextTick(() => {\n validateField(pathValue, { mode: 'silent' });\n });\n }\n // Handles when a path changes\n if (isRef(path)) {\n watch(path, newPath => {\n rebuildPathLookup();\n const nextValue = klona(currentValue.value);\n pathStateLookup.value[newPath] = state;\n nextTick(() => {\n setInPath(formValues, newPath, nextValue);\n });\n });\n }\n return state;\n }\n /**\n * Batches validation runs in 5ms batches\n * Must have two distinct batch queues to make sure they don't override each other settings #3783\n */\n const debouncedSilentValidation = debounceAsync(_validateSchema, 5);\n const debouncedValidation = debounceAsync(_validateSchema, 5);\n const validateSchema = withLatest(async (mode) => {\n return (await mode) === 'silent' ? debouncedSilentValidation() : debouncedValidation();\n }, (formResult, [mode]) => {\n // fields by id lookup\n // errors fields names, we need it to also check if custom errors are updated\n const currentErrorsPaths = keysOf(formCtx.errorBag.value);\n // collect all the keys from the schema and all fields\n // this ensures we have a complete key map of all the fields\n const paths = [\n ...new Set([...keysOf(formResult.results), ...pathStates.value.map(p => p.path), ...currentErrorsPaths]),\n ].sort();\n // aggregates the paths into a single result object while applying the results on the fields\n return paths.reduce((validation, _path) => {\n const path = _path;\n const pathState = findPathState(path) || findHoistedPath(path);\n const messages = (formResult.results[path] || { errors: [] }).errors;\n const fieldResult = {\n errors: messages,\n valid: !messages.length,\n };\n validation.results[path] = fieldResult;\n if (!fieldResult.valid) {\n validation.errors[path] = fieldResult.errors[0];\n }\n // clean up extra errors if path state exists\n if (pathState && extraErrorsBag.value[path]) {\n delete extraErrorsBag.value[path];\n }\n // field not rendered\n if (!pathState) {\n setFieldError(path, messages);\n return validation;\n }\n // always update the valid flag regardless of the mode\n pathState.valid = fieldResult.valid;\n if (mode === 'silent') {\n return validation;\n }\n if (mode === 'validated-only' && !pathState.validated) {\n return validation;\n }\n setFieldError(pathState, fieldResult.errors);\n return validation;\n }, { valid: formResult.valid, results: {}, errors: {} });\n });\n function mutateAllPathState(mutation) {\n pathStates.value.forEach(mutation);\n }\n function findPathState(path) {\n const normalizedPath = typeof path === 'string' ? normalizeFormPath(path) : path;\n const pathState = typeof normalizedPath === 'string' ? pathStateLookup.value[normalizedPath] : normalizedPath;\n return pathState;\n }\n function findHoistedPath(path) {\n const candidates = pathStates.value.filter(state => path.startsWith(state.path));\n return candidates.reduce((bestCandidate, candidate) => {\n if (!bestCandidate) {\n return candidate;\n }\n return (candidate.path.length > bestCandidate.path.length ? candidate : bestCandidate);\n }, undefined);\n }\n let UNSET_BATCH = [];\n let PENDING_UNSET;\n function unsetPathValue(path) {\n UNSET_BATCH.push(path);\n if (!PENDING_UNSET) {\n PENDING_UNSET = nextTick(() => {\n const sortedPaths = [...UNSET_BATCH].sort().reverse();\n sortedPaths.forEach(p => {\n unsetPath(formValues, p);\n });\n UNSET_BATCH = [];\n PENDING_UNSET = null;\n });\n }\n return PENDING_UNSET;\n }\n function makeSubmissionFactory(onlyControlled) {\n return function submitHandlerFactory(fn, onValidationError) {\n return function submissionHandler(e) {\n if (e instanceof Event) {\n e.preventDefault();\n e.stopPropagation();\n }\n // Touch all fields\n mutateAllPathState(s => (s.touched = true));\n isSubmitting.value = true;\n submitCount.value++;\n return validate()\n .then(result => {\n const values = klona(formValues);\n if (result.valid && typeof fn === 'function') {\n const controlled = klona(controlledValues.value);\n let submittedValues = (onlyControlled ? controlled : values);\n if (result.values) {\n submittedValues = result.values;\n }\n return fn(submittedValues, {\n evt: e,\n controlledValues: controlled,\n setErrors,\n setFieldError,\n setTouched,\n setFieldTouched,\n setValues,\n setFieldValue,\n resetForm,\n resetField,\n });\n }\n if (!result.valid && typeof onValidationError === 'function') {\n onValidationError({\n values,\n evt: e,\n errors: result.errors,\n results: result.results,\n });\n }\n })\n .then(returnVal => {\n isSubmitting.value = false;\n return returnVal;\n }, err => {\n isSubmitting.value = false;\n // re-throw the err so it doesn't go silent\n throw err;\n });\n };\n };\n }\n const handleSubmitImpl = makeSubmissionFactory(false);\n const handleSubmit = handleSubmitImpl;\n handleSubmit.withControlled = makeSubmissionFactory(true);\n function removePathState(path, id) {\n const idx = pathStates.value.findIndex(s => s.path === path);\n const pathState = pathStates.value[idx];\n if (idx === -1 || !pathState) {\n return;\n }\n nextTick(() => {\n validateField(path, { mode: 'silent', warn: false });\n });\n if (pathState.multiple && pathState.fieldsCount) {\n pathState.fieldsCount--;\n }\n if (Array.isArray(pathState.id)) {\n const idIndex = pathState.id.indexOf(id);\n if (idIndex >= 0) {\n pathState.id.splice(idIndex, 1);\n }\n delete pathState.__flags.pendingUnmount[id];\n }\n if (!pathState.multiple || pathState.fieldsCount <= 0) {\n pathStates.value.splice(idx, 1);\n unsetInitialValue(path);\n rebuildPathLookup();\n delete pathStateLookup.value[path];\n }\n }\n function markForUnmount(path) {\n return mutateAllPathState(s => {\n if (s.path.startsWith(path)) {\n keysOf(s.__flags.pendingUnmount).forEach(id => {\n s.__flags.pendingUnmount[id] = true;\n });\n }\n });\n }\n const formCtx = {\n formId,\n values: formValues,\n controlledValues,\n errorBag,\n errors,\n schema,\n submitCount,\n meta,\n isSubmitting,\n isValidating,\n fieldArrays,\n keepValuesOnUnmount,\n validateSchema: unref(schema) ? validateSchema : undefined,\n validate,\n setFieldError,\n validateField,\n setFieldValue,\n setValues,\n setErrors,\n setFieldTouched,\n setTouched,\n resetForm,\n resetField,\n handleSubmit,\n stageInitialValue,\n unsetInitialValue,\n setFieldInitialValue,\n useFieldModel,\n createPathState,\n getPathState: findPathState,\n unsetPathValue,\n removePathState,\n initialValues: initialValues,\n getAllPathStates: () => pathStates.value,\n markForUnmount,\n isFieldTouched,\n isFieldDirty,\n isFieldValid,\n };\n /**\n * Sets a single field value\n */\n function setFieldValue(field, value, shouldValidate = true) {\n const clonedValue = klona(value);\n const path = typeof field === 'string' ? field : field.path;\n const pathState = findPathState(path);\n if (!pathState) {\n createPathState(path);\n }\n setInPath(formValues, path, clonedValue);\n if (shouldValidate) {\n validateField(path);\n }\n }\n function forceSetValues(fields, shouldValidate = true) {\n // clean up old values\n keysOf(formValues).forEach(key => {\n delete formValues[key];\n });\n // set up new values\n keysOf(fields).forEach(path => {\n setFieldValue(path, fields[path], false);\n });\n if (shouldValidate) {\n validate();\n }\n }\n /**\n * Sets multiple fields values\n */\n function setValues(fields, shouldValidate = true) {\n merge(formValues, fields);\n // regenerate the arrays when the form values change\n fieldArrays.forEach(f => f && f.reset());\n if (shouldValidate) {\n validate();\n }\n }\n function createModel(path) {\n const pathState = findPathState(unref(path)) || createPathState(path);\n return computed({\n get() {\n return pathState.value;\n },\n set(value) {\n const pathValue = unref(path);\n setFieldValue(pathValue, value, false);\n pathState.validated = true;\n pathState.pending = true;\n validateField(pathValue).then(() => {\n pathState.pending = false;\n });\n },\n });\n }\n function useFieldModel(pathOrPaths) {\n if (!Array.isArray(pathOrPaths)) {\n return createModel(pathOrPaths);\n }\n return pathOrPaths.map(createModel);\n }\n /**\n * Sets the touched meta state on a field\n */\n function setFieldTouched(field, isTouched) {\n const pathState = findPathState(field);\n if (pathState) {\n pathState.touched = isTouched;\n }\n }\n function isFieldTouched(field) {\n var _a;\n return !!((_a = findPathState(field)) === null || _a === void 0 ? void 0 : _a.touched);\n }\n function isFieldDirty(field) {\n var _a;\n return !!((_a = findPathState(field)) === null || _a === void 0 ? void 0 : _a.dirty);\n }\n function isFieldValid(field) {\n var _a;\n return !!((_a = findPathState(field)) === null || _a === void 0 ? void 0 : _a.valid);\n }\n /**\n * Sets the touched meta state on multiple fields\n */\n function setTouched(fields) {\n if (typeof fields === 'boolean') {\n mutateAllPathState(state => {\n state.touched = fields;\n });\n return;\n }\n keysOf(fields).forEach(field => {\n setFieldTouched(field, !!fields[field]);\n });\n }\n function resetField(field, state) {\n var _a;\n const newValue = state && 'value' in state ? state.value : getFromPath(initialValues.value, field);\n const pathState = findPathState(field);\n if (pathState) {\n pathState.__flags.pendingReset = true;\n }\n setFieldInitialValue(field, klona(newValue));\n setFieldValue(field, newValue, false);\n setFieldTouched(field, (_a = state === null || state === void 0 ? void 0 : state.touched) !== null && _a !== void 0 ? _a : false);\n setFieldError(field, (state === null || state === void 0 ? void 0 : state.errors) || []);\n nextTick(() => {\n if (pathState) {\n pathState.__flags.pendingReset = false;\n }\n });\n }\n /**\n * Resets all fields\n */\n function resetForm(resetState, opts) {\n let newValues = (resetState === null || resetState === void 0 ? void 0 : resetState.values) ? resetState.values : originalInitialValues.value;\n newValues = isTypedSchema(schema) && isCallable(schema.cast) ? schema.cast(newValues) : newValues;\n setInitialValues(newValues);\n mutateAllPathState(state => {\n var _a;\n state.__flags.pendingReset = true;\n state.validated = false;\n state.touched = ((_a = resetState === null || resetState === void 0 ? void 0 : resetState.touched) === null || _a === void 0 ? void 0 : _a[state.path]) || false;\n setFieldValue(state.path, getFromPath(newValues, state.path), false);\n setFieldError(state.path, undefined);\n });\n (opts === null || opts === void 0 ? void 0 : opts.force) ? forceSetValues(newValues, false) : setValues(newValues, false);\n setErrors((resetState === null || resetState === void 0 ? void 0 : resetState.errors) || {});\n submitCount.value = (resetState === null || resetState === void 0 ? void 0 : resetState.submitCount) || 0;\n nextTick(() => {\n validate({ mode: 'silent' });\n mutateAllPathState(state => {\n state.__flags.pendingReset = false;\n });\n });\n }\n async function validate(opts) {\n const mode = (opts === null || opts === void 0 ? void 0 : opts.mode) || 'force';\n if (mode === 'force') {\n mutateAllPathState(f => (f.validated = true));\n }\n if (formCtx.validateSchema) {\n return formCtx.validateSchema(mode);\n }\n isValidating.value = true;\n // No schema, each field is responsible to validate itself\n const validations = await Promise.all(pathStates.value.map(state => {\n if (!state.validate) {\n return Promise.resolve({\n key: state.path,\n valid: true,\n errors: [],\n });\n }\n return state.validate(opts).then((result) => {\n return {\n key: state.path,\n valid: result.valid,\n errors: result.errors,\n };\n });\n }));\n isValidating.value = false;\n const results = {};\n const errors = {};\n for (const validation of validations) {\n results[validation.key] = {\n valid: validation.valid,\n errors: validation.errors,\n };\n if (validation.errors.length) {\n errors[validation.key] = validation.errors[0];\n }\n }\n return {\n valid: validations.every(r => r.valid),\n results,\n errors,\n };\n }\n async function validateField(path, opts) {\n var _a;\n const state = findPathState(path);\n if (state && (opts === null || opts === void 0 ? void 0 : opts.mode) !== 'silent') {\n state.validated = true;\n }\n if (schema) {\n const { results } = await validateSchema((opts === null || opts === void 0 ? void 0 : opts.mode) || 'validated-only');\n return results[path] || { errors: [], valid: true };\n }\n if (state === null || state === void 0 ? void 0 : state.validate) {\n return state.validate(opts);\n }\n const shouldWarn = !state && ((_a = opts === null || opts === void 0 ? void 0 : opts.warn) !== null && _a !== void 0 ? _a : true);\n if (shouldWarn) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn$1(`field with path ${path} was not found`);\n }\n }\n return Promise.resolve({ errors: [], valid: true });\n }\n function unsetInitialValue(path) {\n unsetPath(initialValues.value, path);\n }\n /**\n * Sneaky function to set initial field values\n */\n function stageInitialValue(path, value, updateOriginal = false) {\n setFieldInitialValue(path, value);\n setInPath(formValues, path, value);\n if (updateOriginal && !(opts === null || opts === void 0 ? void 0 : opts.initialValues)) {\n setInPath(originalInitialValues.value, path, klona(value));\n }\n }\n function setFieldInitialValue(path, value) {\n setInPath(initialValues.value, path, klona(value));\n }\n async function _validateSchema() {\n const schemaValue = unref(schema);\n if (!schemaValue) {\n return { valid: true, results: {}, errors: {} };\n }\n isValidating.value = true;\n const formResult = isYupValidator(schemaValue) || isTypedSchema(schemaValue)\n ? await validateTypedSchema(schemaValue, formValues)\n : await validateObjectSchema(schemaValue, formValues, {\n names: fieldNames.value,\n bailsMap: fieldBailsMap.value,\n });\n isValidating.value = false;\n return formResult;\n }\n const submitForm = handleSubmit((_, { evt }) => {\n if (isFormSubmitEvent(evt)) {\n evt.target.submit();\n }\n });\n // Trigger initial validation\n onMounted(() => {\n if (opts === null || opts === void 0 ? void 0 : opts.initialErrors) {\n setErrors(opts.initialErrors);\n }\n if (opts === null || opts === void 0 ? void 0 : opts.initialTouched) {\n setTouched(opts.initialTouched);\n }\n // if validate on mount was enabled\n if (opts === null || opts === void 0 ? void 0 : opts.validateOnMount) {\n validate();\n return;\n }\n // otherwise run initial silent validation through schema if available\n // the useField should skip their own silent validation if a yup schema is present\n if (formCtx.validateSchema) {\n formCtx.validateSchema('silent');\n }\n });\n if (isRef(schema)) {\n watch(schema, () => {\n var _a;\n (_a = formCtx.validateSchema) === null || _a === void 0 ? void 0 : _a.call(formCtx, 'validated-only');\n });\n }\n // Provide injections\n provide(FormContextKey, formCtx);\n if ((process.env.NODE_ENV !== 'production')) {\n registerFormWithDevTools(formCtx);\n watch(() => (Object.assign(Object.assign({ errors: errorBag.value }, meta.value), { values: formValues, isSubmitting: isSubmitting.value, isValidating: isValidating.value, submitCount: submitCount.value })), refreshInspector, {\n deep: true,\n });\n }\n function defineComponentBinds(path, config) {\n const pathState = findPathState(toValue(path)) || createPathState(path);\n const evalConfig = () => (isCallable(config) ? config(omit(pathState, PRIVATE_PATH_STATE_KEYS)) : config || {});\n function onBlur() {\n var _a;\n pathState.touched = true;\n const validateOnBlur = (_a = evalConfig().validateOnBlur) !== null && _a !== void 0 ? _a : getConfig().validateOnBlur;\n if (validateOnBlur) {\n validateField(pathState.path);\n }\n }\n function onUpdateModelValue(value) {\n var _a;\n const validateOnModelUpdate = (_a = evalConfig().validateOnModelUpdate) !== null && _a !== void 0 ? _a : getConfig().validateOnModelUpdate;\n setFieldValue(pathState.path, value, validateOnModelUpdate);\n }\n const props = computed(() => {\n if (isCallable(config)) {\n const configVal = config(pathState);\n const model = configVal.model || 'modelValue';\n return Object.assign({ onBlur, [model]: pathState.value, [`onUpdate:${model}`]: onUpdateModelValue }, (configVal.props || {}));\n }\n const model = (config === null || config === void 0 ? void 0 : config.model) || 'modelValue';\n const base = {\n onBlur,\n [model]: pathState.value,\n [`onUpdate:${model}`]: onUpdateModelValue,\n };\n if (config === null || config === void 0 ? void 0 : config.mapProps) {\n return Object.assign(Object.assign({}, base), config.mapProps(omit(pathState, PRIVATE_PATH_STATE_KEYS)));\n }\n return base;\n });\n return props;\n }\n function defineInputBinds(path, config) {\n const pathState = (findPathState(toValue(path)) || createPathState(path));\n const evalConfig = () => (isCallable(config) ? config(omit(pathState, PRIVATE_PATH_STATE_KEYS)) : config || {});\n function onBlur() {\n var _a;\n pathState.touched = true;\n const validateOnBlur = (_a = evalConfig().validateOnBlur) !== null && _a !== void 0 ? _a : getConfig().validateOnBlur;\n if (validateOnBlur) {\n validateField(pathState.path);\n }\n }\n function onInput(e) {\n var _a;\n const value = normalizeEventValue(e);\n const validateOnInput = (_a = evalConfig().validateOnInput) !== null && _a !== void 0 ? _a : getConfig().validateOnInput;\n setFieldValue(pathState.path, value, validateOnInput);\n }\n function onChange(e) {\n var _a;\n const value = normalizeEventValue(e);\n const validateOnChange = (_a = evalConfig().validateOnChange) !== null && _a !== void 0 ? _a : getConfig().validateOnChange;\n setFieldValue(pathState.path, value, validateOnChange);\n }\n const props = computed(() => {\n const base = {\n value: pathState.value,\n onChange,\n onInput,\n onBlur,\n };\n if (isCallable(config)) {\n return Object.assign(Object.assign({}, base), (config(omit(pathState, PRIVATE_PATH_STATE_KEYS)).attrs || {}));\n }\n if (config === null || config === void 0 ? void 0 : config.mapAttrs) {\n return Object.assign(Object.assign({}, base), config.mapAttrs(omit(pathState, PRIVATE_PATH_STATE_KEYS)));\n }\n return base;\n });\n return props;\n }\n return Object.assign(Object.assign({}, formCtx), { values: readonly(formValues), handleReset: () => resetForm(), submitForm,\n defineComponentBinds,\n defineInputBinds });\n}\n/**\n * Manages form meta aggregation\n */\nfunction useFormMeta(pathsState, currentValues, initialValues, errors) {\n const MERGE_STRATEGIES = {\n touched: 'some',\n pending: 'some',\n valid: 'every',\n };\n const isDirty = computed(() => {\n return !isEqual(currentValues, unref(initialValues));\n });\n function calculateFlags() {\n const states = pathsState.value;\n return keysOf(MERGE_STRATEGIES).reduce((acc, flag) => {\n const mergeMethod = MERGE_STRATEGIES[flag];\n acc[flag] = states[mergeMethod](s => s[flag]);\n return acc;\n }, {});\n }\n const flags = reactive(calculateFlags());\n watchEffect(() => {\n const value = calculateFlags();\n flags.touched = value.touched;\n flags.valid = value.valid;\n flags.pending = value.pending;\n });\n return computed(() => {\n return Object.assign(Object.assign({ initialValues: unref(initialValues) }, flags), { valid: flags.valid && !keysOf(errors.value).length, dirty: isDirty.value });\n });\n}\n/**\n * Manages the initial values prop\n */\nfunction useFormInitialValues(pathsState, formValues, opts) {\n const values = resolveInitialValues(opts);\n const providedValues = opts === null || opts === void 0 ? void 0 : opts.initialValues;\n // these are the mutable initial values as the fields are mounted/unmounted\n const initialValues = ref(values);\n // these are the original initial value as provided by the user initially, they don't keep track of conditional fields\n // this is important because some conditional fields will overwrite the initial values for other fields who had the same name\n // like array fields, any push/insert operation will overwrite the initial values because they \"create new fields\"\n // so these are the values that the reset function should use\n // these only change when the user explicitly changes the initial values or when the user resets them with new values.\n const originalInitialValues = ref(klona(values));\n function setInitialValues(values, updateFields = false) {\n initialValues.value = merge(klona(initialValues.value) || {}, klona(values));\n originalInitialValues.value = merge(klona(originalInitialValues.value) || {}, klona(values));\n if (!updateFields) {\n return;\n }\n // update the pristine non-touched fields\n // those are excluded because it's unlikely you want to change the form values using initial values\n // we mostly watch them for API population or newly inserted fields\n // if the user API is taking too much time before user interaction they should consider disabling or hiding their inputs until the values are ready\n pathsState.value.forEach(state => {\n const wasTouched = state.touched;\n if (wasTouched) {\n return;\n }\n const newValue = getFromPath(initialValues.value, state.path);\n setInPath(formValues, state.path, klona(newValue));\n });\n }\n if (isRef(providedValues)) {\n watch(providedValues, value => {\n if (value) {\n setInitialValues(value, true);\n }\n }, {\n deep: true,\n });\n }\n return {\n initialValues,\n originalInitialValues,\n setInitialValues,\n };\n}\n\nconst FormImpl = /** #__PURE__ */ defineComponent({\n name: 'Form',\n inheritAttrs: false,\n props: {\n as: {\n type: null,\n default: 'form',\n },\n validationSchema: {\n type: Object,\n default: undefined,\n },\n initialValues: {\n type: Object,\n default: undefined,\n },\n initialErrors: {\n type: Object,\n default: undefined,\n },\n initialTouched: {\n type: Object,\n default: undefined,\n },\n validateOnMount: {\n type: Boolean,\n default: false,\n },\n onSubmit: {\n type: Function,\n default: undefined,\n },\n onInvalidSubmit: {\n type: Function,\n default: undefined,\n },\n keepValues: {\n type: Boolean,\n default: false,\n },\n },\n setup(props, ctx) {\n const initialValues = toRef(props, 'initialValues');\n const validationSchema = toRef(props, 'validationSchema');\n const keepValues = toRef(props, 'keepValues');\n const { errors, errorBag, values, meta, isSubmitting, isValidating, submitCount, controlledValues, validate, validateField, handleReset, resetForm, handleSubmit, setErrors, setFieldError, setFieldValue, setValues, setFieldTouched, setTouched, resetField, } = useForm({\n validationSchema: validationSchema.value ? validationSchema : undefined,\n initialValues,\n initialErrors: props.initialErrors,\n initialTouched: props.initialTouched,\n validateOnMount: props.validateOnMount,\n keepValuesOnUnmount: keepValues,\n });\n const submitForm = handleSubmit((_, { evt }) => {\n if (isFormSubmitEvent(evt)) {\n evt.target.submit();\n }\n }, props.onInvalidSubmit);\n const onSubmit = props.onSubmit ? handleSubmit(props.onSubmit, props.onInvalidSubmit) : submitForm;\n function handleFormReset(e) {\n if (isEvent(e)) {\n // Prevent default form reset behavior\n e.preventDefault();\n }\n handleReset();\n if (typeof ctx.attrs.onReset === 'function') {\n ctx.attrs.onReset();\n }\n }\n function handleScopedSlotSubmit(evt, onSubmit) {\n const onSuccess = typeof evt === 'function' && !onSubmit ? evt : onSubmit;\n return handleSubmit(onSuccess, props.onInvalidSubmit)(evt);\n }\n function getValues() {\n return klona(values);\n }\n function getMeta() {\n return klona(meta.value);\n }\n function getErrors() {\n return klona(errors.value);\n }\n function slotProps() {\n return {\n meta: meta.value,\n errors: errors.value,\n errorBag: errorBag.value,\n values,\n isSubmitting: isSubmitting.value,\n isValidating: isValidating.value,\n submitCount: submitCount.value,\n controlledValues: controlledValues.value,\n validate,\n validateField,\n handleSubmit: handleScopedSlotSubmit,\n handleReset,\n submitForm,\n setErrors,\n setFieldError,\n setFieldValue,\n setValues,\n setFieldTouched,\n setTouched,\n resetForm,\n resetField,\n getValues,\n getMeta,\n getErrors,\n };\n }\n // expose these functions and methods as part of public API\n ctx.expose({\n setFieldError,\n setErrors,\n setFieldValue,\n setValues,\n setFieldTouched,\n setTouched,\n resetForm,\n validate,\n validateField,\n resetField,\n getValues,\n getMeta,\n getErrors,\n });\n return function renderForm() {\n // avoid resolving the form component as itself\n const tag = props.as === 'form' ? props.as : !props.as ? null : resolveDynamicComponent(props.as);\n const children = normalizeChildren(tag, ctx, slotProps);\n if (!tag) {\n return children;\n }\n // Attributes to add on a native `form` tag\n const formAttrs = tag === 'form'\n ? {\n // Disables native validation as vee-validate will handle it.\n novalidate: true,\n }\n : {};\n return h(tag, Object.assign(Object.assign(Object.assign({}, formAttrs), ctx.attrs), { onSubmit, onReset: handleFormReset }), children);\n };\n },\n});\nconst Form = FormImpl;\n\nfunction useFieldArray(arrayPath) {\n const form = injectWithSelf(FormContextKey, undefined);\n const fields = ref([]);\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n const noOp = () => { };\n const noOpApi = {\n fields,\n remove: noOp,\n push: noOp,\n swap: noOp,\n insert: noOp,\n update: noOp,\n replace: noOp,\n prepend: noOp,\n move: noOp,\n };\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly');\n }\n return noOpApi;\n }\n if (!unref(arrayPath)) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('FieldArray requires a field path to be provided, did you forget to pass the `name` prop?');\n }\n return noOpApi;\n }\n const alreadyExists = form.fieldArrays.find(a => unref(a.path) === unref(arrayPath));\n if (alreadyExists) {\n return alreadyExists;\n }\n let entryCounter = 0;\n function getCurrentValues() {\n return getFromPath(form === null || form === void 0 ? void 0 : form.values, unref(arrayPath), []) || [];\n }\n function initFields() {\n const currentValues = getCurrentValues();\n if (!Array.isArray(currentValues)) {\n return;\n }\n fields.value = currentValues.map((v, idx) => createEntry(v, idx, fields.value));\n updateEntryFlags();\n }\n initFields();\n function updateEntryFlags() {\n const fieldsLength = fields.value.length;\n for (let i = 0; i < fieldsLength; i++) {\n const entry = fields.value[i];\n entry.isFirst = i === 0;\n entry.isLast = i === fieldsLength - 1;\n }\n }\n function createEntry(value, idx, currentFields) {\n // Skips the work by returning the current entry if it already exists\n // This should make the `key` prop stable and doesn't cause more re-renders than needed\n // The value is computed and should update anyways\n if (currentFields && !isNullOrUndefined(idx) && currentFields[idx]) {\n return currentFields[idx];\n }\n const key = entryCounter++;\n const entry = {\n key,\n value: computedDeep({\n get() {\n const currentValues = getFromPath(form === null || form === void 0 ? void 0 : form.values, unref(arrayPath), []) || [];\n const idx = fields.value.findIndex(e => e.key === key);\n return idx === -1 ? value : currentValues[idx];\n },\n set(value) {\n const idx = fields.value.findIndex(e => e.key === key);\n if (idx === -1) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`Attempting to update a non-existent array item`);\n }\n return;\n }\n update(idx, value);\n },\n }),\n isFirst: false,\n isLast: false,\n };\n return entry;\n }\n function afterMutation() {\n updateEntryFlags();\n // Should trigger a silent validation since a field may not do that #4096\n form === null || form === void 0 ? void 0 : form.validate({ mode: 'silent' });\n }\n function remove(idx) {\n const pathName = unref(arrayPath);\n const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n if (!pathValue || !Array.isArray(pathValue)) {\n return;\n }\n const newValue = [...pathValue];\n newValue.splice(idx, 1);\n const fieldPath = pathName + `[${idx}]`;\n form.markForUnmount(fieldPath);\n form.unsetInitialValue(fieldPath);\n setInPath(form.values, pathName, newValue);\n fields.value.splice(idx, 1);\n afterMutation();\n }\n function push(initialValue) {\n const value = klona(initialValue);\n const pathName = unref(arrayPath);\n const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n const normalizedPathValue = isNullOrUndefined(pathValue) ? [] : pathValue;\n if (!Array.isArray(normalizedPathValue)) {\n return;\n }\n const newValue = [...normalizedPathValue];\n newValue.push(value);\n form.stageInitialValue(pathName + `[${newValue.length - 1}]`, value);\n setInPath(form.values, pathName, newValue);\n fields.value.push(createEntry(value));\n afterMutation();\n }\n function swap(indexA, indexB) {\n const pathName = unref(arrayPath);\n const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n if (!Array.isArray(pathValue) || !(indexA in pathValue) || !(indexB in pathValue)) {\n return;\n }\n const newValue = [...pathValue];\n const newFields = [...fields.value];\n // the old switcheroo\n const temp = newValue[indexA];\n newValue[indexA] = newValue[indexB];\n newValue[indexB] = temp;\n const tempEntry = newFields[indexA];\n newFields[indexA] = newFields[indexB];\n newFields[indexB] = tempEntry;\n setInPath(form.values, pathName, newValue);\n fields.value = newFields;\n updateEntryFlags();\n }\n function insert(idx, initialValue) {\n const value = klona(initialValue);\n const pathName = unref(arrayPath);\n const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n if (!Array.isArray(pathValue) || pathValue.length < idx) {\n return;\n }\n const newValue = [...pathValue];\n const newFields = [...fields.value];\n newValue.splice(idx, 0, value);\n newFields.splice(idx, 0, createEntry(value));\n setInPath(form.values, pathName, newValue);\n fields.value = newFields;\n afterMutation();\n }\n function replace(arr) {\n const pathName = unref(arrayPath);\n form.stageInitialValue(pathName, arr);\n setInPath(form.values, pathName, arr);\n initFields();\n afterMutation();\n }\n function update(idx, value) {\n const pathName = unref(arrayPath);\n const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n if (!Array.isArray(pathValue) || pathValue.length - 1 < idx) {\n return;\n }\n setInPath(form.values, `${pathName}[${idx}]`, value);\n form === null || form === void 0 ? void 0 : form.validate({ mode: 'validated-only' });\n }\n function prepend(initialValue) {\n const value = klona(initialValue);\n const pathName = unref(arrayPath);\n const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n const normalizedPathValue = isNullOrUndefined(pathValue) ? [] : pathValue;\n if (!Array.isArray(normalizedPathValue)) {\n return;\n }\n const newValue = [value, ...normalizedPathValue];\n form.stageInitialValue(pathName + `[${newValue.length - 1}]`, value);\n setInPath(form.values, pathName, newValue);\n fields.value.unshift(createEntry(value));\n afterMutation();\n }\n function move(oldIdx, newIdx) {\n const pathName = unref(arrayPath);\n const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName);\n const newValue = isNullOrUndefined(pathValue) ? [] : [...pathValue];\n if (!Array.isArray(pathValue) || !(oldIdx in pathValue) || !(newIdx in pathValue)) {\n return;\n }\n const newFields = [...fields.value];\n const movedItem = newFields[oldIdx];\n newFields.splice(oldIdx, 1);\n newFields.splice(newIdx, 0, movedItem);\n const movedValue = newValue[oldIdx];\n newValue.splice(oldIdx, 1);\n newValue.splice(newIdx, 0, movedValue);\n setInPath(form.values, pathName, newValue);\n fields.value = newFields;\n afterMutation();\n }\n const fieldArrayCtx = {\n fields,\n remove,\n push,\n swap,\n insert,\n update,\n replace,\n prepend,\n move,\n };\n form.fieldArrays.push(Object.assign({ path: arrayPath, reset: initFields }, fieldArrayCtx));\n onBeforeUnmount(() => {\n const idx = form.fieldArrays.findIndex(i => unref(i.path) === unref(arrayPath));\n if (idx >= 0) {\n form.fieldArrays.splice(idx, 1);\n }\n });\n // Makes sure to sync the form values with the array value if they go out of sync\n // #4153\n watch(getCurrentValues, formValues => {\n const fieldsValues = fields.value.map(f => f.value);\n // If form values are not the same as the current values then something overrode them.\n if (!isEqual(formValues, fieldsValues)) {\n initFields();\n }\n });\n return fieldArrayCtx;\n}\n\nconst FieldArrayImpl = /** #__PURE__ */ defineComponent({\n name: 'FieldArray',\n inheritAttrs: false,\n props: {\n name: {\n type: String,\n required: true,\n },\n },\n setup(props, ctx) {\n const { push, remove, swap, insert, replace, update, prepend, move, fields } = useFieldArray(toRef(props, 'name'));\n function slotProps() {\n return {\n fields: fields.value,\n push,\n remove,\n swap,\n insert,\n update,\n replace,\n prepend,\n move,\n };\n }\n ctx.expose({\n push,\n remove,\n swap,\n insert,\n update,\n replace,\n prepend,\n move,\n });\n return () => {\n const children = normalizeChildren(undefined, ctx, slotProps);\n return children;\n };\n },\n});\nconst FieldArray = FieldArrayImpl;\n\nconst ErrorMessageImpl = /** #__PURE__ */ defineComponent({\n name: 'ErrorMessage',\n props: {\n as: {\n type: String,\n default: undefined,\n },\n name: {\n type: String,\n required: true,\n },\n },\n setup(props, ctx) {\n const form = inject(FormContextKey, undefined);\n const message = computed(() => {\n return form === null || form === void 0 ? void 0 : form.errors.value[props.name];\n });\n function slotProps() {\n return {\n message: message.value,\n };\n }\n return () => {\n // Renders nothing if there are no messages\n if (!message.value) {\n return undefined;\n }\n const tag = (props.as ? resolveDynamicComponent(props.as) : props.as);\n const children = normalizeChildren(tag, ctx, slotProps);\n const attrs = Object.assign({ role: 'alert' }, ctx.attrs);\n // If no tag was specified and there are children\n // render the slot as is without wrapping it\n if (!tag && (Array.isArray(children) || !children) && (children === null || children === void 0 ? void 0 : children.length)) {\n return children;\n }\n // If no children in slot\n // render whatever specified and fallback to a <span> with the message in it's contents\n if ((Array.isArray(children) || !children) && !(children === null || children === void 0 ? void 0 : children.length)) {\n return h(tag || 'span', attrs, message.value);\n }\n return h(tag, attrs, children);\n };\n },\n});\nconst ErrorMessage = ErrorMessageImpl;\n\nfunction useResetForm() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return function resetForm(state) {\n if (!form) {\n return;\n }\n return form.resetForm(state);\n };\n}\n\n/**\n * If a field is dirty or not\n */\nfunction useIsFieldDirty(path) {\n const fieldOrPath = resolveFieldOrPathState(path);\n return computed(() => {\n var _a, _b;\n if (!fieldOrPath) {\n return false;\n }\n return (_b = ('meta' in fieldOrPath ? fieldOrPath.meta.dirty : (_a = fieldOrPath === null || fieldOrPath === void 0 ? void 0 : fieldOrPath.value) === null || _a === void 0 ? void 0 : _a.dirty)) !== null && _b !== void 0 ? _b : false;\n });\n}\n\n/**\n * If a field is touched or not\n */\nfunction useIsFieldTouched(path) {\n const fieldOrPath = resolveFieldOrPathState(path);\n return computed(() => {\n var _a, _b;\n if (!fieldOrPath) {\n return false;\n }\n return (_b = ('meta' in fieldOrPath ? fieldOrPath.meta.touched : (_a = fieldOrPath === null || fieldOrPath === void 0 ? void 0 : fieldOrPath.value) === null || _a === void 0 ? void 0 : _a.touched)) !== null && _b !== void 0 ? _b : false;\n });\n}\n\n/**\n * If a field is validated and is valid\n */\nfunction useIsFieldValid(path) {\n const fieldOrPath = resolveFieldOrPathState(path);\n return computed(() => {\n var _a, _b;\n if (!fieldOrPath) {\n return false;\n }\n return (_b = ('meta' in fieldOrPath ? fieldOrPath.meta.valid : (_a = fieldOrPath === null || fieldOrPath === void 0 ? void 0 : fieldOrPath.value) === null || _a === void 0 ? void 0 : _a.valid)) !== null && _b !== void 0 ? _b : false;\n });\n}\n\n/**\n * If the form is submitting or not\n */\nfunction useIsSubmitting() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return computed(() => {\n var _a;\n return (_a = form === null || form === void 0 ? void 0 : form.isSubmitting.value) !== null && _a !== void 0 ? _a : false;\n });\n}\n\n/**\n * If the form is validating or not\n */\nfunction useIsValidating() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return computed(() => {\n var _a;\n return (_a = form === null || form === void 0 ? void 0 : form.isValidating.value) !== null && _a !== void 0 ? _a : false;\n });\n}\n\n/**\n * Validates a single field\n */\nfunction useValidateField(path) {\n const form = injectWithSelf(FormContextKey);\n const field = path ? undefined : inject(FieldContextKey);\n return function validateField() {\n if (field) {\n return field.validate();\n }\n if (form && path) {\n return form === null || form === void 0 ? void 0 : form.validateField(toValue(path));\n }\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`field with name ${unref(path)} was not found`);\n }\n return Promise.resolve({\n errors: [],\n valid: true,\n });\n };\n}\n\n/**\n * If the form is dirty or not\n */\nfunction useIsFormDirty() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return computed(() => {\n var _a;\n return (_a = form === null || form === void 0 ? void 0 : form.meta.value.dirty) !== null && _a !== void 0 ? _a : false;\n });\n}\n\n/**\n * If the form is touched or not\n */\nfunction useIsFormTouched() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return computed(() => {\n var _a;\n return (_a = form === null || form === void 0 ? void 0 : form.meta.value.touched) !== null && _a !== void 0 ? _a : false;\n });\n}\n\n/**\n * If the form has been validated and is valid\n */\nfunction useIsFormValid() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return computed(() => {\n var _a;\n return (_a = form === null || form === void 0 ? void 0 : form.meta.value.valid) !== null && _a !== void 0 ? _a : false;\n });\n}\n\n/**\n * Validate multiple fields\n */\nfunction useValidateForm() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return function validateField() {\n if (!form) {\n return Promise.resolve({ results: {}, errors: {}, valid: true });\n }\n return form.validate();\n };\n}\n\n/**\n * The number of form's submission count\n */\nfunction useSubmitCount() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return computed(() => {\n var _a;\n return (_a = form === null || form === void 0 ? void 0 : form.submitCount.value) !== null && _a !== void 0 ? _a : 0;\n });\n}\n\n/**\n * Gives access to a field's current value\n */\nfunction useFieldValue(path) {\n const form = injectWithSelf(FormContextKey);\n // We don't want to use self injected context as it doesn't make sense\n const field = path ? undefined : inject(FieldContextKey);\n return computed(() => {\n if (path) {\n return getFromPath(form === null || form === void 0 ? void 0 : form.values, toValue(path));\n }\n return toValue(field === null || field === void 0 ? void 0 : field.value);\n });\n}\n\n/**\n * Gives access to a form's values\n */\nfunction useFormValues() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return computed(() => {\n return (form === null || form === void 0 ? void 0 : form.values) || {};\n });\n}\n\n/**\n * Gives access to all form errors\n */\nfunction useFormErrors() {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n return computed(() => {\n return ((form === null || form === void 0 ? void 0 : form.errors.value) || {});\n });\n}\n\n/**\n * Gives access to a single field error\n */\nfunction useFieldError(path) {\n const form = injectWithSelf(FormContextKey);\n // We don't want to use self injected context as it doesn't make sense\n const field = path ? undefined : inject(FieldContextKey);\n return computed(() => {\n if (path) {\n return form === null || form === void 0 ? void 0 : form.errors.value[toValue(path)];\n }\n return field === null || field === void 0 ? void 0 : field.errorMessage.value;\n });\n}\n\nfunction useSubmitForm(cb) {\n const form = injectWithSelf(FormContextKey);\n if (!form) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn('No vee-validate <Form /> or `useForm` was detected in the component tree');\n }\n }\n const onSubmit = form ? form.handleSubmit(cb) : undefined;\n return function submitForm(e) {\n if (!onSubmit) {\n return;\n }\n return onSubmit(e);\n };\n}\n\n/**\n * Sets a field's error message\n */\nfunction useSetFieldError(path) {\n const form = injectWithSelf(FormContextKey);\n // We don't want to use self injected context as it doesn't make sense\n const field = path ? undefined : inject(FieldContextKey);\n return function setFieldError(message) {\n if (path && form) {\n form.setFieldError(toValue(path), message);\n return;\n }\n if (field) {\n field.setErrors(message || []);\n return;\n }\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`Could not set error message since there is no form context or a field named \"${toValue(path)}\", did you forget to call \"useField\" or \"useForm\"?`);\n }\n };\n}\n\n/**\n * Sets a field's touched meta state\n */\nfunction useSetFieldTouched(path) {\n const form = injectWithSelf(FormContextKey);\n // We don't want to use self injected context as it doesn't make sense\n const field = path ? undefined : inject(FieldContextKey);\n return function setFieldTouched(touched) {\n if (path && form) {\n form.setFieldTouched(toValue(path), touched);\n return;\n }\n if (field) {\n field.setTouched(touched);\n return;\n }\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`Could not set touched state since there is no form context or a field named \"${toValue(path)}\", did you forget to call \"useField\" or \"useForm\"?`);\n }\n };\n}\n\n/**\n * Sets a field's value\n */\nfunction useSetFieldValue(path) {\n const form = injectWithSelf(FormContextKey);\n // We don't want to use self injected context as it doesn't make sense\n const field = path ? undefined : inject(FieldContextKey);\n return function setFieldValue(value, shouldValidate = true) {\n if (path && form) {\n form.setFieldValue(toValue(path), value, shouldValidate);\n return;\n }\n if (field) {\n field.setValue(value, shouldValidate);\n return;\n }\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`Could not set value since there is no form context or a field named \"${toValue(path)}\", did you forget to call \"useField\" or \"useForm\"?`);\n }\n };\n}\n\n/**\n * Sets multiple fields errors\n */\nfunction useSetFormErrors() {\n const form = injectWithSelf(FormContextKey);\n function setFormErrors(fields) {\n if (form) {\n form.setErrors(fields);\n return;\n }\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`Could not set errors because a form was not detected, did you forget to use \"useForm\" in a parent component?`);\n }\n }\n return setFormErrors;\n}\n\n/**\n * Sets multiple fields touched or all fields in the form\n */\nfunction useSetFormTouched() {\n const form = injectWithSelf(FormContextKey);\n function setFormTouched(fields) {\n if (form) {\n form.setTouched(fields);\n return;\n }\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`Could not set touched state because a form was not detected, did you forget to use \"useForm\" in a parent component?`);\n }\n }\n return setFormTouched;\n}\n\n/**\n * Sets multiple fields values\n */\nfunction useSetFormValues() {\n const form = injectWithSelf(FormContextKey);\n function setFormValues(fields, shouldValidate = true) {\n if (form) {\n form.setValues(fields, shouldValidate);\n return;\n }\n if ((process.env.NODE_ENV !== 'production')) {\n warn(`Could not set form values because a form was not detected, did you forget to use \"useForm\" in a parent component?`);\n }\n }\n return setFormValues;\n}\n\nexport { ErrorMessage, Field, FieldArray, FieldContextKey, Form, FormContextKey, IS_ABSENT, configure, defineRule, normalizeRules, useField, useFieldArray, useFieldError, useFieldValue, useForm, useFormErrors, useFormValues, useIsFieldDirty, useIsFieldTouched, useIsFieldValid, useIsFormDirty, useIsFormTouched, useIsFormValid, useIsSubmitting, useIsValidating, useResetForm, useSetFieldError, useSetFieldTouched, useSetFieldValue, useSetFormErrors, useSetFormTouched, useSetFormValues, useSubmitCount, useSubmitForm, useValidateField, useValidateForm, validate, validateObjectSchema as validateObject };\n"],"names":["isCallable","fn","isNullOrUndefined","value","isObject","obj","isIndex","toNumber","isObjectLike","getTag","isPlainObject","proto","merge","target","source","key","normalizeFormPath","path","pathArr","fullPath","i","RULES","resolveRule","id","set","val","klona","x","k","list","tmp","str","FormContextKey","FieldContextKey","IS_ABSENT","isClient","isLocator","isTypedSchema","isYupValidator","hasCheckedAttr","type","isContainerValue","isEmptyContainer","isNotNestedPath","isNativeMultiSelect","el","isNativeSelect","isNativeMultiSelectNode","tag","attrs","hasTruthyBindingValue","shouldHaveValueBinding","isFormSubmitEvent","evt","isEvent","isPropPresent","prop","isEqual","a","b","length","keys","isFile","cleanupNonNestedPath","getFromPath","object","fallback","acc","propKey","setInPath","unset","unsetPath","pathValues","_","idx","keysOf","record","injectWithSelf","symbol","def","vm","getCurrentInstance","inject","resolveNextCheckboxValue","currentValue","checkedValue","uncheckedValue","newVal","v","debounceAsync","inner","ms","timer","resolves","args","result","r","resolve","applyModelModifiers","modifiers","withLatest","onDone","latestRun","pending","computedDeep","get","baseRef","ref","watch","newValue","normalizeErrorItem","message","omit","debounceNextTick","lastTick","thisTick","nextTick","normalizeChildren","context","slotProps","_a","_b","getBoundValue","hasValueBinding","parseInputValue","normalizeEventValue","input","files","opt","selectedOption","normalizeRules","rules","prev","curr","params","normalizeParams","buildParams","rule","parsedRule","parseRule","provided","mapValueToLocator","createLocator","name","locator","crossTable","extractLocators","DEFAULT_CONFIG","field","currentConfig","getConfig","validate","options","shouldBail","errors","_validate","validateFieldWithTypedSchema","ctx","pipeline","_generateFieldError","normalizedContext","rulesKeys","_test","isYupError","err","yupToTypedSchema","yupSchema","values","schema","messages","error","validator","fillTargetValues","fieldCtx","normalize","param","validateTypedSchema","validationResult","results","m","validateObjectSchema","opts","validations","_c","strings","fieldResult","isAllValid","validationResults","ID_COUNTER","useFieldState","init","initialValue","setInitialValue","_useFieldValue","setState","state","setErrors","meta","createFieldErrors","createFieldMeta","computed","unref","modelValue","form","modelRef","resolveInitialValue","resolveModelValue","isRef","reactive","useField","useFieldWithChecked","_useField","validateOnMount","bails","label","validateOnValueUpdate","controlled","keepValueOnUnmount","syncVModel","controlForm","normalizeOptions","injectedForm","toValue","rulesValue","flags","validate$1","errorMessage","useVModel","handleChange","handleBlur","shouldValidate","validateWithStateMutation","validateCurrentValue","mode","validateValidStateOnly","e","setValue","onMounted","setTouched","isTouched","resetField","valueProxy","provide","oldValue","dependencies","rulesVal","deps","dep","depAcc","depName","depValue","oldDeps","onBeforeUnmount","shouldKeepValue","pathState","valueIdx","defaults","isVModelSynced","modelPropName","getCurrentModelValue","patchCheckedApi","checked","checkedVal","handleCheckboxChange","propName","emitName","propValue","FieldImpl","defineComponent","props","toRef","keepValue","validateField","handleReset","onChangeHandler","sharedProps","validateOnInput","validateOnChange","validateOnBlur","validateOnModelUpdate","resolveValidationTriggers","baseOnBlur","baseOnInput","baseOnChange","fieldProps","resolveTag","componentProps","resolveDynamicComponent","children","h","_d","Field","FORM_COUNTER","PRIVATE_PATH_STATE_KEYS","resolveInitialValues","providedValues","useForm","formId","FIELD_ID_COUNTER","isSubmitting","isValidating","submitCount","fieldArrays","formValues","pathStates","extraErrorsBag","pathStateLookup","rebuildPathLookup","names","setFieldError","findPathState","normalizedPath","paths","errorBag","pathErrors","fieldNames","fieldBailsMap","map","initialErrors","keepValuesOnUnmount","initialValues","originalInitialValues","setInitialValues","useFormInitialValues","useFormMeta","controlledValues","createPathState","config","pathStateExists","pathValue","shallowRef","newPath","nextValue","debouncedSilentValidation","_validateSchema","debouncedValidation","validateSchema","formResult","currentErrorsPaths","formCtx","p","validation","_path","findHoistedPath","mutateAllPathState","mutation","bestCandidate","candidate","UNSET_BATCH","PENDING_UNSET","unsetPathValue","makeSubmissionFactory","onlyControlled","onValidationError","s","submittedValues","setFieldTouched","setValues","setFieldValue","resetForm","returnVal","handleSubmit","removePathState","idIndex","unsetInitialValue","markForUnmount","stageInitialValue","setFieldInitialValue","useFieldModel","isFieldTouched","isFieldDirty","isFieldValid","clonedValue","forceSetValues","fields","f","createModel","pathOrPaths","resetState","newValues","updateOriginal","schemaValue","submitForm","defineComponentBinds","evalConfig","onBlur","onUpdateModelValue","configVal","model","base","defineInputBinds","onInput","onChange","readonly","pathsState","currentValues","MERGE_STRATEGIES","isDirty","calculateFlags","states","flag","mergeMethod","watchEffect","updateFields","FormImpl","validationSchema","keepValues","onSubmit","handleFormReset","handleScopedSlotSubmit","getValues","getMeta","getErrors","Form","useFieldArray","arrayPath","noOp","noOpApi","alreadyExists","entryCounter","getCurrentValues","initFields","createEntry","updateEntryFlags","fieldsLength","entry","currentFields","update","afterMutation","remove","pathName","fieldPath","push","normalizedPathValue","swap","indexA","indexB","newFields","temp","tempEntry","insert","replace","arr","prepend","move","oldIdx","newIdx","movedItem","movedValue","fieldArrayCtx","fieldsValues","ErrorMessageImpl","ErrorMessage"],"mappings":"gNAAA;AAAA;AAAA;AAAA;AAAA,IAQA,SAASA,EAAWC,EAAI,CACpB,OAAO,OAAOA,GAAO,UACzB,CACA,SAASC,GAAkBC,EAAO,CAC9B,OAAOA,GAAU,IACrB,CACA,MAAMC,GAAYC,GAAQA,IAAQ,MAAQ,CAAC,CAACA,GAAO,OAAOA,GAAQ,UAAY,CAAC,MAAM,QAAQA,CAAG,EAChG,SAASC,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