const e=require("../_util/warning.js"),t=require("../_util/classNames.js"),n=require("../_util/omit.js"),r=require("../_util/props-util/initDefaultProps.js"),i=require("../_util/props-util/index.js"),a=require("../config-provider/hooks/useConfigInject.js"),o=require("../vc-util/devWarning.js"),s=require("../_util/vnode.js"),c=require("../_util/placements.js"),l=require("../menu/src/OverrideContext.js"),u=require("../vc-dropdown/index.js"),d=require("./props.js"),f=require("./style/index.js"),p=require("./dropdown-button.js");let m=require("vue"),h=require("@antsoo-lib/icons");var g=(0,m.defineComponent)({compatConfig:{MODE:3},name:`ADropdown`,inheritAttrs:!1,props:r.default(d.default(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:`bottomLeft`,trigger:`hover`}),slots:Object,setup(r,{slots:d,attrs:p,emit:g}){let{prefixCls:_,rootPrefixCls:v,direction:y,getPopupContainer:b}=a.default(`dropdown`,r),[x,S]=f.default(_),C=(0,m.computed)(()=>{let{placement:e=``,transitionName:t}=r;return t===void 0?e.includes(`top`)?`${v.value}-slide-down`:`${v.value}-slide-up`:t});l.useProvideOverride({prefixCls:(0,m.computed)(()=>`${_.value}-menu`),expandIcon:(0,m.computed)(()=>(0,m.createVNode)(`span`,{class:`${_.value}-menu-submenu-arrow`},[(0,m.createVNode)(h.RightOutlined,{class:`${_.value}-menu-submenu-arrow-icon`},null)])),mode:(0,m.computed)(()=>`vertical`),selectable:(0,m.computed)(()=>!1),onClick:()=>{},validator:({mode:t})=>{e.default(!t||t===`vertical`,`Dropdown`,`mode="${t}" is not supported for Dropdown's Menu.`)}});let w=()=>{let e=r.overlay||d.overlay?.(),t=Array.isArray(e)?e[0]:e;if(!t)return null;let n=t.props||{};o.default(!n.mode||n.mode===`vertical`,`Dropdown`,`mode="${n.mode}" is not supported for Dropdown's Menu.`);let{selectable:a=!1,expandIcon:c=t.children?.expandIcon?.()}=n,l=c!==void 0&&i.isValidElement(c)?c:(0,m.createVNode)(`span`,{class:`${_.value}-menu-submenu-arrow`},[(0,m.createVNode)(h.RightOutlined,{class:`${_.value}-menu-submenu-arrow-icon`},null)]);return i.isValidElement(t)?s.cloneElement(t,{mode:`vertical`,selectable:a,expandIcon:()=>l}):t},T=(0,m.computed)(()=>{let e=r.placement;if(!e)return y.value===`rtl`?`bottomRight`:`bottomLeft`;if(e.includes(`Center`)){let t=e.slice(0,e.indexOf(`Center`));return o.default(!e.includes(`Center`),`Dropdown`,`You are using '${e}' placement in Dropdown, which is deprecated. Try to use '${t}' instead.`),t}return e}),E=(0,m.computed)(()=>typeof r.visible==`boolean`?r.visible:r.open),D=e=>{g(`update:visible`,e),g(`visibleChange`,e),g(`update:open`,e),g(`openChange`,e)};return()=>{let{arrow:e,trigger:i,disabled:a,overlayClassName:o}=r,l=d.default?.()[0],f=s.cloneElement(l,Object.assign({class:t.default(l?.props?.class,{[`${_.value}-rtl`]:y.value===`rtl`},`${_.value}-trigger`)},a?{disabled:a}:{})),h=t.default(o,S.value,{[`${_.value}-rtl`]:y.value===`rtl`}),g=a?[]:i,v;g&&g.includes(`contextmenu`)&&(v=!0);let O=c.default({arrowPointAtCenter:typeof e==`object`&&e.pointAtCenter,autoAdjustOverflow:!0}),k=n.default({...r,...p,visible:E.value,builtinPlacements:O,overlayClassName:h,arrow:!!e,alignPoint:v,prefixCls:_.value,getPopupContainer:b?.value,transitionName:C.value,trigger:g,onVisibleChange:D,placement:T.value},[`overlay`,`onUpdate:visible`]);return x((0,m.createVNode)(u.default,k,{default:()=>[f],overlay:w}))}}});g.Button=p.default,exports.default=g;