Files
xin-procurement/public/assets/card-DU2T2-YW.js
T
2026-08-15 00:19:00 +08:00

25 lines
42 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{$ as t,$t as n,B as r,Dr as i,Et as a,Hn as o,Jn as s,Jt as c,K as l,Kt as u,Ln as d,Mt as f,Pn as p,Q as m,Sr as h,St as g,V as _,Vn as v,Wt as y,Xn as b,Zn as x,Zt as S,l as C,mr as w,n as T,q as E,qt as D,r as O,rr as k,s as A,u as j,vr as M,wr as N,xn as P,xt as F,yr as I,yt as ee,z as L,zn as te}from"./jsx-runtime-CRBytmvs.js";import{n as ne,r as re,t as ie}from"./PlusOutlined-B8K2rG8r.js";var R=e(i()),z=(0,R.createContext)(null),ae=e=>{let{activeTabOffset:t,horizontal:n,rtl:r,indicator:i={}}=e,{size:a,align:o=`center`}=i,[s,c]=(0,R.useState)(),l=(0,R.useRef)(),u=R.useCallback(e=>typeof a==`function`?a(e):typeof a==`number`?a:e,[a]);function d(){M.cancel(l.current)}return(0,R.useEffect)(()=>{let e={};if(t)if(n){e.width=u(t.width);let n=r?`right`:`left`;o===`start`&&(e[n]=t[n]),o===`center`&&(e[n]=t[n]+t.width/2,e.transform=r?`translateX(50%)`:`translateX(-50%)`),o===`end`&&(e[n]=t[n]+t.width,e.transform=`translateX(-100%)`)}else e.height=u(t.height),o===`start`&&(e.top=t.top),o===`center`&&(e.top=t.top+t.height/2,e.transform=`translateY(-50%)`),o===`end`&&(e.top=t.top+t.height,e.transform=`translateY(-100%)`);return d(),l.current=M(()=>{s&&e&&Object.keys(e).every(t=>{let n=e[t],r=s[t];return typeof n==`number`&&typeof r==`number`?Math.round(n)===Math.round(r):n===r})||c(e)}),d},[JSON.stringify(t),n,r,o,u]),{style:s}},B={width:0,height:0,left:0,top:0};function V(e,t,n){return(0,R.useMemo)(()=>{let n=new Map,r=t.get(e[0]?.key)||B,i=r.left+r.width;for(let r=0;r<e.length;r+=1){let{key:a}=e[r],o=t.get(a);o||=t.get(e[r-1]?.key)||B;let s=n.get(a)||{...o};s.right=i-s.left-s.width,n.set(a,s)}return n},[e.map(e=>e.key).join(`_`),t,n])}function H(e,t){let n=R.useRef(e),[,r]=R.useState({});function i(e){let i=typeof e==`function`?e(n.current):e;i!==n.current&&t(i,n.current),n.current=i,r({})}return[n.current,i]}var U=.1,oe=.01,W=20,G=.995**W;function K(e,t){let[n,r]=(0,R.useState)(),[i,a]=(0,R.useState)(0),[o,s]=(0,R.useState)(0),[c,l]=(0,R.useState)(),u=(0,R.useRef)();function d(e){let{screenX:t,screenY:n}=e.touches[0];r({x:t,y:n}),window.clearInterval(u.current)}function f(e){if(!n)return;let{screenX:o,screenY:c}=e.touches[0];r({x:o,y:c});let u=o-n.x,d=c-n.y;t(u,d);let f=Date.now();a(f),s(f-i),l({x:u,y:d})}function p(){if(n&&(r(null),l(null),c)){let e=c.x/o,n=c.y/o;if(Math.max(Math.abs(e),Math.abs(n))<U)return;let r=e,i=n;u.current=window.setInterval(()=>{if(Math.abs(r)<oe&&Math.abs(i)<oe){window.clearInterval(u.current);return}r*=G,i*=G,t(r*W,i*W)},W)}}let m=(0,R.useRef)();function h(e){let{deltaX:n,deltaY:r}=e,i=0,a=Math.abs(n),o=Math.abs(r);a===o?i=m.current===`x`?n:r:a>o?(i=n,m.current=`x`):(i=r,m.current=`y`),t(-i,-i)&&e.preventDefault()}let g=(0,R.useRef)(null);g.current={onTouchStart:d,onTouchMove:f,onTouchEnd:p,onWheel:h},R.useEffect(()=>{function t(e){g.current.onTouchStart(e)}function n(e){g.current.onTouchMove(e)}function r(e){g.current.onTouchEnd(e)}function i(e){g.current.onWheel(e)}return document.addEventListener(`touchmove`,n,{passive:!1}),document.addEventListener(`touchend`,r,{passive:!0}),e.current.addEventListener(`touchstart`,t,{passive:!0}),e.current.addEventListener(`wheel`,i,{passive:!1}),()=>{document.removeEventListener(`touchmove`,n),document.removeEventListener(`touchend`,r)}},[])}function se(e){let[t,n]=(0,R.useState)(0),r=(0,R.useRef)(0),i=(0,R.useRef)();return i.current=e,h(()=>{i.current?.()},[t]),()=>{r.current===t&&(r.current+=1,n(r.current))}}function ce(e){let t=(0,R.useRef)([]),[,n]=(0,R.useState)({}),r=(0,R.useRef)(typeof e==`function`?e():e),i=se(()=>{let e=r.current;t.current.forEach(t=>{e=t(e)}),t.current=[],r.current=e,n({})});function a(e){t.current.push(e),i()}return[r.current,a]}var q={width:0,height:0,left:0,top:0,right:0};function le(e,t,n,r,i,a,{tabs:o,tabPosition:s,rtl:c}){let l,u,d;return[`top`,`bottom`].includes(s)?(l=`width`,u=c?`right`:`left`,d=Math.abs(n)):(l=`height`,u=`top`,d=-n),(0,R.useMemo)(()=>{if(!o.length)return[0,0];let n=o.length,r=n;for(let i=0;i<n;i+=1){let n=e.get(o[i].key)||q;if(Math.floor(n[u]+n[l])>Math.floor(d+t)){r=i-1;break}}let i=0;for(let t=n-1;t>=0;--t)if((e.get(o[t].key)||q)[u]<d){i=t+1;break}return i>r?[0,-1]:[i,r]},[e,t,r,i,a,d,s,o.map(e=>e.key).join(`_`),c])}function ue(e){let t;return e instanceof Map?(t={},e.forEach((e,n)=>{t[n]=e})):t=e,JSON.stringify(t)}var J=`TABS_DQ`;function de(e){return String(e).replace(/"/g,J)}function fe(e,t,n,r){return!(!n||r||e===!1||e===void 0&&(t===!1||t===null))}var pe=R.forwardRef((e,t)=>{let{prefixCls:n,editable:r,locale:i,style:a}=e;return!r||r.showAdd===!1?null:R.createElement(`button`,{ref:t,type:`button`,className:`${n}-nav-add`,style:a,"aria-label":i?.addAriaLabel||`Add tab`,onClick:e=>{r.onEdit(`add`,{event:e})}},r.addIcon||`+`)}),me=R.forwardRef((e,t)=>{let{position:n,prefixCls:r,extra:i}=e;if(!i)return null;let a,o={};return typeof i==`object`&&!R.isValidElement(i)?o=i:o.right=i,n===`right`&&(a=o.right),n===`left`&&(a=o.left),a?R.createElement(`div`,{className:`${r}-extra-content`,ref:t},a):null});function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}var he=R.forwardRef((e,t)=>{let{prefixCls:n,id:r,tabs:i,locale:a,mobile:o,more:s={},style:c,className:l,editable:u,tabBarGutter:d,rtl:f,removeAriaLabel:p,onTabClick:m,getPopupContainer:h,popupClassName:g,popupStyle:_,classNames:y,styles:b}=e,[x,S]=(0,R.useState)(!1),[w,T]=(0,R.useState)(null),{icon:E=`More`}=s,D=`${r}-more-popup`,j=`${n}-dropdown`,M=w===null?null:`${D}-${w}`,N=a?.dropdownAriaLabel;function P(e,t){e.preventDefault(),e.stopPropagation(),u.onEdit(`remove`,{key:t,event:e})}let F=R.createElement(O,{onClick:({key:e,domEvent:t})=>{m(e,t),S(!1)},prefixCls:`${j}-menu`,id:D,tabIndex:-1,role:`listbox`,"aria-activedescendant":M,selectedKeys:[w],"aria-label":N===void 0?`expanded dropdown`:N},i.map(e=>{let{closable:t,disabled:n,closeIcon:i,key:a,label:o}=e,s=fe(t,i,u,n);return R.createElement(A,{key:a,id:`${D}-${a}`,role:`option`,"aria-controls":r&&`${r}-panel-${a}`,disabled:n},R.createElement(`span`,null,o),s&&R.createElement(`button`,{type:`button`,"aria-label":p||`remove`,tabIndex:0,className:v(`${j}-menu-item-remove`,y?.remove),style:b?.remove,onClick:e=>{e.stopPropagation(),P(e,a)}},i||u.removeIcon||`×`))}));function I(e){let t=i.filter(e=>!e.disabled),n=t.findIndex(e=>e.key===w)||0,r=t.length;for(let i=0;i<r;i+=1){n=(n+e+r)%r;let i=t[n];if(!i.disabled){T(i.key);return}}}function ee(e){let{which:t}=e;if(!x){[k.DOWN,k.SPACE,k.ENTER].includes(t)&&(S(!0),e.preventDefault());return}switch(t){case k.UP:I(-1),e.preventDefault();break;case k.DOWN:I(1),e.preventDefault();break;case k.ESC:S(!1);break;case k.SPACE:case k.ENTER:w!==null&&m(w,e);break}}(0,R.useEffect)(()=>{let e=document.getElementById(M);e?.scrollIntoView&&e.scrollIntoView(!1)},[M,w]),(0,R.useEffect)(()=>{x||T(null)},[x]);let L={marginInlineStart:d};i.length||(L.visibility=`hidden`,L.order=1);let te=v(g,{[`${j}-rtl`]:f}),ne=o?null:R.createElement(C,Y({prefixCls:j,overlay:F,visible:i.length?x:!1,onVisibleChange:S,overlayClassName:te,overlayStyle:_,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:h},s),R.createElement(`button`,{type:`button`,className:`${n}-nav-more`,style:L,"aria-haspopup":`listbox`,"aria-controls":D,id:`${r}-more`,"aria-expanded":x,onKeyDown:ee},E));return R.createElement(`div`,{className:v(`${n}-nav-operations`,l),style:c,ref:t},ne,R.createElement(pe,{prefixCls:n,locale:a,editable:u}))}),ge=R.memo(he,(e,t)=>t.tabMoving),_e=e=>{let{prefixCls:t,id:n,active:r,focus:i,tab:{key:a,label:o,disabled:s,closeIcon:c,icon:l},closable:u,renderWrapper:d,removeAriaLabel:f,editable:p,onClick:m,onFocus:h,onBlur:g,onKeyDown:_,onMouseDown:y,onMouseUp:b,styles:x,classNames:S,tabCount:C,currentPosition:w}=e,T=`${t}-tab`,E=fe(u,c,p,s);function D(e){s||m(e)}function O(e){e.preventDefault(),e.stopPropagation(),p.onEdit(`remove`,{key:a,event:e})}let k=R.useMemo(()=>l&&typeof o==`string`?R.createElement(`span`,null,o):o,[o,l]),A=R.useRef(null);R.useEffect(()=>{i&&A.current&&A.current.focus()},[i]);let j=R.createElement(`div`,{key:a,"data-node-key":de(a),className:v(T,S?.item,{[`${T}-with-remove`]:E,[`${T}-active`]:r,[`${T}-disabled`]:s,[`${T}-focus`]:i}),style:x?.item,onClick:D},R.createElement(`div`,{ref:A,role:`tab`,"aria-selected":r,id:n&&`${n}-tab-${a}`,className:`${T}-btn`,"aria-controls":n&&`${n}-panel-${a}`,"aria-disabled":s,tabIndex:s?null:r?0:-1,onClick:e=>{e.stopPropagation(),D(e)},onKeyDown:_,onMouseDown:y,onMouseUp:b,onFocus:h,onBlur:g},i&&R.createElement(`div`,{"aria-live":`polite`,style:{width:0,height:0,position:`absolute`,overflow:`hidden`,opacity:0}},`Tab ${w} of ${C}`),l&&R.createElement(`span`,{className:`${T}-icon`},l),o&&k),E&&R.createElement(`button`,{type:`button`,"aria-label":f||`remove`,tabIndex:r?0:-1,className:v(`${T}-remove`,S?.remove),style:x?.remove,onClick:e=>{e.stopPropagation(),O(e)}},c||p.removeIcon||`×`));return d?d(j):j};function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ve.apply(this,arguments)}var ye=(e,t)=>{let{offsetWidth:n,offsetHeight:r,offsetTop:i,offsetLeft:a}=e,{width:o,height:s,left:c,top:l}=e.getBoundingClientRect();return Math.abs(o-n)<1?[o,s,c-t.left,l-t.top]:[n,r,a,i]},be=e=>{let{offsetWidth:t=0,offsetHeight:n=0}=e.current||{};if(e.current){let{width:n,height:r}=e.current.getBoundingClientRect();if(Math.abs(n-t)<1)return[n,r]}return[t,n]},xe=(e,t)=>e[+!t],Se=R.forwardRef((e,t)=>{let{className:n,style:r,id:i,animated:a,activeKey:s,rtl:c,extra:l,editable:u,locale:d,tabPosition:f,tabBarGutter:p,children:m,onTabClick:h,onTabScroll:g,indicator:_,classNames:y,styles:b}=e,{prefixCls:x,tabs:S}=R.useContext(z),C=(0,R.useRef)(null),T=(0,R.useRef)(null),E=(0,R.useRef)(null),D=(0,R.useRef)(null),O=(0,R.useRef)(null),k=(0,R.useRef)(null),A=(0,R.useRef)(null),j=f===`top`||f===`bottom`,[M,P]=H(0,(e,t)=>{j&&g&&g({direction:e>t?`left`:`right`})}),[F,I]=H(0,(e,t)=>{!j&&g&&g({direction:e>t?`top`:`bottom`})}),[ee,L]=(0,R.useState)([0,0]),[te,ne]=(0,R.useState)([0,0]),[re,ie]=(0,R.useState)([0,0]),[B,U]=(0,R.useState)([0,0]),[oe,W]=ce(new Map),G=V(S,oe,te[0]),q=xe(ee,j),J=xe(te,j),Y=xe(re,j),he=xe(B,j),Se=Math.floor(q)<Math.floor(J+Y),X=Se?q-he:q-Y,Ce=`${x}-nav-operations-hidden`,Z=0,we=0;j&&c?(Z=0,we=Math.max(0,J-X)):(Z=Math.min(0,X-J),we=0);function Te(e){return e<Z?Z:e>we?we:e}let Q=(0,R.useRef)(null),[Ee,De]=(0,R.useState)();function Oe(){De(Date.now())}function ke(){Q.current&&clearTimeout(Q.current)}K(D,(e,t)=>{function n(e,t){e(e=>Te(e+t))}return Se?(j?n(P,e):n(I,t),ke(),Oe(),!0):!1}),(0,R.useEffect)(()=>(ke(),Ee&&(Q.current=setTimeout(()=>{De(0)},100)),ke),[Ee]);let[Ae,je]=le(G,X,j?M:F,J,Y,he,{...e,tabs:S}),Me=N((e=s)=>{let t=G.get(e)||{width:0,height:0,left:0,right:0,top:0};if(j){let e=M;c?t.right<M?e=t.right:t.right+t.width>M+X&&(e=t.right+t.width-X):t.left<-M?e=-t.left:t.left+t.width>-M+X&&(e=-(t.left+t.width-X)),I(0),P(Te(e))}else{let e=F;t.top<-F?e=-t.top:t.top+t.height>-F+X&&(e=-(t.top+t.height-X)),P(0),I(Te(e))}}),[Ne,Pe]=(0,R.useState)(),[Fe,Ie]=(0,R.useState)(!1),$=S.filter(e=>!e.disabled).map(e=>e.key),Le=e=>{let t=$.indexOf(Ne||s),n=$.length,r=(t+e+n)%n,i=$[r];Pe(i)},Re=(e,t)=>{let n=$.indexOf(e),r=S.find(t=>t.key===e);fe(r?.closable,r?.closeIcon,u,r?.disabled)&&(t.preventDefault(),t.stopPropagation(),u.onEdit(`remove`,{key:e,event:t}),n===$.length-1?Le(-1):Le(1))},ze=(e,t)=>{Ie(!0),t.button===1&&Re(e,t)},Be=e=>{let{code:t}=e,n=c&&j,r=$[0],i=$[$.length-1];switch(t){case`ArrowLeft`:j&&Le(n?1:-1);break;case`ArrowRight`:j&&Le(n?-1:1);break;case`ArrowUp`:e.preventDefault(),j||Le(-1);break;case`ArrowDown`:e.preventDefault(),j||Le(1);break;case`Home`:e.preventDefault(),Pe(r);break;case`End`:e.preventDefault(),Pe(i);break;case`Enter`:case`Space`:e.preventDefault(),h(Ne??s,e);break;case`Backspace`:case`Delete`:Re(Ne,e);break}},Ve={};j?Ve.marginInlineStart=p:Ve.marginTop=p;let He=S.map((e,t)=>{let{key:n}=e;return R.createElement(_e,{id:i,prefixCls:x,key:n,tab:e,classNames:{item:y?.item,remove:y?.remove},styles:{item:t===0?b?.item:{...Ve,...b?.item},remove:b?.remove},closable:e.closable,editable:u,active:n===s,focus:n===Ne,renderWrapper:m,removeAriaLabel:d?.removeAriaLabel,tabCount:$.length,currentPosition:t+1,onClick:e=>{h(n,e)},onKeyDown:Be,onFocus:()=>{Fe||Pe(n),Me(n),Oe(),D.current&&(c||(D.current.scrollLeft=0),D.current.scrollTop=0)},onBlur:()=>{Pe(void 0)},onMouseDown:e=>ze(n,e),onMouseUp:()=>{Ie(!1)}})}),Ue=()=>W(()=>{let e=new Map,t=O.current?.getBoundingClientRect();return S.forEach(({key:n})=>{let r=O.current?.querySelector(`[data-node-key="${de(n)}"]`);if(r){let[i,a,o,s]=ye(r,t);e.set(n,{width:i,height:a,left:o,top:s})}}),e});(0,R.useEffect)(()=>{Ue()},[S.map(e=>e.key).join(`_`)]);let We=se(()=>{let e=be(C),t=be(T),n=be(E);L([e[0]-t[0]-n[0],e[1]-t[1]-n[1]]);let r=be(A);ie(r);let i=be(k);U(i);let a=be(O);ne([a[0]-r[0],a[1]-r[1]]),Ue()}),Ge=S.slice(0,Ae),Ke=S.slice(je+1),qe=[...Ge,...Ke],Je=G.get(s),{style:Ye}=ae({activeTabOffset:Je,horizontal:j,indicator:_,rtl:c});(0,R.useEffect)(()=>{Me()},[s,Z,we,ue(Je),ue(G),j]),(0,R.useEffect)(()=>{We()},[c]);let Xe=!!qe.length,Ze=`${x}-nav-wrap`,Qe,$e,et,tt;return j?c?($e=M>0,Qe=M!==we):(Qe=M<0,$e=M!==Z):(et=F<0,tt=F!==Z),R.createElement(o,{onResize:We},R.createElement(`div`,{ref:w(t,C),role:`tablist`,"aria-orientation":j?`horizontal`:`vertical`,className:v(`${x}-nav`,n,y?.header),style:{...b?.header,...r},onKeyDown:()=>{Oe()}},R.createElement(me,{ref:T,position:`left`,extra:l,prefixCls:x}),R.createElement(o,{onResize:We},R.createElement(`div`,{className:v(Ze,{[`${Ze}-ping-left`]:Qe,[`${Ze}-ping-right`]:$e,[`${Ze}-ping-top`]:et,[`${Ze}-ping-bottom`]:tt}),ref:D},R.createElement(o,{onResize:We},R.createElement(`div`,{ref:O,className:`${x}-nav-list`,style:{transform:`translate(${M}px, ${F}px)`,transition:Ee?`none`:void 0}},He,R.createElement(pe,{ref:A,prefixCls:x,locale:d,editable:u,style:{...He.length===0?void 0:Ve,visibility:Xe?`hidden`:null}}),R.createElement(`div`,{className:v(`${x}-ink-bar`,y?.indicator,{[`${x}-ink-bar-animated`]:a.inkBar}),style:{...Ye,...b?.indicator}}))))),R.createElement(ge,ve({},e,{removeAriaLabel:d?.removeAriaLabel,ref:k,prefixCls:x,tabs:qe,className:!Xe&&Ce,popupStyle:b?.popup,tabMoving:!!Ee})),R.createElement(me,{ref:E,position:`right`,extra:l,prefixCls:x})))}),X=({renderTabBar:e,...t})=>e?e(t,Se):R.createElement(Se,t),Ce=R.forwardRef((e,t)=>{let{prefixCls:n,className:r,style:i,id:a,active:o,tabKey:s,children:c}=e,l=R.Children.count(c)>0;return R.createElement(`div`,{id:a&&`${a}-panel-${s}`,role:`tabpanel`,tabIndex:o&&l?0:-1,"aria-labelledby":a&&`${a}-tab-${s}`,"aria-hidden":!o,style:i,className:v(n,o&&`${n}-active`,r),ref:t},c)});function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z.apply(this,arguments)}var we=e=>{let{id:t,activeKey:n,animated:r,tabPosition:i,destroyOnHidden:a,bodyStyle:o,bodyClassName:s,contentStyle:c,contentClassName:l}=e,{prefixCls:u,tabs:d}=R.useContext(z),p=r.tabPane,m=`${u}-body`,h=`${u}-content`;return R.createElement(`div`,{className:v(`${m}-holder`)},R.createElement(`div`,{className:v(m,`${m}-${i}`,{[`${m}-animated`]:p},s),style:o},d.map(e=>{let{key:i,forceRender:o,style:s,className:u,destroyOnHidden:d,...m}=e,g=i===n;return R.createElement(f,Z({key:i,visible:g,forceRender:o,removeOnLeave:!!(a??d),leavedClassName:`${h}-hidden`},r.tabPaneMotion),({style:e,className:n},r)=>R.createElement(Ce,Z({},m,{prefixCls:h,id:t,tabKey:i,animated:p,active:g,style:{...c,...s,...e},className:v(l,u,n),ref:r})))})))};function Te(e={inkBar:!0,tabPane:!1}){let t;return t=e===!1?{inkBar:!1,tabPane:!1}:e===!0?{inkBar:!0,tabPane:!1}:{inkBar:!0,...typeof e==`object`?e:{}},t.tabPaneMotion&&t.tabPane===void 0&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q.apply(this,arguments)}var Ee=0,De=R.forwardRef((e,t)=>{let{id:n,prefixCls:r=`rc-tabs`,className:i,items:a,direction:o,activeKey:s,defaultActiveKey:c,editable:l,animated:u,tabPosition:d=`top`,tabBarGutter:f,tabBarStyle:p,tabBarExtraContent:m,locale:h,more:g,destroyOnHidden:_,renderTabBar:y,onChange:b,onTabClick:S,onTabScroll:C,getPopupContainer:w,popupClassName:T,indicator:E,classNames:D,styles:O,...k}=e,A=R.useMemo(()=>(a||[]).filter(e=>e&&typeof e==`object`&&`key`in e),[a]),j=o===`rtl`,M=Te(u),[N,P]=(0,R.useState)(!1);(0,R.useEffect)(()=>{P(x())},[]);let[F,ee]=I(c??A[0]?.key,s),[L,te]=(0,R.useState)(()=>A.findIndex(e=>e.key===F));(0,R.useEffect)(()=>{let e=A.findIndex(e=>e.key===F);e===-1&&(e=Math.max(0,Math.min(L,A.length-1)),ee(A[e]?.key)),te(e)},[A.map(e=>e.key).join(`_`),F,L]);let[ne,re]=I(null,n);(0,R.useEffect)(()=>{n||(re(`rc-tabs-${Ee}`),Ee+=1)},[]);function ie(e,t){S?.(e,t);let n=e!==F;ee(e),n&&b?.(e)}let ae={id:ne,activeKey:F,animated:M,tabPosition:d,rtl:j,mobile:N},B={...ae,editable:l,locale:h,more:g,tabBarGutter:f,onTabClick:ie,onTabScroll:C,extra:m,style:p,getPopupContainer:w,popupClassName:v(T,D?.popup),indicator:E,styles:O,classNames:D},V=R.useMemo(()=>({tabs:A,prefixCls:r}),[A,r]);return R.createElement(z.Provider,{value:V},R.createElement(`div`,Q({ref:t,id:n,className:v(r,`${r}-${d}`,{[`${r}-mobile`]:N,[`${r}-editable`]:l,[`${r}-rtl`]:j},i)},k),R.createElement(X,Q({},B,{renderTabBar:y})),R.createElement(we,Q({destroyOnHidden:_},ae,{bodyStyle:O?.body,bodyClassName:D?.body,contentStyle:O?.content,contentClassName:D?.content,animated:M}))))}),Oe={motionAppear:!1,motionEnter:!0,motionLeave:!0};function ke(e,n={inkBar:!0,tabPane:!1}){let r;return r=n===!1?{inkBar:!1,tabPane:!1}:n===!0?{inkBar:!0,tabPane:!0}:{inkBar:!0,...a(n)?n:{}},r.tabPane&&(r.tabPaneMotion={...Oe,motionName:t(e,`switch`)}),r}function Ae(e){return e.filter(e=>e)}function je(e,t){return e?e.map(e=>({...e,destroyOnHidden:e.destroyOnHidden??e.destroyInactiveTabPane})):Ae(s(t).map(e=>{if(R.isValidElement(e)){let{key:t,props:n}=e,{tab:r,...i}=n||{};return{key:String(t),...i,label:r}}return null}))}var Me=e=>{let{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:`none`,"&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:`absolute`,transition:`none`,inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[L(e,`slide-up`),L(e,`slide-down`)]]},Ne=e=>{let{componentCls:t,tabsCardPadding:n,cardBg:r,cardGutter:i,colorBorderSecondary:a,itemSelectedColor:o}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:n,background:r,border:`${p(e.lineWidth)} ${e.lineType} ${a}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:o,background:e.colorBgContainer},[`${t}-tab-focus:has(${t}-tab-btn:focus-visible)`]:D(e,-3),[`& ${t}-tab${t}-tab-focus ${t}-tab-btn:focus-visible`]:{outline:`none`},[`${t}-ink-bar`]:{visibility:`hidden`}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:p(i)}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)} 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)}`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:p(i)}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${p(e.borderRadiusLG)} 0 0 ${p(e.borderRadiusLG)}`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)} 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},Pe=e=>{let{antCls:t,componentCls:i,itemHoverColor:a,dropdownEdgeChildVerticalPadding:o}=e;return{[`${i}-dropdown`]:{...S(e),position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:`block`,"&-hidden":{display:`none`},[`&${t}-slide-down-enter${t}-slide-down-enter-active${i}-dropdown-placement-bottomLeft,
&${t}-slide-down-appear${t}-slide-down-appear-active${i}-dropdown-placement-bottomLeft,
&${t}-slide-down-enter${t}-slide-down-enter-active${i}-dropdown-placement-bottom,
&${t}-slide-down-appear${t}-slide-down-appear-active${i}-dropdown-placement-bottom,
&${t}-slide-down-enter${t}-slide-down-enter-active${i}-dropdown-placement-bottomRight,
&${t}-slide-down-appear${t}-slide-down-appear-active${i}-dropdown-placement-bottomRight`]:{animationName:l},[`&${t}-slide-up-enter${t}-slide-up-enter-active${i}-dropdown-placement-topLeft,
&${t}-slide-up-appear${t}-slide-up-appear-active${i}-dropdown-placement-topLeft,
&${t}-slide-up-enter${t}-slide-up-enter-active${i}-dropdown-placement-top,
&${t}-slide-up-appear${t}-slide-up-appear-active${i}-dropdown-placement-top,
&${t}-slide-up-enter${t}-slide-up-enter-active${i}-dropdown-placement-topRight,
&${t}-slide-up-appear${t}-slide-up-appear-active${i}-dropdown-placement-topRight`]:{animationName:r},[`&${t}-slide-down-leave${t}-slide-down-leave-active${i}-dropdown-placement-bottomLeft,
&${t}-slide-down-leave${t}-slide-down-leave-active${i}-dropdown-placement-bottom,
&${t}-slide-down-leave${t}-slide-down-leave-active${i}-dropdown-placement-bottomRight`]:{animationName:E},[`&${t}-slide-up-leave${t}-slide-up-leave-active${i}-dropdown-placement-topLeft,
&${t}-slide-up-leave${t}-slide-up-leave-active${i}-dropdown-placement-top,
&${t}-slide-up-leave${t}-slide-up-leave-active${i}-dropdown-placement-topRight`]:{animationName:_},[`${i}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${p(o)} 0`,overflowX:`hidden`,overflowY:`auto`,textAlign:{_skip_check_:!0,value:`left`},listStyleType:`none`,backgroundColor:e.colorBgContainer,backgroundClip:`padding-box`,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary,"&-item":{...n,display:`flex`,alignItems:`center`,minWidth:e.tabsDropdownWidth,margin:0,padding:`${p(e.paddingXXS)} ${p(e.paddingSM)}`,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:`nowrap`},"&-remove":{flex:`none`,marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorIcon,fontSize:e.fontSizeSM,background:`transparent`,border:0,cursor:`pointer`,"&:hover":{color:a}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:`transparent`,cursor:`not-allowed`}}}}}}},Fe=e=>{let{componentCls:t,margin:n,colorBorderSecondary:r,horizontalMargin:i,verticalItemPadding:a,verticalItemMargin:o,motionDurationSlow:s,calc:c}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:`column`,[`> ${t}-nav, > div > ${t}-nav`]:{margin:i,"&::before":{position:`absolute`,right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${p(e.lineWidth)} ${e.lineType} ${r}`,content:`''`},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:[`width`,`left`,`right`].map(e=>`${e} ${s}`).join(`, `)}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav,
> div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-body-holder, > div > ${t}-body-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:`column`,minWidth:c(e.controlHeight).mul(1.25).equal(),[`${t}-tab`]:{padding:a,textAlign:`center`},[`${t}-tab + ${t}-tab`]:{margin:o},[`${t}-nav-wrap`]:{flexDirection:`column`,"&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:[`height`,`top`].map(e=>`${e} ${s}`).join(`, `)}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:`1 0 auto`,flexDirection:`column`}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-body-holder, > div > ${t}-body-holder`]:{marginLeft:{_skip_check_:!0,value:p(c(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${p(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-body > ${t}-content`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-body-holder, > div > ${t}-body-holder`]:{order:0,marginRight:{_skip_check_:!0,value:c(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${p(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-body > ${t}-content`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},Ie=e=>{let{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,cardHeightSM:i,cardHeightLG:a,horizontalItemPaddingSM:o,horizontalItemPaddingLG:s}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:o,fontSize:e.titleFontSizeSM}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:s,fontSize:e.titleFontSizeLG,lineHeight:e.lineHeightLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:n},[`${t}-nav-add`]:{minWidth:i,minHeight:i}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${p(e.borderRadius)} ${p(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${p(e.borderRadius)} ${p(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${p(e.borderRadius)} ${p(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${p(e.borderRadius)} 0 0 ${p(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r},[`${t}-nav-add`]:{minWidth:a,minHeight:a}}}}}},$=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:i,tabsHorizontalItemMargin:a,horizontalItemPadding:o,itemSelectedColor:s,itemColor:l}=e,u=`${t}-tab`;return{[u]:{position:`relative`,WebkitTouchCallout:`none`,WebkitTapHighlightColor:`transparent`,display:`inline-flex`,alignItems:`center`,padding:o,fontSize:e.titleFontSize,background:`transparent`,border:0,outline:`none`,cursor:`pointer`,color:l,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:`none`,transition:`all ${e.motionDurationSlow}`,[`${u}-icon:not(:last-child)`]:{marginInlineEnd:e.marginSM}},"&-remove":{flex:`none`,lineHeight:1,marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorIcon,fontSize:e.fontSizeSM,background:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading},...c(e)},"&:hover":{color:r},[`&${u}-active ${u}-btn`]:{color:s},[`&${u}-focus ${u}-btn:focus-visible`]:D(e),[`&${u}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`},[`&${u}-disabled ${u}-btn, &${u}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${u}-remove ${i}`]:{margin:0,verticalAlign:`middle`},[`${i}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${u} + ${u}`]:{margin:{_skip_check_:!0,value:a}}}},Le=e=>{let{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:i,calc:a}=e;return{[`${t}-rtl`]:{direction:`rtl`,[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:n},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:e.marginSM}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:e.marginXS},marginLeft:{_skip_check_:!0,value:a(e.marginXXS).mul(-1).equal()},[r]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-body-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-body-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:i},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:`rtl`},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:`right`}}}}},Re=e=>{let{componentCls:t,tabsCardPadding:n,cardHeight:r,cardGutter:i,itemHoverColor:a,itemActiveColor:o,colorBorderSecondary:s}=e;return{[t]:{...S(e),display:`flex`,[`> ${t}-nav, > div > ${t}-nav`]:{position:`relative`,display:`flex`,flex:`none`,alignItems:`center`,[`${t}-nav-wrap`]:{position:`relative`,display:`flex`,flex:`auto`,alignSelf:`stretch`,overflow:`hidden`,whiteSpace:`nowrap`,transform:`translate(0)`,"&::before, &::after":{position:`absolute`,zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:`''`,pointerEvents:`none`}},[`${t}-nav-list`]:{position:`relative`,display:`flex`,transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:`flex`,alignSelf:`stretch`},[`${t}-nav-operations-hidden`]:{position:`absolute`,visibility:`hidden`,pointerEvents:`none`},[`${t}-nav-more`]:{position:`relative`,padding:n,background:`transparent`,border:0,color:e.colorText,"&::after":{position:`absolute`,right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:`translateY(100%)`,content:`''`}},[`${t}-nav-add`]:{minWidth:r,minHeight:r,marginLeft:{_skip_check_:!0,value:i},background:`transparent`,border:`${p(e.lineWidth)} ${e.lineType} ${s}`,borderRadius:`${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)} 0 0`,outline:`none`,cursor:`pointer`,color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:o},...c(e,-3)}},[`${t}-extra-content`]:{flex:`none`},[`${t}-ink-bar`]:{position:`absolute`,background:e.inkBarColor,pointerEvents:`none`},...$(e),[`${t}-body`]:{position:`relative`,width:`100%`},[`${t}-body-holder`]:{flex:`auto`,minWidth:0,minHeight:0},[`${t}-content`]:{...c(e),"&-hidden":{display:`none`}}},[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping']) > ${t}-nav-list`]:{margin:`auto`}}}}}},ze=y(`Tabs`,e=>{let t=P(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${p(e.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${p(e.horizontalItemGutter)}`});return[Ie(t),Le(t),Fe(t),Pe(t),Ne(t),Re(t),Me(t)]},e=>{let{cardHeight:t,cardHeightSM:n,cardHeightLG:r,controlHeight:i,controlHeightLG:a}=e,o=t||a,s=n||i,c=r||a+8;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:o,cardHeightSM:s,cardHeightLG:c,cardPadding:`${(o-e.fontHeight)/2-e.lineWidth}px ${e.padding}px`,cardPaddingSM:`${(s-e.fontHeight)/2-e.lineWidth}px ${e.paddingXS}px`,cardPaddingLG:`${(c-e.fontHeightLG)/2-e.lineWidth}px ${e.padding}px`,titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:`0 0 ${e.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:``,horizontalItemMarginRTL:``,horizontalItemPadding:`${e.paddingSM}px 0`,horizontalItemPaddingSM:`${e.paddingXS}px 0`,horizontalItemPaddingLG:`${e.padding}px 0`,verticalItemPadding:`${e.paddingXS}px ${e.paddingLG}px`,verticalItemMargin:`${e.margin}px 0 0 0`,itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}}),Be=()=>null,Ve=R.forwardRef((e,t)=>{let{type:n,className:r,rootClassName:i,size:a,onEdit:o,hideAdd:s,centered:c,addIcon:l,removeIcon:u,moreIcon:f,more:p,popupClassName:h,children:_,items:y,animated:b,style:x,indicatorSize:S,indicator:C,classNames:w,styles:E,destroyInactiveTabPane:D,destroyOnHidden:O,tabPlacement:k,tabPosition:A,...j}=e,{prefixCls:M}=j,{getPrefixCls:N,direction:P,getPopupContainer:I,className:L,style:ne,classNames:z,styles:ae}=te(`tabs`),{tabs:B}=R.useContext(d),V=N(`tabs`,M),H=ee(V),[U,oe]=ze(V,H),W=R.useRef(null);R.useImperativeHandle(t,()=>({nativeElement:W.current}));let G;n===`editable-card`&&(G={onEdit:(e,{key:t,event:n})=>{o?.(e===`add`?n:t,e)},removeIcon:u??B?.removeIcon??R.createElement(re,null),addIcon:(l??B?.addIcon)||R.createElement(ie,null),showAdd:s!==!0});let K=N(),se=m(a),ce=je(y,_),q=ke(V,b),le={align:C?.align??B?.indicator?.align,size:C?.size??S??B?.indicator?.size??B?.indicatorSize},ue=R.useMemo(()=>{let e=k??A??void 0,t=P===`rtl`;switch(e){case`start`:return t?`right`:`left`;case`end`:return t?`left`:`right`;default:return e}},[k,A,P]),J={...e,size:se,tabPlacement:ue,items:ce},de=g(ne),fe=g(x),[pe,me]=F([z,w],[ae,de,E,fe],{props:J},{popup:{_default:`root`}});return R.createElement(De,{ref:W,direction:P,getPopupContainer:I,...j,items:ce,className:v({[`${V}-large`]:se===`large`,[`${V}-small`]:se===`small`,[`${V}-card`]:[`card`,`editable-card`].includes(n),[`${V}-editable-card`]:n===`editable-card`,[`${V}-centered`]:c},L,r,i,pe.root,U,oe,H),classNames:{...pe,popup:v(h,U,oe,H,pe.popup?.root)},styles:me,style:me.root,editable:G,more:{icon:B?.more?.icon??B?.moreIcon??f??R.createElement(T,null),transitionName:`${K}-slide-up`,...p},prefixCls:V,animated:q,indicator:le,destroyOnHidden:O??D,tabPosition:ue})});Ve.TabPane=Be;var He=({prefixCls:e,className:t,hoverable:n=!0,...r})=>{let{getPrefixCls:i}=R.useContext(d),a=i(`card`,e),o=v(`${a}-grid`,t,{[`${a}-grid-hoverable`]:n});return R.createElement(`div`,{...r,className:o})},Ue=e=>{let{antCls:t,componentCls:r,headerHeight:i,headerPadding:a,tabsMarginBottom:o}=e;return{display:`flex`,justifyContent:`center`,flexDirection:`column`,minHeight:i,marginBottom:-1,padding:`0 ${p(a)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${p(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)} 0 0`,...u(),"&-wrapper":{width:`100%`,display:`flex`,alignItems:`center`},"&-title":{display:`inline-block`,flex:1,...n,[`
> ${r}-typography,
> ${r}-typography-edit-content
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}},[`${t}-tabs-top`]:{clear:`both`,marginBottom:o,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,"&-bar":{borderBottom:`${p(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}}},We=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:i}=e;return{width:`33.33%`,padding:t,border:0,borderRadius:0,boxShadow:`
${p(i)} 0 0 0 ${n},
0 ${p(i)} 0 0 ${n},
${p(i)} ${p(i)} 0 0 ${n},
${p(i)} 0 0 0 ${n} inset,
0 ${p(i)} 0 0 ${n} inset;
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:`relative`,zIndex:1,boxShadow:r}}},Ge=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:r,cardActionsIconSize:i,colorBorderSecondary:a,actionsBg:o}=e;return{margin:0,padding:0,listStyle:`none`,background:o,borderTop:`${p(e.lineWidth)} ${e.lineType} ${a}`,display:`flex`,borderRadius:`0 0 ${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)}`,...u(),"& > li":{margin:r,color:e.colorTextDescription,textAlign:`center`,"> span":{position:`relative`,display:`block`,minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,"&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:`inline-block`,width:`100%`,color:e.colorIcon,lineHeight:p(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:p(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${p(e.lineWidth)} ${e.lineType} ${a}`}}}},Ke=e=>({margin:`${p(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:`flex`,...u(),"&-avatar":{paddingInlineEnd:e.padding},"&-section":{overflow:`hidden`,flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,...n},"&-description":{color:e.colorTextDescription}}),qe=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:r,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${p(r)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${p(e.padding)} ${p(i)}`}}},Je=e=>{let{componentCls:t}=e;return{overflow:`hidden`,[`${t}-body`]:{userSelect:`none`}}},Ye=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:r,colorBorderSecondary:i,boxShadowTertiary:a,bodyPadding:o,extraColor:s,motionDurationMid:c}=e;return{[t]:{...S(e),position:`relative`,background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:a},[`${t}-head`]:Ue(e),[`${t}-extra`]:{marginInlineStart:`auto`,color:s,fontWeight:`normal`,fontSize:e.fontSize},[`${t}-body`]:{padding:o,borderRadius:`0 0 ${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)}`,"&:first-child":{borderStartStartRadius:e.borderRadiusLG,borderStartEndRadius:e.borderRadiusLG},"&:not(:last-child)":{borderEndStartRadius:0,borderEndEndRadius:0}},[`${t}-grid`]:We(e),[`${t}-cover`]:{"> *":{display:`block`,width:`100%`,borderRadius:`${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:Ge(e),[`${t}-meta`]:Ke(e)},[`${t}-bordered`]:{border:`${p(e.lineWidth)} ${e.lineType} ${i}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:`pointer`,transition:[`box-shadow`,`border-color`].map(e=>`${e} ${c}`).join(`, `),"&:hover":{borderColor:`transparent`,boxShadow:n}},[`${t}-contain-grid`]:{borderRadius:`${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)} 0 0 `,[`&:not(:has(> ${t}-head))`]:{borderRadius:0},[`${t}-body`]:{display:`flex`,flexWrap:`wrap`},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:r}}},[`${t}-type-inner`]:qe(e),[`${t}-loading`]:Je(e),[`${t}-rtl`]:{direction:`rtl`}}},Xe=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:r,headerHeightSM:i,headerFontSizeSM:a}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${p(r)}`,fontSize:a,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:`flex`,alignItems:`center`}}}}},Ze=y(`Card`,e=>{let t=P(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[Ye(t),Xe(t)]},e=>({headerBg:`transparent`,headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,headerHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:e.bodyPadding??e.paddingLG,headerPadding:e.headerPadding??e.paddingLG})),Qe=e=>{let{actionClasses:t,actions:n=[],actionStyle:r}=e;return R.createElement(`ul`,{className:t,style:r},n.map((e,t)=>{let r=`action-${t}`;return R.createElement(`li`,{style:{width:`${100/n.length}%`},key:r},R.createElement(`span`,null,e))}))},$e=R.forwardRef((e,t)=>{let{prefixCls:n,className:r,rootClassName:i,style:a,extra:o,headStyle:c={},bodyStyle:l={},title:u,loading:d,bordered:f,variant:p,size:h,type:_,cover:y,actions:x,tabList:S,children:C,activeTabKey:w,defaultActiveTabKey:T,tabBarExtraContent:E,hoverable:D,tabProps:O={},classNames:k,styles:A,...M}=e,{getPrefixCls:N,direction:P,className:I,style:ee,classNames:L,styles:re}=te(`card`),[ie]=j(`card`,p,f),z=m(h),ae={...e,size:z,variant:ie},B=g(ee),V=g(a),[H,U]=F([L,k],[re,B,A,V],{props:ae}),oe=t=>{e.onTabChange?.(t)},W=R.useMemo(()=>s(C),[C]),G=R.useMemo(()=>W.some(e=>R.isValidElement(e)&&e.type===He),[W]),K=N(`card`,n),[se,ce]=Ze(K),q=R.createElement(ne,{loading:!0,active:!0,paragraph:{rows:4},title:!1},C),le=w!==void 0,ue={...O,[le?`activeKey`:`defaultActiveKey`]:le?w:T,tabBarExtraContent:E},J,de=z===`small`?z:`large`,fe=S?R.createElement(Ve,{size:de,...ue,className:`${K}-head-tabs`,onChange:oe,items:S.map(({tab:e,...t})=>({label:e,...t}))}):null;if(u||o||fe){let e=v(`${K}-head`,H.header),t=v(`${K}-head-title`,H.title),n=v(`${K}-extra`,H.extra),r={...c,...U.header};J=R.createElement(`div`,{className:e,style:r},R.createElement(`div`,{className:`${K}-head-wrapper`},u&&R.createElement(`div`,{className:t,style:U.title},u),o&&R.createElement(`div`,{className:n,style:U.extra},o)),fe)}let pe=v(`${K}-cover`,H.cover),me=y?R.createElement(`div`,{className:pe,style:U.cover},y):null,Y=v(`${K}-body`,H.body),he={...l,...U.body},ge=d||W.length?R.createElement(`div`,{className:Y,style:he},d?q:C):null,_e=v(`${K}-actions`,H.actions),ve=x?.length?R.createElement(Qe,{actionClasses:_e,actionStyle:U.actions,actions:x}):null,ye=b(M,[`onTabChange`]),be=v(K,I,{[`${K}-loading`]:d,[`${K}-bordered`]:ie!==`borderless`,[`${K}-hoverable`]:D,[`${K}-contain-grid`]:G,[`${K}-contain-tabs`]:S?.length,[`${K}-small`]:z===`small`,[`${K}-type-${_}`]:!!_,[`${K}-rtl`]:P===`rtl`},r,i,se,ce,H.root),xe={...U.root};return R.createElement(`div`,{ref:t,...ye,className:be,style:xe},J,me,ge,ve)}),et=e=>{let{prefixCls:t,className:n,avatar:r,title:i,description:a,style:o,classNames:s,styles:c,...l}=e,{getPrefixCls:u,className:d,style:f,classNames:p,styles:m}=te(`cardMeta`),h=`${u(`card`,t)}-meta`,_=g(f),y=g(o),[b,x]=F([p,s],[m,_,c,y],{props:e}),S=v(h,n,d,b.root),C={...x.root},w=v(`${h}-avatar`,b.avatar),T=v(`${h}-title`,b.title),E=v(`${h}-description`,b.description),D=v(`${h}-section`,b.section),O=r?R.createElement(`div`,{className:w,style:x.avatar},r):null,k=i?R.createElement(`div`,{className:T,style:x.title},i):null,A=a?R.createElement(`div`,{className:E,style:x.description},a):null,j=k||A?R.createElement(`div`,{className:D,style:x.section},k,A):null;return R.createElement(`div`,{...l,className:S,style:C},O,j)},tt=$e;tt.Grid=He,tt.Meta=et;export{Ve as n,tt as t};