import{j as Te,g as ze,h as Re,d as F,r as O,x as se,e as I,w as R,n as Z,f as C,b as pe,l as _e,b6 as dt,ad as vt,bD as pt,aH as ft,p as ht,k as gt,v as bt,m as mt,__tla as wt}from"./index-286756b9.js";import{O as Me,M as fe,N as Oe,J as yt,E as xt,k as Ae,c as J,n as D,m as He,z as j,Q as Le,R as We,e as Xe,s as Ct,q as he,S as K,u as Q,w as ge,a as Ze,d as ee,t as E,j as It,T as De,x as te,U as kt,o as je,V as ae,p as St,W as be,G as me,L as $t,b as Ee,v as we,X as Bt,Y as Tt,Z as Ye,y as zt,_ as Rt,B as _t,$ as Ne,r as Mt,i as Ot,C as Pe,__tla as At}from"./index-3305e882.js";let Ve,Fe,Ht=Promise.all([(()=>{try{return wt}catch{}})(),(()=>{try{return At}catch{}})()]).then(async()=>{let Je=0;function ye(){const e=Te(),{name:f="unknown"}=(e==null?void 0:e.type)||{};return`${f}-${++Je}`}function xe(e,f){if(!xt||!window.IntersectionObserver)return;const u=new IntersectionObserver(h=>{f(h[0].intersectionRatio>0)},{root:document.body}),r=()=>{e.value&&u.unobserve(e.value)};ze(r),Re(r),Ae(()=>{e.value&&u.observe(e.value)})}const[qe,Ge]=J("sticky"),Qe=ee(F({name:qe,props:{zIndex:D,position:He("top"),container:Object,offsetTop:j(0),offsetBottom:j(0)},emits:["scroll","change"],setup(e,{emit:f,slots:u}){const r=O(),h=Le(r),t=se({fixed:!1,width:0,height:0,transform:0}),b=O(!1),s=I(()=>We(e.position==="top"?e.offsetTop:e.offsetBottom)),l=I(()=>{if(b.value)return;const{fixed:o,height:d,width:g}=t;return o?{width:`${g}px`,height:`${d}px`}:void 0}),T=I(()=>{if(!t.fixed||b.value)return;const o=Xe(Ct(e.zIndex),{width:`${t.width}px`,height:`${t.height}px`,[e.position]:`${s.value}px`});return t.transform&&(o.transform=`translate3d(0, ${t.transform}px, 0)`),o}),n=()=>{if(!r.value||K(r))return;const{container:o,position:d}=e,g=Q(r),L=Oe(window);if(t.width=g.width,t.height=g.height,d==="top")if(o){const S=Q(o),v=S.bottom-s.value-t.height;t.fixed=s.value>g.top&&S.bottom>0,t.transform=v<0?v:0}else t.fixed=s.value>g.top;else{const{clientHeight:S}=document.documentElement;if(o){const v=Q(o),W=S-v.top-s.value-t.height;t.fixed=S-s.valuev.top,t.transform=W<0?-W:0}else t.fixed=S-s.value{f("scroll",{scrollTop:S,isFixed:t.fixed})})(L)};return R(()=>t.fixed,o=>f("change",o)),he("scroll",n,{target:h,passive:!0}),xe(r,n),R([ge,Ze],()=>{r.value&&!K(r)&&t.fixed&&(b.value=!0,Z(()=>{const o=Q(r);t.width=o.width,t.height=o.height,b.value=!1}))}),()=>{var o;return C("div",{ref:r,style:l.value},[C("div",{class:Ge({fixed:t.fixed&&!b.value}),style:T.value},[(o=u.default)==null?void 0:o.call(u)])])}}})),[Ce,le]=J("swipe"),Ue={loop:E,width:D,height:D,vertical:Boolean,autoplay:j(0),duration:j(500),touchable:E,lazyRender:Boolean,initialSwipe:j(0),indicatorColor:String,showIndicators:E,stopPropagation:E},Ie=Symbol(Ce),Ke=ee(F({name:Ce,props:Ue,emits:["change","dragStart","dragEnd"],setup(e,{emit:f,slots:u}){const r=O(),h=O(),t=se({rect:null,width:0,height:0,offset:0,active:0,swiping:!1});let b=!1;const s=It(),{children:l,linkChildren:T}=De(Ie),n=I(()=>l.length),o=I(()=>t[e.vertical?"height":"width"]),d=I(()=>e.vertical?s.deltaY.value:s.deltaX.value),g=I(()=>t.rect?(e.vertical?t.rect.height:t.rect.width)-o.value*n.value:0),L=I(()=>o.value?Math.ceil(Math.abs(g.value)/o.value):n.value),S=I(()=>n.value*o.value),v=I(()=>(t.active+n.value)%n.value),W=I(()=>{const c=e.vertical?"vertical":"horizontal";return s.direction.value===c}),y=I(()=>{const c={transitionDuration:`${t.swiping?0:e.duration}ms`,transform:`translate${e.vertical?"Y":"X"}(${+t.offset.toFixed(2)}px)`};if(o.value){const $=e.vertical?"height":"width",x=e.vertical?"width":"height";c[$]=`${S.value}px`,c[x]=e[x]?`${e[x]}px`:""}return c}),Y=(c,$=0)=>{let x=c*o.value;e.loop||(x=Math.min(x,-g.value));let a=$-x;return e.loop||(a=be(a,g.value,0)),a},_=({pace:c=0,offset:$=0,emitChange:x})=>{if(n.value<=1)return;const{active:a}=t,i=(w=>{const{active:m}=t;return w?e.loop?be(m+w,-1,n.value):be(m+w,0,L.value):m})(c),p=Y(i,$);if(e.loop){if(l[0]&&p!==g.value){const w=p0;l[n.value-1].setOffset(w?-S.value:0)}}t.active=i,t.offset=p,x&&i!==a&&f("change",v.value)},X=()=>{t.swiping=!0,t.active<=-1?_({pace:n.value}):t.active>=n.value&&_({pace:-n.value})},U=()=>{X(),s.reset(),ae(()=>{t.swiping=!1,_({pace:1,emitChange:!0})})};let q;const N=()=>clearTimeout(q),H=()=>{N(),+e.autoplay>0&&n.value>1&&(q=setTimeout(()=>{U(),H()},+e.autoplay))},z=(c=+e.initialSwipe)=>{if(!r.value)return;const $=()=>{var x,a;if(!K(r)){const i={width:r.value.offsetWidth,height:r.value.offsetHeight};t.rect=i,t.width=+((x=e.width)!=null?x:i.width),t.height=+((a=e.height)!=null?a:i.height)}n.value&&(c=Math.min(n.value-1,c))===-1&&(c=n.value-1),t.active=c,t.swiping=!0,t.offset=Y(c),l.forEach(i=>{i.setOffset(0)}),H()};K(r)?Z().then($):$()},P=()=>z(t.active);let V;const ne=c=>{!e.touchable||c.touches.length>1||(s.start(c),b=!1,V=Date.now(),N(),X())},oe=()=>{if(!e.touchable||!t.swiping)return;const c=Date.now()-V,$=d.value/c;if((Math.abs($)>.25||Math.abs(d.value)>o.value/2)&&W.value){const x=e.vertical?s.offsetY.value:s.offsetX.value;let a=0;a=e.loop?x>0?d.value>0?-1:1:0:-Math[d.value>0?"ceil":"floor"](d.value/o.value),_({pace:a,emitChange:!0})}else d.value&&_({pace:0});b=!1,t.swiping=!1,f("dragEnd",{index:v.value}),H()},ue=(c,$)=>{const x=$===v.value,a=x?{backgroundColor:e.indicatorColor}:void 0;return C("i",{style:a,class:le("indicator",{active:x})},null)};return te({prev:()=>{X(),s.reset(),ae(()=>{t.swiping=!1,_({pace:-1,emitChange:!0})})},next:U,state:t,resize:P,swipeTo:(c,$={})=>{X(),s.reset(),ae(()=>{let x;x=e.loop&&c===n.value?t.active===0?0:c:c%n.value,$.immediate?ae(()=>{t.swiping=!1}):t.swiping=!1,_({pace:x-t.active,emitChange:!0})})}}),T({size:o,props:e,count:n,activeIndicator:v}),R(()=>e.initialSwipe,c=>z(+c)),R(n,()=>z(t.active)),R(()=>e.autoplay,H),R([ge,Ze,()=>e.width,()=>e.height],P),R(kt(),c=>{c==="visible"?H():N()}),pe(z),_e(()=>z(t.active)),je(()=>z(t.active)),ze(N),Re(N),he("touchmove",c=>{e.touchable&&t.swiping&&(s.move(c),W.value)&&(!e.loop&&(t.active===0&&d.value>0||t.active===n.value-1&&d.value<0)||(St(c,e.stopPropagation),_({offset:d.value}),b||(f("dragStart",{index:v.value}),b=!0)))},{target:h}),()=>{var c;return C("div",{ref:r,class:le()},[C("div",{ref:h,style:y.value,class:le("track",{vertical:e.vertical}),onTouchstartPassive:ne,onTouchend:oe,onTouchcancel:oe},[(c=u.default)==null?void 0:c.call(u)]),u.indicator?u.indicator({active:v.value,total:n.value}):e.showIndicators&&n.value>1?C("div",{class:le("indicators",{vertical:e.vertical})},[Array(n.value).fill("").map(ue)]):void 0])}}})),[et,ke]=J("tabs");var tt=F({name:et,props:{count:me(Number),inited:Boolean,animated:Boolean,duration:me(D),swipeable:Boolean,lazyRender:Boolean,currentIndex:me(Number)},emits:["change"],setup(e,{emit:f,slots:u}){const r=O(),h=s=>f("change",s),t=()=>{var s;const l=(s=u.default)==null?void 0:s.call(u);return e.animated||e.swipeable?C(Ke,{ref:r,loop:!1,class:ke("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:h},{default:()=>[l]}):l},b=s=>{const l=r.value;l&&l.state.active!==s&&l.swipeTo(s,{immediate:!e.inited})};return R(()=>e.currentIndex,b),pe(()=>{b(e.currentIndex)}),te({swipeRef:r}),()=>C("div",{class:ke("content",{animated:e.animated||e.swipeable})},[t()])}});const[Se,ie]=J("tabs"),at={type:He("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:j(0),duration:j(.3),animated:Boolean,ellipsis:E,swipeable:Boolean,scrollspy:Boolean,offsetTop:j(0),background:String,lazyRender:E,showHeader:E,lineWidth:D,lineHeight:D,beforeChange:Function,swipeThreshold:j(5),titleActiveColor:String,titleInactiveColor:String},$e=Symbol(Se);var lt=F({name:Se,props:at,emits:["change","scroll","rendered","clickTab","update:active"],setup(e,{emit:f,slots:u}){let r,h,t,b,s;const l=O(),T=O(),n=O(),o=O(),d=ye(),g=Le(l),[L,S]=$t(),{children:v,linkChildren:W}=De($e),y=se({inited:!1,position:"",lineStyle:{},currentIndex:-1}),Y=I(()=>v.length>+e.swipeThreshold||!e.ellipsis||e.shrink),_=I(()=>({borderColor:e.color,background:e.background})),X=(a,i)=>{var p;return(p=a.name)!=null?p:i},U=I(()=>{const a=v[y.currentIndex];if(a)return X(a,y.currentIndex)}),q=I(()=>We(e.offsetTop)),N=I(()=>e.sticky?q.value+r:0),H=a=>{const i=T.value,p=L.value;if(!(Y.value&&i&&p&&p[y.currentIndex]))return;const w=p[y.currentIndex].$el,m=w.offsetLeft-(i.offsetWidth-w.offsetWidth)/2;b&&b(),b=function(B,k,M){let A,G=0;const de=B.scrollLeft,re=M===0?1:Math.round(1e3*M/16);return function ve(){B.scrollLeft+=(k-de)/re,++G{const a=y.inited;Z(()=>{const i=L.value;if(!i||!i[y.currentIndex]||e.type!=="line"||K(l.value))return;const p=i[y.currentIndex].$el,{lineWidth:w,lineHeight:m}=e,B=p.offsetLeft+p.offsetWidth/2,k={width:Ee(w),backgroundColor:e.color,transform:`translateX(${B}px) translateX(-50%)`};if(a&&(k.transitionDuration=`${e.duration}s`),we(m)){const M=Ee(m);k.height=M,k.borderRadius=M}y.lineStyle=k})},P=(a,i)=>{const p=(k=>{const M=k=0&&k{const p=v.find((m,B)=>X(m,B)===a),w=p?v.indexOf(p):0;P(w,i)},ne=(a=!1)=>{if(e.scrollspy){const i=v[y.currentIndex].$el;if(i&&g.value){const p=Ye(i,g.value)-N.value;h=!0,s&&s(),s=function(w,m,B,k){let M,A=Oe(w);const G=Am||!G&&Am?M=fe(ve):k&&(M=fe(k))}(),function(){Me(M)}}(g.value,p,a?0:+e.duration,()=>{h=!1})}}},oe=(a,i,p)=>{const{title:w,disabled:m}=v[i],B=X(v[i],i);m||(zt(e.beforeChange,{args:[B],done:()=>{P(i),ne()}}),Rt(a)),f("clickTab",{name:B,title:w,event:p,disabled:m})},ue=a=>{t=a.isFixed,f("scroll",a)},c=()=>{if(e.type==="line"&&v.length)return C("div",{class:ie("line"),style:y.lineStyle},null)},$=()=>{var a,i,p;const{type:w,border:m,sticky:B}=e,k=[C("div",{ref:B?void 0:n,class:[ie("wrap"),{[Bt]:w==="line"&&m}]},[C("div",{ref:T,role:"tablist",class:ie("nav",[w,{shrink:e.shrink,complete:Y.value}]),style:_.value,"aria-orientation":"horizontal"},[(a=u["nav-left"])==null?void 0:a.call(u),v.map(M=>M.renderTitle(oe)),c(),(i=u["nav-right"])==null?void 0:i.call(u)])]),(p=u["nav-bottom"])==null?void 0:p.call(u)];return B?C("div",{ref:n},[k]):k},x=()=>{z(),Z(()=>{var a,i;H(!0),(i=(a=o.value)==null?void 0:a.swipeRef.value)==null||i.resize()})};return R(()=>[e.color,e.duration,e.lineWidth,e.lineHeight],z),R(ge,x),R(()=>e.active,a=>{a!==U.value&&V(a)}),R(()=>v.length,()=>{y.inited&&(V(e.active),z(),Z(()=>{H(!0)}))}),te({resize:x,scrollTo:a=>{Z(()=>{V(a),ne(!0)})}}),_e(z),je(z),Ae(()=>{V(e.active,!0),Z(()=>{y.inited=!0,n.value&&(r=Q(n.value).height),H(!0)})}),xe(l,z),he("scroll",()=>{if(e.scrollspy&&!h){const a=(()=>{for(let i=0;iN.value)return i===0?0:i-1}return v.length-1})();P(a)}},{target:g,passive:!0}),W({id:d,props:e,setLine:z,scrollable:Y,onRendered:(a,i)=>f("rendered",a,i),currentName:U,setTitleRefs:S,scrollIntoView:H}),()=>C("div",{ref:l,class:ie([e.type])},[e.showHeader?e.sticky?C(Qe,{container:l.value,offsetTop:q.value,onScroll:ue},{default:()=>[$()]}):$():null,C(tt,{ref:o,count:v.length,inited:y.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:y.currentIndex,onChange:P},{default:()=>{var a;return[(a=u.default)==null?void 0:a.call(u)]}})])}});const it=Symbol(),[nt,Be]=J("tab"),ot=F({name:nt,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:D,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:E},setup(e,{slots:f}){const u=I(()=>{const h={},{type:t,color:b,disabled:s,isActive:l,activeColor:T,inactiveColor:n}=e;b&&t==="card"&&(h.borderColor=b,s||(l?h.backgroundColor=b:h.color=b));const o=l?T:n;return o&&(h.color=o),h}),r=()=>{const h=C("span",{class:Be("text",{ellipsis:!e.scrollable})},[f.title?f.title():e.title]);return e.dot||we(e.badge)&&e.badge!==""?C(_t,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:()=>[h]}):h};return()=>C("div",{id:e.id,role:"tab",class:[Be([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:u.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[r()])}}),[rt,st]=J("swipe-item"),ct=ee(F({name:rt,setup(e,{slots:f}){let u;const r=se({offset:0,inited:!1,mounted:!1}),{parent:h,index:t}=Ne(Ie);if(!h)return void console.error("[Vant] must be a child component of .");const b=I(()=>{const l={},{vertical:T}=h.props;return h.size.value&&(l[T?"height":"width"]=`${h.size.value}px`),r.offset&&(l.transform=`translate${T?"Y":"X"}(${r.offset}px)`),l}),s=I(()=>{const{loop:l,lazyRender:T}=h.props;if(!T||u)return!0;if(!r.mounted)return!1;const n=h.activeIndicator.value,o=h.count.value-1,d=n===0&&l?o:n-1,g=n===o&&l?0:n+1;return u=t.value===n||t.value===d||t.value===g,u});return pe(()=>{Z(()=>{r.mounted=!0})}),te({setOffset:l=>{r.offset=l}}),()=>{var l;return C("div",{class:st(),style:b.value},[s.value?(l=f.default)==null?void 0:l.call(f):null])}}})),[ut,ce]=J("tab");Ve=ee(F({name:ut,props:Xe({},Mt,{dot:Boolean,name:D,badge:D,title:String,disabled:Boolean,titleClass:Ot,titleStyle:[String,Object],showZeroBadge:E}),setup(e,{slots:f}){const u=ye(),r=O(!1),h=Te(),{parent:t,index:b}=Ne($e);if(!t)return void console.error("[Vant] must be a child component of .");const s=()=>{var d;return(d=e.name)!=null?d:b.value},l=I(()=>{const d=s()===t.currentName.value;return d&&!r.value&&(r.value=!0,t.props.lazyRender&&Z(()=>{t.onRendered(s(),e.title)})),d}),T=O(""),n=O("");dt(()=>{const{titleClass:d,titleStyle:g}=e;T.value=d?vt(d):"",n.value=g&&typeof g!="string"?pt(ft(g)):g});const o=O(!l.value);return R(l,d=>{d?o.value=!1:ae(()=>{o.value=!0})}),R(()=>e.title,()=>{t.setLine(),t.scrollIntoView()}),ht(it,l),te({id:u,renderTitle:d=>C(ot,mt({key:u,id:`${t.id}-${b.value}`,ref:t.setTitleRefs(b.value),style:n.value,class:T.value,isActive:l.value,controls:u,scrollable:t.scrollable.value,activeColor:t.props.titleActiveColor,inactiveColor:t.props.titleInactiveColor,onClick:g=>d(h.proxy,b.value,g)},Pe(t.props,["type","color","shrink"]),Pe(e,["dot","badge","title","disabled","showZeroBadge"])),{title:f.title})}),()=>{var d;const g=`${t.id}-${b.value}`,{animated:L,swipeable:S,scrollspy:v,lazyRender:W}=t.props;if(!f.default&&!L)return;const y=v||l.value;if(L||S)return C(ct,{id:u,role:"tabpanel",class:ce("panel-wrapper",{inactive:o.value}),tabindex:l.value?0:-1,"aria-hidden":!l.value,"aria-labelledby":g},{default:()=>{var _;return[C("div",{class:ce("panel")},[(_=f.default)==null?void 0:_.call(f)])]}});const Y=r.value||v||!W?(d=f.default)==null?void 0:d.call(f):null;return gt(C("div",{id:u,role:"tabpanel",class:ce("panel"),tabindex:y?0:-1,"aria-labelledby":g},[Y]),[[bt,y]])}}})),Fe=ee(lt)});export{Ve as T,Ht as __tla,Fe as a};