import{d as h,g as r,D as g,x as J,y as Q,z as l,as as U,A as C,c as A,E as S}from"./LoadingOutlined.CdPfeNgz.js";import{i as N}from"./initDefaultProps.D5RH7UfE.js";import{o as W}from"./omit.Xvkk__bY.js";const Y=()=>({prefixCls:String,width:{type:[Number,String]}}),O=h({compatConfig:{MODE:3},name:"SkeletonTitle",props:Y(),setup(e){return()=>{const{prefixCls:t,width:n}=e,o=typeof n=="number"?"".concat(n,"px"):n;return r("h3",{class:t,style:{width:o}},null)}}}),Z=()=>({prefixCls:String,width:{type:[Number,String,Array]},rows:Number}),ee=h({compatConfig:{MODE:3},name:"SkeletonParagraph",props:Z(),setup(e){const t=n=>{const{width:o,rows:a=2}=e;if(Array.isArray(o))return o[n];if(a-1===n)return o};return()=>{const{prefixCls:n,rows:o}=e,a=[...Array(o)].map((i,s)=>{const d=t(s);return r("li",{key:s,style:{width:typeof d=="number"?"".concat(d,"px"):d}},null)});return r("ul",{class:n},[a])}}}),E=()=>({prefixCls:String,size:[String,Number],shape:String,active:{type:Boolean,default:void 0}}),w=e=>{const{prefixCls:t,size:n,shape:o}=e,a=g({["".concat(t,"-lg")]:n==="large",["".concat(t,"-sm")]:n==="small"}),i=g({["".concat(t,"-circle")]:o==="circle",["".concat(t,"-square")]:o==="square",["".concat(t,"-round")]:o==="round"}),s=typeof n=="number"?{width:"".concat(n,"px"),height:"".concat(n,"px"),lineHeight:"".concat(n,"px")}:{};return r("span",{class:g(t,a,i),style:s},null)};w.displayName="SkeletonElement";const te=new U("ant-skeleton-loading",{"0%":{transform:"translateX(-37.5%)"},"100%":{transform:"translateX(37.5%)"}}),P=e=>({height:e,lineHeight:"".concat(e,"px")}),k=e=>l({width:e},P(e)),ne=e=>({position:"relative",zIndex:0,overflow:"hidden",background:"transparent","&::after":{position:"absolute",top:0,insetInlineEnd:"-150%",bottom:0,insetInlineStart:"-150%",background:e.skeletonLoadingBackground,animationName:te,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite",content:'""'}}),T=e=>l({width:e*5,minWidth:e*5},P(e)),oe=e=>{const{skeletonAvatarCls:t,color:n,controlHeight:o,controlHeightLG:a,controlHeightSM:i}=e;return{["".concat(t)]:l({display:"inline-block",verticalAlign:"top",background:n},k(o)),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"},["".concat(t).concat(t,"-lg")]:l({},k(a)),["".concat(t).concat(t,"-sm")]:l({},k(i))}},le=e=>{const{controlHeight:t,borderRadiusSM:n,skeletonInputCls:o,controlHeightLG:a,controlHeightSM:i,color:s}=e;return{["".concat(o)]:l({display:"inline-block",verticalAlign:"top",background:s,borderRadius:n},T(t)),["".concat(o,"-lg")]:l({},T(a)),["".concat(o,"-sm")]:l({},T(i))}},G=e=>l({width:e},P(e)),ae=e=>{const{skeletonImageCls:t,imageSizeBase:n,color:o,borderRadiusSM:a}=e;return{["".concat(t)]:l(l({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:o,borderRadius:a},G(n*2)),{["".concat(t,"-path")]:{fill:"#bfbfbf"},["".concat(t,"-svg")]:l(l({},G(n)),{maxWidth:n*4,maxHeight:n*4}),["".concat(t,"-svg").concat(t,"-svg-circle")]:{borderRadius:"50%"}}),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"}}},L=(e,t,n)=>{const{skeletonButtonCls:o}=e;return{["".concat(n).concat(o,"-circle")]:{width:t,minWidth:t,borderRadius:"50%"},["".concat(n).concat(o,"-round")]:{borderRadius:t}}},q=e=>l({width:e*2,minWidth:e*2},P(e)),re=e=>{const{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:o,controlHeightLG:a,controlHeightSM:i,color:s}=e;return l(l(l(l(l({["".concat(n)]:l({display:"inline-block",verticalAlign:"top",background:s,borderRadius:t,width:o*2,minWidth:o*2},q(o))},L(e,o,n)),{["".concat(n,"-lg")]:l({},q(a))}),L(e,a,"".concat(n,"-lg"))),{["".concat(n,"-sm")]:l({},q(i))}),L(e,i,"".concat(n,"-sm")))},ie=e=>{const{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:o,skeletonParagraphCls:a,skeletonButtonCls:i,skeletonInputCls:s,skeletonImageCls:d,controlHeight:H,controlHeightLG:b,controlHeightSM:$,color:p,padding:M,marginSM:R,borderRadius:u,skeletonTitleHeight:v,skeletonBlockRadius:m,skeletonParagraphLineHeight:f,controlHeightXS:B,skeletonParagraphMarginTop:x}=e;return{["".concat(t)]:{display:"table",width:"100%",["".concat(t,"-header")]:{display:"table-cell",paddingInlineEnd:M,verticalAlign:"top",["".concat(n)]:l({display:"inline-block",verticalAlign:"top",background:p},k(H)),["".concat(n,"-circle")]:{borderRadius:"50%"},["".concat(n,"-lg")]:l({},k(b)),["".concat(n,"-sm")]:l({},k($))},["".concat(t,"-content")]:{display:"table-cell",width:"100%",verticalAlign:"top",["".concat(o)]:{width:"100%",height:v,background:p,borderRadius:m,["+ ".concat(a)]:{marginBlockStart:$}},["".concat(a)]:{padding:0,"> li":{width:"100%",height:f,listStyle:"none",background:p,borderRadius:m,"+ li":{marginBlockStart:B}}},["".concat(a,"> li:last-child:not(:first-child):not(:nth-child(2))")]:{width:"61%"}},["&-round ".concat(t,"-content")]:{["".concat(o,", ").concat(a," > li")]:{borderRadius:u}}},["".concat(t,"-with-avatar ").concat(t,"-content")]:{["".concat(o)]:{marginBlockStart:R,["+ ".concat(a)]:{marginBlockStart:x}}},["".concat(t).concat(t,"-element")]:l(l(l(l({display:"inline-block",width:"auto"},re(e)),oe(e)),le(e)),ae(e)),["".concat(t).concat(t,"-block")]:{width:"100%",["".concat(i)]:{width:"100%"},["".concat(s)]:{width:"100%"}},["".concat(t).concat(t,"-active")]:{["\n        ".concat(o,",\n        ").concat(a," > li,\n        ").concat(n,",\n        ").concat(i,",\n        ").concat(s,",\n        ").concat(d,"\n      ")]:l({},ne(e))}}},y=J("Skeleton",e=>{const{componentCls:t}=e,n=Q(e,{skeletonAvatarCls:"".concat(t,"-avatar"),skeletonTitleCls:"".concat(t,"-title"),skeletonParagraphCls:"".concat(t,"-paragraph"),skeletonButtonCls:"".concat(t,"-button"),skeletonInputCls:"".concat(t,"-input"),skeletonImageCls:"".concat(t,"-image"),imageSizeBase:e.controlHeight*1.5,skeletonTitleHeight:e.controlHeight/2,skeletonBlockRadius:e.borderRadiusSM,skeletonParagraphLineHeight:e.controlHeight/2,skeletonParagraphMarginTop:e.marginLG+e.marginXXS,borderRadius:100,skeletonLoadingBackground:"linear-gradient(90deg, ".concat(e.color," 25%, ").concat(e.colorGradientEnd," 37%, ").concat(e.color," 63%)"),skeletonLoadingMotionDuration:"1.4s"});return[ie(n)]},e=>{const{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n}}),se=()=>({active:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},prefixCls:String,avatar:{type:[Boolean,Object],default:void 0},title:{type:[Boolean,Object],default:void 0},paragraph:{type:[Boolean,Object],default:void 0},round:{type:Boolean,default:void 0}});function D(e){return e&&typeof e=="object"?e:{}}function ce(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function ue(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}function de(e,t){const n={};return(!e||!t)&&(n.width="61%"),!e&&t?n.rows=3:n.rows=2,n}const c=h({compatConfig:{MODE:3},name:"ASkeleton",props:N(se(),{avatar:!1,title:!0,paragraph:!0}),setup(e,t){let{slots:n}=t;const{prefixCls:o,direction:a}=C("skeleton",e),[i,s]=y(o);return()=>{var d;const{loading:H,avatar:b,title:$,paragraph:p,active:M,round:R}=e,u=o.value;if(H||e.loading===void 0){const v=!!b||b==="",m=!!$||$==="",f=!!p||p==="";let B;if(v){const I=l(l({prefixCls:"".concat(u,"-avatar")},ce(m,f)),D(b));B=r("div",{class:"".concat(u,"-header")},[r(w,I,null)])}let x;if(m||f){let I;if(m){const z=l(l({prefixCls:"".concat(u,"-title")},ue(v,f)),D($));I=r(O,z,null)}let j;if(f){const z=l(l({prefixCls:"".concat(u,"-paragraph")},de(v,m)),D(p));j=r(ee,z,null)}x=r("div",{class:"".concat(u,"-content")},[I,j])}const V=g(u,{["".concat(u,"-with-avatar")]:v,["".concat(u,"-active")]:M,["".concat(u,"-rtl")]:a.value==="rtl",["".concat(u,"-round")]:R,[s.value]:!0});return i(r("div",{class:V},[B,x]))}return(d=n.default)===null||d===void 0?void 0:d.call(n)}}}),ge=()=>l(l({},E()),{size:String,block:Boolean}),X=h({compatConfig:{MODE:3},name:"ASkeletonButton",props:N(ge(),{size:"default"}),setup(e){const{prefixCls:t}=C("skeleton",e),[n,o]=y(t),a=A(()=>g(t.value,"".concat(t.value,"-element"),{["".concat(t.value,"-active")]:e.active,["".concat(t.value,"-block")]:e.block},o.value));return()=>n(r("div",{class:a.value},[r(w,S(S({},e),{},{prefixCls:"".concat(t.value,"-button")}),null)]))}}),_=h({compatConfig:{MODE:3},name:"ASkeletonInput",props:l(l({},W(E(),["shape"])),{size:String,block:Boolean}),setup(e){const{prefixCls:t}=C("skeleton",e),[n,o]=y(t),a=A(()=>g(t.value,"".concat(t.value,"-element"),{["".concat(t.value,"-active")]:e.active,["".concat(t.value,"-block")]:e.block},o.value));return()=>n(r("div",{class:a.value},[r(w,S(S({},e),{},{prefixCls:"".concat(t.value,"-input")}),null)]))}}),pe="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",F=h({compatConfig:{MODE:3},name:"ASkeletonImage",props:W(E(),["size","shape","active"]),setup(e){const{prefixCls:t}=C("skeleton",e),[n,o]=y(t),a=A(()=>g(t.value,"".concat(t.value,"-element"),o.value));return()=>n(r("div",{class:a.value},[r("div",{class:"".concat(t.value,"-image")},[r("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",class:"".concat(t.value,"-image-svg")},[r("path",{d:pe,class:"".concat(t.value,"-image-path")},null)])])]))}}),me=()=>l(l({},E()),{shape:String}),K=h({compatConfig:{MODE:3},name:"ASkeletonAvatar",props:N(me(),{size:"default",shape:"circle"}),setup(e){const{prefixCls:t}=C("skeleton",e),[n,o]=y(t),a=A(()=>g(t.value,"".concat(t.value,"-element"),{["".concat(t.value,"-active")]:e.active},o.value));return()=>n(r("div",{class:a.value},[r(w,S(S({},e),{},{prefixCls:"".concat(t.value,"-avatar")}),null)]))}});c.Button=X;c.Avatar=K;c.Input=_;c.Image=F;c.Title=O;c.install=function(e){return e.component(c.name,c),e.component(c.Button.name,X),e.component(c.Avatar.name,K),e.component(c.Input.name,_),e.component(c.Image.name,F),e.component(c.Title.name,O),e};export{c as S,X as a};
