import{v as P,aj as Ze,cf as Be,a as ce,f as q,p as d,c5 as ie,a6 as me,Z as W,ag as Le,_ as A,cg as G,a5 as _,K as Oe,L as ye,ch as Mt,ba as Nt,ci as Lt,cj as Ot,am as Ke,a3 as Kt,a2 as Dt,bf as Wt,T as ct,ck as Ee,cl as vt,cm as pt,cn as Ft,au as St,aM as jt,c4 as $t,X as zt,co as Ht,c8 as Ye,a7 as Vt,U as Gt,cp as Ut,cq as st,ca as Xt}from"./index.203f4f59.js";import{u as Yt}from"./useRefs.432b35dd.js";import{P as Zt}from"./PlusOutlined.8a2c9f9f.js";function qt(p){var e=P(),t=P(!1);function o(){for(var a=arguments.length,n=new Array(a),l=0;lj?(x=i,L.value="x"):(x=y,L.value="y"),e(-x,-x)&&g.preventDefault()}var O=P({onTouchStart:s,onTouchMove:R,onTouchEnd:H,onWheel:B});function U(g){O.value.onTouchStart(g)}function K(g){O.value.onTouchMove(g)}function $(g){O.value.onTouchEnd(g)}function ve(g){O.value.onWheel(g)}Oe(function(){var g,i;document.addEventListener("touchmove",K,{passive:!1}),document.addEventListener("touchend",$,{passive:!1}),(g=p.value)===null||g===void 0||g.addEventListener("touchstart",U,{passive:!1}),(i=p.value)===null||i===void 0||i.addEventListener("wheel",ve,{passive:!1})}),Ze(function(){document.removeEventListener("touchmove",K),document.removeEventListener("touchend",$)})}function yt(p,e){var t=P(p);function o(a){var n=typeof a=="function"?a(t.value):a;n!==t.value&&e(n,t.value),t.value=n}return[t,o]}var mt={width:0,height:0,left:0,top:0,right:0},ra=function(){return{id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:{type:Object,default:void 0},editable:{type:Object},moreIcon:Ke.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:{type:Object,default:void 0},onTabClick:{type:Function},onTabScroll:{type:Function}}},ht=ce({compatConfig:{MODE:3},name:"TabNavList",inheritAttrs:!1,props:ra(),slots:["moreIcon","leftExtra","rightExtra","tabBarExtraContent"],emits:["tabClick","tabScroll"],setup:function(e,t){var o=t.attrs,a=t.slots,n=It(),l=n.tabs,c=n.prefixCls,r=P(),v=P(),u=P(),f=P(),h=Yt(),N=_(h,2),k=N[0],F=N[1],E=q(function(){return e.tabPosition==="top"||e.tabPosition==="bottom"}),z=yt(0,function(m,S){E.value&&e.onTabScroll&&e.onTabScroll({direction:m>S?"left":"right"})}),T=_(z,2),s=T[0],R=T[1],H=yt(0,function(m,S){!E.value&&e.onTabScroll&&e.onTabScroll({direction:m>S?"top":"bottom"})}),L=_(H,2),B=L[0],O=L[1],U=G(0),K=_(U,2),$=K[0],ve=K[1],g=G(0),i=_(g,2),y=i[0],x=i[1],D=G(null),j=_(D,2),C=j[0],Se=j[1],he=G(null),w=_(he,2),X=w[0],re=w[1],Te=G(0),ge=_(Te,2),xe=ge[0],se=ge[1],_e=G(0),Q=_(_e,2),De=Q[0],Re=Q[1],Ae=Jt(new Map),pe=_(Ae,2),We=pe[0],Fe=pe[1],we=ea(l,We),Pt=q(function(){return"".concat(c.value,"-nav-operations-hidden")}),Ce=P(0),Ie=P(0);Le(function(){E.value?e.rtl?(Ce.value=0,Ie.value=Math.max(0,$.value-C.value)):(Ce.value=Math.min(0,C.value-$.value),Ie.value=0):(Ce.value=Math.min(0,X.value-y.value),Ie.value=0)});var je=function(S){return SIe.value?Ie.value:S},qe=P(),Et=G(),Je=_(Et,2),$e=Je[0],Qe=Je[1],ze=function(){Qe(Date.now())},He=function(){clearTimeout(qe.value)},et=function(S,b){S(function(M){var I=je(M+b);return I})};ia(r,function(m,S){if(E.value){if(C.value>=$.value)return!1;et(R,m)}else{if(X.value>=y.value)return!1;et(O,S)}return He(),ze(),!0}),ye($e,function(){He(),$e.value&&(qe.value=setTimeout(function(){Qe(0)},100))});var tt=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey,b=we.value.get(S)||{width:0,height:0,left:0,right:0,top:0};if(E.value){var M=s.value;e.rtl?b.rights.value+C.value&&(M=b.right+b.width-C.value):b.left<-s.value?M=-b.left:b.left+b.width>-s.value+C.value&&(M=-(b.left+b.width-C.value)),O(0),R(je(M))}else{var I=B.value;b.top<-B.value?I=-b.top:b.top+b.height>-B.value+X.value&&(I=-(b.top+b.height-X.value)),R(0),O(je(I))}},Ve=P(0),Ge=P(0);Le(function(){var m,S,b,M,I,Y,Z,fe=we.value;["top","bottom"].includes(e.tabPosition)?(S="width",I=C.value,Y=$.value,Z=xe.value,b=e.rtl?"right":"left",M=Math.abs(s.value)):(S="height",I=X.value,Y=$.value,Z=De.value,b="top",M=-B.value);var ee=I;Y+Z>I&&YM+ee){V=te-1;break}}for(var ue=0,J=be-1;J>=0;J-=1){var ne=fe.get(le[J].key)||mt;if(ne[b]0,ue=s.value+C.value<$.value):(ue=s.value<0,J=-s.value+C.value<$.value):(ne=B.value<0,lt=-B.value+X.value