import{d as p,a9 as i,w as m,r as d,l as f,g as _,v as x,c as g,o as v,u as M}from"./app-DJb_CRLj.js";import{u as V}from"./useRandomStr-7r5tQ8Eq.js";const h=["name"],y=p({__name:"NumInput",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(l,{expose:r}){const t=i(l,"modelValue");m(t,e=>{if(e!=null&&e!=""){e=e+"";let c=(s=>s.replace(/[٠-٩]/g,n=>"٠١٢٣٤٥٦٧٨٩".indexOf(n)))((s=>s.replace(/[۰-۹]/g,n=>"۰۱۲۳۴۵۶۷۸۹".indexOf(n)))(e));t.value=c.replace(/\D+/g,"")}});const a=d(null);return f(()=>{var e,o;(e=a.value)!=null&&e.hasAttribute("autofocus")&&((o=a.value)==null||o.focus())}),r({focus:()=>{var e;return(e=a.value)==null?void 0:e.focus()}}),(e,o)=>_((v(),g("input",{type:"text",class:"form-control","onUpdate:modelValue":o[0]||(o[0]=u=>t.value=u),ref_key:"input",ref:a,name:M(V)(15)},null,8,h)),[[x,t.value]])}});export{y as _};
