import{resetComponent as S,genFocusStyle as b}from"../../style/index.mjs";import"../../_util/cssinjs/StyleContext.mjs";import"vue";import"../../_util/cssinjs/transformers/legacyLogicalProperties.mjs";import{initMoveMotion as v}from"../../style/motion/move.mjs";import{slideDownOut as x,slideUpOut as R,slideDownIn as _,slideUpIn as y,initSlideMotion as f}from"../../style/motion/slide.mjs";import{initZoomMotion as z}from"../../style/motion/zoom.mjs";import{getArrowOffset as I}from"../../style/placementArrow.mjs";import"../../theme/internal.mjs";import C from"./button.mjs";import L from"./status.mjs";import P from"../../theme/util/genComponentStyleHook.mjs";import{merge as X}from"../../theme/util/statistic.mjs";import{roundedArrow as A}from"../../style/roundedArrow.mjs";const B=t=>{const{componentCls:e,menuCls:n,zIndexPopup:p,dropdownArrowDistance:r,dropdownArrowOffset:a,sizePopupArrow:s,antCls:o,iconCls:d,motionDurationMid:l,dropdownPaddingVertical:m,fontSize:c,dropdownEdgeChildPadding:$,colorTextDisabled:i,fontSizeIcon:g,controlPaddingHorizontal:w,colorBgElevated:u,boxShadowPopoverArrow:h}=t;return[{[e]:{...S(t),position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:p,display:"block","&::before":{position:"absolute",insetBlock:-r+s/2,zIndex:-9999,opacity:1e-4,content:'""'},[`${e}-wrap`]:{position:"relative",[`${o}-btn > ${d}-down`]:{fontSize:g},[`${d}-down::before`]:{transition:`transform ${l}`}},[`${e}-wrap-open`]:{[`${d}-down::before`]:{transform:"rotate(180deg)"}},"\n        &-hidden,\n        &-menu-hidden,\n        &-menu-submenu-hidden\n      ":{display:"none"},[`
        &-show-arrow${e}-placement-topLeft,
        &-show-arrow${e}-placement-top,
        &-show-arrow${e}-placement-topRight
      `]:{paddingBottom:r},[`
        &-show-arrow${e}-placement-bottomLeft,
        &-show-arrow${e}-placement-bottom,
        &-show-arrow${e}-placement-bottomRight
      `]:{paddingTop:r},[`${e}-arrow`]:{position:"absolute",zIndex:1,display:"block",...A(s,t.borderRadiusXS,t.borderRadiusOuter,u,h)},[`
        &-placement-top > ${e}-arrow,
        &-placement-topLeft > ${e}-arrow,
        &-placement-topRight > ${e}-arrow
      `]:{bottom:r,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${e}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft > ${e}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-topRight > ${e}-arrow`]:{right:{_skip_check_:!0,value:a}},[`
          &-placement-bottom > ${e}-arrow,
          &-placement-bottomLeft > ${e}-arrow,
          &-placement-bottomRight > ${e}-arrow
        `]:{top:r,transform:"translateY(-100%)"},[`&-placement-bottom > ${e}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateY(-100%) translateX(-50%)"},[`&-placement-bottomLeft > ${e}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-bottomRight > ${e}-arrow`]:{right:{_skip_check_:!0,value:a}},[`&${o}-slide-down-enter${o}-slide-down-enter-active${e}-placement-bottomLeft,
          &${o}-slide-down-appear${o}-slide-down-appear-active${e}-placement-bottomLeft,
          &${o}-slide-down-enter${o}-slide-down-enter-active${e}-placement-bottom,
          &${o}-slide-down-appear${o}-slide-down-appear-active${e}-placement-bottom,
          &${o}-slide-down-enter${o}-slide-down-enter-active${e}-placement-bottomRight,
          &${o}-slide-down-appear${o}-slide-down-appear-active${e}-placement-bottomRight`]:{animationName:y},[`&${o}-slide-up-enter${o}-slide-up-enter-active${e}-placement-topLeft,
          &${o}-slide-up-appear${o}-slide-up-appear-active${e}-placement-topLeft,
          &${o}-slide-up-enter${o}-slide-up-enter-active${e}-placement-top,
          &${o}-slide-up-appear${o}-slide-up-appear-active${e}-placement-top,
          &${o}-slide-up-enter${o}-slide-up-enter-active${e}-placement-topRight,
          &${o}-slide-up-appear${o}-slide-up-appear-active${e}-placement-topRight`]:{animationName:_},[`&${o}-slide-down-leave${o}-slide-down-leave-active${e}-placement-bottomLeft,
          &${o}-slide-down-leave${o}-slide-down-leave-active${e}-placement-bottom,
          &${o}-slide-down-leave${o}-slide-down-leave-active${e}-placement-bottomRight`]:{animationName:R},[`&${o}-slide-up-leave${o}-slide-up-leave-active${e}-placement-topLeft,
          &${o}-slide-up-leave${o}-slide-up-leave-active${e}-placement-top,
          &${o}-slide-up-leave${o}-slide-up-leave-active${e}-placement-topRight`]:{animationName:x}}},{[`${e} ${n}`]:{position:"relative",margin:0},[`${n}-submenu-popup`]:{position:"absolute",zIndex:p,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul,li":{listStyle:"none"},ul:{marginInline:"0.3em"}},[`${e}, ${e}-menu-submenu`]:{[n]:{padding:$,listStyleType:"none",backgroundColor:u,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,...b(t),[`${n}-item-group-title`]:{padding:`${m}px ${w}px`,color:t.colorTextDescription,transition:`all ${l}`},[`${n}-item`]:{position:"relative",display:"flex",alignItems:"center",borderRadius:t.borderRadiusSM},[`${n}-item-icon`]:{minWidth:c,marginInlineEnd:t.marginXS,fontSize:t.fontSizeSM},[`${n}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${l}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${n}-item, ${n}-submenu-title`]:{clear:"both",margin:0,padding:`${m}px ${w}px`,color:t.colorText,fontWeight:"normal",fontSize:c,lineHeight:t.lineHeight,cursor:"pointer",transition:`all ${l}`,"&:hover, &-active":{backgroundColor:t.controlItemBgHover},...b(t),"&-selected":{color:t.colorPrimary,backgroundColor:t.controlItemBgActive,"&:hover, &-active":{backgroundColor:t.controlItemBgActiveHover}},"&-disabled":{color:i,cursor:"not-allowed","&:hover":{color:i,backgroundColor:u,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${t.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:t.colorSplit},[`${e}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:t.paddingXS,[`${e}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:t.colorTextDescription,fontSize:g,fontStyle:"normal"}}},[`${n}-item-group-list`]:{margin:`0 ${t.marginXS}px`,padding:0,listStyle:"none"},[`${n}-submenu-title`]:{paddingInlineEnd:w+t.fontSizeSM},[`${n}-submenu-vertical`]:{position:"relative"},[`${n}-submenu${n}-submenu-disabled ${e}-menu-submenu-title`]:{[`&, ${e}-menu-submenu-arrow-icon`]:{color:i,backgroundColor:u,cursor:"not-allowed"}},[`${n}-submenu-selected ${e}-menu-submenu-title`]:{color:t.colorPrimary}}}},[f(t,"slide-up"),f(t,"slide-down"),v(t,"move-up"),v(t,"move-down"),z(t,"zoom-big")]]},j=P("Dropdown",(t,{rootPrefixCls:e})=>{const{marginXXS:n,sizePopupArrow:p,controlHeight:r,fontSize:a,lineHeight:s,paddingXXS:o,componentCls:d,borderRadiusOuter:l,borderRadiusLG:m}=t,c=(r-a*s)/2,{dropdownArrowOffset:$}=I({sizePopupArrow:p,contentRadius:m,borderRadiusOuter:l}),i=X(t,{menuCls:`${d}-menu`,rootPrefixCls:e,dropdownArrowDistance:p/2+n,dropdownArrowOffset:$,dropdownPaddingVertical:c,dropdownEdgeChildPadding:o});return[B(i),C(i),L(i)]},t=>({zIndexPopup:t.zIndexPopupBase+50}));export{j as default};
