@moohng/dui
Version:
基于 Vue 3 的轻量级组件库
2 lines (1 loc) • 36.4 kB
JavaScript
!function(t,e){"use strict";const n={loading:"正在加载...",noMore:"没有更多了~"};var r=e.defineComponent({name:"load-more",data:()=>({nextStatus:"more"}),props:{invisible:{type:Boolean,default:!1}},emits:["load-more"],computed:{pullupText(){return n[this.nextStatus]}},methods:{getPullupOptions(){return{threshold:0,onLoadMore:t=>{"more"===this.nextStatus&&(this.nextStatus="loading",this.$emit("load-more",e=>{t(!1),this.finished(e)}))}}},refresh(){this.nextStatus="more"},finished(t=!1){this.nextStatus=t?"noMore":"more"}}});const o=e.withScopeId("data-v-2f2fb309");e.pushScopeId("data-v-2f2fb309");const i={class:"load-more pd text-center"},c={class:"dui-icon__loading"};e.popScopeId();const s=o((function(t,n,r,o,s,u){const a=e.resolveDirective("pullup");return e.withDirectives((e.openBlock(),e.createBlock("div",i,[e.withDirectives(e.createVNode("i",c,null,512),[[e.vShow,"loading"===t.nextStatus]]),e.createTextVNode(" "+e.toDisplayString(t.pullupText),1)],512)),[[e.vShow,"loading"===t.nextStatus||"noMore"===t.nextStatus&&!t.invisible],[a,t.getPullupOptions()]])}));function u(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}u(".dui-icon__loading[data-v-2f2fb309]{width:18px;height:18px}"),r.render=s,r.__scopeId="data-v-2f2fb309",r.__file="src/components/load-more/load-more.vue";var a=function(t){try{return!!t()}catch(t){return!0}},l={}.toString,f=function(t){return l.call(t).slice(8,-1)},h="".split,p=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==f(t)?h.call(t,""):Object(t)}:Object,d=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},v=function(t){return p(d(t))},g={},m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var y=function(t){return t&&t.Math==Math&&t},w=y("object"==typeof globalThis&&globalThis)||y("object"==typeof window&&window)||y("object"==typeof self&&self)||y("object"==typeof m&&m)||function(){return this}()||Function("return this")(),b=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),_=function(t){return"object"==typeof t?null!==t:"function"==typeof t},S=w.document,E=_(S)&&_(S.createElement),T=function(t){return E?S.createElement(t):{}},O=!b&&!a((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),I=function(t){if(!_(t))throw TypeError(String(t)+" is not an object");return t},x=function(t,e){if(!_(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!_(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!_(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!_(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},j=Object.defineProperty,M={f:b?j:function(t,e,n){if(I(t),e=x(e,!0),I(n),O)try{return j(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},A=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},L=b?function(t,e,n){return M.f(t,e,A(1,n))}:function(t,e,n){return t[e]=n,t},R=w["__core-js_shared__"]||function(t,e){try{L(w,t,e)}catch(n){w[t]=e}return e}("__core-js_shared__",{}),P=Function.toString;"function"!=typeof R.inspectSource&&(R.inspectSource=function(t){return P.call(t)});var D,k,C,N=R.inspectSource,F=w.WeakMap,V="function"==typeof F&&/native code/.test(N(F)),B={}.hasOwnProperty,H=function(t,e){return B.call(t,e)},U=function(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&n.path)}},n.exports),n.exports}((function(t){(t.exports=function(t,e){return R[t]||(R[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.7.0",mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),q=0,G=Math.random(),W=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++q+G).toString(36)},z=U("keys"),$=function(t){return z[t]||(z[t]=W(t))},Y={},K=w.WeakMap;if(V){var X=R.state||(R.state=new K),J=X.get,Q=X.has,Z=X.set;D=function(t,e){return e.facade=t,Z.call(X,t,e),e},k=function(t){return J.call(X,t)||{}},C=function(t){return Q.call(X,t)}}else{var tt=$("state");Y[tt]=!0,D=function(t,e){return e.facade=t,L(t,tt,e),e},k=function(t){return H(t,tt)?t[tt]:{}},C=function(t){return H(t,tt)}}var et,nt,rt,ot={set:D,get:k,has:C,enforce:function(t){return C(t)?k(t):D(t,{})},getterFor:function(t){return function(e){var n;if(!_(e)||(n=k(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},it={}.propertyIsEnumerable,ct=Object.getOwnPropertyDescriptor,st={f:ct&&!it.call({1:2},1)?function(t){var e=ct(this,t);return!!e&&e.enumerable}:it},ut=Object.getOwnPropertyDescriptor,at={f:b?ut:function(t,e){if(t=v(t),e=x(e,!0),O)try{return ut(t,e)}catch(t){}if(H(t,e))return A(!st.f.call(t,e),t[e])}},lt=/#|\.prototype\./,ft=function(t,e){var n=pt[ht(t)];return n==vt||n!=dt&&("function"==typeof e?a(e):!!e)},ht=ft.normalize=function(t){return String(t).replace(lt,".").toLowerCase()},pt=ft.data={},dt=ft.NATIVE="N",vt=ft.POLYFILL="P",gt=ft,mt={},yt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},wt=function(t,e,n){if(yt(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},bt=at.f,_t=function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e},St=function(t,e){var n,r,o,i,c,s,u,a,l=t.target,f=t.global,h=t.stat,p=t.proto,d=f?w:h?w[l]:(w[l]||{}).prototype,v=f?mt:mt[l]||(mt[l]={}),g=v.prototype;for(o in e)n=!gt(f?o:l+(h?".":"#")+o,t.forced)&&d&&H(d,o),c=v[o],n&&(s=t.noTargetGet?(a=bt(d,o))&&a.value:d[o]),i=n&&s?s:e[o],n&&typeof c==typeof i||(u=t.bind&&n?wt(i,w):t.wrap&&n?_t(i):p&&"function"==typeof i?wt(Function.call,i):i,(t.sham||i&&i.sham||c&&c.sham)&&L(u,"sham",!0),v[o]=u,p&&(H(mt,r=l+"Prototype")||L(mt,r,{}),mt[r][o]=i,t.real&&g&&!g[o]&&L(g,o,i)))},Et=function(t){return Object(d(t))},Tt=!a((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ot=$("IE_PROTO"),It=Object.prototype,xt=Tt?Object.getPrototypeOf:function(t){return t=Et(t),H(t,Ot)?t[Ot]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?It:null},jt=!!Object.getOwnPropertySymbols&&!a((function(){return!String(Symbol())})),Mt=jt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,At=U("wks"),Lt=w.Symbol,Rt=Mt?Lt:Lt&&Lt.withoutSetter||W,Pt=function(t){return H(At,t)||(jt&&H(Lt,t)?At[t]=Lt[t]:At[t]=Rt("Symbol."+t)),At[t]},Dt=(Pt("iterator"),!1);[].keys&&("next"in(rt=[].keys())?(nt=xt(xt(rt)))!==Object.prototype&&(et=nt):Dt=!0),null==et&&(et={});var kt,Ct={IteratorPrototype:et,BUGGY_SAFARI_ITERATORS:Dt},Nt=Math.ceil,Ft=Math.floor,Vt=function(t){return isNaN(t=+t)?0:(t>0?Ft:Nt)(t)},Bt=Math.min,Ht=function(t){return t>0?Bt(Vt(t),9007199254740991):0},Ut=Math.max,qt=Math.min,Gt=function(t){return function(e,n,r){var o,i=v(e),c=Ht(i.length),s=function(t,e){var n=Vt(t);return n<0?Ut(n+e,0):qt(n,e)}(r,c);if(t&&n!=n){for(;c>s;)if((o=i[s++])!=o)return!0}else for(;c>s;s++)if((t||s in i)&&i[s]===n)return t||s||0;return!t&&-1}},Wt={includes:Gt(!0),indexOf:Gt(!1)}.indexOf,zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],$t=Object.keys||function(t){return function(t,e){var n,r=v(t),o=0,i=[];for(n in r)!H(Y,n)&&H(r,n)&&i.push(n);for(;e.length>o;)H(r,n=e[o++])&&(~Wt(i,n)||i.push(n));return i}(t,zt)},Yt=b?Object.defineProperties:function(t,e){I(t);for(var n,r=$t(e),o=r.length,i=0;o>i;)M.f(t,n=r[i++],e[n]);return t},Kt=function(t){return"function"==typeof t?t:void 0},Xt=function(t,e){return arguments.length<2?Kt(mt[t])||Kt(w[t]):mt[t]&&mt[t][e]||w[t]&&w[t][e]},Jt=Xt("document","documentElement"),Qt=$("IE_PROTO"),Zt=function(){},te=function(t){return"<script>"+t+"<\/script>"},ee=function(){try{kt=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;ee=kt?function(t){t.write(te("")),t.close();var e=t.parentWindow.Object;return t=null,e}(kt):((e=T("iframe")).style.display="none",Jt.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(te("document.F=Object")),t.close(),t.F);for(var n=zt.length;n--;)delete ee.prototype[zt[n]];return ee()};Y[Qt]=!0;var ne=Object.create||function(t,e){var n;return null!==t?(Zt.prototype=I(t),n=new Zt,Zt.prototype=null,n[Qt]=t):n=ee(),void 0===e?n:Yt(n,e)},re={};re[Pt("toStringTag")]="z";var oe="[object z]"===String(re),ie=Pt("toStringTag"),ce="Arguments"==f(function(){return arguments}()),se=oe?f:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ie))?n:ce?f(e):"Object"==(r=f(e))&&"function"==typeof e.callee?"Arguments":r},ue=oe?{}.toString:function(){return"[object "+se(this)+"]"},ae=M.f,le=Pt("toStringTag"),fe=function(t,e,n,r){if(t){var o=n?t:t.prototype;H(o,le)||ae(o,le,{configurable:!0,value:e}),r&&!oe&&L(o,"toString",ue)}},he=Ct.IteratorPrototype,pe=function(){return this},de=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return I(n),function(t){if(!_(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),ve=function(t,e,n,r){r&&r.enumerable?t[e]=n:L(t,e,n)},ge=Ct.IteratorPrototype,me=Ct.BUGGY_SAFARI_ITERATORS,ye=Pt("iterator"),we=function(){return this},be=function(t,e,n,r,o,i,c){!function(t,e,n){var r=e+" Iterator";t.prototype=ne(he,{next:A(1,n)}),fe(t,r,!1,!0),g[r]=pe}(n,e,r);var s,u,a,l=function(t){if(t===o&&v)return v;if(!me&&t in p)return p[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},f=e+" Iterator",h=!1,p=t.prototype,d=p[ye]||p["@@iterator"]||o&&p[o],v=!me&&d||l(o),m="Array"==e&&p.entries||d;if(m&&(s=xt(m.call(new t)),ge!==Object.prototype&&s.next&&(fe(s,f,!0,!0),g[f]=we)),"values"==o&&d&&"values"!==d.name&&(h=!0,v=function(){return d.call(this)}),c&&p[ye]!==v&&L(p,ye,v),g[e]=v,o)if(u={values:l("values"),keys:i?v:l("keys"),entries:l("entries")},c)for(a in u)(me||h||!(a in p))&&ve(p,a,u[a]);else St({target:e,proto:!0,forced:me||h},u);return u},_e=ot.set,Se=ot.getterFor("Array Iterator");be(Array,"Array",(function(t,e){_e(this,{type:"Array Iterator",target:v(t),index:0,kind:e})}),(function(){var t=Se(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");g.Arguments=g.Array;var Ee=Pt("toStringTag");for(var Te in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Oe=w[Te],Ie=Oe&&Oe.prototype;Ie&&se(Ie)!==Ee&&L(Ie,Ee,Te),g[Te]=g.Array}var xe,je,Me=Array.isArray||function(t){return"Array"==f(t)},Ae=Pt("species"),Le=function(t,e){var n;return Me(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Me(n.prototype)?_(n)&&null===(n=n[Ae])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Re=[].push,Pe=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,c=5==t||i;return function(s,u,a,l){for(var f,h,d=Et(s),v=p(d),g=wt(u,a,3),m=Ht(v.length),y=0,w=l||Le,b=e?w(s,m):n?w(s,0):void 0;m>y;y++)if((c||y in v)&&(h=g(f=v[y],y,d),t))if(e)b[y]=h;else if(h)switch(t){case 3:return!0;case 5:return f;case 6:return y;case 2:Re.call(b,f)}else if(o)return!1;return i?-1:r||o?o:b}},De={forEach:Pe(0),map:Pe(1),filter:Pe(2),some:Pe(3),every:Pe(4),find:Pe(5),findIndex:Pe(6)},ke=Object.defineProperty,Ce={},Ne=function(t){throw t},Fe=De.forEach,Ve=!!(je=[]["forEach"])&&a((function(){je.call(null,xe||function(){throw 1},1)})),Be=function(t,e){if(H(Ce,t))return Ce[t];e||(e={});var n=[][t],r=!!H(e,"ACCESSORS")&&e.ACCESSORS,o=H(e,0)?e[0]:Ne,i=H(e,1)?e[1]:void 0;return Ce[t]=!!n&&!a((function(){if(r&&!b)return!0;var t={length:-1};r?ke(t,1,{enumerable:!0,get:Ne}):t[1]=1,n.call(t,o,i)}))}("forEach"),He=Ve&&Be?[].forEach:function(t){return Fe(this,t,arguments.length>1?arguments[1]:void 0)};St({target:"Array",proto:!0,forced:[].forEach!=He},{forEach:He});var Ue=function(t){return mt[t+"Prototype"]},qe=Ue("Array").forEach,Ge=Array.prototype,We={DOMTokenList:!0,NodeList:!0},ze=function(t){var e=t.forEach;return t===Ge||t instanceof Array&&e===Ge.forEach||We.hasOwnProperty(se(t))?qe:e};!function(){if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=function(t){for(var e=window.document,n=o(e);n;)n=o(e=n.ownerDocument);return e}(),e=[],n=null,r=null;c.prototype.THROTTLE_TIMEOUT=100,c.prototype.POLL_INTERVAL=null,c.prototype.USE_MUTATION_OBSERVER=!0,c._setupCrossOriginUpdater=function(){return n||(n=function(t,n){r=t&&n?f(t,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},e.forEach((function(t){t._checkForIntersections()}))}),n},c._resetCrossOriginUpdater=function(){n=null,r=null},c.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},c.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._unmonitorIntersections(t.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},c.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},c.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},c.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},c.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},c.prototype._monitorIntersections=function(e){var n=e.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(e)){var r=this._checkForIntersections,i=null,c=null;this.POLL_INTERVAL?i=n.setInterval(r,this.POLL_INTERVAL):(s(n,"resize",r,!0),s(e,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(c=new n.MutationObserver(r)).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push((function(){var t=e.defaultView;t&&(i&&t.clearInterval(i),u(t,"resize",r,!0)),u(e,"scroll",r,!0),c&&c.disconnect()}));var a=this.root&&(this.root.ownerDocument||this.root)||t;if(e!=a){var l=o(e);l&&this._monitorIntersections(l.ownerDocument)}}},c.prototype._unmonitorIntersections=function(e){var n=this._monitoringDocuments.indexOf(e);if(-1!=n){var r=this.root&&(this.root.ownerDocument||this.root)||t;if(!this._observationTargets.some((function(t){var n=t.element.ownerDocument;if(n==e)return!0;for(;n&&n!=r;){var i=o(n);if((n=i&&i.ownerDocument)==e)return!0}return!1}))){var i=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),i(),e!=r){var c=o(e);c&&this._unmonitorIntersections(c.ownerDocument)}}}},c.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e<t.length;e++)t[e]()},c.prototype._checkForIntersections=function(){if(this.root||!n||r){var t=this._rootIsInDom(),e=t?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var o=r.element,c=a(o),s=this._rootContainsTarget(o),u=r.entry,l=t&&s&&this._computeTargetAndRootIntersection(o,c,e),f=null;this._rootContainsTarget(o)?n&&!this.root||(f=e):f={top:0,bottom:0,left:0,right:0,width:0,height:0};var h=r.entry=new i({time:window.performance&&performance.now&&performance.now(),target:o,boundingClientRect:c,rootBounds:f,intersectionRect:l});u?t&&s?this._hasCrossedThreshold(u,h)&&this._queuedEntries.push(h):u&&u.isIntersecting&&this._queuedEntries.push(h):this._queuedEntries.push(h)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},c.prototype._computeTargetAndRootIntersection=function(e,o,i){if("none"!=window.getComputedStyle(e).display){for(var c,s,u,l,h,d,v,g,m=o,y=p(e),w=!1;!w&&y;){var b=null,_=1==y.nodeType?window.getComputedStyle(y):{};if("none"==_.display)return null;if(y==this.root||9==y.nodeType)if(w=!0,y==this.root||y==t)n&&!this.root?!r||0==r.width&&0==r.height?(y=null,b=null,m=null):b=r:b=i;else{var S=p(y),E=S&&a(S),T=S&&this._computeTargetAndRootIntersection(S,E,i);E&&T?(y=S,b=f(E,T)):(y=null,m=null)}else{var O=y.ownerDocument;y!=O.body&&y!=O.documentElement&&"visible"!=_.overflow&&(b=a(y))}if(b&&(c=b,s=m,u=void 0,l=void 0,h=void 0,d=void 0,v=void 0,g=void 0,u=Math.max(c.top,s.top),l=Math.min(c.bottom,s.bottom),h=Math.max(c.left,s.left),d=Math.min(c.right,s.right),g=l-u,m=(v=d-h)>=0&&g>=0&&{top:u,bottom:l,left:h,right:d,width:v,height:g}||null),!m)break;y=y&&p(y)}return m}},c.prototype._getRootRect=function(){var e;if(this.root&&!d(this.root))e=a(this.root);else{var n=d(this.root)?this.root:t,r=n.documentElement,o=n.body;e={top:0,left:0,right:r.clientWidth||o.clientWidth,width:r.clientWidth||o.clientWidth,bottom:r.clientHeight||o.clientHeight,height:r.clientHeight||o.clientHeight}}return this._expandRectByRootMargin(e)},c.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map((function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100})),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},c.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,r=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==r)for(var o=0;o<this.thresholds.length;o++){var i=this.thresholds[o];if(i==n||i==r||i<n!=i<r)return!0}},c.prototype._rootIsInDom=function(){return!this.root||h(t,this.root)},c.prototype._rootContainsTarget=function(e){var n=this.root&&(this.root.ownerDocument||this.root)||t;return h(n,e)&&(!this.root||n==e.ownerDocument)},c.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},c.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},window.IntersectionObserver=c,window.IntersectionObserverEntry=i}function o(t){try{return t.defaultView&&t.defaultView.frameElement||null}catch(t){return null}}function i(t){this.time=t.time,this.target=t.target,this.rootBounds=l(t.rootBounds),this.boundingClientRect=l(t.boundingClientRect),this.intersectionRect=l(t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,r=this.intersectionRect,o=r.width*r.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function c(t,e){var n,r,o,i=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType&&9!=i.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),r=this.THROTTLE_TIMEOUT,o=null,function(){o||(o=setTimeout((function(){n(),o=null}),r))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map((function(t){return t.value+t.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function s(t,e,n,r){"function"==typeof t.addEventListener?t.addEventListener(e,n,r||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function u(t,e,n,r){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,r||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function a(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function l(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function f(t,e){var n=e.top-t.top,r=e.left-t.left;return{top:n,left:r,height:e.height,width:e.width,bottom:n+e.height,right:r+e.width}}function h(t,e){for(var n=e;n;){if(n==t)return!0;n=p(n)}return!1}function p(e){var n=e.parentNode;return 9==e.nodeType&&e!=t?o(e):(n&&n.assignedSlot&&(n=n.assignedSlot.parentNode),n&&11==n.nodeType&&n.host?n.host:n)}function d(t){return t&&9===t.nodeType}}();const $e={loading:"正在加载...",noMore:"没有更多了~"};var Ye=e.defineComponent({name:"load",data:()=>({nextStatus:""}),props:{invisible:{type:Boolean,default:!1}},emits:["load"],computed:{pullupText(){return $e[this.nextStatus]}},methods:{onLoadMore(){this.nextStatus="loading",this.$emit("load",t=>{this.finished(t)})},refresh(){this.nextStatus="more"},finished(t=!1){this.nextStatus=t?"noMore":"more"}},directives:{load:{mounted:(t,{value:e})=>{t.ob=new IntersectionObserver(n=>{ze(n).call(n,n=>{n.target===t&&n.intersectionRatio>0&&e()})}),t.ob.observe(t)},unmounted:t=>{t.ob.unobserve(t)}}}});const Ke=e.withScopeId("data-v-639774c9");e.pushScopeId("data-v-639774c9");const Xe={class:"pd flex-center"},Je={key:0},Qe={class:"dui-icon__loading mr-xs"};e.popScopeId();const Ze=Ke((function(t,n,r,o,i,c){const s=e.resolveDirective("load");return e.openBlock(),e.createBlock("div",Xe,["more"===t.nextStatus?e.withDirectives((e.openBlock(),e.createBlock("div",Je,null,512)),[[s,t.onLoadMore]]):"loading"===t.nextStatus||"noMore"===t.nextStatus&&!t.invisible?(e.openBlock(),e.createBlock(e.Fragment,{key:1},[e.withDirectives(e.createVNode("i",Qe,null,512),[[e.vShow,"loading"===t.nextStatus]]),e.createTextVNode(" "+e.toDisplayString(t.pullupText),1)],64)):e.createCommentVNode("v-if",!0)])}));u(".dui-icon__loading[data-v-639774c9]{width:18px;height:18px}"),Ye.render=Ze,Ye.__scopeId="data-v-639774c9",Ye.__file="src/components/load-more/load.vue";var tn=Pt("iterator"),en=Array.prototype,nn=Pt("iterator"),rn=function(t){var e=t.return;if(void 0!==e)return I(e.call(t)).value},on=function(t,e){this.stopped=t,this.result=e},cn=function(t,e,n){var r,o,i,c,s,u,a,l,f=n&&n.that,h=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),v=wt(e,f,1+h+d),m=function(t){return r&&rn(r),new on(!0,t)},y=function(t){return h?(I(t),d?v(t[0],t[1],m):v(t[0],t[1])):d?v(t,m):v(t)};if(p)r=t;else{if("function"!=typeof(o=function(t){if(null!=t)return t[nn]||t["@@iterator"]||g[se(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(l=o)&&(g.Array===l||en[tn]===l)){for(i=0,c=Ht(t.length);c>i;i++)if((s=y(t[i]))&&s instanceof on)return s;return new on(!1)}r=o.call(t)}for(u=r.next;!(a=u.call(r)).done;){try{s=y(a.value)}catch(t){throw rn(r),t}if("object"==typeof s&&s&&s instanceof on)return s}return new on(!1)},sn=function(t,e){var n=this;if(!(n instanceof sn))return new sn(t,e);de&&(n=de(new Error(void 0),xt(n))),void 0!==e&&L(n,"message",String(e));var r=[];return cn(t,r.push,{that:r}),L(n,"errors",r),n};sn.prototype=ne(Error.prototype,{constructor:A(5,sn),message:A(5,""),name:A(5,"AggregateError")}),St({global:!0},{AggregateError:sn});var un=Object.freeze({__proto__:null}),an=w.Promise,ln=Pt("species"),fn=Pt("iterator"),hn=!1;try{var pn=0,dn={next:function(){return{done:!!pn++}},return:function(){hn=!0}};dn[fn]=function(){return this},Array.from(dn,(function(){throw 2}))}catch(t){}var vn,gn,mn,yn=Pt("species"),wn=function(t,e){var n,r=I(t).constructor;return void 0===r||null==(n=I(r)[yn])?e:yt(n)},bn=Xt("navigator","userAgent")||"",_n=/(iphone|ipod|ipad).*applewebkit/i.test(bn),Sn="process"==f(w.process),En=w.location,Tn=w.setImmediate,On=w.clearImmediate,In=w.process,xn=w.MessageChannel,jn=w.Dispatch,Mn=0,An={},Ln=function(t){if(An.hasOwnProperty(t)){var e=An[t];delete An[t],e()}},Rn=function(t){return function(){Ln(t)}},Pn=function(t){Ln(t.data)},Dn=function(t){w.postMessage(t+"",En.protocol+"//"+En.host)};Tn&&On||(Tn=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return An[++Mn]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},vn(Mn),Mn},On=function(t){delete An[t]},Sn?vn=function(t){In.nextTick(Rn(t))}:jn&&jn.now?vn=function(t){jn.now(Rn(t))}:xn&&!_n?(mn=(gn=new xn).port2,gn.port1.onmessage=Pn,vn=wt(mn.postMessage,mn,1)):w.addEventListener&&"function"==typeof postMessage&&!w.importScripts&&En&&"file:"!==En.protocol&&!a(Dn)?(vn=Dn,w.addEventListener("message",Pn,!1)):vn="onreadystatechange"in T("script")?function(t){Jt.appendChild(T("script")).onreadystatechange=function(){Jt.removeChild(this),Ln(t)}}:function(t){setTimeout(Rn(t),0)});var kn,Cn,Nn,Fn,Vn,Bn,Hn,Un,qn={set:Tn,clear:On},Gn=at.f,Wn=qn.set,zn=w.MutationObserver||w.WebKitMutationObserver,$n=w.document,Yn=w.process,Kn=w.Promise,Xn=Gn(w,"queueMicrotask"),Jn=Xn&&Xn.value;Jn||(kn=function(){var t,e;for(Sn&&(t=Yn.domain)&&t.exit();Cn;){e=Cn.fn,Cn=Cn.next;try{e()}catch(t){throw Cn?Fn():Nn=void 0,t}}Nn=void 0,t&&t.enter()},!_n&&!Sn&&zn&&$n?(Vn=!0,Bn=$n.createTextNode(""),new zn(kn).observe(Bn,{characterData:!0}),Fn=function(){Bn.data=Vn=!Vn}):Kn&&Kn.resolve?(Hn=Kn.resolve(void 0),Un=Hn.then,Fn=function(){Un.call(Hn,kn)}):Fn=Sn?function(){Yn.nextTick(kn)}:function(){Wn.call(w,kn)});var Qn,Zn,tr=Jn||function(t){var e={fn:t,next:void 0};Nn&&(Nn.next=e),Cn||(Cn=e,Fn()),Nn=e},er=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=yt(e),this.reject=yt(n)},nr={f:function(t){return new er(t)}},rr=function(t,e){if(I(t),_(e)&&e.constructor===t)return e;var n=nr.f(t);return(0,n.resolve)(e),n.promise},or=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},ir=w.process,cr=ir&&ir.versions,sr=cr&&cr.v8;sr?Zn=(Qn=sr.split("."))[0]+Qn[1]:bn&&(!(Qn=bn.match(/Edge\/(\d+)/))||Qn[1]>=74)&&(Qn=bn.match(/Chrome\/(\d+)/))&&(Zn=Qn[1]);var ur,ar,lr,fr=Zn&&+Zn,hr=qn.set,pr=Pt("species"),dr="Promise",vr=ot.get,gr=ot.set,mr=ot.getterFor(dr),yr=an,wr=w.TypeError,br=w.document,_r=w.process,Sr=(Xt("fetch"),nr.f),Er=Sr,Tr=!!(br&&br.createEvent&&w.dispatchEvent),Or="function"==typeof PromiseRejectionEvent,Ir=gt(dr,(function(){if(!(N(yr)!==String(yr))){if(66===fr)return!0;if(!Sn&&!Or)return!0}if(!yr.prototype.finally)return!0;if(fr>=51&&/native code/.test(yr))return!1;var t=yr.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[pr]=e,!(t.then((function(){}))instanceof e)})),xr=Ir||!function(t,e){if(!e&&!hn)return!1;var n=!1;try{var r={};r[fn]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){yr.all(t).catch((function(){}))})),jr=function(t){var e;return!(!_(t)||"function"!=typeof(e=t.then))&&e},Mr=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;tr((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var c,s,u,a=n[i++],l=o?a.ok:a.fail,f=a.resolve,h=a.reject,p=a.domain;try{l?(o||(2===t.rejection&&Pr(t),t.rejection=1),!0===l?c=r:(p&&p.enter(),c=l(r),p&&(p.exit(),u=!0)),c===a.promise?h(wr("Promise-chain cycle")):(s=jr(c))?s.call(c,f,h):f(c)):h(r)}catch(t){p&&!u&&p.exit(),h(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&Lr(t)}))}},Ar=function(t,e,n){var r,o;Tr?((r=br.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),w.dispatchEvent(r)):r={promise:e,reason:n},!Or&&(o=w["on"+t])?o(r):"unhandledrejection"===t&&function(t,e){var n=w.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},Lr=function(t){hr.call(w,(function(){var e,n=t.facade,r=t.value;if(Rr(t)&&(e=or((function(){Sn?_r.emit("unhandledRejection",r,n):Ar("unhandledrejection",n,r)})),t.rejection=Sn||Rr(t)?2:1,e.error))throw e.value}))},Rr=function(t){return 1!==t.rejection&&!t.parent},Pr=function(t){hr.call(w,(function(){var e=t.facade;Sn?_r.emit("rejectionHandled",e):Ar("rejectionhandled",e,t.value)}))},Dr=function(t,e,n){return function(r){t(e,r,n)}},kr=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Mr(t,!0))},Cr=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw wr("Promise can't be resolved itself");var r=jr(e);r?tr((function(){var n={done:!1};try{r.call(e,Dr(Cr,n,t),Dr(kr,n,t))}catch(e){kr(n,e,t)}})):(t.value=e,t.state=1,Mr(t,!1))}catch(e){kr({done:!1},e,t)}}};Ir&&(yr=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,yr,dr),yt(t),ur.call(this);var e=vr(this);try{t(Dr(Cr,e),Dr(kr,e))}catch(t){kr(e,t)}},(ur=function(t){gr(this,{type:dr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)n&&n.unsafe&&t[r]?t[r]=e[r]:ve(t,r,e[r],n);return t}(yr.prototype,{then:function(t,e){var n=mr(this),r=Sr(wn(this,yr));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=Sn?_r.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Mr(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),ar=function(){var t=new ur,e=vr(t);this.promise=t,this.resolve=Dr(Cr,e),this.reject=Dr(kr,e)},nr.f=Sr=function(t){return t===yr||t===lr?new ar(t):Er(t)}),St({global:!0,wrap:!0,forced:Ir},{Promise:yr}),fe(yr,dr,!1,!0),function(t){var e=Xt(t),n=M.f;b&&e&&!e[ln]&&n(e,ln,{configurable:!0,get:function(){return this}})}(dr),lr=Xt(dr),St({target:dr,stat:!0,forced:Ir},{reject:function(t){var e=Sr(this);return e.reject.call(void 0,t),e.promise}}),St({target:dr,stat:!0,forced:!0},{resolve:function(t){return rr(this===lr?yr:this,t)}}),St({target:dr,stat:!0,forced:xr},{all:function(t){var e=this,n=Sr(e),r=n.resolve,o=n.reject,i=or((function(){var n=yt(e.resolve),i=[],c=0,s=1;cn(t,(function(t){var u=c++,a=!1;i.push(void 0),s++,n.call(e,t).then((function(t){a||(a=!0,i[u]=t,--s||r(i))}),o)})),--s||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Sr(e),r=n.reject,o=or((function(){var o=yt(e.resolve);cn(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}}),St({target:"Promise",stat:!0},{allSettled:function(t){var e=this,n=nr.f(e),r=n.resolve,o=n.reject,i=or((function(){var n=yt(e.resolve),o=[],i=0,c=1;cn(t,(function(t){var s=i++,u=!1;o.push(void 0),c++,n.call(e,t).then((function(t){u||(u=!0,o[s]={status:"fulfilled",value:t},--c||r(o))}),(function(t){u||(u=!0,o[s]={status:"rejected",reason:t},--c||r(o))}))})),--c||r(o)}));return i.error&&o(i.value),n.promise}});St({target:"Promise",stat:!0},{any:function(t){var e=this,n=nr.f(e),r=n.resolve,o=n.reject,i=or((function(){var n=yt(e.resolve),i=[],c=0,s=1,u=!1;cn(t,(function(t){var a=c++,l=!1;i.push(void 0),s++,n.call(e,t).then((function(t){l||u||(u=!0,r(t))}),(function(t){l||u||(l=!0,i[a]=t,--s||o(new(Xt("AggregateError"))(i,"No one promise resolved")))}))})),--s||o(new(Xt("AggregateError"))(i,"No one promise resolved"))}));return i.error&&o(i.value),n.promise}});var Nr=!!an&&a((function(){an.prototype.finally.call({then:function(){}},(function(){}))}));St({target:"Promise",proto:!0,real:!0,forced:Nr},{finally:function(t){var e=wn(this,Xt("Promise")),n="function"==typeof t;return this.then(n?function(n){return rr(e,t()).then((function(){return n}))}:t,n?function(n){return rr(e,t()).then((function(){throw n}))}:t)}});var Fr,Vr=function(t){return function(e,n){var r,o,i=String(d(e)),c=Vt(n),s=i.length;return c<0||c>=s?t?"":void 0:(r=i.charCodeAt(c))<55296||r>56319||c+1===s||(o=i.charCodeAt(c+1))<56320||o>57343?t?i.charAt(c):r:t?i.slice(c,c+2):o-56320+(r-55296<<10)+65536}},Br={codeAt:Vr(!1),charAt:Vr(!0)}.charAt,Hr=ot.set,Ur=ot.getterFor("String Iterator");be(String,"String",(function(t){Hr(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=Ur(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=Br(n,r),e.index+=t.length,{value:t,done:!1})})),(Fr=un)&&Fr.default;var qr=mt.Promise,Gr=[].slice,Wr={},zr=function(t,e,n){if(!(e in Wr)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";Wr[e]=Function("C,a","return new C("+r.join(",")+")")}return Wr[e](t,n)},$r=Function.bind||function(t){var e=yt(this),n=Gr.call(arguments,1),r=function(){var o=n.concat(Gr.call(arguments));return this instanceof r?zr(e,o.length,o):e.apply(t,o)};return _(e.prototype)&&(r.prototype=e.prototype),r};St({target:"Function",proto:!0},{bind:$r});var Yr=Ue("Function").bind,Kr=Function.prototype,Xr=function(t){var e=t.bind;return t===Kr||t instanceof Function&&e===Kr.bind?Yr:e},Jr=[].slice,Qr=/MSIE .\./.test(bn),Zr=function(t){return function(e,n){var r=arguments.length>2,o=r?Jr.call(arguments,2):void 0;return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,n)}};St({global:!0,bind:!0,forced:Qr},{setTimeout:Zr(w.setTimeout),setInterval:Zr(w.setInterval)}),St({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}});mt.Date.now;function to(){}class eo{loading=!1;lastPosition=0;constructor(t,{threshold:e,onLoadMore:n=to}){var r;this.threshold=e,this.onLoadMore=n,this.$el=function(t,e){if("function"==typeof t&&(t=t()),t instanceof HTMLElement)return t;try{const e=document.querySelector(t);if(null===e)throw new Error;return e}catch(t){if(void 0!==e)return e;throw new Error("必须提供有效的下拉刷新DOM节点")}}(t,null),this.pullupHeight=this.$el?this.$el.offsetHeight:0,"number"==typeof this.threshold&&(this.pullupHeight=this.threshold),this.handlerScroll=Xr(r=this.handlerScroll).call(r,this),window.addEventListener("scroll",this.handlerScroll,!1)}handlerScroll(){const{scrollTop:t,scrollHeight:e,clientHeight:n}=document.scrollingElement||document.documentElement,r=e-t-n;if(!this.loading&&r<this.lastPosition&&r<=this.pullupHeight){var o;this.loading=!0;const t=this.onLoadMore(Xr(o=this.finished).call(o,this));var i;if(t instanceof qr)t.then(Xr(i=this.finished).call(i,this))}this.loading&&r>this.pullupHeight&&(this.loading=!1),this.lastPosition=r}finished(){this.lastPosition=0}destroy(){window.removeEventListener("scroll",this.handlerScroll,!1)}}const no={install:t=>{t.directive("pullup",{mounted:(t,{value:e})=>{t.pullup=new eo(t,e)},unmounted:t=>{t.pullup.destroy()}})}},ro={install:t=>{t.use(no),t.component(r.name,r),t.component(Ye.name,Ye)}};t.default=ro,t.plugin=ro,Object.defineProperty(t,"__esModule",{value:!0})}(this["load-more"]=this["load-more"]||{},Vue);