import{resetComponent as S}from"../../style/index.mjs";import"../../theme/internal.mjs";import u from"../../theme/util/genComponentStyleHook.mjs";import{merge as g}from"../../theme/util/statistic.mjs";import{TinyColor as p}from"../../node_modules/.pnpm/@ctrl_tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/index.mjs";const $=r=>{const{componentCls:o,controlSize:i,dotSize:e,marginFull:t,marginPart:a,colorFillContentHover:l}=r;return{[o]:{...S(r),position:"relative",height:i,margin:`${a}px ${t}px`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${t}px ${a}px`},[`${o}-rail`]:{position:"absolute",backgroundColor:r.colorFillTertiary,borderRadius:r.borderRadiusXS,transition:`background-color ${r.motionDurationMid}`},[`${o}-track`]:{position:"absolute",backgroundColor:r.colorPrimaryBorder,borderRadius:r.borderRadiusXS,transition:`background-color ${r.motionDurationMid}`},"&:hover":{[`${o}-rail`]:{backgroundColor:r.colorFillSecondary},[`${o}-track`]:{backgroundColor:r.colorPrimaryBorderHover},[`${o}-dot`]:{borderColor:l},[`${o}-handle::after`]:{boxShadow:`0 0 0 ${r.handleLineWidth}px ${r.colorPrimaryBorderHover}`},[`${o}-dot-active`]:{borderColor:r.colorPrimary}},[`${o}-handle`]:{position:"absolute",width:r.handleSize,height:r.handleSize,outline:"none",[`${o}-dragging`]:{zIndex:1},"&::before":{content:'""',position:"absolute",insetInlineStart:-r.handleLineWidth,insetBlockStart:-r.handleLineWidth,width:r.handleSize+r.handleLineWidth*2,height:r.handleSize+r.handleLineWidth*2,backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:r.handleSize,height:r.handleSize,backgroundColor:r.colorBgElevated,boxShadow:`0 0 0 ${r.handleLineWidth}px ${r.colorPrimaryBorder}`,borderRadius:"50%",cursor:"pointer",transition:`
            inset-inline-start ${r.motionDurationMid},
            inset-block-start ${r.motionDurationMid},
            width ${r.motionDurationMid},
            height ${r.motionDurationMid},
            box-shadow ${r.motionDurationMid}
          `},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:-((r.handleSizeHover-r.handleSize)/2+r.handleLineWidthHover),insetBlockStart:-((r.handleSizeHover-r.handleSize)/2+r.handleLineWidthHover),width:r.handleSizeHover+r.handleLineWidthHover*2,height:r.handleSizeHover+r.handleLineWidthHover*2},"&::after":{boxShadow:`0 0 0 ${r.handleLineWidthHover}px ${r.colorPrimary}`,width:r.handleSizeHover,height:r.handleSizeHover,insetInlineStart:(r.handleSize-r.handleSizeHover)/2,insetBlockStart:(r.handleSize-r.handleSizeHover)/2}}},[`${o}-mark`]:{position:"absolute",fontSize:r.fontSize},[`${o}-mark-text`]:{position:"absolute",display:"inline-block",color:r.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:r.colorText}},[`${o}-step`]:{position:"absolute",background:"transparent",pointerEvents:"none"},[`${o}-dot`]:{position:"absolute",width:e,height:e,backgroundColor:r.colorBgElevated,border:`${r.handleLineWidth}px solid ${r.colorBorderSecondary}`,borderRadius:"50%",cursor:"pointer",transition:`border-color ${r.motionDurationSlow}`,pointerEvents:"auto","&-active":{borderColor:r.colorPrimaryBorder}},[`&${o}-disabled`]:{cursor:"not-allowed",[`${o}-rail`]:{backgroundColor:`${r.colorFillSecondary} !important`},[`${o}-track`]:{backgroundColor:`${r.colorTextDisabled} !important`},[`
          ${o}-dot
        `]:{backgroundColor:r.colorBgElevated,borderColor:r.colorTextDisabled,boxShadow:"none",cursor:"not-allowed"},[`${o}-handle::after`]:{backgroundColor:r.colorBgElevated,cursor:"not-allowed",width:r.handleSize,height:r.handleSize,boxShadow:`0 0 0 ${r.handleLineWidth}px ${new p(r.colorTextDisabled).onBackground(r.colorBgContainer).toHexString()}`,insetInlineStart:0,insetBlockStart:0},[`
          ${o}-mark-text,
          ${o}-dot
        `]:{cursor:"not-allowed !important"}}}}},s=(r,o)=>{const{componentCls:i,railSize:e,handleSize:t,dotSize:a}=r,l=o?"paddingBlock":"paddingInline",d=o?"width":"height",n=o?"height":"width",c=o?"insetBlockStart":"insetInlineStart",h=o?"top":"insetInlineStart";return{[l]:e,[n]:e*3,[`${i}-rail`]:{[d]:"100%",[n]:e},[`${i}-track`]:{[n]:e},[`${i}-handle`]:{[c]:(e*3-t)/2},[`${i}-mark`]:{insetInlineStart:0,top:0,[h]:t,[d]:"100%"},[`${i}-step`]:{insetInlineStart:0,top:0,[h]:e,[d]:"100%",[n]:e},[`${i}-dot`]:{position:"absolute",[c]:(e-a)/2}}},b=r=>{const{componentCls:o,marginPartWithMark:i}=r;return{[`${o}-horizontal`]:{...s(r,!0),[`&${o}-with-marks`]:{marginBottom:i}}}},m=r=>{const{componentCls:o}=r;return{[`${o}-vertical`]:{...s(r,!1),height:"100%"}}},C=u("Slider",r=>{const o=g(r,{marginPart:(r.controlHeight-r.controlSize)/2,marginFull:r.controlSize/2,marginPartWithMark:r.controlHeightLG-r.controlSize});return[$(o),b(o),m(o)]},r=>{const i=r.controlHeightLG/4,e=r.controlHeightSM/2,t=r.lineWidth+1,a=r.lineWidth+3;return{controlSize:i,railSize:4,handleSize:i,handleSizeHover:e,dotSize:8,handleLineWidth:t,handleLineWidthHover:a}});export{C as default};
