Files
2026-07-13 15:23:29 +08:00

1 line
19 KiB
JavaScript

import{$ as e,Bt as t,Ct as n,D as r,Et as i,F as a,J as o,Ln as s,Lt as c,Or as l,Rt as u,Sn as d,Sr as f,St as p,Tr as m,Vn as ee,Y as te,Zt as ne,_n as re,an as h,cn as ie,ct as g,dn as ae,en as _,fr as oe,hn as se,it as ce,mn as v,or as le,sn as ue,st as y,vn as b,wt as de,xn as fe,xt as x}from"./jsx-runtime-NwRKtVrk.js";import{i as pe,n as me}from"./ColorPresets-BBbJffTn.js";var S=l(m()),he=S.createContext(void 0),ge=e=>{let{getPrefixCls:t,direction:n}=S.useContext(ue),{prefixCls:r,size:i,className:a,...o}=e,s=t(`btn-group`,r),[,,c]=de(),l=S.useMemo(()=>{switch(i){case`large`:return`lg`;case`small`:return`sm`;default:return``}},[i]),u=f(s,{[`${s}-${l}`]:l,[`${s}-rtl`]:n===`rtl`},a,c);return S.createElement(he.Provider,{value:i},S.createElement(`div`,{...o,className:u}))},C=/^[\u4E00-\u9FA5]{2}$/,w=C.test.bind(C);function T(e){return e===`danger`?{danger:!0}:{type:e}}function E(e){return e===`text`||e===`link`}function _e(e,t,n,r){if(!re(e))return;let i=t?` `:``;return!b(e)&&!v(e)&&b(e.type)&&w(e.props.children)?y(e,e=>{let t=f(e.className,r)||void 0,a={...n,...e.style};return{...e,children:e.children.split(``).join(i),className:t,style:a}}):b(e)?S.createElement(`span`,{className:r,style:n},w(e)?e.split(``).join(i):e):g(e)?S.createElement(`span`,{className:r,style:n},e):y(e,e=>({...e,className:f(e.className,r)||void 0,style:{...e.style,...n}}))}function ve(e,t,n,r){let i=!1,a=[];return S.Children.forEach(e,e=>{let t=b(e)||v(e);if(i&&t){let t=a.length-1;a[t]=`${a[t]}${e}`}else a.push(e);i=t}),S.Children.map(a,e=>_e(e,t,n,r))}[`default`,`primary`,`danger`].concat(fe(u));var ye=(0,S.forwardRef)((e,t)=>{let{className:n,style:r,children:i,prefixCls:a}=e,o=f(`${a}-icon`,n);return S.createElement(`span`,{ref:t,className:o,style:r},i)}),D=(0,S.forwardRef)((t,n)=>{let{prefixCls:r,className:i,style:a,iconClassName:o}=t,s=f(`${r}-loading-icon`,i);return S.createElement(ye,{prefixCls:r,className:s,style:a,ref:n},S.createElement(e,{className:o}))}),O=()=>({width:0,opacity:0,transform:`scale(0)`}),k=e=>({width:e.scrollWidth,opacity:1,transform:`scale(1)`}),be=e=>{let{prefixCls:t,loading:n,existIcon:r,className:i,style:a,mount:o}=e,s=!!n;return r?S.createElement(D,{prefixCls:t,className:i,style:a}):S.createElement(d,{visible:s,motionName:`${t}-loading-icon-motion`,motionAppear:!o,motionEnter:!o,motionLeave:!o,removeOnLeave:!0,onAppearStart:O,onAppearActive:k,onEnterStart:O,onEnterActive:k,onLeaveStart:k,onLeaveActive:O},({className:e,style:n},r)=>{let o={...a,...n};return S.createElement(D,{prefixCls:t,className:f(i,e),style:o,ref:r})})},A=()=>({"@media (prefers-reduced-motion: reduce)":{transition:`none`,animation:`none`}}),j=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),xe=e=>{let{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:i,colorErrorHover:a}=e;return{[`${t}-group`]:[{position:`relative`,display:`inline-flex`,[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:`relative`,zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},j(`${t}-primary`,i),j(`${t}-danger`,a)]}},M=e=>{let{paddingInline:n,onlyIconSize:r,borderColorDisabled:i}=e;return t(e,{buttonPaddingHorizontal:n,buttonPaddingVertical:0,buttonIconOnlyFontSize:r,colorBorderDisabled:i})},N=e=>{let t=e.contentFontSize??e.fontSize,n=e.contentFontSizeSM??e.fontSize,r=e.contentFontSizeLG??e.fontSizeLG,o=e.contentLineHeight??c(t),s=e.contentLineHeightSM??c(n),l=e.contentLineHeightLG??c(r),d=me(new a(e.colorBgSolid),`#fff`)?`#000`:`#fff`,f=u.reduce((t,n)=>({...t,[`${n}ShadowColor`]:`0 ${h(e.controlOutlineWidth)} 0 ${i(e[`${n}1`],e.colorBgContainer)}`}),{}),p=e.colorBgContainerDisabled,m=e.colorBgContainerDisabled;return{...f,fontWeight:400,iconGap:e.marginXS,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorderDisabled,defaultGhostColor:e.colorBgContainer,ghostBg:`transparent`,defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:`inherit`,onlyIconSizeSM:`inherit`,onlyIconSizeLG:`inherit`,groupBorderColor:e.colorPrimaryHover,linkHoverBg:`transparent`,textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:d,contentFontSize:t,contentFontSizeSM:n,contentFontSizeLG:r,contentLineHeight:o,contentLineHeightSM:s,contentLineHeightLG:l,paddingBlock:Math.max((e.controlHeight-t*o)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-n*s)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-r*l)/2-e.lineWidth,0),defaultBgDisabled:p,dashedBgDisabled:m}},Se=e=>{let{componentCls:t,antCls:n,lineWidth:r}=e,[i,a]=x(n,`btn`);return{[t]:[{[i(`border-width`)]:r,[i(`border-color`)]:`#000`,[i(`border-color-hover`)]:a(`border-color`),[i(`border-color-active`)]:a(`border-color`),[i(`border-color-disabled`)]:a(`border-color`),[i(`border-style`)]:`solid`,[i(`text-color`)]:`#000`,[i(`text-color-hover`)]:a(`text-color`),[i(`text-color-active`)]:a(`text-color`),[i(`text-color-disabled`)]:a(`text-color`),[i(`bg-color`)]:`#ddd`,[i(`bg-color-hover`)]:a(`bg-color`),[i(`bg-color-active`)]:a(`bg-color`),[i(`bg-color-disabled`)]:e.colorBgContainerDisabled,[i(`bg-color-container`)]:e.colorBgContainer,[i(`shadow`)]:`none`},{border:[a(`border-width`),a(`border-style`),a(`border-color`)].join(` `),color:a(`text-color`),backgroundColor:a(`bg-color`),[`&:not(:disabled):not(${t}-disabled)`]:{"&:hover":{border:[a(`border-width`),a(`border-style`),a(`border-color-hover`)].join(` `),color:a(`text-color-hover`),backgroundColor:a(`bg-color-hover`)},"&:active":{border:[a(`border-width`),a(`border-style`),a(`border-color-active`)].join(` `),color:a(`text-color-active`),backgroundColor:a(`bg-color-active`)}}},{[`&${t}-variant-solid`]:{[i(`solid-bg-color`)]:a(`color-base`),[i(`solid-bg-color-hover`)]:a(`color-hover`),[i(`solid-bg-color-active`)]:a(`color-active`),[i(`border-color`)]:`transparent`,[i(`text-color`)]:e.colorTextLightSolid,[i(`bg-color`)]:a(`solid-bg-color`),[i(`bg-color-hover`)]:a(`solid-bg-color-hover`),[i(`bg-color-active`)]:a(`solid-bg-color-active`),boxShadow:a(`shadow`)},[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[i(`border-color`)]:a(`color-base`),[i(`border-color-hover`)]:a(`color-hover`),[i(`border-color-active`)]:a(`color-active`),[i(`bg-color`)]:a(`bg-color-container`),[i(`text-color`)]:a(`color-base`),[i(`text-color-hover`)]:a(`color-hover`),[i(`text-color-active`)]:a(`color-active`),boxShadow:a(`shadow`)},[`&${t}-variant-dashed`]:{[i(`border-style`)]:`dashed`,[i(`bg-color-disabled`)]:e.dashedBgDisabled},[`&${t}-variant-filled`]:{[i(`border-color`)]:`transparent`,[i(`text-color`)]:a(`color-base`),[i(`bg-color`)]:a(`color-light`),[i(`bg-color-hover`)]:a(`color-light-hover`),[i(`bg-color-active`)]:a(`color-light-active`)},[`&${t}-variant-text, &${t}-variant-link`]:{[i(`border-color`)]:`transparent`,[i(`text-color`)]:a(`color-base`),[i(`text-color-hover`)]:a(`color-hover`),[i(`text-color-active`)]:a(`color-active`),[i(`bg-color`)]:`transparent`,[i(`bg-color-hover`)]:`transparent`,[i(`bg-color-active`)]:`transparent`,[`&:disabled, &${e.componentCls}-disabled`]:{background:`transparent`,borderColor:`transparent`}},[`&${t}-variant-text`]:{[i(`bg-color-hover`)]:a(`color-light`),[i(`bg-color-active`)]:a(`color-light-active`)}},{[`&${t}-variant-link`]:{[i(`color-base`)]:e.colorLink,[i(`color-hover`)]:e.colorLinkHover,[i(`color-active`)]:e.colorLinkActive,[i(`bg-color-hover`)]:e.linkHoverBg},[`&${t}-color-primary`]:{[i(`color-base`)]:e.colorPrimary,[i(`color-hover`)]:e.colorPrimaryHover,[i(`color-active`)]:e.colorPrimaryActive,[i(`color-light`)]:e.colorPrimaryBg,[i(`color-light-hover`)]:e.colorPrimaryBgHover,[i(`color-light-active`)]:e.colorPrimaryBorder,[i(`shadow`)]:e.primaryShadow,[`&${t}-variant-solid`]:{[i(`text-color`)]:e.primaryColor,[i(`text-color-hover`)]:a(`text-color`),[i(`text-color-active`)]:a(`text-color`)}},[`&${t}-color-dangerous`]:{[i(`color-base`)]:e.colorError,[i(`color-hover`)]:e.colorErrorHover,[i(`color-active`)]:e.colorErrorActive,[i(`color-light`)]:e.colorErrorBg,[i(`color-light-hover`)]:e.colorErrorBgFilledHover,[i(`color-light-active`)]:e.colorErrorBgActive,[i(`shadow`)]:e.dangerShadow,[`&${t}-variant-solid`]:{[i(`text-color`)]:e.dangerColor,[i(`text-color-hover`)]:a(`text-color`),[i(`text-color-active`)]:a(`text-color`)}},[`&${t}-color-default`]:{[i(`solid-bg-color`)]:e.colorBgSolid,[i(`solid-bg-color-hover`)]:e.colorBgSolidHover,[i(`solid-bg-color-active`)]:e.colorBgSolidActive,[i(`color-base`)]:e.defaultBorderColor,[i(`color-hover`)]:e.defaultHoverBorderColor,[i(`color-active`)]:e.defaultActiveBorderColor,[i(`color-light`)]:e.colorFillTertiary,[i(`color-light-hover`)]:e.colorFillSecondary,[i(`color-light-active`)]:e.colorFill,[i(`text-color`)]:e.defaultColor,[i(`text-color-hover`)]:e.defaultHoverColor,[i(`text-color-active`)]:e.defaultActiveColor,[i(`shadow`)]:e.defaultShadow,[`&${t}-variant-outlined`]:{[i(`bg-color-disabled`)]:e.defaultBgDisabled},[`&${t}-variant-solid`]:{[i(`text-color`)]:e.solidTextColor,[i(`text-color-hover`)]:a(`text-color`),[i(`text-color-active`)]:a(`text-color`)},[`&${t}-variant-filled, &${t}-variant-text`]:{[i(`text-color-hover`)]:a(`text-color`),[i(`text-color-active`)]:a(`text-color`)},[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[i(`text-color`)]:e.defaultColor,[i(`text-color-hover`)]:e.defaultHoverColor,[i(`text-color-active`)]:e.defaultActiveColor,[i(`bg-color-container`)]:e.defaultBg,[i(`bg-color-hover`)]:e.defaultHoverBg,[i(`bg-color-active`)]:e.defaultActiveBg},[`&${t}-variant-text`]:{[i(`text-color`)]:e.textTextColor,[i(`text-color-hover`)]:e.textTextHoverColor,[i(`text-color-active`)]:e.textTextActiveColor,[i(`bg-color-hover`)]:e.textHoverBg},[`&${t}-background-ghost`]:{[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[i(`text-color`)]:e.defaultGhostColor,[i(`border-color`)]:e.defaultGhostBorderColor}}}},u.map(n=>{let r=e[`${n}6`],a=e[`${n}1`],o=e[`${n}Hover`],s=e[`${n}2`],c=e[`${n}3`],l=e[`${n}Active`],u=e[`${n}ShadowColor`];return{[`&${t}-color-${n}`]:{[i(`color-base`)]:r,[i(`color-hover`)]:o,[i(`color-active`)]:l,[i(`color-light`)]:a,[i(`color-light-hover`)]:s,[i(`color-light-active`)]:c,[i(`shadow`)]:u}}}),{[`&:disabled, &${e.componentCls}-disabled`]:{cursor:`not-allowed`,borderColor:e.colorBorderDisabled,background:a(`bg-color-disabled`),color:e.colorTextDisabled,boxShadow:`none`}},{[`&${t}-background-ghost`]:{[i(`bg-color`)]:e.ghostBg,[i(`bg-color-hover`)]:e.ghostBg,[i(`bg-color-active`)]:e.ghostBg,[i(`shadow`)]:`none`,[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[i(`bg-color-hover`)]:e.ghostBg,[i(`bg-color-active`)]:e.ghostBg}}}]}},Ce=e=>{let{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:i,motionDurationSlow:a,motionEaseInOut:o,iconGap:s,calc:c}=e;return{[t]:{outline:`none`,position:`relative`,display:`inline-flex`,gap:s,alignItems:`center`,justifyContent:`center`,fontWeight:r,whiteSpace:`nowrap`,textAlign:`center`,backgroundImage:`none`,cursor:`pointer`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:`none`,touchAction:`manipulation`,...A(),"&:disabled > *":{pointerEvents:`none`},[`${t}-icon > svg`]:_(),[`${t}-icon`]:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},"> a":{color:`currentColor`},"&:not(:disabled)":ne(e),[`&${t}-two-chinese-chars::first-letter`]:{letterSpacing:`0.34em`},[`&${t}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:`-0.34em`,letterSpacing:`0.34em`},[`&${t}-icon-only`]:{paddingInline:0,[`&${t}-compact-item`]:{flex:`none`}},[`&${t}-loading`]:{opacity:i,cursor:`default`},[`${t}-loading-icon`]:{transition:[`width`,`opacity`,`margin`].map(e=>`${e} ${a} ${o}`).join(`,`)},[`&:not(${t}-icon-end)`]:{[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineEnd:c(s).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:c(s).mul(-1).equal()}}},"&-icon-end":{flexDirection:`row-reverse`,[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineStart:c(s).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:c(s).mul(-1).equal()}}}}}},P=e=>({minWidth:e.controlHeight,paddingInline:0,borderRadius:`50%`}),F=(e,t=``)=>{let{componentCls:n,controlHeight:r,fontSize:i,borderRadius:a,buttonPaddingHorizontal:o,iconCls:s,buttonPaddingVertical:c,buttonIconOnlyFontSize:l}=e;return[{[t]:{fontSize:i,height:r,padding:`${h(c)} ${h(o)}`,borderRadius:a,[`&${n}-icon-only`]:{width:r,[s]:{fontSize:l}}}},{[`${n}${n}-circle${t}`]:P(e)},{[`${n}${n}-round${t}`]:{borderRadius:e.controlHeight,[`&:not(${n}-icon-only)`]:{paddingInline:e.buttonPaddingHorizontal}}}]},I=e=>F(t(e,{fontSize:e.contentFontSize}),e.componentCls),L=e=>F(t(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM}),`${e.componentCls}-sm`),R=e=>F(t(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG}),`${e.componentCls}-lg`),z=e=>{let{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:`100%`}}}},we=p(`Button`,e=>{let t=M(e);return[Ce(t),I(t),L(t),R(t),z(t),Se(t),xe(t)]},N,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function B(e,t,n){return{[`&-item:not(${t}-last-item)`]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":{"&:focus,&:active":{zIndex:3},"&:hover":{zIndex:4},"&[disabled]":{zIndex:0}}}}function V(e,t){return{[`&-item:not(${t}-first-item):not(${t}-last-item)`]:{borderRadius:0},[`&-item${t}-first-item:not(${t}-last-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${t}-last-item:not(${t}-first-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function H(e){let t=`${e.componentCls}-compact-vertical`;return{[t]:{...B(e,t,e.componentCls),...V(e.componentCls,t)}}}var U=e=>{let{antCls:t,componentCls:n,lineWidth:r,calc:i,colorBgContainer:a}=e,o=`${n}-variant-solid:not([disabled])`,s=i(r).mul(-1).equal(),[c,l]=x(t,`btn`),u=e=>({[`${n}-compact${e?`-vertical`:``}-item`]:{[c(`compact-connect-border-color`)]:l(`bg-color-hover`),[`&${o}`]:{transition:`none`,[`& + ${o}:before`]:[{position:`absolute`,backgroundColor:l(`compact-connect-border-color`),content:`""`},e?{top:s,insetInline:s,height:r}:{insetBlock:s,insetInlineStart:s,width:r}],"&:hover:before":{display:`none`}}}});return[u(),u(!0),{[`${o}${n}-color-default`]:{[c(`compact-connect-border-color`)]:`color-mix(in srgb, ${l(`bg-color-hover`)} 75%, ${a})`}}]},Te=n([`Button`,`compact`],e=>{let t=M(e);return[r(t),H(t),U(t)]},N);function Ee(e){if(se(e)){let t=e?.delay;return t=v(t)?t:0,{loading:t<=0,delay:t}}return{loading:!!e,delay:0}}var De={default:[`default`,`outlined`],primary:[`primary`,`solid`],dashed:[`default`,`dashed`],link:[`link`,`link`],text:[`default`,`text`]},W=S.forwardRef((e,t)=>{let{_skipSemantic:n,loading:r=!1,prefixCls:i,color:a,variant:c,type:l,danger:u=!1,shape:d,size:p,disabled:m,className:ne,rootClassName:h,children:g,icon:_,iconPosition:v,iconPlacement:ue,ghost:y=!1,block:b=!1,htmlType:de=`button`,classNames:fe,styles:x,style:me,autoInsertSpace:ge,autoFocus:C,...T}=e,_e=s(g),D=l||`default`,{getPrefixCls:O,direction:k,autoInsertSpace:A,className:j,style:xe,classNames:M,styles:N,loadingIcon:Se,shape:Ce,color:P,variant:F}=ie(`button`),I=d||Ce||`default`,[L,R]=(0,S.useMemo)(()=>{if(a&&c)return[a,c];if(l||u){let e=De[D]||[];return u?[`danger`,e[1]]:e}return c===`solid`?[`primary`,c]:P&&F?[P,F]:F===`solid`?[`primary`,F]:[`default`,`outlined`]},[a,c,l,u,P,F,D]),[z,B]=(0,S.useMemo)(()=>y&&R===`solid`?[L,`outlined`]:[L,R],[L,R,y]),V=z===`danger`,H=V?`dangerous`:z,U=ge??A??!0,W=O(`btn`,i),[Oe,ke]=we(W),Ae=(0,S.useContext)(ce),G=m??Ae,je=(0,S.useContext)(he),K=(0,S.useMemo)(()=>Ee(r),[r]),[q,Me]=(0,S.useState)(K.loading),[J,Ne]=(0,S.useState)(!1),Y=(0,S.useRef)(null),Pe=le(t,Y),Fe=_e.length===1&&!_&&!E(B),X=(0,S.useRef)(!0);S.useEffect(()=>(X.current=!1,()=>{X.current=!0}),[]),oe(()=>{let e=null;K.delay>0?e=setTimeout(()=>{e=null,Me(!0)},K.delay):Me(K.loading);function t(){e&&=(clearTimeout(e),null)}return t},[K.delay,K.loading]),(0,S.useEffect)(()=>{if(!Y.current||!U)return;let e=Y.current.textContent||``;Fe&&w(e)?J||Ne(!0):J&&Ne(!1)}),(0,S.useEffect)(()=>{C&&Y.current&&Y.current.focus()},[]);let Ie=S.useCallback(t=>{if(q||G){t.preventDefault();return}e.onClick?.((`href`in e,t))},[e.onClick,q,G]),{compactSize:Le,compactItemClassnames:Re}=o(W,k),Z=te(e=>p??Le??je??e),ze=q?`loading`:_,Be=ue??v??`start`,Q=ee(T,[`navigate`]),Ve={...e,type:D,color:z,variant:B,danger:V,shape:I,size:Z,disabled:G,loading:q,iconPlacement:Be},[He,Ue]=ae([n?void 0:M,fe],[n?void 0:N,x],{props:Ve}),We=f(W,Oe,ke,{[`${W}-${I}`]:I!=="default"&&I!==`square`&&I,[`${W}-${D}`]:D,[`${W}-dangerous`]:u,[`${W}-color-${H}`]:H,[`${W}-variant-${B}`]:B,[`${W}-lg`]:Z===`large`,[`${W}-sm`]:Z===`small`,[`${W}-icon-only`]:!g&&g!==0&&!!ze,[`${W}-background-ghost`]:y&&!E(B),[`${W}-loading`]:q,[`${W}-two-chinese-chars`]:J&&U&&!q,[`${W}-block`]:b,[`${W}-rtl`]:k===`rtl`,[`${W}-icon-end`]:Be===`end`},Re,ne,h,j,He.root),Ge={...Ue.root,...xe,...me},Ke={className:He.icon,style:Ue.icon},qe=e=>S.createElement(ye,{prefixCls:W,...Ke},e),Je=S.createElement(be,{existIcon:!!_,prefixCls:W,loading:q,mount:X.current,...Ke}),Ye=se(r)&&r.icon||Se,Xe;Xe=_&&!q?qe(_):r&&Ye?qe(Ye):Je;let Ze=re(g)?ve(g,Fe&&U,Ue.content,He.content):null;if(Q.href!==void 0)return S.createElement(`a`,{...Q,className:f(We,{[`${W}-disabled`]:G}),href:G?void 0:Q.href,style:Ge,onClick:Ie,ref:Pe,tabIndex:G?-1:0,"aria-disabled":G},Xe,Ze);let $=S.createElement(`button`,{...T,type:de,className:We,style:Ge,onClick:Ie,disabled:G,ref:Pe},Xe,Ze,Re&&S.createElement(Te,{prefixCls:W}));return E(B)||($=S.createElement(pe,{component:`Button`,disabled:q},$)),$});W.Group=ge,W.__ANT_BUTTON=!0;var Oe=W;export{T as i,W as n,A as r,Oe as t};