"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),M=require("lodash-es/isPlainObject"),d=require("../_util/props-util/index.js"),F=require("../_util/vnode.js"),s=require("../_util/vue-types/index.js"),H=require("../config-provider/hooks/useConfigInject.js");require("../skeleton/index.js");require("../tabs/index.js");const J=require("../vc-util/devWarning.js"),Q=require("./style/index.js");require("../tabs/src/TabPanelList/TabPane.js");const B=require("../tabs/src/Tabs.js"),X=require("../skeleton/Skeleton.js"),{TabPane:Y}=B.default,K=()=>({prefixCls:String,title:s.default.any,extra:s.default.any,bordered:{type:Boolean,default:!0},bodyStyle:{type:Object,default:void 0},headStyle:{type:Object,default:void 0},loading:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},type:{type:String},size:{type:String},actions:s.default.any,tabList:{type:Array},tabBarExtraContent:s.default.any,activeTabKey:String,defaultActiveTabKey:String,cover:s.default.any,onTabChange:{type:Function}}),Z=t.defineComponent({compatConfig:{MODE:3},name:"ACard",inheritAttrs:!1,props:K(),slots:Object,setup(u,{slots:n,attrs:v}){const{prefixCls:g,direction:P,size:$}=H.default("card",u),[j,O]=Q.default(g),W=r=>r.map((a,f)=>t.isVNode(a)&&!d.isEmptyElement(a)||!t.isVNode(a)?t.createVNode("li",{style:{width:`${100/r.length}%`},key:`action-${f}`},[t.createVNode("span",null,[a])]):null),_=r=>{u.onTabChange?.(r)},k=(r=[])=>{let i;return r.forEach(a=>{a&&M(a.type)&&a.type.__ANT_CARD_GRID&&(i=!0)}),i};return()=>{const{headStyle:r={},bodyStyle:i={},loading:a,bordered:f=!0,type:C,tabList:l,hoverable:D,activeTabKey:S,defaultActiveTabKey:L,tabBarExtraContent:N=d.filterEmptyWithUndefined(n.tabBarExtraContent?.()),title:y=d.filterEmptyWithUndefined(n.title?.()),extra:b=d.filterEmptyWithUndefined(n.extra?.()),actions:p=d.filterEmptyWithUndefined(n.actions?.()),cover:m=d.filterEmptyWithUndefined(n.cover?.())}=u,o=d.flattenChildren(n.default?.()),e=g.value,R={[`${e}`]:!0,[O.value]:!0,[`${e}-loading`]:a,[`${e}-bordered`]:f,[`${e}-hoverable`]:!!D,[`${e}-contain-grid`]:k(o),[`${e}-contain-tabs`]:l&&l.length,[`${e}-${$.value}`]:$.value,[`${e}-type-${C}`]:!!C,[`${e}-rtl`]:P.value==="rtl"},U=t.createVNode(X.default,{loading:!0,active:!0,paragraph:{rows:4},title:!1},{default:()=>[o]}),V=S!==void 0,w={size:"large",[V?"activeKey":"defaultActiveKey"]:V?S:L,onChange:_,class:`${e}-head-tabs`};let T;const q=l&&l.length?t.createVNode(B.default,w,{default:()=>[l.map(c=>{const{tab:x,slots:E}=c,A=E?.tab;J.default(!E,"Card","tabList slots is deprecated, Please use `customTab` instead.");let h=x!==void 0?x:n[A]?n[A](c):null;return h=F.customRenderSlot(n,"customTab",c,()=>[h]),t.createVNode(Y,{tab:h,key:c.key,disabled:c.disabled},null)})],rightExtra:N?()=>N:null}):null;(y||b||q)&&(T=t.createVNode("div",{class:`${e}-head`,style:r},[t.createVNode("div",{class:`${e}-head-wrapper`},[y&&t.createVNode("div",{class:`${e}-head-title`},[y]),b&&t.createVNode("div",{class:`${e}-extra`},[b])]),q]));const z=m?t.createVNode("div",{class:`${e}-cover`},[m]):null,G=t.createVNode("div",{class:`${e}-body`,style:i},[a?U:o]),I=p&&p.length?t.createVNode("ul",{class:`${e}-actions`},[W(p)]):null;return j(t.createVNode("div",{ref:"cardContainerRef",...v,class:[R,v.class]},[T,z,o&&o.length?G:null,I]))}}});exports.cardProps=K;exports.default=Z;
