import{d as L,N as k,R as F,C as R,r as $,c as E,o as M,X as j,b as m,e as i,j as d,f as r,g as b,u as p,w as f,T as z,F as A,k as D,h,A as _,Z as G,l as U}from"./vue.BxlDVA1H.js";import{W,u as X,$ as Z,L as y}from"./index.lP_uh0LI.js";import{_ as q}from"./_plugin-vue_export-helper.DlAUqK2U.js";const H={key:0,class:"layout-navbars-breadcrumb"},J={key:0,class:"layout-navbars-breadcrumb-span"},K={key:1},O={key:2},P=["onClick"],Q=L({name:"layoutBreadcrumb"}),Y=L({...Q,setup(ee){const B=W(),w=X(),{themeConfig:o}=k(w),{routesList:g}=k(B),c=F(),C=R(),e=$({breadcrumbList:[],routeSplit:[],routeSplitFirst:"",routeSplitIndex:1}),I=E(()=>{u(c.path);const{layout:t,isBreadcrumb:a}=o.value;return t==="classic"||t==="transverse"?!1:!!a}),N=t=>{const{redirect:a,path:n}=t;a?C.push(a):C.push(n)},T=()=>{o.value.isCollapse=!o.value.isCollapse,V()},V=()=>{y.remove("themeConfig"),y.set("themeConfig",o.value)},v=t=>{t.forEach(a=>{e.routeSplit.forEach((n,S,l)=>{e.routeSplitFirst===a.path&&(e.routeSplitFirst+=`/${l[e.routeSplitIndex]}`,e.breadcrumbList.push(a),e.routeSplitIndex++,a.children&&v(a.children))})})},u=t=>{if(!o.value.isBreadcrumb)return!1;e.breadcrumbList=[g.value[0]],e.routeSplit=t.split("/"),e.routeSplit.shift(),e.routeSplitFirst=`/${e.routeSplit[0]}`,e.routeSplitIndex=1,v(g.value),(c.name==="home"||c.name==="notFound"&&e.breadcrumbList.length>1)&&e.breadcrumbList.shift(),e.breadcrumbList.length>0&&(e.breadcrumbList[e.breadcrumbList.length-1].meta.tagsViewName=Z.setTagsViewNameI18n(c))};return M(()=>{u(c.path)}),j(t=>{u(t.path)}),(t,a)=>{const n=m("SvgIcon"),S=m("el-breadcrumb-item"),l=m("el-breadcrumb");return I.value?(r(),i("div",H,[b(n,{class:"layout-navbars-breadcrumb-icon",name:p(o).isCollapse?"ele-Expand":"ele-Fold",size:16,onClick:T},null,8,["name"]),b(l,{class:"layout-navbars-breadcrumb-hide"},{default:f(()=>[b(z,{name:"breadcrumb"},{default:f(()=>[(r(!0),i(A,null,D(e.breadcrumbList,(s,x)=>(r(),h(S,{key:s.meta.tagsViewName?s.meta.tagsViewName:s.meta.title},{default:f(()=>[x===e.breadcrumbList.length-1?(r(),i("span",J,[p(o).isBreadcrumbIcon?(r(),h(n,{key:0,name:s.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):d("",!0),s.meta.tagsViewName?(r(),i("div",O,_(s.meta.tagsViewName),1)):(r(),i("div",K,_(t.$t(s.meta.title)),1))])):(r(),i("a",{key:1,onClick:G(te=>N(s),["prevent"])},[p(o).isBreadcrumbIcon?(r(),h(n,{key:0,name:s.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):d("",!0),U(_(t.$t(s.meta.title)),1)],8,P))]),_:2},1024))),128))]),_:1})]),_:1})])):d("",!0)}}}),oe=q(Y,[["__scopeId","data-v-e6a58a1f"]]);export{oe as default};
