import{_ as e}from"./b9RiRfZU.js";import{c as a,w as t,B as l,L as s,V as r,P as n,$ as d,M as o,a2 as p,W as u,a7 as i,U as m,u as y,l as c,ao as b,ax as f,x as v,_ as x}from"./CFGNYEIb.js";import{j as g}from"./ZipTOXeQ.js";const q={class:"input-wrapper"},h=["for"],k=["disabled","id","type","placeholder"],j=["disabled","id","type","placeholder"],w={key:3,type:"button",class:"absolute top-1/2 -translate-y-1/2 end-5 flex items-center justify-center"},S={__name:"BaseTextInput",props:{name:{type:String,required:!0},type:{type:String,required:!1,default:"text"},label:{type:String,required:!1},placeholder:{type:String,required:!1},value:{type:String,required:!1},disabled:{type:Boolean,required:!1},absoluteError:{type:Boolean,required:!1},rounded:{type:Boolean,required:!1},icon:{type:String,required:!1}},emits:["update:value"],setup(S,{emit:V}){const _=S,B=g(_.name),E=a(_.type),I=a(null);return t((()=>_.value),(e=>{e&&(I.value=e,B.setValue(e))}),{deep:!0,immediate:!0}),(a,t)=>{const g=e,V=l("VeeErrorMessage"),_=l("VeeField");return s(),r(_,{name:S.name,type:y(E)},{default:n((({field:e,meta:l})=>[d("div",q,[S.label?(s(),o("label",{key:0,for:S.name},p(S.label),9,h)):u("",!0),"textarea"!==S.type?i((s(),o("input",m({key:1,disabled:S.disabled,id:S.name,type:y(E),placeholder:S.placeholder},e,{"onUpdate:modelValue":t[0]||(t[0]=e=>c(I)?I.value=e:null),onInput:t[1]||(t[1]=e=>a.$emit("update:value",e.target.value)),class:["appearance-none",S.rounded?"!rounded-full !px-6":""],autocomplete:"off"}),null,16,k)),[[b,y(I)]]):i((s(),o("textarea",m({key:2,disabled:S.disabled,id:S.name,type:S.type,placeholder:S.placeholder},e,{"onUpdate:modelValue":t[2]||(t[2]=e=>c(I)?I.value=e:null),onInput:t[3]||(t[3]=e=>a.$emit("update:value",e.target.value)),class:"appearance-none"}),null,16,j)),[[f,y(I)]]),S.icon?(s(),o("div",w,[v(g,{name:S.icon},null,8,["name"])])):u("",!0),"password"==S.type?(s(),o("button",{key:4,type:"button",onClick:t[4]||(t[4]=e=>"password"==y(E)?E.value="text":E.value="password"),class:"absolute top-1/2 -translate-y-1/2 end-5 flex items-center justify-center"},["password"==y(E)?(s(),r(g,{key:0,name:"eye",class:"scale-[1.5]"})):(s(),r(g,{key:1,name:"eye-slash",class:"scale-[1.5]"}))])):u("",!0)]),v(V,{class:x(["text-sm text-red-500",S.absoluteError&&"absolute"]),name:S.name},null,8,["name","class"])])),_:1},8,["name","type"])}}};export{S as _};
