index-legacy-e48d4cab.js 2.9 KB

1
  1. !function(){function e(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,i,o,a,l=[],u=!0,f=!1;try{if(o=(n=n.call(e)).next,0===r){if(Object(n)!==n)return;u=!1}else for(;!(u=(t=o.call(n)).done)&&(l.push(t.value),l.length!==r);u=!0);}catch(d){f=!0,i=d}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw i}}return l}}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}System.register(["./index-legacy-e510f409.js"],(function(r,n){"use strict";var t,i,o,a,l,u,f,d,c,s,v,g,h,b,p,m,y,x,S;return{setters:[function(e){t=e.b0,i=e.q,o=e.t,a=e.U,l=e.V,u=e.d,f=e.l,d=e.ai,c=e.w,s=e.bi,v=e.o,g=e.z,h=e.D,b=e.f,p=e.n,m=e.E,y=e.ak,x=e.R,S=e.K}],execute:function(){var n=r("T",Symbol()),T=e(i("list"),3),w=T[0],j=T[1],A=T[2],k={error:Boolean,offset:o(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:a("down"),loadingText:String,finishedText:String,immediateCheck:l},B=u({name:w,props:k,emits:["load","update:error","update:loading"],setup:function(e,r){var i=r.emit,o=r.slots,a=f(e.loading),l=f(),u=f(),S=t(n,null),T=d(l),w=function(){p((function(){if(!(a.value||e.finished||e.disabled||e.error||!1===(null==S?void 0:S.value))){var r=e.direction,n=+e.offset,t=m(T);if(t.height&&!y(l)){var o=m(u);("up"===r?t.top-o.top<=n:o.bottom-t.bottom<=n)&&(a.value=!0,i("update:loading",!0),i("load"))}}}))},k=function(){if(e.finished){var r=o.finished?o.finished():e.finishedText;if(r)return b("div",{class:j("finished-text")},[r])}},B=function(){i("update:error",!1),w()},C=function(){if(e.error){var r=o.error?o.error():e.errorText;if(r)return b("div",{role:"button",class:j("error-text"),tabindex:0,onClick:B},[r])}},O=function(){if(a.value&&!e.finished&&!e.disabled)return b("div",{class:j("loading")},[o.loading?o.loading():b(x,{class:j("loading-icon")},{default:function(){return[e.loadingText||A("loading")]}})])};return c((function(){return[e.loading,e.finished,e.error]}),w),S&&c(S,(function(e){e&&w()})),s((function(){a.value=e.loading})),v((function(){e.immediateCheck&&w()})),g({check:w}),h("scroll",w,{target:T,passive:!0}),function(){var r,n=null==(r=o.default)?void 0:r.call(o),t=b("div",{ref:u,class:j("placeholder")},null);return b("div",{ref:l,role:"feed",class:j(),"aria-busy":a.value},["down"===e.direction?n:t,O(),k(),C(),"up"===e.direction?n:t])}}});r("L",S(B))}}}))}();