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