axios 0.33.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +70 -1
- package/dist/axios.js +416 -50
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/esm/axios.js +416 -50
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/index.d.ts +5 -1
- package/lib/adapters/http.js +107 -14
- package/lib/adapters/xhr.js +2 -2
- package/lib/cancel/fromSignal.js +20 -0
- package/lib/core/Axios.js +107 -24
- package/lib/core/dispatchRequest.js +5 -4
- package/lib/core/mergeConfig.js +10 -0
- package/lib/env/data.js +1 -1
- package/lib/helpers/assertParamsDepth.js +100 -0
- package/lib/helpers/estimateDataURLDecodedBytes.js +3 -3
- package/lib/helpers/formDataToJSON.js +40 -3
- package/lib/helpers/getDirectAgent.js +85 -0
- package/lib/helpers/shouldBypassProxy.js +229 -2
- package/lib/helpers/toFormData.js +39 -12
- package/lib/utils.js +101 -5
- package/package.json +1 -1
package/dist/esm/axios.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e,t=function(e,t){return function(){return e.apply(t,arguments)}},r=Object.prototype.toString,n=(e=Object.create(null),function(t){var n=r.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())});function o(e){return e=e.toLowerCase(),function(t){return n(t)===e}}function i(e){return Array.isArray(e)}function a(e){return void 0===e}var s=o("ArrayBuffer");function u(e){return"number"==typeof e}function c(e){return null!==e&&"object"==typeof e}function f(e){if("object"!==n(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var l=o("Date"),p=o("File"),d=o("Blob"),h=o("FileList");function m(e){return"[object Function]"===r.call(e)}var y=o("URLSearchParams");function v(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var E,b=(E="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return E&&e instanceof E});var O,w=o("HTMLFormElement"),g=(O=Object.prototype.hasOwnProperty,function(e,t){return O.call(e,t)}),R={isArray:i,isArrayBuffer:s,isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";if(!e)return!1;if("function"==typeof FormData&&e instanceof FormData)return!0;if(!c(e))return!1;var n=Object.getPrototypeOf(e);return!(!n||n===Object.prototype)&&(!!m(e.append)&&(r.call(e)===t||m(e.toString)&&e.toString()===t))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&s(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:u,isObject:c,isPlainObject:f,isEmptyObject:function(e){if(!f(e))return!1;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},isUndefined:a,isDate:l,isFile:p,isBlob:d,isFunction:m,isStream:function(e){return c(e)&&m(e.pipe)},isURLSearchParams:y,isStandardBrowserEnv:function(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:v,merge:function e(){var t=Object.create(null);function r(r,n){var o;"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(f(o=Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0)&&f(r)?t[n]=e(o,r):f(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r)}for(var n=0,o=arguments.length;n<o;n++)v(arguments[n],r);return t},extend:function(e,r,n){return v(r,(function(r,o){e[o]=n&&"function"==typeof r?t(r,n):r})),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r,n){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:n,kindOfTest:o,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;if(i(e))return e;var t=e.length;if(!u(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:b,isFileList:h,forEachEntry:function(e,t){for(var r,n=(e&&e[Symbol.iterator]).call(e);(r=n.next())&&!r.done;){var o=r.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var r,n=[];null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:w,hasOwnProperty:g},A=["authorization","proxy-authorization","cookie","set-cookie","x-api-key","password"];function S(e){var t=Object.create(null);return t.value=e,t}function _(e,t,r,n){var o;return function(e,t){return"string"==typeof e&&t[e.toLowerCase()]}(r,t)?"[REDACTED ****]":R.isArray(e)?-1!==n.indexOf(e)?"[Circular]":(n.push(e),o=[],R.forEach(e,(function(e,r){o[r]=_(e,t,r,n)})),n.pop(),o):R.isPlainObject(e)?-1!==n.indexOf(e)?"[Circular]":(n.push(e),o={},R.forEach(e,(function(e,r){o[r]=_(e,t,r,n)})),n.pop(),o):e}function T(e){return e?_(e,function(e){var t=(e&&R.isArray(e.redact)&&e.redact.length?e.redact:null)||A,r={};return R.forEach(t,(function(e){"string"==typeof e&&(r[e.toLowerCase()]=!0)})),r}(e),void 0,[]):e}function j(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}R.inherits(j,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var x=j.prototype,P=Object.create(null);["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL","ERR_FORM_DATA_DEPTH_EXCEEDED"].forEach((function(e){P[e]=S(e)})),Object.defineProperties(j,P),Object.defineProperty(x,"isAxiosError",S(!0)),j.from=function(e,t,r,n,o,i){var a=Object.create(x);return R.toFlatObject(e,a,(function(e){return e!==Error.prototype})),j.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};var D=j,C="object"==typeof self?self.FormData:window.FormData;function F(e){return R.isPlainObject(e)||R.isArray(e)}function N(e){return R.endsWith(e,"[]")?e.slice(0,-2):e}function U(e,t,r){return e?e.concat(t).map((function(e,t){return e=N(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}var B=R.toFlatObject(R,{},null,(function(e){return/^is[A-Z]/.test(e)}));var L=function(e,t,r){if(!R.isObject(e))throw new TypeError("target must be an object");t=t||new(C||FormData);var n,o=(r=R.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!R.isUndefined(t[e])}))).metaTokens,i=r.visitor||h,a=r.dots,s=r.indexes,u=r.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===r.maxDepth?100:r.maxDepth,f=u&&((n=t)&&R.isFunction(n.append)&&"FormData"===n[Symbol.toStringTag]&&n[Symbol.iterator]);if(!R.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(R.isDate(e))return e.toISOString();if(!f&&R.isBlob(e))throw new D("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(e)||R.isTypedArray(e)?f&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}var p=[];function d(e,t){if(t>c)throw new D("Maximum object depth of "+c+" exceeded (got "+t+" levels)",D.ERR_FORM_DATA_DEPTH_EXCEEDED);R.isObject(e)&&-1===p.indexOf(e)&&(p.push(e),R.forEach(e,(function(e){d(e,t+1)})),p.pop())}function h(e,r,n){var i=e;if(e&&!n&&"object"==typeof e)if(R.endsWith(r,"{}"))r=o?r:r.slice(0,-2),d(e,1),e=JSON.stringify(e);else if(R.isArray(e)&&function(e){return R.isArray(e)&&!e.some(F)}(e)||R.isFileList(e)||R.endsWith(r,"[]")&&(i=R.toArray(e)))return r=N(r),i.forEach((function(e,n){!R.isUndefined(e)&&null!==e&&t.append(!0===s?U([r],n,a):null===s?r:r+"[]",l(e))})),!1;return!!F(e)||(t.append(U(n,r,a),l(e)),!1)}var m=Object.assign(B,{defaultVisitor:h,convertValue:l,isVisitable:F});if(!R.isObject(e))throw new TypeError("data must be an object");return function e(r,n,o){if(!R.isUndefined(r)){if((o=o||0)>c)throw new D("Maximum object depth of "+c+" exceeded (got "+o+" levels)",D.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(r))throw Error("Circular reference detected in "+n.join("."));p.push(r),R.forEach(r,(function(r,a){!0===(!(R.isUndefined(r)||null===r)&&i.call(t,r,R.isString(a)?a.trim():a,n,m))&&e(r,n?n.concat(a):[a],o+1)})),p.pop()}}(e,null,0),t};function k(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20/g,(function(e){return t[e]}))}function M(e,t){this._pairs=[],e&&L(e,this,t)}var q=M.prototype;q.append=function(e,t){this._pairs.push([e,t])},q.toString=function(e){var t=e?function(t){return e.call(this,t,k)}:k;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var z=M;function I(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var H=function(e,t,r){if(!t)return e;var n=e.indexOf("#");-1!==n&&(e=e.slice(0,n));var o,i,a=I;return r&&(R.isFunction(r)?o=r:(a=R.hasOwnProperty(r,"encode")&&r.encode||I,o=R.hasOwnProperty(r,"serialize")?r.serialize:void 0)),(i=o?o(t,r):R.isURLSearchParams(t)?t.toString():new z(t,r).toString(a))&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e};function J(){this.handlers=[]}J.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},J.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},J.prototype.clear=function(){this.handlers&&(this.handlers=[])},J.prototype.forEach=function(e){R.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var V=J,X=function(e,t){R.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},W={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:z,FormData:FormData,Blob:Blob},protocols:["http","https","file","blob","url","data"]};var K=function(e){function t(e,r,n,o){var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&R.isArray(n)?n.length:i,s?(R.hasOwnProperty(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&R.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&R.isArray(n[i])&&(n[i]=function(e){var t,r,n={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)n[r=o[t]]=e[r];return n}(n[i])),!a)}if(R.isFormData(e)&&R.isFunction(e.entries)){var r={};return R.forEachEntry(e,(function(e,n){var o=function(e){return R.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return"[]"===e[0]?"":e[1]||e[0]}))}(e);!function(e){var t=e.length-1;if(t>100)throw new D("Maximum object depth of 100 exceeded (got "+t+" levels)",D.ERR_FORM_DATA_DEPTH_EXCEEDED)}(o),t(o,n,r,0)})),r}return null},Q=R.isStandardBrowserEnv()?{write:function(e,t,r,n,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),R.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),R.isString(n)&&a.push("path="+n),R.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){for(var t,r=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(t=n[o];" "===t.charAt(0);)t=t.substring(1);if(0===t.indexOf(r))return decodeURIComponent(t.substring(r.length))}return null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},G=function(e,t,r){var n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||!1===r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t},Y=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Z=R.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=R.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0};function ee(e,t,r){D.call(this,null==e?"canceled":e,D.ERR_CANCELED,t,r),this.name="CanceledError"}R.inherits(ee,D,{__CANCEL__:!0});var te=ee,re=function(e){return new Promise((function(t,r){var n,o=e.data,i=e.headers,a=e.responseType,s=R.hasOwnProperty(e,"withXSRFToken")?e.withXSRFToken:void 0;function u(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}R.isFormData(o)&&R.isStandardBrowserEnv()&&delete i["Content-Type"];var c=new XMLHttpRequest,f=R.hasOwnProperty(e,"auth")?e.auth:void 0;if(f){var l=R.hasOwnProperty(f,"username")&&f.username||"",p=R.hasOwnProperty(f,"password")&&f.password?unescape(encodeURIComponent(f.password)):"";i.Authorization="Basic "+btoa(l+":"+p)}var d=G(e.baseURL,e.url,e.allowAbsoluteUrls);function h(){if(c){var n,o,i,s,f,l="getAllResponseHeaders"in c?(n=c.getAllResponseHeaders(),f={},n?(R.forEach(n.split("\n"),(function(e){if(s=e.indexOf(":"),o=R.trim(e.slice(0,s)).toLowerCase(),i=R.trim(e.slice(s+1)),o){if(f[o]&&Y.indexOf(o)>=0)return;f[o]="set-cookie"===o?(f[o]?f[o]:[]).concat([i]):f[o]?f[o]+", "+i:i}})),f):f):null;!function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new D("Request failed with status code "+r.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),u()}),(function(e){r(e),u()}),{data:a&&"text"!==a&&"json"!==a?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:l,config:e,request:c}),c=null}}if(c.open(e.method.toUpperCase(),H(d,e.params,R.hasOwnProperty(e,"paramsSerializer")?e.paramsSerializer:void 0),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(h)},c.onabort=function(){c&&(r(new D("Request aborted",D.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new D("Network Error",D.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||W;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new D(t,n.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,e,c)),c=null},R.isStandardBrowserEnv()&&(R.isFunction(s)&&(s=s(e)),!0===s||!1!==s&&Z(d))){var m=e.xsrfHeaderName&&e.xsrfCookieName&&Q.read(e.xsrfCookieName);m&&(i[e.xsrfHeaderName]=m)}"setRequestHeader"in c&&R.forEach(i,(function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete i[t]:c.setRequestHeader(t,e)})),R.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),a&&"json"!==a&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(n=function(t){c&&(r(!t||t.type?new te(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n))),o||!1===o||0===o||""===o||(o=null);var y,v=(y=/^([-+\w]{1,25})(:?\/\/|:)/.exec(d))&&y[1]||"";v&&-1===$.protocols.indexOf(v)?r(new D("Unsupported protocol "+v+":",D.ERR_BAD_REQUEST,e)):c.send(o)}))},ne={"Content-Type":"application/x-www-form-urlencoded"};function oe(e,t){!R.isUndefined(e)&&R.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var ie,ae={transitional:W,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(ie=re),ie),transformRequest:[function(e,t){X(t,"Accept"),X(t,"Content-Type");var r,n=t&&t["Content-Type"]||"",o=n.indexOf("application/json")>-1,i=R.isObject(e);if(i&&R.isHTMLForm(e)&&(e=new FormData(e)),R.isFormData(e))return o?JSON.stringify(K(e)):e;if(R.isArrayBuffer(e)||R.isBuffer(e)||R.isStream(e)||R.isFile(e)||R.isBlob(e))return e;if(R.isArrayBufferView(e))return e.buffer;if(R.isURLSearchParams(e))return oe(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(i){var a=R.hasOwnProperty(this,"formSerializer")?this.formSerializer:void 0,s=R.hasOwnProperty(this,"env")?this.env:void 0;if(-1!==n.indexOf("application/x-www-form-urlencoded"))return function(e,t){return L(e,new $.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return $.isNode&&R.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((r=R.isFileList(e))||n.indexOf("multipart/form-data")>-1){var u=s&&s.FormData;return L(r?{"files[]":e}:e,u&&new u,a)}}return i||o?(oe(t,"application/json"),function(e,t,r){if(R.isString(e))try{return(t||JSON.parse)(e),R.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||ae.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&R.isString(e)&&(r&&!this.responseType||n)){var o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw D.from(e,D.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,redact:A.slice(),env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};R.forEach(["delete","get","head"],(function(e){ae.headers[e]={}})),R.forEach(["post","put","patch"],(function(e){ae.headers[e]=R.merge(ne)}));var se=ae,ue=function(e,t,r,n){var o=this||se;return R.forEach(n,(function(n){e=n.call(o,e,t,r)})),e},ce=function(e){return!(!e||!e.__CANCEL__)},fe=/[^\x09\x20-\x7E\x80-\xFF]/g,le=/^[\x09\x20]+|[\x09\x20]+$/g;var pe=function e(t){return!1===t||null==t?t:R.isArray(t)?t.map(e):String(t).replace(fe,"").replace(le,"")};function de(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new te}var he=function(e){de(e),e.headers=e.headers||{},e.data=ue.call(e,e.data,e.headers,null,e.transformRequest),X(e.headers,"Accept"),X(e.headers,"Content-Type");var t=R.hasOwnProperty(e.headers,"common")&&e.headers.common?e.headers.common:{},r=e.method&&R.hasOwnProperty(e.headers,e.method)&&e.headers[e.method]?e.headers[e.method]:{};return e.headers=R.merge(t,r,e.headers),R.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),R.forEach(e.headers,(function(t,r){e.headers[r]=pe(t)})),(e.adapter||se.adapter)(e).then((function(t){return de(e),t.data=ue.call(e,t.data,t.headers,t.status,e.transformResponse),t}),(function(t){return ce(t)||(de(e),t&&t.response&&(t.response.data=ue.call(e,t.response.data,t.response.headers,t.response.status,e.transformResponse))),Promise.reject(t)}))},me=function(e,t){t=t||{};var r=Object.create(null);function n(e,t){return R.hasOwnProperty(e,t)?e[t]:void 0}function o(e,t){return R.hasOwnProperty(e,t)}function i(e,t){return R.isPlainObject(e)&&R.isPlainObject(t)?R.merge(e,t):R.isEmptyObject(t)?R.merge({},e):R.isPlainObject(t)?R.merge({},t):R.isArray(t)?t.slice():t}function a(r){return o(t,r)&&!R.isUndefined(t[r])?i(n(e,r),t[r]):o(e,r)&&!R.isUndefined(e[r])?i(void 0,e[r]):void 0}function s(e){if(o(t,e)&&!R.isUndefined(t[e]))return i(void 0,t[e])}function u(r){return o(t,r)&&!R.isUndefined(t[r])?i(void 0,t[r]):o(e,r)&&!R.isUndefined(e[r])?i(void 0,e[r]):void 0}function c(r){return o(t,r)?i(n(e,r),t[r]):o(e,r)?i(void 0,e[r]):void 0}var f={url:s,method:s,data:s,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,allowedSocketPaths:u,responseEncoding:u,validateStatus:c};return R.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){if("__proto__"!==e&&"constructor"!==e&&"prototype"!==e){var t=R.hasOwnProperty(f,e)?f[e]:a,n=t(e);R.isUndefined(n)&&t!==c||(r[e]=n)}})),r},ye="0.33.0",ve=ye,Ee={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Ee[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var be={};Ee.transitional=function(e,t,r){function n(e,t){return"[Axios v"+ve+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new D(n(o," has been removed"+(t?" in "+t:"")),D.ERR_DEPRECATED);return t&&!be[o]&&(be[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var Oe={assertOptions:function(e,t,r){if("object"!=typeof e)throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],u=void 0===s||a(s,i,e);if(!0!==u)throw new D("option "+i+" must be "+u,D.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}},validators:Ee},we=Oe.validators;function ge(e){this.defaults=e,this.interceptors={request:new V,response:new V}}ge.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=me(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&Oe.assertOptions(r,{silentJSONParsing:we.transitional(we.boolean),forcedJSONParsing:we.transitional(we.boolean),clarifyTimeoutError:we.transitional(we.boolean)},!1);var n=t.paramsSerializer;null!=n&&(R.isFunction(n)?t.paramsSerializer={serialize:n}:Oe.assertOptions(n,{encode:we.function,serialize:we.function},!0));var o=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));var a,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!i){var u=[he,void 0];for(Array.prototype.unshift.apply(u,o),u=u.concat(s),a=Promise.resolve(t);u.length;)a=a.then(u.shift(),u.shift());return a}for(var c=t;o.length;){var f=o.shift(),l=o.shift();try{c=f(c)}catch(e){l(e);break}}try{a=he(c)}catch(e){return Promise.reject(e)}for(;s.length;)a=a.then(s.shift(),s.shift());return a},ge.prototype.getUri=function(e){e=me(this.defaults,e);var t=G(e.baseURL,e.url,e.allowAbsoluteUrls);return H(t,e.params,e.paramsSerializer)},R.forEach(["delete","get","head","options"],(function(e){ge.prototype[e]=function(t,r){var n=r||{};return this.request(me(n,{method:e,url:t,data:R.hasOwnProperty(n,"data")?n.data:void 0}))}})),R.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(me(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ge.prototype[e]=t(),ge.prototype[e+"Form"]=t(!0)}));var Re=ge;function Ae(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new te(e,n,o),t(r.reason))}))}Ae.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Ae.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},Ae.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},Ae.source=function(){var e;return{token:new Ae((function(t){e=t})),cancel:e}};var Se=Ae;var _e=function e(r){var n=new Re(r),o=t(Re.prototype.request,n);return R.extend(o,Re.prototype,n),R.extend(o,n),o.create=function(t){return e(me(r,t))},o}(se);_e.Axios=Re,_e.CanceledError=te,_e.CancelToken=Se,_e.isCancel=ce,_e.VERSION=ye,_e.toFormData=L,_e.AxiosError=D,_e.Cancel=_e.CanceledError,_e.all=function(e){return Promise.all(e)},_e.spread=function(e){return function(t){return e.apply(null,t)}},_e.isAxiosError=function(e){return R.isObject(e)&&!0===e.isAxiosError},_e.formToJSON=function(e){return K(R.isHTMLForm(e)?new FormData(e):e)};var Te=_e,je=_e;Te.default=je;export{Te as default};
|
|
1
|
+
var e,t=function(e,t){return function(){return e.apply(t,arguments)}},r=Object.prototype.toString,n=(e=Object.create(null),function(t){var n=r.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())});function o(e){return e=e.toLowerCase(),function(t){return n(t)===e}}function i(e){return Array.isArray(e)}function a(e){return void 0===e}var s=o("ArrayBuffer");function c(e){return null!==e&&"object"==typeof e}function u(e){if("object"!==n(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var f=o("Date"),l=o("File"),p=o("Blob"),h=o("FileList");function d(e){return"[object Function]"===r.call(e)}var m=o("URLSearchParams");function y(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}function v(e,t,r){var n=Object.create(null);n.value=r,n.writable=!0,n.enumerable=!0,n.configurable=!0,Object.defineProperty(e,t,n)}var O,b=(O="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return O&&e instanceof O});var g,E=o("HTMLFormElement"),w=(g=Object.prototype.hasOwnProperty,function(e,t){return g.call(e,t)}),R={isArray:i,isArrayBuffer:s,isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";if(!e)return!1;if("function"==typeof FormData&&e instanceof FormData)return!0;if(!c(e))return!1;var n=Object.getPrototypeOf(e);return!(!n||n===Object.prototype)&&(!!d(e.append)&&(r.call(e)===t||d(e.toString)&&e.toString()===t))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&s(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:u,isEmptyObject:function(e){if(!u(e))return!1;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},isUndefined:a,isDate:f,isFile:l,isBlob:p,isFunction:d,isStream:function(e){return c(e)&&d(e.pipe)},isURLSearchParams:m,isStandardBrowserEnv:function(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:y,merge:function e(){var t=Object.create(null);function r(r,n){var o;"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(u(o=Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0)&&u(r)?t[n]=e(o,r):u(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r)}for(var n=0,o=arguments.length;n<o;n++)y(arguments[n],r);return t},extend:function(e,r,n){return y(r,(function(r,o){e[o]=n&&"function"==typeof r?t(r,n):r})),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){if(e.prototype=Object.create(t.prototype,n),Object.prototype.hasOwnProperty.call(e.prototype,"constructor")?e.prototype.constructor=e:v(e.prototype,"constructor",e),r){var o=Object.keys(r);Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.prototype.propertyIsEnumerable.call(r,e)})))),o.forEach((function(t){var n=r[t];Object.prototype.hasOwnProperty.call(e.prototype,t)?e.prototype[t]=n:v(e.prototype,t,n)}))}},defineOwnProperty:v,toFlatObject:function(e,t,r,n){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:n,kindOfTest:o,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;if(i(e))return e;var t=e.length;if("number"!=typeof t||t<0||t>4294967295||Math.floor(t)!==t)return null;if(h(e)){for(var r=[];t-- >0;){var n=e[t];if(null===n||a(n))return null;v(r,t,n)}return r}for(var o=Object(e),s=Object.create(null),c=0,u=[],f=Object.prototype.hasOwnProperty;o&&c<t;){if(-1!==u.indexOf(o))return null;if(v(u,u.length,o),o===Object.prototype)break;var l=Object.getPrototypeOf(o);if(null===l){var p=Object.getOwnPropertyDescriptor(o,"constructor"),d=p&&f.call(p,"value")&&p.value,m="function"==typeof d&&Object.getOwnPropertyDescriptor(d,"prototype");if(m&&f.call(m,"value")&&m.value===o&&Function.prototype.toString.call(d)===Function.prototype.toString.call(Object))break}for(var y=Object.getOwnPropertyNames(o),O=0;O<y.length;O++){var b=y[O],g=+b;g>=0&&g<t&&Math.floor(g)===g&&String(g)===b&&f.call(o,b)&&!s[b]&&(s[b]=!0,c++)}o=l}if(c!==t)return null;for(var E=new Array(t);t-- >0;)v(E,t,e[t]);return E},isTypedArray:b,isFileList:h,forEachEntry:function(e,t){for(var r,n=(e&&e[Symbol.iterator]).call(e);(r=n.next())&&!r.done;){var o=r.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var r,n=[];null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:E,hasOwnProperty:w},j=["authorization","proxy-authorization","cookie","set-cookie","x-api-key","password"];function P(e){var t=Object.create(null);return t.value=e,t}function _(e,t,r,n){var o;return function(e,t){return"string"==typeof e&&t[e.toLowerCase()]}(r,t)?"[REDACTED ****]":R.isArray(e)?-1!==n.indexOf(e)?"[Circular]":(n.push(e),o=[],R.forEach(e,(function(e,r){o[r]=_(e,t,r,n)})),n.pop(),o):R.isPlainObject(e)?-1!==n.indexOf(e)?"[Circular]":(n.push(e),o={},R.forEach(e,(function(e,r){o[r]=_(e,t,r,n)})),n.pop(),o):e}function A(e){return e?_(e,function(e){var t=(e&&R.isArray(e.redact)&&e.redact.length?e.redact:null)||j,r={};return R.forEach(t,(function(e){"string"==typeof e&&(r[e.toLowerCase()]=!0)})),r}(e),void 0,[]):e}function S(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}R.inherits(S,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var x=S.prototype,T=Object.create(null);["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL","ERR_FORM_DATA_DEPTH_EXCEEDED"].forEach((function(e){T[e]=P(e)})),Object.defineProperties(S,T),Object.defineProperty(x,"isAxiosError",P(!0)),S.from=function(e,t,r,n,o,i){var a=Object.create(x);return R.toFlatObject(e,a,(function(e){return e!==Error.prototype})),S.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};var D=S,C="object"==typeof self?self.FormData:window.FormData;function N(e){return R.isPlainObject(e)||R.isArray(e)}function F(e){return R.endsWith(e,"[]")?e.slice(0,-2):e}function U(e,t,r){return e?e.concat(t).map((function(e,t){return e=F(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}var k=R.toFlatObject(R,{},null,(function(e){return/^is[A-Z]/.test(e)}));var B=["__proto__","constructor","prototype"];var L=function(e,t,r){if(!R.isObject(e))throw new TypeError("target must be an object");t=t||new(C||FormData);var n,o=(r=function(e){var t=Object.create(null);if(t.metaTokens=!0,t.dots=!1,t.indexes=!1,null==e)return t;for(var r=Object.getOwnPropertyNames(e),n=0;n<r.length;n++){var o=r[n];-1!==B.indexOf(o)||R.isUndefined(e[o])||(t[o]=e[o])}return t}(r)).metaTokens,i=r.visitor||d,a=r.dots,s=r.indexes,c=r.Blob||"undefined"!=typeof Blob&&Blob,u=void 0===r.maxDepth?100:r.maxDepth,f=c&&((n=t)&&R.isFunction(n.append)&&"FormData"===n[Symbol.toStringTag]&&n[Symbol.iterator]);if(!R.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(R.isDate(e))return e.toISOString();if(!f&&R.isBlob(e))throw new D("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(e)||R.isTypedArray(e)?f&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}var p=[];function h(e,t){if(t>u)throw new D("Maximum object depth of "+u+" exceeded (got "+t+" levels)",D.ERR_FORM_DATA_DEPTH_EXCEEDED);R.isObject(e)&&-1===p.indexOf(e)&&(R.defineOwnProperty(p,p.length,e),R.forEach(e,(function(e){h(e,t+1)})),p.pop())}function d(e,r,n){var i=e;if(e&&!n&&"object"==typeof e)if(R.endsWith(r,"{}"))r=o?r:r.slice(0,-2),h(e,1),e=JSON.stringify(e);else if(R.isArray(e)&&function(e){return R.isArray(e)&&!e.some(N)}(e)||(R.isFileList(e)||R.endsWith(r,"[]"))&&(i=R.toArray(e)))return r=F(r),i.forEach((function(e,n){!R.isUndefined(e)&&null!==e&&t.append(!0===s?U([r],n,a):null===s?r:r+"[]",l(e))})),!1;return!!N(e)||(t.append(U(n,r,a),l(e)),!1)}var m=Object.assign(k,{defaultVisitor:d,convertValue:l,isVisitable:N});if(!R.isObject(e))throw new TypeError("data must be an object");return function e(r,n,o){if(!R.isUndefined(r)){if((o=o||0)>u)throw new D("Maximum object depth of "+u+" exceeded (got "+o+" levels)",D.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(r))throw Error("Circular reference detected in "+n.join("."));R.defineOwnProperty(p,p.length,r),R.forEach(r,(function(r,a){!0===(!(R.isUndefined(r)||null===r)&&i.call(t,r,R.isString(a)?a.trim():a,n,m))&&e(r,n?n.concat(a):[a],o+1)})),p.pop()}}(e,null,0),t};function M(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20/g,(function(e){return t[e]}))}function I(e,t){this._pairs=[],e&&L(e,this,t)}var q=I.prototype;q.append=function(e,t){this._pairs.push([e,t])},q.toString=function(e){var t=e?function(t){return e.call(this,t,M)}:M;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var z=I;function H(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var V=function(e,t,r){if(!t)return e;var n=e.indexOf("#");-1!==n&&(e=e.slice(0,n));var o,i,a=H;return r&&(R.isFunction(r)?o=r:(a=R.hasOwnProperty(r,"encode")&&r.encode||H,o=R.hasOwnProperty(r,"serialize")?r.serialize:void 0)),(i=o?o(t,r):R.isURLSearchParams(t)?t.toString():new z(t,r).toString(a))&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e};function J(){this.handlers=[]}J.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},J.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},J.prototype.clear=function(){this.handlers&&(this.handlers=[])},J.prototype.forEach=function(e){R.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var W=J,X=function(e,t){R.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},$={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},K={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:z,FormData:FormData,Blob:Blob},protocols:["http","https","file","blob","url","data"]};function Q(e){var t,r,n={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)n[r=o[t]]=e[r];return n}function G(e){var t=[e];function r(e,r){var n=e[r]=function(e){if(!R.isArray(e))return e;var t=Object.keys(e);if(t.length!==e.length)return Q(e);for(var r=0;r<t.length;r++){var n=+t[r];if(n<0||n>=e.length||Math.floor(n)!==n||String(n)!==t[r])return Q(e)}return e}(e[r]);(R.isArray(n)||R.isPlainObject(n))&&t.push(n)}for(;t.length;)for(var n=t.pop(),o=Object.keys(n),i=0;i<o.length;i++)r(n,o[i]);return e}var Y=function(e){function t(e,r,n,o){var i=e[o++];if("__proto__"===i)return!0;var a=isFinite(+i),s=o>=e.length;return i=!i&&R.isArray(n)?n.length:i,s?(R.hasOwnProperty(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(R.hasOwnProperty(n,i)&&R.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&R.isArray(n[i])&&(n[i]=Q(n[i])),!a)}if(R.isFormData(e)&&R.isFunction(e.entries)){var r={};return R.forEachEntry(e,(function(e,n){var o=function(e){return R.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return"[]"===e[0]?"":e[1]||e[0]}))}(e);!function(e){var t=e.length-1;if(t>100)throw new D("Maximum object depth of 100 exceeded (got "+t+" levels)",D.ERR_FORM_DATA_DEPTH_EXCEEDED)}(o),t(o,n,r,0)})),G(r)}return null},Z=R.isStandardBrowserEnv()?{write:function(e,t,r,n,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),R.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),R.isString(n)&&a.push("path="+n),R.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){for(var t,r=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(t=n[o];" "===t.charAt(0);)t=t.substring(1);if(0===t.indexOf(r))return decodeURIComponent(t.substring(r.length))}return null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},ee=function(e,t,r){var n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||!1===r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t},te=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],re=R.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=R.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0};function ne(e,t,r){D.call(this,null==e?"canceled":e,D.ERR_CANCELED,t,r),this.name="CanceledError"}R.inherits(ne,D,{__CANCEL__:!0});var oe=ne,ie=function(e,t,r){var n=new oe(null,t,r);if(e)try{var o=e.reason;void 0!==o&&(n.reason=o)}catch(e){}return n},ae=function(e){return new Promise((function(t,r){var n,o=e.data,i=e.headers,a=e.responseType,s=R.hasOwnProperty(e,"withXSRFToken")?e.withXSRFToken:void 0;function c(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}R.isFormData(o)&&R.isStandardBrowserEnv()&&delete i["Content-Type"];var u=new XMLHttpRequest,f=R.hasOwnProperty(e,"auth")?e.auth:void 0;if(f){var l=R.hasOwnProperty(f,"username")&&f.username||"",p=R.hasOwnProperty(f,"password")&&f.password?unescape(encodeURIComponent(f.password)):"";i.Authorization="Basic "+btoa(l+":"+p)}var h=ee(e.baseURL,e.url,e.allowAbsoluteUrls);function d(){if(u){var n,o,i,s,f,l="getAllResponseHeaders"in u?(n=u.getAllResponseHeaders(),f={},n?(R.forEach(n.split("\n"),(function(e){if(s=e.indexOf(":"),o=R.trim(e.slice(0,s)).toLowerCase(),i=R.trim(e.slice(s+1)),o){if(f[o]&&te.indexOf(o)>=0)return;f[o]="set-cookie"===o?(f[o]?f[o]:[]).concat([i]):f[o]?f[o]+", "+i:i}})),f):f):null;!function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new D("Request failed with status code "+r.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:l,config:e,request:u}),u=null}}if(u.open(e.method.toUpperCase(),V(h,e.params,R.hasOwnProperty(e,"paramsSerializer")?e.paramsSerializer:void 0),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(d)},u.onabort=function(){u&&(r(new D("Request aborted",D.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new D("Network Error",D.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||$;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new D(t,n.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,e,u)),u=null},R.isStandardBrowserEnv()&&(R.isFunction(s)&&(s=s(e)),!0===s||!1!==s&&re(h))){var m=e.xsrfHeaderName&&e.xsrfCookieName&&Z.read(e.xsrfCookieName);m&&(i[e.xsrfHeaderName]=m)}"setRequestHeader"in u&&R.forEach(i,(function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete i[t]:u.setRequestHeader(t,e)})),R.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(n=function(t){u&&(r(!t||t.type?ie(e.signal,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n))),o||!1===o||0===o||""===o||(o=null);var y,v=(y=/^([-+\w]{1,25})(:?\/\/|:)/.exec(h))&&y[1]||"";v&&-1===K.protocols.indexOf(v)?r(new D("Unsupported protocol "+v+":",D.ERR_BAD_REQUEST,e)):u.send(o)}))},se={"Content-Type":"application/x-www-form-urlencoded"};function ce(e,t){!R.isUndefined(e)&&R.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var ue,fe={transitional:$,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(ue=ae),ue),transformRequest:[function(e,t){X(t,"Accept"),X(t,"Content-Type");var r,n=t&&t["Content-Type"]||"",o=n.indexOf("application/json")>-1,i=R.isObject(e);if(i&&R.isHTMLForm(e)&&(e=new FormData(e)),R.isFormData(e))return o?JSON.stringify(Y(e)):e;if(R.isArrayBuffer(e)||R.isBuffer(e)||R.isStream(e)||R.isFile(e)||R.isBlob(e))return e;if(R.isArrayBufferView(e))return e.buffer;if(R.isURLSearchParams(e))return ce(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(i){var a=R.hasOwnProperty(this,"formSerializer")?this.formSerializer:void 0,s=R.hasOwnProperty(this,"env")?this.env:void 0;if(-1!==n.indexOf("application/x-www-form-urlencoded"))return function(e,t){return L(e,new K.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return K.isNode&&R.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((r=R.isFileList(e))||n.indexOf("multipart/form-data")>-1){var c=s&&s.FormData;return L(r?{"files[]":e}:e,c&&new c,a)}}return i||o?(ce(t,"application/json"),function(e,t,r){if(R.isString(e))try{return(t||JSON.parse)(e),R.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||fe.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&R.isString(e)&&(r&&!this.responseType||n)){var o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw D.from(e,D.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,redact:j.slice(),env:{FormData:K.classes.FormData,Blob:K.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};R.forEach(["delete","get","head"],(function(e){fe.headers[e]={}})),R.forEach(["post","put","patch"],(function(e){fe.headers[e]=R.merge(se)}));var le=fe,pe=function(e,t,r,n){var o=this||le;return R.forEach(n,(function(n){e=n.call(o,e,t,r)})),e},he=function(e){return!(!e||!e.__CANCEL__)},de=/[^\x09\x20-\x7E\x80-\xFF]/g,me=/^[\x09\x20]+|[\x09\x20]+$/g;var ye=function e(t){return!1===t||null==t?t:R.isArray(t)?t.map(e):String(t).replace(de,"").replace(me,"")};function ve(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw ie(e.signal,e)}var Oe=function(e){ve(e),e.headers=R.hasOwnProperty(e,"headers")&&e.headers||{},e.data=pe.call(e,e.data,e.headers,null,e.transformRequest),X(e.headers,"Accept"),X(e.headers,"Content-Type");var t=R.hasOwnProperty(e.headers,"common")&&e.headers.common?e.headers.common:{},r=e.method&&R.hasOwnProperty(e.headers,e.method)&&e.headers[e.method]?e.headers[e.method]:{};return e.headers=R.merge(t,r,e.headers),R.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),R.forEach(e.headers,(function(t,r){e.headers[r]=ye(t)})),(e.adapter||le.adapter)(e).then((function(t){return ve(e),t.data=pe.call(e,t.data,t.headers,t.status,e.transformResponse),t}),(function(t){return he(t)||(ve(e),t&&t.response&&(t.response.data=pe.call(e,t.response.data,t.response.headers,t.response.status,e.transformResponse))),Promise.reject(t)}))};function be(e){for(var t=e.length,r=Object.create(null),n=[],o=e,i=e;o;){for(var a=Object.getOwnPropertyNames(o),s=0;s<a.length;s++){var c=a[s],u=+c;u>=0&&u<t&&Math.floor(u)===u&&String(u)===c&&!r[c]&&(r[c]=!0,n.push(c))}if(o=Object.getPrototypeOf(o),i=(i=i&&Object.getPrototypeOf(i))&&Object.getPrototypeOf(i),o&&o===i)throw new D("Circular prototype chain in params",D.ERR_BAD_OPTION_VALUE)}return n.sort((function(e,t){return e-t}))}var ge=function(e){if(R.isObject(e)){var t=[{value:e,depth:0,complete:!1}],r=[],n=null;"function"==typeof WeakMap?n=new WeakMap:"function"==typeof Map&&(n=new Map);for(var o=[],i=[],a=0;t.length;){var s,c=t.pop(),u=c.value;if(c.complete)r.pop(),n?n.set(u,c.depth):(-1===(s=o.indexOf(u))&&(s=a,a=(a+1)%128),o[s]=u,i[s]=c.depth);else if(0===c.depth?R.isObject(u):R.isPlainObject(u)||R.isArray(u)){if(c.depth>100)throw new D("params exceed the maximum depth of 100",D.ERR_BAD_OPTION_VALUE);if(-1!==r.indexOf(u))throw new D("Circular reference detected in params",D.ERR_BAD_OPTION_VALUE);if(n){if(n.has(u)&&n.get(u)>=c.depth)continue}else if(-1!==(s=o.indexOf(u))&&i[s]>=c.depth)continue;r.push(u),t.push({value:u,depth:c.depth,complete:!0});for(var f=R.isArray(u)?be(u):Object.keys(u),l=0;l<f.length;l++){var p=f[l];"__proto__"!==p&&"constructor"!==p&&"prototype"!==p&&t.push({value:u[p],depth:c.depth+1,complete:!1})}}}}},Ee=function(e,t){t=t||{},ge(R.hasOwnProperty(e,"params")?e.params:void 0),ge(R.hasOwnProperty(t,"params")?t.params:void 0);var r=Object.create(null);function n(e,t){return R.hasOwnProperty(e,t)?e[t]:void 0}function o(e,t){return R.hasOwnProperty(e,t)}function i(e,t){return R.isPlainObject(e)&&R.isPlainObject(t)?R.merge(e,t):R.isEmptyObject(t)?R.merge({},e):R.isPlainObject(t)?R.merge({},t):R.isArray(t)?t.slice():t}function a(r){return o(t,r)&&!R.isUndefined(t[r])?i(n(e,r),t[r]):o(e,r)&&!R.isUndefined(e[r])?i(void 0,e[r]):void 0}function s(e){if(o(t,e)&&!R.isUndefined(t[e]))return i(void 0,t[e])}function c(r){return o(t,r)&&!R.isUndefined(t[r])?i(void 0,t[r]):o(e,r)&&!R.isUndefined(e[r])?i(void 0,e[r]):void 0}function u(r){return o(t,r)?i(n(e,r),t[r]):o(e,r)?i(void 0,e[r]):void 0}var f={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,signal:function(r){var o=n(t,r);return R.isUndefined(o)?n(e,r):o},socketPath:c,allowedSocketPaths:c,responseEncoding:c,validateStatus:u};return R.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){if("__proto__"!==e&&"constructor"!==e&&"prototype"!==e){var t=R.hasOwnProperty(f,e)?f[e]:a,n=t(e);R.isUndefined(n)&&t!==u||(r[e]=n)}})),r},we="0.35.0",Re=we,je={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){je[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var Pe={};je.transitional=function(e,t,r){function n(e,t){return"[Axios v"+Re+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new D(n(o," has been removed"+(t?" in "+t:"")),D.ERR_DEPRECATED);return t&&!Pe[o]&&(Pe[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var _e={assertOptions:function(e,t,r){if("object"!=typeof e)throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],c=void 0===s||a(s,i,e);if(!0!==c)throw new D("option "+i+" must be "+c,D.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}},validators:je},Ae=_e.validators;function Se(e,t){return t?e.then(null,(function(e){try{if(e instanceof Error||"[object Error]"===Object.prototype.toString.call(e)){var r=t.stack;if("string"==typeof r){var n=r.indexOf("\n");r=-1===n?"":r.slice(n+1);var o=e.stack;!r||null!=o&&""!==o?r&&"string"==typeof o&&-1===o.indexOf(r)&&(e.stack=o+"\n"+r):e.stack=r}}}catch(e){}return Promise.reject(e)})):e}function xe(e){return function(){return Oe(e)}}function Te(e){this.defaults=e,this.interceptors={request:new W,response:new W}}Te.prototype.request=function e(t,r){"string"==typeof t?(r=r||{}).url=t:r=t||{};try{r=Ee(this.defaults,r)}catch(e){return Promise.reject(e)}var n=!0===r.captureCallerStack?function(e){var t={};try{Error.captureStackTrace?Error.captureStackTrace(t,e):t=new Error}catch(e){}return t}(e):null;r.method?r.method=r.method.toLowerCase():R.hasOwnProperty(this.defaults,"method")&&this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var o=r.transitional;void 0!==o&&_e.assertOptions(o,{silentJSONParsing:Ae.transitional(Ae.boolean),forcedJSONParsing:Ae.transitional(Ae.boolean),clarifyTimeoutError:Ae.transitional(Ae.boolean)},!1);var i=r.paramsSerializer;null!=i&&(R.isFunction(i)?r.paramsSerializer={serialize:i}:_e.assertOptions(i,{encode:Ae.function,serialize:Ae.function},!0));var a=[],s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(r)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));var c,u=[];if(this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)})),!s){var f=[Oe,void 0];for(Array.prototype.unshift.apply(f,a),f=f.concat(u),c=Promise.resolve(r);f.length;)c=c.then(f.shift(),f.shift());return Se(c,n)}for(var l=r;a.length;){var p=a.shift(),h=a.shift();try{l=p?p(l):l}catch(e){if(!h){c=Promise.reject(e);break}try{var d=h(e);d&&"function"==typeof d.then&&(c=Promise.resolve(d).then(xe(l)))}catch(e){c=Promise.reject(e)}break}}if(!c)try{c=Oe(l)}catch(e){c=Promise.reject(e)}for(;u.length;)c=c.then(u.shift(),u.shift());return Se(c,n)},Te.prototype.getUri=function(e){e=Ee(this.defaults,e);var t=ee(e.baseURL,e.url,e.allowAbsoluteUrls);return V(t,e.params,e.paramsSerializer)},R.forEach(["delete","get","head","options"],(function(e){Te.prototype[e]=function(t,r){var n=r||{};try{n=Ee(n,{method:e,url:t,data:R.hasOwnProperty(n,"data")?n.data:void 0})}catch(e){return Promise.reject(e)}return this.request(n)}})),R.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){var i;try{i=Ee(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n})}catch(e){return Promise.reject(e)}return this.request(i)}}Te.prototype[e]=t(),Te.prototype[e+"Form"]=t(!0)}));var De=Te;function Ce(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new oe(e,n,o),t(r.reason))}))}Ce.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Ce.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},Ce.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},Ce.source=function(){var e;return{token:new Ce((function(t){e=t})),cancel:e}};var Ne=Ce;var Fe=function e(r){var n=new De(r),o=t(De.prototype.request,n);return R.extend(o,De.prototype,n),R.extend(o,n),o.create=function(t){return e(Ee(r,t))},o}(le);Fe.Axios=De,Fe.CanceledError=oe,Fe.CancelToken=Ne,Fe.isCancel=he,Fe.VERSION=we,Fe.toFormData=L,Fe.AxiosError=D,Fe.Cancel=Fe.CanceledError,Fe.all=function(e){return Promise.all(e)},Fe.spread=function(e){return function(t){return e.apply(null,t)}},Fe.isAxiosError=function(e){return R.isObject(e)&&!0===e.isAxiosError},Fe.formToJSON=function(e){return Y(R.isHTMLForm(e)?new FormData(e):e)};var Ue=Fe,ke=Fe;Ue.default=ke;export{Ue as default};
|
|
2
2
|
//# sourceMappingURL=axios.min.js.map
|