const e=require("../../style/index.js"),t=require("../../theme/util/genComponentStyleHook.js"),n=require("../../theme/util/statistic.js");function r(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:`not-allowed`}}}function i(e){return{backgroundColor:e.bgColorSelected,boxShadow:e.boxShadow}}var a={overflow:`hidden`,...e.textEllipsis},o=t=>{let{componentCls:n}=t;return{[n]:{...e.resetComponent(t),display:`inline-block`,padding:t.segmentedContainerPadding,color:t.labelColor,backgroundColor:t.bgColor,borderRadius:t.borderRadius,transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,[`${n}-group`]:{position:`relative`,display:`flex`,alignItems:`stretch`,justifyItems:`flex-start`,width:`100%`},[`&${n}-rtl`]:{direction:`rtl`},[`&${n}-block`]:{display:`flex`},[`&${n}-block ${n}-item`]:{flex:1,minWidth:0},[`${n}-item`]:{position:`relative`,textAlign:`center`,cursor:`pointer`,transition:`color ${t.motionDurationMid} ${t.motionEaseInOut}`,borderRadius:t.borderRadiusSM,"&-selected":{...i(t),color:t.labelColorHover},"&::after":{content:`""`,position:`absolute`,width:`100%`,height:`100%`,top:0,insetInlineStart:0,borderRadius:`inherit`,transition:`background-color ${t.motionDurationMid}`,pointerEvents:`none`},[`&:hover:not(${n}-item-selected):not(${n}-item-disabled)`]:{color:t.labelColorHover,"&::after":{backgroundColor:t.bgColorHover}},"&-label":{minHeight:t.controlHeight-t.segmentedContainerPadding*2,lineHeight:`${t.controlHeight-t.segmentedContainerPadding*2}px`,padding:`0 ${t.segmentedPaddingHorizontal}px`,...a},"&-icon + *":{marginInlineStart:t.marginSM/2},"&-input":{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:`none`}},[`${n}-thumb`]:{...i(t),position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:`100%`,padding:`${t.paddingXXS}px 0`,borderRadius:t.borderRadiusSM,[`& ~ ${n}-item:not(${n}-item-selected):not(${n}-item-disabled)::after`]:{backgroundColor:`transparent`}},[`&${n}-lg`]:{borderRadius:t.borderRadiusLG,[`${n}-item-label`]:{minHeight:t.controlHeightLG-t.segmentedContainerPadding*2,lineHeight:`${t.controlHeightLG-t.segmentedContainerPadding*2}px`,padding:`0 ${t.segmentedPaddingHorizontal}px`,fontSize:t.fontSizeLG},[`${n}-item, ${n}-thumb`]:{borderRadius:t.borderRadius}},[`&${n}-sm`]:{borderRadius:t.borderRadiusSM,[`${n}-item-label`]:{minHeight:t.controlHeightSM-t.segmentedContainerPadding*2,lineHeight:`${t.controlHeightSM-t.segmentedContainerPadding*2}px`,padding:`0 ${t.segmentedPaddingHorizontalSM}px`},[`${n}-item, ${n}-thumb`]:{borderRadius:t.borderRadiusXS}},...r(`&-disabled ${n}-item`,t),...r(`${n}-item-disabled`,t),[`${n}-thumb-motion-appear-active`]:{transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOut}, width ${t.motionDurationSlow} ${t.motionEaseInOut}`,willChange:`transform, width`}}}},s=t.default(`Segmented`,e=>{let{lineWidthBold:t,lineWidth:r,colorTextLabel:i,colorText:a,colorFillSecondary:s,colorBgLayout:c,colorBgElevated:l}=e;return[o(n.merge(e,{segmentedPaddingHorizontal:e.controlPaddingHorizontal-r,segmentedPaddingHorizontalSM:e.controlPaddingHorizontalSM-r,segmentedContainerPadding:t,labelColor:i,labelColorHover:a,bgColor:c,bgColorHover:s,bgColorSelected:l}))]});exports.default=s;