const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../_util/omit.js"),r=require("../config-provider/DisabledContext.js"),i=require("../config-provider/hooks/useConfigInject.js"),a=require("../_util/vue-types/index.js"),o=require("../_util/statusUtils.js"),s=require("../form/FormItemContext.js"),c=require("../space/Compact.js"),l=require("../_util/vnode.js"),u=require("../_util/isValidValue.js"),d=require("./src/InputNumber.js"),f=require("./style/index.js");let p=require("vue"),m=require("@antsoo-lib/icons");var h=d.inputNumberProps(),g=()=>({...h,size:e.stringType(),bordered:e.booleanType(!0),placeholder:String,name:String,id:String,controls:e.booleanType(!1),type:String,addonBefore:a.default.any,addonAfter:a.default.any,prefix:a.default.any,"onUpdate:value":h.onChange,valueModifiers:Object,status:e.stringType()}),_=(0,p.defineComponent)({compatConfig:{MODE:3},name:`AInputNumber`,inheritAttrs:!1,props:g(),slots:Object,setup(e,{emit:a,expose:h,attrs:g,slots:_}){let v=s.useInjectFormItemContext(),y=s.FormItemInputContext.useInject(),b=(0,p.computed)(()=>o.getMergedStatus(y.status,e.status)),{prefixCls:x,size:S,direction:C,disabled:w}=i.default(`input-number`,e),{compactSize:T,compactItemClassnames:E}=c.useCompactItemContext(x,C),D=r.useInjectDisabled(),O=(0,p.computed)(()=>w.value??D.value),[k,A]=f.default(x),j=(0,p.computed)(()=>T.value||S.value),M=(0,p.shallowRef)(e.value??e.defaultValue),N=(0,p.shallowRef)(!1);(0,p.watch)(()=>e.value,()=>{M.value=e.value});let P=(0,p.shallowRef)(null),F=()=>{P.value?.focus()};h({focus:F,blur:()=>{P.value?.blur()}});let I=t=>{e.value===void 0&&(M.value=t),a(`update:value`,t),a(`change`,t),v.onFieldChange()},L=e=>{N.value=!1,a(`blur`,e),v.onFieldBlur()},R=e=>{N.value=!0,a(`focus`,e)};return()=>{let{hasFeedback:r,isFormItemInput:i,feedbackIcon:a}=y,f=e.id??v.id.value,{class:h,bordered:S,readonly:w,style:T,addonBefore:D=_.addonBefore?.(),addonAfter:z=_.addonAfter?.(),prefix:B=_.prefix?.(),valueModifiers:V={},...H}={...g,...e,id:f,disabled:O.value},U=x.value,W=t.default({[`${U}-lg`]:j.value===`large`,[`${U}-sm`]:j.value===`small`,[`${U}-rtl`]:C.value===`rtl`,[`${U}-readonly`]:w,[`${U}-borderless`]:!S,[`${U}-in-form-item`]:i},o.getStatusClassNames(U,b.value),h,E.value,A.value),G=(0,p.createVNode)(d.default,{...n.default(H,[`size`,`defaultValue`]),ref:P,lazy:!!V.lazy,value:M.value,class:W,prefixCls:U,readonly:w,onChange:I,onBlur:L,onFocus:R},{upHandler:_.upIcon?()=>(0,p.createVNode)(`span`,{class:`${U}-handler-up-inner`},[_.upIcon()]):()=>(0,p.createVNode)(m.UpOutlined,{class:`${U}-handler-up-inner`},null),downHandler:_.downIcon?()=>(0,p.createVNode)(`span`,{class:`${U}-handler-down-inner`},[_.downIcon()]):()=>(0,p.createVNode)(m.DownOutlined,{class:`${U}-handler-down-inner`},null)}),K=u.default(D)||u.default(z),q=u.default(B);if((q||r)&&(G=(0,p.createVNode)(`div`,{class:t.default(`${U}-affix-wrapper`,o.getStatusClassNames(`${U}-affix-wrapper`,b.value,r),{[`${U}-affix-wrapper-focused`]:N.value,[`${U}-affix-wrapper-disabled`]:O.value,[`${U}-affix-wrapper-sm`]:j.value===`small`,[`${U}-affix-wrapper-lg`]:j.value===`large`,[`${U}-affix-wrapper-rtl`]:C.value===`rtl`,[`${U}-affix-wrapper-readonly`]:w,[`${U}-affix-wrapper-borderless`]:!S,[`${h}`]:!K&&h},A.value),style:T,onClick:F},[q&&(0,p.createVNode)(`span`,{class:`${U}-prefix`},[B]),G,r&&(0,p.createVNode)(`span`,{class:`${U}-suffix`},[a])])),K){let e=`${U}-group`,n=`${e}-addon`,i=D?(0,p.createVNode)(`div`,{class:n},[D]):null,a=z?(0,p.createVNode)(`div`,{class:n},[z]):null,l=t.default(`${U}-wrapper`,e,{[`${e}-rtl`]:C.value===`rtl`},A.value);G=(0,p.createVNode)(`div`,{class:t.default(`${U}-group-wrapper`,{[`${U}-group-wrapper-sm`]:j.value===`small`,[`${U}-group-wrapper-lg`]:j.value===`large`,[`${U}-group-wrapper-rtl`]:C.value===`rtl`},o.getStatusClassNames(`${x}-group-wrapper`,b.value,r),h,A.value),style:T},[(0,p.createVNode)(`div`,{class:l},[i&&(0,p.createVNode)(c.NoCompactStyle,null,{default:()=>[(0,p.createVNode)(s.NoFormStatus,null,{default:()=>[i]})]}),G,a&&(0,p.createVNode)(c.NoCompactStyle,null,{default:()=>[(0,p.createVNode)(s.NoFormStatus,null,{default:()=>[a]})]})])])}return k(l.cloneElement(G,{style:T}))}}}),v=Object.assign(_,{install:e=>(e.component(_.name,_),e)});exports.default=v,exports.inputNumberProps=g;