import{u as g}from"./uid.KLLbMoZc.js";import{u as j}from"./index.OjlVAl1H.js";import{B as n,r as b,q,i as z}from"./entry.2xM5grDS.js";const D=(a,v)=>{const t=n("form-events",void 0),e=n("form-group",void 0),F=n("form-inputs",void 0),d=b(a==null?void 0:a.id);q(()=>{d.value=(a==null?void 0:a.legend)===null||a.legend?void 0:(a==null?void 0:a.id)??g(),e&&(e.inputId.value=d.value,F&&(F.value[e.name.value]=d))});const I=b(!1);function c(l,m){t&&t.emit({type:l,path:m})}function B(){c("blur",e==null?void 0:e.name.value),I.value=!0}function h(){c("change",e==null?void 0:e.name.value)}const i=j(()=>{(I.value||e!=null&&e.eagerValidation.value)&&c("input",e==null?void 0:e.name.value)},300);return{inputId:d,name:z(()=>(a==null?void 0:a.name)??(e==null?void 0:e.name.value)),size:z(()=>{var m;const l=v.size[e==null?void 0:e.size.value]?e==null?void 0:e.size.value:null;return(a==null?void 0:a.size)??l??((m=v==null?void 0:v.default)==null?void 0:m.size)}),color:z(()=>{var l;return(l=e==null?void 0:e.error)!=null&&l.value?"red":a==null?void 0:a.color}),emitFormBlur:B,emitFormInput:i,emitFormChange:h}};export{D as u};
