"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("../../style/index.js");require("../../_util/cssinjs/StyleContext.js");require("vue");require("../../_util/cssinjs/transformers/legacyLogicalProperties.js");const h=require("../../style/motion/move.js"),d=require("../../style/motion/slide.js"),S=require("../../style/motion/zoom.js"),x=require("../../style/placementArrow.js");require("../../theme/internal.js");const _=require("./button.js"),R=require("./status.js"),z=require("../../theme/util/genComponentStyleHook.js"),y=require("../../theme/util/statistic.js"),I=require("../../style/roundedArrow.js"),C=t=>{const{componentCls:e,menuCls:n,zIndexPopup:p,dropdownArrowDistance:i,dropdownArrowOffset:a,sizePopupArrow:c,antCls:o,iconCls:s,motionDurationMid:l,dropdownPaddingVertical:u,fontSize:m,dropdownEdgeChildPadding:w,colorTextDisabled:r,fontSizeIcon:v,controlPaddingHorizontal:g,colorBgElevated:$,boxShadowPopoverArrow:f}=t;return[{[e]:{...b.resetComponent(t),position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:p,display:"block","&::before":{position:"absolute",insetBlock:-i+c/2,zIndex:-9999,opacity:1e-4,content:'""'},[`${e}-wrap`]:{position:"relative",[`${o}-btn > ${s}-down`]:{fontSize:v},[`${s}-down::before`]:{transition:`transform ${l}`}},[`${e}-wrap-open`]:{[`${s}-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:i},[`
        &-show-arrow${e}-placement-bottomLeft,
        &-show-arrow${e}-placement-bottom,
        &-show-arrow${e}-placement-bottomRight
      `]:{paddingTop:i},[`${e}-arrow`]:{position:"absolute",zIndex:1,display:"block",...I.roundedArrow(c,t.borderRadiusXS,t.borderRadiusOuter,$,f)},[`
        &-placement-top > ${e}-arrow,
        &-placement-topLeft > ${e}-arrow,
        &-placement-topRight > ${e}-arrow
      `]:{bottom:i,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:i,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:d.slideUpIn},[`&${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:d.slideDownIn},[`&${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:d.slideUpOut},[`&${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:d.slideDownOut}}},{[`${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:w,listStyleType:"none",backgroundColor:$,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,...b.genFocusStyle(t),[`${n}-item-group-title`]:{padding:`${u}px ${g}px`,color:t.colorTextDescription,transition:`all ${l}`},[`${n}-item`]:{position:"relative",display:"flex",alignItems:"center",borderRadius:t.borderRadiusSM},[`${n}-item-icon`]:{minWidth:m,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:`${u}px ${g}px`,color:t.colorText,fontWeight:"normal",fontSize:m,lineHeight:t.lineHeight,cursor:"pointer",transition:`all ${l}`,"&:hover, &-active":{backgroundColor:t.controlItemBgHover},...b.genFocusStyle(t),"&-selected":{color:t.colorPrimary,backgroundColor:t.controlItemBgActive,"&:hover, &-active":{backgroundColor:t.controlItemBgActiveHover}},"&-disabled":{color:r,cursor:"not-allowed","&:hover":{color:r,backgroundColor:$,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:v,fontStyle:"normal"}}},[`${n}-item-group-list`]:{margin:`0 ${t.marginXS}px`,padding:0,listStyle:"none"},[`${n}-submenu-title`]:{paddingInlineEnd:g+t.fontSizeSM},[`${n}-submenu-vertical`]:{position:"relative"},[`${n}-submenu${n}-submenu-disabled ${e}-menu-submenu-title`]:{[`&, ${e}-menu-submenu-arrow-icon`]:{color:r,backgroundColor:$,cursor:"not-allowed"}},[`${n}-submenu-selected ${e}-menu-submenu-title`]:{color:t.colorPrimary}}}},[d.initSlideMotion(t,"slide-up"),d.initSlideMotion(t,"slide-down"),h.initMoveMotion(t,"move-up"),h.initMoveMotion(t,"move-down"),S.initZoomMotion(t,"zoom-big")]]},q=z.default("Dropdown",(t,{rootPrefixCls:e})=>{const{marginXXS:n,sizePopupArrow:p,controlHeight:i,fontSize:a,lineHeight:c,paddingXXS:o,componentCls:s,borderRadiusOuter:l,borderRadiusLG:u}=t,m=(i-a*c)/2,{dropdownArrowOffset:w}=x.getArrowOffset({sizePopupArrow:p,contentRadius:u,borderRadiusOuter:l}),r=y.merge(t,{menuCls:`${s}-menu`,rootPrefixCls:e,dropdownArrowDistance:p/2+n,dropdownArrowOffset:w,dropdownPaddingVertical:m,dropdownEdgeChildPadding:o});return[C(r),_.default(r),R.default(r)]},t=>({zIndexPopup:t.zIndexPopupBase+50}));exports.default=q;
