"use strict";var e=Object.defineProperty,t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(t,r,a)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,l=(e,l)=>{for(var n in l||(l={}))r.call(l,n)&&o(e,n,l[n]);if(t)for(var n of t(l))a.call(l,n)&&o(e,n,l[n]);return e},n=require("../../../../../common/vendor.js"),s=require("../helpers/buildURL.js"),i=require("../core/buildFullPath.js"),d=require("../core/settle.js"),u=require("../utils.js");const c=(e,t)=>{const r={};return e.forEach((e=>{u.isUndefined(t[e])||(r[e]=t[e])})),r};exports.adapter=e=>new Promise(((t,r)=>{const a=s.buildURL(i.buildFullPath(e.baseURL,e.url),e.params),o={url:a,header:e.header,complete:o=>{e.fullPath=a,o.config=e;try{"string"==typeof o.data&&(o.data=JSON.parse(o.data))}catch(l){}d.settle(t,r,o)}};let u;if("UPLOAD"===e.method){delete o.header["content-type"],delete o.header["Content-Type"];const t={filePath:e.filePath,name:e.name},r=["formData"];u=n.index.uploadFile(l(l(l({},o),t),c(r,e)))}else if("DOWNLOAD"===e.method)u=n.index.downloadFile(o);else{const t=["data","method","timeout","dataType","responseType"];u=n.index.request(l(l({},o),c(t,e)))}e.getTask&&e.getTask(u,e)}));
