import{a as p,c as b}from"./index-w-dkzpPh.js";import{c as v,b as y}from"./VInput-qFshDEqa.js";import{f as F}from"./forwardRefs-BQ8_JL2J.js";import{g as V,p as h,B as R,b as P,n as k,a as C}from"./index-DPl16C00.js";const S=h({...b(),...y()},"VForm"),w=V()({name:"VForm",props:S(),emits:{"update:modelValue":o=>!0,submit:o=>!0},setup(o,i){let{slots:s,emit:f}=i;const r=v(o),n=R();function l(t){t.preventDefault(),r.reset()}function c(t){const a=t,e=r.validate();a.then=e.then.bind(e),a.catch=e.catch.bind(e),a.finally=e.finally.bind(e),f("submit",a),a.defaultPrevented||e.then(u=>{var m;let{valid:d}=u;d&&((m=n.value)==null||m.submit())}),a.preventDefault()}return p(()=>{var t;return P("form",{ref:n,class:C(["v-form",o.class]),style:k(o.style),novalidate:!0,onReset:l,onSubmit:c},[(t=s.default)==null?void 0:t.call(s,r)])}),F(r,n)}});export{w as V};
