{"version":3,"file":"index.esm.6e62527c.js","sources":["../../../../../../node_modules/dequal/lite/index.mjs","../../../../../../node_modules/svelte-forms-lib/lib/util.js","../../../../../../node_modules/svelte-forms-lib/lib/create-form.js","../../../../../../node_modules/property-expr/index.js","../../../../../../node_modules/tiny-case/index.js","../../../../../../node_modules/toposort/index.js","../../../../../../node_modules/yup/index.esm.js"],"sourcesContent":["var has = Object.prototype.hasOwnProperty;\n\nexport function dequal(foo, bar) {\n\tvar ctor, len;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n","import {dequal as isEqual} from 'dequal/lite';\n\nfunction subscribeOnce(observable) {\n return new Promise((resolve) => {\n observable.subscribe(resolve)(); // immediately invoke to unsubscribe\n });\n}\n\nfunction update(object, path, value) {\n object.update((o) => {\n set(o, path, value);\n return o;\n });\n}\n\nfunction cloneDeep(object) {\n return JSON.parse(JSON.stringify(object));\n}\n\nfunction isNullish(value) {\n return value === undefined || value === null;\n}\n\nfunction isEmpty(object) {\n return isNullish(object) || Object.keys(object).length <= 0;\n}\n\nfunction getValues(object) {\n let results = [];\n\n for (const [, value] of Object.entries(object)) {\n const values = typeof value === 'object' ? getValues(value) : [value];\n results = [...results, ...values];\n }\n\n return results;\n}\n\n// TODO: refactor this so as not to rely directly on yup's API\n// This should use dependency injection, with a default callback which may assume\n// yup as the validation schema\nfunction getErrorsFromSchema(initialValues, schema, errors = {}) {\n for (const key in schema) {\n switch (true) {\n case schema[key].type === 'object' && !isEmpty(schema[key].fields): {\n errors[key] = getErrorsFromSchema(\n initialValues[key],\n schema[key].fields,\n {...errors[key]},\n );\n break;\n }\n\n case schema[key].type === 'array': {\n const values =\n initialValues && initialValues[key] ? initialValues[key] : [];\n errors[key] = values.map((value) => {\n const innerError = getErrorsFromSchema(\n value,\n schema[key].innerType.fields,\n {...errors[key]},\n );\n\n return Object.keys(innerError).length > 0 ? innerError : '';\n });\n break;\n }\n\n default: {\n errors[key] = '';\n }\n }\n }\n\n return errors;\n}\n\nconst deepEqual = isEqual;\n\nfunction assignDeep(object, value) {\n if (Array.isArray(object)) {\n return object.map((o) => assignDeep(o, value));\n }\n const copy = {};\n for (const key in object) {\n copy[key] =\n typeof object[key] === 'object' && !isNullish(object[key]) ? assignDeep(object[key], value) : value;\n }\n return copy;\n}\n\nfunction set(object, path, value) {\n if (new Object(object) !== object) return object;\n\n if (!Array.isArray(path)) {\n path = path.toString().match(/[^.[\\]]+/g) || [];\n }\n\n const result = path\n .slice(0, -1)\n // TODO: replace this reduce with something more readable\n // eslint-disable-next-line unicorn/no-array-reduce\n .reduce(\n (accumulator, key, index) =>\n new Object(accumulator[key]) === accumulator[key]\n ? accumulator[key]\n : (accumulator[key] =\n Math.trunc(Math.abs(path[index + 1])) === +path[index + 1]\n ? []\n : {}),\n object,\n );\n\n result[path[path.length - 1]] = value;\n\n return object;\n}\n\nexport const util = {\n assignDeep,\n cloneDeep,\n deepEqual,\n getErrorsFromSchema,\n getValues,\n isEmpty,\n isNullish,\n set,\n subscribeOnce,\n update,\n};\n","import {derived, writable, get} from 'svelte/store';\nimport {util} from './util';\n\nconst NO_ERROR = '';\nconst IS_TOUCHED = true;\n\nfunction isCheckbox(element) {\n return element.getAttribute && element.getAttribute('type') === 'checkbox';\n}\n\nfunction isFileInput(element) {\n return element.getAttribute && element.getAttribute('type') === 'file';\n}\n\nfunction resolveValue(element) {\n if (isFileInput(element)) {\n return element.files;\n } else if (isCheckbox(element)) {\n return element.checked;\n } else {\n return element.value;\n }\n}\n\nexport const createForm = (config) => {\n let initialValues = config.initialValues || {};\n\n const validationSchema = config.validationSchema;\n const validateFunction = config.validate;\n const onSubmit = config.onSubmit;\n\n const getInitial = {\n values: () => util.cloneDeep(initialValues),\n errors: () =>\n validationSchema\n ? util.getErrorsFromSchema(initialValues, validationSchema.fields)\n : util.assignDeep(initialValues, NO_ERROR),\n touched: () => util.assignDeep(initialValues, !IS_TOUCHED),\n };\n\n const form = writable(getInitial.values());\n const errors = writable(getInitial.errors());\n const touched = writable(getInitial.touched());\n\n const isSubmitting = writable(false);\n const isValidating = writable(false);\n\n const isValid = derived(errors, ($errors) => {\n const noErrors = util\n .getValues($errors)\n .every((field) => field === NO_ERROR);\n return noErrors;\n });\n\n const modified = derived(form, ($form) => {\n const object = util.assignDeep($form, false);\n\n for (let key in $form) {\n object[key] = !util.deepEqual($form[key], initialValues[key]);\n }\n\n return object;\n });\n\n const isModified = derived(modified, ($modified) => {\n return util.getValues($modified).includes(true);\n });\n\n function validateField(field) {\n return util\n .subscribeOnce(form)\n .then((values) => validateFieldValue(field, values[field]));\n }\n\n function validateFieldValue(field, value) {\n updateTouched(field, true);\n\n if (validationSchema) {\n isValidating.set(true);\n\n return validationSchema\n .validateAt(field, get(form))\n .then(() => util.update(errors, field, ''))\n .catch((error) => util.update(errors, field, error.message))\n .finally(() => {\n isValidating.set(false);\n });\n }\n\n if (validateFunction) {\n isValidating.set(true);\n return Promise.resolve()\n .then(() => validateFunction({[field]: value}))\n .then((errs) =>\n util.update(errors, field, !util.isNullish(errs) ? errs[field] : ''),\n )\n .finally(() => {\n isValidating.set(false);\n });\n }\n\n return Promise.resolve();\n }\n\n function updateValidateField(field, value) {\n updateField(field, value);\n return validateFieldValue(field, value);\n }\n\n function handleChange(event) {\n const element = event.target;\n const field = element.name || element.id;\n const value = resolveValue(element);\n\n return updateValidateField(field, value);\n }\n\n function handleSubmit(event) {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n\n isSubmitting.set(true);\n\n return util.subscribeOnce(form).then((values) => {\n if (typeof validateFunction === 'function') {\n isValidating.set(true);\n\n return Promise.resolve()\n .then(() => validateFunction(values))\n .then((error) => {\n if (util.isNullish(error) || util.getValues(error).length === 0) {\n return clearErrorsAndSubmit(values);\n } else {\n errors.set(error);\n isSubmitting.set(false);\n }\n })\n .finally(() => isValidating.set(false));\n }\n\n if (validationSchema) {\n isValidating.set(true);\n\n return (\n validationSchema\n .validate(values, {abortEarly: false})\n .then(() => clearErrorsAndSubmit(values))\n // eslint-disable-next-line unicorn/catch-error-name\n .catch((yupErrors) => {\n if (yupErrors && yupErrors.inner) {\n const updatedErrors = getInitial.errors();\n\n yupErrors.inner.map((error) =>\n util.set(updatedErrors, error.path, error.message),\n );\n\n errors.set(updatedErrors);\n }\n isSubmitting.set(false);\n })\n .finally(() => isValidating.set(false))\n );\n }\n\n return clearErrorsAndSubmit(values);\n });\n }\n\n function handleReset() {\n form.set(getInitial.values());\n errors.set(getInitial.errors());\n touched.set(getInitial.touched());\n }\n\n function clearErrorsAndSubmit(values) {\n return Promise.resolve()\n .then(() => errors.set(getInitial.errors()))\n .then(() => onSubmit(values, form, errors))\n .finally(() => isSubmitting.set(false));\n }\n\n /**\n * Handler to imperatively update the value of a form field\n */\n function updateField(field, value) {\n util.update(form, field, value);\n }\n\n /**\n * Handler to imperatively update the touched value of a form field\n */\n function updateTouched(field, value) {\n util.update(touched, field, value);\n }\n\n /**\n * Update the initial values and reset form. Used to dynamically display new form values\n */\n function updateInitialValues(newValues) {\n initialValues = newValues;\n\n handleReset();\n }\n\n return {\n form,\n errors,\n touched,\n modified,\n isValid,\n isSubmitting,\n isValidating,\n isModified,\n handleChange,\n handleSubmit,\n handleReset,\n updateField,\n updateValidateField,\n updateTouched,\n validateField,\n updateInitialValues,\n state: derived(\n [\n form,\n errors,\n touched,\n modified,\n isValid,\n isValidating,\n isSubmitting,\n isModified,\n ],\n ([\n $form,\n $errors,\n $touched,\n $modified,\n $isValid,\n $isValidating,\n $isSubmitting,\n $isModified,\n ]) => ({\n form: $form,\n errors: $errors,\n touched: $touched,\n modified: $modified,\n isValid: $isValid,\n isSubmitting: $isSubmitting,\n isValidating: $isValidating,\n isModified: $isModified,\n }),\n ),\n };\n};\n","/**\n * Based on Kendo UI Core expression code \n */\n'use strict'\n\nfunction Cache(maxSize) {\n this._maxSize = maxSize\n this.clear()\n}\nCache.prototype.clear = function () {\n this._size = 0\n this._values = Object.create(null)\n}\nCache.prototype.get = function (key) {\n return this._values[key]\n}\nCache.prototype.set = function (key, value) {\n this._size >= this._maxSize && this.clear()\n if (!(key in this._values)) this._size++\n\n return (this._values[key] = value)\n}\n\nvar SPLIT_REGEX = /[^.^\\]^[]+|(?=\\[\\]|\\.\\.)/g,\n DIGIT_REGEX = /^\\d+$/,\n LEAD_DIGIT_REGEX = /^\\d/,\n SPEC_CHAR_REGEX = /[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/g,\n CLEAN_QUOTES_REGEX = /^\\s*(['\"]?)(.*?)(\\1)\\s*$/,\n MAX_CACHE_SIZE = 512\n\nvar pathCache = new Cache(MAX_CACHE_SIZE),\n setCache = new Cache(MAX_CACHE_SIZE),\n getCache = new Cache(MAX_CACHE_SIZE)\n\nvar config\n\nmodule.exports = {\n Cache: Cache,\n\n split: split,\n\n normalizePath: normalizePath,\n\n setter: function (path) {\n var parts = normalizePath(path)\n\n return (\n setCache.get(path) ||\n setCache.set(path, function setter(obj, value) {\n var index = 0\n var len = parts.length\n var data = obj\n\n while (index < len - 1) {\n var part = parts[index]\n if (\n part === '__proto__' ||\n part === 'constructor' ||\n part === 'prototype'\n ) {\n return obj\n }\n\n data = data[parts[index++]]\n }\n data[parts[index]] = value\n })\n )\n },\n\n getter: function (path, safe) {\n var parts = normalizePath(path)\n return (\n getCache.get(path) ||\n getCache.set(path, function getter(data) {\n var index = 0,\n len = parts.length\n while (index < len) {\n if (data != null || !safe) data = data[parts[index++]]\n else return\n }\n return data\n })\n )\n },\n\n join: function (segments) {\n return segments.reduce(function (path, part) {\n return (\n path +\n (isQuoted(part) || DIGIT_REGEX.test(part)\n ? '[' + part + ']'\n : (path ? '.' : '') + part)\n )\n }, '')\n },\n\n forEach: function (path, cb, thisArg) {\n forEach(Array.isArray(path) ? path : split(path), cb, thisArg)\n },\n}\n\nfunction normalizePath(path) {\n return (\n pathCache.get(path) ||\n pathCache.set(\n path,\n split(path).map(function (part) {\n return part.replace(CLEAN_QUOTES_REGEX, '$2')\n })\n )\n )\n}\n\nfunction split(path) {\n return path.match(SPLIT_REGEX) || ['']\n}\n\nfunction forEach(parts, iter, thisArg) {\n var len = parts.length,\n part,\n idx,\n isArray,\n isBracket\n\n for (idx = 0; idx < len; idx++) {\n part = parts[idx]\n\n if (part) {\n if (shouldBeQuoted(part)) {\n part = '\"' + part + '\"'\n }\n\n isBracket = isQuoted(part)\n isArray = !isBracket && /^\\d+$/.test(part)\n\n iter.call(thisArg, part, isBracket, isArray, idx, parts)\n }\n }\n}\n\nfunction isQuoted(str) {\n return (\n typeof str === 'string' && str && [\"'\", '\"'].indexOf(str.charAt(0)) !== -1\n )\n}\n\nfunction hasLeadingNumber(part) {\n return part.match(LEAD_DIGIT_REGEX) && !part.match(DIGIT_REGEX)\n}\n\nfunction hasSpecialChars(part) {\n return SPEC_CHAR_REGEX.test(part)\n}\n\nfunction shouldBeQuoted(part) {\n return !isQuoted(part) && (hasLeadingNumber(part) || hasSpecialChars(part))\n}\n","const reWords = /[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+|(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*/g\n\nconst words = (str) => str.match(reWords) || []\n\nconst upperFirst = (str) => str[0].toUpperCase() + str.slice(1)\n\nconst join = (str, d) => words(str).join(d).toLowerCase()\n\nconst camelCase = (str) =>\n words(str).reduce(\n (acc, next) =>\n `${acc}${\n !acc\n ? next.toLowerCase()\n : next[0].toUpperCase() + next.slice(1).toLowerCase()\n }`,\n '',\n )\n\nconst pascalCase = (str) => upperFirst(camelCase(str))\n\nconst snakeCase = (str) => join(str, '_')\n\nconst kebabCase = (str) => join(str, '-')\n\nconst sentenceCase = (str) => upperFirst(join(str, ' '))\n\nconst titleCase = (str) => words(str).map(upperFirst).join(' ')\n\nmodule.exports = {\n words,\n upperFirst,\n camelCase,\n pascalCase,\n snakeCase,\n kebabCase,\n sentenceCase,\n titleCase,\n}\n","\n/**\n * Topological sorting function\n *\n * @param {Array} edges\n * @returns {Array}\n */\n\nmodule.exports = function(edges) {\n return toposort(uniqueNodes(edges), edges)\n}\n\nmodule.exports.array = toposort\n\nfunction toposort(nodes, edges) {\n var cursor = nodes.length\n , sorted = new Array(cursor)\n , visited = {}\n , i = cursor\n // Better data structures make algorithm much faster.\n , outgoingEdges = makeOutgoingEdges(edges)\n , nodesHash = makeNodesHash(nodes)\n\n // check for unknown nodes\n edges.forEach(function(edge) {\n if (!nodesHash.has(edge[0]) || !nodesHash.has(edge[1])) {\n throw new Error('Unknown node. There is an unknown node in the supplied edges.')\n }\n })\n\n while (i--) {\n if (!visited[i]) visit(nodes[i], i, new Set())\n }\n\n return sorted\n\n function visit(node, i, predecessors) {\n if(predecessors.has(node)) {\n var nodeRep\n try {\n nodeRep = \", node was:\" + JSON.stringify(node)\n } catch(e) {\n nodeRep = \"\"\n }\n throw new Error('Cyclic dependency' + nodeRep)\n }\n\n if (!nodesHash.has(node)) {\n throw new Error('Found unknown node. Make sure to provided all involved nodes. Unknown node: '+JSON.stringify(node))\n }\n\n if (visited[i]) return;\n visited[i] = true\n\n var outgoing = outgoingEdges.get(node) || new Set()\n outgoing = Array.from(outgoing)\n\n if (i = outgoing.length) {\n predecessors.add(node)\n do {\n var child = outgoing[--i]\n visit(child, nodesHash.get(child), predecessors)\n } while (i)\n predecessors.delete(node)\n }\n\n sorted[--cursor] = node\n }\n}\n\nfunction uniqueNodes(arr){\n var res = new Set()\n for (var i = 0, len = arr.length; i < len; i++) {\n var edge = arr[i]\n res.add(edge[0])\n res.add(edge[1])\n }\n return Array.from(res)\n}\n\nfunction makeOutgoingEdges(arr){\n var edges = new Map()\n for (var i = 0, len = arr.length; i < len; i++) {\n var edge = arr[i]\n if (!edges.has(edge[0])) edges.set(edge[0], new Set())\n if (!edges.has(edge[1])) edges.set(edge[1], new Set())\n edges.get(edge[0]).add(edge[1])\n }\n return edges\n}\n\nfunction makeNodesHash(arr){\n var res = new Map()\n for (var i = 0, len = arr.length; i < len; i++) {\n res.set(arr[i], i)\n }\n return res\n}\n","import { getter, forEach, split, normalizePath, join } from 'property-expr';\nimport { camelCase, snakeCase } from 'tiny-case';\nimport toposort from 'toposort';\n\nconst toString = Object.prototype.toString;\nconst errorToString = Error.prototype.toString;\nconst regExpToString = RegExp.prototype.toString;\nconst symbolToString = typeof Symbol !== 'undefined' ? Symbol.prototype.toString : () => '';\nconst SYMBOL_REGEXP = /^Symbol\\((.*)\\)(.*)$/;\nfunction printNumber(val) {\n if (val != +val) return 'NaN';\n const isNegativeZero = val === 0 && 1 / val < 0;\n return isNegativeZero ? '-0' : '' + val;\n}\nfunction printSimpleValue(val, quoteStrings = false) {\n if (val == null || val === true || val === false) return '' + val;\n const typeOf = typeof val;\n if (typeOf === 'number') return printNumber(val);\n if (typeOf === 'string') return quoteStrings ? `\"${val}\"` : val;\n if (typeOf === 'function') return '[Function ' + (val.name || 'anonymous') + ']';\n if (typeOf === 'symbol') return symbolToString.call(val).replace(SYMBOL_REGEXP, 'Symbol($1)');\n const tag = toString.call(val).slice(8, -1);\n if (tag === 'Date') return isNaN(val.getTime()) ? '' + val : val.toISOString(val);\n if (tag === 'Error' || val instanceof Error) return '[' + errorToString.call(val) + ']';\n if (tag === 'RegExp') return regExpToString.call(val);\n return null;\n}\nfunction printValue(value, quoteStrings) {\n let result = printSimpleValue(value, quoteStrings);\n if (result !== null) return result;\n return JSON.stringify(value, function (key, value) {\n let result = printSimpleValue(this[key], quoteStrings);\n if (result !== null) return result;\n return value;\n }, 2);\n}\n\nfunction toArray(value) {\n return value == null ? [] : [].concat(value);\n}\n\nlet _Symbol$toStringTag;\nlet strReg = /\\$\\{\\s*(\\w+)\\s*\\}/g;\n_Symbol$toStringTag = Symbol.toStringTag;\nclass ValidationError extends Error {\n static formatError(message, params) {\n const path = params.label || params.path || 'this';\n if (path !== params.path) params = Object.assign({}, params, {\n path\n });\n if (typeof message === 'string') return message.replace(strReg, (_, key) => printValue(params[key]));\n if (typeof message === 'function') return message(params);\n return message;\n }\n static isError(err) {\n return err && err.name === 'ValidationError';\n }\n constructor(errorOrErrors, value, field, type, disableStack) {\n super();\n this.value = void 0;\n this.path = void 0;\n this.type = void 0;\n this.errors = void 0;\n this.params = void 0;\n this.inner = void 0;\n this[_Symbol$toStringTag] = 'Error';\n this.name = 'ValidationError';\n this.value = value;\n this.path = field;\n this.type = type;\n this.errors = [];\n this.inner = [];\n toArray(errorOrErrors).forEach(err => {\n if (ValidationError.isError(err)) {\n this.errors.push(...err.errors);\n const innerErrors = err.inner.length ? err.inner : [err];\n this.inner.push(...innerErrors);\n } else {\n this.errors.push(err);\n }\n });\n this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];\n if (!disableStack && Error.captureStackTrace) Error.captureStackTrace(this, ValidationError);\n }\n}\n\nlet mixed = {\n default: '${path} is invalid',\n required: '${path} is a required field',\n defined: '${path} must be defined',\n notNull: '${path} cannot be null',\n oneOf: '${path} must be one of the following values: ${values}',\n notOneOf: '${path} must not be one of the following values: ${values}',\n notType: ({\n path,\n type,\n value,\n originalValue\n }) => {\n const castMsg = originalValue != null && originalValue !== value ? ` (cast from the value \\`${printValue(originalValue, true)}\\`).` : '.';\n return type !== 'mixed' ? `${path} must be a \\`${type}\\` type, ` + `but the final value was: \\`${printValue(value, true)}\\`` + castMsg : `${path} must match the configured type. ` + `The validated value was: \\`${printValue(value, true)}\\`` + castMsg;\n }\n};\nlet string = {\n length: '${path} must be exactly ${length} characters',\n min: '${path} must be at least ${min} characters',\n max: '${path} must be at most ${max} characters',\n matches: '${path} must match the following: \"${regex}\"',\n email: '${path} must be a valid email',\n url: '${path} must be a valid URL',\n uuid: '${path} must be a valid UUID',\n trim: '${path} must be a trimmed string',\n lowercase: '${path} must be a lowercase string',\n uppercase: '${path} must be a upper case string'\n};\nlet number = {\n min: '${path} must be greater than or equal to ${min}',\n max: '${path} must be less than or equal to ${max}',\n lessThan: '${path} must be less than ${less}',\n moreThan: '${path} must be greater than ${more}',\n positive: '${path} must be a positive number',\n negative: '${path} must be a negative number',\n integer: '${path} must be an integer'\n};\nlet date = {\n min: '${path} field must be later than ${min}',\n max: '${path} field must be at earlier than ${max}'\n};\nlet boolean = {\n isValue: '${path} field must be ${value}'\n};\nlet object = {\n noUnknown: '${path} field has unspecified keys: ${unknown}'\n};\nlet array = {\n min: '${path} field must have at least ${min} items',\n max: '${path} field must have less than or equal to ${max} items',\n length: '${path} must have ${length} items'\n};\nlet tuple = {\n notType: params => {\n const {\n path,\n value,\n spec\n } = params;\n const typeLen = spec.types.length;\n if (Array.isArray(value)) {\n if (value.length < typeLen) return `${path} tuple value has too few items, expected a length of ${typeLen} but got ${value.length} for value: \\`${printValue(value, true)}\\``;\n if (value.length > typeLen) return `${path} tuple value has too many items, expected a length of ${typeLen} but got ${value.length} for value: \\`${printValue(value, true)}\\``;\n }\n return ValidationError.formatError(mixed.notType, params);\n }\n};\nvar locale = Object.assign(Object.create(null), {\n mixed,\n string,\n number,\n date,\n object,\n array,\n boolean,\n tuple\n});\n\nconst isSchema = obj => obj && obj.__isYupSchema__;\n\nclass Condition {\n static fromOptions(refs, config) {\n if (!config.then && !config.otherwise) throw new TypeError('either `then:` or `otherwise:` is required for `when()` conditions');\n let {\n is,\n then,\n otherwise\n } = config;\n let check = typeof is === 'function' ? is : (...values) => values.every(value => value === is);\n return new Condition(refs, (values, schema) => {\n var _branch;\n let branch = check(...values) ? then : otherwise;\n return (_branch = branch == null ? void 0 : branch(schema)) != null ? _branch : schema;\n });\n }\n constructor(refs, builder) {\n this.fn = void 0;\n this.refs = refs;\n this.refs = refs;\n this.fn = builder;\n }\n resolve(base, options) {\n let values = this.refs.map(ref =>\n // TODO: ? operator here?\n ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context));\n let schema = this.fn(values, base, options);\n if (schema === undefined ||\n // @ts-ignore this can be base\n schema === base) {\n return base;\n }\n if (!isSchema(schema)) throw new TypeError('conditions must return a schema object');\n return schema.resolve(options);\n }\n}\n\nconst prefixes = {\n context: '$',\n value: '.'\n};\nfunction create$9(key, options) {\n return new Reference(key, options);\n}\nclass Reference {\n constructor(key, options = {}) {\n this.key = void 0;\n this.isContext = void 0;\n this.isValue = void 0;\n this.isSibling = void 0;\n this.path = void 0;\n this.getter = void 0;\n this.map = void 0;\n if (typeof key !== 'string') throw new TypeError('ref must be a string, got: ' + key);\n this.key = key.trim();\n if (key === '') throw new TypeError('ref must be a non-empty string');\n this.isContext = this.key[0] === prefixes.context;\n this.isValue = this.key[0] === prefixes.value;\n this.isSibling = !this.isContext && !this.isValue;\n let prefix = this.isContext ? prefixes.context : this.isValue ? prefixes.value : '';\n this.path = this.key.slice(prefix.length);\n this.getter = this.path && getter(this.path, true);\n this.map = options.map;\n }\n getValue(value, parent, context) {\n let result = this.isContext ? context : this.isValue ? value : parent;\n if (this.getter) result = this.getter(result || {});\n if (this.map) result = this.map(result);\n return result;\n }\n\n /**\n *\n * @param {*} value\n * @param {Object} options\n * @param {Object=} options.context\n * @param {Object=} options.parent\n */\n cast(value, options) {\n return this.getValue(value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context);\n }\n resolve() {\n return this;\n }\n describe() {\n return {\n type: 'ref',\n key: this.key\n };\n }\n toString() {\n return `Ref(${this.key})`;\n }\n static isRef(value) {\n return value && value.__isYupRef;\n }\n}\n\n// @ts-ignore\nReference.prototype.__isYupRef = true;\n\nconst isAbsent = value => value == null;\n\nfunction createValidation(config) {\n function validate({\n value,\n path = '',\n options,\n originalValue,\n schema\n }, panic, next) {\n const {\n name,\n test,\n params,\n message,\n skipAbsent\n } = config;\n let {\n parent,\n context,\n abortEarly = schema.spec.abortEarly,\n disableStackTrace = schema.spec.disableStackTrace\n } = options;\n function resolve(item) {\n return Reference.isRef(item) ? item.getValue(value, parent, context) : item;\n }\n function createError(overrides = {}) {\n var _overrides$disableSta;\n const nextParams = Object.assign({\n value,\n originalValue,\n label: schema.spec.label,\n path: overrides.path || path,\n spec: schema.spec\n }, params, overrides.params);\n for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);\n const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, (_overrides$disableSta = overrides.disableStackTrace) != null ? _overrides$disableSta : disableStackTrace);\n error.params = nextParams;\n return error;\n }\n const invalid = abortEarly ? panic : next;\n let ctx = {\n path,\n parent,\n type: name,\n from: options.from,\n createError,\n resolve,\n options,\n originalValue,\n schema\n };\n const handleResult = validOrError => {\n if (ValidationError.isError(validOrError)) invalid(validOrError);else if (!validOrError) invalid(createError());else next(null);\n };\n const handleError = err => {\n if (ValidationError.isError(err)) invalid(err);else panic(err);\n };\n const shouldSkip = skipAbsent && isAbsent(value);\n if (shouldSkip) {\n return handleResult(true);\n }\n let result;\n try {\n var _result;\n result = test.call(ctx, value, ctx);\n if (typeof ((_result = result) == null ? void 0 : _result.then) === 'function') {\n if (options.sync) {\n throw new Error(`Validation test of type: \"${ctx.type}\" returned a Promise during a synchronous validate. ` + `This test will finish after the validate call has returned`);\n }\n return Promise.resolve(result).then(handleResult, handleError);\n }\n } catch (err) {\n handleError(err);\n return;\n }\n handleResult(result);\n }\n validate.OPTIONS = config;\n return validate;\n}\n\nfunction getIn(schema, path, value, context = value) {\n let parent, lastPart, lastPartDebug;\n\n // root path: ''\n if (!path) return {\n parent,\n parentPath: path,\n schema\n };\n forEach(path, (_part, isBracket, isArray) => {\n let part = isBracket ? _part.slice(1, _part.length - 1) : _part;\n schema = schema.resolve({\n context,\n parent,\n value\n });\n let isTuple = schema.type === 'tuple';\n let idx = isArray ? parseInt(part, 10) : 0;\n if (schema.innerType || isTuple) {\n if (isTuple && !isArray) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part \"${lastPartDebug}\" must contain an index to the tuple element, e.g. \"${lastPartDebug}[0]\"`);\n if (value && idx >= value.length) {\n throw new Error(`Yup.reach cannot resolve an array item at index: ${_part}, in the path: ${path}. ` + `because there is no value at that index. `);\n }\n parent = value;\n value = value && value[idx];\n schema = isTuple ? schema.spec.types[idx] : schema.innerType;\n }\n\n // sometimes the array index part of a path doesn't exist: \"nested.arr.child\"\n // in these cases the current part is the next schema and should be processed\n // in this iteration. For cases where the index signature is included this\n // check will fail and we'll handle the `child` part on the next iteration like normal\n if (!isArray) {\n if (!schema.fields || !schema.fields[part]) throw new Error(`The schema does not contain the path: ${path}. ` + `(failed at: ${lastPartDebug} which is a type: \"${schema.type}\")`);\n parent = value;\n value = value && value[part];\n schema = schema.fields[part];\n }\n lastPart = part;\n lastPartDebug = isBracket ? '[' + _part + ']' : '.' + _part;\n });\n return {\n schema,\n parent,\n parentPath: lastPart\n };\n}\nfunction reach(obj, path, value, context) {\n return getIn(obj, path, value, context).schema;\n}\n\nclass ReferenceSet extends Set {\n describe() {\n const description = [];\n for (const item of this.values()) {\n description.push(Reference.isRef(item) ? item.describe() : item);\n }\n return description;\n }\n resolveAll(resolve) {\n let result = [];\n for (const item of this.values()) {\n result.push(resolve(item));\n }\n return result;\n }\n clone() {\n return new ReferenceSet(this.values());\n }\n merge(newItems, removeItems) {\n const next = this.clone();\n newItems.forEach(value => next.add(value));\n removeItems.forEach(value => next.delete(value));\n return next;\n }\n}\n\n// tweaked from https://github.com/Kelin2025/nanoclone/blob/0abeb7635bda9b68ef2277093f76dbe3bf3948e1/src/index.js\nfunction clone(src, seen = new Map()) {\n if (isSchema(src) || !src || typeof src !== 'object') return src;\n if (seen.has(src)) return seen.get(src);\n let copy;\n if (src instanceof Date) {\n // Date\n copy = new Date(src.getTime());\n seen.set(src, copy);\n } else if (src instanceof RegExp) {\n // RegExp\n copy = new RegExp(src);\n seen.set(src, copy);\n } else if (Array.isArray(src)) {\n // Array\n copy = new Array(src.length);\n seen.set(src, copy);\n for (let i = 0; i < src.length; i++) copy[i] = clone(src[i], seen);\n } else if (src instanceof Map) {\n // Map\n copy = new Map();\n seen.set(src, copy);\n for (const [k, v] of src.entries()) copy.set(k, clone(v, seen));\n } else if (src instanceof Set) {\n // Set\n copy = new Set();\n seen.set(src, copy);\n for (const v of src) copy.add(clone(v, seen));\n } else if (src instanceof Object) {\n // Object\n copy = {};\n seen.set(src, copy);\n for (const [k, v] of Object.entries(src)) copy[k] = clone(v, seen);\n } else {\n throw Error(`Unable to clone ${src}`);\n }\n return copy;\n}\n\n// If `CustomSchemaMeta` isn't extended with any keys, we'll fall back to a\n// loose Record definition allowing free form usage.\nclass Schema {\n constructor(options) {\n this.type = void 0;\n this.deps = [];\n this.tests = void 0;\n this.transforms = void 0;\n this.conditions = [];\n this._mutate = void 0;\n this.internalTests = {};\n this._whitelist = new ReferenceSet();\n this._blacklist = new ReferenceSet();\n this.exclusiveTests = Object.create(null);\n this._typeCheck = void 0;\n this.spec = void 0;\n this.tests = [];\n this.transforms = [];\n this.withMutation(() => {\n this.typeError(mixed.notType);\n });\n this.type = options.type;\n this._typeCheck = options.check;\n this.spec = Object.assign({\n strip: false,\n strict: false,\n abortEarly: true,\n recursive: true,\n disableStackTrace: false,\n nullable: false,\n optional: true,\n coerce: true\n }, options == null ? void 0 : options.spec);\n this.withMutation(s => {\n s.nonNullable();\n });\n }\n\n // TODO: remove\n get _type() {\n return this.type;\n }\n clone(spec) {\n if (this._mutate) {\n if (spec) Object.assign(this.spec, spec);\n return this;\n }\n\n // if the nested value is a schema we can skip cloning, since\n // they are already immutable\n const next = Object.create(Object.getPrototypeOf(this));\n\n // @ts-expect-error this is readonly\n next.type = this.type;\n next._typeCheck = this._typeCheck;\n next._whitelist = this._whitelist.clone();\n next._blacklist = this._blacklist.clone();\n next.internalTests = Object.assign({}, this.internalTests);\n next.exclusiveTests = Object.assign({}, this.exclusiveTests);\n\n // @ts-expect-error this is readonly\n next.deps = [...this.deps];\n next.conditions = [...this.conditions];\n next.tests = [...this.tests];\n next.transforms = [...this.transforms];\n next.spec = clone(Object.assign({}, this.spec, spec));\n return next;\n }\n label(label) {\n let next = this.clone();\n next.spec.label = label;\n return next;\n }\n meta(...args) {\n if (args.length === 0) return this.spec.meta;\n let next = this.clone();\n next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);\n return next;\n }\n withMutation(fn) {\n let before = this._mutate;\n this._mutate = true;\n let result = fn(this);\n this._mutate = before;\n return result;\n }\n concat(schema) {\n if (!schema || schema === this) return this;\n if (schema.type !== this.type && this.type !== 'mixed') throw new TypeError(`You cannot \\`concat()\\` schema's of different types: ${this.type} and ${schema.type}`);\n let base = this;\n let combined = schema.clone();\n const mergedSpec = Object.assign({}, base.spec, combined.spec);\n combined.spec = mergedSpec;\n combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);\n\n // manually merge the blacklist/whitelist (the other `schema` takes\n // precedence in case of conflicts)\n combined._whitelist = base._whitelist.merge(schema._whitelist, schema._blacklist);\n combined._blacklist = base._blacklist.merge(schema._blacklist, schema._whitelist);\n\n // start with the current tests\n combined.tests = base.tests;\n combined.exclusiveTests = base.exclusiveTests;\n\n // manually add the new tests to ensure\n // the deduping logic is consistent\n combined.withMutation(next => {\n schema.tests.forEach(fn => {\n next.test(fn.OPTIONS);\n });\n });\n combined.transforms = [...base.transforms, ...combined.transforms];\n return combined;\n }\n isType(v) {\n if (v == null) {\n if (this.spec.nullable && v === null) return true;\n if (this.spec.optional && v === undefined) return true;\n return false;\n }\n return this._typeCheck(v);\n }\n resolve(options) {\n let schema = this;\n if (schema.conditions.length) {\n let conditions = schema.conditions;\n schema = schema.clone();\n schema.conditions = [];\n schema = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema);\n schema = schema.resolve(options);\n }\n return schema;\n }\n resolveOptions(options) {\n var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;\n return Object.assign({}, options, {\n from: options.from || [],\n strict: (_options$strict = options.strict) != null ? _options$strict : this.spec.strict,\n abortEarly: (_options$abortEarly = options.abortEarly) != null ? _options$abortEarly : this.spec.abortEarly,\n recursive: (_options$recursive = options.recursive) != null ? _options$recursive : this.spec.recursive,\n disableStackTrace: (_options$disableStack = options.disableStackTrace) != null ? _options$disableStack : this.spec.disableStackTrace\n });\n }\n\n /**\n * Run the configured transform pipeline over an input value.\n */\n\n cast(value, options = {}) {\n let resolvedSchema = this.resolve(Object.assign({\n value\n }, options));\n let allowOptionality = options.assert === 'ignore-optionality';\n let result = resolvedSchema._cast(value, options);\n if (options.assert !== false && !resolvedSchema.isType(result)) {\n if (allowOptionality && isAbsent(result)) {\n return result;\n }\n let formattedValue = printValue(value);\n let formattedResult = printValue(result);\n throw new TypeError(`The value of ${options.path || 'field'} could not be cast to a value ` + `that satisfies the schema type: \"${resolvedSchema.type}\". \\n\\n` + `attempted value: ${formattedValue} \\n` + (formattedResult !== formattedValue ? `result of cast: ${formattedResult}` : ''));\n }\n return result;\n }\n _cast(rawValue, options) {\n let value = rawValue === undefined ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this), rawValue);\n if (value === undefined) {\n value = this.getDefault(options);\n }\n return value;\n }\n _validate(_value, options = {}, panic, next) {\n let {\n path,\n originalValue = _value,\n strict = this.spec.strict\n } = options;\n let value = _value;\n if (!strict) {\n value = this._cast(value, Object.assign({\n assert: false\n }, options));\n }\n let initialTests = [];\n for (let test of Object.values(this.internalTests)) {\n if (test) initialTests.push(test);\n }\n this.runTests({\n path,\n value,\n originalValue,\n options,\n tests: initialTests\n }, panic, initialErrors => {\n // even if we aren't ending early we can't proceed further if the types aren't correct\n if (initialErrors.length) {\n return next(initialErrors, value);\n }\n this.runTests({\n path,\n value,\n originalValue,\n options,\n tests: this.tests\n }, panic, next);\n });\n }\n\n /**\n * Executes a set of validations, either schema, produced Tests or a nested\n * schema validate result.\n */\n runTests(runOptions, panic, next) {\n let fired = false;\n let {\n tests,\n value,\n originalValue,\n path,\n options\n } = runOptions;\n let panicOnce = arg => {\n if (fired) return;\n fired = true;\n panic(arg, value);\n };\n let nextOnce = arg => {\n if (fired) return;\n fired = true;\n next(arg, value);\n };\n let count = tests.length;\n let nestedErrors = [];\n if (!count) return nextOnce([]);\n let args = {\n value,\n originalValue,\n path,\n options,\n schema: this\n };\n for (let i = 0; i < tests.length; i++) {\n const test = tests[i];\n test(args, panicOnce, function finishTestRun(err) {\n if (err) {\n Array.isArray(err) ? nestedErrors.push(...err) : nestedErrors.push(err);\n }\n if (--count <= 0) {\n nextOnce(nestedErrors);\n }\n });\n }\n }\n asNestedTest({\n key,\n index,\n parent,\n parentPath,\n originalParent,\n options\n }) {\n const k = key != null ? key : index;\n if (k == null) {\n throw TypeError('Must include `key` or `index` for nested validations');\n }\n const isIndex = typeof k === 'number';\n let value = parent[k];\n const testOptions = Object.assign({}, options, {\n // Nested validations fields are always strict:\n // 1. parent isn't strict so the casting will also have cast inner values\n // 2. parent is strict in which case the nested values weren't cast either\n strict: true,\n parent,\n value,\n originalValue: originalParent[k],\n // FIXME: tests depend on `index` being passed around deeply,\n // we should not let the options.key/index bleed through\n key: undefined,\n // index: undefined,\n [isIndex ? 'index' : 'key']: k,\n path: isIndex || k.includes('.') ? `${parentPath || ''}[${value ? k : `\"${k}\"`}]` : (parentPath ? `${parentPath}.` : '') + key\n });\n return (_, panic, next) => this.resolve(testOptions)._validate(value, testOptions, panic, next);\n }\n validate(value, options) {\n var _options$disableStack2;\n let schema = this.resolve(Object.assign({}, options, {\n value\n }));\n let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema.spec.disableStackTrace;\n return new Promise((resolve, reject) => schema._validate(value, options, (error, parsed) => {\n if (ValidationError.isError(error)) error.value = parsed;\n reject(error);\n }, (errors, validated) => {\n if (errors.length) reject(new ValidationError(errors, validated, undefined, undefined, disableStackTrace));else resolve(validated);\n }));\n }\n validateSync(value, options) {\n var _options$disableStack3;\n let schema = this.resolve(Object.assign({}, options, {\n value\n }));\n let result;\n let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema.spec.disableStackTrace;\n schema._validate(value, Object.assign({}, options, {\n sync: true\n }), (error, parsed) => {\n if (ValidationError.isError(error)) error.value = parsed;\n throw error;\n }, (errors, validated) => {\n if (errors.length) throw new ValidationError(errors, value, undefined, undefined, disableStackTrace);\n result = validated;\n });\n return result;\n }\n isValid(value, options) {\n return this.validate(value, options).then(() => true, err => {\n if (ValidationError.isError(err)) return false;\n throw err;\n });\n }\n isValidSync(value, options) {\n try {\n this.validateSync(value, options);\n return true;\n } catch (err) {\n if (ValidationError.isError(err)) return false;\n throw err;\n }\n }\n _getDefault(options) {\n let defaultValue = this.spec.default;\n if (defaultValue == null) {\n return defaultValue;\n }\n return typeof defaultValue === 'function' ? defaultValue.call(this, options) : clone(defaultValue);\n }\n getDefault(options\n // If schema is defaulted we know it's at least not undefined\n ) {\n let schema = this.resolve(options || {});\n return schema._getDefault(options);\n }\n default(def) {\n if (arguments.length === 0) {\n return this._getDefault();\n }\n let next = this.clone({\n default: def\n });\n return next;\n }\n strict(isStrict = true) {\n return this.clone({\n strict: isStrict\n });\n }\n nullability(nullable, message) {\n const next = this.clone({\n nullable\n });\n next.internalTests.nullable = createValidation({\n message,\n name: 'nullable',\n test(value) {\n return value === null ? this.schema.spec.nullable : true;\n }\n });\n return next;\n }\n optionality(optional, message) {\n const next = this.clone({\n optional\n });\n next.internalTests.optionality = createValidation({\n message,\n name: 'optionality',\n test(value) {\n return value === undefined ? this.schema.spec.optional : true;\n }\n });\n return next;\n }\n optional() {\n return this.optionality(true);\n }\n defined(message = mixed.defined) {\n return this.optionality(false, message);\n }\n nullable() {\n return this.nullability(true);\n }\n nonNullable(message = mixed.notNull) {\n return this.nullability(false, message);\n }\n required(message = mixed.required) {\n return this.clone().withMutation(next => next.nonNullable(message).defined(message));\n }\n notRequired() {\n return this.clone().withMutation(next => next.nullable().optional());\n }\n transform(fn) {\n let next = this.clone();\n next.transforms.push(fn);\n return next;\n }\n\n /**\n * Adds a test function to the schema's queue of tests.\n * tests can be exclusive or non-exclusive.\n *\n * - exclusive tests, will replace any existing tests of the same name.\n * - non-exclusive: can be stacked\n *\n * If a non-exclusive test is added to a schema with an exclusive test of the same name\n * the exclusive test is removed and further tests of the same name will be stacked.\n *\n * If an exclusive test is added to a schema with non-exclusive tests of the same name\n * the previous tests are removed and further tests of the same name will replace each other.\n */\n\n test(...args) {\n let opts;\n if (args.length === 1) {\n if (typeof args[0] === 'function') {\n opts = {\n test: args[0]\n };\n } else {\n opts = args[0];\n }\n } else if (args.length === 2) {\n opts = {\n name: args[0],\n test: args[1]\n };\n } else {\n opts = {\n name: args[0],\n message: args[1],\n test: args[2]\n };\n }\n if (opts.message === undefined) opts.message = mixed.default;\n if (typeof opts.test !== 'function') throw new TypeError('`test` is a required parameters');\n let next = this.clone();\n let validate = createValidation(opts);\n let isExclusive = opts.exclusive || opts.name && next.exclusiveTests[opts.name] === true;\n if (opts.exclusive) {\n if (!opts.name) throw new TypeError('Exclusive tests must provide a unique `name` identifying the test');\n }\n if (opts.name) next.exclusiveTests[opts.name] = !!opts.exclusive;\n next.tests = next.tests.filter(fn => {\n if (fn.OPTIONS.name === opts.name) {\n if (isExclusive) return false;\n if (fn.OPTIONS.test === validate.OPTIONS.test) return false;\n }\n return true;\n });\n next.tests.push(validate);\n return next;\n }\n when(keys, options) {\n if (!Array.isArray(keys) && typeof keys !== 'string') {\n options = keys;\n keys = '.';\n }\n let next = this.clone();\n let deps = toArray(keys).map(key => new Reference(key));\n deps.forEach(dep => {\n // @ts-ignore readonly array\n if (dep.isSibling) next.deps.push(dep.key);\n });\n next.conditions.push(typeof options === 'function' ? new Condition(deps, options) : Condition.fromOptions(deps, options));\n return next;\n }\n typeError(message) {\n let next = this.clone();\n next.internalTests.typeError = createValidation({\n message,\n name: 'typeError',\n skipAbsent: true,\n test(value) {\n if (!this.schema._typeCheck(value)) return this.createError({\n params: {\n type: this.schema.type\n }\n });\n return true;\n }\n });\n return next;\n }\n oneOf(enums, message = mixed.oneOf) {\n let next = this.clone();\n enums.forEach(val => {\n next._whitelist.add(val);\n next._blacklist.delete(val);\n });\n next.internalTests.whiteList = createValidation({\n message,\n name: 'oneOf',\n skipAbsent: true,\n test(value) {\n let valids = this.schema._whitelist;\n let resolved = valids.resolveAll(this.resolve);\n return resolved.includes(value) ? true : this.createError({\n params: {\n values: Array.from(valids).join(', '),\n resolved\n }\n });\n }\n });\n return next;\n }\n notOneOf(enums, message = mixed.notOneOf) {\n let next = this.clone();\n enums.forEach(val => {\n next._blacklist.add(val);\n next._whitelist.delete(val);\n });\n next.internalTests.blacklist = createValidation({\n message,\n name: 'notOneOf',\n test(value) {\n let invalids = this.schema._blacklist;\n let resolved = invalids.resolveAll(this.resolve);\n if (resolved.includes(value)) return this.createError({\n params: {\n values: Array.from(invalids).join(', '),\n resolved\n }\n });\n return true;\n }\n });\n return next;\n }\n strip(strip = true) {\n let next = this.clone();\n next.spec.strip = strip;\n return next;\n }\n\n /**\n * Return a serialized description of the schema including validations, flags, types etc.\n *\n * @param options Provide any needed context for resolving runtime schema alterations (lazy, when conditions, etc).\n */\n describe(options) {\n const next = (options ? this.resolve(options) : this).clone();\n const {\n label,\n meta,\n optional,\n nullable\n } = next.spec;\n const description = {\n meta,\n label,\n optional,\n nullable,\n default: next.getDefault(options),\n type: next.type,\n oneOf: next._whitelist.describe(),\n notOneOf: next._blacklist.describe(),\n tests: next.tests.map(fn => ({\n name: fn.OPTIONS.name,\n params: fn.OPTIONS.params\n })).filter((n, idx, list) => list.findIndex(c => c.name === n.name) === idx)\n };\n return description;\n }\n}\n// @ts-expect-error\nSchema.prototype.__isYupSchema__ = true;\nfor (const method of ['validate', 'validateSync']) Schema.prototype[`${method}At`] = function (path, value, options = {}) {\n const {\n parent,\n parentPath,\n schema\n } = getIn(this, path, value, options.context);\n return schema[method](parent && parent[parentPath], Object.assign({}, options, {\n parent,\n path\n }));\n};\nfor (const alias of ['equals', 'is']) Schema.prototype[alias] = Schema.prototype.oneOf;\nfor (const alias of ['not', 'nope']) Schema.prototype[alias] = Schema.prototype.notOneOf;\n\nconst returnsTrue = () => true;\nfunction create$8(spec) {\n return new MixedSchema(spec);\n}\nclass MixedSchema extends Schema {\n constructor(spec) {\n super(typeof spec === 'function' ? {\n type: 'mixed',\n check: spec\n } : Object.assign({\n type: 'mixed',\n check: returnsTrue\n }, spec));\n }\n}\ncreate$8.prototype = MixedSchema.prototype;\n\nfunction create$7() {\n return new BooleanSchema();\n}\nclass BooleanSchema extends Schema {\n constructor() {\n super({\n type: 'boolean',\n check(v) {\n if (v instanceof Boolean) v = v.valueOf();\n return typeof v === 'boolean';\n }\n });\n this.withMutation(() => {\n this.transform((value, _raw, ctx) => {\n if (ctx.spec.coerce && !ctx.isType(value)) {\n if (/^(true|1)$/i.test(String(value))) return true;\n if (/^(false|0)$/i.test(String(value))) return false;\n }\n return value;\n });\n });\n }\n isTrue(message = boolean.isValue) {\n return this.test({\n message,\n name: 'is-value',\n exclusive: true,\n params: {\n value: 'true'\n },\n test(value) {\n return isAbsent(value) || value === true;\n }\n });\n }\n isFalse(message = boolean.isValue) {\n return this.test({\n message,\n name: 'is-value',\n exclusive: true,\n params: {\n value: 'false'\n },\n test(value) {\n return isAbsent(value) || value === false;\n }\n });\n }\n default(def) {\n return super.default(def);\n }\n defined(msg) {\n return super.defined(msg);\n }\n optional() {\n return super.optional();\n }\n required(msg) {\n return super.required(msg);\n }\n notRequired() {\n return super.notRequired();\n }\n nullable() {\n return super.nullable();\n }\n nonNullable(msg) {\n return super.nonNullable(msg);\n }\n strip(v) {\n return super.strip(v);\n }\n}\ncreate$7.prototype = BooleanSchema.prototype;\n\n// Taken from HTML spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address\nlet rEmail =\n// eslint-disable-next-line\n/^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\nlet rUrl =\n// eslint-disable-next-line\n/^((https?|ftp):)?\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(\\#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i;\n\n// eslint-disable-next-line\nlet rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nlet isTrimmed = value => isAbsent(value) || value === value.trim();\nlet objStringTag = {}.toString();\nfunction create$6() {\n return new StringSchema();\n}\nclass StringSchema extends Schema {\n constructor() {\n super({\n type: 'string',\n check(value) {\n if (value instanceof String) value = value.valueOf();\n return typeof value === 'string';\n }\n });\n this.withMutation(() => {\n this.transform((value, _raw, ctx) => {\n if (!ctx.spec.coerce || ctx.isType(value)) return value;\n\n // don't ever convert arrays\n if (Array.isArray(value)) return value;\n const strValue = value != null && value.toString ? value.toString() : value;\n\n // no one wants plain objects converted to [Object object]\n if (strValue === objStringTag) return value;\n return strValue;\n });\n });\n }\n required(message) {\n return super.required(message).withMutation(schema => schema.test({\n message: message || mixed.required,\n name: 'required',\n skipAbsent: true,\n test: value => !!value.length\n }));\n }\n notRequired() {\n return super.notRequired().withMutation(schema => {\n schema.tests = schema.tests.filter(t => t.OPTIONS.name !== 'required');\n return schema;\n });\n }\n length(length, message = string.length) {\n return this.test({\n message,\n name: 'length',\n exclusive: true,\n params: {\n length\n },\n skipAbsent: true,\n test(value) {\n return value.length === this.resolve(length);\n }\n });\n }\n min(min, message = string.min) {\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n min\n },\n skipAbsent: true,\n test(value) {\n return value.length >= this.resolve(min);\n }\n });\n }\n max(max, message = string.max) {\n return this.test({\n name: 'max',\n exclusive: true,\n message,\n params: {\n max\n },\n skipAbsent: true,\n test(value) {\n return value.length <= this.resolve(max);\n }\n });\n }\n matches(regex, options) {\n let excludeEmptyString = false;\n let message;\n let name;\n if (options) {\n if (typeof options === 'object') {\n ({\n excludeEmptyString = false,\n message,\n name\n } = options);\n } else {\n message = options;\n }\n }\n return this.test({\n name: name || 'matches',\n message: message || string.matches,\n params: {\n regex\n },\n skipAbsent: true,\n test: value => value === '' && excludeEmptyString || value.search(regex) !== -1\n });\n }\n email(message = string.email) {\n return this.matches(rEmail, {\n name: 'email',\n message,\n excludeEmptyString: true\n });\n }\n url(message = string.url) {\n return this.matches(rUrl, {\n name: 'url',\n message,\n excludeEmptyString: true\n });\n }\n uuid(message = string.uuid) {\n return this.matches(rUUID, {\n name: 'uuid',\n message,\n excludeEmptyString: false\n });\n }\n\n //-- transforms --\n ensure() {\n return this.default('').transform(val => val === null ? '' : val);\n }\n trim(message = string.trim) {\n return this.transform(val => val != null ? val.trim() : val).test({\n message,\n name: 'trim',\n test: isTrimmed\n });\n }\n lowercase(message = string.lowercase) {\n return this.transform(value => !isAbsent(value) ? value.toLowerCase() : value).test({\n message,\n name: 'string_case',\n exclusive: true,\n skipAbsent: true,\n test: value => isAbsent(value) || value === value.toLowerCase()\n });\n }\n uppercase(message = string.uppercase) {\n return this.transform(value => !isAbsent(value) ? value.toUpperCase() : value).test({\n message,\n name: 'string_case',\n exclusive: true,\n skipAbsent: true,\n test: value => isAbsent(value) || value === value.toUpperCase()\n });\n }\n}\ncreate$6.prototype = StringSchema.prototype;\n\n//\n// String Interfaces\n//\n\nlet isNaN$1 = value => value != +value;\nfunction create$5() {\n return new NumberSchema();\n}\nclass NumberSchema extends Schema {\n constructor() {\n super({\n type: 'number',\n check(value) {\n if (value instanceof Number) value = value.valueOf();\n return typeof value === 'number' && !isNaN$1(value);\n }\n });\n this.withMutation(() => {\n this.transform((value, _raw, ctx) => {\n if (!ctx.spec.coerce) return value;\n let parsed = value;\n if (typeof parsed === 'string') {\n parsed = parsed.replace(/\\s/g, '');\n if (parsed === '') return NaN;\n // don't use parseFloat to avoid positives on alpha-numeric strings\n parsed = +parsed;\n }\n\n // null -> NaN isn't useful; treat all nulls as null and let it fail on\n // nullability check vs TypeErrors\n if (ctx.isType(parsed) || parsed === null) return parsed;\n return parseFloat(parsed);\n });\n });\n }\n min(min, message = number.min) {\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n min\n },\n skipAbsent: true,\n test(value) {\n return value >= this.resolve(min);\n }\n });\n }\n max(max, message = number.max) {\n return this.test({\n message,\n name: 'max',\n exclusive: true,\n params: {\n max\n },\n skipAbsent: true,\n test(value) {\n return value <= this.resolve(max);\n }\n });\n }\n lessThan(less, message = number.lessThan) {\n return this.test({\n message,\n name: 'max',\n exclusive: true,\n params: {\n less\n },\n skipAbsent: true,\n test(value) {\n return value < this.resolve(less);\n }\n });\n }\n moreThan(more, message = number.moreThan) {\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n more\n },\n skipAbsent: true,\n test(value) {\n return value > this.resolve(more);\n }\n });\n }\n positive(msg = number.positive) {\n return this.moreThan(0, msg);\n }\n negative(msg = number.negative) {\n return this.lessThan(0, msg);\n }\n integer(message = number.integer) {\n return this.test({\n name: 'integer',\n message,\n skipAbsent: true,\n test: val => Number.isInteger(val)\n });\n }\n truncate() {\n return this.transform(value => !isAbsent(value) ? value | 0 : value);\n }\n round(method) {\n var _method;\n let avail = ['ceil', 'floor', 'round', 'trunc'];\n method = ((_method = method) == null ? void 0 : _method.toLowerCase()) || 'round';\n\n // this exists for symemtry with the new Math.trunc\n if (method === 'trunc') return this.truncate();\n if (avail.indexOf(method.toLowerCase()) === -1) throw new TypeError('Only valid options for round() are: ' + avail.join(', '));\n return this.transform(value => !isAbsent(value) ? Math[method](value) : value);\n }\n}\ncreate$5.prototype = NumberSchema.prototype;\n\n//\n// Number Interfaces\n//\n\n/**\n * This file is a modified version of the file from the following repository:\n * Date.parse with progressive enhancement for ISO 8601 \n * NON-CONFORMANT EDITION.\n * © 2011 Colin Snover \n * Released under MIT license.\n */\n\n// prettier-ignore\n// 1 YYYY 2 MM 3 DD 4 HH 5 mm 6 ss 7 msec 8 Z 9 ± 10 tzHH 11 tzmm\nconst isoReg = /^(\\d{4}|[+-]\\d{6})(?:-?(\\d{2})(?:-?(\\d{2}))?)?(?:[ T]?(\\d{2}):?(\\d{2})(?::?(\\d{2})(?:[,.](\\d{1,}))?)?(?:(Z)|([+-])(\\d{2})(?::?(\\d{2}))?)?)?$/;\nfunction toNumber(str, defaultValue = 0) {\n return Number(str) || defaultValue;\n}\nfunction parseIsoDate(date) {\n const regexResult = isoReg.exec(date);\n if (!regexResult) return Date.parse ? Date.parse(date) : Number.NaN;\n\n // use of toNumber() avoids NaN timestamps caused by “undefined”\n // values being passed to Date constructor\n const struct = {\n year: toNumber(regexResult[1]),\n month: toNumber(regexResult[2], 1) - 1,\n day: toNumber(regexResult[3], 1),\n hour: toNumber(regexResult[4]),\n minute: toNumber(regexResult[5]),\n second: toNumber(regexResult[6]),\n millisecond: regexResult[7] ?\n // allow arbitrary sub-second precision beyond milliseconds\n toNumber(regexResult[7].substring(0, 3)) : 0,\n z: regexResult[8] || undefined,\n plusMinus: regexResult[9] || undefined,\n hourOffset: toNumber(regexResult[10]),\n minuteOffset: toNumber(regexResult[11])\n };\n\n // timestamps without timezone identifiers should be considered local time\n if (struct.z === undefined && struct.plusMinus === undefined) {\n return new Date(struct.year, struct.month, struct.day, struct.hour, struct.minute, struct.second, struct.millisecond).valueOf();\n }\n let totalMinutesOffset = 0;\n if (struct.z !== 'Z' && struct.plusMinus !== undefined) {\n totalMinutesOffset = struct.hourOffset * 60 + struct.minuteOffset;\n if (struct.plusMinus === '+') totalMinutesOffset = 0 - totalMinutesOffset;\n }\n return Date.UTC(struct.year, struct.month, struct.day, struct.hour, struct.minute + totalMinutesOffset, struct.second, struct.millisecond);\n}\n\nlet invalidDate = new Date('');\nlet isDate = obj => Object.prototype.toString.call(obj) === '[object Date]';\nfunction create$4() {\n return new DateSchema();\n}\nclass DateSchema extends Schema {\n constructor() {\n super({\n type: 'date',\n check(v) {\n return isDate(v) && !isNaN(v.getTime());\n }\n });\n this.withMutation(() => {\n this.transform((value, _raw, ctx) => {\n // null -> InvalidDate isn't useful; treat all nulls as null and let it fail on\n // nullability check vs TypeErrors\n if (!ctx.spec.coerce || ctx.isType(value) || value === null) return value;\n value = parseIsoDate(value);\n\n // 0 is a valid timestamp equivalent to 1970-01-01T00:00:00Z(unix epoch) or before.\n return !isNaN(value) ? new Date(value) : DateSchema.INVALID_DATE;\n });\n });\n }\n prepareParam(ref, name) {\n let param;\n if (!Reference.isRef(ref)) {\n let cast = this.cast(ref);\n if (!this._typeCheck(cast)) throw new TypeError(`\\`${name}\\` must be a Date or a value that can be \\`cast()\\` to a Date`);\n param = cast;\n } else {\n param = ref;\n }\n return param;\n }\n min(min, message = date.min) {\n let limit = this.prepareParam(min, 'min');\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n min\n },\n skipAbsent: true,\n test(value) {\n return value >= this.resolve(limit);\n }\n });\n }\n max(max, message = date.max) {\n let limit = this.prepareParam(max, 'max');\n return this.test({\n message,\n name: 'max',\n exclusive: true,\n params: {\n max\n },\n skipAbsent: true,\n test(value) {\n return value <= this.resolve(limit);\n }\n });\n }\n}\nDateSchema.INVALID_DATE = invalidDate;\ncreate$4.prototype = DateSchema.prototype;\ncreate$4.INVALID_DATE = invalidDate;\n\n// @ts-expect-error\nfunction sortFields(fields, excludedEdges = []) {\n let edges = [];\n let nodes = new Set();\n let excludes = new Set(excludedEdges.map(([a, b]) => `${a}-${b}`));\n function addNode(depPath, key) {\n let node = split(depPath)[0];\n nodes.add(node);\n if (!excludes.has(`${key}-${node}`)) edges.push([key, node]);\n }\n for (const key of Object.keys(fields)) {\n let value = fields[key];\n nodes.add(key);\n if (Reference.isRef(value) && value.isSibling) addNode(value.path, key);else if (isSchema(value) && 'deps' in value) value.deps.forEach(path => addNode(path, key));\n }\n return toposort.array(Array.from(nodes), edges).reverse();\n}\n\nfunction findIndex(arr, err) {\n let idx = Infinity;\n arr.some((key, ii) => {\n var _err$path;\n if ((_err$path = err.path) != null && _err$path.includes(key)) {\n idx = ii;\n return true;\n }\n });\n return idx;\n}\nfunction sortByKeyOrder(keys) {\n return (a, b) => {\n return findIndex(keys, a) - findIndex(keys, b);\n };\n}\n\nconst parseJson = (value, _, ctx) => {\n if (typeof value !== 'string') {\n return value;\n }\n let parsed = value;\n try {\n parsed = JSON.parse(value);\n } catch (err) {\n /* */\n }\n return ctx.isType(parsed) ? parsed : value;\n};\n\n// @ts-ignore\nfunction deepPartial(schema) {\n if ('fields' in schema) {\n const partial = {};\n for (const [key, fieldSchema] of Object.entries(schema.fields)) {\n partial[key] = deepPartial(fieldSchema);\n }\n return schema.setFields(partial);\n }\n if (schema.type === 'array') {\n const nextArray = schema.optional();\n if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);\n return nextArray;\n }\n if (schema.type === 'tuple') {\n return schema.optional().clone({\n types: schema.spec.types.map(deepPartial)\n });\n }\n if ('optional' in schema) {\n return schema.optional();\n }\n return schema;\n}\nconst deepHas = (obj, p) => {\n const path = [...normalizePath(p)];\n if (path.length === 1) return path[0] in obj;\n let last = path.pop();\n let parent = getter(join(path), true)(obj);\n return !!(parent && last in parent);\n};\nlet isObject = obj => Object.prototype.toString.call(obj) === '[object Object]';\nfunction unknown(ctx, value) {\n let known = Object.keys(ctx.fields);\n return Object.keys(value).filter(key => known.indexOf(key) === -1);\n}\nconst defaultSort = sortByKeyOrder([]);\nfunction create$3(spec) {\n return new ObjectSchema(spec);\n}\nclass ObjectSchema extends Schema {\n constructor(spec) {\n super({\n type: 'object',\n check(value) {\n return isObject(value) || typeof value === 'function';\n }\n });\n this.fields = Object.create(null);\n this._sortErrors = defaultSort;\n this._nodes = [];\n this._excludedEdges = [];\n this.withMutation(() => {\n if (spec) {\n this.shape(spec);\n }\n });\n }\n _cast(_value, options = {}) {\n var _options$stripUnknown;\n let value = super._cast(_value, options);\n\n //should ignore nulls here\n if (value === undefined) return this.getDefault(options);\n if (!this._typeCheck(value)) return value;\n let fields = this.fields;\n let strip = (_options$stripUnknown = options.stripUnknown) != null ? _options$stripUnknown : this.spec.noUnknown;\n let props = [].concat(this._nodes, Object.keys(value).filter(v => !this._nodes.includes(v)));\n let intermediateValue = {}; // is filled during the transform below\n let innerOptions = Object.assign({}, options, {\n parent: intermediateValue,\n __validating: options.__validating || false\n });\n let isChanged = false;\n for (const prop of props) {\n let field = fields[prop];\n let exists = (prop in value);\n if (field) {\n let fieldValue;\n let inputValue = value[prop];\n\n // safe to mutate since this is fired in sequence\n innerOptions.path = (options.path ? `${options.path}.` : '') + prop;\n field = field.resolve({\n value: inputValue,\n context: options.context,\n parent: intermediateValue\n });\n let fieldSpec = field instanceof Schema ? field.spec : undefined;\n let strict = fieldSpec == null ? void 0 : fieldSpec.strict;\n if (fieldSpec != null && fieldSpec.strip) {\n isChanged = isChanged || prop in value;\n continue;\n }\n fieldValue = !options.__validating || !strict ?\n // TODO: use _cast, this is double resolving\n field.cast(value[prop], innerOptions) : value[prop];\n if (fieldValue !== undefined) {\n intermediateValue[prop] = fieldValue;\n }\n } else if (exists && !strip) {\n intermediateValue[prop] = value[prop];\n }\n if (exists !== prop in intermediateValue || intermediateValue[prop] !== value[prop]) {\n isChanged = true;\n }\n }\n return isChanged ? intermediateValue : value;\n }\n _validate(_value, options = {}, panic, next) {\n let {\n from = [],\n originalValue = _value,\n recursive = this.spec.recursive\n } = options;\n options.from = [{\n schema: this,\n value: originalValue\n }, ...from];\n // this flag is needed for handling `strict` correctly in the context of\n // validation vs just casting. e.g strict() on a field is only used when validating\n options.__validating = true;\n options.originalValue = originalValue;\n super._validate(_value, options, panic, (objectErrors, value) => {\n if (!recursive || !isObject(value)) {\n next(objectErrors, value);\n return;\n }\n originalValue = originalValue || value;\n let tests = [];\n for (let key of this._nodes) {\n let field = this.fields[key];\n if (!field || Reference.isRef(field)) {\n continue;\n }\n tests.push(field.asNestedTest({\n options,\n key,\n parent: value,\n parentPath: options.path,\n originalParent: originalValue\n }));\n }\n this.runTests({\n tests,\n value,\n originalValue,\n options\n }, panic, fieldErrors => {\n next(fieldErrors.sort(this._sortErrors).concat(objectErrors), value);\n });\n });\n }\n clone(spec) {\n const next = super.clone(spec);\n next.fields = Object.assign({}, this.fields);\n next._nodes = this._nodes;\n next._excludedEdges = this._excludedEdges;\n next._sortErrors = this._sortErrors;\n return next;\n }\n concat(schema) {\n let next = super.concat(schema);\n let nextFields = next.fields;\n for (let [field, schemaOrRef] of Object.entries(this.fields)) {\n const target = nextFields[field];\n nextFields[field] = target === undefined ? schemaOrRef : target;\n }\n return next.withMutation(s =>\n // XXX: excludes here is wrong\n s.setFields(nextFields, [...this._excludedEdges, ...schema._excludedEdges]));\n }\n _getDefault(options) {\n if ('default' in this.spec) {\n return super._getDefault(options);\n }\n\n // if there is no default set invent one\n if (!this._nodes.length) {\n return undefined;\n }\n let dft = {};\n this._nodes.forEach(key => {\n var _innerOptions;\n const field = this.fields[key];\n let innerOptions = options;\n if ((_innerOptions = innerOptions) != null && _innerOptions.value) {\n innerOptions = Object.assign({}, innerOptions, {\n parent: innerOptions.value,\n value: innerOptions.value[key]\n });\n }\n dft[key] = field && 'getDefault' in field ? field.getDefault(innerOptions) : undefined;\n });\n return dft;\n }\n setFields(shape, excludedEdges) {\n let next = this.clone();\n next.fields = shape;\n next._nodes = sortFields(shape, excludedEdges);\n next._sortErrors = sortByKeyOrder(Object.keys(shape));\n // XXX: this carries over edges which may not be what you want\n if (excludedEdges) next._excludedEdges = excludedEdges;\n return next;\n }\n shape(additions, excludes = []) {\n return this.clone().withMutation(next => {\n let edges = next._excludedEdges;\n if (excludes.length) {\n if (!Array.isArray(excludes[0])) excludes = [excludes];\n edges = [...next._excludedEdges, ...excludes];\n }\n\n // XXX: excludes here is wrong\n return next.setFields(Object.assign(next.fields, additions), edges);\n });\n }\n partial() {\n const partial = {};\n for (const [key, schema] of Object.entries(this.fields)) {\n partial[key] = 'optional' in schema && schema.optional instanceof Function ? schema.optional() : schema;\n }\n return this.setFields(partial);\n }\n deepPartial() {\n const next = deepPartial(this);\n return next;\n }\n pick(keys) {\n const picked = {};\n for (const key of keys) {\n if (this.fields[key]) picked[key] = this.fields[key];\n }\n return this.setFields(picked, this._excludedEdges.filter(([a, b]) => keys.includes(a) && keys.includes(b)));\n }\n omit(keys) {\n const remaining = [];\n for (const key of Object.keys(this.fields)) {\n if (keys.includes(key)) continue;\n remaining.push(key);\n }\n return this.pick(remaining);\n }\n from(from, to, alias) {\n let fromGetter = getter(from, true);\n return this.transform(obj => {\n if (!obj) return obj;\n let newObj = obj;\n if (deepHas(obj, from)) {\n newObj = Object.assign({}, obj);\n if (!alias) delete newObj[from];\n newObj[to] = fromGetter(obj);\n }\n return newObj;\n });\n }\n\n /** Parse an input JSON string to an object */\n json() {\n return this.transform(parseJson);\n }\n noUnknown(noAllow = true, message = object.noUnknown) {\n if (typeof noAllow !== 'boolean') {\n message = noAllow;\n noAllow = true;\n }\n let next = this.test({\n name: 'noUnknown',\n exclusive: true,\n message: message,\n test(value) {\n if (value == null) return true;\n const unknownKeys = unknown(this.schema, value);\n return !noAllow || unknownKeys.length === 0 || this.createError({\n params: {\n unknown: unknownKeys.join(', ')\n }\n });\n }\n });\n next.spec.noUnknown = noAllow;\n return next;\n }\n unknown(allow = true, message = object.noUnknown) {\n return this.noUnknown(!allow, message);\n }\n transformKeys(fn) {\n return this.transform(obj => {\n if (!obj) return obj;\n const result = {};\n for (const key of Object.keys(obj)) result[fn(key)] = obj[key];\n return result;\n });\n }\n camelCase() {\n return this.transformKeys(camelCase);\n }\n snakeCase() {\n return this.transformKeys(snakeCase);\n }\n constantCase() {\n return this.transformKeys(key => snakeCase(key).toUpperCase());\n }\n describe(options) {\n const next = (options ? this.resolve(options) : this).clone();\n const base = super.describe(options);\n base.fields = {};\n for (const [key, value] of Object.entries(next.fields)) {\n var _innerOptions2;\n let innerOptions = options;\n if ((_innerOptions2 = innerOptions) != null && _innerOptions2.value) {\n innerOptions = Object.assign({}, innerOptions, {\n parent: innerOptions.value,\n value: innerOptions.value[key]\n });\n }\n base.fields[key] = value.describe(innerOptions);\n }\n return base;\n }\n}\ncreate$3.prototype = ObjectSchema.prototype;\n\nfunction create$2(type) {\n return new ArraySchema(type);\n}\nclass ArraySchema extends Schema {\n constructor(type) {\n super({\n type: 'array',\n spec: {\n types: type\n },\n check(v) {\n return Array.isArray(v);\n }\n });\n\n // `undefined` specifically means uninitialized, as opposed to \"no subtype\"\n this.innerType = void 0;\n this.innerType = type;\n }\n _cast(_value, _opts) {\n const value = super._cast(_value, _opts);\n\n // should ignore nulls here\n if (!this._typeCheck(value) || !this.innerType) {\n return value;\n }\n let isChanged = false;\n const castArray = value.map((v, idx) => {\n const castElement = this.innerType.cast(v, Object.assign({}, _opts, {\n path: `${_opts.path || ''}[${idx}]`\n }));\n if (castElement !== v) {\n isChanged = true;\n }\n return castElement;\n });\n return isChanged ? castArray : value;\n }\n _validate(_value, options = {}, panic, next) {\n var _options$recursive;\n // let sync = options.sync;\n // let path = options.path;\n let innerType = this.innerType;\n // let endEarly = options.abortEarly ?? this.spec.abortEarly;\n let recursive = (_options$recursive = options.recursive) != null ? _options$recursive : this.spec.recursive;\n options.originalValue != null ? options.originalValue : _value;\n super._validate(_value, options, panic, (arrayErrors, value) => {\n var _options$originalValu2;\n if (!recursive || !innerType || !this._typeCheck(value)) {\n next(arrayErrors, value);\n return;\n }\n\n // #950 Ensure that sparse array empty slots are validated\n let tests = new Array(value.length);\n for (let index = 0; index < value.length; index++) {\n var _options$originalValu;\n tests[index] = innerType.asNestedTest({\n options,\n index,\n parent: value,\n parentPath: options.path,\n originalParent: (_options$originalValu = options.originalValue) != null ? _options$originalValu : _value\n });\n }\n this.runTests({\n value,\n tests,\n originalValue: (_options$originalValu2 = options.originalValue) != null ? _options$originalValu2 : _value,\n options\n }, panic, innerTypeErrors => next(innerTypeErrors.concat(arrayErrors), value));\n });\n }\n clone(spec) {\n const next = super.clone(spec);\n // @ts-expect-error readonly\n next.innerType = this.innerType;\n return next;\n }\n\n /** Parse an input JSON string to an object */\n json() {\n return this.transform(parseJson);\n }\n concat(schema) {\n let next = super.concat(schema);\n\n // @ts-expect-error readonly\n next.innerType = this.innerType;\n if (schema.innerType)\n // @ts-expect-error readonly\n next.innerType = next.innerType ?\n // @ts-expect-error Lazy doesn't have concat and will break\n next.innerType.concat(schema.innerType) : schema.innerType;\n return next;\n }\n of(schema) {\n // FIXME: this should return a new instance of array without the default to be\n let next = this.clone();\n if (!isSchema(schema)) throw new TypeError('`array.of()` sub-schema must be a valid yup schema not: ' + printValue(schema));\n\n // @ts-expect-error readonly\n next.innerType = schema;\n next.spec = Object.assign({}, next.spec, {\n types: schema\n });\n return next;\n }\n length(length, message = array.length) {\n return this.test({\n message,\n name: 'length',\n exclusive: true,\n params: {\n length\n },\n skipAbsent: true,\n test(value) {\n return value.length === this.resolve(length);\n }\n });\n }\n min(min, message) {\n message = message || array.min;\n return this.test({\n message,\n name: 'min',\n exclusive: true,\n params: {\n min\n },\n skipAbsent: true,\n // FIXME(ts): Array\n test(value) {\n return value.length >= this.resolve(min);\n }\n });\n }\n max(max, message) {\n message = message || array.max;\n return this.test({\n message,\n name: 'max',\n exclusive: true,\n params: {\n max\n },\n skipAbsent: true,\n test(value) {\n return value.length <= this.resolve(max);\n }\n });\n }\n ensure() {\n return this.default(() => []).transform((val, original) => {\n // We don't want to return `null` for nullable schema\n if (this._typeCheck(val)) return val;\n return original == null ? [] : [].concat(original);\n });\n }\n compact(rejector) {\n let reject = !rejector ? v => !!v : (v, i, a) => !rejector(v, i, a);\n return this.transform(values => values != null ? values.filter(reject) : values);\n }\n describe(options) {\n const next = (options ? this.resolve(options) : this).clone();\n const base = super.describe(options);\n if (next.innerType) {\n var _innerOptions;\n let innerOptions = options;\n if ((_innerOptions = innerOptions) != null && _innerOptions.value) {\n innerOptions = Object.assign({}, innerOptions, {\n parent: innerOptions.value,\n value: innerOptions.value[0]\n });\n }\n base.innerType = next.innerType.describe(innerOptions);\n }\n return base;\n }\n}\ncreate$2.prototype = ArraySchema.prototype;\n\n// @ts-ignore\nfunction create$1(schemas) {\n return new TupleSchema(schemas);\n}\nclass TupleSchema extends Schema {\n constructor(schemas) {\n super({\n type: 'tuple',\n spec: {\n types: schemas\n },\n check(v) {\n const types = this.spec.types;\n return Array.isArray(v) && v.length === types.length;\n }\n });\n this.withMutation(() => {\n this.typeError(tuple.notType);\n });\n }\n _cast(inputValue, options) {\n const {\n types\n } = this.spec;\n const value = super._cast(inputValue, options);\n if (!this._typeCheck(value)) {\n return value;\n }\n let isChanged = false;\n const castArray = types.map((type, idx) => {\n const castElement = type.cast(value[idx], Object.assign({}, options, {\n path: `${options.path || ''}[${idx}]`\n }));\n if (castElement !== value[idx]) isChanged = true;\n return castElement;\n });\n return isChanged ? castArray : value;\n }\n _validate(_value, options = {}, panic, next) {\n let itemTypes = this.spec.types;\n super._validate(_value, options, panic, (tupleErrors, value) => {\n var _options$originalValu2;\n // intentionally not respecting recursive\n if (!this._typeCheck(value)) {\n next(tupleErrors, value);\n return;\n }\n let tests = [];\n for (let [index, itemSchema] of itemTypes.entries()) {\n var _options$originalValu;\n tests[index] = itemSchema.asNestedTest({\n options,\n index,\n parent: value,\n parentPath: options.path,\n originalParent: (_options$originalValu = options.originalValue) != null ? _options$originalValu : _value\n });\n }\n this.runTests({\n value,\n tests,\n originalValue: (_options$originalValu2 = options.originalValue) != null ? _options$originalValu2 : _value,\n options\n }, panic, innerTypeErrors => next(innerTypeErrors.concat(tupleErrors), value));\n });\n }\n describe(options) {\n const next = (options ? this.resolve(options) : this).clone();\n const base = super.describe(options);\n base.innerType = next.spec.types.map((schema, index) => {\n var _innerOptions;\n let innerOptions = options;\n if ((_innerOptions = innerOptions) != null && _innerOptions.value) {\n innerOptions = Object.assign({}, innerOptions, {\n parent: innerOptions.value,\n value: innerOptions.value[index]\n });\n }\n return schema.describe(innerOptions);\n });\n return base;\n }\n}\ncreate$1.prototype = TupleSchema.prototype;\n\nfunction create(builder) {\n return new Lazy(builder);\n}\nclass Lazy {\n constructor(builder) {\n this.type = 'lazy';\n this.__isYupSchema__ = true;\n this.spec = void 0;\n this._resolve = (value, options = {}) => {\n let schema = this.builder(value, options);\n if (!isSchema(schema)) throw new TypeError('lazy() functions must return a valid schema');\n if (this.spec.optional) schema = schema.optional();\n return schema.resolve(options);\n };\n this.builder = builder;\n this.spec = {\n meta: undefined,\n optional: false\n };\n }\n clone(spec) {\n const next = new Lazy(this.builder);\n next.spec = Object.assign({}, this.spec, spec);\n return next;\n }\n optionality(optional) {\n const next = this.clone({\n optional\n });\n return next;\n }\n optional() {\n return this.optionality(true);\n }\n resolve(options) {\n return this._resolve(options.value, options);\n }\n cast(value, options) {\n return this._resolve(value, options).cast(value, options);\n }\n asNestedTest(config) {\n let {\n key,\n index,\n parent,\n options\n } = config;\n let value = parent[index != null ? index : key];\n return this._resolve(value, Object.assign({}, options, {\n value,\n parent\n })).asNestedTest(config);\n }\n validate(value, options) {\n return this._resolve(value, options).validate(value, options);\n }\n validateSync(value, options) {\n return this._resolve(value, options).validateSync(value, options);\n }\n validateAt(path, value, options) {\n return this._resolve(value, options).validateAt(path, value, options);\n }\n validateSyncAt(path, value, options) {\n return this._resolve(value, options).validateSyncAt(path, value, options);\n }\n isValid(value, options) {\n return this._resolve(value, options).isValid(value, options);\n }\n isValidSync(value, options) {\n return this._resolve(value, options).isValidSync(value, options);\n }\n describe(options) {\n return options ? this.resolve(options).describe(options) : {\n type: 'lazy',\n meta: this.spec.meta,\n label: undefined\n };\n }\n meta(...args) {\n if (args.length === 0) return this.spec.meta;\n let next = this.clone();\n next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);\n return next;\n }\n}\n\nfunction setLocale(custom) {\n Object.keys(custom).forEach(type => {\n // @ts-ignore\n Object.keys(custom[type]).forEach(method => {\n // @ts-ignore\n locale[type][method] = custom[type][method];\n });\n });\n}\n\nfunction addMethod(schemaType, name, fn) {\n if (!schemaType || !isSchema(schemaType.prototype)) throw new TypeError('You must provide a yup schema constructor function');\n if (typeof name !== 'string') throw new TypeError('A Method name must be provided');\n if (typeof fn !== 'function') throw new TypeError('Method function must be provided');\n schemaType.prototype[name] = fn;\n}\n\nexport { ArraySchema, BooleanSchema, DateSchema, MixedSchema, NumberSchema, ObjectSchema, Schema, StringSchema, TupleSchema, ValidationError, addMethod, create$2 as array, create$7 as bool, create$7 as boolean, create$4 as date, locale as defaultLocale, getIn, isSchema, create as lazy, create$8 as mixed, create$5 as number, create$3 as object, printValue, reach, create$9 as ref, setLocale, create$6 as string, create$1 as tuple };\n"],"names":["has","dequal","foo","bar","ctor","len","subscribeOnce","observable","resolve","update","object","path","value","o","set","cloneDeep","isNullish","isEmpty","getValues","results","values","getErrorsFromSchema","initialValues","schema","errors","key","innerError","deepEqual","isEqual","assignDeep","copy","result","accumulator","index","util","NO_ERROR","IS_TOUCHED","isCheckbox","element","isFileInput","resolveValue","createForm","config","validationSchema","validateFunction","onSubmit","getInitial","form","writable","touched","isSubmitting","isValidating","isValid","derived","$errors","field","modified","$form","isModified","$modified","validateField","validateFieldValue","updateTouched","get","error","errs","updateValidateField","updateField","handleChange","event","handleSubmit","clearErrorsAndSubmit","yupErrors","updatedErrors","handleReset","updateInitialValues","newValues","$touched","$isValid","$isValidating","$isSubmitting","$isModified","Cache","maxSize","SPLIT_REGEX","DIGIT_REGEX","LEAD_DIGIT_REGEX","SPEC_CHAR_REGEX","CLEAN_QUOTES_REGEX","MAX_CACHE_SIZE","pathCache","setCache","getCache","propertyExpr","split","normalizePath","parts","obj","data","part","safe","segments","isQuoted","cb","thisArg","forEach","iter","idx","isArray","isBracket","shouldBeQuoted","str","hasLeadingNumber","hasSpecialChars","reWords","words","upperFirst","join","d","camelCase","acc","next","pascalCase","snakeCase","kebabCase","sentenceCase","titleCase","tinyCase","toposortModule","edges","toposort","uniqueNodes","nodes","cursor","sorted","visited","outgoingEdges","makeOutgoingEdges","nodesHash","makeNodesHash","edge","visit","node","i","predecessors","nodeRep","outgoing","child","arr","res","toString","errorToString","regExpToString","symbolToString","SYMBOL_REGEXP","printNumber","val","printSimpleValue","quoteStrings","typeOf","tag","printValue","toArray","_Symbol$toStringTag","strReg","ValidationError","message","params","_","err","errorOrErrors","type","disableStack","innerErrors","mixed","originalValue","castMsg","string","number","date","boolean","array","tuple","spec","typeLen","isSchema","Condition","refs","is","then","otherwise","check","_branch","branch","builder","base","options","ref","prefixes","Reference","prefix","getter","parent","context","isAbsent","createValidation","validate","panic","name","test","skipAbsent","abortEarly","disableStackTrace","item","createError","overrides","_overrides$disableSta","nextParams","invalid","ctx","handleResult","validOrError","handleError","_result","getIn","lastPart","lastPartDebug","_part","isTuple","ReferenceSet","description","newItems","removeItems","clone","src","seen","k","v","Schema","s","label","args","fn","before","combined","mergedSpec","conditions","prevSchema","condition","_options$strict","_options$abortEarly","_options$recursive","_options$disableStack","resolvedSchema","allowOptionality","formattedValue","formattedResult","rawValue","prevValue","_value","strict","initialTests","initialErrors","runOptions","fired","tests","panicOnce","arg","nextOnce","count","nestedErrors","parentPath","originalParent","isIndex","testOptions","_options$disableStack2","reject","parsed","validated","_options$disableStack3","defaultValue","def","isStrict","nullable","optional","opts","isExclusive","keys","deps","dep","enums","valids","resolved","invalids","strip","meta","n","list","method","alias","create$7","BooleanSchema","_raw","msg","rEmail","rUrl","rUUID","isTrimmed","objStringTag","create$6","StringSchema","strValue","length","min","max","regex","excludeEmptyString","isNaN$1","create$5","NumberSchema","less","more","_method","avail","isoReg","toNumber","parseIsoDate","regexResult","struct","totalMinutesOffset","invalidDate","isDate","DateSchema","param","cast","limit","sortFields","fields","excludedEdges","excludes","a","b","addNode","depPath","findIndex","ii","_err$path","sortByKeyOrder","parseJson","deepPartial","partial","fieldSchema","nextArray","deepHas","p","last","isObject","unknown","known","defaultSort","create$3","ObjectSchema","_options$stripUnknown","props","intermediateValue","innerOptions","isChanged","prop","exists","fieldValue","inputValue","fieldSpec","from","recursive","objectErrors","fieldErrors","nextFields","schemaOrRef","target","dft","_innerOptions","shape","additions","picked","remaining","to","fromGetter","newObj","noAllow","unknownKeys","allow","_innerOptions2","create$2","ArraySchema","_opts","castArray","castElement","innerType","arrayErrors","_options$originalValu2","_options$originalValu","innerTypeErrors","original","rejector"],"mappings":"meAAA,IAAIA,GAAM,OAAO,UAAU,eAEpB,SAASC,GAAOC,EAAKC,EAAK,CAChC,IAAIC,EAAMC,EACV,GAAIH,IAAQC,EAAK,MAAO,GAExB,GAAID,GAAOC,IAAQC,EAAKF,EAAI,eAAiBC,EAAI,YAAa,CAC7D,GAAIC,IAAS,KAAM,OAAOF,EAAI,YAAcC,EAAI,UAChD,GAAIC,IAAS,OAAQ,OAAOF,EAAI,aAAeC,EAAI,WAEnD,GAAIC,IAAS,MAAO,CACnB,IAAKC,EAAIH,EAAI,UAAYC,EAAI,OAC5B,KAAOE,KAASJ,GAAOC,EAAIG,CAAG,EAAGF,EAAIE,CAAG,CAAC,GAAE,CAE5C,OAAOA,IAAQ,EACf,CAED,GAAI,CAACD,GAAQ,OAAOF,GAAQ,SAAU,CACrCG,EAAM,EACN,IAAKD,KAAQF,EAEZ,GADIF,GAAI,KAAKE,EAAKE,CAAI,GAAK,EAAEC,GAAO,CAACL,GAAI,KAAKG,EAAKC,CAAI,GACnD,EAAEA,KAAQD,IAAQ,CAACF,GAAOC,EAAIE,CAAI,EAAGD,EAAIC,CAAI,CAAC,EAAG,MAAO,GAE7D,OAAO,OAAO,KAAKD,C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