const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/subItem.BqxpECh8.js","assets/vue.D1BjjNmv.js","assets/index.CL7yl-Wb.js","assets/index.DgHxlRHa.css"])))=>i.map(i=>d[i]);
import{aK as P,u as O,_ as V,o as j,e as K}from"./index.CL7yl-Wb.js";import{a as R,r as N,aC as k,aB as q,_ as F,f as Y,a5 as J,q as Q,aK as U,aj as i,c as d,o as r,S as a,K as l,R as C,a9 as W,J as L,u as G,aA as X,b as S,Q as m,a8 as Z,P as y,Y as g,t as ee}from"./vue.D1BjjNmv.js";import{_ as te}from"./_plugin-vue_export-helper.DlAUqK2U.js";const ne={class:"el-menu-horizontal-warp"},se=["onClick"],oe=R({name:"navMenuHorizontal"}),ae=R({...oe,props:{menuList:{type:Array,default:()=>[]}},setup(A){const M=X(()=>V(()=>import("./subItem.BqxpECh8.js"),__vite__mapDeps([0,1,2,3]))),$=A,c=N(),b=P(),w=O(),{routesList:z}=k(b),{themeConfig:p}=k(w),v=q(),u=F({defaultActive:""}),x=Y(()=>$.menuList),B=n=>{const e=n.wheelDelta||-n.deltaY*40;c.value.$refs.wrapRef.scrollLeft=c.value.$refs.wrapRef.scrollLeft+e/4},D=()=>{ee(()=>{let n=document.querySelector(".el-menu.el-menu--horizontal li.is-active");if(!n)return!1;c.value.$refs.wrapRef.scrollLeft=n.offsetLeft})},_=n=>n.filter(e=>{var t;return!((t=e.meta)!=null&&t.isHide)}).map(e=>(e=Object.assign({},e),e.children&&(e.children=_(e.children)),e)),H=n=>{const e=n.split("/");let t={children:[]};return _(z.value).map((o,f)=>{o.path===`/${e[1]}`&&(o.k=f,t.item={...o},t.children=[{...o}],o.children&&(t.children=o.children))}),t},h=n=>{const{path:e,meta:t}=n;if(p.value.layout==="classic")u.defaultActive=`/${e==null?void 0:e.split("/")[1]}`;else{const o=t!=null&&t.isDynamic?t.isDynamicPath.split("/"):e.split("/");o.length>=4&&(t!=null&&t.isHide)?u.defaultActive=o.splice(0,3).join("/"):u.defaultActive=e}},I=n=>{j.handleOpenLink(n)};return J(()=>{h(v)}),Q(()=>{D()}),U(n=>{h(n);let{layout:e,isClassicSplitMenu:t}=p.value;e==="classic"&&t&&K.emit("setSendClassicChildren",H(n.path))}),(n,e)=>{const t=i("SvgIcon"),o=i("el-sub-menu"),f=i("el-menu-item"),T=i("el-menu"),E=i("el-scrollbar");return r(),d("div",ne,[a(E,{onWheel:g(B,["prevent"]),ref_key:"elMenuHorizontalScrollRef",ref:c},{default:l(()=>[a(T,{router:"","default-active":u.defaultActive,ellipsis:!1,"background-color":"transparent",mode:"horizontal"},{default:l(()=>[(r(!0),d(C,null,W(x.value,s=>(r(),d(C,null,[s.children&&s.children.length>0?(r(),L(o,{index:s.path,key:s.path},{title:l(()=>[a(t,{name:s.meta.icon},null,8,["name"]),S("span",null,m(n.$t(s.meta.title)),1)]),default:l(()=>[a(G(M),{chil:s.children},null,8,["chil"])]),_:2},1032,["index"])):(r(),L(f,{index:s.path,key:s.path},Z({_:2},[!s.meta.isLink||s.meta.isLink&&s.meta.isIframe?{name:"title",fn:l(()=>[a(t,{name:s.meta.icon},null,8,["name"]),y(" "+m(n.$t(s.meta.title)),1)]),key:"0"}:{name:"title",fn:l(()=>[S("a",{class:"w100",onClick:g(le=>I(s),["prevent"])},[a(t,{name:s.meta.icon},null,8,["name"]),y(" "+m(n.$t(s.meta.title)),1)],8,se)]),key:"1"}]),1032,["index"]))],64))),256))]),_:1},8,["default-active"])]),_:1},512)])}}}),ue=te(ae,[["__scopeId","data-v-161df1d0"]]);export{ue as default};
