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