import{clearFix as n,resetComponent as c,textEllipsis as t}from"../../style/index.mjs";import"../../theme/internal.mjs";import p from"../../theme/util/genComponentStyleHook.mjs";import{merge as g}from"../../theme/util/statistic.mjs";const s=i=>{const{antCls:r,componentCls:d,cardHeadHeight:a,cardPaddingBase:o,cardHeadTabsMarginBottom:e}=i;return{display:"flex",justifyContent:"center",flexDirection:"column",minHeight:a,marginBottom:-1,padding:`0 ${o}px`,color:i.colorTextHeading,fontWeight:i.fontWeightStrong,fontSize:i.fontSizeLG,background:"transparent",borderBottom:`${i.lineWidth}px ${i.lineType} ${i.colorBorderSecondary}`,borderRadius:`${i.borderRadiusLG}px ${i.borderRadiusLG}px 0 0`,...n(),"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":{display:"inline-block",flex:1,...t,[`
          > ${d}-typography,
          > ${d}-typography-edit-content
        `]:{insetInlineStart:0,marginTop:0,marginBottom:0}},[`${r}-tabs-top`]:{clear:"both",marginBottom:e,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,"&-bar":{borderBottom:`${i.lineWidth}px ${i.lineType} ${i.colorBorderSecondary}`}}}},$=i=>{const{cardPaddingBase:r,colorBorderSecondary:d,cardShadow:a,lineWidth:o}=i;return{width:"33.33%",padding:r,border:0,borderRadius:0,boxShadow:`
      ${o}px 0 0 0 ${d},
      0 ${o}px 0 0 ${d},
      ${o}px ${o}px 0 0 ${d},
      ${o}px 0 0 0 ${d} inset,
      0 ${o}px 0 0 ${d} inset;
    `,transition:`all ${i.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:a}}},h=i=>{const{componentCls:r,iconCls:d,cardActionsLiMargin:a,cardActionsIconSize:o,colorBorderSecondary:e}=i;return{margin:0,padding:0,listStyle:"none",background:i.colorBgContainer,borderTop:`${i.lineWidth}px ${i.lineType} ${e}`,display:"flex",borderRadius:`0 0 ${i.borderRadiusLG}px ${i.borderRadiusLG}px `,...n(),"& > li":{margin:a,color:i.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:i.cardActionsIconSize*2,fontSize:i.fontSize,lineHeight:i.lineHeight,cursor:"pointer","&:hover":{color:i.colorPrimary,transition:`color ${i.motionDurationMid}`},[`a:not(${r}-btn), > ${d}`]:{display:"inline-block",width:"100%",color:i.colorTextDescription,lineHeight:`${i.fontSize*i.lineHeight}px`,transition:`color ${i.motionDurationMid}`,"&:hover":{color:i.colorPrimary}},[`> ${d}`]:{fontSize:o,lineHeight:`${o*i.lineHeight}px`}},"&:not(:last-child)":{borderInlineEnd:`${i.lineWidth}px ${i.lineType} ${e}`}}}},S=i=>({margin:`-${i.marginXXS}px 0`,display:"flex",...n(),"&-avatar":{paddingInlineEnd:i.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:i.marginXS}},"&-title":{color:i.colorTextHeading,fontWeight:i.fontWeightStrong,fontSize:i.fontSizeLG,...t},"&-description":{color:i.colorTextDescription}}),m=i=>{const{componentCls:r,cardPaddingBase:d,colorFillAlter:a}=i;return{[`${r}-head`]:{padding:`0 ${d}px`,background:a,"&-title":{fontSize:i.fontSize}},[`${r}-body`]:{padding:`${i.padding}px ${d}px`}}},x=i=>{const{componentCls:r}=i;return{overflow:"hidden",[`${r}-body`]:{userSelect:"none"}}},b=i=>{const{componentCls:r,cardShadow:d,cardHeadPadding:a,colorBorderSecondary:o,boxShadow:e,cardPaddingBase:l}=i;return{[r]:{...c(i),position:"relative",background:i.colorBgContainer,borderRadius:i.borderRadiusLG,[`&:not(${r}-bordered)`]:{boxShadow:e},[`${r}-head`]:s(i),[`${r}-extra`]:{marginInlineStart:"auto",color:"",fontWeight:"normal",fontSize:i.fontSize},[`${r}-body`]:{padding:l,borderRadius:` 0 0 ${i.borderRadiusLG}px ${i.borderRadiusLG}px`,...n()},[`${r}-grid`]:$(i),[`${r}-cover`]:{"> *":{display:"block",width:"100%"},img:{borderRadius:`${i.borderRadiusLG}px ${i.borderRadiusLG}px 0 0`}},[`${r}-actions`]:h(i),[`${r}-meta`]:S(i)},[`${r}-bordered`]:{border:`${i.lineWidth}px ${i.lineType} ${o}`,[`${r}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${r}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${i.motionDurationMid}, border-color ${i.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:d}},[`${r}-contain-grid`]:{[`${r}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${r}-loading) ${r}-body`]:{marginBlockStart:-i.lineWidth,marginInlineStart:-i.lineWidth,padding:0}},[`${r}-contain-tabs`]:{[`> ${r}-head`]:{[`${r}-head-title, ${r}-extra`]:{paddingTop:a}}},[`${r}-type-inner`]:m(i),[`${r}-loading`]:x(i),[`${r}-rtl`]:{direction:"rtl"}}},y=i=>{const{componentCls:r,cardPaddingSM:d,cardHeadHeightSM:a}=i;return{[`${r}-small`]:{[`> ${r}-head`]:{minHeight:a,padding:`0 ${d}px`,fontSize:i.fontSize,[`> ${r}-head-wrapper`]:{[`> ${r}-extra`]:{fontSize:i.fontSize}}},[`> ${r}-body`]:{padding:d}},[`${r}-small${r}-contain-tabs`]:{[`> ${r}-head`]:{[`${r}-head-title, ${r}-extra`]:{minHeight:a,paddingTop:0,display:"flex",alignItems:"center"}}}}},C=p("Card",i=>{const r=g(i,{cardShadow:i.boxShadowCard,cardHeadHeight:i.fontSizeLG*i.lineHeightLG+i.padding*2,cardHeadHeightSM:i.fontSize*i.lineHeight+i.paddingXS*2,cardHeadPadding:i.padding,cardPaddingBase:i.paddingLG,cardHeadTabsMarginBottom:-i.padding-i.lineWidth,cardActionsLiMargin:`${i.paddingSM}px 0`,cardActionsIconSize:i.fontSize,cardPaddingSM:12});return[b(r),y(r)]});export{C as default};
