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