import{e as u,u as f}from"./vendor-@vue.54cfd5db.js";function y(r){const M=u(()=>i(["Menu","SubMenu"])),p=u(()=>i(["Menu"])),d=u(()=>i(["SubMenu"])),m=u(()=>{var a,o,l;let e=r==null?void 0:r.parent;if(!e)return{};const t=(o=(a=f(p))==null?void 0:a.props.indentSize)!=null?o:20;let n=t;if((l=f(p))!=null&&l.props.collapse)n=t;else for(;e&&e.type.name!=="Menu";)e.type.name==="SubMenu"&&(n+=t),e=e.parent;return{paddingLeft:n+"px"}});function i(e){let t=r==null?void 0:r.parent;if(!t)return null;for(;t&&e.indexOf(t.type.name)===-1;)t=t.parent;return t}function s(){let e=r;if(!e)return{uidList:[],list:[]};const t=[];for(;e&&e.type.name!=="Menu";)e.type.name==="SubMenu"&&t.push(e),e=e.parent;return{uidList:t.map(n=>n.uid),list:t}}function S(e,t="SubMenu"){let n=e.parent;for(;n;){if(n.type.name!==t)return n;n=n.parent}return n}return{getParentMenu:M,getParentInstance:S,getParentRootMenu:p,getParentList:s,getParentSubMenu:d,getItemStyle:m}}export{y as useMenuItem};
