7 lines
44 KiB
JavaScript
7 lines
44 KiB
JavaScript
|
|
function pt(e,t){return function(){return e.apply(t,arguments)}}const{toString:tn}=Object.prototype,{getPrototypeOf:Ie}=Object,we=(e=>t=>{const n=tn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),F=e=>(e=e.toLowerCase(),t=>we(t)===e),Ee=e=>t=>typeof t===e,{isArray:V}=Array,Z=Ee("undefined");function nn(e){return e!==null&&!Z(e)&&e.constructor!==null&&!Z(e.constructor)&&C(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ht=F("ArrayBuffer");function rn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ht(e.buffer),t}const sn=Ee("string"),C=Ee("function"),mt=Ee("number"),be=e=>e!==null&&typeof e=="object",on=e=>e===!0||e===!1,ce=e=>{if(we(e)!=="object")return!1;const t=Ie(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},an=F("Date"),ln=F("File"),un=F("Blob"),cn=F("FileList"),fn=e=>be(e)&&C(e.pipe),dn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||C(e.append)&&((t=we(e))==="formdata"||t==="object"&&C(e.toString)&&e.toString()==="[object FormData]"))},pn=F("URLSearchParams"),[hn,mn,yn,_n]=["ReadableStream","Request","Response","Headers"].map(F),wn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function te(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),V(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let l;for(r=0;r<i;r++)l=o[r],t.call(null,e[l],l,e)}}function yt(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_t=e=>!Z(e)&&e!==q;function Pe(){const{caseless:e}=_t(this)&&this||{},t={},n=(r,s)=>{const o=e&&yt(t,s)||s;ce(t[o])&&ce(r)?t[o]=Pe(t[o],r):ce(r)?t[o]=Pe({},r):V(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&te(arguments[r],n);return t}const En=(e,t,n,{allOwnKeys:r}={})=>(te(t,(s,o)=>{n&&C(s)?e[o]=pt(s,n):e[o]=s},{allOwnKeys:r}),e),bn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Rn=(e,t,n,r)=>{let s,o,i;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=n!==!1&&Ie(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Sn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},vn=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!mt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Tn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ie(Uint8Array)),On=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},An=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xn=F("HTMLFormElement"),Cn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ye=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nn=F("RegExp"),wt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};te(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Pn=e=>{wt(e,(t,n)=>{if(C(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(C(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Fn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return V(e)?r(e):r(String(e).split(t)),n},Dn=()=>{},Ln=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Oe="abcdefghijklmnopqrstuvwxyz",Qe="0123456789",Et={DIGIT:Qe,ALPHA:Oe,ALPHA_DIGIT:Oe+Oe.toUpperCase()+Qe},Bn=(e=16,t=Et.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;
|
||
|
|
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&rr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},nt=Symbol("internals");function K(e){return e&&String(e).trim().toLowerCase()}function fe(e){return e===!1||e==null?e:a.isArray(e)?e.map(fe):String(e)}function or(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const ir=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ae(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function ar(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function lr(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class A{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(l,f,c){const u=K(f);if(!u)throw new Error("header name must be a non-empty string");const d=a.findKey(s,u);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||f]=fe(l))}const i=(l,f)=>a.forEach(l,(c,u)=>o(c,u,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!ir(t))i(sr(t),n);else if(a.isHeaders(t))for(const[l,f]of t.entries())o(f,l,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=K(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return or(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=K(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ae(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=K(i),i){const l=a.findKey(r,i);l&&(!n||Ae(r,r[l],l,n))&&(delete r[l],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Ae(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=fe(s),delete n[o];return}const l=t?ar(o):String(o).trim();l!==o&&delete n[o],n[l]=fe(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||
|
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[nt]=this[nt]={accessors:{}}).accessors,s=this.prototype;function o(i){const l=K(i);r[l]||(lr(s,i),r[l]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(A.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(A);function xe(e,t){const n=this||ne,r=t||n,s=A.from(r.headers);let o=r.data;return a.forEach(e,function(l){o=l.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function xt(e){return!!(e&&e.__CANCEL__)}function W(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(W,y,{__CANCEL__:!0});function Ct(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ur(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function cr(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const c=Date.now(),u=r[o];i||(i=c),n[s]=f,r[s]=c;let d=o,_=0;for(;d!==s;)_+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-i<t)return;const w=u&&c-u;return w?Math.round(_*1e3/w):void 0}}function fr(e,t){let n=0,r=1e3/t,s,o;const i=(c,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?i(c,u):(s=c,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const de=(e,t,n=3)=>{let r=0;const s=cr(50,250);return fr(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,f=i-r,c=s(f),u=i<=l;r=i;const d={loaded:i,total:l,progress:l?i/l:void 0,bytes:f,rate:c||void 0,estimated:c&&l&&u?(l-i)/c:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},n)},rt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},st=e=>(...t)=>a.asap(()=>e(...t)),dr=O.hasStandardBrowserEnv?function(){const t=O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const l=a.isString(i)?s(i):i;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),pr=O.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Nt(e,t){return e&&!hr(t)?mr(e,t):t}const ot=e=>e instanceof A?{...e}:e;function I(e,t){t=t||{};const n={};function r(c,u,d){return a.isPlainObject(c)&&a.isPlainObject(u)?a.merge.call({caseless:d},c,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(c,u,d){if(a.isUndefined(u)){if(!a.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function o(c,u){if(!a.isUndefined(u))return r(void 0,u)}function i(c,u){if(a.isUndefined(u)){if(!a.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function l(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const f={url:o,metho
|
||
|
|
`+o.map(lt).join(`
|
||
|
|
`):" "+lt(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Be};function Ce(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new W(null,e)}function ut(e){return Ce(e),e.headers=A.from(e.headers),e.data=xe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lt.getAdapter(e.adapter||ne.adapter)(e).then(function(r){return Ce(e),r.data=xe.call(e,e.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return xt(r)||(Ce(e),r&&r.response&&(r.response.data=xe.call(e,e.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const Bt="1.7.7",ze={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ze[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ct={};ze.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Bt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,l)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!ct[i]&&(ct[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,l):!0}};function xr(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const l=e[o],f=l===void 0||i(l,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const ke={assertOptions:xr,validators:ze},B=ke.validators;class j{constructor(t){this.defaults=t,this.interceptors={request:new tt,response:new tt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
|
|
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=I(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ke.assertOptions(r,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ke.assertOptions(s,{encode:B.function,serialize:B.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=A.concat(i,o);const l=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,_;if(!f){const p=[ut.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,c),_=p.length,u=Promise.resolve(n);d<_;)u=u.then(p[d++],p[d++]);return u}_=l.length;let w=n;for(d=0;d<_;){const p=l[d++],m=l[d++];try{w=p(w)}catch(h){m.call(this,h);break}}try{u=ut.call(this,w)}catch(p){return Promise.reject(p)}for(d=0,_=c.length;d<_;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=I(this.defaults,t);const n=Nt(t.baseURL,t.url);return Tt(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){j.prototype[t]=function(n,r){return this.request(I(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,l){return this.request(I(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}j.prototype[t]=n(),j.prototype[t+"Form"]=n(!0)});class Je{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(l=>{r.subscribe(l),o=l}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,l){r.reason||(r.reason=new W(o,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Je(function(s){t=s}),cancel:t}}}function Cr(e){return function(n){return e.apply(null,n)}}function Nr(e){return a.isObject(e)&&e.isAxiosError===!0}const Ue={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object
|