UNPKG

vdi-axios

Version:
3 lines (2 loc) 20.6 kB
"use strict";var Me=Object.defineProperty;var fe=Object.getOwnPropertySymbols;var Je=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable;var le=(r,e,t)=>e in r?Me(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,k=(r,e)=>{for(var t in e||(e={}))Je.call(e,t)&&le(r,t,e[t]);if(fe)for(var t of fe(e))ke.call(e,t)&&le(r,t,e[t]);return r};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var $=require("@wendellhu/redi");const Q=$.createIdentifier("HTTP_CLIENT_CONFIG"),Y=$.createIdentifier("HTTP_INTERCEPTORS");var Z={exports:{}},Te=function(e,t){return function(){for(var n=new Array(arguments.length),s=0;s<n.length;s++)n[s]=arguments[s];return e.apply(t,n)}},Ve=Te,ee=Object.prototype.toString,re=function(r){return function(e){var t=ee.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}}(Object.create(null));function C(r){return r=r.toLowerCase(),function(t){return re(t)===r}}function te(r){return Array.isArray(r)}function B(r){return typeof r=="undefined"}function We(r){return r!==null&&!B(r)&&r.constructor!==null&&!B(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var _e=C("ArrayBuffer");function ze(r){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&_e(r.buffer),e}function Xe(r){return typeof r=="string"}function Ge(r){return typeof r=="number"}function Ae(r){return r!==null&&typeof r=="object"}function L(r){if(re(r)!=="object")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}var Ke=C("Date"),Qe=C("File"),Ye=C("Blob"),Ze=C("FileList");function ne(r){return ee.call(r)==="[object Function]"}function er(r){return Ae(r)&&ne(r.pipe)}function rr(r){var e="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||ee.call(r)===e||ne(r.toString)&&r.toString()===e)}var tr=C("URLSearchParams");function nr(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function ir(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function ie(r,e){if(!(r===null||typeof r=="undefined"))if(typeof r!="object"&&(r=[r]),te(r))for(var t=0,i=r.length;t<i;t++)e.call(null,r[t],t,r);else for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.call(null,r[n],n,r)}function G(){var r={};function e(n,s){L(r[s])&&L(n)?r[s]=G(r[s],n):L(n)?r[s]=G({},n):te(n)?r[s]=n.slice():r[s]=n}for(var t=0,i=arguments.length;t<i;t++)ie(arguments[t],e);return r}function sr(r,e,t){return ie(e,function(n,s){t&&typeof n=="function"?r[s]=Ve(n,t):r[s]=n}),r}function ar(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function or(r,e,t,i){r.prototype=Object.create(e.prototype,i),r.prototype.constructor=r,t&&Object.assign(r.prototype,t)}function ur(r,e,t){var i,n,s,a={};e=e||{};do{for(i=Object.getOwnPropertyNames(r),n=i.length;n-- >0;)s=i[n],a[s]||(e[s]=r[s],a[s]=!0);r=Object.getPrototypeOf(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e}function fr(r,e,t){r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;var i=r.indexOf(e,t);return i!==-1&&i===t}function lr(r){if(!r)return null;var e=r.length;if(B(e))return null;for(var t=new Array(e);e-- >0;)t[e]=r[e];return t}var cr=function(r){return function(e){return r&&e instanceof r}}(typeof Uint8Array!="undefined"&&Object.getPrototypeOf(Uint8Array)),p={isArray:te,isArrayBuffer:_e,isBuffer:We,isFormData:rr,isArrayBufferView:ze,isString:Xe,isNumber:Ge,isObject:Ae,isPlainObject:L,isUndefined:B,isDate:Ke,isFile:Qe,isBlob:Ye,isFunction:ne,isStream:er,isURLSearchParams:tr,isStandardBrowserEnv:ir,forEach:ie,merge:G,extend:sr,trim:nr,stripBOM:ar,inherits:or,toFlatObject:ur,kindOf:re,kindOfTest:C,endsWith:fr,toArray:lr,isTypedArray:cr,isFileList:Ze},_=p;function ce(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Pe=function(e,t,i){if(!t)return e;var n;if(i)n=i(t);else if(_.isURLSearchParams(t))n=t.toString();else{var s=[];_.forEach(t,function(f,d){f===null||typeof f=="undefined"||(_.isArray(f)?d=d+"[]":f=[f],_.forEach(f,function(l){_.isDate(l)?l=l.toISOString():_.isObject(l)&&(l=JSON.stringify(l)),s.push(ce(d)+"="+ce(l))}))}),n=s.join("&")}if(n){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e},dr=p;function F(){this.handlers=[]}F.prototype.use=function(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1};F.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};F.prototype.forEach=function(e){dr.forEach(this.handlers,function(i){i!==null&&e(i)})};var pr=F,hr=p,vr=function(e,t){hr.forEach(e,function(n,s){s!==t&&s.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[s])})},Se=p;function P(r,e,t,i,n){Error.call(this),this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),n&&(this.response=n)}Se.inherits(P,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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Ne=P.prototype,xe={};["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"].forEach(function(r){xe[r]={value:r}});Object.defineProperties(P,xe);Object.defineProperty(Ne,"isAxiosError",{value:!0});P.from=function(r,e,t,i,n,s){var a=Object.create(Ne);return Se.toFlatObject(r,a,function(f){return f!==Error.prototype}),P.call(a,r.message,e,t,i,n),a.name=r.name,s&&Object.assign(a,s),a};var x=P,De={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},R=p;function mr(r,e){e=e||new FormData;var t=[];function i(s){return s===null?"":R.isDate(s)?s.toISOString():R.isArrayBuffer(s)||R.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function n(s,a){if(R.isPlainObject(s)||R.isArray(s)){if(t.indexOf(s)!==-1)throw Error("Circular reference detected in "+a);t.push(s),R.forEach(s,function(f,d){if(!R.isUndefined(f)){var o=a?a+"."+d:d,l;if(f&&!a&&typeof f=="object"){if(R.endsWith(d,"{}"))f=JSON.stringify(f);else if(R.endsWith(d,"[]")&&(l=R.toArray(f))){l.forEach(function(m){!R.isUndefined(m)&&e.append(o,i(m))});return}}n(f,o)}}),t.pop()}else e.append(a,i(s))}return n(r),e}var $e=mr,V=x,Er=function(e,t,i){var n=i.config.validateStatus;!i.status||!n||n(i.status)?e(i):t(new V("Request failed with status code "+i.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))},U=p,yr=U.isStandardBrowserEnv()?function(){return{write:function(t,i,n,s,a,u){var f=[];f.push(t+"="+encodeURIComponent(i)),U.isNumber(n)&&f.push("expires="+new Date(n).toGMTString()),U.isString(s)&&f.push("path="+s),U.isString(a)&&f.push("domain="+a),u===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(t){var i=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Rr=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Or=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},br=Rr,wr=Or,Ue=function(e,t){return e&&!br(t)?wr(e,t):t},W=p,Cr=["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"],Tr=function(e){var t={},i,n,s;return e&&W.forEach(e.split(` `),function(u){if(s=u.indexOf(":"),i=W.trim(u.substr(0,s)).toLowerCase(),n=W.trim(u.substr(s+1)),i){if(t[i]&&Cr.indexOf(i)>=0)return;i==="set-cookie"?t[i]=(t[i]?t[i]:[]).concat([n]):t[i]=t[i]?t[i]+", "+n:n}}),t},de=p,_r=de.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),i;function n(s){var a=s;return e&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return i=n(window.location.href),function(a){var u=de.isString(a)?n(a):a;return u.protocol===i.protocol&&u.host===i.host}}():function(){return function(){return!0}}(),K=x,Ar=p;function Le(r){K.call(this,r==null?"canceled":r,K.ERR_CANCELED),this.name="CanceledError"}Ar.inherits(Le,K,{__CANCEL__:!0});var j=Le,Pr=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""},D=p,Sr=Er,Nr=yr,xr=Pe,Dr=Ue,$r=Tr,Ur=_r,Lr=De,O=x,gr=j,Br=Pr,pe=function(e){return new Promise(function(i,n){var s=e.data,a=e.headers,u=e.responseType,f;function d(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}D.isFormData(s)&&D.isStandardBrowserEnv()&&delete a["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(l+":"+m)}var h=Dr(e.baseURL,e.url);o.open(e.method.toUpperCase(),xr(h,e.params,e.paramsSerializer),!0),o.timeout=e.timeout;function oe(){if(!!o){var y="getAllResponseHeaders"in o?$r(o.getAllResponseHeaders()):null,T=!u||u==="text"||u==="json"?o.responseText:o.response,w={data:T,status:o.status,statusText:o.statusText,headers:y,config:e,request:o};Sr(function(J){i(J),d()},function(J){n(J),d()},w),o=null}}if("onloadend"in o?o.onloadend=oe:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(oe)},o.onabort=function(){!o||(n(new O("Request aborted",O.ECONNABORTED,e,o)),o=null)},o.onerror=function(){n(new O("Network Error",O.ERR_NETWORK,e,o,o)),o=null},o.ontimeout=function(){var T=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",w=e.transitional||Lr;e.timeoutErrorMessage&&(T=e.timeoutErrorMessage),n(new O(T,w.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,e,o)),o=null},D.isStandardBrowserEnv()){var ue=(e.withCredentials||Ur(h))&&e.xsrfCookieName?Nr.read(e.xsrfCookieName):void 0;ue&&(a[e.xsrfHeaderName]=ue)}"setRequestHeader"in o&&D.forEach(a,function(T,w){typeof s=="undefined"&&w.toLowerCase()==="content-type"?delete a[w]:o.setRequestHeader(w,T)}),D.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),u&&u!=="json"&&(o.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&o.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(y){!o||(n(!y||y&&y.type?new gr:y),o.abort(),o=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),s||(s=null);var M=Br(h);if(M&&["http","https","file"].indexOf(M)===-1){n(new O("Unsupported protocol "+M+":",O.ERR_BAD_REQUEST,e));return}o.send(s)})},Ir=null,c=p,he=vr,ve=x,Fr=De,jr=$e,Hr={"Content-Type":"application/x-www-form-urlencoded"};function me(r,e){!c.isUndefined(r)&&c.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function qr(){var r;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(r=pe),r}function Mr(r,e,t){if(c.isString(r))try{return(e||JSON.parse)(r),c.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(r)}var H={transitional:Fr,adapter:qr(),transformRequest:[function(e,t){if(he(t,"Accept"),he(t,"Content-Type"),c.isFormData(e)||c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return me(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i=c.isObject(e),n=t&&t["Content-Type"],s;if((s=c.isFileList(e))||i&&n==="multipart/form-data"){var a=this.env&&this.env.FormData;return jr(s?{"files[]":e}:e,a&&new a)}else if(i||n==="application/json")return me(t,"application/json"),Mr(e);return e}],transformResponse:[function(e){var t=this.transitional||H.transitional,i=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,s=!i&&this.responseType==="json";if(s||n&&c.isString(e)&&e.length)try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?ve.from(a,ve.ERR_BAD_RESPONSE,this,null,this.response):a}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ir},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};c.forEach(["delete","get","head"],function(e){H.headers[e]={}});c.forEach(["post","put","patch"],function(e){H.headers[e]=c.merge(Hr)});var se=H,Jr=p,kr=se,Vr=function(e,t,i){var n=this||kr;return Jr.forEach(i,function(a){e=a.call(n,e,t)}),e},ge=function(e){return!!(e&&e.__CANCEL__)},Ee=p,z=Vr,Wr=ge,zr=se,Xr=j;function X(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Xr}var Gr=function(e){X(e),e.headers=e.headers||{},e.data=z.call(e,e.data,e.headers,e.transformRequest),e.headers=Ee.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Ee.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var t=e.adapter||zr.adapter;return t(e).then(function(n){return X(e),n.data=z.call(e,n.data,n.headers,e.transformResponse),n},function(n){return Wr(n)||(X(e),n&&n.response&&(n.response.data=z.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})},E=p,Be=function(e,t){t=t||{};var i={};function n(o,l){return E.isPlainObject(o)&&E.isPlainObject(l)?E.merge(o,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function s(o){if(E.isUndefined(t[o])){if(!E.isUndefined(e[o]))return n(void 0,e[o])}else return n(e[o],t[o])}function a(o){if(!E.isUndefined(t[o]))return n(void 0,t[o])}function u(o){if(E.isUndefined(t[o])){if(!E.isUndefined(e[o]))return n(void 0,e[o])}else return n(void 0,t[o])}function f(o){if(o in t)return n(e[o],t[o]);if(o in e)return n(void 0,e[o])}var d={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials: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,responseEncoding:u,validateStatus:f};return E.forEach(Object.keys(e).concat(Object.keys(t)),function(l){var m=d[l]||s,h=m(l);E.isUndefined(h)&&m!==f||(i[l]=h)}),i},Ie={version:"0.27.2"},Kr=Ie.version,b=x,ae={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){ae[r]=function(i){return typeof i===r||"a"+(e<1?"n ":" ")+r}});var ye={};ae.transitional=function(e,t,i){function n(s,a){return"[Axios v"+Kr+"] Transitional option '"+s+"'"+a+(i?". "+i:"")}return function(s,a,u){if(e===!1)throw new b(n(a," has been removed"+(t?" in "+t:"")),b.ERR_DEPRECATED);return t&&!ye[a]&&(ye[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,a,u):!0}};function Qr(r,e,t){if(typeof r!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(r),n=i.length;n-- >0;){var s=i[n],a=e[s];if(a){var u=r[s],f=u===void 0||a(u,s,r);if(f!==!0)throw new b("option "+s+" must be "+f,b.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new b("Unknown option "+s,b.ERR_BAD_OPTION)}}var Yr={assertOptions:Qr,validators:ae},Fe=p,Zr=Pe,Re=pr,Oe=Gr,q=Be,et=Ue,je=Yr,A=je.validators;function S(r){this.defaults=r,this.interceptors={request:new Re,response:new Re}}S.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=q(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var i=t.transitional;i!==void 0&&je.assertOptions(i,{silentJSONParsing:A.transitional(A.boolean),forcedJSONParsing:A.transitional(A.boolean),clarifyTimeoutError:A.transitional(A.boolean)},!1);var n=[],s=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(t)===!1||(s=s&&h.synchronous,n.unshift(h.fulfilled,h.rejected))});var a=[];this.interceptors.response.forEach(function(h){a.push(h.fulfilled,h.rejected)});var u;if(!s){var f=[Oe,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(a),u=Promise.resolve(t);f.length;)u=u.then(f.shift(),f.shift());return u}for(var d=t;n.length;){var o=n.shift(),l=n.shift();try{d=o(d)}catch(m){l(m);break}}try{u=Oe(d)}catch(m){return Promise.reject(m)}for(;a.length;)u=u.then(a.shift(),a.shift());return u};S.prototype.getUri=function(e){e=q(this.defaults,e);var t=et(e.baseURL,e.url);return Zr(t,e.params,e.paramsSerializer)};Fe.forEach(["delete","get","head","options"],function(e){S.prototype[e]=function(t,i){return this.request(q(i||{},{method:e,url:t,data:(i||{}).data}))}});Fe.forEach(["post","put","patch"],function(e){function t(i){return function(s,a,u){return this.request(q(u||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}S.prototype[e]=t(),S.prototype[e+"Form"]=t(!0)});var rt=S,tt=j;function N(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var t=this;this.promise.then(function(i){if(!!t._listeners){var n,s=t._listeners.length;for(n=0;n<s;n++)t._listeners[n](i);t._listeners=null}}),this.promise.then=function(i){var n,s=new Promise(function(a){t.subscribe(a),n=a}).then(i);return s.cancel=function(){t.unsubscribe(n)},s},r(function(n){t.reason||(t.reason=new tt(n),e(t.reason))})}N.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};N.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};N.prototype.unsubscribe=function(e){if(!!this._listeners){var t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}};N.source=function(){var e,t=new N(function(n){e=n});return{token:t,cancel:e}};var nt=N,it=function(e){return function(i){return e.apply(null,i)}},st=p,at=function(e){return st.isObject(e)&&e.isAxiosError===!0},be=p,ot=Te,g=rt,ut=Be,ft=se;function He(r){var e=new g(r),t=ot(g.prototype.request,e);return be.extend(t,g.prototype,e),be.extend(t,e),t.create=function(n){return He(ut(r,n))},t}var v=He(ft);v.Axios=g;v.CanceledError=j;v.CancelToken=nt;v.isCancel=ge;v.VERSION=Ie.version;v.toFormData=$e;v.AxiosError=x;v.Cancel=v.CanceledError;v.all=function(e){return Promise.all(e)};v.spread=it;v.isAxiosError=at;Z.exports=v;Z.exports.default=v;var we=Z.exports,lt=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,dt=(r,e,t,i)=>{for(var n=i>1?void 0:i?ct(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&lt(e,t,n),n},pt=(r,e)=>(t,i)=>e(t,i,r);let I=class{constructor(r){this.interceptors=r}register(r){const e=t=>(console.error(t),Promise.reject(t));this.interceptors.forEach(t=>{r.request.use((...i)=>t.request(...i),i=>t.requestError?t.requestError(i):e(i)),r.response.use((...i)=>t.response(...i),i=>t.responseError?t.responseError(i):e(i))})}};I=dt([pt(0,$.Many(Y))],I);class ht{request(e){return e}response(e){return e}}var vt=Object.defineProperty,mt=Object.getOwnPropertyDescriptor,Et=(r,e,t,i)=>{for(var n=i>1?void 0:i?mt(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&vt(e,t,n),n},Ce=(r,e)=>(t,i)=>e(t,i,r);exports.HttpClient=class extends we.Axios{constructor(r,e){super(k(k({},we.defaults),r)),this.config=r,this.CreateHttpInterceptor=e,this.CreateHttpInterceptor.register(this.interceptors)}};exports.HttpClient=Et([Ce(0,$.Inject(Q)),Ce(1,$.Inject(I))],exports.HttpClient);class yt{static forRoot(e){return{providers:[[Q,{useValue:e}],[Y,{useClass:ht}],[I],[exports.HttpClient]],vueModule:exports.HttpClient}}}exports.HTTP_CLIENT_CONFIG=Q;exports.HTTP_CLIENT_INTERCEPTORS=Y;exports.HttpClientModule=yt;