const e=require("../_util/classNames.js"),t=require("../_util/omit.js"),n=require("../config-provider/DisabledContext.js"),r=require("../config-provider/hooks/useConfigInject.js"),i=require("../_util/statusUtils.js"),a=require("../form/FormItemContext.js"),o=require("../space/Compact.js"),s=require("./style/index.js"),c=require("../vc-input/utils/commonUtils.js"),l=require("../vc-input/Input.js"),u=require("./inputProps.js");let d=require("vue"),f=require("@antsoo-lib/icons");var p=(0,d.defineComponent)({compatConfig:{MODE:3},name:`AInput`,inheritAttrs:!1,props:u.default(),setup(u,{slots:p,attrs:m,expose:h,emit:g}){let _=(0,d.ref)(),v=a.useInjectFormItemContext(),y=a.FormItemInputContext.useInject(),b=(0,d.computed)(()=>i.getMergedStatus(y.status,u.status)),{direction:x,prefixCls:S,size:C,autocomplete:w}=r.default(`input`,u),{compactSize:T,compactItemClassnames:E}=o.useCompactItemContext(S,x),D=(0,d.computed)(()=>T.value||C.value),[O,k]=s.default(S),A=n.useInjectDisabled();h({focus:e=>{_.value?.focus(e)},blur:()=>{_.value?.blur()},input:_,setSelectionRange:(e,t,n)=>{_.value?.setSelectionRange(e,t,n)},select:()=>{_.value?.select()}});let j=(0,d.ref)([]),M=()=>{j.value.push(setTimeout(()=>{_.value?.input&&_.value?.input.getAttribute(`type`)===`password`&&_.value?.input.hasAttribute(`value`)&&_.value?.input.removeAttribute(`value`)}))};(0,d.onMounted)(()=>{M()}),(0,d.onBeforeUpdate)(()=>{j.value.forEach(e=>clearTimeout(e))}),(0,d.onBeforeUnmount)(()=>{j.value.forEach(e=>clearTimeout(e))});let N=e=>{M(),g(`blur`,e),v.onFieldBlur()},P=e=>{M(),g(`focus`,e)},F=e=>{g(`update:value`,e.target.value),g(`change`,e),g(`input`,e),v.onFieldChange()};return()=>{let{hasFeedback:n,feedbackIcon:r}=y,{allowClear:s,bordered:h=!0,prefix:g=p.prefix?.(),suffix:C=p.suffix?.(),addonAfter:T=p.addonAfter?.(),addonBefore:j=p.addonBefore?.(),id:M=v.id?.value,...I}=u,L=(n||C)&&(0,d.createVNode)(d.Fragment,null,[C,n&&r]),R=S.value,z=c.hasPrefixSuffix({prefix:g,suffix:C})||!!n,B=p.clearIcon||(()=>(0,d.createVNode)(f.CloseCircleFilled,null,null));return O((0,d.createVNode)(l.default,{...m,...t.default(I,[`onUpdate:value`,`onChange`,`onInput`]),onChange:F,id:M,disabled:u.disabled??A.value,ref:_,prefixCls:R,autocomplete:w.value,onBlur:N,onFocus:P,prefix:g,suffix:L,allowClear:s,addonAfter:T&&(0,d.createVNode)(o.NoCompactStyle,null,{default:()=>[(0,d.createVNode)(a.NoFormStatus,null,{default:()=>[T]})]}),addonBefore:j&&(0,d.createVNode)(o.NoCompactStyle,null,{default:()=>[(0,d.createVNode)(a.NoFormStatus,null,{default:()=>[j]})]}),class:[m.class,E.value],inputClassName:e.default({[`${R}-sm`]:D.value===`small`,[`${R}-lg`]:D.value===`large`,[`${R}-rtl`]:x.value===`rtl`,[`${R}-borderless`]:!h},!z&&i.getStatusClassNames(R,b.value),k.value),affixWrapperClassName:e.default({[`${R}-affix-wrapper-sm`]:D.value===`small`,[`${R}-affix-wrapper-lg`]:D.value===`large`,[`${R}-affix-wrapper-rtl`]:x.value===`rtl`,[`${R}-affix-wrapper-borderless`]:!h},i.getStatusClassNames(`${R}-affix-wrapper`,b.value,n),k.value),wrapperClassName:e.default({[`${R}-group-rtl`]:x.value===`rtl`},k.value),groupClassName:e.default({[`${R}-group-wrapper-sm`]:D.value===`small`,[`${R}-group-wrapper-lg`]:D.value===`large`,[`${R}-group-wrapper-rtl`]:x.value===`rtl`},i.getStatusClassNames(`${R}-group-wrapper`,b.value,n),k.value)},{...p,clearIcon:B}))}}});exports.default=p;