!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?e(exports):"function"==typeofdefine&&define.amd?define(["exports"],e):e(t.WHATWGFetch={})}(this,function(a){"use strict";vare="URLSearchParams"inself,r="Symbol"inself&&"iterator"inSymbol,h="FileReader"inself&&"Blob"inself&&function(){try{returnnewBlob,!0}catch(t){return!1}}(),o="FormData"inself,n="ArrayBuffer"inself;if(n)vari=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){returnt&&-1<i.indexOf(Object.prototype.toString.call(t))};functionu(t){if("string"!=typeoft&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))thrownewTypeError("Invalid character in header field name");returnt.toLowerCase()}functionf(t){return"string"!=typeoft&&(t=String(t)),t}functiont(e){vart={next:function(){vart=e.shift();return{done:void0===t,value:t}}};returnr&&(t[Symbol.iterator]=function(){returnt}),t}functiond(e){this.map={},einstanceofd?e.forEach(function(t,e){this.append(e,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}functionc(t){if(t.bodyUsed)returnPromise.reject(newTypeError("Already read"));t.bodyUsed=!0}functionp(r){returnnewPromise(function(t,e){r.onload=function(){t(r.result)},r.onerror=function(){e(r.error)}})}functiony(t){vare=newFileReader,r=p(e);returne.readAsArrayBuffer(t),r}functionl(t){if(t.slice)returnt.slice(0);vare=newUint8Array(t.byteLength);returne.set(newUint8Array(t)),e.buffer}functionb(){returnthis.bodyUsed=!1,this._initBody=function(t){(this._bodyInit=t)?"string"==typeoft?this._bodyText=t:h&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():n&&h&&function(t){returnt&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=l(t.buffer),this._bodyInit=newBlob([this._bodyArrayBuffer])):n&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=l(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeoft?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},h&&(this.blob=function(){vart=c(this);if(t)returnt;if(this._bodyBlob)returnPromise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)returnPromise.resolve(newBlob([this._bodyArrayBuffer]));if(this._bodyFormData)thrownewError("could not read FormData body as blob");returnPromise.resolve(newBlob([this._bodyText]))},this.arrayBuffer=function(){returnthis._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){vart=c(this);if(t)returnt;if(this._bodyBlob)returnfunction(t){vare=newFileReader,r=p(e);returne.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)returnPromise.resolve(function(t){for(vare=newUint8Array(t),r=newArray(e.length),o=0;o<e.length;o++)r[o]=String.fromCharCode(e[o]);returnr.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)thrownewError("could not read FormData body as text");returnPromise.resolve(this._bodyText)},o&&(this.formData=function(){returnthis.text().then(v)}),this.json=function(){returnthis.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=f(e);varr=this.map[t];this.map[t]=r?r+", "+e:e},d.prototype.delete=function(t){deletethis.map[u(t)]},d.prototype.get=function(t){returnt=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){returnthis.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=f(e)},d.prototype.forEach=function(t,e){for(varrinthis.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},d.prototype.keys=function(){varr=[];returnthis.forEach(function(t,e){r.push(e)}),t(r)},d.prototype.values=function(){vare=[];returnthis.forEach(function(t){e.push(t)}),t(e)},d.prototype.entries=function(){varr=[];returnthis.forEach(function(t,e){r.push([e,t])}),t(r)},r&&(d.prototype[Symbol.iterator]=d.prototype.entries);varm=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];functionw(t,e){varr=(e=e||{}).body;if(tinstanceofw){if(t.bodyUsed)thrownewTypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=newd(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}elsethis.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=newd(e.headers)),this.method=function(t){vare=t.toUpperCase();return-1<m.indexOf(e)?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)thrownewTypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}functionv(t){varn=newFormData;returnt.trim().split("&").forEach(function(t){if(t){vare=t.split("="),r=e.shift().replace(/\+/g," "),o=e.join("=").replace(/\+/g," ");n.append(decodeURIComponent(r),decodeURIComponent(o))}}),n}functionE(t,e){e=e||{},this.type="default",this.status=void0===e.status?200:e.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"ine?e.statusText:"OK",this.headers=newd(e.headers),this.url=e.url||"",this._initBody(t)}w.prototype.clone=function(){returnneww(this,{body:this._bodyInit})},b.call(w.prototype),b.call(E.prototype),E.prototype.clone=function(){returnnewE(this._bodyInit,{status:this.status,statusText:this.statusText,headers:newd(this.headers),url:this.url})},E.error=function(){vart=newE(null,{status:0,statusText:""});returnt.type="error",t};varA=[301,302,303,307,308];E.redirect=function(t,e){if(-1===A.indexOf(e))thrownewRangeError("Invalid status code");returnnewE(null,{status:e,headers:{location:t}})},a.DOMException=self.DOMException;try{newa.DOMException}catch(t){a.DOMException=function(t,e){this.message=t,this.name=e;varr=Error(t);this.stack=r.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function_(i,s){returnnewPromise(function(r,t){vare=neww(i,s);if(e.signal&&e.signal.aborted)returnt(newa.DOMException("Aborted","AbortError"));varo=newXMLHttpRequest;functionn(){o.abort()}o.onload=function(){vart={status:o.status,statusText:o.statusText,headers:function(t){varn=newd;returnt.replace(/\r?\n[\t]+/g," ").split(/\r?\n/).forEach(function(t){vare=t.split(":"),r=e.shift().trim();if(r){varo=e.join(":").trim();n.append(r,o)}}),n}(o.getAllResponseHeaders()||"")};t.url="responseURL"ino?o.responseURL:t.headers.get("X-Request-URL");vare="response"ino?o.response:o.responseText;r(newE(e,t))},o.onerror=function(){t(newTypeError("Network request failed"))},o.ontimeout=function(){t(newTypeError("Network request failed"))},o.onabort=function(){t(newa.DOMException("Aborted","AbortError"))},o.open(e.method,e.url,!0),"include"===e.credentials?o.withCredentials=!0:"omit"===e.credentials&&(o.withCredentials=!1),"responseType"ino&&h&&(o.responseType="blob"),e.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),e.signal&&(e.signal.addEventListener("abort",n),o.onreadystatechange=function(){4===o.readyState&&e.signal.removeEventListener("abort",n)}),o.send(void0===e._bodyInit?null:e._bodyInit)})}_.polyfill=!0,self.fetch||(self.fetch=_,self.Headers=d,self.Request=w,self.Response=E),a.Headers=d,a.Request=w,a.Response=E,a.fetch=_,Object.defineProperty(a,"__esModule",{value:!0})});