System.register(["./index-legacy-e17b48ce.js","./use-tab-status-legacy-d1d356b4.js"],(function(e,i){"use strict";var r,t,o,n,a,d,l,s,u,c,f,g,v,h,p,b,m,x,T;return{setters:[e=>{r=e.c,t=e.b,o=e.m,n=e.t,a=e.d,d=e.r,l=e.aS,s=e.w,u=e.bL,c=e.y,f=e.X,g=e.Y,v=e.a,h=e.z,p=e.Z,b=e.ba,m=e.L,x=e.k},e=>{T=e.u}],execute:function(){const[i,k,y]=r("list"),S={error:Boolean,offset:t(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:o("down"),loadingText:String,finishedText:String,immediateCheck:n};var B=a({name:i,props:S,emits:["load","update:error","update:loading"],setup(e,{emit:i,slots:r}){const t=d(e.loading),o=d(),n=d(),a=T(),x=l(o),S=()=>{h((()=>{if(t.value||e.finished||e.disabled||e.error||!1===(null==a?void 0:a.value))return;const{direction:r}=e,d=+e.offset,l=p(x);if(!l.height||b(o))return;let s=!1;const u=p(n);s="up"===r?l.top-u.top<=d:u.bottom-l.bottom<=d,s&&(t.value=!0,i("update:loading",!0),i("load"))}))},B=()=>{if(e.finished){const i=r.finished?r.finished():e.finishedText;if(i)return v("div",{class:k("finished-text")},[i])}},w=()=>{i("update:error",!1),S()},C=()=>{if(e.error){const i=r.error?r.error():e.errorText;if(i)return v("div",{role:"button",class:k("error-text"),tabindex:0,onClick:w},[i])}},L=()=>{if(t.value&&!e.finished&&!e.disabled)return v("div",{class:k("loading")},[r.loading?r.loading():v(m,{class:k("loading-icon")},{default:()=>[e.loadingText||y("loading")]})])};return s((()=>[e.loading,e.finished,e.error]),S),a&&s(a,(e=>{e&&S()})),u((()=>{t.value=e.loading})),c((()=>{e.immediateCheck&&S()})),f({check:S}),g("scroll",S,{target:x,passive:!0}),()=>{var i;const a=null==(i=r.default)?void 0:i.call(r),d=v("div",{ref:n,class:k("placeholder")},null);return v("div",{ref:o,role:"feed",class:k(),"aria-busy":t.value},["down"===e.direction?a:d,L(),B(),C(),"up"===e.direction?a:d])}}});e("L",x(B))}}}));
