import{a as e,n as t}from"./react-dom-stZKkA6x.js";import{$n as n,En as r,Mr as i,N as a,Rn as o,Xn as s,_n as c,bn as l,jn as u,ln as d,yn as f}from"./jsx-runtime-dm82oUI8.js";var p=e(t()),m=e(i()),h=new s(`antStatusProcessing`,{"0%":{transform:`scale(0.8)`,opacity:.5},"100%":{transform:`scale(2.4)`,opacity:0}}),g=new s(`antZoomBadgeIn`,{"0%":{transform:`scale(0) translate(50%, -50%)`,opacity:0},"100%":{transform:`scale(1) translate(50%, -50%)`}}),_=new s(`antZoomBadgeOut`,{"0%":{transform:`scale(1) translate(50%, -50%)`},"100%":{transform:`scale(0) translate(50%, -50%)`,opacity:0}}),v=new s(`antNoWrapperZoomBadgeIn`,{"0%":{transform:`scale(0)`,opacity:0},"100%":{transform:`scale(1)`}}),y=new s(`antNoWrapperZoomBadgeOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0)`,opacity:0}}),b=new s(`antBadgeLoadingCircle`,{"0%":{transformOrigin:`50%`},"100%":{transform:`translate(50%, -50%) rotate(360deg)`,transformOrigin:`50%`}}),x=e=>{let{componentCls:t,iconCls:i,antCls:a,badgeShadowSize:o,textFontSize:s,textFontSizeSM:c,statusSize:l,dotSize:u,textFontWeight:d,indicatorHeight:p,indicatorHeightSM:m,marginXS:x,calc:S}=e,C=`${a}-scroll-number`,w=f(e,(e,{darkColor:n})=>({[`&${t} ${t}-color-${e}`]:{background:n,[`&:not(${t}-count)`]:{color:n},"a:hover &":{background:n}}}));return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},r(e)),{position:`relative`,display:`inline-block`,width:`fit-content`,lineHeight:1,[`${t}-count`]:{display:`inline-flex`,justifyContent:`center`,zIndex:e.indicatorZIndex,minWidth:p,height:p,color:e.badgeTextColor,fontWeight:d,fontSize:s,lineHeight:n(p),whiteSpace:`nowrap`,textAlign:`center`,background:e.badgeColor,borderRadius:S(p).div(2).equal(),boxShadow:`0 0 0 ${n(o)} ${e.badgeShadowColor}`,transition:`background ${e.motionDurationMid}`,a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},[`${t}-count-sm`]:{minWidth:m,height:m,fontSize:c,lineHeight:n(m),borderRadius:S(m).div(2).equal()},[`${t}-multiple-words`]:{padding:`0 ${n(e.paddingXS)}`,bdi:{unicodeBidi:`plaintext`}},[`${t}-dot`]:{zIndex:e.indicatorZIndex,width:u,minWidth:u,height:u,background:e.badgeColor,borderRadius:`100%`,boxShadow:`0 0 0 ${n(o)} ${e.badgeShadowColor}`},[`${t}-count, ${t}-dot, ${C}-custom-component`]:{position:`absolute`,top:0,insetInlineEnd:0,transform:`translate(50%, -50%)`,transformOrigin:`100% 0%`,[`&${i}-spin`]:{animationName:b,animationDuration:`1s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`}},[`&${t}-status`]:{lineHeight:`inherit`,verticalAlign:`baseline`,[`${t}-status-dot`]:{position:`relative`,top:-1,display:`inline-block`,width:l,height:l,verticalAlign:`middle`,borderRadius:`50%`},[`${t}-status-success`]:{backgroundColor:e.colorSuccess},[`${t}-status-processing`]:{overflow:`visible`,color:e.colorInfo,backgroundColor:e.colorInfo,borderColor:`currentcolor`,"&::after":{position:`absolute`,top:0,insetInlineStart:0,width:`100%`,height:`100%`,borderWidth:o,borderStyle:`solid`,borderColor:`inherit`,borderRadius:`50%`,animationName:h,animationDuration:e.badgeProcessingDuration,animationIterationCount:`infinite`,animationTimingFunction:`ease-in-out`,content:`""`}},[`${t}-status-default`]:{backgroundColor:e.colorTextPlaceholder},[`${t}-status-error`]:{backgroundColor:e.colorError},[`${t}-status-warning`]:{backgroundColor:e.colorWarning},[`${t}-status-text`]:{marginInlineStart:x,color:e.colorText,fontSize:e.fontSize}}}),w),{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:g,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:`both`},[`${t}-zoom-leave`]:{animationName:_,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:`both`},[`&${t}-not-a-wrapper`]:{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`${t}-zoom-leave`]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`&:not(${t}-status)`]:{verticalAlign:`middle`},[`${C}-custom-component, ${t}-count`]:{transform:`none`},[`${C}-custom-component, ${C}`]:{position:`relative`,top:`auto`,display:`block`,transformOrigin:`50% 50%`}},[C]:{overflow:`hidden`,transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack}`,[`${C}-only`]:{position:`relative`,display:`inline-block`,height:p,transition:`all ${e.motionDurationSlow} ${e.motionEaseOutBack}`,WebkitTransformStyle:`preserve-3d`,WebkitBackfaceVisibility:`hidden`,[`> p${C}-only-unit`]:{height:p,margin:0,WebkitTransformStyle:`preserve-3d`,WebkitBackfaceVisibility:`hidden`}},[`${C}-symbol`]:{verticalAlign:`top`}},"&-rtl":{direction:`rtl`,[`${t}-count, ${t}-dot, ${C}-custom-component`]:{transform:`translate(-50%, -50%)`}}})}},S=e=>{let{fontHeight:t,lineWidth:n,marginXS:r,colorBorderBg:i}=e,a=t,o=n,s=e.colorTextLightSolid,c=e.colorError,l=e.colorErrorHover;return u(e,{badgeFontHeight:a,badgeShadowSize:o,badgeTextColor:s,badgeColor:c,badgeColorHover:l,badgeShadowColor:i,badgeProcessingDuration:`1.2s`,badgeRibbonOffset:r,badgeRibbonCornerTransform:`scaleY(0.75)`,badgeRibbonCornerFilter:`brightness(75%)`})},C=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:r,lineWidth:i}=e;return{indicatorZIndex:`auto`,indicatorHeight:Math.round(t*n)-2*i,indicatorHeightSM:t,dotSize:r/2,textFontSize:r,textFontSizeSM:r,textFontWeight:`normal`,statusSize:r/2}},w=l(`Badge`,e=>x(S(e)),C),T=e=>{let{antCls:t,badgeFontHeight:i,marginXS:a,badgeRibbonOffset:o,calc:s}=e,c=`${t}-ribbon`,l=`${t}-ribbon-wrapper`,u=f(e,(e,{darkColor:t})=>({[`&${c}-color-${e}`]:{background:t,color:t}}));return{[l]:{position:`relative`},[c]:Object.assign(Object.assign(Object.assign(Object.assign({},r(e)),{position:`absolute`,top:a,padding:`0 ${n(e.paddingXS)}`,color:e.colorPrimary,lineHeight:n(i),whiteSpace:`nowrap`,backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,[`${c}-text`]:{color:e.badgeTextColor},[`${c}-corner`]:{position:`absolute`,top:`100%`,width:o,height:o,color:`currentcolor`,border:`${n(s(o).div(2).equal())} solid`,transform:e.badgeRibbonCornerTransform,transformOrigin:`top`,filter:e.badgeRibbonCornerFilter}}),u),{[`&${c}-placement-end`]:{insetInlineEnd:s(o).mul(-1).equal(),borderEndEndRadius:0,[`${c}-corner`]:{insetInlineEnd:0,borderInlineEndColor:`transparent`,borderBlockEndColor:`transparent`}},[`&${c}-placement-start`]:{insetInlineStart:s(o).mul(-1).equal(),borderEndStartRadius:0,[`${c}-corner`]:{insetInlineStart:0,borderBlockEndColor:`transparent`,borderInlineStartColor:`transparent`}},"&-rtl":{direction:`rtl`}})}},E=l([`Badge`,`Ribbon`],e=>T(S(e)),C),D=e=>{let{className:t,prefixCls:n,style:r,color:i,children:s,text:c,placement:l=`end`,rootClassName:u}=e,{getPrefixCls:d,direction:f}=p.useContext(o),h=d(`ribbon`,n),g=`${h}-wrapper`,[_,v,y]=E(h,g),b=a(i,!1),x=(0,m.default)(h,`${h}-placement-${l}`,{[`${h}-rtl`]:f===`rtl`,[`${h}-color-${i}`]:b},t),S={},C={};return i&&!b&&(S.background=i,C.color=i),_(p.createElement(`div`,{className:(0,m.default)(g,u,v,y)},s,p.createElement(`div`,{className:(0,m.default)(x,v),style:Object.assign(Object.assign({},S),r)},p.createElement(`span`,{className:`${h}-text`},c),p.createElement(`div`,{className:`${h}-corner`,style:C}))))},O=e=>{let{prefixCls:t,value:n,current:r,offset:i=0}=e,a;return i&&(a={position:`absolute`,top:`${i}00%`,left:0}),p.createElement(`span`,{style:a,className:(0,m.default)(`${t}-only-unit`,{current:r})},n)};function k(e,t,n){let r=e,i=0;for(;(r+10)%10!==t;)r+=n,i+=n;return i}var A=e=>{let{prefixCls:t,count:n,value:r}=e,i=Number(r),a=Math.abs(n),[o,s]=p.useState(i),[c,l]=p.useState(a),u=()=>{s(i),l(a)};p.useEffect(()=>{let e=setTimeout(u,1e3);return()=>clearTimeout(e)},[i]);let d,f;if(o===i||Number.isNaN(i)||Number.isNaN(o))d=[p.createElement(O,Object.assign({},e,{key:i,current:!0}))],f={transition:`none`};else{d=[];let t=i+10,n=[];for(let e=i;e<=t;e+=1)n.push(e);let r=ce%10===o);d=(r<0?n.slice(0,s+1):n.slice(s)).map((t,n)=>{let i=t%10;return p.createElement(O,Object.assign({},e,{key:t,value:i,offset:r<0?n-s:n,current:n===s}))}),f={transform:`translateY(${-k(o,i,r)}00%)`}}return p.createElement(`span`,{className:`${t}-only`,style:f,onTransitionEnd:u},d)},j=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{prefixCls:n,count:r,className:i,motionClassName:a,style:s,title:c,show:l,component:u=`sup`,children:f}=e,h=j(e,[`prefixCls`,`count`,`className`,`motionClassName`,`style`,`title`,`show`,`component`,`children`]),{getPrefixCls:g}=p.useContext(o),_=g(`scroll-number`,n),v=Object.assign(Object.assign({},h),{"data-show":l,style:s,className:(0,m.default)(_,i,a),title:c}),y=r;if(r&&Number(r)%1==0){let e=String(r).split(``);y=p.createElement(`bdi`,null,e.map((t,n)=>p.createElement(A,{prefixCls:_,count:Number(r),value:t,key:e.length-n})))}return s?.borderColor&&(v.style=Object.assign(Object.assign({},s),{boxShadow:`0 0 0 1px ${s.borderColor} inset`})),f?d(f,e=>({className:(0,m.default)(`${_}-custom-component`,e?.className,a)})):p.createElement(u,Object.assign({},v,{ref:t}),y)}),M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{prefixCls:n,scrollNumberPrefixCls:r,children:i,status:s,text:l,color:u,count:f=null,overflowCount:h=99,dot:g=!1,size:_=`default`,title:v,offset:y,style:b,className:x,rootClassName:S,classNames:C,styles:T,showZero:E=!1}=e,D=M(e,[`prefixCls`,`scrollNumberPrefixCls`,`children`,`status`,`text`,`color`,`count`,`overflowCount`,`dot`,`size`,`title`,`offset`,`style`,`className`,`rootClassName`,`classNames`,`styles`,`showZero`]),{getPrefixCls:O,direction:k,badge:A}=p.useContext(o),j=O(`badge`,n),[N,P,F]=w(j),I=f>h?`${h}+`:f,L=I===`0`||I===0||l===`0`||l===0,R=f===null||L&&!E,z=(s!=null||u!=null)&&R,B=s!=null||!L,V=g&&!L,H=V?``:I,U=(0,p.useMemo)(()=>((H==null||H===``)&&(l==null||l===``)||L&&!E)&&!V,[H,L,E,V,l]),W=(0,p.useRef)(f);U||(W.current=f);let G=W.current,K=(0,p.useRef)(H);U||(K.current=H);let q=K.current,J=(0,p.useRef)(V);U||(J.current=V);let Y=(0,p.useMemo)(()=>{if(!y)return Object.assign(Object.assign({},A?.style),b);let e={marginTop:y[1]};return k===`rtl`?e.left=Number.parseInt(y[0],10):e.right=-Number.parseInt(y[0],10),Object.assign(Object.assign(Object.assign({},e),A?.style),b)},[k,y,b,A?.style]),te=v??(typeof G==`string`||typeof G==`number`?G:void 0),X=!U&&(l===0?E:!!l&&l!==!0),ne=X?p.createElement(`span`,{className:`${j}-status-text`},l):null,re=!G||typeof G!=`object`?void 0:d(G,e=>({style:Object.assign(Object.assign({},Y),e.style)})),Z=a(u,!1),ie=(0,m.default)(C?.indicator,A?.classNames?.indicator,{[`${j}-status-dot`]:z,[`${j}-status-${s}`]:!!s,[`${j}-color-${u}`]:Z}),Q={};u&&!Z&&(Q.color=u,Q.background=u);let $=(0,m.default)(j,{[`${j}-status`]:z,[`${j}-not-a-wrapper`]:!i,[`${j}-rtl`]:k===`rtl`},x,S,A?.className,A?.classNames?.root,C?.root,P,F);if(!i&&z&&(l||B||!R)){let e=Y.color;return N(p.createElement(`span`,Object.assign({},D,{className:$,style:Object.assign(Object.assign(Object.assign({},T?.root),A?.styles?.root),Y)}),p.createElement(`span`,{className:ie,style:Object.assign(Object.assign(Object.assign({},T?.indicator),A?.styles?.indicator),Q)}),X&&p.createElement(`span`,{style:{color:e},className:`${j}-status-text`},l)))}return N(p.createElement(`span`,Object.assign({ref:t},D,{className:$,style:Object.assign(Object.assign({},A?.styles?.root),T?.root)}),i,p.createElement(c,{visible:!U,motionName:`${j}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:e})=>{let t=O(`scroll-number`,r),n=J.current,i=(0,m.default)(C?.indicator,A?.classNames?.indicator,{[`${j}-dot`]:n,[`${j}-count`]:!n,[`${j}-count-sm`]:_===`small`,[`${j}-multiple-words`]:!n&&q&&q.toString().length>1,[`${j}-status-${s}`]:!!s,[`${j}-color-${u}`]:Z}),a=Object.assign(Object.assign(Object.assign({},T?.indicator),A?.styles?.indicator),Y);return u&&!Z&&(a||={},a.background=u),p.createElement(ee,{prefixCls:t,show:!U,motionClassName:e,className:i,count:q,title:te,style:a,key:`scrollNumber`},re)}),ne))});N.Ribbon=D;export{N as t};