diff --git a/dist/index.js b/dist/index.js index e5020a1..2f1fc4a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -11,4 +11,4 @@ * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function n(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function i(e){var t,r;return!1!==n(e)&&("function"==typeof(t=e.constructor)&&(!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}function a(e,t,r){if("string"==typeof t){let[e,o]=t.split(" ");r=Object.assign(o?{method:e,url:o}:{url:e},r)}else r=Object.assign({},t);var o;r.headers=(o=r.headers)?Object.keys(o).reduce((e,t)=>(e[t.toLowerCase()]=o[t],e),{}):{};const s=function e(t,r){const o=Object.assign({},t);return Object.keys(r).forEach(s=>{i(r[s])?s in t?o[s]=e(t[s],r[s]):Object.assign(o,{[s]:r[s]}):Object.assign(o,{[s]:r[s]})}),o}(e||{},r);return e&&e.mediaType.previews.length&&(s.mediaType.previews=e.mediaType.previews.filter(e=>!s.mediaType.previews.includes(e)).concat(s.mediaType.previews)),s.mediaType.previews=s.mediaType.previews.map(e=>e.replace(/-preview/,"")),s}const c=/\{[^}]+\}/g;function u(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function p(e,t){return Object.keys(e).filter(e=>!t.includes(e)).reduce((t,r)=>(t[r]=e[r],t),{})}function l(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map((function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e})).join("")}function d(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function m(e,t,r){return t="+"===e||"#"===e?l(t):d(t),r?d(r)+"="+t:t}function h(e){return null!=e}function f(e){return";"===e||"&"===e||"?"===e}function g(e,t){var r=["+","#",".","/",";","?","&"];return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,o,s){if(o){let e="";const s=[];if(-1!==r.indexOf(o.charAt(0))&&(e=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach((function(r){var o=/([^:\*]*)(?::(\d+)|(\*))?/.exec(r);s.push(function(e,t,r,o){var s=e[r],n=[];if(h(s)&&""!==s)if("string"==typeof s||"number"==typeof s||"boolean"==typeof s)s=s.toString(),o&&"*"!==o&&(s=s.substring(0,parseInt(o,10))),n.push(m(t,s,f(t)?r:""));else if("*"===o)Array.isArray(s)?s.filter(h).forEach((function(e){n.push(m(t,e,f(t)?r:""))})):Object.keys(s).forEach((function(e){h(s[e])&&n.push(m(t,s[e],e))}));else{const e=[];Array.isArray(s)?s.filter(h).forEach((function(r){e.push(m(t,r))})):Object.keys(s).forEach((function(r){h(s[r])&&(e.push(d(r)),e.push(m(t,s[r].toString())))})),f(t)?n.push(d(r)+"="+e.join(",")):0!==e.length&&n.push(e.join(","))}else";"===t?h(s)&&n.push(d(r)):""!==s||"&"!==t&&"?"!==t?""===s&&n.push(""):n.push(d(r)+"=");return n}(t,e,o[1],o[2]||o[3]))})),e&&"+"!==e){var n=",";return"?"===e?n="&":"#"!==e&&(n=e),(0!==s.length?e:"")+s.join(n)}return s.join(",")}return l(s)}))}function E(e){let t,r=e.method.toUpperCase(),o=(e.url||"/").replace(/:([a-z]\w+)/g,"{+$1}"),s=Object.assign({},e.headers),n=p(e,["method","baseUrl","url","headers","request","mediaType"]);const i=function(e){const t=e.match(c);return t?t.map(u).reduce((e,t)=>e.concat(t),[]):[]}(o);var a;o=(a=o,{expand:g.bind(null,a)}).expand(n),/^http/.test(o)||(o=e.baseUrl+o);const l=p(n,Object.keys(e).filter(e=>i.includes(e)).concat("baseUrl"));if(!/application\/octet-stream/i.test(s.accept)&&(e.mediaType.format&&(s.accept=s.accept.split(/,/).map(t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,"application/vnd$1$2."+e.mediaType.format)).join(",")),e.mediaType.previews.length)){const t=s.accept.match(/[\w-]+(?=-preview)/g)||[];s.accept=t.concat(e.mediaType.previews).map(t=>`application/vnd.github.${t}-preview${e.mediaType.format?"."+e.mediaType.format:"+json"}`).join(",")}return["GET","HEAD"].includes(r)?o=function(e,t){const r=/\?/.test(e)?"&":"?",o=Object.keys(t);return 0===o.length?e:e+r+o.map(e=>"q"===e?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${e}=${encodeURIComponent(t[e])}`).join("&")}(o,l):"data"in l?t=l.data:Object.keys(l).length?t=l:s["content-length"]=0,s["content-type"]||void 0===t||(s["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(r)&&void 0===t&&(t=""),Object.assign({method:r,url:o,headers:s},void 0!==t?{body:t}:null,e.request?{request:e.request}:null)}function w(e,t,r){return E(a(e,t,r))}const T=function e(t,r){const o=a(t,r),s=w.bind(null,o);return Object.assign(s,{DEFAULTS:o,defaults:e.bind(null,o),merge:a.bind(null,o),parse:E})}(null,{method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":"octokit-endpoint.js/6.0.3 "+o()},mediaType:{format:"",previews:[]}});var y=r(1),b=r(8),v=r(6),_=r(10),P=r(2);const O=y.Readable,R=Symbol("buffer"),S=Symbol("type");class A{constructor(){this[S]="";const e=arguments[0],t=arguments[1],r=[];let o=0;if(e){const t=e,s=Number(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{},o=r.size;let s=void 0===o?0:o;var n=r.timeout;let i=void 0===n?0:n;null==e?e=null:F(e)?e=Buffer.from(e.toString()):U(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof y||(e=Buffer.from(String(e)))),this[G]={body:e,disturbed:!1,error:null},this.size=s,this.timeout=i,e instanceof y&&e.on("error",(function(e){const r="AbortError"===e.name?e:new k(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[G].error=r}))}function x(){var e=this;if(this[G].disturbed)return L.Promise.reject(new TypeError("body used already for: "+this.url));if(this[G].disturbed=!0,this[G].error)return L.Promise.reject(this[G].error);let t=this.body;if(null===t)return L.Promise.resolve(Buffer.alloc(0));if(U(t)&&(t=t.stream()),Buffer.isBuffer(t))return L.Promise.resolve(t);if(!(t instanceof y))return L.Promise.resolve(Buffer.alloc(0));let r=[],o=0,s=!1;return new L.Promise((function(n,i){let a;e.timeout&&(a=setTimeout((function(){s=!0,i(new k(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(s=!0,i(t)):i(new k(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!s&&null!==t){if(e.size&&o+t.length>e.size)return s=!0,void i(new k(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,r.push(t)}})),t.on("end",(function(){if(!s){clearTimeout(a);try{n(Buffer.concat(r,o))}catch(t){i(new k(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function F(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function U(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function D(e){let t,r,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof y&&"function"!=typeof o.getBoundary&&(t=new I,r=new I,o.pipe(t),o.pipe(r),e[G].body=t,o=r),o}function j(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":F(e)?"application/x-www-form-urlencoded;charset=UTF-8":U(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?"multipart/form-data;boundary="+e.getBoundary():e instanceof y?null:"text/plain;charset=UTF-8"}function N(e){const t=e.body;return null===t?0:U(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}L.prototype={get body(){return this[G].body},get bodyUsed(){return this[G].disturbed},arrayBuffer(){return x.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return x.call(this).then((function(t){return Object.assign(new A([],{type:e.toLowerCase()}),{[R]:t})}))},json(){var e=this;return x.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return L.Promise.reject(new k(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return x.call(this).then((function(e){return e.toString()}))},buffer(){return x.call(this)},textConverted(){var e=this;return x.call(this).then((function(t){return function(e,t){if("function"!=typeof C)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let o,s,n="utf-8";r&&(o=/charset=([^;]*)/i.exec(r));s=e.slice(0,1024).toString(),!o&&s&&(o=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[W]=Object.create(null),e instanceof z){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){B(e=""+e);const t=$(this[W],e);return void 0===t?null:this[W][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=K(this),o=0;for(;o1&&void 0!==arguments[1]?arguments[1]:"key+value";const r=Object.keys(e[W]).sort();return r.map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[W][t].join(", ")}:function(t){return[t.toLowerCase(),e[W][t].join(", ")]})}z.prototype.entries=z.prototype[Symbol.iterator],Object.defineProperty(z.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(z.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const V=Symbol("internal");function X(e,t){const r=Object.create(J);return r[V]={target:e,kind:t,index:0},r}const J=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==J)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[V];const t=e.target,r=e.kind,o=e.index,s=K(t,r);return o>=s.length?{value:void 0,done:!0}:(this[V].index=o+1,{value:s[o],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function Z(e){const t=Object.assign({__proto__:null},e[W]),r=$(e[W],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(J,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const Y=Symbol("Response internals"),Q=b.STATUS_CODES;class ee{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};L.call(this,e,t);const r=t.status||200,o=new z(t.headers);if(null!=e&&!o.has("Content-Type")){const t=j(e);t&&o.append("Content-Type",t)}this[Y]={url:t.url,status:r,statusText:t.statusText||Q[r],headers:o,counter:t.counter}}get url(){return this[Y].url||""}get status(){return this[Y].status}get ok(){return this[Y].status>=200&&this[Y].status<300}get redirected(){return this[Y].counter>0}get statusText(){return this[Y].statusText}get headers(){return this[Y].headers}clone(){return new ee(D(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}L.mixIn(ee.prototype),Object.defineProperties(ee.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(ee.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const te=Symbol("Request internals"),re=v.parse,oe=v.format,se="destroy"in y.Readable.prototype;function ne(e){return"object"==typeof e&&"object"==typeof e[te]}class ie{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ne(e)?t=re(e.url):(t=e&&e.href?re(e.href):re(""+e),e={});let o=r.method||e.method||"GET";if(o=o.toUpperCase(),(null!=r.body||ne(e)&&null!==e.body)&&("GET"===o||"HEAD"===o))throw new TypeError("Request with GET/HEAD method cannot have body");let s=null!=r.body?r.body:ne(e)&&null!==e.body?D(e):null;L.call(this,s,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const n=new z(r.headers||e.headers||{});if(null!=s&&!n.has("Content-Type")){const e=j(s);e&&n.append("Content-Type",e)}let i=ne(e)?e.signal:null;if("signal"in r&&(i=r.signal),null!=i&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(i))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[te]={method:o,redirect:r.redirect||e.redirect||"follow",headers:n,parsedURL:t,signal:i},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[te].method}get url(){return oe(this[te].parsedURL)}get headers(){return this[te].headers}get redirect(){return this[te].redirect}get signal(){return this[te].signal}clone(){return new ie(this)}}function ae(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}L.mixIn(ie.prototype),Object.defineProperty(ie.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(ie.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),ae.prototype=Object.create(Error.prototype),ae.prototype.constructor=ae,ae.prototype.name="AbortError";const ce=y.PassThrough,ue=v.resolve;function pe(e,t){if(!pe.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return L.Promise=pe.Promise,new pe.Promise((function(r,o){const s=new ie(e,t),n=function(e){const t=e[te].parsedURL,r=new z(e[te].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof y.Readable&&!se)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=N(e);"number"==typeof t&&(o=String(t))}o&&r.set("Content-Length",o),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let s=e.agent;return"function"==typeof s&&(s=s(t)),r.has("Connection")||s||r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:Z(r),agent:s})}(s),i=("https:"===n.protocol?_:b).request,a=s.signal;let c=null;const u=function(){let e=new ae("The user aborted a request.");o(e),s.body&&s.body instanceof y.Readable&&s.body.destroy(e),c&&c.body&&c.body.emit("error",e)};if(a&&a.aborted)return void u();const p=function(){u(),m()},l=i(n);let d;function m(){l.abort(),a&&a.removeEventListener("abort",p),clearTimeout(d)}a&&a.addEventListener("abort",p),s.timeout&&l.once("socket",(function(e){d=setTimeout((function(){o(new k("network timeout at: "+s.url,"request-timeout")),m()}),s.timeout)})),l.on("error",(function(e){o(new k(`request to ${s.url} failed, reason: ${e.message}`,"system",e)),m()})),l.on("response",(function(e){clearTimeout(d);const t=function(e){const t=new z;for(const r of Object.keys(e))if(!q.test(r))if(Array.isArray(e[r]))for(const o of e[r])M.test(o)||(void 0===t[W][r]?t[W][r]=[o]:t[W][r].push(o));else M.test(e[r])||(t[W][r]=[e[r]]);return t}(e.headers);if(pe.isRedirect(e.statusCode)){const n=t.get("Location"),i=null===n?null:ue(s.url,n);switch(s.redirect){case"error":return o(new k("redirect mode is set to error: "+s.url,"no-redirect")),void m();case"manual":if(null!==i)try{t.set("Location",i)}catch(e){o(e)}break;case"follow":if(null===i)break;if(s.counter>=s.follow)return o(new k("maximum redirect reached at: "+s.url,"max-redirect")),void m();const n={headers:new z(s.headers),follow:s.follow,counter:s.counter+1,agent:s.agent,compress:s.compress,method:s.method,body:s.body,signal:s.signal,timeout:s.timeout};return 303!==e.statusCode&&s.body&&null===N(s)?(o(new k("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void m()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==s.method)||(n.method="GET",n.body=void 0,n.headers.delete("content-length")),r(pe(new ie(i,n))),void m())}}e.once("end",(function(){a&&a.removeEventListener("abort",p)}));let n=e.pipe(new ce);const i={url:s.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:s.size,timeout:s.timeout,counter:s.counter},u=t.get("Content-Encoding");if(!s.compress||"HEAD"===s.method||null===u||204===e.statusCode||304===e.statusCode)return c=new ee(n,i),void r(c);const l={flush:P.Z_SYNC_FLUSH,finishFlush:P.Z_SYNC_FLUSH};if("gzip"==u||"x-gzip"==u)return n=n.pipe(P.createGunzip(l)),c=new ee(n,i),void r(c);if("deflate"!=u&&"x-deflate"!=u){if("br"==u&&"function"==typeof P.createBrotliDecompress)return n=n.pipe(P.createBrotliDecompress()),c=new ee(n,i),void r(c);c=new ee(n,i),r(c)}else{e.pipe(new ce).once("data",(function(e){n=8==(15&e[0])?n.pipe(P.createInflate()):n.pipe(P.createInflateRaw()),c=new ee(n,i),r(c)}))}})),function(e,t){const r=t.body;null===r?e.end():U(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(l,s)}))}pe.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},pe.Promise=global.Promise;var le=pe;class de extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}}var me=r(27);const he=r.n(me)()(e=>console.warn(e));class fe extends Error{constructor(e,t,r){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=t,Object.defineProperty(this,"code",{get:()=>(he(new de("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),t)}),this.headers=r.headers||{};const o=Object.assign({},r.request);r.request.headers.authorization&&(o.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),o.url=o.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=o}}function ge(e){(i(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let t,r,o={};return(e.request&&e.request.fetch||le)(e.url,Object.assign({method:e.method,body:e.body,headers:e.headers,redirect:e.redirect},e.request)).then(s=>{r=s.url,t=s.status;for(const e of s.headers)o[e[0]]=e[1];if(204===t||205===t)return;if("HEAD"===e.method){if(t<400)return;throw new fe(s.statusText,t,{headers:o,request:e})}if(304===t)throw new fe("Not modified",t,{headers:o,request:e});if(t>=400)return s.text().then(r=>{const s=new fe(r,t,{headers:o,request:e});try{let e=JSON.parse(s.message);Object.assign(s,e);let t=e.errors;s.message=s.message+": "+t.map(JSON.stringify).join(", ")}catch(e){}throw s});const n=s.headers.get("content-type");return/application\/json/.test(n)?s.json():!n||/^text\/|charset=utf-8$/.test(n)?s.text():function(e){return e.arrayBuffer()}(s)}).then(e=>({status:t,url:r,headers:o,data:e})).catch(t=>{if(t instanceof fe)throw t;throw new fe(t.message,500,{headers:o,request:e})})}const Ee=function e(t,r){const o=t.defaults(r);return Object.assign((function(t,r){const s=o.merge(t,r);if(!s.request||!s.request.hook)return ge(o.parse(s));const n=(e,t)=>ge(o.parse(o.merge(e,t)));return Object.assign(n,{endpoint:o,defaults:e.bind(null,o)}),s.request.hook(n,s)}),{endpoint:o,defaults:e.bind(null,o)})}(T,{headers:{"user-agent":"octokit-request.js/5.4.5 "+o()}});class we extends Error{constructor(e,t){super(t.data.errors[0].message),Object.assign(this,t.data),this.name="GraphqlError",this.request=e,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const Te=["method","baseUrl","url","headers","request","query","mediaType"];function ye(e,t){const r=e.defaults(t);return Object.assign((e,t)=>function(e,t,r){r=r="string"==typeof t?Object.assign({query:t},r):t;const o=Object.keys(r).reduce((e,t)=>Te.includes(t)?(e[t]=r[t],e):(e.variables||(e.variables={}),e.variables[t]=r[t],e),{});return e(o).then(e=>{if(e.data.errors)throw new we(o,{data:e.data});return e.data.data})}(r,e,t),{defaults:ye.bind(null,r),endpoint:Ee.endpoint})}ye(Ee,{headers:{"user-agent":"octokit-graphql.js/4.5.1 "+o()},method:"POST",url:"/graphql"});async function be(e){const t=3===e.split(/\./).length?"app":/^v\d+\./.test(e)?"installation":"oauth";return{type:"token",token:e,tokenType:t}}async function ve(e,t,r,o){const s=t.endpoint.merge(r,o);return s.headers.authorization=function(e){return 3===e.split(/\./).length?"bearer "+e:"token "+e}(e),t(s)}class _e{constructor(e={}){const t=new s.Collection,r={baseUrl:Ee.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};var n;if(r.headers["user-agent"]=[e.userAgent,"octokit-core.js/2.5.4 "+o()].filter(Boolean).join(" "),e.baseUrl&&(r.baseUrl=e.baseUrl),e.previews&&(r.mediaType.previews=e.previews),e.timeZone&&(r.headers["time-zone"]=e.timeZone),this.request=Ee.defaults(r),this.graphql=(n=this.request,ye(n,{method:"POST",url:"/graphql"})).defaults({...r,baseUrl:r.baseUrl.replace(/\/api\/v3$/,"/api")}),this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log),this.hook=t,e.authStrategy){const r=e.authStrategy(Object.assign({request:this.request},e.auth));t.wrap("request",r.hook),this.auth=r}else if(e.auth){const r=function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if("string"!=typeof e)throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(be.bind(null,e),{hook:ve.bind(null,e)})}(e.auth);t.wrap("request",r.hook),this.auth=r}else this.auth=async()=>({type:"unauthenticated"});this.constructor.plugins.forEach(t=>{Object.assign(this,t(this,e))})}static defaults(e){return class extends(this){constructor(...t){const r=t[0]||{};super(Object.assign({},e,r,r.userAgent&&e.userAgent?{userAgent:`${r.userAgent} ${e.userAgent}`}:null))}}}static plugin(e,...t){var r;e instanceof Array&&console.warn(["Passing an array of plugins to Octokit.plugin() has been deprecated.","Instead of:"," Octokit.plugin([plugin1, plugin2, ...])","Use:"," Octokit.plugin(plugin1, plugin2, ...)"].join("\n"));const o=this.plugins;let s=[...e instanceof Array?e:[e],...t];return(r=class extends(this){}).plugins=o.concat(s.filter(e=>!o.includes(e))),r}}_e.VERSION="2.5.4",_e.plugins=[]}]); \ No newline at end of file +function n(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function i(e){var t,r;return!1!==n(e)&&("function"==typeof(t=e.constructor)&&(!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}function a(e,t,r){if("string"==typeof t){let[e,o]=t.split(" ");r=Object.assign(o?{method:e,url:o}:{url:e},r)}else r=Object.assign({},t);var o;r.headers=(o=r.headers)?Object.keys(o).reduce((e,t)=>(e[t.toLowerCase()]=o[t],e),{}):{};const s=function e(t,r){const o=Object.assign({},t);return Object.keys(r).forEach(s=>{i(r[s])?s in t?o[s]=e(t[s],r[s]):Object.assign(o,{[s]:r[s]}):Object.assign(o,{[s]:r[s]})}),o}(e||{},r);return e&&e.mediaType.previews.length&&(s.mediaType.previews=e.mediaType.previews.filter(e=>!s.mediaType.previews.includes(e)).concat(s.mediaType.previews)),s.mediaType.previews=s.mediaType.previews.map(e=>e.replace(/-preview/,"")),s}const c=/\{[^}]+\}/g;function u(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function p(e,t){return Object.keys(e).filter(e=>!t.includes(e)).reduce((t,r)=>(t[r]=e[r],t),{})}function l(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map((function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e})).join("")}function d(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function m(e,t,r){return t="+"===e||"#"===e?l(t):d(t),r?d(r)+"="+t:t}function h(e){return null!=e}function f(e){return";"===e||"&"===e||"?"===e}function g(e,t){var r=["+","#",".","/",";","?","&"];return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,o,s){if(o){let e="";const s=[];if(-1!==r.indexOf(o.charAt(0))&&(e=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach((function(r){var o=/([^:\*]*)(?::(\d+)|(\*))?/.exec(r);s.push(function(e,t,r,o){var s=e[r],n=[];if(h(s)&&""!==s)if("string"==typeof s||"number"==typeof s||"boolean"==typeof s)s=s.toString(),o&&"*"!==o&&(s=s.substring(0,parseInt(o,10))),n.push(m(t,s,f(t)?r:""));else if("*"===o)Array.isArray(s)?s.filter(h).forEach((function(e){n.push(m(t,e,f(t)?r:""))})):Object.keys(s).forEach((function(e){h(s[e])&&n.push(m(t,s[e],e))}));else{const e=[];Array.isArray(s)?s.filter(h).forEach((function(r){e.push(m(t,r))})):Object.keys(s).forEach((function(r){h(s[r])&&(e.push(d(r)),e.push(m(t,s[r].toString())))})),f(t)?n.push(d(r)+"="+e.join(",")):0!==e.length&&n.push(e.join(","))}else";"===t?h(s)&&n.push(d(r)):""!==s||"&"!==t&&"?"!==t?""===s&&n.push(""):n.push(d(r)+"=");return n}(t,e,o[1],o[2]||o[3]))})),e&&"+"!==e){var n=",";return"?"===e?n="&":"#"!==e&&(n=e),(0!==s.length?e:"")+s.join(n)}return s.join(",")}return l(s)}))}function E(e){let t,r=e.method.toUpperCase(),o=(e.url||"/").replace(/:([a-z]\w+)/g,"{+$1}"),s=Object.assign({},e.headers),n=p(e,["method","baseUrl","url","headers","request","mediaType"]);const i=function(e){const t=e.match(c);return t?t.map(u).reduce((e,t)=>e.concat(t),[]):[]}(o);var a;o=(a=o,{expand:g.bind(null,a)}).expand(n),/^http/.test(o)||(o=e.baseUrl+o);const l=p(n,Object.keys(e).filter(e=>i.includes(e)).concat("baseUrl"));if(!/application\/octet-stream/i.test(s.accept)&&(e.mediaType.format&&(s.accept=s.accept.split(/,/).map(t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,"application/vnd$1$2."+e.mediaType.format)).join(",")),e.mediaType.previews.length)){const t=s.accept.match(/[\w-]+(?=-preview)/g)||[];s.accept=t.concat(e.mediaType.previews).map(t=>`application/vnd.github.${t}-preview${e.mediaType.format?"."+e.mediaType.format:"+json"}`).join(",")}return["GET","HEAD"].includes(r)?o=function(e,t){const r=/\?/.test(e)?"&":"?",o=Object.keys(t);return 0===o.length?e:e+r+o.map(e=>"q"===e?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${e}=${encodeURIComponent(t[e])}`).join("&")}(o,l):"data"in l?t=l.data:Object.keys(l).length?t=l:s["content-length"]=0,s["content-type"]||void 0===t||(s["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(r)&&void 0===t&&(t=""),Object.assign({method:r,url:o,headers:s},void 0!==t?{body:t}:null,e.request?{request:e.request}:null)}function w(e,t,r){return E(a(e,t,r))}const T=function e(t,r){const o=a(t,r),s=w.bind(null,o);return Object.assign(s,{DEFAULTS:o,defaults:e.bind(null,o),merge:a.bind(null,o),parse:E})}(null,{method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":"octokit-endpoint.js/6.0.3 "+o()},mediaType:{format:"",previews:[]}});var y=r(1),b=r(8),v=r(6),_=r(10),P=r(2);const O=y.Readable,R=Symbol("buffer"),S=Symbol("type");class A{constructor(){this[S]="";const e=arguments[0],t=arguments[1],r=[];let o=0;if(e){const t=e,s=Number(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{},o=r.size;let s=void 0===o?0:o;var n=r.timeout;let i=void 0===n?0:n;null==e?e=null:F(e)?e=Buffer.from(e.toString()):U(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof y||(e=Buffer.from(String(e)))),this[G]={body:e,disturbed:!1,error:null},this.size=s,this.timeout=i,e instanceof y&&e.on("error",(function(e){const r="AbortError"===e.name?e:new k(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[G].error=r}))}function x(){var e=this;if(this[G].disturbed)return L.Promise.reject(new TypeError("body used already for: "+this.url));if(this[G].disturbed=!0,this[G].error)return L.Promise.reject(this[G].error);let t=this.body;if(null===t)return L.Promise.resolve(Buffer.alloc(0));if(U(t)&&(t=t.stream()),Buffer.isBuffer(t))return L.Promise.resolve(t);if(!(t instanceof y))return L.Promise.resolve(Buffer.alloc(0));let r=[],o=0,s=!1;return new L.Promise((function(n,i){let a;e.timeout&&(a=setTimeout((function(){s=!0,i(new k(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(s=!0,i(t)):i(new k(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!s&&null!==t){if(e.size&&o+t.length>e.size)return s=!0,void i(new k(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,r.push(t)}})),t.on("end",(function(){if(!s){clearTimeout(a);try{n(Buffer.concat(r,o))}catch(t){i(new k(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function F(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function U(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function D(e){let t,r,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof y&&"function"!=typeof o.getBoundary&&(t=new I,r=new I,o.pipe(t),o.pipe(r),e[G].body=t,o=r),o}function j(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":F(e)?"application/x-www-form-urlencoded;charset=UTF-8":U(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?"multipart/form-data;boundary="+e.getBoundary():e instanceof y?null:"text/plain;charset=UTF-8"}function N(e){const t=e.body;return null===t?0:U(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}L.prototype={get body(){return this[G].body},get bodyUsed(){return this[G].disturbed},arrayBuffer(){return x.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return x.call(this).then((function(t){return Object.assign(new A([],{type:e.toLowerCase()}),{[R]:t})}))},json(){var e=this;return x.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return L.Promise.reject(new k(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return x.call(this).then((function(e){return e.toString()}))},buffer(){return x.call(this)},textConverted(){var e=this;return x.call(this).then((function(t){return function(e,t){if("function"!=typeof C)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let o,s,n="utf-8";r&&(o=/charset=([^;]*)/i.exec(r));s=e.slice(0,1024).toString(),!o&&s&&(o=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[W]=Object.create(null),e instanceof z){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){B(e=""+e);const t=$(this[W],e);return void 0===t?null:this[W][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=K(this),o=0;for(;o1&&void 0!==arguments[1]?arguments[1]:"key+value";const r=Object.keys(e[W]).sort();return r.map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[W][t].join(", ")}:function(t){return[t.toLowerCase(),e[W][t].join(", ")]})}z.prototype.entries=z.prototype[Symbol.iterator],Object.defineProperty(z.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(z.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const V=Symbol("internal");function X(e,t){const r=Object.create(J);return r[V]={target:e,kind:t,index:0},r}const J=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==J)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[V];const t=e.target,r=e.kind,o=e.index,s=K(t,r);return o>=s.length?{value:void 0,done:!0}:(this[V].index=o+1,{value:s[o],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function Z(e){const t=Object.assign({__proto__:null},e[W]),r=$(e[W],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(J,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const Y=Symbol("Response internals"),Q=b.STATUS_CODES;class ee{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};L.call(this,e,t);const r=t.status||200,o=new z(t.headers);if(null!=e&&!o.has("Content-Type")){const t=j(e);t&&o.append("Content-Type",t)}this[Y]={url:t.url,status:r,statusText:t.statusText||Q[r],headers:o,counter:t.counter}}get url(){return this[Y].url||""}get status(){return this[Y].status}get ok(){return this[Y].status>=200&&this[Y].status<300}get redirected(){return this[Y].counter>0}get statusText(){return this[Y].statusText}get headers(){return this[Y].headers}clone(){return new ee(D(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}L.mixIn(ee.prototype),Object.defineProperties(ee.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(ee.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const te=Symbol("Request internals"),re=v.parse,oe=v.format,se="destroy"in y.Readable.prototype;function ne(e){return"object"==typeof e&&"object"==typeof e[te]}class ie{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ne(e)?t=re(e.url):(t=e&&e.href?re(e.href):re(""+e),e={});let o=r.method||e.method||"GET";if(o=o.toUpperCase(),(null!=r.body||ne(e)&&null!==e.body)&&("GET"===o||"HEAD"===o))throw new TypeError("Request with GET/HEAD method cannot have body");let s=null!=r.body?r.body:ne(e)&&null!==e.body?D(e):null;L.call(this,s,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const n=new z(r.headers||e.headers||{});if(null!=s&&!n.has("Content-Type")){const e=j(s);e&&n.append("Content-Type",e)}let i=ne(e)?e.signal:null;if("signal"in r&&(i=r.signal),null!=i&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(i))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[te]={method:o,redirect:r.redirect||e.redirect||"follow",headers:n,parsedURL:t,signal:i},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[te].method}get url(){return oe(this[te].parsedURL)}get headers(){return this[te].headers}get redirect(){return this[te].redirect}get signal(){return this[te].signal}clone(){return new ie(this)}}function ae(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}L.mixIn(ie.prototype),Object.defineProperty(ie.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(ie.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),ae.prototype=Object.create(Error.prototype),ae.prototype.constructor=ae,ae.prototype.name="AbortError";const ce=y.PassThrough,ue=v.resolve;function pe(e,t){if(!pe.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return L.Promise=pe.Promise,new pe.Promise((function(r,o){const s=new ie(e,t),n=function(e){const t=e[te].parsedURL,r=new z(e[te].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof y.Readable&&!se)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=N(e);"number"==typeof t&&(o=String(t))}o&&r.set("Content-Length",o),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let s=e.agent;return"function"==typeof s&&(s=s(t)),r.has("Connection")||s||r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:Z(r),agent:s})}(s),i=("https:"===n.protocol?_:b).request,a=s.signal;let c=null;const u=function(){let e=new ae("The user aborted a request.");o(e),s.body&&s.body instanceof y.Readable&&s.body.destroy(e),c&&c.body&&c.body.emit("error",e)};if(a&&a.aborted)return void u();const p=function(){u(),m()},l=i(n);let d;function m(){l.abort(),a&&a.removeEventListener("abort",p),clearTimeout(d)}a&&a.addEventListener("abort",p),s.timeout&&l.once("socket",(function(e){d=setTimeout((function(){o(new k("network timeout at: "+s.url,"request-timeout")),m()}),s.timeout)})),l.on("error",(function(e){o(new k(`request to ${s.url} failed, reason: ${e.message}`,"system",e)),m()})),l.on("response",(function(e){clearTimeout(d);const t=function(e){const t=new z;for(const r of Object.keys(e))if(!q.test(r))if(Array.isArray(e[r]))for(const o of e[r])M.test(o)||(void 0===t[W][r]?t[W][r]=[o]:t[W][r].push(o));else M.test(e[r])||(t[W][r]=[e[r]]);return t}(e.headers);if(pe.isRedirect(e.statusCode)){const n=t.get("Location"),i=null===n?null:ue(s.url,n);switch(s.redirect){case"error":return o(new k("uri requested responds with a redirect, redirect mode is set to error: "+s.url,"no-redirect")),void m();case"manual":if(null!==i)try{t.set("Location",i)}catch(e){o(e)}break;case"follow":if(null===i)break;if(s.counter>=s.follow)return o(new k("maximum redirect reached at: "+s.url,"max-redirect")),void m();const n={headers:new z(s.headers),follow:s.follow,counter:s.counter+1,agent:s.agent,compress:s.compress,method:s.method,body:s.body,signal:s.signal,timeout:s.timeout,size:s.size};return 303!==e.statusCode&&s.body&&null===N(s)?(o(new k("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void m()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==s.method)||(n.method="GET",n.body=void 0,n.headers.delete("content-length")),r(pe(new ie(i,n))),void m())}}e.once("end",(function(){a&&a.removeEventListener("abort",p)}));let n=e.pipe(new ce);const i={url:s.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:s.size,timeout:s.timeout,counter:s.counter},u=t.get("Content-Encoding");if(!s.compress||"HEAD"===s.method||null===u||204===e.statusCode||304===e.statusCode)return c=new ee(n,i),void r(c);const l={flush:P.Z_SYNC_FLUSH,finishFlush:P.Z_SYNC_FLUSH};if("gzip"==u||"x-gzip"==u)return n=n.pipe(P.createGunzip(l)),c=new ee(n,i),void r(c);if("deflate"!=u&&"x-deflate"!=u){if("br"==u&&"function"==typeof P.createBrotliDecompress)return n=n.pipe(P.createBrotliDecompress()),c=new ee(n,i),void r(c);c=new ee(n,i),r(c)}else{e.pipe(new ce).once("data",(function(e){n=8==(15&e[0])?n.pipe(P.createInflate()):n.pipe(P.createInflateRaw()),c=new ee(n,i),r(c)}))}})),function(e,t){const r=t.body;null===r?e.end():U(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(l,s)}))}pe.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},pe.Promise=global.Promise;var le=pe;class de extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}}var me=r(27);const he=r.n(me)()(e=>console.warn(e));class fe extends Error{constructor(e,t,r){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=t,Object.defineProperty(this,"code",{get:()=>(he(new de("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),t)}),this.headers=r.headers||{};const o=Object.assign({},r.request);r.request.headers.authorization&&(o.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),o.url=o.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=o}}function ge(e){(i(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let t,r,o={};return(e.request&&e.request.fetch||le)(e.url,Object.assign({method:e.method,body:e.body,headers:e.headers,redirect:e.redirect},e.request)).then(s=>{r=s.url,t=s.status;for(const e of s.headers)o[e[0]]=e[1];if(204===t||205===t)return;if("HEAD"===e.method){if(t<400)return;throw new fe(s.statusText,t,{headers:o,request:e})}if(304===t)throw new fe("Not modified",t,{headers:o,request:e});if(t>=400)return s.text().then(r=>{const s=new fe(r,t,{headers:o,request:e});try{let e=JSON.parse(s.message);Object.assign(s,e);let t=e.errors;s.message=s.message+": "+t.map(JSON.stringify).join(", ")}catch(e){}throw s});const n=s.headers.get("content-type");return/application\/json/.test(n)?s.json():!n||/^text\/|charset=utf-8$/.test(n)?s.text():function(e){return e.arrayBuffer()}(s)}).then(e=>({status:t,url:r,headers:o,data:e})).catch(t=>{if(t instanceof fe)throw t;throw new fe(t.message,500,{headers:o,request:e})})}const Ee=function e(t,r){const o=t.defaults(r);return Object.assign((function(t,r){const s=o.merge(t,r);if(!s.request||!s.request.hook)return ge(o.parse(s));const n=(e,t)=>ge(o.parse(o.merge(e,t)));return Object.assign(n,{endpoint:o,defaults:e.bind(null,o)}),s.request.hook(n,s)}),{endpoint:o,defaults:e.bind(null,o)})}(T,{headers:{"user-agent":"octokit-request.js/5.4.5 "+o()}});class we extends Error{constructor(e,t){super(t.data.errors[0].message),Object.assign(this,t.data),this.name="GraphqlError",this.request=e,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const Te=["method","baseUrl","url","headers","request","query","mediaType"];function ye(e,t){const r=e.defaults(t);return Object.assign((e,t)=>function(e,t,r){r=r="string"==typeof t?Object.assign({query:t},r):t;const o=Object.keys(r).reduce((e,t)=>Te.includes(t)?(e[t]=r[t],e):(e.variables||(e.variables={}),e.variables[t]=r[t],e),{});return e(o).then(e=>{if(e.data.errors)throw new we(o,{data:e.data});return e.data.data})}(r,e,t),{defaults:ye.bind(null,r),endpoint:Ee.endpoint})}ye(Ee,{headers:{"user-agent":"octokit-graphql.js/4.5.1 "+o()},method:"POST",url:"/graphql"});async function be(e){const t=3===e.split(/\./).length?"app":/^v\d+\./.test(e)?"installation":"oauth";return{type:"token",token:e,tokenType:t}}async function ve(e,t,r,o){const s=t.endpoint.merge(r,o);return s.headers.authorization=function(e){return 3===e.split(/\./).length?"bearer "+e:"token "+e}(e),t(s)}class _e{constructor(e={}){const t=new s.Collection,r={baseUrl:Ee.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};var n;if(r.headers["user-agent"]=[e.userAgent,"octokit-core.js/2.5.4 "+o()].filter(Boolean).join(" "),e.baseUrl&&(r.baseUrl=e.baseUrl),e.previews&&(r.mediaType.previews=e.previews),e.timeZone&&(r.headers["time-zone"]=e.timeZone),this.request=Ee.defaults(r),this.graphql=(n=this.request,ye(n,{method:"POST",url:"/graphql"})).defaults({...r,baseUrl:r.baseUrl.replace(/\/api\/v3$/,"/api")}),this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log),this.hook=t,e.authStrategy){const r=e.authStrategy(Object.assign({request:this.request},e.auth));t.wrap("request",r.hook),this.auth=r}else if(e.auth){const r=function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if("string"!=typeof e)throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(be.bind(null,e),{hook:ve.bind(null,e)})}(e.auth);t.wrap("request",r.hook),this.auth=r}else this.auth=async()=>({type:"unauthenticated"});this.constructor.plugins.forEach(t=>{Object.assign(this,t(this,e))})}static defaults(e){return class extends(this){constructor(...t){const r=t[0]||{};super(Object.assign({},e,r,r.userAgent&&e.userAgent?{userAgent:`${r.userAgent} ${e.userAgent}`}:null))}}}static plugin(e,...t){var r;e instanceof Array&&console.warn(["Passing an array of plugins to Octokit.plugin() has been deprecated.","Instead of:"," Octokit.plugin([plugin1, plugin2, ...])","Use:"," Octokit.plugin(plugin1, plugin2, ...)"].join("\n"));const o=this.plugins;let s=[...e instanceof Array?e:[e],...t];return(r=class extends(this){}).plugins=o.concat(s.filter(e=>!o.includes(e))),r}}_e.VERSION="2.5.4",_e.plugins=[]}]); \ No newline at end of file