Comparing version 0.1.6 to 0.1.7
@@ -1686,3 +1686,3 @@ declare enum ErrorCode { | ||
*/ | ||
getPlayerSeason(options: ClientFnOptions<PlayerSeasonOptions>): Promise<Result<PlayerSeason>>; | ||
getPlayerSeason(options: ClientFnOptions<PlayerSeasonOptions>): Promise<Result<PlayerSeason | PlayerSeason[]>>; | ||
/** | ||
@@ -1790,5 +1790,9 @@ * Get a list of all past matches from the api | ||
/** | ||
* Gamemode type | ||
*/ | ||
gamemode: GameModeStatGamemode; | ||
/** | ||
* Player object or id | ||
*/ | ||
player: Player | string; | ||
player: string | Array<string>; | ||
/** | ||
@@ -1803,3 +1807,3 @@ * Fetch player ranked statistics | ||
} | ||
declare type PlayerSeasonResponse = PromiseResult<PlayerSeason>; | ||
declare type PlayerSeasonResponse = PromiseResult<PlayerSeason | Array<PlayerSeason>>; | ||
/** | ||
@@ -1812,3 +1816,3 @@ * Get data for a single season of a player(s) by a given id or name | ||
*/ | ||
declare function getPlayerSeason({ player, ranked, season, ...rest }: PlayerSeasonOptions): PlayerSeasonResponse; | ||
declare function getPlayerSeason({ gamemode, player, ranked, season, ...rest }: PlayerSeasonOptions): PlayerSeasonResponse; | ||
@@ -1815,0 +1819,0 @@ interface SamplesOptions extends WithApiShard { |
@@ -1,9 +0,9 @@ | ||
(()=>{var Ss=Object.create;var he=Object.defineProperty,Rs=Object.defineProperties,Os=Object.getOwnPropertyDescriptor,Cs=Object.getOwnPropertyDescriptors,Es=Object.getOwnPropertyNames,me=Object.getOwnPropertySymbols,xs=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable;var Be=(t,e,r)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b=(t,e)=>{for(var r in e||(e={}))De.call(e,r)&&Be(t,r,e[r]);if(me)for(var r of me(e))Ot.call(e,r)&&Be(t,r,e[r]);return t},_=(t,e)=>Rs(t,Cs(e)),Ps=t=>he(t,"__esModule",{value:!0});var q=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var K=(t,e)=>{var r={};for(var s in t)De.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&me)for(var s of me(t))e.indexOf(s)<0&&Ot.call(t,s)&&(r[s]=t[s]);return r};var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var gs=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Es(e))!De.call(t,s)&&s!=="default"&&he(t,s,{get:()=>e[s],enumerable:!(r=Os(e,s))||r.enumerable});return t},Ct=t=>gs(Ps(he(t!=null?Ss(xs(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Ue=(t,e,r)=>(Be(t,typeof e!="symbol"?e+"":e,r),r);var Ke=y((Li,jt)=>{"use strict";jt.exports=function(e,r){return function(){for(var i=new Array(arguments.length),o=0;o<i.length;o++)i[o]=arguments[o];return e.apply(r,i)}}});var g=y((Mi,zt)=>{"use strict";var qs=Ke(),$=Object.prototype.toString;function je(t){return $.call(t)==="[object Array]"}function He(t){return typeof t=="undefined"}function Ns(t){return t!==null&&!He(t)&&t.constructor!==null&&!He(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Fs(t){return $.call(t)==="[object ArrayBuffer]"}function Ls(t){return typeof FormData!="undefined"&&t instanceof FormData}function Ms(t){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function Is(t){return typeof t=="string"}function Ds(t){return typeof t=="number"}function Ht(t){return t!==null&&typeof t=="object"}function Ae(t){if($.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Bs(t){return $.call(t)==="[object Date]"}function Us(t){return $.call(t)==="[object File]"}function ks(t){return $.call(t)==="[object Blob]"}function Wt(t){return $.call(t)==="[object Function]"}function Ks(t){return Ht(t)&&Wt(t.pipe)}function js(t){return typeof URLSearchParams!="undefined"&&t instanceof URLSearchParams}function Hs(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ws(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function We(t,e){if(!(t===null||typeof t=="undefined"))if(typeof t!="object"&&(t=[t]),je(t))for(var r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}function ze(){var t={};function e(i,o){Ae(t[o])&&Ae(i)?t[o]=ze(t[o],i):Ae(i)?t[o]=ze({},i):je(i)?t[o]=i.slice():t[o]=i}for(var r=0,s=arguments.length;r<s;r++)We(arguments[r],e);return t}function zs(t,e,r){return We(e,function(i,o){r&&typeof i=="function"?t[o]=qs(i,r):t[o]=i}),t}function $s(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}zt.exports={isArray:je,isArrayBuffer:Fs,isBuffer:Ns,isFormData:Ls,isArrayBufferView:Ms,isString:Is,isNumber:Ds,isObject:Ht,isPlainObject:Ae,isUndefined:He,isDate:Bs,isFile:Us,isBlob:ks,isFunction:Wt,isStream:Ks,isURLSearchParams:js,isStandardBrowserEnv:Ws,forEach:We,merge:ze,extend:zs,trim:Hs,stripBOM:$s}});var be=y((Ii,Yt)=>{"use strict";var V=g();function $t(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Yt.exports=function(e,r,s){if(!r)return e;var i;if(s)i=s(r);else if(V.isURLSearchParams(r))i=r.toString();else{var o=[];V.forEach(r,function(c,d){c===null||typeof c=="undefined"||(V.isArray(c)?d=d+"[]":c=[c],V.forEach(c,function(l){V.isDate(l)?l=l.toISOString():V.isObject(l)&&(l=JSON.stringify(l)),o.push($t(d)+"="+$t(l))}))}),i=o.join("&")}if(i){var u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}});var Vt=y((Di,Qt)=>{"use strict";var Ys=g();function ve(){this.handlers=[]}ve.prototype.use=function(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};ve.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};ve.prototype.forEach=function(e){Ys.forEach(this.handlers,function(s){s!==null&&e(s)})};Qt.exports=ve});var Xt=y((Bi,Jt)=>{"use strict";var Qs=g();Jt.exports=function(e,r){Qs.forEach(e,function(i,o){o!==r&&o.toUpperCase()===r.toUpperCase()&&(e[r]=i,delete e[o])})}});var _e=y((Ui,Zt)=>{"use strict";Zt.exports=function(e,r,s,i,o){return e.config=r,s&&(e.code=s),e.request=i,e.response=o,e.isAxiosError=!0,e.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}},e}});var Se=y((ki,Gt)=>{"use strict";var Vs=_e();Gt.exports=function(e,r,s,i,o){var u=new Error(e);return Vs(u,r,s,i,o)}});var $e=y((Ki,er)=>{"use strict";var Js=Se();er.exports=function(e,r,s){var i=s.config.validateStatus;!s.status||!i||i(s.status)?e(s):r(Js("Request failed with status code "+s.status,s.config,null,s.request,s))}});var rr=y((ji,tr)=>{"use strict";var Re=g();tr.exports=Re.isStandardBrowserEnv()?function(){return{write:function(r,s,i,o,u,a){var c=[];c.push(r+"="+encodeURIComponent(s)),Re.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),Re.isString(o)&&c.push("path="+o),Re.isString(u)&&c.push("domain="+u),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var nr=y((Hi,sr)=>{"use strict";sr.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}});var or=y((Wi,ir)=>{"use strict";ir.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}});var Ye=y((zi,ar)=>{"use strict";var Xs=nr(),Zs=or();ar.exports=function(e,r){return e&&!Xs(r)?Zs(e,r):r}});var pr=y(($i,ur)=>{"use strict";var Qe=g(),Gs=["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"];ur.exports=function(e){var r={},s,i,o;return e&&Qe.forEach(e.split(` | ||
`),function(a){if(o=a.indexOf(":"),s=Qe.trim(a.substr(0,o)).toLowerCase(),i=Qe.trim(a.substr(o+1)),s){if(r[s]&&Gs.indexOf(s)>=0)return;s==="set-cookie"?r[s]=(r[s]?r[s]:[]).concat([i]):r[s]=r[s]?r[s]+", "+i:i}}),r}});var fr=y((Yi,cr)=>{"use strict";var lr=g();cr.exports=lr.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function i(o){var u=o;return e&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=i(window.location.href),function(u){var a=lr.isString(u)?i(u):u;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}()});var J=y((Qi,dr)=>{"use strict";function Ve(t){this.message=t}Ve.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Ve.prototype.__CANCEL__=!0;dr.exports=Ve});var mr=y((Vi,hr)=>{"use strict";var Oe=g(),en=$e(),tn=rr(),rn=be(),sn=Ye(),nn=pr(),on=fr(),Je=Se(),an=X(),un=J();hr.exports=function(e){return new Promise(function(s,i){var o=e.data,u=e.headers,a=e.responseType,c;function d(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}Oe.isFormData(o)&&delete u["Content-Type"];var n=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";u.Authorization="Basic "+btoa(l+":"+f)}var v=sn(e.baseURL,e.url);n.open(e.method.toUpperCase(),rn(v,e.params,e.paramsSerializer),!0),n.timeout=e.timeout;function M(){if(!!n){var m="getAllResponseHeaders"in n?nn(n.getAllResponseHeaders()):null,S=!a||a==="text"||a==="json"?n.responseText:n.response,x={data:S,status:n.status,statusText:n.statusText,headers:m,config:e,request:n};en(function(h){s(h),d()},function(h){i(h),d()},x),n=null}}if("onloadend"in n?n.onloadend=M:n.onreadystatechange=function(){!n||n.readyState!==4||n.status===0&&!(n.responseURL&&n.responseURL.indexOf("file:")===0)||setTimeout(M)},n.onabort=function(){!n||(i(Je("Request aborted",e,"ECONNABORTED",n)),n=null)},n.onerror=function(){i(Je("Network Error",e,null,n)),n=null},n.ontimeout=function(){var S="timeout of "+e.timeout+"ms exceeded",x=e.transitional||an.transitional;e.timeoutErrorMessage&&(S=e.timeoutErrorMessage),i(Je(S,e,x.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",n)),n=null},Oe.isStandardBrowserEnv()){var O=(e.withCredentials||on(v))&&e.xsrfCookieName?tn.read(e.xsrfCookieName):void 0;O&&(u[e.xsrfHeaderName]=O)}"setRequestHeader"in n&&Oe.forEach(u,function(S,x){typeof o=="undefined"&&x.toLowerCase()==="content-type"?delete u[x]:n.setRequestHeader(x,S)}),Oe.isUndefined(e.withCredentials)||(n.withCredentials=!!e.withCredentials),a&&a!=="json"&&(n.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&n.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&n.upload&&n.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(c=function(m){!n||(i(!m||m&&m.type?new un("canceled"):m),n.abort(),n=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c))),o||(o=null),n.send(o)})}});var Ar=y((Ji,yr)=>{var Z=1e3,G=Z*60,ee=G*60,Y=ee*24,pn=Y*7,ln=Y*365.25;yr.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return cn(t);if(r==="number"&&isFinite(t))return e.long?dn(t):fn(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function cn(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return r*ln;case"weeks":case"week":case"w":return r*pn;case"days":case"day":case"d":return r*Y;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ee;case"minutes":case"minute":case"mins":case"min":case"m":return r*G;case"seconds":case"second":case"secs":case"sec":case"s":return r*Z;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function fn(t){var e=Math.abs(t);return e>=Y?Math.round(t/Y)+"d":e>=ee?Math.round(t/ee)+"h":e>=G?Math.round(t/G)+"m":e>=Z?Math.round(t/Z)+"s":t+"ms"}function dn(t){var e=Math.abs(t);return e>=Y?Ce(t,e,Y,"day"):e>=ee?Ce(t,e,ee,"hour"):e>=G?Ce(t,e,G,"minute"):e>=Z?Ce(t,e,Z,"second"):t+" ms"}function Ce(t,e,r,s){var i=e>=r*1.5;return Math.round(t/r)+" "+s+(i?"s":"")}});var Xe=y((Xi,br)=>{function hn(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=u,r.humanize=Ar(),r.destroy=d,Object.keys(t).forEach(n=>{r[n]=t[n]}),r.names=[],r.skips=[],r.formatters={};function e(n){let l=0;for(let f=0;f<n.length;f++)l=(l<<5)-l+n.charCodeAt(f),l|=0;return r.colors[Math.abs(l)%r.colors.length]}r.selectColor=e;function r(n){let l,f=null,v,M;function O(...m){if(!O.enabled)return;let S=O,x=Number(new Date),ne=x-(l||x);S.diff=ne,S.prev=l,S.curr=x,l=x,m[0]=r.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let h=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(ie,I)=>{if(ie==="%%")return"%";h++;let B=r.formatters[I];if(typeof B=="function"){let ce=m[h];ie=B.call(S,ce),m.splice(h,1),h--}return ie}),r.formatArgs.call(S,m),(S.log||r.log).apply(S,m)}return O.namespace=n,O.useColors=r.useColors(),O.color=r.selectColor(n),O.extend=s,O.destroy=r.destroy,Object.defineProperty(O,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(v!==r.namespaces&&(v=r.namespaces,M=r.enabled(n)),M),set:m=>{f=m}}),typeof r.init=="function"&&r.init(O),O}function s(n,l){let f=r(this.namespace+(typeof l=="undefined"?":":l)+n);return f.log=this.log,f}function i(n){r.save(n),r.namespaces=n,r.names=[],r.skips=[];let l,f=(typeof n=="string"?n:"").split(/[\s,]+/),v=f.length;for(l=0;l<v;l++)!f[l]||(n=f[l].replace(/\*/g,".*?"),n[0]==="-"?r.skips.push(new RegExp("^"+n.substr(1)+"$")):r.names.push(new RegExp("^"+n+"$")))}function o(){let n=[...r.names.map(a),...r.skips.map(a).map(l=>"-"+l)].join(",");return r.enable(""),n}function u(n){if(n[n.length-1]==="*")return!0;let l,f;for(l=0,f=r.skips.length;l<f;l++)if(r.skips[l].test(n))return!1;for(l=0,f=r.names.length;l<f;l++)if(r.names[l].test(n))return!0;return!1}function a(n){return n.toString().substring(2,n.toString().length-2).replace(/\.\*\?$/,"*")}function c(n){return n instanceof Error?n.stack||n.message:n}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}br.exports=hn});var vr=y((N,Ee)=>{N.formatArgs=yn;N.save=An;N.load=bn;N.useColors=mn;N.storage=vn();N.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();N.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function mn(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function yn(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Ee.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}N.log=console.debug||console.log||(()=>{});function An(t){try{t?N.storage.setItem("debug",t):N.storage.removeItem("debug")}catch(e){}}function bn(){let t;try{t=N.storage.getItem("debug")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function vn(){try{return localStorage}catch(t){}}Ee.exports=Xe()(N);var{formatters:_n}=Ee.exports;_n.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Sr=y((Zi,_r)=>{"use strict";_r.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",s=e.indexOf(r+t),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}});var Cr=y((Gi,Or)=>{"use strict";var Sn=q("os"),Rr=q("tty"),D=Sr(),{env:R}=process,j;D("no-color")||D("no-colors")||D("color=false")||D("color=never")?j=0:(D("color")||D("colors")||D("color=true")||D("color=always"))&&(j=1);"FORCE_COLOR"in R&&(R.FORCE_COLOR==="true"?j=1:R.FORCE_COLOR==="false"?j=0:j=R.FORCE_COLOR.length===0?1:Math.min(parseInt(R.FORCE_COLOR,10),3));function Ze(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Ge(t,e){if(j===0)return 0;if(D("color=16m")||D("color=full")||D("color=truecolor"))return 3;if(D("color=256"))return 2;if(t&&!e&&j===void 0)return 0;let r=j||0;if(R.TERM==="dumb")return r;if(process.platform==="win32"){let s=Sn.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in R)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(s=>s in R)||R.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in R)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(R.TEAMCITY_VERSION)?1:0;if(R.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in R){let s=parseInt((R.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(R.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(R.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(R.TERM)||"COLORTERM"in R?1:r}function Rn(t){let e=Ge(t,t&&t.isTTY);return Ze(e)}Or.exports={supportsColor:Rn,stdout:Ze(Ge(!0,Rr.isatty(1))),stderr:Ze(Ge(!0,Rr.isatty(2)))}});var xr=y((C,Pe)=>{var On=q("tty"),xe=q("util");C.init=Tn;C.log=Pn;C.formatArgs=En;C.save=gn;C.load=wn;C.useColors=Cn;C.destroy=xe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");C.colors=[6,2,3,4,5,1];try{let t=Cr();t&&(t.stderr||t).level>=2&&(C.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}C.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function Cn(){return"colors"in C.inspectOpts?Boolean(C.inspectOpts.colors):On.isatty(process.stderr.fd)}function En(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} [0m`;t[0]=o+t[0].split(` | ||
(()=>{var Rs=Object.create;var he=Object.defineProperty,Os=Object.defineProperties,Cs=Object.getOwnPropertyDescriptor,Es=Object.getOwnPropertyDescriptors,xs=Object.getOwnPropertyNames,me=Object.getOwnPropertySymbols,Ps=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var ke=(t,e,r)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S=(t,e)=>{for(var r in e||(e={}))Be.call(e,r)&&ke(t,r,e[r]);if(me)for(var r of me(e))Et.call(e,r)&&ke(t,r,e[r]);return t},v=(t,e)=>Os(t,Es(e)),gs=t=>he(t,"__esModule",{value:!0});var q=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var K=(t,e)=>{var r={};for(var s in t)Be.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&me)for(var s of me(t))e.indexOf(s)<0&&Et.call(t,s)&&(r[s]=t[s]);return r};var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ws=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of xs(e))!Be.call(t,s)&&s!=="default"&&he(t,s,{get:()=>e[s],enumerable:!(r=Cs(e,s))||r.enumerable});return t},xt=t=>ws(gs(he(t!=null?Rs(Ps(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Ke=(t,e,r)=>(ke(t,typeof e!="symbol"?e+"":e,r),r);var He=y((Mi,Ht)=>{"use strict";Ht.exports=function(e,r){return function(){for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];return e.apply(r,n)}}});var g=y((Di,$t)=>{"use strict";var Ns=He(),$=Object.prototype.toString;function We(t){return $.call(t)==="[object Array]"}function ze(t){return typeof t=="undefined"}function Fs(t){return t!==null&&!ze(t)&&t.constructor!==null&&!ze(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ls(t){return $.call(t)==="[object ArrayBuffer]"}function Ms(t){return typeof FormData!="undefined"&&t instanceof FormData}function Ds(t){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function Is(t){return typeof t=="string"}function Us(t){return typeof t=="number"}function Wt(t){return t!==null&&typeof t=="object"}function be(t){if($.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Bs(t){return $.call(t)==="[object Date]"}function ks(t){return $.call(t)==="[object File]"}function Ks(t){return $.call(t)==="[object Blob]"}function zt(t){return $.call(t)==="[object Function]"}function js(t){return Wt(t)&&zt(t.pipe)}function Hs(t){return typeof URLSearchParams!="undefined"&&t instanceof URLSearchParams}function Ws(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function zs(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function $e(t,e){if(!(t===null||typeof t=="undefined"))if(typeof t!="object"&&(t=[t]),We(t))for(var r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}function Ye(){var t={};function e(n,o){be(t[o])&&be(n)?t[o]=Ye(t[o],n):be(n)?t[o]=Ye({},n):We(n)?t[o]=n.slice():t[o]=n}for(var r=0,s=arguments.length;r<s;r++)$e(arguments[r],e);return t}function $s(t,e,r){return $e(e,function(n,o){r&&typeof n=="function"?t[o]=Ns(n,r):t[o]=n}),t}function Ys(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}$t.exports={isArray:We,isArrayBuffer:Ls,isBuffer:Fs,isFormData:Ms,isArrayBufferView:Ds,isString:Is,isNumber:Us,isObject:Wt,isPlainObject:be,isUndefined:ze,isDate:Bs,isFile:ks,isBlob:Ks,isFunction:zt,isStream:js,isURLSearchParams:Hs,isStandardBrowserEnv:zs,forEach:$e,merge:Ye,extend:$s,trim:Ws,stripBOM:Ys}});var Se=y((Ii,Qt)=>{"use strict";var V=g();function Yt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Qt.exports=function(e,r,s){if(!r)return e;var n;if(s)n=s(r);else if(V.isURLSearchParams(r))n=r.toString();else{var o=[];V.forEach(r,function(c,h){c===null||typeof c=="undefined"||(V.isArray(c)?h=h+"[]":c=[c],V.forEach(c,function(l){V.isDate(l)?l=l.toISOString():V.isObject(l)&&(l=JSON.stringify(l)),o.push(Yt(h)+"="+Yt(l))}))}),n=o.join("&")}if(n){var u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}});var Jt=y((Ui,Vt)=>{"use strict";var Qs=g();function ve(){this.handlers=[]}ve.prototype.use=function(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};ve.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};ve.prototype.forEach=function(e){Qs.forEach(this.handlers,function(s){s!==null&&e(s)})};Vt.exports=ve});var Zt=y((Bi,Xt)=>{"use strict";var Vs=g();Xt.exports=function(e,r){Vs.forEach(e,function(n,o){o!==r&&o.toUpperCase()===r.toUpperCase()&&(e[r]=n,delete e[o])})}});var _e=y((ki,Gt)=>{"use strict";Gt.exports=function(e,r,s,n,o){return e.config=r,s&&(e.code=s),e.request=n,e.response=o,e.isAxiosError=!0,e.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}},e}});var Re=y((Ki,er)=>{"use strict";var Js=_e();er.exports=function(e,r,s,n,o){var u=new Error(e);return Js(u,r,s,n,o)}});var Qe=y((ji,tr)=>{"use strict";var Xs=Re();tr.exports=function(e,r,s){var n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):r(Xs("Request failed with status code "+s.status,s.config,null,s.request,s))}});var sr=y((Hi,rr)=>{"use strict";var Oe=g();rr.exports=Oe.isStandardBrowserEnv()?function(){return{write:function(r,s,n,o,u,a){var c=[];c.push(r+"="+encodeURIComponent(s)),Oe.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),Oe.isString(o)&&c.push("path="+o),Oe.isString(u)&&c.push("domain="+u),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var ir=y((Wi,nr)=>{"use strict";nr.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}});var ar=y((zi,or)=>{"use strict";or.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}});var Ve=y(($i,ur)=>{"use strict";var Zs=ir(),Gs=ar();ur.exports=function(e,r){return e&&!Zs(r)?Gs(e,r):r}});var lr=y((Yi,pr)=>{"use strict";var Je=g(),en=["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"];pr.exports=function(e){var r={},s,n,o;return e&&Je.forEach(e.split(` | ||
`),function(a){if(o=a.indexOf(":"),s=Je.trim(a.substr(0,o)).toLowerCase(),n=Je.trim(a.substr(o+1)),s){if(r[s]&&en.indexOf(s)>=0)return;s==="set-cookie"?r[s]=(r[s]?r[s]:[]).concat([n]):r[s]=r[s]?r[s]+", "+n:n}}),r}});var dr=y((Qi,fr)=>{"use strict";var cr=g();fr.exports=cr.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function n(o){var u=o;return e&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=n(window.location.href),function(u){var a=cr.isString(u)?n(u):u;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}()});var J=y((Vi,hr)=>{"use strict";function Xe(t){this.message=t}Xe.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Xe.prototype.__CANCEL__=!0;hr.exports=Xe});var yr=y((Ji,mr)=>{"use strict";var Ce=g(),tn=Qe(),rn=sr(),sn=Se(),nn=Ve(),on=lr(),an=dr(),Ze=Re(),un=X(),pn=J();mr.exports=function(e){return new Promise(function(s,n){var o=e.data,u=e.headers,a=e.responseType,c;function h(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}Ce.isFormData(o)&&delete u["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";u.Authorization="Basic "+btoa(l+":"+f)}var b=nn(e.baseURL,e.url);i.open(e.method.toUpperCase(),sn(b,e.params,e.paramsSerializer),!0),i.timeout=e.timeout;function U(){if(!!i){var m="getAllResponseHeaders"in i?on(i.getAllResponseHeaders()):null,_=!a||a==="text"||a==="json"?i.responseText:i.response,x={data:_,status:i.status,statusText:i.statusText,headers:m,config:e,request:i};tn(function(d){s(d),h()},function(d){n(d),h()},x),i=null}}if("onloadend"in i?i.onloadend=U:i.onreadystatechange=function(){!i||i.readyState!==4||i.status===0&&!(i.responseURL&&i.responseURL.indexOf("file:")===0)||setTimeout(U)},i.onabort=function(){!i||(n(Ze("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(Ze("Network Error",e,null,i)),i=null},i.ontimeout=function(){var _="timeout of "+e.timeout+"ms exceeded",x=e.transitional||un.transitional;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),n(Ze(_,e,x.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",i)),i=null},Ce.isStandardBrowserEnv()){var O=(e.withCredentials||an(b))&&e.xsrfCookieName?rn.read(e.xsrfCookieName):void 0;O&&(u[e.xsrfHeaderName]=O)}"setRequestHeader"in i&&Ce.forEach(u,function(_,x){typeof o=="undefined"&&x.toLowerCase()==="content-type"?delete u[x]:i.setRequestHeader(x,_)}),Ce.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),a&&a!=="json"&&(i.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&i.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(c=function(m){!i||(n(!m||m&&m.type?new pn("canceled"):m),i.abort(),i=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c))),o||(o=null),i.send(o)})}});var br=y((Xi,Ar)=>{var Z=1e3,G=Z*60,ee=G*60,Y=ee*24,ln=Y*7,cn=Y*365.25;Ar.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return fn(t);if(r==="number"&&isFinite(t))return e.long?hn(t):dn(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function fn(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return r*cn;case"weeks":case"week":case"w":return r*ln;case"days":case"day":case"d":return r*Y;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ee;case"minutes":case"minute":case"mins":case"min":case"m":return r*G;case"seconds":case"second":case"secs":case"sec":case"s":return r*Z;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function dn(t){var e=Math.abs(t);return e>=Y?Math.round(t/Y)+"d":e>=ee?Math.round(t/ee)+"h":e>=G?Math.round(t/G)+"m":e>=Z?Math.round(t/Z)+"s":t+"ms"}function hn(t){var e=Math.abs(t);return e>=Y?Ee(t,e,Y,"day"):e>=ee?Ee(t,e,ee,"hour"):e>=G?Ee(t,e,G,"minute"):e>=Z?Ee(t,e,Z,"second"):t+" ms"}function Ee(t,e,r,s){var n=e>=r*1.5;return Math.round(t/r)+" "+s+(n?"s":"")}});var Ge=y((Zi,Sr)=>{function mn(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=n,r.enabled=u,r.humanize=br(),r.destroy=h,Object.keys(t).forEach(i=>{r[i]=t[i]}),r.names=[],r.skips=[],r.formatters={};function e(i){let l=0;for(let f=0;f<i.length;f++)l=(l<<5)-l+i.charCodeAt(f),l|=0;return r.colors[Math.abs(l)%r.colors.length]}r.selectColor=e;function r(i){let l,f=null,b,U;function O(...m){if(!O.enabled)return;let _=O,x=Number(new Date),ne=x-(l||x);_.diff=ne,_.prev=l,_.curr=x,l=x,m[0]=r.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let d=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(ie,M)=>{if(ie==="%%")return"%";d++;let I=r.formatters[M];if(typeof I=="function"){let ce=m[d];ie=I.call(_,ce),m.splice(d,1),d--}return ie}),r.formatArgs.call(_,m),(_.log||r.log).apply(_,m)}return O.namespace=i,O.useColors=r.useColors(),O.color=r.selectColor(i),O.extend=s,O.destroy=r.destroy,Object.defineProperty(O,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(b!==r.namespaces&&(b=r.namespaces,U=r.enabled(i)),U),set:m=>{f=m}}),typeof r.init=="function"&&r.init(O),O}function s(i,l){let f=r(this.namespace+(typeof l=="undefined"?":":l)+i);return f.log=this.log,f}function n(i){r.save(i),r.namespaces=i,r.names=[],r.skips=[];let l,f=(typeof i=="string"?i:"").split(/[\s,]+/),b=f.length;for(l=0;l<b;l++)!f[l]||(i=f[l].replace(/\*/g,".*?"),i[0]==="-"?r.skips.push(new RegExp("^"+i.substr(1)+"$")):r.names.push(new RegExp("^"+i+"$")))}function o(){let i=[...r.names.map(a),...r.skips.map(a).map(l=>"-"+l)].join(",");return r.enable(""),i}function u(i){if(i[i.length-1]==="*")return!0;let l,f;for(l=0,f=r.skips.length;l<f;l++)if(r.skips[l].test(i))return!1;for(l=0,f=r.names.length;l<f;l++)if(r.names[l].test(i))return!0;return!1}function a(i){return i.toString().substring(2,i.toString().length-2).replace(/\.\*\?$/,"*")}function c(i){return i instanceof Error?i.stack||i.message:i}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Sr.exports=mn});var vr=y((N,xe)=>{N.formatArgs=An;N.save=bn;N.load=Sn;N.useColors=yn;N.storage=vn();N.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();N.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function yn(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function An(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+xe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(s=r))}),t.splice(s,0,e)}N.log=console.debug||console.log||(()=>{});function bn(t){try{t?N.storage.setItem("debug",t):N.storage.removeItem("debug")}catch(e){}}function Sn(){let t;try{t=N.storage.getItem("debug")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function vn(){try{return localStorage}catch(t){}}xe.exports=Ge()(N);var{formatters:_n}=xe.exports;_n.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Rr=y((Gi,_r)=>{"use strict";_r.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",s=e.indexOf(r+t),n=e.indexOf("--");return s!==-1&&(n===-1||s<n)}});var Er=y((eo,Cr)=>{"use strict";var Rn=q("os"),Or=q("tty"),D=Rr(),{env:R}=process,j;D("no-color")||D("no-colors")||D("color=false")||D("color=never")?j=0:(D("color")||D("colors")||D("color=true")||D("color=always"))&&(j=1);"FORCE_COLOR"in R&&(R.FORCE_COLOR==="true"?j=1:R.FORCE_COLOR==="false"?j=0:j=R.FORCE_COLOR.length===0?1:Math.min(parseInt(R.FORCE_COLOR,10),3));function et(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function tt(t,e){if(j===0)return 0;if(D("color=16m")||D("color=full")||D("color=truecolor"))return 3;if(D("color=256"))return 2;if(t&&!e&&j===void 0)return 0;let r=j||0;if(R.TERM==="dumb")return r;if(process.platform==="win32"){let s=Rn.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in R)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(s=>s in R)||R.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in R)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(R.TEAMCITY_VERSION)?1:0;if(R.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in R){let s=parseInt((R.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(R.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(R.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(R.TERM)||"COLORTERM"in R?1:r}function On(t){let e=tt(t,t&&t.isTTY);return et(e)}Cr.exports={supportsColor:On,stdout:et(tt(!0,Or.isatty(1))),stderr:et(tt(!0,Or.isatty(2)))}});var Pr=y((C,ge)=>{var Cn=q("tty"),Pe=q("util");C.init=qn;C.log=gn;C.formatArgs=xn;C.save=wn;C.load=Tn;C.useColors=En;C.destroy=Pe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");C.colors=[6,2,3,4,5,1];try{let t=Er();t&&(t.stderr||t).level>=2&&(C.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}C.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function En(){return"colors"in C.inspectOpts?Boolean(C.inspectOpts.colors):Cn.isatty(process.stderr.fd)}function xn(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,n="[3"+(s<8?s:"8;5;"+s),o=` ${n};1m${e} [0m`;t[0]=o+t[0].split(` | ||
`).join(` | ||
`+o),t.push(i+"m+"+Pe.exports.humanize(this.diff)+"[0m")}else t[0]=xn()+e+" "+t[0]}function xn(){return C.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Pn(...t){return process.stderr.write(xe.format(...t)+` | ||
`)}function gn(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function wn(){return process.env.DEBUG}function Tn(t){t.inspectOpts={};let e=Object.keys(C.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=C.inspectOpts[e[r]]}Pe.exports=Xe()(C);var{formatters:Er}=Pe.exports;Er.o=function(t){return this.inspectOpts.colors=this.useColors,xe.inspect(t,this.inspectOpts).split(` | ||
`).map(e=>e.trim()).join(" ")};Er.O=function(t){return this.inspectOpts.colors=this.useColors,xe.inspect(t,this.inspectOpts)}});var Pr=y((eo,et)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?et.exports=vr():et.exports=xr()});var wr=y((to,gr)=>{var ue;gr.exports=function(){if(!ue){try{ue=Pr()("follow-redirects")}catch(t){}typeof ue!="function"&&(ue=function(){})}ue.apply(null,arguments)}});var it=y((ro,nt)=>{var te=q("url"),tt=te.URL,qn=q("http"),Nn=q("https"),Tr=q("stream").Writable,Fn=q("assert"),qr=wr(),Q=["abort","aborted","connect","error","socket","timeout"],rt=Object.create(null);Q.forEach(function(t){rt[t]=function(e,r,s){this._redirectable.emit(t,e,r,s)}});var Ln=ge("ERR_FR_REDIRECTION_FAILURE",""),Mn=ge("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),In=ge("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Dn=ge("ERR_STREAM_WRITE_AFTER_END","write after end");function F(t,e){Tr.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var r=this;this._onNativeResponse=function(s){r._processResponse(s)},this._performRequest()}F.prototype=Object.create(Tr.prototype);F.prototype.abort=function(){Lr(this._currentRequest),this.emit("abort")};F.prototype.write=function(t,e,r){if(this._ending)throw new Dn;if(!(typeof t=="string"||typeof t=="object"&&"length"in t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(typeof e=="function"&&(r=e,e=null),t.length===0){r&&r();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,r)):(this.emit("error",new In),this.abort())};F.prototype.end=function(t,e,r){if(typeof t=="function"?(r=t,t=e=null):typeof e=="function"&&(r=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var s=this,i=this._currentRequest;this.write(t,e,function(){s._ended=!0,i.end(null,null,r)}),this._ending=!0}};F.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)};F.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)};F.prototype.setTimeout=function(t,e){var r=this;function s(u){u.setTimeout(t),u.removeListener("timeout",u.destroy),u.addListener("timeout",u.destroy)}function i(u){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},t),s(u)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),e&&r.removeListener("timeout",e),r.socket||r._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",s),this.once("response",o),this.once("error",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){F.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(F.prototype,t,{get:function(){return this._currentRequest[t]}})});F.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}};F.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e){this.emit("error",new TypeError("Unsupported protocol "+t));return}if(this._options.agents){var r=t.substr(0,t.length-1);this._options.agent=this._options.agents[r]}var s=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=te.format(this._options),s._redirectable=this;for(var i=0;i<Q.length;i++)s.on(Q[i],rt[Q[i]]);if(this._isRedirect){var o=0,u=this,a=this._requestBodyBuffers;(function c(d){if(s===u._currentRequest)if(d)u.emit("error",d);else if(o<a.length){var n=a[o++];s.finished||s.write(n.data,n.encoding,c)}else u._ended&&s.end()})()}};F.prototype._processResponse=function(t){var e=t.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e});var r=t.headers.location;if(r&&this._options.followRedirects!==!1&&e>=300&&e<400){if(Lr(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new Mn);return}((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],st(/^content-/i,this._options.headers));var s=st(/^host$/i,this._options.headers)||te.parse(this._currentUrl).hostname,i=te.resolve(this._currentUrl,r);qr("redirecting to",i),this._isRedirect=!0;var o=te.parse(i);if(Object.assign(this._options,o),o.hostname!==s&&st(/^authorization$/i,this._options.headers),typeof this._options.beforeRedirect=="function"){var u={headers:t.headers};try{this._options.beforeRedirect.call(null,this._options,u)}catch(c){this.emit("error",c);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(c){var a=new Ln("Redirected request failed: "+c.message);a.cause=c,this.emit("error",a)}}else t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[]};function Nr(t){var e={maxRedirects:21,maxBodyLength:10*1024*1024},r={};return Object.keys(t).forEach(function(s){var i=s+":",o=r[i]=t[s],u=e[s]=Object.create(o);function a(d,n,l){if(typeof d=="string"){var f=d;try{d=Fr(new tt(f))}catch(v){d=te.parse(f)}}else tt&&d instanceof tt?d=Fr(d):(l=n,n=d,d={protocol:i});return typeof n=="function"&&(l=n,n=null),n=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},d,n),n.nativeProtocols=r,Fn.equal(n.protocol,i,"protocol mismatch"),qr("options",n),new F(n,l)}function c(d,n,l){var f=u.request(d,n,l);return f.end(),f}Object.defineProperties(u,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function Bn(){}function Fr(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};return t.port!==""&&(e.port=Number(t.port)),e}function st(t,e){var r;for(var s in e)t.test(s)&&(r=e[s],delete e[s]);return r}function ge(t,e){function r(s){Error.captureStackTrace(this,this.constructor),this.message=s||e}return r.prototype=new Error,r.prototype.constructor=r,r.prototype.name="Error ["+t+"]",r.prototype.code=t,r}function Lr(t){for(var e=0;e<Q.length;e++)t.removeListener(Q[e],rt[Q[e]]);t.on("error",Bn),t.abort()}nt.exports=Nr({http:qn,https:Nn});nt.exports.wrap=Nr});var we=y((so,Mr)=>{Mr.exports={version:"0.22.0"}});var Kr=y((no,kr)=>{"use strict";var pe=g(),Ir=$e(),Un=Ye(),kn=be(),Kn=q("http"),jn=q("https"),Hn=it().http,Wn=it().https,Dr=q("url"),zn=q("zlib"),$n=we().version,Te=Se(),ot=_e(),Yn=X(),Qn=J(),Br=/https:?/;function Ur(t,e,r){if(t.hostname=e.host,t.host=e.host,t.port=e.port,t.path=r,e.auth){var s=Buffer.from(e.auth.username+":"+e.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+s}t.beforeRedirect=function(o){o.headers.host=o.host,Ur(o,e,o.href)}}kr.exports=function(e){return new Promise(function(s,i){var o;function u(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}var a=function(A){u(),s(A)},c=function(A){u(),i(A)},d=e.data,n=e.headers,l={};if(Object.keys(n).forEach(function(A){l[A.toLowerCase()]=A}),"user-agent"in l?n[l["user-agent"]]||delete n[l["user-agent"]]:n["User-Agent"]="axios/"+$n,d&&!pe.isStream(d)){if(!Buffer.isBuffer(d))if(pe.isArrayBuffer(d))d=Buffer.from(new Uint8Array(d));else if(pe.isString(d))d=Buffer.from(d,"utf-8");else return c(Te("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));l["content-length"]||(n["Content-Length"]=d.length)}var f=void 0;if(e.auth){var v=e.auth.username||"",M=e.auth.password||"";f=v+":"+M}var O=Un(e.baseURL,e.url),m=Dr.parse(O),S=m.protocol||"http:";if(!f&&m.auth){var x=m.auth.split(":"),ne=x[0]||"",h=x[1]||"";f=ne+":"+h}f&&l.authorization&&delete n[l.authorization];var Me=Br.test(S),ie=Me?e.httpsAgent:e.httpAgent,I={path:kn(m.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:n,agent:ie,agents:{http:e.httpAgent,https:e.httpsAgent},auth:f};e.socketPath?I.socketPath=e.socketPath:(I.hostname=m.hostname,I.port=m.port);var B=e.proxy;if(!B&&B!==!1){var ce=S.slice(0,-1)+"_proxy",mt=process.env[ce]||process.env[ce.toUpperCase()];if(mt){var oe=Dr.parse(mt),yt=process.env.no_proxy||process.env.NO_PROXY,At=!0;if(yt){var _s=yt.split(",").map(function(A){return A.trim()});At=!_s.some(function(A){return A?A==="*"||A[0]==="."&&m.hostname.substr(m.hostname.length-A.length)===A?!0:m.hostname===A:!1})}if(At&&(B={host:oe.hostname,port:oe.port,protocol:oe.protocol},oe.auth)){var bt=oe.auth.split(":");B.auth={username:bt[0],password:bt[1]}}}}B&&(I.headers.host=m.hostname+(m.port?":"+m.port:""),Ur(I,B,S+"//"+m.hostname+(m.port?":"+m.port:"")+I.path));var fe,vt=Me&&(B?Br.test(B.protocol):!0);e.transport?fe=e.transport:e.maxRedirects===0?fe=vt?jn:Kn:(e.maxRedirects&&(I.maxRedirects=e.maxRedirects),fe=vt?Wn:Hn),e.maxBodyLength>-1&&(I.maxBodyLength=e.maxBodyLength),e.insecureHTTPParser&&(I.insecureHTTPParser=e.insecureHTTPParser);var P=fe.request(I,function(A){if(!P.aborted){var H=A,p=A.req||P;if(A.statusCode!==204&&p.method!=="HEAD"&&e.decompress!==!1)switch(A.headers["content-encoding"]){case"gzip":case"compress":case"deflate":H=H.pipe(zn.createUnzip()),delete A.headers["content-encoding"];break}var de={status:A.statusCode,statusText:A.statusMessage,headers:A.headers,config:e,request:p};if(e.responseType==="stream")de.data=H,Ir(a,c,de);else{var _t=[],St=0;H.on("data",function(U){_t.push(U),St+=U.length,e.maxContentLength>-1&&St>e.maxContentLength&&(H.destroy(),c(Te("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,p)))}),H.on("error",function(U){P.aborted||c(ot(U,e,null,p))}),H.on("end",function(){var U=Buffer.concat(_t);e.responseType!=="arraybuffer"&&(U=U.toString(e.responseEncoding),(!e.responseEncoding||e.responseEncoding==="utf8")&&(U=pe.stripBOM(U))),de.data=U,Ir(a,c,de)})}}});if(P.on("error",function(A){P.aborted&&A.code!=="ERR_FR_TOO_MANY_REDIRECTS"||c(ot(A,e,null,P))}),e.timeout){var Ie=parseInt(e.timeout,10);if(isNaN(Ie)){c(Te("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",P));return}P.setTimeout(Ie,function(){P.abort();var A=e.transitional||Yn.transitional;c(Te("timeout of "+Ie+"ms exceeded",e,A.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",P))})}(e.cancelToken||e.signal)&&(o=function(T){P.aborted||(P.abort(),c(!T||T&&T.type?new Qn("canceled"):T))},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o))),pe.isStream(d)?d.on("error",function(A){c(ot(A,e,null,P))}).pipe(P):P.end(d)})}});var X=y((io,Wr)=>{"use strict";var E=g(),jr=Xt(),Vn=_e(),Jn={"Content-Type":"application/x-www-form-urlencoded"};function Hr(t,e){!E.isUndefined(t)&&E.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Xn(){var t;return typeof XMLHttpRequest!="undefined"?t=mr():typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&(t=Kr()),t}function Zn(t,e,r){if(E.isString(t))try{return(e||JSON.parse)(t),E.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var qe={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Xn(),transformRequest:[function(e,r){return jr(r,"Accept"),jr(r,"Content-Type"),E.isFormData(e)||E.isArrayBuffer(e)||E.isBuffer(e)||E.isStream(e)||E.isFile(e)||E.isBlob(e)?e:E.isArrayBufferView(e)?e.buffer:E.isURLSearchParams(e)?(Hr(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):E.isObject(e)||r&&r["Content-Type"]==="application/json"?(Hr(r,"application/json"),Zn(e)):e}],transformResponse:[function(e){var r=this.transitional||qe.transitional,s=r&&r.silentJSONParsing,i=r&&r.forcedJSONParsing,o=!s&&this.responseType==="json";if(o||i&&E.isString(e)&&e.length)try{return JSON.parse(e)}catch(u){if(o)throw u.name==="SyntaxError"?Vn(u,this,"E_JSON_PARSE"):u}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};E.forEach(["delete","get","head"],function(e){qe.headers[e]={}});E.forEach(["post","put","patch"],function(e){qe.headers[e]=E.merge(Jn)});Wr.exports=qe});var $r=y((oo,zr)=>{"use strict";var Gn=g(),ei=X();zr.exports=function(e,r,s){var i=this||ei;return Gn.forEach(s,function(u){e=u.call(i,e,r)}),e}});var at=y((ao,Yr)=>{"use strict";Yr.exports=function(e){return!!(e&&e.__CANCEL__)}});var Jr=y((uo,Vr)=>{"use strict";var Qr=g(),ut=$r(),ti=at(),ri=X(),si=J();function pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new si("canceled")}Vr.exports=function(e){pt(e),e.headers=e.headers||{},e.data=ut.call(e,e.data,e.headers,e.transformRequest),e.headers=Qr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Qr.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var r=e.adapter||ri.adapter;return r(e).then(function(i){return pt(e),i.data=ut.call(e,i.data,i.headers,e.transformResponse),i},function(i){return ti(i)||(pt(e),i&&i.response&&(i.response.data=ut.call(e,i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})}});var lt=y((po,Xr)=>{"use strict";var L=g();Xr.exports=function(e,r){r=r||{};var s={};function i(n,l){return L.isPlainObject(n)&&L.isPlainObject(l)?L.merge(n,l):L.isPlainObject(l)?L.merge({},l):L.isArray(l)?l.slice():l}function o(n){if(L.isUndefined(r[n])){if(!L.isUndefined(e[n]))return i(void 0,e[n])}else return i(e[n],r[n])}function u(n){if(!L.isUndefined(r[n]))return i(void 0,r[n])}function a(n){if(L.isUndefined(r[n])){if(!L.isUndefined(e[n]))return i(void 0,e[n])}else return i(void 0,r[n])}function c(n){if(n in r)return i(e[n],r[n]);if(n in e)return i(void 0,e[n])}var d={url:u,method:u,data:u,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return L.forEach(Object.keys(e).concat(Object.keys(r)),function(l){var f=d[l]||o,v=f(l);L.isUndefined(v)&&f!==c||(s[l]=v)}),s}});var es=y((lo,Gr)=>{"use strict";var ni=we().version,ct={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){ct[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});var Zr={};ct.transitional=function(e,r,s){function i(o,u){return"[Axios v"+ni+"] Transitional option '"+o+"'"+u+(s?". "+s:"")}return function(o,u,a){if(e===!1)throw new Error(i(u," has been removed"+(r?" in "+r:"")));return r&&!Zr[u]&&(Zr[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,u,a):!0}};function ii(t,e,r){if(typeof t!="object")throw new TypeError("options must be an object");for(var s=Object.keys(t),i=s.length;i-- >0;){var o=s[i],u=e[o];if(u){var a=t[o],c=a===void 0||u(a,o,t);if(c!==!0)throw new TypeError("option "+o+" must be "+c);continue}if(r!==!0)throw Error("Unknown option "+o)}}Gr.exports={assertOptions:ii,validators:ct}});var os=y((co,is)=>{"use strict";var ts=g(),oi=be(),rs=Vt(),ss=Jr(),Ne=lt(),ns=es(),re=ns.validators;function le(t){this.defaults=t,this.interceptors={request:new rs,response:new rs}}le.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=Ne(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;r!==void 0&&ns.assertOptions(r,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1);var s=[],i=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(i=i&&f.synchronous,s.unshift(f.fulfilled,f.rejected))});var o=[];this.interceptors.response.forEach(function(f){o.push(f.fulfilled,f.rejected)});var u;if(!i){var a=[ss,void 0];for(Array.prototype.unshift.apply(a,s),a=a.concat(o),u=Promise.resolve(e);a.length;)u=u.then(a.shift(),a.shift());return u}for(var c=e;s.length;){var d=s.shift(),n=s.shift();try{c=d(c)}catch(l){n(l);break}}try{u=ss(c)}catch(l){return Promise.reject(l)}for(;o.length;)u=u.then(o.shift(),o.shift());return u};le.prototype.getUri=function(e){return e=Ne(this.defaults,e),oi(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};ts.forEach(["delete","get","head","options"],function(e){le.prototype[e]=function(r,s){return this.request(Ne(s||{},{method:e,url:r,data:(s||{}).data}))}});ts.forEach(["post","put","patch"],function(e){le.prototype[e]=function(r,s,i){return this.request(Ne(i||{},{method:e,url:r,data:s}))}});is.exports=le});var us=y((fo,as)=>{"use strict";var ai=J();function se(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(i){e=i});var r=this;this.promise.then(function(s){if(!!r._listeners){var i,o=r._listeners.length;for(i=0;i<o;i++)r._listeners[i](s);r._listeners=null}}),this.promise.then=function(s){var i,o=new Promise(function(u){r.subscribe(u),i=u}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i){r.reason||(r.reason=new ai(i),e(r.reason))})}se.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};se.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};se.prototype.unsubscribe=function(e){if(!!this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}};se.source=function(){var e,r=new se(function(i){e=i});return{token:r,cancel:e}};as.exports=se});var ls=y((ho,ps)=>{"use strict";ps.exports=function(e){return function(s){return e.apply(null,s)}}});var fs=y((mo,cs)=>{"use strict";cs.exports=function(e){return typeof e=="object"&&e.isAxiosError===!0}});var ms=y((yo,ft)=>{"use strict";var ds=g(),ui=Ke(),Fe=os(),pi=lt(),li=X();function hs(t){var e=new Fe(t),r=ui(Fe.prototype.request,e);return ds.extend(r,Fe.prototype,e),ds.extend(r,e),r.create=function(i){return hs(pi(t,i))},r}var k=hs(li);k.Axios=Fe;k.Cancel=J();k.CancelToken=us();k.isCancel=at();k.VERSION=we().version;k.all=function(e){return Promise.all(e)};k.spread=ls();k.isAxiosError=fs();ft.exports=k;ft.exports.default=k});var dt=y((Ao,ys)=>{ys.exports=ms()});var W;(function(s){s.NO_API_KEY="No API has been provided. An API key is required to get `pubg.ts`",s.INVALID_API_KEY="An invalid API key has been provided. Please check the key is valid",s.INVALID_SHARD="The shard argument provided is invalid. Please validate you have passed the correct shard value"})(W||(W={}));var ke;(function(e){e.NOT_FOUND="not-found"})(ke||(ke={}));var fi={[ke.NOT_FOUND]:{detail:"No player(s) found matching the criteria",title:"Not found"}};var Et;(function(o){o.ALIVE="alive",o.BYPLAYER="byplayer",o.BYZONE="byzone",o.LOGOUT="logout",o.SUICIDE="suicide"})(Et||(Et={}));var xt;(function(a){a.BALTIC_MAIN="Baltic_Main",a.DESERT_MAIN="Desert_Main",a.DIHOROTOK_MAIN="DihorOtok_Main",a.ERANGEL_MAIN="Erangel_Main",a.RANGE_MAIN="Range_Main",a.SAVAGE_MAIN="Savage_Main",a.SUMMERLAND_MAIN="Summerland_Main"})(xt||(xt={}));var Pt;(function(a){a.AIROYALE="airoyale",a.ARCADE="arcade",a.CUSTOM="custom",a.EVENT="event",a.OFFICIAL="official",a.SEASONAL="seasonal",a.TRAINING="training"})(Pt||(Pt={}));var gt;(function(p){p.CONQUEST_DUO="conquest_duo",p.CONQUEST_DUO_FPP="conquest_duo_fpp",p.CONQUEST_SOLO="conquest_solo",p.CONQUEST_SOLO_FPP="conquest_solo_fpp",p.CONQUEST_SQUAD="conquest_squad",p.CONQUEST_SQUAD_FPP="conquest_squad_fpp",p.DUO="duo",p.DUO_FPP="duo_fpp",p.ESPORTS_DUO="esports_duo",p.ESPORTS_DUO_FPP="esports_duo_fpp",p.ESPORTS_SOLO="esports_solo",p.ESPORTS_SOLO_FPP="esports_solo_fpp",p.ESPORTS_SQUAD="esports_squad",p.ESPORTS_SQUAD_FPP="esports_squad_fpp",p.LAB_FPP="lab_fpp",p.LAB_TPP="lab_tpp",p.NORMAL_DUO="normal_duo",p.NORMAL_DUO_FPP="normal_duo_fpp",p.NORMAL_SOLO="normal_solo",p.NORMAL_SOLO_FPP="normal_solo_fpp",p.NORMAL_SQUAD="normal_squad",p.NORMAL_SQUAD_FPP="normal_squad_fpp",p.SOLO="solo",p.SOLO_FPP="solo_fpp",p.SQUAD="squad",p.SQUAD_FPP="squad_fpp",p.TDM="tdm",p.WAR_DUO="war_duo",p.WAR_DUO_FPP="war_duo_fpp",p.WAR_SOLO="war_solo",p.WAR_SOLO_FPP="war_solo_fpp",p.WAR_SQUAD="war_squad",p.WAR_SQUAD_FPP="war_squad_fpp",p.ZOMBIE_DUO="zombie_duo",p.ZOMBIE_DUO_FPP="zombie_duo_fpp",p.ZOMBIE_SOLO="zombie_solo",p.ZOMBIE_SOLO_FPP="zombie_solo_fpp",p.ZOMBIE_SQUAD="zombie_squad",p.ZOMBIE_SQUAD_FPP="zombie_squad_fpp"})(gt||(gt={}));var z;(function(a){a.CONSOLE="console",a.KAKAO="kakao",a.PSN="psn",a.STADIA="stadia",a.STEAM="steam",a.TOURNAMENT="tournament",a.XBOX="xbox"})(z||(z={}));var wt;(function(h){h.PC_AS="pc-as",h.PC_EU="pc-eu",h.PC_JP="pc-jp",h.PC_KAKAO="pc-kakao",h.PC_KRJP="pc-krjp",h.PC_NA="pc-na",h.PC_OC="pc-oc",h.PC_RU="pc-ru",h.PC_SA="pc-sa",h.PC_SEA="pc-sea",h.PC_TOURNAMENT="pc-tournament",h.PSN_AS="psn-as",h.PSN_EU="psn-eu",h.PSN_NA="psn-na",h.PSN_OC="psn-oc",h.XBOX_AS="xbox-as",h.XBOX_EU="xbox-eu",h.XBOX_NA="xbox-na",h.XBOX_OC="xbox-oc",h.XBOX_SA="xbox-sa"})(wt||(wt={}));var ae;(function(n){n.ASSET="asset",n.MATCH="match",n.PARTICIPANT="participant",n.PLAYER="player",n.PLAYER_SEASON="playerSeason",n.RANKED_PLAYER_SEASON="rankedplayerstats",n.ROSTER="roster",n.SEASON="season",n.STATUS="status",n.TOURNAMENT="tournament"})(ae||(ae={}));var Tt;(function(s){s.CLOSED="closed",s.PREPARE="prepare",s.PROGRESS="progress"})(Tt||(Tt={}));var qt;(function(u){u.DUO="duo",u.DUO_FPP="duo-fpp",u.SOLO="solo",u.SOLO_FPP="solo-fpp",u.SQUAD="squad",u.SQUAD_FPP="squad-fpp"})(qt||(qt={}));var ws=class{constructor({apiKey:e,shard:r=z.STEAM}){Ue(this,"_apiKey");Ue(this,"_shard");if(this._apiKey=e,this._shard=r,!this._apiKey)throw new Error(W.NO_API_KEY);if(this._apiKey.length<=0)throw new Error(W.INVALID_API_KEY)}async getMatch({id:e}){return await Nt({apiKey:this._apiKey,id:e,shard:this._shard})}async getPlayer({id:e,skipFailed:r,value:s}){return await Ft({apiKey:this._apiKey,id:e,shard:this._shard,skipFailed:r,value:s})}async getPlayerSeason(e){return await Lt(b({apiKey:this._apiKey,shard:this._shard},e))}async getSamples({createdAt:e}={}){return await Mt({apiKey:this._apiKey,createdAt:e,shard:this._shard})}async getSeason({id:e}={}){return await It({apiKey:this._apiKey,id:e,shard:this._shard})}async getSeasons(){return await ye({apiKey:this._apiKey,shard:this._shard})}async getStatus(){return await Dt({apiKey:this._apiKey})}async getTelemetry({url:e}){return await Bt({apiKey:this._apiKey,url:e})}async getTournament({id:e}={}){return e?await Ut({apiKey:this._apiKey,id:e}):await kt({apiKey:this._apiKey})}};var Ts=10;function Kt(t,e=Ts){let r=[];for(;t.length;)r.push(t.splice(0,e));return r}var As=Ct(dt());var Le={accept:"application/vnd.api+json"},ht="https://api.pubg.com";async function w({apiKey:t,endpoint:e,headers:r={},params:s={},root:i=!1,shard:o=z.STEAM}){if(!Object.values(z).includes(o))throw new Error(W.INVALID_SHARD);let u=i?`${ht}/${e}`:`${ht}/shards/${o}/${e}`;try{return{data:(await(0,As.default)(u,{headers:b(_(b({},Le),{Authorization:`Bearer ${t}`}),r),params:s,responseType:"json"})).data,error:null}}catch({response:a}){let{data:c,status:d}=a,n=c.errors[0];return console.error(`${n.title}: ${n.detail}`),{data:null,error:n,status:d}}}async function bs(t){let e=await Promise.all(t.map(r=>w(r)));return e.forEach(r=>{if(r.error)return r}),e}async function Nt(r){var s=r,{id:t}=s,e=K(s,["id"]);let i=await w(_(b({},e),{endpoint:`matches/${t}`}));if(i.error)return i;let{data:o,included:u}=i.data;return{data:_(b({},o.attributes),{assets:o.relationships.assets.data,id:o.id,members:u,type:o.type}),error:null}}async function Ft(i){var o=i,{id:t=!1,skipFailed:e=!1,value:r}=o,s=K(o,["id","skipFailed","value"]);let u=Array.isArray(r),a=!u&&t?`players/${r}`:"players",c=u?Kt([...r]).map(f=>_(b({},s),{endpoint:a,params:{[`filter[${t?"playerIds":"playerNames"}]`]:f.join(",")}})):[_(b({},s),{endpoint:a,params:t?void 0:{"filter[playerNames]":r}})],d=await bs(c),n=d.find(f=>f.error!==null);if(n&&n.error)return n;let l=d.map(({data:f})=>f.data).flat();return!e&&u&&r.length!==l.length?{data:null,error:{title:"Failed data length validation",detail:`Input array length does not match response length. Players missing: | ||
${r.filter(f=>l.map(v=>t?v.id:v.attributes.name).indexOf(f)===-1).join(` | ||
`)}`},status:400}:{data:l.map(({attributes:f,id:v,relationships:M,type:O})=>_(b({},f),{assets:M.assets.data,id:v,matches:M.matches.data,type:O})),error:null}}async function Lt(i){var o=i,{player:t,ranked:e=!1,season:r}=o,s=K(o,["player","ranked","season"]);var l;let{playerId:u,shard:a}=typeof t=="object"?{playerId:t.id,shard:t.shardId}:{playerId:t,shard:s.shard},c=typeof r=="object"?r.id:r,d=await w(_(b({},s),{endpoint:`players/${u}/seasons/${c}${e?"/ranked":""}`,shard:a}));if(d.error)return d;let{data:n}=d.data;switch(n.type){case ae.PLAYER_SEASON:let f=Object.fromEntries(Object.entries(n.relationships).map(([v,M])=>v==="player"||v==="season"?[]:[v,M]));return{data:{bestRankPoint:(l=n.attributes.bestRankPoint)!=null?l:void 0,gamemodeStats:n.attributes.gameModeStats,matches:f,playerId:n.relationships.player.data.id,seasonId:n.relationships.season.data.id,type:n.type},error:null};case ae.RANKED_PLAYER_SEASON:return{data:{playerId:n.relationships.player.data.id,rankedGameModeStats:n.attributes.rankedGameModeStats,seasonId:n.relationships.season.data.id,type:n.type},error:null}}}async function Mt({apiKey:t,createdAt:e,shard:r}){let s=await w({apiKey:t,endpoint:"samples",params:e?{"filter[createdAt-start]":e.toISOString()}:void 0,shard:r});if(s.error)return s;let{data:i}=s.data;return{data:_(b({},i.attributes),{id:i.id,matches:i.relationships.matches.data}),error:null}}async function It(r){var s=r,{id:t}=s,e=K(s,["id"]);let i=await ye(b({},e));return i.error?i:{data:i.data.find(o=>t?t===o.id:o.isCurrentSeason),error:null}}async function ye(t){let e=await w(_(b({},t),{endpoint:"seasons"}));if(e.error)return e;let{data:r}=e.data;return{data:r.map(({attributes:s,id:i,type:o})=>({id:i,isCurrentSeason:s.isCurrentSeason,isOffseason:s.isOffseason,type:o})),error:null}}async function Dt({apiKey:t}){let e=await w({apiKey:t,endpoint:"status",root:!0});return e.error?e:{data:e.data.data,error:null}}var vs=Ct(dt());async function Bt({apiKey:t,url:e}){let r=await(0,vs.default)(e,{headers:_(b({},Le),{Authorization:`Bearer ${t}`}),responseType:"json"});return"error"in r?r:r.data}async function Ut({apiKey:t,id:e}){let r=await w({apiKey:t,endpoint:`tournaments/${e}`,root:!0});if(r.error)return r;let{data:s,included:i}=r.data;return{data:_(b({},s),{matches:i}),error:null}}async function kt({apiKey:t}){let e=await w({apiKey:t,endpoint:"tournaments",root:!0});if(e.error)return e;let{data:r}=e.data;return{data:r.map(({attributes:s,id:i,type:o})=>({createdAt:s.createdAt,id:i,type:o})),error:null}}})(); | ||
`+o),t.push(n+"m+"+ge.exports.humanize(this.diff)+"[0m")}else t[0]=Pn()+e+" "+t[0]}function Pn(){return C.inspectOpts.hideDate?"":new Date().toISOString()+" "}function gn(...t){return process.stderr.write(Pe.format(...t)+` | ||
`)}function wn(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Tn(){return process.env.DEBUG}function qn(t){t.inspectOpts={};let e=Object.keys(C.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=C.inspectOpts[e[r]]}ge.exports=Ge()(C);var{formatters:xr}=ge.exports;xr.o=function(t){return this.inspectOpts.colors=this.useColors,Pe.inspect(t,this.inspectOpts).split(` | ||
`).map(e=>e.trim()).join(" ")};xr.O=function(t){return this.inspectOpts.colors=this.useColors,Pe.inspect(t,this.inspectOpts)}});var gr=y((to,rt)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?rt.exports=vr():rt.exports=Pr()});var Tr=y((ro,wr)=>{var ue;wr.exports=function(){if(!ue){try{ue=gr()("follow-redirects")}catch(t){}typeof ue!="function"&&(ue=function(){})}ue.apply(null,arguments)}});var at=y((so,ot)=>{var te=q("url"),st=te.URL,Nn=q("http"),Fn=q("https"),qr=q("stream").Writable,Ln=q("assert"),Nr=Tr(),Q=["abort","aborted","connect","error","socket","timeout"],nt=Object.create(null);Q.forEach(function(t){nt[t]=function(e,r,s){this._redirectable.emit(t,e,r,s)}});var Mn=we("ERR_FR_REDIRECTION_FAILURE",""),Dn=we("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),In=we("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Un=we("ERR_STREAM_WRITE_AFTER_END","write after end");function F(t,e){qr.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var r=this;this._onNativeResponse=function(s){r._processResponse(s)},this._performRequest()}F.prototype=Object.create(qr.prototype);F.prototype.abort=function(){Mr(this._currentRequest),this.emit("abort")};F.prototype.write=function(t,e,r){if(this._ending)throw new Un;if(!(typeof t=="string"||typeof t=="object"&&"length"in t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(typeof e=="function"&&(r=e,e=null),t.length===0){r&&r();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,r)):(this.emit("error",new In),this.abort())};F.prototype.end=function(t,e,r){if(typeof t=="function"?(r=t,t=e=null):typeof e=="function"&&(r=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var s=this,n=this._currentRequest;this.write(t,e,function(){s._ended=!0,n.end(null,null,r)}),this._ending=!0}};F.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)};F.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)};F.prototype.setTimeout=function(t,e){var r=this;function s(u){u.setTimeout(t),u.removeListener("timeout",u.destroy),u.addListener("timeout",u.destroy)}function n(u){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},t),s(u)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),e&&r.removeListener("timeout",e),r.socket||r._currentRequest.removeListener("socket",n)}return e&&this.on("timeout",e),this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",s),this.once("response",o),this.once("error",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){F.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(F.prototype,t,{get:function(){return this._currentRequest[t]}})});F.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}};F.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e){this.emit("error",new TypeError("Unsupported protocol "+t));return}if(this._options.agents){var r=t.substr(0,t.length-1);this._options.agent=this._options.agents[r]}var s=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=te.format(this._options),s._redirectable=this;for(var n=0;n<Q.length;n++)s.on(Q[n],nt[Q[n]]);if(this._isRedirect){var o=0,u=this,a=this._requestBodyBuffers;(function c(h){if(s===u._currentRequest)if(h)u.emit("error",h);else if(o<a.length){var i=a[o++];s.finished||s.write(i.data,i.encoding,c)}else u._ended&&s.end()})()}};F.prototype._processResponse=function(t){var e=t.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e});var r=t.headers.location;if(r&&this._options.followRedirects!==!1&&e>=300&&e<400){if(Mr(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new Dn);return}((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],it(/^content-/i,this._options.headers));var s=it(/^host$/i,this._options.headers)||te.parse(this._currentUrl).hostname,n=te.resolve(this._currentUrl,r);Nr("redirecting to",n),this._isRedirect=!0;var o=te.parse(n);if(Object.assign(this._options,o),o.hostname!==s&&it(/^authorization$/i,this._options.headers),typeof this._options.beforeRedirect=="function"){var u={headers:t.headers};try{this._options.beforeRedirect.call(null,this._options,u)}catch(c){this.emit("error",c);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(c){var a=new Mn("Redirected request failed: "+c.message);a.cause=c,this.emit("error",a)}}else t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[]};function Fr(t){var e={maxRedirects:21,maxBodyLength:10*1024*1024},r={};return Object.keys(t).forEach(function(s){var n=s+":",o=r[n]=t[s],u=e[s]=Object.create(o);function a(h,i,l){if(typeof h=="string"){var f=h;try{h=Lr(new st(f))}catch(b){h=te.parse(f)}}else st&&h instanceof st?h=Lr(h):(l=i,i=h,h={protocol:n});return typeof i=="function"&&(l=i,i=null),i=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},h,i),i.nativeProtocols=r,Ln.equal(i.protocol,n,"protocol mismatch"),Nr("options",i),new F(i,l)}function c(h,i,l){var f=u.request(h,i,l);return f.end(),f}Object.defineProperties(u,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function Bn(){}function Lr(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};return t.port!==""&&(e.port=Number(t.port)),e}function it(t,e){var r;for(var s in e)t.test(s)&&(r=e[s],delete e[s]);return r}function we(t,e){function r(s){Error.captureStackTrace(this,this.constructor),this.message=s||e}return r.prototype=new Error,r.prototype.constructor=r,r.prototype.name="Error ["+t+"]",r.prototype.code=t,r}function Mr(t){for(var e=0;e<Q.length;e++)t.removeListener(Q[e],nt[Q[e]]);t.on("error",Bn),t.abort()}ot.exports=Fr({http:Nn,https:Fn});ot.exports.wrap=Fr});var Te=y((no,Dr)=>{Dr.exports={version:"0.22.0"}});var jr=y((io,Kr)=>{"use strict";var pe=g(),Ir=Qe(),kn=Ve(),Kn=Se(),jn=q("http"),Hn=q("https"),Wn=at().http,zn=at().https,Ur=q("url"),$n=q("zlib"),Yn=Te().version,qe=Re(),ut=_e(),Qn=X(),Vn=J(),Br=/https:?/;function kr(t,e,r){if(t.hostname=e.host,t.host=e.host,t.port=e.port,t.path=r,e.auth){var s=Buffer.from(e.auth.username+":"+e.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+s}t.beforeRedirect=function(o){o.headers.host=o.host,kr(o,e,o.href)}}Kr.exports=function(e){return new Promise(function(s,n){var o;function u(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}var a=function(A){u(),s(A)},c=function(A){u(),n(A)},h=e.data,i=e.headers,l={};if(Object.keys(i).forEach(function(A){l[A.toLowerCase()]=A}),"user-agent"in l?i[l["user-agent"]]||delete i[l["user-agent"]]:i["User-Agent"]="axios/"+Yn,h&&!pe.isStream(h)){if(!Buffer.isBuffer(h))if(pe.isArrayBuffer(h))h=Buffer.from(new Uint8Array(h));else if(pe.isString(h))h=Buffer.from(h,"utf-8");else return c(qe("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));l["content-length"]||(i["Content-Length"]=h.length)}var f=void 0;if(e.auth){var b=e.auth.username||"",U=e.auth.password||"";f=b+":"+U}var O=kn(e.baseURL,e.url),m=Ur.parse(O),_=m.protocol||"http:";if(!f&&m.auth){var x=m.auth.split(":"),ne=x[0]||"",d=x[1]||"";f=ne+":"+d}f&&l.authorization&&delete i[l.authorization];var Ie=Br.test(_),ie=Ie?e.httpsAgent:e.httpAgent,M={path:Kn(m.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:i,agent:ie,agents:{http:e.httpAgent,https:e.httpsAgent},auth:f};e.socketPath?M.socketPath=e.socketPath:(M.hostname=m.hostname,M.port=m.port);var I=e.proxy;if(!I&&I!==!1){var ce=_.slice(0,-1)+"_proxy",At=process.env[ce]||process.env[ce.toUpperCase()];if(At){var oe=Ur.parse(At),bt=process.env.no_proxy||process.env.NO_PROXY,St=!0;if(bt){var _s=bt.split(",").map(function(A){return A.trim()});St=!_s.some(function(A){return A?A==="*"||A[0]==="."&&m.hostname.substr(m.hostname.length-A.length)===A?!0:m.hostname===A:!1})}if(St&&(I={host:oe.hostname,port:oe.port,protocol:oe.protocol},oe.auth)){var vt=oe.auth.split(":");I.auth={username:vt[0],password:vt[1]}}}}I&&(M.headers.host=m.hostname+(m.port?":"+m.port:""),kr(M,I,_+"//"+m.hostname+(m.port?":"+m.port:"")+M.path));var fe,_t=Ie&&(I?Br.test(I.protocol):!0);e.transport?fe=e.transport:e.maxRedirects===0?fe=_t?Hn:jn:(e.maxRedirects&&(M.maxRedirects=e.maxRedirects),fe=_t?zn:Wn),e.maxBodyLength>-1&&(M.maxBodyLength=e.maxBodyLength),e.insecureHTTPParser&&(M.insecureHTTPParser=e.insecureHTTPParser);var P=fe.request(M,function(A){if(!P.aborted){var H=A,p=A.req||P;if(A.statusCode!==204&&p.method!=="HEAD"&&e.decompress!==!1)switch(A.headers["content-encoding"]){case"gzip":case"compress":case"deflate":H=H.pipe($n.createUnzip()),delete A.headers["content-encoding"];break}var de={status:A.statusCode,statusText:A.statusMessage,headers:A.headers,config:e,request:p};if(e.responseType==="stream")de.data=H,Ir(a,c,de);else{var Rt=[],Ot=0;H.on("data",function(B){Rt.push(B),Ot+=B.length,e.maxContentLength>-1&&Ot>e.maxContentLength&&(H.destroy(),c(qe("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,p)))}),H.on("error",function(B){P.aborted||c(ut(B,e,null,p))}),H.on("end",function(){var B=Buffer.concat(Rt);e.responseType!=="arraybuffer"&&(B=B.toString(e.responseEncoding),(!e.responseEncoding||e.responseEncoding==="utf8")&&(B=pe.stripBOM(B))),de.data=B,Ir(a,c,de)})}}});if(P.on("error",function(A){P.aborted&&A.code!=="ERR_FR_TOO_MANY_REDIRECTS"||c(ut(A,e,null,P))}),e.timeout){var Ue=parseInt(e.timeout,10);if(isNaN(Ue)){c(qe("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",P));return}P.setTimeout(Ue,function(){P.abort();var A=e.transitional||Qn.transitional;c(qe("timeout of "+Ue+"ms exceeded",e,A.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",P))})}(e.cancelToken||e.signal)&&(o=function(T){P.aborted||(P.abort(),c(!T||T&&T.type?new Vn("canceled"):T))},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o))),pe.isStream(h)?h.on("error",function(A){c(ut(A,e,null,P))}).pipe(P):P.end(h)})}});var X=y((oo,zr)=>{"use strict";var E=g(),Hr=Zt(),Jn=_e(),Xn={"Content-Type":"application/x-www-form-urlencoded"};function Wr(t,e){!E.isUndefined(t)&&E.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Zn(){var t;return typeof XMLHttpRequest!="undefined"?t=yr():typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&(t=jr()),t}function Gn(t,e,r){if(E.isString(t))try{return(e||JSON.parse)(t),E.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var Ne={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Zn(),transformRequest:[function(e,r){return Hr(r,"Accept"),Hr(r,"Content-Type"),E.isFormData(e)||E.isArrayBuffer(e)||E.isBuffer(e)||E.isStream(e)||E.isFile(e)||E.isBlob(e)?e:E.isArrayBufferView(e)?e.buffer:E.isURLSearchParams(e)?(Wr(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):E.isObject(e)||r&&r["Content-Type"]==="application/json"?(Wr(r,"application/json"),Gn(e)):e}],transformResponse:[function(e){var r=this.transitional||Ne.transitional,s=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,o=!s&&this.responseType==="json";if(o||n&&E.isString(e)&&e.length)try{return JSON.parse(e)}catch(u){if(o)throw u.name==="SyntaxError"?Jn(u,this,"E_JSON_PARSE"):u}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};E.forEach(["delete","get","head"],function(e){Ne.headers[e]={}});E.forEach(["post","put","patch"],function(e){Ne.headers[e]=E.merge(Xn)});zr.exports=Ne});var Yr=y((ao,$r)=>{"use strict";var ei=g(),ti=X();$r.exports=function(e,r,s){var n=this||ti;return ei.forEach(s,function(u){e=u.call(n,e,r)}),e}});var pt=y((uo,Qr)=>{"use strict";Qr.exports=function(e){return!!(e&&e.__CANCEL__)}});var Xr=y((po,Jr)=>{"use strict";var Vr=g(),lt=Yr(),ri=pt(),si=X(),ni=J();function ct(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ni("canceled")}Jr.exports=function(e){ct(e),e.headers=e.headers||{},e.data=lt.call(e,e.data,e.headers,e.transformRequest),e.headers=Vr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Vr.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var r=e.adapter||si.adapter;return r(e).then(function(n){return ct(e),n.data=lt.call(e,n.data,n.headers,e.transformResponse),n},function(n){return ri(n)||(ct(e),n&&n.response&&(n.response.data=lt.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var ft=y((lo,Zr)=>{"use strict";var L=g();Zr.exports=function(e,r){r=r||{};var s={};function n(i,l){return L.isPlainObject(i)&&L.isPlainObject(l)?L.merge(i,l):L.isPlainObject(l)?L.merge({},l):L.isArray(l)?l.slice():l}function o(i){if(L.isUndefined(r[i])){if(!L.isUndefined(e[i]))return n(void 0,e[i])}else return n(e[i],r[i])}function u(i){if(!L.isUndefined(r[i]))return n(void 0,r[i])}function a(i){if(L.isUndefined(r[i])){if(!L.isUndefined(e[i]))return n(void 0,e[i])}else return n(void 0,r[i])}function c(i){if(i in r)return n(e[i],r[i]);if(i in e)return n(void 0,e[i])}var h={url:u,method:u,data:u,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return L.forEach(Object.keys(e).concat(Object.keys(r)),function(l){var f=h[l]||o,b=f(l);L.isUndefined(b)&&f!==c||(s[l]=b)}),s}});var ts=y((co,es)=>{"use strict";var ii=Te().version,dt={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){dt[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});var Gr={};dt.transitional=function(e,r,s){function n(o,u){return"[Axios v"+ii+"] Transitional option '"+o+"'"+u+(s?". "+s:"")}return function(o,u,a){if(e===!1)throw new Error(n(u," has been removed"+(r?" in "+r:"")));return r&&!Gr[u]&&(Gr[u]=!0,console.warn(n(u," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,u,a):!0}};function oi(t,e,r){if(typeof t!="object")throw new TypeError("options must be an object");for(var s=Object.keys(t),n=s.length;n-- >0;){var o=s[n],u=e[o];if(u){var a=t[o],c=a===void 0||u(a,o,t);if(c!==!0)throw new TypeError("option "+o+" must be "+c);continue}if(r!==!0)throw Error("Unknown option "+o)}}es.exports={assertOptions:oi,validators:dt}});var as=y((fo,os)=>{"use strict";var rs=g(),ai=Se(),ss=Jt(),ns=Xr(),Fe=ft(),is=ts(),re=is.validators;function le(t){this.defaults=t,this.interceptors={request:new ss,response:new ss}}le.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=Fe(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;r!==void 0&&is.assertOptions(r,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1);var s=[],n=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(n=n&&f.synchronous,s.unshift(f.fulfilled,f.rejected))});var o=[];this.interceptors.response.forEach(function(f){o.push(f.fulfilled,f.rejected)});var u;if(!n){var a=[ns,void 0];for(Array.prototype.unshift.apply(a,s),a=a.concat(o),u=Promise.resolve(e);a.length;)u=u.then(a.shift(),a.shift());return u}for(var c=e;s.length;){var h=s.shift(),i=s.shift();try{c=h(c)}catch(l){i(l);break}}try{u=ns(c)}catch(l){return Promise.reject(l)}for(;o.length;)u=u.then(o.shift(),o.shift());return u};le.prototype.getUri=function(e){return e=Fe(this.defaults,e),ai(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};rs.forEach(["delete","get","head","options"],function(e){le.prototype[e]=function(r,s){return this.request(Fe(s||{},{method:e,url:r,data:(s||{}).data}))}});rs.forEach(["post","put","patch"],function(e){le.prototype[e]=function(r,s,n){return this.request(Fe(n||{},{method:e,url:r,data:s}))}});os.exports=le});var ps=y((ho,us)=>{"use strict";var ui=J();function se(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var r=this;this.promise.then(function(s){if(!!r._listeners){var n,o=r._listeners.length;for(n=0;n<o;n++)r._listeners[n](s);r._listeners=null}}),this.promise.then=function(s){var n,o=new Promise(function(u){r.subscribe(u),n=u}).then(s);return o.cancel=function(){r.unsubscribe(n)},o},t(function(n){r.reason||(r.reason=new ui(n),e(r.reason))})}se.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};se.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};se.prototype.unsubscribe=function(e){if(!!this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}};se.source=function(){var e,r=new se(function(n){e=n});return{token:r,cancel:e}};us.exports=se});var cs=y((mo,ls)=>{"use strict";ls.exports=function(e){return function(s){return e.apply(null,s)}}});var ds=y((yo,fs)=>{"use strict";fs.exports=function(e){return typeof e=="object"&&e.isAxiosError===!0}});var ys=y((Ao,ht)=>{"use strict";var hs=g(),pi=He(),Le=as(),li=ft(),ci=X();function ms(t){var e=new Le(t),r=pi(Le.prototype.request,e);return hs.extend(r,Le.prototype,e),hs.extend(r,e),r.create=function(n){return ms(li(t,n))},r}var k=ms(ci);k.Axios=Le;k.Cancel=J();k.CancelToken=ps();k.isCancel=pt();k.VERSION=Te().version;k.all=function(e){return Promise.all(e)};k.spread=cs();k.isAxiosError=ds();ht.exports=k;ht.exports.default=k});var mt=y((bo,As)=>{As.exports=ys()});var W;(function(s){s.NO_API_KEY="No API has been provided. An API key is required to get `pubg.ts`",s.INVALID_API_KEY="An invalid API key has been provided. Please check the key is valid",s.INVALID_SHARD="The shard argument provided is invalid. Please validate you have passed the correct shard value"})(W||(W={}));var je;(function(e){e.NOT_FOUND="not-found"})(je||(je={}));var di={[je.NOT_FOUND]:{detail:"No player(s) found matching the criteria",title:"Not found"}};var Pt;(function(o){o.ALIVE="alive",o.BYPLAYER="byplayer",o.BYZONE="byzone",o.LOGOUT="logout",o.SUICIDE="suicide"})(Pt||(Pt={}));var gt;(function(a){a.BALTIC_MAIN="Baltic_Main",a.DESERT_MAIN="Desert_Main",a.DIHOROTOK_MAIN="DihorOtok_Main",a.ERANGEL_MAIN="Erangel_Main",a.RANGE_MAIN="Range_Main",a.SAVAGE_MAIN="Savage_Main",a.SUMMERLAND_MAIN="Summerland_Main"})(gt||(gt={}));var wt;(function(a){a.AIROYALE="airoyale",a.ARCADE="arcade",a.CUSTOM="custom",a.EVENT="event",a.OFFICIAL="official",a.SEASONAL="seasonal",a.TRAINING="training"})(wt||(wt={}));var Tt;(function(p){p.CONQUEST_DUO="conquest_duo",p.CONQUEST_DUO_FPP="conquest_duo_fpp",p.CONQUEST_SOLO="conquest_solo",p.CONQUEST_SOLO_FPP="conquest_solo_fpp",p.CONQUEST_SQUAD="conquest_squad",p.CONQUEST_SQUAD_FPP="conquest_squad_fpp",p.DUO="duo",p.DUO_FPP="duo_fpp",p.ESPORTS_DUO="esports_duo",p.ESPORTS_DUO_FPP="esports_duo_fpp",p.ESPORTS_SOLO="esports_solo",p.ESPORTS_SOLO_FPP="esports_solo_fpp",p.ESPORTS_SQUAD="esports_squad",p.ESPORTS_SQUAD_FPP="esports_squad_fpp",p.LAB_FPP="lab_fpp",p.LAB_TPP="lab_tpp",p.NORMAL_DUO="normal_duo",p.NORMAL_DUO_FPP="normal_duo_fpp",p.NORMAL_SOLO="normal_solo",p.NORMAL_SOLO_FPP="normal_solo_fpp",p.NORMAL_SQUAD="normal_squad",p.NORMAL_SQUAD_FPP="normal_squad_fpp",p.SOLO="solo",p.SOLO_FPP="solo_fpp",p.SQUAD="squad",p.SQUAD_FPP="squad_fpp",p.TDM="tdm",p.WAR_DUO="war_duo",p.WAR_DUO_FPP="war_duo_fpp",p.WAR_SOLO="war_solo",p.WAR_SOLO_FPP="war_solo_fpp",p.WAR_SQUAD="war_squad",p.WAR_SQUAD_FPP="war_squad_fpp",p.ZOMBIE_DUO="zombie_duo",p.ZOMBIE_DUO_FPP="zombie_duo_fpp",p.ZOMBIE_SOLO="zombie_solo",p.ZOMBIE_SOLO_FPP="zombie_solo_fpp",p.ZOMBIE_SQUAD="zombie_squad",p.ZOMBIE_SQUAD_FPP="zombie_squad_fpp"})(Tt||(Tt={}));var z;(function(a){a.CONSOLE="console",a.KAKAO="kakao",a.PSN="psn",a.STADIA="stadia",a.STEAM="steam",a.TOURNAMENT="tournament",a.XBOX="xbox"})(z||(z={}));var qt;(function(d){d.PC_AS="pc-as",d.PC_EU="pc-eu",d.PC_JP="pc-jp",d.PC_KAKAO="pc-kakao",d.PC_KRJP="pc-krjp",d.PC_NA="pc-na",d.PC_OC="pc-oc",d.PC_RU="pc-ru",d.PC_SA="pc-sa",d.PC_SEA="pc-sea",d.PC_TOURNAMENT="pc-tournament",d.PSN_AS="psn-as",d.PSN_EU="psn-eu",d.PSN_NA="psn-na",d.PSN_OC="psn-oc",d.XBOX_AS="xbox-as",d.XBOX_EU="xbox-eu",d.XBOX_NA="xbox-na",d.XBOX_OC="xbox-oc",d.XBOX_SA="xbox-sa"})(qt||(qt={}));var ae;(function(i){i.ASSET="asset",i.MATCH="match",i.PARTICIPANT="participant",i.PLAYER="player",i.PLAYER_SEASON="playerSeason",i.RANKED_PLAYER_SEASON="rankedplayerstats",i.ROSTER="roster",i.SEASON="season",i.STATUS="status",i.TOURNAMENT="tournament"})(ae||(ae={}));var Nt;(function(s){s.CLOSED="closed",s.PREPARE="prepare",s.PROGRESS="progress"})(Nt||(Nt={}));var Ft;(function(u){u.DUO="duo",u.DUO_FPP="duo-fpp",u.SOLO="solo",u.SOLO_FPP="solo-fpp",u.SQUAD="squad",u.SQUAD_FPP="squad-fpp"})(Ft||(Ft={}));var Ts=class{constructor({apiKey:e,shard:r=z.STEAM}){Ke(this,"_apiKey");Ke(this,"_shard");if(this._apiKey=e,this._shard=r,!this._apiKey)throw new Error(W.NO_API_KEY);if(this._apiKey.length<=0)throw new Error(W.INVALID_API_KEY)}async getMatch({id:e}){return await Lt({apiKey:this._apiKey,id:e,shard:this._shard})}async getPlayer({id:e,skipFailed:r,value:s}){return await Mt({apiKey:this._apiKey,id:e,shard:this._shard,skipFailed:r,value:s})}async getPlayerSeason(e){return await Dt(S({apiKey:this._apiKey,shard:this._shard},e))}async getSamples({createdAt:e}={}){return await It({apiKey:this._apiKey,createdAt:e,shard:this._shard})}async getSeason({id:e}={}){return await Ut({apiKey:this._apiKey,id:e,shard:this._shard})}async getSeasons(){return await ye({apiKey:this._apiKey,shard:this._shard})}async getStatus(){return await Bt({apiKey:this._apiKey})}async getTelemetry({url:e}){return await kt({apiKey:this._apiKey,url:e})}async getTournament({id:e}={}){return e?await Kt({apiKey:this._apiKey,id:e}):await jt({apiKey:this._apiKey})}};var qs=10;function Ae(t,e=qs){let r=[];for(;t.length;)r.push(t.splice(0,e));return r}var bs=xt(mt());var Me={accept:"application/vnd.api+json"},yt="https://api.pubg.com";async function w({apiKey:t,endpoint:e,headers:r={},params:s={},root:n=!1,shard:o=z.STEAM}){if(!Object.values(z).includes(o))throw new Error(W.INVALID_SHARD);let u=n?`${yt}/${e}`:`${yt}/shards/${o}/${e}`;try{return{data:(await(0,bs.default)(u,{headers:S(v(S({},Me),{Authorization:`Bearer ${t}`}),r),params:s,responseType:"json"})).data,error:null}}catch({response:a}){let{data:c,status:h}=a,i=c.errors[0];return console.error(`${i.title}: ${i.detail}`),{data:null,error:i,status:h}}}async function De(t){let e=await Promise.all(t.map(r=>w(r)));return e.forEach(r=>{if(r.error)return r}),e}async function Lt(r){var s=r,{id:t}=s,e=K(s,["id"]);let n=await w(v(S({},e),{endpoint:`matches/${t}`}));if(n.error)return n;let{data:o,included:u}=n.data;return{data:v(S({},o.attributes),{assets:o.relationships.assets.data,id:o.id,members:u,type:o.type}),error:null}}async function Mt(n){var o=n,{id:t=!1,skipFailed:e=!1,value:r}=o,s=K(o,["id","skipFailed","value"]);let u=Array.isArray(r),a=!u&&t?`players/${r}`:"players",c=u?Ae([...r]).map(f=>v(S({},s),{endpoint:a,params:{[`filter[${t?"playerIds":"playerNames"}]`]:f.join(",")}})):[v(S({},s),{endpoint:a,params:t?void 0:{"filter[playerNames]":r}})],h=await De(c),i=h.find(f=>f.error!==null);if(i&&i.error)return i;let l=h.map(({data:f})=>f.data).flat();return!e&&u&&r.length!==l.length?{data:null,error:{title:"Failed data length validation",detail:`Input array length does not match response length. Players missing: | ||
${r.filter(f=>l.map(b=>t?b.id:b.attributes.name).indexOf(f)===-1).join(` | ||
`)}`},status:400}:{data:l.map(({attributes:f,id:b,relationships:U,type:O})=>v(S({},f),{assets:U.assets.data,id:b,matches:U.matches.data,type:O})),error:null}}async function Dt(o){var u=o,{gamemode:t,player:e,ranked:r=!1,season:s}=u,n=K(u,["gamemode","player","ranked","season"]);let a=typeof s=="object"?s.id:s;if(r)return{data:null,error:{title:"Unimplemented",detail:"Ranked player season stats are currently not supported"}};if(Array.isArray(e)){let h=Ae(e).map(b=>v(S({},n),{endpoint:`seasons/${a}/gameMode/${t}/players`,params:{["filter[playerIds]"]:b.join(",")}})),i=await De(h),l=i.find(b=>b.error!==null);return l&&l.error?l:{data:i.map(({data:b})=>b.data).flat().map(b=>Ss(b)),error:null}}let c=await w(v(S({},n),{endpoint:`players/${e}/seasons/${a}`}));return c.error?c:{data:Ss(c.data.data),error:null}}function Ss(t){var e;switch(t.type){case ae.PLAYER_SEASON:return{bestRankPoint:(e=t.attributes.bestRankPoint)!=null?e:void 0,gamemodeStats:t.attributes.gameModeStats,matches:Object.fromEntries(Object.entries(t.relationships).map(([r,s])=>r==="player"||r==="season"?[]:[r,s])),playerId:t.relationships.player.data.id,seasonId:t.relationships.season.data.id,type:t.type};case ae.RANKED_PLAYER_SEASON:return{playerId:t.relationships.player.data.id,rankedGameModeStats:t.attributes.rankedGameModeStats,seasonId:t.relationships.season.data.id,type:t.type}}}async function It({apiKey:t,createdAt:e,shard:r}){let s=await w({apiKey:t,endpoint:"samples",params:e?{"filter[createdAt-start]":e.toISOString()}:void 0,shard:r});if(s.error)return s;let{data:n}=s.data;return{data:v(S({},n.attributes),{id:n.id,matches:n.relationships.matches.data}),error:null}}async function Ut(r){var s=r,{id:t}=s,e=K(s,["id"]);let n=await ye(S({},e));return n.error?n:{data:n.data.find(o=>t?t===o.id:o.isCurrentSeason),error:null}}async function ye(t){let e=await w(v(S({},t),{endpoint:"seasons"}));if(e.error)return e;let{data:r}=e.data;return{data:r.map(({attributes:s,id:n,type:o})=>({id:n,isCurrentSeason:s.isCurrentSeason,isOffseason:s.isOffseason,type:o})),error:null}}async function Bt({apiKey:t}){let e=await w({apiKey:t,endpoint:"status",root:!0});return e.error?e:{data:e.data.data,error:null}}var vs=xt(mt());async function kt({apiKey:t,url:e}){let r=await(0,vs.default)(e,{headers:v(S({},Me),{Authorization:`Bearer ${t}`}),responseType:"json"});return"error"in r?r:r.data}async function Kt({apiKey:t,id:e}){let r=await w({apiKey:t,endpoint:`tournaments/${e}`,root:!0});if(r.error)return r;let{data:s,included:n}=r.data;return{data:v(S({},s),{matches:n}),error:null}}async function jt({apiKey:t}){let e=await w({apiKey:t,endpoint:"tournaments",root:!0});if(e.error)return e;let{data:r}=e.data;return{data:r.map(({attributes:s,id:n,type:o})=>({createdAt:s.createdAt,id:n,type:o})),error:null}}})(); | ||
//# sourceMappingURL=index.global.js.map |
@@ -1,4 +0,4 @@ | ||
var ae=Object.create;var R=Object.defineProperty,ie=Object.defineProperties,oe=Object.getOwnPropertyDescriptor,pe=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,le=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var k=(r,e,s)=>e in r?R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s,l=(r,e)=>{for(var s in e||(e={}))M.call(e,s)&&k(r,s,e[s]);if(g)for(var s of g(e))V.call(e,s)&&k(r,s,e[s]);return r},A=(r,e)=>ie(r,pe(e)),Z=r=>R(r,"__esModule",{value:!0});var h=(r,e)=>{var s={};for(var n in r)M.call(r,n)&&e.indexOf(n)<0&&(s[n]=r[n]);if(r!=null&&g)for(var n of g(r))e.indexOf(n)<0&&V.call(r,n)&&(s[n]=r[n]);return s};var ce=(r,e)=>{Z(r);for(var s in e)R(r,s,{get:e[s],enumerable:!0})},me=(r,e,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ue(e))!M.call(r,n)&&n!=="default"&&R(r,n,{get:()=>e[n],enumerable:!(s=oe(e,n))||s.enumerable});return r},J=r=>me(Z(R(r!=null?ae(le(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var I=(r,e,s)=>(k(r,typeof e!="symbol"?e+"":e,s),s);ce(exports,{Client:()=>G,DeathType:()=>K,ErrorCode:()=>P,GameModeStatGamemode:()=>B,Gamemode:()=>L,Map:()=>w,MatchType:()=>U,PlayerErrors:()=>Ae,Region:()=>C,ResponseObjectType:()=>b,SeasonState:()=>F,Shard:()=>_,getMatch:()=>W,getPlayer:()=>v,getPlayerSeason:()=>q,getSamples:()=>Q,getSeason:()=>Y,getSeasons:()=>T,getStatus:()=>$,getTelemetry:()=>j,getTournament:()=>X,getTournaments:()=>H});var u=typeof document=="undefined"?new(require("url")).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var P;(function(n){n.NO_API_KEY="No API has been provided. An API key is required to get `pubg.ts`",n.INVALID_API_KEY="An invalid API key has been provided. Please check the key is valid",n.INVALID_SHARD="The shard argument provided is invalid. Please validate you have passed the correct shard value"})(P||(P={}));var D;(function(e){e.NOT_FOUND="not-found"})(D||(D={}));var Ae={[D.NOT_FOUND]:{detail:"No player(s) found matching the criteria",title:"Not found"}};var K;(function(p){p.ALIVE="alive",p.BYPLAYER="byplayer",p.BYZONE="byzone",p.LOGOUT="logout",p.SUICIDE="suicide"})(K||(K={}));var w;(function(a){a.BALTIC_MAIN="Baltic_Main",a.DESERT_MAIN="Desert_Main",a.DIHOROTOK_MAIN="DihorOtok_Main",a.ERANGEL_MAIN="Erangel_Main",a.RANGE_MAIN="Range_Main",a.SAVAGE_MAIN="Savage_Main",a.SUMMERLAND_MAIN="Summerland_Main"})(w||(w={}));var U;(function(a){a.AIROYALE="airoyale",a.ARCADE="arcade",a.CUSTOM="custom",a.EVENT="event",a.OFFICIAL="official",a.SEASONAL="seasonal",a.TRAINING="training"})(U||(U={}));var L;(function(t){t.CONQUEST_DUO="conquest_duo",t.CONQUEST_DUO_FPP="conquest_duo_fpp",t.CONQUEST_SOLO="conquest_solo",t.CONQUEST_SOLO_FPP="conquest_solo_fpp",t.CONQUEST_SQUAD="conquest_squad",t.CONQUEST_SQUAD_FPP="conquest_squad_fpp",t.DUO="duo",t.DUO_FPP="duo_fpp",t.ESPORTS_DUO="esports_duo",t.ESPORTS_DUO_FPP="esports_duo_fpp",t.ESPORTS_SOLO="esports_solo",t.ESPORTS_SOLO_FPP="esports_solo_fpp",t.ESPORTS_SQUAD="esports_squad",t.ESPORTS_SQUAD_FPP="esports_squad_fpp",t.LAB_FPP="lab_fpp",t.LAB_TPP="lab_tpp",t.NORMAL_DUO="normal_duo",t.NORMAL_DUO_FPP="normal_duo_fpp",t.NORMAL_SOLO="normal_solo",t.NORMAL_SOLO_FPP="normal_solo_fpp",t.NORMAL_SQUAD="normal_squad",t.NORMAL_SQUAD_FPP="normal_squad_fpp",t.SOLO="solo",t.SOLO_FPP="solo_fpp",t.SQUAD="squad",t.SQUAD_FPP="squad_fpp",t.TDM="tdm",t.WAR_DUO="war_duo",t.WAR_DUO_FPP="war_duo_fpp",t.WAR_SOLO="war_solo",t.WAR_SOLO_FPP="war_solo_fpp",t.WAR_SQUAD="war_squad",t.WAR_SQUAD_FPP="war_squad_fpp",t.ZOMBIE_DUO="zombie_duo",t.ZOMBIE_DUO_FPP="zombie_duo_fpp",t.ZOMBIE_SOLO="zombie_solo",t.ZOMBIE_SOLO_FPP="zombie_solo_fpp",t.ZOMBIE_SQUAD="zombie_squad",t.ZOMBIE_SQUAD_FPP="zombie_squad_fpp"})(L||(L={}));var _;(function(a){a.CONSOLE="console",a.KAKAO="kakao",a.PSN="psn",a.STADIA="stadia",a.STEAM="steam",a.TOURNAMENT="tournament",a.XBOX="xbox"})(_||(_={}));var C;(function(o){o.PC_AS="pc-as",o.PC_EU="pc-eu",o.PC_JP="pc-jp",o.PC_KAKAO="pc-kakao",o.PC_KRJP="pc-krjp",o.PC_NA="pc-na",o.PC_OC="pc-oc",o.PC_RU="pc-ru",o.PC_SA="pc-sa",o.PC_SEA="pc-sea",o.PC_TOURNAMENT="pc-tournament",o.PSN_AS="psn-as",o.PSN_EU="psn-eu",o.PSN_NA="psn-na",o.PSN_OC="psn-oc",o.XBOX_AS="xbox-as",o.XBOX_EU="xbox-eu",o.XBOX_NA="xbox-na",o.XBOX_OC="xbox-oc",o.XBOX_SA="xbox-sa"})(C||(C={}));var b;(function(i){i.ASSET="asset",i.MATCH="match",i.PARTICIPANT="participant",i.PLAYER="player",i.PLAYER_SEASON="playerSeason",i.RANKED_PLAYER_SEASON="rankedplayerstats",i.ROSTER="roster",i.SEASON="season",i.STATUS="status",i.TOURNAMENT="tournament"})(b||(b={}));var F;(function(n){n.CLOSED="closed",n.PREPARE="prepare",n.PROGRESS="progress"})(F||(F={}));var B;(function(c){c.DUO="duo",c.DUO_FPP="duo-fpp",c.SOLO="solo",c.SOLO_FPP="solo-fpp",c.SQUAD="squad",c.SQUAD_FPP="squad-fpp"})(B||(B={}));var G=class{constructor({apiKey:e,shard:s=_.STEAM}){I(this,"_apiKey");I(this,"_shard");if(this._apiKey=e,this._shard=s,!this._apiKey)throw new Error(P.NO_API_KEY);if(this._apiKey.length<=0)throw new Error(P.INVALID_API_KEY)}async getMatch({id:e}){return await W({apiKey:this._apiKey,id:e,shard:this._shard})}async getPlayer({id:e,skipFailed:s,value:n}){return await v({apiKey:this._apiKey,id:e,shard:this._shard,skipFailed:s,value:n})}async getPlayerSeason(e){return await q(l({apiKey:this._apiKey,shard:this._shard},e))}async getSamples({createdAt:e}={}){return await Q({apiKey:this._apiKey,createdAt:e,shard:this._shard})}async getSeason({id:e}={}){return await Y({apiKey:this._apiKey,id:e,shard:this._shard})}async getSeasons(){return await T({apiKey:this._apiKey,shard:this._shard})}async getStatus(){return await $({apiKey:this._apiKey})}async getTelemetry({url:e}){return await j({apiKey:this._apiKey,url:e})}async getTournament({id:e}={}){return e?await X({apiKey:this._apiKey,id:e}):await H({apiKey:this._apiKey})}};var ye=10;function ee(r,e=ye){let s=[];for(;r.length;)s.push(r.splice(0,e));return s}var te=J(require("axios"));var N={accept:"application/vnd.api+json"},z="https://api.pubg.com";async function y({apiKey:r,endpoint:e,headers:s={},params:n={},root:m=!1,shard:p=_.STEAM}){if(!Object.values(_).includes(p))throw new Error(P.INVALID_SHARD);let c=m?`${z}/${e}`:`${z}/shards/${p}/${e}`;try{return{data:(await(0,te.default)(c,{headers:l(A(l({},N),{Authorization:`Bearer ${r}`}),s),params:n,responseType:"json"})).data,error:null}}catch({response:a}){let{data:x,status:S}=a,i=x.errors[0];return console.error(`${i.title}: ${i.detail}`),{data:null,error:i,status:S}}}async function re(r){let e=await Promise.all(r.map(s=>y(s)));return e.forEach(s=>{if(s.error)return s}),e}async function W(s){var n=s,{id:r}=n,e=h(n,["id"]);let m=await y(A(l({},e),{endpoint:`matches/${r}`}));if(m.error)return m;let{data:p,included:c}=m.data;return{data:A(l({},p.attributes),{assets:p.relationships.assets.data,id:p.id,members:c,type:p.type}),error:null}}async function v(m){var p=m,{id:r=!1,skipFailed:e=!1,value:s}=p,n=h(p,["id","skipFailed","value"]);let c=Array.isArray(s),a=!c&&r?`players/${s}`:"players",x=c?ee([...s]).map(d=>A(l({},n),{endpoint:a,params:{[`filter[${r?"playerIds":"playerNames"}]`]:d.join(",")}})):[A(l({},n),{endpoint:a,params:r?void 0:{"filter[playerNames]":s}})],S=await re(x),i=S.find(d=>d.error!==null);if(i&&i.error)return i;let O=S.map(({data:d})=>d.data).flat();return!e&&c&&s.length!==O.length?{data:null,error:{title:"Failed data length validation",detail:`Input array length does not match response length. Players missing: | ||
${s.filter(d=>O.map(f=>r?f.id:f.attributes.name).indexOf(d)===-1).join(` | ||
`)}`},status:400}:{data:O.map(({attributes:d,id:f,relationships:E,type:ne})=>A(l({},d),{assets:E.assets.data,id:f,matches:E.matches.data,type:ne})),error:null}}async function q(m){var p=m,{player:r,ranked:e=!1,season:s}=p,n=h(p,["player","ranked","season"]);var O;let{playerId:c,shard:a}=typeof r=="object"?{playerId:r.id,shard:r.shardId}:{playerId:r,shard:n.shard},x=typeof s=="object"?s.id:s,S=await y(A(l({},n),{endpoint:`players/${c}/seasons/${x}${e?"/ranked":""}`,shard:a}));if(S.error)return S;let{data:i}=S.data;switch(i.type){case b.PLAYER_SEASON:let d=Object.fromEntries(Object.entries(i.relationships).map(([f,E])=>f==="player"||f==="season"?[]:[f,E]));return{data:{bestRankPoint:(O=i.attributes.bestRankPoint)!=null?O:void 0,gamemodeStats:i.attributes.gameModeStats,matches:d,playerId:i.relationships.player.data.id,seasonId:i.relationships.season.data.id,type:i.type},error:null};case b.RANKED_PLAYER_SEASON:return{data:{playerId:i.relationships.player.data.id,rankedGameModeStats:i.attributes.rankedGameModeStats,seasonId:i.relationships.season.data.id,type:i.type},error:null}}}async function Q({apiKey:r,createdAt:e,shard:s}){let n=await y({apiKey:r,endpoint:"samples",params:e?{"filter[createdAt-start]":e.toISOString()}:void 0,shard:s});if(n.error)return n;let{data:m}=n.data;return{data:A(l({},m.attributes),{id:m.id,matches:m.relationships.matches.data}),error:null}}async function Y(s){var n=s,{id:r}=n,e=h(n,["id"]);let m=await T(l({},e));return m.error?m:{data:m.data.find(p=>r?r===p.id:p.isCurrentSeason),error:null}}async function T(r){let e=await y(A(l({},r),{endpoint:"seasons"}));if(e.error)return e;let{data:s}=e.data;return{data:s.map(({attributes:n,id:m,type:p})=>({id:m,isCurrentSeason:n.isCurrentSeason,isOffseason:n.isOffseason,type:p})),error:null}}async function $({apiKey:r}){let e=await y({apiKey:r,endpoint:"status",root:!0});return e.error?e:{data:e.data.data,error:null}}var se=J(require("axios"));async function j({apiKey:r,url:e}){let s=await(0,se.default)(e,{headers:A(l({},N),{Authorization:`Bearer ${r}`}),responseType:"json"});return"error"in s?s:s.data}async function X({apiKey:r,id:e}){let s=await y({apiKey:r,endpoint:`tournaments/${e}`,root:!0});if(s.error)return s;let{data:n,included:m}=s.data;return{data:A(l({},n),{matches:m}),error:null}}async function H({apiKey:r}){let e=await y({apiKey:r,endpoint:"tournaments",root:!0});if(e.error)return e;let{data:s}=e.data;return{data:s.map(({attributes:n,id:m,type:p})=>({createdAt:n.createdAt,id:m,type:p})),error:null}}0&&(module.exports={Client,DeathType,ErrorCode,GameModeStatGamemode,Gamemode,Map,MatchType,PlayerErrors,Region,ResponseObjectType,SeasonState,Shard,getMatch,getPlayer,getPlayerSeason,getSamples,getSeason,getSeasons,getStatus,getTelemetry,getTournament,getTournaments}); | ||
var ie=Object.create;var x=Object.defineProperty,oe=Object.defineProperties,pe=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyDescriptors,le=Object.getOwnPropertyNames,E=Object.getOwnPropertySymbols,ce=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var D=(t,e,s)=>e in t?x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,l=(t,e)=>{for(var s in e||(e={}))k.call(e,s)&&D(t,s,e[s]);if(E)for(var s of E(e))J.call(e,s)&&D(t,s,e[s]);return t},A=(t,e)=>oe(t,ue(e)),G=t=>x(t,"__esModule",{value:!0});var f=(t,e)=>{var s={};for(var n in t)k.call(t,n)&&e.indexOf(n)<0&&(s[n]=t[n]);if(t!=null&&E)for(var n of E(t))e.indexOf(n)<0&&J.call(t,n)&&(s[n]=t[n]);return s};var me=(t,e)=>{G(t);for(var s in e)x(t,s,{get:e[s],enumerable:!0})},Ae=(t,e,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of le(e))!k.call(t,n)&&n!=="default"&&x(t,n,{get:()=>e[n],enumerable:!(s=pe(e,n))||s.enumerable});return t},ee=t=>Ae(G(x(t!=null?ie(ce(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var I=(t,e,s)=>(D(t,typeof e!="symbol"?e+"":e,s),s);me(exports,{Client:()=>te,DeathType:()=>w,ErrorCode:()=>P,GameModeStatGamemode:()=>W,Gamemode:()=>C,Map:()=>U,MatchType:()=>L,PlayerErrors:()=>ye,Region:()=>F,ResponseObjectType:()=>R,SeasonState:()=>B,Shard:()=>h,getMatch:()=>v,getPlayer:()=>q,getPlayerSeason:()=>Q,getSamples:()=>Y,getSeason:()=>$,getSeasons:()=>T,getStatus:()=>j,getTelemetry:()=>X,getTournament:()=>H,getTournaments:()=>z});var u=typeof document=="undefined"?new(require("url")).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var P;(function(n){n.NO_API_KEY="No API has been provided. An API key is required to get `pubg.ts`",n.INVALID_API_KEY="An invalid API key has been provided. Please check the key is valid",n.INVALID_SHARD="The shard argument provided is invalid. Please validate you have passed the correct shard value"})(P||(P={}));var K;(function(e){e.NOT_FOUND="not-found"})(K||(K={}));var ye={[K.NOT_FOUND]:{detail:"No player(s) found matching the criteria",title:"Not found"}};var w;(function(p){p.ALIVE="alive",p.BYPLAYER="byplayer",p.BYZONE="byzone",p.LOGOUT="logout",p.SUICIDE="suicide"})(w||(w={}));var U;(function(a){a.BALTIC_MAIN="Baltic_Main",a.DESERT_MAIN="Desert_Main",a.DIHOROTOK_MAIN="DihorOtok_Main",a.ERANGEL_MAIN="Erangel_Main",a.RANGE_MAIN="Range_Main",a.SAVAGE_MAIN="Savage_Main",a.SUMMERLAND_MAIN="Summerland_Main"})(U||(U={}));var L;(function(a){a.AIROYALE="airoyale",a.ARCADE="arcade",a.CUSTOM="custom",a.EVENT="event",a.OFFICIAL="official",a.SEASONAL="seasonal",a.TRAINING="training"})(L||(L={}));var C;(function(r){r.CONQUEST_DUO="conquest_duo",r.CONQUEST_DUO_FPP="conquest_duo_fpp",r.CONQUEST_SOLO="conquest_solo",r.CONQUEST_SOLO_FPP="conquest_solo_fpp",r.CONQUEST_SQUAD="conquest_squad",r.CONQUEST_SQUAD_FPP="conquest_squad_fpp",r.DUO="duo",r.DUO_FPP="duo_fpp",r.ESPORTS_DUO="esports_duo",r.ESPORTS_DUO_FPP="esports_duo_fpp",r.ESPORTS_SOLO="esports_solo",r.ESPORTS_SOLO_FPP="esports_solo_fpp",r.ESPORTS_SQUAD="esports_squad",r.ESPORTS_SQUAD_FPP="esports_squad_fpp",r.LAB_FPP="lab_fpp",r.LAB_TPP="lab_tpp",r.NORMAL_DUO="normal_duo",r.NORMAL_DUO_FPP="normal_duo_fpp",r.NORMAL_SOLO="normal_solo",r.NORMAL_SOLO_FPP="normal_solo_fpp",r.NORMAL_SQUAD="normal_squad",r.NORMAL_SQUAD_FPP="normal_squad_fpp",r.SOLO="solo",r.SOLO_FPP="solo_fpp",r.SQUAD="squad",r.SQUAD_FPP="squad_fpp",r.TDM="tdm",r.WAR_DUO="war_duo",r.WAR_DUO_FPP="war_duo_fpp",r.WAR_SOLO="war_solo",r.WAR_SOLO_FPP="war_solo_fpp",r.WAR_SQUAD="war_squad",r.WAR_SQUAD_FPP="war_squad_fpp",r.ZOMBIE_DUO="zombie_duo",r.ZOMBIE_DUO_FPP="zombie_duo_fpp",r.ZOMBIE_SOLO="zombie_solo",r.ZOMBIE_SOLO_FPP="zombie_solo_fpp",r.ZOMBIE_SQUAD="zombie_squad",r.ZOMBIE_SQUAD_FPP="zombie_squad_fpp"})(C||(C={}));var h;(function(a){a.CONSOLE="console",a.KAKAO="kakao",a.PSN="psn",a.STADIA="stadia",a.STEAM="steam",a.TOURNAMENT="tournament",a.XBOX="xbox"})(h||(h={}));var F;(function(i){i.PC_AS="pc-as",i.PC_EU="pc-eu",i.PC_JP="pc-jp",i.PC_KAKAO="pc-kakao",i.PC_KRJP="pc-krjp",i.PC_NA="pc-na",i.PC_OC="pc-oc",i.PC_RU="pc-ru",i.PC_SA="pc-sa",i.PC_SEA="pc-sea",i.PC_TOURNAMENT="pc-tournament",i.PSN_AS="psn-as",i.PSN_EU="psn-eu",i.PSN_NA="psn-na",i.PSN_OC="psn-oc",i.XBOX_AS="xbox-as",i.XBOX_EU="xbox-eu",i.XBOX_NA="xbox-na",i.XBOX_OC="xbox-oc",i.XBOX_SA="xbox-sa"})(F||(F={}));var R;(function(o){o.ASSET="asset",o.MATCH="match",o.PARTICIPANT="participant",o.PLAYER="player",o.PLAYER_SEASON="playerSeason",o.RANKED_PLAYER_SEASON="rankedplayerstats",o.ROSTER="roster",o.SEASON="season",o.STATUS="status",o.TOURNAMENT="tournament"})(R||(R={}));var B;(function(n){n.CLOSED="closed",n.PREPARE="prepare",n.PROGRESS="progress"})(B||(B={}));var W;(function(m){m.DUO="duo",m.DUO_FPP="duo-fpp",m.SOLO="solo",m.SOLO_FPP="solo-fpp",m.SQUAD="squad",m.SQUAD_FPP="squad-fpp"})(W||(W={}));var te=class{constructor({apiKey:e,shard:s=h.STEAM}){I(this,"_apiKey");I(this,"_shard");if(this._apiKey=e,this._shard=s,!this._apiKey)throw new Error(P.NO_API_KEY);if(this._apiKey.length<=0)throw new Error(P.INVALID_API_KEY)}async getMatch({id:e}){return await v({apiKey:this._apiKey,id:e,shard:this._shard})}async getPlayer({id:e,skipFailed:s,value:n}){return await q({apiKey:this._apiKey,id:e,shard:this._shard,skipFailed:s,value:n})}async getPlayerSeason(e){return await Q(l({apiKey:this._apiKey,shard:this._shard},e))}async getSamples({createdAt:e}={}){return await Y({apiKey:this._apiKey,createdAt:e,shard:this._shard})}async getSeason({id:e}={}){return await $({apiKey:this._apiKey,id:e,shard:this._shard})}async getSeasons(){return await T({apiKey:this._apiKey,shard:this._shard})}async getStatus(){return await j({apiKey:this._apiKey})}async getTelemetry({url:e}){return await X({apiKey:this._apiKey,url:e})}async getTournament({id:e}={}){return e?await H({apiKey:this._apiKey,id:e}):await z({apiKey:this._apiKey})}};var de=10;function g(t,e=de){let s=[];for(;t.length;)s.push(t.splice(0,e));return s}var re=ee(require("axios"));var M={accept:"application/vnd.api+json"},V="https://api.pubg.com";async function y({apiKey:t,endpoint:e,headers:s={},params:n={},root:c=!1,shard:p=h.STEAM}){if(!Object.values(h).includes(p))throw new Error(P.INVALID_SHARD);let m=c?`${V}/${e}`:`${V}/shards/${p}/${e}`;try{return{data:(await(0,re.default)(m,{headers:l(A(l({},M),{Authorization:`Bearer ${t}`}),s),params:n,responseType:"json"})).data,error:null}}catch({response:a}){let{data:_,status:b}=a,o=_.errors[0];return console.error(`${o.title}: ${o.detail}`),{data:null,error:o,status:b}}}async function N(t){let e=await Promise.all(t.map(s=>y(s)));return e.forEach(s=>{if(s.error)return s}),e}async function v(s){var n=s,{id:t}=n,e=f(n,["id"]);let c=await y(A(l({},e),{endpoint:`matches/${t}`}));if(c.error)return c;let{data:p,included:m}=c.data;return{data:A(l({},p.attributes),{assets:p.relationships.assets.data,id:p.id,members:m,type:p.type}),error:null}}async function q(c){var p=c,{id:t=!1,skipFailed:e=!1,value:s}=p,n=f(p,["id","skipFailed","value"]);let m=Array.isArray(s),a=!m&&t?`players/${s}`:"players",_=m?g([...s]).map(S=>A(l({},n),{endpoint:a,params:{[`filter[${t?"playerIds":"playerNames"}]`]:S.join(",")}})):[A(l({},n),{endpoint:a,params:t?void 0:{"filter[playerNames]":s}})],b=await N(_),o=b.find(S=>S.error!==null);if(o&&o.error)return o;let O=b.map(({data:S})=>S.data).flat();return!e&&m&&s.length!==O.length?{data:null,error:{title:"Failed data length validation",detail:`Input array length does not match response length. Players missing: | ||
${s.filter(S=>O.map(d=>t?d.id:d.attributes.name).indexOf(S)===-1).join(` | ||
`)}`},status:400}:{data:O.map(({attributes:S,id:d,relationships:Z,type:ae})=>A(l({},S),{assets:Z.assets.data,id:d,matches:Z.matches.data,type:ae})),error:null}}async function Q(p){var m=p,{gamemode:t,player:e,ranked:s=!1,season:n}=m,c=f(m,["gamemode","player","ranked","season"]);let a=typeof n=="object"?n.id:n;if(s)return{data:null,error:{title:"Unimplemented",detail:"Ranked player season stats are currently not supported"}};if(Array.isArray(e)){let b=g(e).map(d=>A(l({},c),{endpoint:`seasons/${a}/gameMode/${t}/players`,params:{["filter[playerIds]"]:d.join(",")}})),o=await N(b),O=o.find(d=>d.error!==null);return O&&O.error?O:{data:o.map(({data:d})=>d.data).flat().map(d=>se(d)),error:null}}let _=await y(A(l({},c),{endpoint:`players/${e}/seasons/${a}`}));return _.error?_:{data:se(_.data.data),error:null}}function se(t){var e;switch(t.type){case R.PLAYER_SEASON:return{bestRankPoint:(e=t.attributes.bestRankPoint)!=null?e:void 0,gamemodeStats:t.attributes.gameModeStats,matches:Object.fromEntries(Object.entries(t.relationships).map(([s,n])=>s==="player"||s==="season"?[]:[s,n])),playerId:t.relationships.player.data.id,seasonId:t.relationships.season.data.id,type:t.type};case R.RANKED_PLAYER_SEASON:return{playerId:t.relationships.player.data.id,rankedGameModeStats:t.attributes.rankedGameModeStats,seasonId:t.relationships.season.data.id,type:t.type}}}async function Y({apiKey:t,createdAt:e,shard:s}){let n=await y({apiKey:t,endpoint:"samples",params:e?{"filter[createdAt-start]":e.toISOString()}:void 0,shard:s});if(n.error)return n;let{data:c}=n.data;return{data:A(l({},c.attributes),{id:c.id,matches:c.relationships.matches.data}),error:null}}async function $(s){var n=s,{id:t}=n,e=f(n,["id"]);let c=await T(l({},e));return c.error?c:{data:c.data.find(p=>t?t===p.id:p.isCurrentSeason),error:null}}async function T(t){let e=await y(A(l({},t),{endpoint:"seasons"}));if(e.error)return e;let{data:s}=e.data;return{data:s.map(({attributes:n,id:c,type:p})=>({id:c,isCurrentSeason:n.isCurrentSeason,isOffseason:n.isOffseason,type:p})),error:null}}async function j({apiKey:t}){let e=await y({apiKey:t,endpoint:"status",root:!0});return e.error?e:{data:e.data.data,error:null}}var ne=ee(require("axios"));async function X({apiKey:t,url:e}){let s=await(0,ne.default)(e,{headers:A(l({},M),{Authorization:`Bearer ${t}`}),responseType:"json"});return"error"in s?s:s.data}async function H({apiKey:t,id:e}){let s=await y({apiKey:t,endpoint:`tournaments/${e}`,root:!0});if(s.error)return s;let{data:n,included:c}=s.data;return{data:A(l({},n),{matches:c}),error:null}}async function z({apiKey:t}){let e=await y({apiKey:t,endpoint:"tournaments",root:!0});if(e.error)return e;let{data:s}=e.data;return{data:s.map(({attributes:n,id:c,type:p})=>({createdAt:n.createdAt,id:c,type:p})),error:null}}0&&(module.exports={Client,DeathType,ErrorCode,GameModeStatGamemode,Gamemode,Map,MatchType,PlayerErrors,Region,ResponseObjectType,SeasonState,Shard,getMatch,getPlayer,getPlayerSeason,getSamples,getSeason,getSeasons,getStatus,getTelemetry,getTournament,getTournaments}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "pubg.ts", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "A lightweight PUBG TypeScript API Wrapper", | ||
@@ -45,3 +45,2 @@ "repository": { | ||
"cross-env": "^7.0.3", | ||
"dotenv": "^10.0.0", | ||
"rimraf": "^3.0.2", | ||
@@ -48,0 +47,0 @@ "tsup": "^5.3.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
432674
12
2197