import{textEllipsis as a,resetIcon as p,resetComponent as u}from"../../style/index.mjs";import{genCompactItemStyle as m}from"../../style/compact-item.mjs";import"../../theme/internal.mjs";import g from"./dropdown.mjs";import $ from"./multiple.mjs";import S from"./single.mjs";import b from"../../theme/util/genComponentStyleHook.mjs";import{merge as t}from"../../theme/util/statistic.mjs";const f=o=>{const{componentCls:r}=o;return{position:"relative",backgroundColor:o.colorBgContainer,border:`${o.lineWidth}px ${o.lineType} ${o.colorBorder}`,transition:`all ${o.motionDurationMid} ${o.motionEaseInOut}`,input:{cursor:"pointer"},[`${r}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${r}-disabled&`]:{color:o.colorTextDisabled,background:o.colorBgContainerDisabled,cursor:"not-allowed",[`${r}-multiple&`]:{background:o.colorBgContainerDisabled},input:{cursor:"not-allowed"}}}},l=(o,r,n=!1)=>{const{componentCls:e,borderHoverColor:i,outlineColor:c,antCls:s}=r,d=n?{[`${e}-selector`]:{borderColor:i}}:{};return{[o]:{[`&:not(${e}-disabled):not(${e}-customize-input):not(${s}-pagination-size-changer)`]:{...d,[`${e}-focused& ${e}-selector`]:{borderColor:i,boxShadow:`0 0 0 ${r.controlOutlineWidth}px ${c}`,borderInlineEndWidth:`${r.controlLineWidth}px !important`,outline:0},[`&:hover ${e}-selector`]:{borderColor:i,borderInlineEndWidth:`${r.controlLineWidth}px !important`}}}}},h=o=>{const{componentCls:r}=o;return{[`${r}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},C=o=>{const{componentCls:r,inputPaddingHorizontalBase:n,iconCls:e}=o;return{[r]:{...u(o),position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${r}-customize-input) ${r}-selector`]:{...f(o),...h(o)},[`${r}-selection-item`]:{flex:1,fontWeight:"normal",...a},[`${r}-selection-placeholder`]:{...a,flex:1,color:o.colorTextPlaceholder,pointerEvents:"none"},[`${r}-arrow`]:{...p(),position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,height:o.fontSizeIcon,marginTop:-o.fontSizeIcon/2,color:o.colorTextQuaternary,fontSize:o.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[e]:{verticalAlign:"top",transition:`transform ${o.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${r}-suffix)`]:{pointerEvents:"auto"}},[`${r}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}},[`${r}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,zIndex:1,display:"inline-block",width:o.fontSizeIcon,height:o.fontSizeIcon,marginTop:-o.fontSizeIcon/2,color:o.colorTextQuaternary,fontSize:o.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:o.colorBgContainer,cursor:"pointer",opacity:0,transition:`color ${o.motionDurationMid} ease, opacity ${o.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:o.colorTextTertiary}},"&:hover":{[`${r}-clear`]:{opacity:1}}},[`${r}-has-feedback`]:{[`${r}-clear`]:{insetInlineEnd:n+o.fontSize+o.paddingXXS}}}},y=o=>{const{componentCls:r}=o;return[{[r]:{[`&-borderless ${r}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${r}-in-form-item`]:{width:"100%"}}},C(o),S(o),$(o),g(o),{[`${r}-rtl`]:{direction:"rtl"}},l(r,t(o,{borderHoverColor:o.colorPrimaryHover,outlineColor:o.controlOutline})),l(`${r}-status-error`,t(o,{borderHoverColor:o.colorErrorHover,outlineColor:o.colorErrorOutline}),!0),l(`${r}-status-warning`,t(o,{borderHoverColor:o.colorWarningHover,outlineColor:o.colorWarningOutline}),!0),m(o,{borderElCls:`${r}-selector`,focusElCls:`${r}-focused`})]},B=b("Select",(o,{rootPrefixCls:r})=>{const n=t(o,{rootPrefixCls:r,inputPaddingHorizontalBase:o.paddingSM-1});return[y(n)]},o=>({zIndexPopup:o.zIndexPopupBase+50}));export{B as default};
