@moohng/dui
Version:
基于 Vue 3 的轻量级组件库
2 lines (1 loc) • 24.2 kB
JavaScript
this.pulldown=function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var e=function(t){return t&&t.Math==Math&&t},n=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),r=function(t){try{return!!t()}catch(t){return!0}},o=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),i={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,a={f:c&&!i.call({1:2},1)?function(t){var e=c(this,t);return!!e&&e.enumerable}:i},u=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},s={}.toString,f=function(t){return s.call(t).slice(8,-1)},l="".split,h=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==f(t)?l.call(t,""):Object(t)}:Object,p=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},v=function(t){return h(p(t))},d=function(t){return"object"==typeof t?null!==t:"function"==typeof t},y=function(t,e){if(!d(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!d(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!d(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!d(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},g={}.hasOwnProperty,m=function(t,e){return g.call(t,e)},w=n.document,b=d(w)&&d(w.createElement),S=function(t){return b?w.createElement(t):{}},E=!o&&!r((function(){return 7!=Object.defineProperty(S("div"),"a",{get:function(){return 7}}).a})),j=Object.getOwnPropertyDescriptor,T={f:o?j:function(t,e){if(t=v(t),e=y(e,!0),E)try{return j(t,e)}catch(t){}if(m(t,e))return u(!a.f.call(t,e),t[e])}},O=/#|\.prototype\./,P=function(t,e){var n=M[L(t)];return n==I||n!=A&&("function"==typeof e?r(e):!!e)},L=P.normalize=function(t){return String(t).replace(O,".").toLowerCase()},M=P.data={},A=P.NATIVE="N",I=P.POLYFILL="P",_=P,x={},D=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},F=function(t,e,n){if(D(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)}},R=function(t){if(!d(t))throw TypeError(String(t)+" is not an object");return t},k=Object.defineProperty,$={f:o?k:function(t,e,n){if(R(t),e=y(e,!0),R(n),E)try{return k(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}},Y=o?function(t,e,n){return $.f(t,e,u(1,n))}:function(t,e,n){return t[e]=n,t},C=T.f,N=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},G=function(t,e){var r,o,i,c,a,u,s,f,l=t.target,h=t.global,p=t.stat,v=t.proto,d=h?n:p?n[l]:(n[l]||{}).prototype,y=h?x:x[l]||(x[l]={}),g=y.prototype;for(i in e)r=!_(h?i:l+(p?".":"#")+i,t.forced)&&d&&m(d,i),a=y[i],r&&(u=t.noTargetGet?(f=C(d,i))&&f.value:d[i]),c=r&&u?u:e[i],r&&typeof a==typeof c||(s=t.bind&&r?F(c,n):t.wrap&&r?N(c):v&&"function"==typeof c?F(Function.call,c):c,(t.sham||c&&c.sham||a&&a.sham)&&Y(s,"sham",!0),y[i]=s,v&&(m(x,o=l+"Prototype")||Y(x,o,{}),x[o][i]=c,t.real&&g&&!g[i]&&Y(g,i,c)))},V=function(t){return"function"==typeof t?t:void 0},H=function(t,e){return arguments.length<2?V(x[t])||V(n[t]):x[t]&&x[t][e]||n[t]&&n[t][e]},q=H("navigator","userAgent")||"",z=[].slice,U=/MSIE .\./.test(q),W=function(t){return function(e,n){var r=arguments.length>2,o=r?z.call(arguments,2):void 0;return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,n)}};G({global:!0,bind:!0,forced:U},{setTimeout:W(n.setTimeout),setInterval:W(n.setInterval)});var B,Z=x.setTimeout,K=n["__core-js_shared__"]||function(t,e){try{Y(n,t,e)}catch(r){n[t]=e}return e}("__core-js_shared__",{}),X=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 K[t]||(K[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.7.0",mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),J=0,Q=Math.random(),tt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++J+Q).toString(36)},et=X("keys"),nt=function(t){return et[t]||(et[t]=tt(t))},rt=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ot=nt("IE_PROTO"),it=Object.prototype,ct=rt?Object.getPrototypeOf:function(t){return t=Object(p(t)),m(t,ot)?t[ot]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?it:null},at=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 R(n),function(t){if(!d(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),ut=Math.ceil,st=Math.floor,ft=function(t){return isNaN(t=+t)?0:(t>0?st:ut)(t)},lt=Math.min,ht=function(t){return t>0?lt(ft(t),9007199254740991):0},pt=Math.max,vt=Math.min,dt=function(t){return function(e,n,r){var o,i=v(e),c=ht(i.length),a=function(t,e){var n=ft(t);return n<0?pt(n+e,0):vt(n,e)}(r,c);if(t&&n!=n){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},yt={includes:dt(!0),indexOf:dt(!1)},gt={},mt=yt.indexOf,wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bt=Object.keys||function(t){return function(t,e){var n,r=v(t),o=0,i=[];for(n in r)!m(gt,n)&&m(r,n)&&i.push(n);for(;e.length>o;)m(r,n=e[o++])&&(~mt(i,n)||i.push(n));return i}(t,wt)},St=o?Object.defineProperties:function(t,e){R(t);for(var n,r=bt(e),o=r.length,i=0;o>i;)$.f(t,n=r[i++],e[n]);return t},Et=H("document","documentElement"),jt=nt("IE_PROTO"),Tt=function(){},Ot=function(t){return"<script>"+t+"<\/script>"},Pt=function(){try{B=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;Pt=B?function(t){t.write(Ot("")),t.close();var e=t.parentWindow.Object;return t=null,e}(B):((e=S("iframe")).style.display="none",Et.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Ot("document.F=Object")),t.close(),t.F);for(var n=wt.length;n--;)delete Pt.prototype[wt[n]];return Pt()};gt[jt]=!0;var Lt=Object.create||function(t,e){var n;return null!==t?(Tt.prototype=R(t),n=new Tt,Tt.prototype=null,n[jt]=t):n=Pt(),void 0===e?n:St(n,e)},Mt=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())})),At=Mt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,It=X("wks"),_t=n.Symbol,xt=At?_t:_t&&_t.withoutSetter||tt,Dt=function(t){return m(It,t)||(Mt&&m(_t,t)?It[t]=_t[t]:It[t]=xt("Symbol."+t)),It[t]},Ft={},Rt=Dt("iterator"),kt=Array.prototype,$t={};$t[Dt("toStringTag")]="z";var Yt="[object z]"===String($t),Ct=Dt("toStringTag"),Nt="Arguments"==f(function(){return arguments}()),Gt=Yt?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),Ct))?n:Nt?f(e):"Object"==(r=f(e))&&"function"==typeof e.callee?"Arguments":r},Vt=Dt("iterator"),Ht=function(t){var e=t.return;if(void 0!==e)return R(e.call(t)).value},qt=function(t,e){this.stopped=t,this.result=e},zt=function(t,e,n){var r,o,i,c,a,u,s,f,l=n&&n.that,h=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),d=F(e,l,1+h+v),y=function(t){return r&&Ht(r),new qt(!0,t)},g=function(t){return h?(R(t),v?d(t[0],t[1],y):d(t[0],t[1])):v?d(t,y):d(t)};if(p)r=t;else{if("function"!=typeof(o=function(t){if(null!=t)return t[Vt]||t["@@iterator"]||Ft[Gt(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(f=o)&&(Ft.Array===f||kt[Rt]===f)){for(i=0,c=ht(t.length);c>i;i++)if((a=g(t[i]))&&a instanceof qt)return a;return new qt(!1)}r=o.call(t)}for(u=r.next;!(s=u.call(r)).done;){try{a=g(s.value)}catch(t){throw Ht(r),t}if("object"==typeof a&&a&&a instanceof qt)return a}return new qt(!1)},Ut=function(t,e){var n=this;if(!(n instanceof Ut))return new Ut(t,e);at&&(n=at(new Error(void 0),ct(n))),void 0!==e&&Y(n,"message",String(e));var r=[];return zt(t,r.push,{that:r}),Y(n,"errors",r),n};Ut.prototype=Lt(Error.prototype,{constructor:u(5,Ut),message:u(5,""),name:u(5,"AggregateError")}),G({global:!0},{AggregateError:Ut});var Wt=n.Promise,Bt=function(t,e,n,r){r&&r.enumerable?t[e]=n:Y(t,e,n)},Zt=Yt?{}.toString:function(){return"[object "+Gt(this)+"]"},Kt=$.f,Xt=Dt("toStringTag"),Jt=function(t,e,n,r){if(t){var o=n?t:t.prototype;m(o,Xt)||Kt(o,Xt,{configurable:!0,value:e}),r&&!Yt&&Y(o,"toString",Zt)}},Qt=Dt("species"),te=Function.toString;"function"!=typeof K.inspectSource&&(K.inspectSource=function(t){return te.call(t)});var ee=K.inspectSource,ne=Dt("iterator"),re=!1;try{var oe=0,ie={next:function(){return{done:!!oe++}},return:function(){re=!0}};ie[ne]=function(){return this},Array.from(ie,(function(){throw 2}))}catch(t){}var ce,ae,ue,se=Dt("species"),fe=function(t,e){var n,r=R(t).constructor;return void 0===r||null==(n=R(r)[se])?e:D(n)},le=/(iphone|ipod|ipad).*applewebkit/i.test(q),he="process"==f(n.process),pe=n.location,ve=n.setImmediate,de=n.clearImmediate,ye=n.process,ge=n.MessageChannel,me=n.Dispatch,we=0,be={},Se=function(t){if(be.hasOwnProperty(t)){var e=be[t];delete be[t],e()}},Ee=function(t){return function(){Se(t)}},je=function(t){Se(t.data)},Te=function(t){n.postMessage(t+"",pe.protocol+"//"+pe.host)};ve&&de||(ve=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return be[++we]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},ce(we),we},de=function(t){delete be[t]},he?ce=function(t){ye.nextTick(Ee(t))}:me&&me.now?ce=function(t){me.now(Ee(t))}:ge&&!le?(ue=(ae=new ge).port2,ae.port1.onmessage=je,ce=F(ue.postMessage,ue,1)):n.addEventListener&&"function"==typeof postMessage&&!n.importScripts&&pe&&"file:"!==pe.protocol&&!r(Te)?(ce=Te,n.addEventListener("message",je,!1)):ce="onreadystatechange"in S("script")?function(t){Et.appendChild(S("script")).onreadystatechange=function(){Et.removeChild(this),Se(t)}}:function(t){setTimeout(Ee(t),0)});var Oe,Pe,Le,Me,Ae,Ie,_e,xe,De={set:ve,clear:de},Fe=T.f,Re=De.set,ke=n.MutationObserver||n.WebKitMutationObserver,$e=n.document,Ye=n.process,Ce=n.Promise,Ne=Fe(n,"queueMicrotask"),Ge=Ne&&Ne.value;Ge||(Oe=function(){var t,e;for(he&&(t=Ye.domain)&&t.exit();Pe;){e=Pe.fn,Pe=Pe.next;try{e()}catch(t){throw Pe?Me():Le=void 0,t}}Le=void 0,t&&t.enter()},!le&&!he&&ke&&$e?(Ae=!0,Ie=$e.createTextNode(""),new ke(Oe).observe(Ie,{characterData:!0}),Me=function(){Ie.data=Ae=!Ae}):Ce&&Ce.resolve?(_e=Ce.resolve(void 0),xe=_e.then,Me=function(){xe.call(_e,Oe)}):Me=he?function(){Ye.nextTick(Oe)}:function(){Re.call(n,Oe)});var Ve,He,qe,ze=Ge||function(t){var e={fn:t,next:void 0};Le&&(Le.next=e),Pe||(Pe=e,Me()),Le=e},Ue=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=D(e),this.reject=D(n)},We={f:function(t){return new Ue(t)}},Be=function(t,e){if(R(t),d(e)&&e.constructor===t)return e;var n=We.f(t);return(0,n.resolve)(e),n.promise},Ze=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Ke=n.WeakMap,Xe="function"==typeof Ke&&/native code/.test(ee(Ke)),Je=n.WeakMap;if(Xe){var Qe=K.state||(K.state=new Je),tn=Qe.get,en=Qe.has,nn=Qe.set;Ve=function(t,e){return e.facade=t,nn.call(Qe,t,e),e},He=function(t){return tn.call(Qe,t)||{}},qe=function(t){return en.call(Qe,t)}}else{var rn=nt("state");gt[rn]=!0,Ve=function(t,e){return e.facade=t,Y(t,rn,e),e},He=function(t){return m(t,rn)?t[rn]:{}},qe=function(t){return m(t,rn)}}var on,cn,an={set:Ve,get:He,has:qe,enforce:function(t){return qe(t)?He(t):Ve(t,{})},getterFor:function(t){return function(e){var n;if(!d(e)||(n=He(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},un=n.process,sn=un&&un.versions,fn=sn&&sn.v8;fn?cn=(on=fn.split("."))[0]+on[1]:q&&(!(on=q.match(/Edge\/(\d+)/))||on[1]>=74)&&(on=q.match(/Chrome\/(\d+)/))&&(cn=on[1]);var ln,hn,pn,vn=cn&&+cn,dn=De.set,yn=Dt("species"),gn="Promise",mn=an.get,wn=an.set,bn=an.getterFor(gn),Sn=Wt,En=n.TypeError,jn=n.document,Tn=n.process,On=(H("fetch"),We.f),Pn=On,Ln=!!(jn&&jn.createEvent&&n.dispatchEvent),Mn="function"==typeof PromiseRejectionEvent,An=_(gn,(function(){if(!(ee(Sn)!==String(Sn))){if(66===vn)return!0;if(!he&&!Mn)return!0}if(!Sn.prototype.finally)return!0;if(vn>=51&&/native code/.test(Sn))return!1;var t=Sn.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[yn]=e,!(t.then((function(){}))instanceof e)})),In=An||!function(t,e){if(!e&&!re)return!1;var n=!1;try{var r={};r[ne]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){Sn.all(t).catch((function(){}))})),_n=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},xn=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;ze((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var c,a,u,s=n[i++],f=o?s.ok:s.fail,l=s.resolve,h=s.reject,p=s.domain;try{f?(o||(2===t.rejection&&kn(t),t.rejection=1),!0===f?c=r:(p&&p.enter(),c=f(r),p&&(p.exit(),u=!0)),c===s.promise?h(En("Promise-chain cycle")):(a=_n(c))?a.call(c,l,h):l(c)):h(r)}catch(t){p&&!u&&p.exit(),h(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&Fn(t)}))}},Dn=function(t,e,r){var o,i;Ln?((o=jn.createEvent("Event")).promise=e,o.reason=r,o.initEvent(t,!1,!0),n.dispatchEvent(o)):o={promise:e,reason:r},!Mn&&(i=n["on"+t])?i(o):"unhandledrejection"===t&&function(t,e){var r=n.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))}("Unhandled promise rejection",r)},Fn=function(t){dn.call(n,(function(){var e,n=t.facade,r=t.value;if(Rn(t)&&(e=Ze((function(){he?Tn.emit("unhandledRejection",r,n):Dn("unhandledrejection",n,r)})),t.rejection=he||Rn(t)?2:1,e.error))throw e.value}))},Rn=function(t){return 1!==t.rejection&&!t.parent},kn=function(t){dn.call(n,(function(){var e=t.facade;he?Tn.emit("rejectionHandled",e):Dn("rejectionhandled",e,t.value)}))},$n=function(t,e,n){return function(r){t(e,r,n)}},Yn=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,xn(t,!0))},Cn=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw En("Promise can't be resolved itself");var r=_n(e);r?ze((function(){var n={done:!1};try{r.call(e,$n(Cn,n,t),$n(Yn,n,t))}catch(e){Yn(n,e,t)}})):(t.value=e,t.state=1,xn(t,!1))}catch(e){Yn({done:!1},e,t)}}};An&&(Sn=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,Sn,gn),D(t),ln.call(this);var e=mn(this);try{t($n(Cn,e),$n(Yn,e))}catch(t){Yn(e,t)}},(ln=function(t){wn(this,{type:gn,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]:Bt(t,r,e[r],n);return t}(Sn.prototype,{then:function(t,e){var n=bn(this),r=On(fe(this,Sn));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=he?Tn.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&xn(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),hn=function(){var t=new ln,e=mn(t);this.promise=t,this.resolve=$n(Cn,e),this.reject=$n(Yn,e)},We.f=On=function(t){return t===Sn||t===pn?new hn(t):Pn(t)}),G({global:!0,wrap:!0,forced:An},{Promise:Sn}),Jt(Sn,gn,!1,!0),function(t){var e=H(t),n=$.f;o&&e&&!e[Qt]&&n(e,Qt,{configurable:!0,get:function(){return this}})}(gn),pn=H(gn),G({target:gn,stat:!0,forced:An},{reject:function(t){var e=On(this);return e.reject.call(void 0,t),e.promise}}),G({target:gn,stat:!0,forced:!0},{resolve:function(t){return Be(this===pn?Sn:this,t)}}),G({target:gn,stat:!0,forced:In},{all:function(t){var e=this,n=On(e),r=n.resolve,o=n.reject,i=Ze((function(){var n=D(e.resolve),i=[],c=0,a=1;zt(t,(function(t){var u=c++,s=!1;i.push(void 0),a++,n.call(e,t).then((function(t){s||(s=!0,i[u]=t,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=On(e),r=n.reject,o=Ze((function(){var o=D(e.resolve);zt(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}}),G({target:"Promise",stat:!0},{allSettled:function(t){var e=this,n=We.f(e),r=n.resolve,o=n.reject,i=Ze((function(){var n=D(e.resolve),o=[],i=0,c=1;zt(t,(function(t){var a=i++,u=!1;o.push(void 0),c++,n.call(e,t).then((function(t){u||(u=!0,o[a]={status:"fulfilled",value:t},--c||r(o))}),(function(t){u||(u=!0,o[a]={status:"rejected",reason:t},--c||r(o))}))})),--c||r(o)}));return i.error&&o(i.value),n.promise}});G({target:"Promise",stat:!0},{any:function(t){var e=this,n=We.f(e),r=n.resolve,o=n.reject,i=Ze((function(){var n=D(e.resolve),i=[],c=0,a=1,u=!1;zt(t,(function(t){var s=c++,f=!1;i.push(void 0),a++,n.call(e,t).then((function(t){f||u||(u=!0,r(t))}),(function(t){f||u||(f=!0,i[s]=t,--a||o(new(H("AggregateError"))(i,"No one promise resolved")))}))})),--a||o(new(H("AggregateError"))(i,"No one promise resolved"))}));return i.error&&o(i.value),n.promise}});var Nn=!!Wt&&r((function(){Wt.prototype.finally.call({then:function(){}},(function(){}))}));G({target:"Promise",proto:!0,real:!0,forced:Nn},{finally:function(t){var e=fe(this,H("Promise")),n="function"==typeof t;return this.then(n?function(n){return Be(e,t()).then((function(){return n}))}:t,n?function(n){return Be(e,t()).then((function(){throw n}))}:t)}});var Gn,Vn,Hn,qn=function(t){return function(e,n){var r,o,i=String(p(e)),c=ft(n),a=i.length;return c<0||c>=a?t?"":void 0:(r=i.charCodeAt(c))<55296||r>56319||c+1===a||(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}},zn={codeAt:qn(!1),charAt:qn(!0)},Un=(Dt("iterator"),!1);[].keys&&("next"in(Hn=[].keys())?(Vn=ct(ct(Hn)))!==Object.prototype&&(Gn=Vn):Un=!0),null==Gn&&(Gn={});var Wn={IteratorPrototype:Gn,BUGGY_SAFARI_ITERATORS:Un},Bn=Wn.IteratorPrototype,Zn=function(){return this},Kn=Wn.IteratorPrototype,Xn=Wn.BUGGY_SAFARI_ITERATORS,Jn=Dt("iterator"),Qn=function(){return this},tr=function(t,e,n,r,o,i,c){!function(t,e,n){var r=e+" Iterator";t.prototype=Lt(Bn,{next:u(1,n)}),Jt(t,r,!1,!0),Ft[r]=Zn}(n,e,r);var a,s,f,l=function(t){if(t===o&&y)return y;if(!Xn&&t in v)return v[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",p=!1,v=t.prototype,d=v[Jn]||v["@@iterator"]||o&&v[o],y=!Xn&&d||l(o),g="Array"==e&&v.entries||d;if(g&&(a=ct(g.call(new t)),Kn!==Object.prototype&&a.next&&(Jt(a,h,!0,!0),Ft[h]=Qn)),"values"==o&&d&&"values"!==d.name&&(p=!0,y=function(){return d.call(this)}),c&&v[Jn]!==y&&Y(v,Jn,y),Ft[e]=y,o)if(s={values:l("values"),keys:i?y:l("keys"),entries:l("entries")},c)for(f in s)(Xn||p||!(f in v))&&Bt(v,f,s[f]);else G({target:e,proto:!0,forced:Xn||p},s);return s},er=zn.charAt,nr=an.set,rr=an.getterFor("String Iterator");tr(String,"String",(function(t){nr(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=rr(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=er(n,r),e.index+=t.length,{value:t,done:!1})}));var or=an.set,ir=an.getterFor("Array Iterator");tr(Array,"Array",(function(t,e){or(this,{type:"Array Iterator",target:v(t),index:0,kind:e})}),(function(){var t=ir(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");Ft.Arguments=Ft.Array;var cr=Dt("toStringTag");for(var ar 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 ur=n[ar],sr=ur&&ur.prototype;sr&&Gt(sr)!==cr&&Y(sr,cr,ar),Ft[ar]=Ft.Array}var fr=x.Promise,lr=[].slice,hr={},pr=function(t,e,n){if(!(e in hr)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";hr[e]=Function("C,a","return new C("+r.join(",")+")")}return hr[e](t,n)},vr=Function.bind||function(t){var e=D(this),n=lr.call(arguments,1),r=function(){var o=n.concat(lr.call(arguments));return this instanceof r?pr(e,o.length,o):e.apply(t,o)};return d(e.prototype)&&(r.prototype=e.prototype),r};G({target:"Function",proto:!0},{bind:vr});var dr,yr=(dr="Function",x[dr+"Prototype"]).bind,gr=Function.prototype,mr=function(t){var e=t.bind;return t===gr||t instanceof Function&&e===gr.bind?yr:e};G({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}});x.Date.now;function wr(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节点")}}function br(){}class Sr{startY=0;pageMoveY=0;stopY=0;isFirst=!0;canPullDown=!1;isRefreshing=!1;isScrolling=!1;constructor(t,{scroller:e=document.scrollingElement||document.documentElement,threshold:n=0,stopTime:r=400,bounceTime:o=200,onPullDownRefresh:i=br,onPullDown:c=br}){var a,u,s;this.el=t,this.$scroller=wr(e),this.threshold=n,this.stopTime=r,this.bounceTime=o,this.onPullDownRefresh=i,this.onPullDown=c,this.handlerStart=mr(a=this.handlerStart).call(a,this),this.handlerMove=mr(u=this.handlerMove).call(u,this),this.handlerEnd=mr(s=this.handlerEnd).call(s,this),this.init()}init(){this.$el=wr(this.el),this.$container=this.$el.parentElement,this.stopY=this.$el.offsetHeight,this.threshold=this.threshold||1.12*this.stopY;const{style:t}=this.$el;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.transform="translateY(-100%) translateZ(0)",this.$container.style.position="relative",this.$container.addEventListener("touchstart",this.handlerStart),this.$container.addEventListener("touchmove",this.handlerMove,{passive:!1}),this.$container.addEventListener("touchend",this.handlerEnd),this.$container.addEventListener("touchcancel",this.handlerEnd)}destroy(){this.$container.removeEventListener("touchstart",this.handlerStart),this.$container.removeEventListener("touchmove",this.handlerMove,{passive:!1}),this.$container.removeEventListener("touchend",this.handlerEnd),this.$container.removeEventListener("touchcancel",this.handlerEnd)}handlerEnd(){if(this.canPullDown)if(this.canPullDown=!1,this.pageMoveY>this.threshold){var t;this.isRefreshing=!0,this.ani(this.$container,this.stopY,this.bounceTime);const e=this.onPullDownRefresh(mr(t=this.finished).call(t,this));e instanceof fr&&e.finally(()=>{this.finished()})}else this.ani(this.$container,0,this.bounceTime)}handlerMove(t){const e=t.touches[0].pageY;let n=e-this.startY;n>0&&!this.isRefreshing&&!this.isScrolling&&this.$scroller.scrollTop<=0&&(t.preventDefault(),this.isFirst&&(this.isFirst=!1,this.startY=e,n=0,this.canPullDown=!0),this.pageMoveY=.4*n,this.ani(this.$container,this.pageMoveY),this.onPullDown(this.pageMoveY,this.pageMoveY>this.threshold))}handlerStart(t){this.startY=t.touches[0].pageY}ani(t,e,n,r){t.style.transform=`translateY(${e}px) translateZ(0)`,n&&(this.isScrolling=!0,t.style.transition=`transform ${n}ms ease`,Z(()=>{t.style.transition="",this.isScrolling=!1,this.isFirst=!0,"function"==typeof r&&r()},n))}finished(){Z(()=>{this.ani(this.$container,0,this.bounceTime,()=>{this.isRefreshing=!1})},this.stopTime)}}return{install:t=>{t.directive("pulldown",{mounted(t,{value:e}){t.pulldown=new Sr(t,e)},unmounted(t){t.pulldown.destroy()}})}}}();