import{b,t as S,_ as h,u as N,a_ as P,s as $,J as E,d as I,z as T}from"./base-xgxQQEpV.js";import{A as p,j as u,o as i,c as w,l as B,C as t,n as f,X as v,g as j,i as C,L as V,Z as z,B as _,F as m,a4 as g,p as L,O as y,aj as O}from"./vendor-vue-WbiK4TmU.js";const F=b({animated:Boolean,count:{type:Number,default:1},rows:{type:Number,default:3},loading:{type:Boolean,default:!0},throttle:{type:S([Number,Object])}}),R=b({variant:{type:String,values:["circle","rect","h1","h3","text","caption","p","image","button"],default:"text"}}),A=p({name:"ElSkeletonItem"}),H=p({...A,props:R,setup(l){const e=N("skeleton");return(r,s)=>(i(),u("div",{class:f([t(e).e("item"),t(e).e(r.variant)])},[r.variant==="image"?(i(),w(t(P),{key:0})):B("v-if",!0)],2))}});var c=h(H,[["__file","skeleton-item.vue"]]);const J=(l,e=0)=>{if(e===0)return l;const r=v(e)&&!!e.initVal,s=j(r);let o=null;const a=n=>{if(E(n)){s.value=l.value;return}o&&clearTimeout(o),o=setTimeout(()=>{s.value=l.value},n)},d=n=>{n==="leading"?$(e)?a(e):a(e.leading):v(e)?a(e.trailing):s.value=!1};return C(()=>d("leading")),V(()=>l.value,n=>{d(n?"leading":"trailing")}),s},M=p({name:"ElSkeleton"}),U=p({...M,props:F,setup(l,{expose:e}){const r=l,s=N("skeleton"),o=J(z(r,"loading"),r.throttle);return e({uiLoading:o}),(a,d)=>t(o)?(i(),u("div",y({key:0,class:[t(s).b(),t(s).is("animated",a.animated)]},a.$attrs),[(i(!0),u(m,null,g(a.count,n=>(i(),u(m,{key:n},[t(o)?_(a.$slots,"template",{key:n},()=>[L(c,{class:f(t(s).is("first")),variant:"p"},null,8,["class"]),(i(!0),u(m,null,g(a.rows,k=>(i(),w(c,{key:k,class:f([t(s).e("paragraph"),t(s).is("last",k===a.rows&&a.rows>1)]),variant:"p"},null,8,["class"]))),128))]):B("v-if",!0)],64))),128))],16)):_(a.$slots,"default",O(y({key:1},a.$attrs)))}});var X=h(U,[["__file","skeleton.vue"]]);const D=I(X,{SkeletonItem:c});T(c);export{D as E};
