{"version":3,"sources":["webpack:///./node_modules/@vuelidate/core/dist/index.esm.js","webpack:///./node_modules/vue-demi/lib/index.mjs"],"names":["unwrapObj","obj","ignoreKeys","Object","keys","reduce","o","k","includes","isFunction","val","isProxy","value","_call","body","then","direct","result","Promise","resolve","e","reject","ROOT_PATH","_async","f","args","i","arguments","length","apply","this","sortValidations","validationsRaw","validations","validationKeys","rules","nestedValidators","config","forEach","key","v","$validator","startsWith","callRule","rule","instance","call","normalizeValidatorResponse","undefined","$valid","createAsyncResult","model","$pending","$dirty","$lazy","$response","watchTargets","$invalid","$pendingCounter","$unwatch","concat","ruleResult","err","data","catch","error","immediate","deep","createSyncResult","createValidatorResult","validatorName","propertyKey","propertyPath","$params","$async","$watchTargets","message","$message","$model","$propertyPath","$property","createValidationResults","resultsCache","path","externalResults","ruleKeys","cachedResult","get","$partial","$path","$touch","$reset","ruleKey","$externalResults","map","stringError","index","$uid","some","$error","$silentErrors","filter","res","$errors","set","collectNestedValidationResults","nestedState","nestedExternalResults","nestedValidationKeys","results","nestedKey","setValidations","state","parentKey","globalConfig","createMetaFields","nestedResults","childResults","allResults","allRes","values","every","r","modelErrors","nestedErrors","errors","$anyDirty","nr","$validate","unwatch","mergedConfig","assign","s","cachedExternalResults","external","$getResultsForChild","$clearExternalResults","$autoDirty","flush","ResultsStorage","storage","Map","storedRules","storedRulesKeys","newRulesKeys","hasAllValidators","paramKey","storedRuleResultPair","isValidCache","checkRulesValidity","VuelidateInjectChildResults","Symbol","VuelidateRemoveChildResults","CollectFlag","COLLECT_ALL","COLLECT_NONE","nestedValidations","$scope","childResultsRaw","childResultsKeys","injectChildResultsIntoParent","$registerAs","childScope","$stopPropagation","push","removeChildResultsFromParent","childKey","sendValidationResultsToParent","removeValidationResultsFromParent","useVuelidate","componentOptions","type","proxy","$options","uid","_uid","validationResults","ComputedProxyFactory","target","Proxy","prop","receiver","vuelidateExternalResults","validationsConfig","validationsWatchTarget","newValidationRules","isVue3"],"mappings":"kHAAA,kDAEA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,EAAqBC,EAAOE,IAAS,eAAS,IAAMF,EAAOE,OAN3GpE,EAAMpG,MAAQiC,EAAS+H,MAYvB,eAAM,IAAMnK,EAAW0B,GAASA,EAAMW,KAAKkE,EAAMpG,MAAO,IAAIqK,EAAqBjE,EAAMpG,QAAUuB,EAAOF,IACtG+I,EAAkBpK,MAAQmG,EAAe,CACvC9E,cACA+E,QACAK,eACAnC,eACAgC,eACArE,SAAUA,EAAS+H,MACnBxF,gBAAiBS,GAAoBhD,EAAS+H,MAAMU,4BAErD,CACDpH,WAAW,MAGfgD,EAAewD,EAAiBa,mBAAqBrE,MAChD,CACL,MAAMsE,EAAyB,eAAMvJ,IAAgBtB,EAAQsB,GAAeA,EAC1E,eAASA,GAAe,IAC1B,eAAMuJ,EAAwBC,IAC5BT,EAAkBpK,MAAQmG,EAAe,CACvC9E,YAAawJ,EACbzE,QACAK,eACAnC,eACAgC,eACArE,SAAUA,EAAWA,EAAS+H,MAAQ,GACtCxF,gBAAiBS,KAElB,CACD3B,WAAW,IAgBf,OAZIrB,IAEF0H,EAA8BS,EAAmB,CAC/Cf,cACAJ,SACAM,qBAGF,eAAgB,IAAMK,EAAkCP,KAInD,eAAS,IACP9J,OAAOgI,OAAO,GAAI,eAAM6C,EAAkBpK,OAAQyG,EAAazG,U,oCCl9B1E,+rBAEA,IACI8K,GAAS","file":"js/chunk-778f391e.754cc0b9.js","sourcesContent":["import { isReactive, isReadonly, unref, reactive, computed, isRef, watch, ref, nextTick, getCurrentInstance, isVue3, onBeforeMount, onBeforeUnmount, inject, provide } from 'vue-demi';\n\nfunction unwrapObj(obj, ignoreKeys = []) {\n return Object.keys(obj).reduce((o, k) => {\n if (ignoreKeys.includes(k)) return o;\n o[k] = unref(obj[k]);\n return o;\n }, {});\n}\nfunction isFunction(val) {\n return typeof val === 'function';\n}\nfunction isProxy(value) {\n return isReactive(value) || isReadonly(value);\n}\n\nfunction _call(body, then, direct) {\n if (direct) {\n return then ? then(body()) : body();\n }\n\n try {\n var result = Promise.resolve(body());\n return then ? result.then(then) : result;\n } catch (e) {\n return Promise.reject(e);\n }\n}\n\nconst ROOT_PATH = '__root';\n/**\n * @typedef {import('vue-demi').ComponentPublicInstance} VueInstance\n */\n\n/**\n * @typedef {import('vue-demi').ComputedRef} ComputedRef\n */\n\n/**\n * @typedef {import('vue-demi').WatchStopHandle} WatchStopHandle\n */\n\n/**\n * @typedef NormalizedValidator\n * @property {Validator} $validator\n * @property {String | Ref | function(*): string} [$message]\n * @property {Object | Ref} [$params]\n * @property {Object | Ref} [$async]\n * @property {Ref<*>[]} [$watchTargets]\n */\n\n/**\n * Response form a raw Validator function.\n * Should return a Boolean or an object with $invalid property.\n * @typedef {Boolean | { $valid: Boolean }} ValidatorResponse\n */\n\n/**\n * Raw validator function, before being normalized\n * Can return a Promise or a {@see ValidatorResponse}\n * @typedef {function(*): ((Promise | ValidatorResponse))} Validator\n */\n\n/**\n * Sorts the validators for a state tree branch\n * @param {Object} validationsRaw\n * @return {{ rules: Object, nestedValidators: Object, config: GlobalConfig }}\n */\n\nfunction _async(f) {\n return function () {\n for (var args = [], i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n\n try {\n return Promise.resolve(f.apply(this, args));\n } catch (e) {\n return Promise.reject(e);\n }\n };\n}\n/**\n * Calls a validation rule by unwrapping its value first from a ref.\n * @param {Validator} rule\n * @param {Ref} value\n * @param {VueInstance} instance\n * @return {Promise | ValidatorResponse}\n */\n\n\nfunction sortValidations(validationsRaw = {}) {\n const validations = unref(validationsRaw);\n const validationKeys = Object.keys(validations);\n const rules = {};\n const nestedValidators = {};\n const config = {};\n validationKeys.forEach(key => {\n const v = validations[key];\n\n switch (true) {\n // If it is already normalized, use it\n case isFunction(v.$validator):\n rules[key] = v;\n break;\n // If it is just a function, normalize it first\n // into { $validator: }\n\n case isFunction(v):\n rules[key] = {\n $validator: v\n };\n break;\n // Catch $-prefixed properties as config\n\n case key.startsWith('$'):\n config[key] = v;\n break;\n // If it doesn’t match any of the above,\n // treat as nestedValidators state property\n\n default:\n nestedValidators[key] = v;\n }\n });\n return {\n rules,\n nestedValidators,\n config\n };\n}\n\nfunction callRule(rule, value, instance) {\n const v = unref(value);\n return rule.call(instance, v, instance);\n}\n/**\n * Normalizes the validator result\n * Allows passing a boolean of an object like `{ $valid: Boolean }`\n * @param {ValidatorResponse} result - Validator result\n * @return {boolean}\n */\n\n\nfunction normalizeValidatorResponse(result) {\n return result.$valid !== undefined ? !result.$valid : !result;\n}\n/**\n * Returns the result of an async validator.\n * @param {Validator} rule\n * @param {Ref<*>} model\n * @param {Ref} $pending\n * @param {Ref} $dirty\n * @param {GlobalConfig} config\n * @param {boolean} config.$lazy\n * @param {Ref<*>} $response\n * @param {VueInstance} instance\n * @param {Ref<*>[]} watchTargets\n * @return {{ $invalid: Ref, $unwatch: WatchStopHandle }}\n */\n\n\nfunction createAsyncResult(rule, model, $pending, $dirty, {\n $lazy\n}, $response, instance, watchTargets = []) {\n const $invalid = ref(!!$dirty.value);\n const $pendingCounter = ref(0);\n $pending.value = false;\n const $unwatch = watch([model, $dirty].concat(watchTargets), () => {\n if ($lazy && !$dirty.value) return false;\n let ruleResult; // make sure we dont break if a validator throws\n\n try {\n ruleResult = callRule(rule, model, instance);\n } catch (err) {\n // convert to a promise, so we can handle it async\n ruleResult = Promise.reject(err);\n }\n\n $pendingCounter.value++;\n $pending.value = !!$pendingCounter.value; // ensure $invalid is false, while validator is resolving\n\n $invalid.value = false;\n Promise.resolve(ruleResult).then(data => {\n $pendingCounter.value--;\n $pending.value = !!$pendingCounter.value;\n $response.value = data;\n $invalid.value = normalizeValidatorResponse(data);\n }).catch(error => {\n $pendingCounter.value--;\n $pending.value = !!$pendingCounter.value;\n $response.value = error;\n $invalid.value = true;\n });\n }, {\n immediate: true,\n deep: typeof model === 'object'\n });\n return {\n $invalid,\n $unwatch\n };\n}\n/**\n * Returns the result of a sync validator\n * @param {Validator} rule\n * @param {Ref<*>} model\n * @param {Ref} $dirty\n * @param {GlobalConfig} config\n * @param {Boolean} config.$lazy\n * @param {Ref<*>} $response\n * @param {VueInstance} instance\n * @return {{$unwatch: (function(): {}), $invalid: ComputedRef}}\n */\n\n\nfunction createSyncResult(rule, model, $dirty, {\n $lazy\n}, $response, instance) {\n const $unwatch = () => ({});\n\n const $invalid = computed(() => {\n if ($lazy && !$dirty.value) return false;\n\n try {\n const result = callRule(rule, model, instance);\n $response.value = result;\n return normalizeValidatorResponse(result);\n } catch (err) {\n $response.value = err;\n }\n\n return true;\n });\n return {\n $unwatch,\n $invalid\n };\n}\n/**\n * Returns the validation result.\n * Detects async and sync validators.\n * @param {NormalizedValidator} rule\n * @param {Ref<*>} model\n * @param {Ref} $dirty\n * @param {GlobalConfig} config - Vuelidate config\n * @param {VueInstance} instance - component instance\n * @param {string} validatorName - name of the current validator\n * @param {string} propertyKey - the current property we are validating\n * @param {string} propertyPath - the deep path to the validated property\n * @return {{ $params: *, $message: Ref, $pending: Ref, $invalid: Ref, $response: Ref<*>, $unwatch: WatchStopHandle }}\n */\n\n\nfunction createValidatorResult(rule, model, $dirty, config, instance, validatorName, propertyKey, propertyPath) {\n const $pending = ref(false);\n const $params = rule.$params || {};\n const $response = ref(null);\n let $invalid;\n let $unwatch;\n\n if (rule.$async) {\n ({\n $invalid,\n $unwatch\n } = createAsyncResult(rule.$validator, model, $pending, $dirty, config, $response, instance, rule.$watchTargets));\n } else {\n ({\n $invalid,\n $unwatch\n } = createSyncResult(rule.$validator, model, $dirty, config, $response, instance));\n }\n\n const message = rule.$message;\n const $message = isFunction(message) ? computed(() => message(unwrapObj({\n $pending,\n $invalid,\n $params: unwrapObj($params),\n // $params can hold refs, so we unwrap them for easy access\n $model: model,\n $response,\n $validator: validatorName,\n $propertyPath: propertyPath,\n $property: propertyKey\n }))) : message || '';\n return {\n $message,\n $params,\n $pending,\n $invalid,\n $response,\n $unwatch\n };\n}\n/**\n * @typedef ErrorObject\n * @property {Ref} $message - Reactive error message\n * @property {Ref} $params - Params passed from withParams\n * @property {Ref} $pending - If validation is pending\n * @property {String} $property - State key\n * @property {String} $propertyPath - Dot notation path to state\n * @property {String} $validator - Validator name\n * @property {String} $uid - Unique identifier\n */\n\n/**\n * @typedef ValidationResult\n * @property {Ref} $pending\n * @property {Ref} $dirty\n * @property {Ref} $invalid\n * @property {Ref} $error\n * @property {Ref} $path\n * @property {Function} $touch\n * @property {Function} $reset\n * @property {ComputedRef} $errors\n * @property {ComputedRef} $silentErrors\n */\n\n/**\n * Creates the main Validation Results object for a state tree\n * Walks the tree's top level branches\n * @param {Object} rules - Rules for the current state tree\n * @param {Object} model - Current state value\n * @param {String} key - Key for the current state tree\n * @param {ResultsStorage} [resultsCache] - A cache map of all the validators\n * @param {String} [path] - the current property path\n * @param {GlobalConfig} [config] - the config object\n * @param {VueInstance} instance\n * @param {ComputedRef} externalResults\n * @return {ValidationResult | {}}\n */\n\n\nfunction createValidationResults(rules, model, key, resultsCache, path, config, instance, externalResults) {\n // collect the property keys\n const ruleKeys = Object.keys(rules);\n const cachedResult = resultsCache.get(path, rules);\n const $dirty = ref(false);\n\n if (cachedResult) {\n // if the rules are the same as before, use the cached results\n if (!cachedResult.$partial) return cachedResult; // remove old watchers\n\n cachedResult.$unwatch(); // use the `$dirty.value`, so we dont save references by accident\n\n $dirty.value = cachedResult.$dirty.value;\n }\n\n const result = {\n // restore $dirty from cache\n $dirty,\n $path: path,\n $touch: () => {\n if (!$dirty.value) $dirty.value = true;\n },\n $reset: () => {\n if ($dirty.value) $dirty.value = false;\n }\n };\n /**\n * If there are no validation rules, it is most likely\n * a top level state, aka root\n */\n\n if (!ruleKeys.length) {\n // if there are cached results, we should overwrite them with the new ones\n cachedResult && resultsCache.set(path, rules, result);\n return result;\n }\n\n ruleKeys.forEach(ruleKey => {\n result[ruleKey] = createValidatorResult(rules[ruleKey], model, result.$dirty, config, instance, ruleKey, key, path);\n });\n result.$externalResults = computed(() => {\n if (!externalResults.value) return [];\n return [].concat(externalResults.value).map((stringError, index) => ({\n $propertyPath: path,\n $property: key,\n $validator: '$externalResults',\n $uid: `${path}-externalResult-${index}`,\n $message: stringError,\n $params: {},\n $response: null,\n $pending: false\n }));\n });\n result.$invalid = computed(() => !!result.$externalResults.value.length || ruleKeys.some(ruleKey => unref(result[ruleKey].$invalid)));\n result.$pending = computed(() => ruleKeys.some(ruleKey => unref(result[ruleKey].$pending)));\n result.$error = computed(() => result.$dirty.value ? result.$pending.value || result.$invalid.value : false);\n result.$silentErrors = computed(() => ruleKeys.filter(ruleKey => unref(result[ruleKey].$invalid)).map(ruleKey => {\n const res = result[ruleKey];\n return reactive({\n $propertyPath: path,\n $property: key,\n $validator: ruleKey,\n $uid: `${path}-${ruleKey}`,\n $message: res.$message,\n $params: res.$params,\n $response: res.$response,\n $pending: res.$pending\n });\n }).concat(result.$externalResults.value));\n result.$errors = computed(() => result.$dirty.value ? result.$silentErrors.value : []);\n\n result.$unwatch = () => ruleKeys.forEach(ruleKey => {\n result[ruleKey].$unwatch();\n });\n\n resultsCache.set(path, rules, result);\n return result;\n}\n/**\n * Collects the validation results of all nested state properties\n * @param {Object} validations - The validation\n * @param {Object} nestedState - Current state\n * @param {String} path - Path to current property\n * @param {ResultsStorage} resultsCache - Validations cache map\n * @param {GlobalConfig} config - The config object\n * @param {VueInstance} instance - The current Vue instance\n * @param {ComputedRef} nestedExternalResults - The external results for this nested collection\n * @return {{}}\n */\n\n\nfunction collectNestedValidationResults(validations, nestedState, path, resultsCache, config, instance, nestedExternalResults) {\n const nestedValidationKeys = Object.keys(validations); // if we have no state, return empty object\n\n if (!nestedValidationKeys.length) return {};\n return nestedValidationKeys.reduce((results, nestedKey) => {\n // build validation results for nested state\n results[nestedKey] = setValidations({\n validations: validations[nestedKey],\n state: nestedState,\n key: nestedKey,\n parentKey: path,\n resultsCache,\n globalConfig: config,\n instance,\n externalResults: nestedExternalResults\n });\n return results;\n }, {});\n}\n/**\n * Generates the Meta fields from the results\n * @param {ValidationResult|{}} results\n * @param {Object.[]} nestedResults\n * @param {Object.[]} childResults\n * @return {{$anyDirty: Ref, $error: Ref, $invalid: Ref, $errors: Ref, $dirty: Ref, $touch: Function, $reset: Function }}\n */\n\n\nfunction createMetaFields(results, nestedResults, childResults) {\n const allResults = computed(() => [nestedResults, childResults].filter(res => res).reduce((allRes, res) => {\n return allRes.concat(Object.values(unref(res)));\n }, [])); // returns `$dirty` as true, if all children are dirty\n\n const $dirty = computed({\n get() {\n return results.$dirty.value || (allResults.value.length ? allResults.value.every(r => r.$dirty) : false);\n },\n\n set(v) {\n results.$dirty.value = v;\n }\n\n });\n const $silentErrors = computed(() => {\n // current state level errors, fallback to empty array if root\n const modelErrors = unref(results.$silentErrors) || []; // collect all nested and child $silentErrors\n\n const nestedErrors = allResults.value.filter(result => (unref(result).$silentErrors || []).length).reduce((errors, result) => {\n return errors.concat(...result.$silentErrors);\n }, []); // merge the $silentErrors\n\n return modelErrors.concat(nestedErrors);\n });\n const $errors = computed(() => {\n // current state level errors, fallback to empty array if root\n const modelErrors = unref(results.$errors) || []; // collect all nested and child $errors\n\n const nestedErrors = allResults.value.filter(result => (unref(result).$errors || []).length).reduce((errors, result) => {\n return errors.concat(...result.$errors);\n }, []); // merge the $errors\n\n return modelErrors.concat(nestedErrors);\n });\n const $invalid = computed(() => // if any of the nested values is invalid\n allResults.value.some(r => r.$invalid) || // or if the current state is invalid\n unref(results.$invalid) || // fallback to false if is root\n false);\n const $pending = computed(() => // if any of the nested values is pending\n allResults.value.some(r => unref(r.$pending)) || // if any of the current state validators is pending\n unref(results.$pending) || // fallback to false if is root\n false);\n const $anyDirty = computed(() => allResults.value.some(r => r.$dirty) || allResults.value.some(r => r.$anyDirty) || $dirty.value);\n const $error = computed(() => $dirty.value ? $pending.value || $invalid.value : false);\n\n const $touch = () => {\n // call the root $touch\n results.$touch(); // call all nested level $touch\n\n allResults.value.forEach(result => {\n result.$touch();\n });\n };\n\n const $reset = () => {\n // reset the root $dirty state\n results.$reset(); // reset all the children $dirty states\n\n allResults.value.forEach(result => {\n result.$reset();\n });\n }; // Ensure that if all child and nested results are $dirty, this also becomes $dirty\n\n\n if (allResults.value.length && allResults.value.every(nr => nr.$dirty)) $touch();\n return {\n $dirty,\n $errors,\n $invalid,\n $anyDirty,\n $error,\n $pending,\n $touch,\n $reset,\n $silentErrors\n };\n}\n/**\n * @typedef VuelidateState\n * @property {WritableComputedRef} $model\n * @property {ComputedRef} $dirty\n * @property {ComputedRef} $error\n * @property {ComputedRef} $errors\n * @property {ComputedRef} $invalid\n * @property {ComputedRef} $anyDirty\n * @property {ComputedRef} $pending\n * @property {Function} $touch\n * @property {Function} $reset\n * @property {String} $path\n * @property {ComputedRef} $silentErrors\n * @property {Function} [$validate]\n * @property {Function} [$getResultsForChild]\n * @property {Object.}\n */\n\n/**\n * Main Vuelidate bootstrap function.\n * Used both for Composition API in `setup` and for Global App usage.\n * Used to collect validation state, when walking recursively down the state tree\n * @param {Object} params\n * @param {Object} params.validations\n * @param {Object} params.state\n * @param {String} [params.key] - Current state property key. Used when being called on nested items\n * @param {String} [params.parentKey] - Parent state property key. Used when being called recursively\n * @param {Object} [params.childResults] - Used to collect child results.\n * @param {ResultsStorage} params.resultsCache - The cached validation results\n * @param {VueInstance} params.instance - The current Vue instance\n * @param {GlobalConfig} params.globalConfig - The validation config, passed to this setValidations instance.\n * @param {Reactive | Ref} params.externalResults - External validation results\n * @return {UnwrapNestedRefs}\n */\n\n\nfunction setValidations({\n validations,\n state,\n key,\n parentKey,\n childResults,\n resultsCache,\n globalConfig = {},\n instance,\n externalResults\n}) {\n /**\n * Executes the validators and returns the result.\n * @return {Promise}\n */\n const $validate = _async(function () {\n if (!$dirty.value) $touch(); // await the watchers\n\n return _call(nextTick, function () {\n return new Promise(resolve => {\n // return whether it is valid or not\n if (!$pending.value) return resolve(!$invalid.value);\n const unwatch = watch($pending, () => {\n resolve(!$invalid.value);\n unwatch();\n });\n });\n });\n });\n /**\n * Returns a child component's results, based on registration name\n * @param {string} key\n * @return {VuelidateState}\n */\n\n\n const path = parentKey ? `${parentKey}.${key}` : key; // Sort out the validation object into:\n // – rules = validators for current state tree fragment\n // — nestedValidators = nested state fragments keys that might contain more validators\n // – config = configuration properties that affect this state fragment\n\n const {\n rules,\n nestedValidators,\n config\n } = sortValidations(validations);\n const mergedConfig = Object.assign({}, globalConfig, config); // create protected state for cases when the state branch does not exist yet.\n // This protects when using the OptionsAPI as the data is bound after the setup method\n\n const nestedState = key ? computed(() => {\n const s = unref(state);\n return s ? unref(s[key]) : undefined;\n }) : state; // cache the external results, so we can revert back to them\n\n const cachedExternalResults = Object.assign({}, unref(externalResults) || {});\n const nestedExternalResults = computed(() => {\n const results = unref(externalResults);\n if (!key) return results;\n return results ? unref(results[key]) : undefined;\n }); // Use rules for the current state fragment and validate it\n\n const results = createValidationResults(rules, nestedState, key, resultsCache, path, mergedConfig, instance, nestedExternalResults); // Use nested keys to repeat the process\n // *WARN*: This is recursive\n\n const nestedResults = collectNestedValidationResults(nestedValidators, nestedState, path, resultsCache, mergedConfig, instance, nestedExternalResults); // Collect and merge this level validation results\n // with all nested validation results\n\n const {\n $dirty,\n $errors,\n $invalid,\n $anyDirty,\n $error,\n $pending,\n $touch,\n $reset,\n $silentErrors\n } = createMetaFields(results, nestedResults, childResults);\n /**\n * If we have no `key`, this is the top level state\n * We dont need `$model` there.\n */\n\n const $model = key ? computed({\n get: () => unref(nestedState),\n set: val => {\n $dirty.value = true;\n const s = unref(state);\n const external = unref(externalResults);\n\n if (external) {\n external[key] = cachedExternalResults[key];\n }\n\n if (isRef(s[key])) {\n s[key].value = val;\n } else {\n s[key] = val;\n }\n }\n }) : null;\n\n if (key && mergedConfig.$autoDirty) {\n watch(nestedState, () => {\n if (!$dirty.value) $touch();\n const external = unref(externalResults);\n\n if (external) {\n external[key] = cachedExternalResults[key];\n }\n }, {\n flush: 'sync'\n });\n }\n\n function $getResultsForChild(key) {\n return (childResults.value || {})[key];\n }\n\n function $clearExternalResults() {\n if (isRef(externalResults)) {\n externalResults.value = cachedExternalResults;\n } else {\n // if the external results state was empty, we need to delete every property, one by one\n if (Object.keys(cachedExternalResults).length === 0) {\n Object.keys(externalResults).forEach(k => {\n delete externalResults[k];\n });\n } else {\n // state was not empty, so we just assign it back into the current state\n Object.assign(externalResults, cachedExternalResults);\n }\n }\n }\n\n return reactive(Object.assign({}, results, {\n // NOTE: The order here is very important, since we want to override\n // some of the *results* meta fields with the collective version of it\n // that includes the results of nested state validation results\n $model,\n $dirty,\n $error,\n $errors,\n $invalid,\n $anyDirty,\n $pending,\n $touch,\n $reset,\n $path: path || ROOT_PATH,\n $silentErrors,\n $validate\n }, childResults && {\n $getResultsForChild,\n $clearExternalResults\n }, nestedResults));\n}\n\nclass ResultsStorage {\n constructor() {\n this.storage = new Map();\n }\n /**\n * Stores a validation result, and its rules by its path\n * @param {String} path\n * @param {Object} rules\n * @param {ValidationResult} result\n */\n\n\n set(path, rules, result) {\n this.storage.set(path, {\n rules,\n result\n });\n }\n /**\n * Check if the stored `results` for the provided `path` have the same `rules` compared to 'storedRules'\n * @param {String} path\n * @param {Object} rules\n * @param {Object} storedRules\n * @return {Boolean}\n */\n\n\n checkRulesValidity(path, rules, storedRules) {\n const storedRulesKeys = Object.keys(storedRules);\n const newRulesKeys = Object.keys(rules);\n if (newRulesKeys.length !== storedRulesKeys.length) return false;\n const hasAllValidators = newRulesKeys.every(ruleKey => storedRulesKeys.includes(ruleKey));\n if (!hasAllValidators) return false;\n return newRulesKeys.every(ruleKey => {\n if (!rules[ruleKey].$params) return true;\n return Object.keys(rules[ruleKey].$params).every(paramKey => {\n // make sure to unwrap before comparing\n return unref(storedRules[ruleKey].$params[paramKey]) === unref(rules[ruleKey].$params[paramKey]);\n });\n });\n }\n /**\n * Returns the matched result if catche is valid\n * @param {String} path\n * @param {Object} rules\n * @return {{$partial: boolean, $dirty: Ref}|undefined|ValidationResult}\n */\n\n\n get(path, rules) {\n const storedRuleResultPair = this.storage.get(path);\n if (!storedRuleResultPair) return undefined;\n const {\n rules: storedRules,\n result\n } = storedRuleResultPair;\n const isValidCache = this.checkRulesValidity(path, rules, storedRules);\n const $unwatch = result.$unwatch ? result.$unwatch : () => ({});\n if (!isValidCache) return {\n $dirty: result.$dirty,\n $partial: true,\n $unwatch\n };\n return result;\n }\n\n}\n\nconst VuelidateInjectChildResults = Symbol('vuelidate#injectChiildResults');\nconst VuelidateRemoveChildResults = Symbol('vuelidate#removeChiildResults');\nconst CollectFlag = {\n COLLECT_ALL: true,\n COLLECT_NONE: false\n};\n/**\n * Create helpers to collect validation state from child components\n * @param {Object} params\n * @param {String | Number} params.$scope - Parent component scope\n * @return {{sendValidationResultsToParent: function, childResults: ComputedRef, removeValidationResultsFromParent: function}}\n */\n\nfunction nestedValidations({\n $scope\n}) {\n const childResultsRaw = {};\n const childResultsKeys = ref([]);\n const childResults = computed(() => childResultsKeys.value.reduce((results, key) => {\n results[key] = unref(childResultsRaw[key]);\n return results;\n }, {}));\n /**\n * Allows children to send validation data up to their parent.\n * @param {Object} results - the results\n * @param {Object} args\n * @param {String} args.$registerAs - the $registeredAs key\n * @param {String | Number} args.$scope - the $scope key\n */\n\n function injectChildResultsIntoParent(results, {\n $registerAs: key,\n $scope: childScope,\n $stopPropagation\n }) {\n if ($stopPropagation || $scope === CollectFlag.COLLECT_NONE || childScope === CollectFlag.COLLECT_NONE || $scope !== CollectFlag.COLLECT_ALL && $scope !== childScope) return;\n childResultsRaw[key] = results;\n childResultsKeys.value.push(key);\n }\n /**\n * Allows children to remove the validation data from their parent, before getting destroyed.\n * @param {String} key - the registeredAs key\n */\n\n\n function removeChildResultsFromParent(key) {\n // remove the key\n childResultsKeys.value = childResultsKeys.value.filter(childKey => childKey !== key); // remove the stored data for the key\n\n delete childResultsRaw[key];\n } // inject the `injectChildResultsIntoParent` method, into the current scope\n\n\n const sendValidationResultsToParent = inject(VuelidateInjectChildResults, () => {}); // provide to all of its children the send results to parent function\n\n provide(VuelidateInjectChildResults, injectChildResultsIntoParent);\n const removeValidationResultsFromParent = inject(VuelidateRemoveChildResults, () => {}); // provide to all of its children the remove results function\n\n provide(VuelidateRemoveChildResults, removeChildResultsFromParent);\n return {\n childResults,\n sendValidationResultsToParent,\n removeValidationResultsFromParent\n };\n}\n/**\n * @typedef GlobalConfig\n * @property {String} [$registerAs] - Config Object\n * @property {String | Number | Symbol} [$scope] - A scope to limit child component registration\n * @property {Boolean} [$stopPropagation] - Tells a Vue component to stop sending its results up to the parent\n * @property {Ref} [$externalResults] - External error messages, like from server validation.\n * @property {Boolean} [$autoDirty] - Should the form watch for state changed, and automatically set `$dirty` to true.\n * @property {Boolean} [$lazy] - Should the validations be lazy, and run only after they are dirty\n */\n\n/**\n * Composition API compatible Vuelidate\n * Use inside the `setup` lifecycle hook\n * @param {Object | GlobalConfig} [validations] - Validations Object or the globalConfig.\n * @param {Object} [state] - State object - required if `validations` is a validation object.\n * @param {GlobalConfig} [globalConfig] - Config Object\n * @return {UnwrapRef<*>}\n */\n\n\nfunction useVuelidate(validations, state, globalConfig = {}) {\n // if we pass only one argument, its most probably the globalConfig.\n // This use case is so parents can just collect results of child forms.\n if (arguments.length === 1) {\n globalConfig = validations;\n validations = undefined;\n state = undefined;\n }\n\n let {\n $registerAs,\n $scope = CollectFlag.COLLECT_ALL,\n $stopPropagation,\n $externalResults\n } = globalConfig;\n const instance = getCurrentInstance();\n const componentOptions = instance ? isVue3 ? instance.type : instance.proxy.$options : {}; // if there is no registration name, add one.\n\n if (!$registerAs && instance) {\n // NOTE:\n // ._uid // Vue 2.x Composition-API plugin\n // .uid // Vue 3.0\n const uid = instance.uid || instance._uid;\n $registerAs = `_vuelidate_${uid}`;\n }\n\n const validationResults = ref({});\n const resultsCache = new ResultsStorage();\n const {\n childResults,\n sendValidationResultsToParent,\n removeValidationResultsFromParent\n } = instance ? nestedValidations({\n $scope\n }) : {\n childResults: ref({})\n }; // Options API\n\n if (!validations && componentOptions.validations) {\n const rules = componentOptions.validations;\n state = ref({});\n onBeforeMount(() => {\n // Delay binding state to validations defined with the Options API until mounting, when the data\n // has been attached to the component instance. From that point on it will be reactive.\n state.value = instance.proxy; // helper proxy for instance property access. It makes every reference\n // reactive for the validation function\n\n function ComputedProxyFactory(target) {\n return new Proxy(target, {\n get(target, prop, receiver) {\n return typeof target[prop] === 'object' ? ComputedProxyFactory(target[prop]) : computed(() => target[prop]);\n }\n\n });\n }\n\n watch(() => isFunction(rules) ? rules.call(state.value, new ComputedProxyFactory(state.value)) : rules, validations => {\n validationResults.value = setValidations({\n validations,\n state,\n childResults,\n resultsCache,\n globalConfig,\n instance: instance.proxy,\n externalResults: $externalResults || instance.proxy.vuelidateExternalResults\n });\n }, {\n immediate: true\n });\n });\n globalConfig = componentOptions.validationsConfig || globalConfig;\n } else {\n const validationsWatchTarget = isRef(validations) || isProxy(validations) ? validations // wrap plain objects in a reactive, so we can track changes if they have computed in them.\n : reactive(validations || {});\n watch(validationsWatchTarget, newValidationRules => {\n validationResults.value = setValidations({\n validations: newValidationRules,\n state,\n childResults,\n resultsCache,\n globalConfig,\n instance: instance ? instance.proxy : {},\n externalResults: $externalResults\n });\n }, {\n immediate: true\n });\n }\n\n if (instance) {\n // send all the data to the parent when the function is invoked inside setup.\n sendValidationResultsToParent(validationResults, {\n $registerAs,\n $scope,\n $stopPropagation\n }); // before this component is destroyed, remove all the data from the parent.\n\n onBeforeUnmount(() => removeValidationResultsFromParent($registerAs));\n } // TODO: Change into reactive + watch\n\n\n return computed(() => {\n return Object.assign({}, unref(validationResults.value), childResults.value);\n });\n}\n\nexport { CollectFlag, useVuelidate as default, useVuelidate };\n","import * as Vue from 'vue'\n\nvar isVue2 = false\nvar isVue3 = true\nvar Vue2 = undefined\n\nfunction install() {}\n\nexport function set(target, key, val) {\n if (Array.isArray(target)) {\n target.length = Math.max(target.length, key)\n target.splice(key, 1, val)\n return val\n }\n target[key] = val\n return val\n}\n\nexport function del(target, key) {\n if (Array.isArray(target)) {\n target.splice(key, 1)\n return\n }\n delete target[key]\n}\n\nexport * from 'vue'\nexport {\n Vue,\n Vue2,\n isVue2,\n isVue3,\n install,\n}\n"],"sourceRoot":""}