"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../input/style/index.js"),s=require("../../style/index.js"),v=require("../../style/compact-item.js");require("../../theme/internal.js");const R=require("../../theme/util/genComponentStyleHook.js"),z=n=>{const{componentCls:e,lineWidth:i,lineType:o,colorBorder:d,borderRadius:t,fontSizeLG:l,controlHeightLG:h,controlHeightSM:g,colorError:b,inputPaddingHorizontalSM:$,colorTextDescription:p,motionDurationMid:a,colorPrimary:S,controlHeight:f,inputPaddingHorizontal:x,colorBgContainer:w,colorTextDisabled:y,borderRadiusSM:u,borderRadiusLG:c,controlWidth:m,handleVisible:I}=n;return[{[e]:{...s.resetComponent(n),...r.genBasicInputStyle(n),...r.genStatusStyle(n,e),display:"inline-block",width:m,margin:0,padding:0,border:`${i}px ${o} ${d}`,borderRadius:t,"&-rtl":{direction:"rtl",[`${e}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:l,borderRadius:c,[`input${e}-input`]:{height:h-2*i}},"&-sm":{padding:0,borderRadius:u,[`input${e}-input`]:{height:g-2*i,padding:`0 ${$}px`}},"&:hover":{...r.genHoverStyle(n)},"&-focused":{...r.genActiveStyle(n)},"&-disabled":{...r.genDisabledStyle(n),[`${e}-input`]:{cursor:"not-allowed"}},"&-out-of-range":{input:{color:b}},"&-group":{...s.resetComponent(n),...r.genInputGroupStyle(n),"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${e}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${e}-group-addon`]:{borderRadius:c}},"&-sm":{[`${e}-group-addon`]:{borderRadius:u}}}},[e]:{"&-input":{width:"100%",height:f-2*i,padding:`0 ${x}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:t,outline:0,transition:`all ${a} linear`,appearance:"textfield",color:n.colorText,fontSize:"inherit",verticalAlign:"top",...r.genPlaceholderStyle(n.colorTextPlaceholder),'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}}}}},{[e]:{[`&:hover ${e}-handler-wrap, &-focused ${e}-handler-wrap`]:{opacity:1},[`${e}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:n.handleWidth,height:"100%",background:w,borderStartStartRadius:0,borderStartEndRadius:t,borderEndEndRadius:t,borderEndStartRadius:0,opacity:I===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${a} linear ${a}`,[`${e}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
              ${e}-handler-up-inner,
              ${e}-handler-down-inner
            `]:{marginInlineEnd:0,fontSize:n.handleFontSize}}},[`${e}-handler`]:{height:"50%",overflow:"hidden",color:p,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${i}px ${o} ${d}`,transition:`all ${a} linear`,"&:active":{background:n.colorFillAlter},"&:hover":{height:"60%",[`
              ${e}-handler-up-inner,
              ${e}-handler-down-inner
            `]:{color:S}},"&-up-inner, &-down-inner":{...s.resetIcon(),color:p,transition:`all ${a} linear`,userSelect:"none"}},[`${e}-handler-up`]:{borderStartEndRadius:t},[`${e}-handler-down`]:{borderBlockStart:`${i}px ${o} ${d}`,borderEndEndRadius:t},"&-disabled, &-readonly":{[`${e}-handler-wrap`]:{display:"none"},[`${e}-input`]:{color:"inherit"}},[`
          ${e}-handler-up-disabled,
          ${e}-handler-down-disabled
        `]:{cursor:"not-allowed"},[`
          ${e}-handler-up-disabled:hover &-handler-up-inner,
          ${e}-handler-down-disabled:hover &-handler-down-inner
        `]:{color:y}}},{[`${e}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${e}-handler-down`]:{borderBlockStartWidth:0}}}]},E=n=>{const{componentCls:e,inputPaddingHorizontal:i,inputAffixPadding:o,controlWidth:d,borderRadiusLG:t,borderRadiusSM:l}=n;return{[`${e}-affix-wrapper`]:{...r.genBasicInputStyle(n),...r.genStatusStyle(n,`${e}-affix-wrapper`),position:"relative",display:"inline-flex",width:d,padding:0,paddingInlineStart:i,"&-lg":{borderRadius:t},"&-sm":{borderRadius:l},[`&:not(${e}-affix-wrapper-disabled):hover`]:{...r.genHoverStyle(n),zIndex:1},"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${e}[disabled]`]:{background:"transparent"}},[`> div${e}`]:{width:"100%",border:"none",outline:"none",[`&${e}-focused`]:{boxShadow:"none !important"}},[`input${e}-input`]:{padding:0},"&::before":{width:0,visibility:"hidden",content:'"\\a0"'},[`${e}-handler-wrap`]:{zIndex:2},[e]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:i,marginInlineStart:o}}}}},H=R.default("InputNumber",n=>{const e=r.initInputToken(n);return[z(e),E(e),v.genCompactItemStyle(e)]},n=>({controlWidth:90,handleWidth:n.controlHeightSM-n.lineWidth*2,handleFontSize:n.fontSize/2,handleVisible:"auto"}));exports.default=H;
