UNPKG

@ibm/ibmi-ci

Version:

IBM i CLI tool

3 lines 690 kB
#! /usr/bin/env node
(()=>{var e={9023:(e,t,r)=>{"use strict";var s,n=Object.create,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of a(t))l.call(e,n)||n===r||i(e,n,{get:()=>t[n],enumerable:!(s=o(t,n))||s.enumerable});return e},h={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(h,{createAppAuth:()=>R,createOAuthUserAuth:()=>O.createOAuthUserAuth}),e.exports=(s=h,u(i({},"__esModule",{value:!0}),s));var d=r(350),p=r(1697),f=r(7349),g=r(2327),m=(((e,t,r)=>{r=null!=e?n(c(e)):{},u(e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)})(r(7349)),r(1635));async function _({appId:e,privateKey:t,timeDifference:r}){try{const s=await(0,m.githubAppJwt)({id:+e,privateKey:t,now:r&&Math.floor(Date.now()/1e3)+r});return{type:"app",token:s.token,appId:s.appId,expiresAt:new Date(1e3*s.expiration).toISOString()}}catch(e){throw"-----BEGIN RSA PRIVATE KEY-----"===t?new Error("The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'"):e}}var A=r(3530);function E({installationId:e,permissions:t={},repositoryIds:r=[],repositoryNames:s=[]}){const n=Object.keys(t).sort().map((e=>"read"===t[e]?e:`${e}!`)).join(",");return[e,r.sort().join(","),s.join(","),n].filter(Boolean).join("|")}function y({installationId:e,token:t,createdAt:r,expiresAt:s,repositorySelection:n,permissions:i,repositoryIds:o,repositoryNames:a,singleFileName:c}){return Object.assign({type:"token",tokenType:"installation",token:t,installationId:e,permissions:i,createdAt:r,expiresAt:s,repositorySelection:n},o?{repositoryIds:o}:null,a?{repositoryNames:a}:null,c?{singleFileName:c}:null)}async function b(e,t,r){const s=Number(t.installationId||e.installationId);if(!s)throw new Error("[@octokit/auth-app] installationId option is required for installation authentication.");if(t.factory){const{type:r,factory:s,oauthApp:n,...i}={...e,...t};return s(i)}const n=Object.assign({installationId:s},t);if(!t.refresh){const t=await async function(e,t){const r=E(t),s=await e.get(r);if(!s)return;const[n,i,o,a,c,l]=s.split("|");return{token:n,createdAt:i,expiresAt:o,permissions:t.permissions||c.split(/,/).reduce(((e,t)=>(/!$/.test(t)?e[t.slice(0,-1)]="write":e[t]="read",e)),{}),repositoryIds:t.repositoryIds,repositoryNames:t.repositoryNames,singleFileName:l,repositorySelection:a}}(e.cache,n);if(t){const{token:e,createdAt:r,expiresAt:n,permissions:i,repositoryIds:o,repositoryNames:a,singleFileName:c,repositorySelection:l}=t;return y({installationId:s,token:e,createdAt:r,expiresAt:n,permissions:i,repositorySelection:l,repositoryIds:o,repositoryNames:a,singleFileName:c})}}const i=await _(e),o=r||e.request,{data:{token:a,expires_at:c,repositories:l,permissions:u,repository_selection:h,single_file:d}}=await o("POST /app/installations/{installation_id}/access_tokens",{installation_id:s,repository_ids:t.repositoryIds,repositories:t.repositoryNames,permissions:t.permissions,mediaType:{previews:["machine-man"]},headers:{authorization:`bearer ${i.token}`}}),p=u||{},f=h||"all",g=l?l.map((e=>e.id)):void 0,m=l?l.map((e=>e.name)):void 0,A=(new Date).toISOString();return await async function(e,t,r){const s=E(t),n=t.permissions?"":Object.keys(r.permissions).map((e=>`${e}${"write"===r.permissions[e]?"!":""}`)).join(","),i=[r.token,r.createdAt,r.expiresAt,r.repositorySelection,n,r.singleFileName].join("|");await e.set(s,i)}(e.cache,n,{token:a,createdAt:A,expiresAt:c,repositorySelection:f,permissions:p,repositoryIds:g,repositoryNames:m,singleFileName:d}),y({installationId:s,token:a,createdAt:A,expiresAt:c,repositorySelection:f,permissions:p,repositoryIds:g,repositoryNames:m,singleFileName:d})}async function w(e,t){switch(t.type){case"app":return _(e);case"oauth":e.log.warn(new g.Deprecation('[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead'));case"oauth-app":return e.oauthApp({type:"oauth-app"});case"installation":return b(e,{...t,type:"installation"});case"oauth-user":return e.oauthApp(t);default:throw new Error(`Invalid auth type: ${t.type}`)}}var v=r(7293);r(9891);var S=function(e){const t=`^(?:${["/app","/app/hook/config","/app/hook/deliveries","/app/hook/deliveries/{delivery_id}","/app/hook/deliveries/{delivery_id}/attempts","/app/installations","/app/installations/{installation_id}","/app/installations/{installation_id}/access_tokens","/app/installations/{installation_id}/suspended","/marketplace_listing/accounts/{account_id}","/marketplace_listing/plan","/marketplace_listing/plans","/marketplace_listing/plans/{plan_id}/accounts","/marketplace_listing/stubbed/accounts/{account_id}","/marketplace_listing/stubbed/plan","/marketplace_listing/stubbed/plans","/marketplace_listing/stubbed/plans/{plan_id}/accounts","/orgs/{org}/installation","/repos/{owner}/{repo}/installation","/users/{username}/installation"].map((e=>e.split("/").map((e=>e.startsWith("{")?"(?:.+?)":e)).join("/"))).map((e=>`(?:${e})`)).join("|")})$`;return new RegExp(t,"i")}(),k=5e3;async function I(e,t,r,s){const n=t.endpoint.merge(r,s),i=n.url;if(/\/login\/oauth\/access_token$/.test(i))return t(n);if(function(e){return!!e&&S.test(e.split("?")[0])}(i.replace(t.endpoint.DEFAULTS.baseUrl,""))){const{token:r}=await _(e);let s;n.headers.authorization=`bearer ${r}`;try{s=await t(n)}catch(r){if(function(e){return!(e.message.match(/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/)||e.message.match(/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/))}(r))throw r;if(void 0===r.response.headers.date)throw r;const s=Math.floor((Date.parse(r.response.headers.date)-Date.parse((new Date).toString()))/1e3);e.log.warn(r.message),e.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${s} seconds. Retrying request with the difference accounted for.`);const{token:i}=await _({...e,timeDifference:s});return n.headers.authorization=`bearer ${i}`,t(n)}return s}if((0,v.requiresBasicAuth)(i)){const r=await e.oauthApp({type:"oauth-app"});return n.headers.authorization=r.headers.authorization,t(n)}const{token:o,createdAt:a}=await b(e,{},t);return n.headers.authorization=`token ${o}`,T(e,t,n,a)}async function T(e,t,r,s,n=0){const i=+new Date-+new Date(s);try{return await t(r)}catch(o){if(401!==o.status)throw o;if(i>=k)throw n>0&&(o.message=`After ${n} retries within ${i/1e3}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`),o;const a=1e3*++n;return e.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${n}, wait: ${a/1e3}s)`),await new Promise((e=>setTimeout(e,a))),T(e,t,r,s,n)}}var C="6.0.1",O=r(7293);function R(e){if(!e.appId)throw new Error("[@octokit/auth-app] appId option is required");if(!Number.isFinite(+e.appId))throw new Error("[@octokit/auth-app] appId option must be a number or numeric string");if(!e.privateKey)throw new Error("[@octokit/auth-app] privateKey option is required");if("installationId"in e&&!e.installationId)throw new Error("[@octokit/auth-app] installationId is set to a falsy value");const t=Object.assign({warn:console.warn.bind(console)},e.log),r=e.request||p.request.defaults({headers:{"user-agent":`octokit-auth-app.js/${C} ${(0,d.getUserAgent)()}`}}),s=Object.assign({request:r,cache:new A.LRUCache({max:15e3,ttl:354e4})},e,e.installationId?{installationId:Number(e.installationId)}:{},{log:t,oauthApp:(0,f.createOAuthAppAuth)({clientType:"github-app",clientId:e.clientId||"",clientSecret:e.clientSecret||"",request:r})});return Object.assign(w.bind(null,s),{hook:I.bind(null,s)})}},7349:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createOAuthAppAuth:()=>d,createOAuthUserAuth:()=>a.createOAuthUserAuth});var s=r(350),n=r(1697),i=r(6409),o=r.n(i),a=r(7293);async function c(e,t){if("oauth-app"===t.type)return{type:"oauth-app",clientId:e.clientId,clientSecret:e.clientSecret,clientType:e.clientType,headers:{authorization:`basic ${o()(`${e.clientId}:${e.clientSecret}`)}`}};if("factory"in t){const{type:r,...s}={...t,...e};return t.factory(s)}const r={clientId:e.clientId,clientSecret:e.clientSecret,request:e.request,...t};return(e.clientType,await(0,a.createOAuthUserAuth)({...r,clientType:e.clientType}))()}var l=r(960);async function u(e,t,r,s){let n=t.endpoint.merge(r,s);if(/\/login\/(oauth\/access_token|device\/code)$/.test(n.url))return t(n);if("github-app"===e.clientType&&!(0,l.X)(n.url))throw new Error(`[@octokit/auth-oauth-app] GitHub Apps cannot use their client ID/secret for basic authentication for endpoints other than "/applications/{client_id}/**". "${n.method} ${n.url}" is not supported.`);const i=o()(`${e.clientId}:${e.clientSecret}`);n.headers.authorization=`basic ${i}`;try{return await t(n)}catch(e){if(401!==e.status)throw e;throw e.message=`[@octokit/auth-oauth-app] "${n.method} ${n.url}" does not support clientId/clientSecret basic authentication.`,e}}const h="7.0.1";function d(e){const t=Object.assign({request:n.request.defaults({headers:{"user-agent":`octokit-auth-oauth-app.js/${h} ${(0,s.getUserAgent)()}`}}),clientType:"oauth-app"},e);return Object.assign(c.bind(null,t),{hook:u.bind(null,t)})}},7293:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createOAuthUserAuth:()=>I,requiresBasicAuth:()=>S.X});var s=r(350),n=r(1697);const i="4.0.1";var o=r(1877),a=r(2586);async function c(e,t){const r=function(e,t){if(!0===t.refresh)return!1;if(!e.authentication)return!1;if("github-app"===e.clientType)return e.authentication;const r=e.authentication;return("scopes"in t&&t.scopes||e.scopes).join(" ")===r.scopes.join(" ")&&r}(e,t.auth);if(r)return r;const{data:s}=await(0,o.T)({clientType:e.clientType,clientId:e.clientId,request:t.request||e.request,scopes:t.auth.scopes||e.scopes});await e.onVerification(s);const n=await u(t.request||e.request,e.clientId,e.clientType,s);return e.authentication=n,n}async function l(e){await new Promise((t=>setTimeout(t,1e3*e)))}async function u(e,t,r,s){try{const n={clientId:t,request:e,code:s.device_code},{authentication:i}="oauth-app"===r?await(0,a.i)({...n,clientType:"oauth-app"}):await(0,a.i)({...n,clientType:"github-app"});return{type:"token",tokenType:"oauth",...i}}catch(n){if(!n.response)throw n;const i=n.response.data.error;if("authorization_pending"===i)return await l(s.interval),u(e,t,r,s);if("slow_down"===i)return await l(s.interval+5),u(e,t,r,s);throw n}}async function h(e,t){return c(e,{auth:t})}async function d(e,t,r,s){let n=t.endpoint.merge(r,s);if(/\/login\/(oauth\/access_token|device\/code)$/.test(n.url))return t(n);const{token:i}=await c(e,{request:t,auth:{type:"oauth"}});return n.headers.authorization=`token ${i}`,t(n)}const p="6.0.1";function f(e){const t=e.request||n.request.defaults({headers:{"user-agent":`octokit-auth-oauth-device.js/${p} ${(0,s.getUserAgent)()}`}}),{request:r=t,...i}=e,o="github-app"===e.clientType?{...i,clientType:"github-app",request:r}:{...i,clientType:"oauth-app",request:r,scopes:e.scopes||[]};if(!e.clientId)throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');if(!e.onVerification)throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');return Object.assign(h.bind(null,o),{hook:d.bind(null,o)})}var g=r(7930);var m=r(6833),_=r(3173),A=r(9786),E=r(3761),y=r(7982);async function b(e,t={}){if(e.authentication||(e.authentication=(e.clientType,await async function(e){if("code"in e.strategyOptions){const{authentication:t}=await(0,g.y)({clientId:e.clientId,clientSecret:e.clientSecret,clientType:e.clientType,onTokenCreated:e.onTokenCreated,...e.strategyOptions,request:e.request});return{type:"token",tokenType:"oauth",...t}}if("onVerification"in e.strategyOptions){const t=f({clientType:e.clientType,clientId:e.clientId,onTokenCreated:e.onTokenCreated,...e.strategyOptions,request:e.request}),r=await t({type:"oauth"});return{clientSecret:e.clientSecret,...r}}if("token"in e.strategyOptions)return{type:"token",tokenType:"oauth",clientId:e.clientId,clientSecret:e.clientSecret,clientType:e.clientType,onTokenCreated:e.onTokenCreated,...e.strategyOptions};throw new Error("[@octokit/auth-oauth-user] Invalid strategy options")}(e))),e.authentication.invalid)throw new Error("[@octokit/auth-oauth-user] Token is invalid");const r=e.authentication;if("expiresAt"in r&&("refresh"===t.type||new Date(r.expiresAt)<new Date)){const{authentication:t}=await(0,m.g)({clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:r.refreshToken,request:e.request});e.authentication={tokenType:"oauth",type:"token",...t}}if("refresh"===t.type){if("oauth-app"===e.clientType)throw new Error("[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens");if(!r.hasOwnProperty("expiresAt"))throw new Error("[@octokit/auth-oauth-user] Refresh token missing");await(e.onTokenCreated?.(e.authentication,{type:t.type}))}if("check"===t.type||"reset"===t.type){const r="check"===t.type?_.a:A.E;try{const{authentication:s}=await r({clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:e.authentication.token,request:e.request});return e.authentication={tokenType:"oauth",type:"token",...s},"reset"===t.type&&await(e.onTokenCreated?.(e.authentication,{type:t.type})),e.authentication}catch(t){throw 404===t.status&&(t.message="[@octokit/auth-oauth-user] Token is invalid",e.authentication.invalid=!0),t}}if("delete"===t.type||"deleteAuthorization"===t.type){const r="delete"===t.type?E.p:y.s;try{await r({clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:e.authentication.token,request:e.request})}catch(e){if(404!==e.status)throw e}return e.authentication.invalid=!0,e.authentication}return e.authentication}var w=r(6409),v=r.n(w),S=r(960);async function k(e,t,r,s={}){const n=t.endpoint.merge(r,s);if(/\/login\/(oauth\/access_token|device\/code)$/.test(n.url))return t(n);if((0,S.X)(n.url)){const r=v()(`${e.clientId}:${e.clientSecret}`);return n.headers.authorization=`basic ${r}`,t(n)}const{token:i}=(e.clientType,await b({...e,request:t}));return n.headers.authorization="token "+i,t(n)}function I({clientId:e,clientSecret:t,clientType:r="oauth-app",request:o=n.request.defaults({headers:{"user-agent":`octokit-auth-oauth-app.js/${i} ${(0,s.getUserAgent)()}`}}),onTokenCreated:a,...c}){const l=Object.assign({clientType:r,clientId:e,clientSecret:t,onTokenCreated:a,strategyOptions:c,request:o});return Object.assign(b.bind(null,l),{hook:k.bind(null,l)})}I.VERSION=i},960:(e,t,r)=>{"use strict";r.d(t,{X:()=>n});const s=/\/applications\/[^/]+\/(token|grant)s?/;function n(e){return e&&s.test(e)}},5643:(e,t,r)=>{"use strict";async function s(e){return{type:"unauthenticated",reason:e}}r.r(t),r.d(t,{createUnauthenticatedAuth:()=>o});var n=/\babuse\b/i;async function i(e,t,r,s){const i=t.endpoint.merge(r,s);return t(i).catch((t=>{if(404===t.status)throw t.message=`Not found. May be due to lack of authentication. Reason: ${e}`,t;if(function(e){return 403===e.status&&!!e.response&&"0"===e.response.headers["x-ratelimit-remaining"]}(t))throw t.message=`API rate limit exceeded. This maybe caused by the lack of authentication. Reason: ${e}`,t;if(function(e){return 403===e.status&&n.test(e.message)}(t))throw t.message=`You have triggered an abuse detection mechanism. This maybe caused by the lack of authentication. Reason: ${e}`,t;if(401===t.status)throw t.message=`Unauthorized. "${i.method} ${i.url}" failed most likely due to lack of authentication. Reason: ${e}`,t;throw t.status>=400&&t.status<500&&(t.message=t.message.replace(/\.?$/,`. May be caused by lack of authentication (${e}).`)),t}))}var o=function(e){if(!e||!e.reason)throw new Error("[@octokit/auth-unauthenticated] No reason passed to createUnauthenticatedAuth");return Object.assign(s.bind(null,e.reason),{hook:i.bind(null,e.reason)})}},1105:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Octokit:()=>w});var s=r(350),n=r(5186),i=r(1697),o=class extends Error{constructor(e,t,r){super("Request failed due to following response errors:\n"+r.errors.map((e=>` - ${e.message}`)).join("\n")),this.request=e,this.headers=t,this.response=r,this.name="GraphqlResponseError",this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},a=["method","baseUrl","url","headers","request","query","mediaType"],c=["query","method","url"],l=/\/api\/v3\/?$/;function u(e,t){const r=e.defaults(t);return Object.assign(((e,t)=>function(e,t,r){if(r){if("string"==typeof t&&"query"in r)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(const e in r)if(c.includes(e))return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}const s="string"==typeof t?Object.assign({query:t},r):t,n=Object.keys(s).reduce(((e,t)=>a.includes(t)?(e[t]=s[t],e):(e.variables||(e.variables={}),e.variables[t]=s[t],e)),{}),i=s.baseUrl||e.endpoint.DEFAULTS.baseUrl;return l.test(i)&&(n.url=i.replace(l,"/api/graphql")),e(n).then((e=>{if(e.data.errors){const t={};for(const r of Object.keys(e.headers))t[r]=e.headers[r];throw new o(n,t,e.data)}return e.data.data}))}(r,e,t)),{defaults:u.bind(null,r),endpoint:r.endpoint})}u(i.request,{headers:{"user-agent":`octokit-graphql.js/7.0.2 ${(0,s.getUserAgent)()}`},method:"POST",url:"/graphql"});const h=/^v1\./,d=/^ghs_/,p=/^ghu_/;async function f(e){const t=3===e.split(/\./).length,r=h.test(e)||d.test(e),s=p.test(e);return{type:"token",token:e,tokenType:t?"app":r?"installation":s?"user-to-server":"oauth"}}async function g(e,t,r,s){const n=t.endpoint.merge(r,s);return n.headers.authorization=function(e){return 3===e.split(/\./).length?`bearer ${e}`:`token ${e}`}(e),t(n)}const m=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(f.bind(null,e),{hook:g.bind(null,e)})};var _="5.0.2",A=()=>{},E=console.warn.bind(console),y=console.error.bind(console),b=`octokit-core.js/${_} ${(0,s.getUserAgent)()}`,w=class{static{this.VERSION=_}static defaults(e){return class extends(this){constructor(...t){const r=t[0]||{};super("function"!=typeof e?Object.assign({},e,r,r.userAgent&&e.userAgent?{userAgent:`${r.userAgent} ${e.userAgent}`}:null):e(r))}}}static{this.plugins=[]}static plugin(...e){const t=this.plugins;return class extends(this){static{this.plugins=t.concat(e.filter((e=>!t.includes(e))))}}}constructor(e={}){const t=new n.Collection,r={baseUrl:i.request.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};var s;if(r.headers["user-agent"]=e.userAgent?`${e.userAgent} ${b}`:b,e.baseUrl&&(r.baseUrl=e.baseUrl),e.previews&&(r.mediaType.previews=e.previews),e.timeZone&&(r.headers["time-zone"]=e.timeZone),this.request=i.request.defaults(r),this.graphql=(s=this.request,u(s,{method:"POST",url:"/graphql"})).defaults(r),this.log=Object.assign({debug:A,info:A,warn:E,error:y},e.log),this.hook=t,e.authStrategy){const{authStrategy:r,...s}=e,n=r(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},e.auth));t.wrap("request",n.hook),this.auth=n}else if(e.auth){const r=m(e.auth);t.wrap("request",r.hook),this.auth=r}else this.auth=async()=>({type:"unauthenticated"});const o=this.constructor;for(let t=0;t<o.plugins.length;++t)Object.assign(this,o.plugins[t](this,e))}}},7785:(e,t,r)=>{"use strict";var s,n=Object.create,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of a(t))l.call(e,n)||n===r||i(e,n,{get:()=>t[n],enumerable:!(s=o(t,n))||s.enumerable});return e},h=(e,t,r)=>(r=null!=e?n(c(e)):{},u(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)),d={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(d,{OAuthApp:()=>z,createAWSLambdaAPIGatewayV2Handler:()=>Y,createNodeMiddleware:()=>K,createWebWorkerHandler:()=>W,handleRequest:()=>$,sendNodeResponse:()=>j,unknownRouteResponse:()=>q}),e.exports=(s=d,u(i({},"__esModule",{value:!0}),s));var p=r(7349),f="6.0.0";function g(e,t,r){if(Array.isArray(t))for(const s of t)g(e,s,r);else e.eventHandlers[t]||(e.eventHandlers[t]=[]),e.eventHandlers[t].push(r)}var m=r(1105),_=r(350),A=m.Octokit.defaults({userAgent:`octokit-oauth-app.js/${f} ${(0,_.getUserAgent)()}`}),E=r(7293);async function y(e,t){const{name:r,action:s}=t;if(e.eventHandlers[`${r}.${s}`])for(const n of e.eventHandlers[`${r}.${s}`])await n(t);if(e.eventHandlers[r])for(const s of e.eventHandlers[r])await s(t)}async function b(e,t){return e.octokit.auth({type:"oauth-user",...t,async factory(t){const r=new e.Octokit({authStrategy:E.createOAuthUserAuth,auth:t}),s=await r.auth({type:"get"});return await y(e,{name:"token",action:"created",token:s.token,scopes:s.scopes,authentication:s,octokit:r}),r}})}var w=h(r(1447));function v(e,t){const r={clientId:e.clientId,request:e.octokit.request,...t,allowSignup:e.allowSignup??t.allowSignup,redirectUrl:t.redirectUrl??e.redirectUrl,scopes:t.scopes??e.defaultScopes};return w.getWebFlowAuthorizationUrl({clientType:e.clientType,...r})}var S=h(r(7349));async function k(e,t){const r=await e.octokit.auth({type:"oauth-user",...t});return await y(e,{name:"token",action:"created",token:r.token,scopes:r.scopes,authentication:r,octokit:new e.Octokit({authStrategy:S.createOAuthUserAuth,auth:{clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:r.token,scopes:r.scopes,refreshToken:r.refreshToken,expiresAt:r.expiresAt,refreshTokenExpiresAt:r.refreshTokenExpiresAt}})}),{authentication:r}}var I=h(r(1447));async function T(e,t){const r=await I.checkToken({clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,request:e.octokit.request,...t});return Object.assign(r.authentication,{type:"token",tokenType:"oauth"}),r}var C=h(r(1447)),O=r(7293);async function R(e,t){const r={clientId:e.clientId,clientSecret:e.clientSecret,request:e.octokit.request,...t};if("oauth-app"===e.clientType){const t=await C.resetToken({clientType:"oauth-app",...r}),s=Object.assign(t.authentication,{type:"token",tokenType:"oauth"});return await y(e,{name:"token",action:"reset",token:t.authentication.token,scopes:t.authentication.scopes||void 0,authentication:s,octokit:new e.Octokit({authStrategy:O.createOAuthUserAuth,auth:{clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:t.authentication.token,scopes:t.authentication.scopes}})}),{...t,authentication:s}}const s=await C.resetToken({clientType:"github-app",...r}),n=Object.assign(s.authentication,{type:"token",tokenType:"oauth"});return await y(e,{name:"token",action:"reset",token:s.authentication.token,authentication:n,octokit:new e.Octokit({authStrategy:O.createOAuthUserAuth,auth:{clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:s.authentication.token}})}),{...s,authentication:n}}var B=h(r(1447)),P=r(7293);async function N(e,t){if("oauth-app"===e.clientType)throw new Error("[@octokit/oauth-app] app.refreshToken() is not supported for OAuth Apps");const r=await B.refreshToken({clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,request:e.octokit.request,refreshToken:t.refreshToken}),s=Object.assign(r.authentication,{type:"token",tokenType:"oauth"});return await y(e,{name:"token",action:"refreshed",token:r.authentication.token,authentication:s,octokit:new e.Octokit({authStrategy:P.createOAuthUserAuth,auth:{clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:r.authentication.token}})}),{...r,authentication:s}}var L=h(r(1447)),U=r(7293);async function D(e,t){if("oauth-app"===e.clientType)throw new Error("[@octokit/oauth-app] app.scopeToken() is not supported for OAuth Apps");const r=await L.scopeToken({clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,request:e.octokit.request,...t}),s=Object.assign(r.authentication,{type:"token",tokenType:"oauth"});return await y(e,{name:"token",action:"scoped",token:r.authentication.token,authentication:s,octokit:new e.Octokit({authStrategy:U.createOAuthUserAuth,auth:{clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:r.authentication.token}})}),{...r,authentication:s}}var F=h(r(1447)),x=r(5643);async function G(e,t){const r={clientId:e.clientId,clientSecret:e.clientSecret,request:e.octokit.request,...t},s="oauth-app"===e.clientType?await F.deleteToken({clientType:"oauth-app",...r}):await F.deleteToken({clientType:"github-app",...r});return await y(e,{name:"token",action:"deleted",token:t.token,octokit:new e.Octokit({authStrategy:x.createUnauthenticatedAuth,auth:{reason:'Handling "token.deleted" event. The access for the token has been revoked.'}})}),s}var M=h(r(1447)),H=r(5643);async function Q(e,t){const r={clientId:e.clientId,clientSecret:e.clientSecret,request:e.octokit.request,...t},s="oauth-app"===e.clientType?await M.deleteAuthorization({clientType:"oauth-app",...r}):await M.deleteAuthorization({clientType:"github-app",...r});return await y(e,{name:"token",action:"deleted",token:t.token,octokit:new e.Octokit({authStrategy:H.createUnauthenticatedAuth,auth:{reason:'Handling "token.deleted" event. The access for the token has been revoked.'}})}),await y(e,{name:"authorization",action:"deleted",token:t.token,octokit:new e.Octokit({authStrategy:H.createUnauthenticatedAuth,auth:{reason:'Handling "authorization.deleted" event. The access for the app has been revoked.'}})}),s}function q(e){return{status:404,headers:{"content-type":"application/json"},text:JSON.stringify({error:`Unknown route: ${e.method} ${e.url}`})}}async function $(e,{pathPrefix:t="/api/github/oauth"},r){if("OPTIONS"===r.method)return{status:200,headers:{"access-control-allow-origin":"*","access-control-allow-methods":"*","access-control-allow-headers":"Content-Type, User-Agent, Authorization"}};let{pathname:s}=new URL(r.url,"http://localhost");if(!s.startsWith(`${t}/`))return;s=s.slice(t.length+1);const n=[r.method,s].join(" "),i={getLogin:"GET login",getCallback:"GET callback",createToken:"POST token",getToken:"GET token",patchToken:"PATCH token",patchRefreshToken:"PATCH refresh-token",scopeToken:"POST token/scoped",deleteToken:"DELETE token",deleteGrant:"DELETE grant"};if(!Object.values(i).includes(n))return q(r);let o;try{const e=await r.text();o=e?JSON.parse(e):{}}catch(e){return{status:400,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify({error:"[@octokit/oauth-app] request error"})}}const{searchParams:a}=new URL(r.url,"http://localhost"),c=Object.fromEntries(a),l=r.headers;try{if(n===i.getLogin){const{url:t}=e.getWebFlowAuthorizationUrl({state:c.state,scopes:c.scopes?c.scopes.split(","):void 0,allowSignup:c.allowSignup?"true"===c.allowSignup:void 0,redirectUrl:c.redirectUrl});return{status:302,headers:{location:t}}}if(n===i.getCallback){if(c.error)throw new Error(`[@octokit/oauth-app] ${c.error} ${c.error_description}`);if(!c.code)throw new Error('[@octokit/oauth-app] "code" parameter is required');const{authentication:{token:t}}=await e.createToken({code:c.code});return{status:200,headers:{"content-type":"text/html"},text:`<h1>Token created successfully</h1>\n\n<p>Your token is: <strong>${t}</strong>. Copy it now as it cannot be shown again.</p>`}}if(n===i.createToken){const{code:t,redirectUrl:r}=o;if(!t)throw new Error('[@octokit/oauth-app] "code" parameter is required');const s=await e.createToken({code:t,redirectUrl:r});return delete s.authentication.clientSecret,{status:201,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(s)}}if(n===i.getToken){const t=l.authorization?.substr(6);if(!t)throw new Error('[@octokit/oauth-app] "Authorization" header is required');const r=await e.checkToken({token:t});return delete r.authentication.clientSecret,{status:200,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(r)}}if(n===i.patchToken){const t=l.authorization?.substr(6);if(!t)throw new Error('[@octokit/oauth-app] "Authorization" header is required');const r=await e.resetToken({token:t});return delete r.authentication.clientSecret,{status:200,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(r)}}if(n===i.patchRefreshToken){const t=l.authorization?.substr(6);if(!t)throw new Error('[@octokit/oauth-app] "Authorization" header is required');const{refreshToken:r}=o;if(!r)throw new Error("[@octokit/oauth-app] refreshToken must be sent in request body");const s=await e.refreshToken({refreshToken:r});return delete s.authentication.clientSecret,{status:200,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(s)}}if(n===i.scopeToken){const t=l.authorization?.substr(6);if(!t)throw new Error('[@octokit/oauth-app] "Authorization" header is required');const r=await e.scopeToken({token:t,...o});return delete r.authentication.clientSecret,{status:200,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(r)}}if(n===i.deleteToken){const t=l.authorization?.substr(6);if(!t)throw new Error('[@octokit/oauth-app] "Authorization" header is required');return await e.deleteToken({token:t}),{status:204,headers:{"access-control-allow-origin":"*"}}}const t=l.authorization?.substr(6);if(!t)throw new Error('[@octokit/oauth-app] "Authorization" header is required');return await e.deleteAuthorization({token:t}),{status:204,headers:{"access-control-allow-origin":"*"}}}catch(e){return{status:400,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify({error:e.message})}}}function j(e,t){t.writeHead(e.status,e.headers),t.end(e.text)}function K(e,t={}){return async function(r,s,n){const i=await function(e){const{method:t,url:r,headers:s}=e;return{method:t,url:r,headers:s,text:async function(){return await new Promise(((t,r)=>{let s=[];e.on("error",r).on("data",(e=>s.push(e))).on("end",(()=>t(Buffer.concat(s).toString())))}))}}}(r),o=await $(e,t,i);return o?(j(o,s),!0):(n?.(),!1)}}function W(e,t={}){return async function(r){const s=await function(e){const t=Object.fromEntries(e.headers.entries());return{method:e.method,url:e.url,headers:t,text:()=>e.text()}}(r),n=await $(e,t,s);return n?function(e){return new Response(e.text,{status:e.status,headers:e.headers})}(n):void 0}}function Y(e,t={}){return async function(r){const s=function(e){const{method:t}=e.requestContext.http;let r=e.rawPath;const{stage:s}=e.requestContext;return r.startsWith("/"+s)&&(r=r.substring(s.length+1)),e.rawQueryString&&(r+="?"+e.rawQueryString),{method:t,url:r,headers:e.headers,text:async()=>e.body||""}}(r),n=await $(e,t,s);return n?{statusCode:(i=n).status,headers:i.headers,body:i.text}:void 0;var i}}var z=class{static{this.VERSION=f}static defaults(e){return class extends(this){constructor(...t){super({...e,...t[0]})}}}constructor(e){const t=e.Octokit||A;this.type=e.clientType||"oauth-app";const r=new t({authStrategy:p.createOAuthAppAuth,auth:{clientType:this.type,clientId:e.clientId,clientSecret:e.clientSecret}}),s={clientType:this.type,clientId:e.clientId,clientSecret:e.clientSecret,defaultScopes:e.defaultScopes||[],allowSignup:e.allowSignup,baseUrl:e.baseUrl,redirectUrl:e.redirectUrl,log:e.log,Octokit:t,octokit:r,eventHandlers:{}};this.on=g.bind(null,s),this.octokit=r,this.getUserOctokit=b.bind(null,s),this.getWebFlowAuthorizationUrl=v.bind(null,s),this.createToken=k.bind(null,s),this.checkToken=T.bind(null,s),this.resetToken=R.bind(null,s),this.refreshToken=N.bind(null,s),this.scopeToken=D.bind(null,s),this.deleteToken=G.bind(null,s),this.deleteAuthorization=Q.bind(null,s)}}},3173:(e,t,r)=>{"use strict";r.d(t,{a:()=>o});var s=r(1697),n=r(6409),i=r.n(n);async function o(e){const t=e.request||s.request,r=await t("POST /applications/{client_id}/token",{headers:{authorization:`basic ${i()(`${e.clientId}:${e.clientSecret}`)}`},client_id:e.clientId,access_token:e.token}),n={clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:e.token,scopes:r.data.scopes};return r.data.expires_at&&(n.expiresAt=r.data.expires_at),"github-app"===e.clientType&&delete n.scopes,{...r,authentication:n}}},1877:(e,t,r)=>{"use strict";r.d(t,{T:()=>i});var s=r(1697),n=r(841);async function i(e){const t=e.request||s.request,r={client_id:e.clientId};return"scopes"in e&&Array.isArray(e.scopes)&&(r.scope=e.scopes.join(" ")),(0,n.d)(t,"POST /login/device/code",r)}},7982:(e,t,r)=>{"use strict";r.d(t,{s:()=>o});var s=r(1697),n=r(6409),i=r.n(n);async function o(e){return(e.request||s.request)("DELETE /applications/{client_id}/grant",{headers:{authorization:`basic ${i()(`${e.clientId}:${e.clientSecret}`)}`},client_id:e.clientId,access_token:e.token})}},3761:(e,t,r)=>{"use strict";r.d(t,{p:()=>o});var s=r(1697),n=r(6409),i=r.n(n);async function o(e){return(e.request||s.request)("DELETE /applications/{client_id}/token",{headers:{authorization:`basic ${i()(`${e.clientId}:${e.clientSecret}`)}`},client_id:e.clientId,access_token:e.token})}},2586:(e,t,r)=>{"use strict";r.d(t,{i:()=>i});var s=r(1697),n=r(841);async function i(e){const t=e.request||s.request,r=await(0,n.d)(t,"POST /login/oauth/access_token",{client_id:e.clientId,device_code:e.code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),i={clientType:e.clientType,clientId:e.clientId,token:r.data.access_token,scopes:r.data.scope.split(/\s+/).filter(Boolean)};if("clientSecret"in e&&(i.clientSecret=e.clientSecret),"github-app"===e.clientType){if("refresh_token"in r.data){const e=new Date(r.headers.date).getTime();i.refreshToken=r.data.refresh_token,i.expiresAt=o(e,r.data.expires_in),i.refreshTokenExpiresAt=o(e,r.data.refresh_token_expires_in)}delete i.scopes}return{...r,authentication:i}}function o(e,t){return new Date(e+1e3*t).toISOString()}},7930:(e,t,r)=>{"use strict";r.d(t,{y:()=>i});var s=r(1697),n=r(841);async function i(e){const t=e.request||s.request,r=await(0,n.d)(t,"POST /login/oauth/access_token",{client_id:e.clientId,client_secret:e.clientSecret,code:e.code,redirect_uri:e.redirectUrl}),i={clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:r.data.access_token,scopes:r.data.scope.split(/\s+/).filter(Boolean)};if("github-app"===e.clientType){if("refresh_token"in r.data){const e=new Date(r.headers.date).getTime();i.refreshToken=r.data.refresh_token,i.expiresAt=o(e,r.data.expires_in),i.refreshTokenExpiresAt=o(e,r.data.refresh_token_expires_in)}delete i.scopes}return{...r,authentication:i}}function o(e,t){return new Date(e+1e3*t).toISOString()}},1447:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VERSION:()=>s,checkToken:()=>u.a,createDeviceCode:()=>c.T,deleteAuthorization:()=>_.s,deleteToken:()=>m.p,exchangeDeviceCode:()=>l.i,exchangeWebFlowCode:()=>a.y,getWebFlowAuthorizationUrl:()=>o,refreshToken:()=>h.g,resetToken:()=>g.E,scopeToken:()=>f});const s="4.0.1";var n=r(1697),i=r(841);function o({request:e=n.request,...t}){return function(e){const t=e.clientType||"oauth-app",r=e.baseUrl||"https://github.com",s={clientType:t,allowSignup:!1!==e.allowSignup,clientId:e.clientId,login:e.login||null,redirectUrl:e.redirectUrl||null,state:e.state||Math.random().toString(36).substr(2),url:""};if("oauth-app"===t){const t="scopes"in e?e.scopes:[];s.scopes="string"==typeof t?t.split(/[,\s]+/).filter(Boolean):t}return s.url=function(e,t){const r={allowSignup:"allow_signup",clientId:"client_id",login:"login",redirectUrl:"redirect_uri",scopes:"scope",state:"state"};let s=e;return Object.keys(r).filter((e=>null!==t[e])).filter((e=>"scopes"!==e||"github-app"!==t.clientType&&(!Array.isArray(t[e])||t[e].length>0))).map((e=>[r[e],`${t[e]}`])).forEach((([e,t],r)=>{s+=0===r?"?":"&",s+=`${e}=${encodeURIComponent(t)}`})),s}(`${r}/login/oauth/authorize`,s),s}({...t,baseUrl:(0,i.l)(e)})}var a=r(7930),c=r(1877),l=r(2586),u=r(3173),h=r(6833),d=r(6409),p=r.n(d);async function f(e){const{request:t,clientType:r,clientId:s,clientSecret:i,token:o,...a}=e,c=t||n.request,l=await c("POST /applications/{client_id}/token/scoped",{headers:{authorization:`basic ${p()(`${s}:${i}`)}`},client_id:s,access_token:o,...a}),u=Object.assign({clientType:r,clientId:s,clientSecret:i,token:l.data.token},l.data.expires_at?{expiresAt:l.data.expires_at}:{});return{...l,authentication:u}}var g=r(9786),m=r(3761),_=r(7982)},6833:(e,t,r)=>{"use strict";r.d(t,{g:()=>i});var s=r(1697),n=r(841);async function i(e){const t=e.request||s.request,r=await(0,n.d)(t,"POST /login/oauth/access_token",{client_id:e.clientId,client_secret:e.clientSecret,grant_type:"refresh_token",refresh_token:e.refreshToken}),i=new Date(r.headers.date).getTime(),a={clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,token:r.data.access_token,refreshToken:r.data.refresh_token,expiresAt:o(i,r.data.expires_in),refreshTokenExpiresAt:o(i,r.data.refresh_token_expires_in)};return{...r,authentication:a}}function o(e,t){return new Date(e+1e3*t).toISOString()}},9786:(e,t,r)=>{"use strict";r.d(t,{E:()=>o});var s=r(1697),n=r(6409),i=r.n(n);async function o(e){const t=e.request||s.request,r=i()(`${e.clientId}:${e.clientSecret}`),n=await t("PATCH /applications/{client_id}/token",{headers:{authorization:`basic ${r}`},client_id:e.clientId,access_token:e.token}),o={clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:n.data.token,scopes:n.data.scopes};return n.data.expires_at&&(o.expiresAt=n.data.expires_at),"github-app"===e.clientType&&delete o.scopes,{...n,authentication:o}}},841:(e,t,r)=>{"use strict";r.d(t,{d:()=>i,l:()=>n});var s=r(9891);function n(e){const t=e.endpoint.DEFAULTS;return/^https:\/\/(api\.)?github\.com$/.test(t.baseUrl)?"https://github.com":t.baseUrl.replace("/api/v3","")}async function i(e,t,r){const i={baseUrl:n(e),headers:{accept:"application/json"},...r},o=await e(t,i);if("error"in o.data){const r=new s.RequestError(`${o.data.error_description} (${o.data.error}, ${o.data.error_uri})`,400,{request:e.endpoint.merge(t,i),headers:o.headers});throw r.response=o,r}return o}},9891:(e,t,r)=>{"use strict";r.r(t),r.d(t,{RequestError:()=>c});var s=r(2327),n=r(778),i=r.n(n);const o=i()((e=>console.warn(e))),a=i()((e=>console.warn(e)));class c extends Error{constructor(e,t,r){let n;super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=t,"headers"in r&&void 0!==r.headers&&(n=r.headers),"response"in r&&(this.response=r.response,n=r.response.headers);const i=Object.assign({},r.request);r.request.headers.authorization&&(i.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),i.url=i.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=i,Object.defineProperty(this,"code",{get:()=>(o(new s.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),t)}),Object.defineProperty(this,"headers",{get:()=>(a(new s.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")),n||{})})}}},1697:(e,t,r)=>{"use strict";function s(e,t){const r=Object.assign({},e);return Object.keys(t).forEach((n=>{!function(e){if("object"!=typeof e||null===e)return!1;if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;const r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}(t[n])?Object.assign(r,{[n]:t[n]}):n in e?r[n]=s(e[n],t[n]):Object.assign(r,{[n]:t[n]})})),r}function n(e){for(const t in e)void 0===e[t]&&delete e[t];return e}function i(e,t,r){if("string"==typeof t){let[e,s]=t.split(" ");r=Object.assign(s?{method:e,url:s}:{url:e},r)}else r=Object.assign({},t);var i;r.headers=(i=r.headers)?Object.keys(i).reduce(((e,t)=>(e[t.toLowerCase()]=i[t],e)),{}):{},n(r),n(r.headers);const o=s(e||{},r);return"/graphql"===r.url&&(e&&e.mediaType.previews?.length&&(o.mediaType.previews=e.mediaType.previews.filter((e=>!o.mediaType.previews.includes(e))).concat(o.mediaType.previews)),o.mediaType.previews=(o.mediaType.previews||[]).map((e=>e.replace(/-preview/,"")))),o}r.r(t),r.d(t,{request:()=>w});const o=/\{[^}]+\}/g;function a(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function c(e,t){const r={__proto__:null};for(const s of Object.keys(e))-1===t.indexOf(s)&&(r[s]=e[s]);return r}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 u(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function h(e,t,r){return t="+"===e||"#"===e?l(t):u(t),r?u(r)+"="+t:t}function d(e){return null!=e}function p(e){return";"===e||"&"===e||"?"===e}function f(e,t){var r=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,s,n){if(s){let e="";const n=[];if(-1!==r.indexOf(s.charAt(0))&&(e=s.charAt(0),s=s.substr(1)),s.split(/,/g).forEach((function(r){var s=/([^:\*]*)(?::(\d+)|(\*))?/.exec(r);n.push(function(e,t,r,s){var n=e[r],i=[];if(d(n)&&""!==n)if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)n=n.toString(),s&&"*"!==s&&(n=n.substring(0,parseInt(s,10))),i.push(h(t,n,p(t)?r:""));else if("*"===s)Array.isArray(n)?n.filter(d).forEach((function(e){i.push(h(t,e,p(t)?r:""))})):Object.keys(n).forEach((function(e){d(n[e])&&i.push(h(t,n[e],e))}));else{const e=[];Array.isArray(n)?n.filter(d).forEach((function(r){e.push(h(t,r))})):Object.keys(n).forEach((function(r){d(n[r])&&(e.push(u(r)),e.push(h(t,n[r].toString())))})),p(t)?i.push(u(r)+"="+e.join(",")):0!==e.length&&i.push(e.join(","))}else";"===t?d(n)&&i.push(u(r)):""!==n||"&"!==t&&"?"!==t?""===n&&i.push(""):i.push(u(r)+"=");return i}(t,e,s[1],s[2]||s[3]))})),e&&"+"!==e){var i=",";return"?"===e?i="&":"#"!==e&&(i=e),(0!==n.length?e:"")+n.join(i)}return n.join(",")}return l(n)})),"/"===e?e:e.replace(/\/$/,"")}function g(e){let t,r=e.method.toUpperCase(),s=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},e.headers),i=c(e,["method","baseUrl","url","headers","request","mediaType"]);const l=function(e){const t=e.match(o);return t?t.map(a).reduce(((e,t)=>e.concat(t)),[]):[]}(s);var u;s=(u=s,{expand:f.bind(null,u)}).expand(i),/^http/.test(s)||(s=e.baseUrl+s);const h=c(i,Object.keys(e).filter((e=>l.includes(e))).concat("baseUrl"));if(!/application\/octet-stream/i.test(n.accept)&&(e.mediaType.format&&(n.accept=n.accept.split(/,/).map((t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`))).join(",")),s.endsWith("/graphql")&&e.mediaType.previews?.length)){const t=n.accept.match(/[\w-]+(?=-preview)/g)||[];n.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)?s=function(e,t){const r=/\?/.test(e)?"&":"?",s=Object.keys(t);return 0===s.length?e:e+r+s.map((e=>"q"===e?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${e}=${encodeURIComponent(t[e])}`)).join("&")}(s,h):"data"in h?t=h.data:Object.keys(h).length&&(t=h),n["content-type"]||void 0===t||(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(r)&&void 0===t&&(t=""),Object.assign({method:r,url:s,headers:n},void 0!==t?{body:t}:null,e.request?{request:e.request}:null)}function m(e,t,r){return g(i(e,t,r))}var _=r(350);const A=function e(t,r){const s=i(t,r),n=m.bind(null,s);return Object.assign(n,{DEFAULTS:s,defaults:e.bind(null,s),merge:i.bind(null,s),parse:g})}(null,{method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":`octokit-endpoint.js/9.0.4 ${(0,_.getUserAgent)()}`},mediaType:{format:""}});var E=r(9891);function y(e){const t=e.request&&e.request.log?e.request.log:console,r=!1!==e.request?.parseSuccessResponseBody;(function(e){if("object"!=typeof e||null===e)return!1;if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;const r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let s,n,i={},{fetch:o}=globalThis;if(e.request?.fetch&&(o=e.request.fetch),!o)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");return o(e.url,{method:e.method,body:e.body,headers:e.headers,signal:e.request?.signal,...e.body&&{duplex:"half"}}).then((async o=>{n=o.url,s=o.status;for(const e of o.headers)i[e[0]]=e[1];if("deprecation"in i){const r=i.link&&i.link.match(/<([^>]+)>; rel="deprecation"/),s=r&&r.pop();t.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${i.sunset}${s?`. See ${s}`:""}`)}if(204!==s&&205!==s){if("HEAD"===e.method){if(s<400)return;throw new E.RequestError(o.statusText,s,{response:{url:n,status:s,headers:i,data:void 0},request:e})}if(304===s)throw new E.RequestError("Not modified",s,{response:{url:n,status:s,headers:i,data:await b(o)},request:e});if(s>=400){const t=await b(o),r=new E.RequestError(function(e){return"string"==typeof e?e:"message"in e?Array.isArray(e.errors)?`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}`:e.message:`Unknown error: ${JSON.stringify(e)}`}(t),s,{response:{url:n,status:s,headers:i,data:t},request:e});throw r}return r?await b(o):o.body}})).then((e=>({status:s,url:n,headers:i,data:e}))).catch((t=>{if(t instanceof E.RequestError)throw t;if("AbortError"===t.name)throw t;let r=t.message;throw"TypeError"===t.name&&"cause"in t&&(t.cause instanceof Error?r=t.cause.message:"string"==typeof t.cause&&(r=t.cause)),new E.RequestError(r,500,{request:e})}))}async function b(e){const t=e.headers.get("content-type");return/application\/json/.test(t)?e.json().catch((()=>e.text())).catch((()=>"")):!t||/^text\/|charset=utf-8$/.test(t)?e.text():function(e){return e.arrayBuffer()}(e)}const w=function e(t,r){const s=t.defaults(r);return Object.assign((function(t,r){const n=s.merge(t,r);if(!n.request||!n.request.hook)return y(s.parse(n));const i=(e,t)=>y(s.parse(s.merge(e,t)));return Object.assign(i,{endpoint:s,defaults:e.bind(null,s)}),n.request.hook(i,n)}),{endpoint:s,defaults:e.bind(null,s)})}(A,{headers:{"user-agent":`octokit-request.js/8.1.6 ${(0,_.getUserAgent)()}`}})},6455:(e,t,r)=>{"use strict";const s=r(5602),n=r(7741);class i extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t=(e=[...e].map((e=>e instanceof Error?e:null!==e&&"object"==typeof e?Object.assign(new Error(e.message),e):new Error(e)))).map((e=>"string"==typeof e.stack?n(e.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(e))).join("\n");t="\n"+s(t,4),super(t),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:e})}*[Symbol.iterator](){for(const e of this._errors)yield e}}e.exports=i},3407:e=>{e.exports={newInvalidAsn1Error:function(e){var t=new Error;return t.name="InvalidAsn1Error",t.message=e||"",t}}},279:(e,t,r)=>{var s=r(3407),n=r(4478),i=r(4578),o=r(3609);for(var a in e.exports={Reader:i,Writer:o},n)n.hasOwnProperty(a)&&(e.exports[a]=n[a]);for(var c in s)s.hasOwnProperty(c)&&(e.exports[c]=s[c])},4578:(e,t,r)=>{var s=r(9491),n=r(2399).Buffer,i=r(4478),o=r(3407).newInvalidAsn1Error;function a(e){if(!e||!n.isBuffer(e))throw new TypeError("data must be a node Buffer");this._buf=e,this._size=e.length,this._len=0,this._offset=0}Object.defineProperty(a.prototype,"length",{enumerable:!0,get:function(){return this._len}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){return this._offset}}),Object.defineProperty(a.prototype,"remain",{get:function(){return this._size-this._offset}}),Object.defineProperty(a.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}}),a.prototype.readByte=function(e){if(this._size-this._offset<1)return null;var t=255&this._buf[this._offset];return e||(this._offset+=1),t},a.prototype.peek=function(){return this.readByte(!0)},a.prototype.readLength=function(e){if(void 0===e&&(e=this._offset),e>=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0==(t&=127))throw o("Indefinite length not supported");if(t>4)throw o("encoding too long");if(this._size-e<t)return null;this._len=0;for(var r=0;r<t;r++)this._len=(this._len<<8)+(255&this._buf[e++])}else this._len=t;return e},a.prototype.readSequence=function(e){var t=this.peek();if(null===t)return null;if(void 0!==e&&e!==t)throw o("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);return null===r?null:(this._offset=r,t)},a.prototype.readInt=function(){return this._readTag(i.Integer)},a.prototype.readBoolean=function(){return 0!==this._readTag(i.Boolean)},a.prototype.readEnumeration=function(){return this._readTag(i.Enumeration)},a.prototype.readString=function(e,t){e||(e=i.OctetString);var r=this.peek();if(null===r)return null;if(r!==e)throw o("Expected 0x"+e.toString(16)+": got 0x"+r.toString(16));var s=this.readLength(this._offset+1);if(null===s)return null;if(this.length>this._size-s)return null;if(this._offset=s,0===this.length)return t?n.alloc(0):"";var a=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?a:a.toString("utf8")},a.prototype.readOID=function(e){e||(e=i.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],s=0,n=0;n<t.length;n++){var o=255&t[n];s<<=7,s+=127&o,0==(128&o)&&(r.push(s),s=0)}return s=r.shift(),r.unshift(s%40),r.unshift(s/40>>0),r.join(".")},a.prototype._readTag=function(e){s.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw o("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(this.length>4)throw o("Integer too long: "+this.length);if(this.length>this._size-r)return null;this._offset=r;for(var n=this._buf[this._offset],i=0,a=0;a<this.length;a++)i<<=8,i|=255&this._buf[this._offset++];return 128==(128&n)&&4!==a&&(i-=1<<8*a),i>>0},e.exports=a},4478:e=>{e.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},3609:(e,t,r)=>{var s=r(9491),n=r(2399).Buffer,i=r(4478),o=r(3407).newInvalidAsn1Error,a={size:1024,growthFactor:8};function c(e){var t,r;t=a,r=e||{},s.ok(t),s.equal(typeof t,"object"),s.ok(r),s.equal(typeof r,"object"),Object.getOwnPropertyNames(t).forEach((function(e){if(!r[e]){var s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,s)}})),e=r,this._buf=n.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw o(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=i.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&r>1;)r--,e<<=8;if(r>4)throw o("BER ints cannot be > 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;r-- >0;)this._buf[this._offset++]=(4278190080&e)>>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(i.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=i.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=i.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+typeof e+")");"number"!=typeof t&&(t=i.OctetString);var r=n.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!n.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach((function(e){t.writeString(e)}))},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=i.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),s=[];s.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach((function(e){!function(e,t){t<128?e.push(t):t<16384?(e.push(t>>>7|128),e.push(127&t)):t<2097152?(e.push(t>>>14|128),e.push(255&(t>>>7|128)),e.push(127&t)):t<268435456?(e.push(t>>>21|128),e.push(255&(t>>>14|128)),e.push(255&(t>>>7|128)),e.push(127&t)):(e.push(255&(t>>>28|128)),e.push(255&(t>>>21|128)),e.push(255&(t>>>14|128)),e.push(255&(t>>>7|128)),e.push(127&t))}(s,parseInt(e,10))}));var n=this;this._ensure(2+s.length),this.writeByte(t),this.writeLength(s.length),s.forEach((function(e){n.writeByte(e)}))},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw o("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=i.Sequence|i.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw o("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){s.ok(void 0!==e),s.ok(void 0!==t),s.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(s.ok(e),this._size-this._offset<e){var t=this._size*this._options.growthFactor;t-this._offset<e&&(t+=e);var r=n.alloc(t);this._buf.copy(r,0,0,this._offset),this._buf=r,this._size=t}},e.exports=c},476:(e,t,r)=>{var s=r(279);e.exports={Ber:s,BerReader:s.Reader,BerWriter:s.Writer}},2703:(e,t,r)=>{"use strict";var s=r(780).lowlevel.crypto_hash,n=0,i=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function o(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function a(e,t){var r,s=0;for(r=0;r<4;r++,n++)n>=t&&(n=0),s=s<<8|e[n];return s}i.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=o(this.S,t,0)^this.P[r],e[0]^=o(this.S,t,4)^this.P[r+1];var s=e[0];e[0]=e[1]^this.P[17],e[1]=s},i.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;r>0;r-=2)e[1]^=o(this.S,t,0)^this.P[r],e[0]^=o(this.S,t,4)^this.P[r-1];var s=e[0];e[0]=e[1]^this.P[0],e[1]=s},i.prototype.expand0state=function(e,t){var r,s,i=new Uint32Array(2),o=new Uint8Array(i.buffer);for(r=0,n=0;r<18;r++)this.P[r]^=a(e,t);for(n=0,r=0;r<18;r+=2)this.encipher(i,o),this.P[r]=i[0],this.P[r+1]=i[1];for(r=0;r<4;r++)for(s=0;s<256;s+=2)this.encipher(i,o),this.S[r][s]=i[0],this.S[r][s+1]=i[1]},i.prototype.expandstate=function(e,t,r,s){var i,o,c=new Uint32Array(2);for(i=0,n=0;i<18;i++)this.P[i]^=a(r,s);for(i=0,n=0;i<18;i+=2)c[0]^=a(e,t),c[1]^=a(e,t),this.encipher(c),this.P[i]=c[0],this.P[i+1]=c[1];for(i=0;i<4;i++)for(o=0;o<256;o+=2)c[0]^=a(e,t),c[1]^=a(e,t),this.encipher(c),this.S[i][o]=c[0],this.S[i][o+1]=c[1];n=0},i.prototype.enc=function(e,t){for(var r=0;r<t;r++)this.encipher(e.subarray(2*r))},i.prototype.dec=function(e,t){for(var r=0;r<t;r++)this.decipher(e.subarray(2*r))};function c(e,t,r){var s,n=new i,o=new Uint32Array(8),c=new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,105,116,101]);for(n.expandstate(t,64,e,64),s=0;s<64;s++)n.expand0state(t,64),n.expand0state(e,64);for(s=0;s<8;s++)o[s]=a(c,c.byteLength);for(s=0;s<64;s++)n.enc(o,o.byteLength/8);for(s=0;s<8;s++)r[4*s+3]=o[s]>>>24,r[4*s+2]=o[s]>>>16,r[4*s+1]=o[s]>>>8,r[4*s+0]=o[s]}e.exports={BLOCKS:8,HASHSIZE:32,hash:c,pbkdf:function(e,t,r,n,i,o,a){var l,u,h,d,p,f,g=new Uint8Array(64),m=new Uint8Array(64),_=new Uint8Array(32),A=new Uint8Array(32),E=new Uint8Array(n+4),y=o;if(a<1)return-1;if(0===t||0===n||0===o||o>_.byteLength*_.byteLength||n>1<<20)return-1;for(d=Math.floor((o+_.byteLength-1)/_.byteLength),h=Math.floor((o+d-1)/d),l=0;l<n;l++)E[l]=r[l];for(s(g,e,t),f=1;o>0;f++){for(E[n+0]=f>>>24,E[n+1]=f>>>16,E[n+2]=f>>>8,E[n+3]=f,s(m,E,n+4),c(g,m,A),l=_.byteLength;l--;)_[l]=A[l];for(l=1;l<a;l++)for(s(m,A,A.byteLength),c(g,m,A),u=0;u<_.byteLength;u++)_[u]^=A[u];for(h=Math.min(h,o),l=0;l<h&&!((p=l*d+(f-1))>=y);l++)i[p]=_[l];o-=l}return 0}}},5186:(e,t,r)=>{var s=r(3698),n=r(2505),i=r(6417),o=Function.bind,a=o.bind(o);function c(e,t,r){var s=a(i,null).apply(null,r?[t,r]:[t]);e.api={remove:s},e.remove=s,["before","error","after","wrap"].forEach((function(s){var i=r?[t,s,r]:[t,s];e[s]=e.api[s]=a(n,null).apply(null,i)}))}function l(){var e={registry:{}},t=s.bind(null,e);return c(t,e),t}var u=!1;function h(){return u||(console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'),u=!0),l()}h.Singular=function(){var e={registry:{}},t=s.bind(null,e,"h");return c(t,e,"h"),t}.bind(),h.Collection=l.bind(),e.exports=h,e.exports.Hook=h,e.exports.Singular=h.Singular,e.exports.Collection=h.Collection},2505:e=>{e.exports=function(e,t,r,s){var n=s;e.registry[r]||(e.registry[r]=[]),"before"===t&&(s=function(e,t){return Promise.resolve().then(n.bind(null,t)).then(e.bind(null,t))}),"after"===t&&(s=function(e,t){var r;return Promise.resolve().then(e.bind(null,t)).then((function(e){return n(r=e,t)})).then((function(){return r}))}),"error"===t&&(s=function(e,t){return Promise.resolve().then(e.bind(null,t)).catch((function(e){return n(e,t)}))}),e.registry[r].push({hook:s,orig:n})}},3698:e=>{e.exports=function e(t,r,s,n){if("function"!=typeof s)throw new Error("method for before hook must be a function");return n||(n={}),Array.isArray(r)?r.reverse().reduce((function(r,s){return e.bind(null,t,s,r,n)}),s)():Promise.resolve().then((function(){return t.registry[r]?t.registry[r].reduce((function(e,t){return t.hook.bind(null,e,n)}),s)():s(n)}))}},6417:e=>{e.exports=function(e,t,r){if(e.registry[t]){var s=e.registry[t].map((function(e){return e.orig})).indexOf(r);-1!==s&&e.registry[t].splice(s,1)}}},1209:function(e){var t;t=function(){"use strict";var e,t,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={load:function(e,t,r={}){var s,n,i;for(s in t)i=t[s],r[s]=null!=(n=e[s])?n:i;return r},overwrite:function(e,t,r={}){var s,n;for(s in e)n=e[s],void 0!==t[s]&&(r[s]=n);return r}},n=class{constructor(e,t){this.incr=e,this.decr=t,this._first=null,this._last=null,this.length=0}push(e){var t;this.length++,"function"==typeof this.incr&&this.incr(),t={value:e,prev:this._last,next:null},null!=this._last?(this._last.next=t,this._last=t):this._first=this._last=t}shift(){var e;if(null!=this._first)return this.length--,"function"==typeof this.decr&&this.decr(),e=this._first.value,null!=(this._first=this._first.next)?this._first.prev=null:this._last=null,e}first(){if(null!=this._first)return this._first.value}getArray(){var e,t,r;for(e=this._first,r=[];null!=e;)r.push((t=e,e=e.next,t.value));return r}forEachShift(e){var t;for(t=this.shift();null!=t;)e(t),t=this.shift()}debug(){var e,t,r,s,n;for(e=this._first,n=[];null!=e;)n.push((t=e,e=e.next,{value:t.value,prev:null!=(r=t.prev)?r.value:void 0,next:null!=(s=t.next)?s.value:void 0}));return n}},i=class{constructor(e){if(this.instance=e,this._events={},null!=this.instance.on||null!=this.instance.once||null!=this.instance.removeAllListeners)throw new Error("An Emitter already exists for this object");this.instance.on=(e,t)=>this._addListener(e,"many",t),this.instance.once=(e,t)=>this._addListener(e,"once",t),this.instance.removeAllListeners=(e=null)=>null!=e?delete this._events[e]:this._events={}}_addListener(e,t,r){var s;return null==(s=this._events)[e]&&(s[e]=[]),this._events[e].push({cb:r,status:t}),this.instance}listenerCount(e){return null!=this._events[e]?this._events[e].length:0}async trigger(e,...t){var r,s;try{if("debug"!==e&&this.trigger("debug",`Event triggered: ${e}`,t),null==this._events[e])return;return this._events[e]=this._events[e].filter((function(e){return"none"!==e.status})),s=this._events[e].map((async e=>{var r,s;if("none"!==e.status){"once"===e.status&&(e.status="none");try{return"function"==typeof(null!=(s="function"==typeof e.cb?e.cb(...t):void 0)?s.then:void 0)?await s:s}catch(e){return r=e,this.trigger("error",r),null}}})),(await Promise.all(s)).find((function(e){return null!=e}))}catch(e){return r=e,this.trigger("error",r),null}}};e=n,t=i;var o,a,c=class extends Error{};a=s,o=c;var l,u,h=class{constructor(e,t,r,s,n,i,o,c){this.task=e,this.args=t,this.rejectOnDrop=n,this.Events=i,this._states=o,this.Promise=c,this.options=a.load(r,s),this.options.priority=this._sanitizePriority(this.options.priority),this.options.id===s.id&&(this.options.id=`${this.options.id}-${this._randomIndex()}`),this.promise=new this.Promise(((e,t)=>{this._resolve=e,this._reject=t})),this.retryCount=0}_sanitizePriority(e){var t;return(t=~~e!==e?5:e)<0?0:t>9?9:t}_randomIndex(){return Math.random().toString(36).slice(2)}doDrop({error:e,message:t="This job has been dropped by Bottleneck"}={}){return!!this._states.remove(this.options.id)&&(this.rejectOnDrop&&this._reject(null!=e?e:new o(t)),this.Events.trigger("dropped",{args:this.args,options:this.options,task:this.task,promise:this.promise}),!0)}_assertStatus(e){var t;if((t=this._states.jobStatus(this.options.id))!==e&&("DONE"!==e||null!==t))throw new o(`Invalid job status ${t}, expected ${e}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`)}doReceive(){return this._states.start(this.options.id),this.Events.trigger("received",{args:this.args,options:this.options})}doQueue(e,t){return this._assertStatus("RECEIVED"),this._states.next(this.options.id),this.Events.trigger("queued",{args:this.args,options:this.options,reachedHWM:e,blocked:t})}doRun(){return 0===this.retryCount?(this._assertStatus("QUEUED"),this._states.next(this.options.id)):this._assertStatus("EXECUTING"),this.Events.trigger("scheduled",{args:this.args,options:this.options})}async doExecute(e,t,r,s){var n,i,o;0===this.retryCount?(this._assertStatus("RUNNING"),this._states.next(this.options.id)):this._assertStatus("EXECUTING"),i={args:this.args,options:this.options,retryCount:this.retryCount},this.Events.trigger("executing",i);try{if(o=await(null!=e?e.schedule(this.options,this.task,...this.args):this.task(...this.args)),t())return this.doDone(i),await s(this.options,i),this._assertStatus("DONE"),this._resolve(o)}catch(e){return n=e,this._onFailure(n,i,t,r,s)}}doExpire(e,t,r){var s,n;return this._states.jobStatus("RUNNING"===this.options.id)&&this._states.next(this.options.id),this._assertStatus("EXECUTING"),n={args:this.args,options:this.options,retryCount:this.retryCount},s=new o(`This job timed out after ${this.options.expiration} ms.`),this._onFailure(s,n,e,t,r)}async _onFailure(e,t,r,s,n){var i,o;if(r())return null!=(i=await this.Events.trigger("failed",e,t))?(o=~~i,this.Events.trigger("retry",`Retrying ${this.options.id} after ${o} ms`,t),this.retryCount++,s(o)):(this.doDone(t),await n(this.options,t),this._assertStatus("DONE"),this._reject(e))}doDone(e){return this._assertStatus("EXECUTING"),this._states.next(this.options.id),this.Events.trigger("done",e)}};u=s,l=c;var d,p;d=c,p=class{constructor(e){this.status=e,this._jobs={},this.counts=this.status.map((function(){return 0}))}next(e){var t,r;return r=(t=this._jobs[e])+1,null!=t&&r<this.status.length?(this.counts[t]--,this.counts[r]++,this._jobs[e]++):null!=t?(this.counts[t]--,delete this._jobs[e]):void 0}start(e){return this._jobs[e]=0,this.counts[0]++}remove(e){var t;return null!=(t=this._jobs[e])&&(this.counts[t]--,delete this._jobs[e]),null!=t}jobStatus(e){var t;return null!=(t=this.status[this._jobs[e]])?t:null}statusJobs(e){var t,r,s,n;if(null!=e){if((r=this.status.indexOf(e))<0)throw new d(`status must be one of ${this.status.join(", ")}`);for(t in n=[],s=this._jobs)s[t]===r&&n.push(t);return n}return Object.keys(this._jobs)}statusCounts(){return this.counts.reduce(((e,t,r)=>(e[this.status[r]]=t,e)),{})}};var f,g=p;f=n;var m,_,A,E,y,b,w="2.19.5",v={version:w},S=Object.freeze({version:w,default:v}),k=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),I=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");b=s,m=i,E=k,A=I,y=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),_=function(){class e{constructor(e={}){this.deleteKey=this.deleteKey.bind(this),this.limiterOptions=e,b.load(this.limiterOptions,this.defaults,this),this.Events=new m(this),this.instances={},this.Bottleneck=Q,this._startAutoCleanup(),this.sharedConnection=null!=this.connection,null==this.connection&&("redis"===this.limiterOptions.datastore?this.connection=new E(Object.assign({},this.limiterOptions,{Events:this.Events})):"ioredis"===this.limiterOptions.datastore&&(this.connection=new A(Object.assign({},this.limiterOptions,{Events:this.Events}))))}key(e=""){var t;return null!=(t=this.instances[e])?t:(()=>{var t;return t=this.instances[e]=new this.Bottleneck(Object.assign(this.limiterOptions,{id:`${this.id}-${e}`,timeout:this.timeout,connection:this.connection})),this.Events.trigger("created",t,e),t})()}async deleteKey(e=""){var t,r;return r=this.instances[e],this.connection&&(t=await this.connection.__runCommand__(["del",...y.allKeys(`${this.id}-${e}`)])),null!=r&&(delete this.instances[e],await r.disconnect()),null!=r||t>0}limiters(){var e,t,r,s;for(e in r=[],t=this.instances)s=t[e],r.push({key:e,limiter:s});return r}keys(){return Object.keys(this.instances)}async clusterKeys(){var e,t,r,s,n,i,o,a;if(null==this.connection)return this.Promise.resolve(this.keys());for(n=[],e=null,a=`b_${this.id}-`.length;0!==e;)for([o,t]=await this.connection.__runCommand__(["scan",null!=e?e:0,"match",`b_${this.id}-*_settings`,"count",1e4]),e=~~o,r=0,i=t.length;r<i;r++)s=t[r],n.push(s.slice(a,-9));return n}_startAutoCleanup(){var e;return clearInterval(this.interval),"function"==typeof(e=this.interval=setInterval((async()=>{var e,t,r,s,n,i;for(t in n=Date.now(),s=[],r=this.instances){i=r[t];try{await i._store.__groupCheck__(n)?s.push(this.deleteKey(t)):s.push(void 0)}catch(t){e=t,s.push(i.Events.trigger("error",e))}}return s}),this.timeout/2)).unref?e.unref():void 0}updateSettings(e={}){if(b.overwrite(e,this.defaults,this),b.overwrite(e,e,this.limiterOptions),null!=e.timeout)return this._startAutoCleanup()}disconnect(e=!0){var t;if(!this.sharedConnection)return null!=(t=this.connection)?t.disconnect(e):void 0}}return e.prototype.defaults={timeout:3e5,connection:null,Promise,id:"group-key"},e}.call(r);var T,C,O=_;C=s,T=i;var R,B,P,N,L,U,D,F,x,G=function(){class e{constructor(e={}){this.options=e,C.load(this.options,this.defaults,this),this.Events=new T(this),this._arr=[],this._resetPromise(),this._lastFlush=Date.now()}_resetPromise(){return this._promise=new this.Promise(((e,t)=>this._resolve=e))}_flush(){return clearTimeout(this._timeout),this._lastFlush=Date.now(),this._resolve(),this.Events.trigger("batch",this._arr),this._arr=[],this._resetPromise()}add(e){var t;return this._arr.push(e),t=this._promise,this._arr.length===this.maxSize?this._flush():null!=this.maxTime&&1===this._arr.length&&(this._timeout=setTimeout((()=>this._flush()),this.maxTime)),t}}return e.prototype.defaults={maxTime:null,maxSize:null,Promise},e}.call(r),M=(R=S)&&R.default||R,H=[].splice;x=s,L=class{constructor(r){this.Events=new t(this),this._length=0,this._lists=function(){var t,s,n;for(n=[],t=1,s=r;1<=s?t<=s:t>=s;1<=s?++t:--t)n.push(new e((()=>this.incr()),(()=>this.decr())));return n}.call(this)}incr(){if(0==this._length++)return this.Events.trigger("leftzero")}decr(){if(0==--this._length)return this.Events.trigger("zero")}push(e){return this._lists[e.options.priority].push(e)}queued(e){return null!=e?this._lists[e].length:this._length}shiftAll(e){return this._lists.forEach((function(t){return t.forEachShift(e)}))}getFirst(e=this._lists){var t,r,s;for(t=0,r=e.length;t<r;t++)if((s=e[t]).length>0)return s;return[]}shiftLastFrom(e){return this.getFirst(this._lists.slice(e).reverse()).shift()}},P=h,N=class{constructor(e,t,r){this.instance=e,this.storeOptions=t,this.clientId=this.instance._randomIndex(),u.load(r,r,this),this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now(),this._running=0,this._done=0,this._unblockTime=0,this.ready=this.Promise.resolve(),this.clients={},this._startHeartbeat()}_startHeartbeat(){var e;return null==this.heartbeat&&(null!=this.storeOptions.reservoirRefreshInterval&&null!=this.storeOptions.reservoirRefreshAmount||null!=this.storeOptions.reservoirIncreaseInterval&&null!=this.storeOptions.reservoirIncreaseAmount)?"function"==typeof(e=this.heartbeat=setInterval((()=>{var e,t,r,s,n;if(s=Date.now(),null!=this.storeOptions.reservoirRefreshInterval&&s>=this._lastReservoirRefresh+this.storeOptions.reservoirRefreshInterval&&(this._lastReservoirRefresh=s,this.storeOptions.reservoir=this.storeOptions.reservoirRefreshAmount,this.instance._drainAll(this.computeCapacity())),null!=this.storeOptions.reservoirIncreaseInterval&&s>=this._lastReservoirIncrease+this.storeOptions.reservoirIncreaseInterval&&(({reservoirIncreaseAmount:e,reservoirIncreaseMaximum:r,reservoir:n}=this.storeOptions),this._lastReservoirIncrease=s,(t=null!=r?Math.min(e,r-n):e)>0))return this.storeOptions.reservoir+=t,this.instance._drainAll(this.computeCapacity())}),this.heartbeatInterval)).unref?e.unref():void 0:clearInterval(this.heartbeat)}async __publish__(e){return await this.yieldLoop(),this.instance.Events.trigger("message",e.toString())}async __disconnect__(e){return await this.yieldLoop(),clearInterval(this.heartbeat),this.Promise.resolve()}yieldLoop(e=0){return new this.Promise((function(t,r){return setTimeout(t,e)}))}computePenalty(){var e;return null!=(e=this.storeOptions.penalty)?e:15*this.storeOptions.minTime||5e3}async __updateSettings__(e){return await this.yieldLoop(),u.overwrite(e,e,this.storeOptions),this._startHeartbeat(),this.instance._drainAll(this.computeCapacity()),!0}async __running__(){return await this.yieldLoop(),this._running}async __queued__(){return await this.yieldLoop(),this.instance.queued()}async __done__(){return await this.yieldLoop(),this._done}async __groupCheck__(e){return await this.yieldLoop(),this._nextRequest+this.timeout<e}computeCapacity(){var e,t;return({maxConcurrent:e,reservoir:t}=this.storeOptions),null!=e&&null!=t?Math.min(e-this._running,t):null!=e?e-this._running:null!=t?t:null}conditionsCheck(e){var t;return null==(t=this.computeCapacity())||e<=t}async __incrementReservoir__(e){var t;return await this.yieldLoop(),t=this.storeOptions.reservoir+=e,this.instance._drainAll(this.computeCapacity()),t}async __currentReservoir__(){return await this.yieldLoop(),this.storeOptions.reservoir}isBlocked(e){return this._unblockTime>=e}check(e,t){return this.conditionsCheck(e)&&this._nextRequest-t<=0}async __check__(e){var t;return await this.yieldLoop(),t=Date.now(),this.check(e,t)}async __register__(e,t,r){var s,n;return await this.yieldLoop(),s=Date.now(),this.conditionsCheck(t)?(this._running+=t,null!=this.storeOptions.reservoir&&(this.storeOptions.reservoir-=t),n=Math.max(this._nextRequest-s,0),this._nextRequest=s+n+this.storeOptions.minTime,{success:!0,wait:n,reservoir:this.storeOptions.reservoir}):{success:!1}}strategyIsBlock(){return 3===this.storeOptions.strategy}async __submit__(e,t){var r,s,n;if(await this.yieldLoop(),null!=this.storeOptions.maxConcurrent&&t>this.storeOptions.maxConcurrent)throw new l(`Impossible to add a job having a weight of ${t} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);return s=Date.now(),n=null!=this.storeOptions.highWater&&e===this.storeOptions.highWater&&!this.check(t,s),(r=this.strategyIsBlock()&&(n||this.isBlocked(s)))&&(this._unblockTime=s+this.computePenalty(),this._nextRequest=this._unblockTime+this.storeOptions.minTime,this.instance._dropAllQueued()),{reachedHWM:n,blocked:r,strategy:this.storeOptions.strategy}}async __free__(e,t){return await this.yieldLoop(),this._running-=t,this._done+=t,this.instance._drainAll(this.computeCapacity()),{running:this._running}}},U=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),B=i,D=g,F=class{constructor(e,t){this.schedule=this.schedule.bind(this),this.name=e,this.Promise=t,this._running=0,this._queue=new f}isEmpty(){return 0===this._queue.length}async _tryToRun(){var e,t,r,s,n,i,o;if(this._running<1&&this._queue.length>0)return this._running++,({task:o,args:e,resolve:n,reject:s}=this._queue.shift()),t=await async function(){try{return i=await o(...e),function(){return n(i)}}catch(e){return r=e,function(){return s(r)}}}(),this._running--,this._tryToRun(),t()}schedule(e,...t){var r,s,n;return n=s=null,r=new this.Promise((function(e,t){return n=e,s=t})),this._queue.push({task:e,args:t,resolve:n,reject:s}),this._tryToRun(),r}};var Q=function(){class e{constructor(t={},...r){var s,n;this._addToQueue=this._addToQueue.bind(this),this._validateOptions(t,r),x.load(t,this.instanceDefaults,this),this._queues=new L(10),this._scheduled={},this._states=new D(["RECEIVED","QUEUED","RUNNING","EXECUTING"].concat(this.trackDoneStatus?["DONE"]:[])),this._limiter=null,this.Events=new B(this),this._submitLock=new F("submit",this.Promise),this._registerLock=new F("register",this.Promise),n=x.load(t,this.storeDefaults,{}),this._store=function(){if("redis"===this.datastore||"ioredis"===this.datastore||null!=this.connection)return s=x.load(t,this.redisStoreDefaults,{}),new U(this,n,s);if("local"===this.datastore)return s=x.load(t,this.localStoreDefaults,{}),new N(this,n,s);throw new e.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`)}.call(this),this._queues.on("leftzero",(()=>{var e;return null!=(e=this._store.heartbeat)&&"function"==typeof e.ref?e.ref():void 0})),this._queues.on("zero",(()=>{var e;return null!=(e=this._store.heartbeat)&&"function"==typeof e.unref?e.unref():void 0}))}_validateOptions(t,r){if(null==t||"object"!=typeof t||0!==r.length)throw new e.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.")}ready(){return this._store.ready}clients(){return this._store.clients}channel(){return`b_${this.id}`}channel_client(){return`b_${this.id}_${this._store.clientId}`}publish(e){return this._store.__publish__(e)}disconnect(e=!0){return this._store.__disconnect__(e)}chain(e){return this._limiter=e,this}queued(e){return this._queues.queued(e)}clusterQueued(){return this._store.__queued__()}empty(){return 0===this.queued()&&this._submitLock.isEmpty()}running(){return this._store.__running__()}done(){return this._store.__done__()}jobStatus(e){return this._states.jobStatus(e)}jobs(e){return this._states.statusJobs(e)}counts(){return this._states.statusCounts()}_randomIndex(){return Math.random().toString(36).slice(2)}check(e=1){return this._store.__check__(e)}_clearGlobalState(e){return null!=this._scheduled[e]&&(clearTimeout(this._scheduled[e].expiration),delete this._scheduled[e],!0)}async _free(e,t,r,s){var n,i;try{if(({running:i}=await this._store.__free__(e,r.weight)),this.Events.trigger("debug",`Freed ${r.id}`,s),0===i&&this.empty())return this.Events.trigger("idle")}catch(e){return n=e,this.Events.trigger("error",n)}}_run(e,t,r){var s,n,i;return t.doRun(),s=this._clearGlobalState.bind(this,e),i=this._run.bind(this,e,t),n=this._free.bind(this,e,t),this._scheduled[e]={timeout:setTimeout((()=>t.doExecute(this._limiter,s,i,n)),r),expiration:null!=t.options.expiration?setTimeout((function(){return t.doExpire(s,i,n)}),r+t.options.expiration):void 0,job:t}}_drainOne(e){return this._registerLock.schedule((()=>{var t,r,s,n,i;return 0===this.queued()?this.Promise.resolve(null):(i=this._queues.getFirst(),({options:n,args:t}=s=i.first()),null!=e&&n.weight>e?this.Promise.resolve(null):(this.Events.trigger("debug",`Draining ${n.id}`,{args:t,options:n}),r=this._randomIndex(),this._store.__register__(r,n.weight,n.expiration).then((({success:e,wait:o,reservoir:a})=>{var c;return this.Events.trigger("debug",`Drained ${n.id}`,{success:e,args:t,options:n}),e?(i.shift(),(c=this.empty())&&this.Events.trigger("empty"),0===a&&this.Events.trigger("depleted",c),this._run(r,s,o),this.Promise.resolve(n.weight)):this.Promise.resolve(null)}))))}))}_drainAll(e,t=0){return this._drainOne(e).then((r=>{var s;return null!=r?(s=null!=e?e-r:e,this._drainAll(s,t+r)):this.Promise.resolve(t)})).catch((e=>this.Events.trigger("error",e)))}_dropAllQueued(e){return this._queues.shiftAll((function(t){return t.doDrop({message:e})}))}stop(t={}){var r,s;return t=x.load(t,this.stopDefaults),s=e=>{var t;return t=()=>{var t;return(t=this._states.counts)[0]+t[1]+t[2]+t[3]===e},new this.Promise(((e,r)=>t()?e():this.on("done",(()=>{if(t())return this.removeAllListeners("done"),e()}))))},r=t.dropWaitingJobs?(this._run=function(e,r){return r.doDrop({message:t.dropErrorMessage})},this._drainOne=()=>this.Promise.resolve(null),this._registerLock.schedule((()=>this._submitLock.schedule((()=>{var e,r,n;for(e in r=this._scheduled)n=r[e],"RUNNING"===this.jobStatus(n.job.options.id)&&(clearTimeout(n.timeout),clearTimeout(n.expiration),n.job.doDrop({message:t.dropErrorMessage}));return this._dropAllQueued(t.dropErrorMessage),s(0)}))))):this.schedule({priority:9,weight:0},(()=>s(1))),this._receive=function(r){return r._reject(new e.prototype.BottleneckError(t.enqueueErrorMessage))},this.stop=()=>this.Promise.reject(new e.prototype.BottleneckError("stop() has already been called")),r}async _addToQueue(t){var r,s,n,i,o,a,c;({args:r,options:i}=t);try{({reachedHWM:o,blocked:s,strategy:c}=await this._store.__submit__(this.queued(),i.weight))}catch(e){return n=e,this.Events.trigger("debug",`Could not queue ${i.id}`,{args:r,options:i,error:n}),t.doDrop({error:n}),!1}return s?(t.doDrop(),!0):o&&(null!=(a=c===e.prototype.strategy.LEAK?this._queues.shiftLastFrom(i.priority):c===e.prototype.strategy.OVERFLOW_PRIORITY?this._queues.shiftLastFrom(i.priority+1):c===e.prototype.strategy.OVERFLOW?t:void 0)&&a.doDrop(),null==a||c===e.prototype.strategy.OVERFLOW)?(null==a&&t.doDrop(),o):(t.doQueue(o,s),this._queues.push(t),await this._drainAll(),o)}_receive(t){return null!=this._states.jobStatus(t.options.id)?(t._reject(new e.prototype.BottleneckError(`A job with the same id already exists (id=${t.options.id})`)),!1):(t.doReceive(),this._submitLock.schedule(this._addToQueue,t))}submit(...e){var t,r,s,n,i,o,a;return"function"==typeof e[0]?(i=e,[r,...e]=i,[t]=H.call(e,-1),n=x.load({},this.jobDefaults)):(o=e,[n,r,...e]=o,[t]=H.call(e,-1),n=x.load(n,this.jobDefaults)),a=(...e)=>new this.Promise((function(t,s){return r(...e,(function(...e){return(null!=e[0]?s:t)(e)}))})),(s=new P(a,e,n,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise)).promise.then((function(e){return"function"==typeof t?t(...e):void 0})).catch((function(e){return Array.isArray(e)?"function"==typeof t?t(...e):void 0:"function"==typeof t?t(e):void 0})),this._receive(s)}schedule(...e){var t,r,s;return"function"==typeof e[0]?([s,...e]=e,r={}):[r,s,...e]=e,t=new P(s,e,r,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),this._receive(t),t.promise}wrap(e){var t,r;return t=this.schedule.bind(this),(r=function(...r){return t(e.bind(this),...r)}).withOptions=function(r,...s){return t(r,e,...s)},r}async updateSettings(e={}){return await this._store.__updateSettings__(x.overwrite(e,this.storeDefaults)),x.overwrite(e,this.instanceDefaults,this),this}currentReservoir(){return this._store.__currentReservoir__()}incrementReservoir(e=0){return this._store.__incrementReservoir__(e)}}return e.default=e,e.Events=B,e.version=e.prototype.version=M.version,e.strategy=e.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3},e.BottleneckError=e.prototype.BottleneckError=c,e.Group=e.prototype.Group=O,e.RedisConnection=e.prototype.RedisConnection=k,e.IORedisConnection=e.prototype.IORedisConnection=I,e.Batcher=e.prototype.Batcher=G,e.prototype.jobDefaults={priority:5,weight:1,expiration:null,id:"<no-id>"},e.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:e.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null},e.prototype.localStoreDefaults={Promise,timeout:null,heartbeatInterval:250},e.prototype.redisStoreDefaults={Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:!1,connection:null},e.prototype.instanceDefaults={datastore:"local",connection:null,id:"<no-id>",rejectOnDrop:!0,trackDoneStatus:!1,Promise},e.prototype.stopDefaults={enqueueErrorMessage:"This limiter has been stopped and cannot accept new jobs.",dropWaitingJobs:!0,dropErrorMessage:"This limiter has been stopped."},e}.call(r);return Q},e.exports=t()},6409:e=>{e.exports=function(e){return new Buffer(e).toString("base64")}},7741:(e,t,r)=>{"use strict";const s=r(2037),n=/\s+at.*(?:\(|\s)(.*)\)?/,i=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,o=void 0===s.homedir?"":s.homedir();e.exports=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(n);if(null===t||!t[1])return!0;const r=t[1];return!r.includes(".app/Contents/Resources/electron.asar")&&!r.includes(".app/Contents/Resources/default_app.asar")&&!i.test(r)})).filter((e=>""!==e.trim())).map((e=>t.pretty?e.replace(n,((e,t)=>e.replace(t,t.replace(o,"~")))):e)).join("\n"))},2327:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Deprecation:()=>s});class s extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}}},5602:e=>{"use strict";e.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},"string"!=typeof e)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if("string"!=typeof r.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(0===t)return e;const s=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(s,r.indent.repeat(t))}},4970:e=>{"use strict";const t=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;t.writable=e=>t(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,t.readable=e=>t(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,t.duplex=e=>t.writable(e)&&t.readable(e),t.transform=e=>t.duplex(e)&&"function"==typeof e._transform,e.exports=t},789:(e,t,r)=>{"use strict";const s=r(7147),n=r(1017),{promisify:i}=r(3837),o=r(9259).satisfies(process.version,">=10.12.0"),a=e=>{if("win32"===process.platform&&/[<>:"|?*]/.test(e.replace(n.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}},c=e=>({mode:511,fs:s,...e}),l=e=>{const t=new Error(`operation not permitted, mkdir '${e}'`);return t.code="EPERM",t.errno=-4048,t.path=e,t.syscall="mkdir",t};e.exports=async(e,t)=>{a(e),t=c(t);const r=i(t.fs.mkdir),u=i(t.fs.stat);if(o&&t.fs.mkdir===s.mkdir){const s=n.resolve(e);return await r(s,{mode:t.mode,recursive:!0}),s}const h=async e=>{try{return await r(e,t.mode),e}catch(t){if("EPERM"===t.code)throw t;if("ENOENT"===t.code){if(n.dirname(e)===e)throw l(e);if(t.message.includes("null bytes"))throw t;return await h(n.dirname(e)),h(e)}try{if(!(await u(e)).isDirectory())throw new Error("The path is not a directory")}catch(e){throw t}return e}};return h(n.resolve(e))},e.exports.sync=(e,t)=>{if(a(e),t=c(t),o&&t.fs.mkdirSync===s.mkdirSync){const r=n.resolve(e);return s.mkdirSync(r,{mode:t.mode,recursive:!0}),r}const r=e=>{try{t.fs.mkdirSync(e,t.mode)}catch(s){if("EPERM"===s.code)throw s;if("ENOENT"===s.code){if(n.dirname(e)===e)throw l(e);if(s.message.includes("null bytes"))throw s;return r(n.dirname(e)),r(e)}try{if(!t.fs.statSync(e).isDirectory())throw new Error("The path is not a directory")}catch(e){throw s}}return e};return r(n.resolve(e))}},9259:(e,t)=>{var r;t=e.exports=_,r="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var s=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=s-6,o=t.re=[],a=t.safeRe=[],c=t.src=[],l=t.tokens={},u=0;function h(e){l[e]=u++}var d="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",s],[d,i]];function f(e){for(var t=0;t<p.length;t++){var r=p[t][0],s=p[t][1];e=e.split(r+"*").join(r+"{0,"+s+"}").split(r+"+").join(r+"{1,"+s+"}")}return e}h("NUMERICIDENTIFIER"),c[l.NUMERICIDENTIFIER]="0|[1-9]\\d*",h("NUMERICIDENTIFIERLOOSE"),c[l.NUMERICIDENTIFIERLOOSE]="\\d+",h("NONNUMERICIDENTIFIER"),c[l.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+d+"*",h("MAINVERSION"),c[l.MAINVERSION]="("+c[l.NUMERICIDENTIFIER]+")\\.("+c[l.NUMERICIDENTIFIER]+")\\.("+c[l.NUMERICIDENTIFIER]+")",h("MAINVERSIONLOOSE"),c[l.MAINVERSIONLOOSE]="("+c[l.NUMERICIDENTIFIERLOOSE]+")\\.("+c[l.NUMERICIDENTIFIERLOOSE]+")\\.("+c[l.NUMERICIDENTIFIERLOOSE]+")",h("PRERELEASEIDENTIFIER"),c[l.PRERELEASEIDENTIFIER]="(?:"+c[l.NUMERICIDENTIFIER]+"|"+c[l.NONNUMERICIDENTIFIER]+")",h("PRERELEASEIDENTIFIERLOOSE"),c[l.PRERELEASEIDENTIFIERLOOSE]="(?:"+c[l.NUMERICIDENTIFIERLOOSE]+"|"+c[l.NONNUMERICIDENTIFIER]+")",h("PRERELEASE"),c[l.PRERELEASE]="(?:-("+c[l.PRERELEASEIDENTIFIER]+"(?:\\."+c[l.PRERELEASEIDENTIFIER]+")*))",h("PRERELEASELOOSE"),c[l.PRERELEASELOOSE]="(?:-?("+c[l.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+c[l.PRERELEASEIDENTIFIERLOOSE]+")*))",h("BUILDIDENTIFIER"),c[l.BUILDIDENTIFIER]=d+"+",h("BUILD"),c[l.BUILD]="(?:\\+("+c[l.BUILDIDENTIFIER]+"(?:\\."+c[l.BUILDIDENTIFIER]+")*))",h("FULL"),h("FULLPLAIN"),c[l.FULLPLAIN]="v?"+c[l.MAINVERSION]+c[l.PRERELEASE]+"?"+c[l.BUILD]+"?",c[l.FULL]="^"+c[l.FULLPLAIN]+"$",h("LOOSEPLAIN"),c[l.LOOSEPLAIN]="[v=\\s]*"+c[l.MAINVERSIONLOOSE]+c[l.PRERELEASELOOSE]+"?"+c[l.BUILD]+"?",h("LOOSE"),c[l.LOOSE]="^"+c[l.LOOSEPLAIN]+"$",h("GTLT"),c[l.GTLT]="((?:<|>)?=?)",h("XRANGEIDENTIFIERLOOSE"),c[l.XRANGEIDENTIFIERLOOSE]=c[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",h("XRANGEIDENTIFIER"),c[l.XRANGEIDENTIFIER]=c[l.NUMERICIDENTIFIER]+"|x|X|\\*",h("XRANGEPLAIN"),c[l.XRANGEPLAIN]="[v=\\s]*("+c[l.XRANGEIDENTIFIER]+")(?:\\.("+c[l.XRANGEIDENTIFIER]+")(?:\\.("+c[l.XRANGEIDENTIFIER]+")(?:"+c[l.PRERELEASE]+")?"+c[l.BUILD]+"?)?)?",h("XRANGEPLAINLOOSE"),c[l.XRANGEPLAINLOOSE]="[v=\\s]*("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:"+c[l.PRERELEASELOOSE]+")?"+c[l.BUILD]+"?)?)?",h("XRANGE"),c[l.XRANGE]="^"+c[l.GTLT]+"\\s*"+c[l.XRANGEPLAIN]+"$",h("XRANGELOOSE"),c[l.XRANGELOOSE]="^"+c[l.GTLT]+"\\s*"+c[l.XRANGEPLAINLOOSE]+"$",h("COERCE"),c[l.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",h("COERCERTL"),o[l.COERCERTL]=new RegExp(c[l.COERCE],"g"),a[l.COERCERTL]=new RegExp(f(c[l.COERCE]),"g"),h("LONETILDE"),c[l.LONETILDE]="(?:~>?)",h("TILDETRIM"),c[l.TILDETRIM]="(\\s*)"+c[l.LONETILDE]+"\\s+",o[l.TILDETRIM]=new RegExp(c[l.TILDETRIM],"g"),a[l.TILDETRIM]=new RegExp(f(c[l.TILDETRIM]),"g"),h("TILDE"),c[l.TILDE]="^"+c[l.LONETILDE]+c[l.XRANGEPLAIN]+"$",h("TILDELOOSE"),c[l.TILDELOOSE]="^"+c[l.LONETILDE]+c[l.XRANGEPLAINLOOSE]+"$",h("LONECARET"),c[l.LONECARET]="(?:\\^)",h("CARETTRIM"),c[l.CARETTRIM]="(\\s*)"+c[l.LONECARET]+"\\s+",o[l.CARETTRIM]=new RegExp(c[l.CARETTRIM],"g"),a[l.CARETTRIM]=new RegExp(f(c[l.CARETTRIM]),"g"),h("CARET"),c[l.CARET]="^"+c[l.LONECARET]+c[l.XRANGEPLAIN]+"$",h("CARETLOOSE"),c[l.CARETLOOSE]="^"+c[l.LONECARET]+c[l.XRANGEPLAINLOOSE]+"$",h("COMPARATORLOOSE"),c[l.COMPARATORLOOSE]="^"+c[l.GTLT]+"\\s*("+c[l.LOOSEPLAIN]+")$|^$",h("COMPARATOR"),c[l.COMPARATOR]="^"+c[l.GTLT]+"\\s*("+c[l.FULLPLAIN]+")$|^$",h("COMPARATORTRIM"),c[l.COMPARATORTRIM]="(\\s*)"+c[l.GTLT]+"\\s*("+c[l.LOOSEPLAIN]+"|"+c[l.XRANGEPLAIN]+")",o[l.COMPARATORTRIM]=new RegExp(c[l.COMPARATORTRIM],"g"),a[l.COMPARATORTRIM]=new RegExp(f(c[l.COMPARATORTRIM]),"g"),h("HYPHENRANGE"),c[l.HYPHENRANGE]="^\\s*("+c[l.XRANGEPLAIN]+")\\s+-\\s+("+c[l.XRANGEPLAIN]+")\\s*$",h("HYPHENRANGELOOSE"),c[l.HYPHENRANGELOOSE]="^\\s*("+c[l.XRANGEPLAINLOOSE]+")\\s+-\\s+("+c[l.XRANGEPLAINLOOSE]+")\\s*$",h("STAR"),c[l.STAR]="(<|>)?=?\\s*\\*";for(var g=0;g<u;g++)r(g,c[g]),o[g]||(o[g]=new RegExp(c[g]),a[g]=new RegExp(f(c[g])));function m(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof _)return e;if("string"!=typeof e)return null;if(e.length>s)return null;if(!(t.loose?a[l.LOOSE]:a[l.FULL]).test(e))return null;try{return new _(e,t)}catch(e){return null}}function _(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof _){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>s)throw new TypeError("version is longer than "+s+" characters");if(!(this instanceof _))return new _(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?a[l.LOOSE]:a[l.FULL]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<n)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}t.parse=m,t.valid=function(e,t){var r=m(e,t);return r?r.version:null},t.clean=function(e,t){var r=m(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},t.SemVer=_,_.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},_.prototype.toString=function(){return this.version},_.prototype.compare=function(e){return r("SemVer.compare",this.version,this.options,e),e instanceof _||(e=new _(e,this.options)),this.compareMain(e)||this.comparePre(e)},_.prototype.compareMain=function(e){return e instanceof _||(e=new _(e,this.options)),E(this.major,e.major)||E(this.minor,e.minor)||E(this.patch,e.patch)},_.prototype.comparePre=function(e){if(e instanceof _||(e=new _(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var s=this.prerelease[t],n=e.prerelease[t];if(r("prerelease compare",t,s,n),void 0===s&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===s)return-1;if(s!==n)return E(s,n)}while(++t)},_.prototype.compareBuild=function(e){e instanceof _||(e=new _(e,this.options));var t=0;do{var s=this.build[t],n=e.build[t];if(r("prerelease compare",t,s,n),void 0===s&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===s)return-1;if(s!==n)return E(s,n)}while(++t)},_.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,s){"string"==typeof r&&(s=r,r=void 0);try{return new _(e,r).inc(t,s).version}catch(e){return null}},t.diff=function(e,t){if(v(e,t))return null;var r=m(e),s=m(t),n="";if(r.prerelease.length||s.prerelease.length){n="pre";var i="prerelease"}for(var o in r)if(("major"===o||"minor"===o||"patch"===o)&&r[o]!==s[o])return n+o;return i},t.compareIdentifiers=E;var A=/^[0-9]+$/;function E(e,t){var r=A.test(e),s=A.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1}function y(e,t,r){return new _(e,r).compare(new _(t,r))}function b(e,t,r){return y(e,t,r)>0}function w(e,t,r){return y(e,t,r)<0}function v(e,t,r){return 0===y(e,t,r)}function S(e,t,r){return 0!==y(e,t,r)}function k(e,t,r){return y(e,t,r)>=0}function I(e,t,r){return y(e,t,r)<=0}function T(e,t,r,s){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return v(e,r,s);case"!=":return S(e,r,s);case">":return b(e,r,s);case">=":return k(e,r,s);case"<":return w(e,r,s);case"<=":return I(e,r,s);default:throw new TypeError("Invalid operator: "+t)}}function C(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof C){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof C))return new C(e,t);e=e.trim().split(/\s+/).join(" "),r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===O?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return E(t,e)},t.major=function(e,t){return new _(e,t).major},t.minor=function(e,t){return new _(e,t).minor},t.patch=function(e,t){return new _(e,t).patch},t.compare=y,t.compareLoose=function(e,t){return y(e,t,!0)},t.compareBuild=function(e,t,r){var s=new _(e,r),n=new _(t,r);return s.compare(n)||s.compareBuild(n)},t.rcompare=function(e,t,r){return y(t,e,r)},t.sort=function(e,r){return e.sort((function(e,s){return t.compareBuild(e,s,r)}))},t.rsort=function(e,r){return e.sort((function(e,s){return t.compareBuild(s,e,r)}))},t.gt=b,t.lt=w,t.eq=v,t.neq=S,t.gte=k,t.lte=I,t.cmp=T,t.Comparator=C;var O={};function R(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof R)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new R(e.raw,t);if(e instanceof C)return new R(e.value,t);if(!(this instanceof R))return new R(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function B(e,t){for(var r=!0,s=e.slice(),n=s.pop();r&&s.length;)r=s.every((function(e){return n.intersects(e,t)})),n=s.pop();return r}function P(e){return!e||"x"===e.toLowerCase()||"*"===e}function N(e,t,r,s,n,i,o,a,c,l,u,h,d){return((t=P(r)?"":P(s)?">="+r+".0.0":P(n)?">="+r+"."+s+".0":">="+t)+" "+(a=P(c)?"":P(l)?"<"+(+c+1)+".0.0":P(u)?"<"+c+"."+(+l+1)+".0":h?"<="+c+"."+l+"."+u+"-"+h:"<="+a)).trim()}function L(e,t,s){for(var n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!s.includePrerelease){for(n=0;n<e.length;n++)if(r(e[n].semver),e[n].semver!==O&&e[n].semver.prerelease.length>0){var i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function U(e,t,r){try{t=new R(t,r)}catch(e){return!1}return t.test(e)}function D(e,t,r,s){var n,i,o,a,c;switch(e=new _(e,s),t=new R(t,s),r){case">":n=b,i=I,o=w,a=">",c=">=";break;case"<":n=w,i=k,o=b,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(U(e,t,s))return!1;for(var l=0;l<t.set.length;++l){var u=t.set[l],h=null,d=null;if(u.forEach((function(e){e.semver===O&&(e=new C(">=0.0.0")),h=h||e,d=d||e,n(e.semver,h.semver,s)?h=e:o(e.semver,d.semver,s)&&(d=e)})),h.operator===a||h.operator===c)return!1;if((!d.operator||d.operator===a)&&i(e,d.semver))return!1;if(d.operator===c&&o(e,d.semver))return!1}return!0}C.prototype.parse=function(e){var t=this.options.loose?a[l.COMPARATORLOOSE]:a[l.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new _(r[2],this.options.loose):this.semver=O},C.prototype.toString=function(){return this.value},C.prototype.test=function(e){if(r("Comparator.test",e,this.options.loose),this.semver===O||e===O)return!0;if("string"==typeof e)try{e=new _(e,this.options)}catch(e){return!1}return T(e,this.operator,this.semver,this.options)},C.prototype.intersects=function(e,t){if(!(e instanceof C))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new R(e.value,t),U(this.value,r,t));if(""===e.operator)return""===e.value||(r=new R(this.value,t),U(e.semver,r,t));var s=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=T(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=T(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return s||n||i&&o||a||c},t.Range=R,R.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},R.prototype.toString=function(){return this.range},R.prototype.parseRange=function(e){var t=this.options.loose,s=t?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];e=e.replace(s,N),r("hyphen replace",e),e=e.replace(a[l.COMPARATORTRIM],"$1$2$3"),r("comparator trim",e,a[l.COMPARATORTRIM]),e=(e=(e=e.replace(a[l.TILDETRIM],"$1~")).replace(a[l.CARETTRIM],"$1^")).split(/\s+/).join(" ");var n=t?a[l.COMPARATORLOOSE]:a[l.COMPARATOR],i=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var s=t.loose?a[l.CARETLOOSE]:a[l.CARET];return e.replace(s,(function(t,s,n,i,o){var a;return r("caret",e,t,s,n,i,o),P(s)?a="":P(n)?a=">="+s+".0.0 <"+(+s+1)+".0.0":P(i)?a="0"===s?">="+s+"."+n+".0 <"+s+"."+(+n+1)+".0":">="+s+"."+n+".0 <"+(+s+1)+".0.0":o?(r("replaceCaret pr",o),a="0"===s?"0"===n?">="+s+"."+n+"."+i+"-"+o+" <"+s+"."+n+"."+(+i+1):">="+s+"."+n+"."+i+"-"+o+" <"+s+"."+(+n+1)+".0":">="+s+"."+n+"."+i+"-"+o+" <"+(+s+1)+".0.0"):(r("no pr"),a="0"===s?"0"===n?">="+s+"."+n+"."+i+" <"+s+"."+n+"."+(+i+1):">="+s+"."+n+"."+i+" <"+s+"."+(+n+1)+".0":">="+s+"."+n+"."+i+" <"+(+s+1)+".0.0"),r("caret return",a),a}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var s=t.loose?a[l.TILDELOOSE]:a[l.TILDE];return e.replace(s,(function(t,s,n,i,o){var a;return r("tilde",e,t,s,n,i,o),P(s)?a="":P(n)?a=">="+s+".0.0 <"+(+s+1)+".0.0":P(i)?a=">="+s+"."+n+".0 <"+s+"."+(+n+1)+".0":o?(r("replaceTilde pr",o),a=">="+s+"."+n+"."+i+"-"+o+" <"+s+"."+(+n+1)+".0"):a=">="+s+"."+n+"."+i+" <"+s+"."+(+n+1)+".0",r("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var s=t.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return e.replace(s,(function(s,n,i,o,a,c){r("xRange",e,s,n,i,o,a,c);var l=P(i),u=l||P(o),h=u||P(a),d=h;return"="===n&&d&&(n=""),c=t.includePrerelease?"-0":"",l?s=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(u&&(o=0),a=0,">"===n?(n=">=",u?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),s=n+i+"."+o+"."+a+c):u?s=">="+i+".0.0"+c+" <"+(+i+1)+".0.0"+c:h&&(s=">="+i+"."+o+".0"+c+" <"+i+"."+(+o+1)+".0"+c),r("xRange return",s),s}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(a[l.STAR],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter((function(e){return!!e.match(n)}))),i.map((function(e){return new C(e,this.options)}),this)},R.prototype.intersects=function(e,t){if(!(e instanceof R))throw new TypeError("a Range is required");return this.set.some((function(r){return B(r,t)&&e.set.some((function(e){return B(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new R(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},R.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new _(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(L(this.set[t],e,this.options))return!0;return!1},t.satisfies=U,t.maxSatisfying=function(e,t,r){var s=null,n=null;try{var i=new R(t,r)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(s&&-1!==n.compare(e)||(n=new _(s=e,r)))})),s},t.minSatisfying=function(e,t,r){var s=null,n=null;try{var i=new R(t,r)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(s&&1!==n.compare(e)||(n=new _(s=e,r)))})),s},t.minVersion=function(e,t){e=new R(e,t);var r=new _("0.0.0");if(e.test(r))return r;if(r=new _("0.0.0-0"),e.test(r))return r;r=null;for(var s=0;s<e.set.length;++s)e.set[s].forEach((function(e){var t=new _(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!b(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return r&&e.test(r)?r:null},t.validRange=function(e,t){try{return new R(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return D(e,t,"<",r)},t.gtr=function(e,t,r){return D(e,t,">",r)},t.outside=D,t.prerelease=function(e,t){var r=m(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new R(e,r),t=new R(t,r),e.intersects(t)},t.coerce=function(e,t){if(e instanceof _)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var s;(s=a[l.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&s.index+s[0].length===r.index+r[0].length||(r=s),a[l.COERCERTL].lastIndex=s.index+s[1].length+s[2].length;a[l.COERCERTL].lastIndex=-1}else r=e.match(a[l.COERCE]);return null===r?null:m(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}},1329:(e,t,r)=>{"use strict";r.r(t),r.d(t,{App:()=>be,OAuthApp:()=>we,Octokit:()=>ye,RequestError:()=>I.RequestError,createNodeMiddleware:()=>_e});var s=r(1105);function n(e,t,r){const s="function"==typeof t?t.endpoint(r):e.request.endpoint(t,r),n="function"==typeof t?t:e.request,i=s.method,o=s.headers;let a=s.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{const e=function(e){if(!e.data)return{...e,data:[]};if(!("total_count"in e.data)||"url"in e.data)return e;const t=e.data.incomplete_results,r=e.data.repository_selection,s=e.data.total_count;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count;const n=Object.keys(e.data)[0],i=e.data[n];return e.data=i,void 0!==t&&(e.data.incomplete_results=t),void 0!==r&&(e.data.repository_selection=r),e.data.total_count=s,e}(await n({method:i,url:a,headers:o}));return a=((e.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1],{value:e}}catch(e){if(409!==e.status)throw e;return a="",{value:{status:200,headers:{},data:[]}}}}})}}function i(e,t,r,s){return"function"==typeof r&&(s=r,r=void 0),o(e,[],n(e,t,r)[Symbol.asyncIterator](),s)}function o(e,t,r,s){return r.next().then((n=>{if(n.done)return t;let i=!1;return t=t.concat(s?s(n.value,(function(){i=!0})):n.value.data),i?t:o(e,t,r,s)}))}var a=Object.assign(i,{iterator:n});function c(e){return{paginate:Object.assign(i.bind(null,e),{iterator:n.bind(null,e)})}}c.VERSION="9.1.4";class l extends Error{constructor(e,t){super(((e,t)=>`The cursor at "${e.join(",")}" did not change its value "${t}" after a page transition. Please make sure your that your query is set up correctly.`)(e.pathInQuery,t)),this.pageInfo=e,this.cursorValue=t,this.name="MissingCursorChangeError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class u extends Error{constructor(e){super(`No pageInfo property found in response. Please make sure to specify the pageInfo in your query. Response-Data: ${JSON.stringify(e,null,2)}`),this.response=e,this.name="MissingPageInfo",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}function h(e){const t=d(e,"pageInfo");if(0===t.length)throw new u(e);return t}const d=(e,t,r=[])=>{for(const n of Object.keys(e)){const i=[...r,n],o=e[n];if(o.hasOwnProperty(t))return i;if(s=o,"[object Object]"===Object.prototype.toString.call(s)){const e=d(o,t,i);if(e.length>0)return e}}var s;return[]},p=(e,t)=>t.reduce(((e,t)=>e[t]),e),f=(e,t,r)=>{const s=t[t.length-1],n=[...t].slice(0,-1),i=p(e,n);i[s]="function"==typeof r?r(i[s]):r},g=e=>e.hasOwnProperty("hasNextPage"),m=e=>(t,r={})=>{let s=!0,n={...r};return{[Symbol.asyncIterator]:()=>({async next(){if(!s)return{done:!0,value:{}};const r=await e.graphql(t,n),i=(e=>{const t=h(e);return{pathInQuery:t,pageInfo:p(e,[...t,"pageInfo"])}})(r),o=(a=i.pageInfo,g(a)?a.endCursor:a.startCursor);var a;if(s=(e=>g(e)?e.hasNextPage:e.hasPreviousPage)(i.pageInfo),s&&o===n.cursor)throw new l(i,o);return n={...n,cursor:o},{done:!1,value:r}}})}},_=(e,t)=>{if(0===Object.keys(e).length)return Object.assign(e,t);const r=h(e),s=[...r,"nodes"],n=p(t,s);n&&f(e,s,(e=>[...e,...n]));const i=[...r,"edges"],o=p(t,i);o&&f(e,i,(e=>[...e,...o]));const a=[...r,"pageInfo"];return f(e,a,p(t,a)),e},A=e=>{const t=m(e);return async(e,r={})=>{let s={};for await(const n of t(e,r))s=_(s,n);return s}};const E=new Map;for(const[e,t]of Object.entries({actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repositories/{repository_id}/environments/{environment_name}/variables"],createOrUpdateEnvironmentSecret:["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteEnvironmentSecret:["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getEnvironmentPublicKey:["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listEnvironmentSecrets:["GET /repositories/{repository_id}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repositories/{repository_id}/environments/{environment_name}/variables"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotForBusinessSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotForBusinessSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{cancelImport:["DELETE /repos/{owner}/{repo}/import",{},{deprecated:"octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"}],deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getCommitAuthors:["GET /repos/{owner}/{repo}/import/authors",{},{deprecated:"octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"}],getImportStatus:["GET /repos/{owner}/{repo}/import",{},{deprecated:"octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"}],getLargeFiles:["GET /repos/{owner}/{repo}/import/large_files",{},{deprecated:"octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"}],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],mapCommitAuthor:["PATCH /repos/{owner}/{repo}/import/authors/{author_id}",{},{deprecated:"octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"}],setLfsPreference:["PATCH /repos/{owner}/{repo}/import/lfs",{},{deprecated:"octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],startImport:["PUT /repos/{owner}/{repo}/import",{},{deprecated:"octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"}],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"],updateImport:["PATCH /repos/{owner}/{repo}/import",{},{deprecated:"octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"}]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createInvitation:["POST /orgs/{org}/invitations"],createOrUpdateCustomProperties:["PATCH /orgs/{org}/properties/schema"],createOrUpdateCustomPropertiesValuesForRepos:["PATCH /orgs/{org}/properties/values"],createOrUpdateCustomProperty:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],createWebhook:["POST /orgs/{org}/hooks"],delete:["DELETE /orgs/{org}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],enableOrDisableSecurityProductOnAllOrgRepos:["POST /orgs/{org}/{security_product}/{enablement}"],get:["GET /orgs/{org}"],getAllCustomProperties:["GET /orgs/{org}/properties/schema"],getCustomProperty:["GET /orgs/{org}/properties/schema/{custom_property_name}"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listBlockedUsers:["GET /orgs/{org}/blocks"],listCustomPropertiesValuesForRepos:["GET /orgs/{org}/properties/values"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers"],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeCustomProperty:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}"],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},projects:{addCollaborator:["PUT /projects/{project_id}/collaborators/{username}"],createCard:["POST /projects/columns/{column_id}/cards"],createColumn:["POST /projects/{project_id}/columns"],createForAuthenticatedUser:["POST /user/projects"],createForOrg:["POST /orgs/{org}/projects"],createForRepo:["POST /repos/{owner}/{repo}/projects"],delete:["DELETE /projects/{project_id}"],deleteCard:["DELETE /projects/columns/cards/{card_id}"],deleteColumn:["DELETE /projects/columns/{column_id}"],get:["GET /projects/{project_id}"],getCard:["GET /projects/columns/cards/{card_id}"],getColumn:["GET /projects/columns/{column_id}"],getPermissionForUser:["GET /projects/{project_id}/collaborators/{username}/permission"],listCards:["GET /projects/columns/{column_id}/cards"],listCollaborators:["GET /projects/{project_id}/collaborators"],listColumns:["GET /projects/{project_id}/columns"],listForOrg:["GET /orgs/{org}/projects"],listForRepo:["GET /repos/{owner}/{repo}/projects"],listForUser:["GET /users/{username}/projects"],moveCard:["POST /projects/columns/cards/{card_id}/moves"],moveColumn:["POST /projects/columns/{column_id}/moves"],removeCollaborator:["DELETE /projects/{project_id}/collaborators/{username}"],update:["PATCH /projects/{project_id}"],updateCard:["PATCH /projects/columns/cards/{card_id}"],updateColumn:["PATCH /projects/columns/{column_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployment"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createTagProtection:["POST /repos/{owner}/{repo}/tags/protection"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteTagProtection:["DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getCustomPropertiesValues:["GET /repos/{owner}/{repo}/properties/values"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTagProtection:["GET /repos/{owner}/{repo}/tags/protection"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/secret-scanning/alerts"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"]},securityAdvisories:{createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateProjectPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForProjectInOrg:["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listProjectsInOrg:["GET /orgs/{org}/teams/{team_slug}/projects"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeProjectInOrg:["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}}))for(const[r,s]of Object.entries(t)){const[t,n,i]=s,[o,a]=t.split(/ /),c=Object.assign({method:o,url:a},n);E.has(e)||E.set(e,new Map),E.get(e).set(r,{scope:e,methodName:r,endpointDefaults:c,decorations:i})}const y={has:({scope:e},t)=>E.get(e).has(t),getOwnPropertyDescriptor(e,t){return{value:this.get(e,t),configurable:!0,writable:!0,enumerable:!0}},defineProperty:(e,t,r)=>(Object.defineProperty(e.cache,t,r),!0),deleteProperty:(e,t)=>(delete e.cache[t],!0),ownKeys:({scope:e})=>[...E.get(e).keys()],set:(e,t,r)=>e.cache[t]=r,get({octokit:e,scope:t,cache:r},s){if(r[s])return r[s];const n=E.get(t).get(s);if(!n)return;const{endpointDefaults:i,decorations:o}=n;return r[s]=o?function(e,t,r,s,n){const i=e.request.defaults(s);return Object.assign((function(...s){let o=i.endpoint.merge(...s);if(n.mapToData)return o=Object.assign({},o,{data:o[n.mapToData],[n.mapToData]:void 0}),i(o);if(n.renamed){const[s,i]=n.renamed;e.log.warn(`octokit.${t}.${r}() has been renamed to octokit.${s}.${i}()`)}if(n.deprecated&&e.log.warn(n.deprecated),n.renamedParameters){const o=i.endpoint.merge(...s);for(const[s,i]of Object.entries(n.renamedParameters))s in o&&(e.log.warn(`"${s}" parameter is deprecated for "octokit.${t}.${r}()". Use "${i}" instead`),i in o||(o[i]=o[s]),delete o[s]);return i(o)}return i(...s)}),i)}(e,t,s,i,o):e.request.defaults(i),r[s]}};function b(e){const t={};for(const r of E.keys())t[r]=new Proxy({octokit:e,scope:r,cache:{}},y);return t}function w(e){return{rest:b(e)}}async function v(e,t,r,s){if(!r.request||!r.request.request)throw r;if(r.status>=400&&!e.doNotRetry.includes(r.status)){const n=null!=s.request.retries?s.request.retries:e.retries,i=Math.pow((s.request.retryCount||0)+1,2);throw t.retry.retryRequest(r,n,i)}throw r}w.VERSION="10.2.0";var S=r(1209),k=r.n(S),I=r(9891);async function T(e,t,r,s){const n=new(k());return n.on("failed",(function(t,r){const n=~~t.request.request.retries,i=~~t.request.request.retryAfter;if(s.request.retryCount=r.retryCount+1,n>r.retryCount)return i*e.retryAfterBaseValue})),n.schedule(C.bind(null,e,t,r),s)}async function C(e,t,r,s){const n=await r(r,s);return n.data&&n.data.errors&&/Something went wrong while executing your query/.test(n.data.errors[0].message)?v(e,t,new I.RequestError(n.data.errors[0].message,500,{request:s,response:n}),s):n}function O(e,t){const r=Object.assign({enabled:!0,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,422,451],retries:3},t.retry);return r.enabled&&(e.hook.error("request",v.bind(null,r,e)),e.hook.wrap("request",T.bind(null,r,e))),{retry:{retryRequest:(e,t,r)=>(e.request.request=Object.assign({},e.request.request,{retries:t,retryAfter:r}),e)}}}O.VERSION="0.0.0-development";const R=()=>Promise.resolve();function B(e,t,r){return e.retryLimiter.schedule(P,e,t,r)}async function P(e,t,r){const s="GET"!==r.method&&"HEAD"!==r.method,{pathname:n}=new URL(r.url,"http://github.test"),i="GET"===r.method&&n.startsWith("/search/"),o=n.startsWith("/graphql"),a=~~t.retryCount>0?{priority:0,weight:0}:{};e.clustering&&(a.expiration=6e4),(s||o)&&await e.write.key(e.id).schedule(a,R),s&&e.triggersNotification(n)&&await e.notifications.key(e.id).schedule(a,R),i&&await e.search.key(e.id).schedule(a,R);const c=e.global.key(e.id).schedule(a,t,r);if(o){const e=await c;if(null!=e.data.errors&&e.data.errors.some((e=>"RATE_LIMITED"===e.type)))throw Object.assign(new Error("GraphQL Rate Limit Exceeded"),{response:e,data:e.data})}return c}const N=function(e){const t=`^(?:${["/orgs/{org}/invitations","/orgs/{org}/invitations/{invitation_id}","/orgs/{org}/teams/{team_slug}/discussions","/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","/repos/{owner}/{repo}/collaborators/{username}","/repos/{owner}/{repo}/commits/{commit_sha}/comments","/repos/{owner}/{repo}/issues","/repos/{owner}/{repo}/issues/{issue_number}/comments","/repos/{owner}/{repo}/pulls","/repos/{owner}/{repo}/pulls/{pull_number}/comments","/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies","/repos/{owner}/{repo}/pulls/{pull_number}/merge","/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers","/repos/{owner}/{repo}/pulls/{pull_number}/reviews","/repos/{owner}/{repo}/releases","/teams/{team_id}/discussions","/teams/{team_id}/discussions/{discussion_number}/comments"].map((e=>e.split("/").map((e=>e.startsWith("{")?"(?:.+?)":e)).join("/"))).map((e=>`(?:${e})`)).join("|")})[^/]*$`;return new RegExp(t,"i")}(),L=N.test.bind(N),U={};function D(e,t){const{enabled:r=!0,Bottleneck:s=k(),id:n="no-id",timeout:i=12e4,connection:o}=t.throttle||{};if(!r)return{};const a={connection:o,timeout:i};null==U.global&&function(e,t){U.global=new e.Group({id:"octokit-global",maxConcurrent:10,...t}),U.search=new e.Group({id:"octokit-search",maxConcurrent:1,minTime:2e3,...t}),U.write=new e.Group({id:"octokit-write",maxConcurrent:1,minTime:1e3,...t}),U.notifications=new e.Group({id:"octokit-notifications",maxConcurrent:1,minTime:3e3,...t})}(s,a);const c=Object.assign({clustering:null!=o,triggersNotification:L,fallbackSecondaryRateRetryAfter:60,retryAfterBaseValue:1e3,retryLimiter:new s,id:n,...U},t.throttle);if("function"!=typeof c.onSecondaryRateLimit||"function"!=typeof c.onRateLimit)throw new Error("octokit/plugin-throttling error:\n        You must pass the onSecondaryRateLimit and onRateLimit error handlers.\n        See https://octokit.github.io/rest.js/#throttling\n\n        const octokit = new Octokit({\n          throttle: {\n            onSecondaryRateLimit: (retryAfter, options) => {/* ... */},\n            onRateLimit: (retryAfter, options) => {/* ... */}\n          }\n        })\n    ");const l={},u=new s.Events(l);return l.on("secondary-limit",c.onSecondaryRateLimit),l.on("rate-limit",c.onRateLimit),l.on("error",(t=>e.log.warn("Error in throttling-plugin limit handler",t))),c.retryLimiter.on("failed",(async function(t,r){const[s,n,i]=r.args,{pathname:o}=new URL(i.url,"http://github.test");if((!o.startsWith("/graphql")||401===t.status)&&403!==t.status)return;const a=~~n.retryCount;n.retryCount=a,i.request.retryCount=a;const{wantRetry:c,retryAfter:l=0}=await async function(){if(/\bsecondary rate\b/i.test(t.message)){const r=Number(t.response.headers["retry-after"])||s.fallbackSecondaryRateRetryAfter;return{wantRetry:await u.trigger("secondary-limit",r,i,e,a),retryAfter:r}}if(null!=t.response.headers&&"0"===t.response.headers["x-ratelimit-remaining"]||(t.response.data?.errors??[]).some((e=>"RATE_LIMITED"===e.type))){const r=new Date(1e3*~~t.response.headers["x-ratelimit-reset"]).getTime(),s=Math.max(Math.ceil((r-Date.now())/1e3)+1,0);return{wantRetry:await u.trigger("rate-limit",s,i,e,a),retryAfter:s}}return{}}();return c?(n.retryCount++,l*s.retryAfterBaseValue):void 0})),e.hook.wrap("request",B.bind(null,c)),{}}D.VERSION="8.1.3",D.triggersNotification=L;var F=r(9023),x=r(7785),G=r(5643);const M=e=>({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console),...e}),H=["branch_protection_rule","branch_protection_rule.created","branch_protection_rule.deleted","branch_protection_rule.edited","check_run","check_run.completed","check_run.created","check_run.requested_action","check_run.rerequested","check_suite","check_suite.completed","check_suite.requested","check_suite.rerequested","code_scanning_alert","code_scanning_alert.appeared_in_branch","code_scanning_alert.closed_by_user","code_scanning_alert.created","code_scanning_alert.fixed","code_scanning_alert.reopened","code_scanning_alert.reopened_by_user","commit_comment","commit_comment.created","create","delete","dependabot_alert","dependabot_alert.created","dependabot_alert.dismissed","dependabot_alert.fixed","dependabot_alert.reintroduced","dependabot_alert.reopened","deploy_key","deploy_key.created","deploy_key.deleted","deployment","deployment.created","deployment_protection_rule","deployment_protection_rule.requested","deployment_status","deployment_status.created","discussion","discussion.answered","discussion.category_changed","discussion.created","discussion.deleted","discussion.edited","discussion.labeled","discussion.locked","discussion.pinned","discussion.transferred","discussion.unanswered","discussion.unlabeled","discussion.unlocked","discussion.unpinned","discussion_comment","discussion_comment.created","discussion_comment.deleted","discussion_comment.edited","fork","github_app_authorization","github_app_authorization.revoked","gollum","installation","installation.created","installation.deleted","installation.new_permissions_accepted","installation.suspend","installation.unsuspend","installation_repositories","installation_repositories.added","installation_repositories.removed","installation_target","installation_target.renamed","issue_comment","issue_comment.created","issue_comment.deleted","issue_comment.edited","issues","issues.assigned","issues.closed","issues.deleted","issues.demilestoned","issues.edited","issues.labeled","issues.locked","issues.milestoned","issues.opened","issues.pinned","issues.reopened","issues.transferred","issues.unassigned","issues.unlabeled","issues.unlocked","issues.unpinned","label","label.created","label.deleted","label.edited","marketplace_purchase","marketplace_purchase.cancelled","marketplace_purchase.changed","marketplace_purchase.pending_change","marketplace_purchase.pending_change_cancelled","marketplace_purchase.purchased","member","member.added","member.edited","member.removed","membership","membership.added","membership.removed","merge_group","merge_group.checks_requested","meta","meta.deleted","milestone","milestone.closed","milestone.created","milestone.deleted","milestone.edited","milestone.opened","org_block","org_block.blocked","org_block.unblocked","organization","organization.deleted","organization.member_added","organization.member_invited","organization.member_removed","organization.renamed","package","package.published","package.updated","page_build","ping","project","project.closed","project.created","project.deleted","project.edited","project.reopened","project_card","project_card.converted","project_card.created","project_card.deleted","project_card.edited","project_card.moved","project_column","project_column.created","project_column.deleted","project_column.edited","project_column.moved","projects_v2_item","projects_v2_item.archived","projects_v2_item.converted","projects_v2_item.created","projects_v2_item.deleted","projects_v2_item.edited","projects_v2_item.reordered","projects_v2_item.restored","public","pull_request","pull_request.assigned","pull_request.auto_merge_disabled","pull_request.auto_merge_enabled","pull_request.closed","pull_request.converted_to_draft","pull_request.demilestoned","pull_request.dequeued","pull_request.edited","pull_request.enqueued","pull_request.labeled","pull_request.locked","pull_request.milestoned","pull_request.opened","pull_request.ready_for_review","pull_request.reopened","pull_request.review_request_removed","pull_request.review_requested","pull_request.synchronize","pull_request.unassigned","pull_request.unlabeled","pull_request.unlocked","pull_request_review","pull_request_review.dismissed","pull_request_review.edited","pull_request_review.submitted","pull_request_review_comment","pull_request_review_comment.created","pull_request_review_comment.deleted","pull_request_review_comment.edited","pull_request_review_thread","pull_request_review_thread.resolved","pull_request_review_thread.unresolved","push","registry_package","registry_package.published","registry_package.updated","release","release.created","release.deleted","release.edited","release.prereleased","release.published","release.released","release.unpublished","repository","repository.archived","repository.created","repository.deleted","repository.edited","repository.privatized","repository.publicized","repository.renamed","repository.transferred","repository.unarchived","repository_dispatch","repository_import","repository_vulnerability_alert","repository_vulnerability_alert.create","repository_vulnerability_alert.dismiss","repository_vulnerability_alert.reopen","repository_vulnerability_alert.resolve","secret_scanning_alert","secret_scanning_alert.created","secret_scanning_alert.reopened","secret_scanning_alert.resolved","secret_scanning_alert.revoked","secret_scanning_alert_location","secret_scanning_alert_location.created","security_advisory","security_advisory.performed","security_advisory.published","security_advisory.updated","security_advisory.withdrawn","sponsorship","sponsorship.cancelled","sponsorship.created","sponsorship.edited","sponsorship.pending_cancellation","sponsorship.pending_tier_change","sponsorship.tier_changed","star","star.created","star.deleted","status","team","team.added_to_repository","team.created","team.deleted","team.edited","team.removed_from_repository","team_add","watch","watch.started","workflow_dispatch","workflow_job","workflow_job.completed","workflow_job.in_progress","workflow_job.queued","workflow_job.waiting","workflow_run","workflow_run.completed","workflow_run.in_progress","workflow_run.requested"];function Q(e,t,r){e.hooks[t]||(e.hooks[t]=[]),e.hooks[t].push(r)}function q(e,t,r){if(Array.isArray(t))t.forEach((t=>q(e,t,r)));else{if(["*","error"].includes(t)){const e="*"===t?"any":t,r=`Using the "${t}" event with the regular Webhooks.on() function is not supported. Please use the Webhooks.on${e.charAt(0).toUpperCase()+e.slice(1)}() method instead`;throw new Error(r)}H.includes(t)||e.log.warn(`"${t}" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)`),Q(e,t,r)}}function $(e,t){Q(e,"*",t)}function j(e,t){Q(e,"error",t)}var K=r(6455),W=r.n(K);function Y(e,t){let r;try{r=e(t)}catch(e){console.log('FATAL: Error occurred in "error" event handler'),console.log(e)}r&&r.catch&&r.catch((e=>{console.log('FATAL: Error occurred in "error" event handler'),console.log(e)}))}function z(e,t){const r=e.hooks.error||[];if(t instanceof Error){const e=Object.assign(new(W())([t]),{event:t,errors:[t]});return r.forEach((t=>Y(t,e))),Promise.reject(e)}if(!t||!t.name)throw new(W())(["Event name not passed"]);if(!t.payload)throw new(W())(["Event payload not passed"]);const s=function(e,t,r){const s=[e.hooks[r],e.hooks["*"]];return t&&s.unshift(e.hooks[`${r}.${t}`]),[].concat(...s.filter(Boolean))}(e,"action"in t.payload?t.payload.action:null,t.name);if(0===s.length)return Promise.resolve();const n=[],i=s.map((r=>{let s=Promise.resolve(t);return e.transform&&(s=s.then(e.transform)),s.then((e=>r(e))).catch((e=>n.push(Object.assign(e,{event:t}))))}));return Promise.all(i).then((()=>{if(0===n.length)return;const e=new(W())(n);throw Object.assign(e,{event:t,errors:n}),r.forEach((t=>Y(t,e))),e}))}function V(e,t,r){if(Array.isArray(t))t.forEach((t=>V(e,t,r)));else if(e.hooks[t])for(let s=e.hooks[t].length-1;s>=0;s--)if(e.hooks[t][s]===r)return void e.hooks[t].splice(s,1)}function X(e){const t={hooks:{},log:M(e&&e.log)};return e&&e.transform&&(t.transform=e.transform),{on:q.bind(null,t),onAny:$.bind(null,t),onError:j.bind(null,t),removeListener:V.bind(null,t),receive:z.bind(null,t)}}var J=r(6113),Z=(e=>(e.SHA1="sha1",e.SHA256="sha256",e))(Z||{});const ee="4.0.0";async function te(e,t){const{secret:r,algorithm:s}="object"==typeof e?{secret:e.secret,algorithm:e.algorithm||Z.SHA256}:{secret:e,algorithm:Z.SHA256};if(!r||!t)throw new TypeError("[@octokit/webhooks-methods] secret & payload required for sign()");if(!Object.values(Z).includes(s))throw new TypeError(`[@octokit/webhooks] Algorithm ${s} is not supported. Must be  'sha1' or 'sha256'`);return`${s}=${(0,J.createHmac)(s,r).update(t).digest("hex")}`}te.VERSION=ee;var re=r(4300);const se=e=>e.startsWith("sha256=")?"sha256":"sha1";async function ne(e,t,r){if(!e||!t||!r)throw new TypeError("[@octokit/webhooks-methods] secret, eventPayload & signature required");const s=re.Buffer.from(r),n=se(r),i=re.Buffer.from(await te({secret:e,algorithm:n},t));return s.length===i.length&&(0,J.timingSafeEqual)(s,i)}async function ie(e,t){if(!await ne(e.secret,t.payload,t.signature).catch((()=>!1))){const r=new Error("[@octokit/webhooks] signature does not match event payload and secret");return e.eventHandler.receive(Object.assign(r,{event:t,status:400}))}let r;try{r=JSON.parse(t.payload)}catch(e){throw e.message="Invalid JSON",e.status=400,new(W())([e])}return e.eventHandler.receive({id:t.id,name:t.name,payload:r})}ne.VERSION=ee;class oe{constructor(e){if(!e||!e.secret)throw new Error("[@octokit/webhooks] options.secret required");const t={eventHandler:X(e),secret:e.secret,hooks:{},log:M(e.log)};this.sign=te.bind(null,e.secret),this.verify=ne.bind(null,e.secret),this.on=t.eventHandler.on,this.onAny=t.eventHandler.onAny,this.onError=t.eventHandler.onError,this.removeListener=t.eventHandler.removeListener,this.receive=t.eventHandler.receive,this.verifyAndReceive=ie.bind(null,t)}}const ae=["x-github-event","x-hub-signature-256","x-github-delivery"];async function ce(e,t,r,s,n){let i;try{i=new URL(r.url,"http://localhost").pathname}catch(e){return s.writeHead(422,{"content-type":"application/json"}),s.end(JSON.stringify({error:`Request URL could not be parsed: ${r.url}`})),!0}if(i!==t.path)return n?.(),!1;if("POST"!==r.method)return function(e,t){t.writeHead(404,{"content-type":"application/json"}),t.end(JSON.stringify({error:`Unknown route: ${e.method} ${e.url}`}))}(r,s),!0;if(!r.headers["content-type"]||!r.headers["content-type"].startsWith("application/json"))return s.writeHead(415,{"content-type":"application/json",accept:"application/json"}),s.end(JSON.stringify({error:'Unsupported "Content-Type" header value. Must be "application/json"'})),!0;const o=function(e){return ae.filter((t=>!(t in e.headers)))}(r).join(", ");if(o)return s.writeHead(400,{"content-type":"application/json"}),s.end(JSON.stringify({error:`Required headers missing: ${o}`})),!0;const a=r.headers["x-github-event"],c=r.headers["x-hub-signature-256"],l=r.headers["x-github-delivery"];t.log.debug(`${a} event received (id: ${l})`);let u=!1;const h=setTimeout((()=>{u=!0,s.statusCode=202,s.end("still processing\n")}),9e3).unref();try{const t=await function(e){return e.body?Promise.resolve(e.body):new Promise(((t,r)=>{let s="";e.setEncoding("utf8"),e.on("error",(e=>r(new(W())([e])))),e.on("data",(e=>s+=e)),e.on("end",(()=>t(s)))}))}(r);return await e.verifyAndReceive({id:l,name:a,payload:t,signature:c}),clearTimeout(h),u||s.end("ok\n"),!0}catch(e){if(clearTimeout(h),u)return!0;const r=Array.from(e)[0],n=r.message?`${r.name}: ${r.message}`:"Error: An Unspecified error occurred";return s.statusCode=void 0!==r.status?r.status:500,t.log.error(e),s.end(JSON.stringify({error:n})),!0}}async function le(e,t){return e.octokit.auth({type:"installation",installationId:t,factory(e){const r={...e.octokitOptions,authStrategy:F.createAppAuth,auth:{...e,installationId:t}};return new e.octokit.constructor(r)}})}function ue(e){return Object.assign(he.bind(null,e),{iterator:de.bind(null,e)})}async function he(e,t){const r=de(e)[Symbol.asyncIterator]();let s=await r.next();for(;!s.done;)await t(s.value),s=await r.next()}function de(e){return{async*[Symbol.asyncIterator](){const t=a.iterator(e.octokit,"GET /app/installations");for await(const{data:r}of t)for(const t of r){const r=await le(e,t.id);yield{octokit:r,installation:t}}}}}function pe(e){return Object.assign(fe.bind(null,e),{iterator:ge.bind(null,e)})}async function fe(e,t,r){const s=ge(e,r?t:void 0)[Symbol.asyncIterator]();let n=await s.next();for(;!n.done;)r?await r(n.value):await t(n.value),n=await s.next()}function ge(e,t){return{async*[Symbol.asyncIterator](){const r=t?function(e,t){return{async*[Symbol.asyncIterator](){yield{octokit:await e.getInstallationOctokit(t)}}}}(e,t.installationId):e.eachInstallation.iterator();for await(const{octokit:e}of r){const t=a.iterator(e,"GET /installation/repositories");for await(const{data:r}of t)for(const t of r)yield{octokit:e,repository:t}}}}}function me(){}function _e(e,t={}){const r=Object.assign({debug:me,info:me,warn:console.warn.bind(console),error:console.error.bind(console)},t.log),s={pathPrefix:"/api/github",...t,log:r},n=function(e,{path:t="/api/github/webhooks",log:r=M()}={}){return ce.bind(null,e,{path:t,log:r})}(e.webhooks,{path:s.pathPrefix+"/webhooks",log:r}),i=(0,x.createNodeMiddleware)(e.oauth,{pathPrefix:s.pathPrefix+"/oauth"});return Ae.bind(null,s.pathPrefix,n,i)}async function Ae(e,t,r,s,n,i){const{pathname:o}=new URL(s.url,"http://localhost");return o.startsWith(`${e}/`)?(o===`${e}/webhooks`?t(s,n):o.startsWith(`${e}/oauth/`)?r(s,n):(0,x.sendNodeResponse)((0,x.unknownRouteResponse)(s),n),!0):(i?.(),!1)}var Ee=class{static{this.VERSION="14.0.2"}static defaults(e){return class extends(this){constructor(...t){super({...e,...t[0]})}}}constructor(e){const t=e.Octokit||s.Octokit,r=Object.assign({appId:e.appId,privateKey:e.privateKey},e.oauth?{clientId:e.oauth.clientId,clientSecret:e.oauth.clientSecret}:{});this.octokit=new t({authStrategy:F.createAppAuth,auth:r,log:e.log}),this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log),e.webhooks?this.webhooks=function(e,t){return new oe({secret:t.secret,transform:async t=>{if(!("installation"in t.payload)||"object"!=typeof t.payload.installation){const r=new e.constructor({authStrategy:G.createUnauthenticatedAuth,auth:{reason:'"installation" key missing in webhook event payload'}});return{...t,octokit:r}}const r=t.payload.installation.id,s=await e.auth({type:"installation",installationId:r,factory:e=>new e.octokit.constructor({...e.octokitOptions,authStrategy:F.createAppAuth,auth:{...e,installationId:r}})});return s.hook.before("request",(e=>{e.headers["x-github-delivery"]=t.id})),{...t,octokit:s}}})}(this.octokit,e.webhooks):Object.defineProperty(this,"webhooks",{get(){throw new Error("[@octokit/app] webhooks option not set")}}),e.oauth?this.oauth=new x.OAuthApp({...e.oauth,clientType:"github-app",Octokit:t}):Object.defineProperty(this,"oauth",{get(){throw new Error("[@octokit/app] oauth.clientId / oauth.clientSecret options are not set")}}),this.getInstallationOctokit=le.bind(null,this),this.eachInstallation=ue(this),this.eachRepository=pe(this)}},ye=s.Octokit.plugin(w,c,(function(e){return e.graphql,{graphql:Object.assign(e.graphql,{paginate:Object.assign(A(e),{iterator:m(e)})})}}),O,D).defaults({userAgent:"octokit.js/3.1.2",throttle:{onRateLimit:function(e,t,r){if(r.log.warn(`Request quota exhausted for request ${t.method} ${t.url}`),0===t.request.retryCount)return r.log.info(`Retrying after ${e} seconds!`),!0},onSecondaryRateLimit:function(e,t,r){if(r.log.warn(`SecondaryRateLimit detected for request ${t.method} ${t.url}`),0===t.request.retryCount)return r.log.info(`Retrying after ${e} seconds!`),!0}}}),be=Ee.defaults({Octokit:ye}),we=x.OAuthApp.defaults({Octokit:ye})},778:(e,t,r)=>{var s=r(2479);function n(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}e.exports=s(n),e.exports.strict=s(i),n.proto=n((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))},2399:(e,t,r)=>{"use strict";var s,n=r(4300),i=n.Buffer,o={};for(s in n)n.hasOwnProperty(s)&&"SlowBuffer"!==s&&"Buffer"!==s&&(o[s]=n[s]);var a=o.Buffer={};for(s in i)i.hasOwnProperty(s)&&"allocUnsafe"!==s&&"allocUnsafeSlow"!==s&&(a[s]=i[s]);if(o.Buffer.prototype=i.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return i(e,t,r)}),a.alloc||(a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var s=i(e);return t&&0!==t.length?"string"==typeof r?s.fill(t,r):s.fill(t):s.fill(0),s}),!o.kStringMaxLength)try{o.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),e.exports=o},2995:e=>{e.exports=function(e){var t=[];return e.forEach((function(e){/^[A-Za-z0-9_\/-]+$/.test(e)||(e=(e="'"+e.replace(/'/g,"'\\''")+"'").replace(/^(?:'')+/g,"").replace(/\\'''/g,"\\'")),t.push(e)})),t.join(" ")}},491:(e,t,r)=>{"use strict";const{Duplex:s,Readable:n,Writable:i}=r(2781),{CHANNEL_EXTENDED_DATATYPE:{STDERR:o}}=r(3190),{bufferSlice:a}=r(9205),c=2097152,l=1048576;class u extends n{constructor(e,t){super(t),this._channel=e}_read(e){this._channel._waitChanDrain&&(this._channel._waitChanDrain=!1,this._channel.incoming.window<=l&&f(this._channel))}}class h extends i{constructor(e){super({highWaterMark:c}),this._channel=e}_write(e,t,r){const s=this._channel,n=s._client._protocol,i=s.outgoing,c=i.packetSize,l=i.id;let u=i.window;const h=e.length;let d=0;if("open"===i.state){for(;h-d>0&&u>0;){let t=h-d;t>u&&(t=u),t>c&&(t=c),0===d&&t===h?n.channelExtData(l,e,o):n.channelExtData(l,a(e,d,d+t),o),d+=t,u-=t}if(i.window=u,h-d>0)return 0===u&&(s._waitWindow=!0),s._chunkErr=d>0?a(e,d,h):e,void(s._chunkcbErr=r);r()}}}function d(){this.eof(),!this.server&&this.allowHalfOpen||this.close(),this.writable=!1}function p(){this.readable=!1}function f(e){if("closed"===e.outgoing.state)return;const t=c-e.incoming.window;t<=0||(e.incoming.window+=t,e._client._protocol.channelWindowAdjust(e.outgoing.id,t))}e.exports={Channel:class extends s{constructor(e,t,r){const s={highWaterMark:c,allowHalfOpen:!r||r&&!1!==r.allowHalfOpen,emitClose:!1};super(s),this.allowHalfOpen=s.allowHalfOpen;const n=!(!r||!r.server);this.server=n,this.type=t.type,this.subtype=void 0,this.incoming=t.incoming,this.outgoing=t.outgoing,this._callbacks=[],this._client=e,this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this.stdin=this.stdout=this,this.stderr=n?new h(this):new u(this,s),this._waitWindow=!1,this._waitChanDrain=!1,this._chunk=void 0,this._chunkcb=void 0,this._chunkErr=void 0,this._chunkcbErr=void 0,this.on("finish",d).on("prefinish",d),this.on("end",p).on("close",p)}_read(e){this._waitChanDrain&&(this._waitChanDrain=!1,this.incoming.window<=l&&f(this))}_write(e,t,r){const s=this._client._protocol,n=this.outgoing,i=n.packetSize,o=n.id;let c=n.window;const l=e.length;let u=0;if("open"===n.state){for(;l-u>0&&c>0;){let t=l-u;t>c&&(t=c),t>i&&(t=i),0===u&&t===l?s.channelData(o,e):s.channelData(o,a(e,u,u+t)),u+=t,c-=t}if(n.window=c,l-u>0)return 0===c&&(this._waitWindow=!0),this._chunk=u>0?a(e,u,l):e,void(this._chunkcb=r);r()}}eof(){"open"===this.outgoing.state&&(this.outgoing.state="eof",this._client._protocol.channelEOF(this.outgoing.id))}close(){"open"!==this.outgoing.state&&"eof"!==this.outgoing.state||(this.outgoing.state="closing",this._client._protocol.channelClose(this.outgoing.id))}destroy(){return this.end(),this.close(),this}setWindow(e,t,r,s){if(this.server)throw new Error("Client-only method called in server mode");"session"!==this.type||"shell"!==this.subtype&&"exec"!==this.subtype||!this.writable||"open"!==this.outgoing.state||this._client._protocol.windowChange(this.outgoing.id,e,t,r,s)}signal(e){if(this.server)throw new Error("Client-only method called in server mode");"session"===this.type&&this.writable&&"open"===this.outgoing.state&&this._client._protocol.signal(this.outgoing.id,e)}exit(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");"session"===this.type&&this.writable&&"open"===this.outgoing.state&&("number"==typeof e?this._client._protocol.exitStatus(this.outgoing.id,e):this._client._protocol.exitSignal(this.outgoing.id,e,t,r))}},MAX_WINDOW:c,PACKET_SIZE:32768,windowAdjust:f,WINDOW_THRESHOLD:l}},1119:(e,t,r)=>{"use strict";const{Socket:s}=r(1808),{Duplex:n}=r(2781),{resolve:i}=r(1017),{readFile:o}=r(7147),{execFile:a,spawn:c}=r(2081),{isParsedKey:l,parseKey:u}=r(3781),{makeBufferParser:h,readUInt32BE:d,writeUInt32BE:p,writeUInt32LE:f}=r(9205);function g(e){let t=!1;return(...r)=>{t||(t=!0,e(...r))}}function m(){}const _=Buffer.alloc(0),A=h();class E{getIdentities(e){e(new Error("Missing getIdentities() implementation"))}sign(e,t,r,s){"function"==typeof r&&(s=r),s(new Error("Missing sign() implementation"))}}class y extends E{constructor(e){super(),this.socketPath=e}getStream(e){e=g(e);const t=new s;function r(){try{t.destroy()}catch{}e(new Error("Failed to connect to agent"))}t.on("connect",(()=>{e(null,t)})),t.on("close",r).on("end",r).on("error",r),t.connect(this.socketPath)}getIdentities(e){e=g(e),this.getStream(((t,r)=>{function s(t){if(r)try{r.destroy()}catch{}t||(t=new Error("Failed to retrieve identities from agent")),e(t)}if(t)return s(t);const n=new k(!0);n.on("error",s),n.pipe(r).pipe(n),r.on("close",s).on("end",s).on("error",s),n.getIdentities(((t,n)=>{if(t)return s(t);try{r.destroy()}catch{}e(null,n)}))}))}sign(e,t,r,s){"function"==typeof r?(s=r,r=void 0):"object"==typeof r&&null!==r||(r=void 0),s=g(s),this.getStream(((n,i)=>{function o(e){if(i)try{i.destroy()}catch{}e||(e=new Error("Failed to sign data with agent")),s(e)}if(n)return o(n);const a=new k(!0);a.on("error",o),a.pipe(i).pipe(a),i.on("close",o).on("end",o).on("error",o),a.sign(e,t,r,((e,t)=>{if(e)return o(e);try{i.destroy()}catch{}s(null,t)}))}))}}const b=(()=>{const e=i(__dirname,"..","util/pagent.exe"),t={10:new Error("Invalid pagent.exe arguments"),11:new Error("Pageant is not running"),12:new Error("pagent.exe could not create an mmap"),13:new Error("pagent.exe could not set mode for stdin"),14:new Error("pagent.exe could not set mode for stdout"),15:new Error("pagent.exe did not get expected input payload")};function r(e){e.buffer=null,e.proc&&(e.proc.kill(),e.proc=void 0)}class s extends n{constructor(){super(),this.proc=void 0,this.buffer=null}_read(e){}_write(r,s,n){if(null===this.buffer)this.buffer=r;else{const e=Buffer.allocUnsafe(this.buffer.length+r.length);this.buffer.copy(e,0),r.copy(e,this.buffer.length),this.buffer=e}if(this.buffer.length<4)return n();const i=d(this.buffer,0);if(this.buffer.length-4<i)return n();if(r=this.buffer.slice(0,4+i),this.buffer.length>4+i)return n(new Error("Unexpected multiple agent requests"));let o;this.buffer=null;const a=this.proc=c(e,[r.length]);a.stdout.on("data",(e=>{this.push(e)})),a.on("error",(e=>{o=e,n(o)})),a.on("close",(e=>{if(this.proc=void 0,!o){if(o=t[e])return n(o);n()}})),a.stdin.end(r)}_final(e){r(this),e()}_destroy(e,t){r(this),t()}}return class extends y{getStream(e){e(null,new s)}}})(),w=(()=>{const e=/^!<socket >(\d+) s ([A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8})/;return class extends y{getStream(t){t=g(t);let r=this.socketPath,n=!1;o(r,(function i(c,l){if(c)return n?t(new Error("Invalid cygwin unix socket path")):void a("cygpath",["-w",r],((e,s,a)=>{if(e||0===s.length)return t(new Error("Invalid cygwin unix socket path"));n=!0,r=s.toString().replace(/[\r\n]/g,""),o(r,i)}));const u=e.exec(l.toString("ascii"));if(!u)return t(new Error("Malformed cygwin unix socket file"));let h,p=0,g=!1;const m=[];let _,A=Buffer.alloc(12);const E=parseInt(u[1],10),y=u[2].replace(/-/g,""),b=Buffer.allocUnsafe(16);for(let e=0,t=0;t<32;++e,t+=2)b[e]=parseInt(y.substring(t,t+2),16);for(let e=0;e<16;e+=4)f(b,d(b,e),e);function w(){p=0,h="secret",_.write(b)}function v(e){if(p+=e.length,"secret"!==h){if("creds"===h&&(g||m.push(e),12===p)){if(_.removeListener("connect",w),_.removeListener("data",v),_.removeListener("error",S),_.removeListener("end",S),_.removeListener("close",S),g)return t(null,_);g=!0,A=Buffer.concat(m),f(A,process.pid,0),_.on("error",(()=>{})),_.destroy(),k()}}else 16===p&&(p=0,h="creds",_.write(A))}function S(){t(new Error("Problem negotiating cygwin unix socket security"))}function k(){_=new s,_.on("connect",w),_.on("data",v),_.on("error",S),_.on("end",S),_.on("close",S),_.connect(E)}k()}))}}})(),v=/^[/\\][/\\]\.[/\\]pipe[/\\].+/;function S(e){return"win32"!==process.platform||v.test(e)?new y(e):"pageant"===e?new b:new w(e)}const k=(()=>{const e=Symbol("Inbound Request Type"),t=Symbol("Inbound Request Response"),r=Symbol("Inbound Request Context");class s{constructor(s,n){this[e]=s,this[t]=void 0,this[r]=n}hasResponded(){return void 0!==this[t]}getType(){return this[e]}getContext(){return this[r]}}function i(e,r,s){return r[t]=s,function(e){let r;for(;e[h].length;){const s=e[h][0][t];if(void 0===s)break;e[h].shift(),r=e.push(s)}return r}(e)}function o(e){if(e[g]=null,0===e[f]){const t=e[h];if(t&&t.length){e[h]=[];for(const e of t)e.cb(new Error("No reply from server"))}}try{e.end()}catch{}setImmediate((()=>{e[b]||e.emit("end"),e[y]||e.emit("close")}))}function a(){this[y]=!0}function c(){this[b]=!0}const h=Symbol("Requests"),f=Symbol("Agent Protocol Role"),g=Symbol("Agent Protocol Buffer"),E=Symbol("Agent Protocol Current Message Length"),y=Symbol("Agent Protocol Closed"),b=Symbol("Agent Protocol Ended");return class extends n{constructor(e){super({autoDestroy:!0,emitClose:!1}),this[f]=e?0:1,this[h]=[],this[g]=null,this[E]=-1,this.once("end",c),this.once("close",a)}_read(e){}_write(e,t,r){null===this[g]?this[g]=e:this[g]=function(e,t){const r=Buffer.allocUnsafe(e.length+t.length);return e.copy(r,0),t.copy(r,e.length),r}(this[g],e);let n=this[g],i=n.length,o=0;for(;o<i&&!(i<5)&&(-1===this[E]&&(this[E]=d(n,o)),!(i<4+this[E]));){const e=n[o+=4];if(++o,0===this[f]){if(0===this[h].length)return r(new Error("Received unexpected message from server"));const t=this[h].shift();switch(e){case 5:t.cb(new Error("Agent responded with failure"));break;case 12:{if(11!==t.type)return r(new Error("Agent responded with wrong message type"));A.init(n,o);const e=A.readUInt32BE();if(void 0===e)return A.clear(),r(new Error("Malformed agent response"));const s=[];for(let t=0;t<e;++t){let e=A.readString();if(void 0===e)return A.clear(),r(new Error("Malformed agent response"));const t=A.readString(!0);if(void 0===t)return A.clear(),r(new Error("Malformed agent response"));e=u(e),e instanceof Error||(e.comment=e.comment||t,s.push(e))}o=A.pos(),A.clear(),t.cb(null,s);break}case 14:{if(13!==t.type)return r(new Error("Agent responded with wrong message type"));A.init(n,o);let e=A.readString();if(o=A.pos(),A.clear(),void 0===e)return r(new Error("Malformed agent response"));if(A.init(e,0),A.readString(!0),e=A.readString(),A.clear(),void 0===e)return r(new Error("Malformed OpenSSH signature format"));t.cb(null,e);break}default:return r(new Error("Agent responded with unsupported message type"))}}else switch(e){case 11:{const t=new s(e);this[h].push(t),this.emit("identities",t);break}case 13:{A.init(n,o);let t=A.readString();const r=A.readString(),i=A.readUInt32BE();if(o=A.pos(),A.clear(),void 0===i){const t=new s(e);return this[h].push(t),this.failureReply(t)}if(t=u(t),t instanceof Error){const t=new s(e);return this[h].push(t),this.failureReply(t)}const a={hash:void 0};let c;"ssh-rsa"===t.type&&(2&i?(c="rsa-sha2-256",a.hash="sha256"):4&i&&(c="rsa-sha2-512",a.hash="sha512")),void 0===c&&(c=t.type);const l=new s(e,c);this[h].push(l),this.emit("sign",l,t,r,a);break}default:{const t=new s(e);this[h].push(t),this.failureReply(t)}}if(this[E]=-1,o===i){this[g]=null;break}this[g]=n=n.slice(o),i=n.length,o=0}r()}_destroy(e,t){o(this),t()}_final(e){o(this),e()}sign(e,t,r,s){if(0!==this[f])throw new Error("Client-only method called with server role");"function"==typeof r?(s=r,r=void 0):"object"==typeof r&&null!==r||(r=void 0);let n=0;if((e=u(e))instanceof Error)throw new Error("Invalid public key argument");if("ssh-rsa"===e.type&&r)switch(r.hash){case"sha256":n=2;break;case"sha512":n=4}const i=(e=e.getPublicSSH()).length,o=t.length;let a=0;const c=Buffer.allocUnsafe(9+i+4+o+4);return p(c,c.length-4,a),c[a+=4]=13,p(c,i,++a),e.copy(c,a+=4),p(c,o,a+=i),t.copy(c,a+=4),p(c,n,a+=o),"function"!=typeof s&&(s=m),this[h].push({type:13,cb:s}),this.push(c)}getIdentities(e){if(0!==this[f])throw new Error("Client-only method called with server role");let t=0;const r=Buffer.allocUnsafe(5);return p(r,r.length-4,t),r[t+=4]=11,"function"!=typeof e&&(e=m),this[h].push({type:11,cb:e}),this.push(r)}failureReply(e){if(1!==this[f])throw new Error("Server-only method called with client role");if(!(e instanceof s))throw new Error("Wrong request argument");if(e.hasResponded())return!0;let t=0;const r=Buffer.allocUnsafe(5);return p(r,r.length-4,t),r[t+=4]=5,i(this,e,r)}getIdentitiesReply(e,t){if(1!==this[f])throw new Error("Server-only method called with client role");if(!(e instanceof s))throw new Error("Wrong request argument");if(e.hasResponded())return!0;if(11!==e.getType())throw new Error("Invalid response to request");if(!Array.isArray(t))throw new Error("Keys argument must be an array");let r=4;const n=[];for(let e=0;e<t.length;++e){const s=t[e];if("object"!=typeof s||null===s)throw new Error(`Invalid key entry: ${s}`);let i,o;if(l(s))i=s;else if(l(s.pubKey))i=s.pubKey;else{if("object"!=typeof s.pubKey||null===s.pubKey)continue;if(({pubKey:i,comment:o}=s.pubKey),i=u(i),i instanceof Error)continue}o=i.comment||o,i=i.getPublicSSH(),r+=4+i.length,o&&"string"==typeof o?o=Buffer.from(o):Buffer.isBuffer(o)||(o=_),r+=4+o.length,n.push({pubKey:i,comment:o})}let o=0;const a=Buffer.allocUnsafe(5+r);p(a,a.length-4,o),a[o+=4]=12,p(a,n.length,++o),o+=4;for(let e=0;e<n.length;++e){const{pubKey:t,comment:r}=n[e];p(a,t.length,o),t.copy(a,o+=4),p(a,r.length,o+=t.length),o+=4,r.length&&(r.copy(a,o),o+=r.length)}return i(this,e,a)}signReply(e,t){if(1!==this[f])throw new Error("Server-only method called with client role");if(!(e instanceof s))throw new Error("Wrong request argument");if(e.hasResponded())return!0;if(13!==e.getType())throw new Error("Invalid response to request");if(!Buffer.isBuffer(t))throw new Error("Signature argument must be a Buffer");if(0===t.length)throw new Error("Signature argument must be non-empty");let r=0;const n=e.getContext(),o=Buffer.byteLength(n),a=Buffer.allocUnsafe(13+o+4+t.length);return p(a,a.length-4,r),a[r+=4]=14,p(a,4+o+4+t.length,++r),p(a,o,r+=4),a.utf8Write(n,r+=4,o),p(a,t.length,r+=o),t.copy(a,r+=4),i(this,e,a)}}})(),I=Symbol("Agent"),T=Symbol("Agent Keys"),C=Symbol("Agent Keys Index"),O=Symbol("Agent Init Callbacks");function R(e){return e instanceof E}e.exports={AgentContext:class{constructor(e){if("string"==typeof e)e=S(e);else if(!R(e))throw new Error("Invalid agent argument");this[I]=e,this[T]=null,this[C]=-1,this[O]=null}init(e){if("function"!=typeof e&&(e=m),null===this[T])if(null===this[O]){this[O]=[e];const t=(...e)=>{process.nextTick((()=>{const t=this[O];this[O]=null;for(const r of t)r(...e)}))};this[I].getIdentities(g(((e,r)=>{if(e)return t(e);if(!Array.isArray(r))return t(new Error("Agent implementation failed to provide keys"));const s=[];for(let e of r)e=u(e),e instanceof Error||s.push(e);this[T]=s,this[C]=-1,t()})))}else this[O].push(e);else process.nextTick(e)}nextKey(){return!(null===this[T]||++this[C]>=this[T].length)&&this[T][this[C]]}currentKey(){return null===this[T]||this[C]>=this[T].length?null:this[T][this[C]]}pos(){return null===this[T]||this[C]>=this[T].length?-1:this[C]}reset(){this[C]=-1}sign(...e){this[I].sign(...e)}},AgentProtocol:k,BaseAgent:E,createAgent:S,CygwinAgent:w,isAgent:R,OpenSSHAgent:y,PageantAgent:b}},2353:(e,t,r)=>{"use strict";const{createHash:s,getHashes:n,randomFillSync:i}=r(6113),{Socket:o}=r(1808),{lookup:a}=r(9523),c=r(2361),l=n(),{COMPAT:u,CHANNEL_EXTENDED_DATATYPE:{STDERR:h},CHANNEL_OPEN_FAILURE:d,DEFAULT_CIPHER:p,DEFAULT_COMPRESSION:f,DEFAULT_KEX:g,DEFAULT_MAC:m,DEFAULT_SERVER_HOST_KEY:_,DISCONNECT_REASON:A,DISCONNECT_REASON_BY_VALUE:E,SUPPORTED_CIPHER:y,SUPPORTED_COMPRESSION:b,SUPPORTED_KEX:w,SUPPORTED_MAC:v,SUPPORTED_SERVER_HOST_KEY:S}=r(3190),{init:k}=r(8545),I=r(3603),{parseKey:T}=r(3781),{SFTP:C}=r(4061),{bufferCopy:O,makeBufferParser:R,makeError:B,readUInt32BE:P,sigSSHToASN1:N,writeUInt32BE:L}=r(9205),{AgentContext:U,createAgent:D,isAgent:F}=r(1119),{Channel:x,MAX_WINDOW:G,PACKET_SIZE:M,windowAdjust:H,WINDOW_THRESHOLD:Q}=r(491),{ChannelManager:q,generateAlgorithmList:$,isWritable:j,onChannelOpenFailure:K,onCHANNEL_CLOSE:W}=r(7236),Y=R(),z=R(),V=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,X=e=>{};function J(e,t,r,s){const n=G,i=M;"function"==typeof r&&(s=r,r={});const o=(e,t)=>{s(e,t)};o.type=t;const a=e._chanMgr.add(o);if(-1!==a)switch(t){case"session":case"sftp":e._protocol.session(a,n,i);break;case"direct-tcpip":e._protocol.directTcpip(a,n,i,r);break;case"direct-streamlocal@openssh.com":e._protocol.openssh_directStreamLocal(a,n,i,r);break;default:throw new Error(`Unsupported channel type: ${t}`)}else s(new Error("No free channels available"))}function Z(e,t,r){const s={single:!1,protocol:"MIT-MAGIC-COOKIE-1",cookie:void 0,screen:0};"function"==typeof t?r=t:"object"==typeof t&&null!==t&&("boolean"==typeof t.single&&(s.single=t.single),"number"==typeof t.screen&&(s.screen=t.screen),"string"==typeof t.protocol&&(s.protocol=t.protocol),"string"==typeof t.cookie?s.cookie=t.cookie:Buffer.isBuffer(t.cookie)&&(s.cookie=t.cookie.hexSlice(0,t.cookie.length))),void 0===s.cookie&&(s.cookie=ne());const n="function"==typeof r;"open"===e.outgoing.state?(n&&e._callbacks.push((t=>{t?r(!0!==t?t:new Error("Unable to request X11")):(e._hasX11=!0,++e._client._acceptX11,e.once("close",(()=>{e._client._acceptX11&&--e._client._acceptX11})),r())})),e._client._protocol.x11Forward(e.outgoing.id,s,n)):n&&r(new Error("Channel is not open"))}function ee(e,t,r){let s=24,n=80,i=640,o=480,a="vt100",c=null;"function"==typeof t?r=t:"object"==typeof t&&null!==t&&("number"==typeof t.rows&&(s=t.rows),"number"==typeof t.cols&&(n=t.cols),"number"==typeof t.width&&(i=t.width),"number"==typeof t.height&&(o=t.height),"string"==typeof t.term&&(a=t.term),"object"==typeof t.modes&&(c=t.modes));const l="function"==typeof r;"open"===e.outgoing.state?(l&&e._callbacks.push((e=>{e?r(!0!==e?e:new Error("Unable to request a pseudo-terminal")):r()})),e._client._protocol.pty(e.outgoing.id,s,n,o,i,a,c,l)):l&&r(new Error("Channel is not open"))}function te(e,t){const r="function"==typeof t;"open"===e.outgoing.state?e._client._agentFwdEnabled?r&&t(!1):(e._client._agentFwdEnabled=!0,e._callbacks.push((s=>{if(s)return e._client._agentFwdEnabled=!1,void(r&&t(!0!==s?s:new Error("Unable to request agent forwarding")));r&&t()})),e._client._protocol.openssh_agentForward(e.outgoing.id,!0)):r&&t(new Error("Channel is not open"))}function re(e,t){if("open"!==e.outgoing.state)return;const r=Object.keys(t||{});for(let s=0;s<r.length;++s){const n=r[s],i=t[n];e._client._protocol.env(e.outgoing.id,n,i,!1)}}function se(e,t,r){"open"===e.outgoing.state?(e._callbacks.push((s=>{s?r(!0!==s?s:new Error(`Unable to start subsystem: ${t}`)):(e.subtype="subsystem",r(void 0,e))})),e._client._protocol.subsystem(e.outgoing.id,t,!0)):r(new Error("Channel is not open"))}const ne=(()=>{const e=Buffer.allocUnsafe(16);return()=>(i(e,0,16),e.hexSlice(0,16))})();function ie(e){if(!Array.isArray(e))throw new Error("authList must be an array");let t=0;return(r,s,n)=>t!==e.length&&e[t++]}function oe(e,t,r){if("ssh-rsa"===t.type){if(e._protocol._compatFlags&u.IMPLY_RSA_SHA2_SIGALGS&&(r=Array.isArray(r)?["rsa-sha2-256","rsa-sha2-512",...r]:["rsa-sha2-256","rsa-sha2-512"]),Array.isArray(r)){if(-1!==r.indexOf("rsa-sha2-256"))return[["rsa-sha2-256","sha256"]];if(-1!==r.indexOf("rsa-sha2-512"))return[["rsa-sha2-512","sha512"]];if(-1===r.indexOf("ssh-rsa"))return[]}return[["ssh-rsa","sha1"]]}}e.exports=class extends c{constructor(){super(),this.config={host:void 0,port:void 0,localAddress:void 0,localPort:void 0,forceIPv4:void 0,forceIPv6:void 0,keepaliveCountMax:void 0,keepaliveInterval:void 0,readyTimeout:void 0,ident:void 0,username:void 0,password:void 0,privateKey:void 0,tryKeyboard:void 0,agent:void 0,allowAgentFwd:void 0,authHandler:void 0,hostHashAlgo:void 0,hostHashCb:void 0,strictVendor:void 0,debug:void 0},this._agent=void 0,this._readyTimeout=void 0,this._chanMgr=void 0,this._callbacks=void 0,this._forwarding=void 0,this._forwardingUnix=void 0,this._acceptX11=void 0,this._agentFwdEnabled=void 0,this._remoteVer=void 0,this._protocol=void 0,this._sock=void 0,this._resetKA=void 0}connect(e){if(this._sock&&j(this._sock))return this.once("close",(()=>{this.connect(e)})),this.end(),this;this.config.host=e.hostname||e.host||"localhost",this.config.port=e.port||22,this.config.localAddress="string"==typeof e.localAddress?e.localAddress:void 0,this.config.localPort="string"==typeof e.localPort||"number"==typeof e.localPort?e.localPort:void 0,this.config.forceIPv4=e.forceIPv4||!1,this.config.forceIPv6=e.forceIPv6||!1,this.config.keepaliveCountMax="number"==typeof e.keepaliveCountMax&&e.keepaliveCountMax>=0?e.keepaliveCountMax:3,this.config.keepaliveInterval="number"==typeof e.keepaliveInterval&&e.keepaliveInterval>0?e.keepaliveInterval:0,this.config.readyTimeout="number"==typeof e.readyTimeout&&e.readyTimeout>=0?e.readyTimeout:2e4,this.config.ident="string"==typeof e.ident||Buffer.isBuffer(e.ident)?e.ident:void 0;const t={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:[]},sc:void 0};let r=!0;if("object"==typeof e.algorithms&&null!==e.algorithms&&(t.kex=$(e.algorithms.kex,g,w),t.kex!==g&&(r=!1),t.serverHostKey=$(e.algorithms.serverHostKey,_,S),t.serverHostKey!==_&&(r=!1),t.cs.cipher=$(e.algorithms.cipher,p,y),t.cs.cipher!==p&&(r=!1),t.cs.mac=$(e.algorithms.hmac,m,v),t.cs.mac!==m&&(r=!1),t.cs.compress=$(e.algorithms.compress,f,b),t.cs.compress!==f&&(r=!1),r||(t.sc=t.cs)),"string"==typeof e.username)this.config.username=e.username;else{if("string"!=typeof e.user)throw new Error("Invalid username");this.config.username=e.user}this.config.password="string"==typeof e.password?e.password:void 0,this.config.privateKey="string"==typeof e.privateKey||Buffer.isBuffer(e.privateKey)?e.privateKey:void 0,this.config.localHostname="string"==typeof e.localHostname?e.localHostname:void 0,this.config.localUsername="string"==typeof e.localUsername?e.localUsername:void 0,this.config.tryKeyboard=!0===e.tryKeyboard,"string"==typeof e.agent&&e.agent.length?this.config.agent=D(e.agent):F(e.agent)?this.config.agent=e.agent:this.config.agent=void 0,this.config.allowAgentFwd=!0===e.agentForward&&void 0!==this.config.agent;let n=this.config.authHandler="function"==typeof e.authHandler||Array.isArray(e.authHandler)?e.authHandler:void 0;this.config.strictVendor="boolean"!=typeof e.strictVendor||e.strictVendor;const i=this.config.debug="function"==typeof e.debug?e.debug:void 0;if(!0===e.agentForward&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");let c,u,R=this._callbacks=[];if(this._chanMgr=new q(this),this._forwarding={},this._forwardingUnix={},this._acceptX11=0,this._agentFwdEnabled=!1,this._agent=this.config.agent?this.config.agent:void 0,this._remoteVer=void 0,this.config.privateKey){if(c=T(this.config.privateKey,e.passphrase),c instanceof Error)throw new Error(`Cannot parse privateKey: ${c.message}`);if(Array.isArray(c)&&(c=c[0]),null===c.getPrivatePEM())throw new Error("privateKey value does not contain a (valid) private key")}if("function"==typeof e.hostVerifier){const t=e.hostVerifier;let r;-1!==l.indexOf(e.hostHash)&&(r=s(e.hostHash)),u=(e,s)=>{r&&(r.update(e),e=r.digest("hex"));const n=t(e,s);void 0!==n&&s(n)}}const P=this._sock=e.sock||new o;let J=!1,Z=!1;this._protocol&&this._protocol.cleanup();const ee=i?(e,t,r)=>{i(`Debug output from server: ${JSON.stringify(r)}`)}:void 0;let te;const re=this._protocol=new I({ident:this.config.ident,offer:r?void 0:t,onWrite:e=>{j(P)&&P.write(e)},onError:e=>{"handshake"===e.level&&clearTimeout(this._readyTimeout),re._destruct||P.removeAllListeners("data"),this.emit("error",e);try{P.end()}catch{}},onHeader:e=>{Z=!0,this._remoteVer=e.versions.software,e.greeting&&this.emit("greeting",e.greeting)},onHandshakeComplete:e=>{this.emit("handshake",e),J||(J=!0,re.service("ssh-userauth"))},debug:i,hostVerifier:u,messageHandlers:{DEBUG:ee,DISCONNECT:(e,t,r)=>{if(t!==A.BY_APPLICATION){r||void 0===(r=E[t])&&(r=`Unexpected disconnection reason: ${t}`);const e=new Error(r);e.code=t,this.emit("error",e)}P.end()},SERVICE_ACCEPT:(e,t)=>{"ssh-userauth"===t&&be()},EXT_INFO:(e,t)=>{if(void 0===te){for(const e of t)if("server-sig-algs"===e.name)return void(te=e.algs);te=null}},USERAUTH_BANNER:(e,t)=>{this.emit("banner",t)},USERAUTH_SUCCESS:e=>{ue(),clearTimeout(this._readyTimeout),this.emit("ready")},USERAUTH_FAILURE:(e,t,r)=>{if(pe.keyAlgos){const e=pe.keyAlgos[0][0];if(i&&i(`Client: ${pe.type} (${e}) auth failed`),pe.keyAlgos.shift(),pe.keyAlgos.length){const[e,t]=pe.keyAlgos[0];switch(pe.type){case"agent":return void re.authPK(pe.username,pe.agentCtx.currentKey(),e);case"publickey":return void re.authPK(pe.username,pe.key,e);case"hostbased":return void re.authHostbased(pe.username,pe.key,pe.localHostname,pe.localUsername,e,((e,r)=>{const s=pe.key.sign(e,t);if(s instanceof Error)return s.message=`Error while signing with key: ${s.message}`,s.level="client-authentication",this.emit("error",s),be();r(s)}))}}else pe.keyAlgos=void 0}if("agent"===pe.type){const e=pe.agentCtx.pos();return i&&i(`Client: Agent key #${e+1} failed`),we()}i&&i(`Client: ${pe.type} auth failed`),ge=r,me=t,be()},USERAUTH_PASSWD_CHANGEREQ:(e,t)=>{"password"===pe.type&&this.emit("change password",t,(e=>{re.authPassword(this.config.username,this.config.password,e)}))},USERAUTH_PK_OK:e=>{let t,r;if(pe.keyAlgos&&([t,r]=pe.keyAlgos[0]),"agent"===pe.type){const e=pe.agentCtx.currentKey();re.authPK(pe.username,e,t,((t,s)=>{const n={hash:r};pe.agentCtx.sign(e,t,n,((e,t)=>{if(!e)return s(t);e.level="agent",this.emit("error",e),we()}))}))}else"publickey"===pe.type&&re.authPK(pe.username,pe.key,t,((e,t)=>{const s=pe.key.sign(e,r);if(s instanceof Error)return s.message=`Error signing data with key: ${s.message}`,s.level="client-authentication",this.emit("error",s),be();t(s)}))},USERAUTH_INFO_REQUEST:(e,t,r,s)=>{if("keyboard-interactive"===pe.type){if(0===(Array.isArray(s)?s.length:0))return i&&i("Client: Sending automatic USERAUTH_INFO_RESPONSE"),void re.authInfoRes();pe.prompt(t,r,"",s,(e=>{re.authInfoRes(e)}))}},REQUEST_SUCCESS:(e,t)=>{R.length&&R.shift()(!1,t)},REQUEST_FAILURE:e=>{R.length&&R.shift()(!0)},GLOBAL_REQUEST:(e,t,r,s)=>{"hostkeys-00@openssh.com"===t?(!function(e,t,r){if(!e._sock||!j(e._sock))return;if("function"!=typeof r&&(r=X),!Array.isArray(t))throw new TypeError("Invalid keys argument type");const s=[];for(const e of t){const t=T(e);if(t instanceof Error)throw t;s.push(t)}if(!e.config.strictVendor||e.config.strictVendor&&V.test(e._remoteVer))return e._callbacks.push(((t,n)=>{if(t)return void r(!0!==t?t:new Error("Server failed to prove supplied keys"));const i=[];let o=0;for(Y.init(n,0);Y.avail()&&o!==s.length;){const t=s[o++],r=t.getPublicSSH(),n=Y.readString();z.init(n,0);const a=z.readString(!0);let c,l=z.readString();if(a!==t.type){if("ssh-rsa"!==t.type)continue;switch(a){case"rsa-sha2-256":c="sha256";break;case"rsa-sha2-512":c="sha512";break;default:continue}}const u=e._protocol._kex.sessionID,h=Buffer.allocUnsafe(37+u.length+4+r.length);let d=0;L(h,29,d),h.utf8Write("hostkeys-prove-00@openssh.com",d+=4,29),L(h,u.length,d+=29),O(u,h,0,u.length,d+=4),L(h,r.length,d+=u.length),O(r,h,0,r.length,d+=4),(l=N(l,a))&&!0===t.verify(h,l,c)&&i.push(t)}z.clear(),Y.clear(),r(null,i)})),void e._protocol.openssh_hostKeysProve(s);process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}(this,s,((e,t)=>{e||this.emit("hostkeys",t)})),r&&re.requestSuccess()):r&&re.requestFailure()},CHANNEL_OPEN:(e,t)=>{!function(e,t){let r,s=-1;const n=()=>{const r={type:t.type,incoming:{id:s,window:G,packetSize:M,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},n=new x(e,r);return e._chanMgr.update(s,n),e._protocol.channelOpenConfirm(t.sender,s,G,M),n},i=()=>{void 0===r&&(r=-1===s?d.RESOURCE_SHORTAGE:d.CONNECT_FAILED),-1!==s&&e._chanMgr.remove(s),e._protocol.channelOpenFail(t.sender,r,"")},o=()=>(s=e._chanMgr.add(),-1===s&&(r=d.RESOURCE_SHORTAGE,e.config.debug&&e.config.debug("Client: Automatic rejection of incoming channel open: no channels available")),-1!==s),a=t.data;switch(t.type){case"forwarded-tcpip":{const t=e._forwarding[`${a.destIP}:${a.destPort}`];if(void 0!==t&&o())return 0===a.destPort&&(a.destPort=t),void e.emit("tcp connection",a,n,i);break}case"forwarded-streamlocal@openssh.com":if(void 0!==e._forwardingUnix[a.socketPath]&&o())return void e.emit("unix connection",a,n,i);break;case"auth-agent@openssh.com":if(e._agentFwdEnabled&&"function"==typeof e._agent.getStream&&o())return void e._agent.getStream(((e,t)=>{if(e)return i();const r=n();r.pipe(t).pipe(r)}));break;case"x11":if(0!==e._acceptX11&&o())return void e.emit("x11",a,n,i);break;default:r=d.UNKNOWN_CHANNEL_TYPE,e.config.debug&&e.config.debug(`Client: Automatic rejection of unsupported incoming channel open type: ${t.type}`)}void 0===r&&(r=d.ADMINISTRATIVELY_PROHIBITED,e.config.debug&&e.config.debug("Client: Automatic rejection of unexpected incoming channel open for: "+t.type)),i()}(this,t)},CHANNEL_OPEN_CONFIRMATION:(e,t)=>{const r=this._chanMgr.get(t.recipient);if("function"!=typeof r)return;const s="sftp"===r.type,n={type:s?"session":r.type,incoming:{id:t.recipient,window:G,packetSize:M,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},o=s?new C(this,n,{debug:i}):new x(this,n);this._chanMgr.update(t.recipient,o),r(void 0,o)},CHANNEL_OPEN_FAILURE:(e,t,r,s)=>{const n=this._chanMgr.get(t);"function"==typeof n&&K(this,t,{reason:r,description:s},n)},CHANNEL_DATA:(e,t,r)=>{const s=this._chanMgr.get(t);"object"==typeof s&&null!==s&&0!==s.incoming.window&&(s.incoming.window-=r.length,!1!==s.push(r)?s.incoming.window<=Q&&H(s):s._waitChanDrain=!0)},CHANNEL_EXTENDED_DATA:(e,t,r,s)=>{if(s!==h)return;const n=this._chanMgr.get(t);"object"==typeof n&&null!==n&&0!==n.incoming.window&&(n.incoming.window-=r.length,n.stderr.push(r)?n.incoming.window<=Q&&H(n):n._waitChanDrain=!0)},CHANNEL_WINDOW_ADJUST:(e,t,r)=>{const s=this._chanMgr.get(t);"object"==typeof s&&null!==s&&(s.outgoing.window+=r,s._waitWindow&&(s._waitWindow=!1,s._chunk?s._write(s._chunk,null,s._chunkcb):s._chunkcb?s._chunkcb():s._chunkErr?s.stderr._write(s._chunkErr,null,s._chunkcbErr):s._chunkcbErr&&s._chunkcbErr()))},CHANNEL_SUCCESS:(e,t)=>{const r=this._chanMgr.get(t);"object"==typeof r&&null!==r&&(this._resetKA(),r._callbacks.length&&r._callbacks.shift()(!1))},CHANNEL_FAILURE:(e,t)=>{const r=this._chanMgr.get(t);"object"==typeof r&&null!==r&&(this._resetKA(),r._callbacks.length&&r._callbacks.shift()(!0))},CHANNEL_REQUEST:(e,t,r,s,n)=>{const i=this._chanMgr.get(t);if("object"!=typeof i||null===i)return;const o=i._exit;if(void 0===o.code){switch(r){case"exit-status":return void i.emit("exit",o.code=n);case"exit-signal":return void i.emit("exit",o.code=null,o.signal=`SIG${n.signal}`,o.dump=n.coreDumped,o.desc=n.errorMessage)}s&&e.channelFailure(i.outgoing.id)}},CHANNEL_EOF:(e,t)=>{const r=this._chanMgr.get(t);"object"==typeof r&&null!==r&&"open"===r.incoming.state&&(r.incoming.state="eof",r.readable&&r.push(null),r.stderr.readable&&r.stderr.push(null))},CHANNEL_CLOSE:(e,t)=>{W(this,t,this._chanMgr.get(t))}}});P.pause();const se=this.config.keepaliveInterval,ne=this.config.keepaliveCountMax;let ae,ce=0;const le=()=>{if(++ce>ne){if(clearInterval(ae),P.readable){const e=new Error("Keepalive timeout");e.level="client-timeout",this.emit("error",e),P.destroy()}}else j(P)?(R.push(ue),re.ping()):clearInterval(ae)};function ue(){se>0&&(ce=0,clearInterval(ae),j(P)&&(ae=setInterval(le,se)))}this._resetKA=ue;const he=(()=>{let e=!1;return()=>{if(!e&&(e=!0,fe&&!Z)){const e=B("Connection lost before handshake","protocol",!0);this.emit("error",e)}}})(),de=(()=>{let e=!1;return()=>{e||(e=!0,fe=!0,i&&i("Socket connected"),this.emit("connect"),k.then((()=>{re.start(),P.on("data",(e=>{try{re.parse(e,0,e.length)}catch(e){this.emit("error",e);try{j(P)&&P.end()}catch{}}})),P.stderr&&"function"==typeof P.stderr.resume&&P.stderr.resume(),P.resume()})).catch((e=>{this.emit("error",e);try{j(P)&&P.end()}catch{}})))}})();let pe,fe=!1;P.on("connect",de).on("timeout",(()=>{this.emit("timeout")})).on("error",(e=>{i&&i(`Socket error: ${e.message}`),clearTimeout(this._readyTimeout),e.level="client-socket",this.emit("error",e)})).on("end",(()=>{i&&i("Socket ended"),he(),re.cleanup(),clearTimeout(this._readyTimeout),clearInterval(ae),this.emit("end")})).on("close",(()=>{i&&i("Socket closed"),he(),re.cleanup(),clearTimeout(this._readyTimeout),clearInterval(ae),this.emit("close");const e=R;R=this._callbacks=[];const t=new Error("No response from server");for(let r=0;r<e.length;++r)e[r](t);this._chanMgr.cleanup(t)}));let ge=null,me=null;const _e=["none"];void 0!==this.config.password&&_e.push("password"),void 0!==c&&_e.push("publickey"),void 0!==this._agent&&_e.push("agent"),this.config.tryKeyboard&&_e.push("keyboard-interactive"),void 0!==c&&void 0!==this.config.localHostname&&void 0!==this.config.localUsername&&_e.push("hostbased"),Array.isArray(n)?n=ie(n):"function"!=typeof n&&(n=ie(_e));let Ae=!1;const Ee=e=>{if(!Ae){if(Ae=!0,!1===e){const e=new Error("All configured authentication methods failed");return e.level="client-authentication",this.emit("error",e),void this.end()}if("string"==typeof e){const t=e;if(-1===_e.indexOf(t))return ye(`Authentication method not allowed: ${t}`);const r=this.config.username;switch(t){case"password":e={type:t,username:r,password:this.config.password};break;case"publickey":e={type:t,username:r,key:c};break;case"hostbased":e={type:t,username:r,key:c,localHostname:this.config.localHostname,localUsername:this.config.localUsername};break;case"agent":e={type:t,username:r,agentCtx:new U(this._agent)};break;case"keyboard-interactive":e={type:t,username:r,prompt:(...e)=>this.emit("keyboard-interactive",...e)};break;case"none":e={type:t,username:r};break;default:return ye(`Skipping unsupported authentication method: ${e}`)}}else{if("object"!=typeof e||null===e)return ye(`Skipping invalid authentication attempt: ${e}`);{const t=e.username;if("string"!=typeof t)return ye(`Skipping invalid authentication attempt: ${e}`);const r=e.type;switch(r){case"password":{const{password:s}=e;if("string"!=typeof s&&!Buffer.isBuffer(s))return ye("Skipping invalid password auth attempt");e={type:r,username:t,password:s};break}case"publickey":{const s=T(e.key,e.passphrase);if(s instanceof Error)return ye("Skipping invalid key auth attempt");if(!s.isPrivateKey())return ye("Skipping non-private key");e={type:r,username:t,key:s};break}case"hostbased":{const{localHostname:s,localUsername:n}=e,i=T(e.key,e.passphrase);if(i instanceof Error||"string"!=typeof s||"string"!=typeof n)return ye("Skipping invalid hostbased auth attempt");if(!i.isPrivateKey())return ye("Skipping non-private key");e={type:r,username:t,key:i,localHostname:s,localUsername:n};break}case"agent":{let s=e.agent;if("string"==typeof s&&s.length)s=D(s);else if(!F(s))return ye(`Skipping invalid agent: ${e.agent}`);e={type:r,username:t,agentCtx:new U(s)};break}case"keyboard-interactive":{const{prompt:s}=e;if("function"!=typeof s)return ye("Skipping invalid keyboard-interactive auth attempt");e={type:r,username:t,prompt:s};break}case"none":e={type:r,username:t};break;default:return ye(`Skipping unsupported authentication method: ${e}`)}}}pe=e;try{const e=pe.username;switch(pe.type){case"password":re.authPassword(e,pe.password);break;case"publickey":{let t;if(pe.keyAlgos=oe(this,pe.key,te),pe.keyAlgos){if(!pe.keyAlgos.length)return ye("Skipping key authentication (no mutual hash algorithm)");t=pe.keyAlgos[0][0]}re.authPK(e,pe.key,t);break}case"hostbased":{let t,r;if(pe.keyAlgos=oe(this,pe.key,te),pe.keyAlgos){if(!pe.keyAlgos.length)return ye("Skipping hostbased authentication (no mutual hash algorithm)");[t,r]=pe.keyAlgos[0]}re.authHostbased(e,pe.key,pe.localHostname,pe.localUsername,t,((e,t)=>{const s=pe.key.sign(e,r);if(s instanceof Error)return s.message=`Error while signing with key: ${s.message}`,s.level="client-authentication",this.emit("error",s),be();t(s)}));break}case"agent":pe.agentCtx.init((e=>{if(e)return e.level="agent",this.emit("error",e),be();we()}));break;case"keyboard-interactive":re.authKeyboard(e);break;case"none":re.authNone(e)}}finally{Ae=!1}}};function ye(e){i&&i(e),process.nextTick(be)}function be(){Ae=!1;const e=n(me,ge,Ee);Ae||void 0===e||Ee(e)}const we=()=>{if("agent"===pe.type){const e=pe.agentCtx.nextKey();if(!1===e)i&&i("Agent: No more keys left to try"),i&&i("Client: agent auth failed"),be();else{const t=pe.agentCtx.pos();let r;if(pe.keyAlgos=oe(this,e,te),pe.keyAlgos){if(!pe.keyAlgos.length)return i&&i(`Agent: Skipping key #${t+1} (no mutual hash algorithm)`),void we();r=pe.keyAlgos[0][0]}i&&i(`Agent: Trying key #${t+1}`),re.authPK(pe.username,e,r)}}},ve=()=>{this.config.readyTimeout>0&&(this._readyTimeout=setTimeout((()=>{const e=new Error("Timed out while waiting for handshake");e.level="client-timeout",this.emit("error",e),P.destroy()}),this.config.readyTimeout))};if(e.sock)ve(),"boolean"==typeof P.connecting&&P.connecting||de();else{let t=this.config.host;const r=this.config.forceIPv4,s=this.config.forceIPv6;i&&i(`Client: Trying ${t} on port ${this.config.port} ...`);const n=()=>{ve(),P.connect({host:t,port:this.config.port,localAddress:this.config.localAddress,localPort:this.config.localPort}),P.setMaxListeners(0),P.setTimeout("number"==typeof e.timeout?e.timeout:0)};!r&&!s||r&&s?n():a(t,r?4:6,((e,s,i)=>{if(e){const s=new Error(`Error while looking up ${r?"IPv4":"IPv6"} address for '${t}': ${e}`);return clearTimeout(this._readyTimeout),s.level="client-dns",this.emit("error",s),void this.emit("close")}t=s,n()}))}return this}end(){return this._sock&&j(this._sock)&&(this._protocol.disconnect(A.BY_APPLICATION),this._sock.end()),this}destroy(){return this._sock&&j(this._sock)&&this._sock.destroy(),this}exec(e,t,r){if(!this._sock||!j(this._sock))throw new Error("Not connected");return"function"==typeof t&&(r=t,t={}),J(this,"session",{allowHalfOpen:!1!==t.allowHalfOpen},((s,n)=>{if(s)return void r(s);const i=[];function o(e){if(e)return n.close(),void r(e);i.length&&i.shift()()}(!0===this.config.allowAgentFwd||t&&!0===t.agentForward&&void 0!==this._agent)&&i.push((()=>te(n,o))),"object"==typeof t&&null!==t&&("object"==typeof t.env&&null!==t.env&&re(n,t.env),("object"==typeof t.pty&&null!==t.pty||!0===t.pty)&&i.push((()=>ee(n,t.pty,o))),("object"==typeof t.x11&&null!==t.x11||"number"===t.x11||!0===t.x11)&&i.push((()=>Z(n,t.x11,o)))),i.push((()=>function(e,t,r,s){"open"===e.outgoing.state?(e._callbacks.push((t=>{t?s(!0!==t?t:new Error("Unable to exec")):(e.subtype="exec",e.allowHalfOpen=!1!==r.allowHalfOpen,s(void 0,e))})),e._client._protocol.exec(e.outgoing.id,t,!0)):s(new Error("Channel is not open"))}(n,e,t,r))),i.shift()()})),this}shell(e,t,r){if(!this._sock||!j(this._sock))throw new Error("Not connected");return"function"==typeof e?(r=e,e=t=void 0):"function"==typeof t&&(r=t,t=void 0),!e||void 0===e.x11&&void 0===e.env||(t=e,e=void 0),J(this,"session",((s,n)=>{if(s)return void r(s);const i=[];function o(e){if(e)return n.close(),void r(e);i.length&&i.shift()()}(!0===this.config.allowAgentFwd||t&&!0===t.agentForward&&void 0!==this._agent)&&i.push((()=>te(n,o))),!1!==e&&i.push((()=>ee(n,e,o))),"object"==typeof t&&null!==t&&("object"==typeof t.env&&null!==t.env&&re(n,t.env),("object"==typeof t.x11&&null!==t.x11||"number"===t.x11||!0===t.x11)&&i.push((()=>Z(n,t.x11,o)))),i.push((()=>function(e,t){"open"===e.outgoing.state?(e._callbacks.push((r=>{r?t(!0!==r?r:new Error("Unable to open shell")):(e.subtype="shell",t(void 0,e))})),e._client._protocol.shell(e.outgoing.id,!0)):t(new Error("Channel is not open"))}(n,r))),i.shift()()})),this}subsys(e,t){if(!this._sock||!j(this._sock))throw new Error("Not connected");return J(this,"session",((r,s)=>{r?t(r):se(s,e,((e,r)=>{e?t(e):t(void 0,r)}))})),this}forwardIn(e,t,r){if(!this._sock||!j(this._sock))throw new Error("Not connected");const s="function"==typeof r;return s&&this._callbacks.push(((s,n)=>{if(s)return void r(!0!==s?s:new Error(`Unable to bind to ${e}:${t}`));let i=t;0===t&&n&&n.length>=4&&(i=P(n,0),this._protocol._compatFlags&u.DYN_RPORT_BUG||(t=i)),this._forwarding[`${e}:${t}`]=i,r(void 0,i)})),this._protocol.tcpipForward(e,t,s),this}unforwardIn(e,t,r){if(!this._sock||!j(this._sock))throw new Error("Not connected");const s="function"==typeof r;return s&&this._callbacks.push((s=>{s?r(!0!==s?s:new Error(`Unable to unbind from ${e}:${t}`)):(delete this._forwarding[`${e}:${t}`],r())})),this._protocol.cancelTcpipForward(e,t,s),this}forwardOut(e,t,r,s,n){if(!this._sock||!j(this._sock))throw new Error("Not connected");return"function"!=typeof n&&(n=X),J(this,"direct-tcpip",{srcIP:e,srcPort:t,dstIP:r,dstPort:s},n),this}openssh_noMoreSessions(e){if(!this._sock||!j(this._sock))throw new Error("Not connected");const t="function"==typeof e;return!this.config.strictVendor||this.config.strictVendor&&V.test(this._remoteVer)?(t&&this._callbacks.push((t=>{t?e(!0!==t?t:new Error("Unable to disable future sessions")):e()})),this._protocol.openssh_noMoreSessions(t),this):t?(process.nextTick(e,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardInStreamLocal(e,t){if(!this._sock||!j(this._sock))throw new Error("Not connected");const r="function"==typeof t;return!this.config.strictVendor||this.config.strictVendor&&V.test(this._remoteVer)?(r&&this._callbacks.push((r=>{r?t(!0!==r?r:new Error(`Unable to bind to ${e}`)):(this._forwardingUnix[e]=!0,t())})),this._protocol.openssh_streamLocalForward(e,r),this):r?(process.nextTick(t,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_unforwardInStreamLocal(e,t){if(!this._sock||!j(this._sock))throw new Error("Not connected");const r="function"==typeof t;return!this.config.strictVendor||this.config.strictVendor&&V.test(this._remoteVer)?(r&&this._callbacks.push((r=>{r?t(!0!==r?r:new Error(`Unable to unbind from ${e}`)):(delete this._forwardingUnix[e],t())})),this._protocol.openssh_cancelStreamLocalForward(e,r),this):r?(process.nextTick(t,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardOutStreamLocal(e,t){if(!this._sock||!j(this._sock))throw new Error("Not connected");return"function"!=typeof t&&(t=X),!this.config.strictVendor||this.config.strictVendor&&V.test(this._remoteVer)?(J(this,"direct-streamlocal@openssh.com",{socketPath:e},t),this):(process.nextTick(t,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this)}sftp(e){if(!this._sock||!j(this._sock))throw new Error("Not connected");return J(this,"sftp",((t,r)=>{t?e(t):se(r,"sftp",((t,s)=>{function n(){r.removeListener("ready",i),r.removeListener("error",o),r.removeListener("exit",a),r.removeListener("close",a)}function i(){n(),e(void 0,r)}function o(t){n(),e(t)}function a(t,r){let s;n(),s="number"==typeof t?`Received exit code ${t} while establishing SFTP session`:void 0!==r?`Received signal ${r} while establishing SFTP session`:"Received unexpected SFTP session termination";const i=new Error(s);i.code=t,i.signal=r,e(i)}t?e(t):(r.on("ready",i).on("error",o).on("exit",a).on("close",a),r._init())}))})),this}setNoDelay(e){return this._sock&&"function"==typeof this._sock.setNoDelay&&this._sock.setNoDelay(e),this}}},3657:(e,t,r)=>{"use strict";const{Agent:s}=r(3685),{Agent:n}=r(5687),{connect:i}=r(4404);let o;for(const e of[s,n]){class n extends e{constructor(e,t){super(t),this._connectCfg=e,this._defaultSrcIP=t&&t.srcIP||"localhost"}createConnection(t,s){const n=t&&t.localAddress||this._defaultSrcIP,i=t&&t.localPort||0,a=t.host,l=t.port;void 0===o&&(o=r(2353));const u=new o;let h=!1;u.on("ready",(()=>{u.forwardOut(n,i,a,l,((r,n)=>{if(h=!0,r)return u.end(),s(r);n.once("close",(()=>u.end())),s(null,c(n,e,t))}))})).on("error",s).on("close",(()=>{h||s(new Error("Unexpected connection close"))})).connect(this._connectCfg)}}t[e===s?"SSHTTPAgent":"SSHTTPSAgent"]=n}function a(){}function c(e,t,r){if(t===s)return e.setKeepAlive=a,e.setNoDelay=a,e.setTimeout=a,e.ref=a,e.unref=a,e.destroySoon=e.destroy,e;r.socket=e;const n=i(r),o=(()=>{let t=!1;return()=>{t||(t=!0,e.isPaused()&&e.resume())}})();return n.on("end",o).on("close",o),n}},9005:(e,t,r)=>{"use strict";const{AgentProtocol:s,BaseAgent:n,createAgent:i,CygwinAgent:o,OpenSSHAgent:a,PageantAgent:c}=r(1119),{SSHTTPAgent:l,SSHTTPSAgent:u}=r(3657),{parseKey:h}=r(3781),{flagsToString:d,OPEN_MODE:p,STATUS_CODE:f,stringToFlags:g}=r(4061);e.exports={AgentProtocol:s,BaseAgent:n,createAgent:i,Client:r(2353),CygwinAgent:o,HTTPAgent:l,HTTPSAgent:u,OpenSSHAgent:a,PageantAgent:c,Server:r(7465),utils:{parseKey:h,...r(8970),sftp:{flagsToString:d,OPEN_MODE:p,STATUS_CODE:f,stringToFlags:g}}}},8970:(e,t,r)=>{"use strict";const{createCipheriv:s,generateKeyPair:n,generateKeyPairSync:i,getCurves:o,randomBytes:a}=r(6113),{Ber:c}=r(476),l=r(2703).pbkdf,{CIPHER_INFO:u}=r(8545),h=o(),d=new Map(Object.entries(u));function p(e,t){if("string"!=typeof e)throw new TypeError("Key type must be a string");const r={type:"spki",format:"der"},s={type:"pkcs8",format:"der"};switch(e.toLowerCase()){case"rsa":{if("object"!=typeof t||null===t)throw new TypeError("Missing options object for RSA key");const e=t.bits;if(!Number.isInteger(e))throw new TypeError("RSA bits must be an integer");if(e<=0||e>16384)throw new RangeError("RSA bits must be non-zero and <= 16384");return["rsa",{modulusLength:e,publicKeyEncoding:r,privateKeyEncoding:s}]}case"ecdsa":{if("object"!=typeof t||null===t)throw new TypeError("Missing options object for ECDSA key");if(!Number.isInteger(t.bits))throw new TypeError("ECDSA bits must be an integer");let e;switch(t.bits){case 256:e="prime256v1";break;case 384:e="secp384r1";break;case 521:e="secp521r1";break;default:throw new Error("ECDSA bits must be 256, 384, or 521")}if(!h.includes(e))throw new Error("Unsupported ECDSA bits value");return["ec",{namedCurve:e,publicKeyEncoding:r,privateKeyEncoding:s}]}case"ed25519":return["ed25519",{publicKeyEncoding:r,privateKeyEncoding:s}];default:throw new Error(`Unsupported key type: ${e}`)}}function f(e,t,r,n){let i,o="new",u="";if("object"==typeof n&&null!==n&&("string"==typeof n.comment&&n.comment&&(u=n.comment),"string"==typeof n.format&&n.format&&(o=n.format),n.passphrase)){let e;if("string"==typeof n.passphrase)e=Buffer.from(n.passphrase);else{if(!Buffer.isBuffer(n.passphrase))throw new Error("Invalid passphrase");e=n.passphrase}if(void 0===n.cipher)throw new Error("Missing cipher name");const t=d.get(n.cipher);if(void 0===t)throw new Error("Invalid cipher name");if("new"===o){let r=16;if(void 0!==n.rounds){if(!Number.isInteger(n.rounds))throw new TypeError("rounds must be an integer");n.rounds>0&&(r=n.rounds)}const s=Buffer.allocUnsafe(t.keyLen+t.ivLen),o=a(16);if(0!==l(e,e.length,o,o.length,s,s.length,r))return new Error("Failed to generate information to encrypt key");const c=Buffer.allocUnsafe(4+o.length+4);{let e=0;c.writeUInt32BE(o.length,e+=0),c.set(o,e+=4),c.writeUInt32BE(r,e+=o.length)}i={cipher:t,cipherName:n.cipher,kdfName:"bcrypt",kdfOptions:c,key:s.slice(0,t.keyLen),iv:s.slice(t.keyLen)}}}if("new"===o){let n,o="-----BEGIN OPENSSH PRIVATE KEY-----\n";const l=Buffer.from(i?i.cipherName:"none"),h=Buffer.from(i?i.kdfName:"none"),d=i?i.kdfOptions:Buffer.alloc(0),p=i?i.cipher.blockLen:8,f=function(e,t,r){switch(e){case"rsa":{let e=new c.Reader(r);if(e.readSequence(),0!==e.readInt())throw new Error("Unsupported version in RSA private key");if(e.readSequence(),"1.2.840.113549.1.1.1"!==e.readOID())throw new Error("Bad RSA private OID");if(e.readByte()!==c.Null)throw new Error("Malformed RSA private key (expected null)");if(0!==e.readByte())throw new Error("Malformed RSA private key (expected zero-length null)");if(e=new c.Reader(e.readString(c.OctetString,!0)),e.readSequence(),0!==e.readInt())throw new Error("Unsupported version in RSA private key");const t=e.readString(c.Integer,!0),s=e.readString(c.Integer,!0),n=e.readString(c.Integer,!0),i=e.readString(c.Integer,!0),o=e.readString(c.Integer,!0);e.readString(c.Integer,!0),e.readString(c.Integer,!0);const a=e.readString(c.Integer,!0),l=Buffer.from("ssh-rsa"),u=Buffer.allocUnsafe(4+l.length+4+t.length+4+s.length+4+n.length+4+a.length+4+i.length+4+o.length);let h=0;u.writeUInt32BE(l.length,h+=0),u.set(l,h+=4),u.writeUInt32BE(t.length,h+=l.length),u.set(t,h+=4),u.writeUInt32BE(s.length,h+=t.length),u.set(s,h+=4),u.writeUInt32BE(n.length,h+=s.length),u.set(n,h+=4),u.writeUInt32BE(a.length,h+=n.length),u.set(a,h+=4),u.writeUInt32BE(i.length,h+=a.length),u.set(i,h+=4),u.writeUInt32BE(o.length,h+=i.length),u.set(o,h+=4);const d=Buffer.allocUnsafe(4+l.length+4+s.length+4+t.length);return h=0,d.writeUInt32BE(l.length,h+=0),d.set(l,h+=4),d.writeUInt32BE(s.length,h+=l.length),d.set(s,h+=4),d.writeUInt32BE(t.length,h+=s.length),d.set(t,h+=4),{sshName:l.toString(),priv:u,pub:d}}case"ec":{let e=new c.Reader(t);if(e.readSequence(),e.readSequence(),"1.2.840.10045.2.1"!==e.readOID())throw new Error("Bad ECDSA public OID");e.readOID();let s,n=e.readString(c.BitString,!0);{let e=0;for(;e<n.length&&0===n[e];++e);e>0&&(n=n.slice(e))}if(e=new c.Reader(r),e.readSequence(),0!==e.readInt())throw new Error("Unsupported version in ECDSA private key");if(e.readSequence(),"1.2.840.10045.2.1"!==e.readOID())throw new Error("Bad ECDSA private OID");switch(e.readOID()){case"1.2.840.10045.3.1.7":s="nistp256";break;case"1.3.132.0.34":s="nistp384";break;case"1.3.132.0.35":s="nistp521";break;default:throw new Error("Unsupported curve in ECDSA private key")}if(e=new c.Reader(e.readString(c.OctetString,!0)),e.readSequence(),1!==e.readInt())throw new Error("Unsupported version in ECDSA private key");const i=Buffer.concat([Buffer.from([0]),e.readString(c.OctetString,!0)]),o=Buffer.from(`ecdsa-sha2-${s}`);s=Buffer.from(s);const a=Buffer.allocUnsafe(4+o.length+4+s.length+4+n.length+4+i.length);let l=0;a.writeUInt32BE(o.length,l+=0),a.set(o,l+=4),a.writeUInt32BE(s.length,l+=o.length),a.set(s,l+=4),a.writeUInt32BE(n.length,l+=s.length),a.set(n,l+=4),a.writeUInt32BE(i.length,l+=n.length),a.set(i,l+=4);const u=Buffer.allocUnsafe(4+o.length+4+s.length+4+n.length);return l=0,u.writeUInt32BE(o.length,l+=0),u.set(o,l+=4),u.writeUInt32BE(s.length,l+=o.length),u.set(s,l+=4),u.writeUInt32BE(n.length,l+=s.length),u.set(n,l+=4),{sshName:o.toString(),priv:a,pub:u}}case"ed25519":{let e=new c.Reader(t);if(e.readSequence(),e.readSequence(),"1.3.101.112"!==e.readOID())throw new Error("Bad ED25519 public OID");let s=e.readString(c.BitString,!0);{let e=0;for(;e<s.length&&0===s[e];++e);e>0&&(s=s.slice(e))}if(e=new c.Reader(r),e.readSequence(),0!==e.readInt())throw new Error("Unsupported version in ED25519 private key");if(e.readSequence(),"1.3.101.112"!==e.readOID())throw new Error("Bad ED25519 private OID");e=new c.Reader(e.readString(c.OctetString,!0));const n=e.readString(c.OctetString,!0),i=Buffer.from("ssh-ed25519"),o=Buffer.allocUnsafe(4+i.length+4+s.length+4+(n.length+s.length));let a=0;o.writeUInt32BE(i.length,a+=0),o.set(i,a+=4),o.writeUInt32BE(s.length,a+=i.length),o.set(s,a+=4),o.writeUInt32BE(n.length+s.length,a+=s.length),o.set(n,a+=4),o.set(s,a+=n.length);const l=Buffer.allocUnsafe(4+i.length+4+s.length);return a=0,l.writeUInt32BE(i.length,a+=0),l.set(i,a+=4),l.writeUInt32BE(s.length,a+=i.length),l.set(s,a+=4),{sshName:i.toString(),priv:o,pub:l}}}}(e,t,r),g=a(4),m=Buffer.from(u),_=8+f.priv.length+4+m.length;let A=[];for(let e=1;(_+A.length)%p;++e)A.push(255&e);A=Buffer.from(A);let E,y=Buffer.allocUnsafe(_+A.length);{let e=0;y.set(g,e+=0),y.set(g,e+=4),y.set(f.priv,e+=4),y.writeUInt32BE(m.length,e+=f.priv.length),y.set(m,e+=4),y.set(A,e+=m.length)}if(i){const e={authTagLength:i.cipher.authLen},t=s(i.cipher.sslName,i.key,i.iv,e);t.setAutoPadding(!1),y=Buffer.concat([t.update(y),t.final()]),E=i.cipher.authLen>0?t.getAuthTag():Buffer.alloc(0),i.key.fill(0),i.iv.fill(0)}else E=Buffer.alloc(0);const b=Buffer.from("openssh-key-v1\0"),w=Buffer.allocUnsafe(b.length+4+l.length+4+h.length+4+d.length+4+4+f.pub.length+4+y.length+E.length);{let e=0;w.set(b,e+=0),w.writeUInt32BE(l.length,e+=b.length),w.set(l,e+=4),w.writeUInt32BE(h.length,e+=l.length),w.set(h,e+=4),w.writeUInt32BE(d.length,e+=h.length),w.set(d,e+=4),w.writeUInt32BE(1,e+=d.length),w.writeUInt32BE(f.pub.length,e+=4),w.set(f.pub,e+=4),w.writeUInt32BE(y.length,e+=f.pub.length),w.set(y,e+=4),w.set(E,e+=y.length)}{const e=w.base64Slice(0,w.length);let t=e.replace(/.{64}/g,"$&\n");63&e.length&&(t+="\n"),o+=t}{const e=f.pub.base64Slice(0,f.pub.length);n=`${f.sshName} ${e}${u?` ${u}`:""}`}return o+="-----END OPENSSH PRIVATE KEY-----\n",{private:o,public:n}}throw new Error("Invalid output key format")}function g(){}e.exports={generateKeyPair:(e,t,r)=>{"function"==typeof t&&(r=t,t=void 0),"function"!=typeof r&&(r=g);const s=p(e,t);n(...s,((e,n,i)=>{if(e)return r(e);let o;try{o=f(s[0],n,i,t)}catch(e){return r(e)}r(null,o)}))},generateKeyPairSync:(e,t)=>{const r=p(e,t),{publicKey:s,privateKey:n}=i(...r);return f(r[0],s,n,t)}}},3603:(e,t,r)=>{"use strict";const{inspect:s}=r(3837),{bindingAvailable:n,NullCipher:i,NullDecipher:o}=r(8545),{COMPAT_CHECKS:a,DISCONNECT_REASON:c,eddsaSupported:l,MESSAGE:u,SIGNALS:h,TERMINAL_MODE:d}=r(3190),{DEFAULT_KEXINIT_CLIENT:p,DEFAULT_KEXINIT_SERVER:f,KexInit:g,kexinit:m,onKEXPayload:_}=r(5260),{parseKey:A}=r(3781),E=r(2908),{bufferCopy:y,bufferFill:b,bufferSlice:w,convertSignature:v,sendPacket:S,writeUInt32BE:k}=r(9205),{PacketReader:I,PacketWriter:T,ZlibPacketReader:C,ZlibPacketWriter:O}=r(6993),R=r(6674).i8,B=new Map(Object.values(c).map((e=>[e,1]))),P=Buffer.from(`SSH-2.0-ssh2js${R}`),N=Buffer.from(`${P}\r\n`),L=Buffer.from([u.GLOBAL_REQUEST,0,0,0,21,107,101,101,112,97,108,105,118,101,64,111,112,101,110,115,115,104,46,99,111,109,1]),U=Buffer.from([d.TTY_OP_END]);function D(){}const F=/^SSH-(2\.0|1\.99)-([^ ]+)(?: (.*))?$/;function x(e,t,r){let n,i;this._buffer?(n=Buffer.allocUnsafe(this._buffer.length+(r-t)),n.set(this._buffer,0),0===t?n.set(e,this._buffer.length):n.set(new Uint8Array(e.buffer,e.byteOffset+t,r-t),this._buffer.length),i=this._buffer.length,t=0):(n=e,i=0);const a=t;let c=t,l=t,u=!1,h=0,d=0;for(;t<n.length;++t){const e=n[t];if(13!==e){if(10===e){if(l>c&&l-c>4&&83===n[c]&&83===n[c+1]&&72===n[c+2]&&45===n[c+3]){const e=n.latin1Slice(a,l+1),u=c===a?e:e.slice(c-a),h=F.exec(u);if(!h)throw new Error("Invalid identification string");const d={greeting:c===a?"":e.slice(0,c-a),identRaw:u,versions:{protocol:h[1],software:h[2]},comments:h[3]};return this._remoteIdentRaw=Buffer.from(u),this._debug&&this._debug(`Remote ident: ${s(u)}`),this._compatFlags=H(d),this._buffer=void 0,this._decipher=new o(0,_.bind(this,{firstPacket:!0})),this._parse=G,this._onHeader(d),this._destruct?(m(this),t+1-i):r}if(this._server)throw new Error("Greetings from clients not permitted");if(++d>1024)throw new Error("Max greeting lines exceeded");u=!1,c=t+1,h=0}else{if(u)throw new Error("Invalid header: expected newline");if(++h>=8192)throw new Error("Header line too long")}l=t}else u=!0}return this._buffer||(this._buffer=w(n,a)),t-i}function G(e,t,r){return this._decipher.decrypt(e,t,r)}function M(e){if(this._onPacket(),0===e.length)return void(this._debug&&this._debug("Inbound: Skipping empty packet payload"));const t=(e=this._packetRW.read.read(e))[0];t!==u.USERAUTH_SUCCESS||this._server||this._authenticated||(this._authenticated=!0,"zlib@openssh.com"===this._kex.negotiated.cs.compress&&(this._packetRW.write=new O(this)),"zlib@openssh.com"===this._kex.negotiated.sc.compress&&(this._packetRW.read=new C));const r=E[t];if(void 0!==r)return r(this,e);this._debug&&this._debug(`Inbound: Unsupported message type: ${t}`)}function H(e){const t=e.versions.software;let r=0;for(const e of a)"string"==typeof e[0]?t===e[0]&&(r|=e[1]):e[0].test(t)&&(r|=e[1]);return r}e.exports=class{constructor(e){const t=e.onWrite;if("function"!=typeof t)throw new Error("Missing onWrite function");this._onWrite=e=>{t(e)};const r=e.onError;if("function"!=typeof r)throw new Error("Missing onError function");this._onError=e=>{r(e)};const o=e.debug;this._debug="function"==typeof o?e=>{o(e)}:void 0;const a=e.onHeader;this._onHeader="function"==typeof a?(...e)=>{a(...e)}:D;const c=e.onPacket;this._onPacket="function"==typeof c?()=>{c()}:D;let h,d=e.onHandshakeComplete;"function"!=typeof d&&(d=D),this._onHandshakeComplete=(...e)=>{this._debug&&this._debug("Handshake completed"),h=void 0===h;const t=this._queue;if(t){this._queue=void 0,this._debug&&this._debug(`Draining outbound queue (${t.length}) ...`);for(let e=0;e<t.length;++e){const r=t[e];let s=this._packetRW.write.finalize(r);if(s===r){const e=this._cipher.allocPacket(r.length);e.set(r,5),s=e}S(this,s)}this._debug&&this._debug("... finished draining outbound queue")}h&&this._server&&this._kex.remoteExtInfoEnabled&&function(e){let t="ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss";l&&(t=`ssh-ed25519,${t}`);const r=Buffer.byteLength(t);let s=e._packetRW.write.allocStart;const n=e._packetRW.write.alloc(28+r);n[s]=u.EXT_INFO,k(n,1,++s),k(n,15,s+=4),n.utf8Write("server-sig-algs",s+=4,15),k(n,r,s+=15),n.utf8Write(t,s+=4,r),e._debug&&e._debug("Outbound: Sending EXT_INFO"),S(e,e._packetRW.write.finalize(n))}(this),d(...e)},this._queue=void 0;const m=e.messageHandlers;let _;if(this._handlers="object"==typeof m&&null!==m?m:{},this._onPayload=M.bind(this),this._server=!!e.server,this._banner=void 0,this._server){if("object"!=typeof e.hostKeys||null===e.hostKeys)throw new Error("Missing server host key(s)");this._hostKeys=e.hostKeys,"string"==typeof e.greeting&&e.greeting.length&&(_="\r\n"===e.greeting.slice(-2)?e.greeting:`${e.greeting}\r\n`),"string"==typeof e.banner&&e.banner.length&&(this._banner="\r\n"===e.banner.slice(-2)?e.banner:`${e.banner}\r\n`)}else this._hostKeys=void 0;let A,E=e.offer;if("object"!=typeof E||null===E?E=this._server?f:p:E.constructor!==g&&(this._server||(E.kex=E.kex.concat(["ext-info-c"])),E=new g(E)),this._kex=void 0,this._kexinit=void 0,this._offer=E,this._cipher=new i(0,this._onWrite),this._decipher=void 0,this._skipNextInboundPacket=!1,this._packetRW={read:new I,write:new T(this)},this._hostVerifier=this._server||"function"!=typeof e.hostVerifier?void 0:e.hostVerifier,this._parse=x,this._buffer=void 0,this._authsQueue=[],this._authenticated=!1,this._remoteIdentRaw=void 0,"string"==typeof e.ident)this._identRaw=Buffer.from(`SSH-2.0-${e.ident}`),A=Buffer.allocUnsafe(this._identRaw.length+2),A.set(this._identRaw,0),A[A.length-2]=13,A[A.length-1]=10;else if(Buffer.isBuffer(e.ident)){const t=Buffer.allocUnsafe(8+e.ident.length);t.latin1Write("SSH-2.0-",0,8),t.set(e.ident,8),this._identRaw=t,A=Buffer.allocUnsafe(t.length+2),A.set(t,0),A[A.length-2]=13,A[A.length-1]=10}else this._identRaw=P,A=N;this._compatFlags=0,this._debug&&(n?this._debug("Custom crypto binding available"):this._debug("Custom crypto binding not available")),this._debug&&this._debug(`Local ident: ${s(this._identRaw.toString())}`),this.start=()=>{this.start=void 0,_&&this._onWrite(_),this._onWrite(A)}}_destruct(e){this._packetRW.read.cleanup(),this._packetRW.write.cleanup(),this._cipher&&this._cipher.free(),this._decipher&&this._decipher.free(),"string"==typeof e&&0!==e.length||(e="fatal error"),this.parse=()=>{throw new Error(`Instance unusable after ${e}`)},this._onWrite=()=>{throw new Error(`Instance unusable after ${e}`)},this._destruct=void 0}cleanup(){this._destruct&&this._destruct()}parse(e,t,r){for(;t<r;)t=this._parse(e,t,r)}disconnect(e){let t=this._packetRW.write.allocStartKEX;const r=this._packetRW.write.alloc(13,!0),s=t+13;B.has(e)||(e=c.PROTOCOL_ERROR),r[t]=u.DISCONNECT,k(r,e,++t),r.fill(0,t+=4,s),this._debug&&this._debug(`Outbound: Sending DISCONNECT (${e})`),S(this,this._packetRW.write.finalize(r,!0),!0)}ping(){const e=this._packetRW.write.allocStart,t=this._packetRW.write.alloc(L.length);t.set(L,e),this._debug&&this._debug("Outbound: Sending ping (GLOBAL_REQUEST: keepalive@openssh.com)"),S(this,this._packetRW.write.finalize(t))}rekey(){void 0===this._kexinit?(this._debug&&this._debug("Outbound: Initiated explicit rekey"),this._queue=[],m(this)):this._debug&&this._debug("Outbound: Ignoring rekey during handshake")}requestSuccess(e){let t,r=this._packetRW.write.allocStart;Buffer.isBuffer(e)?(t=this._packetRW.write.alloc(1+e.length),t[r]=u.REQUEST_SUCCESS,t.set(e,++r)):(t=this._packetRW.write.alloc(1),t[r]=u.REQUEST_SUCCESS),this._debug&&this._debug("Outbound: Sending REQUEST_SUCCESS"),S(this,this._packetRW.write.finalize(t))}requestFailure(){const e=this._packetRW.write.allocStart,t=this._packetRW.write.alloc(1);t[e]=u.REQUEST_FAILURE,this._debug&&this._debug("Outbound: Sending REQUEST_FAILURE"),S(this,this._packetRW.write.finalize(t))}channelSuccess(e){let t=this._packetRW.write.allocStart;const r=this._packetRW.write.alloc(5);r[t]=u.CHANNEL_SUCCESS,k(r,e,++t),this._debug&&this._debug(`Outbound: Sending CHANNEL_SUCCESS (r:${e})`),S(this,this._packetRW.write.finalize(r))}channelFailure(e){let t=this._packetRW.write.allocStart;const r=this._packetRW.write.alloc(5);r[t]=u.CHANNEL_FAILURE,k(r,e,++t),this._debug&&this._debug(`Outbound: Sending CHANNEL_FAILURE (r:${e})`),S(this,this._packetRW.write.finalize(r))}channelEOF(e){let t=this._packetRW.write.allocStart;const r=this._packetRW.write.alloc(5);r[t]=u.CHANNEL_EOF,k(r,e,++t),this._debug&&this._debug(`Outbound: Sending CHANNEL_EOF (r:${e})`),S(this,this._packetRW.write.finalize(r))}channelClose(e){let t=this._packetRW.write.allocStart;const r=this._packetRW.write.alloc(5);r[t]=u.CHANNEL_CLOSE,k(r,e,++t),this._debug&&this._debug(`Outbound: Sending CHANNEL_CLOSE (r:${e})`),S(this,this._packetRW.write.finalize(r))}channelWindowAdjust(e,t){let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(9);s[r]=u.CHANNEL_WINDOW_ADJUST,k(s,e,++r),k(s,t,r+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_WINDOW_ADJUST (r:${e}, ${t})`),S(this,this._packetRW.write.finalize(s))}channelData(e,t){const r=Buffer.isBuffer(t),s=r?t.length:Buffer.byteLength(t);let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(9+s);i[n]=u.CHANNEL_DATA,k(i,e,++n),k(i,s,n+=4),r?i.set(t,n+=4):i.utf8Write(t,n+=4,s),this._debug&&this._debug(`Outbound: Sending CHANNEL_DATA (r:${e}, ${s})`),S(this,this._packetRW.write.finalize(i))}channelExtData(e,t,r){const s=Buffer.isBuffer(t),n=s?t.length:Buffer.byteLength(t);let i=this._packetRW.write.allocStart;const o=this._packetRW.write.alloc(13+n);o[i]=u.CHANNEL_EXTENDED_DATA,k(o,e,++i),k(o,r,i+=4),k(o,n,i+=4),s?o.set(t,i+=4):o.utf8Write(t,i+=4,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_EXTENDED_DATA (r:${e})`),S(this,this._packetRW.write.finalize(o))}channelOpenConfirm(e,t,r,s){let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(17);i[n]=u.CHANNEL_OPEN_CONFIRMATION,k(i,e,++n),k(i,t,n+=4),k(i,r,n+=4),k(i,s,n+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_CONFIRMATION (r:${e}, l:${t})`),S(this,this._packetRW.write.finalize(i))}channelOpenFail(e,t,r){"string"!=typeof r&&(r="");const s=Buffer.byteLength(r);let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(13+s+4);i[n]=u.CHANNEL_OPEN_FAILURE,k(i,e,++n),k(i,t,n+=4),k(i,s,n+=4),n+=4,s&&(i.utf8Write(r,n,s),n+=s),k(i,0,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_FAILURE (r:${e})`),S(this,this._packetRW.write.finalize(i))}service(e){if(this._server)throw new Error("Client-only method called in server mode");const t=Buffer.byteLength(e);let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(5+t);s[r]=u.SERVICE_REQUEST,k(s,t,++r),s.utf8Write(e,r+=4,t),this._debug&&this._debug(`Outbound: Sending SERVICE_REQUEST (${e})`),S(this,this._packetRW.write.finalize(s))}authPassword(e,t,r){if(this._server)throw new Error("Client-only method called in server mode");const s=Buffer.byteLength(e),n=Buffer.byteLength(t),i=r?Buffer.byteLength(r):0;let o=this._packetRW.write.allocStart;const a=this._packetRW.write.alloc(5+s+4+14+4+8+1+4+n+(r?4+i:0));a[o]=u.USERAUTH_REQUEST,k(a,s,++o),a.utf8Write(e,o+=4,s),k(a,14,o+=s),a.utf8Write("ssh-connection",o+=4,14),k(a,8,o+=14),a.utf8Write("password",o+=4,8),a[o+=8]=r?1:0,k(a,n,++o),Buffer.isBuffer(t)?y(t,a,0,n,o+=4):a.utf8Write(t,o+=4,n),r?(k(a,i,o+=n),Buffer.isBuffer(r)?y(r,a,0,i,o+=4):a.utf8Write(r,o+=4,i),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (changed password)")):this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (password)"),this._authsQueue.push("password"),S(this,this._packetRW.write.finalize(a))}authPK(e,t,r,s){if(this._server)throw new Error("Client-only method called in server mode");if((t=A(t))instanceof Error)throw new Error("Invalid key");const n=t.type;t=t.getPublicSSH(),"function"==typeof r&&(s=r,r=void 0),r||(r=n);const i=Buffer.byteLength(e),o=Buffer.byteLength(r),a=t.length,c=this._kex.sessionID,l=c.length,h=(s?4+l:0)+1+4+i+4+14+4+9+1+4+o+4+a;let d,p;if(s?(d=Buffer.allocUnsafe(h),p=0,k(d,l,p),d.set(c,p+=4),p+=l):(d=this._packetRW.write.alloc(h),p=this._packetRW.write.allocStart),d[p]=u.USERAUTH_REQUEST,k(d,i,++p),d.utf8Write(e,p+=4,i),k(d,14,p+=i),d.utf8Write("ssh-connection",p+=4,14),k(d,9,p+=14),d.utf8Write("publickey",p+=4,9),d[p+=9]=s?1:0,k(d,o,++p),d.utf8Write(r,p+=4,o),k(d,a,p+=o),d.set(t,p+=4),!s)return this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey -- check)"),void S(this,this._packetRW.write.finalize(d));s(d,(s=>{if(!1===(s=v(s,n)))throw new Error("Error while converting handshake signature");const c=s.length;p=this._packetRW.write.allocStart,d=this._packetRW.write.alloc(5+i+4+14+4+9+1+4+o+4+a+4+4+o+4+c),d[p]=u.USERAUTH_REQUEST,k(d,i,++p),d.utf8Write(e,p+=4,i),k(d,14,p+=i),d.utf8Write("ssh-connection",p+=4,14),k(d,9,p+=14),d.utf8Write("publickey",p+=4,9),d[p+=9]=1,k(d,o,++p),d.utf8Write(r,p+=4,o),k(d,a,p+=o),d.set(t,p+=4),k(d,4+o+4+c,p+=a),k(d,o,p+=4),d.utf8Write(r,p+=4,o),k(d,c,p+=o),d.set(s,p+=4),this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey)"),S(this,this._packetRW.write.finalize(d))}))}authHostbased(e,t,r,s,n,i){if(this._server)throw new Error("Client-only method called in server mode");if((t=A(t))instanceof Error)throw new Error("Invalid key");const o=t.type;t=t.getPublicSSH(),"function"==typeof n&&(i=n,n=void 0),n||(n=o);const a=Buffer.byteLength(e),c=Buffer.byteLength(n),l=t.length,h=this._kex.sessionID,d=h.length,p=Buffer.byteLength(r),f=Buffer.byteLength(s),g=Buffer.allocUnsafe(4+d+1+4+a+4+14+4+9+4+c+4+l+4+p+4+f);let m=0;k(g,d,m),g.set(h,m+=4),g[m+=d]=u.USERAUTH_REQUEST,k(g,a,++m),g.utf8Write(e,m+=4,a),k(g,14,m+=a),g.utf8Write("ssh-connection",m+=4,14),k(g,9,m+=14),g.utf8Write("hostbased",m+=4,9),k(g,c,m+=9),g.utf8Write(n,m+=4,c),k(g,l,m+=c),g.set(t,m+=4),k(g,p,m+=l),g.utf8Write(r,m+=4,p),k(g,f,m+=p),g.utf8Write(s,m+=4,f),i(g,(e=>{if(!(e=v(e,o)))throw new Error("Error while converting handshake signature");const t=e.length,r=g.length-d-4;m=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(r+4+4+c+4+t);y(g,s,4+d,g.length,m),k(s,4+c+4+t,m+=r),k(s,c,m+=4),s.utf8Write(n,m+=4,c),k(s,t,m+=c),s.set(e,m+=4),this._authsQueue.push("hostbased"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (hostbased)"),S(this,this._packetRW.write.finalize(s))}))}authKeyboard(e){if(this._server)throw new Error("Client-only method called in server mode");const t=Buffer.byteLength(e);let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(5+t+4+14+4+20+4+4);s[r]=u.USERAUTH_REQUEST,k(s,t,++r),s.utf8Write(e,r+=4,t),k(s,14,r+=t),s.utf8Write("ssh-connection",r+=4,14),k(s,20,r+=14),s.utf8Write("keyboard-interactive",r+=4,20),k(s,0,r+=20),k(s,0,r+=4),this._authsQueue.push("keyboard-interactive"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (keyboard-interactive)"),S(this,this._packetRW.write.finalize(s))}authNone(e){if(this._server)throw new Error("Client-only method called in server mode");const t=Buffer.byteLength(e);let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(5+t+4+14+4+4);s[r]=u.USERAUTH_REQUEST,k(s,t,++r),s.utf8Write(e,r+=4,t),k(s,14,r+=t),s.utf8Write("ssh-connection",r+=4,14),k(s,4,r+=14),s.utf8Write("none",r+=4,4),this._authsQueue.push("none"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (none)"),S(this,this._packetRW.write.finalize(s))}authInfoRes(e){if(this._server)throw new Error("Client-only method called in server mode");let t,r=0;if(e){t=new Array(e.length);for(let s=0;s<e.length;++s){const n=Buffer.byteLength(e[s]);t[s]=n,r+=4+n}}let s=this._packetRW.write.allocStart;const n=this._packetRW.write.alloc(5+r);if(n[s]=u.USERAUTH_INFO_RESPONSE,e){k(n,e.length,++s),s+=4;for(let r=0;r<e.length;++r){const i=t[r];k(n,i,s),s+=4,i&&(n.utf8Write(e[r],s,i),s+=i)}}else k(n,0,++s);this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_RESPONSE"),S(this,this._packetRW.write.finalize(n))}tcpipForward(e,t,r){if(this._server)throw new Error("Client-only method called in server mode");const s=Buffer.byteLength(e);let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(23+s+4);i[n]=u.GLOBAL_REQUEST,k(i,13,++n),i.utf8Write("tcpip-forward",n+=4,13),i[n+=13]=void 0===r||!0===r?1:0,k(i,s,++n),i.utf8Write(e,n+=4,s),k(i,t,n+=s),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (tcpip-forward)"),S(this,this._packetRW.write.finalize(i))}cancelTcpipForward(e,t,r){if(this._server)throw new Error("Client-only method called in server mode");const s=Buffer.byteLength(e);let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(30+s+4);i[n]=u.GLOBAL_REQUEST,k(i,20,++n),i.utf8Write("cancel-tcpip-forward",n+=4,20),i[n+=20]=void 0===r||!0===r?1:0,k(i,s,++n),i.utf8Write(e,n+=4,s),k(i,t,n+=s),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-tcpip-forward)"),S(this,this._packetRW.write.finalize(i))}openssh_streamLocalForward(e,t){if(this._server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=this._packetRW.write.allocStart;const n=this._packetRW.write.alloc(41+r);n[s]=u.GLOBAL_REQUEST,k(n,31,++s),n.utf8Write("streamlocal-forward@openssh.com",s+=4,31),n[s+=31]=void 0===t||!0===t?1:0,k(n,r,++s),n.utf8Write(e,s+=4,r),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),S(this,this._packetRW.write.finalize(n))}openssh_cancelStreamLocalForward(e,t){if(this._server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=this._packetRW.write.allocStart;const n=this._packetRW.write.alloc(48+r);n[s]=u.GLOBAL_REQUEST,k(n,38,++s),n.utf8Write("cancel-streamlocal-forward@openssh.com",s+=4,38),n[s+=38]=void 0===t||!0===t?1:0,k(n,r,++s),n.utf8Write(e,s+=4,r),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)"),S(this,this._packetRW.write.finalize(n))}directTcpip(e,t,r,s){if(this._server)throw new Error("Client-only method called in server mode");const n=Buffer.byteLength(s.srcIP),i=Buffer.byteLength(s.dstIP);let o=this._packetRW.write.allocStart;const a=this._packetRW.write.alloc(33+n+4+4+i+4);a[o]=u.CHANNEL_OPEN,k(a,12,++o),a.utf8Write("direct-tcpip",o+=4,12),k(a,e,o+=12),k(a,t,o+=4),k(a,r,o+=4),k(a,i,o+=4),a.utf8Write(s.dstIP,o+=4,i),k(a,s.dstPort,o+=i),k(a,n,o+=4),a.utf8Write(s.srcIP,o+=4,n),k(a,s.srcPort,o+=n),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, direct-tcpip)`),S(this,this._packetRW.write.finalize(a))}openssh_directStreamLocal(e,t,r,s){if(this._server)throw new Error("Client-only method called in server mode");const n=Buffer.byteLength(s.socketPath);let i=this._packetRW.write.allocStart;const o=this._packetRW.write.alloc(51+n+4+4);o[i]=u.CHANNEL_OPEN,k(o,30,++i),o.utf8Write("direct-streamlocal@openssh.com",i+=4,30),k(o,e,i+=30),k(o,t,i+=4),k(o,r,i+=4),k(o,n,i+=4),o.utf8Write(s.socketPath,i+=4,n),b(o,0,i+=n,i+8),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, direct-streamlocal@openssh.com)`),S(this,this._packetRW.write.finalize(o))}openssh_noMoreSessions(e){if(this._server)throw new Error("Client-only method called in server mode");let t=this._packetRW.write.allocStart;const r=this._packetRW.write.alloc(34);r[t]=u.GLOBAL_REQUEST,k(r,28,++t),r.utf8Write("no-more-sessions@openssh.com",t+=4,28),r[t+=28]=void 0===e||!0===e?1:0,this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (no-more-sessions@openssh.com)"),S(this,this._packetRW.write.finalize(r))}session(e,t,r){if(this._server)throw new Error("Client-only method called in server mode");let s=this._packetRW.write.allocStart;const n=this._packetRW.write.alloc(24);n[s]=u.CHANNEL_OPEN,k(n,7,++s),n.utf8Write("session",s+=4,7),k(n,e,s+=7),k(n,t,s+=4),k(n,r,s+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, session)`),S(this,this._packetRW.write.finalize(n))}windowChange(e,t,r,s,n){if(this._server)throw new Error("Client-only method called in server mode");let i=this._packetRW.write.allocStart;const o=this._packetRW.write.alloc(39);o[i]=u.CHANNEL_REQUEST,k(o,e,++i),k(o,13,i+=4),o.utf8Write("window-change",i+=4,13),o[i+=13]=0,k(o,r,++i),k(o,t,i+=4),k(o,n,i+=4),k(o,s,i+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, window-change)`),S(this,this._packetRW.write.finalize(o))}pty(e,t,r,s,n,i,o,a){if(this._server)throw new Error("Client-only method called in server mode");i&&i.length||(i="vt100"),!o||Buffer.isBuffer(o)||Array.isArray(o)||"object"!=typeof o||null===o||(o=function(e){const t=Object.keys(e),r=Buffer.allocUnsafe(5*t.length+1);let s=0;for(let n=0;n<t.length;++n){const i=t[n];if("TTY_OP_END"===i)continue;const o=d[i];if(void 0===o)continue;const a=e[i];"number"==typeof a&&isFinite(a)&&(r[s++]=o,r[s++]=a>>>24,r[s++]=a>>>16,r[s++]=a>>>8,r[s++]=a)}return r[s++]=d.TTY_OP_END,s<r.length?w(r,0,s):r}(o)),o&&o.length||(o=U);const c=i.length,l=o.length;let h=this._packetRW.write.allocStart;const p=this._packetRW.write.alloc(21+c+4+4+4+4+4+l);if(p[h]=u.CHANNEL_REQUEST,k(p,e,++h),k(p,7,h+=4),p.utf8Write("pty-req",h+=4,7),p[h+=7]=void 0===a||!0===a?1:0,k(p,c,++h),p.utf8Write(i,h+=4,c),k(p,r,h+=c),k(p,t,h+=4),k(p,n,h+=4),k(p,s,h+=4),k(p,l,h+=4),h+=4,Array.isArray(o))for(let e=0;e<l;++e)p[h++]=o[e];else Buffer.isBuffer(o)&&p.set(o,h);this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, pty-req)`),S(this,this._packetRW.write.finalize(p))}shell(e,t){if(this._server)throw new Error("Client-only method called in server mode");let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(15);s[r]=u.CHANNEL_REQUEST,k(s,e,++r),k(s,5,r+=4),s.utf8Write("shell",r+=4,5),s[r+=5]=void 0===t||!0===t?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, shell)`),S(this,this._packetRW.write.finalize(s))}exec(e,t,r){if(this._server)throw new Error("Client-only method called in server mode");const s=Buffer.isBuffer(t),n=s?t.length:Buffer.byteLength(t);let i=this._packetRW.write.allocStart;const o=this._packetRW.write.alloc(18+n);o[i]=u.CHANNEL_REQUEST,k(o,e,++i),k(o,4,i+=4),o.utf8Write("exec",i+=4,4),o[i+=4]=void 0===r||!0===r?1:0,k(o,n,++i),s?o.set(t,i+=4):o.utf8Write(t,i+=4,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exec: ${t})`),S(this,this._packetRW.write.finalize(o))}signal(e,t){if(this._server)throw new Error("Client-only method called in server mode");const r=t;if("SIG"===(t=t.toUpperCase()).slice(0,3)&&(t=t.slice(3)),1!==h[t])throw new Error(`Invalid signal: ${r}`);const s=t.length;let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(20+s);i[n]=u.CHANNEL_REQUEST,k(i,e,++n),k(i,6,n+=4),i.utf8Write("signal",n+=4,6),i[n+=6]=0,k(i,s,++n),i.utf8Write(t,n+=4,s),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, signal: ${t})`),S(this,this._packetRW.write.finalize(i))}env(e,t,r,s){if(this._server)throw new Error("Client-only method called in server mode");const n=Buffer.byteLength(t),i=Buffer.isBuffer(r),o=i?r.length:Buffer.byteLength(r);let a=this._packetRW.write.allocStart;const c=this._packetRW.write.alloc(17+n+4+o);c[a]=u.CHANNEL_REQUEST,k(c,e,++a),k(c,3,a+=4),c.utf8Write("env",a+=4,3),c[a+=3]=void 0===s||!0===s?1:0,k(c,n,++a),c.utf8Write(t,a+=4,n),k(c,o,a+=n),i?c.set(r,a+=4):c.utf8Write(r,a+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, env: ${t}=${r})`),S(this,this._packetRW.write.finalize(c))}x11Forward(e,t,r){if(this._server)throw new Error("Client-only method called in server mode");const s=t.protocol,n=t.cookie,i=Buffer.isBuffer(s),o=i?s.length:Buffer.byteLength(s),a=Buffer.isBuffer(n),c=a?n.length:Buffer.byteLength(n);let l=this._packetRW.write.allocStart;const h=this._packetRW.write.alloc(22+o+4+c+4);h[l]=u.CHANNEL_REQUEST,k(h,e,++l),k(h,7,l+=4),h.utf8Write("x11-req",l+=4,7),h[l+=7]=void 0===r||!0===r?1:0,h[++l]=t.single?1:0,k(h,o,++l),i?h.set(s,l+=4):h.utf8Write(s,l+=4,o),k(h,c,l+=o),a?h.set(n,l+=4):h.latin1Write(n,l+=4,c),k(h,t.screen||0,l+=c),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, x11-req)`),S(this,this._packetRW.write.finalize(h))}subsystem(e,t,r){if(this._server)throw new Error("Client-only method called in server mode");const s=Buffer.byteLength(t);let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(23+s);i[n]=u.CHANNEL_REQUEST,k(i,e,++n),k(i,9,n+=4),i.utf8Write("subsystem",n+=4,9),i[n+=9]=void 0===r||!0===r?1:0,k(i,s,++n),i.utf8Write(t,n+=4,s),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, subsystem: ${t})`),S(this,this._packetRW.write.finalize(i))}openssh_agentForward(e,t){if(this._server)throw new Error("Client-only method called in server mode");let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(36);s[r]=u.CHANNEL_REQUEST,k(s,e,++r),k(s,26,r+=4),s.utf8Write("auth-agent-req@openssh.com",r+=4,26),s[r+=26]=void 0===t||!0===t?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, auth-agent-req@openssh.com)`),S(this,this._packetRW.write.finalize(s))}openssh_hostKeysProve(e){if(this._server)throw new Error("Client-only method called in server mode");let t=0;const r=[];for(const s of e){const e=s.getPublicSSH();t+=4+e.length,r.push(e)}let s=this._packetRW.write.allocStart;const n=this._packetRW.write.alloc(35+t);n[s]=u.GLOBAL_REQUEST,k(n,29,++s),n.utf8Write("hostkeys-prove-00@openssh.com",s+=4,29),n[s+=29]=1,++s;for(const e of r)k(n,e.length,s),y(e,n,0,e.length,s+=4),s+=e.length;this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (hostkeys-prove-00@openssh.com)"),S(this,this._packetRW.write.finalize(n))}serviceAccept(e){if(!this._server)throw new Error("Server-only method called in client mode");const t=Buffer.byteLength(e);let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(5+t);if(s[r]=u.SERVICE_ACCEPT,k(s,t,++r),s.utf8Write(e,r+=4,t),this._debug&&this._debug(`Outbound: Sending SERVICE_ACCEPT (${e})`),S(this,this._packetRW.write.finalize(s)),this._server&&this._banner&&"ssh-userauth"===e){const e=this._banner;this._banner=void 0;const t=Buffer.byteLength(e);r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(5+t+4);s[r]=u.USERAUTH_BANNER,k(s,t,++r),s.utf8Write(e,r+=4,t),k(s,0,r+=t),this._debug&&this._debug("Outbound: Sending USERAUTH_BANNER"),S(this,this._packetRW.write.finalize(s))}}forwardedTcpip(e,t,r,s){if(!this._server)throw new Error("Server-only method called in client mode");const n=Buffer.byteLength(s.boundAddr),i=Buffer.byteLength(s.remoteAddr);let o=this._packetRW.write.allocStart;const a=this._packetRW.write.alloc(36+n+4+4+i+4);a[o]=u.CHANNEL_OPEN,k(a,15,++o),a.utf8Write("forwarded-tcpip",o+=4,15),k(a,e,o+=15),k(a,t,o+=4),k(a,r,o+=4),k(a,n,o+=4),a.utf8Write(s.boundAddr,o+=4,n),k(a,s.boundPort,o+=n),k(a,i,o+=4),a.utf8Write(s.remoteAddr,o+=4,i),k(a,s.remotePort,o+=i),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, forwarded-tcpip)`),S(this,this._packetRW.write.finalize(a))}x11(e,t,r,s){if(!this._server)throw new Error("Server-only method called in client mode");const n=Buffer.byteLength(s.originAddr);let i=this._packetRW.write.allocStart;const o=this._packetRW.write.alloc(24+n+4);o[i]=u.CHANNEL_OPEN,k(o,3,++i),o.utf8Write("x11",i+=4,3),k(o,e,i+=3),k(o,t,i+=4),k(o,r,i+=4),k(o,n,i+=4),o.utf8Write(s.originAddr,i+=4,n),k(o,s.originPort,i+=n),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, x11)`),S(this,this._packetRW.write.finalize(o))}openssh_authAgent(e,t,r){if(!this._server)throw new Error("Server-only method called in client mode");let s=this._packetRW.write.allocStart;const n=this._packetRW.write.alloc(39);n[s]=u.CHANNEL_OPEN,k(n,22,++s),n.utf8Write("auth-agent@openssh.com",s+=4,22),k(n,e,s+=22),k(n,t,s+=4),k(n,r,s+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, auth-agent@openssh.com)`),S(this,this._packetRW.write.finalize(n))}openssh_forwardedStreamLocal(e,t,r,s){if(!this._server)throw new Error("Server-only method called in client mode");const n=Buffer.byteLength(s.socketPath);let i=this._packetRW.write.allocStart;const o=this._packetRW.write.alloc(54+n+4);o[i]=u.CHANNEL_OPEN,k(o,33,++i),o.utf8Write("forwarded-streamlocal@openssh.com",i+=4,33),k(o,e,i+=33),k(o,t,i+=4),k(o,r,i+=4),k(o,n,i+=4),o.utf8Write(s.socketPath,i+=4,n),k(o,0,i+=n),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, forwarded-streamlocal@openssh.com)`),S(this,this._packetRW.write.finalize(o))}exitStatus(e,t){if(!this._server)throw new Error("Server-only method called in client mode");let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(25);s[r]=u.CHANNEL_REQUEST,k(s,e,++r),k(s,11,r+=4),s.utf8Write("exit-status",r+=4,11),s[r+=11]=0,k(s,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exit-status: ${t})`),S(this,this._packetRW.write.finalize(s))}exitSignal(e,t,r,s){if(!this._server)throw new Error("Server-only method called in client mode");const n=t;if("string"!=typeof n||!n)throw new Error(`Invalid signal: ${n}`);let i=t.toUpperCase();if("SIG"===i.slice(0,3)&&(i=i.slice(3)),1!==h[i])throw new Error(`Invalid signal: ${n}`);const o=Buffer.byteLength(i),a=s?Buffer.byteLength(s):0;let c=this._packetRW.write.allocStart;const l=this._packetRW.write.alloc(25+o+1+4+a+4);l[c]=u.CHANNEL_REQUEST,k(l,e,++c),k(l,11,c+=4),l.utf8Write("exit-signal",c+=4,11),l[c+=11]=0,k(l,o,++c),l.utf8Write(i,c+=4,o),l[c+=o]=r?1:0,k(l,a,++c),c+=4,a&&(l.utf8Write(s,c,a),c+=a),k(l,0,c),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exit-signal: ${t})`),S(this,this._packetRW.write.finalize(l))}authFailure(e,t){if(!this._server)throw new Error("Server-only method called in client mode");if(0===this._authsQueue.length)throw new Error("No auth in progress");let r;if("boolean"==typeof e&&(t=e,e=void 0),e){r=[];for(let t=0;t<e.length;++t)"none"!==e[t].toLowerCase()&&r.push(e[t]);r=r.join(",")}else r="";const s=r.length;let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(5+s+1);i[n]=u.USERAUTH_FAILURE,k(i,s,++n),i.utf8Write(r,n+=4,s),i[n+=s]=!0===t?1:0,this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_FAILURE"),S(this,this._packetRW.write.finalize(i))}authSuccess(){if(!this._server)throw new Error("Server-only method called in client mode");if(0===this._authsQueue.length)throw new Error("No auth in progress");const e=this._packetRW.write.allocStart,t=this._packetRW.write.alloc(1);t[e]=u.USERAUTH_SUCCESS,this._authsQueue.shift(),this._authenticated=!0,this._debug&&this._debug("Outbound: Sending USERAUTH_SUCCESS"),S(this,this._packetRW.write.finalize(t)),"zlib@openssh.com"===this._kex.negotiated.cs.compress&&(this._packetRW.read=new C),"zlib@openssh.com"===this._kex.negotiated.sc.compress&&(this._packetRW.write=new O(this))}authPKOK(e,t){if(!this._server)throw new Error("Server-only method called in client mode");if(0===this._authsQueue.length||"publickey"!==this._authsQueue[0])throw new Error('"publickey" auth not in progress');const r=Buffer.byteLength(e),s=t.length;let n=this._packetRW.write.allocStart;const i=this._packetRW.write.alloc(5+r+4+s);i[n]=u.USERAUTH_PK_OK,k(i,r,++n),i.utf8Write(e,n+=4,r),k(i,s,n+=r),i.set(t,n+=4),this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_PK_OK"),S(this,this._packetRW.write.finalize(i))}authPasswdChg(e){if(!this._server)throw new Error("Server-only method called in client mode");const t=Buffer.byteLength(e);let r=this._packetRW.write.allocStart;const s=this._packetRW.write.alloc(5+t+4);s[r]=u.USERAUTH_PASSWD_CHANGEREQ,k(s,t,++r),s.utf8Write(e,r+=4,t),k(s,0,r+=t),this._debug&&this._debug("Outbound: Sending USERAUTH_PASSWD_CHANGEREQ"),S(this,this._packetRW.write.finalize(s))}authInfoReq(e,t,r){if(!this._server)throw new Error("Server-only method called in client mode");let s=0;const n=e?Buffer.byteLength(e):0,i=t?Buffer.byteLength(t):0;for(let e=0;e<r.length;++e)s+=4+Buffer.byteLength(r[e].prompt)+1;let o=this._packetRW.write.allocStart;const a=this._packetRW.write.alloc(5+n+4+i+4+4+s);a[o]=u.USERAUTH_INFO_REQUEST,k(a,n,++o),o+=4,e&&(a.utf8Write(e,o,n),o+=n),k(a,i,o),o+=4,t&&(a.utf8Write(t,o,i),o+=i),k(a,0,o),k(a,r.length,o+=4),o+=4;for(let e=0;e<r.length;++e){const t=r[e],s=Buffer.byteLength(t.prompt);k(a,s,o),o+=4,s&&(a.utf8Write(t.prompt,o,s),o+=s),a[o++]=t.echo?1:0}this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_REQUEST"),S(this,this._packetRW.write.finalize(a))}}},4061:(e,t,r)=>{"use strict";const s=r(2361),n=r(7147),{constants:i}=n,{Readable:o,Writable:a}=r(2781),{inherits:c,isDate:l}=r(3837),u=Buffer[Symbol.species],{bufferCopy:h,bufferSlice:d,makeBufferParser:p,writeUInt32BE:f}=r(9205),g=Buffer.alloc(28),m={OK:0,EOF:1,NO_SUCH_FILE:2,PERMISSION_DENIED:3,FAILURE:4,BAD_MESSAGE:5,NO_CONNECTION:6,CONNECTION_LOST:7,OP_UNSUPPORTED:8},_=new Map(Object.values(m).map((e=>[e,1]))),A={[m.OK]:"No error",[m.EOF]:"End of file",[m.NO_SUCH_FILE]:"No such file or directory",[m.PERMISSION_DENIED]:"Permission denied",[m.FAILURE]:"Failure",[m.BAD_MESSAGE]:"Bad message",[m.NO_CONNECTION]:"No connection",[m.CONNECTION_LOST]:"Connection lost",[m.OP_UNSUPPORTED]:"Operation unsupported"},E=200,y={READ:1,WRITE:2,APPEND:4,CREAT:8,TRUNC:16,EXCL:32},b=2**32-1,w=Buffer.from([0,0,0,5,1,0,0,0,3]),v=Buffer.from([0,0,0,5,2,0,0,0,3]),S=/^SSH-2.0-(?:OpenSSH|dropbear)/,k=262144,I=p(),T={readable:!1,writable:!1,push:e=>{},once:()=>{},on:()=>{},emit:()=>{},end:()=>{}};function C(){}function O(e,t,r,s,n,i,o,a){const c=e._maxReadLen,l=Math.max(n-c,0);l&&(n=c);const u=t.length;let h=9,p=i;const g=Buffer.allocUnsafe(13+u+8+4);f(g,g.length-4,0),g[4]=5;const _=e._writeReqid=e._writeReqid+1&b;f(g,_,5),f(g,u,h),g.set(t,h+=4),h+=u;for(let e=7;e>=0;--e)g[h+e]=255&p,p/=256;f(g,n,h+=8),"function"!=typeof o&&(o=C);const A=a||{nb:0,position:i,off:s,origOff:s,len:void 0,overflow:void 0,cb:(s,n,i)=>{const a=A.len,c=A.overflow;if(s){if(o._wantEOFError||s.code!==m.EOF)return o(s)}else{if(i>a)return o(new Error("Received more data than requested"));if(i===a&&c)return A.nb+=i,A.position+=i,A.off+=i,void O(e,t,r,A.off,c,A.position,o,A)}i=i||0,n=0===A.origOff&&r.length===A.nb?r:d(r,A.origOff,A.origOff+A.nb+i),o(void 0,A.nb+i,n,A.position)},buffer:void 0};A.len=n,A.overflow=l,A.buffer=d(r,s,s+n),e._requests[_]=A;const E=M(e,g);e._debug&&e._debug(`SFTP: Outbound: ${E?"Buffered":"Sending"} READ`)}function R(e,t,r,s,i,o){let a,c,l,u,h=64,d=32768;"function"==typeof i?o=i:"object"==typeof i&&null!==i&&("number"==typeof i.concurrency&&i.concurrency>0&&!isNaN(i.concurrency)&&(h=i.concurrency),"number"==typeof i.chunkSize&&i.chunkSize>0&&!isNaN(i.chunkSize)&&(d=i.chunkSize),"number"==typeof i.fileSize&&i.fileSize>0&&!isNaN(i.fileSize)&&(l=i.fileSize),"function"==typeof i.step&&(a=i.step),"string"!=typeof i.mode&&"number"!=typeof i.mode||(c=U(i.mode)));let p,f,g,m=0,_=0,A=!1,E=d*h;function y(r){if(A)return;A=!0;let s,i=0;p||f?(s=()=>{0==--i&&o(r)},!p||e!==n&&"open"!==e.outgoing.state||++i,!f||t!==n&&"open"!==t.outgoing.state||++i,!p||e!==n&&"open"!==e.outgoing.state||e.close(p,s),!f||t!==n&&"open"!==t.outgoing.state||t.close(f,s)):o(r)}e.open(r,"r",((i,A)=>{if(i)return y(i);function b(i,l){if(i)return e!==n?void e.stat(r,((e,t)=>{if(e)return y(i);b(null,t)})):y(i);u=l.size,t.open(s,"w",((r,n)=>{if(r)return y(r);if(f=n,u<=0)return y();for(;E>u;){if(1===h){E=u;break}E-=d,--h}if(g=function(e){try{return Buffer.allocUnsafe(e)}catch(e){return e}}(E),g instanceof Error)return y(g);function i(r,s,n,i,c,h){if(r)return y(r);c=c||0,t.write(f,g,c,s,i,(function(r){if(r)return y(r);if(_+=s,a&&a(_,s,u),s<h)return l(c,i+s,h-s);if(_===u)return void t.close(f,(t=>{if(f=void 0,t)return y(t);e.close(p,(e=>{if(p=void 0,e)return y(e);o()}))}));if(m>=u)return;const n=m+d>u?u-m:d;l(c,m,n),m+=n}))}function l(t,r,s){e.read(p,g,t,s,r,function(e,t,r){return(s,n,o)=>{i(s,n,0,t,e,r)}}(t,r,s))}function A(){let e=0,t=0;for(;m<u&&e<h;){const r=m+d>u?u-m:d;l(t,m,r),t+=r,m+=r,++e}}void 0!==c?t.fchmod(f,c,(function e(r){r?t.chmod(s,c,(t=>e())):A()})):A()}))}p=A,void 0===l?e.fstat(p,b):b(null,{size:l})}))}function B(e,t,r,s,n,i,o){const a="function"==typeof o?o:void 0;e.write(t,r,s,n,i,((o,c)=>{if(o)return e.close(t,(()=>{a&&a(o)}));c===n?e.close(t,a):B(e,t,r,s+=c,n-=c,i+=c,a)}))}class P{constructor(e){this.mode=e&&e.mode,this.uid=e&&e.uid,this.gid=e&&e.gid,this.size=e&&e.size,this.atime=e&&e.atime,this.mtime=e&&e.mtime,this.extended=e&&e.extended}isDirectory(){return(this.mode&i.S_IFMT)===i.S_IFDIR}isFile(){return(this.mode&i.S_IFMT)===i.S_IFREG}isBlockDevice(){return(this.mode&i.S_IFMT)===i.S_IFBLK}isCharacterDevice(){return(this.mode&i.S_IFMT)===i.S_IFCHR}isSymbolicLink(){return(this.mode&i.S_IFMT)===i.S_IFLNK}isFIFO(){return(this.mode&i.S_IFMT)===i.S_IFIFO}isSocket(){return(this.mode&i.S_IFMT)===i.S_IFSOCK}}function N(e){let t=0,r=0;if("object"==typeof e&&null!==e){if("number"==typeof e.size){t|=1;const s=e.size;g[r++]=s/72057594037927940,g[r++]=s/281474976710656,g[r++]=s/1099511627776,g[r++]=s/4294967296,g[r++]=s/16777216,g[r++]=s/65536,g[r++]=s/256,g[r++]=s}if("number"==typeof e.uid&&"number"==typeof e.gid){t|=2;const s=e.uid,n=e.gid;g[r++]=s>>>24,g[r++]=s>>>16,g[r++]=s>>>8,g[r++]=s,g[r++]=n>>>24,g[r++]=n>>>16,g[r++]=n>>>8,g[r++]=n}if("number"==typeof e.mode||"string"==typeof e.mode){const s=U(e.mode);t|=4,g[r++]=s>>>24,g[r++]=s>>>16,g[r++]=s>>>8,g[r++]=s}if(("number"==typeof e.atime||l(e.atime))&&("number"==typeof e.mtime||l(e.mtime))){const s=L(e.atime),n=L(e.mtime);t|=8,g[r++]=s>>>24,g[r++]=s>>>16,g[r++]=s>>>8,g[r++]=s,g[r++]=n>>>24,g[r++]=n>>>16,g[r++]=n>>>8,g[r++]=n}}return{flags:t,nb:r}}function L(e){if("number"==typeof e&&e==e)return e;if(l(e))return parseInt(e.getTime()/1e3,10);throw new Error(`Cannot parse time: ${e}`)}function U(e){if("number"==typeof e&&e==e)return e;if("string"==typeof e)return U(parseInt(e,8));throw new Error(`Cannot parse mode: ${e}`)}const D={r:y.READ,"r+":y.READ|y.WRITE,w:y.TRUNC|y.CREAT|y.WRITE,wx:y.TRUNC|y.CREAT|y.WRITE|y.EXCL,xw:y.TRUNC|y.CREAT|y.WRITE|y.EXCL,"w+":y.TRUNC|y.CREAT|y.READ|y.WRITE,"wx+":y.TRUNC|y.CREAT|y.READ|y.WRITE|y.EXCL,"xw+":y.TRUNC|y.CREAT|y.READ|y.WRITE|y.EXCL,a:y.APPEND|y.CREAT|y.WRITE,ax:y.APPEND|y.CREAT|y.WRITE|y.EXCL,xa:y.APPEND|y.CREAT|y.WRITE|y.EXCL,"a+":y.APPEND|y.CREAT|y.READ|y.WRITE,"ax+":y.APPEND|y.CREAT|y.READ|y.WRITE|y.EXCL,"xa+":y.APPEND|y.CREAT|y.READ|y.WRITE|y.EXCL};function F(e){const t=D[e];return void 0!==t?t:null}const x=(()=>{const e=Object.keys(D);return t=>{for(let r=0;r<e.length;++r){const s=e[r];if(D[s]===t)return s}return null}})();function G(e){const t=I.readUInt32BE();if(void 0===t)return;const r=new P;if(1&t){const t=I.readUInt64BE(e);if(void 0===t)return;r.size=t}if(2&t){const e=I.readUInt32BE(),t=I.readUInt32BE();if(void 0===t)return;r.uid=e,r.gid=t}if(4&t){const e=I.readUInt32BE();if(void 0===e)return;r.mode=e}if(8&t){const e=I.readUInt32BE(),t=I.readUInt32BE();if(void 0===t)return;r.atime=e,r.mtime=t}if(2147483648&t){const e=I.readUInt32BE();if(void 0===e)return;const t={};for(let r=0;r<e;++r){const e=I.readString(!0),r=I.readString();if(void 0===r)return;t[e]=r}r.extended=t}return r}function M(e,t){const r=H(e,t);return void 0===r||(e._buffer.push(r),!1)}function H(e,t){const r=e.outgoing;if("open"!==r.state)return;if(0===r.window)return e._waitWindow=!0,e._chunkcb=Q,t;let s;const n=t.length;let i=0;for(;n-i>0&&r.window>0;){const s=Math.min(n-i,r.window,r.packetSize);r.window-=s,0===r.window&&(e._waitWindow=!0,e._chunkcb=Q),0===i&&s===n?e._protocol.channelData(e.outgoing.id,t):e._protocol.channelData(e.outgoing.id,d(t,i,i+s)),i+=s}return n-i>0&&(s=i>0?d(t,i,n):t),s}function Q(){this._chunkcb=void 0;const e=this._buffer;let t=0;for(;t<e.length;){const r=e[t],s=H(this,r);if(void 0!==s)return s!==r&&(e[t]=s),void(t>0&&(this._buffer=e.slice(t)));++t}t>0&&(this._buffer=[])}function q(e,t,r){const s=new Error(t);return s.level="sftp-protocol",!r&&e._debug&&e._debug(`SFTP: Inbound: ${t}`),e.emit("error",s),e.destroy(),$(e),!1}function $(e){const t=Object.keys(e._requests);if(0===t.length)return;const r=e._requests;e._requests={};const s=new Error("No response from server");for(let e=0;e<t.length;++e){const n=r[t[e]];"function"==typeof n.cb&&n.cb(s)}}const j={2:(e,t)=>{if(-1!==e._version)return q(e,"Duplicate VERSION packet");const r={};I.init(t,1);let s=I.readUInt32BE();for(;I.avail();){const e=I.readString(!0),t=I.readString(!0);if(void 0===t){s=void 0;break}r[e]=t}if(I.clear(),void 0===s)return q(e,"Malformed VERSION packet");if(e._debug){const t=Object.keys(r);t.length?e._debug(`SFTP: Inbound: Received VERSION (v${s}, exts:${t})`):e._debug(`SFTP: Inbound: Received VERSION (v${s})`)}if(e._version=s,e._extensions=r,"1"===r["limits@openssh.com"])return function(e,t){let r=9;const s=Buffer.allocUnsafe(31);f(s,s.length-4,0),s[4]=E;const n=e._writeReqid=e._writeReqid+1&b;f(s,n,5),f(s,18,r),s.utf8Write("limits@openssh.com",r+=4,18),e._requests[n]={extended:"limits@openssh.com",cb:t};const i=M(e,s);if(e._debug){const t=i?"Buffered":"Sending";e._debug(`SFTP: Outbound: ${t} limits@openssh.com`)}}(e,((t,r)=>{t||(r.maxPktLen>0&&(e._maxOutPktLen=r.maxPktLen),r.maxReadLen>0&&(e._maxReadLen=r.maxReadLen),r.maxWriteLen>0&&(e._maxWriteLen=r.maxWriteLen),e.maxOpenHandles=r.maxOpenHandles>0?r.maxOpenHandles:1/0),e.emit("ready")}));e.emit("ready")},101:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readUInt32BE(),n=I.readString(!0);if(I.clear(),e._debug){const t=JSON.stringify(n);e._debug(`SFTP: Inbound: Received STATUS (id:${r}, ${s}, ${t})`)}const i=e._requests[r];if(delete e._requests[r],i&&"function"==typeof i.cb){if(s===m.OK)return void i.cb();const e=new Error(n||A[s]||"Unknown status");e.code=s,i.cb(e)}},102:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString();if(I.clear(),void 0===s)return void 0!==r&&delete e._requests[r],q(e,"Malformed HANDLE packet");e._debug&&e._debug(`SFTP: Inbound: Received HANDLE (id:${r})`);const n=e._requests[r];delete e._requests[r],n&&"function"==typeof n.cb&&n.cb(void 0,s)},103:(e,t)=>{I.init(t,1);const r=I.readUInt32BE();let s;if(void 0!==r&&(s=e._requests[r],delete e._requests[r]),s&&"function"==typeof s.cb)if(s.buffer){const t=I.readString(s.buffer);if(I.clear(),void 0!==t)return e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${t})`),void s.cb(void 0,s.buffer,t)}else{const t=I.readString();if(I.clear(),void 0!==t)return e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${t.length})`),void s.cb(void 0,t)}else{const t=I.skipString();if(I.clear(),void 0!==t)return void(e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${t})`))}return q(e,"Malformed DATA packet")},104:(e,t)=>{I.init(t,1);const r=I.readUInt32BE();let s;void 0!==r&&(s=e._requests[r],delete e._requests[r]);const n=I.readUInt32BE();if(void 0!==n){let t=[];for(let r=0;r<n;++r){const r=I.readString(!0),s=I.readString(!0),n=G(e._biOpt);if(void 0===n){t=void 0;break}t.push({filename:r,longname:s,attrs:n})}if(void 0!==t)return e._debug&&e._debug(`SFTP: Inbound: Received NAME (id:${r}, ${t.length})`),I.clear(),void(s&&"function"==typeof s.cb&&s.cb(void 0,t))}return I.clear(),q(e,"Malformed NAME packet")},105:(e,t)=>{I.init(t,1);const r=I.readUInt32BE();let s;void 0!==r&&(s=e._requests[r],delete e._requests[r]);const n=G(e._biOpt);return I.clear(),void 0!==n?(e._debug&&e._debug(`SFTP: Inbound: Received ATTRS (id:${r})`),void(s&&"function"==typeof s.cb&&s.cb(void 0,n))):q(e,"Malformed ATTRS packet")},201:(e,t)=>{I.init(t,1);const r=I.readUInt32BE();if(void 0!==r){const t=e._requests[r];if(!t)return e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),void I.clear();switch(delete e._requests[r],t.extended){case"statvfs@openssh.com":case"fstatvfs@openssh.com":{const s=e._biOpt,n={f_bsize:I.readUInt64BE(s),f_frsize:I.readUInt64BE(s),f_blocks:I.readUInt64BE(s),f_bfree:I.readUInt64BE(s),f_bavail:I.readUInt64BE(s),f_files:I.readUInt64BE(s),f_ffree:I.readUInt64BE(s),f_favail:I.readUInt64BE(s),f_sid:I.readUInt64BE(s),f_flag:I.readUInt64BE(s),f_namemax:I.readUInt64BE(s)};if(void 0===n.f_namemax)break;return e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${t.extended})`),I.clear(),void("function"==typeof t.cb&&t.cb(void 0,n))}case"limits@openssh.com":{const s={maxPktLen:I.readUInt64BE(),maxReadLen:I.readUInt64BE(),maxWriteLen:I.readUInt64BE(),maxOpenHandles:I.readUInt64BE()};if(void 0===s.maxOpenHandles)break;return e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${t.extended})`),I.clear(),void("function"==typeof t.cb&&t.cb(void 0,s))}case"users-groups-by-id@openssh.com":{const s=I.readUInt32BE();if(void 0===s)break;const n=new Array(s);for(let e=0;e<n.length;++e)n[e]=I.readString(!0);const i=I.readUInt32BE();if(void 0===i)break;const o=new Array(i);for(let e=0;e<o.length;++e)o[e]=I.readString(!0);if(o.length>0&&void 0===o[o.length-1])break;return e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${t.extended})`),I.clear(),void("function"==typeof t.cb&&t.cb(void 0,n,o))}default:return e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),I.clear(),void("function"==typeof t.cb&&t.cb())}}return I.clear(),q(e,"Malformed EXTENDED_REPLY packet")}},K={1:(e,t)=>{if(-1!==e._version)return q(e,"Duplicate INIT packet");const r={};I.init(t,1);let s=I.readUInt32BE();for(;I.avail();){const e=I.readString(!0),t=I.readString(!0);if(void 0===t){s=void 0;break}r[e]=t}if(I.clear(),void 0===s)return q(e,"Malformed INIT packet");if(e._debug){const t=Object.keys(r);t.length?e._debug(`SFTP: Inbound: Received INIT (v${s}, exts:${t})`):e._debug(`SFTP: Inbound: Received INIT (v${s})`)}M(e,v),e._version=s,e._extensions=r,e.emit("ready")},3:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0),n=I.readUInt32BE(),i=G(e._biOpt);if(I.clear(),void 0===i)return q(e,"Malformed OPEN packet");e._debug&&e._debug(`SFTP: Inbound: Received OPEN (id:${r})`),e.emit("OPEN",r,s,n,i)||e.status(r,m.OP_UNSUPPORTED)},4:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString();if(I.clear(),void 0===s||s.length>256)return q(e,"Malformed CLOSE packet");e._debug&&e._debug(`SFTP: Inbound: Received CLOSE (id:${r})`),e.emit("CLOSE",r,s)||e.status(r,m.OP_UNSUPPORTED)},5:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(),n=I.readUInt64BE(e._biOpt),i=I.readUInt32BE();if(I.clear(),void 0===i||s.length>256)return q(e,"Malformed READ packet");e._debug&&e._debug(`SFTP: Inbound: Received READ (id:${r})`),e.emit("READ",r,s,n,i)||e.status(r,m.OP_UNSUPPORTED)},6:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(),n=I.readUInt64BE(e._biOpt),i=I.readString();if(I.clear(),void 0===i||s.length>256)return q(e,"Malformed WRITE packet");e._debug&&e._debug(`SFTP: Inbound: Received WRITE (id:${r})`),e.emit("WRITE",r,s,n,i)||e.status(r,m.OP_UNSUPPORTED)},7:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0);if(I.clear(),void 0===s)return q(e,"Malformed LSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received LSTAT (id:${r})`),e.emit("LSTAT",r,s)||e.status(r,m.OP_UNSUPPORTED)},8:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString();if(I.clear(),void 0===s||s.length>256)return q(e,"Malformed FSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received FSTAT (id:${r})`),e.emit("FSTAT",r,s)||e.status(r,m.OP_UNSUPPORTED)},9:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0),n=G(e._biOpt);if(I.clear(),void 0===n)return q(e,"Malformed SETSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received SETSTAT (id:${r})`),e.emit("SETSTAT",r,s,n)||e.status(r,m.OP_UNSUPPORTED)},10:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(),n=G(e._biOpt);if(I.clear(),void 0===n||s.length>256)return q(e,"Malformed FSETSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received FSETSTAT (id:${r})`),e.emit("FSETSTAT",r,s,n)||e.status(r,m.OP_UNSUPPORTED)},11:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0);if(I.clear(),void 0===s)return q(e,"Malformed OPENDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received OPENDIR (id:${r})`),e.emit("OPENDIR",r,s)||e.status(r,m.OP_UNSUPPORTED)},12:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString();if(I.clear(),void 0===s||s.length>256)return q(e,"Malformed READDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received READDIR (id:${r})`),e.emit("READDIR",r,s)||e.status(r,m.OP_UNSUPPORTED)},13:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0);if(I.clear(),void 0===s)return q(e,"Malformed REMOVE packet");e._debug&&e._debug(`SFTP: Inbound: Received REMOVE (id:${r})`),e.emit("REMOVE",r,s)||e.status(r,m.OP_UNSUPPORTED)},14:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0),n=G(e._biOpt);if(I.clear(),void 0===n)return q(e,"Malformed MKDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received MKDIR (id:${r})`),e.emit("MKDIR",r,s,n)||e.status(r,m.OP_UNSUPPORTED)},15:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0);if(I.clear(),void 0===s)return q(e,"Malformed RMDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received RMDIR (id:${r})`),e.emit("RMDIR",r,s)||e.status(r,m.OP_UNSUPPORTED)},16:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0);if(I.clear(),void 0===s)return q(e,"Malformed REALPATH packet");e._debug&&e._debug(`SFTP: Inbound: Received REALPATH (id:${r})`),e.emit("REALPATH",r,s)||e.status(r,m.OP_UNSUPPORTED)},17:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0);if(I.clear(),void 0===s)return q(e,"Malformed STAT packet");e._debug&&e._debug(`SFTP: Inbound: Received STAT (id:${r})`),e.emit("STAT",r,s)||e.status(r,m.OP_UNSUPPORTED)},18:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0),n=I.readString(!0);if(I.clear(),void 0===n)return q(e,"Malformed RENAME packet");e._debug&&e._debug(`SFTP: Inbound: Received RENAME (id:${r})`),e.emit("RENAME",r,s,n)||e.status(r,m.OP_UNSUPPORTED)},19:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0);if(I.clear(),void 0===s)return q(e,"Malformed READLINK packet");e._debug&&e._debug(`SFTP: Inbound: Received READLINK (id:${r})`),e.emit("READLINK",r,s)||e.status(r,m.OP_UNSUPPORTED)},20:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0),n=I.readString(!0);if(I.clear(),void 0===n)return q(e,"Malformed SYMLINK packet");let i;e._debug&&e._debug(`SFTP: Inbound: Received SYMLINK (id:${r})`),i=e._isOpenSSH?e.emit("SYMLINK",r,n,s):e.emit("SYMLINK",r,s,n),i||e.status(r,m.OP_UNSUPPORTED)},[E]:(e,t)=>{I.init(t,1);const r=I.readUInt32BE(),s=I.readString(!0);if(void 0===s)return I.clear(),q(e,"Malformed EXTENDED packet");let n;I.avail()&&(n=I.readRaw()),I.clear(),e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED (id:${r})`),e.emit("EXTENDED",r,s,n)||e.status(r,m.OP_UNSUPPORTED)}},{ERR_INVALID_ARG_TYPE:W,ERR_OUT_OF_RANGE:Y,validateNumber:z}=r(5607);let V;const X=[];function J(e,t){if(!Number.isSafeInteger(e)){if(z(e,t),!Number.isInteger(e))throw new Y(t,"an integer",e);throw new Y(t,">= 0 and <= 2 ** 53 - 1",e)}if(e<0)throw new Y(t,">= 0 and <= 2 ** 53 - 1",e)}function Z(e){return e+7&-8}function ee(e,t,r){if(void 0===r)r={};else if("string"==typeof r)r={encoding:r};else{if(null===r||"object"!=typeof r)throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}if(void 0===r.highWaterMark&&(r.highWaterMark=65536),r.emitClose=!1,r.autoDestroy=!1,o.call(this,r),this.path=t,this.flags=void 0===r.flags?"r":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=0,this.bytesRead=0,this.isClosed=!1,this.handle=void 0===r.handle?null:r.handle,this.sftp=e,this._opening=!1,void 0!==this.start&&(J(this.start,"start"),this.pos=this.start),void 0===this.end)this.end=1/0;else if(this.end!==1/0&&(J(this.end,"end"),void 0!==this.start&&this.start>this.end))throw new Y("start",`<= "end" (here: ${this.end})`,this.start);this.on("end",(function(){this.autoClose&&this.destroy()})),Buffer.isBuffer(this.handle)||this.open()}function te(e,t,r){if(!e.handle)return s();function s(s){t(s=s||r),e.isClosed=!0,s||e.emit("close")}e.sftp.close(e.handle,s)}function re(e,t,r){if(void 0===r)r={};else if("string"==typeof r)r={encoding:r};else{if(null===r||"object"!=typeof r)throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}r.emitClose=!1,r.autoDestroy=!1,a.call(this,r),this.path=t,this.flags=void 0===r.flags?"w":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=0,this.bytesWritten=0,this.isClosed=!1,this.handle=void 0===r.handle?null:r.handle,this.sftp=e,this._opening=!1,void 0!==this.start&&(J(this.start,"start"),this.pos=this.start),r.encoding&&this.setDefaultEncoding(r.encoding),this.on("finish",(function(){this._writableState.finalCalled||this.autoClose&&this.destroy()})),Buffer.isBuffer(this.handle)||this.open()}c(ee,o),ee.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,((e,t)=>{if(this._opening=!1,e)return this.emit("error",e),void(this.autoClose&&this.destroy());this.handle=t,this.emit("open",t),this.emit("ready"),this.read()})))},ee.prototype._read=function(e){if(!Buffer.isBuffer(this.handle))return this.once("open",(()=>this._read(e)));if(this.destroyed)return;var t;(!V||V.length-V.used<128)&&(t=this.readableHighWaterMark||this._readableState.highWaterMark,V=X.length>0?X.pop():Buffer.allocUnsafe(t),V.used=0);const r=V;let s=Math.min(V.length-V.used,e);const n=V.used;if(void 0!==this.end&&(s=Math.min(this.end-this.pos+1,s)),s<=0)return this.push(null);this.sftp.read(this.handle,V,V.used,s,this.pos,((e,t)=>{if(e)return this.emit("error",e),void(this.autoClose&&this.destroy());let i=null;if(n+s===r.used&&r===V)r.used=Z(r.used+t-s);else{const e=n+s&-8,i=Z(n+t);e-i>=128&&X.push(r.slice(i,e))}t>0&&(this.bytesRead+=t,i=r.slice(n,n+t)),this.pos+=t,this.push(i)})),V.used=Z(V.used+s)},ee.prototype._destroy=function(e,t){!this._opening||Buffer.isBuffer(this.handle)?(te(this,t,e),this.handle=null,this._opening=!1):this.once("open",te.bind(null,this,t,e))},ee.prototype.close=function(e){this.destroy(null,e)},Object.defineProperty(ee.prototype,"pending",{get(){return null===this.handle},configurable:!0}),c(re,a),re.prototype._final=function(e){this.autoClose&&this.destroy(),e()},re.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,((e,t)=>{if(this._opening=!1,e)return this.emit("error",e),void(this.autoClose&&this.destroy());this.handle=t;const r=e=>{if(e)this.sftp.chmod(this.path,this.mode,(e=>r()));else if("a"!==this.flags[0])this.emit("open",t),this.emit("ready");else{const e=(r,s)=>{r?this.sftp.stat(this.path,((t,s)=>{if(t)return this.destroy(),void this.emit("error",r);e(null,s)})):(this.pos=s.size,this.emit("open",t),this.emit("ready"))};this.sftp.fstat(t,e)}};this.sftp.fchmod(t,this.mode,r)})))},re.prototype._write=function(e,t,r){if(!Buffer.isBuffer(e)){const t=new W("data","Buffer",e);return this.emit("error",t)}if(!Buffer.isBuffer(this.handle))return this.once("open",(function(){this._write(e,t,r)}));this.sftp.write(this.handle,e,0,e.length,this.pos,((e,t)=>{if(e)return this.autoClose&&this.destroy(),r(e);this.bytesWritten+=t,r()})),this.pos+=e.length},re.prototype._writev=function(e,t){if(!Buffer.isBuffer(this.handle))return this.once("open",(function(){this._writev(e,t)}));const r=this.sftp,s=this.handle;let n=e.length;const i=(e,r)=>{if(e)return this.destroy(),t(e);this.bytesWritten+=r,0==--n&&t()};for(let t=0;t<e.length;++t){const n=e[t].chunk;r.write(s,n,0,n.length,this.pos,i),this.pos+=n.length}},"function"!=typeof a.prototype.destroy&&(re.prototype.destroy=ee.prototype.destroy),re.prototype._destroy=ee.prototype._destroy,re.prototype.close=function(e){if(e){if(this.isClosed)return void process.nextTick(e);this.on("close",e)}this.autoClose||this.on("finish",this.destroy.bind(this)),this.end()},re.prototype.destroySoon=re.prototype.end,Object.defineProperty(re.prototype,"pending",{get(){return null===this.handle},configurable:!0}),e.exports={flagsToString:x,OPEN_MODE:y,SFTP:class extends s{constructor(e,t,r){super(),"object"==typeof r&&r||(r={});const s=e._protocol._remoteIdentRaw;this.server=!!r.server,this._debug="function"==typeof r.debug?r.debug:void 0,this._isOpenSSH=s&&S.test(s),this._version=-1,this._extensions={},this._biOpt=r.biOpt,this._pktLenBytes=0,this._pktLen=0,this._pktPos=0,this._pktType=0,this._pktData=void 0,this._writeReqid=-1,this._requests={},this._maxInPktLen=k,this._maxOutPktLen=34e3,this._maxReadLen=(this._isOpenSSH?k:34e3)-2048,this._maxWriteLen=(this._isOpenSSH?k:34e3)-2048,this.maxOpenHandles=void 0,this._client=e,this._protocol=e._protocol,this._callbacks=[],this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this._waitWindow=!1,this._chunkcb=void 0,this._buffer=[],this.type=t.type,this.subtype=void 0,this.incoming=t.incoming,this.outgoing=t.outgoing,this.stderr=T,this.readable=!0}push(e){if(null===e){if($(this),!this.readable)return;return this.readable=!1,void this.emit("end")}let t=0;for(;t<e.length;){if(this._pktLenBytes<4){let r=Math.min(4-this._pktLenBytes,e.length-t);for(this._pktLenBytes+=r;r--;)this._pktLen=(this._pktLen<<8)+e[t++];if(this._pktLenBytes<4)return;if(0===this._pktLen)return q(this,"Invalid packet length");if(this._pktLen>this._maxInPktLen){const e=this._maxInPktLen;return q(this,`Packet length ${this._pktLen} exceeds max length of ${e}`)}if(t>=e.length)return}if(this._pktPos<this._pktLen){const r=Math.min(this._pktLen-this._pktPos,e.length-t);if(0!==t||r!==e.length?r===this._pktLen?this._pkt=new u(e.buffer,e.byteOffset+t,r):(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(new Uint8Array(e.buffer,e.byteOffset+t,r),this._pktPos)):r===this._pktLen?this._pkt=e:(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(e,this._pktPos)),t+=r,this._pktPos+=r,this._pktPos<this._pktLen)return}const r=this._pkt[0],s=this._pkt;this._pktLen=0,this._pktLenBytes=0,this._pkt=void 0,this._pktPos=0;const n=this.server?K[r]:j[r];if(!n)return q(this,`Unknown packet type ${r}`);if(-1===this._version)if(this.server){if(1!==r)return q(this,`Expected INIT packet, got ${r}`)}else if(2!==r)return q(this,`Expected VERSION packet, got ${r}`);if(!1===n(this,s))return}}end(){this.destroy()}destroy(){"open"!==this.outgoing.state&&"eof"!==this.outgoing.state||(this.outgoing.state="closing",this._protocol.channelClose(this.outgoing.id))}_init(){this._init=C,this.server||M(this,w)}createReadStream(e,t){if(this.server)throw new Error("Client-only method called in server mode");return new ee(this,e,t)}createWriteStream(e,t){if(this.server)throw new Error("Client-only method called in server mode");return new re(this,e,t)}open(e,t,r,s){if(this.server)throw new Error("Client-only method called in server mode");"function"==typeof r&&(s=r,r=void 0);const n="number"==typeof t?t:F(t);if(null===n)throw new Error(`Unknown flags string: ${t}`);let i=0,o=0;"string"!=typeof r&&"number"!=typeof r||(r={mode:r}),"object"==typeof r&&null!==r&&(i=(r=N(r)).flags,o=r.nb);const a=Buffer.byteLength(e);let c=9;const l=Buffer.allocUnsafe(13+a+4+4+o);f(l,l.length-4,0),l[4]=3;const u=this._writeReqid=this._writeReqid+1&b;f(l,u,5),f(l,a,c),l.utf8Write(e,c+=4,a),f(l,n,c+=a),f(l,i,c+=4),o&&(c+=4,o===g.length?l.set(g,c):h(g,l,0,o,c),c+=o),this._requests[u]={cb:s};const d=M(this,l);this._debug&&this._debug(`SFTP: Outbound: ${d?"Buffered":"Sending"} OPEN`)}close(e,t){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");const r=e.length;let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=4;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.set(e,s+=4),this._requests[i]={cb:t};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} CLOSE`)}read(e,t,r,s,n,i){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(t))throw new Error("buffer is not a Buffer");if(r>=t.length)throw new Error("offset is out of bounds");if(r+s>t.length)throw new Error("length extends beyond buffer");if(null===n)throw new Error("null position currently unsupported");O(this,e,t,r,s,n,i)}readData(e,t,r,s,n,i){this.read(e,t,r,s,n,i)}write(e,t,r,s,n,i){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(t))throw new Error("buffer is not a Buffer");if(r>t.length)throw new Error("offset is out of bounds");if(r+s>t.length)throw new Error("length extends beyond buffer");if(null===n)throw new Error("null position currently unsupported");if(!s)return void(i&&process.nextTick(i,void 0,0));const o=this._maxWriteLen,a=Math.max(s-o,0),c=n;a&&(s=o);const l=e.length;let u=9;const d=Buffer.allocUnsafe(13+l+8+4+s);f(d,d.length-4,0),d[4]=6;const p=this._writeReqid=this._writeReqid+1&b;f(d,p,5),f(d,l,u),d.set(e,u+=4),u+=l;for(let e=7;e>=0;--e)d[u+e]=255&n,n/=256;f(d,s,u+=8),h(t,d,r,r+s,u+=4),this._requests[p]={cb:n=>{n?"function"==typeof i&&i(n):a?this.write(e,t,r+s,a,c+s,i):"function"==typeof i&&i(void 0,r+s)}};const g=M(this,d);if(this._debug){const e=g?"Sent":"Buffered";this._debug(`SFTP: Outbound: ${e} WRITE (id:${p})`)}}writeData(e,t,r,s,n,i){this.write(e,t,r,s,n,i)}fastGet(e,t,r,s){if(this.server)throw new Error("Client-only method called in server mode");R(this,n,e,t,r,s)}fastPut(e,t,r,s){if(this.server)throw new Error("Client-only method called in server mode");R(n,this,e,t,r,s)}readFile(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");let s;if("function"==typeof r?s=r:"function"==typeof t&&(s=t,t=void 0),"string"==typeof t)t={encoding:t,flag:"r"};else if(t){if("object"!=typeof t)throw new TypeError("Bad arguments")}else t={encoding:null,flag:"r"};const n=t.encoding;if(n&&!Buffer.isEncoding(n))throw new Error(`Unknown encoding: ${n}`);let i,o,a,c,l=0,u=0;const h=t.flag||"r",p=()=>{0===i?(o=Buffer.allocUnsafe(8192),this.read(c,o,0,8192,u,f)):this.read(c,o,l,i-l,u,f)},f=(e,t)=>{let r;if(e){if(r=e.code===m.EOF,!r)return this.close(c,(()=>s&&s(e)))}else r=!1;if(r||0===i&&0===t)return g();u+=t,l+=t,0!==i?l===i?g():p():(a.push(d(o,0,t)),p())};f._wantEOFError=!0;const g=()=>{this.close(c,(e=>(0===i?o=Buffer.concat(a,l):l<i&&(o=d(o,0,l)),n&&(o=o.toString(n)),s&&s(e,o))))};this.open(e,h,438,((t,r)=>{if(t)return s&&s(t);c=r;const n=(t,r)=>{if(t)this.stat(e,((e,r)=>{if(e)return this.close(c,(()=>{s&&s(t)}));n(null,r)}));else{if(i=r.size||0,0===i)return a=[],p();o=Buffer.allocUnsafe(i),p()}};this.fstat(c,n)}))}writeFile(e,t,r,s){if(this.server)throw new Error("Client-only method called in server mode");let n;if("function"==typeof s?n=s:"function"==typeof r&&(n=r,r=void 0),"string"==typeof r)r={encoding:r,mode:438,flag:"w"};else if(r){if("object"!=typeof r)throw new TypeError("Bad arguments")}else r={encoding:"utf8",mode:438,flag:"w"};if(r.encoding&&!Buffer.isEncoding(r.encoding))throw new Error(`Unknown encoding: ${r.encoding}`);const i=r.flag||"w";this.open(e,i,r.mode,((s,o)=>{if(s)n&&n(s);else{const s=Buffer.isBuffer(t)?t:Buffer.from(""+t,r.encoding||"utf8"),a=/a/.test(i)?null:0;if(null===a){const t=(r,i)=>{r?this.stat(e,((e,s)=>{if(e)return this.close(o,(()=>{n&&n(r)}));t(null,s)})):B(this,o,s,0,s.length,i.size,n)};return void this.fstat(o,t)}B(this,o,s,0,s.length,a,n)}}))}appendFile(e,t,r,s){if(this.server)throw new Error("Client-only method called in server mode");let n;if("function"==typeof s?n=s:"function"==typeof r&&(n=r,r=void 0),"string"==typeof r)r={encoding:r,mode:438,flag:"a"};else if(r){if("object"!=typeof r)throw new TypeError("Bad arguments")}else r={encoding:"utf8",mode:438,flag:"a"};r.flag||(r=Object.assign({flag:"a"},r)),this.writeFile(e,t,r,n)}exists(e,t){if(this.server)throw new Error("Client-only method called in server mode");this.stat(e,(e=>{t&&t(!e)}))}unlink(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=13;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.utf8Write(e,s+=4,r),this._requests[i]={cb:t};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} REMOVE`)}rename(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");const s=Buffer.byteLength(e),n=Buffer.byteLength(t);let i=9;const o=Buffer.allocUnsafe(13+s+4+n);f(o,o.length-4,0),o[4]=18;const a=this._writeReqid=this._writeReqid+1&b;f(o,a,5),f(o,s,i),o.utf8Write(e,i+=4,s),f(o,n,i+=s),o.utf8Write(t,i+=4,n),this._requests[a]={cb:r};const c=M(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} RENAME`)}mkdir(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");let s=0,n=0;"function"==typeof t&&(r=t,t=void 0),"object"==typeof t&&null!==t&&(s=(t=N(t)).flags,n=t.nb);const i=Buffer.byteLength(e);let o=9;const a=Buffer.allocUnsafe(13+i+4+n);f(a,a.length-4,0),a[4]=14;const c=this._writeReqid=this._writeReqid+1&b;f(a,c,5),f(a,i,o),a.utf8Write(e,o+=4,i),f(a,s,o+=i),n&&(o+=4,n===g.length?a.set(g,o):h(g,a,0,n,o),o+=n),this._requests[c]={cb:r};const l=M(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} MKDIR`)}rmdir(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=15;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.utf8Write(e,s+=4,r),this._requests[i]={cb:t};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} RMDIR`)}readdir(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");"function"==typeof t&&(r=t,t={}),"object"==typeof t&&null!==t||(t={});const s=!t||!t.full;if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new Error("missing directory handle or path");if("string"==typeof e){const s=[];let n=0;const i=(e,o)=>{if(e)return r(e);this.readdir(o,t,((e,t)=>{const a=e&&e.code===m.EOF;if(e&&!a)return this.close(o,(()=>r(e)));if(a)return this.close(o,(e=>{if(e)return r(e);r(void 0,s)}));for(let e=0;e<t.length;++e,++n)s[n]=t[e];i(void 0,o)}))};return this.opendir(e,i)}const n=e.length;let i=9;const o=Buffer.allocUnsafe(13+n);f(o,o.length-4,0),o[4]=12;const a=this._writeReqid=this._writeReqid+1&b;f(o,a,5),f(o,n,i),o.set(e,i+=4),this._requests[a]={cb:s?(e,t)=>{if("function"==typeof r){if(e)return r(e);for(let e=t.length-1;e>=0;--e)"."!==t[e].filename&&".."!==t[e].filename||t.splice(e,1);r(void 0,t)}}:r};const c=M(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} READDIR`)}fstat(e,t){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");const r=e.length;let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=8;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.set(e,s+=4),this._requests[i]={cb:t};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} FSTAT`)}stat(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=17;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.utf8Write(e,s+=4,r),this._requests[i]={cb:t};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} STAT`)}lstat(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=7;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.utf8Write(e,s+=4,r),this._requests[i]={cb:t};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} LSTAT`)}opendir(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=11;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.utf8Write(e,s+=4,r),this._requests[i]={cb:t};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} OPENDIR`)}setstat(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");let s=0,n=0;"object"==typeof t&&null!==t?(s=(t=N(t)).flags,n=t.nb):"function"==typeof t&&(r=t);const i=Buffer.byteLength(e);let o=9;const a=Buffer.allocUnsafe(13+i+4+n);f(a,a.length-4,0),a[4]=9;const c=this._writeReqid=this._writeReqid+1&b;f(a,c,5),f(a,i,o),a.utf8Write(e,o+=4,i),f(a,s,o+=i),n&&(o+=4,n===g.length?a.set(g,o):h(g,a,0,n,o),o+=n),this._requests[c]={cb:r};const l=M(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} SETSTAT`)}fsetstat(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let s=0,n=0;"object"==typeof t&&null!==t?(s=(t=N(t)).flags,n=t.nb):"function"==typeof t&&(r=t);const i=e.length;let o=9;const a=Buffer.allocUnsafe(13+i+4+n);f(a,a.length-4,0),a[4]=10;const c=this._writeReqid=this._writeReqid+1&b;f(a,c,5),f(a,i,o),a.set(e,o+=4),f(a,s,o+=i),n&&(o+=4,n===g.length?a.set(g,o):h(g,a,0,n,o),o+=n),this._requests[c]={cb:r};const l=M(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} FSETSTAT`)}futimes(e,t,r,s){return this.fsetstat(e,{atime:L(t),mtime:L(r)},s)}utimes(e,t,r,s){return this.setstat(e,{atime:L(t),mtime:L(r)},s)}fchown(e,t,r,s){return this.fsetstat(e,{uid:t,gid:r},s)}chown(e,t,r,s){return this.setstat(e,{uid:t,gid:r},s)}fchmod(e,t,r){return this.fsetstat(e,{mode:t},r)}chmod(e,t,r){return this.setstat(e,{mode:t},r)}readlink(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=19;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.utf8Write(e,s+=4,r),this._requests[i]={cb:(e,r)=>{if("function"==typeof t)return e?t(e):r&&r.length?void t(void 0,r[0].filename):t(new Error("Response missing link info"))}};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} READLINK`)}symlink(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");const s=Buffer.byteLength(t),n=Buffer.byteLength(e);let i=9;const o=Buffer.allocUnsafe(13+s+4+n);f(o,o.length-4,0),o[4]=20;const a=this._writeReqid=this._writeReqid+1&b;f(o,a,5),this._isOpenSSH?(f(o,n,i),o.utf8Write(e,i+=4,n),f(o,s,i+=n),o.utf8Write(t,i+=4,s)):(f(o,s,i),o.utf8Write(t,i+=4,s),f(o,n,i+=s),o.utf8Write(e,i+=4,n)),this._requests[a]={cb:r};const c=M(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} SYMLINK`)}realpath(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=Buffer.byteLength(e);let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=16;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,r,s),n.utf8Write(e,s+=4,r),this._requests[i]={cb:(e,r)=>{if("function"==typeof t)return e?t(e):r&&r.length?void t(void 0,r[0].filename):t(new Error("Response missing path info"))}};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} REALPATH`)}ext_openssh_rename(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");const s=this._extensions["posix-rename@openssh.com"];if(!s||"1"!==s)throw new Error("Server does not support this extended request");const n=Buffer.byteLength(e),i=Buffer.byteLength(t);let o=9;const a=Buffer.allocUnsafe(41+n+4+i);f(a,a.length-4,0),a[4]=E;const c=this._writeReqid=this._writeReqid+1&b;f(a,c,5),f(a,24,o),a.utf8Write("posix-rename@openssh.com",o+=4,24),f(a,n,o+=24),a.utf8Write(e,o+=4,n),f(a,i,o+=n),a.utf8Write(t,o+=4,i),this._requests[c]={cb:r};const l=M(this,a);if(this._debug){const e=l?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} posix-rename@openssh.com`)}}ext_openssh_statvfs(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=this._extensions["statvfs@openssh.com"];if(!r||"2"!==r)throw new Error("Server does not support this extended request");const s=Buffer.byteLength(e);let n=9;const i=Buffer.allocUnsafe(36+s);f(i,i.length-4,0),i[4]=E;const o=this._writeReqid=this._writeReqid+1&b;f(i,o,5),f(i,19,n),i.utf8Write("statvfs@openssh.com",n+=4,19),f(i,s,n+=19),i.utf8Write(e,n+=4,s),this._requests[o]={extended:"statvfs@openssh.com",cb:t};const a=M(this,i);if(this._debug){const e=a?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} statvfs@openssh.com`)}}ext_openssh_fstatvfs(e,t){if(this.server)throw new Error("Client-only method called in server mode");const r=this._extensions["fstatvfs@openssh.com"];if(!r||"2"!==r)throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");const s=e.length;let n=9;const i=Buffer.allocUnsafe(37+s);f(i,i.length-4,0),i[4]=E;const o=this._writeReqid=this._writeReqid+1&b;f(i,o,5),f(i,20,n),i.utf8Write("fstatvfs@openssh.com",n+=4,20),f(i,s,n+=20),i.set(e,n+=4),this._requests[o]={extended:"fstatvfs@openssh.com",cb:t};const a=M(this,i);if(this._debug){const e=a?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} fstatvfs@openssh.com`)}}ext_openssh_hardlink(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");if("1"!==this._extensions["hardlink@openssh.com"])throw new Error("Server does not support this extended request");const s=Buffer.byteLength(e),n=Buffer.byteLength(t);let i=9;const o=Buffer.allocUnsafe(37+s+4+n);f(o,o.length-4,0),o[4]=E;const a=this._writeReqid=this._writeReqid+1&b;f(o,a,5),f(o,20,i),o.utf8Write("hardlink@openssh.com",i+=4,20),f(o,s,i+=20),o.utf8Write(e,i+=4,s),f(o,n,i+=s),o.utf8Write(t,i+=4,n),this._requests[a]={cb:r};const c=M(this,o);if(this._debug){const e=c?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} hardlink@openssh.com`)}}ext_openssh_fsync(e,t){if(this.server)throw new Error("Client-only method called in server mode");if("1"!==this._extensions["fsync@openssh.com"])throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");const r=e.length;let s=9;const n=Buffer.allocUnsafe(34+r);f(n,n.length-4,0),n[4]=E;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,17,s),n.utf8Write("fsync@openssh.com",s+=4,17),f(n,r,s+=17),n.set(e,s+=4),this._requests[i]={cb:t};const o=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} fsync@openssh.com`)}ext_openssh_lsetstat(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");if("1"!==this._extensions["lsetstat@openssh.com"])throw new Error("Server does not support this extended request");let s=0,n=0;"object"==typeof t&&null!==t?(s=(t=N(t)).flags,n=t.nb):"function"==typeof t&&(r=t);const i=Buffer.byteLength(e);let o=9;const a=Buffer.allocUnsafe(37+i+4+n);f(a,a.length-4,0),a[4]=E;const c=this._writeReqid=this._writeReqid+1&b;f(a,c,5),f(a,20,o),a.utf8Write("lsetstat@openssh.com",o+=4,20),f(a,i,o+=20),a.utf8Write(e,o+=4,i),f(a,s,o+=i),n&&(o+=4,n===g.length?a.set(g,o):h(g,a,0,n,o),o+=n),this._requests[c]={cb:r};const l=M(this,a);if(this._debug){const e=l?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} lsetstat@openssh.com`)}}ext_openssh_expandPath(e,t){if(this.server)throw new Error("Client-only method called in server mode");if("1"!==this._extensions["expand-path@openssh.com"])throw new Error("Server does not support this extended request");const r=Buffer.byteLength(e);let s=9;const n=Buffer.allocUnsafe(40+r);f(n,n.length-4,0),n[4]=E;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,5),f(n,23,s),n.utf8Write("expand-path@openssh.com",s+=4,23),f(n,r,s+=20),n.utf8Write(e,s+=4,r),this._requests[i]={cb:(e,r)=>{if("function"==typeof t)return e?t(e):r&&r.length?void t(void 0,r[0].filename):t(new Error("Response missing expanded path"))}};const o=M(this,n);if(this._debug){const e=o?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} expand-path@openssh.com`)}}ext_copy_data(e,t,r,s,n,i){if(this.server)throw new Error("Client-only method called in server mode");if("1"!==this._extensions["copy-data"])throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("Source handle is not a Buffer");if(!Buffer.isBuffer(s))throw new Error("Destination handle is not a Buffer");let o=0;const a=Buffer.allocUnsafe(26+e.length+8+8+4+s.length+8);f(a,a.length-4,o),o+=4,a[o]=E,++o;const c=this._writeReqid=this._writeReqid+1&b;f(a,c,o),o+=4,f(a,9,o),o+=4,a.utf8Write("copy-data",o,9),o+=9,f(a,e.length,o),o+=4,a.set(e,o),o+=e.length;for(let e=7;e>=0;--e)a[o+e]=255&t,t/=256;o+=8;for(let e=7;e>=0;--e)a[o+e]=255&r,r/=256;o+=8,f(a,s.length,o),o+=4,a.set(s,o),o+=s.length;for(let e=7;e>=0;--e)a[o+e]=255&n,n/=256;this._requests[c]={cb:i};const l=M(this,a);if(this._debug){const e=l?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} copy-data`)}}ext_home_dir(e,t){if(this.server)throw new Error("Client-only method called in server mode");if("1"!==this._extensions["home-directory"])throw new Error("Server does not support this extended request");if("string"!=typeof e)throw new TypeError("username is not a string");let r=0;const s=Buffer.byteLength(e),n=Buffer.allocUnsafe(31+s);f(n,n.length-4,r),r+=4,n[r]=E,++r;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,r),r+=4,f(n,14,r),r+=4,n.utf8Write("home-directory",r,14),r+=14,f(n,s,r),r+=4,n.utf8Write(e,r,s),r+=s,this._requests[i]={cb:(e,r)=>{if("function"==typeof t)return e?t(e):r&&r.length?void t(void 0,r[0].filename):t(new Error("Response missing home directory"))}};const o=M(this,n);if(this._debug){const e=o?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} home-directory`)}}ext_users_groups(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");if("1"!==this._extensions["users-groups-by-id@openssh.com"])throw new Error("Server does not support this extended request");if(!Array.isArray(e))throw new TypeError("uids is not an array");for(const t of e)if(!Number.isInteger(t)||t<0||t>2**32-1)throw new Error("uid values must all be 32-bit unsigned integers");if(!Array.isArray(t))throw new TypeError("gids is not an array");for(const e of t)if(!Number.isInteger(e)||e<0||e>2**32-1)throw new Error("gid values must all be 32-bit unsigned integers");let s=0;const n=Buffer.allocUnsafe(47+4*e.length+4+4*t.length);f(n,n.length-4,s),s+=4,n[s]=E,++s;const i=this._writeReqid=this._writeReqid+1&b;f(n,i,s),s+=4,f(n,30,s),s+=4,n.utf8Write("users-groups-by-id@openssh.com",s,30),s+=30,f(n,4*e.length,s),s+=4;for(const t of e)f(n,t,s),s+=4;f(n,4*t.length,s),s+=4;for(const e of t)f(n,e,s),s+=4;this._requests[i]={extended:"users-groups-by-id@openssh.com",cb:r};const o=M(this,n);if(this._debug){const e=o?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${e} users-groups-by-id@openssh.com`)}}handle(e,t){if(!this.server)throw new Error("Server-only method called in client mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");const r=t.length;if(r>256)throw new Error("handle too large (> 256 bytes)");let s=9;const n=Buffer.allocUnsafe(13+r);f(n,n.length-4,0),n[4]=102,f(n,e,5),f(n,r,s),r&&n.set(t,s+=4);const i=M(this,n);this._debug&&this._debug(`SFTP: Outbound: ${i?"Buffered":"Sending"} HANDLE`)}status(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!_.has(t))throw new Error(`Bad status code: ${t}`);r||(r="");const s=Buffer.byteLength(r);let n=9;const i=Buffer.allocUnsafe(17+s+4);f(i,i.length-4,0),i[4]=101,f(i,e,5),f(i,t,n),f(i,s,n+=4),n+=4,s&&(i.utf8Write(r,n,s),n+=s),f(i,0,n);const o=M(this,i);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} STATUS`)}data(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");const s=Buffer.isBuffer(t);if(!s&&"string"!=typeof t)throw new Error("data is not a Buffer or string");let n;s||r||(r=void 0,n=!0);const i=s?t.length:Buffer.byteLength(t,r);let o=9;const a=Buffer.allocUnsafe(13+i);f(a,a.length-4,0),a[4]=103,f(a,e,5),f(a,i,o),i&&(s?a.set(t,o+=4):n?a.utf8Write(t,o+=4,i):a.write(t,o+=4,i,r));const c=M(this,a);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} DATA`)}name(e,t){if(!this.server)throw new Error("Server-only method called in client mode");if(!Array.isArray(t)){if("object"!=typeof t||null===t)throw new Error("names is not an object or array");t=[t]}const r=t.length;let s,n=0;const i=[];for(let e=0;e<r;++e){const r=t[e],o=r&&r.filename&&"string"==typeof r.filename?r.filename:"";n+=4+Buffer.byteLength(o);const a=r&&r.longname&&"string"==typeof r.longname?r.longname:"";if(n+=4+Buffer.byteLength(a),"object"==typeof r.attrs&&null!==r.attrs){if(s=N(r.attrs),n+=4+s.nb,s.nb){let e;s.nb===g.length?e=new Uint8Array(g):(e=new Uint8Array(s.nb),h(g,e,0,s.nb,0)),s.bytes=e}i.push(s)}else n+=4,i.push(null)}let o=9;const a=Buffer.allocUnsafe(13+n);f(a,a.length-4,0),a[4]=104,f(a,e,5),f(a,r,o),o+=4;for(let e=0;e<r;++e){const r=t[e];{const e=r&&r.filename&&"string"==typeof r.filename?r.filename:"",t=Buffer.byteLength(e);f(a,t,o),o+=4,t&&(a.utf8Write(e,o,t),o+=t)}{const e=r&&r.longname&&"string"==typeof r.longname?r.longname:"",t=Buffer.byteLength(e);f(a,t,o),o+=4,t&&(a.utf8Write(e,o,t),o+=t)}const s=i[e];s?(f(a,s.flags,o),o+=4,s.flags&&s.bytes&&(a.set(s.bytes,o),o+=s.nb)):(f(a,0,o),o+=4)}const c=M(this,a);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} NAME`)}attrs(e,t){if(!this.server)throw new Error("Server-only method called in client mode");if("object"!=typeof t||null===t)throw new Error("attrs is not an object");const r=(t=N(t)).flags,s=t.nb;let n=9;const i=Buffer.allocUnsafe(13+s);f(i,i.length-4,0),i[4]=105,f(i,e,5),f(i,r,n),s&&(n+=4,s===g.length?i.set(g,n):h(g,i,0,s,n),n+=s);const o=M(this,i);this._debug&&this._debug(`SFTP: Outbound: ${o?"Buffered":"Sending"} ATTRS`)}},Stats:P,STATUS_CODE:m,stringToFlags:F}},3190:(e,t,r)=>{"use strict";const s=r(6113);let n;try{n=r(Object(function(){var e=new Error("Cannot find module 'cpu-features'");throw e.code="MODULE_NOT_FOUND",e}()))()}catch{}const{bindingAvailable:i,CIPHER_INFO:o,MAC_INFO:a}=r(8545),c=(()=>{if("function"==typeof s.sign&&"function"==typeof s.verify){const e="-----BEGIN PRIVATE KEY-----\r\nMC4CAQAwBQYDK2VwBCIEIHKj+sVa9WcD/q2DJUJaf43Kptc8xYuUQA4bOFj9vC8T\r\n-----END PRIVATE KEY-----",t=Buffer.from("a");let r,n;try{r=s.sign(null,t,e),n=s.verify(null,t,e,r)}catch{}return Buffer.isBuffer(r)&&64===r.length&&!0===n}return!1})(),l="function"==typeof s.diffieHellman&&"function"==typeof s.generateKeyPairSync&&"function"==typeof s.createPublicKey,u=["ecdh-sha2-nistp256","ecdh-sha2-nistp384","ecdh-sha2-nistp521","diffie-hellman-group-exchange-sha256","diffie-hellman-group14-sha256","diffie-hellman-group15-sha512","diffie-hellman-group16-sha512","diffie-hellman-group17-sha512","diffie-hellman-group18-sha512"];l&&(u.unshift("curve25519-sha256"),u.unshift("curve25519-sha256@libssh.org"));const h=u.concat(["diffie-hellman-group-exchange-sha1","diffie-hellman-group14-sha1","diffie-hellman-group1-sha1"]),d=["ecdsa-sha2-nistp256","ecdsa-sha2-nistp384","ecdsa-sha2-nistp521","rsa-sha2-512","rsa-sha2-256","ssh-rsa"];c&&d.unshift("ssh-ed25519");const p=d.concat(["ssh-dss"]),f=(()=>{const e=s.getCiphers();return t=>e.includes(o[t].sslName)})();let g=["aes128-gcm@openssh.com","aes256-gcm@openssh.com","aes128-ctr","aes192-ctr","aes256-ctr"];n&&n.flags&&!n.flags.aes?i?g.unshift("chacha20-poly1305@openssh.com"):g.push("chacha20-poly1305@openssh.com"):i&&n&&"x86"===n.arch?g.splice(4,0,"chacha20-poly1305@openssh.com"):g.push("chacha20-poly1305@openssh.com"),g=g.filter(f);const m=g.concat(["aes256-cbc","aes192-cbc","aes128-cbc","blowfish-cbc","3des-cbc","aes128-gcm","aes256-gcm","arcfour256","arcfour128","cast128-cbc","arcfour"].filter(f)),_=(()=>{const e=s.getHashes();return t=>e.includes(a[t].sslName)})(),A=["hmac-sha2-256-etm@openssh.com","hmac-sha2-512-etm@openssh.com","hmac-sha1-etm@openssh.com","hmac-sha2-256","hmac-sha2-512","hmac-sha1"].filter(_),E=A.concat(["hmac-md5","hmac-sha2-256-96","hmac-sha2-512-96","hmac-ripemd160","hmac-sha1-96","hmac-md5-96"].filter(_)),y=["none","zlib@openssh.com","zlib"],b=y.concat([]),w={BAD_DHGEX:1,OLD_EXIT:2,DYN_RPORT_BUG:4,BUG_DHGEX_LARGE:8,IMPLY_RSA_SHA2_SIGALGS:16};e.exports={MESSAGE:{DISCONNECT:1,IGNORE:2,UNIMPLEMENTED:3,DEBUG:4,SERVICE_REQUEST:5,SERVICE_ACCEPT:6,EXT_INFO:7,KEXINIT:20,NEWKEYS:21,KEXDH_INIT:30,KEXDH_REPLY:31,KEXDH_GEX_GROUP:31,KEXDH_GEX_INIT:32,KEXDH_GEX_REPLY:33,KEXDH_GEX_REQUEST:34,KEXECDH_INIT:30,KEXECDH_REPLY:31,USERAUTH_REQUEST:50,USERAUTH_FAILURE:51,USERAUTH_SUCCESS:52,USERAUTH_BANNER:53,USERAUTH_PASSWD_CHANGEREQ:60,USERAUTH_PK_OK:60,USERAUTH_INFO_REQUEST:60,USERAUTH_INFO_RESPONSE:61,GLOBAL_REQUEST:80,REQUEST_SUCCESS:81,REQUEST_FAILURE:82,CHANNEL_OPEN:90,CHANNEL_OPEN_CONFIRMATION:91,CHANNEL_OPEN_FAILURE:92,CHANNEL_WINDOW_ADJUST:93,CHANNEL_DATA:94,CHANNEL_EXTENDED_DATA:95,CHANNEL_EOF:96,CHANNEL_CLOSE:97,CHANNEL_REQUEST:98,CHANNEL_SUCCESS:99,CHANNEL_FAILURE:100},DISCONNECT_REASON:{HOST_NOT_ALLOWED_TO_CONNECT:1,PROTOCOL_ERROR:2,KEY_EXCHANGE_FAILED:3,RESERVED:4,MAC_ERROR:5,COMPRESSION_ERROR:6,SERVICE_NOT_AVAILABLE:7,PROTOCOL_VERSION_NOT_SUPPORTED:8,HOST_KEY_NOT_VERIFIABLE:9,CONNECTION_LOST:10,BY_APPLICATION:11,TOO_MANY_CONNECTIONS:12,AUTH_CANCELED_BY_USER:13,NO_MORE_AUTH_METHODS_AVAILABLE:14,ILLEGAL_USER_NAME:15},DISCONNECT_REASON_STR:void 0,CHANNEL_OPEN_FAILURE:{ADMINISTRATIVELY_PROHIBITED:1,CONNECT_FAILED:2,UNKNOWN_CHANNEL_TYPE:3,RESOURCE_SHORTAGE:4},TERMINAL_MODE:{TTY_OP_END:0,VINTR:1,VQUIT:2,VERASE:3,VKILL:4,VEOF:5,VEOL:6,VEOL2:7,VSTART:8,VSTOP:9,VSUSP:10,VDSUSP:11,VREPRINT:12,VWERASE:13,VLNEXT:14,VFLUSH:15,VSWTCH:16,VSTATUS:17,VDISCARD:18,IGNPAR:30,PARMRK:31,INPCK:32,ISTRIP:33,INLCR:34,IGNCR:35,ICRNL:36,IUCLC:37,IXON:38,IXANY:39,IXOFF:40,IMAXBEL:41,ISIG:50,ICANON:51,XCASE:52,ECHO:53,ECHOE:54,ECHOK:55,ECHONL:56,NOFLSH:57,TOSTOP:58,IEXTEN:59,ECHOCTL:60,ECHOKE:61,PENDIN:62,OPOST:70,OLCUC:71,ONLCR:72,OCRNL:73,ONOCR:74,ONLRET:75,CS7:90,CS8:91,PARENB:92,PARODD:93,TTY_OP_ISPEED:128,TTY_OP_OSPEED:129},CHANNEL_EXTENDED_DATATYPE:{STDERR:1},SIGNALS:["ABRT","ALRM","FPE","HUP","ILL","INT","QUIT","SEGV","TERM","USR1","USR2","KILL","PIPE"].reduce(((e,t)=>({...e,[t]:1})),{}),COMPAT:w,COMPAT_CHECKS:[["Cisco-1.25",w.BAD_DHGEX],[/^Cisco-1[.]/,w.BUG_DHGEX_LARGE],[/^[0-9.]+$/,w.OLD_EXIT],[/^OpenSSH_5[.][0-9]+/,w.DYN_RPORT_BUG],[/^OpenSSH_7[.]4/,w.IMPLY_RSA_SHA2_SIGALGS]],DEFAULT_KEX:u,SUPPORTED_KEX:h,DEFAULT_SERVER_HOST_KEY:d,SUPPORTED_SERVER_HOST_KEY:p,DEFAULT_CIPHER:g,SUPPORTED_CIPHER:m,DEFAULT_MAC:A,SUPPORTED_MAC:E,DEFAULT_COMPRESSION:y,SUPPORTED_COMPRESSION:b,curve25519Supported:l,eddsaSupported:c},e.exports.DISCONNECT_REASON_BY_VALUE=Array.from(Object.entries(e.exports.DISCONNECT_REASON)).reduce(((e,[t,r])=>({...e,[r]:t})),{})},8545:(e,t,r)=>{"use strict";const{createCipheriv:s,createDecipheriv:n,createHmac:i,randomFillSync:o,timingSafeEqual:a}=r(6113),{readUInt32BE:c,writeUInt32BE:l}=r(9205),u=Buffer[Symbol.species],h=2**32-1,d=Buffer.alloc(0),p=Buffer.alloc(4),f=new Map,g=35e3;let m,_,A,E,y,b,w;try{m=r(Object(function(){var e=new Error("Cannot find module './crypto/build/Release/sshcrypto.node'");throw e.code="MODULE_NOT_FOUND",e}())),({AESGCMCipher:_,ChaChaPolyCipher:A,GenericCipher:E,AESGCMDecipher:y,ChaChaPolyDecipher:b,GenericDecipher:w}=m)}catch{}const v=(()=>{function e(e,t,r,s,n,i,o){return{sslName:e,blockLen:t,keyLen:r,ivLen:0!==s||1&o?s:t,authLen:n,discardLen:i,stream:!!(1&o)}}return{"chacha20-poly1305@openssh.com":e("chacha20",8,64,0,16,0,1),"aes128-gcm":e("aes-128-gcm",16,16,12,16,0,1),"aes256-gcm":e("aes-256-gcm",16,32,12,16,0,1),"aes128-gcm@openssh.com":e("aes-128-gcm",16,16,12,16,0,1),"aes256-gcm@openssh.com":e("aes-256-gcm",16,32,12,16,0,1),"aes128-cbc":e("aes-128-cbc",16,16,0,0,0,0),"aes192-cbc":e("aes-192-cbc",16,24,0,0,0,0),"aes256-cbc":e("aes-256-cbc",16,32,0,0,0,0),"rijndael-cbc@lysator.liu.se":e("aes-256-cbc",16,32,0,0,0,0),"3des-cbc":e("des-ede3-cbc",8,24,0,0,0,0),"blowfish-cbc":e("bf-cbc",8,16,0,0,0,0),"idea-cbc":e("idea-cbc",8,16,0,0,0,0),"cast128-cbc":e("cast-cbc",8,16,0,0,0,0),"aes128-ctr":e("aes-128-ctr",16,16,16,0,0,1),"aes192-ctr":e("aes-192-ctr",16,24,16,0,0,1),"aes256-ctr":e("aes-256-ctr",16,32,16,0,0,1),"3des-ctr":e("des-ede3",8,24,8,0,0,1),"blowfish-ctr":e("bf-ecb",8,16,8,0,0,1),"cast128-ctr":e("cast5-ecb",8,16,8,0,0,1),arcfour:e("rc4",8,16,0,0,1536,1),arcfour128:e("rc4",8,16,0,0,1536,1),arcfour256:e("rc4",8,32,0,0,1536,1),arcfour512:e("rc4",8,64,0,0,1536,1)}})(),S=(()=>{function e(e,t,r,s){return{sslName:e,len:t,actualLen:r,isETM:s}}return{"hmac-md5":e("md5",16,16,!1),"hmac-md5-96":e("md5",16,12,!1),"hmac-ripemd160":e("ripemd160",20,20,!1),"hmac-sha1":e("sha1",20,20,!1),"hmac-sha1-etm@openssh.com":e("sha1",20,20,!0),"hmac-sha1-96":e("sha1",20,12,!1),"hmac-sha2-256":e("sha256",32,32,!1),"hmac-sha2-256-etm@openssh.com":e("sha256",32,32,!0),"hmac-sha2-256-96":e("sha256",32,12,!1),"hmac-sha2-512":e("sha512",64,64,!1),"hmac-sha2-512-etm@openssh.com":e("sha512",64,64,!0),"hmac-sha2-512-96":e("sha512",64,12,!1)}})(),k=Buffer.alloc(32),I=Buffer.alloc(16);let T,C,O;class R{constructor(e){const t=e.outbound;this.outSeqno=t.seqno,this._onWrite=t.onWrite,this._encKeyMain=t.cipherKey.slice(0,32),this._encKeyPktLen=t.cipherKey.slice(32),this._dead=!1}free(){this._dead=!0}allocPacket(e){let t=5+e,r=8-(t-4&7);r<4&&(r+=8),t+=r;const s=Buffer.allocUnsafe(t);return l(s,t-4,0),s[4]=r,o(s,5+e,r),s}encrypt(e){if(this._dead)return;I[0]=0,l(I,this.outSeqno,12);const t=s("chacha20",this._encKeyMain,I).update(k),r=s("chacha20",this._encKeyPktLen,I).update(e.slice(0,4));this._onWrite(r),I[0]=1;const n=s("chacha20",this._encKeyMain,I).update(e.slice(4));this._onWrite(n),O(C,r,r.length,n,n.length,t);const i=Buffer.allocUnsafe(16);i.set(new Uint8Array(T.HEAPU8.buffer,C,16),0),this._onWrite(i),this.outSeqno=this.outSeqno+1>>>0}}class B{constructor(e){const t=e.outbound;this.outSeqno=t.seqno,this._onWrite=t.onWrite,this._instance=new A(t.cipherKey),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){let t=5+e,r=8-(t-4&7);r<4&&(r+=8),t+=r;const s=Buffer.allocUnsafe(t+16);return l(s,t-4,0),s[4]=r,o(s,5+e,r),s}encrypt(e){this._dead||(this._instance.encrypt(e,this.outSeqno),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}}class P{constructor(e){const t=e.outbound;this.outSeqno=t.seqno,this._onWrite=t.onWrite,this._encSSLName=t.cipherInfo.sslName,this._encKey=t.cipherKey,this._encIV=t.cipherIV,this._dead=!1}free(){this._dead=!0}allocPacket(e){let t=5+e,r=16-(t-4&15);r<4&&(r+=16),t+=r;const s=Buffer.allocUnsafe(t);return l(s,t-4,0),s[4]=r,o(s,5+e,r),s}encrypt(e){if(this._dead)return;const t=s(this._encSSLName,this._encKey,this._encIV);t.setAutoPadding(!1);const r=e.slice(0,4);t.setAAD(r),this._onWrite(r);const n=t.update(e.slice(4));this._onWrite(n);const i=t.final();i.length&&this._onWrite(i);const o=t.getAuthTag();this._onWrite(o),Q(this._encIV),this.outSeqno=this.outSeqno+1>>>0}}class N{constructor(e){const t=e.outbound;this.outSeqno=t.seqno,this._onWrite=t.onWrite,this._instance=new _(t.cipherInfo.sslName,t.cipherKey,t.cipherIV),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){let t=5+e,r=16-(t-4&15);r<4&&(r+=16),t+=r;const s=Buffer.allocUnsafe(t+16);return l(s,t-4,0),s[4]=r,o(s,5+e,r),s}encrypt(e){this._dead||(this._instance.encrypt(e),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}}class L{constructor(e){const t=e.outbound;this.outSeqno=t.seqno,this._onWrite=t.onWrite,this._encBlockLen=t.cipherInfo.blockLen,this._cipherInstance=s(t.cipherInfo.sslName,t.cipherKey,t.cipherIV),this._macSSLName=t.macInfo.sslName,this._macKey=t.macKey,this._macActualLen=t.macInfo.actualLen,this._macETM=t.macInfo.isETM,this._aadLen=this._macETM?4:0,this._dead=!1;const r=t.cipherInfo.discardLen;if(r){let e=f.get(r);void 0===e&&(e=Buffer.alloc(r),f.set(r,e)),this._cipherInstance.update(e)}}free(){this._dead=!0}allocPacket(e){const t=this._encBlockLen;let r=5+e,s=t-(r-this._aadLen&t-1);s<4&&(s+=t),r+=s;const n=Buffer.allocUnsafe(r);return l(n,r-4,0),n[4]=s,o(n,5+e,s),n}encrypt(e){if(this._dead)return;let t;if(this._macETM){const r=new Uint8Array(e.buffer,e.byteOffset,4),s=this._cipherInstance.update(new Uint8Array(e.buffer,e.byteOffset+4,e.length-4));this._onWrite(r),this._onWrite(s),t=i(this._macSSLName,this._macKey),l(p,this.outSeqno,0),t.update(p),t.update(r),t.update(s)}else{const r=this._cipherInstance.update(e);this._onWrite(r),t=i(this._macSSLName,this._macKey),l(p,this.outSeqno,0),t.update(p),t.update(e)}let r=t.digest();r.length>this._macActualLen&&(r=r.slice(0,this._macActualLen)),this._onWrite(r),this.outSeqno=this.outSeqno+1>>>0}}class U{constructor(e){const t=e.outbound;this.outSeqno=t.seqno,this._onWrite=t.onWrite,this._encBlockLen=t.cipherInfo.blockLen,this._macLen=t.macInfo.len,this._macActualLen=t.macInfo.actualLen,this._aadLen=t.macInfo.isETM?4:0,this._instance=new E(t.cipherInfo.sslName,t.cipherKey,t.cipherIV,t.macInfo.sslName,t.macKey,t.macInfo.isETM),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){const t=this._encBlockLen;let r=5+e,s=t-(r-this._aadLen&t-1);s<4&&(s+=t),r+=s;const n=Buffer.allocUnsafe(r+this._macLen);return l(n,r-4,0),n[4]=s,o(n,5+e,s),n}encrypt(e){this._dead||(this._instance.encrypt(e,this.outSeqno),this._macActualLen<this._macLen&&(e=new u(e.buffer,e.byteOffset,e.length-(this._macLen-this._macActualLen))),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}}class D{constructor(e){const t=e.inbound;this.inSeqno=t.seqno,this._onPayload=t.onPayload,this._decKeyMain=t.decipherKey.slice(0,32),this._decKeyPktLen=t.decipherKey.slice(32),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._calcMac=Buffer.allocUnsafe(16),this._macPos=0}free(){}decrypt(e,t,r){for(;t<r;){if(this._lenPos<4){let s=Math.min(4-this._lenPos,r-t);for(;s--;)this._lenBuf[this._lenPos++]=e[t++];if(this._lenPos<4)return;I[0]=0,l(I,this.inSeqno,12);const i=n("chacha20",this._decKeyPktLen,I).update(this._lenBuf);if(this._len=c(i,0),this._len>g||this._len<8||0!=(7&this._len))throw new Error("Bad packet length")}if(this._pktLen<this._len){if(t>=r)return;const s=Math.min(this._len-this._pktLen,r-t);let n;if(n=0!==t||s!==r?new Uint8Array(e.buffer,e.byteOffset+t,s):e,s===this._len?this._packet=n:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(n,this._pktLen)),t+=s,this._pktLen+=s,this._pktLen<this._len||t>=r)return}{const s=Math.min(16-this._macPos,r-t);if(0!==t||s!==r?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+t,s),this._macPos):this._mac.set(e,this._macPos),t+=s,this._macPos+=s,this._macPos<16)return}I[0]=0,l(I,this.inSeqno,12);const i=s("chacha20",this._decKeyMain,I).update(k);if(O(C,this._lenBuf,4,this._packet,this._packet.length,i),this._calcMac.set(new Uint8Array(T.HEAPU8.buffer,C,16),0),!a(this._calcMac,this._mac))throw new Error("Invalid MAC");I[0]=1;const o=n("chacha20",this._decKeyMain,I).update(this._packet),h=new u(o.buffer,o.byteOffset+1,o.length-o[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{const e=this._onPayload(h);if(void 0!==e)return!1===e?t:e}}}}class F{constructor(e){const t=e.inbound;this.inSeqno=t.seqno,this._onPayload=t.onPayload,this._instance=new b(t.decipherKey),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._macPos=0}free(){this._instance.free()}decrypt(e,t,r){for(;t<r;){if(this._lenPos<4){let s=Math.min(4-this._lenPos,r-t);for(;s--;)this._lenBuf[this._lenPos++]=e[t++];if(this._lenPos<4)return;if(this._len=this._instance.decryptLen(this._lenBuf,this.inSeqno),this._len>g||this._len<8||0!=(7&this._len))throw new Error("Bad packet length");if(t>=r)return}if(this._pktLen<this._len){const s=Math.min(this._len-this._pktLen,r-t);let n;if(n=0!==t||s!==r?new Uint8Array(e.buffer,e.byteOffset+t,s):e,s===this._len?this._packet=n:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(n,this._pktLen)),t+=s,this._pktLen+=s,this._pktLen<this._len||t>=r)return}{const s=Math.min(16-this._macPos,r-t);if(0!==t||s!==r?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+t,s),this._macPos):this._mac.set(e,this._macPos),t+=s,this._macPos+=s,this._macPos<16)return}this._instance.decrypt(this._packet,this._mac,this.inSeqno);const s=new u(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{const e=this._onPayload(s);if(void 0!==e)return!1===e?t:e}}}}class x{constructor(e){const t=e.inbound;this.inSeqno=t.seqno,this._onPayload=t.onPayload,this._decipherInstance=null,this._decipherSSLName=t.decipherInfo.sslName,this._decipherKey=t.decipherKey,this._decipherIV=t.decipherIV,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(e,t,r){for(;t<r;){if(this._lenBytes<4){let s=Math.min(4-this._lenBytes,r-t);for(this._lenBytes+=s;s--;)this._len=(this._len<<8)+e[t++];if(this._lenBytes<4)return;if(this._len+20>g||this._len<16||0!=(15&this._len))throw new Error("Bad packet length");this._decipherInstance=n(this._decipherSSLName,this._decipherKey,this._decipherIV),this._decipherInstance.setAutoPadding(!1),this._decipherInstance.setAAD(q(this._len))}if(this._pktLen<this._len){if(t>=r)return;const s=Math.min(this._len-this._pktLen,r-t);let n;if(n=0!==t||s!==r?this._decipherInstance.update(new Uint8Array(e.buffer,e.byteOffset+t,s)):this._decipherInstance.update(e),n.length&&(s===this._len?this._packet=n:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(n,this._packetPos)),this._packetPos+=n.length),t+=s,this._pktLen+=s,this._pktLen<this._len||t>=r)return}{const s=Math.min(16-this._tagPos,r-t);if(0!==t||s!==r?this._tag.set(new Uint8Array(e.buffer,e.byteOffset+t,s),this._tagPos):this._tag.set(e,this._tagPos),t+=s,this._tagPos+=s,this._tagPos<16)return}{this._decipherInstance.setAuthTag(this._tag);const e=this._decipherInstance.final();e.length&&(this._packet?this._packet.set(e,this._packetPos):this._packet=e)}const s=this._packet?new u(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):d;this.inSeqno=this.inSeqno+1>>>0,Q(this._decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tagPos=0;{const e=this._onPayload(s);if(void 0!==e)return!1===e?t:e}}}}class G{constructor(e){const t=e.inbound;this.inSeqno=t.seqno,this._onPayload=t.onPayload,this._instance=new y(t.decipherInfo.sslName,t.decipherKey,t.decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(e,t,r){for(;t<r;){if(this._lenBytes<4){let s=Math.min(4-this._lenBytes,r-t);for(this._lenBytes+=s;s--;)this._len=(this._len<<8)+e[t++];if(this._lenBytes<4)return;if(this._len+20>g||this._len<16||0!=(15&this._len))throw new Error(`Bad packet length: ${this._len}`)}if(this._pktLen<this._len){if(t>=r)return;const s=Math.min(this._len-this._pktLen,r-t);let n;if(n=0!==t||s!==r?new Uint8Array(e.buffer,e.byteOffset+t,s):e,s===this._len?this._packet=n:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(n,this._pktLen)),t+=s,this._pktLen+=s,this._pktLen<this._len||t>=r)return}{const s=Math.min(16-this._tagPos,r-t);if(0!==t||s!==r?this._tag.set(new Uint8Array(e.buffer,e.byteOffset+t,s),this._tagPos):this._tag.set(e,this._tagPos),t+=s,this._tagPos+=s,this._tagPos<16)return}this._instance.decrypt(this._packet,this._len,this._tag);const s=new u(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tagPos=0;{const e=this._onPayload(s);if(void 0!==e)return!1===e?t:e}}}}class M{constructor(e){const t=e.inbound;this.inSeqno=t.seqno,this._onPayload=t.onPayload,this._decipherInstance=n(t.decipherInfo.sslName,t.decipherKey,t.decipherIV),this._decipherInstance.setAutoPadding(!1),this._block=Buffer.allocUnsafe(t.macInfo.isETM?4:t.decipherInfo.blockLen),this._blockSize=t.decipherInfo.blockLen,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._mac=Buffer.allocUnsafe(t.macInfo.actualLen),this._macPos=0,this._macSSLName=t.macInfo.sslName,this._macKey=t.macKey,this._macActualLen=t.macInfo.actualLen,this._macETM=t.macInfo.isETM,this._macInstance=null;const r=t.decipherInfo.discardLen;if(r){let e=f.get(r);void 0===e&&(e=Buffer.alloc(r),f.set(r,e)),this._decipherInstance.update(e)}}free(){}decrypt(e,t,r){for(;t<r;){if(this._blockPos<this._block.length){const s=Math.min(this._block.length-this._blockPos,r-t);if(0!==t||s!==r||s<e.length?this._block.set(new Uint8Array(e.buffer,e.byteOffset+t,s),this._blockPos):this._block.set(e,this._blockPos),t+=s,this._blockPos+=s,this._blockPos<this._block.length)return;let n,o;if(this._macETM?this._len=o=c(this._block,0):(n=this._decipherInstance.update(this._block),this._len=c(n,0),o=4+this._len-this._blockSize),this._len>g||this._len<5||0!=(o&this._blockSize-1))throw new Error("Bad packet length");if(this._macInstance=i(this._macSSLName,this._macKey),l(p,this.inSeqno,0),this._macInstance.update(p),this._macETM?this._macInstance.update(this._block):(this._macInstance.update(new Uint8Array(n.buffer,n.byteOffset,4)),this._pktLen=n.length-4,this._packetPos=this._pktLen,this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(n.buffer,n.byteOffset+4,this._packetPos),0)),t>=r)return}if(this._pktLen<this._len){const s=Math.min(this._len-this._pktLen,r-t);let n;n=0!==t||s!==r?new Uint8Array(e.buffer,e.byteOffset+t,s):e,this._macETM&&this._macInstance.update(n);const i=this._decipherInstance.update(n);if(i.length&&(s===this._len?this._packet=i:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(i,this._packetPos)),this._packetPos+=i.length),t+=s,this._pktLen+=s,this._pktLen<this._len||t>=r)return}{const s=Math.min(this._macActualLen-this._macPos,r-t);if(0!==t||s!==r?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+t,s),this._macPos):this._mac.set(e,this._macPos),t+=s,this._macPos+=s,this._macPos<this._macActualLen)return}this._macETM||this._macInstance.update(this._packet);let o=this._macInstance.digest();if(this._macActualLen<o.length&&(o=new Uint8Array(o.buffer,o.byteOffset,this._macActualLen)),s=o,n=this._mac,!(s.length!==n.length?(a(s,s),0):a(s,n)))throw new Error("Invalid MAC");const h=new u(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._macPos=0,this._macInstance=null;{const e=this._onPayload(h);if(void 0!==e)return!1===e?t:e}}var s,n}}class H{constructor(e){const t=e.inbound;this.inSeqno=t.seqno,this._onPayload=t.onPayload,this._instance=new w(t.decipherInfo.sslName,t.decipherKey,t.decipherIV,t.macInfo.sslName,t.macKey,t.macInfo.isETM,t.macInfo.actualLen),this._block=Buffer.allocUnsafe(t.macInfo.isETM||t.decipherInfo.stream?4:t.decipherInfo.blockLen),this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(t.macInfo.actualLen),this._macPos=0,this._macActualLen=t.macInfo.actualLen,this._macETM=t.macInfo.isETM}free(){this._instance.free()}decrypt(e,t,r){for(;t<r;){if(this._blockPos<this._block.length){const s=Math.min(this._block.length-this._blockPos,r-t);if(0!==t||s!==r||s<e.length?this._block.set(new Uint8Array(e.buffer,e.byteOffset+t,s),this._blockPos):this._block.set(e,this._blockPos),t+=s,this._blockPos+=s,this._blockPos<this._block.length)return;let n;if(this._macETM?this._len=n=c(this._block,0):(this._instance.decryptBlock(this._block),this._len=c(this._block,0),n=4+this._len-this._block.length),this._len>g||this._len<5||0!=(n&this._block.length-1))throw new Error("Bad packet length");if(this._macETM||(this._pktLen=this._block.length-4,this._pktLen&&(this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(this._block.buffer,this._block.byteOffset+4,this._pktLen),0))),t>=r)return}if(this._pktLen<this._len){const s=Math.min(this._len-this._pktLen,r-t);let n;if(n=0!==t||s!==r?new Uint8Array(e.buffer,e.byteOffset+t,s):e,s===this._len?this._packet=n:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(n,this._pktLen)),t+=s,this._pktLen+=s,this._pktLen<this._len||t>=r)return}{const s=Math.min(this._macActualLen-this._macPos,r-t);if(0!==t||s!==r?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+t,s),this._macPos):this._mac.set(e,this._macPos),t+=s,this._macPos+=s,this._macPos<this._macActualLen)return}this._instance.decrypt(this._packet,this.inSeqno,this._block,this._mac);const s=new u(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._macPos=0,this._macInstance=null;{const e=this._onPayload(s);if(void 0!==e)return!1===e?t:e}}}}function Q(e){++e[11]>>>8&&++e[10]>>>8&&++e[9]>>>8&&++e[8]>>>8&&++e[7]>>>8&&++e[6]>>>8&&++e[5]>>>8&&++e[4]}const q=(()=>{const e=Buffer.alloc(4);return t=>(e[0]=t>>>24,e[1]=t>>>16,e[2]=t>>>8,e[3]=t,e)})();e.exports={CIPHER_INFO:v,MAC_INFO:S,bindingAvailable:!!m,init:new Promise((async(e,t)=>{try{T=await r(9449)(),C=T._malloc(16),O=T.cwrap("poly1305_auth",null,["number","array","number","array","number","array"])}catch(e){return t(e)}e()})),NullCipher:class{constructor(e,t){this.outSeqno=e,this._onWrite=t,this._dead=!1}free(){this._dead=!0}allocPacket(e){let t=5+e,r=8-(7&t);r<4&&(r+=8),t+=r;const s=Buffer.allocUnsafe(t);return l(s,t-4,0),s[4]=r,o(s,5+e,r),s}encrypt(e){this._dead||(this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},createCipher:function(e){if("object"!=typeof e||null===e)throw new Error("Invalid config");if("object"!=typeof e.outbound||null===e.outbound)throw new Error("Invalid outbound");const t=e.outbound;if("function"!=typeof t.onWrite)throw new Error("Invalid outbound.onWrite");if("object"!=typeof t.cipherInfo||null===t.cipherInfo)throw new Error("Invalid outbound.cipherInfo");if(!Buffer.isBuffer(t.cipherKey)||t.cipherKey.length!==t.cipherInfo.keyLen)throw new Error("Invalid outbound.cipherKey");if(t.cipherInfo.ivLen&&(!Buffer.isBuffer(t.cipherIV)||t.cipherIV.length!==t.cipherInfo.ivLen))throw new Error("Invalid outbound.cipherIV");if("number"!=typeof t.seqno||t.seqno<0||t.seqno>h)throw new Error("Invalid outbound.seqno");const r=!!t.forceNative;switch(t.cipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return _&&!r?new N(e):new P(e);case"chacha20":return A&&!r?new B(e):new R(e);default:if("object"!=typeof t.macInfo||null===t.macInfo)throw new Error("Invalid outbound.macInfo");if(!Buffer.isBuffer(t.macKey)||t.macKey.length!==t.macInfo.len)throw new Error("Invalid outbound.macKey");return E&&!r?new U(e):new L(e)}},NullDecipher:class{constructor(e,t){this.inSeqno=e,this._onPayload=t,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0}free(){}decrypt(e,t,r){for(;t<r;){if(this._lenBytes<4){let s=Math.min(4-this._lenBytes,r-t);for(this._lenBytes+=s;s--;)this._len=(this._len<<8)+e[t++];if(this._lenBytes<4)return;if(this._len>g||this._len<8||0!=(4+this._len&7))throw new Error("Bad packet length");if(t>=r)return}if(this._packetPos<this._len){const s=Math.min(this._len-this._packetPos,r-t);let n;if(n=0!==t||s!==r?new Uint8Array(e.buffer,e.byteOffset+t,s):e,s===this._len?this._packet=n:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(n,this._packetPos)),t+=s,this._packetPos+=s,this._packetPos<this._len)return}const s=this._packet?new u(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):d;this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0;{const e=this._onPayload(s);if(void 0!==e)return!1===e?t:e}}}},createDecipher:function(e){if("object"!=typeof e||null===e)throw new Error("Invalid config");if("object"!=typeof e.inbound||null===e.inbound)throw new Error("Invalid inbound");const t=e.inbound;if("function"!=typeof t.onPayload)throw new Error("Invalid inbound.onPayload");if("object"!=typeof t.decipherInfo||null===t.decipherInfo)throw new Error("Invalid inbound.decipherInfo");if(!Buffer.isBuffer(t.decipherKey)||t.decipherKey.length!==t.decipherInfo.keyLen)throw new Error("Invalid inbound.decipherKey");if(t.decipherInfo.ivLen&&(!Buffer.isBuffer(t.decipherIV)||t.decipherIV.length!==t.decipherInfo.ivLen))throw new Error("Invalid inbound.decipherIV");if("number"!=typeof t.seqno||t.seqno<0||t.seqno>h)throw new Error("Invalid inbound.seqno");const r=!!t.forceNative;switch(t.decipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return y&&!r?new G(e):new x(e);case"chacha20":return b&&!r?new F(e):new D(e);default:if("object"!=typeof t.macInfo||null===t.macInfo)throw new Error("Invalid inbound.macInfo");if(!Buffer.isBuffer(t.macKey)||t.macKey.length!==t.macInfo.len)throw new Error("Invalid inbound.macKey");return w&&!r?new H(e):new M(e)}}}},9449:(e,t,r)=>{var s,n=(s=(s="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e){var t,n,i;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise((function(e,t){n=e,i=t}));var o,a={};for(o in t)t.hasOwnProperty(o)&&(a[o]=t[o]);var c,l,u,h,d,p="object"==typeof window,f="function"==typeof importScripts,g="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";g?(m=f?r(1017).dirname(m)+"/":__dirname+"/",c=function(e,t){var s=$(e);return s?t?s:s.toString():(h||(h=r(7147)),d||(d=r(1017)),e=d.normalize(e),h.readFileSync(e,t?null:"utf8"))},u=function(e){return(e=c(e,!0)).buffer||(e=new Uint8Array(e)),b(e.buffer),e},l=function(e,t,s){var n=$(e);n&&t(n),h||(h=r(7147)),d||(d=r(1017)),e=d.normalize(e),h.readFile(e,(function(e,r){e?s(e):t(r.buffer)}))},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.inspect=function(){return"[Emscripten Module object]"}):(p||f)&&(f?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),s&&(m=s),m=0!==m.indexOf("blob:")?m.substr(0,m.lastIndexOf("/")+1):"",c=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(n){if(e=$(e)){t=[];for(var r=0;r<e.length;r++){var s=e[r];255<s&&(Q&&b(!1,"Character code "+s+" ("+String.fromCharCode(s)+")  at offset "+r+" not in 0x00-0xFF."),s&=255),t.push(String.fromCharCode(s))}return t.join("")}throw n}},f&&(u=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){if(e=$(e))return e;throw t}}),l=function(e,t,r){var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=function(){if(200==s.status||0==s.status&&s.response)t(s.response);else{var n=$(e);n?t(n.buffer):r()}},s.onerror=r,s.send(null)}),t.print||console.log.bind(console);var _,A=t.printErr||console.warn.bind(console);for(o in a)a.hasOwnProperty(o)&&(t[o]=a[o]);a=null,t.wasmBinary&&(_=t.wasmBinary),t.noExitRuntime,"object"!=typeof WebAssembly&&D("no native wasm support detected");var E,y=!1;function b(e,t){e||D("Assertion failed: "+t)}function w(e){var r=t["_"+e];return b(r,"Cannot call unknown function "+e+", make sure it is exported"),r}var v,S,k,I="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function T(){var e=E.buffer;v=e,t.HEAP8=S=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=new Int32Array(e),t.HEAPU8=k=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}var C,O=[],R=[],B=[];function P(){var e=t.preRun.shift();O.unshift(e)}var N=0,L=null,U=null;function D(e){throw t.onAbort&&t.onAbort(e),A(e),y=!0,e=new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info."),i(e),e}t.preloadedImages={},t.preloadedAudios={};var F,x="data:application/octet-stream;base64,";if(!(F="data:application/octet-stream;base64,AGFzbQEAAAABIAZgAX8Bf2ADf39/AGABfwBgAABgAAF/YAZ/f39/f38AAgcBAWEBYQAAAwsKAAEDAQAAAgQFAgQFAXABAQEFBwEBgAKAgAIGCQF/AUGAjMACCwclCQFiAgABYwADAWQACQFlAAgBZgAHAWcABgFoAAUBaQAKAWoBAAqGTQpPAQJ/QYAIKAIAIgEgAEEDakF8cSICaiEAAkAgAkEAIAAgAU0bDQAgAD8AQRB0SwRAIAAQAEUNAQtBgAggADYCACABDwtBhAhBMDYCAEF/C4wFAg5+Cn8gACgCJCEUIAAoAiAhFSAAKAIcIREgACgCGCESIAAoAhQhEyACQRBPBEAgAC0ATEVBGHQhFyAAKAIEIhZBBWytIQ8gACgCCCIYQQVsrSENIAAoAgwiGUEFbK0hCyAAKAIQIhpBBWytIQkgADUCACEIIBqtIRAgGa0hDiAYrSEMIBatIQoDQCASIAEtAAMiEiABLQAEQQh0ciABLQAFQRB0ciABLQAGIhZBGHRyQQJ2Qf///x9xaq0iAyAOfiABLwAAIAEtAAJBEHRyIBNqIBJBGHRBgICAGHFqrSIEIBB+fCARIAEtAAdBCHQgFnIgAS0ACEEQdHIgAS0ACSIRQRh0ckEEdkH///8fcWqtIgUgDH58IAEtAApBCHQgEXIgAS0AC0EQdHIgAS0ADEEYdHJBBnYgFWqtIgYgCn58IBQgF2ogAS8ADSABLQAPQRB0cmqtIgcgCH58IAMgDH4gBCAOfnwgBSAKfnwgBiAIfnwgByAJfnwgAyAKfiAEIAx+fCAFIAh+fCAGIAl+fCAHIAt+fCADIAh+IAQgCn58IAUgCX58IAYgC358IAcgDX58IAMgCX4gBCAIfnwgBSALfnwgBiANfnwgByAPfnwiA0IaiEL/////D4N8IgRCGohC/////w+DfCIFQhqIQv////8Pg3wiBkIaiEL/////D4N8IgdCGoinQQVsIAOnQf///x9xaiITQRp2IASnQf///x9xaiESIAWnQf///x9xIREgBqdB////H3EhFSAHp0H///8fcSEUIBNB////H3EhEyABQRBqIQEgAkEQayICQQ9LDQALCyAAIBQ2AiQgACAVNgIgIAAgETYCHCAAIBI2AhggACATNgIUCwMAAQu2BAEGfwJAIAAoAjgiBARAIABBPGohBQJAIAJBECAEayIDIAIgA0kbIgZFDQAgBkEDcSEHAkAgBkEBa0EDSQRAQQAhAwwBCyAGQXxxIQhBACEDA0AgBSADIARqaiABIANqLQAAOgAAIAUgA0EBciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0ECciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0EDciIEIAAoAjhqaiABIARqLQAAOgAAIANBBGohAyAAKAI4IQQgCEEEayIIDQALCyAHRQ0AA0AgBSADIARqaiABIANqLQAAOgAAIANBAWohAyAAKAI4IQQgB0EBayIHDQALCyAAIAQgBmoiAzYCOCADQRBJDQEgACAFQRAQAiAAQQA2AjggAiAGayECIAEgBmohAQsgAkEQTwRAIAAgASACQXBxIgMQAiACQQ9xIQIgASADaiEBCyACRQ0AIAJBA3EhBCAAQTxqIQVBACEDIAJBAWtBA08EQCACQXxxIQcDQCAFIAAoAjggA2pqIAEgA2otAAA6AAAgBSADQQFyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQJyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQNyIgYgACgCOGpqIAEgBmotAAA6AAAgA0EEaiEDIAdBBGsiBw0ACwsgBARAA0AgBSAAKAI4IANqaiABIANqLQAAOgAAIANBAWohAyAEQQFrIgQNAAsLIAAgACgCOCACajYCOAsLoS0BDH8jAEEQayIMJAACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEH0AU0EQEGICCgCACIFQRAgAEELakF4cSAAQQtJGyIIQQN2IgJ2IgFBA3EEQCABQX9zQQFxIAJqIgNBA3QiAUG4CGooAgAiBEEIaiEAAkAgBCgCCCICIAFBsAhqIgFGBEBBiAggBUF+IAN3cTYCAAwBCyACIAE2AgwgASACNgIICyAEIANBA3QiAUEDcjYCBCABIARqIgEgASgCBEEBcjYCBAwNCyAIQZAIKAIAIgpNDQEgAQRAAkBBAiACdCIAQQAgAGtyIAEgAnRxIgBBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2aiIDQQN0IgBBuAhqKAIAIgQoAggiASAAQbAIaiIARgRAQYgIIAVBfiADd3EiBTYCAAwBCyABIAA2AgwgACABNgIICyAEQQhqIQAgBCAIQQNyNgIEIAQgCGoiAiADQQN0IgEgCGsiA0EBcjYCBCABIARqIAM2AgAgCgRAIApBA3YiAUEDdEGwCGohB0GcCCgCACEEAn8gBUEBIAF0IgFxRQRAQYgIIAEgBXI2AgAgBwwBCyAHKAIICyEBIAcgBDYCCCABIAQ2AgwgBCAHNgIMIAQgATYCCAtBnAggAjYCAEGQCCADNgIADA0LQYwIKAIAIgZFDQEgBkEAIAZrcUEBayIAIABBDHZBEHEiAnYiAUEFdkEIcSIAIAJyIAEgAHYiAUECdkEEcSIAciABIAB2IgFBAXZBAnEiAHIgASAAdiIBQQF2QQFxIgByIAEgAHZqQQJ0QbgKaigCACIBKAIEQXhxIAhrIQMgASECA0ACQCACKAIQIgBFBEAgAigCFCIARQ0BCyAAKAIEQXhxIAhrIgIgAyACIANJIgIbIQMgACABIAIbIQEgACECDAELCyABIAhqIgkgAU0NAiABKAIYIQsgASABKAIMIgRHBEAgASgCCCIAQZgIKAIASRogACAENgIMIAQgADYCCAwMCyABQRRqIgIoAgAiAEUEQCABKAIQIgBFDQQgAUEQaiECCwNAIAIhByAAIgRBFGoiAigCACIADQAgBEEQaiECIAQoAhAiAA0ACyAHQQA2AgAMCwtBfyEIIABBv39LDQAgAEELaiIAQXhxIQhBjAgoAgAiCUUNAEEAIAhrIQMCQAJAAkACf0EAIAhBgAJJDQAaQR8gCEH///8HSw0AGiAAQQh2IgAgAEGA/j9qQRB2QQhxIgJ0IgAgAEGA4B9qQRB2QQRxIgF0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAEgAnIgAHJrIgBBAXQgCCAAQRVqdkEBcXJBHGoLIgVBAnRBuApqKAIAIgJFBEBBACEADAELQQAhACAIQQBBGSAFQQF2ayAFQR9GG3QhAQNAAkAgAigCBEF4cSAIayIHIANPDQAgAiEEIAciAw0AQQAhAyACIQAMAwsgACACKAIUIgcgByACIAFBHXZBBHFqKAIQIgJGGyAAIAcbIQAgAUEBdCEBIAINAAsLIAAgBHJFBEBBACEEQQIgBXQiAEEAIABrciAJcSIARQ0DIABBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2akECdEG4CmooAgAhAAsgAEUNAQsDQCAAKAIEQXhxIAhrIgEgA0khAiABIAMgAhshAyAAIAQgAhshBCAAKAIQIgEEfyABBSAAKAIUCyIADQALCyAERQ0AIANBkAgoAgAgCGtPDQAgBCAIaiIGIARNDQEgBCgCGCEFIAQgBCgCDCIBRwRAIAQoAggiAEGYCCgCAEkaIAAgATYCDCABIAA2AggMCgsgBEEUaiICKAIAIgBFBEAgBCgCECIARQ0EIARBEGohAgsDQCACIQcgACIBQRRqIgIoAgAiAA0AIAFBEGohAiABKAIQIgANAAsgB0EANgIADAkLIAhBkAgoAgAiAk0EQEGcCCgCACEDAkAgAiAIayIBQRBPBEBBkAggATYCAEGcCCADIAhqIgA2AgAgACABQQFyNgIEIAIgA2ogATYCACADIAhBA3I2AgQMAQtBnAhBADYCAEGQCEEANgIAIAMgAkEDcjYCBCACIANqIgAgACgCBEEBcjYCBAsgA0EIaiEADAsLIAhBlAgoAgAiBkkEQEGUCCAGIAhrIgE2AgBBoAhBoAgoAgAiAiAIaiIANgIAIAAgAUEBcjYCBCACIAhBA3I2AgQgAkEIaiEADAsLQQAhACAIQS9qIgkCf0HgCygCAARAQegLKAIADAELQewLQn83AgBB5AtCgKCAgICABDcCAEHgCyAMQQxqQXBxQdiq1aoFczYCAEH0C0EANgIAQcQLQQA2AgBBgCALIgFqIgVBACABayIHcSICIAhNDQpBwAsoAgAiBARAQbgLKAIAIgMgAmoiASADTQ0LIAEgBEsNCwtBxAstAABBBHENBQJAAkBBoAgoAgAiAwRAQcgLIQADQCADIAAoAgAiAU8EQCABIAAoAgRqIANLDQMLIAAoAggiAA0ACwtBABABIgFBf0YNBiACIQVB5AsoAgAiA0EBayIAIAFxBEAgAiABayAAIAFqQQAgA2txaiEFCyAFIAhNDQYgBUH+////B0sNBkHACygCACIEBEBBuAsoAgAiAyAFaiIAIANNDQcgACAESw0HCyAFEAEiACABRw0BDAgLIAUgBmsgB3EiBUH+////B0sNBSAFEAEiASAAKAIAIAAoAgRqRg0EIAEhAAsCQCAAQX9GDQAgCEEwaiAFTQ0AQegLKAIAIgEgCSAFa2pBACABa3EiAUH+////B0sEQCAAIQEMCAsgARABQX9HBEAgASAFaiEFIAAhAQwIC0EAIAVrEAEaDAULIAAiAUF/Rw0GDAQLAAtBACEEDAcLQQAhAQwFCyABQX9HDQILQcQLQcQLKAIAQQRyNgIACyACQf7///8HSw0BIAIQASEBQQAQASEAIAFBf0YNASAAQX9GDQEgACABTQ0BIAAgAWsiBSAIQShqTQ0BC0G4C0G4CygCACAFaiIANgIAQbwLKAIAIABJBEBBvAsgADYCAAsCQAJAAkBBoAgoAgAiBwRAQcgLIQADQCABIAAoAgAiAyAAKAIEIgJqRg0CIAAoAggiAA0ACwwCC0GYCCgCACIAQQAgACABTRtFBEBBmAggATYCAAtBACEAQcwLIAU2AgBByAsgATYCAEGoCEF/NgIAQawIQeALKAIANgIAQdQLQQA2AgADQCAAQQN0IgNBuAhqIANBsAhqIgI2AgAgA0G8CGogAjYCACAAQQFqIgBBIEcNAAtBlAggBUEoayIDQXggAWtBB3FBACABQQhqQQdxGyIAayICNgIAQaAIIAAgAWoiADYCACAAIAJBAXI2AgQgASADakEoNgIEQaQIQfALKAIANgIADAILIAAtAAxBCHENACADIAdLDQAgASAHTQ0AIAAgAiAFajYCBEGgCCAHQXggB2tBB3FBACAHQQhqQQdxGyIAaiICNgIAQZQIQZQIKAIAIAVqIgEgAGsiADYCACACIABBAXI2AgQgASAHakEoNgIEQaQIQfALKAIANgIADAELQZgIKAIAIAFLBEBBmAggATYCAAsgASAFaiECQcgLIQACQAJAAkACQAJAAkADQCACIAAoAgBHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQELQcgLIQADQCAHIAAoAgAiAk8EQCACIAAoAgRqIgQgB0sNAwsgACgCCCEADAALAAsgACABNgIAIAAgACgCBCAFajYCBCABQXggAWtBB3FBACABQQhqQQdxG2oiCSAIQQNyNgIEIAJBeCACa0EHcUEAIAJBCGpBB3EbaiIFIAggCWoiBmshAiAFIAdGBEBBoAggBjYCAEGUCEGUCCgCACACaiIANgIAIAYgAEEBcjYCBAwDCyAFQZwIKAIARgRAQZwIIAY2AgBBkAhBkAgoAgAgAmoiADYCACAGIABBAXI2AgQgACAGaiAANgIADAMLIAUoAgQiAEEDcUEBRgRAIABBeHEhBwJAIABB/wFNBEAgBSgCCCIDIABBA3YiAEEDdEGwCGpGGiADIAUoAgwiAUYEQEGICEGICCgCAEF+IAB3cTYCAAwCCyADIAE2AgwgASADNgIIDAELIAUoAhghCAJAIAUgBSgCDCIBRwRAIAUoAggiACABNgIMIAEgADYCCAwBCwJAIAVBFGoiACgCACIDDQAgBUEQaiIAKAIAIgMNAEEAIQEMAQsDQCAAIQQgAyIBQRRqIgAoAgAiAw0AIAFBEGohACABKAIQIgMNAAsgBEEANgIACyAIRQ0AAkAgBSAFKAIcIgNBAnRBuApqIgAoAgBGBEAgACABNgIAIAENAUGMCEGMCCgCAEF+IAN3cTYCAAwCCyAIQRBBFCAIKAIQIAVGG2ogATYCACABRQ0BCyABIAg2AhggBSgCECIABEAgASAANgIQIAAgATYCGAsgBSgCFCIARQ0AIAEgADYCFCAAIAE2AhgLIAUgB2ohBSACIAdqIQILIAUgBSgCBEF+cTYCBCAGIAJBAXI2AgQgAiAGaiACNgIAIAJB/wFNBEAgAkEDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwDC0EfIQAgAkH///8HTQRAIAJBCHYiACAAQYD+P2pBEHZBCHEiA3QiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASADciAAcmsiAEEBdCACIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQQCQEGMCCgCACIDQQEgAHQiAXFFBEBBjAggASADcjYCACAEIAY2AgAgBiAENgIYDAELIAJBAEEZIABBAXZrIABBH0YbdCEAIAQoAgAhAQNAIAEiAygCBEF4cSACRg0DIABBHXYhASAAQQF0IQAgAyABQQRxaiIEKAIQIgENAAsgBCAGNgIQIAYgAzYCGAsgBiAGNgIMIAYgBjYCCAwCC0GUCCAFQShrIgNBeCABa0EHcUEAIAFBCGpBB3EbIgBrIgI2AgBBoAggACABaiIANgIAIAAgAkEBcjYCBCABIANqQSg2AgRBpAhB8AsoAgA2AgAgByAEQScgBGtBB3FBACAEQSdrQQdxG2pBL2siACAAIAdBEGpJGyICQRs2AgQgAkHQCykCADcCECACQcgLKQIANwIIQdALIAJBCGo2AgBBzAsgBTYCAEHICyABNgIAQdQLQQA2AgAgAkEYaiEAA0AgAEEHNgIEIABBCGohASAAQQRqIQAgASAESQ0ACyACIAdGDQMgAiACKAIEQX5xNgIEIAcgAiAHayIEQQFyNgIEIAIgBDYCACAEQf8BTQRAIARBA3YiAEEDdEGwCGohAgJ/QYgIKAIAIgFBASAAdCIAcUUEQEGICCAAIAFyNgIAIAIMAQsgAigCCAshACACIAc2AgggACAHNgIMIAcgAjYCDCAHIAA2AggMBAtBHyEAIAdCADcCECAEQf///wdNBEAgBEEIdiIAIABBgP4/akEQdkEIcSICdCIAIABBgOAfakEQdkEEcSIBdCIAIABBgIAPakEQdkECcSIAdEEPdiABIAJyIAByayIAQQF0IAQgAEEVanZBAXFyQRxqIQALIAcgADYCHCAAQQJ0QbgKaiEDAkBBjAgoAgAiAkEBIAB0IgFxRQRAQYwIIAEgAnI2AgAgAyAHNgIAIAcgAzYCGAwBCyAEQQBBGSAAQQF2ayAAQR9GG3QhACADKAIAIQEDQCABIgIoAgRBeHEgBEYNBCAAQR12IQEgAEEBdCEAIAIgAUEEcWoiAygCECIBDQALIAMgBzYCECAHIAI2AhgLIAcgBzYCDCAHIAc2AggMAwsgAygCCCIAIAY2AgwgAyAGNgIIIAZBADYCGCAGIAM2AgwgBiAANgIICyAJQQhqIQAMBQsgAigCCCIAIAc2AgwgAiAHNgIIIAdBADYCGCAHIAI2AgwgByAANgIIC0GUCCgCACIAIAhNDQBBlAggACAIayIBNgIAQaAIQaAIKAIAIgIgCGoiADYCACAAIAFBAXI2AgQgAiAIQQNyNgIEIAJBCGohAAwDC0GECEEwNgIAQQAhAAwCCwJAIAVFDQACQCAEKAIcIgJBAnRBuApqIgAoAgAgBEYEQCAAIAE2AgAgAQ0BQYwIIAlBfiACd3EiCTYCAAwCCyAFQRBBFCAFKAIQIARGG2ogATYCACABRQ0BCyABIAU2AhggBCgCECIABEAgASAANgIQIAAgATYCGAsgBCgCFCIARQ0AIAEgADYCFCAAIAE2AhgLAkAgA0EPTQRAIAQgAyAIaiIAQQNyNgIEIAAgBGoiACAAKAIEQQFyNgIEDAELIAQgCEEDcjYCBCAGIANBAXI2AgQgAyAGaiADNgIAIANB/wFNBEAgA0EDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwBC0EfIQAgA0H///8HTQRAIANBCHYiACAAQYD+P2pBEHZBCHEiAnQiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASACciAAcmsiAEEBdCADIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQICQAJAIAlBASAAdCIBcUUEQEGMCCABIAlyNgIAIAIgBjYCACAGIAI2AhgMAQsgA0EAQRkgAEEBdmsgAEEfRht0IQAgAigCACEIA0AgCCIBKAIEQXhxIANGDQIgAEEddiECIABBAXQhACABIAJBBHFqIgIoAhAiCA0ACyACIAY2AhAgBiABNgIYCyAGIAY2AgwgBiAGNgIIDAELIAEoAggiACAGNgIMIAEgBjYCCCAGQQA2AhggBiABNgIMIAYgADYCCAsgBEEIaiEADAELAkAgC0UNAAJAIAEoAhwiAkECdEG4CmoiACgCACABRgRAIAAgBDYCACAEDQFBjAggBkF+IAJ3cTYCAAwCCyALQRBBFCALKAIQIAFGG2ogBDYCACAERQ0BCyAEIAs2AhggASgCECIABEAgBCAANgIQIAAgBDYCGAsgASgCFCIARQ0AIAQgADYCFCAAIAQ2AhgLAkAgA0EPTQRAIAEgAyAIaiIAQQNyNgIEIAAgAWoiACAAKAIEQQFyNgIEDAELIAEgCEEDcjYCBCAJIANBAXI2AgQgAyAJaiADNgIAIAoEQCAKQQN2IgBBA3RBsAhqIQRBnAgoAgAhAgJ/QQEgAHQiACAFcUUEQEGICCAAIAVyNgIAIAQMAQsgBCgCCAshACAEIAI2AgggACACNgIMIAIgBDYCDCACIAA2AggLQZwIIAk2AgBBkAggAzYCAAsgAUEIaiEACyAMQRBqJAAgAAsQACMAIABrQXBxIgAkACAACwYAIAAkAAsEACMAC4AJAgh/BH4jAEGQAWsiBiQAIAYgBS0AA0EYdEGAgIAYcSAFLwAAIAUtAAJBEHRycjYCACAGIAUoAANBAnZBg/7/H3E2AgQgBiAFKAAGQQR2Qf+B/x9xNgIIIAYgBSgACUEGdkH//8AfcTYCDCAFLwANIQggBS0ADyEJIAZCADcCFCAGQgA3AhwgBkEANgIkIAYgCCAJQRB0QYCAPHFyNgIQIAYgBSgAEDYCKCAGIAUoABQ2AiwgBiAFKAAYNgIwIAUoABwhBSAGQQA6AEwgBkEANgI4IAYgBTYCNCAGIAEgAhAEIAQEQCAGIAMgBBAECyAGKAI4IgEEQCAGQTxqIgIgAWpBAToAACABQQFqQQ9NBEAgASAGakE9aiEEAkBBDyABayIDRQ0AIAMgBGoiAUEBa0EAOgAAIARBADoAACADQQNJDQAgAUECa0EAOgAAIARBADoAASABQQNrQQA6AAAgBEEAOgACIANBB0kNACABQQRrQQA6AAAgBEEAOgADIANBCUkNACAEQQAgBGtBA3EiAWoiBEEANgIAIAQgAyABa0F8cSIBaiIDQQRrQQA2AgAgAUEJSQ0AIARBADYCCCAEQQA2AgQgA0EIa0EANgIAIANBDGtBADYCACABQRlJDQAgBEEANgIYIARBADYCFCAEQQA2AhAgBEEANgIMIANBEGtBADYCACADQRRrQQA2AgAgA0EYa0EANgIAIANBHGtBADYCACABIARBBHFBGHIiAWsiA0EgSQ0AIAEgBGohAQNAIAFCADcDGCABQgA3AxAgAUIANwMIIAFCADcDACABQSBqIQEgA0EgayIDQR9LDQALCwsgBkEBOgBMIAYgAkEQEAILIAY1AjQhECAGNQIwIREgBjUCLCEOIAAgBjUCKCAGKAIkIAYoAiAgBigCHCAGKAIYIgNBGnZqIgJBGnZqIgFBGnZqIgtBgICAYHIgAUH///8fcSINIAJB////H3EiCCAGKAIUIAtBGnZBBWxqIgFB////H3EiCUEFaiIFQRp2IANB////H3EgAUEadmoiA2oiAUEadmoiAkEadmoiBEEadmoiDEEfdSIHIANxIAEgDEEfdkEBayIDQf///x9xIgpxciIBQRp0IAUgCnEgByAJcXJyrXwiDzwAACAAIA9CGIg8AAMgACAPQhCIPAACIAAgD0IIiDwAASAAIA4gByAIcSACIApxciICQRR0IAFBBnZyrXwgD0IgiHwiDjwABCAAIA5CGIg8AAcgACAOQhCIPAAGIAAgDkIIiDwABSAAIBEgByANcSAEIApxciIBQQ50IAJBDHZyrXwgDkIgiHwiDjwACCAAIA5CGIg8AAsgACAOQhCIPAAKIAAgDkIIiDwACSAAIBAgAyAMcSAHIAtxckEIdCABQRJ2cq18IA5CIIh8Ig48AAwgACAOQhiIPAAPIAAgDkIQiDwADiAAIA5CCIg8AA0gBkIANwIwIAZCADcCKCAGQgA3AiAgBkIANwIYIAZCADcCECAGQgA3AgggBkIANwIAIAZBkAFqJAALpwwBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAMgAygCACIBayIDQZgIKAIASQ0BIAAgAWohACADQZwIKAIARwRAIAFB/wFNBEAgAygCCCICIAFBA3YiBEEDdEGwCGpGGiACIAMoAgwiAUYEQEGICEGICCgCAEF+IAR3cTYCAAwDCyACIAE2AgwgASACNgIIDAILIAMoAhghBgJAIAMgAygCDCIBRwRAIAMoAggiAiABNgIMIAEgAjYCCAwBCwJAIANBFGoiAigCACIEDQAgA0EQaiICKAIAIgQNAEEAIQEMAQsDQCACIQcgBCIBQRRqIgIoAgAiBA0AIAFBEGohAiABKAIQIgQNAAsgB0EANgIACyAGRQ0BAkAgAyADKAIcIgJBAnRBuApqIgQoAgBGBEAgBCABNgIAIAENAUGMCEGMCCgCAEF+IAJ3cTYCAAwDCyAGQRBBFCAGKAIQIANGG2ogATYCACABRQ0CCyABIAY2AhggAygCECICBEAgASACNgIQIAIgATYCGAsgAygCFCICRQ0BIAEgAjYCFCACIAE2AhgMAQsgBSgCBCIBQQNxQQNHDQBBkAggADYCACAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAA8LIAMgBU8NACAFKAIEIgFBAXFFDQACQCABQQJxRQRAIAVBoAgoAgBGBEBBoAggAzYCAEGUCEGUCCgCACAAaiIANgIAIAMgAEEBcjYCBCADQZwIKAIARw0DQZAIQQA2AgBBnAhBADYCAA8LIAVBnAgoAgBGBEBBnAggAzYCAEGQCEGQCCgCACAAaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAPCyABQXhxIABqIQACQCABQf8BTQRAIAUoAggiAiABQQN2IgRBA3RBsAhqRhogAiAFKAIMIgFGBEBBiAhBiAgoAgBBfiAEd3E2AgAMAgsgAiABNgIMIAEgAjYCCAwBCyAFKAIYIQYCQCAFIAUoAgwiAUcEQCAFKAIIIgJBmAgoAgBJGiACIAE2AgwgASACNgIIDAELAkAgBUEUaiICKAIAIgQNACAFQRBqIgIoAgAiBA0AQQAhAQwBCwNAIAIhByAEIgFBFGoiAigCACIEDQAgAUEQaiECIAEoAhAiBA0ACyAHQQA2AgALIAZFDQACQCAFIAUoAhwiAkECdEG4CmoiBCgCAEYEQCAEIAE2AgAgAQ0BQYwIQYwIKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiABNgIAIAFFDQELIAEgBjYCGCAFKAIQIgIEQCABIAI2AhAgAiABNgIYCyAFKAIUIgJFDQAgASACNgIUIAIgATYCGAsgAyAAQQFyNgIEIAAgA2ogADYCACADQZwIKAIARw0BQZAIIAA2AgAPCyAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAAsgAEH/AU0EQCAAQQN2IgFBA3RBsAhqIQACf0GICCgCACICQQEgAXQiAXFFBEBBiAggASACcjYCACAADAELIAAoAggLIQIgACADNgIIIAIgAzYCDCADIAA2AgwgAyACNgIIDwtBHyECIANCADcCECAAQf///wdNBEAgAEEIdiIBIAFBgP4/akEQdkEIcSIBdCICIAJBgOAfakEQdkEEcSICdCIEIARBgIAPakEQdkECcSIEdEEPdiABIAJyIARyayIBQQF0IAAgAUEVanZBAXFyQRxqIQILIAMgAjYCHCACQQJ0QbgKaiEBAkACQAJAQYwIKAIAIgRBASACdCIHcUUEQEGMCCAEIAdyNgIAIAEgAzYCACADIAE2AhgMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgASgCACEBA0AgASIEKAIEQXhxIABGDQIgAkEddiEBIAJBAXQhAiAEIAFBBHFqIgdBEGooAgAiAQ0ACyAHIAM2AhAgAyAENgIYCyADIAM2AgwgAyADNgIIDAELIAQoAggiACADNgIMIAQgAzYCCCADQQA2AhggAyAENgIMIAMgADYCCAtBqAhBqAgoAgBBAWsiAEF/IAAbNgIACwsLCQEAQYEICwIGUA==").startsWith(x)){var G=F;F=t.locateFile?t.locateFile(G,m):m+G}function M(){var e=F;try{if(e==F&&_)return new Uint8Array(_);var t=$(e);if(t)return t;if(u)return u(e);throw"both async and sync fetching of the wasm failed"}catch(e){D(e)}}function H(e){for(;0<e.length;){var r=e.shift();if("function"==typeof r)r(t);else{var s=r.m;"number"==typeof s?void 0===r.l?C.get(s)():C.get(s)(r.l):s(void 0===r.l?null:r.l)}}}var Q=!1,q="function"==typeof atob?atob:function(e){var t="",r=0;e=e.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(r++)),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(r++)),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(r++)),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(r++));s=s<<2|n>>4,n=(15&n)<<4|i>>2;var a=(3&i)<<6|o;t+=String.fromCharCode(s),64!==i&&(t+=String.fromCharCode(n)),64!==o&&(t+=String.fromCharCode(a))}while(r<e.length);return t};function $(e){if(e.startsWith(x)){if(e=e.slice(x.length),"boolean"==typeof g&&g){var t=Buffer.from(e,"base64");t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}else try{var r=q(e),s=new Uint8Array(r.length);for(e=0;e<r.length;++e)s[e]=r.charCodeAt(e);t=s}catch(e){throw Error("Converting base64 string to bytes failed.")}return t}}var j={a:function(e){var t=k.length;if(2147483648<(e>>>=0))return!1;for(var r=1;4>=r;r*=2){var s=t*(1+.2/r);s=Math.min(s,e+100663296),0<(s=Math.max(e,s))%65536&&(s+=65536-s%65536);e:{try{E.grow(Math.min(2147483648,s)-v.byteLength+65535>>>16),T();var n=1;break e}catch(e){}n=void 0}if(n)return!0}return!1}};!function(){function e(e){t.asm=e.exports,E=t.asm.b,T(),C=t.asm.j,R.unshift(t.asm.c),N--,t.monitorRunDependencies&&t.monitorRunDependencies(N),0==N&&(null!==L&&(clearInterval(L),L=null),U&&(e=U,U=null,e()))}function r(t){e(t.instance)}function s(e){return function(){if(!_&&(p||f)){if("function"==typeof fetch&&!F.startsWith("file://"))return fetch(F,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+F+"'";return e.arrayBuffer()})).catch((function(){return M()}));if(l)return new Promise((function(e,t){l(F,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return M()}))}().then((function(e){return WebAssembly.instantiate(e,n)})).then(e,(function(e){A("failed to asynchronously prepare wasm: "+e),D(e)}))}var n={a:j};if(N++,t.monitorRunDependencies&&t.monitorRunDependencies(N),t.instantiateWasm)try{return t.instantiateWasm(n,e)}catch(e){return A("Module.instantiateWasm callback failed with error: "+e),!1}(_||"function"!=typeof WebAssembly.instantiateStreaming||F.startsWith(x)||F.startsWith("file://")||"function"!=typeof fetch?s(r):fetch(F,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,n).then(r,(function(e){return A("wasm streaming compile failed: "+e),A("falling back to ArrayBuffer instantiation"),s(r)}))}))).catch(i)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.c).apply(null,arguments)},t._poly1305_auth=function(){return(t._poly1305_auth=t.asm.d).apply(null,arguments)};var K,W=t.stackSave=function(){return(W=t.stackSave=t.asm.e).apply(null,arguments)},Y=t.stackRestore=function(){return(Y=t.stackRestore=t.asm.f).apply(null,arguments)},z=t.stackAlloc=function(){return(z=t.stackAlloc=t.asm.g).apply(null,arguments)};function V(){function e(){if(!K&&(K=!0,t.calledRun=!0,!y)){if(H(R),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();B.unshift(e)}H(B)}}if(!(0<N)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)P();H(O),0<N||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),e()}),1)):e())}}if(t._malloc=function(){return(t._malloc=t.asm.h).apply(null,arguments)},t._free=function(){return(t._free=t.asm.i).apply(null,arguments)},t.cwrap=function(e,t,r,s){var n=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&n&&!s?w(e):function(){return function(e,t,r,s){var n={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2),s=t=z(r),n=k;if(0<r){r=s+r-1;for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),127>=o){if(s>=r)break;n[s++]=o}else{if(2047>=o){if(s+1>=r)break;n[s++]=192|o>>6}else{if(65535>=o){if(s+2>=r)break;n[s++]=224|o>>12}else{if(s+3>=r)break;n[s++]=240|o>>18,n[s++]=128|o>>12&63}n[s++]=128|o>>6&63}n[s++]=128|63&o}}n[s]=0}}return t},array:function(e){var t=z(e.length);return S.set(e,t),t}},i=w(e),o=[];if(e=0,s)for(var a=0;a<s.length;a++){var c=n[r[a]];c?(0===e&&(e=W()),o[a]=c(s[a])):o[a]=s[a]}return r=function(e){if("string"===t)if(e){for(var r=k,s=e+NaN,n=e;r[n]&&!(n>=s);)++n;if(16<n-e&&r.subarray&&I)e=I.decode(r.subarray(e,n));else{for(s="";e<n;){var i=r[e++];if(128&i){var o=63&r[e++];if(192==(224&i))s+=String.fromCharCode((31&i)<<6|o);else{var a=63&r[e++];65536>(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&r[e++])?s+=String.fromCharCode(i):(i-=65536,s+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else s+=String.fromCharCode(i)}e=s}}else e="";else e="boolean"===t?!!e:e;return e}(r=i.apply(null,o)),0!==e&&Y(e),r}(e,t,r,arguments)}},U=function e(){K||V(),K||(U=e)},t.run=V,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return V(),e.ready});e.exports=n},2908:(e,t,r)=>{"use strict";const s=new Array(256);[r(5260).HANDLERS,r(6728)].forEach((e=>{for(let[t,r]of Object.entries(e))t=+t,isFinite(t)&&t>=0&&t<s.length&&(s[t]=r)})),e.exports=s},6728:(e,t,r)=>{"use strict";const{bufferSlice:s,bufferParser:n,doFatalError:i,sigSSHToASN1:o,writeUInt32BE:a}=r(9205),{CHANNEL_OPEN_FAILURE:c,COMPAT:l,MESSAGE:u,TERMINAL_MODE:h}=r(3190),{parseKey:d}=r(3781),p=Array.from(Object.entries(h)).reduce(((e,[t,r])=>({...e,[t]:r})),{});e.exports={[u.DISCONNECT]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE(),s=n.readString(!0),o=n.readString();if(n.clear(),void 0===o)return i(e,"Inbound: Malformed DISCONNECT packet");e._debug&&e._debug(`Inbound: Received DISCONNECT (${r}, "${s}")`);const a=e._handlers.DISCONNECT;a&&a(e,r,s)},[u.IGNORE]:(e,t)=>{e._debug&&e._debug("Inbound: Received IGNORE")},[u.UNIMPLEMENTED]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE();if(n.clear(),void 0===r)return i(e,"Inbound: Malformed UNIMPLEMENTED packet");e._debug&&e._debug(`Inbound: Received UNIMPLEMENTED (seqno ${r})`)},[u.DEBUG]:(e,t)=>{n.init(t,1);const r=n.readBool(),s=n.readString(!0),o=n.readString();if(n.clear(),void 0===o)return i(e,"Inbound: Malformed DEBUG packet");e._debug&&e._debug("Inbound: Received DEBUG");const a=e._handlers.DEBUG;a&&a(e,r,s)},[u.SERVICE_REQUEST]:(e,t)=>{n.init(t,1);const r=n.readString(!0);if(n.clear(),void 0===r)return i(e,"Inbound: Malformed SERVICE_REQUEST packet");e._debug&&e._debug(`Inbound: Received SERVICE_REQUEST (${r})`);const s=e._handlers.SERVICE_REQUEST;s&&s(e,r)},[u.SERVICE_ACCEPT]:(e,t)=>{n.init(t,1);const r=n.readString(!0);if(n.clear(),void 0===r)return i(e,"Inbound: Malformed SERVICE_ACCEPT packet");e._debug&&e._debug(`Inbound: Received SERVICE_ACCEPT (${r})`);const s=e._handlers.SERVICE_ACCEPT;s&&s(e,r)},[u.EXT_INFO]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE();let s;if(void 0!==r){s=[];for(let e=0;e<r;++e){const e=n.readString(!0),t=n.readString();if(void 0===t){s=void 0;break}if("server-sig-algs"!==e);else{const r=t.latin1Slice(0,t.length).split(",");s.push({name:e,algs:r})}}}if(n.clear(),void 0===s)return i(e,"Inbound: Malformed EXT_INFO packet");e._debug&&e._debug("Inbound: Received EXT_INFO");const o=e._handlers.EXT_INFO;o&&o(e,s)},[u.USERAUTH_REQUEST]:(e,t)=>{n.init(t,1);const r=n.readString(!0),c=n.readString(!0),l=n.readString(!0);let u,h;switch(l){case"none":u=null;break;case"password":{const e=n.readBool();if(void 0!==e&&(u=n.readString(!0),void 0!==u&&e)){const e=n.readString(!0);u=void 0!==e?{oldPassword:u,newPassword:e}:void 0}break}case"publickey":{const r=n.readBool();if(void 0!==r){const i=n.readString(!0);let c=i;const l=n.readString();let d;switch(i){case"rsa-sha2-256":c="ssh-rsa",d="sha256";break;case"rsa-sha2-512":c="ssh-rsa",d="sha512"}if(r){const r=n.pos();let h=n.readString();if(void 0!==h&&(h.length>4+i.length+4&&h.utf8Slice(4,4+i.length)===i&&(h=s(h,4+i.length+4)),h=o(h,c),h)){const s=e._kex.sessionID,n=Buffer.allocUnsafe(4+s.length+r);a(n,s.length,0),n.set(s,4),n.set(new Uint8Array(t.buffer,t.byteOffset,r),4+s.length),u={keyAlgo:c,key:l,signature:h,blob:n,hashAlgo:d}}}else u={keyAlgo:c,key:l,hashAlgo:d},h="publickey -- check"}break}case"hostbased":{const r=n.readString(!0);let i=r;const c=n.readString(),l=n.readString(!0),h=n.readString(!0);let d;switch(r){case"rsa-sha2-256":i="ssh-rsa",d="sha256";break;case"rsa-sha2-512":i="ssh-rsa",d="sha512"}const p=n.pos();let f=n.readString();if(void 0!==f&&(f.length>4+r.length+4&&f.utf8Slice(4,4+r.length)===r&&(f=s(f,4+r.length+4)),f=o(f,i),void 0!==f)){const r=e._kex.sessionID,s=Buffer.allocUnsafe(4+r.length+p);a(s,r.length,0),s.set(r,4),s.set(new Uint8Array(t.buffer,t.byteOffset,p),4+r.length),u={keyAlgo:i,key:c,signature:f,blob:s,localHostname:l,localUsername:h,hashAlgo:d}}break}case"keyboard-interactive":n.skipString(),u=n.readList();break;default:void 0!==l&&(u=n.readRaw())}if(n.clear(),void 0===u)return i(e,"Inbound: Malformed USERAUTH_REQUEST packet");void 0===h&&(h=l),e._authsQueue.push(l),e._debug&&e._debug(`Inbound: Received USERAUTH_REQUEST (${h})`);const d=e._handlers.USERAUTH_REQUEST;d&&d(e,r,c,l,u)},[u.USERAUTH_FAILURE]:(e,t)=>{n.init(t,1);const r=n.readList(),s=n.readBool();if(n.clear(),void 0===s)return i(e,"Inbound: Malformed USERAUTH_FAILURE packet");e._debug&&e._debug(`Inbound: Received USERAUTH_FAILURE (${r})`),e._authsQueue.shift();const o=e._handlers.USERAUTH_FAILURE;o&&o(e,r,s)},[u.USERAUTH_SUCCESS]:(e,t)=>{e._debug&&e._debug("Inbound: Received USERAUTH_SUCCESS"),e._authsQueue.shift();const r=e._handlers.USERAUTH_SUCCESS;r&&r(e)},[u.USERAUTH_BANNER]:(e,t)=>{n.init(t,1);const r=n.readString(!0),s=n.readString();if(n.clear(),void 0===s)return i(e,"Inbound: Malformed USERAUTH_BANNER packet");e._debug&&e._debug("Inbound: Received USERAUTH_BANNER");const o=e._handlers.USERAUTH_BANNER;o&&o(e,r)},60:(e,t)=>{if(e._authsQueue.length)switch(e._authsQueue[0]){case"password":{n.init(t,1);const r=n.readString(!0),s=n.readString();if(n.clear(),void 0===s)return i(e,"Inbound: Malformed USERAUTH_PASSWD_CHANGEREQ packet");e._debug&&e._debug("Inbound: Received USERAUTH_PASSWD_CHANGEREQ");const o=e._handlers.USERAUTH_PASSWD_CHANGEREQ;o&&o(e,r);break}case"publickey":{n.init(t,1);const r=n.readString(!0),s=n.readString();if(n.clear(),void 0===s)return i(e,"Inbound: Malformed USERAUTH_PK_OK packet");e._debug&&e._debug("Inbound: Received USERAUTH_PK_OK"),e._authsQueue.shift();const o=e._handlers.USERAUTH_PK_OK;o&&o(e,r,s);break}case"keyboard-interactive":{n.init(t,1);const r=n.readString(!0),s=n.readString(!0);n.readString();const o=n.readUInt32BE();let a;if(void 0!==o){let e;for(a=new Array(o),e=0;e<o;++e){const t=n.readString(!0),r=n.readBool();if(void 0===r)break;a[e]={prompt:t,echo:r}}e!==o&&(a=void 0)}if(n.clear(),void 0===a)return i(e,"Inbound: Malformed USERAUTH_INFO_REQUEST packet");e._debug&&e._debug("Inbound: Received USERAUTH_INFO_REQUEST");const c=e._handlers.USERAUTH_INFO_REQUEST;c&&c(e,r,s,a);break}default:e._debug&&e._debug("Inbound: Received unexpected payload type 60")}else e._debug&&e._debug("Inbound: Received payload type 60 without auth")},61:(e,t)=>{if(!e._authsQueue.length)return void(e._debug&&e._debug("Inbound: Received payload type 61 without auth"));if("keyboard-interactive"!==e._authsQueue[0])return i(e,"Inbound: Received unexpected payload type 61");n.init(t,1);const r=n.readUInt32BE();let s;if(void 0!==r){let e;for(s=new Array(r),e=0;e<r;++e){const t=n.readString(!0);if(void 0===t)break;s[e]=t}e!==r&&(s=void 0)}if(n.clear(),void 0===s)return i(e,"Inbound: Malformed USERAUTH_INFO_RESPONSE packet");e._debug&&e._debug("Inbound: Received USERAUTH_INFO_RESPONSE");const o=e._handlers.USERAUTH_INFO_RESPONSE;o&&o(e,s)},[u.GLOBAL_REQUEST]:(e,t)=>{n.init(t,1);const r=n.readString(!0),s=n.readBool();let o;if(void 0!==s)switch(r){case"tcpip-forward":case"cancel-tcpip-forward":{const e=n.readString(!0),t=n.readUInt32BE();void 0!==t&&(o={bindAddr:e,bindPort:t});break}case"streamlocal-forward@openssh.com":case"cancel-streamlocal-forward@openssh.com":{const e=n.readString(!0);void 0!==e&&(o={socketPath:e});break}case"no-more-sessions@openssh.com":o=null;break;case"hostkeys-00@openssh.com":for(o=[];n.avail()>0;){const e=n.readString();if(void 0===e){o=void 0;break}const t=d(e);t instanceof Error||o.push(t)}break;default:o=n.readRaw()}if(n.clear(),void 0===o)return i(e,"Inbound: Malformed GLOBAL_REQUEST packet");e._debug&&e._debug(`Inbound: GLOBAL_REQUEST (${r})`);const a=e._handlers.GLOBAL_REQUEST;a?a(e,r,s,o):e.requestFailure()},[u.REQUEST_SUCCESS]:(e,t)=>{const r=t.length>1?s(t,1):null;e._debug&&e._debug("Inbound: REQUEST_SUCCESS");const n=e._handlers.REQUEST_SUCCESS;n&&n(e,r)},[u.REQUEST_FAILURE]:(e,t)=>{e._debug&&e._debug("Inbound: Received REQUEST_FAILURE");const r=e._handlers.REQUEST_FAILURE;r&&r(e)},[u.CHANNEL_OPEN]:(e,t)=>{n.init(t,1);const r=n.readString(!0),s=n.readUInt32BE(),o=n.readUInt32BE(),a=n.readUInt32BE();let l;switch(r){case"forwarded-tcpip":case"direct-tcpip":{const e=n.readString(!0),t=n.readUInt32BE(),i=n.readString(!0),c=n.readUInt32BE();void 0!==c&&(l={type:r,sender:s,window:o,packetSize:a,data:{destIP:e,destPort:t,srcIP:i,srcPort:c}});break}case"forwarded-streamlocal@openssh.com":case"direct-streamlocal@openssh.com":{const e=n.readString(!0);void 0!==e&&(l={type:r,sender:s,window:o,packetSize:a,data:{socketPath:e}});break}case"x11":{const e=n.readString(!0),t=n.readUInt32BE();void 0!==t&&(l={type:r,sender:s,window:o,packetSize:a,data:{srcIP:e,srcPort:t}});break}default:l={type:r,sender:s,window:o,packetSize:a,data:{}}}if(n.clear(),void 0===l)return i(e,"Inbound: Malformed CHANNEL_OPEN packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN (s:${s}, ${r})`);const u=e._handlers.CHANNEL_OPEN;u?u(e,l):e.channelOpenFail(l.sender,c.ADMINISTRATIVELY_PROHIBITED,"","")},[u.CHANNEL_OPEN_CONFIRMATION]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE(),s=n.readUInt32BE(),o=n.readUInt32BE(),a=n.readUInt32BE(),c=n.avail()?n.readRaw():void 0;if(n.clear(),void 0===a)return i(e,"Inbound: Malformed CHANNEL_OPEN_CONFIRMATION packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN_CONFIRMATION (r:${r}, s:${s})`);const l=e._handlers.CHANNEL_OPEN_CONFIRMATION;l&&l(e,{recipient:r,sender:s,window:o,packetSize:a,data:c})},[u.CHANNEL_OPEN_FAILURE]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE(),s=n.readUInt32BE(),o=n.readString(!0),a=n.readString();if(n.clear(),void 0===a)return i(e,"Inbound: Malformed CHANNEL_OPEN_FAILURE packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN_FAILURE (r:${r})`);const c=e._handlers.CHANNEL_OPEN_FAILURE;c&&c(e,r,s,o)},[u.CHANNEL_WINDOW_ADJUST]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE(),s=n.readUInt32BE();if(n.clear(),void 0===s)return i(e,"Inbound: Malformed CHANNEL_WINDOW_ADJUST packet");e._debug&&e._debug(`Inbound: CHANNEL_WINDOW_ADJUST (r:${r}, ${s})`);const o=e._handlers.CHANNEL_WINDOW_ADJUST;o&&o(e,r,s)},[u.CHANNEL_DATA]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE(),s=n.readString();if(n.clear(),void 0===s)return i(e,"Inbound: Malformed CHANNEL_DATA packet");e._debug&&e._debug(`Inbound: CHANNEL_DATA (r:${r}, ${s.length})`);const o=e._handlers.CHANNEL_DATA;o&&o(e,r,s)},[u.CHANNEL_EXTENDED_DATA]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE(),s=n.readUInt32BE(),o=n.readString();if(n.clear(),void 0===o)return i(e,"Inbound: Malformed CHANNEL_EXTENDED_DATA packet");e._debug&&e._debug(`Inbound: CHANNEL_EXTENDED_DATA (r:${r}, ${o.length})`);const a=e._handlers.CHANNEL_EXTENDED_DATA;a&&a(e,r,o,s)},[u.CHANNEL_EOF]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE();if(n.clear(),void 0===r)return i(e,"Inbound: Malformed CHANNEL_EOF packet");e._debug&&e._debug(`Inbound: CHANNEL_EOF (r:${r})`);const s=e._handlers.CHANNEL_EOF;s&&s(e,r)},[u.CHANNEL_CLOSE]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE();if(n.clear(),void 0===r)return i(e,"Inbound: Malformed CHANNEL_CLOSE packet");e._debug&&e._debug(`Inbound: CHANNEL_CLOSE (r:${r})`);const s=e._handlers.CHANNEL_CLOSE;s&&s(e,r)},[u.CHANNEL_REQUEST]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE(),s=n.readString(!0),o=n.readBool();let a;if(void 0!==o)switch(s){case"exit-status":a=n.readUInt32BE(),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s}: ${a})`);break;case"exit-signal":{let t,i;if(e._compatFlags&l.OLD_EXIT){const e=n.readUInt32BE();switch(e){case 1:t="HUP";break;case 2:t="INT";break;case 3:t="QUIT";break;case 6:t="ABRT";break;case 9:t="KILL";break;case 14:t="ALRM";break;case 15:t="TERM";break;default:void 0!==e&&(t=`UNKNOWN (${e})`)}i=!1}else t=n.readString(!0),i=n.readBool(),void 0===i&&(t=void 0);const o=n.readString(!0);void 0!==n.skipString()&&(a={signal:t,coreDumped:i,errorMessage:o}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s}: ${t})`);break}case"pty-req":{const t=n.readString(!0),i=n.readUInt32BE(),o=n.readUInt32BE(),c=n.readUInt32BE(),l=n.readUInt32BE(),u=n.readString();if(void 0!==u){n.init(u,1);let e={};for(;n.avail();){const t=n.readByte();if(t===h.TTY_OP_END)break;const r=p[t],s=n.readUInt32BE();if(void 0===t||void 0===r||void 0===s){e=void 0;break}e[r]=s}void 0!==e&&(a={term:t,cols:i,rows:o,width:c,height:l,modes:e})}e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s})`);break}case"window-change":{const t=n.readUInt32BE(),i=n.readUInt32BE(),o=n.readUInt32BE(),c=n.readUInt32BE();void 0!==c&&(a={cols:t,rows:i,width:o,height:c}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s})`);break}case"x11-req":{const t=n.readBool(),i=n.readString(!0),o=n.readString(),c=n.readUInt32BE();void 0!==c&&(a={single:t,protocol:i,cookie:o,screen:c}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s})`);break}case"env":{const t=n.readString(!0),i=n.readString(!0);void 0!==i&&(a={name:t,value:i}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s}: ${t}=${i})`);break}case"shell":case"auth-agent-req@openssh.com":a=null,e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s})`);break;case"exec":case"subsystem":case"signal":a=n.readString(!0),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s}: ${a})`);break;case"xon-xoff":a=n.readBool(),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s}: ${a})`);break;default:a=n.avail()?n.readRaw():null,e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${s})`)}if(n.clear(),void 0===a)return i(e,"Inbound: Malformed CHANNEL_REQUEST packet");const c=e._handlers.CHANNEL_REQUEST;c&&c(e,r,s,o,a)},[u.CHANNEL_SUCCESS]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE();if(n.clear(),void 0===r)return i(e,"Inbound: Malformed CHANNEL_SUCCESS packet");e._debug&&e._debug(`Inbound: CHANNEL_SUCCESS (r:${r})`);const s=e._handlers.CHANNEL_SUCCESS;s&&s(e,r)},[u.CHANNEL_FAILURE]:(e,t)=>{n.init(t,1);const r=n.readUInt32BE();if(n.clear(),void 0===r)return i(e,"Inbound: Malformed CHANNEL_FAILURE packet");e._debug&&e._debug(`Inbound: CHANNEL_FAILURE (r:${r})`);const s=e._handlers.CHANNEL_FAILURE;s&&s(e,r)}}},5260:(e,t,r)=>{"use strict";const{createDiffieHellman:s,createDiffieHellmanGroup:n,createECDH:i,createHash:o,createPublicKey:a,diffieHellman:c,generateKeyPairSync:l,randomFillSync:u}=r(6113),{Ber:h}=r(476),{COMPAT:d,curve25519Supported:p,DEFAULT_KEX:f,DEFAULT_SERVER_HOST_KEY:g,DEFAULT_CIPHER:m,DEFAULT_MAC:_,DEFAULT_COMPRESSION:A,DISCONNECT_REASON:E,MESSAGE:y}=r(3190),{CIPHER_INFO:b,createCipher:w,createDecipher:v,MAC_INFO:S}=r(8545),{parseDERKey:k}=r(3781),{bufferFill:I,bufferParser:T,convertSignature:C,doFatalError:O,FastBuffer:R,sigSSHToASN1:B,writeUInt32BE:P}=r(9205),{PacketReader:N,PacketWriter:L,ZlibPacketReader:U,ZlibPacketWriter:D}=r(6993);let F;const x=Buffer.alloc(0);function G(e){let t;if(e._compatFlags&d.BAD_DHGEX){const r=e._offer.lists.kex;let s=r.array,n=!1;for(let e=0;e<s.length;++e)s[e].includes("group-exchange")&&(n||(n=!0,s=s.slice()),s.splice(e--,1));if(n){let n=17+e._offer.totalSize+1+4;const i=Buffer.from(s.join(","));n-=r.buffer.length-i.length;const o=e._offer.lists.all,a=new Uint8Array(o.buffer,o.byteOffset+4+r.buffer.length,o.length-(4+r.buffer.length));t=Buffer.allocUnsafe(n),P(t,i.length,17),t.set(i,21),t.set(a,21+i.length)}}void 0===t&&(t=Buffer.allocUnsafe(17+e._offer.totalSize+1+4),e._offer.copyAllTo(t,17)),e._debug&&e._debug("Outbound: Sending KEXINIT"),t[0]=y.KEXINIT,u(t,1,16),I(t,0,t.length-5),e._kexinit=t,e._packetRW.write.allocStart=0;{const r=e._packetRW.write.allocStartKEX,s=e._packetRW.write.alloc(t.length,!0);s.set(t,r),e._cipher.encrypt(e._packetRW.write.finalize(s,!0))}}function M(e,t){const r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0}};if(T.init(t,17),void 0===(r.kex=T.readList())||void 0===(r.serverHostKey=T.readList())||void 0===(r.cs.cipher=T.readList())||void 0===(r.sc.cipher=T.readList())||void 0===(r.cs.mac=T.readList())||void 0===(r.sc.mac=T.readList())||void 0===(r.cs.compress=T.readList())||void 0===(r.sc.compress=T.readList())||void 0===(r.cs.lang=T.readList())||void 0===(r.sc.lang=T.readList()))return T.clear(),O(e,"Received malformed KEXINIT","handshake",E.KEY_EXCHANGE_FAILED);const s=T.pos(),n=s<t.length&&1===t[s];T.clear();const i=e._offer,o=r;let a,c,l,u=i.lists.kex.array;if(e._compatFlags&d.BAD_DHGEX){let e=!1;for(let t=0;t<u.length;++t)-1!==u[t].indexOf("group-exchange")&&(e||(e=!0,u=u.slice()),u.splice(t--,1))}const h=e._debug;let p;for(h&&h("Inbound: Handshake in progress"),h&&h(`Handshake: (local) KEX method: ${u}`),h&&h(`Handshake: (remote) KEX method: ${o.kex}`),e._server?(c=u,a=o.kex,p=-1!==a.indexOf("ext-info-c")):(c=o.kex,a=u,p=-1!==c.indexOf("ext-info-s")),l=0;l<a.length&&-1===c.indexOf(a[l]);++l);if(l===a.length)return h&&h("Handshake: No matching key exchange algorithm"),O(e,"Handshake failed: no matching key exchange algorithm","handshake",E.KEY_EXCHANGE_FAILED);r.kex=a[l],h&&h(`Handshake: KEX algorithm: ${a[l]}`),!n||o.kex.length&&a[l]===o.kex[0]||(e._skipNextInboundPacket=!0);const f=i.lists.serverHostKey.array;for(h&&h(`Handshake: (local) Host key format: ${f}`),h&&h(`Handshake: (remote) Host key format: ${o.serverHostKey}`),e._server?(c=f,a=o.serverHostKey):(c=o.serverHostKey,a=f),l=0;l<a.length&&-1===c.indexOf(a[l]);++l);if(l===a.length)return h&&h("Handshake: No matching host key format"),O(e,"Handshake failed: no matching host key format","handshake",E.KEY_EXCHANGE_FAILED);r.serverHostKey=a[l],h&&h(`Handshake: Host key format: ${a[l]}`);const g=i.lists.cs.cipher.array;for(h&&h(`Handshake: (local) C->S cipher: ${g}`),h&&h(`Handshake: (remote) C->S cipher: ${o.cs.cipher}`),e._server?(c=g,a=o.cs.cipher):(c=o.cs.cipher,a=g),l=0;l<a.length&&-1===c.indexOf(a[l]);++l);if(l===a.length)return h&&h("Handshake: No matching C->S cipher"),O(e,"Handshake failed: no matching C->S cipher","handshake",E.KEY_EXCHANGE_FAILED);r.cs.cipher=a[l],h&&h(`Handshake: C->S Cipher: ${a[l]}`);const m=i.lists.sc.cipher.array;for(h&&h(`Handshake: (local) S->C cipher: ${m}`),h&&h(`Handshake: (remote) S->C cipher: ${o.sc.cipher}`),e._server?(c=m,a=o.sc.cipher):(c=o.sc.cipher,a=m),l=0;l<a.length&&-1===c.indexOf(a[l]);++l);if(l===a.length)return h&&h("Handshake: No matching S->C cipher"),O(e,"Handshake failed: no matching S->C cipher","handshake",E.KEY_EXCHANGE_FAILED);r.sc.cipher=a[l],h&&h(`Handshake: S->C cipher: ${a[l]}`);const _=i.lists.cs.mac.array;if(h&&h(`Handshake: (local) C->S MAC: ${_}`),h&&h(`Handshake: (remote) C->S MAC: ${o.cs.mac}`),b[r.cs.cipher].authLen>0)r.cs.mac="",h&&h("Handshake: C->S MAC: <implicit>");else{for(e._server?(c=_,a=o.cs.mac):(c=o.cs.mac,a=_),l=0;l<a.length&&-1===c.indexOf(a[l]);++l);if(l===a.length)return h&&h("Handshake: No matching C->S MAC"),O(e,"Handshake failed: no matching C->S MAC","handshake",E.KEY_EXCHANGE_FAILED);r.cs.mac=a[l],h&&h(`Handshake: C->S MAC: ${a[l]}`)}const A=i.lists.sc.mac.array;if(h&&h(`Handshake: (local) S->C MAC: ${A}`),h&&h(`Handshake: (remote) S->C MAC: ${o.sc.mac}`),b[r.sc.cipher].authLen>0)r.sc.mac="",h&&h("Handshake: S->C MAC: <implicit>");else{for(e._server?(c=A,a=o.sc.mac):(c=o.sc.mac,a=A),l=0;l<a.length&&-1===c.indexOf(a[l]);++l);if(l===a.length)return h&&h("Handshake: No matching S->C MAC"),O(e,"Handshake failed: no matching S->C MAC","handshake",E.KEY_EXCHANGE_FAILED);r.sc.mac=a[l],h&&h(`Handshake: S->C MAC: ${a[l]}`)}const y=i.lists.cs.compress.array;for(h&&h(`Handshake: (local) C->S compression: ${y}`),h&&h(`Handshake: (remote) C->S compression: ${o.cs.compress}`),e._server?(c=y,a=o.cs.compress):(c=o.cs.compress,a=y),l=0;l<a.length&&-1===c.indexOf(a[l]);++l);if(l===a.length)return h&&h("Handshake: No matching C->S compression"),O(e,"Handshake failed: no matching C->S compression","handshake",E.KEY_EXCHANGE_FAILED);r.cs.compress=a[l],h&&h(`Handshake: C->S compression: ${a[l]}`);const w=i.lists.sc.compress.array;for(h&&h(`Handshake: (local) S->C compression: ${w}`),h&&h(`Handshake: (remote) S->C compression: ${o.sc.compress}`),e._server?(c=w,a=o.sc.compress):(c=o.sc.compress,a=w),l=0;l<a.length&&-1===c.indexOf(a[l]);++l);if(l===a.length)return h&&h("Handshake: No matching S->C compression"),O(e,"Handshake failed: no matching S->C compression","handshake",E.KEY_EXCHANGE_FAILED);r.sc.compress=a[l],h&&h(`Handshake: S->C compression: ${a[l]}`),r.cs.lang="",r.sc.lang="",e._kex&&(e._kexinit||G(e),e._decipher._onPayload=j.bind(e,{firstPacket:!1})),e._kex=H(r,e,t),e._kex.remoteExtInfoEnabled=p,e._kex.start()}const H=(()=>{function e(e){let t,r=0,s=e.length;for(;0===e[r];)++r,--s;return 128&e[r]?(t=Buffer.allocUnsafe(1+s),t[0]=0,e.copy(t,1,r),e=t):s!==e.length&&(t=Buffer.allocUnsafe(s),e.copy(t,0,r),e=t),e}class t{constructor(e,t,r){this._protocol=t,this.sessionID=t._kex?t._kex.sessionID:void 0,this.negotiated=e,this.remoteExtInfoEnabled=!1,this._step=1,this._public=null,this._dh=null,this._sentNEWKEYS=!1,this._receivedNEWKEYS=!1,this._finished=!1,this._hostVerified=!1,this._kexinit=t._kexinit,this._remoteKexinit=r,this._identRaw=t._identRaw,this._remoteIdentRaw=t._remoteIdentRaw,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0}finish(e){if(this._finished)return!1;this._finished=!0;const t=this._protocol._server,r=this.negotiated,s=this.convertPublicKey(this._dhData);let n=this.computeSecret(this._dhData);if(n instanceof Error)return n.message=`Error while computing DH secret (${this.type}): ${n.message}`,n.level="handshake",O(this._protocol,n,E.KEY_EXCHANGE_FAILED);const i=o(this.hashName);q(i,t?this._remoteIdentRaw:this._identRaw),q(i,t?this._identRaw:this._remoteIdentRaw),q(i,t?this._remoteKexinit:this._kexinit),q(i,t?this._kexinit:this._remoteKexinit);const a=t?this._hostKey.getPublicSSH():this._hostKey;if(q(i,a),"groupex"===this.type){const e=this.getDHParams(),t=Buffer.allocUnsafe(4);P(t,this._minBits,0),i.update(t),P(t,this._prefBits,0),i.update(t),P(t,this._maxBits,0),i.update(t),q(i,e.prime),q(i,e.generator)}q(i,t?s:this.getPublicKey());const c=t?this.getPublicKey():s;q(i,c),q(i,n);const l=i.digest();if(t){let e;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":e="sha256";break;case"rsa-sha2-512":e="sha512"}this._protocol._debug&&this._protocol._debug("Generating signature ...");let t=this._hostKey.sign(l,e);if(t instanceof Error)return O(this._protocol,`Handshake failed: signature generation failed for ${this._hostKey.type} host key: ${t.message}`,"handshake",E.KEY_EXCHANGE_FAILED);if(t=C(t,this._hostKey.type),!1===t)return O(this._protocol,`Handshake failed: signature conversion failed for ${this._hostKey.type} host key`,"handshake",E.KEY_EXCHANGE_FAILED);const r=this.negotiated.serverHostKey,s=Buffer.byteLength(r),n=4+s+4+t.length;let i=this._protocol._packetRW.write.allocStartKEX;const o=this._protocol._packetRW.write.alloc(5+a.length+4+c.length+4+n,!0);if(o[i]=y.KEXDH_REPLY,P(o,a.length,++i),o.set(a,i+=4),P(o,c.length,i+=a.length),o.set(c,i+=4),P(o,n,i+=c.length),P(o,s,i+=4),o.utf8Write(r,i+=4,s),P(o,t.length,i+=s),o.set(t,i+=4),this._protocol._debug){let e;switch(this.type){case"group":e="KEXDH_REPLY";break;case"groupex":e="KEXDH_GEX_REPLY";break;default:e="KEXECDH_REPLY"}this._protocol._debug(`Outbound: Sending ${e}`)}this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(o,!0))}else{T.init(this._sig,0);const e=T.readString(!0);if(!e)return O(this._protocol,"Malformed packet while reading signature","handshake",E.KEY_EXCHANGE_FAILED);if(e!==r.serverHostKey)return O(this._protocol,`Wrong signature type: ${e}, expected: ${r.serverHostKey}`,"handshake",E.KEY_EXCHANGE_FAILED);let t,s,n=T.readString();if(T.clear(),void 0===n)return O(this._protocol,"Malformed packet while reading signature","handshake",E.KEY_EXCHANGE_FAILED);if(!(n=B(n,e)))return O(this._protocol,"Malformed signature","handshake",E.KEY_EXCHANGE_FAILED);{T.init(this._hostKey,0);const e=T.readString(!0),r=this._hostKey.slice(T.pos());if(T.clear(),t=k(r,e),t instanceof Error)return t.level="handshake",O(this._protocol,t,E.KEY_EXCHANGE_FAILED)}switch(this.negotiated.serverHostKey){case"rsa-sha2-256":s="sha256";break;case"rsa-sha2-512":s="sha512"}this._protocol._debug&&this._protocol._debug("Verifying signature ...");const i=t.verify(l,n,s);if(!0!==i)return i instanceof Error?this._protocol._debug&&this._protocol._debug(`Signature verification failed: ${i.stack}`):this._protocol._debug&&this._protocol._debug("Signature verification failed"),O(this._protocol,"Handshake failed: signature verification failed","handshake",E.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Verified signature")}let u,h;!t&&e||K(this);const d=e=>{if(u)return K(this),u.outbound.seqno=this._protocol._cipher.outSeqno,this._protocol._cipher.free(),this._protocol._cipher=w(u),this._protocol._packetRW.write=h,u=void 0,h=void 0,this._protocol._onHandshakeComplete(r),!1;this.sessionID||(this.sessionID=l);{const e=Buffer.allocUnsafe(4+n.length);P(e,n.length,0),e.set(n,4),n=e}const s=b[r.cs.cipher],i=b[r.sc.cipher],o=$(s.ivLen,this.hashName,n,l,this.sessionID,"A"),a=$(i.ivLen,this.hashName,n,l,this.sessionID,"B"),c=$(s.keyLen,this.hashName,n,l,this.sessionID,"C"),p=$(i.keyLen,this.hashName,n,l,this.sessionID,"D");let f,g,m,_;s.authLen||(f=S[r.cs.mac],g=$(f.len,this.hashName,n,l,this.sessionID,"E")),i.authLen||(m=S[r.sc.mac],_=$(m.len,this.hashName,n,l,this.sessionID,"F"));const A={inbound:{onPayload:this._protocol._onPayload,seqno:this._protocol._decipher.inSeqno,decipherInfo:t?s:i,decipherIV:t?o:a,decipherKey:t?c:p,macInfo:t?f:m,macKey:t?g:_},outbound:{onWrite:this._protocol._onWrite,seqno:this._protocol._cipher.outSeqno,cipherInfo:t?i:s,cipherIV:t?a:o,cipherKey:t?p:c,macInfo:t?m:f,macKey:t?_:g}};this._protocol._decipher.free(),u=A,this._protocol._decipher=v(A);const E={read:void 0,write:void 0};switch(r.cs.compress){case"zlib":t?E.read=new U:E.write=new D(this._protocol);break;case"zlib@openssh.com":if(this._protocol._authenticated){t?E.read=new U:E.write=new D(this._protocol);break}default:t?E.read=new N:E.write=new L(this._protocol)}switch(r.sc.compress){case"zlib":t?E.write=new D(this._protocol):E.read=new U;break;case"zlib@openssh.com":if(this._protocol._authenticated){t?E.write=new D(this._protocol):E.read=new U;break}default:t?E.write=new L(this._protocol):E.read=new N}return this._protocol._packetRW.read.cleanup(),this._protocol._packetRW.write.cleanup(),this._protocol._packetRW.read=E.read,h=E.write,this._public=null,this._dh=null,this._kexinit=this._protocol._kexinit=void 0,this._remoteKexinit=void 0,this._identRaw=void 0,this._remoteIdentRaw=void 0,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0,!e&&d()};return(t||e)&&(this.finish=d),t?void 0:d(e)}start(){if(!this._protocol._server){if(this._protocol._debug){let e;e="group"===this.type?"KEXDH_INIT":"KEXECDH_INIT",this._protocol._debug(`Outbound: Sending ${e}`)}const e=this.getPublicKey();let t=this._protocol._packetRW.write.allocStartKEX;const r=this._protocol._packetRW.write.alloc(5+e.length,!0);r[t]=y.KEXDH_INIT,P(r,e.length,++t),r.set(e,t+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(r,!0))}}getPublicKey(){this.generateKeys();const e=this._public;if(e)return this.convertPublicKey(e)}convertPublicKey(e){let t,r=0,s=e.length;for(;0===e[r];)++r,--s;return 128&e[r]?(t=Buffer.allocUnsafe(1+s),t[0]=0,e.copy(t,1,r),t):(s!==e.length&&(t=Buffer.allocUnsafe(s),e.copy(t,0,r),e=t),e)}computeSecret(t){this.generateKeys();try{return e(this._dh.computeSecret(t))}catch(e){return e}}parse(e){const t=e[0];switch(this._step){case 1:if(this._protocol._server){if(t!==y.KEXDH_INIT)return O(this._protocol,`Received packet ${t} instead of ${y.KEXDH_INIT}`,"handshake",E.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Init"),T.init(e,1);const r=T.readString();if(T.clear(),void 0===r)return O(this._protocol,"Received malformed KEX*_INIT","handshake",E.KEY_EXCHANGE_FAILED);this._dhData=r;let s=this._protocol._hostKeys[this.negotiated.serverHostKey];Array.isArray(s)&&(s=s[0]),this._hostKey=s,this.finish()}else{if(t!==y.KEXDH_REPLY)return O(this._protocol,`Received packet ${t} instead of ${y.KEXDH_REPLY}`,"handshake",E.KEY_EXCHANGE_FAILED);let r,s,n;if(this._protocol._debug&&this._protocol._debug("Received DH Reply"),T.init(e,1),void 0===(r=T.readString())||void 0===(s=T.readString())||void 0===(n=T.readString()))return T.clear(),O(this._protocol,"Received malformed KEX*_REPLY","handshake",E.KEY_EXCHANGE_FAILED);T.clear(),T.init(r,0);const i=T.readString(!0);if(T.clear(),void 0===i)return O(this._protocol,"Received malformed host public key","handshake",E.KEY_EXCHANGE_FAILED);if(i!==this.negotiated.serverHostKey)switch(this.negotiated.serverHostKey){case"rsa-sha2-256":case"rsa-sha2-512":if("ssh-rsa"===i)break;default:return O(this._protocol,"Host key does not match negotiated type","handshake",E.KEY_EXCHANGE_FAILED)}this._hostKey=r,this._dhData=s,this._sig=n;let o,a=!1;if(void 0===this._protocol._hostVerifier?(o=!0,this._protocol._debug&&this._protocol._debug("Host accepted by default (no verification)")):o=this._protocol._hostVerifier(r,(e=>{if(!a){if(a=!0,!1===e)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),O(this._protocol,"Host denied (verification failed)","handshake",E.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,this._receivedNEWKEYS?this.finish():K(this)}})),void 0===o)return void++this._step;if(a=!0,!1===o)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),O(this._protocol,"Host denied (verification failed)","handshake",E.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,K(this)}++this._step;break;case 2:return t!==y.NEWKEYS?O(this._protocol,`Received packet ${t} instead of ${y.NEWKEYS}`,"handshake",E.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Inbound: NEWKEYS"),this._receivedNEWKEYS=!0,++this._step,this.finish(!this._protocol._server&&!this._hostVerified));default:return O(this._protocol,`Received unexpected packet ${t} after NEWKEYS`,"handshake",E.KEY_EXCHANGE_FAILED)}}}class r extends t{constructor(e,...t){super(...t),this.type="25519",this.hashName=e,this._keys=null}generateKeys(){this._keys||(this._keys=l("x25519"))}getPublicKey(){return this.generateKeys(),this._keys.publicKey.export({type:"spki",format:"der"}).slice(-32)}convertPublicKey(e){let t,r=0,s=e.length;for(;0===e[r];)++r,--s;return 32===e.length||s!==e.length&&(t=Buffer.allocUnsafe(s),e.copy(t,0,r),e=t),e}computeSecret(t){this.generateKeys();try{const r=new h.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.3.101.110"),r.endSequence(),r.startSequence(h.BitString),r.writeByte(0),r._ensure(t.length),t.copy(r._buf,r._offset,0,t.length),r._offset+=t.length,r.endSequence(),r.endSequence(),e(c({privateKey:this._keys.privateKey,publicKey:a({key:r.buffer,type:"spki",format:"der"})}))}catch(e){return e}}}class u extends t{constructor(e,t,...r){super(...r),this.type="ecdh",this.curveName=e,this.hashName=t}generateKeys(){this._dh||(this._dh=i(this.curveName),this._public=this._dh.generateKeys())}}class f extends t{constructor(e,...t){super(...t),this.type="groupex",this.hashName=e,this._prime=null,this._generator=null,this._minBits=2048,this._prefBits=function(e){const t=b[e.cs.cipher],r=b[e.sc.cipher],s=8*Math.max(0,"des-ede3-cbc"===t.sslName?14:t.keyLen,t.blockLen,t.ivLen,"des-ede3-cbc"===r.sslName?14:r.keyLen,r.blockLen,r.ivLen);return s<=112?2048:s<=128?3072:s<=192?7680:8192}(this.negotiated),this._protocol._compatFlags&d.BUG_DHGEX_LARGE&&(this._prefBits=Math.min(this._prefBits,4096)),this._maxBits=8192}start(){if(this._protocol._server)return;this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_REQUEST");let e=this._protocol._packetRW.write.allocStartKEX;const t=this._protocol._packetRW.write.alloc(13,!0);t[e]=y.KEXDH_GEX_REQUEST,P(t,this._minBits,++e),P(t,this._prefBits,e+=4),P(t,this._maxBits,e+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(t,!0))}generateKeys(){!this._dh&&this._prime&&this._generator&&(this._dh=s(this._prime,this._generator),this._public=this._dh.generateKeys())}setDHParams(e,t){if(!Buffer.isBuffer(e))throw new Error("Invalid prime value");if(!Buffer.isBuffer(t))throw new Error("Invalid generator value");this._prime=e,this._generator=t}getDHParams(){if(this._dh)return{prime:e(this._dh.getPrime()),generator:e(this._dh.getGenerator())}}parse(e){const r=e[0];switch(this._step){case 1:{if(this._protocol._server)return r!==y.KEXDH_GEX_REQUEST?O(this._protocol,`Received packet ${r} instead of `+y.KEXDH_GEX_REQUEST,"handshake",E.KEY_EXCHANGE_FAILED):O(this._protocol,"Group exchange not implemented for server","handshake",E.KEY_EXCHANGE_FAILED);if(r!==y.KEXDH_GEX_GROUP)return O(this._protocol,`Received packet ${r} instead of ${y.KEXDH_GEX_GROUP}`,"handshake",E.KEY_EXCHANGE_FAILED);let t,s;if(this._protocol._debug&&this._protocol._debug("Received DH GEX Group"),T.init(e,1),void 0===(t=T.readString())||void 0===(s=T.readString()))return T.clear(),O(this._protocol,"Received malformed KEXDH_GEX_GROUP","handshake",E.KEY_EXCHANGE_FAILED);T.clear(),this.setDHParams(t,s),this.generateKeys();const n=this.getPublicKey();this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_INIT");let i=this._protocol._packetRW.write.allocStartKEX;const o=this._protocol._packetRW.write.alloc(5+n.length,!0);o[i]=y.KEXDH_GEX_INIT,P(o,n.length,++i),o.set(n,i+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(o,!0)),++this._step;break}case 2:if(this._protocol._server)return r!==y.KEXDH_GEX_INIT?O(this._protocol,`Received packet ${r} instead of ${y.KEXDH_GEX_INIT}`,"handshake",E.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Received DH GEX Init"),O(this._protocol,"Group exchange not implemented for server","handshake",E.KEY_EXCHANGE_FAILED));if(r!==y.KEXDH_GEX_REPLY)return O(this._protocol,`Received packet ${r} instead of ${y.KEXDH_GEX_REPLY}`,"handshake",E.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Reply"),this._step=1,e[0]=y.KEXDH_REPLY,this.parse=t.prototype.parse,this.parse(e)}}}class g extends t{constructor(e,t,...r){super(...r),this.type="group",this.groupName=e,this.hashName=t}start(){if(!this._protocol._server){this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_INIT");const e=this.getPublicKey();let t=this._protocol._packetRW.write.allocStartKEX;const r=this._protocol._packetRW.write.alloc(5+e.length,!0);r[t]=y.KEXDH_INIT,P(r,e.length,++t),r.set(e,t+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(r,!0))}}generateKeys(){this._dh||(this._dh=n(this.groupName),this._public=this._dh.generateKeys())}getDHParams(){if(this._dh)return{prime:e(this._dh.getPrime()),generator:e(this._dh.getGenerator())}}}return(e,...t)=>{if("object"!=typeof e||null===e)throw new Error("Invalid negotiated argument");const s=e.kex;if("string"==typeof s){switch(t=[e,...t],s){case"curve25519-sha256":case"curve25519-sha256@libssh.org":if(!p)break;return new r("sha256",...t);case"ecdh-sha2-nistp256":return new u("prime256v1","sha256",...t);case"ecdh-sha2-nistp384":return new u("secp384r1","sha384",...t);case"ecdh-sha2-nistp521":return new u("secp521r1","sha512",...t);case"diffie-hellman-group1-sha1":return new g("modp2","sha1",...t);case"diffie-hellman-group14-sha1":return new g("modp14","sha1",...t);case"diffie-hellman-group14-sha256":return new g("modp14","sha256",...t);case"diffie-hellman-group15-sha512":return new g("modp15","sha512",...t);case"diffie-hellman-group16-sha512":return new g("modp16","sha512",...t);case"diffie-hellman-group17-sha512":return new g("modp17","sha512",...t);case"diffie-hellman-group18-sha512":return new g("modp18","sha512",...t);case"diffie-hellman-group-exchange-sha1":return new f("sha1",...t);case"diffie-hellman-group-exchange-sha256":return new f("sha256",...t)}throw new Error(`Unsupported key exchange algorithm: ${s}`)}throw new Error(`Invalid key exchange type: ${s}`)}})(),Q=(()=>{const e=["kex","serverHostKey",["cs","cipher"],["sc","cipher"],["cs","mac"],["sc","mac"],["cs","compress"],["sc","compress"],["cs","lang"],["sc","lang"]];return class{constructor(t){if("object"!=typeof t||null===t)throw new TypeError("Argument must be an object");const r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},all:void 0};let s=0;for(const n of e){let e,i,o,a;if("string"==typeof n)e=r,i=t[n],o=a=n;else{const s=n[0];e=r[s],a=n[1],i=t[s][a],o=`${s}.${a}`}const c={array:void 0,buffer:void 0};if(Buffer.isBuffer(i))c.array=(""+i).split(","),c.buffer=i,s+=4+i.length;else{if("string"==typeof i&&(i=i.split(",")),!Array.isArray(i))throw new TypeError(`Invalid \`${o}\` type: ${typeof i}`);c.array=i,c.buffer=Buffer.from(i.join(",")),s+=4+c.buffer.length}e[a]=c}const n=Buffer.allocUnsafe(s);r.all=n;let i=0;for(const t of e){let e;e="string"==typeof t?r[t].buffer:r[t[0]][t[1]].buffer,i=P(n,e.length,i),n.set(e,i),i+=e.length}this.totalSize=s,this.lists=r}copyAllTo(e,t){const r=this.lists.all;if("number"!=typeof t)throw new TypeError("Invalid offset value: "+typeof t);if(e.length-t<r.length)throw new Error("Insufficient space to copy list");return e.set(r,t),r.length}}})(),q=(()=>{const e=Buffer.allocUnsafe(4);return(t,r)=>{P(e,r.length,0),t.update(e),t.update(r)}})();function $(e,t,r,s,n,i){let a;if(e){let c=o(t).update(r).update(s).update(i).update(n).digest();for(;c.length<e;){const e=o(t).update(r).update(s).update(c).digest(),n=Buffer.allocUnsafe(c.length+e.length);n.set(c,0),n.set(e,c.length),c=n}a=c.length===e?c:new R(c.buffer,c.byteOffset,e)}else a=x;return a}function j(e,t){if(0===t.length)return void(this._debug&&this._debug("Inbound: Skipping empty packet payload"));if(this._skipNextInboundPacket)return void(this._skipNextInboundPacket=!1);const s=(t=this._packetRW.read.read(t))[0];switch(s){case y.DISCONNECT:case y.IGNORE:case y.UNIMPLEMENTED:case y.DEBUG:return F||(F=r(2908)),F[s](this,t);case y.KEXINIT:return e.firstPacket?(e.firstPacket=!1,M(this,t)):O(this,"Received extra KEXINIT during handshake","handshake",E.KEY_EXCHANGE_FAILED);default:if(s<20||s>49)return O(this,`Received unexpected packet type ${s}`,"handshake",E.KEY_EXCHANGE_FAILED)}return this._kex.parse(t)}function K(e){if(!e._sentNEWKEYS){e._protocol._debug&&e._protocol._debug("Outbound: Sending NEWKEYS");const t=e._protocol._packetRW.write.allocStartKEX,r=e._protocol._packetRW.write.alloc(1,!0);r[t]=y.NEWKEYS,e._protocol._cipher.encrypt(e._protocol._packetRW.write.finalize(r,!0)),e._sentNEWKEYS=!0}}e.exports={KexInit:Q,kexinit:G,onKEXPayload:j,DEFAULT_KEXINIT_CLIENT:new Q({kex:f.concat(["ext-info-c"]),serverHostKey:g,cs:{cipher:m,mac:_,compress:A,lang:[]},sc:{cipher:m,mac:_,compress:A,lang:[]}}),DEFAULT_KEXINIT_SERVER:new Q({kex:f,serverHostKey:g,cs:{cipher:m,mac:_,compress:A,lang:[]},sc:{cipher:m,mac:_,compress:A,lang:[]}}),HANDLERS:{[y.KEXINIT]:M}}},3781:(e,t,r)=>{"use strict";const{createDecipheriv:s,createECDH:n,createHash:i,createHmac:o,createSign:a,createVerify:c,getCiphers:l,sign:u,verify:h}=r(6113),d=l(),{Ber:p}=r(476),f=r(2703).pbkdf,{CIPHER_INFO:g}=r(8545),{eddsaSupported:m,SUPPORTED_CIPHER:_}=r(3190),{bufferSlice:A,makeBufferParser:E,readString:y,readUInt32BE:b,writeUInt32BE:w}=r(9205),v=Symbol("Hash Algorithm"),S=Symbol("Private key PEM"),k=Symbol("Public key PEM"),I=Symbol("Public key SSH"),T=Symbol("Decrypted Key"),C=Object.create(null);{const te=Object.keys(g);for(let re=0;re<te.length;++re){const se=g[te[re]].sslName;se&&!C[se]&&(C[se]=g[te[re]])}}const O=E();function R(e,t){let r=(t=t.base64Slice(0,t.length)).replace(/.{64}/g,"$&\n");return 63&t.length&&(r+="\n"),`-----BEGIN ${e} KEY-----\n${r}-----END ${e} KEY-----`}function B(e,t){const r=Buffer.allocUnsafe(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}function P(e,t){const r=e.length;let s=e._pos||0;for(let n=0;n<t;++n){const t=r-s;if(s>=r||t<4)return!1;const n=b(e,s);if(t<4+n)return!1;s+=4+n}return e._pos=s,!0}function N(e,t){const r=new p.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.113549.1.1.1"),r.writeNull(),r.endSequence(),r.startSequence(p.BitString),r.writeByte(0),r.startSequence(),r.writeBuffer(e,p.Integer),r.writeBuffer(t,p.Integer),r.endSequence(),r.endSequence(),r.endSequence(),R("PUBLIC",r.buffer)}function L(e,t){const r=Buffer.allocUnsafe(15+t.length+4+e.length);w(r,7,0),r.utf8Write("ssh-rsa",4,7);let s=11;return w(r,t.length,s),r.set(t,s+=4),w(r,e.length,s+=t.length),r.set(e,s+4),r}const U=(()=>{function e(e){return BigInt(`0x${e.hexSlice(0,e.length)}`)}function t(e){let t=e.toString(16);if(0!=(1&t.length))t=`0${t}`;else{const e=t.charCodeAt(0);(56===e||57===e||e>=97&&e<=102)&&(t=`00${t}`)}return Buffer.from(t,"hex")}return function(r,s,n,i,o,a){const c=e(n);return R("RSA PRIVATE",function(e,t,r,s,n,i,o,a){const c=new p.Writer;return c.startSequence(),c.writeInt(0,p.Integer),c.writeBuffer(e,p.Integer),c.writeBuffer(t,p.Integer),c.writeBuffer(r,p.Integer),c.writeBuffer(s,p.Integer),c.writeBuffer(n,p.Integer),c.writeBuffer(i,p.Integer),c.writeBuffer(o,p.Integer),c.writeBuffer(a,p.Integer),c.endSequence(),c.buffer}(r,s,n,o,a,t(c%(e(o)-1n)),t(c%(e(a)-1n)),i))}})();function D(e,t,r,s){const n=new p.Writer;return n.startSequence(),n.startSequence(),n.writeOID("1.2.840.10040.4.1"),n.startSequence(),n.writeBuffer(e,p.Integer),n.writeBuffer(t,p.Integer),n.writeBuffer(r,p.Integer),n.endSequence(),n.endSequence(),n.startSequence(p.BitString),n.writeByte(0),n.writeBuffer(s,p.Integer),n.endSequence(),n.endSequence(),R("PUBLIC",n.buffer)}function F(e,t,r,s){const n=Buffer.allocUnsafe(15+e.length+4+t.length+4+r.length+4+s.length);w(n,7,0),n.utf8Write("ssh-dss",4,7);let i=11;return w(n,e.length,i),n.set(e,i+=4),w(n,t.length,i+=e.length),n.set(t,i+=4),w(n,r.length,i+=t.length),n.set(r,i+=4),w(n,s.length,i+=r.length),n.set(s,i+4),n}function x(e,t,r,s,n){const i=new p.Writer;return i.startSequence(),i.writeInt(0,p.Integer),i.writeBuffer(e,p.Integer),i.writeBuffer(t,p.Integer),i.writeBuffer(r,p.Integer),i.writeBuffer(s,p.Integer),i.writeBuffer(n,p.Integer),i.endSequence(),R("DSA PRIVATE",i.buffer)}function G(e){const t=new p.Writer;return t.startSequence(),t.startSequence(),t.writeOID("1.3.101.112"),t.endSequence(),t.startSequence(p.BitString),t.writeByte(0),t._ensure(e.length),t._buf.set(e,t._offset),t._offset+=e.length,t.endSequence(),t.endSequence(),R("PUBLIC",t.buffer)}function M(e){const t=Buffer.allocUnsafe(19+e.length);return w(t,11,0),t.utf8Write("ssh-ed25519",4,11),w(t,e.length,15),t.set(e,19),t}function H(e){const t=new p.Writer;return t.startSequence(),t.writeInt(0,p.Integer),t.startSequence(),t.writeOID("1.3.101.112"),t.endSequence(),t.startSequence(p.OctetString),t.writeBuffer(e,p.OctetString),t.endSequence(),t.endSequence(),R("PRIVATE",t.buffer)}function Q(e,t){const r=new p.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.10045.2.1"),r.writeOID(e),r.endSequence(),r.startSequence(p.BitString),r.writeByte(0),r._ensure(t.length),r._buf.set(t,r._offset),r._offset+=t.length,r.endSequence(),r.endSequence(),R("PUBLIC",r.buffer)}function q(e,t){let r;switch(e){case"1.2.840.10045.3.1.7":r="nistp256";break;case"1.3.132.0.34":r="nistp384";break;case"1.3.132.0.35":r="nistp521";break;default:return}const s=Buffer.allocUnsafe(39+t.length);return w(s,19,0),s.utf8Write(`ecdsa-sha2-${r}`,4,19),w(s,8,23),s.utf8Write(r,27,8),w(s,t.length,35),s.set(t,39),s}function $(e,t,r){const s=new p.Writer;return s.startSequence(),s.writeInt(1,p.Integer),s.writeBuffer(r,p.OctetString),s.startSequence(160),s.writeOID(e),s.endSequence(),s.startSequence(161),s.startSequence(p.BitString),s.writeByte(0),s._ensure(t.length),s._buf.set(t,s._offset),s._offset+=t.length,s.endSequence(),s.endSequence(),s.endSequence(),R("EC PRIVATE",s.buffer)}const j={sign:"function"==typeof u?function(e,t){const r=this[S];if(null===r)return new Error("No private key available");t&&"string"==typeof t||(t=this[v]);try{return u(t,e,r)}catch(e){return e}}:function(e,t){const r=this[S];if(null===r)return new Error("No private key available");t&&"string"==typeof t||(t=this[v]);const s=a(t);s.update(e);try{return s.sign(r)}catch(e){return e}},verify:"function"==typeof h?function(e,t,r){const s=this[k];if(null===s)return new Error("No public key available");r&&"string"==typeof r||(r=this[v]);try{return h(r,e,s,t)}catch(e){return e}}:function(e,t,r){const s=this[k];if(null===s)return new Error("No public key available");r&&"string"==typeof r||(r=this[v]);const n=c(r);n.update(e);try{return n.verify(s,t)}catch(e){return e}},isPrivateKey:function(){return null!==this[S]},getPrivatePEM:function(){return this[S]},getPublicPEM:function(){return this[k]},getPublicSSH:function(){return this[I]},equals:function(e){const t=ee(e);return!(t instanceof Error)&&this.type===t.type&&this[S]===t[S]&&this[k]===t[k]&&this[I]===t[I]}};function K(e,t,r,s,n,i,o){this.type=e,this.comment=t,this[S]=r,this[k]=s,this[I]=n,this[v]=i,this[T]=o}K.prototype=j;{const ne=/^-----BEGIN OPENSSH PRIVATE KEY-----(?:\r\n|\n)([\s\S]+)(?:\r\n|\n)-----END OPENSSH PRIVATE KEY-----$/;function ie(e,t,r){const s=[];if(e.length<8)return new Error("Malformed OpenSSH private key");if(b(e,0)!==b(e,4))return r?new Error("OpenSSH key integrity check failed -- bad passphrase?"):new Error("OpenSSH key integrity check failed");let n,i;for(e._pos=8,n=0;n<t;++n){let t,n,o,a;const c=y(e,e._pos,!0);if(void 0===c)return new Error("Malformed OpenSSH private key");switch(c){case"ssh-rsa":{const r=y(e,e._pos);if(void 0===r)return new Error("Malformed OpenSSH private key");const s=y(e,e._pos);if(void 0===s)return new Error("Malformed OpenSSH private key");const i=y(e,e._pos);if(void 0===i)return new Error("Malformed OpenSSH private key");const c=y(e,e._pos);if(void 0===c)return new Error("Malformed OpenSSH private key");const l=y(e,e._pos);if(void 0===l)return new Error("Malformed OpenSSH private key");const u=y(e,e._pos);if(void 0===u)return new Error("Malformed OpenSSH private key");o=N(r,s),a=L(r,s),n=U(r,s,i,c,l,u),t="sha1";break}case"ssh-dss":{const r=y(e,e._pos);if(void 0===r)return new Error("Malformed OpenSSH private key");const s=y(e,e._pos);if(void 0===s)return new Error("Malformed OpenSSH private key");const i=y(e,e._pos);if(void 0===i)return new Error("Malformed OpenSSH private key");const c=y(e,e._pos);if(void 0===c)return new Error("Malformed OpenSSH private key");const l=y(e,e._pos);if(void 0===l)return new Error("Malformed OpenSSH private key");o=D(r,s,i,c),a=F(r,s,i,c),n=x(r,s,i,c,l),t="sha1";break}case"ssh-ed25519":{if(!m)return new Error(`Unsupported OpenSSH private key type: ${c}`);const r=y(e,e._pos);if(void 0===r||32!==r.length)return new Error("Malformed OpenSSH private key");const s=y(e,e._pos);if(void 0===s||64!==s.length)return new Error("Malformed OpenSSH private key");o=G(r),a=M(r),n=H(A(s,0,32)),t=null;break}case"ecdsa-sha2-nistp256":t="sha256",i="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":void 0===t&&(t="sha384",i="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(void 0===t&&(t="sha512",i="1.3.132.0.35"),!P(e,1))return new Error("Malformed OpenSSH private key");const r=y(e,e._pos);if(void 0===r)return new Error("Malformed OpenSSH private key");const s=y(e,e._pos);if(void 0===s)return new Error("Malformed OpenSSH private key");o=Q(i,r),a=q(i,r),n=$(i,r,s);break}default:return new Error(`Unsupported OpenSSH private key type: ${c}`)}const l=y(e,e._pos,!0);if(void 0===l)return new Error("Malformed OpenSSH private key");s.push(new K(c,l,n,o,a,t,r))}let o=0;for(n=e._pos;n<e.length;++n)if(e[n]!==++o%255)return new Error("Malformed OpenSSH private key");return s}K.parse=(e,t)=>{const r=ne.exec(e);if(null===r)return null;let n;const i=Buffer.from(r[1],"base64");if(i.length<31)return new Error("Malformed OpenSSH private key");const o=i.utf8Slice(0,15);if("openssh-key-v1\0"!==o)return new Error(`Unsupported OpenSSH key magic: ${o}`);const a=y(i,15,!0);if(void 0===a)return new Error("Malformed OpenSSH private key");if("none"!==a&&-1===_.indexOf(a))return new Error(`Unsupported cipher for OpenSSH key: ${a}`);const c=y(i,i._pos,!0);if(void 0===c)return new Error("Malformed OpenSSH private key");if("none"!==c){if("none"===a)return new Error("Malformed OpenSSH private key");if("bcrypt"!==c)return new Error(`Unsupported kdf name for OpenSSH key: ${c}`);if(!t)return new Error("Encrypted private OpenSSH key detected, but no passphrase given")}else if("none"!==a)return new Error("Malformed OpenSSH private key");let l,u,h;"none"!==a&&(l=g[a]);const d=y(i,i._pos);if(void 0===d)return new Error("Malformed OpenSSH private key");if(d.length)switch(c){case"none":return new Error("Malformed OpenSSH private key");case"bcrypt":{const e=y(d,0);if(void 0===e||d._pos+4>d.length)return new Error("Malformed OpenSSH private key");const r=b(d,d._pos),s=Buffer.allocUnsafe(l.keyLen+l.ivLen);if(0!==f(t,t.length,e,e.length,s,s.length,r))return new Error("Failed to generate information to decrypt key");u=A(s,0,l.keyLen),h=A(s,l.keyLen,s.length);break}}else if("none"!==c)return new Error("Malformed OpenSSH private key");if(i._pos+3>=i.length)return new Error("Malformed OpenSSH private key");const p=b(i,i._pos);if(i._pos+=4,p>0){for(let e=0;e<p;++e){const e=y(i,i._pos);if(void 0===e)return new Error("Malformed OpenSSH private key");if(void 0===y(e,0,!0))return new Error("Malformed OpenSSH private key")}let e=y(i,i._pos);if(void 0===e)return new Error("Malformed OpenSSH private key");if(void 0!==u){if(e.length<l.blockLen||e.length%l.blockLen!=0)return new Error("Malformed OpenSSH private key");try{const t={authTagLength:l.authLen},r=s(l.sslName,u,h,t);if(r.setAutoPadding(!1),l.authLen>0){if(i.length-i._pos<l.authLen)return new Error("Malformed OpenSSH private key");r.setAuthTag(A(i,i._pos,i._pos+=l.authLen))}e=B(r.update(e),r.final())}catch(e){return e}}if(i._pos!==i.length)return new Error("Malformed OpenSSH private key");n=ie(e,p,void 0!==u)}else n=[];return n instanceof Error?n:n[0]}}function W(e,t,r,s,n,i,o){this.type=e,this.comment=t,this[S]=r,this[k]=s,this[I]=n,this[v]=i,this[T]=o}W.prototype=j;{const oe=/^-----BEGIN (RSA|DSA|EC) PRIVATE KEY-----(?:\r\n|\n)((?:[^:]+:\s*[\S].*(?:\r\n|\n))*)([\s\S]+)(?:\r\n|\n)-----END (RSA|DSA|EC) PRIVATE KEY-----$/;W.parse=(e,t)=>{const r=oe.exec(e);if(null===r)return null;let o,a,c,l,u,h,f=Buffer.from(r[3],"base64"),g=r[2],m=!1;if(void 0!==g){g=g.split(/\r\n|\n/g);for(let e=0;e<g.length;++e){const r=g[e];let n=r.indexOf(":");if("DEK-Info"===r.slice(0,n)){const e=r.slice(n+2);if(n=e.indexOf(","),-1===n)continue;const o=e.slice(0,n).toLowerCase();if(-1===d.indexOf(o))return new Error(`Cipher (${o}) not supported for encrypted OpenSSH private key`);const a=C[o];if(!a)return new Error(`Cipher (${o}) not supported for encrypted OpenSSH private key`);const c=Buffer.from(e.slice(n+1),"hex");if(c.length!==a.ivLen)return new Error("Malformed encrypted OpenSSH private key");if(!t)return new Error("Encrypted OpenSSH private key detected, but no passphrase given");const l=A(c,0,8);let u=i("md5").update(t).update(l).digest();for(;u.length<a.keyLen;)u=B(u,i("md5").update(u).update(t).update(l).digest());u.length>a.keyLen&&(u=A(u,0,a.keyLen));try{const e=s(o,u,c);e.setAutoPadding(!1),f=B(e.update(f),e.final()),m=!0}catch(e){return e}}}}let _="Malformed OpenSSH private key";switch(m&&(_+=". Bad passphrase?"),r[1]){case"RSA":o="ssh-rsa",a=R("RSA PRIVATE",f);try{h=new p.Reader(f),h.readSequence(),h.readInt();const e=h.readString(p.Integer,!0);if(null===e)return new Error(_);const t=h.readString(p.Integer,!0);if(null===t)return new Error(_);c=N(e,t),l=L(e,t)}catch{return new Error(_)}u="sha1";break;case"DSA":o="ssh-dss",a=R("DSA PRIVATE",f);try{h=new p.Reader(f),h.readSequence(),h.readInt();const e=h.readString(p.Integer,!0);if(null===e)return new Error(_);const t=h.readString(p.Integer,!0);if(null===t)return new Error(_);const r=h.readString(p.Integer,!0);if(null===r)return new Error(_);const s=h.readString(p.Integer,!0);if(null===s)return new Error(_);c=D(e,t,r,s),l=F(e,t,r,s)}catch{return new Error(_)}u="sha1";break;case"EC":{let e,t,r;try{h=new p.Reader(f),h.readSequence(),h.readInt(),t=h.readString(p.OctetString,!0),h.readByte();const s=h.readLength();if(null===s)return new Error(_);if(h._offset=s,r=h.readOID(),null===r)return new Error(_);switch(r){case"1.2.840.10045.3.1.7":e="prime256v1",o="ecdsa-sha2-nistp256",u="sha256";break;case"1.3.132.0.34":e="secp384r1",o="ecdsa-sha2-nistp384",u="sha384";break;case"1.3.132.0.35":e="secp521r1",o="ecdsa-sha2-nistp521",u="sha512";break;default:return new Error(`Unsupported private key EC OID: ${r}`)}}catch{return new Error(_)}a=R("EC PRIVATE",f);const s=function(e,t){const r=n(e);return r.setPrivateKey(t),r.getPublicKey()}(e,t);c=Q(r,s),l=q(r,s);break}}return new W(o,"",a,c,l,u,m)}}function Y(e,t,r,s,n,i,o){this.type=e,this.comment=t,this[S]=r,this[k]=s,this[I]=n,this[v]=i,this[T]=o}Y.prototype=j;{const ae=Buffer.alloc(0),ce=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),le=Buffer.from([0,0,0,0]),ue=Buffer.from([0,0,0,1]),he=/^PuTTY-User-Key-File-2: (ssh-(?:rsa|dss))\r?\nEncryption: (aes256-cbc|none)\r?\nComment: ([^\r\n]*)\r?\nPublic-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-MAC: ([^\r\n]+)/;Y.parse=(e,t)=>{const r=he.exec(e);if(null===r)return null;const n=r[2],a="none"!==n;if(a&&!t)return new Error("Encrypted PPK private key detected, but no passphrase given");let c=Buffer.from(r[5],"base64");if(a){const e=g[n];let r=B(i("sha1").update(le).update(t).digest(),i("sha1").update(ue).update(t).digest());r.length>e.keyLen&&(r=A(r,0,e.keyLen));try{const t=s(e.sslName,r,ce);t.setAutoPadding(!1),c=B(t.update(c),t.final())}catch(e){return e}}const l=r[1],u=r[3],h=Buffer.from(r[4],"base64"),d=r[6],p=l.length,f=n.length,m=Buffer.byteLength(u),_=h.length,E=c.length,b=Buffer.allocUnsafe(4+p+4+f+4+m+4+_+4+E);let v,S,k,I=0;if(w(b,p,I),b.utf8Write(l,I+=4,p),w(b,f,I+=p),b.utf8Write(n,I+=4,f),w(b,m,I+=f),b.utf8Write(u,I+=4,m),w(b,_,I+=m),b.set(h,I+=4),w(b,E,I+=_),b.set(c,I+4),t||(t=ae),o("sha1",i("sha1").update("putty-private-key-file-mac-key").update(t).digest()).update(b).digest("hex")!==d)return a?new Error("PPK private key integrity check failed -- bad passphrase?"):new Error("PPK private key integrity check failed");switch(h._pos=0,P(h,1),l){case"ssh-rsa":{const e=y(h,h._pos);if(void 0===e)return new Error("Malformed PPK public key");const t=y(h,h._pos);if(void 0===t)return new Error("Malformed PPK public key");const r=y(c,0);if(void 0===r)return new Error("Malformed PPK private key");const s=y(c,c._pos);if(void 0===s)return new Error("Malformed PPK private key");const n=y(c,c._pos);if(void 0===n)return new Error("Malformed PPK private key");const i=y(c,c._pos);if(void 0===i)return new Error("Malformed PPK private key");v=N(t,e),S=L(t,e),k=U(t,e,r,i,s,n);break}case"ssh-dss":{const e=y(h,h._pos);if(void 0===e)return new Error("Malformed PPK public key");const t=y(h,h._pos);if(void 0===t)return new Error("Malformed PPK public key");const r=y(h,h._pos);if(void 0===r)return new Error("Malformed PPK public key");const s=y(h,h._pos);if(void 0===s)return new Error("Malformed PPK public key");const n=y(c,0);if(void 0===n)return new Error("Malformed PPK private key");v=D(e,t,r,s),S=F(e,t,r,s),k=x(e,t,r,s,n);break}}return new Y(l,u,k,v,S,"sha1",a)}}function z(e,t,r,s,n){this.type=e,this.comment=t,this[S]=null,this[k]=r,this[I]=s,this[v]=n,this[T]=!1}z.prototype=j;{let de;de=m?/^(((?:ssh-(?:rsa|dss|ed25519))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/:/^(((?:ssh-(?:rsa|dss))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/,z.parse=e=>{const t=de.exec(e);if(null===t)return null;const r=t[1],s=t[2],n=Buffer.from(t[3],"base64"),i=t[4]||"",o=y(n,n._pos,!0);return void 0===o||0!==o.indexOf(s)?new Error("Malformed OpenSSH public key"):X(n,s,i,r)}}function V(e,t,r,s,n){this.type=e,this.comment=t,this[S]=null,this[k]=r,this[I]=s,this[v]=n,this[T]=!1}V.prototype=j;{const pe=/^---- BEGIN SSH2 PUBLIC KEY ----(?:\r?\n)((?:.{0,72}\r?\n)+)---- END SSH2 PUBLIC KEY ----$/,fe=/^[A-Z0-9a-z/+=\r\n]+$/,ge=/^([\x21-\x39\x3B-\x7E]{1,64}): ((?:[^\\]*\\\r?\n)*[^\r\n]+)\r?\n/gm,me=/\\\r?\n/g;V.parse=e=>{let t=pe.exec(e);if(null===t)return null;const r=t[1];let s=0,n="";for(;t=ge.exec(r);){const e=t[1],r=t[2].replace(me,"");if(r.length>1024)return ge.lastIndex=0,new Error("Malformed RFC4716 public key");s=ge.lastIndex,"comment"===e.toLowerCase()&&(n=r,n.length>1&&34===n.charCodeAt(0)&&34===n.charCodeAt(n.length-1)&&(n=n.slice(1,-1)))}let i=r.slice(s);if(!fe.test(i))return new Error("Malformed RFC4716 public key");i=Buffer.from(i,"base64");const o=y(i,0,!0);if(void 0===o)return new Error("Malformed RFC4716 public key");let a=null,c=null;switch(o){case"ssh-rsa":{const e=y(i,i._pos);if(void 0===e)return new Error("Malformed RFC4716 public key");const t=y(i,i._pos);if(void 0===t)return new Error("Malformed RFC4716 public key");a=N(t,e),c=L(t,e);break}case"ssh-dss":{const e=y(i,i._pos);if(void 0===e)return new Error("Malformed RFC4716 public key");const t=y(i,i._pos);if(void 0===t)return new Error("Malformed RFC4716 public key");const r=y(i,i._pos);if(void 0===r)return new Error("Malformed RFC4716 public key");const s=y(i,i._pos);if(void 0===s)return new Error("Malformed RFC4716 public key");a=D(e,t,r,s),c=F(e,t,r,s);break}default:return new Error("Malformed RFC4716 public key")}return new V(o,n,a,c,"sha1")}}function X(e,t,r,s){if(!J(t))return new Error(`Unsupported OpenSSH public key type: ${t}`);let n,i,o=null,a=null;switch(t){case"ssh-rsa":{const t=y(e,e._pos||0);if(void 0===t)return new Error("Malformed OpenSSH public key");const r=y(e,e._pos);if(void 0===r)return new Error("Malformed OpenSSH public key");o=N(r,t),a=L(r,t),n="sha1";break}case"ssh-dss":{const t=y(e,e._pos||0);if(void 0===t)return new Error("Malformed OpenSSH public key");const r=y(e,e._pos);if(void 0===r)return new Error("Malformed OpenSSH public key");const s=y(e,e._pos);if(void 0===s)return new Error("Malformed OpenSSH public key");const i=y(e,e._pos);if(void 0===i)return new Error("Malformed OpenSSH public key");o=D(t,r,s,i),a=F(t,r,s,i),n="sha1";break}case"ssh-ed25519":{const t=y(e,e._pos||0);if(void 0===t||32!==t.length)return new Error("Malformed OpenSSH public key");o=G(t),a=M(t),n=null;break}case"ecdsa-sha2-nistp256":n="sha256",i="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":void 0===n&&(n="sha384",i="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(void 0===n&&(n="sha512",i="1.3.132.0.35"),!P(e,1))return new Error("Malformed OpenSSH public key");const t=y(e,e._pos||0);if(void 0===t)return new Error("Malformed OpenSSH public key");o=Q(i,t),a=q(i,t);break}default:return new Error(`Unsupported OpenSSH public key type: ${t}`)}return new z(s,r,o,a,n)}function J(e){switch(e){case"ssh-rsa":case"ssh-dss":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":return!0;case"ssh-ed25519":if(m)return!0;default:return!1}}function Z(e){return!!e&&"boolean"==typeof e[T]}function ee(e,t){if(Z(e))return e;let r,s;if(Buffer.isBuffer(e))r=e,e=e.utf8Slice(0,e.length).trim();else{if("string"!=typeof e)return new Error("Key data must be a Buffer or string");e=e.trim()}if(null!=t)if("string"==typeof t)t=Buffer.from(t);else if(!Buffer.isBuffer(t))return new Error("Passphrase must be a string or Buffer when supplied");if(null!==(s=K.parse(e,t)))return s;if(null!==(s=W.parse(e,t)))return s;if(null!==(s=Y.parse(e,t)))return s;if(null!==(s=z.parse(e)))return s;if(null!==(s=V.parse(e)))return s;if(r){O.init(r,0);const t=O.readString(!0);void 0!==t&&void 0!==(e=O.readRaw())&&(s=X(e,t,"",t),s instanceof Error&&(s=null)),O.clear()}return s||new Error("Unsupported key format")}e.exports={isParsedKey:Z,isSupportedKeyType:J,parseDERKey:(e,t)=>X(e,t,"",t),parseKey:ee}},5607:(e,t,r)=>{"use strict";const s=r(9491),{inspect:n}=r(3837);function i(e){let t="",r=e.length;const s="-"===e[0]?1:0;for(;r>=s+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function o(e,t){if(s("string"==typeof t,"`thing` has to be of type string"),Array.isArray(e)){const r=e.length;return s(r>0,"At least one expected value needs to be specified"),e=e.map((e=>String(e))),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}t.ERR_INTERNAL_ASSERTION=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,e);const r="This is caused by either a bug in ssh2 or incorrect usage of ssh2 internals.\nPlease open an issue with this stack trace at https://github.com/mscdex/ssh2/issues\n";this.message=void 0===t?r:`${t}\n${r}`}};const a=(()=>{try{return new Function("return 2n ** 32n")()}catch{}})();t.ERR_OUT_OF_RANGE=class e extends RangeError{constructor(t,r,o,c){super(),Error.captureStackTrace(this,e),s(r,'Missing "range" argument');let l,u=c?t:`The value of "${t}" is out of range.`;Number.isInteger(o)&&Math.abs(o)>4294967296?l=i(String(o)):"bigint"==typeof o?(l=String(o),(o>a||o<-a)&&(l=i(l)),l+="n"):l=n(o),u+=` It must be ${r}. Received ${l}`,this.message=u}};class c extends TypeError{constructor(e,t,r){let n,i;if(super(),Error.captureStackTrace(this,c),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&t.startsWith("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be",e.endsWith(" argument"))i=`The ${e} ${n} ${o(t,"type")}`;else{const r=e.includes(".")?"property":"argument";i=`The "${e}" ${r} ${n} ${o(t,"type")}`}i+=". Received type "+typeof r,this.message=i}}t.ERR_INVALID_ARG_TYPE=c,t.validateNumber=function(e,t){if("number"!=typeof e)throw new c(t,"number",e)}},9205:(e,t,r)=>{"use strict";const s=r(476).Ber;let n;const i=Buffer[Symbol.species],o=Object.getPrototypeOf(Uint8Array.prototype).fill;function a(e,t){return 16777216*e[t++]+65536*e[t++]+256*e[t++]+e[t]}function c(e,t,r,s,n){n||(n=0),s>e.length&&(s=e.length);let i=s-r;const o=t.length-n;return i>o&&(i=o),t.set(new Uint8Array(e.buffer,e.byteOffset+r,i),n),i}function l(e,t,r){return void 0===r&&(r=e.length),new i(e.buffer,e.byteOffset+t,r-t)}function u(){let e,t=0;const r={init:(r,s)=>{e=r,t="number"==typeof s?s:0},pos:()=>t,length:()=>e?e.length:0,avail:()=>e&&t<e.length?e.length-t:0,clear:()=>{e=void 0},readUInt32BE:()=>{if(e&&!(t+3>=e.length))return 16777216*e[t++]+65536*e[t++]+256*e[t++]+e[t++]},readUInt64BE:r=>{if(e&&!(t+7>=e.length))switch(r){case"always":return BigInt(`0x${e.hexSlice(t,t+=8)}`);case"maybe":if(e[t]>31)return BigInt(`0x${e.hexSlice(t,t+=8)}`);default:return 72057594037927940*e[t++]+281474976710656*e[t++]+1099511627776*e[t++]+4294967296*e[t++]+16777216*e[t++]+65536*e[t++]+256*e[t++]+e[t++]}},skip:r=>{e&&r>0&&(t+=r)},skipString:()=>{const s=r.readUInt32BE();if(void 0!==s)return t+=s,t<=e.length?s:void 0},readByte:()=>{if(e&&t<e.length)return e[t++]},readBool:()=>{if(e&&t<e.length)return!!e[t++]},readList:()=>{const e=r.readString(!0);if(void 0!==e)return e?e.split(","):[]},readString:(s,n)=>{"number"==typeof s&&(n=s,s=void 0);const i=r.readUInt32BE();if(void 0!==i&&!(e.length-t<i||"number"==typeof n&&i>n))return s?Buffer.isBuffer(s)?c(e,s,t,t+=i):e.utf8Slice(t,t+=i):l(e,t,t+=i)},readRaw:r=>{if(e)return"number"!=typeof r?l(e,t,t+=e.length-t):e.length-t>=r?l(e,t,t+=r):void 0}};return r}function h(e,t,r){const s=new Error(e);return"boolean"==typeof t?(r=t,s.level="protocol"):s.level=t||"protocol",s.fatal=!!r,s}function d(e,t,r){return e[r++]=t>>>24,e[r++]=t>>>16,e[r++]=t>>>8,e[r++]=t,r}const p=u();e.exports={bufferCopy:c,bufferSlice:l,FastBuffer:i,bufferFill:(e,t,r,s)=>o.call(e,t,r,s),makeError:h,doFatalError:(e,t,s,i)=>{let o;return void 0===n&&({DISCONNECT_REASON:n}=r(3190)),t instanceof Error?(o=t,i="number"!=typeof s?n.PROTOCOL_ERROR:s):o=h(t,s,!0),"number"!=typeof i&&(i=n.PROTOCOL_ERROR),e.disconnect(i),e._destruct(),e._onError(o),1/0},readUInt32BE:a,writeUInt32BE:d,writeUInt32LE:(e,t,r)=>(e[r++]=t,e[r++]=t>>>8,e[r++]=t>>>16,e[r++]=t>>>24,r),makeBufferParser:u,bufferParser:u(),readString:(e,t,r,s)=>{"number"==typeof r&&(s=r,r=void 0),void 0===t&&(t=0);const n=e.length-t;if(t<0||t>=e.length||n<4)return;const i=a(e,t);if(n<4+i||"number"==typeof s&&i>s)return;const o=(t+=4)+i;return e._pos=o,r?Buffer.isBuffer(r)?c(e,r,t,o):e.utf8Slice(t,o):l(e,t,o)},sigSSHToASN1:(e,t)=>{switch(t){case"ssh-dss":{if(e.length>40)return e;const t=new s.Writer;t.startSequence();let r=e.slice(0,20),n=e.slice(20);if(128&r[0]){const e=Buffer.allocUnsafe(21);e[0]=0,r.copy(e,1),r=e}else 0!==r[0]||128&r[1]||(r=r.slice(1));if(128&n[0]){const e=Buffer.allocUnsafe(21);e[0]=0,n.copy(e,1),n=e}else 0!==n[0]||128&n[1]||(n=n.slice(1));return t.writeBuffer(r,s.Integer),t.writeBuffer(n,s.Integer),t.endSequence(),t.buffer}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{p.init(e,0);const t=p.readString(),r=p.readString();if(p.clear(),void 0===t||void 0===r)return;const n=new s.Writer;return n.startSequence(),n.writeBuffer(t,s.Integer),n.writeBuffer(r,s.Integer),n.endSequence(),n.buffer}default:return e}},convertSignature:(e,t)=>{switch(t){case"ssh-dss":{if(e.length<=40)return e;const t=new s.Reader(e);t.readSequence();let r=t.readString(s.Integer,!0),n=t.readString(s.Integer,!0),i=0,o=0;if(r.length<20){const e=Buffer.allocUnsafe(20);e.set(r,1),r=e,r[0]=0}if(n.length<20){const e=Buffer.allocUnsafe(20);e.set(n,1),n=e,n[0]=0}r.length>20&&0===r[0]&&(i=1),n.length>20&&0===n[0]&&(o=1);const a=Buffer.allocUnsafe(r.length-i+(n.length-o));return c(r,a,i,r.length,0),c(n,a,o,n.length,r.length-i),a}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{if(0===e[0])return e;const t=new s.Reader(e);t.readSequence();const r=t.readString(s.Integer,!0),n=t.readString(s.Integer,!0);if(null===r||null===n)return;const i=Buffer.allocUnsafe(4+r.length+4+n.length);return d(i,r.length,0),i.set(r,4),d(i,n.length,4+r.length),i.set(n,8+r.length),i}}return e},sendPacket:(e,t,r)=>r||void 0===e._kexinit?(e._cipher.encrypt(t),!0):(void 0===e._queue&&(e._queue=[]),e._queue.push(t),e._debug&&e._debug("Outbound: ... packet queued"),!1)}},6993:(e,t,r)=>{"use strict";const{kMaxLength:s}=r(4300),{createInflate:n,constants:{DEFLATE:i,INFLATE:o,Z_DEFAULT_CHUNK:a,Z_DEFAULT_COMPRESSION:c,Z_DEFAULT_MEMLEVEL:l,Z_DEFAULT_STRATEGY:u,Z_DEFAULT_WINDOWBITS:h,Z_PARTIAL_FLUSH:d}}=r(9796),p=n()._handle.constructor;function f(){throw new Error("Should not get here")}function g(e,t,r){const s=this._owner,n=new Error(e);n.errno=t,n.code=r,s._err=n}function m(e){e._handle&&(e._handle.close(),e._handle=null)}class _{constructor(e){const t=h,r=c,n=l,i=u;this._err=void 0,this._writeState=new Uint32Array(2),this._chunkSize=a,this._maxOutputLength=s,this._outBuffer=Buffer.allocUnsafe(this._chunkSize),this._outOffset=0,this._handle=new p(e),this._handle._owner=this,this._handle.onerror=g,this._handle.init(t,r,n,i,this._writeState,f,void 0)}writeSync(e,t){const r=this._handle;if(!r)throw new Error("Invalid Zlib instance");let s,n,i,o=e.length,a=this._chunkSize-this._outOffset,c=0,l=0;const u=this._writeState;let h=this._outBuffer,p=this._outOffset;const f=this._chunkSize;for(;;){if(r.writeSync(d,e,c,o,h,p,a),this._err)throw this._err;s=u[0],n=u[1];const t=o-n,g=a-s;if(g>0){const e=0===p&&g===h.length?h:h.slice(p,p+g);if(p+=g,i?void 0===i.push?i=[i,e]:i.push(e):i=e,l+=e.byteLength,l>this._maxOutputLength)throw m(this),new Error(`Output length exceeded maximum of ${this._maxOutputLength}`)}else if(0!==g)throw new Error("have should not go down");if((0===s||p>=f)&&(a=f,p=0,h=Buffer.allocUnsafe(f)),0!==s)break;c+=t,o=n}if(this._outBuffer=h,this._outOffset=p,0===l&&(i=Buffer.alloc(0)),t)return i.totalLen=l,i;if(void 0===i.push)return i;const g=Buffer.allocUnsafe(l);for(let e=0,t=0;e<i.length;++e){const r=i[e];g.set(r,t),t+=r.length}return g}}e.exports={PacketReader:class{cleanup(){}read(e){return e}},PacketWriter:class{constructor(e){this.allocStart=5,this.allocStartKEX=5,this._protocol=e}cleanup(){}alloc(e,t){return void 0===this._protocol._kexinit||t?this._protocol._cipher.allocPacket(e):Buffer.allocUnsafe(e)}finalize(e,t){return e}},ZlibPacketReader:class{constructor(){this._zlib=new _(o)}cleanup(){this._zlib&&m(this._zlib)}read(e){return this._zlib.writeSync(e,!1)}},ZlibPacketWriter:class{constructor(e){this.allocStart=0,this.allocStartKEX=0,this._protocol=e,this._zlib=new _(i)}cleanup(){this._zlib&&m(this._zlib)}alloc(e,t){return Buffer.allocUnsafe(e)}finalize(e,t){if(void 0===this._protocol._kexinit||t){const t=this._zlib.writeSync(e,!0),r=this._protocol._cipher.allocPacket(t.totalLen);if(void 0===t.push)r.set(t,5);else for(let e=0,s=5;e<t.length;++e){const n=t[e];r.set(n,s),s+=n.length}return r}return e}}}},7465:(e,t,r)=>{"use strict";const{Server:s}=r(1808),n=r(2361),{listenerCount:i}=n,{CHANNEL_OPEN_FAILURE:o,DEFAULT_CIPHER:a,DEFAULT_COMPRESSION:c,DEFAULT_KEX:l,DEFAULT_MAC:u,DEFAULT_SERVER_HOST_KEY:h,DISCONNECT_REASON:d,DISCONNECT_REASON_BY_VALUE:p,SUPPORTED_CIPHER:f,SUPPORTED_COMPRESSION:g,SUPPORTED_KEX:m,SUPPORTED_MAC:_,SUPPORTED_SERVER_HOST_KEY:A}=r(3190),{init:E}=r(8545),{KexInit:y}=r(5260),{parseKey:b}=r(3781),w=r(3603),{SFTP:v}=r(4061),{writeUInt32BE:S}=r(9205),{Channel:k,MAX_WINDOW:I,PACKET_SIZE:T,windowAdjust:C,WINDOW_THRESHOLD:O}=r(491),{ChannelManager:R,generateAlgorithmList:B,isWritable:P,onChannelOpenFailure:N,onCHANNEL_CLOSE:L}=r(7236);class U extends n{constructor(e,t,r,s,n){super(),this.username=this.user=t,this.service=r,this.method=s,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=(e,t,r)=>{this._finalResponse||(this._finalResponse=!0,n(this,e,t,r))},this._protocol=e}accept(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)}reject(e,t){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,e,t)}}class D extends U{constructor(e,t,r,s,n,i){super(e,t,r,s,i),this._multistep=!0,this._cb=void 0,this._onInfoResponse=e=>{const t=this._cb;t&&(this._cb=void 0,t(e))},this.submethods=n,this.on("abort",(()=>{this._cb&&this._cb(new Error("Authentication request aborted"))}))}prompt(e,t,r,s){Array.isArray(e)||(e=[e]),"function"==typeof t?(s=t,t=r=void 0):"function"==typeof r?(s=r,r=void 0):"function"!=typeof s&&(s=void 0);for(let t=0;t<e.length;++t)"string"==typeof e[t]&&(e[t]={prompt:e[t],echo:!0});this._cb=s,this._initialResponse=!0,this._protocol.authInfoReq(t,r,e)}}class F extends U{constructor(e,t,r,s,n,i){super(e,t,r,s,i),this.key={algo:n.keyAlgo,data:n.key},this.hashAlgo=n.hashAlgo,this.signature=n.signature,this.blob=n.blob}accept(){this.signature?U.prototype.accept.call(this):(this._initialResponse=!0,this._protocol.authPKOK(this.key.algo,this.key.data))}}class x extends U{constructor(e,t,r,s,n,i){super(e,t,r,s,i),this.key={algo:n.keyAlgo,data:n.key},this.hashAlgo=n.hashAlgo,this.signature=n.signature,this.blob=n.blob,this.localHostname=n.localHostname,this.localUsername=n.localUsername}}class G extends U{constructor(e,t,r,s,n,i){super(e,t,r,s,i),this.password=n,this._changeCb=void 0}requestChange(e,t){if(this._changeCb)throw new Error("Change request already in progress");if("string"!=typeof e)throw new Error("prompt argument must be a string");if("function"!=typeof t)throw new Error("Callback argument must be a function");this._changeCb=t,this._protocol.authPasswdChg(e)}}class M extends n{constructor(e,t,r){super(),this.type="session",this.subtype=void 0,this.server=!0,this._ending=!1,this._channel=void 0,this._chanInfo={type:"session",incoming:{id:r,window:I,packetSize:T,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}}}}class H extends n{constructor(e,t){if(super(),"object"!=typeof e||null===e)throw new Error("Missing configuration object");const r=Object.create(null),n=[],i=e.hostKeys;if(!Array.isArray(i))throw new Error("hostKeys must be an array");const o="object"==typeof e.algorithms&&null!==e.algorithms?e.algorithms:{},d=B(o.serverHostKey,h,A);for(let e=0;e<i.length;++e){let t;if(t=Buffer.isBuffer(i[e])||"string"==typeof i[e]?b(i[e]):b(i[e].key,i[e].passphrase),t instanceof Error)throw new Error(`Cannot parse privateKey: ${t.message}`);if(Array.isArray(t)&&(t=t[0]),null===t.getPrivatePEM())throw new Error("privateKey value contains an invalid private key");if(!n.includes(t.type))if("ssh-rsa"===t.type){let e=d.indexOf("ssh-rsa");const s=d.indexOf("rsa-sha2-256"),i=d.indexOf("rsa-sha2-512");-1===e&&(e=1/0),[e,s,i].sort($).forEach((o=>{if(-1===o)return;let a;switch(o){case e:a="ssh-rsa";break;case s:a="rsa-sha2-256";break;case i:a="rsa-sha2-512";break;default:return}r[a]=t,n.push(a)}))}else r[t.type]=t,n.push(t.type)}const p={kex:B(o.kex,l,m),serverHostKey:n,cs:{cipher:B(o.cipher,a,f),mac:B(o.hmac,u,_),compress:B(o.compress,c,g),lang:[]},sc:void 0};p.sc=p.cs,"function"==typeof t&&this.on("connection",t);const E="function"==typeof e.debug?e.debug:void 0,w=e.ident?Buffer.from(e.ident):void 0,v=new y(p);this._srv=new s((t=>{if(this._connections>=this.maxConnections)return void t.destroy();let s;if(++this._connections,t.once("close",(()=>{--this._connections})),E){const e=`[${process.hrtime().join(".")}] `;s=t=>{E(`${e}${t}`)}}new Q(t,r,w,v,s,this,e)})).on("error",(e=>{this.emit("error",e)})).on("listening",(()=>{this.emit("listening")})).on("close",(()=>{this.emit("close")})),this._connections=0,this.maxConnections=1/0}injectSocket(e){this._srv.emit("connection",e)}listen(...e){return this._srv.listen(...e),this}address(){return this._srv.address()}getConnections(e){return this._srv.getConnections(e),this}close(e){return this._srv.close(e),this}ref(){return this._srv.ref(),this}unref(){return this._srv.unref(),this}}H.KEEPALIVE_CLIENT_INTERVAL=15e3,H.KEEPALIVE_CLIENT_COUNT_MAX=3;class Q extends n{constructor(e,t,r,s,n,a,c){super();let l,u,h,f=0,g=!1,m=[];const _=[];function A(e){}this._sock=e,this._chanMgr=new R(this),this._debug=n,this.noMoreSessions=!1,this.authenticated=!1,this.on("error",A);const y=n?(e,t,r)=>{n(`Debug output from client: ${JSON.stringify(r)}`)}:void 0,b="number"==typeof c.keepaliveInterval&&isFinite(c.keepaliveInterval)&&c.keepaliveInterval>0?c.keepaliveInterval:"number"==typeof H.KEEPALIVE_CLIENT_INTERVAL&&isFinite(H.KEEPALIVE_CLIENT_INTERVAL)&&H.KEEPALIVE_CLIENT_INTERVAL>0?H.KEEPALIVE_CLIENT_INTERVAL:-1,B="number"==typeof c.keepaliveCountMax&&isFinite(c.keepaliveCountMax)&&c.keepaliveCountMax>=0?c.keepaliveCountMax:"number"==typeof H.KEEPALIVE_CLIENT_COUNT_MAX&&isFinite(H.KEEPALIVE_CLIENT_COUNT_MAX)&&H.KEEPALIVE_CLIENT_COUNT_MAX>=0?H.KEEPALIVE_CLIENT_COUNT_MAX:-1;let Q=0;-1!==b&&-1!==B&&(this.once("ready",(()=>{const e=()=>{clearInterval(u)};this.on("close",e).on("end",e),u=setInterval((()=>{if(++Q>B){clearInterval(u);const e=new Error("Keepalive timeout");e.level="client-timeout",this.emit("error",e),this.end()}else q.ping()}),b)})),h=()=>{u&&u.refresh(),Q=0});const q=this._protocol=new w({server:!0,hostKeys:t,ident:r,offer:s,onPacket:h,greeting:c.greeting,banner:c.banner,onWrite:t=>{P(e)&&e.write(t)},onError:t=>{q._destruct||e.removeAllListeners("data"),this.emit("error",t);try{e.end()}catch{}},onHeader:t=>{this.removeListener("error",A);const r={ip:e.remoteAddress,family:e.remoteFamily,port:e.remotePort,header:t};if(!a.emit("connection",this,r))return q.disconnect(d.BY_APPLICATION),void e.end();t.greeting&&this.emit("greeting",t.greeting)},onHandshakeComplete:e=>{++f>1&&this.emit("rekey"),this.emit("handshake",e)},debug:n,messageHandlers:{DEBUG:y,DISCONNECT:(t,r,s)=>{if(r!==d.BY_APPLICATION){s||void 0===(s=p[r])&&(s=`Unexpected disconnection reason: ${r}`);const e=new Error(s);e.code=r,this.emit("error",e)}e.end()},CHANNEL_OPEN:(e,t)=>{if("session"===t.type&&this.noMoreSessions||!this.authenticated){const e=o.ADMINISTRATIVELY_PROHIBITED;return q.channelOpenFail(t.sender,e)}let r,s,a=-1,c=!1;const l=()=>{c||(c=!0,void 0===r&&(r=-1===a?o.RESOURCE_SHORTAGE:o.CONNECT_FAILED),-1!==a&&this._chanMgr.remove(a),q.channelOpenFail(t.sender,r,""))},u=()=>(a=this._chanMgr.add(),-1===a&&(r=o.RESOURCE_SHORTAGE,n&&n("Automatic rejection of incoming channel open: no channels available")),-1!==a),h=t.data;switch(t.type){case"session":if(i(this,"session")&&u())return s=()=>{if(c)return;c=!0;const e=new M(this,t,a);return this._chanMgr.update(a,e),q.channelOpenConfirm(t.sender,a,I,T),e},void this.emit("session",s,l);break;case"direct-tcpip":if(i(this,"tcpip")&&u())return s=()=>{if(c)return;c=!0;const e={type:void 0,incoming:{id:a,window:I,packetSize:T,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},r=new k(this,e,{server:!0});return this._chanMgr.update(a,r),q.channelOpenConfirm(t.sender,a,I,T),r},void this.emit("tcpip",s,l,h);break;case"direct-streamlocal@openssh.com":if(i(this,"openssh.streamlocal")&&u())return s=()=>{if(c)return;c=!0;const e={type:void 0,incoming:{id:a,window:I,packetSize:T,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},r=new k(this,e,{server:!0});return this._chanMgr.update(a,r),q.channelOpenConfirm(t.sender,a,I,T),r},void this.emit("openssh.streamlocal",s,l,h);break;default:r=o.UNKNOWN_CHANNEL_TYPE,n&&n(`Automatic rejection of unsupported incoming channel open type: ${t.type}`)}void 0===r&&(r=o.ADMINISTRATIVELY_PROHIBITED,n&&n(`Automatic rejection of unexpected incoming channel open for: ${t.type}`)),l()},CHANNEL_OPEN_CONFIRMATION:(e,t)=>{const r=this._chanMgr.get(t.recipient);if("function"!=typeof r)return;const s={type:r.type,incoming:{id:t.recipient,window:I,packetSize:T,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},n=new k(this,s,{server:!0});this._chanMgr.update(t.recipient,n),r(void 0,n)},CHANNEL_OPEN_FAILURE:(e,t,r,s)=>{const n=this._chanMgr.get(t);"function"==typeof n&&N(this,t,{reason:r,description:s},n)},CHANNEL_DATA:(e,t,r)=>{let s=this._chanMgr.get(t);"object"==typeof s&&null!==s&&(s.constructor!==M||(s=s._channel,s))&&0!==s.incoming.window&&(s.incoming.window-=r.length,!1!==s.push(r)?s.incoming.window<=O&&C(s):s._waitChanDrain=!0)},CHANNEL_EXTENDED_DATA:(e,t,r,s)=>{},CHANNEL_WINDOW_ADJUST:(e,t,r)=>{let s=this._chanMgr.get(t);"object"==typeof s&&null!==s&&(s.constructor!==M||(s=s._channel,s))&&(s.outgoing.window+=r,s._waitWindow&&(s._waitWindow=!1,s._chunk?s._write(s._chunk,null,s._chunkcb):s._chunkcb?s._chunkcb():s._chunkErr?s.stderr._write(s._chunkErr,null,s._chunkcbErr):s._chunkcbErr&&s._chunkcbErr()))},CHANNEL_SUCCESS:(e,t)=>{let r=this._chanMgr.get(t);"object"==typeof r&&null!==r&&(r.constructor!==M||(r=r._channel,r))&&r._callbacks.length&&r._callbacks.shift()(!1)},CHANNEL_FAILURE:(e,t)=>{let r=this._chanMgr.get(t);"object"==typeof r&&null!==r&&(r.constructor!==M||(r=r._channel,r))&&r._callbacks.length&&r._callbacks.shift()(!0)},CHANNEL_REQUEST:(e,t,r,s,o)=>{const a=this._chanMgr.get(t);if("object"!=typeof a||null===a)return;let c,l,u=!1;if(a.constructor===M)if(s&&("shell"!==r&&"exec"!==r&&"subsystem"!==r&&(c=()=>{u||a._ending||a._channel||(u=!0,q.channelSuccess(a._chanInfo.outgoing.id))}),l=()=>{u||a._ending||a._channel||(u=!0,q.channelFailure(a._chanInfo.outgoing.id))}),a._ending)l&&l();else{switch(r){case"env":if(i(a,"env"))return void a.emit("env",c,l,{key:o.name,val:o.value});break;case"pty-req":if(i(a,"pty"))return void a.emit("pty",c,l,o);break;case"window-change":i(a,"window-change")?a.emit("window-change",c,l,o):l&&l();break;case"x11-req":if(i(a,"x11"))return void a.emit("x11",c,l,o);break;case"signal":if(i(a,"signal"))return void a.emit("signal",c,l,{name:o});break;case"auth-agent-req@openssh.com":if(i(a,"auth-agent"))return void a.emit("auth-agent",c,l);break;case"shell":if(i(a,"shell"))return c=()=>{if(u||a._ending||a._channel)return;u=!0,s&&q.channelSuccess(a._chanInfo.outgoing.id);const e=new k(this,a._chanInfo,{server:!0});return e.subtype=a.subtype=r,a._channel=e,e},void a.emit("shell",c,l);break;case"exec":if(i(a,"exec"))return c=()=>{if(u||a._ending||a._channel)return;u=!0,s&&q.channelSuccess(a._chanInfo.outgoing.id);const e=new k(this,a._chanInfo,{server:!0});return e.subtype=a.subtype=r,a._channel=e,e},void a.emit("exec",c,l,{command:o});break;case"subsystem":{let e="sftp"===o;if(c=()=>{if(u||a._ending||a._channel)return;let t;return u=!0,s&&q.channelSuccess(a._chanInfo.outgoing.id),e?t=new v(this,a._chanInfo,{server:!0,debug:n}):(t=new k(this,a._chanInfo,{server:!0}),t.subtype=a.subtype=`${r}:${o}`),a._channel=t,t},"sftp"===o){if(i(a,"sftp"))return void a.emit("sftp",c,l);e=!1}if(i(a,"subsystem"))return void a.emit("subsystem",c,l,{name:o});break}}n&&n(`Automatic rejection of incoming channel request: ${r}`),l&&l()}else s&&q.channelFailure(a.outgoing.id)},CHANNEL_EOF:(e,t)=>{let r=this._chanMgr.get(t);"object"==typeof r&&null!==r&&(r.constructor!==M||(r._ending||(r._ending=!0,r.emit("eof"),r.emit("end")),r=r._channel,r))&&"open"===r.incoming.state&&(r.incoming.state="eof",r.readable&&r.push(null))},CHANNEL_CLOSE:(e,t)=>{let r=this._chanMgr.get(t);"object"==typeof r&&null!==r&&(r.constructor!==M||(r._ending=!0,r.emit("close"),r=r._channel,r))&&L(this,t,r)},SERVICE_REQUEST:(t,r)=>{if(0===f||g||this.authenticated||"ssh-userauth"!==r)return q.disconnect(d.SERVICE_NOT_AVAILABLE),void e.end();g=!0,q.serviceAccept(r)},USERAUTH_REQUEST:(t,r,s,n,o)=>{if(0===f||this.authenticated||l&&(l.username!==r||l.service!==s)||"password"!==n&&"publickey"!==n&&"hostbased"!==n&&"keyboard-interactive"!==n&&"none"!==n||10===m.length)return q.disconnect(d.PROTOCOL_ERROR),void e.end();if("ssh-connection"!==s)return q.disconnect(d.SERVICE_NOT_AVAILABLE),void e.end();let a;switch(n){case"keyboard-interactive":a=new D(q,r,s,n,o,$);break;case"publickey":a=new F(q,r,s,n,o,$);break;case"hostbased":a=new x(q,r,s,n,o,$);break;case"password":if(l&&l instanceof G&&l._changeCb){const e=l._changeCb;return l._changeCb=void 0,void e(o.newPassword)}a=new G(q,r,s,n,o,$);break;case"none":a=new U(q,r,s,n,$)}if(l){if(!l._initialResponse)return m.push(a);l._multistep&&!l._finalResponse&&(l._cleanup&&l._cleanup(),l.emit("abort"))}l=a,i(this,"authentication")?this.emit("authentication",l):l.reject()},USERAUTH_INFO_RESPONSE:(e,t)=>{l&&l instanceof D&&l._onInfoResponse(t)},GLOBAL_REQUEST:(e,t,r,s)=>{const n={type:null,buf:null};function o(e,t){n.type=e,n.buf=t,function(){for(;_.length>0&&_[0].type;){const e=_.shift();"SUCCESS"===e.type&&q.requestSuccess(e.buf),"FAILURE"===e.type&&q.requestFailure()}}()}if(r&&_.push(n),("tcpip-forward"===t||"cancel-tcpip-forward"===t||"no-more-sessions@openssh.com"===t||"streamlocal-forward@openssh.com"===t||"cancel-streamlocal-forward@openssh.com"===t)&&i(this,"request")&&this.authenticated){let e,n;if(r){let r=!1;e=e=>{if(r)return;let n;r=!0,"tcpip-forward"===t&&0===s.bindPort&&"number"==typeof e&&(n=Buffer.allocUnsafe(4),S(n,e,0)),o("SUCCESS",n)},n=()=>{r||(r=!0,o("FAILURE"))}}if("no-more-sessions@openssh.com"===t)return this.noMoreSessions=!0,void(e&&e());this.emit("request",e,n,t,s)}else r&&o("FAILURE")}}});e.pause(),E.then((()=>{q.start(),e.on("data",(t=>{try{q.parse(t,0,t.length)}catch(t){this.emit("error",t);try{P(e)&&e.end()}catch{}}})),e.resume()})).catch((t=>{this.emit("error",t);try{P(e)&&e.end()}catch{}})),e.on("error",(e=>{e.level="socket",this.emit("error",e)})).once("end",(()=>{n&&n("Socket ended"),q.cleanup(),this.emit("end")})).once("close",(()=>{n&&n("Socket closed"),q.cleanup(),this.emit("close");const e=new Error("No response from server");this._chanMgr.cleanup(e)}));const $=(e,t,r,s)=>{l!==e||this.authenticated||(t?(l=void 0,this.authenticated=!0,q.authSuccess(),m=[],this.emit("ready")):(q.authFailure(r,s),m.length&&(l=m.pop(),i(this,"authentication")?this.emit("authentication",l):l.reject())))}}end(){return this._sock&&P(this._sock)&&(this._protocol.disconnect(d.BY_APPLICATION),this._sock.end()),this}x11(e,t,r){return q(this,"x11",{originAddr:e,originPort:t},r),this}forwardOut(e,t,r,s,n){return q(this,"forwarded-tcpip",{boundAddr:e,boundPort:t,remoteAddr:r,remotePort:s},n),this}openssh_forwardOutStreamLocal(e,t){return q(this,"forwarded-streamlocal@openssh.com",{socketPath:e},t),this}rekey(e){let t;try{this._protocol.rekey()}catch(e){t=e}"function"==typeof e&&(t?process.nextTick(e,t):this.once("rekey",e))}setNoDelay(e){return this._sock&&"function"==typeof this._sock.setNoDelay&&this._sock.setNoDelay(e),this}}function q(e,t,r,s){const n=I,i=T;"function"==typeof r&&(s=r,r={});const o=(e,t)=>{s(e,t)};o.type=t;const a=e._chanMgr.add(o);if(-1!==a)switch(t){case"forwarded-tcpip":e._protocol.forwardedTcpip(a,n,i,r);break;case"x11":e._protocol.x11(a,n,i,r);break;case"forwarded-streamlocal@openssh.com":e._protocol.openssh_forwardedStreamLocal(a,n,i,r);break;default:throw new Error(`Unsupported channel type: ${t}`)}else s(new Error("No free channels available"))}function $(e,t){return e-t}e.exports=H,e.exports.IncomingClient=Q},7236:(e,t,r)=>{"use strict";const{SFTP:s}=r(4061),n=2**32-1;function i(e,t,r,s){if(e._chanMgr.remove(t),"function"!=typeof s)return;let n;r instanceof Error?n=r:"object"==typeof r&&null!==r?(n=new Error(`(SSH) Channel open failure: ${r.description}`),n.reason=r.reason):(n=new Error("(SSH) Channel open failure: server closed channel unexpectedly"),n.reason=""),s(n)}function o(e,t,r,n,o){if("function"==typeof r)return void i(e,t,n,r);if("object"!=typeof r||null===r)return;if(r.incoming&&"closed"===r.incoming.state)return;if(e._chanMgr.remove(t),r.server&&"Session"===r.constructor.name)return;r.incoming.state="closed",r.readable&&r.push(null),r.server?r.stderr.writable&&r.stderr.end():r.stderr.readable&&r.stderr.push(null),r.constructor===s||"open"!==r.outgoing.state&&"eof"!==r.outgoing.state||o||r.close(),"closing"===r.outgoing.state&&(r.outgoing.state="closed");const a=r._readableState,c=r._writableState;!c||c.ending||c.finished||o||r.end();const l=r._callbacks;r._callbacks=[];for(let e=0;e<l.length;++e)l[e](!0);if(r.server)!r.readable||r.destroyed||a&&a.endEmitted?r.emit("close"):r.once("end",(()=>r.emit("close")));else{let e;switch(r.type){case"direct-streamlocal@openssh.com":case"direct-tcpip":e=()=>r.emit("close");break;default:{const t=r._exit;e=()=>{null===t.code?r.emit("close",t.code,t.signal,t.dump,t.desc):r.emit("close",t.code)}}}!r.readable||r.destroyed||a&&a.endEmitted?e():r.once("end",e);const t=r.stderr._readableState;!r.stderr.readable||r.stderr.destroyed||t&&t.endEmitted?r.stderr.emit("close"):r.stderr.once("end",(()=>r.stderr.emit("close")))}}const a=(()=>{const e=Object.prototype.toString;return t=>"[object RegExp]"===e.call(t)})();e.exports={ChannelManager:class{constructor(e){this._client=e,this._channels={},this._cur=-1,this._count=0}add(e){let t;if(this._cur<n)t=++this._cur;else if(0===this._count)this._cur=0,t=0;else{const e=this._channels;for(let r=0;r<n;++r)if(void 0===e[r]){t=r;break}}return void 0===t?-1:(this._channels[t]=e||!0,++this._count,t)}update(e,t){if("number"!=typeof e||e<0||e>=n||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);t&&this._channels[e]&&(this._channels[e]=t)}get(e){if("number"!=typeof e||e<0||e>=n||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);return this._channels[e]}remove(e){if("number"!=typeof e||e<0||e>=n||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);this._channels[e]&&(delete this._channels[e],this._count&&--this._count)}cleanup(e){const t=this._channels;this._channels={},this._cur=-1,this._count=0;const r=Object.keys(t),s=this._client;for(let n=0;n<r.length;++n){const i=+r[n],a=t[i];o(s,i,a._channel||a,e,!0)}}},generateAlgorithmList:function(e,t,r){if(Array.isArray(e)&&e.length>0){for(let t=0;t<e.length;++t)if(-1===r.indexOf(e[t]))throw new Error(`Unsupported algorithm: ${e[t]}`);return e}if("object"==typeof e&&null!==e){const s=Object.keys(e);let n=t;for(let i=0;i<s.length;++i){const o=s[i];let c=e[o];switch(o){case"append":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let e=0;e<c.length;++e){const s=c[e];if("string"==typeof s){if(!s||-1!==n.indexOf(s))continue;if(-1===r.indexOf(s))throw new Error(`Unsupported algorithm: ${s}`);n===t&&(n=n.slice()),n.push(s)}else if(a(s))for(let e=0;e<r.length;++e){const i=r[e];if(s.test(i)){if(-1!==n.indexOf(i))continue;n===t&&(n=n.slice()),n.push(i)}}}break;case"prepend":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let e=c.length;e>=0;--e){const s=c[e];if("string"==typeof s){if(!s||-1!==n.indexOf(s))continue;if(-1===r.indexOf(s))throw new Error(`Unsupported algorithm: ${s}`);n===t&&(n=n.slice()),n.unshift(s)}else if(a(s))for(let e=r.length;e>=0;--e){const i=r[e];if(s.test(i)){if(-1!==n.indexOf(i))continue;n===t&&(n=n.slice()),n.unshift(i)}}}break;case"remove":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let e=0;e<c.length;++e){const r=c[e];if("string"==typeof r){if(!r)continue;const e=n.indexOf(r);if(-1===e)continue;n===t&&(n=n.slice()),n.splice(e,1)}else if(a(r))for(let e=0;e<n.length;++e)r.test(n[e])&&(n===t&&(n=n.slice()),n.splice(e,1),--e)}}}return n}return t},onChannelOpenFailure:i,onCHANNEL_CLOSE:o,isWritable:e=>e&&e.writable&&e._readableState&&!1===e._readableState.ended}},6613:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.IBMi=void 0;const o=i(r(3048));t.IBMi=class{constructor(){this.client=new o.NodeSSH,this.currentHost="",this.currentPort=22,this.currentUser=""}async connect(e){try{return e.keepaliveInterval=35e3,await this.client.connect(e),this.currentHost=e.host,this.currentPort=e.port,this.currentUser=e.username,{success:!0}}catch(e){return this.client.isConnected()&&this.client.dispose(),{success:!1,error:e}}}isConnected(){return this.client&&this.client.isConnected()}async sendQsh(e){return e.stdin=e.command,this.sendCommand({...e,command:"/QOpenSys/usr/bin/qsh"})}async sendCommand(e){let t=[];e.env&&t.push(...Object.entries(e.env).map((([e,t])=>`export ${e}="${(null==t?void 0:t.replace(/\$/g,"\\$").replace(/"/g,'\\"'))||""}"`))),t.push(e.command);const r=t.join(" && "),s=e.directory||".",n=await this.client.execCommand(r,{cwd:s,stdin:e.stdin,onStdout:e.onStdout,onStderr:e.onStderr});return null===n.code&&(n.code=0),n}async end(){var e;null===(e=this.client.connection)||void 0===e||e.removeAllListeners(),this.client.dispose()}async uploadFiles(e,t){await this.client.putFiles(e.map((e=>({local:e.local,remote:e.remote}))),t)}async downloadFile(e,t){await this.client.getFile(e,t)}async uploadDirectory(e,t,r){await this.client.putDirectory(e,t,r)}async downloadDirectory(e,t,r){await this.client.getDirectory(e,t,r)}}},341:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(4255),a=r(1554),c=i(r(1017)),l=i(r(7147));!async function(){const e=process.argv.slice(2);let t=!0,r=new a.Executor;if(r.addSteps(new o.StepTypes.connect,new o.StepTypes.env),0===e.length)!function(){console.log("IBM i CLI"),console.log("The CLI is used to interact with the IBM i from the command line."),console.log(),console.log("It assumes these environment variables are set:"),console.log("\tIBMI_HOST, IBMI_SSH_PORT, IBMI_USER"),console.log("At least one of these environment variables is required:"),console.log("\tIBMI_PASSWORD, IBMI_PRIVATE_KEY"),console.log();const e=Object.keys(o.StepTypes).filter((e=>!["connect","env"].includes(e))).map((e=>new o.StepTypes[e]));console.log("Available parameters:"),console.log("\t--file <relativePath>"),console.log("\t\tLoads steps from a JSON or YAML file. This cannot"),console.log("\t\tuse this in conjunction with other paramaters."),console.log();for(let t=0;t<e.length;t++){const r=e[t];console.log(`\t--${r.id} ${r.requiredParams.map((e=>`<${e}>`)).join(" ")}`),console.log(`\t\t${r.description}`)}console.log(),process.exit()}();else if("--file"===e[0]){const s=e[1],n=c.parse(s),i=l.readFileSync(s,{encoding:"utf8"});switch(n.ext){case".json":t=(0,o.buildStepsFromJson)(r,JSON.parse(i));break;case".yaml":case".yml":t=(0,o.buildStepsFromYaml)(r,i);break;default:console.log(`Unknown file type: ${n.ext}`),process.exit(1)}}else t=(0,o.buildStepsFromArray)(r,e);if(t||process.exit(1),r.getSteps().length>2){const e=r.getInvalidSteps();e.length>0?(console.log(`Invalid steps found: ${e.length}`),console.log(""),e.forEach((e=>{console.log(`\t> ${e.id} step`),console.log(`\t\tRequired parameters: ${e.requiredParams.join(", ")}`),console.log(`\t\tPassed: ${e.parameters.map((e=>`\`${e}\``)).join(", ")}`),console.log("")})),process.exit(1)):console.log("All steps are valid.");const t=(e,t)=>{t?process.stdout.write(e):console.log(e)},s=await r.executeSteps({log:t});r.dispose(),console.log(`ibmi-ci completed with exit code ${s.code}.`),process.exit(s.code)}}()},3280:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClStep=void 0;const s=r(8813);class n extends s.StepI{constructor(){super(...arguments),this.id="cl",this.description="Execute a CL command on the remote system",this.requiredParams=["clCommand"]}async execute(){const e=this.parameters[0],t=this.getState().rcwd;this.log(`> ${t}`),this.log(`> ${e}`);const r=`system "${e}"`,s=await this.getConnection().sendCommand({command:r,directory:t});return this.log(s.stderr),this.log(""),this.log(s.stdout),0===s.code}}t.ClStep=n},4774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandStep=void 0;const s=r(8813);class n extends s.StepI{constructor(){super(...arguments),this.id="cmd",this.description="Execute a command on the remote system",this.requiredParams=["shellCommand"]}async execute(){const e=this.parameters[0],t=this.getState().rcwd;this.log(`${t} $ ${e}`);const r=await this.getConnection().sendCommand({command:e,directory:t,onStdout:e=>{this.log(e.toString(),!0)},onStderr:e=>{this.log(e.toString(),!0)}});return this.log(""),0===r.code}validateParameters(){return this.parameters.length===this.requiredParams.length}}t.CommandStep=n},635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectStep=void 0;const s=r(6613),n=r(8813);class i extends n.StepI{constructor(){super(...arguments),this.id="connect",this.description="Connect to the IBM i",this.requiredParams=[]}async execute(){let e={success:!0,error:""};if(this.getState().connection){const t=this.getConnection();e={success:!0},this.log(`Connected to ${t.currentUser}@${t.currentHost}`)}else{const t=["IBMI_HOST","IBMI_SSH_PORT","IBMI_USER"];for(const e of t)if(!process.env[e])throw new Error(`${e} is required.`);const r={host:process.env.IBMI_HOST,port:Number(process.env.IBMI_SSH_PORT),username:process.env.IBMI_USER};if(!process.env.IBMI_PASSWORD&&!process.env.IBMI_PRIVATE_KEY)throw new Error("IBMI_PASSWORD or IBMI_PRIVATE_KEY is required");let n="password",i=process.env.IBMI_PASSWORD;if(process.env.IBMI_PRIVATE_KEY&&(n="privateKey",i=process.env.IBMI_PRIVATE_KEY),r[n]=i,this.getState().connection=new s.IBMi,e=await this.getConnection().connect(r),!e.success)throw new Error(`Failed to connect to IBMi: ${e.error}`);this.log("Connected to system.")}const t=await this.getConnection().sendCommand({command:"pwd",directory:"."});if(0!==t.code)throw new Error(`Failed to get current working directory: ${t.stderr}`);this.getState().rcwd=t.stdout.trim(),this.log(`Remote working directory is '${this.getState().rcwd}'`);const r=await this.getConnection().sendCommand({command:"echo $PATH",directory:"."});if(0===r.code&&r.stdout){const e=r.stdout.trim().split(":").map((e=>`${e}:`));this.log("Remote PATH environment variable is:");for(const t of e)this.log(`\t${t}`)}else this.log(`Failed to get remote PATH environment variable. ${r.stderr}`);return e.success}}t.ConnectStep=i},932:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentStep=void 0;const s=r(8813);class n extends s.StepI{constructor(){super(...arguments),this.id="env",this.description="Sets the environment variables for the connected IBM i based on the host",this.requiredParams=[]}async execute(){const e=["IBMI_HOST","IBMI_SSH_PORT","IBMI_USER","IBMI_PASSWORD","IBMI_PRIVATE_KEY","PWD","USER","HOME","SHELL","TERM","EDITOR","LANG","LC_ALL","LC_CTYPE","_","LOGNAME","PATH","CommonProgramFiles(x86)","ProgramFiles(x86)"],t=Object.keys(process.env).filter((t=>!e.includes(t)&&!t.includes(".")&&!t.includes(" "))),r=t.map((e=>`${e}='${process.env[e]}'`)).join(" ");return this.log(`Setting environment variables: ${t.join(", ")}`),0===(await this.getConnection().sendCommand({command:r})).code}}t.EnvironmentStep=n},9749:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.GetStep=void 0;const o=i(r(7147)),a=i(r(1017)),c=r(8813);class l extends c.StepI{constructor(){super(...arguments),this.id="get",this.description="Gets a specific file from IBM i",this.requiredParams=["remoteRelativeDirectory","localRelativePath"]}async execute(){const e=this.getValidRemotePath(this.parameters[0]),t=this.getValidLocalPath(this.parameters[1]);this.log(`Downloading file '${e}' to '${t}'`);const r=a.dirname(t);try{o.mkdirSync(r,{recursive:!0})}catch(e){}return await this.getConnection().downloadFile(t,e),!0}}t.GetStep=l},5874:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.GitHubAssetStep=void 0;const o=i(r(7147)),a=r(3292),c=i(r(1017)),l=r(8813),u=new(r(1329).Octokit);class h extends l.StepI{constructor(){super(...arguments),this.id="ghasset",this.description="Pulls assets from a GitHub release to the local current working directory",this.requiredParams=["owner/repo","tag","assetName"]}async execute(){const[e,t]=this.parameters[0].split("/"),r=this.parameters[1],s=this.parameters[2],n=this.getState().lcwd;this.log(`Downloading files from ${e}/${t}@${r} to '${n}'`);const i=await u.request(`GET /repos/{owner}/{repo}/releases/tags/${r}`,{owner:e,repo:t,headers:{"X-GitHub-Api-Version":"2022-11-28"}}),l=i.data.assets.find((e=>e.name.endsWith(s)));if(l){const s=l.browser_download_url,i=c.join(n,l.name);try{o.mkdirSync(n,{recursive:!0})}catch(e){}return await function(e,t){return fetch(e).then((e=>e.arrayBuffer())).then((e=>(0,a.writeFile)(t,Buffer.from(e))))}(s,i),this.log(`Downloaded asset: ${e}/${t}@${r}:${l.name} -> ${i}`),!0}this.log(`No asset found with name '${s}'. Available assets:`);for(const e of i.data.assets)this.log(`\t${e.name}`);return!1}validateParameters(){return this.parameters.length===this.requiredParams.length&&this.parameters[0].includes("/")}}t.GitHubAssetStep=h},7715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalCwdStep=void 0;const s=r(8813);class n extends s.StepI{constructor(){super(...arguments),this.id="lcwd",this.description="Sets the current working directory on the local system",this.requiredParams=["localDirectory"]}async execute(){return this.getState().lcwd=this.getValidLocalPath(this.parameters[0]),this.log(`Set local working directory to '${this.getState().lcwd}'`),!0}validate(){return this.parameters.length>=this.requiredParams.length}}t.LocalCwdStep=n},7678:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PullStep=void 0;const o=i(r(7147)),a=r(8813);class c extends a.StepI{constructor(){super(...arguments),this.id="pull",this.description="Pulls a directory from IBM i to the local current working directory",this.requiredParams=["remoteRelativeDirectory"]}async execute(){const e=this.getValidRemotePath(this.parameters[0]),t=this.getState().lcwd;this.log(`Downloading files from '${e}' to '${t}'`);try{o.mkdirSync(t,{recursive:!0})}catch(e){}return await this.getConnection().downloadDirectory(t,e,{tick:(e,t,r)=>{this.log(`\t${t} -> ${e}`)},concurrency:10}),this.log(""),this.log(`Downloaded files from '${e}' to '${t}'`),!0}}t.PullStep=c},405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushStep=void 0;const s=r(8813);class n extends s.StepI{constructor(){super(...arguments),this.id="push",this.description="Pushes the current working directory to a chosen directory on the IBM i",this.requiredParams=["remoteRelativeDirectory"]}async execute(){const e=this.getValidRemotePath(this.parameters[0]),t=this.getState().lcwd;return this.log(`Uploading files to ${e}`),await this.getConnection().sendCommand({command:`mkdir -p "${e}"`}),await this.getConnection().uploadDirectory(t,e,{tick:(e,t,r)=>{this.log(`\t${e} -> ${t}`)},concurrency:10}),!0}}t.PushStep=n},8221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteCwdStep=void 0;const s=r(8813);class n extends s.StepI{constructor(){super(...arguments),this.id="rcwd",this.description="Sets the current working directory on the remote system. It will be created if it does not exist.",this.requiredParams=["remoteDirectory"]}async execute(){const e=this.getValidRemotePath(this.parameters[0]);await this.getConnection().sendCommand({command:`mkdir -p "${e}"`});const t=await this.getConnection().sendCommand({command:`cd "${e}"`});if(0!==t.code)throw new Error(`Could not change directory to '${e}'. ${t.stderr}`);return this.getState().rcwd=e,this.log(`Set remote working directory to '${e}'`),!0}validate(){return this.parameters.length>=this.requiredParams.length}}t.RemoteCwdStep=n},1554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Executor=void 0,t.Executor=class{constructor(){this.state={connection:void 0,lcwd:process.cwd(),rcwd:"."},this.steps=[]}setConnection(e){this.state.connection=e}getState(){return this.state}addSteps(...e){this.steps.push(...e)}getLastStep(){return this.steps[this.steps.length-1]}getSteps(){return this.steps}getInvalidSteps(){let e=[];for(let t=0;t<this.steps.length;t++){const r=this.steps[t];r.validateParameters()||e.push(r)}return e}dispose(){var e;null===(e=this.state.connection)||void 0===e||e.end()}async executeSteps(e={}){let t="";const r=(r,s)=>{e.log&&e.log(r,s),t+=r+(s?"":"\n")};for(let e=0;e<this.steps.length;e++){const s=this.steps[e];let n=!1;if(r(""),r("=========================================="),r(`Executing step ${e+1}: ${s.id}`),r("=========================================="),r(""),!s.validateParameters())return r("Runtime error, which is odd because the validation should have caught it!"),r(`Invalid parameters for step: ${s.id}`),{code:0,output:t};try{s.setState(this.state),s.setLogger(r),await s.execute()||(r(`Failed to execute step: ${s.id}`),n=!0)}catch(e){r(`Failed to execute step: ${s.id}`),r(e.message),n=!0}if(n){if(!s.ignoreStepError())return{code:1,output:t};r("Ignoring error for this step.")}}return{code:0,output:t}}}},4255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildStepsFromJson=t.buildStepsFromYaml=t.buildStepsFromArray=t.StepTypes=void 0;const s=r(635),n=r(7715),i=r(932),o=r(405),a=r(4774),c=r(8221),l=r(7678),u=r(9749),h=r(3280),d=r(3419),p=r(5874);function f(e,r){if(!r.steps)return console.log("No steps property found."),!1;for(const s of r.steps){const r=t.StepTypes[s.type];if(!r)return console.log(`Unknown step: ${s.type}`),!1;const n=new r;if(s.ignore&&n.ignoreErrors(!0),s.parameters)for(const e of s.parameters)n.addParameter(e);e.addSteps(n)}return!0}t.StepTypes={connect:s.ConnectStep,env:i.EnvironmentStep,lcwd:n.LocalCwdStep,rcwd:c.RemoteCwdStep,push:o.PushStep,pull:l.PullStep,get:u.GetStep,cmd:a.CommandStep,cl:h.ClStep,ghasset:p.GitHubAssetStep},t.buildStepsFromArray=function(e,r){let s=!1;for(let n=0;n<r.length;n++)if(r[n].startsWith("--"))if("--ignore"===r[n])s=!0;else{const i=r[n].substring(2),o=t.StepTypes[i];if(!o)return console.log(`Unknown step: ${i}`),!1;const a=new o;s&&(a.ignoreErrors(!0),s=!1),e.addSteps(a)}else{const t=e.getLastStep();if(!t)return console.log(`Unknown parameter: ${r[n]}`),!1;t.addParameter(r[n])}return!0},t.buildStepsFromYaml=function(e,t){return f(e,(0,d.parse)(t))},t.buildStepsFromJson=f},8813:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.StepI=void 0;const o=i(r(1017));t.StepI=class{constructor(){this.id="base",this.description="Base Step Description",this.requiredParams=[],this.canError=!1,this.parameters=[]}log(e,t=!1){this.logger&&this.logger(e,t)}setLogger(e){this.logger=e}addParameter(e){this.parameters.push(e)}async execute(){return!1}validateParameters(){return this.parameters.length>=this.requiredParams.length}ignoreErrors(e){this.canError=e}ignoreStepError(){return this.canError}getState(){return this.state}setState(e){this.state=e}getConnection(){return this.state.connection}getValidRemotePath(e){return e.startsWith(".")?o.posix.join(this.state.rcwd,e):e}getValidLocalPath(e){return e.startsWith(".")?o.join(this.state.lcwd,e):e}}},780:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},s=function(){throw new Error("no PRNG")},n=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var o=t(),a=t([1]),c=t([56129,1]),l=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),h=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function f(e,t,r,s){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=s>>24&255,e[t+5]=s>>16&255,e[t+6]=s>>8&255,e[t+7]=255&s}function g(e,t,r,s,n){var i,o=0;for(i=0;i<n;i++)o|=e[t+i]^r[s+i];return(1&o-1>>>8)-1}function m(e,t,r,s){return g(e,t,r,s,16)}function _(e,t,r,s){return g(e,t,r,s,32)}function A(e,t,r,s){!function(e,t,r,s){for(var n,i=255&s[0]|(255&s[1])<<8|(255&s[2])<<16|(255&s[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,l=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,u=255&s[4]|(255&s[5])<<8|(255&s[6])<<16|(255&s[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&s[8]|(255&s[9])<<8|(255&s[10])<<16|(255&s[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,_=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,A=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,E=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,y=255&s[12]|(255&s[13])<<8|(255&s[14])<<16|(255&s[15])<<24,b=i,w=o,v=a,S=c,k=l,I=u,T=h,C=d,O=p,R=f,B=g,P=m,N=_,L=A,U=E,D=y,F=0;F<20;F+=2)b^=(n=(N^=(n=(O^=(n=(k^=(n=b+N|0)<<7|n>>>25)+b|0)<<9|n>>>23)+k|0)<<13|n>>>19)+O|0)<<18|n>>>14,I^=(n=(w^=(n=(L^=(n=(R^=(n=I+w|0)<<7|n>>>25)+I|0)<<9|n>>>23)+R|0)<<13|n>>>19)+L|0)<<18|n>>>14,B^=(n=(T^=(n=(v^=(n=(U^=(n=B+T|0)<<7|n>>>25)+B|0)<<9|n>>>23)+U|0)<<13|n>>>19)+v|0)<<18|n>>>14,D^=(n=(P^=(n=(C^=(n=(S^=(n=D+P|0)<<7|n>>>25)+D|0)<<9|n>>>23)+S|0)<<13|n>>>19)+C|0)<<18|n>>>14,b^=(n=(S^=(n=(v^=(n=(w^=(n=b+S|0)<<7|n>>>25)+b|0)<<9|n>>>23)+w|0)<<13|n>>>19)+v|0)<<18|n>>>14,I^=(n=(k^=(n=(C^=(n=(T^=(n=I+k|0)<<7|n>>>25)+I|0)<<9|n>>>23)+T|0)<<13|n>>>19)+C|0)<<18|n>>>14,B^=(n=(R^=(n=(O^=(n=(P^=(n=B+R|0)<<7|n>>>25)+B|0)<<9|n>>>23)+P|0)<<13|n>>>19)+O|0)<<18|n>>>14,D^=(n=(U^=(n=(L^=(n=(N^=(n=D+U|0)<<7|n>>>25)+D|0)<<9|n>>>23)+N|0)<<13|n>>>19)+L|0)<<18|n>>>14;b=b+i|0,w=w+o|0,v=v+a|0,S=S+c|0,k=k+l|0,I=I+u|0,T=T+h|0,C=C+d|0,O=O+p|0,R=R+f|0,B=B+g|0,P=P+m|0,N=N+_|0,L=L+A|0,U=U+E|0,D=D+y|0,e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=w>>>0&255,e[5]=w>>>8&255,e[6]=w>>>16&255,e[7]=w>>>24&255,e[8]=v>>>0&255,e[9]=v>>>8&255,e[10]=v>>>16&255,e[11]=v>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=k>>>0&255,e[17]=k>>>8&255,e[18]=k>>>16&255,e[19]=k>>>24&255,e[20]=I>>>0&255,e[21]=I>>>8&255,e[22]=I>>>16&255,e[23]=I>>>24&255,e[24]=T>>>0&255,e[25]=T>>>8&255,e[26]=T>>>16&255,e[27]=T>>>24&255,e[28]=C>>>0&255,e[29]=C>>>8&255,e[30]=C>>>16&255,e[31]=C>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=R>>>0&255,e[37]=R>>>8&255,e[38]=R>>>16&255,e[39]=R>>>24&255,e[40]=B>>>0&255,e[41]=B>>>8&255,e[42]=B>>>16&255,e[43]=B>>>24&255,e[44]=P>>>0&255,e[45]=P>>>8&255,e[46]=P>>>16&255,e[47]=P>>>24&255,e[48]=N>>>0&255,e[49]=N>>>8&255,e[50]=N>>>16&255,e[51]=N>>>24&255,e[52]=L>>>0&255,e[53]=L>>>8&255,e[54]=L>>>16&255,e[55]=L>>>24&255,e[56]=U>>>0&255,e[57]=U>>>8&255,e[58]=U>>>16&255,e[59]=U>>>24&255,e[60]=D>>>0&255,e[61]=D>>>8&255,e[62]=D>>>16&255,e[63]=D>>>24&255}(e,t,r,s)}function E(e,t,r,s){!function(e,t,r,s){for(var n,i=255&s[0]|(255&s[1])<<8|(255&s[2])<<16|(255&s[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,l=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,u=255&s[4]|(255&s[5])<<8|(255&s[6])<<16|(255&s[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&s[8]|(255&s[9])<<8|(255&s[10])<<16|(255&s[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,_=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,A=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,E=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,y=255&s[12]|(255&s[13])<<8|(255&s[14])<<16|(255&s[15])<<24,b=0;b<20;b+=2)i^=(n=(_^=(n=(p^=(n=(l^=(n=i+_|0)<<7|n>>>25)+i|0)<<9|n>>>23)+l|0)<<13|n>>>19)+p|0)<<18|n>>>14,u^=(n=(o^=(n=(A^=(n=(f^=(n=u+o|0)<<7|n>>>25)+u|0)<<9|n>>>23)+f|0)<<13|n>>>19)+A|0)<<18|n>>>14,g^=(n=(h^=(n=(a^=(n=(E^=(n=g+h|0)<<7|n>>>25)+g|0)<<9|n>>>23)+E|0)<<13|n>>>19)+a|0)<<18|n>>>14,y^=(n=(m^=(n=(d^=(n=(c^=(n=y+m|0)<<7|n>>>25)+y|0)<<9|n>>>23)+c|0)<<13|n>>>19)+d|0)<<18|n>>>14,i^=(n=(c^=(n=(a^=(n=(o^=(n=i+c|0)<<7|n>>>25)+i|0)<<9|n>>>23)+o|0)<<13|n>>>19)+a|0)<<18|n>>>14,u^=(n=(l^=(n=(d^=(n=(h^=(n=u+l|0)<<7|n>>>25)+u|0)<<9|n>>>23)+h|0)<<13|n>>>19)+d|0)<<18|n>>>14,g^=(n=(f^=(n=(p^=(n=(m^=(n=g+f|0)<<7|n>>>25)+g|0)<<9|n>>>23)+m|0)<<13|n>>>19)+p|0)<<18|n>>>14,y^=(n=(E^=(n=(A^=(n=(_^=(n=y+E|0)<<7|n>>>25)+y|0)<<9|n>>>23)+_|0)<<13|n>>>19)+A|0)<<18|n>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=u>>>0&255,e[5]=u>>>8&255,e[6]=u>>>16&255,e[7]=u>>>24&255,e[8]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=y>>>0&255,e[13]=y>>>8&255,e[14]=y>>>16&255,e[15]=y>>>24&255,e[16]=h>>>0&255,e[17]=h>>>8&255,e[18]=h>>>16&255,e[19]=h>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=f>>>0&255,e[29]=f>>>8&255,e[30]=f>>>16&255,e[31]=f>>>24&255}(e,t,r,s)}var y=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function b(e,t,r,s,n,i,o){var a,c,l=new Uint8Array(16),u=new Uint8Array(64);for(c=0;c<16;c++)l[c]=0;for(c=0;c<8;c++)l[c]=i[c];for(;n>=64;){for(A(u,l,o,y),c=0;c<64;c++)e[t+c]=r[s+c]^u[c];for(a=1,c=8;c<16;c++)a=a+(255&l[c])|0,l[c]=255&a,a>>>=8;n-=64,t+=64,s+=64}if(n>0)for(A(u,l,o,y),c=0;c<n;c++)e[t+c]=r[s+c]^u[c];return 0}function w(e,t,r,s,n){var i,o,a=new Uint8Array(16),c=new Uint8Array(64);for(o=0;o<16;o++)a[o]=0;for(o=0;o<8;o++)a[o]=s[o];for(;r>=64;){for(A(c,a,n,y),o=0;o<64;o++)e[t+o]=c[o];for(i=1,o=8;o<16;o++)i=i+(255&a[o])|0,a[o]=255&i,i>>>=8;r-=64,t+=64}if(r>0)for(A(c,a,n,y),o=0;o<r;o++)e[t+o]=c[o];return 0}function v(e,t,r,s,n){var i=new Uint8Array(32);E(i,s,n,y);for(var o=new Uint8Array(8),a=0;a<8;a++)o[a]=s[a+16];return w(e,t,r,o,i)}function S(e,t,r,s,n,i,o){var a=new Uint8Array(32);E(a,i,o,y);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=i[l+16];return b(e,t,r,s,n,c,a)}var k=function(e){var t,r,s,n,i,o,a,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),s=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|s<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(s>>>7|n<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|i<<12),this.r[5]=i>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|o<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|a<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function I(e,t,r,s,n,i){var o=new k(i);return o.update(r,s,n),o.finish(e,t),0}function T(e,t,r,s,n,i){var o=new Uint8Array(16);return I(o,0,r,s,n,i),m(e,t,o,0)}function C(e,t,r,s,n){var i;if(r<32)return-1;for(S(e,0,t,0,r,s,n),I(e,16,e,32,r-32,e),i=0;i<16;i++)e[i]=0;return 0}function O(e,t,r,s,n){var i,o=new Uint8Array(32);if(r<32)return-1;if(v(o,0,32,s,n),0!==T(t,16,t,32,r-32,o))return-1;for(S(e,0,t,0,r,s,n),i=0;i<32;i++)e[i]=0;return 0}function R(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,s=1;for(t=0;t<16;t++)r=e[t]+s+65535,s=Math.floor(r/65536),e[t]=r-65536*s;e[0]+=s-1+37*(s-1)}function P(e,t,r){for(var s,n=~(r-1),i=0;i<16;i++)s=n&(e[i]^t[i]),e[i]^=s,t[i]^=s}function N(e,r){var s,n,i,o=t(),a=t();for(s=0;s<16;s++)a[s]=r[s];for(B(a),B(a),B(a),n=0;n<2;n++){for(o[0]=a[0]-65517,s=1;s<15;s++)o[s]=a[s]-65535-(o[s-1]>>16&1),o[s-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,P(a,o,1-i)}for(s=0;s<16;s++)e[2*s]=255&a[s],e[2*s+1]=a[s]>>8}function L(e,t){var r=new Uint8Array(32),s=new Uint8Array(32);return N(r,e),N(s,t),_(r,0,s,0)}function U(e){var t=new Uint8Array(32);return N(t,e),1&t[0]}function D(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function F(e,t,r){for(var s=0;s<16;s++)e[s]=t[s]+r[s]}function x(e,t,r){for(var s=0;s<16;s++)e[s]=t[s]-r[s]}function G(e,t,r){var s,n,i=0,o=0,a=0,c=0,l=0,u=0,h=0,d=0,p=0,f=0,g=0,m=0,_=0,A=0,E=0,y=0,b=0,w=0,v=0,S=0,k=0,I=0,T=0,C=0,O=0,R=0,B=0,P=0,N=0,L=0,U=0,D=r[0],F=r[1],x=r[2],G=r[3],M=r[4],H=r[5],Q=r[6],q=r[7],$=r[8],j=r[9],K=r[10],W=r[11],Y=r[12],z=r[13],V=r[14],X=r[15];i+=(s=t[0])*D,o+=s*F,a+=s*x,c+=s*G,l+=s*M,u+=s*H,h+=s*Q,d+=s*q,p+=s*$,f+=s*j,g+=s*K,m+=s*W,_+=s*Y,A+=s*z,E+=s*V,y+=s*X,o+=(s=t[1])*D,a+=s*F,c+=s*x,l+=s*G,u+=s*M,h+=s*H,d+=s*Q,p+=s*q,f+=s*$,g+=s*j,m+=s*K,_+=s*W,A+=s*Y,E+=s*z,y+=s*V,b+=s*X,a+=(s=t[2])*D,c+=s*F,l+=s*x,u+=s*G,h+=s*M,d+=s*H,p+=s*Q,f+=s*q,g+=s*$,m+=s*j,_+=s*K,A+=s*W,E+=s*Y,y+=s*z,b+=s*V,w+=s*X,c+=(s=t[3])*D,l+=s*F,u+=s*x,h+=s*G,d+=s*M,p+=s*H,f+=s*Q,g+=s*q,m+=s*$,_+=s*j,A+=s*K,E+=s*W,y+=s*Y,b+=s*z,w+=s*V,v+=s*X,l+=(s=t[4])*D,u+=s*F,h+=s*x,d+=s*G,p+=s*M,f+=s*H,g+=s*Q,m+=s*q,_+=s*$,A+=s*j,E+=s*K,y+=s*W,b+=s*Y,w+=s*z,v+=s*V,S+=s*X,u+=(s=t[5])*D,h+=s*F,d+=s*x,p+=s*G,f+=s*M,g+=s*H,m+=s*Q,_+=s*q,A+=s*$,E+=s*j,y+=s*K,b+=s*W,w+=s*Y,v+=s*z,S+=s*V,k+=s*X,h+=(s=t[6])*D,d+=s*F,p+=s*x,f+=s*G,g+=s*M,m+=s*H,_+=s*Q,A+=s*q,E+=s*$,y+=s*j,b+=s*K,w+=s*W,v+=s*Y,S+=s*z,k+=s*V,I+=s*X,d+=(s=t[7])*D,p+=s*F,f+=s*x,g+=s*G,m+=s*M,_+=s*H,A+=s*Q,E+=s*q,y+=s*$,b+=s*j,w+=s*K,v+=s*W,S+=s*Y,k+=s*z,I+=s*V,T+=s*X,p+=(s=t[8])*D,f+=s*F,g+=s*x,m+=s*G,_+=s*M,A+=s*H,E+=s*Q,y+=s*q,b+=s*$,w+=s*j,v+=s*K,S+=s*W,k+=s*Y,I+=s*z,T+=s*V,C+=s*X,f+=(s=t[9])*D,g+=s*F,m+=s*x,_+=s*G,A+=s*M,E+=s*H,y+=s*Q,b+=s*q,w+=s*$,v+=s*j,S+=s*K,k+=s*W,I+=s*Y,T+=s*z,C+=s*V,O+=s*X,g+=(s=t[10])*D,m+=s*F,_+=s*x,A+=s*G,E+=s*M,y+=s*H,b+=s*Q,w+=s*q,v+=s*$,S+=s*j,k+=s*K,I+=s*W,T+=s*Y,C+=s*z,O+=s*V,R+=s*X,m+=(s=t[11])*D,_+=s*F,A+=s*x,E+=s*G,y+=s*M,b+=s*H,w+=s*Q,v+=s*q,S+=s*$,k+=s*j,I+=s*K,T+=s*W,C+=s*Y,O+=s*z,R+=s*V,B+=s*X,_+=(s=t[12])*D,A+=s*F,E+=s*x,y+=s*G,b+=s*M,w+=s*H,v+=s*Q,S+=s*q,k+=s*$,I+=s*j,T+=s*K,C+=s*W,O+=s*Y,R+=s*z,B+=s*V,P+=s*X,A+=(s=t[13])*D,E+=s*F,y+=s*x,b+=s*G,w+=s*M,v+=s*H,S+=s*Q,k+=s*q,I+=s*$,T+=s*j,C+=s*K,O+=s*W,R+=s*Y,B+=s*z,P+=s*V,N+=s*X,E+=(s=t[14])*D,y+=s*F,b+=s*x,w+=s*G,v+=s*M,S+=s*H,k+=s*Q,I+=s*q,T+=s*$,C+=s*j,O+=s*K,R+=s*W,B+=s*Y,P+=s*z,N+=s*V,L+=s*X,y+=(s=t[15])*D,o+=38*(w+=s*x),a+=38*(v+=s*G),c+=38*(S+=s*M),l+=38*(k+=s*H),u+=38*(I+=s*Q),h+=38*(T+=s*q),d+=38*(C+=s*$),p+=38*(O+=s*j),f+=38*(R+=s*K),g+=38*(B+=s*W),m+=38*(P+=s*Y),_+=38*(N+=s*z),A+=38*(L+=s*V),E+=38*(U+=s*X),i=(s=(i+=38*(b+=s*F))+(n=1)+65535)-65536*(n=Math.floor(s/65536)),o=(s=o+n+65535)-65536*(n=Math.floor(s/65536)),a=(s=a+n+65535)-65536*(n=Math.floor(s/65536)),c=(s=c+n+65535)-65536*(n=Math.floor(s/65536)),l=(s=l+n+65535)-65536*(n=Math.floor(s/65536)),u=(s=u+n+65535)-65536*(n=Math.floor(s/65536)),h=(s=h+n+65535)-65536*(n=Math.floor(s/65536)),d=(s=d+n+65535)-65536*(n=Math.floor(s/65536)),p=(s=p+n+65535)-65536*(n=Math.floor(s/65536)),f=(s=f+n+65535)-65536*(n=Math.floor(s/65536)),g=(s=g+n+65535)-65536*(n=Math.floor(s/65536)),m=(s=m+n+65535)-65536*(n=Math.floor(s/65536)),_=(s=_+n+65535)-65536*(n=Math.floor(s/65536)),A=(s=A+n+65535)-65536*(n=Math.floor(s/65536)),E=(s=E+n+65535)-65536*(n=Math.floor(s/65536)),y=(s=y+n+65535)-65536*(n=Math.floor(s/65536)),i=(s=(i+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(s/65536)),o=(s=o+n+65535)-65536*(n=Math.floor(s/65536)),a=(s=a+n+65535)-65536*(n=Math.floor(s/65536)),c=(s=c+n+65535)-65536*(n=Math.floor(s/65536)),l=(s=l+n+65535)-65536*(n=Math.floor(s/65536)),u=(s=u+n+65535)-65536*(n=Math.floor(s/65536)),h=(s=h+n+65535)-65536*(n=Math.floor(s/65536)),d=(s=d+n+65535)-65536*(n=Math.floor(s/65536)),p=(s=p+n+65535)-65536*(n=Math.floor(s/65536)),f=(s=f+n+65535)-65536*(n=Math.floor(s/65536)),g=(s=g+n+65535)-65536*(n=Math.floor(s/65536)),m=(s=m+n+65535)-65536*(n=Math.floor(s/65536)),_=(s=_+n+65535)-65536*(n=Math.floor(s/65536)),A=(s=A+n+65535)-65536*(n=Math.floor(s/65536)),E=(s=E+n+65535)-65536*(n=Math.floor(s/65536)),y=(s=y+n+65535)-65536*(n=Math.floor(s/65536)),i+=n-1+37*(n-1),e[0]=i,e[1]=o,e[2]=a,e[3]=c,e[4]=l,e[5]=u,e[6]=h,e[7]=d,e[8]=p,e[9]=f,e[10]=g,e[11]=m,e[12]=_,e[13]=A,e[14]=E,e[15]=y}function M(e,t){G(e,t,t)}function H(e,r){var s,n=t();for(s=0;s<16;s++)n[s]=r[s];for(s=253;s>=0;s--)M(n,n),2!==s&&4!==s&&G(n,n,r);for(s=0;s<16;s++)e[s]=n[s]}function Q(e,r,s){var n,i,o=new Uint8Array(32),a=new Float64Array(80),l=t(),u=t(),h=t(),d=t(),p=t(),f=t();for(i=0;i<31;i++)o[i]=r[i];for(o[31]=127&r[31]|64,o[0]&=248,D(a,s),i=0;i<16;i++)u[i]=a[i],d[i]=l[i]=h[i]=0;for(l[0]=d[0]=1,i=254;i>=0;--i)P(l,u,n=o[i>>>3]>>>(7&i)&1),P(h,d,n),F(p,l,h),x(l,l,h),F(h,u,d),x(u,u,d),M(d,p),M(f,l),G(l,h,l),G(h,u,p),F(p,l,h),x(l,l,h),M(u,l),x(h,d,f),G(l,h,c),F(l,l,d),G(h,h,l),G(l,d,f),G(d,u,a),M(u,p),P(l,u,n),P(h,d,n);for(i=0;i<16;i++)a[i+16]=l[i],a[i+32]=h[i],a[i+48]=u[i],a[i+64]=d[i];var g=a.subarray(32),m=a.subarray(16);return H(g,g),G(m,m,g),N(e,m),0}function q(e,t){return Q(e,t,i)}function $(e,t){return s(t,32),q(e,t)}function j(e,t,r){var s=new Uint8Array(32);return Q(s,r,t),E(e,n,s,y)}k.prototype.blocks=function(e,t,r){for(var s,n,i,o,a,c,l,u,h,d,p,f,g,m,_,A,E,y,b,w=this.fin?0:2048,v=this.h[0],S=this.h[1],k=this.h[2],I=this.h[3],T=this.h[4],C=this.h[5],O=this.h[6],R=this.h[7],B=this.h[8],P=this.h[9],N=this.r[0],L=this.r[1],U=this.r[2],D=this.r[3],F=this.r[4],x=this.r[5],G=this.r[6],M=this.r[7],H=this.r[8],Q=this.r[9];r>=16;)d=h=0,d+=(v+=8191&(s=255&e[t+0]|(255&e[t+1])<<8))*N,d+=(S+=8191&(s>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*Q),d+=(k+=8191&(n>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*H),d+=(I+=8191&(i>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*M),h=(d+=(T+=8191&(o>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*G))>>>13,d&=8191,d+=(C+=a>>>1&8191)*(5*x),d+=(O+=8191&(a>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*F),d+=(R+=8191&(c>>>11|(l=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*D),d+=(B+=8191&(l>>>8|(u=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*U),p=h+=(d+=(P+=u>>>5|w)*(5*L))>>>13,p+=v*L,p+=S*N,p+=k*(5*Q),p+=I*(5*H),h=(p+=T*(5*M))>>>13,p&=8191,p+=C*(5*G),p+=O*(5*x),p+=R*(5*F),p+=B*(5*D),h+=(p+=P*(5*U))>>>13,p&=8191,f=h,f+=v*U,f+=S*L,f+=k*N,f+=I*(5*Q),h=(f+=T*(5*H))>>>13,f&=8191,f+=C*(5*M),f+=O*(5*G),f+=R*(5*x),f+=B*(5*F),g=h+=(f+=P*(5*D))>>>13,g+=v*D,g+=S*U,g+=k*L,g+=I*N,h=(g+=T*(5*Q))>>>13,g&=8191,g+=C*(5*H),g+=O*(5*M),g+=R*(5*G),g+=B*(5*x),m=h+=(g+=P*(5*F))>>>13,m+=v*F,m+=S*D,m+=k*U,m+=I*L,h=(m+=T*N)>>>13,m&=8191,m+=C*(5*Q),m+=O*(5*H),m+=R*(5*M),m+=B*(5*G),_=h+=(m+=P*(5*x))>>>13,_+=v*x,_+=S*F,_+=k*D,_+=I*U,h=(_+=T*L)>>>13,_&=8191,_+=C*N,_+=O*(5*Q),_+=R*(5*H),_+=B*(5*M),A=h+=(_+=P*(5*G))>>>13,A+=v*G,A+=S*x,A+=k*F,A+=I*D,h=(A+=T*U)>>>13,A&=8191,A+=C*L,A+=O*N,A+=R*(5*Q),A+=B*(5*H),E=h+=(A+=P*(5*M))>>>13,E+=v*M,E+=S*G,E+=k*x,E+=I*F,h=(E+=T*D)>>>13,E&=8191,E+=C*U,E+=O*L,E+=R*N,E+=B*(5*Q),y=h+=(E+=P*(5*H))>>>13,y+=v*H,y+=S*M,y+=k*G,y+=I*x,h=(y+=T*F)>>>13,y&=8191,y+=C*D,y+=O*U,y+=R*L,y+=B*N,b=h+=(y+=P*(5*Q))>>>13,b+=v*Q,b+=S*H,b+=k*M,b+=I*G,h=(b+=T*x)>>>13,b&=8191,b+=C*F,b+=O*D,b+=R*U,b+=B*L,v=d=8191&(h=(h=((h+=(b+=P*N)>>>13)<<2)+h|0)+(d&=8191)|0),S=p+=h>>>=13,k=f&=8191,I=g&=8191,T=m&=8191,C=_&=8191,O=A&=8191,R=E&=8191,B=y&=8191,P=b&=8191,t+=16,r-=16;this.h[0]=v,this.h[1]=S,this.h[2]=k,this.h[3]=I,this.h[4]=T,this.h[5]=C,this.h[6]=O,this.h[7]=R,this.h[8]=B,this.h[9]=P},k.prototype.finish=function(e,t){var r,s,n,i,o=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=r,r=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,i=1;i<10;i++)o[i]=this.h[i]+r,r=o[i]>>>13,o[i]&=8191;for(o[9]-=8192,s=(1^r)-1,i=0;i<10;i++)o[i]&=s;for(s=~s,i=0;i<10;i++)this.h[i]=this.h[i]&s|o[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,i=1;i<8;i++)n=(this.h[i]+this.pad[i]|0)+(n>>>16)|0,this.h[i]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},k.prototype.update=function(e,t,r){var s,n;if(this.leftover){for((n=16-this.leftover)>r&&(n=r),s=0;s<n;s++)this.buffer[this.leftover+s]=e[t+s];if(r-=n,t+=n,this.leftover+=n,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(n=r-r%16,this.blocks(e,t,n),t+=n,r-=n),r){for(s=0;s<r;s++)this.buffer[this.leftover+s]=e[t+s];this.leftover+=r}};var K=C,W=O,Y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function z(e,t,r,s){for(var n,i,o,a,c,l,u,h,d,p,f,g,m,_,A,E,y,b,w,v,S,k,I,T,C,O,R=new Int32Array(16),B=new Int32Array(16),P=e[0],N=e[1],L=e[2],U=e[3],D=e[4],F=e[5],x=e[6],G=e[7],M=t[0],H=t[1],Q=t[2],q=t[3],$=t[4],j=t[5],K=t[6],W=t[7],z=0;s>=128;){for(w=0;w<16;w++)v=8*w+z,R[w]=r[v+0]<<24|r[v+1]<<16|r[v+2]<<8|r[v+3],B[w]=r[v+4]<<24|r[v+5]<<16|r[v+6]<<8|r[v+7];for(w=0;w<80;w++)if(n=P,i=N,o=L,a=U,c=D,l=F,u=x,d=M,p=H,f=Q,g=q,m=$,_=j,A=K,I=65535&(k=W),T=k>>>16,C=65535&(S=G),O=S>>>16,I+=65535&(k=($>>>14|D<<18)^($>>>18|D<<14)^(D>>>9|$<<23)),T+=k>>>16,C+=65535&(S=(D>>>14|$<<18)^(D>>>18|$<<14)^($>>>9|D<<23)),O+=S>>>16,I+=65535&(k=$&j^~$&K),T+=k>>>16,C+=65535&(S=D&F^~D&x),O+=S>>>16,S=Y[2*w],I+=65535&(k=Y[2*w+1]),T+=k>>>16,C+=65535&S,O+=S>>>16,S=R[w%16],T+=(k=B[w%16])>>>16,C+=65535&S,O+=S>>>16,C+=(T+=(I+=65535&k)>>>16)>>>16,I=65535&(k=b=65535&I|T<<16),T=k>>>16,C=65535&(S=y=65535&C|(O+=C>>>16)<<16),O=S>>>16,I+=65535&(k=(M>>>28|P<<4)^(P>>>2|M<<30)^(P>>>7|M<<25)),T+=k>>>16,C+=65535&(S=(P>>>28|M<<4)^(M>>>2|P<<30)^(M>>>7|P<<25)),O+=S>>>16,T+=(k=M&H^M&Q^H&Q)>>>16,C+=65535&(S=P&N^P&L^N&L),O+=S>>>16,h=65535&(C+=(T+=(I+=65535&k)>>>16)>>>16)|(O+=C>>>16)<<16,E=65535&I|T<<16,I=65535&(k=g),T=k>>>16,C=65535&(S=a),O=S>>>16,T+=(k=b)>>>16,C+=65535&(S=y),O+=S>>>16,N=n,L=i,U=o,D=a=65535&(C+=(T+=(I+=65535&k)>>>16)>>>16)|(O+=C>>>16)<<16,F=c,x=l,G=u,P=h,H=d,Q=p,q=f,$=g=65535&I|T<<16,j=m,K=_,W=A,M=E,w%16==15)for(v=0;v<16;v++)S=R[v],I=65535&(k=B[v]),T=k>>>16,C=65535&S,O=S>>>16,S=R[(v+9)%16],I+=65535&(k=B[(v+9)%16]),T+=k>>>16,C+=65535&S,O+=S>>>16,y=R[(v+1)%16],I+=65535&(k=((b=B[(v+1)%16])>>>1|y<<31)^(b>>>8|y<<24)^(b>>>7|y<<25)),T+=k>>>16,C+=65535&(S=(y>>>1|b<<31)^(y>>>8|b<<24)^y>>>7),O+=S>>>16,y=R[(v+14)%16],T+=(k=((b=B[(v+14)%16])>>>19|y<<13)^(y>>>29|b<<3)^(b>>>6|y<<26))>>>16,C+=65535&(S=(y>>>19|b<<13)^(b>>>29|y<<3)^y>>>6),O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,R[v]=65535&C|O<<16,B[v]=65535&I|T<<16;I=65535&(k=M),T=k>>>16,C=65535&(S=P),O=S>>>16,S=e[0],T+=(k=t[0])>>>16,C+=65535&S,O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,e[0]=P=65535&C|O<<16,t[0]=M=65535&I|T<<16,I=65535&(k=H),T=k>>>16,C=65535&(S=N),O=S>>>16,S=e[1],T+=(k=t[1])>>>16,C+=65535&S,O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,e[1]=N=65535&C|O<<16,t[1]=H=65535&I|T<<16,I=65535&(k=Q),T=k>>>16,C=65535&(S=L),O=S>>>16,S=e[2],T+=(k=t[2])>>>16,C+=65535&S,O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,e[2]=L=65535&C|O<<16,t[2]=Q=65535&I|T<<16,I=65535&(k=q),T=k>>>16,C=65535&(S=U),O=S>>>16,S=e[3],T+=(k=t[3])>>>16,C+=65535&S,O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,e[3]=U=65535&C|O<<16,t[3]=q=65535&I|T<<16,I=65535&(k=$),T=k>>>16,C=65535&(S=D),O=S>>>16,S=e[4],T+=(k=t[4])>>>16,C+=65535&S,O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,e[4]=D=65535&C|O<<16,t[4]=$=65535&I|T<<16,I=65535&(k=j),T=k>>>16,C=65535&(S=F),O=S>>>16,S=e[5],T+=(k=t[5])>>>16,C+=65535&S,O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,e[5]=F=65535&C|O<<16,t[5]=j=65535&I|T<<16,I=65535&(k=K),T=k>>>16,C=65535&(S=x),O=S>>>16,S=e[6],T+=(k=t[6])>>>16,C+=65535&S,O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,e[6]=x=65535&C|O<<16,t[6]=K=65535&I|T<<16,I=65535&(k=W),T=k>>>16,C=65535&(S=G),O=S>>>16,S=e[7],T+=(k=t[7])>>>16,C+=65535&S,O+=S>>>16,O+=(C+=(T+=(I+=65535&k)>>>16)>>>16)>>>16,e[7]=G=65535&C|O<<16,t[7]=W=65535&I|T<<16,z+=128,s-=128}return s}function V(e,t,r){var s,n=new Int32Array(8),i=new Int32Array(8),o=new Uint8Array(256),a=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,z(n,i,t,r),r%=128,s=0;s<r;s++)o[s]=t[a-r+s];for(o[r]=128,o[(r=256-128*(r<112?1:0))-9]=0,f(o,r-8,a/536870912|0,a<<3),z(n,i,o,r),s=0;s<8;s++)f(e,8*s,n[s],i[s]);return 0}function X(e,r){var s=t(),n=t(),i=t(),o=t(),a=t(),c=t(),l=t(),h=t(),d=t();x(s,e[1],e[0]),x(d,r[1],r[0]),G(s,s,d),F(n,e[0],e[1]),F(d,r[0],r[1]),G(n,n,d),G(i,e[3],r[3]),G(i,i,u),G(o,e[2],r[2]),F(o,o,o),x(a,n,s),x(c,o,i),F(l,o,i),F(h,n,s),G(e[0],a,c),G(e[1],h,l),G(e[2],l,c),G(e[3],a,h)}function J(e,t,r){var s;for(s=0;s<4;s++)P(e[s],t[s],r)}function Z(e,r){var s=t(),n=t(),i=t();H(i,r[2]),G(s,r[0],i),G(n,r[1],i),N(e,n),e[31]^=U(s)<<7}function ee(e,t,r){var s,n;for(R(e[0],o),R(e[1],a),R(e[2],a),R(e[3],o),n=255;n>=0;--n)J(e,t,s=r[n/8|0]>>(7&n)&1),X(t,e),X(e,e),J(e,t,s)}function te(e,r){var s=[t(),t(),t(),t()];R(s[0],h),R(s[1],d),R(s[2],a),G(s[3],h,d),ee(e,s,r)}function re(e,r,n){var i,o=new Uint8Array(64),a=[t(),t(),t(),t()];for(n||s(r,32),V(o,r,32),o[0]&=248,o[31]&=127,o[31]|=64,te(a,o),Z(e,a),i=0;i<32;i++)r[i+32]=e[i];return 0}var se=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ne(e,t){var r,s,n,i;for(s=63;s>=32;--s){for(r=0,n=s-32,i=s-12;n<i;++n)t[n]+=r-16*t[s]*se[n-(s-32)],r=t[n]+128>>8,t[n]-=256*r;t[n]+=r,t[s]=0}for(r=0,n=0;n<32;n++)t[n]+=r-(t[31]>>4)*se[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*se[n];for(s=0;s<32;s++)t[s+1]+=t[s]>>8,e[s]=255&t[s]}function ie(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ne(e,r)}function oe(e,r,s,n){var i,o,a=new Uint8Array(64),c=new Uint8Array(64),l=new Uint8Array(64),u=new Float64Array(64),h=[t(),t(),t(),t()];V(a,n,32),a[0]&=248,a[31]&=127,a[31]|=64;var d=s+64;for(i=0;i<s;i++)e[64+i]=r[i];for(i=0;i<32;i++)e[32+i]=a[32+i];for(V(l,e.subarray(32),s+32),ie(l),te(h,l),Z(e,h),i=32;i<64;i++)e[i]=n[i];for(V(c,e,s+64),ie(c),i=0;i<64;i++)u[i]=0;for(i=0;i<32;i++)u[i]=l[i];for(i=0;i<32;i++)for(o=0;o<32;o++)u[i+o]+=c[i]*a[o];return ne(e.subarray(32),u),d}function ae(e,r,s,n){var i,c=new Uint8Array(32),u=new Uint8Array(64),h=[t(),t(),t(),t()],d=[t(),t(),t(),t()];if(s<64)return-1;if(function(e,r){var s=t(),n=t(),i=t(),c=t(),u=t(),h=t(),d=t();return R(e[2],a),D(e[1],r),M(i,e[1]),G(c,i,l),x(i,i,e[2]),F(c,e[2],c),M(u,c),M(h,u),G(d,h,u),G(s,d,i),G(s,s,c),function(e,r){var s,n=t();for(s=0;s<16;s++)n[s]=r[s];for(s=250;s>=0;s--)M(n,n),1!==s&&G(n,n,r);for(s=0;s<16;s++)e[s]=n[s]}(s,s),G(s,s,i),G(s,s,c),G(s,s,c),G(e[0],s,c),M(n,e[0]),G(n,n,c),L(n,i)&&G(e[0],e[0],p),M(n,e[0]),G(n,n,c),L(n,i)?-1:(U(e[0])===r[31]>>7&&x(e[0],o,e[0]),G(e[3],e[0],e[1]),0)}(d,n))return-1;for(i=0;i<s;i++)e[i]=r[i];for(i=0;i<32;i++)e[i+32]=n[i];if(V(u,e,s),ie(u),ee(h,d,u),te(d,r.subarray(32)),X(h,d),Z(c,h),s-=64,_(r,0,c,0)){for(i=0;i<s;i++)e[i]=0;return-1}for(i=0;i<s;i++)e[i]=r[i+64];return s}var ce=64,le=32,ue=64;function he(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function de(){var e,t;for(t=0;t<arguments.length;t++)if("[object Uint8Array]"!==(e=Object.prototype.toString.call(arguments[t])))throw new TypeError("unexpected type "+e+", use Uint8Array")}function pe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:E,crypto_stream_xor:S,crypto_stream:v,crypto_stream_salsa20_xor:b,crypto_stream_salsa20:w,crypto_onetimeauth:I,crypto_onetimeauth_verify:T,crypto_verify_16:m,crypto_verify_32:_,crypto_secretbox:C,crypto_secretbox_open:O,crypto_scalarmult:Q,crypto_scalarmult_base:q,crypto_box_beforenm:j,crypto_box_afternm:K,crypto_box:function(e,t,r,s,n,i){var o=new Uint8Array(32);return j(o,n,i),K(e,t,r,s,o)},crypto_box_open:function(e,t,r,s,n,i){var o=new Uint8Array(32);return j(o,n,i),W(e,t,r,s,o)},crypto_box_keypair:$,crypto_hash:V,crypto_sign:oe,crypto_sign_keypair:re,crypto_sign_open:ae,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ce,crypto_sign_PUBLICKEYBYTES:le,crypto_sign_SECRETKEYBYTES:ue,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64},e.util||(e.util={},e.util.decodeUTF8=e.util.encodeUTF8=e.util.encodeBase64=e.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),e.randomBytes=function(e){var t=new Uint8Array(e);return s(t,e),t},e.secretbox=function(e,t,r){de(e,t,r),he(r,t);for(var s=new Uint8Array(32+e.length),n=new Uint8Array(s.length),i=0;i<e.length;i++)s[i+32]=e[i];return C(n,s,s.length,t,r),n.subarray(16)},e.secretbox.open=function(e,t,r){de(e,t,r),he(r,t);for(var s=new Uint8Array(16+e.length),n=new Uint8Array(s.length),i=0;i<e.length;i++)s[i+16]=e[i];return!(s.length<32)&&0===O(n,s,s.length,t,r)&&n.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(de(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return Q(r,e,t),r},e.scalarMult.base=function(e){if(de(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return q(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,s,n){var i=e.box.before(s,n);return e.secretbox(t,r,i)},e.box.before=function(e,t){de(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return j(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,s,n){var i=e.box.before(s,n);return e.secretbox.open(t,r,i)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return $(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(de(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return q(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(de(e,t),t.length!==ue)throw new Error("bad secret key size");var r=new Uint8Array(ce+e.length);return oe(r,e,e.length,t),r},e.sign.open=function(e,t){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(de(e,t),t.length!==le)throw new Error("bad public key size");var r=new Uint8Array(e.length),s=ae(r,e,e.length,t);if(s<0)return null;for(var n=new Uint8Array(s),i=0;i<n.length;i++)n[i]=r[i];return n},e.sign.detached=function(t,r){for(var s=e.sign(t,r),n=new Uint8Array(ce),i=0;i<n.length;i++)n[i]=s[i];return n},e.sign.detached.verify=function(e,t,r){if(de(e,t,r),t.length!==ce)throw new Error("bad signature size");if(r.length!==le)throw new Error("bad public key size");var s,n=new Uint8Array(ce+e.length),i=new Uint8Array(ce+e.length);for(s=0;s<ce;s++)n[s]=t[s];for(s=0;s<e.length;s++)n[s+ce]=e[s];return ae(i,n,n.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(le),t=new Uint8Array(ue);return re(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(de(e),e.length!==ue)throw new Error("bad secret key size");for(var t=new Uint8Array(le),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(de(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(le),r=new Uint8Array(ue),s=0;s<32;s++)r[s]=e[s];return re(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=le,e.sign.secretKeyLength=ue,e.sign.seedLength=32,e.sign.signatureLength=ce,e.hash=function(e){de(e);var t=new Uint8Array(64);return V(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return de(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===g(e,0,t,0,e.length)},e.setPRNG=function(e){s=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var s,n=new Uint8Array(r);for(s=0;s<r;s+=65536)t.getRandomValues(n.subarray(s,s+Math.min(r-s,65536)));for(s=0;s<r;s++)e[s]=n[s];pe(n)})):(t=r(6113))&&t.randomBytes&&e.setPRNG((function(e,r){var s,n=t.randomBytes(r);for(s=0;s<r;s++)e[s]=n[s];pe(n)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},1635:(e,t,r)=>{"use strict";function s(e){const t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let t=0,s=e.length;t<s;t++)r[t]=e.charCodeAt(t);return t}function n(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function i(e){return n(btoa(JSON.stringify(e)))}r.r(t),r.d(t,{githubAppJwt:()=>a});const o=async({privateKey:e,payload:t})=>{if(/BEGIN RSA PRIVATE KEY/.test(e))throw new Error("[universal-github-app-jwt] Private Key is in PKCS#1 format, but only PKCS#8 is supported. See https://github.com/gr2m/universal-github-app-jwt#readme");const r={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},o=function(e){const t=e.trim().split("\n").slice(1,-1).join("");return s(atob(t))}(e),a=await crypto.subtle.importKey("pkcs8",o,r,!1,["sign"]),c=function(e,t){return`${i({alg:"RS256",typ:"JWT"})}.${i(t)}`}(0,t),l=s(c),u=function(e){for(var t="",r=new Uint8Array(e),s=r.byteLength,i=0;i<s;i++)t+=String.fromCharCode(r[i]);return n(btoa(t))}(await crypto.subtle.sign(r.name,a,l));return`${c}.${u}`};async function a({id:e,privateKey:t,now:r=Math.floor(Date.now()/1e3)}){const s=r-30,n=s+600,i={iat:s,exp:n,iss:e};return{appId:e,expiration:n,token:await o({privateKey:t,payload:i})}}},350:(e,t,r)=>{"use strict";function s(){return"object"==typeof navigator&&"userAgent"in navigator?navigator.userAgent:"object"==typeof process&&void 0!==process.version?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}r.r(t),r.d(t,{getUserAgent:()=>s})},2479:e=>{e.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){s[e]=t[e]})),s;function s(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var s=t.apply(this,e),n=e[e.length-1];return"function"==typeof s&&s!==n&&Object.keys(n).forEach((function(e){s[e]=n[e]})),s}}},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3292:e=>{"use strict";e.exports=require("fs/promises")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},4404:e=>{"use strict";e.exports=require("tls")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},3530:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;const r="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=new Set,n="object"==typeof process&&process?process:{},i=(e,t,r,s)=>{"function"==typeof n.emitWarning?n.emitWarning(e,t,r,s):console.error(`[${r}] ${t}: ${e}`)};let o=globalThis.AbortController,a=globalThis.AbortSignal;if(void 0===o){a=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},o=class{constructor(){t()}signal=new a;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==n.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");const c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>c(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?u:null:null;class u extends Array{constructor(e){super(e),this.fill(0)}}class h{heap;length;static#e=!1;static create(e){const t=l(e);if(!t)return[];h.#e=!0;const r=new h(e,t);return h.#e=!1,r}constructor(e,t){if(!h.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class d{#t;#r;#s;#n;#i;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#a;#c;#l;#u;#h;#d;#p;#f;#g;#m;#_;#A;#E;#y;#b;#w;static unsafeExposeInternals(e){return{starts:e.#A,ttls:e.#E,sizes:e.#_,keyMap:e.#c,keyList:e.#l,valList:e.#u,next:e.#h,prev:e.#d,get head(){return e.#p},get tail(){return e.#f},free:e.#g,isBackgroundFetch:t=>e.#v(t),backgroundFetch:(t,r,s,n)=>e.#S(t,r,s,n),moveToTail:t=>e.#k(t),indexes:t=>e.#I(t),rindexes:t=>e.#T(t),isStale:t=>e.#C(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#a}get size(){return this.#o}get fetchMethod(){return this.#i}get dispose(){return this.#s}get disposeAfter(){return this.#n}constructor(e){const{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:g,noDisposeOnSet:m,noUpdateTTL:_,maxSize:A=0,maxEntrySize:E=0,sizeCalculation:y,fetchMethod:b,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:k,ignoreFetchAbort:I}=e;if(0!==t&&!c(t))throw new TypeError("max option must be a nonnegative integer");const T=t?l(t):Array;if(!T)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=A,this.maxEntrySize=E||this.#r,this.sizeCalculation=y,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==b&&"function"!=typeof b)throw new TypeError("fetchMethod must be a function if specified");if(this.#i=b,this.#b=!!b,this.#c=new Map,this.#l=new Array(t).fill(void 0),this.#u=new Array(t).fill(void 0),this.#h=new T(t),this.#d=new T(t),this.#p=0,this.#f=0,this.#g=h.create(t),this.#o=0,this.#a=0,"function"==typeof f&&(this.#s=f),"function"==typeof g?(this.#n=g,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#y=!!this.#s,this.#w=!!this.#n,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!_,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!I,0!==this.maxEntrySize){if(0!==this.#r&&!c(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!c(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!u,this.ttlResolution=c(n)||0===n?n:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!c(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";(e=>!s.has(e))(e)&&(s.add(e),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,d))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#R(){const e=new u(this.#t),t=new u(this.#t);this.#E=e,this.#A=t,this.#B=(s,n,i=r.now())=>{if(t[s]=0!==n?i:0,e[s]=n,0!==n&&this.ttlAutopurge){const e=setTimeout((()=>{this.#C(s)&&this.delete(this.#l[s])}),n+1);e.unref&&e.unref()}},this.#P=s=>{t[s]=0!==e[s]?r.now():0},this.#N=(r,i)=>{if(e[i]){const o=e[i],a=t[i];if(!o||!a)return;r.ttl=o,r.start=a,r.now=s||n();const c=r.now-a;r.remainingTTL=o-c}};let s=0;const n=()=>{const e=r.now();if(this.ttlResolution>0){s=e;const t=setTimeout((()=>s=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=r=>{const i=this.#c.get(r);if(void 0===i)return 0;const o=e[i],a=t[i];return o&&a?o-((s||n())-a):1/0},this.#C=r=>{const i=t[r],o=e[r];return!!o&&!!i&&(s||n())-i>o}}#P=()=>{};#N=()=>{};#B=()=>{};#C=()=>!1;#O(){const e=new u(this.#t);this.#a=0,this.#_=e,this.#L=t=>{this.#a-=e[t],e[t]=0},this.#U=(e,t,r,s)=>{if(this.#v(t))return 0;if(!c(r)){if(!s)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof s)throw new TypeError("sizeCalculation must be a function");if(r=s(t,e),!c(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#D=(t,r,s)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#a>r;)this.#F(!0)}this.#a+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#a)}}#L=e=>{};#D=(e,t,r)=>{};#U=(e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#f;this.#x(t)&&(!e&&this.#C(t)||(yield t),t!==this.#p);)t=this.#d[t]}*#T({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#p;this.#x(t)&&(!e&&this.#C(t)||(yield t),t!==this.#f);)t=this.#h[t]}#x(e){return void 0!==e&&this.#c.get(this.#l[e])===e}*entries(){for(const e of this.#I())void 0===this.#u[e]||void 0===this.#l[e]||this.#v(this.#u[e])||(yield[this.#l[e],this.#u[e]])}*rentries(){for(const e of this.#T())void 0===this.#u[e]||void 0===this.#l[e]||this.#v(this.#u[e])||(yield[this.#l[e],this.#u[e]])}*keys(){for(const e of this.#I()){const t=this.#l[e];void 0===t||this.#v(this.#u[e])||(yield t)}}*rkeys(){for(const e of this.#T()){const t=this.#l[e];void 0===t||this.#v(this.#u[e])||(yield t)}}*values(){for(const e of this.#I())void 0===this.#u[e]||this.#v(this.#u[e])||(yield this.#u[e])}*rvalues(){for(const e of this.#T())void 0===this.#u[e]||this.#v(this.#u[e])||(yield this.#u[e])}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const r of this.#I()){const s=this.#u[r],n=this.#v(s)?s.__staleWhileFetching:s;if(void 0!==n&&e(n,this.#l[r],this))return this.get(this.#l[r],t)}}forEach(e,t=this){for(const r of this.#I()){const s=this.#u[r],n=this.#v(s)?s.__staleWhileFetching:s;void 0!==n&&e.call(t,n,this.#l[r],this)}}rforEach(e,t=this){for(const r of this.#T()){const s=this.#u[r],n=this.#v(s)?s.__staleWhileFetching:s;void 0!==n&&e.call(t,n,this.#l[r],this)}}purgeStale(){let e=!1;for(const t of this.#T({allowStale:!0}))this.#C(t)&&(this.delete(this.#l[t]),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const s=this.#u[t],n=this.#v(s)?s.__staleWhileFetching:s;if(void 0===n)return;const i={value:n};if(this.#E&&this.#A){const e=this.#E[t],s=this.#A[t];if(e&&s){const t=e-(r.now()-s);i.ttl=t,i.start=Date.now()}}return this.#_&&(i.size=this.#_[t]),i}dump(){const e=[];for(const t of this.#I({allowStale:!0})){const s=this.#l[t],n=this.#u[t],i=this.#v(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===s)continue;const o={value:i};if(this.#E&&this.#A){o.ttl=this.#E[t];const e=r.now()-this.#A[t];o.start=Math.floor(Date.now()-e)}this.#_&&(o.size=this.#_[t]),e.unshift([s,o])}return e}load(e){this.clear();for(const[t,s]of e){if(s.start){const e=Date.now()-s.start;s.start=r.now()-e}this.set(t,s.value,s)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:s=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const l=this.#U(e,t,r.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(e),this;let u=0===this.#o?void 0:this.#c.get(e);if(void 0===u)u=0===this.#o?this.#f:0!==this.#g.length?this.#g.pop():this.#o===this.#t?this.#F(!1):this.#o,this.#l[u]=e,this.#u[u]=t,this.#c.set(e,u),this.#h[this.#f]=u,this.#d[u]=this.#f,this.#f=u,this.#o++,this.#D(u,l,a),a&&(a.set="add"),c=!1;else{this.#k(u);const r=this.#u[u];if(t!==r){if(this.#b&&this.#v(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||i||(this.#y&&this.#s?.(t,e,"set"),this.#w&&this.#m?.push([t,e,"set"]))}else i||(this.#y&&this.#s?.(r,e,"set"),this.#w&&this.#m?.push([r,e,"set"]));if(this.#L(u),this.#D(u,l,a),this.#u[u]=t,a){a.set="replace";const e=r&&this.#v(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===s||this.#E||this.#R(),this.#E&&(c||this.#B(u,s,n),a&&this.#N(a,u)),!i&&this.#w&&this.#m){const e=this.#m;let t;for(;t=e?.shift();)this.#n?.(...t)}return this}pop(){try{for(;this.#o;){const e=this.#u[this.#p];if(this.#F(!0),this.#v(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#w&&this.#m){const e=this.#m;let t;for(;t=e?.shift();)this.#n?.(...t)}}}#F(e){const t=this.#p,r=this.#l[t],s=this.#u[t];return this.#b&&this.#v(s)?s.__abortController.abort(new Error("evicted")):(this.#y||this.#w)&&(this.#y&&this.#s?.(s,r,"evict"),this.#w&&this.#m?.push([s,r,"evict"])),this.#L(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#g.push(t)),1===this.#o?(this.#p=this.#f=0,this.#g.length=0):this.#p=this.#h[t],this.#c.delete(r),this.#o--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#c.get(e);if(void 0!==n){const e=this.#u[n];if(this.#v(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#C(n))return r&&this.#P(n),s&&(s.has="hit",this.#N(s,n)),!0;s&&(s.has="stale",this.#N(s,n))}else s&&(s.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,s=this.#c.get(e);if(void 0===s||!r&&this.#C(s))return;const n=this.#u[s];return this.#v(n)?n.__staleWhileFetching:n}#S(e,t,r,s){const n=void 0===t?void 0:this.#u[t];if(this.#v(n))return n;const i=new o,{signal:a}=r;a?.addEventListener("abort",(()=>i.abort(a.reason)),{signal:i.signal});const c={signal:i.signal,options:r,context:s},l=(s,n=!1)=>{const{aborted:o}=i.signal,a=r.ignoreFetchAbort&&void 0!==s;if(r.status&&(o&&!n?(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!a&&!n)return u(i.signal.reason);const l=h;return this.#u[t]===h&&(void 0===s?l.__staleWhileFetching?this.#u[t]=l.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,s,c.options))),s},u=s=>{const{aborted:n}=i.signal,o=n&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,l=h;if(this.#u[t]===h&&(c&&void 0!==l.__staleWhileFetching?o||(this.#u[t]=l.__staleWhileFetching):this.delete(e)),a)return r.status&&void 0!==l.__staleWhileFetching&&(r.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw s};r.status&&(r.status.fetchDispatched=!0);const h=new Promise(((t,s)=>{const o=this.#i?.(e,n,c);o&&o instanceof Promise&&o.then((e=>t(void 0===e?void 0:e)),s),i.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))}))})).then(l,(e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e)))),d=Object.assign(h,{__abortController:i,__staleWhileFetching:n,__returned:void 0});return void 0===t?(this.set(e,d,{...c.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=d,d}#v(e){if(!this.#b)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof o}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:g=!1,status:m,signal:_}=t;if(!this.#b)return m&&(m.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:m});const A={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:m,signal:_};let E=this.#c.get(e);if(void 0===E){m&&(m.fetch="miss");const t=this.#S(e,E,A,f);return t.__returned=t}{const t=this.#u[E];if(this.#v(t)){const e=r&&void 0!==t.__staleWhileFetching;return m&&(m.fetch="inflight",e&&(m.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const n=this.#C(E);if(!g&&!n)return m&&(m.fetch="hit"),this.#k(E),s&&this.#P(E),m&&this.#N(m,E),t;const i=this.#S(e,E,A,f),o=void 0!==i.__staleWhileFetching&&r;return m&&(m.fetch=n?"stale":"refresh",o&&n&&(m.returnedStale=!0)),o?i.__staleWhileFetching:i.__returned=i}}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:i}=t,o=this.#c.get(e);if(void 0!==o){const t=this.#u[o],a=this.#v(t);return i&&this.#N(i,o),this.#C(o)?(i&&(i.get="stale"),a?(i&&r&&void 0!==t.__staleWhileFetching&&(i.returnedStale=!0),r?t.__staleWhileFetching:void 0):(n||this.delete(e),i&&r&&(i.returnedStale=!0),r?t:void 0)):(i&&(i.get="hit"),a?t.__staleWhileFetching:(this.#k(o),s&&this.#P(o),t))}i&&(i.get="miss")}#G(e,t){this.#d[t]=e,this.#h[e]=t}#k(e){e!==this.#f&&(e===this.#p?this.#p=this.#h[e]:this.#G(this.#d[e],this.#h[e]),this.#G(this.#f,e),this.#f=e)}delete(e){let t=!1;if(0!==this.#o){const r=this.#c.get(e);if(void 0!==r)if(t=!0,1===this.#o)this.clear();else{this.#L(r);const t=this.#u[r];if(this.#v(t)?t.__abortController.abort(new Error("deleted")):(this.#y||this.#w)&&(this.#y&&this.#s?.(t,e,"delete"),this.#w&&this.#m?.push([t,e,"delete"])),this.#c.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#f)this.#f=this.#d[r];else if(r===this.#p)this.#p=this.#h[r];else{const e=this.#d[r];this.#h[e]=this.#h[r];const t=this.#h[r];this.#d[t]=this.#d[r]}this.#o--,this.#g.push(r)}}if(this.#w&&this.#m?.length){const e=this.#m;let t;for(;t=e?.shift();)this.#n?.(...t)}return t}clear(){for(const e of this.#T({allowStale:!0})){const t=this.#u[e];if(this.#v(t))t.__abortController.abort(new Error("deleted"));else{const r=this.#l[e];this.#y&&this.#s?.(t,r,"delete"),this.#w&&this.#m?.push([t,r,"delete"])}}if(this.#c.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#E&&this.#A&&(this.#E.fill(0),this.#A.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#f=0,this.#g.length=0,this.#a=0,this.#o=0,this.#w&&this.#m){const e=this.#m;let t;for(;t=e?.shift();)this.#n?.(...t)}}}t.LRUCache=d},3048:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeSSH=t.SSHError=void 0;const a=o(r(7147)),c=o(r(1017)),l=o(r(789)),u=o(r(4970)),h=o(r(2995)),d=o(r(2986)),p=r(15),f=i(r(9491)),g=o(r(9005)),m=e=>!c.default.basename(e).startsWith("."),_=()=>{};class A extends Error{constructor(e,t=null){super(e),this.code=t}}function E(e){return e.includes("\\")?e.split("\\").join("/"):e}t.SSHError=A;const y=/Error: (E[\S]+): /;t.NodeSSH=class{constructor(){this.connection=null}getConnection(){const{connection:e}=this;if(null==e)throw new Error("Not connected to server");return e}async connect(e){f.default(null!=e&&"object"==typeof e,"config must be a valid object");const t={...e};if(f.default(null!=t.username&&"string"==typeof t.username,"config.username must be a valid string"),null!=t.host)f.default("string"==typeof t.host,"config.host must be a valid string");else{if(null==t.sock)throw new f.AssertionError({message:"Either config.host or config.sock must be provided"});f.default("object"==typeof t.sock,"config.sock must be a valid object")}if(null!=t.privateKey||null!=t.privateKeyPath){if(null!=t.privateKey?(f.default("string"==typeof t.privateKey,"config.privateKey must be a valid string"),f.default(null==t.privateKeyPath,"config.privateKeyPath must not be specified when config.privateKey is specified")):null!=t.privateKeyPath&&(f.default("string"==typeof t.privateKeyPath,"config.privateKeyPath must be a valid string"),f.default(null==t.privateKey,"config.privateKey must not be specified when config.privateKeyPath is specified")),f.default(null==t.passphrase||"string"==typeof t.passphrase,"config.passphrase must be null or a valid string"),null!=t.privateKeyPath)try{t.privateKey=await async function(e){return new Promise(((t,r)=>{a.default.readFile(e,"utf8",((e,s)=>{e?r(e):t(s)}))}))}(t.privateKeyPath)}catch(e){if(null!=e&&"ENOENT"===e.code)throw new f.AssertionError({message:"config.privateKeyPath does not exist at given fs path"});throw e}}else null!=t.password&&f.default("string"==typeof t.password,"config.password must be a valid string");if(null!=t.tryKeyboard&&f.default("boolean"==typeof t.tryKeyboard,"config.tryKeyboard must be a valid boolean"),t.tryKeyboard){const{password:e}=t;null!=t.onKeyboardInteractive?f.default("function"==typeof t.onKeyboardInteractive,"config.onKeyboardInteractive must be a valid function"):null!=e&&(t.onKeyboardInteractive=(t,r,s,n,i)=>{n.length>0&&n[0].prompt.toLowerCase().includes("password")&&i([e])})}const r=new g.default.Client;return this.connection=r,await new Promise(((e,s)=>{r.on("error",s),t.onKeyboardInteractive&&r.on("keyboard-interactive",t.onKeyboardInteractive),r.on("ready",(()=>{r.removeListener("error",s),e()})),r.on("end",(()=>{this.connection===r&&(this.connection=null)})),r.on("close",(()=>{this.connection===r&&(this.connection=null),s(new A("No response from server","ETIMEDOUT"))})),r.connect(t)})),this}isConnected(){return null!=this.connection}async requestShell(e){const t=this.getConnection();return new Promise(((r,s)=>{t.on("error",s);const n=(e,n)=>{t.removeListener("error",s),e?s(e):r(n)};null==e?t.shell(n):t.shell(e,n)}))}async withShell(e,t){f.default("function"==typeof e,"callback must be a valid function");const r=await this.requestShell(t);try{await e(r)}finally{r.close()||r.destroy()}}async requestSFTP(){const e=this.getConnection();return new Promise(((t,r)=>{e.on("error",r),e.sftp(((s,n)=>{e.removeListener("error",r),s?r(s):t(n)}))}))}async withSFTP(e){f.default("function"==typeof e,"callback must be a valid function");const t=await this.requestSFTP();try{await e(t)}finally{t.end()}}async execCommand(e,t={}){f.default("string"==typeof e,"command must be a valid string"),f.default(null!=t&&"object"==typeof t,"options must be a valid object"),f.default(null==t.cwd||"string"==typeof t.cwd,"options.cwd must be a valid string"),f.default(null==t.stdin||"string"==typeof t.stdin||u.default.readable(t.stdin),"options.stdin must be a valid string or readable stream"),f.default(null==t.execOptions||"object"==typeof t.execOptions,"options.execOptions must be a valid object"),f.default(null==t.encoding||"string"==typeof t.encoding,"options.encoding must be a valid string"),f.default(null==t.onChannel||"function"==typeof t.onChannel,"options.onChannel must be a valid function"),f.default(null==t.onStdout||"function"==typeof t.onStdout,"options.onStdout must be a valid function"),f.default(null==t.onStderr||"function"==typeof t.onStderr,"options.onStderr must be a valid function");let r=e;t.cwd&&(r=`cd ${h.default([t.cwd])} ; ${r}`);const s=this.getConnection(),n={stdout:[],stderr:[]};return new Promise(((e,i)=>{s.on("error",i),s.exec(r,null!=t.execOptions?t.execOptions:{},((r,o)=>{if(s.removeListener("error",i),r)return void i(r);t.onChannel&&t.onChannel(o),o.on("data",(e=>{t.onStdout&&t.onStdout(e),n.stdout.push(e.toString(t.encoding))})),o.stderr.on("data",(e=>{t.onStderr&&t.onStderr(e),n.stderr.push(e.toString(t.encoding))})),null!=t.stdin?u.default.readable(t.stdin)?t.stdin.pipe(o,{end:!0}):(o.write(t.stdin),o.end()):o.end();let a=null,c=null;o.on("exit",((e,t)=>{a=null!=e?e:null,c=null!=t?t:null})),o.on("close",(()=>{e({code:null!=a?a:null,signal:null!=c?c:null,stdout:n.stdout.join("").trim(),stderr:n.stderr.join("").trim()})}))}))}))}async exec(e,t,r={}){f.default("string"==typeof e,"command must be a valid string"),f.default(Array.isArray(t),"parameters must be a valid array"),f.default(null!=r&&"object"==typeof r,"options must be a valid object"),f.default(null==r.stream||["both","stdout","stderr"].includes(r.stream),"options.stream must be one of both, stdout, stderr");for(let e=0,{length:r}=t;e<r;e+=1)f.default("string"==typeof t[e],`parameters[${e}] must be a valid string`);const s=`${e}${t.length>0?` ${h.default(t)}`:""}`,n=await this.execCommand(s,r);if(null==r.stream||"stdout"===r.stream){if(n.stderr)throw new Error(n.stderr);return n.stdout}return"stderr"===r.stream?n.stderr:n}async mkdir(e,t="sftp",r=null){if(f.default("string"==typeof e,"path must be a valid string"),f.default("string"==typeof t&&("sftp"===t||"exec"===t),"method must be either sftp or exec"),f.default(null==r||"object"==typeof r,"sftp must be a valid object"),"exec"===t)return void await this.exec("mkdir",["-p",E(e)]);const s=r||await this.requestSFTP(),n=async t=>async function(e,t){let r=null;try{r=await new Promise(((r,s)=>{t.stat(e,((e,t)=>{e?s(e):r(t)}))}))}catch(e){}if(r){if(r.isDirectory())return;throw new Error("mkdir() failed, target already exists and is not a directory")}try{await new Promise(((r,s)=>{t.mkdir(e,(e=>{e?s(e):r()}))}))}catch(e){if(null!=e&&"string"==typeof e.stack){const t=y.exec(e.stack);if(null!=t)throw new A(e.message,t[1]);throw e}}}(E(e),s).catch((async r=>{if(!t||null==r||"No such file"!==r.message&&"ENOENT"!==r.code)throw r;await this.mkdir(c.default.dirname(e),"sftp",s),await n(!1)}));try{await n(!0)}finally{r||s.end()}}async getFile(e,t,r=null,s=null){f.default("string"==typeof e,"localFile must be a valid string"),f.default("string"==typeof t,"remoteFile must be a valid string"),f.default(null==r||"object"==typeof r,"sftp must be a valid object"),f.default(null==s||"object"==typeof s,"transferOptions must be a valid object");const n=r||await this.requestSFTP();try{await new Promise(((r,i)=>{n.fastGet(E(t),e,s||{},(e=>{e?i(e):r()}))}))}finally{r||n.end()}}async putFile(e,t,r=null,s=null){f.default("string"==typeof e,"localFile must be a valid string"),f.default("string"==typeof t,"remoteFile must be a valid string"),f.default(null==r||"object"==typeof r,"sftp must be a valid object"),f.default(null==s||"object"==typeof s,"transferOptions must be a valid object"),f.default(await new Promise((t=>{a.default.access(e,a.default.constants.R_OK,(e=>{t(null===e)}))})),`localFile does not exist at ${e}`);const n=r||await this.requestSFTP(),i=r=>new Promise(((o,a)=>{n.fastPut(e,E(t),s||{},(e=>{null!=e?"No such file"===e.message&&r?o(this.mkdir(c.default.dirname(t),"sftp",n).then((()=>i(!1)))):a(e):o()}))}));try{await i(!0)}finally{r||n.end()}}async putFiles(e,{concurrency:t=1,sftp:r=null,transferOptions:s={}}={}){f.default(Array.isArray(e),"files must be an array");for(let t=0,{length:r}=e;t<r;t+=1){const r=e[t];f.default(r,"files items must be valid objects"),f.default(r.local&&"string"==typeof r.local,`files[${t}].local must be a string`),f.default(r.remote&&"string"==typeof r.remote,`files[${t}].remote must be a string`)}const n=[],i=r||await this.requestSFTP(),o=new p.PromiseQueue({concurrency:t});try{await new Promise(((t,r)=>{e.forEach((e=>{o.add((async()=>{await this.putFile(e.local,e.remote,i,s),n.push(e)})).catch(r)})),o.waitTillIdle().then(t)}))}catch(e){throw null!=e&&(e.transferred=n),e}finally{r||i.end()}}async putDirectory(e,t,{concurrency:r=1,sftp:s=null,transferOptions:n={},recursive:i=!0,tick:o=_,validate:l=m}={}){f.default("string"==typeof e&&e,"localDirectory must be a string"),f.default("string"==typeof t&&t,"remoteDirectory must be a string");const u=await new Promise((t=>{a.default.stat(e,((e,r)=>{t(r||null)}))}));f.default(null!=u,`localDirectory does not exist at ${e}`),f.default(u.isDirectory(),`localDirectory is not a directory at ${e}`);const h=s||await this.requestSFTP(),g=await d.default(e,{recursive:i,validate:l}),A=g.files.map((t=>c.default.relative(e,t))),E=g.directories.map((t=>c.default.relative(e,t)));E.sort(((e,t)=>e.length-t.length));let y=!1;try{await new Promise(((e,s)=>{const n=new p.PromiseQueue({concurrency:r});E.forEach((e=>{n.add((async()=>{await this.mkdir(c.default.join(t,e),"sftp",h)})).catch(s)})),e(n.waitTillIdle())})),await new Promise(((s,i)=>{const a=new p.PromiseQueue({concurrency:r});A.forEach((r=>{a.add((async()=>{const s=c.default.join(e,r),i=c.default.join(t,r);try{await this.putFile(s,i,h,n),o(s,i,null)}catch(e){y=!0,o(s,i,e)}})).catch(i)})),s(a.waitTillIdle())}))}finally{s||h.end()}return!y}async getDirectory(e,t,{concurrency:r=1,sftp:s=null,transferOptions:n={},recursive:i=!0,tick:o=_,validate:u=m}={}){f.default("string"==typeof e&&e,"localDirectory must be a string"),f.default("string"==typeof t&&t,"remoteDirectory must be a string");const h=await new Promise((t=>{a.default.stat(e,((e,r)=>{t(r||null)}))}));f.default(null!=h,`localDirectory does not exist at ${e}`),f.default(h.isDirectory(),`localDirectory is not a directory at ${e}`);const g=s||await this.requestSFTP(),A=await d.default(t,{recursive:i,validate:u,concurrency:r,fileSystem:{basename:e=>c.default.posix.basename(e),join:(e,t)=>c.default.posix.join(e,t),readdir:e=>new Promise(((t,r)=>{g.readdir(e,((e,s)=>{e?r(e):t(s.map((e=>e.filename)))}))})),stat:e=>new Promise(((t,r)=>{g.stat(e,((e,s)=>{e?r(e):t(s)}))}))}}),E=A.files.map((e=>c.default.relative(t,e))),y=A.directories.map((e=>c.default.relative(t,e)));y.sort(((e,t)=>e.length-t.length));let b=!1;try{await new Promise(((t,s)=>{const n=new p.PromiseQueue({concurrency:r});y.forEach((t=>{n.add((async()=>{await l.default(c.default.join(e,t))})).catch(s)})),t(n.waitTillIdle())})),await new Promise(((s,i)=>{const a=new p.PromiseQueue({concurrency:r});E.forEach((r=>{a.add((async()=>{const s=c.default.join(e,r),i=c.default.join(t,r);try{await this.getFile(s,i,g,n),o(s,i,null)}catch(e){b=!0,o(s,i,e)}})).catch(i)})),s(a.waitTillIdle())}))}finally{s||g.end()}return!b}forwardIn(e,t,r){const s=this.getConnection();return new Promise(((n,i)=>{s.forwardIn(e,t,((t,o)=>{if(t)return void i(t);const a=(t,s,n)=>{t.destIP===e&&t.destPort===o&&(null==r||r(t,s,n))};r&&s.on("tcp connection",a),n({port:o,dispose:()=>new Promise(((r,n)=>{s.off("tcp connection",a),s.unforwardIn(e,o,(e=>{e&&n(t),r()}))}))})}))}))}forwardOut(e,t,r,s){const n=this.getConnection();return new Promise(((i,o)=>{n.forwardOut(e,t,r,s,((e,t)=>{e?o(e):i(t)}))}))}forwardInStreamLocal(e,t){const r=this.getConnection();return new Promise(((s,n)=>{r.openssh_forwardInStreamLocal(e,(i=>{if(i)return void n(i);const o=(r,s,n)=>{r.socketPath===e&&(null==t||t(r,s,n))};t&&r.on("unix connection",o),s({dispose:()=>new Promise(((t,s)=>{r.off("unix connection",o),r.openssh_unforwardInStreamLocal(e,(e=>{e&&s(e),t()}))}))})}))}))}forwardOutStreamLocal(e){const t=this.getConnection();return new Promise(((r,s)=>{t.openssh_forwardOutStreamLocal(e,((e,t)=>{e?s(e):r(t)}))}))}dispose(){this.connection&&(this.connection.end(),this.connection=null)}}},15:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){var t=(void 0===e?{}:e).concurrency,r=void 0===t?1:t;this.options={concurrency:r},this.running=0,this.queue=[],this.idleCallbacks=[]}return e.prototype.clear=function(){this.queue=[]},e.prototype.onIdle=function(e){var t=this;return this.idleCallbacks.push(e),function(){var r=t.idleCallbacks.indexOf(e);-1!==r&&t.idleCallbacks.splice(r,1)}},e.prototype.waitTillIdle=function(){var e=this;return new Promise((function(t){if(0!==e.running)var r=e.onIdle((function(){r(),t()}));else t()}))},e.prototype.add=function(e){var t=this;return new Promise((function(r,s){var n=function(){t.running+=1;try{Promise.resolve(e()).then((function(e){r(e),t.processNext()}),(function(e){s(e),t.processNext()}))}catch(e){s(e),t.processNext()}};t.running>=t.options.concurrency?t.queue.push(n):n()}))},e.prototype.processNext=function(){this.running-=1;var e=this.queue.shift();e?e():0===this.running&&this.idleCallbacks.forEach((function(e){return e()}))},e}();t.PromiseQueue=r},2986:function(e,t,r){"use strict";var s=this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)},n=this&&this.__awaiter||function(e,t,r,s){return new(r||(r=Promise))((function(n,i){function o(e){try{c(s.next(e))}catch(e){i(e)}}function a(e){try{c(s.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,s,n,i,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,s&&(n=2&i[0]?s.return:i[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,i[1])).done)return n;switch(s=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,s=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){o.label=i[1];break}if(6===i[0]&&o.label<n[1]){o.label=n[1],n=i;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(i);break}n[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],s=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFilesystem=void 0;var a=o(r(7147)),c=o(r(1017)),l=o(r(9491)),u=r(15);function h(e){var t=e.path,r=e.recursive,s=e.validate,o=e.result,a=e.fileSystem,c=e.queue,l=e.reject;return n(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,a.stat(t)];case 1:return(e=n.sent()).isFile()?o.files.push(t):e.isDirectory()&&o.directories.push(t),e.isDirectory()&&"none"!==r?[4,a.readdir(t)]:[2];case 2:return n.sent().forEach((function(e){var n=a.join(t,e);s(n)&&c.add((function(){return h({path:n,recursive:"shallow"===r?"none":"deep",validate:s,result:o,fileSystem:a,queue:c,reject:l})})).catch(l)})),[2]}}))}))}t.defaultFilesystem={join:function(e,t){return c.default.join(e,t)},basename:function(e){return c.default.basename(e)},stat:function(e){return new Promise((function(t,r){a.default.stat(e,(function(e,s){e?r(e):t(s)}))}))},readdir:function(e){return new Promise((function(t,r){a.default.readdir(e,(function(e,s){e?r(e):t(s)}))}))}},t.default=function(e,r){var o=void 0===r?{}:r,a=o.recursive,c=void 0===a||a,d=o.validate,p=void 0===d?null:d,f=o.concurrency,g=void 0===f?1/0:f,m=o.fileSystem,_=void 0===m?t.defaultFilesystem:m;return n(this,void 0,void 0,(function(){var r,n,o;return i(this,(function(i){switch(i.label){case 0:return l.default(e&&"string"==typeof e,"path must be a valid string"),l.default("boolean"==typeof c,"options.recursive must be a valid boolean"),l.default(null===p||"function"==typeof p,"options.validate must be a valid function"),l.default("number"==typeof g,"options.concurrency must be a valid number"),l.default(null!==_&&"object"==typeof _,"options.fileSystem must be a valid object"),r=new u.PromiseQueue({concurrency:g}),n={files:[],directories:[]},o=s(s({},t.defaultFilesystem),_),[4,new Promise((function(t,s){h({path:e,recursive:c?"deep":"shallow",validate:null!=p?p:function(e){return"."!==o.basename(e).slice(0,1)},result:n,fileSystem:o,queue:r,reject:s}).then((function(){return r.waitTillIdle()})).then(t,s)}))];case 1:return i.sent(),[2,n]}}))}))}},5775:(e,t,r)=>{"use strict";var s=r(163),n=r(8844),i=r(6575),o=r(3798),a=r(6933),c=r(3179),l=r(4658);function u(e,t,r,s,n,i){const o="block-map"===r.type?a.resolveBlockMap(e,t,r,s,i):"block-seq"===r.type?c.resolveBlockSeq(e,t,r,s,i):l.resolveFlowCollection(e,t,r,s,i),u=o.constructor;return"!"===n||n===u.tagName?(o.tag=u.tagName,o):(n&&(o.tag=n),o)}t.composeCollection=function(e,t,r,a,c){const l=a?t.directives.tagName(a.source,(e=>c(a,"TAG_RESOLVE_FAILED",e))):null,h="block-map"===r.type?"map":"block-seq"===r.type?"seq":"{"===r.start.source?"map":"seq";if(!a||!l||"!"===l||l===i.YAMLMap.tagName&&"map"===h||l===o.YAMLSeq.tagName&&"seq"===h||!h)return u(e,t,r,c,l);let d=t.schema.tags.find((e=>e.tag===l&&e.collection===h));if(!d){const s=t.schema.knownTags[l];if(!s||s.collection!==h)return s?.collection?c(a,"BAD_COLLECTION_TYPE",`${s.tag} used for ${h} collection, but expects ${s.collection}`,!0):c(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),u(e,t,r,c,l);t.schema.tags.push(Object.assign({},s,{default:!1})),d=s}const p=u(e,t,r,c,l,d),f=d.resolve?.(p,(e=>c(a,"TAG_RESOLVE_FAILED",e)),t.options)??p,g=s.isNode(f)?f:new n.Scalar(f);return g.range=p.range,g.tag=l,d?.format&&(g.format=d.format),g}},3138:(e,t,r)=>{"use strict";var s=r(6068),n=r(81),i=r(7655),o=r(5920);t.composeDoc=function(e,t,{offset:r,start:a,value:c,end:l},u){const h=Object.assign({_directives:t},e),d=new s.Document(void 0,h),p={atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},f=o.resolveProps(a,{indicator:"doc-start",next:c??l?.[0],offset:r,onError:u,startOnNewline:!0});f.found&&(d.directives.docStart=!0,!c||"block-map"!==c.type&&"block-seq"!==c.type||f.hasNewline||u(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=c?n.composeNode(p,c,f,u):n.composeEmptyNode(p,f.end,a,null,f,u);const g=d.contents.range[2],m=i.resolveEnd(l,g,!1,u);return m.comment&&(d.comment=m.comment),d.range=[r,g,m.offset],d}},81:(e,t,r)=>{"use strict";var s=r(2055),n=r(5775),i=r(6548),o=r(7655),a=r(7154);const c={composeNode:l,composeEmptyNode:u};function l(e,t,r,a){const{spaceBefore:l,comment:h,anchor:d,tag:p}=r;let f,g=!0;switch(t.type){case"alias":f=function({options:e},{offset:t,source:r,end:n},i){const a=new s.Alias(r.substring(1));""===a.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=t+r.length,l=o.resolveEnd(n,c,e.strict,i);return a.range=[t,c,l.offset],l.comment&&(a.comment=l.comment),a}(e,t,a),(d||p)&&a(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=i.composeScalar(e,t,p,a),d&&(f.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=n.composeCollection(c,e,t,p,a),d&&(f.anchor=d.source.substring(1));break;default:a(t,"UNEXPECTED_TOKEN","error"===t.type?t.message:`Unsupported token (type: ${t.type})`),f=u(e,t.offset,void 0,null,r,a),g=!1}return d&&""===f.anchor&&a(d,"BAD_ALIAS","Anchor cannot be an empty string"),l&&(f.spaceBefore=!0),h&&("scalar"===t.type&&""===t.source?f.comment=h:f.commentBefore=h),e.options.keepSourceTokens&&g&&(f.srcToken=t),f}function u(e,t,r,s,{spaceBefore:n,comment:o,anchor:c,tag:l,end:u},h){const d={type:"scalar",offset:a.emptyScalarPosition(t,r,s),indent:-1,source:""},p=i.composeScalar(e,d,l,h);return c&&(p.anchor=c.source.substring(1),""===p.anchor&&h(c,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(p.spaceBefore=!0),o&&(p.comment=o,p.range[2]=u),p}t.composeEmptyNode=u,t.composeNode=l},6548:(e,t,r)=>{"use strict";var s=r(163),n=r(8844),i=r(1328),o=r(7876);t.composeScalar=function(e,t,r,a){const{value:c,type:l,comment:u,range:h}="block-scalar"===t.type?i.resolveBlockScalar(t,e.options.strict,a):o.resolveFlowScalar(t,e.options.strict,a),d=r?e.directives.tagName(r.source,(e=>a(r,"TAG_RESOLVE_FAILED",e))):null,p=r&&d?function(e,t,r,n,i){if("!"===r)return e[s.SCALAR];const o=[];for(const t of e.tags)if(!t.collection&&t.tag===r){if(!t.default||!t.test)return t;o.push(t)}for(const e of o)if(e.test?.test(t))return e;const a=e.knownTags[r];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),e[s.SCALAR])}(e.schema,c,d,r,a):"scalar"===t.type?function({directives:e,schema:t},r,n,i){const o=t.tags.find((e=>e.default&&e.test?.test(r)))||t[s.SCALAR];if(t.compat){const a=t.compat.find((e=>e.default&&e.test?.test(r)))??t[s.SCALAR];o.tag!==a.tag&&i(n,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${e.tagString(o.tag)} or ${e.tagString(a.tag)}`,!0)}return o}(e,c,t,a):e.schema[s.SCALAR];let f;try{const i=p.resolve(c,(e=>a(r??t,"TAG_RESOLVE_FAILED",e)),e.options);f=s.isScalar(i)?i:new n.Scalar(i)}catch(e){const s=e instanceof Error?e.message:String(e);a(r??t,"TAG_RESOLVE_FAILED",s),f=new n.Scalar(c)}return f.range=h,f.source=c,l&&(f.type=l),d&&(f.tag=d),p.format&&(f.format=p.format),u&&(f.comment=u),f}},5281:(e,t,r)=>{"use strict";var s=r(9226),n=r(6068),i=r(2394),o=r(163),a=r(3138),c=r(7655);function l(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:r}=e;return[t,t+("string"==typeof r?r.length:1)]}function u(e){let t="",r=!1,s=!1;for(let n=0;n<e.length;++n){const i=e[n];switch(i[0]){case"#":t+=(""===t?"":s?"\n\n":"\n")+(i.substring(1)||" "),r=!0,s=!1;break;case"%":"#"!==e[n+1]?.[0]&&(n+=1),r=!1;break;default:r||(s=!0),r=!1}}return{comment:t,afterEmptyLine:s}}t.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,r,s)=>{const n=l(e);s?this.warnings.push(new i.YAMLWarning(n,t,r)):this.errors.push(new i.YAMLParseError(n,t,r))},this.directives=new s.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:r,afterEmptyLine:s}=u(this.prelude);if(r){const n=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${r}`:r;else if(s||e.directives.docStart||!n)e.commentBefore=r;else if(o.isCollection(n)&&!n.flow&&n.items.length>0){let e=n.items[0];o.isPair(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${r}\n${t}`:r}else{const e=n.commentBefore;n.commentBefore=e?`${r}\n${e}`:r}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:u(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(const t of e)yield*this.next(t);yield*this.end(t,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,((t,r,s)=>{const n=l(e);n[0]+=t,this.onError(n,"BAD_DIRECTIVE",r,s)})),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=a.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new i.YAMLParseError(l(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new i.YAMLParseError(l(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=!0;const t=c.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(l(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),r=new n.Document(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}}},6933:(e,t,r)=>{"use strict";var s=r(394),n=r(6575),i=r(5920),o=r(3094),a=r(2566),c=r(6493);const l="All mapping items must start at the same column";t.resolveBlockMap=function({composeNode:e,composeEmptyNode:t},r,u,h,d){const p=new(d?.nodeClass??n.YAMLMap)(r.schema);r.atRoot&&(r.atRoot=!1);let f=u.offset,g=null;for(const n of u.items){const{start:d,key:m,sep:_,value:A}=n,E=i.resolveProps(d,{indicator:"explicit-key-ind",next:m??_?.[0],offset:f,onError:h,startOnNewline:!0}),y=!E.found;if(y){if(m&&("block-seq"===m.type?h(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==u.indent&&h(f,"BAD_INDENT",l)),!E.anchor&&!E.tag&&!_){g=E.end,E.comment&&(p.comment?p.comment+="\n"+E.comment:p.comment=E.comment);continue}(E.hasNewlineAfterProp||o.containsNewline(m))&&h(m??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else E.found?.indent!==u.indent&&h(f,"BAD_INDENT",l);const b=E.end,w=m?e(r,m,E,h):t(r,b,d,null,E,h);r.schema.compat&&a.flowIndentCheck(u.indent,m,h),c.mapIncludes(r,p.items,w)&&h(b,"DUPLICATE_KEY","Map keys must be unique");const v=i.resolveProps(_??[],{indicator:"map-value-ind",next:A,offset:w.range[2],onError:h,startOnNewline:!m||"block-scalar"===m.type});if(f=v.end,v.found){y&&("block-map"!==A?.type||v.hasNewline||h(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&E.start<v.found.offset-1024&&h(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const i=A?e(r,A,v,h):t(r,f,_,null,v,h);r.schema.compat&&a.flowIndentCheck(u.indent,A,h),f=i.range[2];const o=new s.Pair(w,i);r.options.keepSourceTokens&&(o.srcToken=n),p.items.push(o)}else{y&&h(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(w.comment?w.comment+="\n"+v.comment:w.comment=v.comment);const e=new s.Pair(w);r.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return g&&g<f&&h(g,"IMPOSSIBLE","Map comment with trailing content"),p.range=[u.offset,f,g??f],p}},1328:(e,t,r)=>{"use strict";var s=r(8844);t.resolveBlockScalar=function(e,t,r){const n=e.offset,i=function({offset:e,props:t},r,s){if("block-scalar-header"!==t[0].type)return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:n}=t[0],i=n[0];let o=0,a="",c=-1;for(let t=1;t<n.length;++t){const r=n[t];if(a||"-"!==r&&"+"!==r){const s=Number(r);!o&&s?o=s:-1===c&&(c=e+t)}else a=r}-1!==c&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,u="",h=n.length;for(let e=1;e<t.length;++e){const n=t[e];switch(n.type){case"space":l=!0;case"newline":h+=n.source.length;break;case"comment":r&&!l&&s(n,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=n.source.length,u=n.source.substring(1);break;case"error":s(n,"UNEXPECTED_TOKEN",n.message),h+=n.source.length;break;default:{s(n,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${n.type}`);const e=n.source;e&&"string"==typeof e&&(h+=e.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:h}}(e,t,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const o=">"===i.mode?s.Scalar.BLOCK_FOLDED:s.Scalar.BLOCK_LITERAL,a=e.source?function(e){const t=e.split(/\n( *)/),r=t[0],s=r.match(/^( *)/),n=[s?.[1]?[s[1],r.slice(s[1].length)]:["",r]];for(let e=1;e<t.length;e+=2)n.push([t[e],t[e+1]]);return n}(e.source):[];let c=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(""!==t&&"\r"!==t)break;c=e}if(0===c){const t="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let r=n+i.length;return e.source&&(r+=e.source.length),{value:t,type:o,comment:i.comment,range:[n,r,r]}}let l=e.indent+i.indent,u=e.offset+i.length,h=0;for(let e=0;e<c;++e){const[t,s]=a[e];if(""!==s&&"\r"!==s){if(t.length<l){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";r(u+t.length,"MISSING_CHAR",e)}0===i.indent&&(l=t.length),h=e;break}0===i.indent&&t.length>l&&(l=t.length),u+=t.length+s.length+1}for(let e=a.length-1;e>=c;--e)a[e][0].length>l&&(c=e+1);let d="",p="",f=!1;for(let e=0;e<h;++e)d+=a[e][0].slice(l)+"\n";for(let e=h;e<c;++e){let[t,n]=a[e];u+=t.length+n.length+1;const c="\r"===n[n.length-1];if(c&&(n=n.slice(0,-1)),n&&t.length<l){const e="Block scalar lines must not be less indented than their "+(i.indent?"explicit indentation indicator":"first line");r(u-n.length-(c?2:1),"BAD_INDENT",e),t=""}o===s.Scalar.BLOCK_LITERAL?(d+=p+t.slice(l)+n,p="\n"):t.length>l||"\t"===n[0]?(" "===p?p="\n":f||"\n"!==p||(p="\n\n"),d+=p+t.slice(l)+n,p="\n",f=!0):""===n?"\n"===p?d+="\n":p="\n":(d+=p+n,p=" ",f=!1)}switch(i.chomp){case"-":break;case"+":for(let e=c;e<a.length;++e)d+="\n"+a[e][0].slice(l);"\n"!==d[d.length-1]&&(d+="\n");break;default:d+="\n"}const g=n+i.length+e.source.length;return{value:d,type:o,comment:i.comment,range:[n,g,g]}}},3179:(e,t,r)=>{"use strict";var s=r(3798),n=r(5920),i=r(2566);t.resolveBlockSeq=function({composeNode:e,composeEmptyNode:t},r,o,a,c){const l=new(c?.nodeClass??s.YAMLSeq)(r.schema);r.atRoot&&(r.atRoot=!1);let u=o.offset,h=null;for(const{start:s,value:c}of o.items){const d=n.resolveProps(s,{indicator:"seq-item-ind",next:c,offset:u,onError:a,startOnNewline:!0});if(!d.found){if(!(d.anchor||d.tag||c)){h=d.end,d.comment&&(l.comment=d.comment);continue}c&&"block-seq"===c.type?a(d.end,"BAD_INDENT","All sequence items must start at the same column"):a(u,"MISSING_CHAR","Sequence item without - indicator")}const p=c?e(r,c,d,a):t(r,d.end,s,null,d,a);r.schema.compat&&i.flowIndentCheck(o.indent,c,a),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,h??u],l}},7655:(e,t)=>{"use strict";t.resolveEnd=function(e,t,r,s){let n="";if(e){let i=!1,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{r&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";n?n+=o+t:n=t,o="";break}case"newline":n&&(o+=e),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:n,offset:t}}},4658:(e,t,r)=>{"use strict";var s=r(163),n=r(394),i=r(6575),o=r(3798),a=r(7655),c=r(5920),l=r(3094),u=r(6493);const h="Block collections are not allowed within flow collections",d=e=>e&&("block-map"===e.type||"block-seq"===e.type);t.resolveFlowCollection=function({composeNode:e,composeEmptyNode:t},r,p,f,g){const m="{"===p.start.source,_=m?"flow map":"flow sequence",A=new(g?.nodeClass??(m?i.YAMLMap:o.YAMLSeq))(r.schema);A.flow=!0;const E=r.atRoot;E&&(r.atRoot=!1);let y=p.offset+p.start.source.length;for(let o=0;o<p.items.length;++o){const a=p.items[o],{start:g,key:E,sep:b,value:w}=a,v=c.resolveProps(g,{flow:_,indicator:"explicit-key-ind",next:E??b?.[0],offset:y,onError:f,startOnNewline:!1});if(!v.found){if(!(v.anchor||v.tag||b||w)){0===o&&v.comma?f(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${_}`):o<p.items.length-1&&f(v.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${_}`),v.comment&&(A.comment?A.comment+="\n"+v.comment:A.comment=v.comment),y=v.end;continue}!m&&r.options.strict&&l.containsNewline(E)&&f(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===o)v.comma&&f(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${_}`);else if(v.comma||f(v.start,"MISSING_CHAR",`Missing , between ${_} items`),v.comment){let e="";e:for(const t of g)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=A.items[A.items.length-1];s.isPair(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,v.comment=v.comment.substring(e.length+1)}}if(m||b||v.found){const s=v.end,o=E?e(r,E,v,f):t(r,s,g,null,v,f);d(E)&&f(o.range,"BLOCK_IN_FLOW",h);const l=c.resolveProps(b??[],{flow:_,indicator:"map-value-ind",next:w,offset:o.range[2],onError:f,startOnNewline:!1});if(l.found){if(!m&&!v.found&&r.options.strict){if(b)for(const e of b){if(e===l.found)break;if("newline"===e.type){f(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}v.start<l.found.offset-1024&&f(l.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else w&&("source"in w&&w.source&&":"===w.source[0]?f(w,"MISSING_CHAR",`Missing space after : in ${_}`):f(l.start,"MISSING_CHAR",`Missing , or : between ${_} items`));const p=w?e(r,w,l,f):l.found?t(r,l.end,b,null,l,f):null;p?d(w)&&f(p.range,"BLOCK_IN_FLOW",h):l.comment&&(o.comment?o.comment+="\n"+l.comment:o.comment=l.comment);const S=new n.Pair(o,p);if(r.options.keepSourceTokens&&(S.srcToken=a),m){const e=A;u.mapIncludes(r,e.items,o)&&f(s,"DUPLICATE_KEY","Map keys must be unique"),e.items.push(S)}else{const e=new i.YAMLMap(r.schema);e.flow=!0,e.items.push(S),A.items.push(e)}y=p?p.range[2]:l.end}else{const s=w?e(r,w,v,f):t(r,v.end,b,null,v,f);A.items.push(s),y=s.range[2],d(w)&&f(s.range,"BLOCK_IN_FLOW",h)}}const b=m?"}":"]",[w,...v]=p.end;let S=y;if(w&&w.source===b)S=w.offset+w.source.length;else{const e=_[0].toUpperCase()+_.substring(1);f(y,E?"MISSING_CHAR":"BAD_INDENT",E?`${e} must end with a ${b}`:`${e} in block collection must be sufficiently indented and end with a ${b}`),w&&1!==w.source.length&&v.unshift(w)}if(v.length>0){const e=a.resolveEnd(v,S,r.options.strict,f);e.comment&&(A.comment?A.comment+="\n"+e.comment:A.comment=e.comment),A.range=[p.offset,S,e.offset]}else A.range=[p.offset,S,S];return A}},7876:(e,t,r)=>{"use strict";var s=r(8844),n=r(7655);function i(e){let t,r;try{t=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),r=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch(e){t=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let n=s[1],i=" ",o=t.lastIndex;for(r.lastIndex=o;s=r.exec(e);)""===s[1]?"\n"===i?n+=i:i="\n":(n+=i+s[1],i=" "),o=r.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(e),n+i+(s?.[1]??"")}function o(e,t){let r="",s=e[t+1];for(;!(" "!==s&&"\t"!==s&&"\n"!==s&&"\r"!==s||"\r"===s&&"\n"!==e[t+2]);)"\n"===s&&(r+="\n"),s=e[(t+=1)+1];return r||(r=" "),{fold:r,offset:t}}const a={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function c(e,t,r,s){const n=e.substr(t,r),i=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(i)){const n=e.substr(t-2,r+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${n}`),n}return String.fromCodePoint(i)}t.resolveFlowScalar=function(e,t,r){const{offset:l,type:u,source:h,end:d}=e;let p,f;const g=(e,t,s)=>r(l+e,t,s);switch(u){case"scalar":p=s.Scalar.PLAIN,f=function(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":r=`block scalar indicator ${e[0]}`;break;case"@":case"`":r=`reserved character ${e[0]}`}return r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),i(e)}(h,g);break;case"single-quoted-scalar":p=s.Scalar.QUOTE_SINGLE,f=function(e,t){return"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote"),i(e.slice(1,-1)).replace(/''/g,"'")}(h,g);break;case"double-quoted-scalar":p=s.Scalar.QUOTE_DOUBLE,f=function(e,t){let r="";for(let s=1;s<e.length-1;++s){const n=e[s];if("\r"!==n||"\n"!==e[s+1])if("\n"===n){const{fold:t,offset:n}=o(e,s);r+=t,s=n}else if("\\"===n){let n=e[++s];const i=a[n];if(i)r+=i;else if("\n"===n)for(n=e[s+1];" "===n||"\t"===n;)n=e[1+ ++s];else if("\r"===n&&"\n"===e[s+1])for(n=e[1+ ++s];" "===n||"\t"===n;)n=e[1+ ++s];else if("x"===n||"u"===n||"U"===n){const i={x:2,u:4,U:8}[n];r+=c(e,s+1,i,t),s+=i}else{const n=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${n}`),r+=n}}else if(" "===n||"\t"===n){const t=s;let i=e[s+1];for(;" "===i||"\t"===i;)i=e[1+ ++s];"\n"===i||"\r"===i&&"\n"===e[s+2]||(r+=s>t?e.slice(t,s+1):n)}else r+=n}return'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote'),r}(h,g);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${u}`),{value:"",type:null,comment:"",range:[l,l+h.length,l+h.length]}}const m=l+h.length,_=n.resolveEnd(d,m,t,r);return{value:f,type:p,comment:_.comment,range:[l,m,_.offset]}}},5920:(e,t)=>{"use strict";t.resolveProps=function(e,{flow:t,indicator:r,next:s,offset:n,onError:i,startOnNewline:o}){let a=!1,c=o,l=o,u="",h="",d=!1,p=!1,f=!1,g=null,m=null,_=null,A=null,E=null;for(const s of e)switch(f&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),s.type){case"space":!t&&c&&"doc-start"!==r&&"\t"===s.source[0]&&i(s,"TAB_AS_INDENT","Tabs are not allowed as indentation"),l=!0;break;case"comment":{l||i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=s.source.substring(1)||" ";u?u+=h+e:u=e,h="",c=!1;break}case"newline":c?u?u+=s.source:a=!0:h+=s.source,c=!0,d=!0,(g||m)&&(p=!0),l=!0;break;case"anchor":g&&i(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&i(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=s,null===E&&(E=s.offset),c=!1,l=!1,f=!0;break;case"tag":m&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),m=s,null===E&&(E=s.offset),c=!1,l=!1,f=!0;break;case r:(g||m)&&i(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),A&&i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),A=s,c=!1,l=!1;break;case"comma":if(t){_&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=s,c=!1,l=!1;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),c=!1,l=!1}const y=e[e.length-1],b=y?y.offset+y.source.length:n;return f&&s&&"space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&("scalar"!==s.type||""!==s.source)&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:_,found:A,spaceBefore:a,comment:u,hasNewline:d,hasNewlineAfterProp:p,anchor:g,tag:m,end:b,start:E??b}}},3094:(e,t)=>{"use strict";t.containsNewline=function e(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const r of t.items){for(const e of r.start)if("newline"===e.type)return!0;if(r.sep)for(const e of r.sep)if("newline"===e.type)return!0;if(e(r.key)||e(r.value))return!0}return!1;default:return!0}}},7154:(e,t)=>{"use strict";t.emptyScalarPosition=function(e,t,r){if(t){null===r&&(r=t.length);for(let s=r-1;s>=0;--s){let r=t[s];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++s];"space"===r?.type;)e+=r.source.length,r=t[++s];break}}return e}},2566:(e,t,r)=>{"use strict";var s=r(3094);t.flowIndentCheck=function(e,t,r){if("flow-collection"===t?.type){const n=t.end[0];n.indent!==e||"]"!==n.source&&"}"!==n.source||!s.containsNewline(t)||r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}},6493:(e,t,r)=>{"use strict";var s=r(163);t.mapIncludes=function(e,t,r){const{uniqueKeys:n}=e.options;if(!1===n)return!1;const i="function"==typeof n?n:(t,r)=>t===r||s.isScalar(t)&&s.isScalar(r)&&t.value===r.value&&!("<<"===t.value&&e.schema.merge);return t.some((e=>i(e.key,r)))}},6068:(e,t,r)=>{"use strict";var s=r(2055),n=r(3365),i=r(163),o=r(394),a=r(3257),c=r(3673),l=r(9957),u=r(1903),h=r(3085),d=r(7581),p=r(9226);class f{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,i.NODE_TYPE,{value:i.DOC});let s=null;"function"==typeof t||Array.isArray(t)?s=t:void 0===r&&t&&(r=t,t=void 0);const n=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},r);this.options=n;let{version:o}=n;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new p.Directives({version:o}),this.setSchema(o,r),this.contents=void 0===e?null:this.createNode(e,s,r)}clone(){const e=Object.create(f.prototype,{[i.NODE_TYPE]:{value:i.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=i.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){g(this.contents)&&this.contents.add(e)}addIn(e,t){g(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const r=u.anchorNames(this);e.anchor=!t||r.has(t)?u.findNewAnchor(t||"a",r):t}return new s.Alias(e.anchor)}createNode(e,t,r){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,r=t.filter(e).map(String);r.length>0&&(t=t.concat(r)),s=t}else void 0===r&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:n,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:h}=r??{},{onAnchor:p,setAnchors:f,sourceObjects:g}=u.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:n??!0,keepUndefined:c??!1,onAnchor:p,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:g},_=d.createNode(e,h,m);return a&&i.isCollection(_)&&(_.flow=!0),f(),_}createPair(e,t,r={}){const s=this.createNode(e,null,r),n=this.createNode(t,null,r);return new o.Pair(s,n)}delete(e){return!!g(this.contents)&&this.contents.delete(e)}deleteIn(e){return n.isEmptyPath(e)?null!=this.contents&&(this.contents=null,!0):!!g(this.contents)&&this.contents.deleteIn(e)}get(e,t){return i.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&i.isScalar(this.contents)?this.contents.value:this.contents:i.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!i.isCollection(this.contents)&&this.contents.has(e)}hasIn(e){return n.isEmptyPath(e)?void 0!==this.contents:!!i.isCollection(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=n.collectionFromPath(this.schema,[e],t):g(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:null==this.contents?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):g(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let r;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new p.Directives({version:"1.1"}),r={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new p.Directives({version:e}),r={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!r)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new c.Schema(Object.assign(r,t))}}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:s,onAnchor:n,reviver:i}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===r,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},c=a.toJS(this.contents,t??"",o);if("function"==typeof n)for(const{count:e,res:t}of o.anchors.values())n(t,e);return"function"==typeof i?h.applyReviver(i,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return l.stringifyDocument(this,e)}}function g(e){if(i.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}t.Document=f},1903:(e,t,r)=>{"use strict";var s=r(163),n=r(1381);function i(e){const t=new Set;return n.visit(e,{Value(e,r){r.anchor&&t.add(r.anchor)}}),t}function o(e,t){for(let r=1;;++r){const s=`${e}${r}`;if(!t.has(s))return s}}t.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0},t.anchorNames=i,t.createNodeAnchors=function(e,t){const r=[],n=new Map;let a=null;return{onAnchor:s=>{r.push(s),a||(a=i(e));const n=o(t,a);return a.add(n),n},setAnchors:()=>{for(const e of r){const t=n.get(e);if("object"!=typeof t||!t.anchor||!s.isScalar(t.node)&&!s.isCollection(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:n}},t.findNewAnchor=o},3085:(e,t)=>{"use strict";t.applyReviver=function e(t,r,s,n){if(n&&"object"==typeof n)if(Array.isArray(n))for(let r=0,s=n.length;r<s;++r){const s=n[r],i=e(t,n,String(r),s);void 0===i?delete n[r]:i!==s&&(n[r]=i)}else if(n instanceof Map)for(const r of Array.from(n.keys())){const s=n.get(r),i=e(t,n,r,s);void 0===i?n.delete(r):i!==s&&n.set(r,i)}else if(n instanceof Set)for(const r of Array.from(n)){const s=e(t,n,r,r);void 0===s?n.delete(r):s!==r&&(n.delete(r),n.add(s))}else for(const[r,s]of Object.entries(n)){const i=e(t,n,r,s);void 0===i?delete n[r]:i!==s&&(n[r]=i)}return t.call(r,s,n)}},7581:(e,t,r)=>{"use strict";var s=r(2055),n=r(163),i=r(8844);t.createNode=function(e,t,r){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){const t=r.schema[n.MAP].createNode?.(r.schema,null,r);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:o,onAnchor:a,onTagObj:c,schema:l,sourceObjects:u}=r;let h;if(o&&e&&"object"==typeof e){if(h=u.get(e),h)return h.anchor||(h.anchor=a(e)),new s.Alias(h.anchor);h={anchor:null,node:null},u.set(e,h)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let d=function(e,t,r){if(t){const e=r.filter((e=>e.tag===t)),s=e.find((e=>!e.format))??e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return r.find((t=>t.identify?.(e)&&!t.format))}(e,t,l.tags);if(!d){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new i.Scalar(e);return h&&(h.node=t),t}d=e instanceof Map?l[n.MAP]:Symbol.iterator in Object(e)?l[n.SEQ]:l[n.MAP]}c&&(c(d),delete r.onTagObj);const p=d?.createNode?d.createNode(r.schema,e,r):"function"==typeof d?.nodeClass?.from?d.nodeClass.from(r.schema,e,r):new i.Scalar(e);return t?p.tag=t:d.default||(p.tag=d.tag),h&&(h.node=p),p}},9226:(e,t,r)=>{"use strict";var s=r(163),n=r(1381);const i={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};class o{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},o.defaultYaml,e),this.tags=Object.assign({},o.defaultTags,t)}clone(){const e=new o(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new o(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:o.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},o.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:o.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},o.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(2!==r.length&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[e,s]=r;return this.tags[e]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==r.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=r;return"1.1"===e||"1.2"===e?(this.yaml.version=e,!0):(t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1)}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const r=e.slice(2,-1);return"!"===r||"!!"===r?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),r)}const[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);const n=this.tags[r];if(n)try{return n+decodeURIComponent(s)}catch(e){return t(String(e)),null}return"!"===r?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+e.substring(r.length).replace(/[!,[\]{}]/g,(e=>i[e]));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(e&&r.length>0&&s.isNode(e.contents)){const t={};n.visit(e.contents,((e,r)=>{s.isNode(r)&&r.tag&&(t[r.tag]=!0)})),i=Object.keys(t)}else i=[];for(const[s,n]of r)"!!"===s&&"tag:yaml.org,2002:"===n||e&&!i.some((e=>e.startsWith(n)))||t.push(`%TAG ${s} ${n}`);return t.join("\n")}}o.defaultYaml={explicit:!1,version:"1.2"},o.defaultTags={"!!":"tag:yaml.org,2002:"},t.Directives=o},2394:(e,t)=>{"use strict";class r extends Error{constructor(e,t,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=t}}t.YAMLError=r,t.YAMLParseError=class extends r{constructor(e,t,r){super("YAMLParseError",e,t,r)}},t.YAMLWarning=class extends r{constructor(e,t,r){super("YAMLWarning",e,t,r)}},t.prettifyError=(e,t)=>r=>{if(-1===r.pos[0])return;r.linePos=r.pos.map((e=>t.linePos(e)));const{line:s,col:n}=r.linePos[0];r.message+=` at line ${s}, column ${n}`;let i=n-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const e=Math.min(i-39,o.length-79);o="…"+o.substring(e),i-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,i))){let r=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);r.length>80&&(r=r.substring(0,79)+"…\n"),o=r+o}if(/[^ ]/.test(o)){let e=1;const t=r.linePos[1];t&&t.line===s&&t.col>n&&(e=Math.max(1,Math.min(t.col-n,80-i)));const a=" ".repeat(i)+"^".repeat(e);r.message+=`:\n\n${o}\n${a}\n`}}},3419:(e,t,r)=>{"use strict";var s=r(5281),n=r(6068),i=r(3673),o=r(2394),a=r(2055),c=r(163),l=r(394),u=r(8844),h=r(6575),d=r(3798),p=r(5208),f=r(7135),g=r(4708),m=r(9369),_=r(8011),A=r(1381);t.Composer=s.Composer,t.Document=n.Document,t.Schema=i.Schema,t.YAMLError=o.YAMLError,t.YAMLParseError=o.YAMLParseError,t.YAMLWarning=o.YAMLWarning,t.Alias=a.Alias,t.isAlias=c.isAlias,t.isCollection=c.isCollection,t.isDocument=c.isDocument,t.isMap=c.isMap,t.isNode=c.isNode,t.isPair=c.isPair,t.isScalar=c.isScalar,t.isSeq=c.isSeq,t.Pair=l.Pair,t.Scalar=u.Scalar,t.YAMLMap=h.YAMLMap,t.YAMLSeq=d.YAMLSeq,t.CST=p,t.Lexer=f.Lexer,t.LineCounter=g.LineCounter,t.Parser=m.Parser,t.parse=_.parse,t.parseAllDocuments=_.parseAllDocuments,t.parseDocument=_.parseDocument,t.stringify=_.stringify,t.visit=A.visit,t.visitAsync=A.visitAsync},5441:(e,t)=>{"use strict";t.debug=function(e,...t){"debug"===e&&console.log(...t)},t.warn=function(e,t){"debug"!==e&&"warn"!==e||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(t):console.warn(t))}},2055:(e,t,r)=>{"use strict";var s=r(1903),n=r(1381),i=r(163),o=r(466),a=r(3257);class c extends o.NodeBase{constructor(e){super(i.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return n.visit(e,{Node:(e,r)=>{if(r===this)return n.visit.BREAK;r.anchor===this.source&&(t=r)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:n}=t,i=this.resolve(s);if(!i){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let o=r.get(i);if(o||(a.toJS(i,null,t),o=r.get(i)),!o||void 0===o.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(n>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=l(s,i,r)),o.count*o.aliasCount>n))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return o.res}toString(e,t,r){const n=`*${this.source}`;if(e){if(s.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${n} `}return n}}function l(e,t,r){if(i.isAlias(t)){const s=t.resolve(e),n=r&&s&&r.get(s);return n?n.count*n.aliasCount:0}if(i.isCollection(t)){let s=0;for(const n of t.items){const t=l(e,n,r);t>s&&(s=t)}return s}if(i.isPair(t)){const s=l(e,t.key,r),n=l(e,t.value,r);return Math.max(s,n)}return 1}t.Alias=c},3365:(e,t,r)=>{"use strict";var s=r(7581),n=r(163),i=r(466);function o(e,t,r){let n=r;for(let e=t.length-1;e>=0;--e){const r=t[e];if("number"==typeof r&&Number.isInteger(r)&&r>=0){const e=[];e[r]=n,n=e}else n=new Map([[r,n]])}return s.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const a=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class c extends i.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map((t=>n.isNode(t)||n.isPair(t)?t.clone(e):t)),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{const[r,...s]=e,i=this.get(r,!0);if(n.isCollection(i))i.addIn(s,t);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`);this.set(r,o(this.schema,s,t))}}}deleteIn(e){const[t,...r]=e;if(0===r.length)return this.delete(t);const s=this.get(t,!0);if(n.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){const[r,...s]=e,i=this.get(r,!0);return 0===s.length?!t&&n.isScalar(i)?i.value:i:n.isCollection(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every((t=>{if(!n.isPair(t))return!1;const r=t.value;return null==r||e&&n.isScalar(r)&&null==r.value&&!r.commentBefore&&!r.comment&&!r.tag}))}hasIn(e){const[t,...r]=e;if(0===r.length)return this.has(t);const s=this.get(t,!0);return!!n.isCollection(s)&&s.hasIn(r)}setIn(e,t){const[r,...s]=e;if(0===s.length)this.set(r,t);else{const e=this.get(r,!0);if(n.isCollection(e))e.setIn(s,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`);this.set(r,o(this.schema,s,t))}}}}c.maxFlowStringSingleLineLength=60,t.Collection=c,t.collectionFromPath=o,t.isEmptyPath=a},466:(e,t,r)=>{"use strict";var s=r(3085),n=r(163),i=r(3257);t.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:o,reviver:a}={}){if(!n.isDocument(e))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},l=i.toJS(this,"",c);if("function"==typeof o)for(const{count:e,res:t}of c.anchors.values())o(t,e);return"function"==typeof a?s.applyReviver(a,{"":l},"",l):l}}},394:(e,t,r)=>{"use strict";var s=r(7581),n=r(8843),i=r(3567),o=r(163);class a{constructor(e,t=null){Object.defineProperty(this,o.NODE_TYPE,{value:o.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return o.isNode(t)&&(t=t.clone(e)),o.isNode(r)&&(r=r.clone(e)),new a(t,r)}toJSON(e,t){const r=t?.mapAsMap?new Map:{};return i.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}}t.Pair=a,t.createPair=function(e,t,r){const n=s.createNode(e,void 0,r),i=s.createNode(t,void 0,r);return new a(n,i)}},8844:(e,t,r)=>{"use strict";var s=r(163),n=r(466),i=r(3257);class o extends n.NodeBase{constructor(e){super(s.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:i.toJS(this.value,e,t)}toString(){return String(this.value)}}o.BLOCK_FOLDED="BLOCK_FOLDED",o.BLOCK_LITERAL="BLOCK_LITERAL",o.PLAIN="PLAIN",o.QUOTE_DOUBLE="QUOTE_DOUBLE",o.QUOTE_SINGLE="QUOTE_SINGLE",t.Scalar=o,t.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e},6575:(e,t,r)=>{"use strict";var s=r(240),n=r(3567),i=r(3365),o=r(163),a=r(394),c=r(8844);function l(e,t){const r=o.isScalar(t)?t.value:t;for(const s of e)if(o.isPair(s)){if(s.key===t||s.key===r)return s;if(o.isScalar(s.key)&&s.key.value===r)return s}}class u extends i.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(o.MAP,e),this.items=[]}static from(e,t,r){const{keepUndefined:s,replacer:n}=r,i=new this(e),o=(e,o)=>{if("function"==typeof n)o=n.call(t,e,o);else if(Array.isArray(n)&&!n.includes(e))return;(void 0!==o||s)&&i.items.push(a.createPair(e,o,r))};if(t instanceof Map)for(const[e,r]of t)o(e,r);else if(t&&"object"==typeof t)for(const e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i}add(e,t){let r;r=o.isPair(e)?e:e&&"object"==typeof e&&"key"in e?new a.Pair(e.key,e.value):new a.Pair(e,e?.value);const s=l(this.items,r.key),n=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${r.key} already set`);o.isScalar(s.value)&&c.isScalarValue(r.value)?s.value.value=r.value:s.value=r.value}else if(n){const e=this.items.findIndex((e=>n(r,e)<0));-1===e?this.items.push(r):this.items.splice(e,0,r)}else this.items.push(r)}delete(e){const t=l(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const r=l(this.items,e),s=r?.value;return(!t&&o.isScalar(s)?s.value:s)??void 0}has(e){return!!l(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){const s=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(const e of this.items)n.addPairToJSMap(t,s,e);return s}toString(e,t,r){if(!e)return JSON.stringify(this);for(const e of this.items)if(!o.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),s.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}t.YAMLMap=u,t.findPair=l},3798:(e,t,r)=>{"use strict";var s=r(7581),n=r(240),i=r(3365),o=r(163),a=r(8844),c=r(3257);class l extends i.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(o.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=u(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){const r=u(e);if("number"!=typeof r)return;const s=this.items[r];return!t&&o.isScalar(s)?s.value:s}has(e){const t=u(e);return"number"==typeof t&&t<this.items.length}set(e,t){const r=u(e);if("number"!=typeof r)throw new Error(`Expected a valid index, not ${e}.`);const s=this.items[r];o.isScalar(s)&&a.isScalarValue(t)?s.value=t:this.items[r]=t}toJSON(e,t){const r=[];t?.onCreate&&t.onCreate(r);let s=0;for(const e of this.items)r.push(c.toJS(e,String(s++),t));return r}toString(e,t,r){return e?n.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+"  ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){const{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let o of t){if("function"==typeof n){const r=t instanceof Set?o:String(e++);o=n.call(t,r,o)}i.items.push(s.createNode(o,void 0,r))}}return i}}function u(e){let t=o.isScalar(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}t.YAMLSeq=l},3567:(e,t,r)=>{"use strict";var s=r(5441),n=r(611),i=r(163),o=r(8844),a=r(3257);function c(e,t,r){const s=e&&i.isAlias(r)?r.resolve(e.doc):r;if(!i.isMap(s))throw new Error("Merge sources must be maps or map aliases");const n=s.toJSON(null,e,Map);for(const[e,r]of n)t instanceof Map?t.has(e)||t.set(e,r):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0});return t}t.addPairToJSMap=function(e,t,{key:r,value:l}){if(e?.doc.schema.merge&&(e=>"<<"===e||i.isScalar(e)&&"<<"===e.value&&(!e.type||e.type===o.Scalar.PLAIN))(r))if(l=i.isAlias(l)?l.resolve(e.doc):l,i.isSeq(l))for(const r of l.items)c(e,t,r);else if(Array.isArray(l))for(const r of l)c(e,t,r);else c(e,t,l);else{const o=a.toJS(r,"",e);if(t instanceof Map)t.set(o,a.toJS(l,o,e));else if(t instanceof Set)t.add(o);else{const c=function(e,t,r){if(null===t)return"";if("object"!=typeof t)return String(t);if(i.isNode(e)&&r?.doc){const t=n.createStringifyContext(r.doc,{});t.anchors=new Set;for(const e of r.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const i=e.toString(t);if(!r.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+'..."'),s.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(t)}(r,o,e),u=a.toJS(l,c,e);c in t?Object.defineProperty(t,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):t[c]=u}}return t}},163:(e,t)=>{"use strict";const r=Symbol.for("yaml.alias"),s=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),i=Symbol.for("yaml.pair"),o=Symbol.for("yaml.scalar"),a=Symbol.for("yaml.seq"),c=Symbol.for("yaml.node.type"),l=e=>!!e&&"object"==typeof e&&e[c]===o;function u(e){if(e&&"object"==typeof e)switch(e[c]){case n:case a:return!0}return!1}t.ALIAS=r,t.DOC=s,t.MAP=n,t.NODE_TYPE=c,t.PAIR=i,t.SCALAR=o,t.SEQ=a,t.hasAnchor=e=>(l(e)||u(e))&&!!e.anchor,t.isAlias=e=>!!e&&"object"==typeof e&&e[c]===r,t.isCollection=u,t.isDocument=e=>!!e&&"object"==typeof e&&e[c]===s,t.isMap=e=>!!e&&"object"==typeof e&&e[c]===n,t.isNode=function(e){if(e&&"object"==typeof e)switch(e[c]){case r:case n:case o:case a:return!0}return!1},t.isPair=e=>!!e&&"object"==typeof e&&e[c]===i,t.isScalar=l,t.isSeq=e=>!!e&&"object"==typeof e&&e[c]===a},3257:(e,t,r)=>{"use strict";var s=r(163);t.toJS=function e(t,r,n){if(Array.isArray(t))return t.map(((t,r)=>e(t,String(r),n)));if(t&&"function"==typeof t.toJSON){if(!n||!s.hasAnchor(t))return t.toJSON(r,n);const e={aliasCount:0,count:1,res:void 0};n.anchors.set(t,e),n.onCreate=t=>{e.res=t,delete n.onCreate};const i=t.toJSON(r,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof t||n?.keep?t:Number(t)}},7084:(e,t,r)=>{"use strict";var s=r(1328),n=r(7876),i=r(2394),o=r(8431);function a(e,t){if(t)for(const r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function c(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let n=t.length;"block-scalar-header"===e.props[0].type&&(n-=e.props[0].source.length);for(const e of s)e.offset+=n;delete e.props,Object.assign(e,{type:r,source:t,end:s});break}case"block-map":case"block-seq":{const s={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:r,source:t,end:[s]});break}default:{const s="indent"in e?e.indent:-1,n="end"in e&&Array.isArray(e.end)?e.end.filter((e=>"space"===e.type||"comment"===e.type||"newline"===e.type)):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:r,indent:s,source:t,end:n})}}}t.createScalarToken=function(e,t){const{implicitKey:r=!1,indent:s,inFlow:n=!1,offset:i=-1,type:c="PLAIN"}=t,l=o.stringifyString({type:c,value:e},{implicitKey:r,indent:s>0?" ".repeat(s):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(l[0]){case"|":case">":{const e=l.indexOf("\n"),t=l.substring(0,e),r=l.substring(e+1)+"\n",n=[{type:"block-scalar-header",offset:i,indent:s,source:t}];return a(n,u)||n.push({type:"newline",offset:-1,indent:s,source:"\n"}),{type:"block-scalar",offset:i,indent:s,props:n,source:r}}case'"':return{type:"double-quoted-scalar",offset:i,indent:s,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:i,indent:s,source:l,end:u};default:return{type:"scalar",offset:i,indent:s,source:l,end:u}}},t.resolveAsScalar=function(e,t=!0,r){if(e){const o=(e,t,s)=>{const n="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!r)throw new i.YAMLParseError([n,n+1],t,s);r(n,t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return n.resolveFlowScalar(e,t,o);case"block-scalar":return s.resolveBlockScalar(e,t,o)}}return null},t.setScalarValue=function(e,t,r={}){let{afterKey:s=!1,implicitKey:n=!1,inFlow:i=!1,type:l}=r,u="indent"in e?e.indent:null;if(s&&"number"==typeof u&&(u+=2),!l)switch(e.type){case"single-quoted-scalar":l="QUOTE_SINGLE";break;case"double-quoted-scalar":l="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");l=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:l="PLAIN"}const h=o.stringifyString({type:l,value:t},{implicitKey:n||null===u,indent:null!==u&&u>0?" ".repeat(u):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(h[0]){case"|":case">":!function(e,t){const r=t.indexOf("\n"),s=t.substring(0,r),n=t.substring(r+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=s,e.source=n}else{const{offset:t}=e,r="indent"in e?e.indent:-1,i=[{type:"block-scalar-header",offset:t,indent:r,source:s}];a(i,"end"in e?e.end:void 0)||i.push({type:"newline",offset:-1,indent:r,source:"\n"});for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:r,props:i,source:n})}}(e,h);break;case'"':c(e,h,"double-quoted-scalar");break;case"'":c(e,h,"single-quoted-scalar");break;default:c(e,h,"scalar")}}},4453:(e,t)=>{"use strict";function r(e){switch(e.type){case"block-scalar":{let t="";for(const s of e.props)t+=r(s);return t+e.source}case"block-map":case"block-seq":{let t="";for(const r of e.items)t+=s(r);return t}case"flow-collection":{let t=e.start.source;for(const r of e.items)t+=s(r);for(const r of e.end)t+=r.source;return t}case"document":{let t=s(e);if(e.end)for(const r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const r of e.end)t+=r.source;return t}}}function s({start:e,key:t,sep:s,value:n}){let i="";for(const t of e)i+=t.source;if(t&&(i+=r(t)),s)for(const e of s)i+=e.source;return n&&(i+=r(n)),i}t.stringify=e=>"type"in e?r(e):s(e)},8318:(e,t)=>{"use strict";const r=Symbol("break visit"),s=Symbol("skip children"),n=Symbol("remove item");function i(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),o(Object.freeze([]),e,t)}function o(e,t,s){let i=s(t,e);if("symbol"==typeof i)return i;for(const a of["key","value"]){const c=t[a];if(c&&"items"in c){for(let t=0;t<c.items.length;++t){const i=o(Object.freeze(e.concat([[a,t]])),c.items[t],s);if("number"==typeof i)t=i-1;else{if(i===r)return r;i===n&&(c.items.splice(t,1),t-=1)}}"function"==typeof i&&"key"===a&&(i=i(t,e))}}return"function"==typeof i?i(t,e):i}i.BREAK=r,i.SKIP=s,i.REMOVE=n,i.itemAtPath=(e,t)=>{let r=e;for(const[e,s]of t){const t=r?.[e];if(!t||!("items"in t))return;r=t.items[s]}return r},i.parentCollection=(e,t)=>{const r=i.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],n=r?.[s];if(n&&"items"in n)return n;throw new Error("Parent collection not found")},t.visit=i},5208:(e,t,r)=>{"use strict";var s=r(7084),n=r(4453),i=r(8318);t.createScalarToken=s.createScalarToken,t.resolveAsScalar=s.resolveAsScalar,t.setScalarValue=s.setScalarValue,t.stringify=n.stringify,t.visit=i.visit,t.BOM="\ufeff",t.DOCUMENT="",t.FLOW_END="",t.SCALAR="",t.isCollection=e=>!!e&&"items"in e,t.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),t.prettyToken=function(e){switch(e){case"\ufeff":return"<BOM>";case"":return"<DOC>";case"":return"<FLOW_END>";case"":return"<SCALAR>";default:return JSON.stringify(e)}},t.tokenType=function(e){switch(e){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}},7135:(e,t,r)=>{"use strict";var s=r(5208);function n(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const i="0123456789ABCDEFabcdef".split(""),o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""),a=",[]{}".split(""),c=" ,[]{}\n\r\t".split(""),l=e=>!e||c.includes(e);t.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){e&&(this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null),this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;" "===t;)t=this.buffer[++r+e];if("\r"===t){const t=this.buffer[r+e+1];if("\n"===t||!t&&!this.atEnd)return e+r+1}return"\n"===t||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if("-"===t||"."===t){const t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&n(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if(e[0]===s.BOM&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length;const r=e.indexOf("#");if(-1!==r){const s=e[r-1];" "!==s&&"\t"!==s||(t=r-1)}for(;;){const r=e[t-1];if(" "!==r&&"\t"!==r)break;t-=1}const s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield s.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if("---"===e&&n(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"doc";if("..."===e&&n(this.charAt(3)))return yield*this.pushCount(3),"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!n(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&n(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(l),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(!0)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do{e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=(yield*this.pushSpaces(!0))}while(e+t>0);const i=this.getLine();if(null===i)return this.setNext("flow");if((-1!==r&&r<this.indentNext&&"#"!==i[0]||0===r&&(i.startsWith("---")||i.startsWith("..."))&&n(i[3]))&&(r!==this.indentNext-1||1!==this.flowLevel||"]"!==i[0]&&"}"!==i[0]))return this.flowLevel=0,yield s.FLOW_END,yield*this.parseLineStart();let o=0;for(;","===i[o];)o+=(yield*this.pushCount(1)),o+=(yield*this.pushSpaces(!0)),this.flowKey=!1;switch(o+=(yield*this.pushIndicators()),i[o]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(l),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||n(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}const r=this.buffer.substring(0,t);let s=r.indexOf("\n",this.pos);if(-1!==s){for(;-1!==s;){const e=this.continueScalar(s+1);if(-1===e)break;s=r.indexOf("\n",e)}-1!==s&&(t=s-("\r"===r[s-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil((e=>n(e)||"#"===e))}*parseBlockScalar(){let e,t=this.pos-1,r=0;e:for(let s=this.pos;e=this.buffer[s];++s)switch(e){case" ":r+=1;break;case"\n":t=s,r=0;break;case"\r":{const e=this.buffer[s+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext+=this.blockScalarIndent;do{const e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}if(!this.blockScalarKeep)for(;;){let e=t-1,s=this.buffer[e];"\r"===s&&(s=this.buffer[--e]);const n=e;for(;" "===s||"\t"===s;)s=this.buffer[--e];if(!("\n"===s&&e>=this.pos&&e+1+r>n))break;t=e}return yield s.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t,r=this.pos-1,i=this.pos-1;for(;t=this.buffer[++i];)if(":"===t){const t=this.buffer[i+1];if(n(t)||e&&","===t)break;r=i}else if(n(t)){let s=this.buffer[i+1];if("\r"===t&&("\n"===s?(i+=1,t="\n",s=this.buffer[i+1]):r=i),"#"===s||e&&a.includes(s))break;if("\n"===t){const e=this.continueScalar(i+1);if(-1===e)break;i=Math.max(i,e-2)}}else{if(e&&a.includes(t))break;r=i}return t||this.atEnd?(yield s.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(l))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(n(t)||e&&a.includes(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!n(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(o.includes(t))t=this.buffer[++e];else{if("%"!==t||!i.includes(this.buffer[e+1])||!i.includes(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,r=this.pos-1;do{t=this.buffer[++r]}while(" "===t||e&&"\t"===t);const s=r-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=r),s}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}},4708:(e,t)=>{"use strict";t.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){const s=t+r>>1;this.lineStarts[s]<e?t=s+1:r=s}return this.lineStarts[t]===e?{line:t+1,col:1}:0===t?{line:0,col:e}:{line:t,col:e-this.lineStarts[t-1]+1}}}}},9369:(e,t,r)=>{"use strict";var s=r(5208),n=r(7135);function i(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function o(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function a(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function c(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function l(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function u(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||i(t.start,"explicit-key-ind")||i(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,a(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}t.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",s.prettyToken(e)),this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=e.length);const t=s.tokenType(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&u(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const r=e.items[e.items.length-1];if(r.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!r.sep)return Object.assign(r,{key:t,sep:[]}),void(this.onKeyLine=!i(r.start,"explicit-key-ind"));r.value=t;break}case"block-seq":{const r=e.items[e.items.length-1];r.value?e.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{const r=e.items[e.items.length-1];return void(!r||r.value?e.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&-1===o(r.start)&&(0===t.indent||r.start.every((e=>"comment"!==e.type||e.indent<t.indent)))&&("document"===e.type?e.end=r.start:e.items.push({start:r.start}),t.items.splice(-1,1))}}else{const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}}*stream(){switch(this.type){case"directive-line":return void(yield{type:"directive",offset:this.offset,source:this.source});case"byte-order-mark":case"space":case"comment":case"newline":return void(yield this.sourceToken);case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};return"doc-start"===this.type&&e.start.push(this.sourceToken),void this.stack.push(e)}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":return void(-1!==o(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken));case"anchor":case"tag":case"space":case"comment":case"newline":return void e.start.push(this.sourceToken)}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){const t=l(c(this.peek(2)));let r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":return void e.props.push(this.sourceToken);case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const r="end"in t.value?t.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;"comment"===s?.type?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const r=e.items[e.items.length-2],s=r?.value?.end;if(Array.isArray(s))return Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const r=!this.onKeyLine&&this.indent===e.indent&&t.sep;let s=[];if(r&&t.sep&&!t.value){const r=[];for(let s=0;s<t.sep.length;++s){const n=t.sep[s];switch(n.type){case"newline":r.push(s);break;case"space":break;case"comment":n.indent>e.indent&&(r.length=0);break;default:r.length=0}}r.length>=2&&(s=t.sep.splice(r[1]))}switch(this.type){case"anchor":case"tag":return void(r||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"explicit-key-ind":return t.sep||i(t.start,"explicit-key-ind")?r||t.value?(s.push(this.sourceToken),e.items.push({start:s})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}):t.start.push(this.sourceToken),void(this.onKeyLine=!0);case"map-value-ind":if(i(t.start,"explicit-key-ind"))if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(i(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(a(t.key)&&!i(t.sep,"newline")){const e=l(t.start),r=t.key,s=t.sep;s.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:r,sep:s}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(i(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const e=l(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):i(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(r||t.value?(e.items.push({start:s,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const n=this.startBlockValue(e);if(n)return r&&"block-seq"!==n.type&&i(t.start,"explicit-key-ind")&&e.items.push({start:s}),void this.stack.push(n)}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const r="end"in t.value?t.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;"comment"===s?.type?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const r=e.items[e.items.length-2],s=r?.value?.end;if(Array.isArray(s))return Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||i(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const r=l(c(t));u(e);const s=e.end.splice(1,e.end.length);s.push(this.sourceToken);const n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=l(c(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t}]}}case"map-value-ind":{this.onKeyLine=!0;const t=l(c(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every((e=>"newline"===e.type||"space"===e.type))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}},8011:(e,t,r)=>{"use strict";var s=r(5281),n=r(6068),i=r(2394),o=r(5441),a=r(4708),c=r(9369);function l(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new a.LineCounter||null,prettyErrors:t}}function u(e,t={}){const{lineCounter:r,prettyErrors:n}=l(t),o=new c.Parser(r?.addNewLine),a=new s.Composer(t);let u=null;for(const t of a.compose(o.parse(e),!0,e.length))if(u){if("silent"!==u.options.logLevel){u.errors.push(new i.YAMLParseError(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else u=t;return n&&r&&(u.errors.forEach(i.prettifyError(e,r)),u.warnings.forEach(i.prettifyError(e,r))),u}t.parse=function(e,t,r){let s;"function"==typeof t?s=t:void 0===r&&t&&"object"==typeof t&&(r=t);const n=u(e,r);if(!n)return null;if(n.warnings.forEach((e=>o.warn(n.options.logLevel,e))),n.errors.length>0){if("silent"!==n.options.logLevel)throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:s},r))},t.parseAllDocuments=function(e,t={}){const{lineCounter:r,prettyErrors:n}=l(t),o=new c.Parser(r?.addNewLine),a=new s.Composer(t),u=Array.from(a.compose(o.parse(e)));if(n&&r)for(const t of u)t.errors.forEach(i.prettifyError(e,r)),t.warnings.forEach(i.prettifyError(e,r));return u.length>0?u:Object.assign([],{empty:!0},a.streamInfo())},t.parseDocument=u,t.stringify=function(e,t,r){let s=null;if("function"==typeof t||Array.isArray(t)?s=t:void 0===r&&t&&(r=t),"string"==typeof r&&(r=r.length),"number"==typeof r){const e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=r??t??{};if(!e)return}return new n.Document(e,s,r).toString(r)}},3673:(e,t,r)=>{"use strict";var s=r(163),n=r(2744),i=r(2360),o=r(3042),a=r(6524);const c=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class l{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:l,schema:u,sortMapEntries:h,toStringDefaults:d}){this.compat=Array.isArray(e)?a.getTags(e,"compat"):e?a.getTags(null,e):null,this.merge=!!r,this.name="string"==typeof u&&u||"core",this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(t,this.name),this.toStringOptions=d??null,Object.defineProperty(this,s.MAP,{value:n.map}),Object.defineProperty(this,s.SCALAR,{value:o.string}),Object.defineProperty(this,s.SEQ,{value:i.seq}),this.sortMapEntries="function"==typeof h?h:!0===h?c:null}clone(){const e=Object.create(l.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}t.Schema=l},2744:(e,t,r)=>{"use strict";var s=r(163),n=r(6575);const i={collection:"map",default:!0,nodeClass:n.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(s.isMap(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)};t.map=i},5397:(e,t,r)=>{"use strict";var s=r(8844);const n={identify:e=>null==e,createNode:()=>new s.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new s.Scalar(null),stringify:({source:e},t)=>"string"==typeof e&&n.test.test(e)?e:t.options.nullStr};t.nullTag=n},2360:(e,t,r)=>{"use strict";var s=r(163),n=r(3798);const i={collection:"seq",default:!0,nodeClass:n.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(s.isSeq(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)};t.seq=i},3042:(e,t,r)=>{"use strict";var s=r(8431);const n={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,r,n)=>(t=Object.assign({actualString:!0},t),s.stringifyString(e,t,r,n))};t.string=n},976:(e,t,r)=>{"use strict";var s=r(8844);const n={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new s.Scalar("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},r)=>e&&n.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?r.options.trueStr:r.options.falseStr};t.boolTag=n},3398:(e,t,r)=>{"use strict";var s=r(8844),n=r(8961);const i={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber},o={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},a={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new s.Scalar(parseFloat(e)),r=e.indexOf(".");return-1!==r&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-r-1),t},stringify:n.stringifyNumber};t.float=a,t.floatExp=o,t.floatNaN=i},4723:(e,t,r)=>{"use strict";var s=r(8961);const n=e=>"bigint"==typeof e||Number.isInteger(e),i=(e,t,r,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),r);function o(e,t,r){const{value:i}=e;return n(i)&&i>=0?r+i.toString(t):s.stringifyNumber(e)}const a={identify:e=>n(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>i(e,2,8,r),stringify:e=>o(e,8,"0o")},c={identify:n,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>i(e,0,10,r),stringify:s.stringifyNumber},l={identify:e=>n(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>i(e,2,16,r),stringify:e=>o(e,16,"0x")};t.int=c,t.intHex=l,t.intOct=a},3305:(e,t,r)=>{"use strict";var s=r(2744),n=r(5397),i=r(2360),o=r(3042),a=r(976),c=r(3398),l=r(4723);const u=[s.map,i.seq,o.string,n.nullTag,a.boolTag,l.intOct,l.int,l.intHex,c.floatNaN,c.floatExp,c.float];t.schema=u},7854:(e,t,r)=>{"use strict";var s=r(8844),n=r(2744),i=r(2360);function o(e){return"bigint"==typeof e||Number.isInteger(e)}const a=({value:e})=>JSON.stringify(e),c=[{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:a},{identify:e=>null==e,createNode:()=>new s.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:a},{identify:o,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>o(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}],l={default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},u=[n.map,i.seq].concat(c,l);t.schema=u},6524:(e,t,r)=>{"use strict";var s=r(2744),n=r(5397),i=r(2360),o=r(3042),a=r(976),c=r(3398),l=r(4723),u=r(3305),h=r(7854),d=r(8798),p=r(1367),f=r(3879),g=r(3015),m=r(7559),_=r(7714);const A=new Map([["core",u.schema],["failsafe",[s.map,i.seq,o.string]],["json",h.schema],["yaml11",g.schema],["yaml-1.1",g.schema]]),E={binary:d.binary,bool:a.boolTag,float:c.float,floatExp:c.floatExp,floatNaN:c.floatNaN,floatTime:_.floatTime,int:l.int,intHex:l.intHex,intOct:l.intOct,intTime:_.intTime,map:s.map,null:n.nullTag,omap:p.omap,pairs:f.pairs,seq:i.seq,set:m.set,timestamp:_.timestamp},y={"tag:yaml.org,2002:binary":d.binary,"tag:yaml.org,2002:omap":p.omap,"tag:yaml.org,2002:pairs":f.pairs,"tag:yaml.org,2002:set":m.set,"tag:yaml.org,2002:timestamp":_.timestamp};t.coreKnownTags=y,t.getTags=function(e,t){let r=A.get(t);if(!r){if(!Array.isArray(e)){const e=Array.from(A.keys()).filter((e=>"yaml11"!==e)).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}r=[]}if(Array.isArray(e))for(const t of e)r=r.concat(t);else"function"==typeof e&&(r=e(r.slice()));return r.map((e=>{if("string"!=typeof e)return e;const t=E[e];if(t)return t;const r=Object.keys(E).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${e}"; use one of ${r}`)}))}},8798:(e,t,r)=>{"use strict";var s=r(8844),n=r(8431);const i={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof Buffer)return Buffer.from(e,"base64");if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);return r}return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},i,o,a){const c=r;let l;if("function"==typeof Buffer)l=c instanceof Buffer?c.toString("base64"):Buffer.from(c.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<c.length;++t)e+=String.fromCharCode(c[t]);l=btoa(e)}}if(t||(t=s.Scalar.BLOCK_LITERAL),t!==s.Scalar.QUOTE_DOUBLE){const e=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),r=Math.ceil(l.length/e),n=new Array(r);for(let t=0,s=0;t<r;++t,s+=e)n[t]=l.substr(s,e);l=n.join(t===s.Scalar.BLOCK_LITERAL?"\n":" ")}return n.stringifyString({comment:e,type:t,value:l},i,o,a)}};t.binary=i},9466:(e,t,r)=>{"use strict";var s=r(8844);function n({value:e,source:t},r){return t&&(e?i:o).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}const i={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new s.Scalar(!0),stringify:n},o={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new s.Scalar(!1),stringify:n};t.falseTag=o,t.trueTag=i},3922:(e,t,r)=>{"use strict";var s=r(8844),n=r(8961);const i={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber},o={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},a={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new s.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(-1!==r){const s=e.substring(r+1).replace(/_/g,"");"0"===s[s.length-1]&&(t.minFractionDigits=s.length)}return t},stringify:n.stringifyNumber};t.float=a,t.floatExp=o,t.floatNaN=i},5563:(e,t,r)=>{"use strict";var s=r(8961);const n=e=>"bigint"==typeof e||Number.isInteger(e);function i(e,t,r,{intAsBigInt:s}){const n=e[0];if("-"!==n&&"+"!==n||(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===n?BigInt(-1)*t:t}const i=parseInt(e,r);return"-"===n?-1*i:i}function o(e,t,r){const{value:i}=e;if(n(i)){const e=i.toString(t);return i<0?"-"+r+e.substr(1):r+e}return s.stringifyNumber(e)}const a={identify:n,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>i(e,2,2,r),stringify:e=>o(e,2,"0b")},c={identify:n,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>i(e,1,8,r),stringify:e=>o(e,8,"0")},l={identify:n,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>i(e,0,10,r),stringify:s.stringifyNumber},u={identify:n,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>i(e,2,16,r),stringify:e=>o(e,16,"0x")};t.int=l,t.intBin=a,t.intHex=u,t.intOct=c},1367:(e,t,r)=>{"use strict";var s=r(163),n=r(3257),i=r(6575),o=r(3798),a=r(3879);class c extends o.YAMLSeq{constructor(){super(),this.add=i.YAMLMap.prototype.add.bind(this),this.delete=i.YAMLMap.prototype.delete.bind(this),this.get=i.YAMLMap.prototype.get.bind(this),this.has=i.YAMLMap.prototype.has.bind(this),this.set=i.YAMLMap.prototype.set.bind(this),this.tag=c.tag}toJSON(e,t){if(!t)return super.toJSON(e);const r=new Map;t?.onCreate&&t.onCreate(r);for(const e of this.items){let i,o;if(s.isPair(e)?(i=n.toJS(e.key,"",t),o=n.toJS(e.value,i,t)):i=n.toJS(e,"",t),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){const s=a.createPairs(e,t,r),n=new this;return n.items=s.items,n}}c.tag="tag:yaml.org,2002:omap";const l={collection:"seq",identify:e=>e instanceof Map,nodeClass:c,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const r=a.resolvePairs(e,t),n=[];for(const{key:e}of r.items)s.isScalar(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new c,r)},createNode:(e,t,r)=>c.from(e,t,r)};t.YAMLOMap=c,t.omap=l},3879:(e,t,r)=>{"use strict";var s=r(163),n=r(394),i=r(8844),o=r(3798);function a(e,t){if(s.isSeq(e))for(let r=0;r<e.items.length;++r){let o=e.items[r];if(!s.isPair(o)){if(s.isMap(o)){o.items.length>1&&t("Each pair must have its own sequence indicator");const e=o.items[0]||new n.Pair(new i.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){const t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[r]=s.isPair(o)?o:new n.Pair(o)}}else t("Expected a sequence for this tag");return e}function c(e,t,r){const{replacer:s}=r,i=new o.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,c;if("function"==typeof s&&(e=s.call(t,String(a++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);o=e[0],c=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);o=t[0],c=e[o]}else o=e;i.items.push(n.createPair(o,c,r))}return i}const l={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:a,createNode:c};t.createPairs=c,t.pairs=l,t.resolvePairs=a},3015:(e,t,r)=>{"use strict";var s=r(2744),n=r(5397),i=r(2360),o=r(3042),a=r(8798),c=r(9466),l=r(3922),u=r(5563),h=r(1367),d=r(3879),p=r(7559),f=r(7714);const g=[s.map,i.seq,o.string,n.nullTag,c.trueTag,c.falseTag,u.intBin,u.intOct,u.int,u.intHex,l.floatNaN,l.floatExp,l.float,a.binary,h.omap,d.pairs,p.set,f.intTime,f.floatTime,f.timestamp];t.schema=g},7559:(e,t,r)=>{"use strict";var s=r(163),n=r(394),i=r(6575);class o extends i.YAMLMap{constructor(e){super(e),this.tag=o.tag}add(e){let t;t=s.isPair(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new n.Pair(e.key,null):new n.Pair(e,null),i.findPair(this.items,t.key)||this.items.push(t)}get(e,t){const r=i.findPair(this.items,e);return!t&&s.isPair(r)?s.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const r=i.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){const{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof s&&(e=s.call(t,e,e)),i.items.push(n.createPair(e,null,r));return i}}o.tag="tag:yaml.org,2002:set";const a={collection:"map",identify:e=>e instanceof Set,nodeClass:o,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>o.from(e,t,r),resolve(e,t){if(s.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new o,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};t.YAMLSet=o,t.set=a},7714:(e,t,r)=>{"use strict";var s=r(8961);function n(e,t){const r=e[0],s="-"===r||"+"===r?e.substring(1):e,n=e=>t?BigInt(e):Number(e),i=s.replace(/_/g,"").split(":").reduce(((e,t)=>e*n(60)+n(t)),n(0));return"-"===r?n(-1)*i:i}function i(e){let{value:t}=e,r=e=>e;if("bigint"==typeof t)r=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return s.stringifyNumber(e);let n="";t<0&&(n="-",t*=r(-1));const i=r(60),o=[t%i];return t<60?o.unshift(0):(t=(t-o[0])/i,o.unshift(t%i),t>=60&&(t=(t-o[0])/i,o.unshift(t))),n+o.map((e=>String(e).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const o={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:i},a={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:i},c={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(c.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,s,i,o,a,l]=t.map(Number),u=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(r,s-1,i,o||0,a||0,l||0,u);const d=t[8];if(d&&"Z"!==d){let e=n(d,!1);Math.abs(e)<30&&(e*=60),h-=6e4*e}return new Date(h)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};t.floatTime=a,t.intTime=o,t.timestamp=c},4112:(e,t)=>{"use strict";const r="block",s="quoted";function n(e,t){let r=e[t+1];for(;" "===r||"\t"===r;){do{r=e[t+=1]}while(r&&"\n"!==r);r=e[t+1]}return t}t.FOLD_BLOCK=r,t.FOLD_FLOW="flow",t.FOLD_QUOTED=s,t.foldFlowLines=function(e,t,i="flow",{indentAtStart:o,lineWidth:a=80,minContentWidth:c=20,onFold:l,onOverflow:u}={}){if(!a||a<0)return e;const h=Math.max(1+c,1+a-t.length);if(e.length<=h)return e;const d=[],p={};let f,g,m=a-t.length;"number"==typeof o&&(o>a-Math.max(2,c)?d.push(0):m=a-o);let _=!1,A=-1,E=-1,y=-1;i===r&&(A=n(e,A),-1!==A&&(m=A+h));for(let t;t=e[A+=1];){if(i===s&&"\\"===t){switch(E=A,e[A+1]){case"x":A+=3;break;case"u":A+=5;break;case"U":A+=9;break;default:A+=1}y=A}if("\n"===t)i===r&&(A=n(e,A)),m=A+h,f=void 0;else{if(" "===t&&g&&" "!==g&&"\n"!==g&&"\t"!==g){const t=e[A+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(f=A)}if(A>=m)if(f)d.push(f),m=f+h,f=void 0;else if(i===s){for(;" "===g||"\t"===g;)g=t,t=e[A+=1],_=!0;const r=A>y+1?A-2:E-1;if(p[r])return e;d.push(r),p[r]=!0,m=r+h,f=void 0}else _=!0}g=t}if(_&&u&&u(),0===d.length)return e;l&&l();let b=e.slice(0,d[0]);for(let r=0;r<d.length;++r){const n=d[r],o=d[r+1]||e.length;0===n?b=`\n${t}${e.slice(0,o)}`:(i===s&&p[n]&&(b+=`${e[n]}\\`),b+=`\n${t}${e.slice(n+1,o)}`)}return b}},611:(e,t,r)=>{"use strict";var s=r(1903),n=r(163),i=r(8463),o=r(8431);t.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:!0,commentString:i.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof r.indent?" ".repeat(r.indent):"  ",inFlow:s,options:r}},t.stringify=function(e,t,r,i){if(n.isPair(e))return e.toString(t,r,i);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let a;const c=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>a=e});a||(a=function(e,t){if(t.tag){const r=e.filter((e=>e.tag===t.tag));if(r.length>0)return r.find((e=>e.format===t.format))??r[0]}let r,s;if(n.isScalar(t)){s=t.value;const n=e.filter((e=>e.identify?.(s)));r=n.find((e=>e.format===t.format))??n.find((e=>!e.format))}else s=t,r=e.find((e=>e.nodeClass&&s instanceof e.nodeClass));if(!r)throw new Error(`Tag not resolved for ${s?.constructor?.name??typeof s} value`);return r}(t.doc.schema.tags,c));const l=function(e,t,{anchors:r,doc:i}){if(!i.directives)return"";const o=[],a=(n.isScalar(e)||n.isCollection(e))&&e.anchor;a&&s.anchorIsValid(a)&&(r.add(a),o.push(`&${a}`));const c=e.tag?e.tag:t.default?null:t.tag;return c&&o.push(i.directives.tagString(c)),o.join(" ")}(c,a,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const u="function"==typeof a.stringify?a.stringify(c,t,r,i):n.isScalar(c)?o.stringifyString(c,t,r,i):c.toString(t,r,i);return l?n.isScalar(c)||"{"===u[0]||"["===u[0]?`${l} ${u}`:`${l}\n${t.indent}${u}`:u}},240:(e,t,r)=>{"use strict";var s=r(3365),n=r(163),i=r(611),o=r(8463);function a({comment:e,items:t},r,{blockItemPrefix:s,flowChars:a,itemIndent:c,onChompKeep:u,onComment:h}){const{indent:d,options:{commentString:p}}=r,f=Object.assign({},r,{indent:c,type:null});let g=!1;const m=[];for(let e=0;e<t.length;++e){const a=t[e];let u=null;if(n.isNode(a))!g&&a.spaceBefore&&m.push(""),l(r,m,a.commentBefore,g),a.comment&&(u=a.comment);else if(n.isPair(a)){const e=n.isNode(a.key)?a.key:null;e&&(!g&&e.spaceBefore&&m.push(""),l(r,m,e.commentBefore,g))}g=!1;let h=i.stringify(a,f,(()=>u=null),(()=>g=!0));u&&(h+=o.lineComment(h,c,p(u))),g&&u&&(g=!1),m.push(s+h)}let _;if(0===m.length)_=a.start+a.end;else{_=m[0];for(let e=1;e<m.length;++e){const t=m[e];_+=t?`\n${d}${t}`:"\n"}}return e?(_+="\n"+o.indentComment(p(e),d),h&&h()):g&&u&&u(),_}function c({comment:e,items:t},r,{flowChars:a,itemIndent:c,onComment:u}){const{indent:h,indentStep:d,flowCollectionPadding:p,options:{commentString:f}}=r;c+=d;const g=Object.assign({},r,{indent:c,inFlow:!0,type:null});let m=!1,_=0;const A=[];for(let e=0;e<t.length;++e){const s=t[e];let a=null;if(n.isNode(s))s.spaceBefore&&A.push(""),l(r,A,s.commentBefore,!1),s.comment&&(a=s.comment);else if(n.isPair(s)){const e=n.isNode(s.key)?s.key:null;e&&(e.spaceBefore&&A.push(""),l(r,A,e.commentBefore,!1),e.comment&&(m=!0));const t=n.isNode(s.value)?s.value:null;t?(t.comment&&(a=t.comment),t.commentBefore&&(m=!0)):null==s.value&&e?.comment&&(a=e.comment)}a&&(m=!0);let u=i.stringify(s,g,(()=>a=null));e<t.length-1&&(u+=","),a&&(u+=o.lineComment(u,c,f(a))),!m&&(A.length>_||u.includes("\n"))&&(m=!0),A.push(u),_=A.length}let E;const{start:y,end:b}=a;if(0===A.length)E=y+b;else if(m||(m=A.reduce(((e,t)=>e+t.length+2),2)>s.Collection.maxFlowStringSingleLineLength),m){E=y;for(const e of A)E+=e?`\n${d}${h}${e}`:"\n";E+=`\n${h}${b}`}else E=`${y}${p}${A.join(" ")}${p}${b}`;return e&&(E+=o.lineComment(E,h,f(e)),u&&u()),E}function l({indent:e,options:{commentString:t}},r,s,n){if(s&&n&&(s=s.replace(/^\n+/,"")),s){const n=o.indentComment(t(s),e);r.push(n.trimStart())}}t.stringifyCollection=function(e,t,r){return(t.inFlow??e.flow?c:a)(e,t,r)}},8463:(e,t)=>{"use strict";function r(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}t.indentComment=r,t.lineComment=(e,t,s)=>e.endsWith("\n")?r(s,t):s.includes("\n")?"\n"+r(s,t):(e.endsWith(" ")?"":" ")+s,t.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#")},9957:(e,t,r)=>{"use strict";var s=r(163),n=r(611),i=r(8463);t.stringifyDocument=function(e,t){const r=[];let o=!0===t.directives;if(!1!==t.directives&&e.directives){const t=e.directives.toString(e);t?(r.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&r.push("---");const a=n.createStringifyContext(e,t),{commentString:c}=a.options;if(e.commentBefore){1!==r.length&&r.unshift("");const t=c(e.commentBefore);r.unshift(i.indentComment(t,""))}let l=!1,u=null;if(e.contents){if(s.isNode(e.contents)){if(e.contents.spaceBefore&&o&&r.push(""),e.contents.commentBefore){const t=c(e.contents.commentBefore);r.push(i.indentComment(t,""))}a.forceBlockIndent=!!e.comment,u=e.contents.comment}const t=u?void 0:()=>l=!0;let h=n.stringify(e.contents,a,(()=>u=null),t);u&&(h+=i.lineComment(h,"",c(u))),"|"!==h[0]&&">"!==h[0]||"---"!==r[r.length-1]?r.push(h):r[r.length-1]=`--- ${h}`}else r.push(n.stringify(e.contents,a));if(e.directives?.docEnd)if(e.comment){const t=c(e.comment);t.includes("\n")?(r.push("..."),r.push(i.indentComment(t,""))):r.push(`... ${t}`)}else r.push("...");else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,"")),t&&(l&&!u||""===r[r.length-1]||r.push(""),r.push(i.indentComment(c(t),"")))}return r.join("\n")+"\n"}},8961:(e,t)=>{"use strict";t.stringifyNumber=function({format:e,minFractionDigits:t,tag:r,value:s}){if("bigint"==typeof s)return String(s);const n="number"==typeof s?s:Number(s);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let i=JSON.stringify(s);if(!e&&t&&(!r||"tag:yaml.org,2002:float"===r)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let r=t-(i.length-e-1);for(;r-- >0;)i+="0"}return i}},8843:(e,t,r)=>{"use strict";var s=r(163),n=r(8844),i=r(611),o=r(8463);t.stringifyPair=function({key:e,value:t},r,a,c){const{allNullValues:l,doc:u,indent:h,indentStep:d,options:{commentString:p,indentSeq:f,simpleKeys:g}}=r;let m=s.isNode(e)&&e.comment||null;if(g){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(s.isCollection(e))throw new Error("With simple keys, collection cannot be used as a key value")}let _=!g&&(!e||m&&null==t&&!r.inFlow||s.isCollection(e)||(s.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:"object"==typeof e));r=Object.assign({},r,{allNullValues:!1,implicitKey:!_&&(g||!l),indent:h+d});let A,E,y,b=!1,w=!1,v=i.stringify(e,r,(()=>b=!0),(()=>w=!0));if(!_&&!r.inFlow&&v.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");_=!0}if(r.inFlow){if(l||null==t)return b&&a&&a(),""===v?"?":_?`? ${v}`:v}else if(l&&!g||null==t&&_)return v=`? ${v}`,m&&!b?v+=o.lineComment(v,r.indent,p(m)):w&&c&&c(),v;b&&(m=null),_?(m&&(v+=o.lineComment(v,r.indent,p(m))),v=`? ${v}\n${h}:`):(v=`${v}:`,m&&(v+=o.lineComment(v,r.indent,p(m)))),s.isNode(t)?(A=!!t.spaceBefore,E=t.commentBefore,y=t.comment):(A=!1,E=null,y=null,t&&"object"==typeof t&&(t=u.createNode(t))),r.implicitKey=!1,_||m||!s.isScalar(t)||(r.indentAtStart=v.length+1),w=!1,f||!(d.length>=2)||r.inFlow||_||!s.isSeq(t)||t.flow||t.tag||t.anchor||(r.indent=r.indent.substring(2));let S=!1;const k=i.stringify(t,r,(()=>S=!0),(()=>w=!0));let I=" ";if(m||A||E){if(I=A?"\n":"",E){const e=p(E);I+=`\n${o.indentComment(e,r.indent)}`}""!==k||r.inFlow?I+=`\n${r.indent}`:"\n"===I&&(I="\n\n")}else if(!_&&s.isCollection(t)){const e=k[0],s=k.indexOf("\n"),n=-1!==s,i=r.inFlow??t.flow??0===t.items.length;if(n||!i){let t=!1;if(n&&("&"===e||"!"===e)){let r=k.indexOf(" ");"&"===e&&-1!==r&&r<s&&"!"===k[r+1]&&(r=k.indexOf(" ",r+1)),(-1===r||s<r)&&(t=!0)}t||(I=`\n${r.indent}`)}}else""!==k&&"\n"!==k[0]||(I="");return v+=I+k,r.inFlow?S&&a&&a():y&&!S?v+=o.lineComment(v,r.indent,p(y)):w&&c&&c(),v}},8431:(e,t,r)=>{"use strict";var s=r(8844),n=r(4112);const i=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),o=e=>/^(%|---|\.\.\.)/m.test(e);function a(e,t){const r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;const{implicitKey:s}=t,a=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(o(e)?"  ":"");let l="",u=0;for(let e=0,t=r[e];t;t=r[++e])if(" "===t&&"\\"===r[e+1]&&"n"===r[e+2]&&(l+=r.slice(u,e)+"\\ ",e+=1,u=e,t="\\"),"\\"===t)switch(r[e+1]){case"u":{l+=r.slice(u,e);const t=r.substr(e+2,4);switch(t){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:"00"===t.substr(0,2)?l+="\\x"+t.substr(2):l+=r.substr(e,6)}e+=5,u=e+1}break;case"n":if(s||'"'===r[e+2]||r.length<a)e+=1;else{for(l+=r.slice(u,e)+"\n\n";"\\"===r[e+2]&&"n"===r[e+3]&&'"'!==r[e+4];)l+="\n",e+=2;l+=c," "===r[e+2]&&(l+="\\"),e+=1,u=e+1}break;default:e+=1}return l=u?l+r.slice(u):r,s?l:n.foldFlowLines(l,c,n.FOLD_QUOTED,i(t,!1))}function c(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return a(e,t);const r=t.indent||(o(e)?"  ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${r}`)+"'";return t.implicitKey?s:n.foldFlowLines(s,r,n.FOLD_FLOW,i(t,!1))}function l(e,t){const{singleQuote:r}=t.options;let s;if(!1===r)s=a;else{const t=e.includes('"'),n=e.includes("'");s=t&&!n?c:n&&!t?a:r?c:a}return s(e,t)}let u;try{u=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{u=/\n+(?!\n|$)/g}function h({comment:e,type:t,value:r},a,c,h){const{blockQuote:d,commentString:p,lineWidth:f}=a.options;if(!d||/\n[\t ]+$/.test(r)||/^\s*$/.test(r))return l(r,a);const g=a.indent||(a.forceBlockIndent||o(r)?"  ":""),m="literal"===d||"folded"!==d&&t!==s.Scalar.BLOCK_FOLDED&&(t===s.Scalar.BLOCK_LITERAL||!function(e,t,r){if(!t||t<0)return!1;const s=t-r,n=e.length;if(n<=s)return!1;for(let t=0,r=0;t<n;++t)if("\n"===e[t]){if(t-r>s)return!0;if(r=t+1,n-r<=s)return!1}return!0}(r,f,g.length));if(!r)return m?"|\n":">\n";let _,A;for(A=r.length;A>0;--A){const e=r[A-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let E=r.substring(A);const y=E.indexOf("\n");-1===y?_="-":r===E||y!==E.length-1?(_="+",h&&h()):_="",E&&(r=r.slice(0,-E.length),"\n"===E[E.length-1]&&(E=E.slice(0,-1)),E=E.replace(u,`$&${g}`));let b,w=!1,v=-1;for(b=0;b<r.length;++b){const e=r[b];if(" "===e)w=!0;else{if("\n"!==e)break;v=b}}let S=r.substring(0,v<b?v+1:b);S&&(r=r.substring(S.length),S=S.replace(/\n+/g,`$&${g}`));let k=(m?"|":">")+(w?g?"2":"1":"")+_;return e&&(k+=" "+p(e.replace(/ ?[\r\n]+/g," ")),c&&c()),m?`${k}\n${g}${S}${r=r.replace(/\n+/g,`$&${g}`)}${E}`:(r=r.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`),`${k}\n${g}${n.foldFlowLines(`${S}${r}${E}`,g,n.FOLD_BLOCK,i(a,!0))}`)}t.stringifyString=function(e,t,r,u){const{implicitKey:d,inFlow:p}=t,f="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:g}=e;g!==s.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(g=s.Scalar.QUOTE_DOUBLE);const m=e=>{switch(e){case s.Scalar.BLOCK_FOLDED:case s.Scalar.BLOCK_LITERAL:return d||p?l(f.value,t):h(f,t,r,u);case s.Scalar.QUOTE_DOUBLE:return a(f.value,t);case s.Scalar.QUOTE_SINGLE:return c(f.value,t);case s.Scalar.PLAIN:return function(e,t,r,a){const{type:c,value:u}=e,{actualString:d,implicitKey:p,indent:f,indentStep:g,inFlow:m}=t;if(p&&u.includes("\n")||m&&/[[\]{},]/.test(u))return l(u,t);if(!u||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(u))return p||m||!u.includes("\n")?l(u,t):h(e,t,r,a);if(!p&&!m&&c!==s.Scalar.PLAIN&&u.includes("\n"))return h(e,t,r,a);if(o(u)){if(""===f)return t.forceBlockIndent=!0,h(e,t,r,a);if(p&&f===g)return l(u,t)}const _=u.replace(/\n+/g,`$&\n${f}`);if(d){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(_),{compat:r,tags:s}=t.doc.schema;if(s.some(e)||r?.some(e))return l(u,t)}return p?_:n.foldFlowLines(_,f,n.FOLD_FLOW,i(t,!1))}(f,t,r,u);default:return null}};let _=m(g);if(null===_){const{defaultKeyType:e,defaultStringType:r}=t.options,s=d&&e||r;if(_=m(s),null===_)throw new Error(`Unsupported default string type ${s}`)}return _}},1381:(e,t,r)=>{"use strict";var s=r(163);const n=Symbol("break visit"),i=Symbol("skip children"),o=Symbol("remove node");function a(e,t){const r=h(t);s.isDocument(e)?c(null,e.contents,r,Object.freeze([e]))===o&&(e.contents=null):c(null,e,r,Object.freeze([]))}function c(e,t,r,i){const a=d(e,t,r,i);if(s.isNode(a)||s.isPair(a))return p(e,i,a),c(e,a,r,i);if("symbol"!=typeof a)if(s.isCollection(t)){i=Object.freeze(i.concat(t));for(let e=0;e<t.items.length;++e){const s=c(e,t.items[e],r,i);if("number"==typeof s)e=s-1;else{if(s===n)return n;s===o&&(t.items.splice(e,1),e-=1)}}}else if(s.isPair(t)){i=Object.freeze(i.concat(t));const e=c("key",t.key,r,i);if(e===n)return n;e===o&&(t.key=null);const s=c("value",t.value,r,i);if(s===n)return n;s===o&&(t.value=null)}return a}async function l(e,t){const r=h(t);s.isDocument(e)?await u(null,e.contents,r,Object.freeze([e]))===o&&(e.contents=null):await u(null,e,r,Object.freeze([]))}async function u(e,t,r,i){const a=await d(e,t,r,i);if(s.isNode(a)||s.isPair(a))return p(e,i,a),u(e,a,r,i);if("symbol"!=typeof a)if(s.isCollection(t)){i=Object.freeze(i.concat(t));for(let e=0;e<t.items.length;++e){const s=await u(e,t.items[e],r,i);if("number"==typeof s)e=s-1;else{if(s===n)return n;s===o&&(t.items.splice(e,1),e-=1)}}}else if(s.isPair(t)){i=Object.freeze(i.concat(t));const e=await u("key",t.key,r,i);if(e===n)return n;e===o&&(t.key=null);const s=await u("value",t.value,r,i);if(s===n)return n;s===o&&(t.value=null)}return a}function h(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function d(e,t,r,n){return"function"==typeof r?r(e,t,n):s.isMap(t)?r.Map?.(e,t,n):s.isSeq(t)?r.Seq?.(e,t,n):s.isPair(t)?r.Pair?.(e,t,n):s.isScalar(t)?r.Scalar?.(e,t,n):s.isAlias(t)?r.Alias?.(e,t,n):void 0}function p(e,t,r){const n=t[t.length-1];if(s.isCollection(n))n.items[e]=r;else if(s.isPair(n))"key"===e?n.key=r:n.value=r;else{if(!s.isDocument(n)){const e=s.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}n.contents=r}}a.BREAK=n,a.SKIP=i,a.REMOVE=o,l.BREAK=n,l.SKIP=i,l.REMOVE=o,t.visit=a,t.visitAsync=l},6674:e=>{"use strict";e.exports={i8:"1.14.0"}}},t={};function r(s){var n=t[s];if(void 0!==n)return n.exports;var i=t[s]={exports:{}};return e[s].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s=r(341),n=exports;for(var i in s)n[i]=s[i];s.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
//# sourceMappingURL=index.js.map