const e=require("../../menu/src/MenuItem.js"),t=require("../../menu/index.js"),n=require("../../spin/index.js"),r=require("./MentionsContext.js");let i=require("vue");function a(){}var o=(0,i.defineComponent)({compatConfig:{MODE:3},name:`DropdownMenu`,props:{prefixCls:String,options:{type:Array,default:()=>[]}},setup(o,{slots:s}){let{activeIndex:c,setActiveIndex:l,selectOption:u,onFocus:d=a,loading:f}=(0,i.inject)(r.default,{activeIndex:(0,i.shallowRef)(),loading:(0,i.shallowRef)(!1)}),p,m=e=>{clearTimeout(p),p=setTimeout(()=>{d(e)})};return(0,i.onBeforeUnmount)(()=>{clearTimeout(p)}),()=>{let{prefixCls:r,options:a}=o,d=a[c.value]||{};return(0,i.createVNode)(t.default,{prefixCls:`${r}-menu`,activeKey:d.value,onSelect:({key:e})=>{let t=a.find(({value:t})=>t===e);u(t)},onMousedown:m},{default:()=>[!f.value&&a.map((t,n)=>{let{value:r,disabled:a,label:o=t.value,class:c,style:u}=t;return(0,i.createVNode)(e.default,{key:r,disabled:a,onMouseenter:()=>{l(n)},class:c,style:u},{default:()=>[s.option?.(t)??(typeof o==`function`?o(t):o)]})}),!f.value&&a.length===0?(0,i.createVNode)(e.default,{key:`notFoundContent`,disabled:!0},{default:()=>[s.notFoundContent?.()]}):null,f.value&&(0,i.createVNode)(e.default,{key:`loading`,disabled:!0},{default:()=>[(0,i.createVNode)(n.default,{size:`small`},null)]})]})}}});exports.default=o;