import{d as p,i as c,q as v,s as f,o as g,j as m,c as _,m as b}from"./index.29cf2edd.js";const d={style:{width:"100%"}},I=p({__name:"DateOfBirth",props:{value:{type:String}},emits:["input"],setup(i,{emit:l}){const a=i,n=c("");v(()=>{a.value&&(n.value=a.value)});const o=()=>{if(n.value){let e=n.value.replace("/","");parseInt(e.substring(0,2))>31&&(e=e.substring(0,2)),parseInt(e.substring(2,4))>12&&(e=e.substring(0,4));let s=e.replace(/\D/g,""),t=s.substring(0,8),u=e.length;u>4&&(t=r(t,"/",4)),u>2&&(t=r(t,"/",2)),n.value=t}l("input",n.value.substring(0,10))};f(()=>a.value,e=>{e||(n.value="")});function r(e,s,t){return e.substring(0,t)+s+e.substr(t)}return(e,s)=>{const t=b;return g(),m("div",d,[_(t,{value:n.value,"onUpdate:value":s[0]||(s[0]=u=>n.value=u),placeholder:"30/01/1970",onInput:o},null,8,["value"])])}}});export{I as _};
