var Y=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},x=(t,e,r)=>(Y(t,e,"read from private field"),r?r.call(t):e.get(t)),At=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Tt=(t,e,r,o)=>(Y(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),b;class Z{constructor(e){this.message=e}toString(){return`Cancel${this.message?`: ${this.message}`:""}`}}function I(t){return t instanceof Z}const et=class{constructor(e){At(this,b,void 0);let r;const o=new Promise(n=>{r=u=>{x(this,b)||(Tt(this,b,new Z(u)),n(x(this,b)))}});this.onCancel=o.then.bind(o),e(r)}static source(){let e;return{token:new et(r=>{e=r}),cancel:e}}throwIfRequested(){if(x(this,b))throw x(this,b)}};let L=et;b=new WeakMap;function rt(t){return t instanceof L}let nt=class extends Error{constructor(e,r,o,n){super(e),this.config=r,this.request=n,this.response=o}};function xt(t,e,r,o){return new nt(t,e,r,o)}function ot(t){return t instanceof nt}const at=["options","trace","connect"],st=["head","get","delete"],_=["post","put","patch"],kt=new RegExp(`^(${_.join("|")})`,"i"),H=Object.prototype.toString;function Ct(t){return t===null}function k(t){return typeof t=="undefined"}function z(t){return typeof t=="string"||H.call(t)==="[object String]"}function m(t){return H.call(t)==="[object Object]"}function it(t){return Array.isArray(t)}function Rt(t){return H.call(t)==="[object Date]"}function d(t){return typeof t=="function"}function w(t,e){t||Dt(e)}function Dt(t){throw new Error(`[axios-miniprogram]: ${t}`)}function St(t){return m(t)?t:{}}const Mt=/\/:([^/]+)/g;function ut(t,e={},r={}){const o=St(r);return t.replace(Mt,(n,u)=>{var c;const i=(c=e[u])!=null?c:o[u];return u in e&&delete e[u],`/${i}`})}function q(...t){const e={};for(const r of t.filter(m))for(const[o,n]of Object.entries(r))if(m(n)){const u=e[o];e[o]=m(u)?q(u,n):q(n)}else e[o]=n;return e}var Ft=Object.defineProperty,ct=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,lt=(t,e,r)=>e in t?Ft(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,It=(t,e)=>{for(var r in e||(e={}))Wt.call(e,r)&<(t,r,e[r]);if(ct)for(var r of ct(e))Ut.call(e,r)&<(t,r,e[r]);return t};function Lt(t,...e){const r=It({},t);return A(r,e),r}function A(t,e){for(const r of e)delete t[r]}const ft="common",_t=[ft].concat(at,st,_);function Ht(t){var e;const r=(e=t.headers)!=null?e:{},o=q(r[ft],r[t.method],r);return Lt(o,..._t)}function zt(t,e,r){return it(r)||(d(r)?r=[r]:r=[]),r.forEach(o=>{t=o(t,e)}),t}function Nt(t="",e={},r=Bt){const o=r(e);return o&&(t=`${t}${t.indexOf("?")===-1?"?":"&"}${o}`),t}function Bt(t){const e=[];function r(o,n){e.push(`${pt(o)}=${pt(n)}`)}for(const[o,n]of Object.entries(t))if(!Ct(n)&&!k(n)&&n===n)if(m(n))for(const[u,c]of Object.entries(n))r(`${o}[${u}]`,c);else if(it(n)){const u=`${o}[]`;for(const c of n)r(u,c)}else Rt(n)?r(o,n.toISOString()):r(o,n);return e.join("&")}function pt(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}const Gt=/^([a-z][\w-.]*:)\/\//i;function Kt(t){return Gt.test(t)}function dt(t="",e=""){return e?Kt(e)?e:`${t.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`:t}function ht(t){const e=dt(t.baseURL,t.url);return Nt(e,t.params,t.paramsSerializer)}function Jt(t){let e="request";return t.download&&/^GET/i.test(t.method)?e="download":t.upload&&/^POST/i.test(t.method)&&(e="upload"),e}var Qt=Object.defineProperty,Vt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,vt=(t,e,r)=>e in t?Qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,te=(t,e)=>{for(var r in e||(e={}))Yt.call(e,r)&&vt(t,r,e[r]);if(mt)for(var r of mt(e))Zt.call(e,r)&&vt(t,r,e[r]);return t},ee=(t,e)=>Vt(t,Xt(e));function re(t){return new Promise((e,r)=>{const o=ee(te({},t),{type:Jt(t),url:ht(t),method:t.method.toUpperCase(),success:u,fail:c});let n;try{n=t.adapter(o)}catch(s){c({status:400,statusText:"Bad Adapter"}),console.error(s)}function u(s){var f,v,p;const l=s;l.status=(f=l.status)!=null?f:200,l.statusText=(v=l.statusText)!=null?v:"OK",l.headers=(p=l.headers)!=null?p:{},l.config=t,l.request=n;const{validateStatus:T}=t;!d(T)||T(l.status)?e(l):i("validate status error",l)}function c(s){var f,v,p;const l=s;l.isFail=!0,l.status=(f=l.status)!=null?f:400,l.statusText=(v=l.statusText)!=null?v:"Fail",l.headers=(p=l.headers)!=null?p:{},l.config=t,l.request=n,i("request fail",l)}function i(s,f){r(xt(s,t,f,n))}m(n)&&yt(o,n.onProgressUpdate);const{cancelToken:a}=t;rt(a)&&a.onCancel(s=>{m(n)&&(yt(o,n.offProgressUpdate),d(n.abort)&&n.abort()),r(s)})})}function yt(t,e){if(d(e)){const{type:r,onUploadProgress:o,onDownloadProgress:n}=t;switch(r){case"upload":d(o)&&e(o);break;case"download":d(n)&&e(n);break}}}function ne(t){N(t),w(d(t.adapter),"adapter \u4E0D\u662F\u4E00\u4E2A function"),w(z(t.url),"url \u4E0D\u662F\u4E00\u4E2A string"),w(z(t.method),"method \u4E0D\u662F\u4E00\u4E2A string"),t.url=ut(t.url,t.params,t.data),t.headers=Ht(t),kt.test(t.method)?o(t,t.transformRequest):delete t.data;function e(n){return N(t),o(n,t.transformResponse),n}function r(n){return I(n)||(N(t),o(n.response,t.transformResponse)),Promise.reject(n)}function o(n,u){n.data=zt(n.data,n.headers,u)}return re(t).then(e,r)}function N(t){const{cancelToken:e}=t;rt(e)&&e.throwIfRequested()}var wt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},$=(t,e,r)=>(wt(t,e,"read from private field"),r?r.call(t):e.get(t)),bt=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},oe=(t,e,r,o)=>(wt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),ae=(t,e,r,o)=>({set _(n){oe(t,e,n,r)},get _(){return $(t,e,o)}}),C,g;let $t=class{constructor(){bt(this,C,0),bt(this,g,new Map)}get size(){return $(this,g).size}use(e,r){return $(this,g).set(++ae(this,C)._,{resolved:e,rejected:r}),$(this,C)}eject(e){return $(this,g).delete(e)}clear(){$(this,g).clear()}forEach(e){$(this,g).forEach(e)}};C=new WeakMap,g=new WeakMap;var se=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},gt=(t,e,r)=>(se(t,e,"read from private field"),r?r.call(t):e.get(t)),ie=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},ue=(t,e,r)=>new Promise((o,n)=>{var u=a=>{try{i(r.next(a))}catch(s){n(s)}},c=a=>{try{i(r.throw(a))}catch(s){n(s)}},i=a=>a.done?o(a.value):Promise.resolve(a.value).then(u,c);i((r=r.apply(t,e)).next())}),R;let ce=class{constructor(){ie(this,R,[])}use(e){w(d(e),"middleware \u4E0D\u662F\u4E00\u4E2A function"),gt(this,R).push(e)}createContext(e){return{req:e,res:null}}run(e,r){const o=[...gt(this,R),r];function n(){return ue(this,null,function*(){yield o.shift()(e,n)})}return n()}enhanceRun(e){return(r,o)=>e(r,()=>this.run(r,o))}};R=new WeakMap;const le={url:!0,data:!0,upload:!0,download:!0},fe={headers:!0,params:!0};function D(t={},e={}){const r={},o=Array.from(new Set([...Object.keys(t),...Object.keys(e)]));for(const n of o){const u=t[n],c=e[n];le[n]?k(c)||(r[n]=c):fe[n]?m(u)&&m(c)?r[n]=q(u,c):m(c)?r[n]=c:m(u)&&(r[n]=u):k(c)?k(u)||(r[n]=u):r[n]=c}return r}var B=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},h=(t,e,r)=>(B(t,e,"read from private field"),r?r.call(t):e.get(t)),E=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},pe=(t,e,r,o)=>(B(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),S=(t,e,r)=>(B(t,e,"access private method"),r),Et=(t,e,r)=>new Promise((o,n)=>{var u=a=>{try{i(r.next(a))}catch(s){n(s)}},c=a=>{try{i(r.throw(a))}catch(s){n(s)}},i=a=>a.done?o(a.value):Promise.resolve(a.value).then(u,c);i((r=r.apply(t,e)).next())}),y,j,M,G,F,K,J,Q,W;class O{constructor(e,r){E(this,M),E(this,F),E(this,y,void 0),this.interceptors={request:new $t,response:new $t},E(this,j,new ce),this.request=(o,n={})=>{var u,c;z(o)?n.url=o:n=o,n=D(this.defaults,n),n.method=(c=(u=n.method)==null?void 0:u.toLowerCase())!=null?c:"get";const i={resolved:h(this,J)},a={rejected:n.errorHandler},s=[];return S(this,M,G).call(this,f=>{s.unshift(f)}),s.push(i),S(this,F,K).call(this,f=>{s.push(f)}),s.push(a),s.reduce((f,{resolved:v,rejected:p})=>f.then(v,p),Promise.resolve(n))},this.use=o=>(h(this,j).use(o),this),E(this,J,o=>Et(this,null,function*(){const n=h(this,j).createContext(o);return yield h(this,W).call(this,n,h(this,Q)),n.res})),E(this,Q,o=>Et(this,null,function*(){o.res=yield ne(o.req)})),E(this,W,(o,n)=>h(this,y)?h(this,j).enhanceRun(h(h(this,y),W))(o,n):h(this,j).run(o,n)),this.defaults=e,pe(this,y,r)}}y=new WeakMap,j=new WeakMap,M=new WeakSet,G=function(t){var e;this.interceptors.request.forEach(t),h(this,y)&&S(e=h(this,y),M,G).call(e,t)},F=new WeakSet,K=function(t){var e;this.interceptors.response.forEach(t),h(this,y)&&S(e=h(this,y),F,K).call(e,t)},J=new WeakMap,Q=new WeakMap,W=new WeakMap;for(const t of at)O.prototype[t]=function(e,r={}){return r.method=t,this.request(e,r)};for(const t of st)O.prototype[t]=function(e,r,o={}){return o.method=t,o.params=q(r,o.params),this.request(e,o)};for(const t of _)O.prototype[t]=function(e,r,o={}){return o.method=t,o.data=r,this.request(e,o)};function V(t,e){const r=new O(t,e),o=r.request;return o.getUri=function(n){return n.url=ut(n.url,n.params,n.data),ht(D(t,n))},o.create=function(n){return V(D(t,n))},o.extend=function(n){return n.baseURL=dt(t.baseURL,n.baseURL),V(D(t,n),r)},o.fork=o.extend,Object.assign(o,r),Object.setPrototypeOf(o,O.prototype),o}var de=Object.defineProperty,he=Object.defineProperties,me=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,jt=(t,e,r)=>e in t?de(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ve=(t,e)=>{for(var r in e||(e={}))Ot.call(e,r)&&jt(t,r,e[r]);if(U)for(var r of U(e))Pt.call(e,r)&&jt(t,r,e[r]);return t},ye=(t,e)=>he(t,me(e)),we=(t,e)=>{var r={};for(var o in t)Ot.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&U)for(var o of U(t))e.indexOf(o)<0&&Pt.call(t,o)&&(r[o]=t[o]);return r};function X(t){w(m(t),"platform \u4E0D\u662F\u4E00\u4E2A object"),w(d(t.request),"request \u4E0D\u662F\u4E00\u4E2A function"),w(d(t.upload),"upload \u4E0D\u662F\u4E00\u4E2A function"),w(d(t.download),"download \u4E0D\u662F\u4E00\u4E2A function");function e(i){const a=r(i);switch(i.type){case"request":return n(t.request,a);case"download":return c(t.download,a);case"upload":return u(t.upload,a)}}function r(i){return ye(ve({},i),{header:i.headers,success(a){o(a),i.success(a)},fail(a){a.data={errMsg:a.errMsg,errno:a.errno},o(a),i.fail(a)}})}function o(i){var a,s;i.status=(a=i.status)!=null?a:i.statusCode,i.headers=(s=i.headers)!=null?s:i.header,A(i,["statusCode","errMsg","errno","header"])}function n(i,a){return i(a)}function u(i,a){const s=a,f=s.data,{name:v,filePath:p,fileType:l}=f,T=we(f,["name","filePath","fileType"]);return s.name=v,s.fileName=v,s.filePath=p,s.fileType=l,s.formData=T,A(s,["params","data"]),i(s)}function c(i,a){const s=a,{params:f,success:v}=s;return s.filePath=f==null?void 0:f.filePath,s.success=p=>{p.data={filePath:p.filePath,tempFilePath:p.tempFilePath||p.apFilePath},A(p,["tempFilePath","apFilePath","filePath"]),v(p)},A(s,["params"]),i(s)}return e}function be(){const t=r(e());if(!o(t))return;function e(){const n="undefined";if(typeof wx!==n)return wx;if(typeof my!==n)return my;if(typeof swan!==n)return swan;if(typeof tt!==n)return tt;if(typeof qq!==n)return qq;if(typeof qh!==n)return qh;if(typeof ks!==n)return ks;if(typeof dd!==n)return dd;if(typeof jd!==n)return jd}function r(n){var u,c,i;return n&&{request:(u=n.request)!=null?u:n.httpRequest,upload:(c=n.upload)!=null?c:n.uploadFile,download:(i=n.download)!=null?i:n.downloadFile}}function o(n){return m(n)&&d(n.request)&&d(n.upload)&&d(n.download)}return X(t)}const $e={adapter:be(),headers:{common:{Accept:"application/json, text/plain, */*"},options:{},get:{},head:{},post:{},put:{},patch:{},delete:{},trace:{},connect:{}},validateStatus(t){return t>=200&&t<300},dataType:"json",responseType:"text",timeout:1e4},qt="2.5.0",P=V($e);P.version=qt,P.Axios=O,P.CancelToken=L,P.createAdapter=X,P.isCancel=I,P.isAxiosError=ot;export{O as Axios,L as CancelToken,X as createAdapter,P as default,ot as isAxiosError,I as isCancel,qt as version}; //# sourceMappingURL=axios-miniprogram.esm.js.map