@wdns/vuetify-stepper-form
Version:
The Vuetify Stepper Form plugin provides a structured way to create multi-step forms using Vue 3, TypeScript, and Vuetify. It features a stepper layout that allows users to navigate between steps with form validation. The plugin is customizable and stream
927 lines • 102 kB
JavaScript
import { defineComponent as Re, openBlock as $, createElementBlock as de, createElementVNode as we, createTextVNode as Pa, createCommentVNode as ke, computed as y, toValue as F, unref as o, onMounted as ll, getCurrentInstance as ua, provide as Ca, isRef as Ge, watch as Be, onBeforeUnmount as Zl, ref as fe, reactive as Oa, nextTick as Te, warn as Yl, readonly as et, watchEffect as at, inject as Ke, onUnmounted as na, toRef as ga, resolveDynamicComponent as Al, h as lt, shallowRef as Wa, mergeModels as je, useModel as Qe, toRefs as ia, createBlock as se, mergeProps as We, withCtx as z, createVNode as Y, useCssVars as tt, Fragment as Ee, normalizeClass as Ae, normalizeStyle as aa, renderList as Le, withModifiers as dl, withKeys as nt, createSlots as tl, withDirectives as Pl, vModelText as Ul, useId as Nl, useSlots as nl, toRaw as it, renderSlot as il, markRaw as Ye, toDisplayString as ea, mergeDefaults as ot, useAttrs as ut, useTemplateRef as rt, defineAsyncComponent as vl } from "vue";
import "@vueuse/core";
import { useDisplay as st } from "vuetify";
import dt from "@wdns/vuetify-color-field";
import { VMessages as Fl, VTextField as vt, VTextarea as ct, VSelect as ft, VFileInput as pt, VCombobox as mt, VAutocomplete as ht } from "vuetify/components";
import { VDateInput as gt } from "vuetify/labs/VDateInput";
import { VBtn as Aa } from "vuetify/components/VBtn";
import { VItemGroup as yt, VItem as bt } from "vuetify/components/VItemGroup";
import { VLabel as ol } from "vuetify/components/VLabel";
import { VCheckbox as cl } from "vuetify/components/VCheckbox";
import { VRadio as Vt } from "vuetify/components/VRadio";
import { VRadioGroup as Ot } from "vuetify/components/VRadioGroup";
import { VSwitch as kt } from "vuetify/components/VSwitch";
import { VRow as ja, VCol as fa, VContainer as Ra } from "vuetify/components/VGrid";
import { VCard as xt } from "vuetify/components/VCard";
import { VList as _t, VListItem as fl, VListItemTitle as pl, VListItemSubtitle as ml } from "vuetify/components/VList";
import { VDivider as Ct } from "vuetify/components/VDivider";
import { VStepper as jt, VStepperHeader as It, VStepperItem as Et, VStepperWindow as St, VStepperWindowItem as wt, VStepperActions as Mt } from "vuetify/components/VStepper";
import { VTooltip as At } from "vuetify/components/VTooltip";
/**
* @name @wdns/vuetify-stepper-form
* @version 1.2.8
* @description The Vuetify Stepper Form plugin provides a structured way to create multi-step forms using Vue 3, TypeScript, and Vuetify. It features a stepper layout that allows users to navigate between steps with form validation. The plugin is customizable and streamlines building dynamic, interactive forms that guide users through sequential steps.
* @author WebDevNerdStuff & Bunnies... lots and lots of bunnies! <webdevnerdstuff@gmail.com> (https://webdevnerdstuff.com)
* @copyright Copyright 2025, WebDevNerdStuff
* @homepage https://webdevnerdstuff.github.io/vuetify-stepper-form/
* @repository https://github.com/webdevnerdstuff/vuetify-stepper-form
* @license MIT License
*/
const Pt = { "data-cy": "vsf-field-label" }, Ut = ["innerHTML"], Nt = { key: 0, class: "text-error ms-1" }, da = Re({ __name: "FieldLabel", props: { label: {}, required: { type: Boolean, default: !1 } }, setup: (e) => (l, n) => ($(), de("div", Pt, [we("span", { innerHTML: l.label }, null, 8, Ut), n[0] || (n[0] = Pa()), l.required ? ($(), de("span", Nt, "*")) : ke("", !0)])) }), Ja = (e, l, n = {}) => {
const i = (v, a) => {
const r = { ...v };
for (const m in a) a[m] === void 0 || typeof a[m] != "object" || Array.isArray(a[m]) ? a[m] !== void 0 && (r[m] = a[m]) : r[m] = i(r[m] ?? {}, a[m]);
return r;
};
return [e, l, n].filter(Boolean).reduce(i, {});
}, hl = (e) => ({ altLabels: e.altLabels, autoPage: e.autoPage, autoPageDelay: e.autoPageDelay, bgColor: e.bgColor, border: e.border, color: e.color, density: e.density, disabled: e.disabled, editIcon: e.editIcon, editable: e.editable, elevation: e.elevation, errorIcon: e.errorIcon, fieldColumns: e.fieldColumns, flat: e.flat, headerTooltips: e.headerTooltips, height: e.height, hideActions: e.hideActions, hideDetails: e.hideDetails, keepValuesOnUnmount: e.keepValuesOnUnmount, maxHeight: e.maxHeight, maxWidth: e.maxWidth, minHeight: e.minHeight, minWidth: e.minWidth, nextText: e.nextText, prevText: e.prevText, rounded: e.rounded, selectedClass: e.selectedClass, summaryColumns: e.summaryColumns, tag: e.tag, theme: e.theme, tile: e.tile, tooltipLocation: e.tooltipLocation, tooltipOffset: e.tooltipOffset, tooltipTransition: e.tooltipTransition, transition: e.transition, validateOn: e.validateOn, validateOnMount: e.validateOnMount, variant: e.variant }), Ga = (e) => {
const { columns: l, propName: n } = e;
let i = !1;
if (l && (Object.values(l).forEach((v) => {
(v < 1 || v > 12) && (i = !0);
}), i)) throw new Error(`The ${n} values must be between 1 and 12`);
}, Ka = (e) => {
let l = -1, n = -1;
return e.forEach((i, v) => {
i.editable === !1 && (l === -1 && (l = v), n = v);
}), { firstNonEditableIndex: l, lastNonEditableIndex: n };
}, ya = "v-stepper-form", $l = Symbol(), Qa = { autoPageDelay: 250, direction: "horizontal", disabled: !1, editable: !0, jumpAhead: !1, keepValuesOnUnmount: !1, navButtonSize: "large", tooltipLocation: "bottom", tooltipOffset: 10, tooltipTransition: "fade-transition", transition: "fade-transition", width: "100%" };
/**
* vee-validate v4.15.0
* (c) 2024 Abdelrahman Awad
* @license MIT
*/
function Se(e) {
return typeof e == "function";
}
function Bl(e) {
return e == null;
}
const la = (e) => e !== null && !!e && typeof e == "object" && !Array.isArray(e);
function ul(e) {
return Number(e) >= 0;
}
function gl(e) {
if (!/* @__PURE__ */ function(n) {
return typeof n == "object" && n !== null;
}(e) || function(n) {
return n == null ? n === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(n);
}(e) !== "[object Object]") return !1;
if (Object.getPrototypeOf(e) === null) return !0;
let l = e;
for (; Object.getPrototypeOf(l) !== null; ) l = Object.getPrototypeOf(l);
return Object.getPrototypeOf(e) === l;
}
function ba(e, l) {
return Object.keys(l).forEach((n) => {
if (gl(l[n]) && gl(e[n])) return e[n] || (e[n] = {}), void ba(e[n], l[n]);
e[n] = l[n];
}), e;
}
function Va(e) {
const l = e.split(".");
if (!l.length) return "";
let n = String(l[0]);
for (let i = 1; i < l.length; i++) ul(l[i]) ? n += `[${l[i]}]` : n += `.${l[i]}`;
return n;
}
const Ft = {};
function yl(e, l, n) {
typeof n.value == "object" && (n.value = re(n.value)), n.enumerable && !n.get && !n.set && n.configurable && n.writable && l !== "__proto__" ? e[l] = n.value : Object.defineProperty(e, l, n);
}
function re(e) {
if (typeof e != "object") return e;
var l, n, i, v = 0, a = Object.prototype.toString.call(e);
if (a === "[object Object]" ? i = Object.create(e.__proto__ || null) : a === "[object Array]" ? i = Array(e.length) : a === "[object Set]" ? (i = /* @__PURE__ */ new Set(), e.forEach(function(r) {
i.add(re(r));
})) : a === "[object Map]" ? (i = /* @__PURE__ */ new Map(), e.forEach(function(r, m) {
i.set(re(m), re(r));
})) : a === "[object Date]" ? i = /* @__PURE__ */ new Date(+e) : a === "[object RegExp]" ? i = new RegExp(e.source, e.flags) : a === "[object DataView]" ? i = new e.constructor(re(e.buffer)) : a === "[object ArrayBuffer]" ? i = e.slice(0) : a.slice(-6) === "Array]" && (i = new e.constructor(e)), i) {
for (n = Object.getOwnPropertySymbols(e); v < n.length; v++) yl(i, n[v], Object.getOwnPropertyDescriptor(e, n[v]));
for (v = 0, n = Object.getOwnPropertyNames(e); v < n.length; v++) Object.hasOwnProperty.call(i, l = n[v]) && i[l] === e[l] || yl(i, l, Object.getOwnPropertyDescriptor(e, l));
}
return i || e;
}
const rl = Symbol("vee-validate-form"), $t = Symbol("vee-validate-form-context"), Bt = Symbol("vee-validate-field-instance"), Ua = Symbol("Default empty value"), Tl = typeof window < "u";
function Xa(e) {
return Se(e) && !!e.__locatorRef;
}
function De(e) {
return !!e && Se(e.parse) && e.__type === "VVTypedSchema";
}
function Na(e) {
return !!e && Se(e.validate);
}
function Ia(e) {
return e === "checkbox" || e === "radio";
}
function Ba(e) {
return /^\[.+\]$/i.test(e);
}
function bl(e) {
return e.tagName === "SELECT";
}
function Tt(e, l) {
return !function(n, i) {
const v = ![!1, null, void 0, 0].includes(i.multiple) && !Number.isNaN(i.multiple);
return n === "select" && "multiple" in i && v;
}(e, l) && l.type !== "file" && !Ia(l.type);
}
function Dl(e) {
return !!e && (!!(typeof Event < "u" && Se(Event) && e instanceof Event) || !(!e || !e.srcElement));
}
function Vl(e, l) {
return l in e && e[l] !== Ua;
}
function Pe(e, l) {
if (e === l) return !0;
if (e && l && typeof e == "object" && typeof l == "object") {
if (e.constructor !== l.constructor) return !1;
var n, i, v;
if (Array.isArray(e)) {
if ((n = e.length) != l.length) return !1;
for (i = n; i-- != 0; ) if (!Pe(e[i], l[i])) return !1;
return !0;
}
if (e instanceof Map && l instanceof Map) {
if (e.size !== l.size) return !1;
for (i of e.entries()) if (!l.has(i[0])) return !1;
for (i of e.entries()) if (!Pe(i[1], l.get(i[0]))) return !1;
return !0;
}
if (kl(e) && kl(l)) return e.size === l.size && e.name === l.name && e.lastModified === l.lastModified && e.type === l.type;
if (e instanceof Set && l instanceof Set) {
if (e.size !== l.size) return !1;
for (i of e.entries()) if (!l.has(i[0])) return !1;
return !0;
}
if (ArrayBuffer.isView(e) && ArrayBuffer.isView(l)) {
if ((n = e.length) != l.length) return !1;
for (i = n; i-- != 0; ) if (e[i] !== l[i]) return !1;
return !0;
}
if (e.constructor === RegExp) return e.source === l.source && e.flags === l.flags;
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === l.valueOf();
if (e.toString !== Object.prototype.toString) return e.toString() === l.toString();
if ((n = (v = Object.keys(e)).length - Ol(e, v)) !== Object.keys(l).length - Ol(l, Object.keys(l))) return !1;
for (i = n; i-- != 0; ) if (!Object.prototype.hasOwnProperty.call(l, v[i])) return !1;
for (i = n; i-- != 0; ) {
var a = v[i];
if (!Pe(e[a], l[a])) return !1;
}
return !0;
}
return e != e && l != l;
}
function Ol(e, l) {
let n = 0;
for (let i = l.length; i-- != 0; )
e[l[i]] === void 0 && n++;
return n;
}
function kl(e) {
return !!Tl && e instanceof File;
}
function sl(e) {
return Ba(e) ? e.replace(/\[|\]/gi, "") : e;
}
function Ne(e, l, n) {
return e ? Ba(l) ? e[sl(l)] : (l || "").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i, v) => {
return (la(a = i) || Array.isArray(a)) && v in i ? i[v] : n;
var a;
}, e) : n;
}
function qe(e, l, n) {
if (Ba(l)) return void (e[sl(l)] = n);
const i = l.split(/\.|\[(\d+)\]/).filter(Boolean);
let v = e;
for (let a = 0; a < i.length; a++) {
if (a === i.length - 1) return void (v[i[a]] = n);
i[a] in v && !Bl(v[i[a]]) || (v[i[a]] = ul(i[a + 1]) ? [] : {}), v = v[i[a]];
}
}
function Ha(e, l) {
Array.isArray(e) && ul(l) ? e.splice(Number(l), 1) : la(e) && delete e[l];
}
function xl(e, l) {
if (Ba(l)) return void delete e[sl(l)];
const n = l.split(/\.|\[(\d+)\]/).filter(Boolean);
let i = e;
for (let r = 0; r < n.length; r++) {
if (r === n.length - 1) {
Ha(i, n[r]);
break;
}
if (!(n[r] in i) || Bl(i[n[r]])) break;
i = i[n[r]];
}
const v = n.map((r, m) => Ne(e, n.slice(0, m).join(".")));
for (let r = v.length - 1; r >= 0; r--) a = v[r], (Array.isArray(a) ? a.length === 0 : la(a) && Object.keys(a).length === 0) && (r !== 0 ? Ha(v[r - 1], n[r - 1]) : Ha(e, n[0]));
var a;
}
function Ue(e) {
return Object.keys(e);
}
function Ll(e, l = void 0) {
const n = ua();
return (n == null ? void 0 : n.provides[e]) || Ke(e, l);
}
function _l(e, l, n) {
if (Array.isArray(e)) {
const i = [...e], v = i.findIndex((a) => Pe(a, l));
return v >= 0 ? i.splice(v, 1) : i.push(l), i;
}
return Pe(e, l) ? n : l;
}
function Cl(e, l = 0) {
let n = null, i = [];
return function(...v) {
return n && clearTimeout(n), n = setTimeout(() => {
const a = e(...v);
i.forEach((r) => r(a)), i = [];
}, l), new Promise((a) => i.push(a));
};
}
function Dt(e, l) {
return la(l) && l.number ? function(n) {
const i = parseFloat(n);
return isNaN(i) ? n : i;
}(e) : e;
}
function Za(e, l) {
let n;
return async function(...i) {
const v = e(...i);
n = v;
const a = await v;
return v !== n ? a : (n = void 0, l(a, i));
};
}
function Ya(e) {
return Array.isArray(e) ? e : e ? [e] : [];
}
function wa(e, l) {
const n = {};
for (const i in e) l.includes(i) || (n[i] = e[i]);
return n;
}
function za(e) {
if (Rl(e)) return e._value;
}
function Rl(e) {
return "_value" in e;
}
function Fa(e) {
if (!Dl(e)) return e;
const l = e.target;
if (Ia(l.type) && Rl(l)) return za(l);
if (l.type === "file" && l.files) {
const i = Array.from(l.files);
return l.multiple ? i : i[0];
}
if (bl(n = l) && n.multiple) return Array.from(l.options).filter((i) => i.selected && !i.disabled).map(za);
var n;
if (bl(l)) {
const i = Array.from(l.options).find((v) => v.selected);
return i ? za(i) : l.value;
}
return function(i) {
return i.type === "number" || i.type === "range" ? Number.isNaN(i.valueAsNumber) ? i.value : i.valueAsNumber : i.value;
}(l);
}
function Hl(e) {
const l = {};
return Object.defineProperty(l, "_$$isNormalized", { value: !0, writable: !1, enumerable: !1, configurable: !1 }), e ? la(e) && e._$$isNormalized ? e : la(e) ? Object.keys(e).reduce((n, i) => {
const v = function(a) {
return a === !0 ? [] : Array.isArray(a) || la(a) ? a : [a];
}(e[i]);
return e[i] !== !1 && (n[i] = jl(v)), n;
}, l) : typeof e != "string" ? l : e.split("|").reduce((n, i) => {
const v = Lt(i);
return v.name && (n[v.name] = jl(v.params)), n;
}, l) : l;
}
function jl(e) {
const l = (n) => typeof n == "string" && n[0] === "@" ? function(i) {
const v = (a) => {
var r;
return (r = Ne(a, i)) !== null && r !== void 0 ? r : a[i];
};
return v.__locatorRef = i, v;
}(n.slice(1)) : n;
return Array.isArray(e) ? e.map(l) : e instanceof RegExp ? [e] : Object.keys(e).reduce((n, i) => (n[i] = l(e[i]), n), {});
}
const Lt = (e) => {
let l = [];
const n = e.split(":")[0];
return e.includes(":") && (l = e.split(":").slice(1).join(":").split(",")), { name: n, params: l };
};
let Rt = Object.assign({}, { generateMessage: ({ field: e }) => `${e} is not valid.`, bails: !0, validateOnBlur: !0, validateOnChange: !0, validateOnInput: !1, validateOnModelUpdate: !0 });
const ra = () => Rt;
async function zl(e, l, n = {}) {
const i = n == null ? void 0 : n.bails, v = { name: (n == null ? void 0 : n.name) || "{field}", rules: l, label: n == null ? void 0 : n.label, bails: i == null || i, formData: (n == null ? void 0 : n.values) || {} }, a = await async function(r, m) {
const h = r.rules;
if (De(h) || Na(h)) return async function(C, O) {
const x = De(O.rules) ? O.rules : ql(O.rules), d = await x.parse(C, { formData: O.formData }), j = [];
for (const M of d.errors) M.errors.length && j.push(...M.errors);
return { value: d.value, errors: j };
}(m, Object.assign(Object.assign({}, r), { rules: h }));
if (Se(h) || Array.isArray(h)) {
const C = { field: r.label || r.name, name: r.name, label: r.label, form: r.formData, value: m }, O = Array.isArray(h) ? h : [h], x = O.length, d = [];
for (let j = 0; j < x; j++) {
const M = O[j], P = await M(m, C);
if (!(typeof P != "string" && !Array.isArray(P) && P)) {
if (Array.isArray(P)) d.push(...P);
else {
const B = typeof P == "string" ? P : Wl(C);
d.push(B);
}
if (r.bails) return { errors: d };
}
}
return { errors: d };
}
const p = Object.assign(Object.assign({}, r), { rules: Hl(h) }), V = [], _ = Object.keys(p.rules), k = _.length;
for (let C = 0; C < k; C++) {
const O = _[C], x = await Ht(p, m, { name: O, params: p.rules[O] });
if (x.error && (V.push(x.error), r.bails)) return { errors: V };
}
return { errors: V };
}(v, e);
return Object.assign(Object.assign({}, a), { valid: !a.errors.length });
}
function ql(e) {
return { __type: "VVTypedSchema", async parse(l, n) {
var i;
try {
return { output: await e.validate(l, { abortEarly: !1, context: (n == null ? void 0 : n.formData) || {} }), errors: [] };
} catch (v) {
if (!function(r) {
return !!r && r.name === "ValidationError";
}(v)) throw v;
if (!(!((i = v.inner) === null || i === void 0) && i.length) && v.errors.length) return { errors: [{ path: v.path, errors: v.errors }] };
const a = v.inner.reduce((r, m) => {
const h = m.path || "";
return r[h] || (r[h] = { errors: [], path: h }), r[h].errors.push(...m.errors), r;
}, {});
return { errors: Object.values(a) };
}
} };
}
async function Ht(e, l, n) {
const i = (v = n.name, Ft[v]);
var v;
if (!i) throw new Error(`No such validator '${n.name}' exists.`);
const a = function(h, p) {
const V = (_) => Xa(_) ? _(p) : _;
return Array.isArray(h) ? h.map(V) : Object.keys(h).reduce((_, k) => (_[k] = V(h[k]), _), {});
}(n.params, e.formData), r = { field: e.label || e.name, name: e.name, label: e.label, value: l, form: e.formData, rule: Object.assign(Object.assign({}, n), { params: a }) }, m = await i(l, a, r);
return typeof m == "string" ? { error: m } : { error: m ? void 0 : Wl(r) };
}
function Wl(e) {
const l = ra().generateMessage;
return l ? l(e) : "Field is invalid";
}
async function zt(e, l, n) {
const i = Ue(e).map(async (h) => {
var p, V, _;
const k = (p = n == null ? void 0 : n.names) === null || p === void 0 ? void 0 : p[h], C = await zl(Ne(l, h), e[h], { name: (k == null ? void 0 : k.name) || h, label: k == null ? void 0 : k.label, values: l, bails: (_ = (V = n == null ? void 0 : n.bailsMap) === null || V === void 0 ? void 0 : V[h]) === null || _ === void 0 || _ });
return Object.assign(Object.assign({}, C), { path: h });
});
let v = !0;
const a = await Promise.all(i), r = {}, m = {};
for (const h of a) r[h.path] = { valid: h.valid, errors: h.errors }, h.valid || (v = !1, m[h.path] = h.errors[0]);
return { valid: v, results: r, errors: m, source: "schema" };
}
let Il = 0;
function qt(e, l) {
const { value: n, initialValue: i, setInitialValue: v } = function(m, h, p) {
const V = fe(o(h));
function _() {
return p ? Ne(p.initialValues.value, o(m), o(V)) : o(V);
}
function k(d) {
p ? p.setFieldInitialValue(o(m), d, !0) : V.value = d;
}
const C = y(_);
if (!p)
return { value: fe(_()), initialValue: C, setInitialValue: k };
const O = function(d, j, M, P) {
return Ge(d) ? o(d) : d !== void 0 ? d : Ne(j.values, o(P), o(M));
}(h, p, C, m);
return p.stageInitialValue(o(m), O, !0), { value: y({ get: () => Ne(p.values, o(m)), set(d) {
p.setFieldValue(o(m), d, !1);
} }), initialValue: C, setInitialValue: k };
}(e, l.modelValue, l.form);
if (!l.form) {
let _ = function(k) {
var C;
"value" in k && (n.value = k.value), "errors" in k && h(k.errors), "touched" in k && (V.touched = (C = k.touched) !== null && C !== void 0 ? C : V.touched), "initialValue" in k && v(k.initialValue);
};
const { errors: m, setErrors: h } = function() {
const k = fe([]);
return { errors: k, setErrors: (C) => {
k.value = Ya(C);
} };
}(), p = Il >= Number.MAX_SAFE_INTEGER ? 0 : ++Il, V = function(k, C, O, x) {
const d = y(() => {
var M, P, B;
return (B = (P = (M = F(x)) === null || M === void 0 ? void 0 : M.describe) === null || P === void 0 ? void 0 : P.call(M).required) !== null && B !== void 0 && B;
}), j = Oa({ touched: !1, pending: !1, valid: !0, required: d, validated: !!o(O).length, initialValue: y(() => o(C)), dirty: y(() => !Pe(o(k), o(C))) });
return Be(O, (M) => {
j.valid = !M.length;
}, { immediate: !0, flush: "sync" }), j;
}(n, i, m, l.schema);
return { id: p, path: e, value: n, initialValue: i, meta: V, flags: { pendingUnmount: { [p]: !1 }, pendingReset: !1 }, errors: m, setState: _ };
}
const a = l.form.createPathState(e, { bails: l.bails, label: l.label, type: l.type, validate: l.validate, schema: l.schema }), r = y(() => a.errors);
return { id: Array.isArray(a.id) ? a.id[a.id.length - 1] : a.id, path: e, value: n, errors: r, meta: a, initialValue: i, flags: a.__flags, setState: function(m) {
var h, p, V;
"value" in m && (n.value = m.value), "errors" in m && ((h = l.form) === null || h === void 0 || h.setFieldError(o(e), m.errors)), "touched" in m && ((p = l.form) === null || p === void 0 || p.setFieldTouched(o(e), (V = m.touched) !== null && V !== void 0 && V)), "initialValue" in m && v(m.initialValue);
} };
}
const ka = {}, xa = {}, _a = "vee-validate-inspector", Wt = 12405579, Jt = 448379, Gt = 5522283, $a = 16777215, el = 0, Kt = 218007, Qt = 12157168, Xt = 16099682, Zt = 12304330;
let sa, Oe = null;
async function Jl(e) {
if (process.env.NODE_ENV !== "production") {
if (!Tl) return;
(await import("./index-Bp1ttSj7.mjs")).setupDevtoolsPlugin({ id: "vee-validate-devtools-plugin", label: "VeeValidate Plugin", packageName: "vee-validate", homepage: "https://vee-validate.logaretm.com/v4", app: e, logo: "https://vee-validate.logaretm.com/v4/logo.png" }, (l) => {
sa = l, l.addInspector({ id: _a, icon: "rule", label: "vee-validate", noSelectionText: "Select a vee-validate node to inspect", actions: [{ icon: "done_outline", tooltip: "Validate selected item", action: async () => {
Oe ? Oe.type !== "field" ? Oe.type !== "form" ? Oe.type === "pathState" && await Oe.form.validateField(Oe.state.path) : await Oe.form.validate() : await Oe.field.validate() : console.error("There is not a valid selected vee-validate node or component");
} }, { icon: "delete_sweep", tooltip: "Clear validation state of the selected item", action: () => {
Oe ? Oe.type !== "field" ? (Oe.type === "form" && Oe.form.resetForm(), Oe.type === "pathState" && Oe.form.resetField(Oe.state.path)) : Oe.field.resetField() : console.error("There is not a valid selected vee-validate node or component");
} }] }), l.on.getInspectorTree((n) => {
if (n.inspectorId !== _a) return;
const i = Object.values(ka), v = Object.values(xa);
n.rootNodes = [...i.map(Yt), ...v.map((a) => function(r, m) {
return { id: al(m, r), label: o(r.name), tags: Gl(!1, 1, r.type, r.meta.valid, m) };
}(a))];
}), l.on.getInspectorState((n) => {
if (n.inspectorId !== _a) return;
const { form: i, field: v, state: a, type: r } = function(m) {
try {
const h = JSON.parse(decodeURIComponent(atob(m))), p = ka[h.f];
if (!p && h.ff) {
const _ = xa[h.ff];
return _ ? { type: h.type, field: _ } : {};
}
if (!p) return {};
const V = p.getPathState(h.ff);
return { type: h.type, form: p, state: V };
} catch {
}
return {};
}(n.nodeId);
return l.unhighlightElement(), i && r === "form" ? (n.state = function(m) {
const { errorBag: h, meta: p, values: V, isSubmitting: _, isValidating: k, submitCount: C } = m;
return { "Form state": [{ key: "submitCount", value: C.value }, { key: "isSubmitting", value: _.value }, { key: "isValidating", value: k.value }, { key: "touched", value: p.value.touched }, { key: "dirty", value: p.value.dirty }, { key: "valid", value: p.value.valid }, { key: "initialValues", value: p.value.initialValues }, { key: "currentValues", value: V }, { key: "errors", value: Ue(h.value).reduce((O, x) => {
var d;
const j = (d = h.value[x]) === null || d === void 0 ? void 0 : d[0];
return j && (O[x] = j), O;
}, {}) }] };
}(i), Oe = { type: "form", form: i }, void l.highlightElement(i._vm)) : a && r === "pathState" && i ? (n.state = El(a), void (Oe = { type: "pathState", state: a, form: i })) : v && r === "field" ? (n.state = El({ errors: v.errors.value, dirty: v.meta.dirty, valid: v.meta.valid, touched: v.meta.touched, value: v.value.value, initialValue: v.meta.initialValue }), Oe = { field: v, type: "field" }, void l.highlightElement(v._vm)) : (Oe = null, void l.unhighlightElement());
});
});
}
}
const pa = /* @__PURE__ */ function(e, l) {
let n, i;
return function(...v) {
const a = this;
return n || (n = !0, setTimeout(() => n = !1, l), i = e.apply(a, v)), i;
};
}(() => {
setTimeout(async () => {
await Te(), sa == null || sa.sendInspectorState(_a), sa == null || sa.sendInspectorTree(_a);
}, 100);
}, 100);
function Yt(e) {
const { textColor: l, bgColor: n } = Kl(e.meta.value.valid), i = {};
Object.values(e.getAllPathStates()).forEach((a) => {
qe(i, F(a.path), function(r, m) {
return { id: al(m, r), label: F(r.path), tags: Gl(r.multiple, r.fieldsCount, r.type, r.valid, m) };
}(a, e));
});
const { children: v } = function a(r, m = []) {
const h = [...m].pop();
return "id" in r ? Object.assign(Object.assign({}, r), { label: h || r.label }) : la(r) ? { id: `${m.join(".")}`, label: h || "", children: Object.keys(r).map((p) => a(r[p], [...m, p])) } : Array.isArray(r) ? { id: `${m.join(".")}`, label: `${h}[]`, children: r.map((p, V) => a(p, [...m, String(V)])) } : { id: "", label: "", children: [] };
}(i);
return { id: al(e), label: e.name, children: v, tags: [{ label: "Form", textColor: l, backgroundColor: n }, { label: `${e.getAllPathStates().length} fields`, textColor: $a, backgroundColor: Gt }] };
}
function Gl(e, l, n, i, v) {
const { textColor: a, bgColor: r } = Kl(i);
return [e ? void 0 : { label: "Field", textColor: a, backgroundColor: r }, v ? void 0 : { label: "Standalone", textColor: el, backgroundColor: Zt }, n === "checkbox" ? { label: "Checkbox", textColor: $a, backgroundColor: Kt } : void 0, n === "radio" ? { label: "Radio", textColor: $a, backgroundColor: Qt } : void 0, e ? { label: "Multiple", textColor: el, backgroundColor: Xt } : void 0].filter(Boolean);
}
function al(e, l) {
const n = l ? "path" in l ? "pathState" : "field" : "form", i = l ? "path" in l ? l == null ? void 0 : l.path : F(l == null ? void 0 : l.name) : "", v = { f: e == null ? void 0 : e.formId, ff: (l == null ? void 0 : l.id) || i, type: n };
return btoa(encodeURIComponent(JSON.stringify(v)));
}
function El(e) {
return { "Field state": [{ key: "errors", value: e.errors }, { key: "initialValue", value: e.initialValue }, { key: "currentValue", value: e.value }, { key: "touched", value: e.touched }, { key: "dirty", value: e.dirty }, { key: "valid", value: e.valid }] };
}
function Kl(e) {
return { bgColor: e ? Jt : Wt, textColor: e ? el : $a };
}
function ma(e, l, n) {
return Ia(n == null ? void 0 : n.type) ? function(i, v, a) {
const r = a != null && a.standalone ? void 0 : Ll(rl), m = a == null ? void 0 : a.checkedValue, h = a == null ? void 0 : a.uncheckedValue;
function p(V) {
const _ = V.handleChange, k = y(() => {
const O = F(V.value), x = F(m);
return Array.isArray(O) ? O.findIndex((d) => Pe(d, x)) >= 0 : Pe(x, O);
});
function C(O, x = !0) {
var d, j;
if (k.value === ((d = O == null ? void 0 : O.target) === null || d === void 0 ? void 0 : d.checked)) return void (x && V.validate());
const M = F(i), P = r == null ? void 0 : r.getPathState(M), B = Fa(O);
let q = (j = F(m)) !== null && j !== void 0 ? j : B;
r && (P != null && P.multiple) && P.type === "checkbox" ? q = _l(Ne(r.values, M) || [], q, void 0) : (a == null ? void 0 : a.type) === "checkbox" && (q = _l(F(V.value), q, F(h))), _(q, x);
}
return Object.assign(Object.assign({}, V), { checked: k, checkedValue: m, uncheckedValue: h, handleChange: C });
}
return p(Sl(i, v, a));
}(e, l, n) : Sl(e, l, n);
}
function Sl(e, l, n) {
const { initialValue: i, validateOnMount: v, bails: a, type: r, checkedValue: m, label: h, validateOnValueUpdate: p, uncheckedValue: V, controlled: _, keepValueOnUnmount: k, syncVModel: C, form: O } = function(g) {
const D = () => ({ initialValue: void 0, validateOnMount: !1, bails: !0, label: void 0, validateOnValueUpdate: !0, keepValueOnUnmount: void 0, syncVModel: !1, controlled: !0 }), ae = !!(g != null && g.syncVModel), G = typeof (g == null ? void 0 : g.syncVModel) == "string" ? g.syncVModel : (g == null ? void 0 : g.modelPropName) || "modelValue", ne = ae && !("initialValue" in (g || {})) ? qa(ua(), G) : g == null ? void 0 : g.initialValue;
if (!g) return Object.assign(Object.assign({}, D()), { initialValue: ne });
const T = "valueProp" in g ? g.valueProp : g.checkedValue, me = "standalone" in g ? !g.standalone : g.controlled, he = (g == null ? void 0 : g.modelPropName) || (g == null ? void 0 : g.syncVModel) || !1;
return Object.assign(Object.assign(Object.assign({}, D()), g || {}), { initialValue: ne, controlled: me == null || me, checkedValue: T, syncVModel: he });
}(n), x = _ ? Ll(rl) : void 0, d = O || x, j = y(() => Va(F(e))), M = y(() => {
if (F(d == null ? void 0 : d.schema)) return;
const g = o(l);
return Na(g) || De(g) || Se(g) || Array.isArray(g) ? g : Hl(g);
}), P = !Se(M.value) && De(F(l)), { id: B, value: q, initialValue: ie, meta: Z, setState: xe, errors: R, flags: X } = qt(j, { modelValue: i, form: d, bails: a, label: h, type: r, validate: M.value ? oe : void 0, schema: P ? l : void 0 }), le = y(() => R.value[0]);
C && function({ prop: g, value: D, handleChange: ae, shouldValidate: G }) {
const ne = ua();
if (!ne || !g) return void (process.env.NODE_ENV !== "production" && console.warn("Failed to setup model events because `useField` was not called in setup."));
const T = typeof g == "string" ? g : "modelValue", me = `update:${T}`;
T in ne.props && (Be(D, (he) => {
Pe(he, qa(ne, T)) || ne.emit(me, he);
}), Be(() => qa(ne, T), (he) => {
if (he === Ua && D.value === void 0) return;
const _e = he === Ua ? void 0 : he;
Pe(_e, D.value) || ae(_e, G());
}));
}({ value: q, prop: C, handleChange: be, shouldValidate: () => p && !X.pendingReset });
async function ve(g) {
var D, ae;
if (d != null && d.validateSchema) {
const { results: G } = await d.validateSchema(g);
return (D = G[F(j)]) !== null && D !== void 0 ? D : { valid: !0, errors: [] };
}
return M.value ? zl(q.value, M.value, { name: F(j), label: F(h), values: (ae = d == null ? void 0 : d.values) !== null && ae !== void 0 ? ae : {}, bails: a }) : { valid: !0, errors: [] };
}
const W = Za(async () => (Z.pending = !0, Z.validated = !0, ve("validated-only")), (g) => (X.pendingUnmount[Q.id] || (xe({ errors: g.errors }), Z.pending = !1, Z.valid = g.valid), g)), w = Za(async () => ve("silent"), (g) => (Z.valid = g.valid, g));
function oe(g) {
return (g == null ? void 0 : g.mode) === "silent" ? w() : W();
}
function be(g, D = !0) {
te(Fa(g), D);
}
function J(g) {
var D;
const ae = g && "value" in g ? g.value : ie.value;
xe({ value: re(ae), initialValue: re(ae), touched: (D = g == null ? void 0 : g.touched) !== null && D !== void 0 && D, errors: (g == null ? void 0 : g.errors) || [] }), Z.pending = !1, Z.validated = !1, w();
}
ll(() => {
if (v) return W();
d && d.validateSchema || w();
});
const ce = ua();
function te(g, D = !0) {
q.value = ce && C ? Dt(g, ce.props.modelModifiers) : g, (D ? W : w)();
}
const ee = y({ get: () => q.value, set(g) {
te(g, p);
} }), Q = { id: B, name: j, label: h, value: ee, meta: Z, errors: R, errorMessage: le, type: r, checkedValue: m, uncheckedValue: V, bails: a, keepValueOnUnmount: k, resetField: J, handleReset: () => J(), validate: oe, handleChange: be, handleBlur: (g, D = !1) => {
Z.touched = !0, D && W();
}, setState: xe, setTouched: function(g) {
Z.touched = g;
}, setErrors: function(g) {
xe({ errors: Array.isArray(g) ? g : [g] });
}, setValue: te };
if (Ca(Bt, Q), Ge(l) && typeof o(l) != "function" && Be(l, (g, D) => {
Pe(g, D) || (Z.validated ? W() : w());
}, { deep: !0 }), process.env.NODE_ENV !== "production" && (Q._vm = ua(), Be(() => Object.assign(Object.assign({ errors: R.value }, Z), { value: q.value }), pa, { deep: !0 }), d || function(g) {
const D = ua();
if (!sa) {
const ae = D == null ? void 0 : D.appContext.app;
if (!ae) return;
Jl(ae);
}
xa[g.id] = Object.assign({}, g), xa[g.id]._vm = D, na(() => {
delete xa[g.id], pa();
}), pa();
}(Q)), !d) return Q;
const pe = y(() => {
const g = M.value;
return !g || Se(g) || Na(g) || De(g) || Array.isArray(g) ? {} : Object.keys(g).reduce((D, ae) => {
const G = (ne = g[ae], Array.isArray(ne) ? ne.filter(Xa) : Ue(ne).filter((T) => Xa(ne[T])).map((T) => ne[T])).map((T) => T.__locatorRef).reduce((T, me) => {
const he = Ne(d.values, me) || d.values[me];
return he !== void 0 && (T[me] = he), T;
}, {});
var ne;
return Object.assign(D, G), D;
}, {});
});
return Be(pe, (g, D) => {
Object.keys(g).length && !Pe(g, D) && (Z.validated ? W() : w());
}), Zl(() => {
var g;
const D = (g = F(Q.keepValueOnUnmount)) !== null && g !== void 0 ? g : F(d.keepValuesOnUnmount), ae = F(j);
if (D || !d || X.pendingUnmount[Q.id]) return void (d == null || d.removePathState(ae, B));
X.pendingUnmount[Q.id] = !0;
const G = d.getPathState(ae);
if (Array.isArray(G == null ? void 0 : G.id) && (G != null && G.multiple) ? G != null && G.id.includes(Q.id) : (G == null ? void 0 : G.id) === Q.id) {
if (G != null && G.multiple && Array.isArray(G.value)) {
const ne = G.value.findIndex((T) => Pe(T, F(Q.checkedValue)));
if (ne > -1) {
const T = [...G.value];
T.splice(ne, 1), d.setFieldValue(ae, T);
}
Array.isArray(G.id) && G.id.splice(G.id.indexOf(Q.id), 1);
} else d.unsetPathValue(F(j));
d.removePathState(ae, B);
}
}), Q;
}
function qa(e, l) {
if (e) return e.props[l];
}
function wl(e, l) {
let n = e.as || "";
return e.as || l.slots.default || (n = "input"), n;
}
function en(e, l) {
return Ia(l.attrs.type) ? Vl(e, "modelValue") ? e.modelValue : void 0 : Vl(e, "modelValue") ? e.modelValue : l.attrs.value;
}
const an = Re({ name: "Field", inheritAttrs: !1, props: { as: { type: [String, Object], default: void 0 }, name: { type: String, required: !0 }, rules: { type: [Object, String, Function], default: void 0 }, validateOnMount: { type: Boolean, default: !1 }, validateOnBlur: { type: Boolean, default: void 0 }, validateOnChange: { type: Boolean, default: void 0 }, validateOnInput: { type: Boolean, default: void 0 }, validateOnModelUpdate: { type: Boolean, default: void 0 }, bails: { type: Boolean, default: () => ra().bails }, label: { type: String, default: void 0 }, uncheckedValue: { type: null, default: void 0 }, modelValue: { type: null, default: Ua }, modelModifiers: { type: null, default: () => ({}) }, "onUpdate:modelValue": { type: null, default: void 0 }, standalone: { type: Boolean, default: !1 }, keepValue: { type: Boolean, default: void 0 } }, setup(e, l) {
const n = ga(e, "rules"), i = ga(e, "name"), v = ga(e, "label"), a = ga(e, "uncheckedValue"), r = ga(e, "keepValue"), { errors: m, value: h, errorMessage: p, validate: V, handleChange: _, handleBlur: k, setTouched: C, resetField: O, handleReset: x, meta: d, checked: j, setErrors: M, setValue: P } = ma(i, n, { validateOnMount: e.validateOnMount, bails: e.bails, standalone: e.standalone, type: l.attrs.type, initialValue: en(e, l), checkedValue: l.attrs.value, uncheckedValue: a, label: v, validateOnValueUpdate: e.validateOnModelUpdate, keepValueOnUnmount: r, syncVModel: !0 }), B = function(R, X = !0) {
_(R, X);
}, q = y(() => {
const { validateOnInput: R, validateOnChange: X, validateOnBlur: le, validateOnModelUpdate: ve } = function(w) {
var oe, be, J, ce;
const { validateOnInput: te, validateOnChange: ee, validateOnBlur: Q, validateOnModelUpdate: pe } = ra();
return { validateOnInput: (oe = w.validateOnInput) !== null && oe !== void 0 ? oe : te, validateOnChange: (be = w.validateOnChange) !== null && be !== void 0 ? be : ee, validateOnBlur: (J = w.validateOnBlur) !== null && J !== void 0 ? J : Q, validateOnModelUpdate: (ce = w.validateOnModelUpdate) !== null && ce !== void 0 ? ce : pe };
}(e);
return { name: e.name, onBlur: function(w) {
k(w, le), Se(l.attrs.onBlur) && l.attrs.onBlur(w);
}, onInput: function(w) {
B(w, R), Se(l.attrs.onInput) && l.attrs.onInput(w);
}, onChange: function(w) {
B(w, X), Se(l.attrs.onChange) && l.attrs.onChange(w);
}, "onUpdate:modelValue": (w) => B(w, ve) };
}), ie = y(() => {
const R = Object.assign({}, q.value);
return Ia(l.attrs.type) && j && (R.checked = j.value), Tt(wl(e, l), l.attrs) && (R.value = h.value), R;
}), Z = y(() => Object.assign(Object.assign({}, q.value), { modelValue: h.value }));
function xe() {
return { field: ie.value, componentField: Z.value, value: h.value, meta: d, errors: m.value, errorMessage: p.value, validate: V, resetField: O, handleChange: B, handleInput: (R) => B(R, !1), handleReset: x, handleBlur: q.value.onBlur, setTouched: C, setErrors: M, setValue: P };
}
return l.expose({ value: h, meta: d, errors: m, errorMessage: p, setErrors: M, setTouched: C, setValue: P, reset: O, validate: V, handleChange: _ }), () => {
const R = Al(wl(e, l)), X = function(le, ve, W) {
return ve.slots.default ? typeof le != "string" && le ? { default: () => {
var w, oe;
return (oe = (w = ve.slots).default) === null || oe === void 0 ? void 0 : oe.call(w, W());
} } : ve.slots.default(W()) : ve.slots.default;
}(R, l, xe);
return R ? lt(R, Object.assign(Object.assign({}, l.attrs), ie.value), X) : X;
};
} });
let ln = 0;
const Ma = ["bails", "fieldsCount", "id", "multiple", "type", "validate"];
function Ml(e) {
const l = (e == null ? void 0 : e.initialValues) || {}, n = Object.assign({}, F(l)), i = o(e == null ? void 0 : e.validationSchema);
return i && De(i) && Se(i.cast) ? re(i.cast(n) || {}) : re(n);
}
function tn(e) {
var l;
const n = ln++, i = (e == null ? void 0 : e.name) || "Form";
let v = 0;
const a = fe(!1), r = fe(!1), m = fe(0), h = [], p = Oa(Ml(e)), V = fe([]), _ = fe({}), k = fe({}), C = /* @__PURE__ */ function(t) {
let u = null, s = [];
return function(...f) {
const c = Te(() => {
if (u !== c) return;
const A = t(...f);
s.forEach((S) => S(A)), s = [], u = null;
});
return u = c, new Promise((A) => s.push(A));
};
}(() => {
k.value = V.value.reduce((t, u) => (t[Va(F(u.path))] = u, t), {});
});
function O(t, u) {
const s = J(t);
if (s) {
if (typeof t == "string") {
const f = Va(t);
_.value[f] && delete _.value[f];
}
s.errors = Ya(u), s.valid = !s.errors.length;
} else typeof t == "string" && (_.value[Va(t)] = Ya(u));
}
function x(t) {
Ue(t).forEach((u) => {
O(u, t[u]);
});
}
e != null && e.initialErrors && x(e.initialErrors);
const d = y(() => {
const t = V.value.reduce((u, s) => (s.errors.length && (u[F(s.path)] = s.errors), u), {});
return Object.assign(Object.assign({}, _.value), t);
}), j = y(() => Ue(d.value).reduce((t, u) => {
const s = d.value[u];
return s != null && s.length && (t[u] = s[0]), t;
}, {})), M = y(() => V.value.reduce((t, u) => (t[F(u.path)] = { name: F(u.path) || "", label: u.label || "" }, t), {})), P = y(() => V.value.reduce((t, u) => {
var s;
return t[F(u.path)] = (s = u.bails) === null || s === void 0 || s, t;
}, {})), B = Object.assign({}, (e == null ? void 0 : e.initialErrors) || {}), q = (l = e == null ? void 0 : e.keepValuesOnUnmount) !== null && l !== void 0 && l, { initialValues: ie, originalInitialValues: Z, setInitialValues: xe } = function(t, u, s) {
const f = Ml(s), c = fe(f), A = fe(re(f));
function S(N, U) {
U != null && U.force ? (c.value = re(N), A.value = re(N)) : (c.value = ba(re(c.value) || {}, re(N)), A.value = ba(re(A.value) || {}, re(N))), U != null && U.updateFields && t.value.forEach((ue) => {
if (ue.touched) return;
const H = Ne(c.value, F(ue.path));
qe(u, F(ue.path), re(H));
});
}
return { initialValues: c, originalInitialValues: A, setInitialValues: S };
}(V, p, e), R = function(t, u, s, f) {
const c = { touched: "some", pending: "some", valid: "every" }, A = y(() => !Pe(u, o(s)));
function S() {
const U = t.value;
return Ue(c).reduce((ue, H) => {
const Ve = c[H];
return ue[H] = U[Ve]((ge) => ge[H]), ue;
}, {});
}
const N = Oa(S());
return at(() => {
const U = S();
N.touched = U.touched, N.valid = U.valid, N.pending = U.pending;
}), y(() => Object.assign(Object.assign({ initialValues: o(s) }, N), { valid: N.valid && !Ue(f.value).length, dirty: A.value }));
}(V, p, Z, j), X = y(() => V.value.reduce((t, u) => {
const s = Ne(p, F(u.path));
return qe(t, F(u.path), s), t;
}, {})), le = e == null ? void 0 : e.validationSchema;
function ve(t, u) {
var s, f;
const c = y(() => Ne(ie.value, F(t))), A = k.value[F(t)], S = (u == null ? void 0 : u.type) === "checkbox" || (u == null ? void 0 : u.type) === "radio";
if (A && S) {
A.multiple = !0;
const ye = v++;
return Array.isArray(A.id) ? A.id.push(ye) : A.id = [A.id, ye], A.fieldsCount++, A.__flags.pendingUnmount[ye] = !1, A;
}
const N = y(() => Ne(p, F(t))), U = F(t), ue = te.findIndex((ye) => ye === U);
ue !== -1 && te.splice(ue, 1);
const H = y(() => {
var ye, Ie, Fe, Xe;
const va = F(le);
if (De(va)) return (Ie = (ye = va.describe) === null || ye === void 0 ? void 0 : ye.call(va, F(t)).required) !== null && Ie !== void 0 && Ie;
const ca = F(u == null ? void 0 : u.schema);
return !!De(ca) && (Xe = (Fe = ca.describe) === null || Fe === void 0 ? void 0 : Fe.call(ca).required) !== null && Xe !== void 0 && Xe;
}), Ve = v++, ge = Oa({ id: Ve, path: t, touched: !1, pending: !1, valid: !0, validated: !!(!((s = B[U]) === null || s === void 0) && s.length), required: H, initialValue: c, errors: Wa([]), bails: (f = u == null ? void 0 : u.bails) !== null && f !== void 0 && f, label: u == null ? void 0 : u.label, type: (u == null ? void 0 : u.type) || "default", value: N, multiple: !1, __flags: { pendingUnmount: { [Ve]: !1 }, pendingReset: !1 }, fieldsCount: 1, validate: u == null ? void 0 : u.validate, dirty: y(() => !Pe(o(N), o(c))) });
return V.value.push(ge), k.value[U] = ge, C(), j.value[U] && !B[U] && Te(() => {
_e(U, { mode: "silent" });
}), Ge(t) && Be(t, (ye) => {
C();
const Ie = re(N.value);
k.value[ye] = ge, Te(() => {
qe(p, ye, Ie);
});
}), ge;
}
const W = Cl(E, 5), w = Cl(E, 5), oe = Za(async (t) => await (t === "silent" ? W() : w()), (t, [u]) => {
const s = Ue(pe.errorBag.value), f = [.../* @__PURE__ */ new Set([...Ue(t.results), ...V.value.map((c) => c.path), ...s])].sort().reduce((c, A) => {
var S;
const N = A, U = J(N) || function(ge) {
return V.value.filter((Ie) => ge.startsWith(F(Ie.path))).reduce((Ie, Fe) => Ie ? Fe.path.length > Ie.path.length ? Fe : Ie : Fe, void 0);
}(N), ue = ((S = t.results[N]) === null || S === void 0 ? void 0 : S.errors) || [], H = F(U == null ? void 0 : U.path) || N, Ve = function(ge, ye) {
return ye ? { valid: ge.valid && ye.valid, errors: [...ge.errors, ...ye.errors] } : ge;
}({ errors: ue, valid: !ue.length }, c.results[H]);
return c.results[H] = Ve, Ve.valid || (c.errors[H] = Ve.errors[0]), U && _.value[H] && delete _.value[H], U ? (U.valid = Ve.valid, u === "silent" || (u !== "validated-only" || U.validated) && O(U, Ve.errors), c) : (O(H, ue), c);
}, { valid: t.valid, results: {}, errors: {}, source: t.source });
return t.values && (f.values = t.values, f.source = t.source), Ue(f.results).forEach((c) => {
var A;
const S = J(c);
S && u !== "silent" && (u !== "validated-only" || S.validated) && O(S, (A = f.results[c]) === null || A === void 0 ? void 0 : A.errors);
}), f;
});
function be(t) {
V.value.forEach(t);
}
function J(t) {
const u = typeof t == "string" ? Va(t) : t;
return typeof u == "string" ? k.value[u] : u;
}
let ce, te = [];
function ee(t) {
return function(u, s) {
return function(f) {
return f instanceof Event && (f.preventDefault(), f.stopPropagation()), be((c) => c.touched = !0), a.value = !0, m.value++, he().then((c) => {
const A = re(p);
if (c.valid && typeof u == "function") {
const S = re(X.value);
let N = t ? S : A;
return c.values && (N = c.source === "schema" ? c.values : Object.assign({}, N, c.values)), u(N, { evt: f, controlledValues: S, setErrors: x, setFieldError: O, setTouched: ne, setFieldTouched: G, setValues: D, setFieldValue: g, resetForm: me, resetField: T });
}
c.valid || typeof s != "function" || s({ values: A, evt: f, errors: c.errors, results: c.results });
}).then((c) => (a.value = !1, c), (c) => {
throw a.value = !1, c;
});
};
};
}
const Q = ee(!1);
Q.withControlled = ee(!0);
const pe = { name: i, formId: n, values: p, controlledValues: X, errorBag: d, errors: j, schema: le, submitCount: m, meta: R, isSubmitting: a, isValidating: r, fieldArrays: h, keepValuesOnUnmount: q, validateSchema: o(le) ? oe : void 0, validate: he, setFieldError: O, validateField: _e, setFieldValue: g, setValues: D, setErrors: x, setFieldTouched: G, setTouched: ne, resetForm: me, resetField: T, handleSubmit: Q, useFieldModel: function(t) {
return Array.isArray(t) ? t.map((u) => ae(u, !0)) : ae(t);
}, defineInputBinds: function(t, u) {
const [s, f] = K(t, u);
function c() {
f.value.onBlur();
}
function A(N) {
const U = Fa(N);
g(F(t), U, !1), f.value.onInput();
}
function S(N) {
const U = Fa(N);
g(F(t), U, !1), f.value.onChange();
}
return y(() => Object.assign(Object.assign({}, f.value), { onBlur: c, onInput: A, onChange: S, value: s.value }));
}, defineComponentBinds: function(t, u) {
const [s, f] = K(t, u), c = J(F(t));
function A(S) {
s.value = S;
}
return y(() => {
const S = Se(u) ? u(wa(c, Ma)) : u || {};
return Object.assign({ [S.model || "modelValue"]: s.value, [`onUpdate:${S.model || "modelValue"}`]: A }, f.value);
});
}, defineField: K, stageInitialValue: function(t, u, s = !1) {
b(t, u), qe(p, t, u), s && !(e != null && e.initialValues) && qe(Z.value, t, re(u));
}, unsetInitialValue: Je, setFieldInitialValue: b, createPathState: ve, getPathState: J, unsetPathValue: function(t) {
return te.push(t), ce || (ce = Te(() => {
[...te].sort().reverse().forEach((u) => {
xl(p, u);
}), te = [], ce = null;
})), ce;
}, removePathState: function(t, u) {
const s = V.value.findIndex((c) => c.path === t && (Array.isArray(c.id) ? c.id.includes(u) : c.id === u)), f = V.value[s];
if (s !== -1 && f) {
if (Te(() => {
_e(t, { mode: "silent", warn: !1 });
}), f.multiple && f.fieldsCount && f.fieldsCount--, Array.isArray(f.id)) {
const c = f.id.indexOf(u);
c >= 0 && f.id.splice(c, 1), delete f.__flags.pendingUnmount[u];
}
(!f.multiple || f.fieldsCount <= 0) && (V.value.splice(s, 1), Je(t), C(), delete k.value[t]);
}
}, initialValues: ie, getAllPathStates: () => V.value, destroyPath: function(t) {
Ue(k.value).forEach((u) => {
u.startsWith(t) && delete k.value[u];
}), V.value = V.value.filter((u) => !u.path.startsWith(t)), Te(() => {
C();
});
}, isFieldTouched: function(t) {
const u = J(t);
return u ? u.touched : V.value.filter((s) => s.path.startsWith(t)).some((s) => s.touched);
}, isFieldDirty: function(t) {
const u = J(t);
return u ? u.dirty : V.value.filter((s) => s.path.startsWith(t)).some((s) => s.dirty);
}, isFieldValid: function(t) {
const u = J(t);
return u ? u.valid : V.value.filter((s) => s.path.startsWith(t)).every((s) => s.valid);
} };
function g(t, u, s = !0) {
const f = re(u), c = typeof t == "string" ? t : t.path;
J(c) || ve(c), qe(p, c, f), s && _e(c);
}
function D(t, u = !0) {
ba(p, t), h.forEach((s) => s && s.reset()), u && he();
}
function ae(t, u) {
const s = J(F(t)) || ve(t);
return y({ get: () => s.value, set(f) {
var c;
g(F(t), f, (c = F(u)) !== null && c !== void 0 && c);
} });
}
function G(t, u) {
const s = J(t);
s && (s.touched = u);
}
function ne(t) {
typeof t != "boolean" ? Ue(t).forEach((u) => {
G(u, !!t[u]);
}) : be((u) => {
u.touched = t;
});
}
function T(t, u) {
var s;
const f = u && "value" in u ? u.value : Ne(ie.value, t), c = J(t);
c && (c.__flags.pendingReset = !0), b(t, re(f), !0), g(t, f, !1), G(t, (s = u == null ? void 0 : u.touched) !== null && s !== void 0 && s), O(t, (u == null ? voi