@ahooksjs/use-request
Advanced tools
Comparing version 2.8.11 to 2.8.12
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("React")):"function"==typeof define&&define.amd?define(["React"],n):"object"==typeof exports?exports.ahooksUseRequest=n(require("React")):t.ahooksUseRequest=n(t.React)}(this,(function(t){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=97)}([function(n,e){n.exports=t},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n,e){var r=e(29)("wks"),o=e(22),i=e(1).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){t.exports=!e(9)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,n,e){var r=e(1),o=e(7),i=e(11),u=e(12),c=e(19),a=function(t,n,e){var f,s,l,p,v=t&a.F,h=t&a.G,d=t&a.S,y=t&a.P,g=t&a.B,b=h?r:d?r[n]||(r[n]={}):(r[n]||{}).prototype,m=h?o:o[n]||(o[n]={}),O=m.prototype||(m.prototype={});for(f in h&&(e=n),e)l=((s=!v&&b&&void 0!==b[f])?b:e)[f],p=g&&s?c(l,r):y&&"function"==typeof l?c(Function.call,l):l,b&&u(b,f,l,t&a.U),m[f]!=l&&i(m,f,p),y&&O[f]!=l&&(O[f]=l)};r.core=o,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,n,e){var r=e(3);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},function(t,n,e){var r=e(6),o=e(48),i=e(33),u=Object.defineProperty;n.f=e(4)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){"use strict";var r=e(80),o=e(55),i=e(26),u=e(15);t.exports=e(43)(Array,"Array",(function(t,n){this._t=u(t),this._i=0,this._k=n}),(function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,o(1)):o(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,n,e){var r=e(8),o=e(28);t.exports=e(4)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(1),o=e(11),i=e(13),u=e(22)("src"),c=e(69),a=(""+c).split("toString");e(7).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,e,c){var f="function"==typeof e;f&&(i(e,"name")||o(e,"name",n)),t[n]!==e&&(f&&(i(e,u)||o(e,u,t[n]?""+t[n]:a.join(String(n)))),t===r?t[n]=e:c?t[n]?t[n]=e:o(t,n,e):(delete t[n],o(t,n,e)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[u]||c.call(this)}))},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){var r=e(49),o=e(38);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n,e){var r=e(50),o=e(34);t.exports=function(t){return r(o(t))}},function(t,n,e){"use strict";var r=e(77)(!0);e(43)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,n=this._t,e=this._i;return e>=n.length?{value:void 0,done:!0}:(t=r(n,e),this._i+=t.length,{value:t,done:!1})}))},function(t,n,e){"use strict";var r=e(44),o={};o[e(2)("toStringTag")]="z",o+""!="[object z]"&&e(12)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(t,n,e){for(var r=e(10),o=e(14),i=e(12),u=e(1),c=e(11),a=e(26),f=e(2),s=f("iterator"),l=f("toStringTag"),p=a.Array,v={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=o(v),d=0;d<h.length;d++){var y,g=h[d],b=v[g],m=u[g],O=m&&m.prototype;if(O&&(O[s]||c(O,s,p),O[l]||c(O,l,g),a[g]=p,b))for(y in r)O[y]||i(O,y,r[y],!0)}},function(t,n,e){var r=e(30);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){"use strict";var r=e(1),o=e(13),i=e(4),u=e(5),c=e(12),a=e(40).KEY,f=e(9),s=e(29),l=e(25),p=e(22),v=e(2),h=e(52),d=e(72),y=e(73),g=e(74),b=e(6),m=e(3),O=e(31),j=e(15),w=e(33),x=e(28),_=e(41),S=e(76),T=e(54),E=e(39),P=e(8),k=e(14),M=T.f,R=P.f,F=S.f,L=r.Symbol,C=r.JSON,D=C&&C.stringify,I=v("_hidden"),A=v("toPrimitive"),N={}.propertyIsEnumerable,W=s("symbol-registry"),K=s("symbols"),z=s("op-symbols"),q=Object.prototype,U="function"==typeof L&&!!E.f,V=r.QObject,G=!V||!V.prototype||!V.prototype.findChild,H=i&&f((function(){return 7!=_(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a}))?function(t,n,e){var r=M(q,n);r&&delete q[n],R(t,n,e),r&&t!==q&&R(q,n,r)}:R,$=function(t){var n=K[t]=_(L.prototype);return n._k=t,n},Y=U&&"symbol"==typeof L.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof L},B=function(t,n,e){return t===q&&B(z,n,e),b(t),n=w(n,!0),b(e),o(K,n)?(e.enumerable?(o(t,I)&&t[I][n]&&(t[I][n]=!1),e=_(e,{enumerable:x(0,!1)})):(o(t,I)||R(t,I,x(1,{})),t[I][n]=!0),H(t,n,e)):R(t,n,e)},J=function(t,n){b(t);for(var e,r=y(n=j(n)),o=0,i=r.length;i>o;)B(t,e=r[o++],n[e]);return t},Q=function(t){var n=N.call(this,t=w(t,!0));return!(this===q&&o(K,t)&&!o(z,t))&&(!(n||!o(this,t)||!o(K,t)||o(this,I)&&this[I][t])||n)},X=function(t,n){if(t=j(t),n=w(n,!0),t!==q||!o(K,n)||o(z,n)){var e=M(t,n);return!e||!o(K,n)||o(t,I)&&t[I][n]||(e.enumerable=!0),e}},Z=function(t){for(var n,e=F(j(t)),r=[],i=0;e.length>i;)o(K,n=e[i++])||n==I||n==a||r.push(n);return r},tt=function(t){for(var n,e=t===q,r=F(e?z:j(t)),i=[],u=0;r.length>u;)!o(K,n=r[u++])||e&&!o(q,n)||i.push(K[n]);return i};U||(c((L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),n=function(e){this===q&&n.call(z,e),o(this,I)&&o(this[I],t)&&(this[I][t]=!1),H(this,t,x(1,e))};return i&&G&&H(q,t,{configurable:!0,set:n}),$(t)}).prototype,"toString",(function(){return this._k})),T.f=X,P.f=B,e(53).f=S.f=Z,e(24).f=Q,E.f=tt,i&&!e(23)&&c(q,"propertyIsEnumerable",Q,!0),h.f=function(t){return $(v(t))}),u(u.G+u.W+u.F*!U,{Symbol:L});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;nt.length>et;)v(nt[et++]);for(var rt=k(v.store),ot=0;rt.length>ot;)d(rt[ot++]);u(u.S+u.F*!U,"Symbol",{for:function(t){return o(W,t+="")?W[t]:W[t]=L(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var n in W)if(W[n]===t)return n},useSetter:function(){G=!0},useSimple:function(){G=!1}}),u(u.S+u.F*!U,"Object",{create:function(t,n){return void 0===n?_(t):J(_(t),n)},defineProperty:B,defineProperties:J,getOwnPropertyDescriptor:X,getOwnPropertyNames:Z,getOwnPropertySymbols:tt});var it=f((function(){E.f(1)}));u(u.S+u.F*it,"Object",{getOwnPropertySymbols:function(t){return E.f(O(t))}}),C&&u(u.S+u.F*(!U||f((function(){var t=L();return"[null]"!=D([t])||"{}"!=D({a:t})||"{}"!=D(Object(t))}))),"JSON",{stringify:function(t){for(var n,e,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(e=n=r[1],(m(n)||void 0!==t)&&!Y(t))return g(n)||(n=function(t,n){if("function"==typeof e&&(n=e.call(this,t,n)),!Y(n))return n}),r[1]=n,D.apply(C,r)}}),L.prototype[A]||e(11)(L.prototype,A,L.prototype.valueOf),l(L,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n){t.exports=!1},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){var r=e(8).f,o=e(13),i=e(2)("toStringTag");t.exports=function(t,n,e){t&&!o(t=e?t:t.prototype,i)&&r(t,i,{configurable:!0,value:n})}},function(t,n){t.exports={}},function(t,n,e){var r=e(5);r(r.S+r.F,"Object",{assign:e(70)})},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(7),o=e(1),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(23)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(34);t.exports=function(t){return Object(r(t))}},function(t,n,e){var r=e(3),o=e(1).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,e){var r=e(3);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){var r=e(36),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){var r=e(29)("keys"),o=e(22);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,e){var r=e(22)("meta"),o=e(3),i=e(13),u=e(8).f,c=0,a=Object.isExtensible||function(){return!0},f=!e(9)((function(){return a(Object.preventExtensions({}))})),s=function(t){u(t,r,{value:{i:"O"+ ++c,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,n){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!a(t))return"F";if(!n)return"E";s(t)}return t[r].i},getWeak:function(t,n){if(!i(t,r)){if(!a(t))return!0;if(!n)return!1;s(t)}return t[r].w},onFreeze:function(t){return f&&l.NEED&&a(t)&&!i(t,r)&&s(t),t}}},function(t,n,e){var r=e(6),o=e(75),i=e(38),u=e(37)("IE_PROTO"),c=function(){},a=function(){var t,n=e(32)("iframe"),r=i.length;for(n.style.display="none",e(42).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;r--;)delete a.prototype[i[r]];return a()};t.exports=Object.create||function(t,n){var e;return null!==t?(c.prototype=r(t),e=new c,c.prototype=null,e[u]=t):e=a(),void 0===n?e:o(e,n)}},function(t,n,e){var r=e(1).document;t.exports=r&&r.documentElement},function(t,n,e){"use strict";var r=e(23),o=e(5),i=e(12),u=e(11),c=e(26),a=e(78),f=e(25),s=e(79),l=e(2)("iterator"),p=!([].keys&&"next"in[].keys()),v=function(){return this};t.exports=function(t,n,e,h,d,y,g){a(e,n,h);var b,m,O,j=function(t){if(!p&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new e(this,t)}}return function(){return new e(this,t)}},w=n+" Iterator",x="values"==d,_=!1,S=t.prototype,T=S[l]||S["@@iterator"]||d&&S[d],E=T||j(d),P=d?x?j("entries"):E:void 0,k="Array"==n&&S.entries||T;if(k&&(O=s(k.call(new t)))!==Object.prototype&&O.next&&(f(O,w,!0),r||"function"==typeof O[l]||u(O,l,v)),x&&T&&"values"!==T.name&&(_=!0,E=function(){return T.call(this)}),r&&!g||!p&&!_&&S[l]||u(S,l,E),c[n]=E,c[w]=v,d)if(b={values:x?E:j("values"),keys:y?E:j("keys"),entries:P},g)for(m in b)m in S||i(S,m,b[m]);else o(o.P+o.F*(p||_),n,b);return b}},function(t,n,e){var r=e(20),o=e(2)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var n,e,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),o))?e:i?r(n):"Object"==(u=r(n))&&"function"==typeof n.callee?"Arguments":u}},function(t,n){t.exports=function(t,n,e,r){if(!(t instanceof n)||void 0!==r&&r in t)throw TypeError(e+": incorrect invocation!");return t}},function(t,n,e){var r=e(19),o=e(81),i=e(82),u=e(6),c=e(35),a=e(83),f={},s={};(n=t.exports=function(t,n,e,l,p){var v,h,d,y,g=p?function(){return t}:a(t),b=r(e,l,n?2:1),m=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(i(g)){for(v=c(t.length);v>m;m++)if((y=n?b(u(h=t[m])[0],h[1]):b(t[m]))===f||y===s)return y}else for(d=g.call(t);!(h=d.next()).done;)if((y=o(d,b,h.value,n))===f||y===s)return y}).BREAK=f,n.RETURN=s},function(t,n,e){var r=e(12);t.exports=function(t,n,e){for(var o in n)r(t,o,n[o],e);return t}},function(t,n,e){t.exports=!e(4)&&!e(9)((function(){return 7!=Object.defineProperty(e(32)("div"),"a",{get:function(){return 7}}).a}))},function(t,n,e){var r=e(13),o=e(15),i=e(71)(!1),u=e(37)("IE_PROTO");t.exports=function(t,n){var e,c=o(t),a=0,f=[];for(e in c)e!=u&&r(c,e)&&f.push(e);for(;n.length>a;)r(c,e=n[a++])&&(~i(f,e)||f.push(e));return f}},function(t,n,e){var r=e(20);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n,e){var r=e(36),o=Math.max,i=Math.min;t.exports=function(t,n){return(t=r(t))<0?o(t+n,0):i(t,n)}},function(t,n,e){n.f=e(2)},function(t,n,e){var r=e(49),o=e(38).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,n,e){var r=e(24),o=e(28),i=e(15),u=e(33),c=e(13),a=e(48),f=Object.getOwnPropertyDescriptor;n.f=e(4)?f:function(t,n){if(t=i(t),n=u(n,!0),a)try{return f(t,n)}catch(t){}if(c(t,n))return o(!r.f.call(t,n),t[n])}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,e){"use strict";var r,o,i,u,c=e(23),a=e(1),f=e(19),s=e(44),l=e(5),p=e(3),v=e(30),h=e(45),d=e(46),y=e(57),g=e(58).set,b=e(85)(),m=e(59),O=e(86),j=e(87),w=e(60),x=a.TypeError,_=a.process,S=_&&_.versions,T=S&&S.v8||"",E=a.Promise,P="process"==s(_),k=function(){},M=o=m.f,R=!!function(){try{var t=E.resolve(1),n=(t.constructor={})[e(2)("species")]=function(t){t(k,k)};return(P||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof n&&0!==T.indexOf("6.6")&&-1===j.indexOf("Chrome/66")}catch(t){}}(),F=function(t){var n;return!(!p(t)||"function"!=typeof(n=t.then))&&n},L=function(t,n){if(!t._n){t._n=!0;var e=t._c;b((function(){for(var r=t._v,o=1==t._s,i=0,u=function(n){var e,i,u,c=o?n.ok:n.fail,a=n.resolve,f=n.reject,s=n.domain;try{c?(o||(2==t._h&&I(t),t._h=1),!0===c?e=r:(s&&s.enter(),e=c(r),s&&(s.exit(),u=!0)),e===n.promise?f(x("Promise-chain cycle")):(i=F(e))?i.call(e,a,f):a(e)):f(r)}catch(t){s&&!u&&s.exit(),f(t)}};e.length>i;)u(e[i++]);t._c=[],t._n=!1,n&&!t._h&&C(t)}))}},C=function(t){g.call(a,(function(){var n,e,r,o=t._v,i=D(t);if(i&&(n=O((function(){P?_.emit("unhandledRejection",o,t):(e=a.onunhandledrejection)?e({promise:t,reason:o}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",o)})),t._h=P||D(t)?2:1),t._a=void 0,i&&n.e)throw n.v}))},D=function(t){return 1!==t._h&&0===(t._a||t._c).length},I=function(t){g.call(a,(function(){var n;P?_.emit("rejectionHandled",t):(n=a.onrejectionhandled)&&n({promise:t,reason:t._v})}))},A=function(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),L(n,!0))},N=function(t){var n,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw x("Promise can't be resolved itself");(n=F(t))?b((function(){var r={_w:e,_d:!1};try{n.call(t,f(N,r,1),f(A,r,1))}catch(t){A.call(r,t)}})):(e._v=t,e._s=1,L(e,!1))}catch(t){A.call({_w:e,_d:!1},t)}}};R||(E=function(t){h(this,E,"Promise","_h"),v(t),r.call(this);try{t(f(N,this,1),f(A,this,1))}catch(t){A.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=e(47)(E.prototype,{then:function(t,n){var e=M(y(this,E));return e.ok="function"!=typeof t||t,e.fail="function"==typeof n&&n,e.domain=P?_.domain:void 0,this._c.push(e),this._a&&this._a.push(e),this._s&&L(this,!1),e.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=f(N,t,1),this.reject=f(A,t,1)},m.f=M=function(t){return t===E||t===u?new i(t):o(t)}),l(l.G+l.W+l.F*!R,{Promise:E}),e(25)(E,"Promise"),e(61)("Promise"),u=e(7).Promise,l(l.S+l.F*!R,"Promise",{reject:function(t){var n=M(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(c||!R),"Promise",{resolve:function(t){return w(c&&this===u?E:this,t)}}),l(l.S+l.F*!(R&&e(62)((function(t){E.all(t).catch(k)}))),"Promise",{all:function(t){var n=this,e=M(n),r=e.resolve,o=e.reject,i=O((function(){var e=[],i=0,u=1;d(t,!1,(function(t){var c=i++,a=!1;e.push(void 0),u++,n.resolve(t).then((function(t){a||(a=!0,e[c]=t,--u||r(e))}),o)})),--u||r(e)}));return i.e&&o(i.v),e.promise},race:function(t){var n=this,e=M(n),r=e.reject,o=O((function(){d(t,!1,(function(t){n.resolve(t).then(e.resolve,r)}))}));return o.e&&r(o.v),e.promise}})},function(t,n,e){var r=e(6),o=e(30),i=e(2)("species");t.exports=function(t,n){var e,u=r(t).constructor;return void 0===u||null==(e=r(u)[i])?n:o(e)}},function(t,n,e){var r,o,i,u=e(19),c=e(84),a=e(42),f=e(32),s=e(1),l=s.process,p=s.setImmediate,v=s.clearImmediate,h=s.MessageChannel,d=s.Dispatch,y=0,g={},b=function(){var t=+this;if(g.hasOwnProperty(t)){var n=g[t];delete g[t],n()}},m=function(t){b.call(t.data)};p&&v||(p=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return g[++y]=function(){c("function"==typeof t?t:Function(t),n)},r(y),y},v=function(t){delete g[t]},"process"==e(20)(l)?r=function(t){l.nextTick(u(b,t,1))}:d&&d.now?r=function(t){d.now(u(b,t,1))}:h?(i=(o=new h).port2,o.port1.onmessage=m,r=u(i.postMessage,i,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(r=function(t){s.postMessage(t+"","*")},s.addEventListener("message",m,!1)):r="onreadystatechange"in f("script")?function(t){a.appendChild(f("script")).onreadystatechange=function(){a.removeChild(this),b.call(t)}}:function(t){setTimeout(u(b,t,1),0)}),t.exports={set:p,clear:v}},function(t,n,e){"use strict";var r=e(30);function o(t){var n,e;this.promise=new t((function(t,r){if(void 0!==n||void 0!==e)throw TypeError("Bad Promise constructor");n=t,e=r})),this.resolve=r(n),this.reject=r(e)}t.exports.f=function(t){return new o(t)}},function(t,n,e){var r=e(6),o=e(3),i=e(59);t.exports=function(t,n){if(r(t),o(n)&&n.constructor===t)return n;var e=i.f(t);return(0,e.resolve)(n),e.promise}},function(t,n,e){"use strict";var r=e(1),o=e(8),i=e(4),u=e(2)("species");t.exports=function(t){var n=r[t];i&&n&&!n[u]&&o.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n,e){var r=e(2)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,(function(){throw 2}))}catch(t){}t.exports=function(t,n){if(!n&&!o)return!1;var e=!1;try{var i=[7],u=i[r]();u.next=function(){return{done:e=!0}},i[r]=function(){return u},t(i)}catch(t){}return e}},function(t,n,e){var r=e(5),o=e(91)(!1);r(r.S,"Object",{values:function(t){return o(t)}})},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){var r=e(3);t.exports=function(t,n){if(!r(t)||t._t!==n)throw TypeError("Incompatible receiver, "+n+" required!");return t}},function(t,n,e){"use strict";var r=e(5),o=e(42),i=e(20),u=e(51),c=e(35),a=[].slice;r(r.P+r.F*e(9)((function(){o&&a.call(o)})),"Array",{slice:function(t,n){var e=c(this.length),r=i(this);if(n=void 0===n?e:n,"Array"==r)return a.call(this,t,n);for(var o=u(t,e),f=u(n,e),s=c(f-o),l=new Array(s),p=0;p<s;p++)l[p]="String"==r?this.charAt(o+p):this[o+p];return l}})},function(t,n,e){(function(n){var e=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof n&&n&&n.Object===Object&&n,a="object"==typeof self&&self&&self.Object===Object&&self,f=c||a||Function("return this")(),s=Object.prototype.toString,l=Math.max,p=Math.min,v=function(){return f.Date.now()};function h(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function d(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==s.call(t)}(t))return NaN;if(h(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=h(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var c=o.test(t);return c||i.test(t)?u(t.slice(2),c?2:8):r.test(t)?NaN:+t}t.exports=function(t,n,e){var r,o,i,u,c,a,f=0,s=!1,y=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(n){var e=r,i=o;return r=o=void 0,f=n,u=t.apply(i,e)}function m(t){return f=t,c=setTimeout(j,n),s?b(t):u}function O(t){var e=t-a;return void 0===a||e>=n||e<0||y&&t-f>=i}function j(){var t=v();if(O(t))return w(t);c=setTimeout(j,function(t){var e=n-(t-a);return y?p(e,i-(t-f)):e}(t))}function w(t){return c=void 0,g&&r?b(t):(r=o=void 0,u)}function x(){var t=v(),e=O(t);if(r=arguments,o=this,a=t,e){if(void 0===c)return m(a);if(y)return c=setTimeout(j,n),b(a)}return void 0===c&&(c=setTimeout(j,n)),u}return n=d(n)||0,h(e)&&(s=!!e.leading,i=(y="maxWait"in e)?l(d(e.maxWait)||0,n):i,g="trailing"in e?!!e.trailing:g),x.cancel=function(){void 0!==c&&clearTimeout(c),f=0,r=a=o=c=void 0},x.flush=function(){return void 0===c?u:w(v())},x}}).call(this,e(64))},function(t,n,e){(function(n){var e=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof n&&n&&n.Object===Object&&n,a="object"==typeof self&&self&&self.Object===Object&&self,f=c||a||Function("return this")(),s=Object.prototype.toString,l=Math.max,p=Math.min,v=function(){return f.Date.now()};function h(t,n,e){var r,o,i,u,c,a,f=0,s=!1,h=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(n){var e=r,i=o;return r=o=void 0,f=n,u=t.apply(i,e)}function m(t){return f=t,c=setTimeout(j,n),s?b(t):u}function O(t){var e=t-a;return void 0===a||e>=n||e<0||h&&t-f>=i}function j(){var t=v();if(O(t))return w(t);c=setTimeout(j,function(t){var e=n-(t-a);return h?p(e,i-(t-f)):e}(t))}function w(t){return c=void 0,g&&r?b(t):(r=o=void 0,u)}function x(){var t=v(),e=O(t);if(r=arguments,o=this,a=t,e){if(void 0===c)return m(a);if(h)return c=setTimeout(j,n),b(a)}return void 0===c&&(c=setTimeout(j,n)),u}return n=y(n)||0,d(e)&&(s=!!e.leading,i=(h="maxWait"in e)?l(y(e.maxWait)||0,n):i,g="trailing"in e?!!e.trailing:g),x.cancel=function(){void 0!==c&&clearTimeout(c),f=0,r=a=o=c=void 0},x.flush=function(){return void 0===c?u:w(v())},x}function d(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function y(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==s.call(t)}(t))return NaN;if(d(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=d(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var c=o.test(t);return c||i.test(t)?u(t.slice(2),c?2:8):r.test(t)?NaN:+t}t.exports=function(t,n,e){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return d(e)&&(r="leading"in e?!!e.leading:r,o="trailing"in e?!!e.trailing:o),h(t,n,{leading:r,maxWait:n,trailing:o})}}).call(this,e(64))},function(t,n,e){t.exports=e(29)("native-function-to-string",Function.toString)},function(t,n,e){"use strict";var r=e(4),o=e(14),i=e(39),u=e(24),c=e(31),a=e(50),f=Object.assign;t.exports=!f||e(9)((function(){var t={},n={},e=Symbol(),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach((function(t){n[t]=t})),7!=f({},t)[e]||Object.keys(f({},n)).join("")!=r}))?function(t,n){for(var e=c(t),f=arguments.length,s=1,l=i.f,p=u.f;f>s;)for(var v,h=a(arguments[s++]),d=l?o(h).concat(l(h)):o(h),y=d.length,g=0;y>g;)v=d[g++],r&&!p.call(h,v)||(e[v]=h[v]);return e}:f},function(t,n,e){var r=e(15),o=e(35),i=e(51);t.exports=function(t){return function(n,e,u){var c,a=r(n),f=o(a.length),s=i(u,f);if(t&&e!=e){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===e)return t||s||0;return!t&&-1}}},function(t,n,e){var r=e(1),o=e(7),i=e(23),u=e(52),c=e(8).f;t.exports=function(t){var n=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,e){var r=e(14),o=e(39),i=e(24);t.exports=function(t){var n=r(t),e=o.f;if(e)for(var u,c=e(t),a=i.f,f=0;c.length>f;)a.call(t,u=c[f++])&&n.push(u);return n}},function(t,n,e){var r=e(20);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,n,e){var r=e(8),o=e(6),i=e(14);t.exports=e(4)?Object.defineProperties:function(t,n){o(t);for(var e,u=i(n),c=u.length,a=0;c>a;)r.f(t,e=u[a++],n[e]);return t}},function(t,n,e){var r=e(15),o=e(53).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return u.slice()}}(t):o(r(t))}},function(t,n,e){var r=e(36),o=e(34);t.exports=function(t){return function(n,e){var i,u,c=String(o(n)),a=r(e),f=c.length;return a<0||a>=f?t?"":void 0:(i=c.charCodeAt(a))<55296||i>56319||a+1===f||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536}}},function(t,n,e){"use strict";var r=e(41),o=e(28),i=e(25),u={};e(11)(u,e(2)("iterator"),(function(){return this})),t.exports=function(t,n,e){t.prototype=r(u,{next:o(1,e)}),i(t,n+" Iterator")}},function(t,n,e){var r=e(13),o=e(31),i=e(37)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,e){var r=e(2)("unscopables"),o=Array.prototype;null==o[r]&&e(11)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,n,e){var r=e(6);t.exports=function(t,n,e,o){try{return o?n(r(e)[0],e[1]):n(e)}catch(n){var i=t.return;throw void 0!==i&&r(i.call(t)),n}}},function(t,n,e){var r=e(26),o=e(2)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,n,e){var r=e(44),o=e(2)("iterator"),i=e(26);t.exports=e(7).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,n){t.exports=function(t,n,e){var r=void 0===e;switch(n.length){case 0:return r?t():t.call(e);case 1:return r?t(n[0]):t.call(e,n[0]);case 2:return r?t(n[0],n[1]):t.call(e,n[0],n[1]);case 3:return r?t(n[0],n[1],n[2]):t.call(e,n[0],n[1],n[2]);case 4:return r?t(n[0],n[1],n[2],n[3]):t.call(e,n[0],n[1],n[2],n[3])}return t.apply(e,n)}},function(t,n,e){var r=e(1),o=e(58).set,i=r.MutationObserver||r.WebKitMutationObserver,u=r.process,c=r.Promise,a="process"==e(20)(u);t.exports=function(){var t,n,e,f=function(){var r,o;for(a&&(r=u.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?e():n=void 0,r}}n=void 0,r&&r.enter()};if(a)e=function(){u.nextTick(f)};else if(!i||r.navigator&&r.navigator.standalone)if(c&&c.resolve){var s=c.resolve(void 0);e=function(){s.then(f)}}else e=function(){o.call(r,f)};else{var l=!0,p=document.createTextNode("");new i(f).observe(p,{characterData:!0}),e=function(){p.data=l=!l}}return function(r){var o={fn:r,next:void 0};n&&(n.next=o),t||(t=o,e()),n=o}}},function(t,n){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,n,e){var r=e(1).navigator;t.exports=r&&r.userAgent||""},function(t,n,e){"use strict";var r=e(5),o=e(7),i=e(1),u=e(57),c=e(60);r(r.P+r.R,"Promise",{finally:function(t){var n=u(this,o.Promise||i.Promise),e="function"==typeof t;return this.then(e?function(e){return c(n,t()).then((function(){return e}))}:t,e?function(e){return c(n,t()).then((function(){throw e}))}:t)}})},function(t,n,e){var r=e(31),o=e(14);e(90)("keys",(function(){return function(t){return o(r(t))}}))},function(t,n,e){var r=e(5),o=e(7),i=e(9);t.exports=function(t,n){var e=(o.Object||{})[t]||Object[t],u={};u[t]=n(e),r(r.S+r.F*i((function(){e(1)})),"Object",u)}},function(t,n,e){var r=e(4),o=e(14),i=e(15),u=e(24).f;t.exports=function(t){return function(n){for(var e,c=i(n),a=o(c),f=a.length,s=0,l=[];f>s;)e=a[s++],r&&!u.call(c,e)||l.push(t?[e,c[e]]:c[e]);return l}}},function(t,n,e){"use strict";var r=e(93),o=e(65);t.exports=e(94)("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var n=r.getEntry(o(this,"Map"),t);return n&&n.v},set:function(t,n){return r.def(o(this,"Map"),0===t?0:t,n)}},r,!0)},function(t,n,e){"use strict";var r=e(8).f,o=e(41),i=e(47),u=e(19),c=e(45),a=e(46),f=e(43),s=e(55),l=e(61),p=e(4),v=e(40).fastKey,h=e(65),d=p?"_s":"size",y=function(t,n){var e,r=v(n);if("F"!==r)return t._i[r];for(e=t._f;e;e=e.n)if(e.k==n)return e};t.exports={getConstructor:function(t,n,e,f){var s=t((function(t,r){c(t,s,n,"_i"),t._t=n,t._i=o(null),t._f=void 0,t._l=void 0,t[d]=0,null!=r&&a(r,e,t[f],t)}));return i(s.prototype,{clear:function(){for(var t=h(this,n),e=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete e[r.i];t._f=t._l=void 0,t[d]=0},delete:function(t){var e=h(this,n),r=y(e,t);if(r){var o=r.n,i=r.p;delete e._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),e._f==r&&(e._f=o),e._l==r&&(e._l=i),e[d]--}return!!r},forEach:function(t){h(this,n);for(var e,r=u(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(r(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!y(h(this,n),t)}}),p&&r(s.prototype,"size",{get:function(){return h(this,n)[d]}}),s},def:function(t,n,e){var r,o,i=y(t,n);return i?i.v=e:(t._l=i={i:o=v(n,!0),k:n,v:e,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[d]++,"F"!==o&&(t._i[o]=i)),t},getEntry:y,setStrong:function(t,n,e){f(t,n,(function(t,e){this._t=h(t,n),this._k=e,this._l=void 0}),(function(){for(var t=this._k,n=this._l;n&&n.r;)n=n.p;return this._t&&(this._l=n=n?n.n:this._t._f)?s(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(this._t=void 0,s(1))}),e?"entries":"values",!e,!0),l(n)}}},function(t,n,e){"use strict";var r=e(1),o=e(5),i=e(12),u=e(47),c=e(40),a=e(46),f=e(45),s=e(3),l=e(9),p=e(62),v=e(25),h=e(95);t.exports=function(t,n,e,d,y,g){var b=r[t],m=b,O=y?"set":"add",j=m&&m.prototype,w={},x=function(t){var n=j[t];i(j,t,"delete"==t||"has"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function(t){return n.call(this,0===t?0:t),this}:function(t,e){return n.call(this,0===t?0:t,e),this})};if("function"==typeof m&&(g||j.forEach&&!l((function(){(new m).entries().next()})))){var _=new m,S=_[O](g?{}:-0,1)!=_,T=l((function(){_.has(1)})),E=p((function(t){new m(t)})),P=!g&&l((function(){for(var t=new m,n=5;n--;)t[O](n,n);return!t.has(-0)}));E||((m=n((function(n,e){f(n,m,t);var r=h(new b,n,m);return null!=e&&a(e,y,r[O],r),r}))).prototype=j,j.constructor=m),(T||P)&&(x("delete"),x("has"),y&&x("get")),(P||S)&&x(O),g&&j.clear&&delete j.clear}else m=d.getConstructor(n,t,y,O),u(m.prototype,e),c.NEED=!0;return v(m,t),w[t]=m,o(o.G+o.W+o.F*(m!=b),w),g||d.setStrong(m,t,y),m}},function(t,n,e){var r=e(3),o=e(96).set;t.exports=function(t,n,e){var i,u=n.constructor;return u!==e&&"function"==typeof u&&(i=u.prototype)!==e.prototype&&r(i)&&o&&o(t,i),t}},function(t,n,e){var r=e(3),o=e(6),i=function(t,n){if(o(t),!r(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,r){try{(r=e(19)(Function.call,e(54).f(Object.prototype,"__proto__").set,2))(t,[]),n=!(t instanceof Array)}catch(t){n=!0}return function(t,e){return i(t,e),n?t.__proto__=e:r(t,e),t}}({},!1):void 0),check:i}},function(t,n,e){"use strict";e.r(n),e.d(n,"useAsync",(function(){return M})),e.d(n,"usePaginated",(function(){return K})),e.d(n,"useLoadMore",(function(){return D})),e.d(n,"UseRequestProvider",(function(){return $})),e.d(n,"UseAPIProvider",(function(){return Y}));e(27),e(21),e(16),e(17),e(10),e(18),e(56);var r=e(0),o=e.n(r),i=(e(88),e(89),e(63),e(67)),u=e.n(i),c=e(68),a=e.n(c);function f(){return"undefined"==typeof document||void 0===document.visibilityState||"hidden"!==document.visibilityState}e(92);var s=new Map,l=function(t){var n=s.get(t);return{data:null==n?void 0:n.data,startTime:null==n?void 0:n.startTime}},p=function(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u},v=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(p(arguments[n]));return t};var h=function(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u},d=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(h(arguments[n]));return t};var y=function(t){var n=Object(r.useRef)((function(){throw new Error("Cannot call an event handler while rendering.")}));n.current=t;var e=Object(r.useCallback)((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=n.current;if(r)return r.apply(void 0,d(t))}),[n]);if("function"==typeof t)return e},g=function(t,n){var e=Object(r.useRef)(!1);Object(r.useEffect)((function(){return function(){e.current=!1}}),[]),Object(r.useEffect)((function(){if(e.current)return t();e.current=!0}),n)},b=[];var m=!1;if("undefined"!=typeof window&&window.addEventListener&&!m){var O=function(){if(f()&&(void 0===navigator.onLine||navigator.onLine))for(var t=0;t<b.length;t++){(0,b[t])()}};window.addEventListener("visibilitychange",O,!1),window.addEventListener("focus",O,!1),m=!0}var j=function(t){return b.push(t),function(){var n=b.indexOf(t);b.splice(n,1)}},w=[];var x=!1;if("undefined"!=typeof window&&window.addEventListener&&!x){window.addEventListener("visibilitychange",(function(){if(f())for(var t=0;t<w.length;t++){(0,w[t])()}}),!1),x=!0}var _=function(t){return w.push(t),function(){var n=w.indexOf(t);w.splice(n,1)}},S=function(){return(S=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},T=function(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u},E=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(T(arguments[n]));return t},P="AHOOKS_USE_REQUEST_DEFAULT_KEY",k=function(){function t(t,n,e,r){var o,i,c;this.count=0,this.pollingWhenVisibleFlag=!1,this.pollingTimer=void 0,this.loadingDelayTimer=void 0,this.unsubscribe=[],this.that=this,this.state={loading:!1,params:[],data:void 0,error:void 0,run:this.run.bind(this.that),mutate:this.mutate.bind(this.that),refresh:this.refresh.bind(this.that),cancel:this.cancel.bind(this.that),unmount:this.unmount.bind(this.that)},this.service=t,this.config=n,this.subscribe=e,r&&(this.state=S(S({},this.state),r)),this.debounceRun=this.config.debounceInterval?u()(this._run,this.config.debounceInterval):void 0,this.throttleRun=this.config.throttleInterval?a()(this._run,this.config.throttleInterval):void 0,this.limitRefresh=(o=this.refresh.bind(this),i=this.config.focusTimespan,c=!1,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];c||(c=!0,o.apply(void 0,v(t)),setTimeout((function(){c=!1}),i))}),this.config.pollingInterval&&this.unsubscribe.push(_(this.rePolling.bind(this))),this.config.refreshOnWindowFocus&&this.unsubscribe.push(j(this.limitRefresh.bind(this)))}return t.prototype.setState=function(t){void 0===t&&(t={}),this.state=S(S({},this.state),t),this.subscribe(this.state)},t.prototype._run=function(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.pollingTimer&&clearTimeout(this.pollingTimer),this.loadingDelayTimer&&clearTimeout(this.loadingDelayTimer),this.count+=1;var r=this.count;return this.setState({loading:!this.config.loadingDelay,params:n}),this.config.loadingDelay&&(this.loadingDelayTimer=setTimeout((function(){t.setState({loading:!0})}),this.config.loadingDelay)),this.service.apply(this,E(n)).then((function(e){if(r!==t.count)return new Promise((function(){}));t.loadingDelayTimer&&clearTimeout(t.loadingDelayTimer);var o=t.config.formatResult?t.config.formatResult(e):e;return t.setState({data:o,error:void 0,loading:!1}),t.config.onSuccess&&t.config.onSuccess(o,n),o})).catch((function(e){if(r!==t.count)return new Promise((function(){}));if(t.loadingDelayTimer&&clearTimeout(t.loadingDelayTimer),t.setState({data:void 0,error:e,loading:!1}),t.config.onError&&t.config.onError(e,n),t.config.throwOnError)throw e;return console.error(e),Promise.reject("useRequest has caught the exception, if you need to handle the exception yourself, you can set options.throwOnError to true.")})).finally((function(){if(r===t.count&&t.config.pollingInterval){if(!f()&&!t.config.pollingWhenHidden)return void(t.pollingWhenVisibleFlag=!0);t.pollingTimer=setTimeout((function(){t._run.apply(t,E(n))}),t.config.pollingInterval)}}))},t.prototype.run=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.debounceRun?(this.debounceRun.apply(this,E(t)),Promise.resolve(null)):this.throttleRun?(this.throttleRun.apply(this,E(t)),Promise.resolve(null)):this._run.apply(this,E(t))},t.prototype.cancel=function(){this.debounceRun&&this.debounceRun.cancel(),this.throttleRun&&this.throttleRun.cancel(),this.loadingDelayTimer&&clearTimeout(this.loadingDelayTimer),this.pollingTimer&&clearTimeout(this.pollingTimer),this.pollingWhenVisibleFlag=!1,this.count+=1,this.setState({loading:!1})},t.prototype.refresh=function(){return this.run.apply(this,E(this.state.params))},t.prototype.rePolling=function(){this.pollingWhenVisibleFlag&&(this.pollingWhenVisibleFlag=!1,this.refresh())},t.prototype.mutate=function(t){"function"==typeof t?this.setState({data:t(this.state.data)||{}}):this.setState({data:t})},t.prototype.unmount=function(){this.cancel(),this.unsubscribe.forEach((function(t){t()}))},t}();var M=function(t,n){var e,o=n||{},i=o.refreshDeps,u=void 0===i?[]:i,c=o.manual,a=void 0!==c&&c,f=o.onSuccess,p=void 0===f?function(){}:f,v=o.onError,h=void 0===v?function(){}:v,d=o.defaultLoading,b=void 0!==d&&d,m=o.loadingDelay,O=o.pollingInterval,j=void 0===O?0:O,w=o.pollingWhenHidden,x=void 0===w||w,_=o.defaultParams,M=void 0===_?[]:_,R=o.refreshOnWindowFocus,F=void 0!==R&&R,L=o.focusTimespan,C=void 0===L?5e3:L,D=o.fetchKey,I=o.cacheKey,A=o.cacheTime,N=void 0===A?3e5:A,W=o.staleTime,K=void 0===W?0:W,z=o.debounceInterval,q=o.throttleInterval,U=o.initialData,V=o.ready,G=void 0===V||V,H=o.throwOnError,$=void 0!==H&&H,Y=Object(r.useRef)(P),B=y(t),J=y(p),Q=y(h),X=y(D);"formatResult"in o&&(e=o.formatResult);var Z={formatResult:y(e),onSuccess:J,onError:Q,loadingDelay:m,pollingInterval:j,pollingWhenHidden:x,refreshOnWindowFocus:!a&&F,focusTimespan:C,debounceInterval:z,throttleInterval:q,throwOnError:$},tt=y((function(t,n){rt((function(e){return e[t]=n,S({},e)}))})),nt=T(Object(r.useState)((function(){var t;if(I){var n=null===(t=l(I))||void 0===t?void 0:t.data;if(n){Y.current=n.newstFetchKey;var e={};return Object.keys(n.fetches).forEach((function(t){var r=n.fetches[t],o=new k(B,Z,tt.bind(null,t),{loading:r.loading,params:r.params,data:r.data,error:r.error});e[t]=o.state})),e}}return{}})),2),et=nt[0],rt=nt[1],ot=Object(r.useRef)(et);ot.current=et;var it=Object(r.useRef)(),ut=Object(r.useCallback)((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(G){if(X){var e=X.apply(void 0,E(t));Y.current=void 0===e?P:e}var r=Y.current,o=ot.current[r];if(!o){var i=new k(B,Z,tt.bind(null,r),{data:U});o=i.state,rt((function(t){return t[r]=o,S({},t)}))}return o.run.apply(o,E(t))}it.current=t}),[D,tt,G]),ct=Object(r.useRef)(ut);ct.current=ut,g((function(){I&&function(t,n,e){var r=s.get(t);(null==r?void 0:r.timer)&&clearTimeout(r.timer);var o=void 0;n>-1&&(o=setTimeout((function(){s.delete(t)}),n)),s.set(t,{data:e,timer:o,startTime:(new Date).getTime()})}(I,N,{fetches:et,newstFetchKey:Y.current})}),[I,et]);var at=Object(r.useRef)(!1);g((function(){G&&(!at.current&&it.current&&ct.current.apply(ct,E(it.current)),at.current=!0)}),[G]),Object(r.useEffect)((function(){var t;if(!a)if(Object.keys(et).length>0){var n=I&&(null===(t=l(I))||void 0===t?void 0:t.startTime)||0;-1===K||(new Date).getTime()-n<=K||Object.values(et).forEach((function(t){t.refresh()}))}else ct.current.apply(ct,E(M))}),[]);var ft=Object(r.useCallback)((function(){Object.values(ot.current).forEach((function(t){t.unmount()})),Y.current=P,rt({}),ot.current={}}),[rt]);g((function(){a||Object.values(ot.current).forEach((function(t){t.refresh()}))}),E(u)),Object(r.useEffect)((function(){return function(){Object.values(ot.current).forEach((function(t){t.unmount()}))}}),[]);var st=Object(r.useCallback)((function(t){return function(){console.warn("You should't call "+t+" when service not executed once.")}}),[]);return S(S({loading:G&&!a||b,data:U,error:void 0,params:[],cancel:st("cancel"),refresh:st("refresh"),mutate:st("mutate")},et[Y.current]||{}),{run:ut,fetches:et,reset:ft})},R=(e(66),function(){return(R=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)}),F=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e},L=function(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u},C=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(L(arguments[n]));return t};var D=function(t,n){var e=n.refreshDeps,o=void 0===e?[]:e,i=n.ref,u=n.isNoMore,c=n.threshold,a=void 0===c?100:c,f=(n.fetchKey,F(n,["refreshDeps","ref","isNoMore","threshold","fetchKey"])),s=L(Object(r.useState)(!1),2),l=s[0],p=s[1];Object(r.useEffect)((function(){n.fetchKey&&console.warn("useRequest loadMore mode don't need fetchKey!")}),[]);var v=M(t,R(R({},f),{fetchKey:function(t){var n;return(null===(n=null==t?void 0:t.list)||void 0===n?void 0:n.length)||0},onSuccess:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];p(!1),n.onSuccess&&n.onSuccess.apply(n,C(t))}})),h=v.data,d=v.run,y=v.params,b=v.reset,m=v.loading,O=v.fetches,j=Object(r.useCallback)((function(){b();var t=L(y).slice(1);d.apply(void 0,C([void 0],t))}),[d,b,y]),w=Object(r.useRef)(j);w.current=j,g((function(){n.manual||w.current()}),C(o));var x=Object(r.useMemo)((function(){var t=[],n=h;return Object.values(O).forEach((function(e){var r,o;(null===(r=e.data)||void 0===r?void 0:r.list)&&(t=t.concat(null===(o=e.data)||void 0===o?void 0:o.list)),e.loading||(n=e.data)})),R(R({},n),{list:t})}),[O,h]),_=!!u&&(!m&&!l&&u(x)),S=Object(r.useCallback)((function(){if(!_){p(!0);var t=L(y).slice(1);d.apply(void 0,C([x],t))}}),[_,d,x,y]),T=function(){!m&&!l&&i&&i.current&&i.current.scrollHeight-i.current.scrollTop<=i.current.clientHeight+a&&S()},E=Object(r.useRef)(T);return E.current=T,Object(r.useEffect)((function(){if(!i||!i.current)return function(){};var t=function(){return E.current()};return i.current.addEventListener("scroll",t),function(){i&&i.current&&i.current.removeEventListener("scroll",t)}}),[E]),R(R({},v),{data:x,reload:j,loading:m&&0===x.list.length,loadMore:S,loadingMore:l,noMore:_})},I=function(){return(I=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},A=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e},N=function(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u},W=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(N(arguments[n]));return t};var K=function(t,n){n.paginated;var e=n.defaultPageSize,o=void 0===e?10:e,i=n.refreshDeps,u=void 0===i?[]:i,c=n.fetchKey,a=A(n,["paginated","defaultPageSize","refreshDeps","fetchKey"]);Object(r.useEffect)((function(){c&&console.error("useRequest pagination's fetchKey will not work!")}),[]);var f=M(t,I({defaultParams:[{current:1,pageSize:o}]},a)),s=f.data,l=f.params,p=f.run,v=f.loading,h=A(f,["data","params","run","loading"]),d=l&&l[0]?l[0]:{},y=d.current,b=void 0===y?1:y,m=d.pageSize,O=void 0===m?o:m,j=d.sorter,w=void 0===j?{}:j,x=d.filters,_=void 0===x?{}:x,S=Object(r.useCallback)((function(t){var n=N(l),e=n[0],r=n.slice(1);p.apply(void 0,W([I(I({},e),t)],r))}),[p,l]),T=(null==s?void 0:s.total)||0,E=Object(r.useMemo)((function(){return Math.ceil(T/O)}),[O,T]),P=Object(r.useCallback)((function(t,n){var e=t<=0?1:t,r=n<=0?1:n,o=Math.ceil(T/r);e>o&&(e=o),S({current:t,pageSize:n})}),[T,S]),k=Object(r.useCallback)((function(t){P(t,O)}),[P,O]),R=Object(r.useCallback)((function(t){P(b,t)}),[P,b]),F=Object(r.useRef)(k);F.current=k,g((function(){n.manual||F.current(1)}),W(u));var L=Object(r.useCallback)((function(t,n,e){S({current:t.current,pageSize:t.pageSize||o,filters:n,sorter:e})}),[_,w,S]);return I({loading:v,data:s,params:l,run:p,pagination:{current:b,pageSize:O,total:T,totalPage:E,onChange:P,changeCurrent:k,changePageSize:R},tableProps:{dataSource:(null==s?void 0:s.list)||[],loading:v,onChange:L,pagination:{current:b,pageSize:O,total:T}},sorter:w,filters:_},h)},z=o.a.createContext({});z.displayName="UseRequestConfigContext";var q=z,U=function(){return(U=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},V=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e},G=function(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u},H=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(G(arguments[n]));return t};var $=q.Provider,Y=$;n.default=function(t,n){void 0===n&&(n={});var e=Object(r.useContext)(q),o=U(U({},e),n),i=o.paginated,u=o.loadMore,c=o.requestMethod,a=Object(r.useRef)(i),f=Object(r.useRef)(u);if(a.current!==i)throw Error("You should not modify the paginated of options");if(f.current!==u)throw Error("You should not modify the loadMore of options");a.current=i,f.current=u;var s,l=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return fetch.apply(void 0,H(t)).then((function(t){if(t.ok)return t.json();throw new Error(t.statusText)}))},p=c||l;switch(typeof t){case"string":s=function(){return p(t)};break;case"object":var v=t.url,h=V(t,["url"]);s=function(){return c?c(t):l(v,h)};break;default:s=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new Promise((function(e,r){var o=t.apply(void 0,H(n)),i=o;if(!o.then)switch(typeof o){case"string":i=p(o);break;case"object":var u=o.url,a=V(o,["url"]);i=c?c(o):l(u,a)}i.then(e).catch(r)}))}}return u?D(s,o):i?K(s,o):M(s,o)}}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React")):"function"==typeof define&&define.amd?define(["React"],e):"object"==typeof exports?exports.ahooksUseRequest=e(require("React")):t.ahooksUseRequest=e(t.React)}(this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(e,n){e.exports=t},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(e){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,u="object"==typeof e&&e&&e.Object===Object&&e,c="object"==typeof self&&self&&self.Object===Object&&self,l=u||c||Function("return this")(),f=Object.prototype.toString,s=Math.max,d=Math.min,h=function(){return l.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function p(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==f.call(t)}(t))return NaN;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var u=o.test(t);return u||i.test(t)?a(t.slice(2),u?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r,o,i,a,u,c,l=0,f=!1,y=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var n=r,i=o;return r=o=void 0,l=e,a=t.apply(i,n)}function m(t){return l=t,u=setTimeout(j,e),f?g(t):a}function O(t){var n=t-c;return void 0===c||n>=e||n<0||y&&t-l>=i}function j(){var t=h();if(O(t))return w(t);u=setTimeout(j,function(t){var n=e-(t-c);return y?d(n,i-(t-l)):n}(t))}function w(t){return u=void 0,b&&r?g(t):(r=o=void 0,a)}function S(){var t=h(),n=O(t);if(r=arguments,o=this,c=t,n){if(void 0===u)return m(c);if(y)return u=setTimeout(j,e),g(c)}return void 0===u&&(u=setTimeout(j,e)),a}return e=p(e)||0,v(n)&&(f=!!n.leading,i=(y="maxWait"in n)?s(p(n.maxWait)||0,e):i,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==u&&clearTimeout(u),l=0,r=c=o=u=void 0},S.flush=function(){return void 0===u?a:w(h())},S}}).call(this,n(1))},function(t,e,n){(function(e){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,u="object"==typeof e&&e&&e.Object===Object&&e,c="object"==typeof self&&self&&self.Object===Object&&self,l=u||c||Function("return this")(),f=Object.prototype.toString,s=Math.max,d=Math.min,h=function(){return l.Date.now()};function v(t,e,n){var r,o,i,a,u,c,l=0,f=!1,v=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var n=r,i=o;return r=o=void 0,l=e,a=t.apply(i,n)}function m(t){return l=t,u=setTimeout(j,e),f?g(t):a}function O(t){var n=t-c;return void 0===c||n>=e||n<0||v&&t-l>=i}function j(){var t=h();if(O(t))return w(t);u=setTimeout(j,function(t){var n=e-(t-c);return v?d(n,i-(t-l)):n}(t))}function w(t){return u=void 0,b&&r?g(t):(r=o=void 0,a)}function S(){var t=h(),n=O(t);if(r=arguments,o=this,c=t,n){if(void 0===u)return m(c);if(v)return u=setTimeout(j,e),g(c)}return void 0===u&&(u=setTimeout(j,e)),a}return e=y(e)||0,p(n)&&(f=!!n.leading,i=(v="maxWait"in n)?s(y(n.maxWait)||0,e):i,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==u&&clearTimeout(u),l=0,r=c=o=u=void 0},S.flush=function(){return void 0===u?a:w(h())},S}function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function y(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==f.call(t)}(t))return NaN;if(p(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=p(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var u=o.test(t);return u||i.test(t)?a(t.slice(2),u?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return p(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),v(t,e,{leading:r,maxWait:e,trailing:o})}}).call(this,n(1))},function(t,e,n){"use strict";n.r(e),n.d(e,"useAsync",(function(){return M})),n.d(e,"usePaginated",(function(){return q})),n.d(e,"useLoadMore",(function(){return _})),n.d(e,"UseRequestProvider",(function(){return Y})),n.d(e,"UseAPIProvider",(function(){return Q}));var r=n(0),o=n.n(r),i=n(2),a=n.n(i),u=n(3),c=n.n(u);function l(){return"undefined"==typeof document||void 0===document.visibilityState||"hidden"!==document.visibilityState}var f=new Map,s=function(t){var e=f.get(t);return{data:null==e?void 0:e.data,startTime:null==e?void 0:e.startTime}},d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t};var v=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},p=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(v(arguments[e]));return t};var y=function(t){var e=Object(r.useRef)((function(){throw new Error("Cannot call an event handler while rendering.")}));e.current=t;var n=Object(r.useCallback)((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.current;if(r)return r.apply(void 0,p(t))}),[e]);if("function"==typeof t)return n},b=function(t,e){var n=Object(r.useRef)(!1);Object(r.useEffect)((function(){return function(){n.current=!1}}),[]),Object(r.useEffect)((function(){if(n.current)return t();n.current=!0}),e)},g=[];var m=!1;if("undefined"!=typeof window&&window.addEventListener&&!m){var O=function(){if(l()&&(void 0===navigator.onLine||navigator.onLine))for(var t=0;t<g.length;t++){(0,g[t])()}};window.addEventListener("visibilitychange",O,!1),window.addEventListener("focus",O,!1),m=!0}var j=function(t){return g.push(t),function(){var e=g.indexOf(t);g.splice(e,1)}},w=[];var S=!1;if("undefined"!=typeof window&&window.addEventListener&&!S){window.addEventListener("visibilitychange",(function(){if(l())for(var t=0;t<w.length;t++){(0,w[t])()}}),!1),S=!0}var T=function(t){return w.push(t),function(){var e=w.indexOf(t);w.splice(e,1)}},E=function(){return(E=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},x=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},R=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(x(arguments[e]));return t},P="AHOOKS_USE_REQUEST_DEFAULT_KEY",D=function(){function t(t,e,n,r){var o,i,u;this.count=0,this.pollingWhenVisibleFlag=!1,this.pollingTimer=void 0,this.loadingDelayTimer=void 0,this.unsubscribe=[],this.that=this,this.state={loading:!1,params:[],data:void 0,error:void 0,run:this.run.bind(this.that),mutate:this.mutate.bind(this.that),refresh:this.refresh.bind(this.that),cancel:this.cancel.bind(this.that),unmount:this.unmount.bind(this.that)},this.service=t,this.config=e,this.subscribe=n,r&&(this.state=E(E({},this.state),r)),this.debounceRun=this.config.debounceInterval?a()(this._run,this.config.debounceInterval):void 0,this.throttleRun=this.config.throttleInterval?c()(this._run,this.config.throttleInterval):void 0,this.limitRefresh=(o=this.refresh.bind(this),i=this.config.focusTimespan,u=!1,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];u||(u=!0,o.apply(void 0,h(t)),setTimeout((function(){u=!1}),i))}),this.config.pollingInterval&&this.unsubscribe.push(T(this.rePolling.bind(this))),this.config.refreshOnWindowFocus&&this.unsubscribe.push(j(this.limitRefresh.bind(this)))}return t.prototype.setState=function(t){void 0===t&&(t={}),this.state=E(E({},this.state),t),this.subscribe(this.state)},t.prototype._run=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.pollingTimer&&clearTimeout(this.pollingTimer),this.loadingDelayTimer&&clearTimeout(this.loadingDelayTimer),this.count+=1;var r=this.count;return this.setState({loading:!this.config.loadingDelay,params:e}),this.config.loadingDelay&&(this.loadingDelayTimer=setTimeout((function(){t.setState({loading:!0})}),this.config.loadingDelay)),this.service.apply(this,R(e)).then((function(n){if(r!==t.count)return new Promise((function(){}));t.loadingDelayTimer&&clearTimeout(t.loadingDelayTimer);var o=t.config.formatResult?t.config.formatResult(n):n;return t.setState({data:o,error:void 0,loading:!1}),t.config.onSuccess&&t.config.onSuccess(o,e),o})).catch((function(n){if(r!==t.count)return new Promise((function(){}));if(t.loadingDelayTimer&&clearTimeout(t.loadingDelayTimer),t.setState({data:void 0,error:n,loading:!1}),t.config.onError&&t.config.onError(n,e),t.config.throwOnError)throw n;return console.error(n),Promise.reject("useRequest has caught the exception, if you need to handle the exception yourself, you can set options.throwOnError to true.")})).finally((function(){if(r===t.count&&t.config.pollingInterval){if(!l()&&!t.config.pollingWhenHidden)return void(t.pollingWhenVisibleFlag=!0);t.pollingTimer=setTimeout((function(){t._run.apply(t,R(e))}),t.config.pollingInterval)}}))},t.prototype.run=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.debounceRun?(this.debounceRun.apply(this,R(t)),Promise.resolve(null)):this.throttleRun?(this.throttleRun.apply(this,R(t)),Promise.resolve(null)):this._run.apply(this,R(t))},t.prototype.cancel=function(){this.debounceRun&&this.debounceRun.cancel(),this.throttleRun&&this.throttleRun.cancel(),this.loadingDelayTimer&&clearTimeout(this.loadingDelayTimer),this.pollingTimer&&clearTimeout(this.pollingTimer),this.pollingWhenVisibleFlag=!1,this.count+=1,this.setState({loading:!1})},t.prototype.refresh=function(){return this.run.apply(this,R(this.state.params))},t.prototype.rePolling=function(){this.pollingWhenVisibleFlag&&(this.pollingWhenVisibleFlag=!1,this.refresh())},t.prototype.mutate=function(t){"function"==typeof t?this.setState({data:t(this.state.data)||{}}):this.setState({data:t})},t.prototype.unmount=function(){this.cancel(),this.unsubscribe.forEach((function(t){t()}))},t}();var M=function(t,e){var n,o=e||{},i=o.refreshDeps,a=void 0===i?[]:i,u=o.manual,c=void 0!==u&&u,l=o.onSuccess,d=void 0===l?function(){}:l,h=o.onError,v=void 0===h?function(){}:h,p=o.defaultLoading,g=void 0!==p&&p,m=o.loadingDelay,O=o.pollingInterval,j=void 0===O?0:O,w=o.pollingWhenHidden,S=void 0===w||w,T=o.defaultParams,M=void 0===T?[]:T,k=o.refreshOnWindowFocus,C=void 0!==k&&k,I=o.focusTimespan,W=void 0===I?5e3:I,_=o.fetchKey,F=o.cacheKey,K=o.cacheTime,L=void 0===K?3e5:K,N=o.staleTime,q=void 0===N?0:N,z=o.debounceInterval,U=o.throttleInterval,$=o.initialData,H=o.ready,V=void 0===H||H,A=o.throwOnError,Y=void 0!==A&&A,Q=Object(r.useRef)(P),B=y(t),G=y(d),J=y(v),X=y(_);"formatResult"in o&&(n=o.formatResult);var Z={formatResult:y(n),onSuccess:G,onError:J,loadingDelay:m,pollingInterval:j,pollingWhenHidden:S,refreshOnWindowFocus:!c&&C,focusTimespan:W,debounceInterval:z,throttleInterval:U,throwOnError:Y},tt=y((function(t,e){rt((function(n){return n[t]=e,E({},n)}))})),et=x(Object(r.useState)((function(){var t;if(F){var e=null===(t=s(F))||void 0===t?void 0:t.data;if(e){Q.current=e.newstFetchKey;var n={};return Object.keys(e.fetches).forEach((function(t){var r=e.fetches[t],o=new D(B,Z,tt.bind(null,t),{loading:r.loading,params:r.params,data:r.data,error:r.error});n[t]=o.state})),n}}return{}})),2),nt=et[0],rt=et[1],ot=Object(r.useRef)(nt);ot.current=nt;var it=Object(r.useRef)(),at=Object(r.useCallback)((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(V){if(X){var n=X.apply(void 0,R(t));Q.current=void 0===n?P:n}var r=Q.current,o=ot.current[r];if(!o){var i=new D(B,Z,tt.bind(null,r),{data:$});o=i.state,rt((function(t){return t[r]=o,E({},t)}))}return o.run.apply(o,R(t))}it.current=t}),[_,tt,V]),ut=Object(r.useRef)(at);ut.current=at,b((function(){F&&function(t,e,n){var r=f.get(t);(null==r?void 0:r.timer)&&clearTimeout(r.timer);var o=void 0;e>-1&&(o=setTimeout((function(){f.delete(t)}),e)),f.set(t,{data:n,timer:o,startTime:(new Date).getTime()})}(F,L,{fetches:nt,newstFetchKey:Q.current})}),[F,nt]);var ct=Object(r.useRef)(!1);b((function(){V&&(!ct.current&&it.current&&ut.current.apply(ut,R(it.current)),ct.current=!0)}),[V]),Object(r.useEffect)((function(){var t;if(!c)if(Object.keys(nt).length>0){var e=F&&(null===(t=s(F))||void 0===t?void 0:t.startTime)||0;-1===q||(new Date).getTime()-e<=q||Object.values(nt).forEach((function(t){t.refresh()}))}else ut.current.apply(ut,R(M))}),[]);var lt=Object(r.useCallback)((function(){Object.values(ot.current).forEach((function(t){t.unmount()})),Q.current=P,rt({}),ot.current={}}),[rt]);b((function(){c||Object.values(ot.current).forEach((function(t){t.refresh()}))}),R(a)),Object(r.useEffect)((function(){return function(){Object.values(ot.current).forEach((function(t){t.unmount()}))}}),[]);var ft=Object(r.useCallback)((function(t){return function(){console.warn("You should't call "+t+" when service not executed once.")}}),[]);return E(E({loading:V&&!c||g,data:$,error:void 0,params:[],cancel:ft("cancel"),refresh:ft("refresh"),mutate:ft("mutate")},nt[Q.current]||{}),{run:at,fetches:nt,reset:lt})},k=function(){return(k=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},C=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},I=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},W=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I(arguments[e]));return t};var _=function(t,e){var n=e.refreshDeps,o=void 0===n?[]:n,i=e.ref,a=e.isNoMore,u=e.threshold,c=void 0===u?100:u,l=(e.fetchKey,C(e,["refreshDeps","ref","isNoMore","threshold","fetchKey"])),f=I(Object(r.useState)(!1),2),s=f[0],d=f[1];Object(r.useEffect)((function(){e.fetchKey&&console.warn("useRequest loadMore mode don't need fetchKey!")}),[]);var h=M(t,k(k({},l),{fetchKey:function(t){var e;return(null===(e=null==t?void 0:t.list)||void 0===e?void 0:e.length)||0},onSuccess:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];d(!1),e.onSuccess&&e.onSuccess.apply(e,W(t))}})),v=h.data,p=h.run,y=h.params,g=h.reset,m=h.loading,O=h.fetches,j=Object(r.useCallback)((function(){g();var t=I(y).slice(1);p.apply(void 0,W([void 0],t))}),[p,g,y]),w=Object(r.useRef)(j);w.current=j,b((function(){e.manual||w.current()}),W(o));var S=Object(r.useMemo)((function(){var t=[],e=v;return Object.values(O).forEach((function(n){var r,o;(null===(r=n.data)||void 0===r?void 0:r.list)&&(t=t.concat(null===(o=n.data)||void 0===o?void 0:o.list)),n.loading||(e=n.data)})),k(k({},e),{list:t})}),[O,v]),T=!!a&&(!m&&!s&&a(S)),E=Object(r.useCallback)((function(){if(!T){d(!0);var t=I(y).slice(1);p.apply(void 0,W([S],t))}}),[T,p,S,y]),x=function(){!m&&!s&&i&&i.current&&i.current.scrollHeight-i.current.scrollTop<=i.current.clientHeight+c&&E()},R=Object(r.useRef)(x);return R.current=x,Object(r.useEffect)((function(){if(!i||!i.current)return function(){};var t=function(){return R.current()};return i.current.addEventListener("scroll",t),function(){i&&i.current&&i.current.removeEventListener("scroll",t)}}),[R]),k(k({},h),{data:S,reload:j,loading:m&&0===S.list.length,loadMore:E,loadingMore:s,noMore:T})},F=function(){return(F=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},K=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},L=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},N=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(L(arguments[e]));return t};var q=function(t,e){e.paginated;var n=e.defaultPageSize,o=void 0===n?10:n,i=e.refreshDeps,a=void 0===i?[]:i,u=e.fetchKey,c=K(e,["paginated","defaultPageSize","refreshDeps","fetchKey"]);Object(r.useEffect)((function(){u&&console.error("useRequest pagination's fetchKey will not work!")}),[]);var l=M(t,F({defaultParams:[{current:1,pageSize:o}]},c)),f=l.data,s=l.params,d=l.run,h=l.loading,v=K(l,["data","params","run","loading"]),p=s&&s[0]?s[0]:{},y=p.current,g=void 0===y?1:y,m=p.pageSize,O=void 0===m?o:m,j=p.sorter,w=void 0===j?{}:j,S=p.filters,T=void 0===S?{}:S,E=Object(r.useCallback)((function(t){var e=L(s),n=e[0],r=e.slice(1);d.apply(void 0,N([F(F({},n),t)],r))}),[d,s]),x=(null==f?void 0:f.total)||0,R=Object(r.useMemo)((function(){return Math.ceil(x/O)}),[O,x]),P=Object(r.useCallback)((function(t,e){var n=t<=0?1:t,r=e<=0?1:e,o=Math.ceil(x/r);n>o&&(n=o),E({current:t,pageSize:e})}),[x,E]),D=Object(r.useCallback)((function(t){P(t,O)}),[P,O]),k=Object(r.useCallback)((function(t){P(g,t)}),[P,g]),C=Object(r.useRef)(D);C.current=D,b((function(){e.manual||C.current(1)}),N(a));var I=Object(r.useCallback)((function(t,e,n){E({current:t.current,pageSize:t.pageSize||o,filters:e,sorter:n})}),[T,w,E]);return F({loading:h,data:f,params:s,run:d,pagination:{current:g,pageSize:O,total:x,totalPage:R,onChange:P,changeCurrent:D,changePageSize:k},tableProps:{dataSource:(null==f?void 0:f.list)||[],loading:h,onChange:I,pagination:{current:g,pageSize:O,total:x}},sorter:w,filters:T},v)},z=o.a.createContext({});z.displayName="UseRequestConfigContext";var U=z,$=function(){return($=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},H=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},V=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},A=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(V(arguments[e]));return t};var Y=U.Provider,Q=Y;e.default=function(t,e){void 0===e&&(e={});var n=Object(r.useContext)(U),o=$($({},n),e),i=o.paginated,a=o.loadMore,u=o.requestMethod,c=Object(r.useRef)(i),l=Object(r.useRef)(a);if(c.current!==i)throw Error("You should not modify the paginated of options");if(l.current!==a)throw Error("You should not modify the loadMore of options");c.current=i,l.current=a;var f,s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return fetch.apply(void 0,A(t)).then((function(t){if(t.ok)return t.json();throw new Error(t.statusText)}))},d=u||s;switch(typeof t){case"string":f=function(){return d(t)};break;case"object":var h=t.url,v=H(t,["url"]);f=function(){return u?u(t):s(h,v)};break;default:f=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new Promise((function(n,r){var o=t.apply(void 0,A(e)),i=o;if(!o.then)switch(typeof o){case"string":i=d(o);break;case"object":var a=o.url,c=H(o,["url"]);i=u?u(o):s(a,c)}i.then(n).catch(r)}))}}return a?_(f,o):i?q(f,o):M(f,o)}}])})); |
@@ -1,9 +0,1 @@ | ||
import "core-js/modules/es6.object.assign.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.promise.js"; | ||
var __assign = this && this.__assign || function () { | ||
@@ -172,3 +164,3 @@ __assign = Object.assign || function (t) { | ||
fn.then(resolve).catch(reject); | ||
fn.then(resolve)["catch"](reject); | ||
}); | ||
@@ -175,0 +167,0 @@ }; |
@@ -1,12 +0,1 @@ | ||
import "core-js/modules/es6.object.assign.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es7.promise.finally.js"; | ||
import "core-js/modules/es6.promise.js"; | ||
import "core-js/modules/es6.object.keys.js"; | ||
import "core-js/modules/es7.object.values.js"; | ||
var __assign = this && this.__assign || function () { | ||
@@ -184,3 +173,3 @@ __assign = Object.assign || function (t) { | ||
return formattedResult; | ||
}).catch(function (error) { | ||
})["catch"](function (error) { | ||
if (currentCount !== _this.count) { | ||
@@ -214,3 +203,3 @@ // prevent run.then when request is canceled | ||
return Promise.reject('useRequest has caught the exception, if you need to handle the exception yourself, you can set options.throwOnError to true.'); | ||
}).finally(function () { | ||
})["finally"](function () { | ||
if (currentCount === _this.count) { | ||
@@ -217,0 +206,0 @@ if (_this.config.pollingInterval) { |
@@ -1,10 +0,1 @@ | ||
import "core-js/modules/es6.object.assign.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.array.slice.js"; | ||
import "core-js/modules/es7.object.values.js"; | ||
var __assign = this && this.__assign || function () { | ||
@@ -11,0 +2,0 @@ __assign = Object.assign || function (t) { |
@@ -1,9 +0,1 @@ | ||
import "core-js/modules/es6.object.assign.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.array.slice.js"; | ||
var __assign = this && this.__assign || function () { | ||
@@ -10,0 +2,0 @@ __assign = Object.assign || function (t) { |
@@ -1,8 +0,1 @@ | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.promise.js"; | ||
var __rest = this && this.__rest || function (s, e) { | ||
@@ -9,0 +2,0 @@ var t = {}; |
@@ -1,6 +0,1 @@ | ||
import "core-js/modules/es6.map.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
var cache = new Map(); | ||
@@ -20,3 +15,3 @@ | ||
timer = setTimeout(function () { | ||
cache.delete(key); | ||
cache["delete"](key); | ||
}, cacheTime); | ||
@@ -23,0 +18,0 @@ } |
@@ -1,7 +0,1 @@ | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
var __read = this && this.__read || function (o, n) { | ||
@@ -8,0 +2,0 @@ var m = typeof Symbol === "function" && o[Symbol.iterator]; |
@@ -1,7 +0,1 @@ | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
var __read = this && this.__read || function (o, n) { | ||
@@ -8,0 +2,0 @@ var m = typeof Symbol === "function" && o[Symbol.iterator]; |
@@ -15,4 +15,4 @@ "use strict"; | ||
var ConfigContext = react_1.default.createContext({}); | ||
var ConfigContext = react_1["default"].createContext({}); | ||
ConfigContext.displayName = 'UseRequestConfigContext'; | ||
exports.default = ConfigContext; | ||
exports["default"] = ConfigContext; |
"use strict"; | ||
import "core-js/modules/es6.object.assign.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.promise.js"; | ||
var __assign = this && this.__assign || function () { | ||
@@ -91,11 +83,11 @@ __assign = Object.assign || function (t) { | ||
exports.useAsync = useAsync_1.default; | ||
exports.useAsync = useAsync_1["default"]; | ||
var useLoadMore_1 = __importDefault(require("./useLoadMore")); | ||
exports.useLoadMore = useLoadMore_1.default; | ||
exports.useLoadMore = useLoadMore_1["default"]; | ||
var usePaginated_1 = __importDefault(require("./usePaginated")); | ||
exports.usePaginated = usePaginated_1.default; | ||
exports.usePaginated = usePaginated_1["default"]; | ||
@@ -109,3 +101,3 @@ var configContext_1 = __importDefault(require("./configContext")); | ||
var contextConfig = react_1.useContext(configContext_1.default); | ||
var contextConfig = react_1.useContext(configContext_1["default"]); | ||
@@ -196,3 +188,3 @@ var finalOptions = __assign(__assign({}, contextConfig), options); | ||
fn.then(resolve).catch(reject); | ||
fn.then(resolve)["catch"](reject); | ||
}); | ||
@@ -204,13 +196,13 @@ }; | ||
if (loadMore) { | ||
return useLoadMore_1.default(promiseService, finalOptions); | ||
return useLoadMore_1["default"](promiseService, finalOptions); | ||
} | ||
if (paginated) { | ||
return usePaginated_1.default(promiseService, finalOptions); | ||
return usePaginated_1["default"](promiseService, finalOptions); | ||
} | ||
return useAsync_1.default(promiseService, finalOptions); | ||
return useAsync_1["default"](promiseService, finalOptions); | ||
} | ||
var UseRequestProvider = configContext_1.default.Provider; | ||
var UseRequestProvider = configContext_1["default"].Provider; | ||
exports.UseRequestProvider = UseRequestProvider; // UseAPIProvider 已经废弃,此处为了兼容 umijs 插件 plugin-request | ||
@@ -220,2 +212,2 @@ | ||
exports.UseAPIProvider = UseAPIProvider; | ||
exports.default = useRequest; | ||
exports["default"] = useRequest; |
"use strict"; | ||
import "core-js/modules/es6.object.assign.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es7.promise.finally.js"; | ||
import "core-js/modules/es6.promise.js"; | ||
import "core-js/modules/es6.object.keys.js"; | ||
import "core-js/modules/es7.object.values.js"; | ||
var __assign = this && this.__assign || function () { | ||
@@ -126,12 +115,12 @@ __assign = Object.assign || function (t) { | ||
this.debounceRun = this.config.debounceInterval ? lodash_debounce_1.default(this._run, this.config.debounceInterval) : undefined; | ||
this.throttleRun = this.config.throttleInterval ? lodash_throttle_1.default(this._run, this.config.throttleInterval) : undefined; | ||
this.limitRefresh = limit_1.default(this.refresh.bind(this), this.config.focusTimespan); | ||
this.debounceRun = this.config.debounceInterval ? lodash_debounce_1["default"](this._run, this.config.debounceInterval) : undefined; | ||
this.throttleRun = this.config.throttleInterval ? lodash_throttle_1["default"](this._run, this.config.throttleInterval) : undefined; | ||
this.limitRefresh = limit_1["default"](this.refresh.bind(this), this.config.focusTimespan); | ||
if (this.config.pollingInterval) { | ||
this.unsubscribe.push(windowVisible_1.default(this.rePolling.bind(this))); | ||
this.unsubscribe.push(windowVisible_1["default"](this.rePolling.bind(this))); | ||
} | ||
if (this.config.refreshOnWindowFocus) { | ||
this.unsubscribe.push(windowFocus_1.default(this.limitRefresh.bind(this))); | ||
this.unsubscribe.push(windowFocus_1["default"](this.limitRefresh.bind(this))); | ||
} | ||
@@ -207,3 +196,3 @@ } | ||
return formattedResult; | ||
}).catch(function (error) { | ||
})["catch"](function (error) { | ||
if (currentCount !== _this.count) { | ||
@@ -237,3 +226,3 @@ // prevent run.then when request is canceled | ||
return Promise.reject('useRequest has caught the exception, if you need to handle the exception yourself, you can set options.throwOnError to true.'); | ||
}).finally(function () { | ||
})["finally"](function () { | ||
if (currentCount === _this.count) { | ||
@@ -373,6 +362,6 @@ if (_this.config.pollingInterval) { | ||
var servicePersist = usePersistFn_1.default(service); | ||
var onSuccessPersist = usePersistFn_1.default(onSuccess); | ||
var onErrorPersist = usePersistFn_1.default(onError); | ||
var fetchKeyPersist = usePersistFn_1.default(fetchKey); | ||
var servicePersist = usePersistFn_1["default"](service); | ||
var onSuccessPersist = usePersistFn_1["default"](onSuccess); | ||
var onErrorPersist = usePersistFn_1["default"](onError); | ||
var fetchKeyPersist = usePersistFn_1["default"](fetchKey); | ||
var formatResult; | ||
@@ -385,3 +374,3 @@ | ||
var formatResultPersist = usePersistFn_1.default(formatResult); | ||
var formatResultPersist = usePersistFn_1["default"](formatResult); | ||
var config = { | ||
@@ -401,3 +390,3 @@ formatResult: formatResultPersist, | ||
}; | ||
var subscribe = usePersistFn_1.default(function (key, data) { | ||
var subscribe = usePersistFn_1["default"](function (key, data) { | ||
setFetches(function (s) { | ||
@@ -484,3 +473,3 @@ // eslint-disable-next-line no-param-reassign | ||
useUpdateEffect_1.default(function () { | ||
useUpdateEffect_1["default"](function () { | ||
if (cacheKey) { | ||
@@ -495,3 +484,3 @@ cache_1.setCache(cacheKey, cacheTime, { | ||
var hasTriggeredByReady = react_1.useRef(false); | ||
useUpdateEffect_1.default(function () { | ||
useUpdateEffect_1["default"](function () { | ||
if (ready) { | ||
@@ -539,3 +528,3 @@ if (!hasTriggeredByReady.current && readyMemoryParams.current) { | ||
useUpdateEffect_1.default(function () { | ||
useUpdateEffect_1["default"](function () { | ||
if (!manual) { | ||
@@ -576,2 +565,2 @@ /* 全部重新执行 */ | ||
exports.default = useAsync; | ||
exports["default"] = useAsync; |
"use strict"; | ||
import "core-js/modules/es6.object.assign.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.array.slice.js"; | ||
import "core-js/modules/es7.object.values.js"; | ||
var __assign = this && this.__assign || function () { | ||
@@ -111,3 +102,3 @@ __assign = Object.assign || function (t) { | ||
}, []); | ||
var result = useAsync_1.default(service, __assign(__assign({}, restOptions), { | ||
var result = useAsync_1["default"](service, __assign(__assign({}, restOptions), { | ||
fetchKey: function fetchKey(d) { | ||
@@ -150,3 +141,3 @@ var _a; | ||
useUpdateEffect_1.default(function () { | ||
useUpdateEffect_1["default"](function () { | ||
/* 只有自动执行的场景, refreshDeps 才有效 */ | ||
@@ -233,2 +224,2 @@ if (!options.manual) { | ||
exports.default = useLoadMore; | ||
exports["default"] = useLoadMore; |
"use strict"; | ||
import "core-js/modules/es6.object.assign.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.array.slice.js"; | ||
var __assign = this && this.__assign || function () { | ||
@@ -106,3 +98,3 @@ __assign = Object.assign || function (t) { | ||
var _c = useAsync_1.default(service, __assign({ | ||
var _c = useAsync_1["default"](service, __assign({ | ||
defaultParams: [{ | ||
@@ -165,3 +157,3 @@ current: 1, | ||
useUpdateEffect_1.default(function () { | ||
useUpdateEffect_1["default"](function () { | ||
/* 只有自动执行的场景, refreshDeps 才有效 */ | ||
@@ -210,2 +202,2 @@ if (!options.manual) { | ||
exports.default = usePaginated; | ||
exports["default"] = usePaginated; |
"use strict"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.promise.js"; | ||
var __rest = this && this.__rest || function (s, e) { | ||
@@ -77,3 +70,3 @@ var t = {}; | ||
promiseService = function promiseService() { | ||
return umi_request_1.default(service); | ||
return umi_request_1["default"](service); | ||
}; | ||
@@ -85,3 +78,3 @@ } else if (typeof service === 'object') { | ||
promiseService = function promiseService() { | ||
return umi_request_1.default(url_1, rest_1); | ||
return umi_request_1["default"](url_1, rest_1); | ||
}; | ||
@@ -100,3 +93,3 @@ } else { | ||
if (typeof result === 'string') { | ||
umi_request_1.default(result).then(function (data) { | ||
umi_request_1["default"](result).then(function (data) { | ||
resolve(data); | ||
@@ -108,3 +101,3 @@ }); | ||
umi_request_1.default(url, rest).then(function (data) { | ||
umi_request_1["default"](url, rest).then(function (data) { | ||
resolve(data); | ||
@@ -117,5 +110,5 @@ }); | ||
return useAsync_1.default(promiseService, options); | ||
return useAsync_1["default"](promiseService, options); | ||
} | ||
exports.default = useRequest; | ||
exports["default"] = useRequest; |
"use strict"; | ||
import "core-js/modules/es6.map.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -26,3 +21,3 @@ value: true | ||
timer = setTimeout(function () { | ||
cache.delete(key); | ||
cache["delete"](key); | ||
}, cacheTime); | ||
@@ -29,0 +24,0 @@ } |
"use strict"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
var __read = this && this.__read || function (o, n) { | ||
@@ -66,2 +60,2 @@ var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
exports.default = limit; | ||
exports["default"] = limit; |
"use strict"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
var __read = this && this.__read || function (o, n) { | ||
@@ -76,2 +70,2 @@ var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
exports.default = usePersistFn; | ||
exports["default"] = usePersistFn; |
@@ -25,2 +25,2 @@ "use strict"; | ||
exports.default = useUpdateEffect; | ||
exports["default"] = useUpdateEffect; |
@@ -37,2 +37,2 @@ "use strict"; | ||
exports.default = subscribe; | ||
exports["default"] = subscribe; |
@@ -36,2 +36,2 @@ "use strict"; | ||
exports.default = subscribe; | ||
exports["default"] = subscribe; |
{ | ||
"name": "@ahooksjs/use-request", | ||
"version": "2.8.11", | ||
"version": "2.8.12", | ||
"description": "React Hooks for fetching, caching and updating asynchronous data", | ||
@@ -34,3 +34,2 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"core-js": "^2.6.12", | ||
"lodash.debounce": "^4.0.8", | ||
@@ -37,0 +36,0 @@ "lodash.throttle": "^4.1.1" |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
3
0
6
128224
2978
- Removedcore-js@^2.6.12
- Removedcore-js@2.6.12(transitive)