"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,n=(e,n)=>{for(var s in n||(n={}))r.call(n,s)&&o(e,s,n[s]);if(t)for(var s of t(n))a.call(n,s)&&o(e,s,n[s]);return e},s=require("../utils.js");const d=(e,t,r)=>{const a={};return e.forEach((e=>{s.isUndefined(r[e])?s.isUndefined(t[e])||(a[e]=t[e]):a[e]=r[e]})),a};exports.mergeConfig=(e,t={})=>{const r=t.method||e.method||"GET";let a={baseURL:e.baseURL||"",method:r,url:t.url||"",params:t.params||{},custom:n(n({},e.custom||{}),t.custom||{}),header:s.deepMerge(e.header||{},t.header||{})};if(a=n(n({},a),d(["getTask","validateStatus"],e,t)),"DOWNLOAD"===r);else if("UPLOAD"===r){delete a.header["content-type"],delete a.header["Content-Type"];["filePath","name","formData"].forEach((e=>{s.isUndefined(t[e])||(a[e]=t[e])}))}else{const r=["data","timeout","dataType","responseType"];a=n(n({},a),d(r,e,t))}return a};
