import{P as U,cN as re,a as u,d as F,br as z,u as W,c as y,c1 as le,_ as ie,V as A,a0 as E,ap as L,bM as M,a3 as k,bp as se,h as H,cO as de,b as ue,az as pe,cP as ve,a2 as R,bL as ce}from"./index-7c0f3f3a.js";var G=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:U.any,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},align:{type:Object},getPopupContainer:Function,prefixCls:String,transitionName:String,placement:String,overlayClassName:String,overlayStyle:{type:Object,default:void 0},forceRender:{type:Boolean,default:void 0},mouseEnterDelay:Number,mouseLeaveDelay:Number,openClassName:String,minOverlayWidthMatchTrigger:{type:Boolean,default:void 0},destroyPopupOnHide:{type:Boolean,default:void 0},onVisibleChange:{type:Function},"onUpdate:visible":{type:Function}}},T=re(),ye=function(){return u(u({},G()),{},{type:T.type,size:String,htmlType:T.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:U.any,title:String,loading:T.loading,onClick:{type:Function}})},fe=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],me=A.Group;const ge=F({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:z(ye(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(n,f){var o=f.slots,B=f.attrs,P=f.emit,g=function(p){P("update:visible",p),P("visibleChange",p)},i=W("dropdown-button",n),x=i.prefixCls,w=i.direction,O=i.getPopupContainer;return function(){var b,p,e=u(u({},n),B),D=e.type,t=D===void 0?"default":D,a=e.disabled,r=e.loading,m=e.htmlType,s=e.class,d=s===void 0?"":s,l=e.overlay,C=l===void 0?(b=o.overlay)===null||b===void 0?void 0:b.call(o):l,_=e.trigger,v=e.align,c=e.visible;e.onVisibleChange;var h=e.placement,N=h===void 0?w.value==="rtl"?"bottomLeft":"bottomRight":h,S=e.href,q=e.title,V=e.icon,J=V===void 0?((p=o.icon)===null||p===void 0?void 0:p.call(o))||y(le,null,null):V,K=e.mouseEnterDelay,Q=e.mouseLeaveDelay,X=e.overlayClassName,Z=e.overlayStyle,ee=e.destroyPopupOnHide,te=e.onClick;e["onUpdate:visible"];var ae=ie(e,fe),oe={align:v,disabled:a,trigger:a?[]:_,placement:N,getPopupContainer:O.value,onVisibleChange:g,mouseEnterDelay:K,mouseLeaveDelay:Q,visible:c,overlayClassName:X,overlayStyle:Z,destroyPopupOnHide:ee},j=y(A,{type:t,disabled:a,loading:r,onClick:te,htmlType:m,href:S,title:q},{default:o.default}),I=y(A,{type:t,icon:J},null);return y(me,u(u({},ae),{},{class:E(x.value,d)}),{default:function(){return[o.leftButton?o.leftButton({button:j}):j,y(be,oe,{default:function(){return[o.rightButton?o.rightButton({button:I}):I]},overlay:function(){return C}})]}})}}});var Y=F({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:z(G(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(n,f){var o=f.slots,B=f.attrs,P=f.emit,g=W("dropdown",n),i=g.prefixCls,x=g.rootPrefixCls,w=g.direction,O=g.getPopupContainer,b=L(function(){var t=n.placement,a=t===void 0?"":t,r=n.transitionName;return r!==void 0?r:a.indexOf("top")>=0?"".concat(x.value,"-slide-down"):"".concat(x.value,"-slide-up")}),p=function(){var a,r,m,s=n.overlay||((a=o.overlay)===null||a===void 0?void 0:a.call(o)),d=Array.isArray(s)?s[0]:s;if(!d)return null;var l=d.props||{};M(!l.mode||l.mode==="vertical","Dropdown",'mode="'.concat(l.mode,`" is not supported for Dropdown's Menu.`));var C=l.selectable,_=C===void 0?!1:C,v=l.expandIcon,c=v===void 0?(r=d.children)===null||r===void 0||(m=r.expandIcon)===null||m===void 0?void 0:m.call(r):v,h=typeof c<"u"&&R(c)?c:y("span",{class:"".concat(i.value,"-menu-submenu-arrow")},[y(ce,{class:"".concat(i.value,"-menu-submenu-arrow-icon")},null)]),N=R(d)?k(d,{mode:"vertical",selectable:_,expandIcon:function(){return h}}):d;return N},e=L(function(){var t=n.placement;if(!t)return w.value==="rtl"?"bottomRight":"bottomLeft";if(t.includes("Center")){var a=t.slice(0,t.indexOf("Center"));return M(!t.includes("Center"),"Dropdown","You are using '".concat(t,"' placement in Dropdown, which is deprecated. Try to use '").concat(a,"' instead.")),a}return t}),D=function(a){P("update:visible",a),P("visibleChange",a)};return function(){var t,a,r=n.arrow,m=n.trigger,s=n.disabled,d=n.overlayClassName,l=(t=o.default)===null||t===void 0?void 0:t.call(o)[0],C=k(l,se({class:E(l==null||(a=l.props)===null||a===void 0?void 0:a.class,H({},"".concat(i.value,"-rtl"),w.value==="rtl"),"".concat(i.value,"-trigger"))},s?{disabled:s}:{})),_=E(d,H({},"".concat(i.value,"-rtl"),w.value==="rtl")),v=s?[]:m,c;v&&v.indexOf("contextmenu")!==-1&&(c=!0);var h=de({arrowPointAtCenter:ue(r)==="object"&&r.pointAtCenter,autoAdjustOverflow:!0}),N=pe(u(u(u({},n),B),{},{builtinPlacements:h,overlayClassName:_,arrow:r,alignPoint:c,prefixCls:i.value,getPopupContainer:O.value,transitionName:b.value,trigger:v,onVisibleChange:D,placement:e.value}),["overlay","onUpdate:visible"]);return y(ve,N,{default:function(){return[C]},overlay:p})}}});Y.Button=ge;const be=Y;export{be as D,ge as a};