import{k as e,Q as t,n as a,a2 as l,c as s,L as o,r,b as i,d as n,l as u,e as f,f as c,w as p,g as y,z as d,j as g,x as h,M as b,v,A as x,au as m,av as k,t as S,p as _,y as B}from"./index-DVkgSHpn.js";import{_ as I,c as C,b as N}from"./el-layout._U-vZTft.js";const T=I({__name:"el-navbar",props:{top:{type:Number,default:0},safeAreaInsetTop:{type:Boolean,default:!0},placeholder:{type:Boolean,default:!1},fixed:{type:Boolean,default:!0},border:{type:Boolean,default:!1},showLeft:{type:Boolean,default:!0},leftIcon:{type:String,default:"left"},leftText:{type:String,default:""},mpRightReserveCapsule:{type:Boolean,default:!0},rightText:{type:String,default:""},rightIcon:{type:String,default:""},title:{type:[String,Number],default:""},bgColor:{type:String,default:"#ffffff"},titleWidth:{type:[String,Number],default:"400rpx"},height:{type:[String,Number],default:"44"},leftIconSize:{type:[String,Number],default:"20px"},leftIconColor:{type:String,default:"#303133"},autoBack:{type:Boolean,default:!0},titleStyle:{type:[String,Object],default:""},opacity:{type:[Number,String],default:1},scroll:{type:[Number,String],default:0}},emits:["update:top","left","right","change"],setup(I,{emit:T}){const z=I,j=e(),w=T;t((()=>{a((()=>{let e=44;z.safeAreaInsetTop&&(e+=j.statusBarHeight),z.border&&(e+=.5),l().isWechat&&(e=0),w("update:top",e)}))}));const A=s((()=>{if(z.opacity>=1)return z.opacity;var e=z.scroll/180;return e>1?1:e})),H=s((()=>0));let W=o(),$=r(W.length<=1?1:0),L=uni.$config.get("tabBar.defaultHome","pages/index/index");W[W.length-1].route==L?$.value=0:W.length>1?$.value=1:$.value=2;const R=()=>{z.autoBack?W.length>1?k():S(L):w("left")},M=()=>{w("right")},O=()=>{S(L)};return(e,t)=>{const a=i(n("el-status-bar"),C),s=_,o=i(n("uni-icons"),N),r=B;return u(l)().isWechat?g("",!0):(f(),c(s,{key:0,class:"el-navbar"},{default:p((()=>[y(s,{class:d([I.fixed&&"navbar-fixed"])},{default:p((()=>[I.safeAreaInsetTop?(f(),c(a,{key:0,bgColor:I.bgColor,opacity:A.value},null,8,["bgColor","opacity"])):g("",!0),y(s,{style:h({height:I.height+"px",background:I.bgColor,opacity:A.value})},null,8,["style"]),y(s,{class:d(["navbar-content",[I.border&&A.value&&"border-bottom"]]),style:h({height:I.height+"px",top:u(j).statusBarHeight+"px"})},{default:p((()=>[I.showLeft?(f(),c(s,{key:0,class:"left","hover-class":"hover","hover-start-time":"150"},{default:p((()=>[b(e.$slots,"left",{},(()=>[0!=u($)?(f(),c(s,{key:0,class:d(["nav-slot",{"nav-home":2==u($)}])},{default:p((()=>[I.leftIcon?(f(),c(o,{key:0,type:I.leftIcon,size:"20",onClick:R,color:2!=u($)?A.value>=1?"#333":"#fff":"#333",class:d({"nav-left-icon":2!=u($),"nav-left-active":A.value>=1})},null,8,["type","color","class"])):g("",!0),I.leftText?(f(),c(r,{key:1,style:h({color:I.leftIconColor}),class:"text",onClick:R},{default:p((()=>[v(x(I.leftText),1)])),_:1},8,["style"])):g("",!0),y(s,{class:"line"}),y(o,{class:"nav-icon-home",type:"home",size:"20",onClick:O})])),_:1},8,["class"])):g("",!0)]),!0)])),_:3})):g("",!0),b(e.$slots,"center",{},(()=>[y(r,{class:"title",style:h([{width:I.titleWidth,opacity:A.value},u(m)(I.titleStyle)])},{default:p((()=>[v(x(I.title),1)])),_:1},8,["style"])]),!0),y(s,{class:"right",style:h({right:H.value+"px"}),onClick:M},{default:p((()=>[b(e.$slots,"right",{},(()=>[I.rightIcon?(f(),c(o,{key:0,type:I.rightIcon,size:"20"},null,8,["type"])):g("",!0),I.rightText?(f(),c(r,{key:1,class:"text"},{default:p((()=>[v(x(I.rightText),1)])),_:1})):g("",!0)]),!0)])),_:3},8,["style"])])),_:3},8,["class","style"])])),_:3},8,["class"]),I.fixed&&I.placeholder?(f(),c(s,{key:0,style:h({height:Number(I.height)+Number(u(j).statusBarHeight)+"px"})},null,8,["style"])):g("",!0)])),_:3}))}}},[["__scopeId","data-v-3636f1b6"]]);export{T as _};
//# sourceMappingURL=el-navbar.DVIyjZEN.js.map
