const e=require("../_util/classNames.js"),t=require("../_util/vue-types/index.js"),n=require("../vc-trigger/index.js");let r=require("vue");var i=e=>{let t=e===!0?0:1;return{bottomLeft:{points:[`tl`,`bl`],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:[`tr`,`br`],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:[`bl`,`tl`],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:[`br`,`tr`],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}},a=(0,r.defineComponent)({name:`SelectTrigger`,inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:t.default.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:t.default.oneOfType([Number,Boolean]).def(!0),popupElement:t.default.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function,onPopupFocusin:Function,onPopupFocusout:Function},setup(t,{slots:a,attrs:o,expose:s}){let c=(0,r.computed)(()=>{let{dropdownMatchSelectWidth:e}=t;return i(e)}),l=(0,r.ref)();return s({getPopupElement:()=>l.value}),()=>{let{empty:i=!1,...s}={...t,...o},{visible:u,dropdownAlign:d,prefixCls:f,popupElement:p,dropdownClassName:m,dropdownStyle:h,direction:g=`ltr`,placement:_,dropdownMatchSelectWidth:v,containerWidth:y,dropdownRender:b,animation:x,transitionName:S,getPopupContainer:C,getTriggerDOMNode:w,onPopupVisibleChange:T,onPopupMouseEnter:E,onPopupFocusin:D,onPopupFocusout:O}=s,k=`${f}-dropdown`,A=p;b&&(A=b({menuNode:p,props:t}));let j=x?`${k}-${x}`:S,M={minWidth:`${y}px`,...h};return typeof v==`number`?M.width=`${v}px`:v&&(M.width=`${y}px`),(0,r.createVNode)(n.default,{...t,showAction:T?[`click`]:[],hideAction:T?[`click`]:[],popupPlacement:_||(g===`rtl`?`bottomRight`:`bottomLeft`),builtinPlacements:c.value,prefixCls:k,popupTransitionName:j,popupAlign:d,popupVisible:u,getPopupContainer:C,popupClassName:e.default(m,{[`${k}-empty`]:i}),popupStyle:M,getTriggerDOMNode:w,onPopupVisibleChange:T},{default:a.default,popup:()=>(0,r.createVNode)(`div`,{ref:l,onMouseenter:E,onFocusin:D,onFocusout:O},[A])})}}});exports.default=a;