@dypnb/dev-tools 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +0,0 @@
1
- import{c as e,g as t,_ as r,a as n,b as i,d as o,e as s,f as a,h as u,m as f,l as c,w as h,s as l,i as p}from"../chunk-f4ef292d.js";import d from"fs";import g from"path";import v from"events";import _ from"assert";import y from"util";import m from"crypto";import E from"net";import w from"dns";import b from"stream";import S from"buffer";import B from"zlib";import I from"child_process";import A from"readline";import T from"moment";import{wxNotify as k}from"../wxServerNotice/index.js";import"os";import"tty";import"node:url";import"node:path";import"http";import"https";import"url";var U={exports:{}},R={},O=g,N="win32"===process.platform,C=d,L=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function D(e){return"function"==typeof e?e:function(){var e;if(L){var t=new Error;e=function(e){e&&(t.message=e.message,r(e=t))}}else e=r;return e;function r(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}()}if(O.normalize,N)var x=/(.*?)(?:[\/\\]+|$)/g;else x=/(.*?)(?:[\/]+|$)/g;if(N)var P=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else P=/^[\/]*/;R.realpathSync=function(e,t){if(e=O.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var r,n,i,o,s=e,a={},u={};function f(){var t=P.exec(e);r=t[0].length,n=t[0],i=t[0],o="",N&&!u[i]&&(C.lstatSync(i),u[i]=!0)}for(f();r<e.length;){x.lastIndex=r;var c=x.exec(e);if(o=n,n+=c[0],i=o+c[1],r=x.lastIndex,!(u[i]||t&&t[i]===i)){var h;if(t&&Object.prototype.hasOwnProperty.call(t,i))h=t[i];else{var l=C.lstatSync(i);if(!l.isSymbolicLink()){u[i]=!0,t&&(t[i]=i);continue}var p=null;if(!N){var d=l.dev.toString(32)+":"+l.ino.toString(32);a.hasOwnProperty(d)&&(p=a[d])}null===p&&(C.statSync(i),p=C.readlinkSync(i)),h=O.resolve(o,p),t&&(t[i]=h),N||(a[d]=p)}e=O.resolve(h,e.slice(r)),f()}}return t&&(t[s]=e),e},R.realpath=function(e,t,r){if("function"!=typeof r&&(r=D(t),t=null),e=O.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(r.bind(null,null,t[e]));var n,i,o,s,a=e,u={},f={};function c(){var t=P.exec(e);n=t[0].length,i=t[0],o=t[0],s="",N&&!f[o]?C.lstat(o,(function(e){if(e)return r(e);f[o]=!0,h()})):process.nextTick(h)}function h(){if(n>=e.length)return t&&(t[a]=e),r(null,e);x.lastIndex=n;var u=x.exec(e);return s=i,i+=u[0],o=s+u[1],n=x.lastIndex,f[o]||t&&t[o]===o?process.nextTick(h):t&&Object.prototype.hasOwnProperty.call(t,o)?d(t[o]):C.lstat(o,l)}function l(e,n){if(e)return r(e);if(!n.isSymbolicLink())return f[o]=!0,t&&(t[o]=o),process.nextTick(h);if(!N){var i=n.dev.toString(32)+":"+n.ino.toString(32);if(u.hasOwnProperty(i))return p(null,u[i],o)}C.stat(o,(function(e){if(e)return r(e);C.readlink(o,(function(e,t){N||(u[i]=t),p(e,t)}))}))}function p(e,n,i){if(e)return r(e);var o=O.resolve(s,n);t&&(t[i]=o),d(o)}function d(t){e=O.resolve(t,e.slice(n)),c()}c()};var H=z;z.realpath=z,z.sync=V,z.realpathSync=V,z.monkeypatch=function(){M.realpath=z,M.realpathSync=V},z.unmonkeypatch=function(){M.realpath=j,M.realpathSync=G};var M=d,j=M.realpath,G=M.realpathSync,F=process.version,W=/^v[0-5]\./.test(F),q=R;function K(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function z(e,t,r){if(W)return j(e,t,r);"function"==typeof t&&(r=t,t=null),j(e,t,(function(n,i){K(n)?q.realpath(e,t,r):r(n,i)}))}function V(e,t){if(W)return G(e,t);try{return G(e,t)}catch(r){if(K(r))return q.realpathSync(e,t);throw r}}var X=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Q=$;function $(e,t,r){e instanceof RegExp&&(e=Y(e,r)),t instanceof RegExp&&(t=Y(t,r));var n=Z(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function Y(e,t){var r=t.match(e);return r?r[0]:null}function Z(e,t,r){var n,i,o,s,a,u=r.indexOf(e),f=r.indexOf(t,u+1),c=u;if(u>=0&&f>0){if(e===t)return[u,f];for(n=[],o=r.length;c>=0&&!a;)c==u?(n.push(c),u=r.indexOf(e,c+1)):1==n.length?a=[n.pop(),f]:((i=n.pop())<o&&(o=i,s=f),f=r.indexOf(t,c+1)),c=u<f&&u>=0?u:f;n.length&&(a=[o,s])}return a}$.range=Z;var J=function(e,t){for(var r=[],n=0;n<e.length;n++){var i=t(e[n],n);X(i)?r.push.apply(r,i):r.push(i)}return r},ee=Q,te=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return de(function(e){return e.split("\\\\").join(re).split("\\{").join(ne).split("\\}").join(ie).split("\\,").join(oe).split("\\.").join(se)}(e),!0).map(ue)},re="\0SLASH"+Math.random()+"\0",ne="\0OPEN"+Math.random()+"\0",ie="\0CLOSE"+Math.random()+"\0",oe="\0COMMA"+Math.random()+"\0",se="\0PERIOD"+Math.random()+"\0";function ae(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function ue(e){return e.split(re).join("\\").split(ne).join("{").split(ie).join("}").split(oe).join(",").split(se).join(".")}function fe(e){if(!e)return[""];var t=[],r=ee("{","}",e);if(!r)return e.split(",");var n=r.pre,i=r.body,o=r.post,s=n.split(",");s[s.length-1]+="{"+i+"}";var a=fe(o);return o.length&&(s[s.length-1]+=a.shift(),s.push.apply(s,a)),t.push.apply(t,s),t}function ce(e){return"{"+e+"}"}function he(e){return/^-?0\d/.test(e)}function le(e,t){return e<=t}function pe(e,t){return e>=t}function de(e,t){var r=[],n=ee("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var i,o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),a=o||s,u=n.body.indexOf(",")>=0;if(!a&&!u)return n.post.match(/,.*\}/)?de(e=n.pre+"{"+n.body+ie+n.post):[e];if(a)i=n.body.split(/\.\./);else if(1===(i=fe(n.body)).length&&1===(i=de(i[0],!1).map(ce)).length)return(h=n.post.length?de(n.post,!1):[""]).map((function(e){return n.pre+i[0]+e}));var f,c=n.pre,h=n.post.length?de(n.post,!1):[""];if(a){var l=ae(i[0]),p=ae(i[1]),d=Math.max(i[0].length,i[1].length),g=3==i.length?Math.abs(ae(i[2])):1,v=le;p<l&&(g*=-1,v=pe);var _=i.some(he);f=[];for(var y=l;v(y,p);y+=g){var m;if(s)"\\"===(m=String.fromCharCode(y))&&(m="");else if(m=String(y),_){var E=d-m.length;if(E>0){var w=new Array(E+1).join("0");m=y<0?"-"+w+m.slice(1):w+m}}f.push(m)}}else f=J(i,(function(e){return de(e,!1)}));for(var b=0;b<f.length;b++)for(var S=0;S<h.length;S++){var B=c+f[b]+h[S];(!t||a||B)&&r.push(B)}return r}var ge=Ie;Ie.Minimatch=Ae;var ve=function(){try{return require("path")}catch(e){}}()||{sep:"/"};Ie.sep=ve.sep;var _e=Ie.GLOBSTAR=Ae.GLOBSTAR={},ye=te,me={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Ee="[^/]",we=Ee+"*?",be="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{});var Se=/\/+/;function Be(e,t){t=t||{};var r={};return Object.keys(e).forEach((function(t){r[t]=e[t]})),Object.keys(t).forEach((function(e){r[e]=t[e]})),r}function Ie(e,t,r){return ke(t),r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&new Ae(t,r).match(e)}function Ae(e,t){if(!(this instanceof Ae))return new Ae(e,t);ke(e),t||(t={}),e=e.trim(),t.allowWindowsEscape||"/"===ve.sep||(e=e.split(ve.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}function Te(e,t){return t||(t=this instanceof Ae?this.options:{}),e=void 0===e?this.pattern:e,ke(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ye(e)}Ie.filter=function(e,t){return t=t||{},function(r,n,i){return Ie(r,e,t)}},Ie.defaults=function(e){if(!e||"object"!=typeof e||!Object.keys(e).length)return Ie;var t=Ie,r=function(r,n,i){return t(r,n,Be(e,i))};return(r.Minimatch=function(r,n){return new t.Minimatch(r,Be(e,n))}).defaults=function(r){return t.defaults(Be(e,r)).Minimatch},r.filter=function(r,n){return t.filter(r,Be(e,n))},r.defaults=function(r){return t.defaults(Be(e,r))},r.makeRe=function(r,n){return t.makeRe(r,Be(e,n))},r.braceExpand=function(r,n){return t.braceExpand(r,Be(e,n))},r.match=function(r,n,i){return t.match(r,n,Be(e,i))},r},Ae.defaults=function(e){return Ie.defaults(e).Minimatch},Ae.prototype.debug=function(){},Ae.prototype.make=function(){var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)});this.debug(this.pattern,r),r=this.globParts=r.map((function(e){return e.split(Se)})),this.debug(this.pattern,r),r=r.map((function(e,t,r){return e.map(this.parse,this)}),this),this.debug(this.pattern,r),r=r.filter((function(e){return-1===e.indexOf(!1)})),this.debug(this.pattern,r),this.set=r},Ae.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,n=0;if(r.nonegate)return;for(var i=0,o=e.length;i<o&&"!"===e.charAt(i);i++)t=!t,n++;n&&(this.pattern=e.substr(n));this.negate=t},Ie.braceExpand=function(e,t){return Te(e,t)},Ae.prototype.braceExpand=Te;var ke=function(e){if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};Ae.prototype.parse=function(e,t){ke(e);var r=this.options;if("**"===e){if(!r.noglobstar)return _e;e="*"}if(""===e)return"";var n,i="",o=!!r.nocase,s=!1,a=[],u=[],f=!1,c=-1,h=-1,l="."===e.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",p=this;function d(){if(n){switch(n){case"*":i+=we,o=!0;break;case"?":i+=Ee,o=!0;break;default:i+="\\"+n}p.debug("clearStateChar %j %j",n,i),n=!1}}for(var g,v=0,_=e.length;v<_&&(g=e.charAt(v));v++)if(this.debug("%s\t%s %s %j",e,v,i,g),s&&be[g])i+="\\"+g,s=!1;else switch(g){case"/":return!1;case"\\":d(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,v,i,g),f){this.debug(" in class"),"!"===g&&v===h+1&&(g="^"),i+=g;continue}p.debug("call clearStateChar %j",n),d(),n=g,r.noext&&d();continue;case"(":if(f){i+="(";continue}if(!n){i+="\\(";continue}a.push({type:n,start:v-1,reStart:i.length,open:me[n].open,close:me[n].close}),i+="!"===n?"(?:(?!(?:":"(?:",this.debug("plType %j %j",n,i),n=!1;continue;case")":if(f||!a.length){i+="\\)";continue}d(),o=!0;var y=a.pop();i+=y.close,"!"===y.type&&u.push(y),y.reEnd=i.length;continue;case"|":if(f||!a.length||s){i+="\\|",s=!1;continue}d(),i+="|";continue;case"[":if(d(),f){i+="\\"+g;continue}f=!0,h=v,c=i.length,i+=g;continue;case"]":if(v===h+1||!f){i+="\\"+g,s=!1;continue}var m=e.substring(h+1,v);try{RegExp("["+m+"]")}catch(e){var E=this.parse(m,Ue);i=i.substr(0,c)+"\\["+E[0]+"\\]",o=o||E[1],f=!1;continue}o=!0,f=!1,i+=g;continue;default:d(),s?s=!1:!be[g]||"^"===g&&f||(i+="\\"),i+=g}f&&(m=e.substr(h+1),E=this.parse(m,Ue),i=i.substr(0,c)+"\\["+E[0],o=o||E[1]);for(y=a.pop();y;y=a.pop()){var w=i.slice(y.reStart+y.open.length);this.debug("setting tail",i,y),w=w.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,r){return r||(r="\\"),t+t+r+"|"})),this.debug("tail=%j\n %s",w,w,y,i);var b="*"===y.type?we:"?"===y.type?Ee:"\\"+y.type;o=!0,i=i.slice(0,y.reStart)+b+"\\("+w}d(),s&&(i+="\\\\");var S=!1;switch(i.charAt(0)){case"[":case".":case"(":S=!0}for(var B=u.length-1;B>-1;B--){var I=u[B],A=i.slice(0,I.reStart),T=i.slice(I.reStart,I.reEnd-8),k=i.slice(I.reEnd-8,I.reEnd),U=i.slice(I.reEnd);k+=U;var R=A.split("(").length-1,O=U;for(v=0;v<R;v++)O=O.replace(/\)[+*?]?/,"");var N="";""===(U=O)&&t!==Ue&&(N="$"),i=A+T+U+N+k}""!==i&&o&&(i="(?=.)"+i);S&&(i=l+i);if(t===Ue)return[i,o];if(!o)return function(e){return e.replace(/\\(.)/g,"$1")}(e);var C=r.nocase?"i":"";try{var L=new RegExp("^"+i+"$",C)}catch(e){return new RegExp("$.")}return L._glob=e,L._src=i,L};var Ue={};Ie.makeRe=function(e,t){return new Ae(e,t||{}).makeRe()},Ae.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,r=t.noglobstar?we:t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",n=t.nocase?"i":"",i=e.map((function(e){return e.map((function(e){return e===_e?r:"string"==typeof e?function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(e):e._src})).join("\\/")})).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,n)}catch(e){this.regexp=!1}return this.regexp},Ie.match=function(e,t,r){var n=new Ae(t,r=r||{});return e=e.filter((function(e){return n.match(e)})),n.options.nonull&&!e.length&&e.push(t),e},Ae.prototype.match=function(e,t){if(void 0===t&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var r=this.options;"/"!==ve.sep&&(e=e.split(ve.sep).join("/")),e=e.split(Se),this.debug(this.pattern,"split",e);var n,i,o=this.set;for(this.debug(this.pattern,"set",o),i=e.length-1;i>=0&&!(n=e[i]);i--);for(i=0;i<o.length;i++){var s=o[i],a=e;if(r.matchBase&&1===s.length&&(a=[n]),this.matchOne(a,s,t))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate},Ae.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,o=0,s=e.length,a=t.length;i<s&&o<a;i++,o++){this.debug("matchOne loop");var u,f=t[o],c=e[i];if(this.debug(t,f,c),!1===f)return!1;if(f===_e){this.debug("GLOBSTAR",[t,f,c]);var h=i,l=o+1;if(l===a){for(this.debug("** at the end");i<s;i++)if("."===e[i]||".."===e[i]||!n.dot&&"."===e[i].charAt(0))return!1;return!0}for(;h<s;){var p=e[h];if(this.debug("\nglobstar while",e,h,t,l,p),this.matchOne(e.slice(h),t.slice(l),r))return this.debug("globstar found match!",h,s,p),!0;if("."===p||".."===p||!n.dot&&"."===p.charAt(0)){this.debug("dot detected!",e,h,t,l);break}this.debug("globstar swallow a segment, and continue"),h++}return!(!r||(this.debug("\n>>> no match, partial?",e,h,t,l),h!==s))}if("string"==typeof f?(u=c===f,this.debug("string match",f,c,u)):(u=c.match(f),this.debug("pattern match",f,c,u)),!u)return!1}if(i===s&&o===a)return!0;if(i===s)return r;if(o===a)return i===s-1&&""===e[i];throw new Error("wtf?")};var Re,Oe={exports:{}},Ne={exports:{}};try{var Ce=require("util");if("function"!=typeof Ce.inherits)throw"";Oe.exports=Ce.inherits}catch(qu){Oe.exports=(Re||(Re=1,"function"==typeof Object.create?Ne.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ne.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Ne.exports)}var Le=Oe.exports,De={exports:{}};function xe(e){return"/"===e.charAt(0)}function Pe(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),r=t[1]||"",n=Boolean(r&&":"!==r.charAt(1));return Boolean(t[2]||n)}De.exports="win32"===process.platform?Pe:xe,De.exports.posix=xe,De.exports.win32=Pe;var He=De.exports,Me={};function je(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Me.alphasort=Ve,Me.alphasorti=ze,Me.setopts=function(e,t,r){r||(r={});if(r.matchBase&&-1===t.indexOf("/")){if(r.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!r.silent,e.pattern=t,e.strict=!1!==r.strict,e.realpath=!!r.realpath,e.realpathCache=r.realpathCache||Object.create(null),e.follow=!!r.follow,e.dot=!!r.dot,e.mark=!!r.mark,e.nodir=!!r.nodir,e.nodir&&(e.mark=!0);e.sync=!!r.sync,e.nounique=!!r.nounique,e.nonull=!!r.nonull,e.nosort=!!r.nosort,e.nocase=!!r.nocase,e.stat=!!r.stat,e.noprocess=!!r.noprocess,e.maxLength=r.maxLength||1/0,e.cache=r.cache||Object.create(null),e.statCache=r.statCache||Object.create(null),e.symlinks=r.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(Xe))}(e,r),e.changedCwd=!1;var n=process.cwd();je(r,"cwd")?(e.cwd=We.resolve(r.cwd),e.changedCwd=e.cwd!==n):e.cwd=n;e.root=r.root||We.resolve(e.cwd,"/"),e.root=We.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/"));e.cwdAbs=Qe(e,e.cwd),e.nomount=!!r.nomount,r.nonegate=!0,r.nocomment=!0,e.minimatch=new Ke(t,r),e.options=e.minimatch.options},Me.ownProp=je,Me.makeAbs=Qe,Me.finish=function(e){for(var t=e.nounique,r=t?[]:Object.create(null),n=0,i=e.matches.length;n<i;n++){var o=e.matches[n];if(o&&0!==Object.keys(o).length){var s=Object.keys(o);t?r.push.apply(r,s):s.forEach((function(e){r[e]=!0}))}else if(e.nonull){var a=e.minimatch.globSet[n];t?r.push(a):r[a]=!0}}t||(r=Object.keys(r));e.nosort||(r=r.sort(e.nocase?ze:Ve));if(e.mark){for(n=0;n<r.length;n++)r[n]=e._mark(r[n]);e.nodir&&(r=r.filter((function(t){var r=!/\/$/.test(t),n=e.cache[t]||e.cache[Qe(e,t)];return r&&n&&(r="DIR"!==n&&!Array.isArray(n)),r})))}e.ignore.length&&(r=r.filter((function(t){return!$e(e,t)})));e.found=r},Me.mark=function(e,t){var r=Qe(e,t),n=e.cache[r],i=t;if(n){var o="DIR"===n||Array.isArray(n),s="/"===t.slice(-1);if(o&&!s?i+="/":!o&&s&&(i=i.slice(0,-1)),i!==t){var a=Qe(e,i);e.statCache[a]=e.statCache[r],e.cache[a]=e.cache[r]}}return i},Me.isIgnored=$e,Me.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(t))}))};var Ge,Fe,We=g,qe=He,Ke=ge.Minimatch;function ze(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}function Ve(e,t){return e.localeCompare(t)}function Xe(e){var t=null;if("/**"===e.slice(-3)){var r=e.replace(/(\/\*\*)+$/,"");t=new Ke(r,{dot:!0})}return{matcher:new Ke(e,{dot:!0}),gmatcher:t}}function Qe(e,t){var r=t;return r="/"===t.charAt(0)?We.join(e.root,t):qe(t)||""===t?t:e.changedCwd?We.resolve(e.cwd,t):We.resolve(t),"win32"===process.platform&&(r=r.replace(/\\/g,"/")),r}function $e(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))}))}var Ye=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){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}};var Ze={exports:{}},Je=Ye;function et(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function tt(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}Ze.exports=Je(et),Ze.exports.strict=Je(tt),et.proto=et((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return et(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return tt(this)},configurable:!0})}));var rt,nt,it=Ze.exports,ot=Ye,st=Object.create(null),at=it,ut=ot((function(e,t){return st[e]?(st[e].push(t),null):(st[e]=[t],function(e){return at((function t(){var r=st[e],n=r.length,i=function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n]=e[n];return r}(arguments);try{for(var o=0;o<n;o++)r[o].apply(null,i)}finally{r.length>n?(r.splice(0,n),process.nextTick((function(){t.apply(null,i)}))):delete st[e]}}))}(e))}));function ft(){if(nt)return rt;nt=1,rt=E;var e=d,t=H,r=ge;r.Minimatch;var n=Le,i=v.EventEmitter,o=g,s=_,a=He,u=function(){if(Fe)return Ge;Fe=1,Ge=c,c.GlobSync=h;var e=d,t=H,r=ge;r.Minimatch,ft().Glob;var n=g,i=_,o=He,s=Me;s.alphasort,s.alphasorti;var a=s.setopts,u=s.ownProp,f=s.childrenIgnored;function c(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new h(e,t).found}function h(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof h))return new h(e,t);if(a(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}return h.prototype._finish=function(){if(i(this instanceof h),this.realpath){var e=this;this.matches.forEach((function(r,n){var i=e.matches[n]=Object.create(null);for(var o in r)try{o=e._makeAbs(o),i[t.realpathSync(o,e.realpathCache)]=!0}catch(t){if("stat"!==t.syscall)throw t;i[e._makeAbs(o)]=!0}}))}s.finish(this)},h.prototype._process=function(e,t,n){i(this instanceof h);for(var s,a=0;"string"==typeof e[a];)a++;switch(a){case e.length:return void this._processSimple(e.join("/"),t);case 0:s=null;break;default:s=e.slice(0,a).join("/")}var u,c=e.slice(a);null===s?u=".":o(s)||o(e.join("/"))?(s&&o(s)||(s="/"+s),u=s):u=s;var l=this._makeAbs(u);f(this,u)||(c[0]===r.GLOBSTAR?this._processGlobStar(s,u,l,c,t,n):this._processReaddir(s,u,l,c,t,n))},h.prototype._processReaddir=function(e,t,r,i,o,s){var a=this._readdir(r,s);if(a){for(var u=i[0],f=!!this.minimatch.negate,c=u._glob,h=this.dot||"."===c.charAt(0),l=[],p=0;p<a.length;p++)("."!==(v=a[p]).charAt(0)||h)&&(f&&!e?!v.match(u):v.match(u))&&l.push(v);var d=l.length;if(0!==d)if(1!==i.length||this.mark||this.stat)for(i.shift(),p=0;p<d;p++){var g;v=l[p],g=e?[e,v]:[v],this._process(g.concat(i),o,s)}else{this.matches[o]||(this.matches[o]=Object.create(null));for(p=0;p<d;p++){var v=l[p];e&&(v="/"!==e.slice(-1)?e+"/"+v:e+v),"/"!==v.charAt(0)||this.nomount||(v=n.join(this.root,v)),this.matches[o][v]=!0}}}},h.prototype._emitMatch=function(e,t){if(this._makeAbs(t),this.mark&&(t=this._mark(t)),!this.matches[e][t]){if(this.nodir){var r=this.cache[this._makeAbs(t)];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}},h.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var r,n;try{n=e.lstatSync(t)}catch(e){return null}var i=n.isSymbolicLink();return this.symlinks[t]=i,i||n.isDirectory()?r=this._readdir(t,!1):this.cache[t]="FILE",r},h.prototype._readdir=function(t,r){if(r&&!u(this.symlinks,t))return this._readdirInGlobStar(t);if(u(this.cache,t)){var n=this.cache[t];if(!n||"FILE"===n)return null;if(Array.isArray(n))return n}try{return this._readdirEntries(t,e.readdirSync(t))}catch(e){return this._readdirError(t,e),null}},h.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var n=t[r];n="/"===e?e+n:e+"/"+n,this.cache[n]=!0}return this.cache[e]=t,t},h.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=t.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t)}},h.prototype._processGlobStar=function(e,t,r,n,i,o){var s=this._readdir(r,o);if(s){var a=n.slice(1),u=e?[e]:[],f=u.concat(a);this._process(f,i,!1);var c=s.length;if(!this.symlinks[r]||!o)for(var h=0;h<c;h++)if("."!==s[h].charAt(0)||this.dot){var l=u.concat(s[h],a);this._process(l,i,!0);var p=u.concat(s[h],n);this._process(p,i,!0)}}},h.prototype._processSimple=function(e,t){var r=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),r){if(e&&o(e)&&!this.nomount){var i=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=n.join(this.root,e):(e=n.resolve(this.root,e),i&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this.matches[t][e]=!0}},h.prototype._stat=function(t){var r=this._makeAbs(t),n="/"===t.slice(-1);if(t.length>this.maxLength)return!1;if(!this.stat&&u(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return i;if(n&&"FILE"===i)return!1}var o=this.statCache[r];if(!o){var s;try{s=e.lstatSync(r)}catch(e){return!1}if(s.isSymbolicLink())try{o=e.statSync(r)}catch(e){o=s}else o=s}return this.statCache[r]=o,i=o.isDirectory()?"DIR":"FILE",this.cache[r]=this.cache[r]||i,(!n||"DIR"===i)&&i},h.prototype._mark=function(e){return s.mark(this,e)},h.prototype._makeAbs=function(e){return s.makeAbs(this,e)},Ge}(),f=Me;f.alphasort,f.alphasorti;var c=f.setopts,h=f.ownProp,l=ut,p=f.childrenIgnored,y=f.isIgnored,m=it;function E(e,t,r){if("function"==typeof t&&(r=t,t={}),t||(t={}),t.sync){if(r)throw new TypeError("callback provided to sync glob");return u(e,t)}return new b(e,t,r)}E.sync=u;var w=E.GlobSync=u.GlobSync;function b(e,t,r){if("function"==typeof t&&(r=t,t=null),t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new w(e,t)}if(!(this instanceof b))return new b(e,t,r);c(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof r&&(r=m(r),this.on("error",r),this.on("end",(function(e){r(null,e)})));var i=this;n=this.minimatch.set.length;if(this._processing=0,this.matches=new Array(n),this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return a();for(var o=!0,s=0;s<n;s++)this._process(this.minimatch.set[s],s,!1,a);function a(){--i._processing,i._processing<=0&&(o?process.nextTick((function(){i._finish()})):i._finish())}o=!1}return E.glob=E,E.hasMagic=function(e,t){var r=function(e,t){if(null===t||"object"!=typeof t)return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}({},t);r.noprocess=!0;var n=new b(e,r).minimatch.set;if(!e)return!1;if(n.length>1)return!0;for(var i=0;i<n[0].length;i++)if("string"!=typeof n[0][i])return!0;return!1},E.Glob=b,n(b,i),b.prototype._finish=function(){if(s(this instanceof b),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();f.finish(this),this.emit("end",this.found)}},b.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n)}function n(){0==--e&&t._finish()}},b.prototype._realpathSet=function(e,r){var n=this.matches[e];if(!n)return r();var i=Object.keys(n),o=this,s=i.length;if(0===s)return r();var a=this.matches[e]=Object.create(null);i.forEach((function(n,i){n=o._makeAbs(n),t.realpath(n,o.realpathCache,(function(t,i){t?"stat"===t.syscall?a[n]=!0:o.emit("error",t):a[i]=!0,0==--s&&(o.matches[e]=a,r())}))}))},b.prototype._mark=function(e){return f.mark(this,e)},b.prototype._makeAbs=function(e){return f.makeAbs(this,e)},b.prototype.abort=function(){this.aborted=!0,this.emit("abort")},b.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},b.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(t=0;t<n.length;t++){var i=n[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},b.prototype._process=function(e,t,n,i){if(s(this instanceof b),s("function"==typeof i),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,n,i]);else{for(var o,u=0;"string"==typeof e[u];)u++;switch(u){case e.length:return void this._processSimple(e.join("/"),t,i);case 0:o=null;break;default:o=e.slice(0,u).join("/")}var f,c=e.slice(u);null===o?f=".":a(o)||a(e.join("/"))?(o&&a(o)||(o="/"+o),f=o):f=o;var h=this._makeAbs(f);if(p(this,f))return i();c[0]===r.GLOBSTAR?this._processGlobStar(o,f,h,c,t,n,i):this._processReaddir(o,f,h,c,t,n,i)}},b.prototype._processReaddir=function(e,t,r,n,i,o,s){var a=this;this._readdir(r,o,(function(u,f){return a._processReaddir2(e,t,r,n,i,o,f,s)}))},b.prototype._processReaddir2=function(e,t,r,n,i,s,a,u){if(!a)return u();for(var f=n[0],c=!!this.minimatch.negate,h=f._glob,l=this.dot||"."===h.charAt(0),p=[],d=0;d<a.length;d++){if("."!==(v=a[d]).charAt(0)||l)(c&&!e?!v.match(f):v.match(f))&&p.push(v)}var g=p.length;if(0===g)return u();if(1===n.length&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(d=0;d<g;d++){var v=p[d];e&&(v="/"!==e?e+"/"+v:e+v),"/"!==v.charAt(0)||this.nomount||(v=o.join(this.root,v)),this._emitMatch(i,v)}return u()}n.shift();for(d=0;d<g;d++){v=p[d];e&&(v="/"!==e?e+"/"+v:e+v),this._process([v].concat(n),i,s,u)}u()},b.prototype._emitMatch=function(e,t){if(!this.aborted&&!this.matches[e][t]&&!y(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var r=this._makeAbs(t);if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.mark&&(t=this._mark(t)),this.matches[e][t]=!0;var i=this.statCache[r];i&&this.emit("stat",t,i),this.emit("match",t)}},b.prototype._readdirInGlobStar=function(t,r){if(!this.aborted){if(this.follow)return this._readdir(t,!1,r);var n=this,i=l("lstat\0"+t,(function(e,i){if(e)return r();var o=i.isSymbolicLink();n.symlinks[t]=o,o||i.isDirectory()?n._readdir(t,!1,r):(n.cache[t]="FILE",r())}));i&&e.lstat(t,i)}},b.prototype._readdir=function(t,r,n){if(!this.aborted&&(n=l("readdir\0"+t+"\0"+r,n))){if(r&&!h(this.symlinks,t))return this._readdirInGlobStar(t,n);if(h(this.cache,t)){var i=this.cache[t];if(!i||"FILE"===i)return n();if(Array.isArray(i))return n(null,i)}e.readdir(t,function(e,t,r){return function(n,i){n?e._readdirError(t,n,r):e._readdirEntries(t,i,r)}}(this,t,n))}},b.prototype._readdirEntries=function(e,t,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var i=t[n];i="/"===e?e+i:e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,r(null,t)}},b.prototype._readdirError=function(e,t,r){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t)}return r()}},b.prototype._processGlobStar=function(e,t,r,n,i,o,s){var a=this;this._readdir(r,o,(function(u,f){a._processGlobStar2(e,t,r,n,i,o,f,s)}))},b.prototype._processGlobStar2=function(e,t,r,n,i,o,s,a){if(!s)return a();var u=n.slice(1),f=e?[e]:[],c=f.concat(u);this._process(c,i,!1,a);var h=this.symlinks[r],l=s.length;if(h&&o)return a();for(var p=0;p<l;p++){if("."!==s[p].charAt(0)||this.dot){var d=f.concat(s[p],u);this._process(d,i,!0,a);var g=f.concat(s[p],n);this._process(g,i,!0,a)}}a()},b.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,(function(i,o){n._processSimple2(e,t,i,o,r)}))},b.prototype._processSimple2=function(e,t,r,n,i){if(this.matches[t]||(this.matches[t]=Object.create(null)),!n)return i();if(e&&a(e)&&!this.nomount){var s=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=o.join(this.root,e):(e=o.resolve(this.root,e),s&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),i()},b.prototype._stat=function(t,r){var n=this._makeAbs(t),i="/"===t.slice(-1);if(t.length>this.maxLength)return r();if(!this.stat&&h(this.cache,n)){var o=this.cache[n];if(Array.isArray(o)&&(o="DIR"),!i||"DIR"===o)return r(null,o);if(i&&"FILE"===o)return r()}var s=this.statCache[n];if(void 0!==s){if(!1===s)return r(null,s);var a=s.isDirectory()?"DIR":"FILE";return i&&"FILE"===a?r():r(null,a,s)}var u=this,f=l("stat\0"+n,(function(i,o){if(o&&o.isSymbolicLink())return e.stat(n,(function(e,i){e?u._stat2(t,n,null,o,r):u._stat2(t,n,e,i,r)}));u._stat2(t,n,i,o,r)}));f&&e.lstat(n,f)},b.prototype._stat2=function(e,t,r,n,i){if(r)return this.statCache[t]=!1,i();var o="/"===e.slice(-1);if(this.statCache[t]=n,"/"===t.slice(-1)&&!n.isDirectory())return i(null,!1,n);var s=n.isDirectory()?"DIR":"FILE";return this.cache[t]=this.cache[t]||s,o&&"DIR"!==s?i():i(null,s,n)},rt}var ct,ht={exports:{}};
2
- /*!
3
- * async
4
- * https://github.com/caolan/async
5
- *
6
- * Copyright 2010-2014 Caolan McMahon
7
- * Released under the MIT license
8
- */ct=ht,function(){var e,t,r={};function n(t){var r=!1;return function(){if(r)throw new Error("Callback was already called.");r=!0,t.apply(e,arguments)}}null!=(e=this)&&(t=e.async),r.noConflict=function(){return e.async=t,r};var i=Object.prototype.toString,o=Array.isArray||function(e){return"[object Array]"===i.call(e)},s=function(e,t){for(var r=0;r<e.length;r+=1)t(e[r],r,e)},a=function(e,t){if(e.map)return e.map(t);var r=[];return s(e,(function(e,n,i){r.push(t(e,n,i))})),r},u=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t};"undefined"!=typeof process&&process.nextTick?(r.nextTick=process.nextTick,"undefined"!=typeof setImmediate?r.setImmediate=function(e){setImmediate(e)}:r.setImmediate=r.nextTick):"function"==typeof setImmediate?(r.nextTick=function(e){setImmediate(e)},r.setImmediate=r.nextTick):(r.nextTick=function(e){setTimeout(e,0)},r.setImmediate=r.nextTick),r.each=function(e,t,r){if(r=r||function(){},!e.length)return r();var i=0;function o(t){t?(r(t),r=function(){}):(i+=1)>=e.length&&r()}s(e,(function(e){t(e,n(o))}))},r.forEach=r.each,r.eachSeries=function(e,t,r){if(r=r||function(){},!e.length)return r();var n=0,i=function(){t(e[n],(function(t){t?(r(t),r=function(){}):(n+=1)>=e.length?r():i()}))};i()},r.forEachSeries=r.eachSeries,r.eachLimit=function(e,t,r,n){f(t).apply(null,[e,r,n])},r.forEachLimit=r.eachLimit;var f=function(e){return function(t,r,n){if(n=n||function(){},!t.length||e<=0)return n();var i=0,o=0,s=0;!function a(){if(i>=t.length)return n();for(;s<e&&o<t.length;)s+=1,r(t[(o+=1)-1],(function(e){e?(n(e),n=function(){}):(s-=1,(i+=1)>=t.length?n():a())}))}()}},c=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r.each].concat(t))}},h=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r.eachSeries].concat(t))}},l=function(e,t,r,n){if(t=a(t,(function(e,t){return{index:t,value:e}})),n){var i=[];e(t,(function(e,t){r(e.value,(function(r,n){i[e.index]=n,t(r)}))}),(function(e){n(e,i)}))}else e(t,(function(e,t){r(e.value,(function(e){t(e)}))}))};r.map=c(l),r.mapSeries=h(l),r.mapLimit=function(e,t,r,n){return p(t)(e,r,n)};var p=function(e){return function(e,t){return function(){var r=Array.prototype.slice.call(arguments);return t.apply(null,[f(e)].concat(r))}}(e,l)};r.reduce=function(e,t,n,i){r.eachSeries(e,(function(e,r){n(t,e,(function(e,n){t=n,r(e)}))}),(function(e){i(e,t)}))},r.inject=r.reduce,r.foldl=r.reduce,r.reduceRight=function(e,t,n,i){var o=a(e,(function(e){return e})).reverse();r.reduce(o,t,n,i)},r.foldr=r.reduceRight;var d=function(e,t,r,n){var i=[];t=a(t,(function(e,t){return{index:t,value:e}})),e(t,(function(e,t){r(e.value,(function(r){r&&i.push(e),t()}))}),(function(e){n(a(i.sort((function(e,t){return e.index-t.index})),(function(e){return e.value})))}))};r.filter=c(d),r.filterSeries=h(d),r.select=r.filter,r.selectSeries=r.filterSeries;var g=function(e,t,r,n){var i=[];t=a(t,(function(e,t){return{index:t,value:e}})),e(t,(function(e,t){r(e.value,(function(r){r||i.push(e),t()}))}),(function(e){n(a(i.sort((function(e,t){return e.index-t.index})),(function(e){return e.value})))}))};r.reject=c(g),r.rejectSeries=h(g);var v=function(e,t,r,n){e(t,(function(e,t){r(e,(function(r){r?(n(e),n=function(){}):t()}))}),(function(e){n()}))};r.detect=c(v),r.detectSeries=h(v),r.some=function(e,t,n){r.each(e,(function(e,r){t(e,(function(e){e&&(n(!0),n=function(){}),r()}))}),(function(e){n(!1)}))},r.any=r.some,r.every=function(e,t,n){r.each(e,(function(e,r){t(e,(function(e){e||(n(!1),n=function(){}),r()}))}),(function(e){n(!0)}))},r.all=r.every,r.sortBy=function(e,t,n){r.map(e,(function(e,r){t(e,(function(t,n){t?r(t):r(null,{value:e,criteria:n})}))}),(function(e,t){if(e)return n(e);n(null,a(t.sort((function(e,t){var r=e.criteria,n=t.criteria;return r<n?-1:r>n?1:0})),(function(e){return e.value})))}))},r.auto=function(e,t){t=t||function(){};var n=u(e),i=n.length;if(!i)return t();var a={},f=[],c=function(e){f.unshift(e)},h=function(){i--,s(f.slice(0),(function(e){e()}))};c((function(){if(!i){var e=t;t=function(){},e(null,a)}})),s(n,(function(n){var i=o(e[n])?e[n]:[e[n]],l=function(e){var i=Array.prototype.slice.call(arguments,1);if(i.length<=1&&(i=i[0]),e){var o={};s(u(a),(function(e){o[e]=a[e]})),o[n]=i,t(e,o),t=function(){}}else a[n]=i,r.setImmediate(h)},p=i.slice(0,Math.abs(i.length-1))||[],d=function(){return t=function(e,t){return e&&a.hasOwnProperty(t)},r=!0,((e=p).reduce?e.reduce(t,r):(s(e,(function(e,n,i){r=t(r,e,n,i)})),r))&&!a.hasOwnProperty(n);var e,t,r};if(d())i[i.length-1](l,a);else{var g=function(){d()&&(function(e){for(var t=0;t<f.length;t+=1)if(f[t]===e)return void f.splice(t,1)}(g),i[i.length-1](l,a))};c(g)}}))},r.retry=function(e,t,n){var i=[];"function"==typeof e&&(n=t,t=e,e=5),e=parseInt(e,10)||5;var o=function(o,s){for(var a=function(e,t){return function(r){e((function(e,n){r(!e||t,{err:e,result:n})}),s)}};e;)i.push(a(t,!(e-=1)));r.series(i,(function(e,t){t=t[t.length-1],(o||n)(t.err,t.result)}))};return n?o():o},r.waterfall=function(e,t){if(t=t||function(){},!o(e)){var n=new Error("First argument to waterfall must be an array of functions");return t(n)}if(!e.length)return t();var i=function(e){return function(n){if(n)t.apply(null,arguments),t=function(){};else{var o=Array.prototype.slice.call(arguments,1),s=e.next();s?o.push(i(s)):o.push(t),r.setImmediate((function(){e.apply(null,o)}))}}};i(r.iterator(e))()};var _=function(e,t,r){if(r=r||function(){},o(t))e.map(t,(function(e,t){e&&e((function(e){var r=Array.prototype.slice.call(arguments,1);r.length<=1&&(r=r[0]),t.call(null,e,r)}))}),r);else{var n={};e.each(u(t),(function(e,r){t[e]((function(t){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),n[e]=i,r(t)}))}),(function(e){r(e,n)}))}};r.parallel=function(e,t){_({map:r.map,each:r.each},e,t)},r.parallelLimit=function(e,t,r){_({map:p(t),each:f(t)},e,r)},r.series=function(e,t){if(t=t||function(){},o(e))r.mapSeries(e,(function(e,t){e&&e((function(e){var r=Array.prototype.slice.call(arguments,1);r.length<=1&&(r=r[0]),t.call(null,e,r)}))}),t);else{var n={};r.eachSeries(u(e),(function(t,r){e[t]((function(e){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),n[t]=i,r(e)}))}),(function(e){t(e,n)}))}},r.iterator=function(e){var t=function(r){var n=function(){return e.length&&e[r].apply(null,arguments),n.next()};return n.next=function(){return r<e.length-1?t(r+1):null},n};return t(0)},r.apply=function(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t.concat(Array.prototype.slice.call(arguments)))}};var y=function(e,t,r,n){var i=[];e(t,(function(e,t){r(e,(function(e,r){i=i.concat(r||[]),t(e)}))}),(function(e){n(e,i)}))};r.concat=c(y),r.concatSeries=h(y),r.whilst=function(e,t,n){e()?t((function(i){if(i)return n(i);r.whilst(e,t,n)})):n()},r.doWhilst=function(e,t,n){e((function(i){if(i)return n(i);var o=Array.prototype.slice.call(arguments,1);t.apply(null,o)?r.doWhilst(e,t,n):n()}))},r.until=function(e,t,n){e()?n():t((function(i){if(i)return n(i);r.until(e,t,n)}))},r.doUntil=function(e,t,n){e((function(i){if(i)return n(i);var o=Array.prototype.slice.call(arguments,1);t.apply(null,o)?n():r.doUntil(e,t,n)}))},r.queue=function(e,t){function i(e,t,n,i){if(e.started||(e.started=!0),o(t)||(t=[t]),0==t.length)return r.setImmediate((function(){e.drain&&e.drain()}));s(t,(function(t){var o={data:t,callback:"function"==typeof i?i:null};n?e.tasks.unshift(o):e.tasks.push(o),e.saturated&&e.tasks.length===e.concurrency&&e.saturated(),r.setImmediate(e.process)}))}void 0===t&&(t=1);var a=0,u={tasks:[],concurrency:t,saturated:null,empty:null,drain:null,started:!1,paused:!1,push:function(e,t){i(u,e,!1,t)},kill:function(){u.drain=null,u.tasks=[]},unshift:function(e,t){i(u,e,!0,t)},process:function(){if(!u.paused&&a<u.concurrency&&u.tasks.length){var t=u.tasks.shift();u.empty&&0===u.tasks.length&&u.empty(),a+=1;var r=n((function(){a-=1,t.callback&&t.callback.apply(t,arguments),u.drain&&u.tasks.length+a===0&&u.drain(),u.process()}));e(t.data,r)}},length:function(){return u.tasks.length},running:function(){return a},idle:function(){return u.tasks.length+a===0},pause:function(){!0!==u.paused&&(u.paused=!0)},resume:function(){if(!1!==u.paused){u.paused=!1;for(var e=1;e<=u.concurrency;e++)r.setImmediate(u.process)}}};return u},r.priorityQueue=function(e,t){function n(e,t){return e.priority-t.priority}var i=r.queue(e,t);return i.push=function(e,t,a){!function(e,t,i,a){if(e.started||(e.started=!0),o(t)||(t=[t]),0==t.length)return r.setImmediate((function(){e.drain&&e.drain()}));s(t,(function(t){var o={data:t,priority:i,callback:"function"==typeof a?a:null};e.tasks.splice(function(e,t,r){for(var n=-1,i=e.length-1;n<i;){var o=n+(i-n+1>>>1);r(t,e[o])>=0?n=o:i=o-1}return n}(e.tasks,o,n)+1,0,o),e.saturated&&e.tasks.length===e.concurrency&&e.saturated(),r.setImmediate(e.process)}))}(i,e,t,a)},delete i.unshift,i},r.cargo=function(e,t){var n=!1,i=[],u={tasks:i,payload:t,saturated:null,empty:null,drain:null,drained:!0,push:function(e,n){o(e)||(e=[e]),s(e,(function(e){i.push({data:e,callback:"function"==typeof n?n:null}),u.drained=!1,u.saturated&&i.length===t&&u.saturated()})),r.setImmediate(u.process)},process:function r(){if(!n){if(0===i.length)return u.drain&&!u.drained&&u.drain(),void(u.drained=!0);var o="number"==typeof t?i.splice(0,t):i.splice(0,i.length),f=a(o,(function(e){return e.data}));u.empty&&u.empty(),n=!0,e(f,(function(){n=!1;var e=arguments;s(o,(function(t){t.callback&&t.callback.apply(null,e)})),r()}))}},length:function(){return i.length},running:function(){return n}};return u};var m=function(e){return function(t){var r=Array.prototype.slice.call(arguments,1);t.apply(null,r.concat([function(t){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[e]&&s(r,(function(t){console[e](t)})))}]))}};r.log=m("log"),r.dir=m("dir"),r.memoize=function(e,t){var n={},i={};t=t||function(e){return e};var o=function(){var o=Array.prototype.slice.call(arguments),s=o.pop(),a=t.apply(null,o);a in n?r.nextTick((function(){s.apply(null,n[a])})):a in i?i[a].push(s):(i[a]=[s],e.apply(null,o.concat([function(){n[a]=arguments;var e=i[a];delete i[a];for(var t=0,r=e.length;t<r;t++)e[t].apply(null,arguments)}])))};return o.memo=n,o.unmemoized=e,o},r.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},r.times=function(e,t,n){for(var i=[],o=0;o<e;o++)i.push(o);return r.map(i,t,n)},r.timesSeries=function(e,t,n){for(var i=[],o=0;o<e;o++)i.push(o);return r.mapSeries(i,t,n)},r.seq=function(){var e=arguments;return function(){var t=this,n=Array.prototype.slice.call(arguments),i=n.pop();r.reduce(e,n,(function(e,r,n){r.apply(t,e.concat([function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);n(e,t)}]))}),(function(e,r){i.apply(t,[e].concat(r))}))}},r.compose=function(){return r.seq.apply(null,Array.prototype.reverse.call(arguments))};var E=function(e,t){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return e(t,(function(e,t){e.apply(r,n.concat([t]))}),i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};r.applyEach=c(E),r.applyEachSeries=h(E),r.forever=function(e,t){!function r(n){if(n){if(t)return t(n);throw n}e(r)}()},ct.exports?ct.exports=r:e.async=r}();var lt,pt=ht.exports,dt={exports:{}},gt={exports:{}},vt={newInvalidAsn1Error:function(e){var t=new Error;return t.name="InvalidAsn1Error",t.message=e||"",t}},_t={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},yt=S,mt=yt.Buffer,Et={};for(lt in yt)yt.hasOwnProperty(lt)&&"SlowBuffer"!==lt&&"Buffer"!==lt&&(Et[lt]=yt[lt]);var wt=Et.Buffer={};for(lt in mt)mt.hasOwnProperty(lt)&&"allocUnsafe"!==lt&&"allocUnsafeSlow"!==lt&&(wt[lt]=mt[lt]);if(Et.Buffer.prototype=mt.prototype,wt.from&&wt.from!==Uint8Array.from||(wt.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 mt(e,t,r)}),wt.alloc||(wt.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 n=mt(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!Et.kStringMaxLength)try{Et.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(Ku){}Et.constants||(Et.constants={MAX_LENGTH:Et.kMaxLength},Et.kStringMaxLength&&(Et.constants.MAX_STRING_LENGTH=Et.kStringMaxLength));var bt=Et,St=_,Bt=bt.Buffer,It=_t,At=vt.newInvalidAsn1Error;function Tt(e){if(!e||!Bt.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(Tt.prototype,"length",{enumerable:!0,get:function(){return this._len}}),Object.defineProperty(Tt.prototype,"offset",{enumerable:!0,get:function(){return this._offset}}),Object.defineProperty(Tt.prototype,"remain",{get:function(){return this._size-this._offset}}),Object.defineProperty(Tt.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}}),Tt.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},Tt.prototype.peek=function(){return this.readByte(!0)},Tt.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 At("Indefinite length not supported");if(t>4)throw At("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},Tt.prototype.readSequence=function(e){var t=this.peek();if(null===t)return null;if(void 0!==e&&e!==t)throw At("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)},Tt.prototype.readInt=function(){return this._readTag(It.Integer)},Tt.prototype.readBoolean=function(){return 0!==this._readTag(It.Boolean)},Tt.prototype.readEnumeration=function(){return this._readTag(It.Enumeration)},Tt.prototype.readString=function(e,t){e||(e=It.OctetString);var r=this.peek();if(null===r)return null;if(r!==e)throw At("Expected 0x"+e.toString(16)+": got 0x"+r.toString(16));var n=this.readLength(this._offset+1);if(null===n)return null;if(this.length>this._size-n)return null;if(this._offset=n,0===this.length)return t?Bt.alloc(0):"";var i=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?i:i.toString("utf8")},Tt.prototype.readOID=function(e){e||(e=It.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],n=0,i=0;i<t.length;i++){var o=255&t[i];n<<=7,n+=127&o,0==(128&o)&&(r.push(n),n=0)}return n=r.shift(),r.unshift(n%40),r.unshift(n/40>>0),r.join(".")},Tt.prototype._readTag=function(e){St.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw At("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 At("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,o=0;o<this.length;o++)i<<=8,i|=255&this._buf[this._offset++];return 128==(128&n)&&4!==o&&(i-=1<<8*o),i>>0};var kt=Tt,Ut=_,Rt=bt.Buffer,Ot=_t,Nt=vt.newInvalidAsn1Error,Ct={size:1024,growthFactor:8};function Lt(e){var t,r;t=Ct,r=e||{},Ut.ok(t),Ut.equal(typeof t,"object"),Ut.ok(r),Ut.equal(typeof r,"object"),Object.getOwnPropertyNames(t).forEach((function(e){if(!r[e]){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n)}})),e=r,this._buf=Rt.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(Lt.prototype,"buffer",{get:function(){if(this._seq.length)throw Nt(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),Lt.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},Lt.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=Ot.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&r>1;)r--,e<<=8;if(r>4)throw Nt("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},Lt.prototype.writeNull=function(){this.writeByte(Ot.Null),this.writeByte(0)},Lt.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=Ot.Enumeration),this.writeInt(e,t)},Lt.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=Ot.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},Lt.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+typeof e+")");"number"!=typeof t&&(t=Ot.OctetString);var r=Rt.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},Lt.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!Rt.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},Lt.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)}))},Lt.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=Ot.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),n=[];n.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))}(n,parseInt(e,10))}));var i=this;this._ensure(2+n.length),this.writeByte(t),this.writeLength(n.length),n.forEach((function(e){i.writeByte(e)}))},Lt.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 Nt("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}},Lt.prototype.startSequence=function(e){"number"!=typeof e&&(e=Ot.Sequence|Ot.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},Lt.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 Nt("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}},Lt.prototype._shift=function(e,t,r){Ut.ok(void 0!==e),Ut.ok(void 0!==t),Ut.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},Lt.prototype._ensure=function(e){if(Ut.ok(e),this._size-this._offset<e){var t=this._size*this._options.growthFactor;t-this._offset<e&&(t+=e);var r=Rt.alloc(t);this._buf.copy(r,0,0,this._offset),this._buf=r,this._size=t}};var Dt=Lt;!function(e){var t=vt,r=_t,n=kt,i=Dt;for(var o in e.exports={Reader:n,Writer:i},r)r.hasOwnProperty(o)&&(e.exports[o]=r[o]);for(var s in t)t.hasOwnProperty(s)&&(e.exports[s]=t[s])}(gt);var xt=gt.exports,Pt={Ber:xt,BerReader:xt.Reader,BerWriter:xt.Writer};function Ht(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function Mt(){return new Ht(null)}Ht.prototype.am=function(e,t,r,n,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],f=this[e++]>>14,c=a*u+f*s;i=((u=s*u+((16383&c)<<14)+r[n]+i)>>28)+(c>>14)+a*f,r[n++]=268435455&u}return i},Ht.prototype.DB=28,Ht.prototype.DM=268435455,Ht.prototype.DV=1<<28;Ht.prototype.FV=Math.pow(2,52),Ht.prototype.F1=24,Ht.prototype.F2=4;var jt,Gt,Ft="0123456789abcdefghijklmnopqrstuvwxyz",Wt=new Array;for(jt="0".charCodeAt(0),Gt=0;Gt<=9;++Gt)Wt[jt++]=Gt;for(jt="a".charCodeAt(0),Gt=10;Gt<36;++Gt)Wt[jt++]=Gt;for(jt="A".charCodeAt(0),Gt=10;Gt<36;++Gt)Wt[jt++]=Gt;function qt(e){return Ft.charAt(e)}function Kt(e,t){var r=Wt[e.charCodeAt(t)];return null==r?-1:r}function zt(e){var t=Mt();return t.fromInt(e),t}function Vt(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function Xt(e){this.m=e}function Qt(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function $t(e,t){return e&t}function Yt(e,t){return e|t}function Zt(e,t){return e^t}function Jt(e,t){return e&~t}function er(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function tr(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function rr(){}function nr(e){return e}function ir(e){this.r2=Mt(),this.q3=Mt(),Ht.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}Xt.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},Xt.prototype.revert=function(e){return e},Xt.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},Xt.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Xt.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Qt.prototype.convert=function(e){var t=Mt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(Ht.ZERO)>0&&this.m.subTo(t,t),t},Qt.prototype.revert=function(e){var t=Mt();return e.copyTo(t),this.reduce(t),t},Qt.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},Qt.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Qt.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Ht.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},Ht.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},Ht.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=8==r?255&e[n]:Kt(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this[this.t++]=s:o+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&Ht.ZERO.subTo(this,this)},Ht.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},Ht.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},Ht.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},Ht.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+s+1]=this[r]>>i|a,a=(this[r]&o)<<n;for(r=s-1;r>=0;--r)t[r]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},Ht.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&o)<<i,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}},Ht.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},Ht.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&Ht.ZERO.subTo(t,t)},Ht.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},Ht.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=Mt());var o=Mt(),s=this.s,a=e.s,u=this.DB-Vt(n[n.t-1]);u>0?(n.lShiftTo(u,o),i.lShiftTo(u,r)):(n.copyTo(o),i.copyTo(r));var f=o.t,c=o[f-1];if(0!=c){var h=c*(1<<this.F1)+(f>1?o[f-2]>>this.F2:0),l=this.FV/h,p=(1<<this.F1)/h,d=1<<this.F2,g=r.t,v=g-f,_=null==t?Mt():t;for(o.dlShiftTo(v,_),r.compareTo(_)>=0&&(r[r.t++]=1,r.subTo(_,r)),Ht.ONE.dlShiftTo(f,_),_.subTo(o,o);o.t<f;)o[o.t++]=0;for(;--v>=0;){var y=r[--g]==c?this.DM:Math.floor(r[g]*l+(r[g-1]+d)*p);if((r[g]+=o.am(0,y,r,v,0,f))<y)for(o.dlShiftTo(v,_),r.subTo(_,r);r[g]<--y;)r.subTo(_,r)}null!=t&&(r.drShiftTo(f,t),s!=a&&Ht.ZERO.subTo(t,t)),r.t=f,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&Ht.ZERO.subTo(r,r)}}},Ht.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},Ht.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},Ht.prototype.exp=function(e,t){if(e>4294967295||e<1)return Ht.ONE;var r=Mt(),n=Mt(),i=t.convert(this),o=Vt(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var s=r;r=n,n=s}return t.revert(r)},Ht.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(i=!0,o=qt(r));s>=0;)a<t?(r=(this[s]&(1<<a)-1)<<t-a,r|=this[--s]>>(a+=this.DB-t)):(r=this[s]>>(a-=t)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=qt(r));return i?o:"0"},Ht.prototype.negate=function(){var e=Mt();return Ht.ZERO.subTo(this,e),e},Ht.prototype.abs=function(){return this.s<0?this.negate():this},Ht.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},Ht.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Vt(this[this.t-1]^this.s&this.DM)},Ht.prototype.mod=function(e){var t=Mt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Ht.ZERO)>0&&e.subTo(t,t),t},Ht.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new Xt(t):new Qt(t),this.exp(e,r)},Ht.ZERO=zt(0),Ht.ONE=zt(1),rr.prototype.convert=nr,rr.prototype.revert=nr,rr.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},rr.prototype.sqrTo=function(e,t){e.squareTo(t)},ir.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Mt();return e.copyTo(t),this.reduce(t),t},ir.prototype.revert=function(e){return e},ir.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},ir.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},ir.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var or=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],sr=(1<<26)/or[or.length-1];Ht.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},Ht.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=zt(r),i=Mt(),o=Mt(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(e)+s},Ht.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,a=0;a<e.length;++a){var u=Kt(e,a);u<0?"-"==e.charAt(a)&&0==this.signum()&&(i=!0):(s=t*s+u,++o>=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&Ht.ZERO.subTo(this,this)},Ht.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(Ht.ONE.shiftLeft(e-1),Yt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Ht.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},Ht.prototype.bitwiseTo=function(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},Ht.prototype.changeBit=function(e,t){var r=Ht.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},Ht.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},Ht.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},Ht.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},Ht.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,e[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e[i],r,i,0,t-i);r.clamp()},Ht.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},Ht.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},Ht.prototype.millerRabin=function(e){var t=this.subtract(Ht.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>or.length&&(e=or.length);for(var i=Mt(),o=0;o<e;++o){i.fromInt(or[Math.floor(Math.random()*or.length)]);var s=i.modPow(n,this);if(0!=s.compareTo(Ht.ONE)&&0!=s.compareTo(t)){for(var a=1;a++<r&&0!=s.compareTo(t);)if(0==(s=s.modPowInt(2,this)).compareTo(Ht.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},Ht.prototype.clone=function(){var e=Mt();return this.copyTo(e),e},Ht.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},Ht.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},Ht.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},Ht.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},Ht.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},Ht.prototype.equals=function(e){return 0==this.compareTo(e)},Ht.prototype.min=function(e){return this.compareTo(e)<0?this:e},Ht.prototype.max=function(e){return this.compareTo(e)>0?this:e},Ht.prototype.and=function(e){var t=Mt();return this.bitwiseTo(e,$t,t),t},Ht.prototype.or=function(e){var t=Mt();return this.bitwiseTo(e,Yt,t),t},Ht.prototype.xor=function(e){var t=Mt();return this.bitwiseTo(e,Zt,t),t},Ht.prototype.andNot=function(e){var t=Mt();return this.bitwiseTo(e,Jt,t),t},Ht.prototype.not=function(){for(var e=Mt(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},Ht.prototype.shiftLeft=function(e){var t=Mt();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},Ht.prototype.shiftRight=function(e){var t=Mt();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},Ht.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+er(this[e]);return this.s<0?this.t*this.DB:-1},Ht.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=tr(this[r]^t);return e},Ht.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},Ht.prototype.setBit=function(e){return this.changeBit(e,Yt)},Ht.prototype.clearBit=function(e){return this.changeBit(e,Jt)},Ht.prototype.flipBit=function(e){return this.changeBit(e,Zt)},Ht.prototype.add=function(e){var t=Mt();return this.addTo(e,t),t},Ht.prototype.subtract=function(e){var t=Mt();return this.subTo(e,t),t},Ht.prototype.multiply=function(e){var t=Mt();return this.multiplyTo(e,t),t},Ht.prototype.divide=function(e){var t=Mt();return this.divRemTo(e,t,null),t},Ht.prototype.remainder=function(e){var t=Mt();return this.divRemTo(e,null,t),t},Ht.prototype.divideAndRemainder=function(e){var t=Mt(),r=Mt();return this.divRemTo(e,t,r),new Array(t,r)},Ht.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),o=zt(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new Xt(t):t.isEven()?new ir(t):new Qt(t);var s=new Array,a=3,u=r-1,f=(1<<r)-1;if(s[1]=n.convert(this),r>1){var c=Mt();for(n.sqrTo(s[1],c);a<=f;)s[a]=Mt(),n.mulTo(c,s[a-2],s[a]),a+=2}var h,l,p=e.t-1,d=!0,g=Mt();for(i=Vt(e[p])-1;p>=0;){for(i>=u?h=e[p]>>i-u&f:(h=(e[p]&(1<<i+1)-1)<<u-i,p>0&&(h|=e[p-1]>>this.DB+i-u)),a=r;0==(1&h);)h>>=1,--a;if((i-=a)<0&&(i+=this.DB,--p),d)s[h].copyTo(o),d=!1;else{for(;a>1;)n.sqrTo(o,g),n.sqrTo(g,o),a-=2;a>0?n.sqrTo(o,g):(l=o,o=g,g=l),n.mulTo(g,s[h],o)}for(;p>=0&&0==(e[p]&1<<i);)n.sqrTo(o,g),l=o,o=g,g=l,--i<0&&(i=this.DB-1,--p)}return n.revert(o)},Ht.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return Ht.ZERO;for(var r=e.clone(),n=this.clone(),i=zt(1),o=zt(0),s=zt(0),a=zt(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(e,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(a,o)):(n.subTo(r,n),t&&s.subTo(i,s),a.subTo(o,a))}return 0!=n.compareTo(Ht.ONE)?Ht.ZERO:a.compareTo(e)>=0?a.subtract(e):a.signum()<0?(a.addTo(e,a),a.signum()<0?a.add(e):a):a},Ht.prototype.pow=function(e){return this.exp(e,new rr)},Ht.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},Ht.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=or[or.length-1]){for(t=0;t<or.length;++t)if(r[0]==or[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<or.length;){for(var n=or[t],i=t+1;i<or.length&&n<sr;)n*=or[i++];for(n=r.modInt(n);t<i;)if(n%or[t++]==0)return!1}return r.millerRabin(e)},Ht.prototype.square=function(){var e=Mt();return this.squareTo(e),e},Ht.prototype.Barrett=ir;var ar,ur,fr,cr=Ht,hr={},lr=hr.MESSAGE={DISCONNECT:1,IGNORE:2,UNIMPLEMENTED:3,DEBUG:4,SERVICE_REQUEST:5,SERVICE_ACCEPT:6,KEXINIT:20,NEWKEYS:21,USERAUTH_REQUEST:50,USERAUTH_FAILURE:51,USERAUTH_SUCCESS:52,USERAUTH_BANNER:53,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};for(ar=0,fr=(ur=Object.keys(lr)).length;ar<fr;++ar)lr[lr[ur[ar]]]=ur[ar];lr.KEXDH_INIT=30,lr.KEXDH_REPLY=31,lr.KEXDH_GEX_REQUEST=34,lr.KEXDH_GEX_GROUP=31,lr.KEXDH_GEX_INIT=32,lr.KEXDH_GEX_REPLY=33,lr.USERAUTH_PASSWD_CHANGEREQ=60,lr.USERAUTH_PK_OK=60,lr.USERAUTH_INFO_REQUEST=60,lr.USERAUTH_INFO_RESPONSE=61;var pr=hr.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};for(ar=0,fr=(ur=Object.keys(pr)).length;ar<fr;++ar)pr[pr[ur[ar]]]=ur[ar];var dr=hr.CHANNEL_OPEN_FAILURE={ADMINISTRATIVELY_PROHIBITED:1,CONNECT_FAILED:2,UNKNOWN_CHANNEL_TYPE:3,RESOURCE_SHORTAGE:4};for(ar=0,fr=(ur=Object.keys(dr)).length;ar<fr;++ar)dr[dr[ur[ar]]]=ur[ar];var gr=hr.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};for(ar=0,fr=(ur=Object.keys(gr)).length;ar<fr;++ar)gr[gr[ur[ar]]]=ur[ar];var vr=hr.CHANNEL_EXTENDED_DATATYPE={STDERR:1};for(ar=0,fr=(ur=Object.keys(vr)).length;ar<fr;++ar)vr[vr[ur[ar]]]=ur[ar];hr.SIGNALS=["ABRT","ALRM","FPE","HUP","ILL","INT","QUIT","SEGV","TERM","USR1","USR2","KILL","PIPE"];var _r=["diffie-hellman-group14-sha1","diffie-hellman-group1-sha1"],yr=new Buffer(_r.join(",")),mr=["ssh-rsa","ssh-dss"],Er=new Buffer(mr.join(",")),wr=["aes256-cbc","aes192-cbc","aes128-cbc","blowfish-cbc","3des-cbc","arcfour256","arcfour128","cast128-cbc","arcfour"],br=new Buffer(wr.join(",")),Sr=["hmac-md5","hmac-sha1","hmac-sha2-256","hmac-sha2-256-96","hmac-sha2-512","hmac-sha2-512-96","hmac-ripemd160","hmac-sha1-96","hmac-md5-96"],Br=new Buffer(Sr.join(",")),Ir=["none"],Ar=new Buffer(Ir.join(","));process.versions.openssl>="1.0.1"&&(process.version>="v0.11.12"&&(wr=["aes128-gcm","aes128-gcm@openssh.com","aes256-gcm","aes256-gcm@openssh.com"].concat(wr),_r=["diffie-hellman-group-exchange-sha256","diffie-hellman-group-exchange-sha1"].concat(_r),yr=new Buffer(_r.join(","))),wr=["aes256-ctr","aes192-ctr","aes128-ctr"].concat(wr),br=new Buffer(wr.join(","))),hr.ALGORITHMS={KEX:_r,KEX_LIST:yr,KEX_LIST_SIZE:yr.length,SERVER_HOST_KEY:mr,SERVER_HOST_KEY_LIST:Er,SERVER_HOST_KEY_LIST_SIZE:Er.length,CIPHER:wr,CIPHER_LIST:br,CIPHER_LIST_SIZE:br.length,HMAC:Sr,HMAC_LIST:Br,HMAC_LIST_SIZE:Br.length,COMPRESS:Ir,COMPRESS_LIST:Ar,COMPRESS_LIST_SIZE:Ar.length},hr.SSH_TO_OPENSSL={"aes128-gcm":"aes-128-gcm","aes256-gcm":"aes-256-gcm","aes128-gcm@openssh.com":"aes-128-gcm","aes256-gcm@openssh.com":"aes-256-gcm","3des-cbc":"des-ede3-cbc","blowfish-cbc":"bf-cbc","aes256-cbc":"aes-256-cbc","aes192-cbc":"aes-192-cbc","aes128-cbc":"aes-128-cbc","idea-cbc":"idea-cbc","cast128-cbc":"cast-cbc","rijndael-cbc@lysator.liu.se":"aes-256-cbc",arcfour128:"rc4",arcfour256:"rc4",arcfour512:"rc4",arcfour:"rc4","camellia128-cbc":"camellia-128-cbc","camellia192-cbc":"camellia-192-cbc","camellia256-cbc":"camellia-256-cbc","camellia128-cbc@openssh.com":"camellia-128-cbc","camellia192-cbc@openssh.com":"camellia-192-cbc","camellia256-cbc@openssh.com":"camellia-256-cbc","3des-ctr":"des-ede3","blowfish-ctr":"bf-ecb","aes256-ctr":"aes-256-ctr","aes192-ctr":"aes-192-ctr","aes128-ctr":"aes-128-ctr","cast128-ctr":"cast5-ecb","camellia128-ctr":"camellia-128-ecb","camellia192-ctr":"camellia-192-ecb","camellia256-ctr":"camellia-256-ecb","camellia128-ctr@openssh.com":"camellia-128-ecb","camellia192-ctr@openssh.com":"camellia-192-ecb","camellia256-ctr@openssh.com":"camellia-256-ecb","hmac-sha1-96":"sha1","hmac-sha1":"sha1","hmac-sha2-256":"sha256","hmac-sha2-256-96":"sha256","hmac-sha2-512":"sha512","hmac-sha2-512-96":"sha512","hmac-md5-96":"md5","hmac-md5":"md5","hmac-ripemd160":"ripemd160"};var Tr,kr,Ur,Rr,Or=hr.BUGS={BAD_DHGEX:1};function Nr(){if(kr)return Tr;var e;kr=1;var t=/^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]+)/,r=/^-----BEGIN (RSA|DSA) PRIVATE KEY-----$/i,n=/^-----END (?:RSA|DSA) PRIVATE KEY-----$/i,i=/^(ssh-(rsa|dss)(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z\/+=]+)(?:$|\s+([\S].*)?)$/i,o=/^---- BEGIN SSH2 PUBLIC KEY ----$/i,s=/^---- END SSH2 PUBLIC KEY ----$/i,a=/^([^:]+):\s*([\S].*)?$/i,u=/^([^:]+): (.*)?$/i;return Tr=function(f){if(Buffer.isBuffer(f))f=f.toString("utf8");else if("string"!=typeof f)return new Error("Key data must be a Buffer or string");var c,h,l,p={fulltype:void 0,type:void 0,extra:void 0,comment:void 0,encryption:void 0,private:void 0,privateOrig:void 0,public:void 0,publicOrig:void 0};for(f=f.trim().split(/\r\n|\n/);!f[0].length;)f.shift();for(;!f.slice(-1)[0].length;)f.pop();var d=f.join("\n");if((c=r.exec(f[0]))&&n.test(f.slice(-1))){if(p.type="dsa"===c[1].toLowerCase()?"dss":"rsa",a.test(f[1])){for(h=1,l=f.length;h<l;++h)if(c=a.exec(f[h]))c[1]=c[1].toLowerCase(),"dek-info"===c[1]&&(c[2]=c[2].split(","),p.encryption=c[2][0].toLowerCase(),c[2].length>1&&(p.extra=c[2].slice(1)));else if(f[h].length)break;p.private=new Buffer(f.slice(h,-1).join(""),"base64")}else p.private=new Buffer(f.slice(1,-1).join(""),"base64");p.privateOrig=new Buffer(d)}else if(c=i.exec(f[0]))p.fulltype=c[1],p.type=c[2].toLowerCase(),p.public=new Buffer(c[3],"base64"),p.publicOrig=new Buffer(d),p.comment=c[4];else if(o.test(f[0])&&s.test(f.slice(-1))){if(-1===f[1].indexOf(": "))p.public=new Buffer(f.slice(1,-1).join(""),"base64");else{for(h=1,l=f.length;h<l;++h)if(-1!==f[h].indexOf(": ")){for(;"\\"===f[h].substr(-1);){if(!(h+1<l))return new Error("RFC4716 public key missing header continuation line");f[h]=f[h].slice(0,-1)+f[h+1],f.splice(h+1,1),--l}if(!(c=u.exec(f[h])))return new Error("RFC4716 public key invalid header line");c[1]=c[1].toLowerCase(),"comment"===c[1]&&(p.comment=c[2]||"",'"'===p.comment[0]&&'"'===p.comment.substr(-1)&&(p.comment=p.comment.slice(1,-1)))}else if(f[h].length)break;p.public=new Buffer(f.slice(h,-1).join(""),"base64")}l=p.public.readUInt32BE(0,!0);var g=p.public.toString("ascii",4,4+l);if(p.fulltype=g,"ssh-dss"===g)p.type="dss";else{if("ssh-rsa"!==g)return new Error("Unsupported RFC4716 public key type: "+g);p.type="rsa"}p.public=p.public.slice(11),p.publicOrig=new Buffer(d)}else{if(!(c=t.exec(d)))return new Error("Unsupported key format");e||(e=Cr()),p.ppk=!0,p.type=c[1],p.fulltype="ssh-"+c[1],"none"!==c[2]&&(p.encryption=c[2]),p.comment=c[3],p.public=new Buffer(c[4].replace(/\r?\n/g,""),"base64");var v=new Buffer(c[5].replace(/\r?\n/g,""),"base64");if(!(p.privateMAC=c[6].replace(/\r?\n/g,""),p.encryption||e.verifyPPKMAC(p,void 0,v)))throw new Error("PPK MAC mismatch");var _=e.genPublicKey(p);p.public=_.public,p.publicOrig=_.publicOrig,p.private=v,p.encryption||e.convertPPKPrivate(p)}return p},Tr}function Cr(){if(Rr)return Ur;Rr=1;var e=m,t=Pt.Ber,r=cr,n=hr.SSH_TO_OPENSSL,i=/^arcfour/i,o=/^aes\d+-gcm/i,s=/(.{64})/g,a=1/0,u=new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function f(t,r,n){if(void 0!==t._macresult)return t._macresult;if(!t.ppk)throw new Error("Key isn't a PPK");if(!t.privateMAC)throw new Error("Missing MAC");if(!n)throw new Error("Missing raw private key data");if(t.encryption&&"string"!=typeof r)throw new Error("Missing passphrase for encrypted PPK");if(t.encryption&&!t._decrypted)throw new Error("PPK must be decrypted before verifying MAC");var i=t.privateMAC,o=t.fulltype.length,s=t.encryption?"aes256-cbc":"none",a=s.length,u=Buffer.byteLength(t.comment),f=t.public,c=f.length,h=n.length,l=new Buffer(4+o+4+a+4+u+4+c+4+h),p=0;l.writeUInt32BE(o,p,!0),l.write(t.fulltype,p+=4,o,"ascii"),l.writeUInt32BE(a,p+=o,!0),l.write(s,p+=4,a,"ascii"),l.writeUInt32BE(u,p+=a,!0),l.write(t.comment,p+=4,u,"utf8"),l.writeUInt32BE(c,p+=u,!0),f.copy(l,p+=4),l.writeUInt32BE(h,p+=c,!0),n.copy(l,p+=4),"string"!=typeof r&&(r="");var d=e.createHash("sha1").update("putty-private-key-file-mac-key","ascii").update(r,"utf8").digest("binary");d=new Buffer(d,"binary");var g=e.createHmac("sha1",d).update(l,"binary").digest("hex");return t._macresult=g===i}function c(e){if(!(e.ppk&&e.public&&e.private))throw new Error("Key isn't a PPK");if(e._converted)return!1;var n,i,o=e.public,a=e.private,u=new t.Writer;if("rsa"===e.type){var f=h(o,11),c=h(o,o._pos),l=h(a,0);n=h(a,a._pos),i=h(a,a._pos);var p=h(a,a._pos),d=new r(n,256),g=new r(i,256),v=new r(l,256),_=new r(l,256);v=new Buffer(v.mod(d.subtract(r.ONE)).toByteArray()),_=new Buffer(_.mod(g.subtract(r.ONE)).toByteArray()),u.startSequence(),u.writeInt(0,t.Integer),u.writeBuffer(c,t.Integer),u.writeBuffer(f,t.Integer),u.writeBuffer(l,t.Integer),u.writeBuffer(n,t.Integer),u.writeBuffer(i,t.Integer),u.writeBuffer(v,t.Integer),u.writeBuffer(_,t.Integer),u.writeBuffer(p,t.Integer),u.endSequence()}else{n=h(o,11),i=h(o,o._pos);var y=h(o,o._pos),m=h(o,o._pos),E=h(a,0);u.startSequence(),u.writeInt(0,t.Integer),u.writeBuffer(n,t.Integer),u.writeBuffer(i,t.Integer),u.writeBuffer(y,t.Integer),u.writeBuffer(m,t.Integer),u.writeBuffer(E,t.Integer),u.endSequence()}var w=u.buffer.toString("base64").replace(s,"$1\n"),b="-----BEGIN "+("rsa"===e.type?"RSA":"DSA")+" PRIVATE KEY-----\n"+w+("\n"===w[w.length-1]?"":"\n")+"-----END "+("rsa"===e.type?"RSA":"DSA")+" PRIVATE KEY-----";return e.private=u.buffer,e.privateOrig=new Buffer(b),e._converted=!0,!0}function h(e,t,r,n,i,o){r&&!Buffer.isBuffer(r)&&"string"!=typeof r&&("number"==typeof i&&(o=i),i=n,n=r,r=void 0);var s,u,f=e.length,c=f-t;return t<0||t>=f||c<4||(s=e.readUInt32BE(t,!0))>(o||a)||c<4+s?(n&&n._cleanup(i),!1):(u=(t+=4)+s,e._pos=u,r?Buffer.isBuffer(r)?(e.copy(r,0,t,u),r):e.toString(r,t,u):e.slice(t,u))}return Ur={iv_inc:function(e){var t=12,r=0;do{if(255!==(r=e[--t]))return void(e[t]=++r);e[t]=0}while(t>4)},isStreamCipher:function(e){return i.test(e)},isGCM:function(e){return o.test(e)},readInt:function(e,t,r,n){var i=e.length;return t<0||t>=i||i-t<4?(r&&r._cleanup(n),!1):e.readUInt32BE(t,!0)},readString:h,parseKey:Nr(),genPublicKey:function(e){var r,n,i,o,a,u,f,c,h,l,p,d,g,v;if(e.private){var _,y,m=e.private,E=2;if(48!==m[0]){var w="Malformed private key (expected sequence)";throw e._decrypted&&(w+=". Bad passphrase?"),new Error(w)}if(128&m[1]&&(E+=127&m[1]),2!==m[E++])throw new Error("Malformed private key (expected integer for version)");if(128&(_=m[E++]))for(y=127&_,_=0;y>0;)_+=m[E++]*Math.pow(2,8*(y-1)),--y;if(E+=_,"rsa"===e.type){if(2!==m[E++])throw new Error("Malformed private key (expected integer for n)");if(128&(o=m[E++]))for(y=127&o,o=0;y>0;)o+=m[E++]*Math.pow(2,8*(y-1)),--y;if(i=E,E+=o,2!==m[E++])throw new Error("Malformed private key (expected integer for e)");if(128&(u=m[E++]))for(y=127&u,u=0;y>0;)u+=m[E++]*Math.pow(2,8*(y-1)),--y;a=E}else{if(2!==m[E++])throw new Error("Malformed private key (expected integer for p)");if(128&(c=m[E++]))for(y=127&c,c=0;y>0;)c+=m[E++]*Math.pow(2,8*(y-1)),--y;if(f=E,E+=c,2!==m[E++])throw new Error("Malformed private key (expected integer for q)");if(128&(l=m[E++]))for(y=127&l,l=0;y>0;)l+=m[E++]*Math.pow(2,8*(y-1)),--y;if(h=E,E+=l,2!==m[E++])throw new Error("Malformed private key (expected integer for g)");if(128&(d=m[E++]))for(y=127&d,d=0;y>0;)d+=m[E++]*Math.pow(2,8*(y-1)),--y;if(p=E,E+=d,2!==m[E++])throw new Error("Malformed private key (expected integer for y)");if(128&(v=m[E++]))for(y=127&v,v=0;y>0;)v+=m[E++]*Math.pow(2,8*(y-1)),--y;g=E,E+=v}n=11,"rsa"===e.type?((r=new Buffer(15+o+4+u)).writeUInt32BE(7,0,!0),r.write("ssh-rsa",4,7,"ascii"),r.writeUInt32BE(u,n,!0),m.copy(r,n+=4,a,a+u),r.writeUInt32BE(o,n+=u,!0),m.copy(r,n+=4,i,i+o)):((r=new Buffer(15+c+4+l+4+d+4+v)).writeUInt32BE(7,0,!0),r.write("ssh-dss",4,7,"ascii"),r.writeUInt32BE(c,n,!0),m.copy(r,n+=4,f,f+c),r.writeUInt32BE(l,n+=c,!0),m.copy(r,n+=4,h,h+l),r.writeUInt32BE(d,n+=l,!0),m.copy(r,n+=4,p,p+d),r.writeUInt32BE(v,n+=d,!0),m.copy(r,n+=4,g,g+v))}else{if(!e.public)throw new Error("Missing data generated by parseKey()");if(0!==(r=e.public)[0]||0!==r[1]||0!==r[2]||7!==r[3]||115!==r[4]||115!==r[5]||104!==r[6]||45!==r[7]||(114!==r[8]||115!==r[9]||97!==r[10])&&(100!==r[8]||115!==r[9]||115!==r[10])){var b=new Buffer(11+r.length);r.copy(b,11),b.writeUInt32BE(7,0,!0),"rsa"===e.type?b.write("ssh-rsa",4,7,"ascii"):b.write("ssh-dss",4,7,"ascii"),r=b}}n=11;var S=new t.Writer;if(S.startSequence(),"rsa"===e.type){u=r.readUInt32BE(n,!0),a=n+=4,n+=u,o=r.readUInt32BE(n,!0),i=n+=4;var B=r.slice(a,a+u),I=r.slice(i,i+o);S.startSequence(),S.writeOID("1.2.840.113549.1.1.1"),S.writeNull(),S.endSequence(),S.startSequence(t.BitString),S.writeByte(0),S.startSequence(),S.writeBuffer(I,t.Integer),S.writeBuffer(B,t.Integer),S.endSequence(),S.endSequence()}else{c=r.readUInt32BE(n,!0),f=n+=4,n+=c,l=r.readUInt32BE(n,!0),h=n+=4,n+=l,d=r.readUInt32BE(n,!0),p=n+=4,n+=d,v=r.readUInt32BE(n,!0),g=n+=4,n=r.slice(f,f+c);var A=r.slice(h,h+l),T=r.slice(p,p+d),k=r.slice(g,g+v);S.startSequence(),S.writeOID("1.2.840.10040.4.1"),S.startSequence(),S.writeBuffer(n,t.Integer),S.writeBuffer(A,t.Integer),S.writeBuffer(T,t.Integer),S.endSequence(),S.endSequence(),S.startSequence(t.BitString),S.writeByte(0),S.writeBuffer(k,t.Integer),S.endSequence()}S.endSequence();var U=S.buffer.toString("base64").replace(s,"$1\n"),R="-----BEGIN PUBLIC KEY-----\n"+U+("\n"===U[U.length-1]?"":"\n")+"-----END PUBLIC KEY-----";return{type:e.type,fulltype:"ssh-"+e.type,public:r,publicOrig:new Buffer(R)}},convertPPKPrivate:c,verifyPPKMAC:f,decryptKey:function(t,r){if(!t._decrypted&&t.encryption){var i,o,s,a,h=0;switch(t.encryption=n[t.encryption]||t.encryption,t.encryption){case"aes-256-cbc":case"aes-256-ctr":h=32;break;case"des-ede3-cbc":case"des-ede3":case"aes-192-cbc":case"aes-192-ctr":h=24;break;case"aes-128-cbc":case"aes-128-ctr":case"cast-cbc":case"bf-cbc":h=16}if(t.ppk)o=u,i=e.createHash("sha1").update("\0\0\0\0"+r,"binary").digest("binary")+e.createHash("sha1").update("\0\0\0"+r,"binary").digest("binary"),i=new Buffer(i,"binary").slice(0,h);else{for(o=new Buffer(t.extra[0],"hex"),i=new Buffer(e.createHash("md5").update(r+o.toString("binary",0,8),"binary").digest("binary"),"binary");h>i.length;)i=Buffer.concat([i,new Buffer(e.createHash("md5").update(i.toString("binary")+r+o.toString("binary"),"binary").digest("binary"),"binary").slice(0,8)]);i.length>h&&(i=i.slice(0,h))}if((a=e.createDecipheriv(t.encryption,i,o)).setAutoPadding(!1),s=a.update(t.private,"binary","binary"),s+=a.final("binary"),t.private=new Buffer(s,"binary"),t._decrypted=!0,t.privateOrig){var l=t.privateOrig.toString("utf8"),p=/^(.+(?:\r\n|\n))/.exec(l)[1];p+=new Buffer(s,"binary").toString("base64").match(/.{1,70}/g).join("\n"),p+=/((?:\r\n|\n).+)$/.exec(l)[1],t.privateOrig=p}else if(t.ppk){if(!f(t,r,t.private))throw new Error("PPK MAC mismatch");c(t)}}}},Ur}hr.BUGGY_IMPLS=[["Cisco-1.25",Or.BAD_DHGEX]];var Lr=b.Transform,Dr=b.Readable,xr=b.Writable,Pr=process.binding("constants"),Hr=y,Mr=Hr.inherits,jr=Hr.isDate,Gr=v.EventEmitter.listenerCount,Fr=d,Wr=Cr().readString,qr=Cr().readInt,Kr=1,zr=2,Vr=4,Xr=8,Qr=2147483648,$r={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};Object.keys($r).forEach((function(e){$r[$r[e]]=e})),an.STATUS_CODE=$r;var Yr={INIT:1,OPEN:3,CLOSE:4,READ:5,WRITE:6,LSTAT:7,FSTAT:8,SETSTAT:9,FSETSTAT:10,OPENDIR:11,READDIR:12,REMOVE:13,MKDIR:14,RMDIR:15,REALPATH:16,STAT:17,RENAME:18,READLINK:19,SYMLINK:20,EXTENDED:200};Object.keys(Yr).forEach((function(e){Yr[Yr[e]]=e}));var Zr={VERSION:2,STATUS:101,HANDLE:102,DATA:103,NAME:104,ATTRS:105,EXTENDED:201};Object.keys(Zr).forEach((function(e){Zr[Zr[e]]=e}));var Jr={READ:1,WRITE:2,APPEND:4,CREAT:8,TRUNC:16,EXCL:32};an.OPEN_MODE=Jr;var en=Math.pow(2,32)-1,tn=new Buffer([0,0,0,5,Yr.INIT,0,0,0,3]),rn=new Buffer([0,0,0,5,Zr.VERSION,0,0,0,3]),nn=/^SSH-2.0-(?:OpenSSH|dropbear)/,on=260096;function sn(e){}function an(e,t){"string"!=typeof e||t||(t=e,e=void 0),"object"==typeof e&&e||(e={}),Lr.call(this,{highWaterMark:"number"==typeof e.highWaterMark?e.highWaterMark:32768}),this.debug="function"==typeof e.debug?e.debug:sn,this.server=!!e.server,this._isOpenSSH=t&&nn.test(t),this._needContinue=!1,this._state={status:"packet_header",writeReqid:-1,pktLeft:void 0,pktHdrBuf:new Buffer(9),pktBuf:void 0,pktType:void 0,version:void 0,extensions:{},maxDataLen:this._isOpenSSH?on:32768,requests:{}};var r=this;function n(){r.writable=!1,r._cleanup(!1)}this.on("end",(function(){r.readable=!1})).on("finish",n).on("prefinish",n),this.server||this.push(tn)}function un(e,t,r,n,i,o){var s,a,u,f=25,c=32768;"function"==typeof i?o=i:"object"==typeof i&&("number"==typeof i.concurrency&&i.concurrency>0&&!isNaN(i.concurrency)&&(f=i.concurrency),"number"==typeof i.chunkSize&&i.chunkSize>0&&!isNaN(i.chunkSize)&&(c=i.chunkSize),"function"==typeof i.step&&(s=i.step),i.preserve);var h,l,p=0,d=0,g=0,v=0,_=!1,y=new Buffer(c*f);function m(r){if(!_){_=!0;var n,i=0;h||l?(n=function(){0==--i&&o(r)},h&&(e===Fr||e.writable)&&++i,l&&(t===Fr||t.writable)&&++i,h&&(e===Fr||e.writable)&&e.close(h,n),l&&(t===Fr||t.writable)&&t.close(l,n)):o(r)}}e.open(r,"r",(function(i,_){if(i)return m(i);h=_,e.fstat(h,(function i(_,E){if(_)return e!==Fr?void e.stat(r,(function(e,t){if(e)return m(_);i(null,t)})):m(_);a=E.size,t.open(n,"w",(function(r,n){if(r)return m(r);if(l=n,a<=0)return m();function i(r,n,i,u,f){if(r)return m(r);function c(r){if(r)return m(r);v+=n,s&&s(v,n,a),0==--g&&(v===a?t.close(l,(function(t){if(l=void 0,t)return m(t);e.close(h,(function(e){if(h=void 0,e)return m(e);o()}))})):E())}e===Fr?t.writeData(l,i,f||0,n,u,c):t.write(l,i,f||0,n,u,c)}function _(e,t){return function(r,n,o){i(r,n,o,t,e)}}function E(){for(;d<a&&g<f;)u=d+c>a?a-d:c,e===Fr?e.read(h,y,p,u,d,_(p,d)):e.readData(h,y,p,u,d,i),p+=u,d+=u,++g;p=0}E()}))}))}))}function fn(e,t,r,n,i,o,s){var a="function"==typeof s?s:void 0;e.writeData(t,r,n,i,o,(function(s,u){if(s)return e.close(t,(function(){a&&a(s)}));u===i?e.close(t,a):fn(e,t,r,n+=u,i-=u,o+=u,a)}))}function cn(e,t,r,n){var i=e.readUInt32BE(t,!0),o=new yn;if(t+=4,i&Kr){var s=hn(e,t,r,n);if(!1===s)return!1;o.size=s,t+=8}if(i&zr){var a,u;if(!1===(a=qr(e,t,this,n)))return!1;if(o.uid=a,!1===(u=qr(e,t+=4,this,n)))return!1;o.gid=u,t+=4}if(i&Vr){var f=qr(e,t,this,n);if(!1===f)return!1;o.mode=f,o.permissions=f,t+=4}if(i&Xr){var c,h;if(!1===(c=qr(e,t,this,n)))return!1;if(o.atime=c,!1===(h=qr(e,t+=4,this,n)))return!1;o.mtime=h,t+=4}if(i&Qr){var l=qr(e,t,this,n);if(!1===l)return!1;t+=4;for(var p,d=0;d<l;++d){if(!1===(p=qr(e,t,this,n)))return!1;t+=4+p}}return e._pos=t,o}function hn(e,t,r,n){if(e.length-t<8)return r&&r._cleanup(n),!1;for(var i=0,o=t+8;t<o;++t)i*=256,i+=e[t];return e._pos=t,i}function ln(e){var t=0,r=0,n=[],i=0;if("number"==typeof e.size){t|=Kr,r+=8;var o=new Array(8),s=e.size;for(i=7;i>=0;--i)o[i]=255&s,s/=256;n.push(o)}if("number"==typeof e.uid&&"number"==typeof e.gid&&(t|=zr,r+=8,n.push([e.uid>>24&255,e.uid>>16&255,e.uid>>8&255,255&e.uid]),n.push([e.gid>>24&255,e.gid>>16&255,e.gid>>8&255,255&e.gid])),"number"==typeof e.permissions||"string"==typeof e.permissions||"number"==typeof e.mode||"string"==typeof e.mode){var a=dn(e.mode||e.permissions);t|=Vr,r+=4,n.push([a>>24&255,a>>16&255,a>>8&255,255&a])}if(("number"==typeof e.atime||jr(e.atime))&&("number"==typeof e.mtime||jr(e.mtime))){var u=pn(e.atime),f=pn(e.mtime);t|=Xr,r+=8,n.push([u>>24&255,u>>16&255,u>>8&255,255&u]),n.push([f>>24&255,f>>16&255,f>>8&255,255&f])}return{flags:t,nbytes:r,bytes:n}}function pn(e){if("number"==typeof e&&!isNaN(e))return e;if(jr(e))return parseInt(e.getTime()/1e3,10);throw new Error("Cannot parse time: "+e)}function dn(e){if("number"==typeof e&&!isNaN(e))return e;if("string"==typeof e)return dn(parseInt(e,8));throw new Error("Cannot parse mode: "+e)}Mr(an,Lr),an.prototype.__read=Lr.prototype._read,an.prototype._read=function(e){return this._needContinue&&(this._needContinue=!1,this.emit("continue")),this.__read(e)},an.prototype.__push=Lr.prototype.push,an.prototype.push=function(e,t){if(!this.readable)return!1;null===e&&(this.readable=!1);var r=this.__push(e,t);return this._needContinue=!1===r,r},an.prototype._cleanup=function(e){var t=this._state;t.pktBuf=void 0;var r=t.requests,n=Object.keys(r),i=n.length;if(i){if(this.readable)for(var o,s=new Error("SFTP session ended early"),a=0;a<i;++a)(o=r[n[a]].cb)&&o(s);t.requests={}}this.readable?this.push(null):this._readableState.endEmitted||this._readableState.flowing||this.resume(),!1!==e&&(this.debug("DEBUG[SFTP]: Parser: Malformed packet"),e&&e(new Error("Malformed packet")))},an.prototype._transform=function(e,t,r){for(var n,i,o,s=this._state,a=this.server,u=s.status,f=s.pktType,c=s.pktBuf,h=s.pktLeft,l=s.version,p=s.pktHdrBuf,d=s.requests,g=this.debug,v=e.length,_=0;;){if("discard"===u){if(!(h<=(i=v-_))){h-=i;break}_+=h,h=0,u="packet_header",n=c=void 0}else{if(void 0!==c){if(h<=(i=v-_)){e.copy(c,c.length-h,_,_+h),_+=h,h=0,n=c,c=void 0;continue}e.copy(c,c.length-h,_),h-=i;break}if("packet_header"===u)n?(h=n.readUInt32BE(4,!0)-1,f=n[8],a?void 0===l&&f!==Yr.INIT?(g("DEBUG[SFTP]: Parser: Unexpected packet before init"),u="bad_pkt"):void 0!==l&&f===Yr.INIT?(g("DEBUG[SFTP]: Parser: Unexpected duplicate init"),u="bad_pkt"):h>34e3?(g("DEBUG[SFTP]: Parser: Packet length ("+h+") exceeds max length (34000)"),u="bad_pkt"):f===Yr.EXTENDED?u="bad_pkt":void 0===Yr[f]&&(g("DEBUG[SFTP]: Parser: Unsupported packet type: "+f),u="discard"):void 0===l&&f!==Zr.VERSION?(g("DEBUG[SFTP]: Parser: Unexpected packet before version"),u="bad_pkt"):void 0!==l&&f===Zr.VERSION?(g("DEBUG[SFTP]: Parser: Unexpected duplicate version"),u="bad_pkt"):void 0===Zr[f]&&(u="discard"),"bad_pkt"===u?(p.writeUInt32BE(h,0,!0),p[4]=f,h=4,c=p):(c=new Buffer(h),u="payload")):(h=5,c=p);else if("payload"===u){if(f===Zr.VERSION||f===Yr.INIT){if(!1===(l=s.version=qr(n,0,this,r)))return;if(l<3)return this._cleanup(),r(new Error("Incompatible SFTP version: "+l));a&&this.push(rn);var y,m,E=n.length;for(n._pos=4;n._pos<E;){if(!1===(y=Wr(n,n._pos,"ascii",this,r)))return;if(!1===(m=Wr(n,n._pos,"ascii",this,r)))return;s.extensions[y]?s.extensions[y].push(m):s.extensions[y]=[m]}this.emit("ready")}else{if(!1===(o=qr(n,0,this,r)))return;var w,b,S,B;if(a){var I,A,T=Yr[f];if(g("DEBUG[SFTP]: Parser: Request: "+T),Gr(this,T)){if(f===Yr.OPEN){if(!1===(w=Wr(n,4,"utf8",this,r)))return;var k=qr(n,n._pos,this,r);if(!1===k)return;if(!1===(b=cn(n,n._pos+4,this,r)))return;this.emit(T,o,w,k,b)}else if(f===Yr.CLOSE||f===Yr.FSTAT||f===Yr.READDIR){if(!1===(S=Wr(n,4,this,r)))return;this.emit(T,o,S)}else if(f===Yr.READ){if(!1===(S=Wr(n,4,this,r)))return;if(!1===(I=hn(n,n._pos,this,r)))return;var U=qr(n,n._pos,this,r);if(!1===U)return;this.emit(T,o,S,I,U)}else if(f===Yr.WRITE){if(!1===(S=Wr(n,4,this,r)))return;if(!1===(I=hn(n,n._pos,this,r)))return;if(!1===(B=Wr(n,n._pos,this,r)))return;this.emit(T,o,S,I,B)}else if(f===Yr.LSTAT||f===Yr.STAT||f===Yr.OPENDIR||f===Yr.REMOVE||f===Yr.RMDIR||f===Yr.REALPATH||f===Yr.READLINK){if(!1===(A=Wr(n,4,"utf8",this,r)))return;this.emit(T,o,A)}else if(f===Yr.SETSTAT||f===Yr.MKDIR){if(!1===(A=Wr(n,4,"utf8",this,r)))return;if(!1===(b=cn(n,n._pos,this,r)))return;this.emit(T,o,A,b)}else if(f===Yr.FSETSTAT){if(!1===(S=Wr(n,4,this,r)))return;if(!1===(b=cn(n,n._pos,this,r)))return;this.emit(T,o,S,b)}else if(f===Yr.RENAME||f===Yr.SYMLINK){var R,O;if(!1===(R=Wr(n,4,"utf8",this,r)))return;if(!1===(O=Wr(n,n._pos,"utf8",this,r)))return;f===Yr.SYMLINK&&this._isOpenSSH?this.emit(T,o,O,R):this.emit(T,o,R,O)}}else this.status(o,$r.OP_UNSUPPORTED)}else{var N=d[o],C=N&&N.cb;if(g("DEBUG[SFTP]: Parser: Response: "+Zr[f]),N&&C)if(f===Zr.STATUS){var L=qr(n,4,this,r);if(!1===L)return;var D=Wr(n,8,"utf8",this,r);if(!1===D)return;var x=Wr(n,n._pos,"ascii",this,r);if(!1===x)return;if(L===$r.OK)C();else{var P=new Error(D||$r[L]);P.code=L,P.lang=x,C(P)}}else if(f===Zr.HANDLE){if(!1===(S=Wr(n,4,this,r)))return;C(void 0,S)}else if(f===Zr.DATA)if(N.buffer){var H=qr(n,4,this,r);if(!1===H)return;var M=N.buffer.length;if(H>M&&n.writeUInt32BE(M,4,!0),!1===(B=Wr(n,4,N.buffer,this,r)))return;C(void 0,B,H)}else{if(!1===(B=Wr(n,4,this,r)))return;C(void 0,B)}else if(f===Zr.NAME){var j=qr(n,4,this,r);if(!1===j)return;var G,F=[];n._pos=8;for(var W=0;W<j;++W){if(!1===(w=Wr(n,n._pos,"utf8",this,r)))return;if(!1===(G=Wr(n,n._pos,"utf8",this,r)))return;if(!1===(b=cn(n,n._pos,this,r)))return;F.push({filename:w,longname:G,attrs:b})}C(void 0,F)}else if(f===Zr.ATTRS){if(!1===(b=cn(n,4,this,r)))return;C(void 0,b)}else if(f===Zr.EXTENDED){if(N.extended)switch(N.extended){case"statvfs@openssh.com":case"fstatvfs@openssh.com":var q={f_bsize:void 0,f_frsize:void 0,f_blocks:void 0,f_bfree:void 0,f_bavail:void 0,f_files:void 0,f_ffree:void 0,f_favail:void 0,f_sid:void 0,f_flag:void 0,f_namemax:void 0};if(q.f_bsize=hn(n,4,this,r),!1===q.f_bsize)return;if(q.f_frsize=hn(n,12,this,r),!1===q.f_frsize)return;if(q.f_blocks=hn(n,20,this,r),!1===q.f_blocks)return;if(q.f_bfree=hn(n,28,this,r),!1===q.f_bfree)return;if(q.f_bavail=hn(n,36,this,r),!1===q.f_bavail)return;if(q.f_files=hn(n,44,this,r),!1===q.f_files)return;if(q.f_ffree=hn(n,52,this,r),!1===q.f_ffree)return;if(q.f_favail=hn(n,60,this,r),!1===q.f_favail)return;if(q.f_sid=hn(n,68,this,r),!1===q.f_sid)return;if(q.f_flag=hn(n,76,this,r),!1===q.f_flag)return;if(q.f_namemax=hn(n,84,this,r),!1===q.f_namemax)return;C(void 0,q)}C()}N&&delete d[o]}}u="packet_header",n=c=void 0}else if("bad_pkt"===u){if(a&&n[4]!==Yr.INIT){var K=n[4]===Yr.EXTENDED?$r.OP_UNSUPPORTED:$r.FAILURE;if(n[4]===Yr.INIT||n[4]===Zr.VERSION)return this._cleanup(r);if(!1===(o=qr(n,5,this,r)))return;this.status(o,K)}h=n.readUInt32BE(0,!0)-5,u="discard"}}if(_>=v)break}s.status=u,s.pktType=f,s.pktBuf=c,s.pktLeft=h,s.version=l,r()},an.prototype.createReadStream=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");return new En(this,e,t)},an.prototype.createWriteStream=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");return new wn(this,e,t)},an.prototype.open=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=this._state;"function"==typeof r&&(n=r,r=void 0);var o=_n(t);if(null===o)throw new Error("Unknown flags string: "+t);var s=0,a=0;"object"==typeof r&&(s=(r=ln(r)).flags,a=r.nbytes,r=r.bytes);var u=Buffer.byteLength(e),f=9,c=new Buffer(13+u+4+4+a);c.writeUInt32BE(c.length-4,0,!0),c[4]=Yr.OPEN;var h=i.writeReqid=(i.writeReqid+1)%en;if(c.writeUInt32BE(h,5,!0),c.writeUInt32BE(u,f,!0),c.write(e,f+=4,u,"utf8"),c.writeUInt32BE(o,f+=u,!0),c.writeUInt32BE(s,f+=4,!0),r&&s){f+=4;for(var l=0,p=r.length;l<p;++l)for(var d=0,g=r[l].length;d<g;++d)c[f++]=r[l][d]}return i.requests[h]={cb:n},this.debug("DEBUG[SFTP]: Outgoing: Writing OPEN"),this.push(c)},an.prototype.close=function(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");var r=this._state,n=e.length,i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.CLOSE;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),e.copy(o,i+=4),r.requests[s]={cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing CLOSE"),this.push(o)},an.prototype.readData=function(e,t,r,n,i,o){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+n>t.length)throw new Error("length extends beyond buffer");if(null===i)throw new Error("null position currently unsupported");var s=this._state,a=e.length,u=9,f=i,c=new Buffer(13+a+8+4);c.writeUInt32BE(c.length-4,0,!0),c[4]=Yr.READ;var h=s.writeReqid=(s.writeReqid+1)%en;c.writeUInt32BE(h,5,!0),c.writeUInt32BE(a,u,!0),e.copy(c,u+=4),u+=a;for(var l=7;l>=0;--l)c[u+l]=255&f,f/=256;return c.writeUInt32BE(n,u+=8,!0),s.requests[h]={cb:function(e,t,r){if(e&&e.code!==$r.EOF)return o(e);o(void 0,r||0,t,i)},buffer:t.slice(r,r+n)},this.debug("DEBUG[SFTP]: Outgoing: Writing READ"),this.push(c)},an.prototype.writeData=function(e,t,r,n,i,o){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+n>t.length)throw new Error("length extends beyond buffer");if(null===i)throw new Error("null position currently unsupported");var s=this,a=this._state;if(n){var u=n>a.maxDataLen?n-a.maxDataLen:0,f=i;u&&(n=a.maxDataLen);var c=e.length,h=9,l=new Buffer(13+c+8+4+n);l.writeUInt32BE(l.length-4,0,!0),l[4]=Yr.WRITE;var p=a.writeReqid=(a.writeReqid+1)%en;l.writeUInt32BE(p,5,!0),l.writeUInt32BE(c,h,!0),e.copy(l,h+=4),h+=c;for(var d=7;d>=0;--d)l[h+d]=255&i,i/=256;return l.writeUInt32BE(n,h+=8,!0),t.copy(l,h+=4,r,r+n),a.requests[p]={cb:function(i){i?o&&o(i):u?s.writeData(e,t,r+n,u,f+n,o):o&&o(void 0,n)}},this.debug("DEBUG[SFTP]: Outgoing: Writing WRITE"),this.push(l)}o&&process.nextTick((function(){o(void 0,0)}))},an.prototype.fastGet=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");un(this,Fr,e,t,r,n)},an.prototype.fastPut=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");un(Fr,this,e,t,r,n)},an.prototype.readFile=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n="function"==typeof r?r:void 0,i=this;if("function"!=typeof t&&t)if("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"};else t={encoding:null,flag:"r"};var o,s,a,u=t.encoding;if(u&&!Buffer.isEncoding(u))throw new Error("Unknown encoding: "+u);var f,c=0,h=0,l=t.flag||"r";function p(){0===o?(s=new Buffer(8192),i.readData(f,s,0,8192,h,d)):i.readData(f,s,c,o-c,h,d)}function d(e,t){return e?i.close(f,(function(){return n&&n(e)})):0===t?g():(h+=t,c+=t,void(0!==o?c===o?g():p():(a.push(s.slice(0,t)),p())))}function g(){i.close(f,(function(e){return 0===o?s=Buffer.concat(a,c):c<o&&(s=s.slice(0,c)),u&&(s=s.toString(u)),n&&n(e,s)}))}this.open(e,l,438,(function(t,r){if(t)return n&&n(t);f=r,i.fstat(f,(function t(r,u){if(r)i.stat(e,(function(e,o){if(e)return i.close(f,(function(){n&&n(r)}));t(null,o)}));else{if(0===(o=u.size))return a=[],p();s=new Buffer(o),p()}}))}))},an.prototype.writeFile=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i="function"==typeof n?n:void 0,o=this;if("function"!=typeof r&&r)if("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"};else i=r,r={encoding:"utf8",mode:438,flag:"w"};if(r.encoding&&!Buffer.isEncoding(r.encoding))throw new Error("Unknown encoding: "+r.encoding);var s=r.flag||"w";this.open(e,s,r.mode,(function(n,a){if(n)i&&i(n);else{var u=Buffer.isBuffer(t)?t:new Buffer(""+t,r.encoding||"utf8"),f=/a/.test(s)?null:0;if(null===f)return void o.fstat(a,(function t(r,n){r?o.stat(e,(function(e,n){if(e)return o.close(a,(function(){i&&i(r)}));t(null,n)})):fn(o,a,u,0,u.length,n.size,i)}));fn(o,a,u,0,u.length,f,i)}}))},an.prototype.appendFile=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");if("function"!=typeof r&&r)if("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"};else r={encoding:"utf8",mode:438,flag:"a"};r.flag||(r=Hr._extend({flag:"a"},r)),this.writeFile(e,t,r,n)},an.prototype.exists=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");this.stat(e,(function(e){t&&t(!e)}))},an.prototype.unlink=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=this._state,n=Buffer.byteLength(e),i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.REMOVE;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing REMOVE"),this.push(o)},an.prototype.rename=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=this._state,i=Buffer.byteLength(e),o=Buffer.byteLength(t),s=9,a=new Buffer(13+i+4+o);a.writeUInt32BE(a.length-4,0,!0),a[4]=Yr.RENAME;var u=n.writeReqid=(n.writeReqid+1)%en;return a.writeUInt32BE(u,5,!0),a.writeUInt32BE(i,s,!0),a.write(e,s+=4,i,"utf8"),a.writeUInt32BE(o,s+=i,!0),a.write(t,s+=4,o,"utf8"),n.requests[u]={cb:r},this.debug("DEBUG[SFTP]: Outgoing: Writing RENAME"),this.push(a)},an.prototype.mkdir=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=0,i=0,o=this._state;"function"==typeof t&&(r=t,t=void 0),"object"==typeof t&&(n=(t=ln(t)).flags,i=t.nbytes,t=t.bytes);var s=Buffer.byteLength(e),a=9,u=new Buffer(13+s+4+i);u.writeUInt32BE(u.length-4,0,!0),u[4]=Yr.MKDIR;var f=o.writeReqid=(o.writeReqid+1)%en;if(u.writeUInt32BE(f,5,!0),u.writeUInt32BE(s,a,!0),u.write(e,a+=4,s,"utf8"),u.writeUInt32BE(n,a+=s),n){a+=4;for(var c=0,h=t.length;c<h;++c)for(var l=0,p=t[c].length;l<p;++l)u[a++]=t[c][l]}return o.requests[f]={cb:r},this.debug("DEBUG[SFTP]: Outgoing: Writing MKDIR"),this.push(u)},an.prototype.rmdir=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=this._state,n=Buffer.byteLength(e),i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.RMDIR;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing RMDIR"),this.push(o)},an.prototype.readdir=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n,i=this._state;if("function"==typeof t&&(r=t,t={}),"object"!=typeof t&&(t={}),n=!t||!t.full,!Buffer.isBuffer(e)&&"string"!=typeof e)throw new Error("missing directory handle or path");if("string"==typeof e){var o=this,s=[],a=0;return this.opendir(e,(function e(n,i){if(n)return r(n);o.readdir(i,t,(function(t,n){var u=t&&t.code===$r.EOF;if(t&&!u)return o.close(i,(function(){r(t)}));if(u)return o.close(i,(function(e){if(e)return r(e);r(void 0,s)}));for(var f=0,c=n.length;f<c;++f,++a)s[a]=n[f];e(void 0,i)}))}))}var u=e.length,f=9,c=new Buffer(13+u);c.writeUInt32BE(c.length-4,0,!0),c[4]=Yr.READDIR;var h=i.writeReqid=(i.writeReqid+1)%en;return c.writeUInt32BE(h,5,!0),c.writeUInt32BE(u,f,!0),e.copy(c,f+=4),i.requests[h]={cb:n?function(e,t){if(e)return r(e);for(var n=t.length-1;n>=0;--n)"."!==t[n].filename&&".."!==t[n].filename||t.splice(n,1);r(void 0,t)}:r},this.debug("DEBUG[SFTP]: Outgoing: Writing READDIR"),this.push(c)},an.prototype.fstat=function(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");var r=this._state,n=e.length,i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.FSTAT;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),e.copy(o,i+=4),r.requests[s]={cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing FSTAT"),this.push(o)},an.prototype.stat=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=this._state,n=Buffer.byteLength(e),i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.STAT;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing STAT"),this.push(o)},an.prototype.lstat=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=this._state,n=Buffer.byteLength(e),i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.LSTAT;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing LSTAT"),this.push(o)},an.prototype.opendir=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=this._state,n=Buffer.byteLength(e),i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.OPENDIR;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing OPENDIR"),this.push(o)},an.prototype.setstat=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=0,i=0,o=this._state;"object"==typeof t?(n=(t=ln(t)).flags,i=t.nbytes,t=t.bytes):"function"==typeof t&&(r=t);var s=Buffer.byteLength(e),a=9,u=new Buffer(13+s+4+i);u.writeUInt32BE(u.length-4,0,!0),u[4]=Yr.SETSTAT;var f=o.writeReqid=(o.writeReqid+1)%en;if(u.writeUInt32BE(f,5,!0),u.writeUInt32BE(s,a,!0),u.write(e,a+=4,s,"utf8"),u.writeUInt32BE(n,a+=s),n){a+=4;for(var c=0,h=t.length;c<h;++c)for(var l=0,p=t[c].length;l<p;++l)u[a++]=t[c][l]}return o.requests[f]={cb:r},this.debug("DEBUG[SFTP]: Outgoing: Writing SETSTAT"),this.push(u)},an.prototype.fsetstat=function(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");var n=0,i=0,o=this._state;"object"==typeof t?(n=(t=ln(t)).flags,i=t.nbytes,t=t.bytes):"function"==typeof t&&(r=t);var s=e.length,a=9,u=new Buffer(13+s+4+i);u.writeUInt32BE(u.length-4,0,!0),u[4]=Yr.FSETSTAT;var f=o.writeReqid=(o.writeReqid+1)%en;if(u.writeUInt32BE(f,5,!0),u.writeUInt32BE(s,a,!0),e.copy(u,a+=4),u.writeUInt32BE(n,a+=s),n){a+=4;for(var c=0,h=t.length;c<h;++c)for(var l=0,p=t[c].length;l<p;++l)u[a++]=t[c][l]}return o.requests[f]={cb:r},this.debug("DEBUG[SFTP]: Outgoing: Writing FSETSTAT"),this.push(u)},an.prototype.futimes=function(e,t,r,n){return this.fsetstat(e,{atime:pn(t),mtime:pn(r)},n)},an.prototype.utimes=function(e,t,r,n){return this.setstat(e,{atime:pn(t),mtime:pn(r)},n)},an.prototype.fchown=function(e,t,r,n){return this.fsetstat(e,{uid:t,gid:r},n)},an.prototype.chown=function(e,t,r,n){return this.setstat(e,{uid:t,gid:r},n)},an.prototype.fchmod=function(e,t,r){return this.fsetstat(e,{mode:t},r)},an.prototype.chmod=function(e,t,r){return this.setstat(e,{mode:t},r)},an.prototype.readlink=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=this._state,n=Buffer.byteLength(e),i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.READLINK;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={cb:function(e,r){return e?t(e):r&&r.length?void t(void 0,r[0].filename):t(new Error("Response missing link info"))}},this.debug("DEBUG[SFTP]: Outgoing: Writing READLINK"),this.push(o)},an.prototype.symlink=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=this._state,i=Buffer.byteLength(t),o=Buffer.byteLength(e),s=9,a=new Buffer(13+i+4+o);a.writeUInt32BE(a.length-4,0,!0),a[4]=Yr.SYMLINK;var u=n.writeReqid=(n.writeReqid+1)%en;return a.writeUInt32BE(u,5,!0),this._isOpenSSH?(a.writeUInt32BE(o,s,!0),a.write(e,s+=4,o,"utf8"),a.writeUInt32BE(i,s+=o,!0),a.write(t,s+=4,i,"utf8")):(a.writeUInt32BE(i,s,!0),a.write(t,s+=4,i,"utf8"),a.writeUInt32BE(o,s+=i,!0),a.write(e,s+=4,o,"utf8")),n.requests[u]={cb:r},this.debug("DEBUG[SFTP]: Outgoing: Writing SYMLINK"),this.push(a)},an.prototype.realpath=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=this._state,n=Buffer.byteLength(e),i=9,o=new Buffer(13+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.REALPATH;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(n,i,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={cb:function(e,r){return e?t(e):r&&r.length?void t(void 0,r[0].filename):t(new Error("Response missing path info"))}},this.debug("DEBUG[SFTP]: Outgoing: Writing REALPATH"),this.push(o)},an.prototype.ext_openssh_rename=function(e,t,r){var n=this._state;if(this.server)throw new Error("Client-only method called in server mode");if(!n.extensions["posix-rename@openssh.com"]||-1===n.extensions["posix-rename@openssh.com"].indexOf("1"))throw new Error("Server does not support this extended request");var i=Buffer.byteLength(e),o=Buffer.byteLength(t),s=9,a=new Buffer(41+i+4+o);a.writeUInt32BE(a.length-4,0,!0),a[4]=Yr.EXTENDED;var u=n.writeReqid=(n.writeReqid+1)%en;return a.writeUInt32BE(u,5,!0),a.writeUInt32BE(24,s,!0),a.write("posix-rename@openssh.com",s+=4,24,"ascii"),a.writeUInt32BE(i,s+=24,!0),a.write(e,s+=4,i,"utf8"),a.writeUInt32BE(o,s+=i,!0),a.write(t,s+=4,o,"utf8"),n.requests[u]={cb:r},this.debug("DEBUG[SFTP]: Outgoing: Writing posix-rename@openssh.com"),this.push(a)},an.prototype.ext_openssh_statvfs=function(e,t){var r=this._state;if(this.server)throw new Error("Client-only method called in server mode");if(!r.extensions["statvfs@openssh.com"]||-1===r.extensions["statvfs@openssh.com"].indexOf("2"))throw new Error("Server does not support this extended request");var n=Buffer.byteLength(e),i=9,o=new Buffer(36+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.EXTENDED;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(19,i,!0),o.write("statvfs@openssh.com",i+=4,19,"ascii"),o.writeUInt32BE(n,i+=19,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={extended:"statvfs@openssh.com",cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing statvfs@openssh.com"),this.push(o)},an.prototype.ext_openssh_fstatvfs=function(e,t){var r=this._state;if(this.server)throw new Error("Client-only method called in server mode");if(!r.extensions["fstatvfs@openssh.com"]||-1===r.extensions["fstatvfs@openssh.com"].indexOf("2"))throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");var n=e.length,i=9,o=new Buffer(37+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.EXTENDED;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(20,i,!0),o.write("fstatvfs@openssh.com",i+=4,20,"ascii"),o.writeUInt32BE(n,i+=20,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={extended:"fstatvfs@openssh.com",cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing fstatvfs@openssh.com"),this.push(o)},an.prototype.ext_openssh_hardlink=function(e,t,r){var n=this._state;if(this.server)throw new Error("Client-only method called in server mode");if(!n.extensions["hardlink@openssh.com"]||-1===n.extensions["hardlink@openssh.com"].indexOf("1"))throw new Error("Server does not support this extended request");var i=Buffer.byteLength(e),o=Buffer.byteLength(t),s=9,a=new Buffer(37+i+4+o);a.writeUInt32BE(a.length-4,0,!0),a[4]=Yr.EXTENDED;var u=n.writeReqid=(n.writeReqid+1)%en;return a.writeUInt32BE(u,5,!0),a.writeUInt32BE(20,s,!0),a.write("hardlink@openssh.com",s+=4,20,"ascii"),a.writeUInt32BE(i,s+=20,!0),a.write(e,s+=4,i,"utf8"),a.writeUInt32BE(o,s+=i,!0),a.write(t,s+=4,o,"utf8"),n.requests[u]={cb:r},this.debug("DEBUG[SFTP]: Outgoing: Writing hardlink@openssh.com"),this.push(a)},an.prototype.ext_openssh_fsync=function(e,t){var r=this._state;if(this.server)throw new Error("Client-only method called in server mode");if(!r.extensions["fsync@openssh.com"]||-1===r.extensions["fsync@openssh.com"].indexOf("1"))throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");var n=e.length,i=9,o=new Buffer(34+n);o.writeUInt32BE(o.length-4,0,!0),o[4]=Yr.EXTENDED;var s=r.writeReqid=(r.writeReqid+1)%en;return o.writeUInt32BE(s,5,!0),o.writeUInt32BE(17,i,!0),o.write("fsync@openssh.com",i+=4,17,"ascii"),o.writeUInt32BE(n,i+=17,!0),o.write(e,i+=4,n,"utf8"),r.requests[s]={cb:t},this.debug("DEBUG[SFTP]: Outgoing: Writing fsync@openssh.com"),this.push(o)},an.prototype.status=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");if(!$r[t]||"number"!=typeof t)throw new Error("Bad status code: "+t);r||(r=""),n||(n="");var i=Buffer.byteLength(r),o=Buffer.byteLength(n),s=new Buffer(17+i+4+o);return s.writeUInt32BE(s.length-4,0,!0),s[4]=Zr.STATUS,s.writeUInt32BE(e,5,!0),s.writeUInt32BE(t,9,!0),s.writeUInt32BE(i,13,!0),i&&s.write(r,17,i,"utf8"),s.writeUInt32BE(o,17+i,!0),o&&s.write(n,17+i+4,o,"ascii"),this.debug("DEBUG[SFTP]: Outgoing: Writing STATUS"),this.push(s)},an.prototype.handle=function(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");var r=t.length;if(r>256)throw new Error("handle too large (> 256 bytes)");var n=new Buffer(13+r);return n.writeUInt32BE(n.length-4,0,!0),n[4]=Zr.HANDLE,n.writeUInt32BE(e,5,!0),n.writeUInt32BE(r,9,!0),r&&t.copy(n,13),this.debug("DEBUG[SFTP]: Outgoing: Writing HANDLE"),this.push(n)},an.prototype.data=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");var n=Buffer.isBuffer(t);if(!n&&"string"!=typeof t)throw new Error("data is not a Buffer or string");n||r||(r="utf8");var i=n?t.length:Buffer.byteLength(t,r),o=new Buffer(13+i);return o.writeUInt32BE(o.length-4,0,!0),o[4]=Zr.DATA,o.writeUInt32BE(e,5,!0),o.writeUInt32BE(i,9,!0),i&&(n?t.copy(o,13):o.write(t,13,i,r)),this.debug("DEBUG[SFTP]: Outgoing: Writing DATA"),this.push(o)},an.prototype.name=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");if(Array.isArray(t)||"object"!=typeof t){if(!Array.isArray(t))throw new Error("names is not an object or array")}else t=[t];var r,n,i,o,s,a,u,f,c,h,l,p,d=t.length,g=0,v=[];for(h=0;h<d;++h)i=(n=t[h])&&n.filename&&"string"==typeof n.filename?n.filename:"",g+=4+Buffer.byteLength(i),o=n&&n.longname&&"string"==typeof n.longname?n.longname:"",g+=4+Buffer.byteLength(o),"object"==typeof n.attrs?(g+=4+(r=ln(n.attrs)).nbytes,v.push(r)):v.push(null);for((f=new Buffer(13+g)).writeUInt32BE(f.length-4,0,!0),f[4]=Zr.NAME,f.writeUInt32BE(e,5,!0),f.writeUInt32BE(d,9,!0),c=13,h=0;h<d;++h)if(i=(n=t[h])&&n.filename&&"string"==typeof n.filename?n.filename:"",a=Buffer.byteLength(i),f.writeUInt32BE(a,c,!0),c+=4,a&&(f.write(i,c,a,"utf8"),c+=a),o=n&&n.longname&&"string"==typeof n.longname?n.longname:"",a=Buffer.byteLength(o),f.writeUInt32BE(a,c,!0),c+=4,a&&(f.write(o,c,a,"utf8"),c+=a),s=v[h]){if(f.writeUInt32BE(s.flags,c,!0),c+=4,s.flags&&s.bytes){var _=s.bytes;for(l=0,a=_.length;l<a;++l)for(p=0,u=_[l].length;p<u;++p)f[c++]=_[l][p]}}else f.writeUInt32BE(0,c,!0),c+=4;return this.debug("DEBUG[SFTP]: Outgoing: Writing NAME"),this.push(f)},an.prototype.attrs=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");if("object"!=typeof t)throw new Error("attrs is not an object");var r=ln(t),n=new Buffer(13+r.nbytes),i=13;if(n.writeUInt32BE(n.length-4,0,!0),n[4]=Zr.ATTRS,n.writeUInt32BE(e,5,!0),n.writeUInt32BE(r.flags,9,!0),r.flags&&r.bytes)for(var o=r.bytes,s=0,a=o.length;s<a;++s)for(var u=0,f=o[s].length;u<f;++u)n[i++]=o[s][u];return this.debug("DEBUG[SFTP]: Outgoing: Writing ATTRS"),this.push(n)};var gn={r:Jr.READ,"r+":Jr.READ|Jr.WRITE,w:Jr.TRUNC|Jr.CREAT|Jr.WRITE,wx:Jr.TRUNC|Jr.CREAT|Jr.WRITE|Jr.EXCL,xw:Jr.TRUNC|Jr.CREAT|Jr.WRITE|Jr.EXCL,"w+":Jr.TRUNC|Jr.CREAT|Jr.READ|Jr.WRITE,"wx+":Jr.TRUNC|Jr.CREAT|Jr.READ|Jr.WRITE|Jr.EXCL,"xw+":Jr.TRUNC|Jr.CREAT|Jr.READ|Jr.WRITE|Jr.EXCL,a:Jr.APPEND|Jr.CREAT|Jr.WRITE,ax:Jr.APPEND|Jr.CREAT|Jr.WRITE|Jr.EXCL,xa:Jr.APPEND|Jr.CREAT|Jr.WRITE|Jr.EXCL,"a+":Jr.APPEND|Jr.CREAT|Jr.READ|Jr.WRITE,"ax+":Jr.APPEND|Jr.CREAT|Jr.READ|Jr.WRITE|Jr.EXCL,"xa+":Jr.APPEND|Jr.CREAT|Jr.READ|Jr.WRITE|Jr.EXCL},vn=Object.keys(gn);function _n(e){var t=gn[e];return void 0!==t?t:null}function yn(e){this.mode=e&&e.mode,this.permissions=this.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}an.stringToFlags=_n,an.flagsToString=function(e){for(var t=0;t<vn.length;++t){var r=vn[t];if(gn[r]===e)return r}return null},yn.prototype._checkModeProperty=function(e){return(this.mode&Pr.S_IFMT)===e},yn.prototype.isDirectory=function(){return this._checkModeProperty(Pr.S_IFDIR)},yn.prototype.isFile=function(){return this._checkModeProperty(Pr.S_IFREG)},yn.prototype.isBlockDevice=function(){return this._checkModeProperty(Pr.S_IFBLK)},yn.prototype.isCharacterDevice=function(){return this._checkModeProperty(Pr.S_IFCHR)},yn.prototype.isSymbolicLink=function(){return this._checkModeProperty(Pr.S_IFLNK)},yn.prototype.isFIFO=function(){return this._checkModeProperty(Pr.S_IFIFO)},yn.prototype.isSocket=function(){return this._checkModeProperty(Pr.S_IFSOCK)},an.Stats=yn;var mn;function En(e,t,r){if(!(this instanceof En))return new En(e,t,r);var n=this;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),Dr.call(this,r),this.path=t,this.handle=void 0===r.handle?null:r.handle,this.flags=void 0===r.flags?"r":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=void 0===r.start?void 0:r.start,this.end=void 0===r.end?void 0:r.end,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=0,this.sftp=e,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw new TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.on("end",(function(){n.autoClose&&n.destroy()})),Buffer.isBuffer(this.handle)||this.open()}function wn(e,t,r){if(!(this instanceof wn))return new wn(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(xr.call(this,r),this.path=t,this.handle=void 0===r.handle?null:r.handle,this.flags=void 0===r.flags?"w":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=void 0===r.start?void 0:r.start,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=0,this.bytesWritten=0,this.sftp=e,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),Buffer.isBuffer(this.handle)||this.open(),this.once("finish",(function(){this.autoClose&&this.close()}))}Mr(En,Dr),En.prototype.open=function(){var e=this;this.sftp.open(this.path,this.flags,this.mode,(function(t,r){if(t)return e.emit("error",t),this.destroyed=this.closed=!0,void e.emit("close");e.handle=r,e.emit("open",r),e.read()}))},En.prototype._read=function(e){if(!Buffer.isBuffer(this.handle))return this.once("open",(function(){this._read(e)}));if(!this.destroyed){var t;(!mn||mn.length-mn.used<128)&&(mn=null,t=this._readableState.highWaterMark,(mn=new Buffer(t)).used=0);var r=mn,n=Math.min(mn.length-mn.used,e),i=mn.used;if(void 0!==this.end&&(n=Math.min(this.end-this.pos+1,n)),n<=0)return this.push(null);var o=this;this.sftp.readData(this.handle,mn,mn.used,n,this.pos,(function(e,t){if(e)o.autoClose&&o.destroy(),o.emit("error",e);else{var n=null;t>0&&(n=r.slice(i,i+t)),o.push(n)}})),this.pos+=n,mn.used+=n}},En.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,Buffer.isBuffer(this.handle)&&this.close())},En.prototype.close=function(e){var t=this;if(e&&this.once("close",e),this.closed||!Buffer.isBuffer(this.handle))return Buffer.isBuffer(this.handle)?process.nextTick(this.emit.bind(this,"close")):void this.once("open",r);function r(e){t.sftp.close(e||t.handle,(function(e){e?t.emit("error",e):t.emit("close")})),t.handle=null}this.closed=!0,r()},Mr(wn,xr),wn.prototype.open=function(){var e=this;this.sftp.open(this.path,this.flags,this.mode,(function(t,r){if(t)return e.emit("error",t),void(this.autoClose&&(this.destroyed=this.closed=!0,e.emit("close")));e.handle=r,"a"!==e.flags[0]?e.emit("open",r):e.sftp.fstat(r,(function t(n,i){n?e.sftp.stat(e.path,(function(r,i){if(r)return e.destroy(),void e.emit("error",n);t(null,i)})):(e.pos=i.size,e.emit("open",r))}))}))},wn.prototype._write=function(e,t,r){if(!Buffer.isBuffer(e))return this.emit("error",new Error("Invalid data"));if(!Buffer.isBuffer(this.handle))return this.once("open",(function(){this._write(e,t,r)}));var n=this;this.sftp.writeData(this.handle,e,0,e.length,this.pos,(function(e,t){if(e)return n.autoClose&&n.destroy(),r(e);n.bytesWritten+=t,r()})),this.pos+=e.length},wn.prototype._writev=function(e,t){if(!Buffer.isBuffer(this.handle))return this.once("open",(function(){this._writev(e,t)}));for(var r=this.sftp,n=this.handle,i=e.length,o=this,s=0;s<e.length;++s){var a=e[s].chunk;r.writeData(n,a,0,a.length,this.pos,u),this.pos+=a.length}function u(e,r){if(e)return o.destroy(),t(e);o.bytesWritten+=r,0==--i&&t()}},wn.prototype.destroy=En.prototype.destroy,wn.prototype.close=En.prototype.close,wn.prototype.destroySoon=wn.prototype.end;var bn=an,Sn=v.EventEmitter;function Bn(e,t,r,n,i){for(var o=0;o<i;++o,++t,++n)if(e[t]!==r[n])return!1;return!0}function In(e){"string"==typeof e&&(e=new Buffer(e));var t,r,n=e.length;for(this.maxMatches=1/0,this.matches=0,this._occ=new Array(256),this._lookbehind_size=0,this._needle=e,this._bufpos=0,this._lookbehind=new Buffer(n),r=0;r<256;++r)this._occ[r]=n;if(n>=1)for(t=0;t<n-1;++t)this._occ[e[t]]=n-1-t}(0,y.inherits)(In,Sn),In.prototype.reset=function(){this._lookbehind_size=0,this.matches=0,this._bufpos=0},In.prototype.push=function(e,t){var r,n;for(Buffer.isBuffer(e)||(e=new Buffer(e,"binary")),n=e.length,this._bufpos=t||0;r!==n&&this.matches<this.maxMatches;)r=this._sbmh_feed(e);return r},In.prototype._sbmh_feed=function(e){var t=e.length,r=this._needle,n=r.length,i=-this._lookbehind_size,o=r[n-1],s=this._occ,a=this._lookbehind;if(i<0){for(;i<0&&i<=t-n;){if((f=this._sbmh_lookup_char(e,i+n-1))===o&&this._sbmh_memcmp(e,i,n-1))return this._lookbehind_size=0,++this.matches,i>-this._lookbehind_size?this.emit("info",!0,a,0,this._lookbehind_size+i):this.emit("info",!0),this._bufpos=i+n,i+n;i+=s[f]}if(i<0)for(;i<0&&!this._sbmh_memcmp(e,i,t-i);)i++;if(!(i>=0)){var u=this._lookbehind_size+i;return u>0&&this.emit("info",!1,a,0,u),a.copy(a,0,u,this._lookbehind_size-u),this._lookbehind_size-=u,e.copy(a,this._lookbehind_size),this._lookbehind_size+=t,this._bufpos=t,t}this.emit("info",!1,a,0,this._lookbehind_size),this._lookbehind_size=0}for(i>=0&&(i+=this._bufpos);i<=t-n;){var f;if((f=e[i+n-1])===o&&e[i]===r[0]&&Bn(r,0,e,i,n-1))return++this.matches,i>0?this.emit("info",!0,e,this._bufpos,i):this.emit("info",!0),this._bufpos=i+n,i+n;i+=s[f]}if(i<t){for(;i<t&&(e[i]!==r[0]||!Bn(e,i,r,0,t-i));)++i;i<t&&(e.copy(a,0,i,i+(t-i)),this._lookbehind_size=t-i)}return i>0&&this.emit("info",!1,e,this._bufpos,i<t?i:t),this._bufpos=t,t},In.prototype._sbmh_lookup_char=function(e,t){return t<0?this._lookbehind[this._lookbehind_size+t]:e[t]},In.prototype._sbmh_memcmp=function(e,t,r){for(var n=0;n<r;){if(this._sbmh_lookup_char(e,t+n)!==this._needle[n])return!1;++n}return!0};var An=In,Tn="0.0.23",kn=m,Un=B,Rn=b.Transform,On=y.inherits,Nn=y.inspect,Cn=An,Ln=Pt.Ber,Dn=hr,xn=Cr(),Pn=xn.isStreamCipher,Hn=xn.isGCM,Mn=xn.iv_inc,jn=xn.parseKey,Gn=xn.decryptKey,Fn=xn.genPublicKey,Wn=xn.readString,qn=xn.readInt,Kn=Dn.MESSAGE,zn=Dn.ALGORITHMS,Vn=Dn.DISCONNECT_REASON,Xn=Dn.CHANNEL_OPEN_FAILURE,Qn=Dn.SSH_TO_OPENSSL,$n=Dn.TERMINAL_MODE,Yn=Dn.SIGNALS,Zn=Dn.BUGS,Jn=Dn.BUGGY_IMPLS,ei=Jn.length,ti=Tn,ri=0,ni=ri++,ii=ri++,oi=ri++,si=ri++,ai=ri++,ui=ri++,fi=ri++,ci=ri++,hi=ri++,li=ri++,pi=ri++,di=4294967295,gi=/^group|gex-sha1$/i,vi=/\x00/g,_i=new Buffer("SSH-"),yi=new Buffer(0),mi=new Buffer([Kn.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]),Ei=new Buffer([Kn.NEWKEYS]),wi=new Buffer([Kn.USERAUTH_SUCCESS]),bi=new Buffer([Kn.REQUEST_SUCCESS]),Si=new Buffer([Kn.REQUEST_FAILURE]),Bi=new Buffer([$n.TTY_OP_END]),Ii=new Buffer([Kn.KEXDH_GEX_REQUEST,0,0,4,0,0,0,10,0,0,0,20,0]);function Ai(e){}function Ti(e){var t,r;"object"!=typeof e&&(e={}),Rn.call(this,{highWaterMark:"number"==typeof e.highWaterMark?e.highWaterMark:32768}),this._needContinue=!1,this.bytesSent=this.bytesReceived=0,this.debug="function"==typeof e.debug?e.debug:Ai,this.server=!0===e.server,this.doCompress=!1,this.maxPacketSize="number"==typeof e.maxPacketSize?e.maxPacketSize:35e3,this.remoteBugs=0,this.server&&(this.remoteBugs=Zn.BAD_DHGEX);var n=this;if(this.server&&"string"!=typeof e.privateKey&&!Buffer.isBuffer(e.privateKey))throw new Error("Invalid/missing privateKey");if(this.server){if((t=jn(e.privateKey))instanceof Error)throw new Error("Cannot parse privateKey: "+t.message);if(!t.private)throw new Error("privateKey value does not contain a (valid) private key");if(t.encryption){if("string"!=typeof e.passphrase)throw new Error("Encrypted private key detected, but no passphrase given");Gn(t,e.passphrase)}r=Fn(t)}if(this.config={privateKey:t,publicKey:r,ident:"SSH-2.0-"+(e.ident||"ssh2js"+ti+(this.server?"srv":""))},this.config.ident.replace(vi,""),this.config.ident.length+2>255)throw new Error("ident too long");this.reset(!0),this.on("header",(function(e){var t=e.identRaw,r=e.versions.software;n.debug("DEBUG: Remote ident: "+Nn(t));for(var i,o=0;o<ei;++o)"string"==typeof(i=Jn[o])[0]?r===i[0]&&(n.remoteBugs|=i[1]):i[0].test(r)&&(n.remoteBugs|=i[1]);n._state.incoming.identRaw=t,Li(n)})),this.on("end",(function(){n._state=void 0,n.reset(),n._state.incoming.hmac.bufCompute=void 0,n._state.outgoing.bufSeqno=void 0})),this.on("DISCONNECT",(function(e,t,r,i){!function(e,t,r,n,i){if(r!==Vn.BY_APPLICATION){var o=new Error(n||t);o.code=r,e.emit("error",o)}e.reset()}(n,e,t,r)})),this.on("KEXINIT",(function(e){!function(e,t){var r=e._state,n=r.outgoing;n.status===li&&(e.debug("DEBUG: Received re-key request"),n.status=pi,n.kexinit=void 0,Li(e));!0===function(e,t){var r,n,i,o,s,a=e._state,u=a.incoming,f=a.outgoing,c=e.debug;c("DEBUG: Comparing KEXINITs ...");var h=zn.KEX;if(e.remoteBugs&Zn.BAD_DHGEX&&~h.toString().indexOf("group-exchange"))for(var l=(h=h.slice()).length-1;l>=0;--l)~h[l].indexOf("group-exchange")&&h.splice(l,1);c("DEBUG: (local) KEX algorithms: "+h),c("DEBUG: (remote) KEX algorithms: "+t.algorithms.kex),e.server?(r=h,n=t.algorithms.kex):(r=t.algorithms.kex,n=h);for(s=0,o=n.length;s<o&&-1===r.indexOf(n[s]);++s);if(s===o)return c("DEBUG: No matching KEX algorithm"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),!1;var p=n[s];c("DEBUG: KEX algorithm: "+p),c("DEBUG: (local) Host key formats: "+zn.SERVER_HOST_KEY),c("DEBUG: (remote) Host key formats: "+t.algorithms.srvHostKey),e.server?(r=zn.SERVER_HOST_KEY,n=t.algorithms.srvHostKey):(r=t.algorithms.srvHostKey,n=zn.SERVER_HOST_KEY);for(s=0,o=n.length;s<o&&-1===r.indexOf(n[s]);++s);if(s===o)return c("DEBUG: No matching host key format"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),!1;a.hostkeyFormat=n[s],c("DEBUG: Host key format: "+a.hostkeyFormat),c("DEBUG: (local) Client->Server ciphers: "+zn.CIPHER),c("DEBUG: (remote) Client->Server ciphers: "+t.algorithms.cs.encrypt),e.server?(r=zn.CIPHER,n=t.algorithms.cs.encrypt):(r=t.algorithms.cs.encrypt,n=zn.CIPHER);for(s=0,o=n.length;s<o&&-1===r.indexOf(n[s]);++s);if(s===o)return c("DEBUG: No matching Client->Server cipher"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),!1;i=e.server?u.decrypt.type=n[s]:f.encrypt.type=n[s];c("DEBUG: Client->Server Cipher: "+i),c("DEBUG: (local) Server->Client ciphers: "+zn.CIPHER),c("DEBUG: (remote) Server->Client ciphers: "+t.algorithms.sc.encrypt),e.server?(r=zn.CIPHER,n=t.algorithms.sc.encrypt):(r=t.algorithms.sc.encrypt,n=zn.CIPHER);for(s=0,o=n.length;s<o&&-1===r.indexOf(n[s]);++s);if(s===o)return c("DEBUG: No matching Server->Client cipher"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),!1;i=e.server?f.encrypt.type=n[s]:u.decrypt.type=n[s];c("DEBUG: Server->Client Cipher: "+i),c("DEBUG: (local) Client->Server HMAC algorithms: "+zn.HMAC),c("DEBUG: (remote) Client->Server HMAC algorithms: "+t.algorithms.cs.mac),e.server?(r=zn.HMAC,n=t.algorithms.cs.mac):(r=t.algorithms.cs.mac,n=zn.HMAC);for(s=0,o=n.length;s<o&&-1===r.indexOf(n[s]);++s);if(s===o)return c("DEBUG: No matching Client->Server HMAC algorithm"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),!1;i=e.server?u.hmac.type=n[s]:f.hmac.type=n[s];c("DEBUG: Client->Server HMAC algorithm: "+i),c("DEBUG: (local) Server->Client HMAC algorithms: "+zn.HMAC),c("DEBUG: (remote) Server->Client HMAC algorithms: "+t.algorithms.sc.mac),e.server?(r=zn.HMAC,n=t.algorithms.sc.mac):(r=t.algorithms.sc.mac,n=zn.HMAC);for(s=0,o=n.length;s<o&&-1===r.indexOf(n[s]);++s);if(s===o)return c("DEBUG: No matching Server->Client HMAC algorithm"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),!1;i=e.server?f.hmac.type=n[s]:u.hmac.type=n[s];c("DEBUG: Server->Client HMAC algorithm: "+i);var d=zn.COMPRESS;if(e.doCompress&&"none"!==d.slice(-1)){var g=d.indexOf("none");~g&&((d=d.slice()).splice(g,1),d.push("none"))}c("DEBUG: (local) Client->Server compression algorithms: "+d),c("DEBUG: (remote) Client->Server compression algorithms: "+t.algorithms.cs.compress),e.server?(r=d,n=t.algorithms.cs.compress):(r=t.algorithms.cs.compress,n=d);for(s=0,o=n.length;s<o&&-1===r.indexOf(n[s]);++s);if(s===o)return c("DEBUG: No matching Client->Server compression algorithm"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),!1;i=e.server?u.decompress.type=n[s]:f.compress.type=n[s];c("DEBUG: Client->Server compression algorithm: "+i),c("DEBUG: (local) Server->Client compression algorithms: "+d),c("DEBUG: (remote) Server->Client compression algorithms: "+t.algorithms.sc.compress),e.server?(r=d,n=t.algorithms.sc.compress):(r=t.algorithms.sc.compress,n=d);for(s=0,o=n.length;s<o&&-1===r.indexOf(n[s]);++s);if(s===o)return c("DEBUG: No matching Server->Client compression algorithm"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),!1;i=e.server?f.compress.type=n[s]:u.decompress.type=n[s];c("DEBUG: Server->Client compression algorithm: "+i),a.kex="diffie-hellman-group1-sha1"===p?kn.getDiffieHellman("modp2"):"diffie-hellman-group14-sha1"===p?kn.getDiffieHellman("modp14"):void 0;if(a.kex){a.kexdh="group",f.pubkey=new Buffer(a.kex.generateKeys("binary"),"binary");var v=0;for(o=f.pubkey.length;0===f.pubkey[v];)++v,--o;if(128&f.pubkey[v]){var _=new Buffer(o+1);_[0]=0,f.pubkey.copy(_,1,v),f.pubkey=_}}else"diffie-hellman-group-exchange-sha1"===p?a.kexdh="gex-sha1":"diffie-hellman-group-exchange-sha256"===p&&(a.kexdh="gex-sha256");return!0}(e,t)&&(e.server?"group"!==r.kexdh?r.incoming.expectedPacket="KEXDH_GEX_REQ":r.incoming.expectedPacket="KEXDH_INIT":"group"!==r.kexdh?function(e){e._state.incoming.expectedPacket="KEXDH_GEX_GROUP",e.debug("DEBUG: Outgoing: Writing KEXDH_GEX_REQUEST"),xi(e,Ii,void 0,!0)}(e):Di(e))}(n,e)})),this.on("NEWKEYS",(function(){!function(e){var t=e._state,r=t.outgoing,n=t.incoming,i=0,o=r.kexsecret.length;for(;0===r.kexsecret[i];)++i,--o;var s,a,u=8,f=0,c=0,h=gi.test(t.kexdh)?"sha1":"sha256",l=(128&r.kexsecret[i]?1:0)+o,p=new Buffer(4+l);p.writeUInt32BE(l,c,!0),c+=4,128&r.kexsecret[i]&&(p[c++]=0);if(r.kexsecret.copy(p,c,i),r.kexsecret=void 0,Pn(r.encrypt.type))r.encrypt.size=u,s=yi;else{switch(s=new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(e.server?"B":"A","ascii").update(r.sessionId).digest("binary"),"binary"),r.encrypt.type){case"aes128-gcm":case"aes256-gcm":case"aes128-gcm@openssh.com":case"aes256-gcm@openssh.com":u=12;break;case"aes256-cbc":case"aes192-cbc":case"aes128-cbc":case"aes256-ctr":case"aes192-ctr":case"aes128-ctr":u=16}for(r.encrypt.size=u;u>s.length;)s=Buffer.concat([s,new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(s).digest("binary"),"binary")]);s=s.slice(0,u)}switch(r.encrypt.type){case"aes256-gcm":case"aes256-gcm@openssh.com":case"aes256-cbc":case"aes256-ctr":case"arcfour256":f=32;break;case"3des-cbc":case"3des-ctr":case"aes192-cbc":case"aes192-ctr":f=24;break;case"aes128-gcm":case"aes128-gcm@openssh.com":case"aes128-cbc":case"aes128-ctr":case"cast128-cbc":case"blowfish-cbc":case"arcfour":case"arcfour128":f=16}a=new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(e.server?"D":"C","ascii").update(r.sessionId).digest("binary"),"binary");for(;f>a.length;)a=Buffer.concat([a,new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(a).digest("binary"),"binary")]);if(a=a.slice(0,f),Hn(r.encrypt.type))r.encrypt.size=16,r.encrypt.iv=s,r.encrypt.key=a,r.encrypt.instance=!0;else{var d=Qn[r.encrypt.type];r.encrypt.instance=kn.createCipheriv(d,a,s),r.encrypt.instance.setAutoPadding(!1)}if(u=8,f=0,Pn(n.decrypt.type))n.decrypt.size=u,s=yi;else{switch(s=new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(e.server?"A":"B","ascii").update(r.sessionId).digest("binary"),"binary"),n.decrypt.type){case"aes128-gcm":case"aes256-gcm":case"aes128-gcm@openssh.com":case"aes256-gcm@openssh.com":u=12;break;case"aes256-cbc":case"aes192-cbc":case"aes128-cbc":case"aes256-ctr":case"aes192-ctr":case"aes128-ctr":u=16}for(Hn(n.decrypt.type)?n.decrypt.size=16:n.decrypt.size=u;u>s.length;)s=Buffer.concat([s,new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(s).digest("binary"),"binary")]);s=s.slice(0,u)}switch(n.decrypt.buf=new Buffer(n.decrypt.size),n.decrypt.type){case"aes256-gcm":case"aes256-gcm@openssh.com":case"aes256-cbc":case"aes256-ctr":case"arcfour256":f=32;break;case"3des-cbc":case"3des-ctr":case"aes192-cbc":case"aes192-ctr":f=24;break;case"aes128-gcm":case"aes128-gcm@openssh.com":case"aes128-cbc":case"aes128-ctr":case"cast128-cbc":case"blowfish-cbc":case"arcfour":case"arcfour128":f=16}a=new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(e.server?"C":"D","ascii").update(r.sessionId).digest("binary"),"binary");for(;f>a.length;)a=Buffer.concat([a,new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(a).digest("binary"),"binary")]);a=a.slice(0,f);var g,v=Qn[n.decrypt.type];n.decrypt.instance=kn.createDecipheriv(v,a,s),n.decrypt.instance.setAutoPadding(!1),n.decrypt.iv=s,n.decrypt.key=a,"arcfour"===r.encrypt.type.substr(0,7)&&((g=new Buffer(1536)).fill(0),r.encrypt.instance.update(g));"arcfour"===n.decrypt.type.substr(0,7)&&((g=new Buffer(1536)).fill(0),n.decrypt.instance.update(g));var _=0,y=0;switch(r.hmac.type){case"hmac-ripemd160":case"hmac-sha1":_=20,r.hmac.size=20;break;case"hmac-sha1-96":_=20,r.hmac.size=12;break;case"hmac-sha2-256":_=32,r.hmac.size=32;break;case"hmac-sha2-256-96":_=32,r.hmac.size=12;break;case"hmac-sha2-512":_=64,r.hmac.size=64;break;case"hmac-sha2-512-96":_=64,r.hmac.size=12;break;case"hmac-md5":_=16,r.hmac.size=16;break;case"hmac-md5-96":_=16,r.hmac.size=12}switch(n.hmac.type){case"hmac-ripemd160":case"hmac-sha1":y=20,n.hmac.size=20;break;case"hmac-sha1-96":y=20,n.hmac.size=12;break;case"hmac-sha2-256":y=32,n.hmac.size=32;break;case"hmac-sha2-256-96":y=32,n.hmac.size=12;break;case"hmac-sha2-512":y=64,n.hmac.size=64;break;case"hmac-sha2-512-96":y=64,n.hmac.size=12;break;case"hmac-md5":y=16,n.hmac.size=16;break;case"hmac-md5-96":y=16,n.hmac.size=12}if(Hn(r.encrypt.type))r.hmac.key=void 0;else{for(a=new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(e.server?"F":"E","ascii").update(r.sessionId).digest("binary"),"binary");_>a.length;)a=Buffer.concat([a,new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(a).digest("binary"),"binary")]);r.hmac.key=a.slice(0,_)}if(Hn(n.decrypt.type))n.hmac.key=void 0,n.hmac.size=16;else{for(a=new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(e.server?"E":"F","ascii").update(r.sessionId).digest("binary"),"binary");y>a.length;)a=Buffer.concat([a,new Buffer(kn.createHash(h).update(p).update(r.exchangeHash).update(a).digest("binary"),"binary")]);n.hmac.key=a.slice(0,y)}r.exchangeHash=void 0,n.hmac.buf&&n.hmac.buf.length===n.hmac.size||(n.hmac.buf=new Buffer(n.hmac.size));!1!==r.compress.type&&"none"!==r.compress.type&&(r.compress.instance=Un.deflateSync);!1!==n.decompress.type&&"none"!==n.decompress.type&&(n.decompress.instance=Un.inflateSync);if(e.bytesSent=e.bytesReceived=0,r.status===pi){r.status=li,n.expectedPacket=void 0;var m=r.rekeyQueue,E=m.length,w=0;for(r.rekeyQueue=[];w<E;++w)Buffer.isBuffer(m[w])?xi(e,m[w]):xi(e,m[w][0],m[w][1]);E=(m=n.rekeyQueue).length,w=0,n.rekeyQueue=[];for(var b=n.seqno;w<E;++w){if(n.seqno=m[w][0],n.payload=m[w][1],!1===ki(e))return;if(n.status===ni)return}n.seqno=b}else r.status=li,n.expectedPacket=void 0}(n)})),this.server?this.on("KEXDH_INIT",(function(e){!function(e,t){!function(e,t){for(var r=e._state,n=r.outgoing,i=r.incoming,o=e.config.publicKey.public,s=e.config.publicKey.fulltype,a=e.config.privateKey.privateOrig,u=-1,f=0,c=t.length;f<c&&0===t[f];++f)++u;u>-1&&(t=t.slice(u+1));var h,l,p=r.kex.computeSecret(t,"binary","binary"),d=new Buffer(p,"binary"),g=kn.createHash(gi.test(r.kexdh)?"sha1":"sha256"),v=Buffer.byteLength(i.identRaw),_=Buffer.byteLength(e.config.ident),y=i.kexinit.length,m=n.kexinit.length,E=o.length,w=0,b=0,S=0,B=t.length,I=n.pubkey.length,A=d.length,T=0,k=0,U=0,R=0;if("group"!==r.kexdh){for(w=12,h=r.kex.getPrime(),l=r.kex.getGenerator(),b=h.length,S=l.length;0===h[U];)++U,--b;for(;0===l[R];)++R,--S;128&h[U]&&++b,128&l[R]&&++S}for(;0===n.pubkey[T];)++T,--I;for(;0===d[k];)++k,--A;128&t[0]&&++B;128&n.pubkey[T]&&++I;128&d[k]&&++A;var O=0,N=new Buffer(v+_+y+m+E+w+b+S+B+I+A+32+("group"!==r.kexdh?8:0));N.writeUInt32BE(v,O,!0),O+=4,N.write(i.identRaw,O,"utf8"),O+=v,N.writeUInt32BE(_,O,!0),O+=4,N.write(e.config.ident,O,"utf8"),O+=_,N.writeUInt32BE(y,O,!0),O+=4,i.kexinit.copy(N,O),O+=y,i.kexinit=void 0,N.writeUInt32BE(m,O,!0),O+=4,n.kexinit.copy(N,O),O+=m,n.kexinit=void 0,N.writeUInt32BE(E,O,!0),O+=4,o.copy(N,O),O+=E,"group"!==r.kexdh&&(Ii.slice(1).copy(N,O),O+=w,N.writeUInt32BE(b,O,!0),O+=4,128&h[U]&&(N[O++]=0),h.copy(N,O,U),O+=b-(128&h[U]?1:0),N.writeUInt32BE(S,O,!0),O+=4,128&l[R]&&(N[O++]=0),l.copy(N,O,R),O+=S-(128&l[R]?1:0));N.writeUInt32BE(B,O,!0),O+=4,128&t[0]&&(N[O++]=0);t.copy(N,O),O+=B-(128&t[0]?1:0),N.writeUInt32BE(I,O,!0),O+=4,128&n.pubkey[T]&&(N[O++]=0);n.pubkey.copy(N,O,T),O+=I-(128&n.pubkey[T]?1:0),N.writeUInt32BE(A,O,!0),O+=4,128&d[k]&&(N[O++]=0);d.copy(N,O,k),n.exchangeHash=new Buffer(g.update(N).digest("binary"),"binary"),void 0===n.sessionId&&(n.sessionId=n.exchangeHash);n.kexsecret=d;var C,L="ssh-rsa"===s?"RSA":"DSA",D=kn.createSign(L+"-SHA1");if(D.update(n.exchangeHash,"binary"),C=D.sign(a,"binary"),"ssh-dss"===s){var x,P,H,M=new Ln.Reader(new Buffer(C,"binary"));for(M.readSequence(),P=M.readString(Ln.Integer,!0),H=M.readString(Ln.Integer,!0),x=0;P.length-x>20&&0===P[x];)++x;for(x>0&&(P=P.slice(x)),x=0;H.length-x>20&&0===H[x];)++x;x>0&&(H=H.slice(x)),C=P.toString("binary")+H.toString("binary")}var j=4+s.length+4+C.length,G=new Buffer(5+E+4+I+4+j);G[O=0]="group"===r.kexdh?Kn.KEXDH_REPLY:Kn.KEXDH_GEX_REPLY,++O,G.writeUInt32BE(E,O,!0),O+=4,o.copy(G,O),O+=E,G.writeUInt32BE(I,O,!0),O+=4,128&n.pubkey[T]&&(G[O++]=0);n.pubkey.copy(G,O,T),O+=I-(128&n.pubkey[T]?1:0),G.writeUInt32BE(j,O,!0),O+=4,G.writeUInt32BE(s.length,O,!0),O+=4,G.write(s,O,s.length,"ascii"),O+=s.length,G.writeUInt32BE(C.length,O,!0),O+=4,G.write(C,O,C.length,"binary"),r.incoming.expectedPacket="NEWKEYS",e.debug("DEBUG: Outgoing: Writing KEXDH_REPLY"),xi(e,G,void 0,!0),e.debug("DEBUG: Outgoing: Writing NEWKEYS"),xi(e,Ei,void 0,!0)}(e,t)}(n,e)})):this.on("KEXDH_REPLY",(function(e){!function(e,t,r){var n,i,o=e._state,s=o.incoming,a=o.outgoing,u=e.debug;u("DEBUG: Checking host key format");var f=Wn(t.hostkey,0,"ascii",e,r);if(!1===f)return!1;if(t.hostkey_format!==o.hostkeyFormat||t.hostkey_format!==f)return u("DEBUG: Host key format mismatch"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),e.reset(),!1;u("DEBUG: Checking signature format");var c=Wn(t.sig,0,"ascii",e,r);if(!1===c)return!1;if(t.sig_format!==c)return u("DEBUG: Signature format mismatch"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),e.reset(),!1;if(a.status===hi){var h;if(u("DEBUG: Verifying host fingerprint"),e.emit("fingerprint",t.hostkey,(function(e){void 0===h&&(h=e)})),void 0===h)u("DEBUG: Host accepted by default (no verification)");else{if(!0!==h)return u("DEBUG: Host denied via fingerprint verification"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),e.reset(),e.emit("error",new Error("Host fingerprint verification failed")),!1;u("DEBUG: Host accepted (verified)")}}var l=-1;for(i=0,n=t.pubkey.length;i<n&&0===t.pubkey[i];++i)++l;l>-1&&(t.pubkey=t.pubkey.slice(l+1));var p=o.kex.computeSecret(t.pubkey,"binary","binary");t.secret=new Buffer(p,"binary");var d,g,v=kn.createHash(gi.test(o.kexdh)?"sha1":"sha256"),_=Buffer.byteLength(e.config.ident),y=Buffer.byteLength(s.identRaw),m=a.kexinit.length,E=s.kexinit.length,w=t.hostkey.length,b=0,S=0,B=0,I=a.pubkey.length,A=t.pubkey.length,T=t.secret.length,k=0,U=0,R=0,O=0,N=0;if("group"!==o.kexdh){for(b=12,d=o.kex.getPrime(),g=o.kex.getGenerator(),S=d.length,B=g.length;0===d[O];)++O,--S;for(;0===g[N];)++N,--B;128&d[O]&&++S,128&g[N]&&++B}for(;0===a.pubkey[k];)++k,--I;for(;0===t.pubkey[U];)++U,--A;for(;0===t.secret[R];)++R,--T;128&a.pubkey[k]&&++I;128&t.pubkey[U]&&++A;128&t.secret[R]&&++T;var C=0,L=new Buffer(_+y+m+E+w+b+S+B+I+A+T+32+("group"!==o.kexdh?8:0));L.writeUInt32BE(_,C,!0),C+=4,L.write(e.config.ident,C,"utf8"),C+=_,L.writeUInt32BE(y,C,!0),C+=4,L.write(s.identRaw,C,"utf8"),C+=y,L.writeUInt32BE(m,C,!0),C+=4,a.kexinit.copy(L,C),C+=m,a.kexinit=void 0,L.writeUInt32BE(E,C,!0),C+=4,s.kexinit.copy(L,C),C+=E,s.kexinit=void 0,L.writeUInt32BE(w,C,!0),C+=4,t.hostkey.copy(L,C),C+=w,"group"!==o.kexdh&&(Ii.slice(1).copy(L,C),C+=b,L.writeUInt32BE(S,C,!0),C+=4,128&d[O]&&(L[C++]=0),d.copy(L,C,O),C+=S-(128&d[O]?1:0),L.writeUInt32BE(B,C,!0),C+=4,128&g[N]&&(L[C++]=0),g.copy(L,C,N),C+=B-(128&g[N]?1:0));L.writeUInt32BE(I,C,!0),C+=4,128&a.pubkey[k]&&(L[C++]=0);a.pubkey.copy(L,C,k),C+=I-(128&a.pubkey[k]?1:0),L.writeUInt32BE(A,C,!0),C+=4,128&t.pubkey[U]&&(L[C++]=0);t.pubkey.copy(L,C,U),C+=A-(128&t.pubkey[U]?1:0),L.writeUInt32BE(T,C,!0),C+=4,128&t.secret[R]&&(L[C++]=0);t.secret.copy(L,C,R),a.exchangeHash=new Buffer(v.update(L).digest("binary"),"binary");var D=new Ln.Writer,x=Wn(t.sig,t.sig._pos,e,r);if(!1===x)return!1;var P="ssh-rsa"===t.sig_format?"RSA":"DSA",H=kn.createVerify(P+"-SHA1");if(H.update(a.exchangeHash,"binary"),D.startSequence(),"RSA"===P){var M=Wn(t.hostkey,t.hostkey._pos,e,r);if(!1===M)return!1;var j=Wn(t.hostkey,t.hostkey._pos,e,r);if(!1===j)return!1;D.startSequence(),D.writeOID("1.2.840.113549.1.1.1"),D.writeNull(),D.endSequence(),D.startSequence(Ln.BitString),D.writeByte(0),D.startSequence(),D.writeBuffer(j,Ln.Integer),D.writeBuffer(M,Ln.Integer),D.endSequence(),D.endSequence()}else{var G=Wn(t.hostkey,t.hostkey._pos,e,r);if(!1===G)return!1;var F=Wn(t.hostkey,t.hostkey._pos,e,r);if(!1===F)return!1;var W=Wn(t.hostkey,t.hostkey._pos,e,r);if(!1===W)return!1;var q=Wn(t.hostkey,t.hostkey._pos,e,r);if(!1===q)return!1;if(D.startSequence(),D.writeOID("1.2.840.10040.4.1"),D.startSequence(),D.writeBuffer(G,Ln.Integer),D.writeBuffer(F,Ln.Integer),D.writeBuffer(W,Ln.Integer),D.endSequence(),D.endSequence(),D.startSequence(Ln.BitString),D.writeByte(0),D.writeBuffer(q,Ln.Integer),D.endSequence(),x.length<=40){var K=new Ln.Writer;K.startSequence();var z=x.slice(0,20),V=x.slice(20);if(128&z[0]){var X=new Buffer(21);X[0]=0,z.copy(X,1),z=X}if(128&V[0]){var Q=new Buffer(21);Q[0]=0,V.copy(Q,1),V=Q}K.writeBuffer(z,Ln.Integer),K.writeBuffer(V,Ln.Integer),K.endSequence(),x=K.buffer}}D.endSequence(),u("DEBUG: Verifying signature");var $=D.buffer.toString("base64").replace(/(.{64})/g,"$1\n"),Y="-----BEGIN PUBLIC KEY-----\n"+$+("\n"===$[$.length-1]?"":"\n")+"-----END PUBLIC KEY-----";if(!H.verify(Y,x,"binary"))return u("DEBUG: Signature could not be verified"),e.disconnect(Vn.KEY_EXCHANGE_FAILED),e.reset(),!1;void 0===a.sessionId&&(a.sessionId=a.exchangeHash);a.kexsecret=t.secret,u("DEBUG: Outgoing: Writing NEWKEYS"),a.status===pi?xi(e,Ei,void 0,!0):xi(e,Ei)}(n,e)})).on("KEXDH_GEX_GROUP",(function(e,t){!function(e,t,r){var n=e._state,i=n.outgoing;n.kex=kn.createDiffieHellman(t,r),i.pubkey=new Buffer(n.kex.generateKeys("binary"),"binary");var o=0,s=i.pubkey.length;for(;0===i.pubkey[o];)++o,--s;if(128&i.pubkey[o]){var a=new Buffer(s+1);a[0]=0,i.pubkey.copy(a,1,o),i.pubkey=a}Di(e)}(n,e,t)})),this.server&&"string"==typeof e.banner&&("\r\n"===e.banner.slice(-2)?this.push(e.banner):this.push(e.banner+"\r\n")),this.debug("DEBUG: Local ident: "+Nn(this.config.ident)),this.push(this.config.ident+"\r\n"),this._state.incoming.expectedPacket="KEXINIT"}function ki(e,t){var r,n,i,o,s,a,u,f,c,h,l,p,d,g,v=e._state.incoming,_=e._state.outgoing,y=v.payload,m=v.seqno;++v.seqno>di&&(v.seqno=0);var E=y[0];if(void 0===E)return!1;if(_.status!==li&&Kn[E]!==v.expectedPacket&&E<1&&E>4)return e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, expected: "+v.expectedPacket+" but got: "+Kn[E]),e.disconnect(Vn.PROTOCOL_ERROR),!1;if(E===Kn.CHANNEL_DATA){if(!1===(s=qn(y,1,e,t)))return!1;if(!1===(a=Wn(y,5,e,t,32768)))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_DATA ("+s+")"),e.emit("CHANNEL_DATA:"+s,a)}else if(E===Kn.CHANNEL_EXTENDED_DATA){if(!1===(s=qn(y,1,e,t)))return!1;var w=qn(y,5,e,t);if(!1===w)return!1;if(!1===(a=Wn(y,9,e,t)))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_EXTENDED_DATA ("+s+")"),e.emit("CHANNEL_EXTENDED_DATA:"+s,w,a)}else if(E===Kn.CHANNEL_WINDOW_ADJUST){if(!1===(s=qn(y,1,e,t)))return!1;var b=qn(y,5,e,t);if(!1===b)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_WINDOW_ADJUST ("+s+", "+b+")"),e.emit("CHANNEL_WINDOW_ADJUST:"+s,b)}else if(E===Kn.CHANNEL_SUCCESS){if(!1===(s=qn(y,1,e,t)))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_SUCCESS ("+s+")"),e.emit("CHANNEL_SUCCESS:"+s)}else if(E===Kn.CHANNEL_FAILURE){if(!1===(s=qn(y,1,e,t)))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_FAILURE ("+s+")"),e.emit("CHANNEL_FAILURE:"+s)}else if(E===Kn.CHANNEL_EOF){if(!1===(s=qn(y,1,e,t)))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_EOF ("+s+")"),e.emit("CHANNEL_EOF:"+s)}else if(E===Kn.CHANNEL_OPEN){var S,B=Wn(y,1,"ascii",e,t);if(!1===B)return!1;if(!1===(c=qn(y,y._pos,e,t)))return!1;if(!1===(h=qn(y,y._pos+=4,e,t)))return!1;if(!1===(l=qn(y,y._pos+=4,e,t)))return!1;if(e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_OPEN ("+c+", "+B+")"),"forwarded-tcpip"===B||"direct-tcpip"===B){var I=Wn(y,y._pos+=4,"ascii",e,t);if(!1===I)return!1;var A=qn(y,y._pos,e,t);if(!1===A)return!1;if(!1===(u=Wn(y,y._pos+=4,"ascii",e,t)))return!1;if(!1===(f=qn(y,y._pos,e,t)))return!1;S={type:B,sender:c,window:h,packetSize:l,data:{destIP:I,destPort:A,srcIP:u,srcPort:f}}}else if("forwarded-streamlocal@openssh.com"===B||"direct-streamlocal@openssh.com"===B){if(!1===(g=Wn(y,y._pos+=4,"utf8",e,t)))return!1;S={type:B,sender:c,window:h,packetSize:l,data:{socketPath:g}}}else if("x11"===B){if(!1===(u=Wn(y,y._pos+=4,"ascii",e,t)))return!1;if(!1===(f=qn(y,y._pos,e,t)))return!1;S={type:B,sender:c,window:h,packetSize:l,data:{srcIP:u,srcPort:f}}}else S={type:B,sender:c,window:h,packetSize:l,data:{}};e.emit("CHANNEL_OPEN",S)}else if(E===Kn.CHANNEL_OPEN_CONFIRMATION){if(!1===(p=qn(y,1,e,t)))return!1;if(!1===(c=qn(y,5,e,t)))return!1;if(!1===(h=qn(y,9,e,t)))return!1;if(!1===(l=qn(y,13,e,t)))return!1;o={recipient:p,sender:c,window:h,packetSize:l},y.length>17&&(o.data=y.slice(17)),e.emit("CHANNEL_OPEN_CONFIRMATION:"+o.recipient,o)}else if(E===Kn.CHANNEL_OPEN_FAILURE){if(!1===(p=qn(y,1,e,t)))return!1;var T=qn(y,5,e,t);if(!1===T)return!1;if(!1===(d=Wn(y,9,"utf8",e,t)))return!1;if(!1===(n=Wn(y,y._pos,"utf8",e,t)))return!1;y._pos=9,o={recipient:p,reasonCode:T,reason:Xn[T],description:d,lang:n},e.emit("CHANNEL_OPEN_FAILURE:"+o.recipient,o)}else if(E===Kn.CHANNEL_CLOSE){if(!1===(s=qn(y,1,e,t)))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_CLOSE ("+s+")"),e.emit("CHANNEL_CLOSE:"+s)}else if(E===Kn.IGNORE);else if(E===Kn.DISCONNECT){var k=qn(y,1,e,t);if(!1===k)return!1;var U=Vn[k];if(!1===(d=Wn(y,5,"utf8",e,t)))return!1;n=Wn(y,y._pos,"ascii",e,t),e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: DISCONNECT ("+U+")"),e.emit("DISCONNECT",U,k,d,n)}else if(E===Kn.DEBUG){if(!1===(i=Wn(y,2,"utf8",e,t)))return!1;if(!1===(n=Wn(y,y._pos,"ascii",e,t)))return!1;e.emit("DEBUG",i,n)}else if(E===Kn.NEWKEYS)e.emit("NEWKEYS");else if(E===Kn.SERVICE_REQUEST){if(!1===(r=Wn(y,1,"ascii",e,t)))return!1;e.emit("SERVICE_REQUEST",r)}else if(E===Kn.SERVICE_ACCEPT){if(!1===(r=Wn(y,1,"ascii",e,t)))return!1;e.emit("SERVICE_ACCEPT",r)}else if(E===Kn.USERAUTH_REQUEST){var R=Wn(y,1,"utf8",e,t);if(!1===R)return!1;var O=Wn(y,y._pos,"ascii",e,t);if(!1===O)return!1;var N,C=Wn(y,y._pos,"ascii",e,t);if(!1===C)return!1;if("password"===C){if(!1===(N=Wn(y,y._pos+1,"utf8",e,t)))return!1}else if("publickey"===C||"hostbased"===C){var L,D,x,P,H,M,j;if("publickey"===C){if(void 0===(L=y[y._pos++]))return!1;L=0!==L}if(!1===(D=Wn(y,y._pos,"ascii",e,t)))return!1;if(!1===(x=Wn(y,y._pos,e,t)))return!1;if(L||"hostbased"===C){if("hostbased"===C){if(!1===(M=Wn(y,y._pos,"ascii",e,t)))return!1;if(!1===(j=Wn(y,y._pos,"utf8",e,t)))return!1}var G=y._pos;if(!1===(P=Wn(y,G,e,t)))return!1;if(P.toString("ascii",4,11)===D&&(P=P.slice(15)),"ssh-dss"===D&&P.length<=40){var F=new Ln.Writer;F.startSequence();var W=P.slice(0,20),q=P.slice(20);if(128&W[0]){var K=new Buffer(21);K[0]=0,W.copy(K,1),W=K}if(128&q[0]){var z=new Buffer(21);z[0]=0,q.copy(z,1),q=z}F.writeBuffer(W,Ln.Integer),F.writeBuffer(q,Ln.Integer),F.endSequence(),P=F.buffer}(H=new Buffer(4+_.sessionId.length+G)).writeUInt32BE(_.sessionId.length,0,!0),_.sessionId.copy(H,4),y.copy(H,4+_.sessionId.length,0,G)}N={keyAlgo:D,key:x,signature:P,blob:H,localHostname:M,localUsername:j}}else if("keyboard-interactive"===C){var V=qn(y,y._pos,e,t);if(!1===V)return!1;if(!1===(N=Wn(y,y._pos+4+V,"utf8",e,t)))return!1}else"none"!==C&&(N=y.slice(y._pos));e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_REQUEST ("+C+")"),e.emit("USERAUTH_REQUEST",R,O,C,N)}else if(E===Kn.USERAUTH_SUCCESS)e.emit("USERAUTH_SUCCESS");else if(E===Kn.USERAUTH_FAILURE){var X=Wn(y,1,"ascii",e,t);if(!1===X)return!1;var Q=y[y._pos];if(void 0===Q)return!1;Q=0!==Q,X=X.split(","),e.emit("USERAUTH_FAILURE",X,Q)}else if(E===Kn.USERAUTH_BANNER){if(!1===(i=Wn(y,1,"utf8",e,t)))return!1;if(!1===(n=Wn(y,y._pos,"utf8",e,t)))return!1;e.emit("USERAUTH_BANNER",i,n)}else if(E===Kn.GLOBAL_REQUEST){var $=Wn(y,1,"ascii",e,t);if(!1===$)return!1;var Y,Z=y[y._pos++];if(void 0===Z)return!1;if(Z=0!==Z,"tcpip-forward"===$||"cancel-tcpip-forward"===$){var J=Wn(y,y._pos,"ascii",e,t);if(!1===J)return!1;var ee=qn(y,y._pos,e,t);if(!1===ee)return!1;Y={bindAddr:J,bindPort:ee}}else if("streamlocal-forward@openssh.com"===$||"cancel-streamlocal-forward@openssh.com"===$){if(!1===(g=Wn(y,y._pos,"utf8",e,t)))return!1;Y={socketPath:g}}else"no-more-sessions@openssh.com"===$||(Y=y.slice(y._pos));e.emit("GLOBAL_REQUEST",$,Z,Y)}else if(E===Kn.REQUEST_SUCCESS)y.length>1?e.emit("REQUEST_SUCCESS",y.slice(1)):e.emit("REQUEST_SUCCESS");else if(E===Kn.REQUEST_FAILURE)e.emit("REQUEST_FAILURE");else if(E===Kn.UNIMPLEMENTED);else{if(E===Kn.KEXINIT)return function(e,t){var r,n=e._state.incoming,i=n.payload,o={algorithms:{kex:void 0,srvHostKey:void 0,cs:{encrypt:void 0,mac:void 0,compress:void 0},sc:{encrypt:void 0,mac:void 0,compress:void 0}},languages:{cs:void 0,sc:void 0}};if(r=Ci(i,17,e,t),!1===r)return!1;if(o.algorithms.kex=r,r=Ci(i,i._pos,e,t),!1===r)return!1;if(o.algorithms.srvHostKey=r,r=Ci(i,i._pos,e,t),!1===r)return!1;if(o.algorithms.cs.encrypt=r,r=Ci(i,i._pos,e,t),!1===r)return!1;if(o.algorithms.sc.encrypt=r,r=Ci(i,i._pos,e,t),!1===r)return!1;if(o.algorithms.cs.mac=r,r=Ci(i,i._pos,e,t),!1===r)return!1;if(o.algorithms.sc.mac=r,r=Ci(i,i._pos,e,t),!1===r)return!1;if(o.algorithms.cs.compress=r,r=Ci(i,i._pos,e,t),!1===r)return!1;if(o.algorithms.sc.compress=r,r=Ci(i,i._pos,e,t),!1===r)return!1;if(o.languages.cs=r,r=Ci(i,i._pos,e,t),!1===r)return!1;o.languages.sc=r,n.kexinit=i,e.emit("KEXINIT",o)}(e,t);if(E===Kn.CHANNEL_REQUEST)return function(e,t){var r,n,i,o,s,a,u,f=e._state.incoming.payload,c=qn(f,1,e,t);if(!1===c)return!1;var h=Wn(f,5,"ascii",e,t);if(!1===h)return!1;if("exit-status"===h){var l=qn(f,++f._pos,e,t);if(!1===l)return!1;r={recipient:c,request:h,wantReply:!1,code:l}}else if("exit-signal"===h){if(!1===(u=Wn(f,++f._pos,"ascii",e,t)))return!1;var p=f[f._pos];if(void 0===p)return!1;p=0!==p;var d=Wn(f,++f._pos,"utf8",e,t);if(!1===d)return!1;var g=Wn(f,f._pos,"utf8",e,t);if(!1===g)return!1;r={recipient:c,request:h,wantReply:!1,signal:u,coredump:p,description:d,lang:g}}else if("pty-req"===h){if(void 0===(a=f[f._pos++]))return!1;a=0!==a;var v=Wn(f,f._pos,"ascii",e,t);if(!1===v)return!1;if(!1===(n=qn(f,f._pos,e,t)))return!1;if(!1===(i=qn(f,f._pos+=4,e,t)))return!1;if(!1===(o=qn(f,f._pos+=4,e,t)))return!1;if(!1===(s=qn(f,f._pos+=4,e,t)))return!1;var _=Wn(f,f._pos+=4,e,t);if(!1===_)return!1;_=function(e){for(var t,r={},n=0,i=e.length;n<i&&!((t=e[n])===$n.TTY_OP_END||void 0===$n[t]||n+5>i);n+=5)r[$n[t]]=e.readUInt32BE(n+1,!0);return r}(_),r={recipient:c,request:h,wantReply:a,term:v,cols:n,rows:i,width:o,height:s,modes:_}}else if("window-change"===h){if(!1===(n=qn(f,++f._pos,e,t)))return!1;if(!1===(i=qn(f,f._pos+=4,e,t)))return!1;if(!1===(o=qn(f,f._pos+=4,e,t)))return!1;if(!1===(s=qn(f,f._pos+=4,e,t)))return!1;r={recipient:c,request:h,wantReply:!1,cols:n,rows:i,width:o,height:s}}else if("x11-req"===h){if(void 0===(a=f[f._pos++]))return!1;a=0!==a;var y=f[f._pos++];if(void 0===y)return!1;y=0!==y;var m=Wn(f,f._pos,"ascii",e,t);if(!1===m)return!1;var E=Wn(f,f._pos,"hex",e,t);if(!1===E)return!1;var w=qn(f,f._pos,e,t);if(!1===w)return!1;r={recipient:c,request:h,wantReply:a,single:y,protocol:m,cookie:E,screen:w}}else if("env"===h){if(void 0===(a=f[f._pos++]))return!1;a=0!==a;var b=Wn(f,f._pos,"utf8",e,t);if(!1===b)return!1;var S=Wn(f,f._pos,"utf8",e,t);if(!1===S)return!1;r={recipient:c,request:h,wantReply:a,key:b,val:S}}else if("shell"===h){if(void 0===(a=f[f._pos]))return!1;r={recipient:c,request:h,wantReply:a=0!==a}}else if("exec"===h){if(void 0===(a=f[f._pos++]))return!1;a=0!==a;var B=Wn(f,f._pos,"utf8",e,t);if(!1===B)return!1;r={recipient:c,request:h,wantReply:a,command:B}}else if("subsystem"===h){if(void 0===(a=f[f._pos++]))return!1;a=0!==a;var I=Wn(f,f._pos,"utf8",e,t);if(!1===I)return!1;r={recipient:c,request:h,wantReply:a,subsystem:I}}else if("signal"===h){if(!1===(u=Wn(f,++f._pos,"ascii",e,t)))return!1;r={recipient:c,request:h,wantReply:!1,signal:"SIG"+u}}else if("xon-xoff"===h){var A=f[++f._pos];if(void 0===A)return!1;r={recipient:c,request:h,wantReply:!1,clientControl:A=0!==A}}else if("auth-agent-req@openssh.com"===h){if(void 0===(a=f[f._pos]))return!1;r={recipient:c,request:h,wantReply:a=0!==a}}else{if(void 0===(a=f[f._pos]))return!1;r={recipient:c,request:h,wantReply:a=0!==a}}e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_REQUEST ("+c+", "+h+")"),e.emit("CHANNEL_REQUEST:"+c,r)}(e,t);if(E>=30&&E<=49)return function(e,t,r){var n=e._state,i=n.incoming,o=i.payload;if("group"!==n.kexdh){if(e.server)return e.disconnect(Vn.PROTOCOL_ERROR),!1;if(t===Kn.KEXDH_GEX_GROUP){var s=Wn(o,1,e,r);if(!1===s)return!1;var a=Wn(o,o._pos,e,r);if(!1===a)return!1;e.emit("KEXDH_GEX_GROUP",s,a)}else if(t===Kn.KEXDH_GEX_REPLY)return Ui(e,r)}else if(t===Kn.KEXDH_INIT){var u=Wn(o,1,e,r);if(!1===u)return!1;e.emit("KEXDH_INIT",u)}else if(t===Kn.KEXDH_REPLY)return Ui(e,r)}(e,E,t);if(E>=60&&E<=70)return function(e,t,r){var n,i,o,s=e._state,a=s.authMethod,u=s.incoming.payload;if("password"===a){if(t===Kn.USERAUTH_PASSWD_CHANGEREQ){if(!1===(n=Wn(u,1,"utf8",e,r)))return!1;if(!1===(i=Wn(u,u._pos,"utf8",e,r)))return!1;e.emit("USERAUTH_PASSWD_CHANGEREQ",n,i)}}else if("keyboard-interactive"===a){if(t===Kn.USERAUTH_INFO_REQUEST){var f,c,h;if(!1===(f=Wn(u,1,"utf8",e,r)))return!1;if(!1===(c=Wn(u,u._pos,"utf8",e,r)))return!1;if(!1===(i=Wn(u,u._pos,"utf8",e,r)))return!1;if(!1===(h=qn(u,u._pos,e,r)))return!1;u._pos+=4;for(var l=[],p=0;p<h;++p){if(!1===(o=Wn(u,u._pos,"utf8",e,r)))return!1;var d=u[u._pos++];if(void 0===d)return!1;d=0!==d,l.push({prompt:o,echo:d})}e.emit("USERAUTH_INFO_REQUEST",f,c,i,l)}else if(t===Kn.USERAUTH_INFO_RESPONSE){var g=qn(u,1,e,r);if(!1===g)return!1;u._pos=5;for(var v=[],_=0;_<g;++_){if(!1===(o=Wn(u,u._pos,"utf8",e,r)))return!1;v.push(o)}e.emit("USERAUTH_INFO_RESPONSE",v)}}else"publickey"===a&&t===Kn.USERAUTH_PK_OK&&e.emit("USERAUTH_PK_OK")}(e,E,t);var te=new Buffer(5);te[0]=Kn.UNIMPLEMENTED,te.writeUInt32BE(m,1,!0),xi(e,te)}}function Ui(e,t){var r=e._state.incoming.payload,n=Wn(r,1,e,t);if(!1===n)return!1;var i=Wn(r,r._pos,e,t);if(!1===i)return!1;var o=Wn(r,r._pos,e,t);if(!1===o)return!1;var s={hostkey:n,hostkey_format:void 0,pubkey:i,sig:o,sig_format:void 0},a=Wn(n,0,"ascii",e,t);if(!1===a)return!1;s.hostkey_format=a;var u=Wn(o,0,"ascii",e,t);if(!1===u)return!1;s.sig_format=u,e.emit("KEXDH_REPLY",s)}function Ri(e,t){var r=e._state.incoming,n=r.hmac;if(e.debug("DEBUG: Parser: Verifying MAC"),Hn(r.decrypt.type)){var i=r.decrypt,o=i.instance;o.setAuthTag(t);var s=new Buffer(o.update(r.packet,"binary","binary"),"binary");return r.payload=s.slice(1,r.packet.length+4-s[0]),o.final("binary"),Mn(i.iv),i.instance=kn.createDecipheriv(Qn[i.type],i.key,i.iv),i.instance.setAutoPadding(!1),!0}var a=kn.createHmac(Qn[n.type],n.key);n.bufCompute.writeUInt32BE(r.seqno,0,!0),n.bufCompute.writeUInt32BE(r.pktLen,4,!0),n.bufCompute[8]=r.padLen,a.update(n.bufCompute),a.update(r.packet);var u=a.digest("binary");return u.length>r.hmac.size&&(u=u.slice(0,r.hmac.size)),u===t.toString("binary")}function Oi(e,t){var r=e._state.incoming.decrypt.instance;return e.debug("DEBUG: Parser: Decrypting"),new Buffer(r.update(t,"binary","binary"),"binary")}function Ni(e,t,r,n){var i=e._state.incoming.expect;i.amount=r,i.type=t,i.ptr=0,n&&e[n]?i.buf=e[n]:r&&(i.buf=new Buffer(r))}function Ci(e,t,r,n){var i=Wn(e,t,"ascii",r,n);return!1!==i&&(i.length?i.split(","):[])}function Li(e){var t,r=function(e){var t=!1;try{t=kn.randomBytes(e)}catch(e){}return t}(16),n=zn.KEX_LIST_SIZE,i=zn.KEX_LIST;if(e.remoteBugs&Zn.BAD_DHGEX&&~i.toString().indexOf("group-exchange")){for(var o=(i=zn.KEX.slice()).length-1;o>=0;--o)~i[o].indexOf("group-exchange")&&i.splice(o,1);n=(i=new Buffer(i.join(","))).length}var s=21+n+4+(t=e.server?e.config.publicKey.fulltype:zn.SERVER_HOST_KEY_LIST).length+2*(4+zn.CIPHER_LIST_SIZE)+2*(4+zn.HMAC_LIST_SIZE)+2*(4+zn.COMPRESS_LIST_SIZE)+8+1+4,a=new Buffer(s),u=17;a.fill(0),a[0]=Kn.KEXINIT,!1!==r&&r.copy(a,1),a.writeUInt32BE(n,u,!0),u+=4,i.copy(a,u),u+=n,a.writeUInt32BE(t.length,u,!0),u+=4,"string"==typeof t?a.write(t,u):t.copy(a,u),u+=t.length,a.writeUInt32BE(zn.CIPHER_LIST_SIZE,u,!0),u+=4,zn.CIPHER_LIST.copy(a,u),u+=zn.CIPHER_LIST_SIZE,a.writeUInt32BE(zn.CIPHER_LIST_SIZE,u,!0),u+=4,zn.CIPHER_LIST.copy(a,u),u+=zn.CIPHER_LIST_SIZE,a.writeUInt32BE(zn.HMAC_LIST_SIZE,u,!0),u+=4,zn.HMAC_LIST.copy(a,u),u+=zn.HMAC_LIST_SIZE,a.writeUInt32BE(zn.HMAC_LIST_SIZE,u,!0),u+=4,zn.HMAC_LIST.copy(a,u),u+=zn.HMAC_LIST_SIZE;var f=zn.COMPRESS_LIST,c=zn.COMPRESS_LIST_SIZE;if(e.doCompress&&"none"!==zn.COMPRESS.slice(-1)){var h=zn.COMPRESS.indexOf("none");~h&&((f=zn.COMPRESS.slice()).splice(h,1),f.push("none"),c=(f=new Buffer(f.join(","))).length)}a.writeUInt32BE(c,u,!0),u+=4,f.copy(a,u),u+=c,a.writeUInt32BE(c,u,!0),u+=4,f.copy(a,u),u+=c,e.debug("DEBUG: Outgoing: Writing KEXINIT"),e._state.incoming.expectedPacket="KEXINIT";var l=e._state.outgoing;return l.kexinit=a,l.status===li&&(l.status=pi),xi(e,a,void 0,!0)}function Di(e){var t=e._state,r=t.outgoing,n=new Buffer(5+r.pubkey.length);return"group"!==t.kexdh?(t.incoming.expectedPacket="KEXDH_GEX_REPLY",n[0]=Kn.KEXDH_GEX_INIT,e.debug("DEBUG: Outgoing: Writing KEXDH_GEX_INIT")):(t.incoming.expectedPacket="KEXDH_REPLY",n[0]=Kn.KEXDH_INIT,e.debug("DEBUG: Outgoing: Writing KEXDH_INIT")),n.writeUInt32BE(r.pubkey.length,1,!0),r.pubkey.copy(n,5),xi(e,n,void 0,!0)}function xi(e,t,r,n){var i=e._state;if(i){var o,s,a,u,f,c=i.outgoing,h=c.encrypt,l=c.hmac,p=c.compress.instance;if(c.status===pi&&!n)return"function"==typeof r?c.rekeyQueue.push([t,r]):c.rekeyQueue.push(t),!1;if(e._readableState.ended||e._writableState.ended)return!1;if(p&&(t=p(t)),o=t.length+9,!1!==h.instance&&Hn(h.type)){for(var d=1+t.length+4;d%h.size!=0;)++d;s=d-1-t.length,o=4+d}else s=(o+=(h.size-1)*o%h.size)-t.length-5;(a=new Buffer(o)).writeUInt32BE(o-4,0,!0),a[4]=s,t.copy(a,5),kn.randomBytes(s).copy(a,5+t.length),!1!==l.type&&l.key&&(u=kn.createHmac(Qn[l.type],l.key),c.bufSeqno.writeUInt32BE(c.seqno,0,!0),u.update(c.bufSeqno),u.update(a),(u=u.digest("binary")).length>c.hmac.size&&(u=u.slice(0,c.hmac.size)),u=new Buffer(u,"binary"));var g,v=0;if(!1!==h.instance)if(Hn(h.type)){var _=kn.createCipheriv(Qn[h.type],h.key,h.iv);_.setAutoPadding(!1);var y=a.slice(0,4);_.setAAD(y),e.push(y),v+=y,g=_.update(a.slice(4),"binary","binary"),e.push(g,"binary"),v+=g.length;var m=_.final("binary");m.length&&(e.push(m,"binary"),v+=m.length);var E=_.getAuthTag();f=e.push(E),v+=E.length,Mn(h.iv)}else g=h.instance.update(a,"binary","binary"),e.push(g,"binary"),v+=g.length,f=e.push(u),v+=u.length;else f=e.push(a),v=a.length;return e.bytesSent+=v,++c.seqno>di&&(c.seqno=0),r&&r(),f}}On(Ti,Rn),Ti.prototype.__read=Rn.prototype._read,Ti.prototype._read=function(e){return this._needContinue&&(this._needContinue=!1,this.emit("continue")),this.__read(e)},Ti.prototype.__push=Rn.prototype.push,Ti.prototype.push=function(e,t){var r=this.__push(e,t);return this._needContinue=!1===r,r},Ti.prototype._cleanup=function(e){this.reset(),this.debug("DEBUG: Parser: Malformed packet"),e&&e(new Error("Malformed packet"))},Ti.prototype._transform=function(e,t,r){var n,i,o,s=!1,a=!1,u=this._state,f=u.incoming,c=u.outgoing,h=f.expect,l=f.decrypt,p=f.decompress,d=e.length,g=0,v=this.debug,_=0,y=_;for(this.bytesReceived+=d;;){if(void 0!==h.type){if(_>=d)break;if(2===h.type){g=d-_;var m=h.buf.length-h.ptr;m<=g?(e.copy(h.buf,h.ptr,_,_+m),_+=m,n=h.buf,h.buf=void 0,h.ptr=0,h.type=void 0):(e.copy(h.buf,h.ptr,_),h.ptr+=g,_+=g);continue}if(0===h.type){if(_+=f.search.push(e),void 0!==h.type)continue}else if(1===h.type){if(4+ ++h.ptr>255)return this.reset(),v("DEBUG: Parser: Identification string exceeded 255 characters"),r(new Error("Max identification string size exceeded"));if(10!==e[_]){++_===d&&y<_&&(void 0===h.buf?h.buf=e.toString("ascii",y,_):h.buf+=e.toString("ascii",y,_));continue}h.type=void 0,y<_&&(void 0===h.buf?h.buf=e.toString("ascii",y,_):h.buf+=e.toString("ascii",y,_)),n=h.buf,h.buf=void 0,++_}}if(f.status===ni)if(this.server)if(n){if(83!==n[0]||83!==n[1]||72!==n[2]||45!==n[3])return this.reset(),v("DEBUG: Parser: Bad identification start"),r(new Error("Bad identification start"));f.status=ii,v("DEBUG: Parser: IN_INIT (waiting for rest of identification)")}else v("DEBUG: Parser: IN_INIT (waiting for identification begin)"),Ni(this,2,4);else{v("DEBUG: Parser: IN_INIT");var E=f.search=new Cn(_i);E.on("info",(function e(t,r,n,i){r&&(void 0===f.greeting?f.greeting=r.toString("binary",n,i):f.greeting+=r.toString("binary",n,i)),t&&(h.type=void 0,f.search.removeListener("info",e))})),E.maxMatches=1,Ni(this,0),f.status=ii}else if(f.status===ii)v("DEBUG: Parser: IN_GREETING"),f.search=void 0,y=_,Ni(this,1),f.status=oi;else if(f.status===oi){v("DEBUG: Parser: IN_HEADER");var w=(n=n.trim()).indexOf("-"),b=n.indexOf(" "),S={greeting:f.greeting,identRaw:"SSH-"+n,versions:{protocol:n.substr(0,w),software:-1===b?n.substring(w+1):n.substring(w+1,b)},comments:b>-1?n.substring(b+1):void 0};if(f.greeting=void 0,"1.99"!==S.versions.protocol&&"2.0"!==S.versions.protocol)return this.reset(),v("DEBUG: Parser: protocol version not supported: "+S.versions.protocol),r(new Error("Protocol version not supported"));if(this.emit("header",S),f.status===ni)return;f.status=si}else if(f.status===si)v("DEBUG: Parser: IN_PACKETBEFORE (expecting "+l.size+")"),Ni(this,2,l.size,l.buf),f.status=ai;else if(f.status===ai){if(v("DEBUG: Parser: IN_PACKET"),a=l.instance&&Hn(l.type),l.instance&&!Hn(l.type)&&(n=Oi(this,n)),!1===(o=qn(n,0,this,r)))return;var B=f.hmac.size||0,I=o+4+B;if(I>this.maxPacketSize||I<16+B||(o+4)%l.size!=0)return this.disconnect(Vn.PROTOCOL_ERROR),v("DEBUG: Parser: Bad packet length ("+I+")"),r(new Error("Bad packet length"));f.pktLen=o;var A=f.pktLen+4-l.size;if(a?(l.instance.setAAD(n.slice(0,4)),v("DEBUG: Parser: pktLen:"+f.pktLen+",remainLen:"+A)):(f.padLen=n[4],v("DEBUG: Parser: pktLen:"+f.pktLen+",padLen:"+f.padLen+",remainLen:"+A)),A>0)f.pktExtra=a?n.slice(4):n.slice(5),Ni(this,2,A),f.status=ui;else{if(!(A<0)){s=!0,f.status=ui;continue}f.status=si}}else if(f.status===ui){v("DEBUG: Parser: IN_PACKETDATA"),a=l.instance&&Hn(l.type),!l.instance||s||a?s&&(s=!1):n=Oi(this,n);var T=f.pktLen-f.padLen-1;f.pktExtra?(i=new Buffer(f.pktExtra.length+n.length),f.pktExtra.copy(i),n.copy(i,f.pktExtra.length),f.payload=i.slice(0,T)):(i=a?n.slice(4):n.slice(5),f.payload=n.slice(5,5+T)),void 0!==f.hmac.size?(v("DEBUG: Parser: HMAC size:"+f.hmac.size),Ni(this,2,f.hmac.size,f.hmac.buf),f.status=fi,f.packet=i):f.status=ci,f.pktExtra=void 0,i=void 0}else if(f.status===fi){if(v("DEBUG: Parser: IN_PACKETDATAVERIFY"),!Ri(this,n))return this.reset(),v("DEBUG: Parser: IN_PACKETDATAVERIFY (Invalid HMAC)"),r(new Error("Invalid HMAC"));v("DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)"),f.status=ci,f.packet=void 0}else if(f.status===ci){p.instance&&(v("DEBUG: Parser: Decompressing"),f.payload=p.instance(f.payload)),this.emit("packet");var k=f.payload[0];if(v!==Ai){var U="DEBUG: Parser: IN_PACKETDATAAFTER, packet: ",R=u.kexdh,O=u.authMethod,N=null;c.status!==pi||k<=4||k>=20&&k<=49||(U+="(enqueued) "),"group"===R&&k===Kn.KEXDH_INIT?N="KEXDH_INIT":"group"===R&&k===Kn.KEXDH_REPLY?N="KEXDH_REPLY":"group"!==R&&k===Kn.KEXDH_GEX_GROUP?N="KEXDH_GEX_GROUP":"group"!==R&&k===Kn.KEXDH_GEX_REPLY?N="KEXDH_GEX_REPLY":60===k?"password"===O?N="USERAUTH_PASSWD_CHANGEREQ":"keyboard-interactive"===O?N="USERAUTH_INFO_REQUEST":"publickey"===O&&(N="USERAUTH_PK_OK"):61===k&&"keyboard-interactive"===O&&(N="USERAUTH_INFO_RESPONSE"),null===N&&(N=Kn[k]),k!==Kn.CHANNEL_OPEN&&k!==Kn.CHANNEL_REQUEST&&k!==Kn.CHANNEL_SUCCESS&&k!==Kn.CHANNEL_FAILURE&&k!==Kn.CHANNEL_EOF&&k!==Kn.CHANNEL_CLOSE&&k!==Kn.CHANNEL_DATA&&k!==Kn.CHANNEL_EXTENDED_DATA&&k!==Kn.CHANNEL_WINDOW_ADJUST&&k!==Kn.DISCONNECT&&k!==Kn.USERAUTH_REQUEST&&v(U+N)}if(c.status===li||k<=4||k>=20&&k<=49){if(!1===ki(this,r))return;if(f.status===ni)return}else if(c.status===pi){if(50===f.rekeyQueue.length)return v("DEBUG: Parser: Max incoming re-key queue length reached"),this.disconnect(Vn.PROTOCOL_ERROR),r(new Error("Incoming re-key queue length limit reached"));var C=f.seqno;++f.seqno>di&&(f.seqno=0),f.rekeyQueue.push([C,f.payload])}f.status=si,f.payload=void 0}void 0!==n&&(n=void 0)}r()},Ti.prototype.reset=function(e){if(this._state){var t=this._state;t.incoming.status=ni,t.outgoing.status=hi}else this._state={authMethod:void 0,hostkeyFormat:void 0,kex:void 0,kexdh:void 0,incoming:{status:ni,expectedPacket:void 0,search:void 0,greeting:void 0,seqno:0,pktLen:void 0,padLen:void 0,pktExtra:void 0,payload:void 0,packet:void 0,kexinit:void 0,identRaw:void 0,rekeyQueue:[],expect:{amount:void 0,type:void 0,ptr:0,buf:void 0},decrypt:{instance:!1,size:8,iv:void 0,key:void 0,buf:void 0,type:void 0},hmac:{size:void 0,key:void 0,buf:void 0,bufCompute:new Buffer(9),type:!1},decompress:{instance:!1,type:!1}},outgoing:{status:hi,seqno:0,bufSeqno:new Buffer(4),rekeyQueue:[],kexinit:void 0,kexsecret:void 0,pubkey:void 0,exchangeHash:void 0,sessionId:void 0,encrypt:{instance:!1,size:8,iv:void 0,key:void 0,type:void 0},hmac:{size:void 0,key:void 0,buf:void 0,type:!1},compress:{instance:!1,type:!1}}};e||this.readable&&this.push(null)},Ti.prototype.disconnect=function(e){var t=new Buffer(13);return t.fill(0),t[0]=Kn.DISCONNECT,void 0===Vn[e]&&(e=Vn.BY_APPLICATION),t.writeUInt32BE(e,1,!0),this.debug("DEBUG: Outgoing: Writing DISCONNECT ("+Vn[e]+")"),xi(this,t),this.reset(),!1},Ti.prototype.ping=function(){return this.debug("DEBUG: Outgoing: Writing ping (GLOBAL_REQUEST: keepalive@openssh.com)"),xi(this,mi)},Ti.prototype.rekey=function(){var e=this._state.outgoing.status;if(e===pi)throw new Error("A re-key is already in progress");if(e!==li)throw new Error("Cannot re-key yet");return this.debug("DEBUG: Outgoing: Starting re-key"),Li(this)},Ti.prototype.requestSuccess=function(e){var t;return Buffer.isBuffer(e)?((t=new Buffer(1+e.length))[0]=Kn.REQUEST_SUCCESS,e.copy(t,1)):t=bi,this.debug("DEBUG: Outgoing: Writing REQUEST_SUCCESS"),xi(this,t)},Ti.prototype.requestFailure=function(){return this.debug("DEBUG: Outgoing: Writing REQUEST_FAILURE"),xi(this,Si)},Ti.prototype.channelSuccess=function(e){var t=new Buffer(5);return t[0]=Kn.CHANNEL_SUCCESS,t.writeUInt32BE(e,1,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_SUCCESS ("+e+")"),xi(this,t)},Ti.prototype.channelFailure=function(e){var t=new Buffer(5);return t[0]=Kn.CHANNEL_FAILURE,t.writeUInt32BE(e,1,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_FAILURE ("+e+")"),xi(this,t)},Ti.prototype.channelEOF=function(e){var t=new Buffer(5);return t[0]=Kn.CHANNEL_EOF,t.writeUInt32BE(e,1,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_EOF ("+e+")"),xi(this,t)},Ti.prototype.channelClose=function(e){var t=new Buffer(5);return t[0]=Kn.CHANNEL_CLOSE,t.writeUInt32BE(e,1,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_CLOSE ("+e+")"),xi(this,t)},Ti.prototype.channelWindowAdjust=function(e,t){var r=new Buffer(9);return r[0]=Kn.CHANNEL_WINDOW_ADJUST,r.writeUInt32BE(e,1,!0),r.writeUInt32BE(t,5,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_WINDOW_ADJUST ("+e+", "+t+")"),xi(this,r)},Ti.prototype.channelData=function(e,t){var r=Buffer.isBuffer(t),n=r?t.length:Buffer.byteLength(t),i=new Buffer(9+n);return i[0]=Kn.CHANNEL_DATA,i.writeUInt32BE(e,1,!0),i.writeUInt32BE(n,5,!0),r?t.copy(i,9):i.write(t,9,n,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_DATA ("+e+")"),xi(this,i)},Ti.prototype.channelExtData=function(e,t,r){var n=Buffer.isBuffer(t),i=n?t.length:Buffer.byteLength(t),o=new Buffer(13+i);return o[0]=Kn.CHANNEL_EXTENDED_DATA,o.writeUInt32BE(e,1,!0),o.writeUInt32BE(r,5,!0),o.writeUInt32BE(i,9,!0),n?t.copy(o,13):o.write(t,13,i,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_EXTENDED_DATA ("+e+")"),xi(this,o)},Ti.prototype.channelOpenConfirm=function(e,t,r,n){var i=new Buffer(17);return i[0]=Kn.CHANNEL_OPEN_CONFIRMATION,i.writeUInt32BE(e,1,!0),i.writeUInt32BE(t,5,!0),i.writeUInt32BE(r,9,!0),i.writeUInt32BE(n,13,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN_CONFIRMATION (r:"+e+", l:"+t+")"),xi(this,i)},Ti.prototype.channelOpenFail=function(e,t,r,n){"string"!=typeof r&&(r=""),"string"!=typeof n&&(n="");var i=Buffer.byteLength(r),o=Buffer.byteLength(n),s=9,a=new Buffer(13+i+4+o);return a[0]=Kn.CHANNEL_OPEN_FAILURE,a.writeUInt32BE(e,1,!0),a.writeUInt32BE(t,5,!0),a.writeUInt32BE(i,s,!0),s+=4,i&&(a.write(r,s,i,"utf8"),s+=i),a.writeUInt32BE(o,s,!0),o&&a.write(n,s+=4,o,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN_FAILURE ("+e+")"),xi(this,a)},Ti.prototype.service=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=new Buffer(5+t);return r[0]=Kn.SERVICE_REQUEST,r.writeUInt32BE(t,1,!0),r.write(e,5,t,"ascii"),this.debug("DEBUG: Outgoing: Writing SERVICE_REQUEST ("+e+")"),xi(this,r)},Ti.prototype.tcpipForward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(e),i=new Buffer(23+n+4);return i[0]=Kn.GLOBAL_REQUEST,i.writeUInt32BE(13,1,!0),i.write("tcpip-forward",5,13,"ascii"),i[18]=void 0===r||!0===r?1:0,i.writeUInt32BE(n,19,!0),i.write(e,23,n,"ascii"),i.writeUInt32BE(t,23+n,!0),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (tcpip-forward)"),xi(this,i)},Ti.prototype.cancelTcpipForward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(e),i=new Buffer(30+n+4);return i[0]=Kn.GLOBAL_REQUEST,i.writeUInt32BE(20,1,!0),i.write("cancel-tcpip-forward",5,20,"ascii"),i[25]=void 0===r||!0===r?1:0,i.writeUInt32BE(n,26,!0),i.write(e,30,n,"ascii"),i.writeUInt32BE(t,30+n,!0),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (cancel-tcpip-forward)"),xi(this,i)},Ti.prototype.openssh_streamLocalForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(r),n=new Buffer(41+r);return n[0]=Kn.GLOBAL_REQUEST,n.writeUInt32BE(31,1,!0),n.write("streamlocal-forward@openssh.com",5,31,"ascii"),n[36]=void 0===t||!0===t?1:0,n.writeUInt32BE(r,37,!0),n.write(e,41,r,"utf8"),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),xi(this,n)},Ti.prototype.openssh_cancelStreamLocalForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(r),n=new Buffer(48+r);return n[0]=Kn.GLOBAL_REQUEST,n.writeUInt32BE(38,1,!0),n.write("cancel-streamlocal-forward@openssh.com",5,38,"ascii"),n[43]=void 0===t||!0===t?1:0,n.writeUInt32BE(r,44,!0),n.write(e,48,r,"utf8"),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)"),xi(this,n)},Ti.prototype.directTcpip=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(n.srcIP),o=Buffer.byteLength(n.dstIP),s=29,a=new Buffer(33+i+4+4+o+4);return a[0]=Kn.CHANNEL_OPEN,a.writeUInt32BE(12,1,!0),a.write("direct-tcpip",5,12,"ascii"),a.writeUInt32BE(e,17,!0),a.writeUInt32BE(t,21,!0),a.writeUInt32BE(r,25,!0),a.writeUInt32BE(o,s,!0),a.write(n.dstIP,s+=4,o,"ascii"),a.writeUInt32BE(n.dstPort,s+=o,!0),a.writeUInt32BE(i,s+=4,!0),a.write(n.srcIP,s+=4,i,"ascii"),a.writeUInt32BE(n.srcPort,s+=i,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", direct-tcpip)"),xi(this,a)},Ti.prototype.openssh_directStreamLocal=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(n.socketPath),o=47,s=new Buffer(51+i+4);return s[0]=Kn.CHANNEL_OPEN,s.writeUInt32BE(30,1,!0),s.write("direct-streamlocal@openssh.com",5,30,"ascii"),s.writeUInt32BE(e,35,!0),s.writeUInt32BE(t,39,!0),s.writeUInt32BE(r,43,!0),s.writeUInt32BE(i,o,!0),s.write(n.socketPath,o+=4,i,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", direct-streamlocal@openssh.com)"),xi(this,s)},Ti.prototype.openssh_noMoreSessions=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=new Buffer(34);return t[0]=Kn.GLOBAL_REQUEST,t.writeUInt32BE(28,1,!0),t.write("no-more-sessions@openssh.com",5,28,"ascii"),t[33]=void 0===e||!0===e?1:0,this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (no-more-sessions@openssh.com)"),xi(this,t)},Ti.prototype.session=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=new Buffer(24);return n[0]=Kn.CHANNEL_OPEN,n.writeUInt32BE(7,1,!0),n.write("session",5,7,"ascii"),n.writeUInt32BE(e,12,!0),n.writeUInt32BE(t,16,!0),n.writeUInt32BE(r,20,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", session)"),xi(this,n)},Ti.prototype.windowChange=function(e,t,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");var o=new Buffer(39);return o[0]=Kn.CHANNEL_REQUEST,o.writeUInt32BE(e,1,!0),o.writeUInt32BE(13,5,!0),o.write("window-change",9,13,"ascii"),o[22]=0,o.writeUInt32BE(r,23,!0),o.writeUInt32BE(t,27,!0),o.writeUInt32BE(i,31,!0),o.writeUInt32BE(n,35,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", window-change)"),xi(this,o)},Ti.prototype.pty=function(e,t,r,n,i,o,s,a){if(this.server)throw new Error("Client-only method called in server mode");o&&o.length||(o="vt100"),!s||Buffer.isBuffer(s)||Array.isArray(s)||"object"!=typeof s||(s=function(e){for(var t,r,n,i=/^\d+$/,o=Object.keys(e),s=0,a=[],u=0,f=o.length;u<f;++u)t=o[u],(r=$n[t])&&!i.test(t)&&"number"==typeof e[t]&&"TTY_OP_END"!==t&&(n=e[t],a[s++]=r,a[s++]=n>>>24&255,a[s++]=n>>>16&255,a[s++]=n>>>8&255,a[s++]=255&n);return a[s]=$n.TTY_OP_END,a}(s)),s&&s.length||(s=Bi);var u=o.length,f=s.length,c=21,h=new Buffer(21+u+4+4+4+4+4+f);if(h[0]=Kn.CHANNEL_REQUEST,h.writeUInt32BE(e,1,!0),h.writeUInt32BE(7,5,!0),h.write("pty-req",9,7,"ascii"),h[16]=void 0===a||!0===a?1:0,h.writeUInt32BE(u,17,!0),h.write(o,21,u,"utf8"),h.writeUInt32BE(r,c+=u,!0),h.writeUInt32BE(t,c+=4,!0),h.writeUInt32BE(i,c+=4,!0),h.writeUInt32BE(n,c+=4,!0),h.writeUInt32BE(f,c+=4,!0),c+=4,Array.isArray(s))for(var l=0;l<f;++l)h[c++]=s[l];else Buffer.isBuffer(s)?s.copy(h,c):"string"==typeof s&&h.write(s,c+=4,f,"binary");return this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", pty-req)"),xi(this,h)},Ti.prototype.shell=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=new Buffer(15);return r[0]=Kn.CHANNEL_REQUEST,r.writeUInt32BE(e,1,!0),r.writeUInt32BE(5,5,!0),r.write("shell",9,5,"ascii"),r[14]=void 0===t||!0===t?1:0,this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", shell)"),xi(this,r)},Ti.prototype.exec=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.isBuffer(t)?t.length:Buffer.byteLength(t),i=new Buffer(18+n);return i[0]=Kn.CHANNEL_REQUEST,i.writeUInt32BE(e,1,!0),i.writeUInt32BE(4,5,!0),i.write("exec",9,4,"ascii"),i[13]=void 0===r||!0===r?1:0,i.writeUInt32BE(n,14,!0),Buffer.isBuffer(t)?t.copy(i,18):i.write(t,18,n,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exec)"),xi(this,i)},Ti.prototype.signal=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");if("SIG"===(t=t.toUpperCase()).slice(0,3)&&(t=t.substring(3)),-1===Yn.indexOf(t))throw new Error("Invalid signal: "+t);var r=t.length,n=new Buffer(20+r);return n[0]=Kn.CHANNEL_REQUEST,n.writeUInt32BE(e,1,!0),n.writeUInt32BE(6,5,!0),n.write("signal",9,6,"ascii"),n[15]=0,n.writeUInt32BE(r,16,!0),n.write(t,20,r,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", signal)"),xi(this,n)},Ti.prototype.env=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(t),o=Buffer.isBuffer(r)?r.length:Buffer.byteLength(r),s=new Buffer(17+i+4+o);return s[0]=Kn.CHANNEL_REQUEST,s.writeUInt32BE(e,1,!0),s.writeUInt32BE(3,5,!0),s.write("env",9,3,"ascii"),s[12]=void 0===n||!0===n?1:0,s.writeUInt32BE(i,13,!0),s.write(t,17,i,"ascii"),s.writeUInt32BE(o,17+i,!0),Buffer.isBuffer(r)?r.copy(s,17+i+4):s.write(r,17+i+4,o,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", env)"),xi(this,s)},Ti.prototype.x11Forward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(t.protocol),i=Buffer.byteLength(t.cookie),o=new Buffer(22+n+4+i+4);o[0]=Kn.CHANNEL_REQUEST,o.writeUInt32BE(e,1,!0),o.writeUInt32BE(7,5,!0),o.write("x11-req",9,7,"ascii"),o[16]=void 0===r||!0===r?1:0,o[17]=t.single?1:0,o.writeUInt32BE(n,18,!0);var s=22;return Buffer.isBuffer(t.protocol)?t.protocol.copy(o,s):o.write(t.protocol,s,n,"utf8"),s+=n,o.writeUInt32BE(i,s,!0),s+=4,Buffer.isBuffer(t.cookie)?t.cookie.copy(o,s):o.write(t.cookie,s,i,"utf8"),s+=i,o.writeUInt32BE(t.screen||0,s,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", x11-req)"),xi(this,o)},Ti.prototype.subsystem=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(t),i=new Buffer(23+n);return i[0]=Kn.CHANNEL_REQUEST,i.writeUInt32BE(e,1,!0),i.writeUInt32BE(9,5,!0),i.write("subsystem",9,9,"ascii"),i[18]=void 0===r||!0===r?1:0,i.writeUInt32BE(n,19,!0),i.write(t,23,n,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", subsystem: "+t+")"),xi(this,i)},Ti.prototype.openssh_agentForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=new Buffer(36);return r[0]=Kn.CHANNEL_REQUEST,r.writeUInt32BE(e,1,!0),r.writeUInt32BE(26,5,!0),r.write("auth-agent-req@openssh.com",9,26,"ascii"),r[35]=void 0===t||!0===t?1:0,this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", auth-agent-req@openssh.com)"),xi(this,r)},Ti.prototype.authPassword=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(e),n=Buffer.byteLength(t),i=0,o=new Buffer(5+r+4+14+4+8+1+4+n);return o[i]=Kn.USERAUTH_REQUEST,o.writeUInt32BE(r,++i,!0),o.write(e,i+=4,r,"utf8"),o.writeUInt32BE(14,i+=r,!0),o.write("ssh-connection",i+=4,14,"ascii"),o.writeUInt32BE(8,i+=14,!0),o.write("password",i+=4,8,"ascii"),o[i+=8]=0,o.writeUInt32BE(n,++i,!0),o.write(t,i+=4,n,"utf8"),this._state.authMethod="password",this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (password)"),xi(this,o)},Ti.prototype.authPK=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n,i=this,o=this._state.outgoing;this._state.authMethod="publickey",t.public?(n=t.fulltype,t.type,t=t.public):(n=t.toString("ascii",4,4+t.readUInt32BE(0,!0))).substring(4,7);var s=Buffer.byteLength(e),a=Buffer.byteLength(n),u=t.length,f=o.sessionId.length,c=0,h=new Buffer((r?4+f:0)+1+4+s+4+14+4+9+1+4+a+4+u);return r?(h.writeUInt32BE(f,c,!0),o.sessionId.copy(h,c+=4),h[c+=f]=Kn.USERAUTH_REQUEST):h[c]=Kn.USERAUTH_REQUEST,h.writeUInt32BE(s,++c,!0),h.write(e,c+=4,s,"utf8"),h.writeUInt32BE(14,c+=s,!0),h.write("ssh-connection",c+=4,14,"ascii"),h.writeUInt32BE(9,c+=14,!0),h.write("publickey",c+=4,9,"ascii"),h[c+=9]=r?1:0,h.writeUInt32BE(a,++c,!0),h.write(n,c+=4,a,"ascii"),h.writeUInt32BE(u,c+=a,!0),t.copy(h,c+=4),r?(r(h,(function(r){var o=r.length,f=new Buffer(5+s+4+14+4+9+1+4+a+4+u+4+4+7+4+o);return f[c=0]=Kn.USERAUTH_REQUEST,f.writeUInt32BE(s,++c,!0),f.write(e,c+=4,s,"utf8"),f.writeUInt32BE(14,c+=s,!0),f.write("ssh-connection",c+=4,14,"ascii"),f.writeUInt32BE(9,c+=14,!0),f.write("publickey",c+=4,9,"ascii"),f[c+=9]=1,f.writeUInt32BE(a,++c,!0),f.write(n,c+=4,a,"ascii"),f.writeUInt32BE(u,c+=a,!0),t.copy(f,c+=4),f.writeUInt32BE(15+o,c+=u,!0),f.writeUInt32BE(7,c+=4,!0),f.write(n,c+=4,7,"ascii"),f.writeUInt32BE(o,c+=7,!0),r.copy(f,c+=4),i.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (publickey)"),xi(i,f)})),!0):(this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (publickey -- check)"),xi(this,h))},Ti.prototype.authHostbased=function(e,t,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");var o,s=this,a=this._state.outgoing;t.public?(o=t.fulltype,t.type,t=t.public):(o=t.toString("ascii",4,4+t.readUInt32BE(0,!0))).substring(4,7);var u=Buffer.byteLength(e),f=Buffer.byteLength(o),c=t.length,h=a.sessionId.length,l=Buffer.byteLength(r),p=Buffer.byteLength(n),d=0,g=new Buffer(4+h+1+4+u+4+14+4+9+4+f+4+c+4+l+4+p);return g.writeUInt32BE(h,d,!0),a.sessionId.copy(g,d+=4),g[d+=h]=Kn.USERAUTH_REQUEST,g.writeUInt32BE(u,++d,!0),g.write(e,d+=4,u,"utf8"),g.writeUInt32BE(14,d+=u,!0),g.write("ssh-connection",d+=4,14,"ascii"),g.writeUInt32BE(9,d+=14,!0),g.write("hostbased",d+=4,9,"ascii"),g.writeUInt32BE(f,d+=9,!0),g.write(o,d+=4,f,"ascii"),g.writeUInt32BE(c,d+=f,!0),t.copy(g,d+=4),g.writeUInt32BE(l,d+=c,!0),g.write(r,d+=4,l,"ascii"),g.writeUInt32BE(p,d+=l,!0),g.write(n,d+=4,p,"utf8"),i(g,(function(e){var t=e.length,r=new Buffer(g.length-h+t);return g.copy(r,0,4+h),r.writeUInt32BE(t,r.length-t-4,!0),e.copy(r,r.length-t),s._state.authMethod="hostbased",s.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (hostbased)"),xi(s,r)})),!0},Ti.prototype.authKeyboard=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=0,n=new Buffer(5+t+4+14+4+20+4+4);return n[r]=Kn.USERAUTH_REQUEST,n.writeUInt32BE(t,++r,!0),n.write(e,r+=4,t,"utf8"),n.writeUInt32BE(14,r+=t,!0),n.write("ssh-connection",r+=4,14,"ascii"),n.writeUInt32BE(20,r+=14,!0),n.write("keyboard-interactive",r+=4,20,"ascii"),n.writeUInt32BE(0,r+=20,!0),n.writeUInt32BE(0,r+=4,!0),this._state.authMethod="keyboard-interactive",this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (keyboard-interactive)"),xi(this,n)},Ti.prototype.authNone=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=0,n=new Buffer(5+t+4+14+4+4);return n[r]=Kn.USERAUTH_REQUEST,n.writeUInt32BE(t,++r,!0),n.write(e,r+=4,t,"utf8"),n.writeUInt32BE(14,r+=t,!0),n.write("ssh-connection",r+=4,14,"ascii"),n.writeUInt32BE(4,r+=14,!0),n.write("none",r+=4,4,"ascii"),this._state.authMethod="none",this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (none)"),xi(this,n)},Ti.prototype.authInfoRes=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t,r,n,i=0,o=0;if(e)for(n=0,r=e.length;n<r;++n)i+=4+Buffer.byteLength(e[n]);var s=new Buffer(5+i);if(s[o++]=Kn.USERAUTH_INFO_RESPONSE,s.writeUInt32BE(e?e.length:0,o,!0),e)for(o+=4,n=0,r=e.length;n<r;++n)t=Buffer.byteLength(e[n]),s.writeUInt32BE(t,o,!0),o+=4,t&&(s.write(e[n],o,t,"utf8"),o+=t);return this.debug("DEBUG: Outgoing: Writing USERAUTH_INFO_RESPONSE"),xi(this,s)},Ti.prototype.serviceAccept=function(e){if(!this.server)throw new Error("Server-only method called in client mode");var t=e.length,r=new Buffer(5+t);return r[0]=Kn.SERVICE_ACCEPT,r.writeUInt32BE(t,1,!0),r.write(e,5,t,"ascii"),this.debug("DEBUG: Outgoing: Writing SERVICE_ACCEPT ("+e+")"),xi(this,r)},Ti.prototype.forwardedTcpip=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.boundAddr),o=Buffer.byteLength(n.remoteAddr),s=36+i,a=new Buffer(36+i+4+4+o+4);return a[0]=Kn.CHANNEL_OPEN,a.writeUInt32BE(15,1,!0),a.write("forwarded-tcpip",5,15,"ascii"),a.writeUInt32BE(e,20,!0),a.writeUInt32BE(t,24,!0),a.writeUInt32BE(r,28,!0),a.writeUInt32BE(i,32,!0),a.write(n.boundAddr,36,i,"ascii"),a.writeUInt32BE(n.boundPort,s,!0),a.writeUInt32BE(o,s+=4,!0),a.write(n.remoteAddr,s+=4,o,"ascii"),a.writeUInt32BE(n.remotePort,s+=o,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", forwarded-tcpip)"),xi(this,a)},Ti.prototype.x11=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.originAddr),o=24+i,s=new Buffer(24+i+4);return s[0]=Kn.CHANNEL_OPEN,s.writeUInt32BE(3,1,!0),s.write("x11",5,3,"ascii"),s.writeUInt32BE(e,8,!0),s.writeUInt32BE(t,12,!0),s.writeUInt32BE(r,16,!0),s.writeUInt32BE(i,20,!0),s.write(n.originAddr,24,i,"ascii"),s.writeUInt32BE(n.originPort,o,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", x11)"),xi(this,s)},Ti.prototype.openssh_forwardedStreamLocal=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.socketPath),o=new Buffer(54+i+4);return o[0]=Kn.CHANNEL_OPEN,o.writeUInt32BE(33,1,!0),o.write("forwarded-streamlocal@openssh.com",5,33,"ascii"),o.writeUInt32BE(e,38,!0),o.writeUInt32BE(t,42,!0),o.writeUInt32BE(r,46,!0),o.writeUInt32BE(i,50,!0),o.write(n.socketPath,54,i,"utf8"),o.writeUInt32BE(0,54+i,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", forwarded-streamlocal@openssh.com)"),xi(this,o)},Ti.prototype.exitStatus=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=new Buffer(25);return r[0]=Kn.CHANNEL_REQUEST,r.writeUInt32BE(e,1,!0),r.writeUInt32BE(11,5,!0),r.write("exit-status",9,11,"ascii"),r[20]=0,r.writeUInt32BE(t,21,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exit-status)"),xi(this,r)},Ti.prototype.exitSignal=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(t),o=n?Buffer.byteLength(n):0,s=25+i,a=new Buffer(25+i+1+4+o+4);return a[0]=Kn.CHANNEL_REQUEST,a.writeUInt32BE(e,1,!0),a.writeUInt32BE(11,5,!0),a.write("exit-signal",9,11,"ascii"),a[20]=0,a.writeUInt32BE(i,21,!0),a.write(t,25,i,"utf8"),a[s++]=r?1:0,a.writeUInt32BE(o,s,!0),s+=4,o&&(a.write(n,s,o,"utf8"),s+=o),a.writeUInt32BE(0,s,!0),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exit-signal)"),xi(this,a)},Ti.prototype.authFailure=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r;if("boolean"==typeof e&&(t=e,e=void 0),e){r=[];for(var n=0,i=e.length;n<i;++n)"none"!==e[n].toLowerCase()&&r.push(e[n]);r=r.join(",")}else r="";var o=r.length,s=new Buffer(5+o+1);return s[0]=Kn.USERAUTH_FAILURE,s.writeUInt32BE(o,1,!0),s.write(r,5,o,"ascii"),s[5+o]=!0===t?1:0,this.debug("DEBUG: Outgoing: Writing USERAUTH_FAILURE"),xi(this,s)},Ti.prototype.authSuccess=function(){if(!this.server)throw new Error("Server-only method called in client mode");return this.debug("DEBUG: Outgoing: Writing USERAUTH_SUCCESS"),xi(this,wi)},Ti.prototype.authPKOK=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=e.length,n=t.length,i=new Buffer(5+r+4+n);return i[0]=Kn.USERAUTH_PK_OK,i.writeUInt32BE(r,1,!0),i.write(e,5,r,"ascii"),i.writeUInt32BE(n,5+r,!0),t.copy(i,5+r+4),this.debug("DEBUG: Outgoing: Writing USERAUTH_PK_OK"),xi(this,i)},Ti.prototype.authPasswdChg=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=Buffer.byteLength(e),n=t?t.length:0,i=0,o=new Buffer(5+r+4+n);return o[i]=Kn.USERAUTH_PASSWD_CHANGEREQ,o.writeUInt32BE(r,++i,!0),o.write(e,i+=4,r,"utf8"),o.writeUInt32BE(n,i+=r,!0),n&&o.write(t,i+=4,n,"ascii"),this.debug("DEBUG: Outgoing: Writing USERAUTH_PASSWD_CHANGEREQ"),xi(this,o)},Ti.prototype.authInfoReq=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");var n,i,o,s,a=0,u=e?Buffer.byteLength(e):0,f=t?Buffer.byteLength(t):0,c=0;for(s=0,o=r.length;s<o;++s)a+=4+Buffer.byteLength(r[s].prompt)+1;var h=new Buffer(5+u+4+f+4+4+a);for(h[c++]=Kn.USERAUTH_INFO_REQUEST,h.writeUInt32BE(u,c,!0),c+=4,e&&(h.write(e,c,u,"utf8"),c+=u),h.writeUInt32BE(f,c,!0),c+=4,t&&(h.write(t,c,f,"utf8"),c+=f),h.writeUInt32BE(0,c,!0),c+=4,h.writeUInt32BE(r.length,c,!0),c+=4,s=0,o=r.length;s<o;++s)i=r[s],n=Buffer.byteLength(i.prompt),h.writeUInt32BE(n,c,!0),c+=4,n&&(h.write(i.prompt,c,n,"utf8"),c+=n),h[c++]=i.echo?1:0;return this.debug("DEBUG: Outgoing: Writing USERAUTH_INFO_REQUEST"),xi(this,h)};var Pi,Hi,Mi={SFTPStream:bn,SSH2Stream:Ti,utils:Cr(),constants:hr},ji={exports:{}};var Gi,Fi={};function Wi(){if(Gi)return Fi;function e(e){return Object.prototype.toString.call(e)}return Gi=1,Fi.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},Fi.isBoolean=function(e){return"boolean"==typeof e},Fi.isNull=function(e){return null===e},Fi.isNullOrUndefined=function(e){return null==e},Fi.isNumber=function(e){return"number"==typeof e},Fi.isString=function(e){return"string"==typeof e},Fi.isSymbol=function(e){return"symbol"==typeof e},Fi.isUndefined=function(e){return void 0===e},Fi.isRegExp=function(t){return"[object RegExp]"===e(t)},Fi.isObject=function(e){return"object"==typeof e&&null!==e},Fi.isDate=function(t){return"[object Date]"===e(t)},Fi.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},Fi.isFunction=function(e){return"function"==typeof e},Fi.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},Fi.isBuffer=S.Buffer.isBuffer,Fi}var qi,Ki,zi,Vi,Xi,Qi,$i,Yi,Zi,Ji,eo,to,ro={};function no(){if(qi)return ro;qi=1;var e=S.Buffer,t=e.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var r=ro.StringDecoder=function(r){switch(this.encoding=(r||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!t(e))throw new Error("Unknown encoding: "+e)}(r),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=i;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=n)}this.charBuffer=new e(6),this.charReceived=0,this.charLength=0};function n(e){return e.toString(this.encoding)}function i(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}return r.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},r.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},r.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},ro}function io(){if(zi)return Ki;zi=1,Ki=a;var e=Hi?Pi:(Hi=1,Pi=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}),t=S.Buffer;a.ReadableState=s;var r=v.EventEmitter;r.listenerCount||(r.listenerCount=function(e,t){return e.listeners(t).length});var n,i=b,o=Wi();function s(e,t){var r=(e=e||{}).highWaterMark;this.highWaterMark=r||0===r?r:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(n||(n=no().StringDecoder),this.decoder=new n(e.encoding),this.encoding=e.encoding)}function a(e){if(!(this instanceof a))return new a(e);this._readableState=new s(e),this.readable=!0,i.call(this)}function u(e,r,n,i,o){var s=function(e,r){var n=null;t.isBuffer(r)||"string"==typeof r||null==r||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(r,n);if(s)e.emit("error",s);else if(null==n)r.reading=!1,r.ended||function(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.length>0?h(e):y(e)}(e,r);else if(r.objectMode||n&&n.length>0)if(r.ended&&!o){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(r.endEmitted&&o){a=new Error("stream.unshift() after end event");e.emit("error",a)}else!r.decoder||o||i||(n=r.decoder.write(n)),r.length+=r.objectMode?1:n.length,o?r.buffer.unshift(n):(r.reading=!1,r.buffer.push(n)),r.needReadable&&h(e),function(e,t){t.readingMore||(t.readingMore=!0,process.nextTick((function(){!function(e,t){var r=t.length;for(;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}(e,t)})))}(e,r);else o||(r.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(r)}o.inherits=Le,o.inherits(a,i),a.prototype.push=function(e,r){var n=this._readableState;return"string"!=typeof e||n.objectMode||(r=r||n.defaultEncoding)!==n.encoding&&(e=new t(e,r),r=""),u(this,n,e,r,!1)},a.prototype.unshift=function(e){return u(this,this._readableState,e,"",!0)},a.prototype.setEncoding=function(e){n||(n=no().StringDecoder),this._readableState.decoder=new n(e),this._readableState.encoding=e};var f=8388608;function c(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>=f)e=f;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function h(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?process.nextTick((function(){l(e)})):l(e))}function l(e){e.emit("readable")}function p(e){var t,n=e._readableState;function i(e,r,i){!1===e.write(t)&&n.awaitDrain++}for(n.awaitDrain=0;n.pipesCount&&null!==(t=e.read());)if(1===n.pipesCount?i(n.pipes):m(n.pipes,i),e.emit("data",t),n.awaitDrain>0)return;if(0===n.pipesCount)return n.flowing=!1,void(r.listenerCount(e,"data")>0&&g(e));n.ranOut=!0}function d(){this._readableState.ranOut&&(this._readableState.ranOut=!1,p(this))}function g(e,t){if(e._readableState.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,n=!1;e.readable=!0,e.pipe=i.prototype.pipe,e.on=e.addListener=i.prototype.on,e.on("readable",(function(){var t;for(n=!0;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(n=!1,e._readableState.needReadable=!0)})),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,n?process.nextTick((function(){e.emit("readable")})):this.read(0),this.emit("resume")},e.emit("readable")}function _(e,r){var n,i=r.buffer,o=r.length,s=!!r.decoder,a=!!r.objectMode;if(0===i.length)return null;if(0===o)n=null;else if(a)n=i.shift();else if(!e||e>=o)n=s?i.join(""):t.concat(i,o),i.length=0;else{if(e<i[0].length)n=(h=i[0]).slice(0,e),i[0]=h.slice(e);else if(e===i[0].length)n=i.shift();else{n=s?"":new t(e);for(var u=0,f=0,c=i.length;f<c&&u<e;f++){var h=i[0],l=Math.min(e-u,h.length);s?n+=h.slice(0,l):h.copy(n,u,0,l),l<h.length?i[0]=h.slice(l):i.shift(),u+=l}}}return n}function y(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,process.nextTick((function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))})))}function m(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}return a.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var r,n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h(this),null;if(0===(e=c(e,t))&&t.ended)return r=null,t.length>0&&t.decoder&&(r=_(e,t),t.length-=r.length),0===t.length&&y(this),r;var i=t.needReadable;return t.length-e<=t.highWaterMark&&(i=!0),(t.ended||t.reading)&&(i=!1),i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=c(n,t)),null===(r=e>0?_(e,t):null)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&y(this),r},a.prototype._read=function(e){this.emit("error",new Error("not implemented"))},a.prototype.pipe=function(t,n){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1;var s=(!n||!1!==n.end)&&t!==process.stdout&&t!==process.stderr?u:c;function a(e){e===i&&c()}function u(){t.end()}o.endEmitted?process.nextTick(s):i.once("end",s),t.on("unpipe",a);var f=function(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&p(e)}}(i);function c(){t.removeListener("close",l),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",h),t.removeListener("unpipe",a),i.removeListener("end",u),i.removeListener("end",c),t._writableState&&!t._writableState.needDrain||f()}function h(e){v(),t.removeListener("error",h),0===r.listenerCount(t,"error")&&t.emit("error",e)}function l(){t.removeListener("finish",g),v()}function g(){t.removeListener("close",l),v()}function v(){i.unpipe(t)}return t.on("drain",f),t._events&&t._events.error?e(t._events.error)?t._events.error.unshift(h):t._events.error=[h,t._events.error]:t.on("error",h),t.once("close",l),t.once("finish",g),t.emit("pipe",i),o.flowing||(this.on("readable",d),o.flowing=!0,process.nextTick((function(){p(i)}))),t},a.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",d),t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",d),t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}return-1===(i=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}(t.pipes,e))||(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},a.prototype.on=function(e,t){var r=i.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||g(this),"readable"===e&&this.readable){var n=this._readableState;n.readableListening||(n.readableListening=!0,n.emittedReadable=!1,n.needReadable=!0,n.reading?n.length&&h(this):this.read(0))}return r},a.prototype.addListener=a.prototype.on,a.prototype.resume=function(){g(this),this.read(0),this.emit("resume")},a.prototype.pause=function(){g(this,!0),this.emit("pause")},a.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",(function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)})),e.on("data",(function(i){(t.decoder&&(i=t.decoder.write(i)),t.objectMode&&null==i)||(t.objectMode||i&&i.length)&&(n.push(i)||(r=!0,e.pause()))})),e)"function"==typeof e[i]&&void 0===this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return m(["error","close","destroy","pause","resume"],(function(t){e.on(t,n.emit.bind(n,t))})),n._read=function(t){r&&(r=!1,e.resume())},n},a._fromList=_,Ki}function oo(){if(Xi)return Vi;Xi=1,Vi=i;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},t=Wi();t.inherits=Le;var r=io(),n=so();function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),n.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",o)}function o(){this.allowHalfOpen||this._writableState.ended||process.nextTick(this.end.bind(this))}return t.inherits(i,r),function(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}(e(n.prototype),(function(e){i.prototype[e]||(i.prototype[e]=n.prototype[e])})),Vi}function so(){if($i)return Qi;$i=1,Qi=o;var e=S.Buffer;o.WritableState=i;var t=Wi();t.inherits=Le;var r=b;function n(e,t,r){this.chunk=e,this.encoding=t,this.callback=r}function i(e,t){var r=(e=e||{}).highWaterMark;this.highWaterMark=r||0===r?r:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var n=!1===e.decodeStrings;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){r?process.nextTick((function(){i(n)})):i(n);e._writableState.errorEmitted=!0,e.emit("error",n)}(e,0,n,t,i);else{var o=u(e,r);o||r.bufferProcessing||!r.buffer.length||function(e,t){t.bufferProcessing=!0;for(var r=0;r<t.buffer.length;r++){var n=t.buffer[r],i=n.chunk,o=n.encoding,a=n.callback;if(s(e,t,t.objectMode?1:i.length,i,o,a),t.writing){r++;break}}t.bufferProcessing=!1,r<t.buffer.length?t.buffer=t.buffer.slice(r):t.buffer.length=0}(e,r),n?process.nextTick((function(){a(e,r,o,i)})):a(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.errorEmitted=!1}function o(e){var t=oo();if(!(this instanceof o||this instanceof t))return new o(e);this._writableState=new i(e,this),this.writable=!0,r.call(this)}function s(e,t,r,n,i,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,e._write(n,i,t.onwrite),t.sync=!1}function a(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),n(),r&&f(e,t)}function u(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function f(e,t){var r=u(0,t);return r&&(t.finished=!0,e.emit("finish")),r}return t.inherits(o,r),o.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},o.prototype.write=function(t,r,i){var o=this._writableState,a=!1;return"function"==typeof r&&(i=r,r=null),e.isBuffer(t)?r="buffer":r||(r=o.defaultEncoding),"function"!=typeof i&&(i=function(){}),o.ended?function(e,t,r){var n=new Error("write after end");e.emit("error",n),process.nextTick((function(){r(n)}))}(this,0,i):function(t,r,n,i){var o=!0;if(!e.isBuffer(n)&&"string"!=typeof n&&null!=n&&!r.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");t.emit("error",s),process.nextTick((function(){i(s)})),o=!1}return o}(this,o,t,i)&&(a=function(t,r,i,o,a){i=function(t,r,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof r||(r=new e(r,n));return r}(r,i,o),e.isBuffer(i)&&(o="buffer");var u=r.objectMode?1:i.length;r.length+=u;var f=r.length<r.highWaterMark;f||(r.needDrain=!0);r.writing?r.buffer.push(new n(i,o,a)):s(t,r,u,i,o,a);return f}(this,o,t,r,i)),a},o.prototype._write=function(e,t,r){r(new Error("not implemented"))},o.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.ending||n.finished||function(e,t,r){t.ending=!0,f(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0}(this,n,r)},Qi}function ao(){if(Zi)return Yi;Zi=1,Yi=n;var e=oo(),t=Wi();function r(e,t){this.afterTransform=function(e,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!=r&&e.push(r);i&&i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function n(t){if(!(this instanceof n))return new n(t);e.call(this,t),this._transformState=new r(t,this);var o=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",(function(){"function"==typeof this._flush?this._flush((function(e){i(o,e)})):i(o)}))}function i(e,t){if(t)return e.emit("error",t);var r=e._writableState;e._readableState;var n=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}return t.inherits=Le,t.inherits(n,e),n.prototype.push=function(t,r){return this._transformState.needTransform=!1,e.prototype.push.call(this,t,r)},n.prototype._transform=function(e,t,r){throw new Error("not implemented")},n.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},n.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Yi}function uo(){return to||(to=1,function(e,t){var r=b;(t=e.exports=io()).Stream=r,t.Readable=t,t.Writable=so(),t.Duplex=oo(),t.Transform=ao(),t.PassThrough=function(){if(eo)return Ji;eo=1,Ji=r;var e=ao(),t=Wi();function r(t){if(!(this instanceof r))return new r(t);e.call(this,t)}return t.inherits=Le,t.inherits(r,e),r.prototype._transform=function(e,t,r){r(null,e)},Ji}(),process.browser||"disable"!==process.env.READABLE_STREAM||(e.exports=b)}(ji,ji.exports)),ji.exports}var fo=y.inherits,co=b.Duplex||uo().Duplex,ho=b.Readable||uo().Readable,lo=b.Writable||uo().Writable,po=Mi.constants.CHANNEL_EXTENDED_DATATYPE.STDERR,go=1048576,vo=["CHANNEL_EOF","CHANNEL_CLOSE","CHANNEL_DATA","CHANNEL_EXTENDED_DATA","CHANNEL_WINDOW_ADJUST","CHANNEL_SUCCESS","CHANNEL_FAILURE","CHANNEL_REQUEST"],_o=vo.length;function yo(e,t,r){var n={highWaterMark:go,allowHalfOpen:!r||r&&!1!==r.allowHalfOpen};this.allowHalfOpen=n.allowHalfOpen,co.call(this,n);var i=this,o=r&&r.server;this.server=o,this.type=e.type,this.subtype=void 0;var s,a,u,f,c,h=this.incoming=e.incoming,l=h.id,p=this.outgoing=e.outgoing,d=this._callbacks=[];this._client=t,this._hasX11=!1;var g=t._channels,v=t._sshstream;function _(){i._waitClientDrain&&(i._waitClientDrain=!1,i._waitWindow||(i._chunk?i._write(i._chunk,null,i._chunkcb):i._chunkcb?i._chunkcb():i._chunkErr?i.stderr._write(i._chunkErr,null,i._chunkcbErr):i._chunkcbErr&&i._chunkcbErr()))}function y(){i.eof(),(o||!o&&!i.allowHalfOpen)&&i.close(),i.writable=!1}function m(){i.readable=!1}t._sock.on("drain",_),v.once("CHANNEL_EOF:"+l,(function(){"closed"!==h.state&&"eof"!==h.state&&(h.state="eof",i.readable&&i.push(null),o&&i.stderr.writable?i.stderr.end():!o&&i.stderr.readable&&i.stderr.push(null))})).once("CHANNEL_CLOSE:"+l,(function(){if("closed"!==h.state){h.state="closed",i.readable&&i.push(null),o&&i.stderr.writable?i.stderr.end():!o&&i.stderr.readable&&i.stderr.push(null),"open"!==p.state&&"eof"!==p.state||i.close(),"closing"===p.state&&(p.state="closed"),delete g[l];var e=i._writableState;t._sock.removeListener("drain",_),e.ending||e.finished||i.end(),i._callbacks=[];for(var r=0;r<d.length;++r)d[r](!0);d=i._callbacks,o?i.emit("close"):(null===s?i.emit("close",s,a,u,f,c):i.emit("close",s),i.stderr.emit("close"));for(r=0;r<_o;++r)v.removeAllListeners(vo[r]+":"+l)}})).on("CHANNEL_DATA:"+l,(function(e){0!==h.window&&(h.window-=e.length,i.push(e)?0===h.window&&mo(i):i._waitChanDrain=!0)})).on("CHANNEL_WINDOW_ADJUST:"+l,(function(e){p.window+=e,i._waitWindow&&(i._waitWindow=!1,i._waitClientDrain||(i._chunk?i._write(i._chunk,null,i._chunkcb):i._chunkcb?i._chunkcb():i._chunkErr?i.stderr._write(i._chunkErr,null,i._chunkcbErr):i._chunkcbErr&&i._chunkcbErr()))})).on("CHANNEL_SUCCESS:"+l,(function(){o?(v._kalast=Date.now(),v._kacnt=0):t._resetKA(),d.length&&d.shift()(!1)})).on("CHANNEL_FAILURE:"+l,(function(){o?(v._kalast=Date.now(),v._kacnt=0):t._resetKA(),d.length&&d.shift()(!0)})).on("CHANNEL_REQUEST:"+l,(function(e){if(!o){if("exit-status"===e.request)return void i.emit("exit",s=e.code);if("exit-signal"===e.request)return void i.emit("exit",s=null,a="SIG"+e.signal,u=e.coredump,f=e.description,c=e.lang)}e.wantReply&&v.channelFailure(p.id)})),this.stdin=this.stdout=this,o?this.stderr=new Eo(this):(this.stderr=new ho(n),this.stderr._read=function(e){i._waitChanDrain&&(i._waitChanDrain=!1,0===h.window&&mo(i))},v.on("CHANNEL_EXTENDED_DATA:"+l,(function(e,t){0!==h.window&&(h.window-=t.length,i.stderr.push(t)?0===h.window&&mo(i):i._waitChanDrain=!0)}))),this._waitClientDrain=!1,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",y).on("prefinish",y),this.on("end",m).on("close",m)}function mo(e,t){return"open"!==e.outgoing.state||(t=t||go,e.incoming.window+=t,e._client._sshstream.channelWindowAdjust(e.outgoing.id,t))}function Eo(e){lo.call(this,{highWaterMark:go}),this._channel=e}fo(yo,co),yo.prototype.eof=function(){var e=!0,t=this.outgoing;return"open"===t.state&&(t.state="eof",e=this._client._sshstream.channelEOF(t.id)),e},yo.prototype.close=function(){var e=!0,t=this.outgoing;return"open"!==t.state&&"eof"!==t.state||(t.state="closing",e=this._client._sshstream.channelClose(t.id)),e},yo.prototype._read=function(e){this._waitChanDrain&&(this._waitChanDrain=!1,0===this.incoming.window&&mo(this))},yo.prototype._write=function(e,t,r){var n,i,o,s=this._client._sshstream,a=this.outgoing,u=a.packetSize,f=a.id,c=a.window,h=e.length,l=0;if("open"===a.state){for(;h-l>0&&c>0;)if((o=h-l)>c&&(o=c),o>u&&(o=u),n=s.channelData(f,e.slice(l,l+o)),l+=o,c-=o,!n){this._waitClientDrain=!0,this._chunk=void 0,this._chunkcb=r;break}if(a.window=c,h-l>0)return 0===c&&(this._waitWindow=!0),l>0?(i=new Buffer(h-l),e.copy(i,0,l),this._chunk=i):this._chunk=e,void(this._chunkcb=r);this._waitClientDrain||r()}},yo.prototype.destroy=function(){this.end()},yo.prototype.setWindow=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");return"session"!==this.type||"shell"!==this.subtype&&"exec"!==this.subtype||!this.writable||"open"!==this.outgoing.state||this._client._sshstream.windowChange(this.outgoing.id,e,t,r,n)},yo.prototype.signal=function(e){if(this.server)throw new Error("Client-only method called in server mode");return"session"!==this.type||!this.writable||"open"!==this.outgoing.state||this._client._sshstream.signal(this.outgoing.id,e)},yo.prototype.exit=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");return"session"!==this.type||!this.writable||"open"!==this.outgoing.state||("number"==typeof e?this._client._sshstream.exitStatus(this.outgoing.id,e):this._client._sshstream.exitSignal(this.outgoing.id,e,t,r))},yo.MAX_WINDOW=go,yo.PACKET_SIZE=32768,fo(Eo,lo),Eo.prototype._write=function(e,t,r){var n,i,o,s=this._channel,a=s._client._sshstream,u=s.outgoing,f=u.packetSize,c=u.id,h=u.window,l=e.length,p=0;if("open"===s.outgoing.state){for(;l-p>0&&h>0;)if((o=l-p)>h&&(o=h),o>f&&(o=f),n=a.channelExtData(c,e.slice(p,p+o),po),p+=o,h-=o,!n){s._waitClientDrain=!0,s._chunkErr=void 0,s._chunkcbErr=r;break}if(u.window=h,l-p>0)return 0===h&&(s._waitWindow=!0),p>0?(i=new Buffer(l-p),e.copy(i,0,p),s._chunkErr=i):s._chunkErr=e,void(s._chunkcbErr=r);s._waitClientDrain||r()}};var wo=yo,bo=E.Socket,So=v.EventEmitter,Bo=y.inherits,Io=g,Ao=d,To=I,ko=/^\!<socket >(\d+) s ([A-Z0-9]{8}\-[A-Z0-9]{8}\-[A-Z0-9]{8}\-[A-Z0-9]{8})/;if("win32"===process.platform){var Uo={},Ro=Io.resolve(__dirname,"..","util/pagent.exe");function Oo(){this.proc=void 0,this.buffer=null}Uo[10]=new Error("Invalid pagent.exe arguments"),Uo[11]=new Error("Pageant is not running"),Uo[12]=new Error("pagent.exe could not create an mmap"),Uo[13]=new Error("pagent.exe could not set mode for stdin"),Uo[14]=new Error("pagent.exe could not set mode for stdout"),Uo[15]=new Error("pagent.exe did not get expected input payload"),Bo(Oo,So),Oo.prototype.write=function(e){if(null===this.buffer?this.buffer=e:this.buffer=Buffer.concat([this.buffer,e],this.buffer.length+e.length),!(this.buffer.length<4)){var t=this.buffer.readUInt32BE(0,!0);if(!(this.buffer.length-4<t)){e=this.buffer.slice(0,4+t),this.buffer.length>4+t?this.buffer=this.buffer.slice(4+t):this.buffer=null;var r,n=this,i=!1;(r=this.proc=To.spawn(Ro,[e.length])).stdout.on("data",(function(e){n.emit("data",e)})),r.once("error",(function(e){i||(i=!0,n.emit("error",e))})),r.once("close",(function(e){n.proc=void 0,Uo[e]&&!i&&(i=!0,n.emit("error",Uo[e])),n.emit("close",i)})),r.stdin.end(e)}}},Oo.prototype.end=Oo.prototype.destroy=function(){this.buffer=null,this.proc&&(this.proc.kill(),this.proc=void 0)},Oo.prototype.connect=function(){this.emit("connect")}}var No=y.inherits,Co=v.EventEmitter;function Lo(e){var t=this;Co.call(this),this._stream=e,e.on("error",(function(e){t.emit("error",e)})).on("end",(function(){t.emit("end")})).on("close",(function(){t.emit("close")})).on("continue",(function(){t.emit("continue")}))}No(Lo,Co),Lo.prototype.end=function(){return this._stream.end()},Lo.prototype.createReadStream=function(e,t){return this._stream.createReadStream(e,t)},Lo.prototype.createWriteStream=function(e,t){return this._stream.createWriteStream(e,t)},Lo.prototype.open=function(e,t,r,n){return this._stream.open(e,t,r,n)},Lo.prototype.close=function(e,t){return this._stream.close(e,t)},Lo.prototype.read=function(e,t,r,n,i,o){return this._stream.readData(e,t,r,n,i,o)},Lo.prototype.write=function(e,t,r,n,i,o){return this._stream.writeData(e,t,r,n,i,o)},Lo.prototype.fastGet=function(e,t,r,n){return this._stream.fastGet(e,t,r,n)},Lo.prototype.fastPut=function(e,t,r,n){return this._stream.fastPut(e,t,r,n)},Lo.prototype.readFile=function(e,t,r){return this._stream.readFile(e,t,r)},Lo.prototype.writeFile=function(e,t,r,n){return this._stream.writeFile(e,t,r,n)},Lo.prototype.appendFile=function(e,t,r,n){return this._stream.appendFile(e,t,r,n)},Lo.prototype.exists=function(e,t){return this._stream.exists(e,t)},Lo.prototype.unlink=function(e,t){return this._stream.unlink(e,t)},Lo.prototype.rename=function(e,t,r){return this._stream.rename(e,t,r)},Lo.prototype.mkdir=function(e,t,r){return this._stream.mkdir(e,t,r)},Lo.prototype.rmdir=function(e,t){return this._stream.rmdir(e,t)},Lo.prototype.readdir=function(e,t,r){return this._stream.readdir(e,t,r)},Lo.prototype.fstat=function(e,t){return this._stream.fstat(e,t)},Lo.prototype.stat=function(e,t){return this._stream.stat(e,t)},Lo.prototype.lstat=function(e,t){return this._stream.lstat(e,t)},Lo.prototype.opendir=function(e,t){return this._stream.opendir(e,t)},Lo.prototype.setstat=function(e,t,r){return this._stream.setstat(e,t,r)},Lo.prototype.fsetstat=function(e,t,r){return this._stream.fsetstat(e,t,r)},Lo.prototype.futimes=function(e,t,r,n){return this._stream.futimes(e,t,r,n)},Lo.prototype.utimes=function(e,t,r,n){return this._stream.utimes(e,t,r,n)},Lo.prototype.fchown=function(e,t,r,n){return this._stream.fchown(e,t,r,n)},Lo.prototype.chown=function(e,t,r,n){return this._stream.chown(e,t,r,n)},Lo.prototype.fchmod=function(e,t,r){return this._stream.fchmod(e,t,r)},Lo.prototype.chmod=function(e,t,r){return this._stream.chmod(e,t,r)},Lo.prototype.readlink=function(e,t){return this._stream.readlink(e,t)},Lo.prototype.symlink=function(e,t,r){return this._stream.symlink(e,t,r)},Lo.prototype.realpath=function(e,t){return this._stream.realpath(e,t)},Lo.prototype.ext_openssh_rename=function(e,t,r){return this._stream.ext_openssh_rename(e,t,r)},Lo.prototype.ext_openssh_statvfs=function(e,t){return this._stream.ext_openssh_statvfs(e,t)},Lo.prototype.ext_openssh_fstatvfs=function(e,t){return this._stream.ext_openssh_fstatvfs(e,t)},Lo.prototype.ext_openssh_hardlink=function(e,t,r){return this._stream.ext_openssh_hardlink(e,t,r)},Lo.prototype.ext_openssh_fsync=function(e,t){return this._stream.ext_openssh_fsync(e,t)};var Do,xo,Po,Ho,Mo,jo=Lo,Go={};function Fo(){if(Po)return xo;Po=1;var e=(Do||(Do=1,Go.spliceOne=function(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}),Go).spliceOne;function t(t,r,n){var i=this._streams=[];this._timer=void 0,this._timerInterval=t,this._timerfn=function(){for(var t,o,s=Date.now(),a=0,u=i.length;a<u;++a)if((o=(t=i[a])._kalast)&&s-o>=r)if(++t._kacnt>n){var f=new Error("Keepalive timeout");f.level="client-timeout",t.emit("error",f),t.disconnect(),e(i,a),--a,u=i.length}else t._kalast=s,t.ping()}}return t.prototype.start=function(){this._timer&&this.stop(),this._timer=setInterval(this._timerfn,this._timerInterval)},t.prototype.stop=function(){this._timer&&(clearInterval(this._timer),this._timer=void 0)},t.prototype.add=function(e){var t=this._streams,r=this;function n(){e._kalast=Date.now(),e._kacnt=0}e.once("end",(function(){r.remove(e)})).on("packet",n),t[t.length]=e,n(),this._timer||this.start()},t.prototype.remove=function(t){var r=this._streams,n=r.indexOf(t);~n&&e(r,n),r.length||this.stop()},xo=t}var Wo=m,qo=E.Socket,Ko=w.lookup,zo=v.EventEmitter,Vo=y.inherits,Xo=Mi,Qo=Xo.SSH2Stream,$o=Xo.SFTPStream,Yo=Xo.constants,Zo=Xo.utils.parseKey,Jo=Xo.utils.decryptKey,es=Xo.utils.genPublicKey,ts=wo,rs=function(e,t,r,n,i){var o,s,a,u,f,c,h,l,p=0,d=Buffer.isBuffer(t),g=0,v=0,_=0,y=0,m=!1;function E(){var e;if(d){var r=9;(e=new Buffer(9+p+4+u+4)).writeUInt32BE(e.length-4,0,!0),e[4]=13,e.writeUInt32BE(p,5,!0),t.copy(e,r),e.writeUInt32BE(u,r+=p,!0),n.copy(e,r+=4),e.writeUInt32BE(0,r+=u,!0),o.write(e)}else o.write(new Buffer([0,0,0,1,11]))}function w(e){for(var r=0,n=e.length;r<n;++r)if(void 0===f)5==++g&&(f=e[r],g=0);else if(14===f)if(a){if(a[g]=e[r],++g===v)return o.removeAllListeners("data"),o.destroy()}else v<<=8,v+=e[r],4==++g&&(a=new Buffer(v),g=0);else if(12===f)if(void 0===c){if(_<<=8,_+=e[r],4==++g&&(c=new Array(_),g=0,0===_))return o.removeAllListeners("data"),o.destroy()}else if(t)if(!1===m){if(t[g]=e[r],++g===p&&(c[_-1]=t,p=0,g=0,m=!0,0==--_))return t=void 0,o.removeAllListeners("data"),o.destroy()}else!0===m?(y<<=8,y+=e[r],4==++g&&(g=0,y>0?m=y:(t=void 0,m=!1),y=0)):++g===m&&(m=!1,g=0,t=void 0);else p<<=8,p+=e[r],4==++g&&(t=new Buffer(p),g=0);else if(5===f)return s=d?new Error("Agent unable to sign data"):new Error("Unable to retrieve list of keys from agent"),o.removeAllListeners("data"),o.destroy()}function b(e){s=e}function S(){s?i(s):d&&!a||!d&&!c?i(new Error("Unexpected disconnection from agent")):d&&a?i(void 0,a):!d&&c&&i(void 0,c)}if("function"==typeof t&&"function"==typeof r?(h=t,l=r):d?(p=t.length,u=n.length):(i=t,t=void 0),"win32"===process.platform){if("pageant"!==e){var B=!1;return void Ao.readFile(e,(function t(r,n){if(r)return B?i(new Error("Invalid cygwin unix socket path")):void To.exec('cygpath -w "'+e+'"',(function(r,n,o){if(r||0===n.length)return i(new Error("Invalid cygwin unix socket path"));B=!0,e=n.toString().replace(/[\r\n]/g,""),Ao.readFile(e,t)}));var s;if(s=ko.exec(n.toString("ascii"))){var a,u,f,c,h,l,p=0,d=!1,g=[],v=new Buffer(12);for(v.fill(0),a=parseInt(s[1],10),u=s[2].replace(/\-/g,""),f=new Buffer(16),h=0,l=0;l<32;++h,l+=2)f[h]=parseInt(u.substring(l,l+2),16);for(h=0;h<16;h+=4)f.writeUInt32LE(f.readUInt32BE(h,!0),h,!0);function _(){p=0,c="secret",o.write(f)}function y(e){p+=e.length,"secret"===c?16===p&&(p=0,c="creds",o.write(v)):"creds"===c&&(d||g.push(e),12===p&&(o.removeListener("connect",_),o.removeListener("data",y),o.removeListener("close",m),d?(I(),o.emit("connect")):(d=!0,(v=Buffer.concat(g)).writeUInt32LE(process.pid,0,!0),o.destroy(),E())))}function m(){i(new Error("Problem negotiating cygwin unix socket security"))}function E(){(o=new bo).once("connect",_),o.on("data",y),o.once("close",m),o.connect(a)}E()}else i(new Error("Malformed cygwin unix socket file"))}))}o=new Oo}else o=new bo;function I(){var e;h||l?(o.once("connect",(function(){e=h();var t=!1;function r(){t||(o.destroy(),t=!0)}e.once("end",r).once("close",r).on("data",(function(e){o.write(e)})),o.on("data",(function(t){e.write(t)}))})),o.once("close",(function(){e||l()}))):(o.once("connect",E),o.on("data",w),o.once("error",b),o.once("close",S))}I(),o.connect(e)},ns=jo,is=Math.pow(2,32)-1,os=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,ss=function(e){};function as(){if(!(this instanceof as))return new as;zo.call(this),this.config={host:void 0,port:void 0,forceIPv4:void 0,forceIPv6:void 0,keepaliveCountMax:void 0,keepaliveInterval:void 0,readyTimeout:void 0,compress:void 0,username:void 0,password:void 0,privateKey:void 0,publicKey:void 0,tryKeyboard:void 0,agent:void 0,allowAgentFwd:void 0,hostHashAlgo:void 0,hostHashCb:void 0,strictVendor:void 0,debug:void 0},this._readyTimeout=void 0,this._channels=void 0,this._callbacks=void 0,this._forwarding=void 0,this._acceptX11=void 0,this._agentFwdEnabled=void 0,this._curChan=void 0,this._remoteVer=void 0,this._sshstream=void 0,this._sock=void 0,this._resetKA=void 0}function us(e,t,r,n){var i=fs(e),o=ts.MAX_WINDOW,s=ts.PACKET_SIZE,a=!0;if(!1===i)return n(new Error("No free channels available"));"function"==typeof r&&(n=r,r={}),e._channels[i]=!0;var u=e._sshstream;return u.once("CHANNEL_OPEN_CONFIRMATION:"+i,f).once("CHANNEL_OPEN_FAILURE:"+i,c).once("CHANNEL_CLOSE:"+i,c),"session"===t?a=u.session(i,o,s):"direct-tcpip"===t?a=u.directTcpip(i,o,s,r):"direct-streamlocal@openssh.com"===t&&(a=u.openssh_directStreamLocal(i,o,s,r)),a;function f(r){u.removeListener("CHANNEL_OPEN_FAILURE:"+i,c),u.removeListener("CHANNEL_CLOSE:"+i,c);var a={type:t,incoming:{id:i,window:o,packetSize:s,state:"open"},outgoing:{id:r.sender,window:r.window,packetSize:r.packetSize,state:"open"}};n(void 0,new ts(a,e))}function c(t){var r;u.removeListener("CHANNEL_OPEN_CONFIRMATION:"+i,f),u.removeListener("CHANNEL_OPEN_FAILURE:"+i,c),u.removeListener("CHANNEL_CLOSE:"+i,c),delete e._channels[i],t instanceof Error?r=t:"object"==typeof t&&null!==t?((r=new Error("(SSH) Channel open failure: "+t.description)).reason=t.reason,r.lang=t.lang):(r=new Error("(SSH) Channel open failure: server closed channel unexpectedly")).reason=r.lang="",n(r)}}function fs(e){if(e._curChan<is)return++e._curChan;for(var t=0,r=e._channels;t<is;++t)if(!r[t])return t;return!1}function cs(e,t,r){var n={single:!1,protocol:"MIT-MAGIC-COOKIE-1",cookie:Wo.randomBytes(16).toString("hex"),screen:"number"==typeof t?t:0};"function"==typeof t?r=t:"object"==typeof t&&("boolean"==typeof t.single&&(n.single=t.single),"number"==typeof t.screen&&(n.screen=t.screen));var i="function"==typeof r;return"open"!==e.outgoing.state?(i&&r(new Error("Channel is not open")),!0):(i&&e._callbacks.push((function(t){if(t)return r(!0!==t?t:new Error("Unable to request X11"));e._hasX11=!0,++e._client._acceptX11,e.once("close",(function(){e._client._acceptX11&&--e._client._acceptX11})),r()})),e._client._sshstream.x11Forward(e.outgoing.id,n,i))}function hs(e,t,r){var n=24,i=80,o=640,s=480,a="vt100";"function"==typeof t?r=t:"object"==typeof t&&("number"==typeof t.rows&&(n=t.rows),"number"==typeof t.cols&&(i=t.cols),"number"==typeof t.width&&(o=t.width),"number"==typeof t.height&&(s=t.height),"string"==typeof t.term&&(a=t.term));var u="function"==typeof r;return"open"!==e.outgoing.state?(u&&r(new Error("Channel is not open")),!0):(u&&e._callbacks.push((function(e){if(e)return r(!0!==e?e:new Error("Unable to request a pseudo-terminal"));r()})),e._client._sshstream.pty(e.outgoing.id,n,i,s,o,a,null,u))}function ls(e,t){var r="function"==typeof t;return"open"!==e.outgoing.state?(r&&t(new Error("Channel is not open")),!0):e._client._agentFwdEnabled?(r&&t(!1),!0):(e._client._agentFwdEnabled=!0,e._callbacks.push((function(n){if(n)return e._client._agentFwdEnabled=!1,void(r&&t(!0!==n?n:new Error("Unable to request agent forwarding")));r&&t()})),e._client._sshstream.openssh_agentForward(e.outgoing.id,!0))}function ps(e,t,r){return"open"!==e.outgoing.state?(r(new Error("Channel is not open")),!0):(e._callbacks.push((function(n){if(n)return r(!0!==n?n:new Error("Unable to start subsystem: "+t));e.subtype="subsystem",r(void 0,e)})),e._client._sshstream.subsystem(e.outgoing.id,t,!0))}Vo(as,zo),as.prototype.connect=function(e){var t=this;if(this._sock&&this._sock.writable)return this.once("close",(function(){t.connect(e)})),void this.end();this.config.host=e.hostname||e.host||"localhost",this.config.port=e.port||22,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.compress=e.compress,this.config.username=e.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.publicKey=void 0,this.config.localHostname="string"==typeof e.localHostname&&e.localHostname.length?e.localHostname:void 0,this.config.localUsername="string"==typeof e.localUsername&&e.localUsername.length?e.localUsername:void 0,this.config.tryKeyboard=!0===e.tryKeyboard,this.config.agent="string"==typeof e.agent&&e.agent.length?e.agent:void 0,this.config.allowAgentFwd=!0===e.agentForward&&void 0!==this.config.agent,this.config.strictVendor="boolean"!=typeof e.strictVendor||e.strictVendor;var r=this.config.debug="function"==typeof e.debug?e.debug:ss;if("string"!=typeof this.config.username)throw new Error("Invalid username");if(!0===e.agentForward&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");var n=this._callbacks=[];if(this._channels={},this._forwarding={},this._acceptX11=0,this._agentFwdEnabled=!1,this._curChan=-1,this._remoteVer=void 0,this.config.privateKey){var i=Zo(this.config.privateKey);if(i instanceof Error)throw new Error("Cannot parse privateKey: "+i.message);if(!i.private)throw new Error("privateKey value does not contain a (valid) private key");if(i.encryption){if("string"!=typeof e.passphrase)throw new Error("Encrypted private key detected, but no passphrase given");Jo(i,e.passphrase)}this.config.privateKey=i,this.config.publicKey=es(i)}var o=this._sshstream=new Qo({debug:r===ss?void 0:r}),s=this._sock=e.sock||new qo;this._sock.stderr&&this._sock.stderr.resume();var a,u=this.config.keepaliveInterval,f=this.config.keepaliveCountMax,c=0;function h(){if(++c>f){if(clearInterval(a),s.readable){var e=new Error("Keepalive timeout");e.level="client-timeout",t.emit("error",e),s.destroy()}}else s.writable?(n.push(l),o.ping()):clearInterval(a)}function l(){u>0&&(c=0,clearInterval(a),s.writable&&(a=setInterval(h,u)))}if(this._resetKA=l,o.on("USERAUTH_BANNER",(function(e){t.emit("banner",e)})),s.on("connect",(function(){r("DEBUG: Client: Connected"),t.emit("connect"),t._sock.setKeepAlive(!0),e.sock||o.pipe(s).pipe(o)})).on("timeout",(function(){t.emit("timeout")})).on("error",(function(e){clearTimeout(t._readyTimeout),e.level="client-socket",t.emit("error",e)})).on("end",(function(){o.unpipe(s),clearTimeout(t._readyTimeout),clearInterval(a),t.emit("end")})).on("close",(function(){o.unpipe(s),clearTimeout(t._readyTimeout),clearInterval(a),t.emit("close");var e=n,r=new Error("No response from server");n=t._callbacks=[];for(var i=0;i<e.length;++i)e[i](r);var u=Object.keys(t._channels);t._channels={};for(i=0;i<u.length;++i)o.emit("CHANNEL_OPEN_FAILURE:"+u[i],r),o.emit("CHANNEL_CLOSE:"+u[i])})),o.on("drain",(function(){t.emit("drain")})).once("header",(function(e){t._remoteVer=e.versions.software,e.greeting&&t.emit("greeting",e.greeting)})).on("continue",(function(){t.emit("continue")})).on("error",(function(e){e.level="protocol",t.emit("error",e)})),"function"==typeof e.hostVerifier&&~Wo.getHashes().indexOf(e.hostHash)){var p=e.hostVerifier,d=Wo.createHash(e.hostHash);o.once("fingerprint",(function(e,t){d.update(e,"binary"),t(p(d.digest("hex")))}))}var g,v,_=[],y=0;function m(){if(!_.length){o.removeListener("USERAUTH_FAILURE",b),o.removeListener("USERAUTH_PK_OK",w);var e=new Error("All configured authentication methods failed");return e.level="client-authentication",t.emit("error",e),void(o.writable&&t.end())}switch(g=_.shift()){case"password":o.authPassword(t.config.username,t.config.password);break;case"publickey":o.authPK(t.config.username,t.config.publicKey),o.once("USERAUTH_PK_OK",w);break;case"hostbased":o.authHostbased(t.config.username,t.config.publicKey,t.config.localHostname,t.config.localUsername,(function(e,r){var n=Wo.createSign("rsa"===t.config.privateKey.type?"RSA-SHA1":"DSA-SHA1");if(n.update(e),n=n.sign(t.config.privateKey.privateOrig,"binary"),n=new Buffer(n,"binary"),"dss"===t.config.privateKey.type&&n.length>40){for(var i=new Buffer(40),o=4,s=5+n[3]+1;0===n[o];)++o;for(;0===n[s];)++s;n.copy(i,0,o,o+20),n.copy(i,20,s,s+20),n=i}r(n)}));break;case"agent":rs(t.config.agent,(function(e,n){return e?(e.level="agent",t.emit("error",e),v=void 0,m()):0===n.length?(r("DEBUG: Agent: No keys stored in agent"),v=void 0,m()):(v=n,y=0,o.authPK(t.config.username,n[0]),void o.once("USERAUTH_PK_OK",w))}));break;case"keyboard-interactive":o.authKeyboard(t.config.username),o.on("USERAUTH_INFO_REQUEST",E);break;case"none":o.authNone(t.config.username)}}function E(e,n,i,s){if(0===(Array.isArray(s)?s.length:0))return r("DEBUG: Client: Sending automatic USERAUTH_INFO_RESPONSE"),o.authInfoRes();t.emit("keyboard-interactive",e,n,i,s,(function(e){o.authInfoRes(e)}))}function w(){if("agent"===g){var e=v[y],r=e.toString("ascii",4,4+e.readUInt32BE(0,!0)).substring(4,7);o.authPK(t.config.username,e,(function(n,i){rs(t.config.agent,e,r,n,(function(e,n){if(e)return e.level="agent",t.emit("error",e),v=void 0,m();var o;o=n.toString("ascii",4,11)==="ssh-"+r?n.slice(15):n,i(o)}))}))}else"publickey"===g&&o.authPK(t.config.username,t.config.publicKey,(function(e,r){var n=Wo.createSign("rsa"===t.config.privateKey.type?"RSA-SHA1":"DSA-SHA1");if(n.update(e),n=n.sign(t.config.privateKey.privateOrig,"binary"),n=new Buffer(n,"binary"),"dss"===t.config.privateKey.type&&n.length>40){for(var i=new Buffer(40),o=4,s=5+n[3]+1;0===n[o];)++o;for(;0===n[s];)++s;n.copy(i,0,o,o+20),n.copy(i,20,s,s+20),n=i}r(n)}))}function b(e,n){if(o.removeListener("USERAUTH_PK_OK",w),o.removeListener("USERAUTH_INFO_REQUEST",E),"agent"===g)return r("DEBUG: Client: Agent key #"+(y+1)+" failed"),void(++y>=v.length?(r("DEBUG: Agent: No more keys left to try"),r("DEBUG: Client: "+g+" auth failed"),v=void 0,m()):(r("DEBUG: Agent: Trying key #"+(y+1)),o.authPK(t.config.username,v[y]),o.once("USERAUTH_PK_OK",w)));r("DEBUG: Client: "+g+" auth failed"),m()}if(void 0!==this.config.password&&_.push("password"),void 0!==this.config.publicKey&&_.push("publickey"),void 0!==this.config.agent&&_.push("agent"),this.config.tryKeyboard&&_.push("keyboard-interactive"),void 0!==this.config.publicKey&&void 0!==this.config.localHostname&&void 0!==this.config.localUsername&&_.push("hostbased"),_.push("none"),o.once("USERAUTH_SUCCESS",(function(){_=void 0,o.removeListener("USERAUTH_FAILURE",b),o.removeListener("USERAUTH_INFO_REQUEST",E),l(),clearTimeout(t._readyTimeout),t.emit("ready")})).on("USERAUTH_FAILURE",b),o.once("NEWKEYS",(function(){o.service("ssh-userauth"),o.once("SERVICE_ACCEPT",(function(e){"ssh-userauth"===e&&m()}))})),o.on("CHANNEL_OPEN",(function(e){!function(e,t){var r,n=!1;function i(){var r={type:t.type,incoming:{id:n,window:ts.MAX_WINDOW,packetSize:ts.PACKET_SIZE,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},i=new ts(r,e);return e._sshstream.channelOpenConfirm(t.sender,n,ts.MAX_WINDOW,ts.PACKET_SIZE),i}function o(){void 0===r&&(r=!1===n?Yo.CHANNEL_OPEN_FAILURE.RESOURCE_SHORTAGE:Yo.CHANNEL_OPEN_FAILURE.CONNECT_FAILED),e._sshstream.channelOpenFail(t.sender,r,"","")}if("forwarded-tcpip"===t.type||"x11"===t.type||"auth-agent@openssh.com"===t.type){var s="forwarded-tcpip"===t.type&&!e._forwarding[t.data.destIP+":"+t.data.destPort]||"x11"===t.type&&0===e._acceptX11||"auth-agent@openssh.com"===t.type&&!e._agentFwdEnabled;s?(r=Yo.CHANNEL_OPEN_FAILURE.ADMINISTRATIVELY_PROHIBITED,e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: unexpected channel open for: "+t.type)):!1===(n=fs(e))?(e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: no channels available"),s=!0):e._channels[n]=!0,s&&o(),!1!==n&&("forwarded-tcpip"===t.type?e.emit("tcp connection",t.data,i,o):"x11"===t.type?e.emit("x11",t.data,i,o):rs(e.config.agent,i,o))}else e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: unsupported type: "+t.type),r=Yo.CHANNEL_OPEN_FAILURE.UNKNOWN_CHANNEL_TYPE,o()}(t,e)})),o.on("REQUEST_SUCCESS",(function(e){n.length&&n.shift()(!1,e)})).on("REQUEST_FAILURE",(function(){n.length&&n.shift()(!0)})),o.on("GLOBAL_REQUEST",(function(e,t,r){t&&o.requestFailure()})),e.sock)T(),o.pipe(s).pipe(o);else{var S=this.config.host,B=this.config.forceIPv4,I=this.config.forceIPv6;function A(){T(),t._sock.connect(t.config.port,S),t._sock.setNoDelay(!0),t._sock.setMaxListeners(0),t._sock.setTimeout("number"==typeof e.timeout?e.timeout:0)}r("DEBUG: Client: Trying "+S+" on port "+this.config.port+" ..."),!B&&!I||B&&I?A():Ko(S,B?4:6,(function(e,r,n){if(e){var i=new Error("Error while looking up "+(B?"IPv4":"IPv6")+" address for host "+S+": "+e);return clearTimeout(t._readyTimeout),i.level="client-dns",t.emit("error",i),void t.emit("close")}S=r,A()}))}function T(){t.config.readyTimeout>0&&(t._readyTimeout=setTimeout((function(){var e=new Error("Timed out while waiting for handshake");e.level="client-timeout",t.emit("error",e),s.destroy()}),t.config.readyTimeout))}},as.prototype.end=function(){return!!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable)&&this._sshstream.disconnect()},as.prototype.destroy=function(){this._sock&&this._sock.destroy()},as.prototype.exec=function(e,t,r){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");"function"==typeof t&&(r=t,t={});var n=this;return us(this,"session",{allowHalfOpen:!1!==t.allowHalfOpen},(function(i,o){if(i)return r(i);var s=[];function a(e){if(e)return o.close(),r(e);s.length&&s.shift()()}(!0===n.config.allowAgentFwd||t&&!0===t.agentForward&&void 0!==n.config.agent)&&s.push((function(){ls(o,a)})),"object"==typeof t&&("object"==typeof t.env&&function(e,t){if("open"!==e.outgoing.state)return!0;for(var r,n,i=!0,o=Object.keys(t||{}),s=0,a=o.length;s<a;++s)n=t[r=o[s]],i=e._client._sshstream.env(e.outgoing.id,r,n,!1)}(o,t.env),"object"!=typeof t.pty&&!0!==t.pty||s.push((function(){hs(o,t.pty,a)})),"object"!=typeof t.x11&&"number"!==t.x11&&!0!==t.x11||s.push((function(){cs(o,t.x11,a)}))),s.push((function(){!function(e,t,r,n){if("open"!==e.outgoing.state)return n(new Error("Channel is not open")),!0;e._callbacks.push((function(t){if(t)return n(!0!==t?t:new Error("Unable to exec"));e.subtype="exec",e.allowHalfOpen=!1!==r.allowHalfOpen,n(void 0,e)})),e._client._sshstream.exec(e.outgoing.id,t,!0)}(o,e,t,r)})),s.shift()()}))},as.prototype.shell=function(e,t,r){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");var n=this;return"function"==typeof e?(r=e,e=t=void 0):"function"==typeof t&&(r=t,t=void 0),e&&void 0!==e.x11&&(t=e,e=void 0),us(this,"session",(function(i,o){if(i)return r(i);var s=[];function a(e){if(e)return o.close(),r(e);s.length&&s.shift()()}(!0===n.config.allowAgentFwd||t&&!0===t.agentForward&&void 0!==n.config.agent)&&s.push((function(){ls(o,a)})),!1!==e&&s.push((function(){hs(o,e,a)})),"object"==typeof t&&("object"!=typeof t.x11&&"number"!==t.x11&&!0!==t.x11||s.push((function(){cs(o,t.x11,a)}))),s.push((function(){!function(e,t){if("open"!==e.outgoing.state)return t(new Error("Channel is not open")),!0;e._callbacks.push((function(r){if(r)return t(!0!==r?r:new Error("Unable to open shell"));e.subtype="shell",t(void 0,e)})),e._client._sshstream.shell(e.outgoing.id,!0)}(o,r)})),s.shift()()}))},as.prototype.subsys=function(e,t){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");return us(this,"session",(function(r,n){if(r)return t(r);ps(n,e,(function(e,r){if(e)return t(e);t(void 0,r)}))}))},as.prototype.sftp=function(e){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");var t=this;return us(this,"session",(function(r,n){if(r)return e(r);ps(n,"sftp",(function(r,n){if(r)return e(r);var i=t._sshstream._state.incoming.identRaw,o={debug:t.config.debug},s=new $o(o,i);function a(t){s.removeListener("ready",u),n.removeListener("exit",f),e(t)}function u(){s.removeListener("error",a),n.removeListener("exit",f),e(void 0,new ns(s))}function f(t,r){var n;s.removeListener("ready",u),s.removeListener("error",a),n="number"==typeof t?"Received exit code "+t+" while establishing SFTP session":"Received signal "+r+" while establishing SFTP session";var i=new Error(n);i.code=t,i.signal=r,e(i)}s.once("error",a).once("ready",u).once("close",(function(){n.end()})),n.once("exit",f),s.pipe(n).pipe(s)}))}))},as.prototype.forwardIn=function(e,t,r){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");var n=this,i="function"==typeof r;return i&&this._callbacks.push((function(i,o){if(i)return r(!0!==i?i:new Error("Unable to bind to "+e+":"+t));0===t&&o&&o.length>=4&&(t=o.readUInt32BE(0,!0)),n._forwarding[e+":"+t]=!0,r(void 0,t)})),this._sshstream.tcpipForward(e,t,i)},as.prototype.unforwardIn=function(e,t,r){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");var n=this,i="function"==typeof r;return i&&this._callbacks.push((function(i){if(i)return r(!0!==i?i:new Error("Unable to unbind from "+e+":"+t));delete n._forwarding[e+":"+t],r()})),this._sshstream.cancelTcpipForward(e,t,i)},as.prototype.forwardOut=function(e,t,r,n,i){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");return us(this,"direct-tcpip",{srcIP:e,srcPort:t,dstIP:r,dstPort:n},i)},as.prototype.openssh_noMoreSessions=function(e){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");var t="function"==typeof e;return!this.config.strictVendor||this.config.strictVendor&&os.test(this._remoteVer)?(t&&this._callbacks.push((function(t){if(t)return e(!0!==t?t:new Error("Unable to disable future sessions"));e()})),this._sshstream.openssh_noMoreSessions(t)):(t&&process.nextTick((function(){e(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))})),!0)},as.prototype.openssh_forwardInStreamLocal=function(e,t){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");var r="function"==typeof t;return!this.config.strictVendor||this.config.strictVendor&&os.test(this._remoteVer)?(r&&this._callbacks.push((function(r){if(r)return t(!0!==r?r:new Error("Unable to bind to "+e));t()})),this._sshstream.openssh_streamLocalForward(e,r)):(r&&process.nextTick((function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))})),!0)},as.prototype.openssh_unforwardInStreamLocal=function(e,t){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");var r="function"==typeof t;return!this.config.strictVendor||this.config.strictVendor&&os.test(this._remoteVer)?(r&&this._callbacks.push((function(r){if(r)return t(!0!==r?r:new Error("Unable to unbind on "+e));t()})),this._sshstream.openssh_cancelStreamLocalForward(e,r)):(r&&process.nextTick((function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))})),!0)},as.prototype.openssh_forwardOutStreamLocal=function(e,t){if(!(this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable))throw new Error("Not connected");return!this.config.strictVendor||this.config.strictVendor&&os.test(this._remoteVer)?us(this,"direct-streamlocal@openssh.com",{socketPath:e},t):(process.nextTick((function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))})),!0)},as.Client=as,as.Server=function(){if(Mo)return Ho;Mo=1;var e,t=E,r=v.EventEmitter,n=r.listenerCount,i=y.inherits,o=Mi.SSH2Stream,s=Mi.SFTPStream,a=Mi.constants,u=a.DISCONNECT_REASON,f=a.CHANNEL_OPEN_FAILURE,c=wo,h=Fo(),l=Math.pow(2,32)-1,p=10;function d(i,s){if(!(this instanceof d))return new d(i,s);!e&&d.KEEPALIVE_INTERVAL>0&&d.KEEPALIVE_CLIENT_INTERVAL>0&&d.KEEPALIVE_CLIENT_COUNT_MAX>=0&&(e=new h(d.KEEPALIVE_INTERVAL,d.KEEPALIVE_CLIENT_INTERVAL,d.KEEPALIVE_CLIENT_COUNT_MAX));var a=this;r.call(this),"function"==typeof s&&a.on("connection",s);for(var f={},c=0,l=Object.keys(i),p=l.length;c<p;++c)f[l[c]]=i[l[c]];if(f.server=!0,"function"==typeof f.debug)var v=f.debug,_=Object.keys(f);this._srv=new t.Server((function(e){if(a._connections>=a.maxConnections)e.destroy();else{++a._connections,e.once("close",(function(e){--a._connections,c.read()})).on("error",(function(e){c.reset(),c.emit("error",e)}));var t=f;if(v){t={};for(var r,i=0;i<_.length;++i)t[r=_[i]]=f[r];var s="["+process.hrtime().join(".")+"] ";t.debug=function(e){v(s+e)}}var c=new o(t),h=new g(c,e);e.pipe(c).pipe(e),h.on("error",l),c.once("header",(function(t){if(!c._readableState.ended){if(!n(a,"connection"))return c.disconnect(u.BY_APPLICATION);h.removeListener("error",l),a.emit("connection",h,{ip:e.remoteAddress,header:t})}}))}function l(e){}})).on("error",(function(e){a.emit("error",e)})).on("listening",(function(){a.emit("listening")})).on("close",(function(){a.emit("close")})),this._connections=0,this.maxConnections=1/0}function g(t,i){r.call(this);var o=this;this._sshstream=t;var s=this._channels={};this._curChan=-1,this._sock=i,this.noMoreSessions=!1,this.authenticated=!1,t.on("end",(function(){o.emit("end")})).on("close",(function(e){o.emit("close",e)})).on("error",(function(e){o.emit("error",e)})).on("drain",(function(){o.emit("drain")})).on("continue",(function(){o.emit("continue")}));var a,h=0,l=!1,d=[];function g(e,r,i,s){if(0===h||a&&(a.username!==e||a.service!==r)||"password"!==i&&"publickey"!==i&&"hostbased"!==i&&"keyboard-interactive"!==i&&"none"!==i||d.length===p)return t.disconnect(u.PROTOCOL_ERROR);if("ssh-connection"!==r)return t.disconnect(u.SERVICE_NOT_AVAILABLE);var f;if(t._state.authMethod=i,"keyboard-interactive"===i?f=new b(t,e,r,i,s,v):"publickey"===i?f=new S(t,e,r,i,s,v):"hostbased"===i?f=new B(t,e,r,i,s,v):"password"===i?f=new I(t,e,r,i,s,v):"none"===i&&(f=new m(t,e,r,i,v)),a){if(!a._initialResponse)return d.push(f);a._multistep&&!this._finalResponse&&(a._cleanup&&a._cleanup(),a.emit("abort"))}a=f,n(o,"authentication")?o.emit("authentication",a):a.reject()}function v(e,r,i,s){a!==e||o.authenticated||(r?(t.removeListener("USERAUTH_REQUEST",g),a=void 0,o.authenticated=!0,t.authSuccess(),d=[],o.emit("ready")):(t.authFailure(i,s),d.length&&(a=d.pop(),n(o,"authentication")?o.emit("authentication",a):a.reject())))}t.on("SERVICE_REQUEST",(function(e){if(0===h||l||o.authenticated||"ssh-userauth"!==e)return t.disconnect(u.SERVICE_NOT_AVAILABLE);l=!0,t.serviceAccept(e)})).on("USERAUTH_REQUEST",g),t.on("GLOBAL_REQUEST",(function(e,r,i){if(("tcpip-forward"===e||"cancel-tcpip-forward"===e||"no-more-sessions@openssh.com"===e||"streamlocal-forward@openssh.com"===e||"cancel-streamlocal-forward@openssh.com"===e)&&n(o,"request")&&o.authenticated){var s,a;if(r){var u=!1;s=function(r){var n;if(!u)return u=!0,"tcpip-forward"===e&&0===i.bindPort&&"number"==typeof r&&(n=new Buffer(4)).writeUInt32BE(r,0,!0),t.requestSuccess(n)},a=function(){if(!u)return u=!0,t.requestFailure()}}if("no-more-sessions@openssh.com"===e)return o.noMoreSessions=!0,void(s&&s());o.emit("request",s,a,e,i)}else r&&t.requestFailure()})),t.on("CHANNEL_OPEN",(function(e){if("session"===e.type&&o.noMoreSessions||!o.authenticated){var r=f.ADMINISTRATIVELY_PROHIBITED;return t.channelOpenFail(e.sender,r)}var i,a,u=T(o),h=!1;if(!1===u)return t.channelOpenFail(e.sender,f.RESOURCE_SHORTAGE);switch(s[u]=!0,a=function(){if(!h){h=!0,delete s[u];var r=f.ADMINISTRATIVELY_PROHIBITED;return t.channelOpenFail(e.sender,r)}},e.type){case"session":n(o,"session")?(i=function(){if(!h)return h=!0,t.channelOpenConfirm(e.sender,u,c.MAX_WINDOW,c.PACKET_SIZE),new _(o,e,u)},o.emit("session",i,a)):a();break;case"direct-tcpip":n(o,"tcpip")?(i=function(){if(!h){h=!0,t.channelOpenConfirm(e.sender,u,c.MAX_WINDOW,c.PACKET_SIZE);var r={type:void 0,incoming:{id:u,window:c.MAX_WINDOW,packetSize:c.PACKET_SIZE,state:"open"},outgoing:{id:e.sender,window:e.window,packetSize:e.packetSize,state:"open"}};return new c(r,o)}},o.emit("tcpip",i,a,e.data)):a();break;case"direct-streamlocal@openssh.com":n(o,"openssh.streamlocal")?(i=function(){if(!h){h=!0,t.channelOpenConfirm(e.sender,u,c.MAX_WINDOW,c.PACKET_SIZE);var r={type:void 0,incoming:{id:u,window:c.MAX_WINDOW,packetSize:c.PACKET_SIZE,state:"open"},outgoing:{id:e.sender,window:e.window,packetSize:e.packetSize,state:"open"}};return new c(r,o)}},o.emit("openssh.streamlocal",i,a,e.data)):a();break;default:a()}})),t.on("NEWKEYS",(function(){++h>1&&o.emit("rekey")})),e&&this.once("ready",(function(){e.add(t)}))}function _(e,t,r){this.subtype=void 0;var i,o=!1,a=this,u=t.sender,f={type:"session",incoming:{id:r,window:c.MAX_WINDOW,packetSize:c.PACKET_SIZE,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}};e._sshstream.on("CHANNEL_REQUEST:"+r,(function(t){var r,h,l=!1;if(t.wantReply&&("shell"!==t.request&&"exec"!==t.request&&"subsystem"!==t.request&&(r=function(){if(!(l||o||i))return l=!0,e._sshstream.channelSuccess(u)}),h=function(){if(!(l||o||i))return l=!0,e._sshstream.channelFailure(u)}),o)h&&h();else switch(t.request){case"env":n(a,"env")?a.emit("env",r,h,{key:t.key,val:t.val}):h&&h();break;case"pty-req":n(a,"pty")?a.emit("pty",r,h,{cols:t.cols,rows:t.rows,width:t.width,height:t.height,term:t.term,modes:t.modes}):h&&h();break;case"window-change":n(a,"window-change")?a.emit("window-change",r,h,{cols:t.cols,rows:t.rows,width:t.width,height:t.height}):h&&h();break;case"x11-req":n(a,"x11")?a.emit("x11",r,h,{single:t.single,protocol:t.protocol,cookie:t.cookie,screen:t.screen}):h&&h();break;case"signal":n(a,"signal")?a.emit("signal",r,h,{name:t.signal}):h&&h();break;case"auth-agent-req@openssh.com":n(a,"auth-agent")?a.emit("auth-agent",r,h):h&&h();break;case"shell":n(a,"shell")?(r=function(){if(!(l||o||i))return l=!0,t.wantReply&&e._sshstream.channelSuccess(u),(i=new c(f,e,{server:!0})).subtype=a.subtype=t.request,i},a.emit("shell",r,h)):h&&h();break;case"exec":n(a,"exec")?(r=function(){if(!(l||o||i))return l=!0,t.wantReply&&e._sshstream.channelSuccess(u),(i=new c(f,e,{server:!0})).subtype=a.subtype=t.request,i},a.emit("exec",r,h,{command:t.command})):h&&h();break;case"subsystem":r=function(){if(!(l||o||i)){if(l=!0,t.wantReply&&e._sshstream.channelSuccess(u),(i=new c(f,e,{server:!0})).subtype=a.subtype=t.request+":"+t.subsystem,"sftp"===t.subsystem){var r=new s({server:!0,debug:e._sshstream.debug});return i.pipe(r).pipe(i),r}return i}},"sftp"===t.subsystem&&n(a,"sftp")?a.emit("sftp",r,h):"sftp"!==t.subsystem&&n(a,"subsystem")?a.emit("subsystem",r,h,{name:t.subsystem}):h&&h();break;default:h&&h()}})).once("CHANNEL_EOF:"+r,(function(){o=!0,a.emit("eof"),a.emit("end")})).once("CHANNEL_CLOSE:"+r,(function(){o=!0,a.emit("close")}))}function m(e,t,n,i,o){r.call(this);var s=this;this.username=this.user=t,this.service=n,this.method=i,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=function(e,t,r){s._finalResponse||(s._finalResponse=!0,o(s,e,t,r))},this._stream=e}i(d,r),d.prototype.listen=function(){return this._srv.listen.apply(this._srv,arguments),this},d.prototype.address=function(){return this._srv.address()},d.prototype.getConnections=function(e){this._srv.getConnections(e)},d.prototype.close=function(e){return this._srv.close(e),this},d.prototype.ref=function(){this._srv.ref()},d.prototype.unref=function(){this._srv.unref()},i(g,r),g.prototype.end=function(){return this._sshstream.disconnect(u.BY_APPLICATION)},g.prototype.x11=function(e,t,r){return A(this,"x11",{originAddr:e,originPort:t},r)},g.prototype.forwardOut=function(e,t,r,n,i){return A(this,"forwarded-tcpip",{boundAddr:e,boundPort:t,remoteAddr:r,remotePort:n},i)},g.prototype.openssh_forwardOutStreamLocal=function(e,t){return A(this,"forwarded-streamlocal@openssh.com",{socketPath:e},t)},g.prototype.rekey=function(e){var t,r=this._sshstream,n=!0;try{n=r.rekey()}catch(e){t=e}return"function"==typeof e&&(t?process.nextTick((function(){e(t)})):this.once("rekey",e)),n},i(_,r),i(m,r),m.prototype.accept=function(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)},m.prototype.reject=function(e,t){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,e,t)};var w=/[ \t\r\n]*,[ \t\r\n]*/g;function b(e,t,r,n,i,o){m.call(this,e,t,r,n,o),this._multistep=!0;var s=this;this._cb=void 0,this._onInfoResponse=function(e){if(s._cb){var t=s._cb;s._cb=void 0,t(e)}},this.submethods=i.split(w),this.on("abort",(function(){s._cb&&s._cb(new Error("Authentication request aborted"))}))}function S(e,t,r,n,i,o){m.call(this,e,t,r,n,o),this.key={algo:i.keyAlgo,data:i.key},this.signature=i.signature,this.signature?this.sigAlgo="ssh-rsa"===i.keyAlgo?"RSA-SHA1":"DSA-SHA1":this.sigAlgo=void 0,this.blob=i.blob}function B(e,t,r,n,i,o){m.call(this,e,t,r,n,o),this.key={algo:i.keyAlgo,data:i.key},this.signature=i.signature,this.signature?this.sigAlgo="ssh-rsa"===i.keyAlgo?"RSA-SHA1":"DSA-SHA1":this.sigAlgo=void 0,this.blob=i.blob,this.localHostname=i.localHostname,this.localUsername=i.localUsername}function I(e,t,r,n,i,o){m.call(this,e,t,r,n,o),this.password=i}function A(e,t,r,n){var i=T(e),o=c.MAX_WINDOW,s=c.PACKET_SIZE,a=!0;if(!1===i)return n(new Error("No free channels available"));"function"==typeof r&&(n=r,r={}),e._channels[i]=!0;var u=e._sshstream;return u.once("CHANNEL_OPEN_CONFIRMATION:"+i,(function(r){u.removeAllListeners("CHANNEL_OPEN_FAILURE:"+i);var a={type:t,incoming:{id:i,window:o,packetSize:s,state:"open"},outgoing:{id:r.sender,window:r.window,packetSize:r.packetSize,state:"open"}};n(void 0,new c(a,e,{server:!0}))})).once("CHANNEL_OPEN_FAILURE:"+i,(function(t){u.removeAllListeners("CHANNEL_OPEN_CONFIRMATION:"+i),delete e._channels[i];var r=new Error("(SSH) Channel open failure: "+t.description);r.reason=t.reason,r.lang=t.lang,n(r)})),"forwarded-tcpip"===t?a=u.forwardedTcpip(i,o,s,r):"x11"===t?a=u.x11(i,o,s,r):"forwarded-streamlocal@openssh.com"===t&&(a=u.openssh_forwardedStreamLocal(i,o,s,r)),a}function T(e){if(e._curChan<l)return++e._curChan;for(var t=0,r=e._channels;t<l;++t)if(!r[t])return t;return!1}return i(b,m),b.prototype._cleanup=function(){this._stream.removeListener("USERAUTH_INFO_RESPONSE",this._onInfoResponse)},b.prototype.prompt=function(e,t,r,n){Array.isArray(e)||(e=[e]),"function"==typeof t?(n=t,t=r=void 0):"function"==typeof r&&(n=r,r=void 0);for(var i=0;i<e.length;++i)"string"==typeof e[i]&&(e[i]={prompt:e[i],echo:!0});return this._cb=n,this._initialResponse=!0,this._stream.once("USERAUTH_INFO_RESPONSE",this._onInfoResponse),this._stream.authInfoReq(t,r,e)},i(S,m),S.prototype.accept=function(){this.signature?m.prototype.accept.call(this):(this._initialResponse=!0,this._stream.authPKOK(this.key.algo,this.key.data))},i(B,m),i(I,m),d.createServer=function(e,t){return new d(e,t)},d.KEEPALIVE_INTERVAL=1e3,d.KEEPALIVE_CLIENT_INTERVAL=15e3,d.KEEPALIVE_CLIENT_COUNT_MAX=3,Ho=d}(),as.utils=Xo.utils,as.SFTP_STATUS_CODE=$o.STATUS_CODE,as.SFTP_OPEN_MODE=$o.OPEN_MODE;var ds=as,gs={exports:{}};!function(t,r){(function(){var n,i=200,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,f=128,c=256,h=1/0,l=9007199254740991,p=NaN,d=4294967295,g="[object Arguments]",v="[object Array]",_="[object Boolean]",y="[object Date]",m="[object Error]",E="[object Function]",w="[object GeneratorFunction]",b="[object Map]",S="[object Number]",B="[object Object]",I="[object Promise]",A="[object RegExp]",T="[object Set]",k="[object String]",U="[object Symbol]",R="[object WeakMap]",O="[object ArrayBuffer]",N="[object DataView]",C="[object Float32Array]",L="[object Float64Array]",D="[object Int8Array]",x="[object Int16Array]",P="[object Int32Array]",H="[object Uint8Array]",M="[object Uint8ClampedArray]",j="[object Uint16Array]",G="[object Uint32Array]",F=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39|#96);/g,z=/[&<>"'`]/g,V=RegExp(K.source),X=RegExp(z.source),Q=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+|\s+$/g,ie=/^\s+/,oe=/\s+$/,se=/[a-zA-Z0-9]+/g,ae=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,ce=/^0x/i,he=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,de=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,_e=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,me="\\ud800-\\udfff",Ee="\\u0300-\\u036f\\ufe20-\\ufe23",we="\\u20d0-\\u20f0",be="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Be="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Te="['’]",ke="["+me+"]",Ue="["+Ae+"]",Re="["+Ee+we+"]",Oe="\\d+",Ne="["+be+"]",Ce="["+Se+"]",Le="[^"+me+Ae+Oe+be+Se+Be+"]",De="\\ud83c[\\udffb-\\udfff]",xe="[^"+me+"]",Pe="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",Me="["+Be+"]",je="\\u200d",Ge="(?:"+Ce+"|"+Le+")",Fe="(?:"+Me+"|"+Le+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Re+"|"+De+")"+"?",ze="["+Ie+"]?",Ve=ze+Ke+("(?:"+je+"(?:"+[xe,Pe,He].join("|")+")"+ze+Ke+")*"),Xe="(?:"+[Ne,Pe,He].join("|")+")"+Ve,Qe="(?:"+[xe+Re+"?",Re,Pe,He,ke].join("|")+")",$e=RegExp(Te,"g"),Ye=RegExp(Re,"g"),Ze=RegExp(De+"(?="+De+")|"+Qe+Ve,"g"),Je=RegExp([Me+"?"+Ce+"+"+We+"(?="+[Ue,Me,"$"].join("|")+")",Fe+"+"+qe+"(?="+[Ue,Me+Ge,"$"].join("|")+")",Me+"?"+Ge+"+"+We,Me+"+"+qe,Oe,Xe].join("|"),"g"),et=RegExp("["+je+me+Ee+we+Ie+"]"),tt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","Reflect","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[C]=it[L]=it[D]=it[x]=it[P]=it[H]=it[M]=it[j]=it[G]=!0,it[g]=it[v]=it[O]=it[_]=it[N]=it[y]=it[m]=it[E]=it[b]=it[S]=it[B]=it[A]=it[T]=it[k]=it[R]=!1;var ot={};ot[g]=ot[v]=ot[O]=ot[N]=ot[_]=ot[y]=ot[C]=ot[L]=ot[D]=ot[x]=ot[P]=ot[b]=ot[S]=ot[B]=ot[A]=ot[T]=ot[k]=ot[U]=ot[H]=ot[M]=ot[j]=ot[G]=!0,ot[m]=ot[E]=ot[R]=!1;var st={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},at={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},ut={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},ft={function:!0,object:!0},ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ht=parseFloat,lt=parseInt,pt=r&&!r.nodeType?r:n,dt=t&&!t.nodeType?t:n,gt=dt&&dt.exports===pt?pt:n,vt=Xt(pt&&dt&&"object"==typeof e&&e),_t=Xt(ft[typeof self]&&self),yt=Xt(ft[typeof window]&&window),mt=Xt(ft[typeof this]&&this),Et=vt||yt!==(mt&&mt.window)&&yt||_t||mt||Function("return this")();function wt(e,t){return e.set(t[0],t[1]),e}function bt(e,t){return e.add(t),e}function St(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Bt(e,t,r,n){for(var i=-1,o=e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function It(e,t){for(var r=-1,n=e.length;++r<n&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=-1,n=e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Tt(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function kt(e,t){return!!e.length&&Pt(e,t,0)>-1}function Ut(e,t,r){for(var n=-1,i=e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Rt(e,t){for(var r=-1,n=e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Ot(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Nt(e,t,r,n){var i=-1,o=e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Ct(e,t,r,n){var i=e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Lt(e,t){for(var r=-1,n=e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function Dt(e,t,r,n){var i;return r(e,(function(e,r,o){if(t(e,r,o))return i=n?r:e,!1})),i}function xt(e,t,r){for(var n=e.length,i=r?n:-1;r?i--:++i<n;)if(t(e[i],i,e))return i;return-1}function Pt(e,t,r){if(t!=t)return Zt(e,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function Ht(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Mt(e,t){var r=e?e.length:0;return r?Gt(e,t)/r:p}function jt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Gt(e,t){for(var r,i=-1,o=e.length;++i<o;){var s=t(e[i]);s!==n&&(r=r===n?s:r+s)}return r}function Ft(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Wt(e,t){return Rt(t,(function(t){return[t,e[t]]}))}function qt(e){return function(t){return e(t)}}function Kt(e,t){return Rt(t,(function(t){return e[t]}))}function zt(e,t){for(var r=-1,n=e.length;++r<n&&Pt(t,e[r],0)>-1;);return r}function Vt(e,t){for(var r=e.length;r--&&Pt(t,e[r],0)>-1;);return r}function Xt(e){return e&&e.Object===Object?e:null}function Qt(e){return st[e]}function $t(e){return at[e]}function Yt(e){return"\\"+ct[e]}function Zt(e,t,r){for(var n=e.length,i=t+(r?0:-1);r?i--:++i<n;){var o=e[i];if(o!=o)return i}return-1}function Jt(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function er(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function tr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function rr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function nr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function ir(e){if(!e||!et.test(e))return e.length;for(var t=Ze.lastIndex=0;Ze.test(e);)t++;return t}function or(e){return e.match(Ze)}function sr(e){return ut[e]}var ar=function e(t){var r=(t=t?ar.defaults({},t,ar.pick(Et,rt)):Et).Date,me=t.Error,Ee=t.Math,we=t.RegExp,be=t.TypeError,Se=t.Array.prototype,Be=t.Object.prototype,Ie=t.String.prototype,Ae=t.Function.prototype.toString,Te=Be.hasOwnProperty,ke=0,Ue=Ae.call(Object),Re=Be.toString,Oe=Et._,Ne=we("^"+Ae.call(Te).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ce=gt?t.Buffer:n,Le=t.Reflect,De=t.Symbol,xe=t.Uint8Array,Pe=t.clearTimeout,He=Le?Le.enumerate:n,Me=Object.getOwnPropertySymbols,je="symbol"==typeof(je=De&&De.iterator)?je:n,Ge=Object.create,Fe=Be.propertyIsEnumerable,We=t.setTimeout,qe=Se.splice,Ke=Ee.ceil,ze=Ee.floor,Ve=Object.getPrototypeOf,Xe=t.isFinite,Qe=Se.join,Ze=Object.keys,st=Ee.max,at=Ee.min,ut=t.parseInt,ft=Ee.random,ct=Ie.replace,pt=Se.reverse,dt=Ie.split,vt=Ai(t,"DataView"),_t=Ai(t,"Map"),yt=Ai(t,"Promise"),mt=Ai(t,"Set"),Xt=Ai(t,"WeakMap"),ur=Ai(Object,"create"),fr=Xt&&new Xt,cr=!Fe.call({valueOf:1},"valueOf"),hr={},lr=Yi(vt),pr=Yi(_t),dr=Yi(yt),gr=Yi(mt),vr=Yi(Xt),_r=De?De.prototype:n,yr=_r?_r.valueOf:n,mr=_r?_r.toString:n;function Er(e){if(ls(e)&&!ns(e)&&!(e instanceof Sr)){if(e instanceof br)return e;if(Te.call(e,"__wrapped__"))return Zi(e)}return new br(e)}function wr(){}function br(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Sr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Br(){}function Ir(e,t){return ur?e[t]!==n:Te.call(e,t)}function Ar(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Tr(e){var t=-1,r=e?e.length:0;for(this.__data__=new Ar;++t<r;)this.push(e[t])}function kr(e,t){var r=e.__data__;if(Mi(t)){var n=r.__data__;return("string"==typeof t?n.string:n.hash)[t]===s}return r.has(t)}function Ur(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Rr(e,t){var r=Cr(e,t);return!(r<0)&&(r==e.length-1?e.pop():qe.call(e,r,1),!0)}function Or(e,t){var r=Cr(e,t);return r<0?n:e[r][1]}function Nr(e,t){return Cr(e,t)>-1}function Cr(e,t){for(var r=e.length;r--;)if(Jo(e[r][0],t))return r;return-1}function Lr(e,t,r){var n=Cr(e,t);n<0?e.push([t,r]):e[n][1]=r}function Dr(e,t,r,i){return e===n||Jo(e,Be[r])&&!Te.call(i,r)?t:e}function xr(e,t,r){(r!==n&&!Jo(e[t],r)||"number"==typeof t&&r===n&&!(t in e))&&(e[t]=r)}function Pr(e,t,r){var i=e[t];Te.call(e,t)&&Jo(i,r)&&(r!==n||t in e)||(e[t]=r)}function Hr(e,t,r,n){return zr(e,(function(e,i,o){t(n,e,r(e),o)})),n}function Mr(e,t){return e&&Jn(t,js(t),e)}function jr(e,t){for(var r=-1,i=null==e,o=t.length,s=Array(o);++r<o;)s[r]=i?n:Ds(e,t[r]);return s}function Gr(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function Fr(e,t,r,i,o,s,a){var u;if(i&&(u=s?i(e,o,s,a):i(e)),u!==n)return u;if(!hs(e))return e;var f=ns(e);if(f){if(u=function(e){var t=e.length,r=e.constructor(t);t&&"string"==typeof e[0]&&Te.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!t)return Zn(e,u)}else{var c=Oi(e),h=c==E||c==w;if(ss(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(c==B||c==g||h&&!s){if(Jt(e))return s?e:{};if(u=function(e){return"function"!=typeof e.constructor||Gi(e)?{}:Wr(ki(e))}(h?{}:e),!t)return function(e,t){return Jn(e,Ui(e),t)}(e,Mr(u,e))}else{if(!ot[c])return s?e:{};u=function(e,t,r,n){var i=e.constructor;switch(t){case O:return Xn(e);case _:case y:return new i(+e);case N:return function(e,t){var r=t?Xn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case C:case L:case D:case x:case P:case H:case M:case j:case G:return function(e,t){var r=t?Xn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case b:return function(e,t,r){var n=t?r(tr(e),!0):tr(e);return Nt(n,wt,new e.constructor)}(e,n,r);case S:case k:return new i(e);case A:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return function(e,t,r){var n=t?r(nr(e),!0):nr(e);return Nt(n,bt,new e.constructor)}(e,n,r);case U:return function(e){return yr?Object(yr.call(e)):{}}(e)}}(e,c,Fr,t)}}a||(a=new Ur);var l=a.get(e);if(l)return l;if(a.set(e,u),!f)var p=r?function(e){return on(e,js,Ui)}(e):js(e);return It(p||e,(function(n,o){p&&(n=e[o=n]),Pr(u,o,Fr(n,t,r,i,o,e,a))})),u}function Wr(e){return hs(e)?Ge(e):{}}function qr(e,t,r){if("function"!=typeof e)throw new be(o);return We((function(){e.apply(n,r)}),t)}function Kr(e,t,r,n){var o=-1,s=kt,a=!0,u=e.length,f=[],c=t.length;if(!u)return f;r&&(t=Rt(t,qt(r))),n?(s=Ut,a=!1):t.length>=i&&(s=kr,a=!1,t=new Tr(t));e:for(;++o<u;){var h=e[o],l=r?r(h):h;if(h=n||0!==h?h:0,a&&l==l){for(var p=c;p--;)if(t[p]===l)continue e;f.push(h)}else s(t,l,n)||f.push(h)}return f}Er.templateSettings={escape:Q,evaluate:$,interpolate:Y,variable:"",imports:{_:Er}},Er.prototype=wr.prototype,Er.prototype.constructor=Er,br.prototype=Wr(wr.prototype),br.prototype.constructor=br,Sr.prototype=Wr(wr.prototype),Sr.prototype.constructor=Sr,Br.prototype=ur?ur(null):Be,Ar.prototype.clear=function(){this.__data__={hash:new Br,map:_t?new _t:[],string:new Br}},Ar.prototype.delete=function(e){var t=this.__data__;return Mi(e)?function(e,t){return Ir(e,t)&&delete e[t]}("string"==typeof e?t.string:t.hash,e):_t?t.map.delete(e):Rr(t.map,e)},Ar.prototype.get=function(e){var t=this.__data__;return Mi(e)?function(e,t){if(ur){var r=e[t];return r===s?n:r}return Te.call(e,t)?e[t]:n}("string"==typeof e?t.string:t.hash,e):_t?t.map.get(e):Or(t.map,e)},Ar.prototype.has=function(e){var t=this.__data__;return Mi(e)?Ir("string"==typeof e?t.string:t.hash,e):_t?t.map.has(e):Nr(t.map,e)},Ar.prototype.set=function(e,t){var r=this.__data__;return Mi(e)?function(e,t,r){e[t]=ur&&r===n?s:r}("string"==typeof e?r.string:r.hash,e,t):_t?r.map.set(e,t):Lr(r.map,e,t),this},Tr.prototype.push=function(e){var t=this.__data__;if(Mi(e)){var r=t.__data__;("string"==typeof e?r.string:r.hash)[e]=s}else t.set(e,s)},Ur.prototype.clear=function(){this.__data__={array:[],map:null}},Ur.prototype.delete=function(e){var t=this.__data__,r=t.array;return r?Rr(r,e):t.map.delete(e)},Ur.prototype.get=function(e){var t=this.__data__,r=t.array;return r?Or(r,e):t.map.get(e)},Ur.prototype.has=function(e){var t=this.__data__,r=t.array;return r?Nr(r,e):t.map.has(e)},Ur.prototype.set=function(e,t){var r=this.__data__,n=r.array;n&&(n.length<199?Lr(n,e,t):(r.array=null,r.map=new Ar(n)));var i=r.map;return i&&i.set(e,t),this};var zr=ri(en),Vr=ri(tn,!0);function Xr(e,t){var r=!0;return zr(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function Qr(e,t,r){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=t(s);if(null!=a&&(u===n?a==a&&!ys(a):r(a,u)))var u=a,f=s}return f}function $r(e,t){var r=[];return zr(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function Yr(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=Li),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?Yr(a,t-1,r,n,i):Ot(i,a):n||(i[i.length]=a)}return i}var Zr=ni(),Jr=ni(!0);function en(e,t){return e&&Zr(e,t,js)}function tn(e,t){return e&&Jr(e,t,js)}function rn(e,t){return Tt(t,(function(t){return us(e[t])}))}function nn(e,t){for(var r=0,i=(t=Hi(t,e)?[t]:zn(t)).length;null!=e&&r<i;)e=e[$i(t[r++])];return r&&r==i?e:n}function on(e,t,r){var n=t(e);return ns(e)?n:Ot(n,r(e))}function sn(e,t){return e>t}function an(e,t){return Te.call(e,t)||"object"==typeof e&&t in e&&null===ki(e)}function un(e,t){return t in Object(e)}function fn(e,t,r){for(var i=r?Ut:kt,o=e[0].length,s=e.length,a=s,u=Array(s),f=1/0,c=[];a--;){var h=e[a];a&&t&&(h=Rt(h,qt(t))),f=at(h.length,f),u[a]=!r&&(t||o>=120&&h.length>=120)?new Tr(a&&h):n}h=e[0];var l=-1,p=u[0];e:for(;++l<o&&c.length<f;){var d=h[l],g=t?t(d):d;if(d=r||0!==d?d:0,!(p?kr(p,g):i(c,g,r))){for(a=s;--a;){var v=u[a];if(!(v?kr(v,g):i(e[a],g,r)))continue e}p&&p.push(g),c.push(d)}}return c}function cn(e,t,r){Hi(t,e)||(e=Ki(e,t=zn(t)),t=uo(t));var i=null==e?e:e[$i(t)];return null==i?n:St(i,e,r)}function hn(e,t,r,i,o){return e===t||(null==e||null==t||!hs(e)&&!ls(t)?e!=e&&t!=t:function(e,t,r,i,o,s){var a=ns(e),u=ns(t),f=v,c=v;a||(f=(f=Oi(e))==g?B:f);u||(c=(c=Oi(t))==g?B:c);var h=f==B&&!Jt(e),l=c==B&&!Jt(t),p=f==c;if(p&&!h)return s||(s=new Ur),a||ms(e)?mi(e,t,r,i,o,s):function(e,t,r,n,i,o,s){switch(r){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!n(new xe(e),new xe(t)));case _:case y:return+e==+t;case m:return e.name==t.name&&e.message==t.message;case S:return e!=+e?t!=+t:e==+t;case A:case k:return e==t+"";case b:var a=tr;case T:var u=2&o;if(a||(a=nr),e.size!=t.size&&!u)return!1;var f=s.get(e);return f?f==t:(o|=1,s.set(e,t),mi(a(e),a(t),n,i,o,s));case U:if(yr)return yr.call(e)==yr.call(t)}return!1}(e,t,f,r,i,o,s);if(!(2&o)){var d=h&&Te.call(e,"__wrapped__"),E=l&&Te.call(t,"__wrapped__");if(d||E){var w=d?e.value():e,I=E?t.value():t;return s||(s=new Ur),r(w,I,i,o,s)}}if(!p)return!1;return s||(s=new Ur),function(e,t,r,i,o,s){var a=2&o,u=js(e),f=u.length,c=js(t),h=c.length;if(f!=h&&!a)return!1;var l=f;for(;l--;){var p=u[l];if(!(a?p in t:an(t,p)))return!1}var d=s.get(e);if(d)return d==t;var g=!0;s.set(e,t);var v=a;for(;++l<f;){var _=e[p=u[l]],y=t[p];if(i)var m=a?i(y,_,p,t,e,s):i(_,y,p,e,t,s);if(!(m===n?_===y||r(_,y,i,o,s):m)){g=!1;break}v||(v="constructor"==p)}if(g&&!v){var E=e.constructor,w=t.constructor;E==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof w&&w instanceof w||(g=!1)}return s.delete(e),g}(e,t,r,i,o,s)}(e,t,hn,r,i,o))}function ln(e,t,r,i){var o=r.length,s=o,a=!i;if(null==e)return!s;for(e=Object(e);o--;){var u=r[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var f=(u=r[o])[0],c=e[f],h=u[1];if(a&&u[2]){if(c===n&&!(f in e))return!1}else{var l=new Ur;if(i)var p=i(c,h,f,e,t,l);if(!(p===n?hn(h,c,i,3,l):p))return!1}}return!0}function pn(e){return"function"==typeof e?e:null==e?ha:"object"==typeof e?ns(e)?yn(e[0],e[1]):_n(e):Ea(e)}function dn(e){e=null==e?e:Object(e);var t=[];for(var r in e)t.push(r);return t}function gn(e,t){return e<t}function vn(e,t){var r=-1,n=is(e)?Array(e.length):[];return zr(e,(function(e,i,o){n[++r]=t(e,i,o)})),n}function _n(e){var t=Ii(e);return 1==t.length&&t[0][2]?Wi(t[0][0],t[0][1]):function(r){return r===e||ln(r,e,t)}}function yn(e,t){return Hi(e)&&Fi(t)?Wi($i(e),t):function(r){var i=Ds(r,e);return i===n&&i===t?xs(r,e):hn(t,i,n,3)}}function mn(e,t,r,i,o){if(e!==t){if(!ns(t)&&!ms(t))var s=Gs(t);It(s||t,(function(a,u){if(s&&(a=t[u=a]),hs(a))o||(o=new Ur),function(e,t,r,i,o,s,a){var u=e[r],f=t[r],c=a.get(f);if(c)return void xr(e,r,c);var h=s?s(u,f,r+"",e,t,a):n,l=h===n;l&&(h=f,ns(f)||ms(f)?ns(u)?h=u:os(u)?h=Zn(u):(l=!1,h=Fr(f,!0)):gs(f)||rs(f)?rs(u)?h=As(u):!hs(u)||i&&us(u)?(l=!1,h=Fr(f,!0)):h=u:l=!1);a.set(f,h),l&&o(h,f,i,s,a);a.delete(f),xr(e,r,h)}(e,t,u,r,mn,i,o);else{var f=i?i(e[u],a,u+"",e,t,o):n;f===n&&(f=a),xr(e,u,f)}}))}}function En(e,t){var r=e.length;if(r)return xi(t+=t<0?r:0,r)?e[t]:n}function wn(e,t,r){var n=-1;t=Rt(t.length?t:[ha],qt(Si()));var i=vn(e,(function(e,r,i){var o=Rt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;for(;++n<s;){var u=Qn(i[n],o[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function bn(e,t){return e=Object(e),Nt(t,(function(t,r){return r in e&&(t[r]=e[r]),t}),{})}function Sn(e,t){for(var r=-1,n=Ei(e),i=n.length,o={};++r<i;){var s=n[r],a=e[s];t(a,s)&&(o[s]=a)}return o}function Bn(e){return function(t){return null==t?n:t[e]}}function In(e,t,r,n){var i=n?Ht:Pt,o=-1,s=t.length,a=e;for(r&&(a=Rt(e,qt(r)));++o<s;)for(var u=0,f=t[o],c=r?r(f):f;(u=i(a,c,u,n))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function An(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;if(xi(i))qe.call(e,i,1);else if(Hi(i,e))delete e[$i(i)];else{var s=zn(i),a=Ki(e,s);null!=a&&delete a[$i(uo(s))]}}}return e}function Tn(e,t){return e+ze(ft()*(t-e+1))}function kn(e,t){var r="";if(!e||t<1||t>l)return r;do{t%2&&(r+=e),(t=ze(t/2))&&(e+=e)}while(t);return r}function Un(e,t,r,i){for(var o=-1,s=(t=Hi(t,e)?[t]:zn(t)).length,a=s-1,u=e;null!=u&&++o<s;){var f=$i(t[o]);if(hs(u)){var c=r;if(o!=a){var h=u[f];(c=i?i(h,f,u):n)===n&&(c=null==h?xi(t[o+1])?[]:{}:h)}Pr(u,f,c)}u=u[f]}return e}He&&!Fe.call({valueOf:1},"valueOf")&&(dn=function(e){return er(He(e))});var Rn=fr?function(e,t){return fr.set(e,t),e}:ha;function On(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}function Nn(e,t){var r;return zr(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function Cn(e,t,r){var n=0,i=e?e.length:n;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!ys(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return Ln(e,t,ha,r)}function Ln(e,t,r,i){t=r(t);for(var o=0,s=e?e.length:0,a=t!=t,u=null===t,f=ys(t),c=t===n;o<s;){var h=ze((o+s)/2),l=r(e[h]),p=l!==n,d=null===l,g=l==l,v=ys(l);if(a)var _=i||g;else _=c?g&&(i||p):u?g&&p&&(i||!d):f?g&&p&&!d&&(i||!v):!d&&!v&&(i?l<=t:l<t);_?o=h+1:s=h}return at(s,4294967294)}function Dn(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!Jo(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function xn(e){return"number"==typeof e?e:ys(e)?p:+e}function Pn(e){if("string"==typeof e)return e;if(ys(e))return mr?mr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Hn(e,t,r){var n=-1,o=kt,s=e.length,a=!0,u=[],f=u;if(r)a=!1,o=Ut;else if(s>=i){var c=t?null:_i(e);if(c)return nr(c);a=!1,o=kr,f=new Tr}else f=t?[]:u;e:for(;++n<s;){var h=e[n],l=t?t(h):h;if(h=r||0!==h?h:0,a&&l==l){for(var p=f.length;p--;)if(f[p]===l)continue e;t&&f.push(l),u.push(h)}else o(f,l,r)||(f!==u&&f.push(l),u.push(h))}return u}function Mn(e,t,r,n){return Un(e,t,r(nn(e,t)),n)}function jn(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?On(e,n?0:o,n?o+1:i):On(e,n?o+1:0,n?i:o)}function Gn(e,t){var r=e;return r instanceof Sr&&(r=r.value()),Nt(t,(function(e,t){return t.func.apply(t.thisArg,Ot([e],t.args))}),r)}function Fn(e,t,r){for(var n=-1,i=e.length;++n<i;)var o=o?Ot(Kr(o,e[n],t,r),Kr(e[n],o,t,r)):e[n];return o&&o.length?Hn(o,t,r):[]}function Wn(e,t,r){for(var i=-1,o=e.length,s=t.length,a={};++i<o;){var u=i<s?t[i]:n;r(a,e[i],u)}return a}function qn(e){return os(e)?e:[]}function Kn(e){return"function"==typeof e?e:ha}function zn(e){return ns(e)?e:Qi(e)}function Vn(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:On(e,t,r)}function Xn(e){var t=new e.constructor(e.byteLength);return new xe(t).set(new xe(e)),t}function Qn(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,s=ys(e),a=t!==n,u=null===t,f=t==t,c=ys(t);if(!u&&!c&&!s&&e>t||s&&a&&f&&!u&&!c||i&&a&&f||!r&&f||!o)return 1;if(!i&&!s&&!c&&e<t||c&&r&&o&&!i&&!s||u&&r&&o||!a&&o||!f)return-1}return 0}function $n(e,t,r,n){for(var i=-1,o=e.length,s=r.length,a=-1,u=t.length,f=st(o-s,0),c=Array(u+f),h=!n;++a<u;)c[a]=t[a];for(;++i<s;)(h||i<o)&&(c[r[i]]=e[i]);for(;f--;)c[a++]=e[i++];return c}function Yn(e,t,r,n){for(var i=-1,o=e.length,s=-1,a=r.length,u=-1,f=t.length,c=st(o-a,0),h=Array(c+f),l=!n;++i<c;)h[i]=e[i];for(var p=i;++u<f;)h[p+u]=t[u];for(;++s<a;)(l||i<o)&&(h[p+r[s]]=e[i++]);return h}function Zn(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Jn(e,t,r,n){r||(r={});for(var i=-1,o=t.length;++i<o;){var s=t[i];Pr(r,s,n?n(r[s],e[s],s,r,e):e[s])}return r}function ei(e,t){return function(r,n){var i=ns(r)?Bt:Hr,o=t?t():{};return i(r,e,Si(n),o)}}function ti(e){return Yo((function(t,r){var i=-1,o=r.length,s=o>1?r[o-1]:n,a=o>2?r[2]:n;for(s="function"==typeof s?(o--,s):n,a&&Pi(r[0],r[1],a)&&(s=o<3?n:s,o=1),t=Object(t);++i<o;){var u=r[i];u&&e(t,u,i,s)}return t}))}function ri(e,t){return function(r,n){if(null==r)return r;if(!is(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Object(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function ni(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===r(o[u],u,o))break}return t}}function ii(e){return function(t){t=Ts(t);var r=et.test(t)?or(t):n,i=r?r[0]:t.charAt(0),o=r?Vn(r,1).join(""):t.slice(1);return i[e]()+o}}function oi(e){return function(t){return Nt(oa(Ys(t).replace($e,"")),e,"")}}function si(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Wr(e.prototype),n=e.apply(r,t);return hs(n)?n:r}}function ai(e){return Yo((function(t){var r=(t=Yr(t,1)).length,s=r,a=br.prototype.thru;for(e&&t.reverse();s--;){var u=t[s];if("function"!=typeof u)throw new be(o);if(a&&!f&&"wrapper"==bi(u))var f=new br([],!0)}for(s=f?s:r;++s<r;){var c=bi(u=t[s]),h="wrapper"==c?wi(u):n;f=h&&ji(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?f[bi(h[0])].apply(f,h[3]):1==u.length&&ji(u)?f[c]():f.thru(u)}return function(){var e=arguments,n=e[0];if(f&&1==e.length&&ns(n)&&n.length>=i)return f.plant(n).value();for(var o=0,s=r?t[o].apply(this,e):n;++o<r;)s=t[o].call(this,s);return s}}))}function ui(e,t,r,i,o,s,a,u,c,h){var l=t&f,p=1&t,d=2&t,g=24&t,v=512&t,_=d?n:si(e);return function f(){for(var y=arguments.length,m=y,E=Array(y);m--;)E[m]=arguments[m];if(g)var w=Ti(f),b=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&n++;return n}(E,w);if(i&&(E=$n(E,i,o,g)),s&&(E=Yn(E,s,a,g)),y-=b,g&&y<h){var S=rr(E,w);return gi(e,t,ui,f.placeholder,r,E,S,u,c,h-y)}var B=p?r:this,I=d?B[e]:e;return y=E.length,u?E=function(e,t){var r=e.length,i=at(t.length,r),o=Zn(e);for(;i--;){var s=t[i];e[i]=xi(s,r)?o[s]:n}return e}(E,u):v&&y>1&&E.reverse(),l&&c<y&&(E.length=c),this&&this!==Et&&this instanceof f&&(I=_||si(I)),I.apply(B,E)}}function fi(e,t){return function(r,n){return function(e,t,r,n){return en(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function ci(e){return function(t,r){var i;if(t===n&&r===n)return 0;if(t!==n&&(i=t),r!==n){if(i===n)return r;"string"==typeof t||"string"==typeof r?(t=Pn(t),r=Pn(r)):(t=xn(t),r=xn(r)),i=e(t,r)}return i}}function hi(e){return Yo((function(t){return t=1==t.length&&ns(t[0])?Rt(t[0],qt(Si())):Rt(Yr(t,1,Di),qt(Si())),Yo((function(r){var n=this;return e(t,(function(e){return St(e,n,r)}))}))}))}function li(e,t){var r=(t=t===n?" ":Pn(t)).length;if(r<2)return r?kn(t,e):t;var i=kn(t,Ke(e/ir(t)));return et.test(t)?Vn(or(i),0,e).join(""):i.slice(0,e)}function pi(e){return function(t,r,i){return i&&"number"!=typeof i&&Pi(t,r,i)&&(r=i=n),t=(t=Is(t))==t?t:0,r===n?(r=t,t=0):r=Is(r)||0,function(e,t,r,n){for(var i=-1,o=st(Ke((t-e)/(r||1)),0),s=Array(o);o--;)s[n?o:++i]=e,e+=r;return s}(t,r,i=i===n?t<r?1:-1:Is(i)||0,e)}}function di(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Is(t),r=Is(r)),e(t,r)}}function gi(e,t,r,i,o,s,a,f,c,h){var l=8&t;t|=l?u:64,4&(t&=~(l?64:u))||(t&=-4);var p=[e,t,o,l?s:n,l?a:n,l?n:s,l?n:a,f,c,h],d=r.apply(n,p);return ji(e)&&Xi(d,p),d.placeholder=i,d}function vi(e){var t=Ee[e];return function(e,r){if(e=Is(e),r=Ss(r)){var n=(Ts(e)+"e").split("e");return+((n=(Ts(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var _i=mt&&1/nr(new mt([,-0]))[1]==h?function(e){return new mt(e)}:va;function yi(e,t,r,i,s,h,l,p){var d=2&t;if(!d&&"function"!=typeof e)throw new be(o);var g=i?i.length:0;if(g||(t&=-97,i=s=n),l=l===n?l:st(Ss(l),0),p=p===n?p:Ss(p),g-=s?s.length:0,64&t){var v=i,_=s;i=s=n}var y=d?n:wi(e),m=[e,t,r,i,s,v,_,h,l,p];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=n==f&&8==r||n==f&&r==c&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var h=e[3];e[3]=h?$n(h,u,t[4]):u,e[4]=h?rr(e[3],a):t[4]}u=t[5],u&&(h=e[5],e[5]=h?Yn(h,u,t[6]):u,e[6]=h?rr(e[5],a):t[6]);u=t[7],u&&(e[7]=u);n&f&&(e[8]=null==e[8]?t[8]:at(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(m,y),e=m[0],t=m[1],r=m[2],i=m[3],s=m[4],!(p=m[9]=null==m[9]?d?0:e.length:st(m[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,r){var i=si(e);return function o(){for(var s=arguments.length,a=Array(s),u=s,f=Ti(o);u--;)a[u]=arguments[u];var c=s<3&&a[0]!==f&&a[s-1]!==f?[]:rr(a,f);return(s-=c.length)<r?gi(e,t,ui,o.placeholder,n,a,c,n,n,r-s):St(this&&this!==Et&&this instanceof o?i:e,this,a)}}(e,t,p):t!=u&&33!=t||s.length?ui.apply(n,m):function(e,t,r,n){var i=1&t,o=si(e);return function t(){for(var s=-1,a=arguments.length,u=-1,f=n.length,c=Array(f+a),h=this&&this!==Et&&this instanceof t?o:e;++u<f;)c[u]=n[u];for(;a--;)c[u++]=arguments[++s];return St(h,i?r:this,c)}}(e,t,r,i);else var E=function(e,t,r){var n=1&t,i=si(e);return function t(){return(this&&this!==Et&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return(y?Rn:Xi)(E,m)}function mi(e,t,r,i,o,s){var a=-1,u=2&o,f=1&o,c=e.length,h=t.length;if(c!=h&&!(u&&h>c))return!1;var l=s.get(e);if(l)return l==t;var p=!0;for(s.set(e,t);++a<c;){var d=e[a],g=t[a];if(i)var v=u?i(g,d,a,t,e,s):i(d,g,a,e,t,s);if(v!==n){if(v)continue;p=!1;break}if(f){if(!Lt(t,(function(e){return d===e||r(d,e,i,o,s)}))){p=!1;break}}else if(d!==g&&!r(d,g,i,o,s)){p=!1;break}}return s.delete(e),p}function Ei(e){return on(e,Gs,Ri)}var wi=fr?function(e){return fr.get(e)}:va;function bi(e){for(var t=e.name+"",r=hr[t],n=Te.call(hr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function Si(){var e=Er.iteratee||la;return e=e===la?pn:e,arguments.length?e(arguments[0],arguments[1]):e}var Bi=Bn("length");function Ii(e){for(var t=zs(e),r=t.length;r--;)t[r][2]=Fi(t[r][1]);return t}function Ai(e,t){var r=e[t];return ps(r)?r:n}function Ti(e){return(Te.call(Er,"placeholder")?Er:e).placeholder}function ki(e){return Ve(Object(e))}function Ui(e){return Me(Object(e))}Me||(Ui=function(){return[]});var Ri=Me?function(e){for(var t=[];e;)Ot(t,Ui(e)),e=ki(e);return t}:Ui;function Oi(e){return Re.call(e)}function Ni(e,t,r){for(var n,i=-1,o=(t=Hi(t,e)?[t]:zn(t)).length;++i<o;){var s=$i(t[i]);if(!(n=null!=e&&r(e,s)))break;e=e[s]}return n||!!(o=e?e.length:0)&&cs(o)&&xi(s,o)&&(ns(e)||_s(e)||rs(e))}function Ci(e){var t=e?e.length:n;return cs(t)&&(ns(e)||_s(e)||rs(e))?Ft(t,String):null}function Li(e){return os(e)&&(ns(e)||rs(e))}function Di(e){return ns(e)&&!(2==e.length&&!us(e[0]))}function xi(e,t){return!!(t=null==t?l:t)&&("number"==typeof e||ge.test(e))&&e>-1&&e%1==0&&e<t}function Pi(e,t,r){if(!hs(r))return!1;var n=typeof t;return!!("number"==n?is(r)&&xi(t,r.length):"string"==n&&t in r)&&Jo(r[t],e)}function Hi(e,t){if(ns(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ys(e))||(J.test(e)||!Z.test(e)||null!=t&&e in Object(t))}function Mi(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function ji(e){var t=bi(e),r=Er[t];if("function"!=typeof r||!(t in Sr.prototype))return!1;if(e===r)return!0;var n=wi(r);return!!n&&e===n[0]}function Gi(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Be)}function Fi(e){return e==e&&!hs(e)}function Wi(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==n||e in Object(r)))}}function qi(e,t,r,i,o,s){return hs(e)&&hs(t)&&mn(e,t,n,qi,s.set(t,e)),e}function Ki(e,t){return 1==t.length?e:nn(e,On(t,0,-1))}(vt&&Oi(new vt(new ArrayBuffer(1)))!=N||_t&&Oi(new _t)!=b||yt&&Oi(yt.resolve())!=I||mt&&Oi(new mt)!=T||Xt&&Oi(new Xt)!=R)&&(Oi=function(e){var t=Re.call(e),r=t==B?e.constructor:n,i=r?Yi(r):n;if(i)switch(i){case lr:return N;case pr:return b;case dr:return I;case gr:return T;case vr:return R}return t});var zi,Vi,Xi=(zi=0,Vi=0,function(e,t){var r=Ho(),n=16-(r-Vi);if(Vi=r,n>0){if(++zi>=150)return e}else zi=0;return Rn(e,t)}),Qi=zo((function(e){var t=[];return Ts(e).replace(ee,(function(e,r,n,i){t.push(n?i.replace(ae,"$1"):r||e)})),t}));function $i(e){if("string"==typeof e||ys(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Yi(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Zi(e){if(e instanceof Sr)return e.clone();var t=new br(e.__wrapped__,e.__chain__);return t.__actions__=Zn(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ji=Yo((function(e,t){return os(e)?Kr(e,Yr(t,1,os,!0)):[]})),eo=Yo((function(e,t){var r=uo(t);return os(r)&&(r=n),os(e)?Kr(e,Yr(t,1,os,!0),Si(r)):[]})),to=Yo((function(e,t){var r=uo(t);return os(r)&&(r=n),os(e)?Kr(e,Yr(t,1,os,!0),n,r):[]}));function ro(e,t,r){var i=e?e.length:0;return i?On(e,(t=r||t===n?1:Ss(t))<0?0:t,i):[]}function no(e,t,r){var i=e?e.length:0;return i?On(e,0,(t=i-(t=r||t===n?1:Ss(t)))<0?0:t):[]}function io(e){return e&&e.length?e[0]:n}var oo=Yo((function(e){var t=Rt(e,qn);return t.length&&t[0]===e[0]?fn(t):[]})),so=Yo((function(e){var t=uo(e),r=Rt(e,qn);return t===uo(r)?t=n:r.pop(),r.length&&r[0]===e[0]?fn(r,Si(t)):[]})),ao=Yo((function(e){var t=uo(e),r=Rt(e,qn);return t===uo(r)?t=n:r.pop(),r.length&&r[0]===e[0]?fn(r,n,t):[]}));function uo(e){var t=e?e.length:0;return t?e[t-1]:n}var fo=Yo(co);function co(e,t){return e&&e.length&&t&&t.length?In(e,t):e}var ho=Yo((function(e,t){t=Yr(t,1);var r=e?e.length:0,n=jr(e,t);return An(e,Rt(t,(function(e){return xi(e,r)?+e:e})).sort(Qn)),n}));function lo(e){return e?pt.call(e):e}var po=Yo((function(e){return Hn(Yr(e,1,os,!0))})),go=Yo((function(e){var t=uo(e);return os(t)&&(t=n),Hn(Yr(e,1,os,!0),Si(t))})),vo=Yo((function(e){var t=uo(e);return os(t)&&(t=n),Hn(Yr(e,1,os,!0),n,t)}));function _o(e){if(!e||!e.length)return[];var t=0;return e=Tt(e,(function(e){if(os(e))return t=st(e.length,t),!0})),Ft(t,(function(t){return Rt(e,Bn(t))}))}function yo(e,t){if(!e||!e.length)return[];var r=_o(e);return null==t?r:Rt(r,(function(e){return St(t,n,e)}))}var mo=Yo((function(e,t){return os(e)?Kr(e,t):[]})),Eo=Yo((function(e){return Fn(Tt(e,os))})),wo=Yo((function(e){var t=uo(e);return os(t)&&(t=n),Fn(Tt(e,os),Si(t))})),bo=Yo((function(e){var t=uo(e);return os(t)&&(t=n),Fn(Tt(e,os),n,t)})),So=Yo(_o),Bo=Yo((function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,yo(e,r)}));function Io(e){var t=Er(e);return t.__chain__=!0,t}function Ao(e,t){return t(e)}var To=Yo((function(e){var t=(e=Yr(e,1)).length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return jr(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Sr&&xi(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:Ao,args:[o],thisArg:n}),new br(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(o)})),ko=ei((function(e,t,r){Te.call(e,r)?++e[r]:e[r]=1}));function Uo(e,t){return"function"==typeof t&&ns(e)?It(e,t):zr(e,Si(t))}function Ro(e,t){return"function"==typeof t&&ns(e)?function(e,t){for(var r=e.length;r--&&!1!==t(e[r],r,e););return e}(e,t):Vr(e,Si(t))}var Oo=ei((function(e,t,r){Te.call(e,r)?e[r].push(t):e[r]=[t]})),No=Yo((function(e,t,r){var i=-1,o="function"==typeof t,s=Hi(t),a=is(e)?Array(e.length):[];return zr(e,(function(e){var u=o?t:s&&null!=e?e[t]:n;a[++i]=u?St(u,e,r):cn(e,t,r)})),a})),Co=ei((function(e,t,r){e[r]=t}));function Lo(e,t){return(ns(e)?Rt:vn)(e,Si(t,3))}var Do=ei((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));function xo(e,t,r){var i=-1,o=bs(e),s=o.length,a=s-1;for(t=(r?Pi(e,t,r):t===n)?1:Gr(Ss(t),0,s);++i<t;){var u=Tn(i,a),f=o[u];o[u]=o[i],o[i]=f}return o.length=t,o}var Po=Yo((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Pi(e,t[0],t[1])?t=[]:r>2&&Pi(t[0],t[1],t[2])&&(t=[t[0]]),wn(e,t=1==t.length&&ns(t[0])?t[0]:Yr(t,1,Di),[])})),Ho=r.now;function Mo(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,yi(e,f,n,n,n,n,t)}function jo(e,t){var r;if("function"!=typeof t)throw new be(o);return e=Ss(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var Go=Yo((function(e,t,r){var n=1;if(r.length){var i=rr(r,Ti(Go));n|=u}return yi(e,n,t,r,i)})),Fo=Yo((function(e,t,r){var n=3;if(r.length){var i=rr(r,Ti(Fo));n|=u}return yi(t,n,e,r,i)}));function Wo(e,t,r){var i,s,a,u,f,c=0,h=0,l=!1,p=!1,d=!0;if("function"!=typeof e)throw new be(o);function g(t){var r=i,o=s;return i=s=n,h=t,u=e.apply(o,r)}function v(e){var r=e-c;return!c||r>=t||r<0||p&&e-h>=a}function _(){var e=Ho();if(v(e))return y(e);f=We(_,function(e){var r=t-(e-c);return p?at(r,a-(e-h)):r}(e))}function y(e){return Pe(f),f=n,d&&i?g(e):(i=s=n,u)}function m(){var e=Ho(),r=v(e);if(i=arguments,s=this,c=e,r){if(f===n)return function(e){return h=e,f=We(_,t),l?g(e):u}(c);if(p)return Pe(f),f=We(_,t),g(c)}return f===n&&(f=We(_,t)),u}return t=Is(t)||0,hs(r)&&(l=!!r.leading,a=(p="maxWait"in r)?st(Is(r.maxWait)||0,t):a,d="trailing"in r?!!r.trailing:d),m.cancel=function(){f!==n&&Pe(f),c=h=0,i=s=f=n},m.flush=function(){return f===n?u:y(Ho())},m}var qo=Yo((function(e,t){return qr(e,1,t)})),Ko=Yo((function(e,t,r){return qr(e,Is(t)||0,r)}));function zo(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new be(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(zo.Cache||Ar),r}zo.Cache=Ar;var Vo=Yo((function(e,t){var r=(t=1==t.length&&ns(t[0])?Rt(t[0],qt(Si())):Rt(Yr(t,1,Di),qt(Si()))).length;return Yo((function(n){for(var i=-1,o=at(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return St(e,this,n)}))})),Xo=Yo((function(e,t){var r=rr(t,Ti(Xo));return yi(e,u,n,t,r)})),Qo=Yo((function(e,t){var r=rr(t,Ti(Qo));return yi(e,64,n,t,r)})),$o=Yo((function(e,t){return yi(e,c,n,n,n,Yr(t,1))}));function Yo(e,t){if("function"!=typeof e)throw new be(o);return t=st(t===n?e.length-1:Ss(t),0),function(){for(var r=arguments,n=-1,i=st(r.length-t,0),o=Array(i);++n<i;)o[n]=r[t+n];switch(t){case 0:return e.call(this,o);case 1:return e.call(this,r[0],o);case 2:return e.call(this,r[0],r[1],o)}var s=Array(t+1);for(n=-1;++n<t;)s[n]=r[n];return s[t]=o,St(e,this,s)}}function Zo(){if(!arguments.length)return[];var e=arguments[0];return ns(e)?e:[e]}function Jo(e,t){return e===t||e!=e&&t!=t}var es=di(sn),ts=di((function(e,t){return e>=t}));function rs(e){return os(e)&&Te.call(e,"callee")&&(!Fe.call(e,"callee")||Re.call(e)==g)}var ns=Array.isArray;function is(e){return null!=e&&cs(Bi(e))&&!us(e)}function os(e){return ls(e)&&is(e)}var ss=Ce?function(e){return e instanceof Ce}:ua(!1);function as(e){return!!ls(e)&&(Re.call(e)==m||"string"==typeof e.message&&"string"==typeof e.name)}function us(e){var t=hs(e)?Re.call(e):"";return t==E||t==w}function fs(e){return"number"==typeof e&&e==Ss(e)}function cs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=l}function hs(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ls(e){return!!e&&"object"==typeof e}function ps(e){return!!hs(e)&&(us(e)||Jt(e)?Ne:pe).test(Yi(e))}function ds(e){return"number"==typeof e||ls(e)&&Re.call(e)==S}function gs(e){if(!ls(e)||Re.call(e)!=B||Jt(e))return!1;var t=ki(e);if(null===t)return!0;var r=Te.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ae.call(r)==Ue}function vs(e){return hs(e)&&Re.call(e)==A}function _s(e){return"string"==typeof e||!ns(e)&&ls(e)&&Re.call(e)==k}function ys(e){return"symbol"==typeof e||ls(e)&&Re.call(e)==U}function ms(e){return ls(e)&&cs(e.length)&&!!it[Re.call(e)]}var Es=di(gn),ws=di((function(e,t){return e<=t}));function bs(e){if(!e)return[];if(is(e))return _s(e)?or(e):Zn(e);if(je&&e[je])return er(e[je]());var t=Oi(e);return(t==b?tr:t==T?nr:Xs)(e)}function Ss(e){if(!e)return 0===e?e:0;if((e=Is(e))===h||e===-1/0)return 17976931348623157e292*(e<0?-1:1);var t=e%1;return e==e?t?e-t:e:0}function Bs(e){return e?Gr(Ss(e),0,d):0}function Is(e){if("number"==typeof e)return e;if(ys(e))return p;if(hs(e)){var t=us(e.valueOf)?e.valueOf():e;e=hs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ne,"");var r=le.test(e);return r||de.test(e)?lt(e.slice(2),r?2:8):he.test(e)?p:+e}function As(e){return Jn(e,Gs(e))}function Ts(e){return null==e?"":Pn(e)}var ks=ti((function(e,t){if(cr||Gi(t)||is(t))Jn(t,js(t),e);else for(var r in t)Te.call(t,r)&&Pr(e,r,t[r])})),Us=ti((function(e,t){if(cr||Gi(t)||is(t))Jn(t,Gs(t),e);else for(var r in t)Pr(e,r,t[r])})),Rs=ti((function(e,t,r,n){Jn(t,Gs(t),e,n)})),Os=ti((function(e,t,r,n){Jn(t,js(t),e,n)})),Ns=Yo((function(e,t){return jr(e,Yr(t,1))})),Cs=Yo((function(e){return e.push(n,Dr),St(Rs,n,e)})),Ls=Yo((function(e){return e.push(n,qi),St(Ws,n,e)}));function Ds(e,t,r){var i=null==e?n:nn(e,t);return i===n?r:i}function xs(e,t){return null!=e&&Ni(e,t,un)}var Ps=fi((function(e,t,r){e[t]=r}),ua(ha)),Hs=fi((function(e,t,r){Te.call(e,t)?e[t].push(r):e[t]=[r]}),Si),Ms=Yo(cn);function js(e){var t=Gi(e);if(!t&&!is(e))return function(e){return Ze(Object(e))}(e);var r=Ci(e),n=!!r,i=r||[],o=i.length;for(var s in e)!an(e,s)||n&&("length"==s||xi(s,o))||t&&"constructor"==s||i.push(s);return i}function Gs(e){for(var t=-1,r=Gi(e),n=dn(e),i=n.length,o=Ci(e),s=!!o,a=o||[],u=a.length;++t<i;){var f=n[t];s&&("length"==f||xi(f,u))||"constructor"==f&&(r||!Te.call(e,f))||a.push(f)}return a}var Fs=ti((function(e,t,r){mn(e,t,r)})),Ws=ti((function(e,t,r,n){mn(e,t,r,n)})),qs=Yo((function(e,t){return null==e?{}:(t=Rt(Yr(t,1),$i),bn(e,Kr(Ei(e),t)))})),Ks=Yo((function(e,t){return null==e?{}:bn(e,Rt(Yr(t,1),$i))}));function zs(e){return Wt(e,js(e))}function Vs(e){return Wt(e,Gs(e))}function Xs(e){return e?Kt(e,js(e)):[]}var Qs=oi((function(e,t,r){return t=t.toLowerCase(),e+(r?$s(t):t)}));function $s(e){return ia(Ts(e).toLowerCase())}function Ys(e){return(e=Ts(e))&&e.replace(ve,Qt).replace(Ye,"")}var Zs=oi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Js=oi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),ea=ii("toLowerCase"),ta=oi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),ra=oi((function(e,t,r){return e+(r?" ":"")+ia(t)})),na=oi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),ia=ii("toUpperCase");function oa(e,t,r){return e=Ts(e),(t=r?n:t)===n&&(t=tt.test(e)?Je:se),e.match(t)||[]}var sa=Yo((function(e,t){try{return St(e,n,t)}catch(e){return as(e)?e:new me(e)}})),aa=Yo((function(e,t){return It(Yr(t,1),(function(t){t=$i(t),e[t]=Go(e[t],e)})),e}));function ua(e){return function(){return e}}var fa=ai(),ca=ai(!0);function ha(e){return e}function la(e){return pn("function"==typeof e?e:Fr(e,!0))}var pa=Yo((function(e,t){return function(r){return cn(r,e,t)}})),da=Yo((function(e,t){return function(r){return cn(e,r,t)}}));function ga(e,t,r){var n=js(t),i=rn(t,n);null!=r||hs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=rn(t,js(t)));var o=!(hs(r)&&"chain"in r&&!r.chain),s=us(e);return It(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Zn(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Ot([this.value()],arguments))})})),e}function va(){}var _a=hi(Rt),ya=hi(At),ma=hi(Lt);function Ea(e){return Hi(e)?Bn($i(e)):function(e){return function(t){return nn(t,e)}}(e)}var wa=pi(),ba=pi(!0),Sa=ci((function(e,t){return e+t})),Ba=vi("ceil"),Ia=ci((function(e,t){return e/t})),Aa=vi("floor"),Ta=ci((function(e,t){return e*t})),ka=vi("round"),Ua=ci((function(e,t){return e-t}));return Er.after=function(e,t){if("function"!=typeof t)throw new be(o);return e=Ss(e),function(){if(--e<1)return t.apply(this,arguments)}},Er.ary=Mo,Er.assign=ks,Er.assignIn=Us,Er.assignInWith=Rs,Er.assignWith=Os,Er.at=Ns,Er.before=jo,Er.bind=Go,Er.bindAll=aa,Er.bindKey=Fo,Er.castArray=Zo,Er.chain=Io,Er.chunk=function(e,t,r){t=(r?Pi(e,t,r):t===n)?1:st(Ss(t),0);var i=e?e.length:0;if(!i||t<1)return[];for(var o=0,s=0,a=Array(Ke(i/t));o<i;)a[s++]=On(e,o,o+=t);return a},Er.compact=function(e){for(var t=-1,r=e?e.length:0,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Er.concat=function(){var e=arguments.length,t=Zo(arguments[0]);if(e<2)return e?Zn(t):[];for(var r=Array(e-1);e--;)r[e-1]=arguments[e];return function(e,t){for(var r=-1,n=e.length,i=-1,o=t.length,s=Array(n+o);++r<n;)s[r]=e[r];for(;++i<o;)s[r++]=t[i];return s}(t,Yr(r,1))},Er.cond=function(e){var t=e?e.length:0,r=Si();return e=t?Rt(e,(function(e){if("function"!=typeof e[1])throw new be(o);return[r(e[0]),e[1]]})):[],Yo((function(r){for(var n=-1;++n<t;){var i=e[n];if(St(i[0],this,r))return St(i[1],this,r)}}))},Er.conforms=function(e){return function(e){var t=js(e),r=t.length;return function(i){if(null==i)return!r;for(var o=r;o--;){var s=t[o],a=e[s],u=i[s];if(u===n&&!(s in Object(i))||!a(u))return!1}return!0}}(Fr(e,!0))},Er.constant=ua,Er.countBy=ko,Er.create=function(e,t){var r=Wr(e);return t?Mr(r,t):r},Er.curry=function e(t,r,i){var o=yi(t,8,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},Er.curryRight=function e(t,r,i){var o=yi(t,16,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},Er.debounce=Wo,Er.defaults=Cs,Er.defaultsDeep=Ls,Er.defer=qo,Er.delay=Ko,Er.difference=Ji,Er.differenceBy=eo,Er.differenceWith=to,Er.drop=ro,Er.dropRight=no,Er.dropRightWhile=function(e,t){return e&&e.length?jn(e,Si(t,3),!0,!0):[]},Er.dropWhile=function(e,t){return e&&e.length?jn(e,Si(t,3),!0):[]},Er.fill=function(e,t,r,i){var o=e?e.length:0;return o?(r&&"number"!=typeof r&&Pi(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=Ss(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:Ss(i))<0&&(i+=o),i=r>i?0:Bs(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},Er.filter=function(e,t){return(ns(e)?Tt:$r)(e,Si(t,3))},Er.flatMap=function(e,t){return Yr(Lo(e,t),1)},Er.flatMapDeep=function(e,t){return Yr(Lo(e,t),h)},Er.flatMapDepth=function(e,t,r){return r=r===n?1:Ss(r),Yr(Lo(e,t),r)},Er.flatten=function(e){return(e?e.length:0)?Yr(e,1):[]},Er.flattenDeep=function(e){return(e?e.length:0)?Yr(e,h):[]},Er.flattenDepth=function(e,t){return(e?e.length:0)?Yr(e,t=t===n?1:Ss(t)):[]},Er.flip=function(e){return yi(e,512)},Er.flow=fa,Er.flowRight=ca,Er.fromPairs=function(e){for(var t=-1,r=e?e.length:0,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Er.functions=function(e){return null==e?[]:rn(e,js(e))},Er.functionsIn=function(e){return null==e?[]:rn(e,Gs(e))},Er.groupBy=Oo,Er.initial=function(e){return no(e,1)},Er.intersection=oo,Er.intersectionBy=so,Er.intersectionWith=ao,Er.invert=Ps,Er.invertBy=Hs,Er.invokeMap=No,Er.iteratee=la,Er.keyBy=Co,Er.keys=js,Er.keysIn=Gs,Er.map=Lo,Er.mapKeys=function(e,t){var r={};return t=Si(t,3),en(e,(function(e,n,i){r[t(e,n,i)]=e})),r},Er.mapValues=function(e,t){var r={};return t=Si(t,3),en(e,(function(e,n,i){r[n]=t(e,n,i)})),r},Er.matches=function(e){return _n(Fr(e,!0))},Er.matchesProperty=function(e,t){return yn(e,Fr(t,!0))},Er.memoize=zo,Er.merge=Fs,Er.mergeWith=Ws,Er.method=pa,Er.methodOf=da,Er.mixin=ga,Er.negate=function(e){if("function"!=typeof e)throw new be(o);return function(){return!e.apply(this,arguments)}},Er.nthArg=function(e){return e=Ss(e),Yo((function(t){return En(t,e)}))},Er.omit=qs,Er.omitBy=function(e,t){return t=Si(t),Sn(e,(function(e,r){return!t(e,r)}))},Er.once=function(e){return jo(2,e)},Er.orderBy=function(e,t,r,i){return null==e?[]:(ns(t)||(t=null==t?[]:[t]),ns(r=i?n:r)||(r=null==r?[]:[r]),wn(e,t,r))},Er.over=_a,Er.overArgs=Vo,Er.overEvery=ya,Er.overSome=ma,Er.partial=Xo,Er.partialRight=Qo,Er.partition=Do,Er.pick=Ks,Er.pickBy=function(e,t){return null==e?{}:Sn(e,Si(t))},Er.property=Ea,Er.propertyOf=function(e){return function(t){return null==e?n:nn(e,t)}},Er.pull=fo,Er.pullAll=co,Er.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?In(e,t,Si(r)):e},Er.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?In(e,t,n,r):e},Er.pullAt=ho,Er.range=wa,Er.rangeRight=ba,Er.rearg=$o,Er.reject=function(e,t){var r=ns(e)?Tt:$r;return t=Si(t,3),r(e,(function(e,r,n){return!t(e,r,n)}))},Er.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=Si(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return An(e,i),r},Er.rest=Yo,Er.reverse=lo,Er.sampleSize=xo,Er.set=function(e,t,r){return null==e?e:Un(e,t,r)},Er.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Un(e,t,r,i)},Er.shuffle=function(e){return xo(e,d)},Er.slice=function(e,t,r){var i=e?e.length:0;return i?(r&&"number"!=typeof r&&Pi(e,t,r)?(t=0,r=i):(t=null==t?0:Ss(t),r=r===n?i:Ss(r)),On(e,t,r)):[]},Er.sortBy=Po,Er.sortedUniq=function(e){return e&&e.length?Dn(e):[]},Er.sortedUniqBy=function(e,t){return e&&e.length?Dn(e,Si(t)):[]},Er.split=function(e,t,r){return r&&"number"!=typeof r&&Pi(e,t,r)&&(t=r=n),(r=r===n?d:r>>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!vs(t))&&""==(t=Pn(t))&&et.test(e)?Vn(or(e),0,r):dt.call(e,t,r):[]},Er.spread=function(e,t){if("function"!=typeof e)throw new be(o);return t=t===n?0:st(Ss(t),0),Yo((function(r){var n=r[t],i=Vn(r,0,t);return n&&Ot(i,n),St(e,this,i)}))},Er.tail=function(e){return ro(e,1)},Er.take=function(e,t,r){return e&&e.length?On(e,0,(t=r||t===n?1:Ss(t))<0?0:t):[]},Er.takeRight=function(e,t,r){var i=e?e.length:0;return i?On(e,(t=i-(t=r||t===n?1:Ss(t)))<0?0:t,i):[]},Er.takeRightWhile=function(e,t){return e&&e.length?jn(e,Si(t,3),!1,!0):[]},Er.takeWhile=function(e,t){return e&&e.length?jn(e,Si(t,3)):[]},Er.tap=function(e,t){return t(e),e},Er.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new be(o);return hs(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Wo(e,t,{leading:n,maxWait:t,trailing:i})},Er.thru=Ao,Er.toArray=bs,Er.toPairs=zs,Er.toPairsIn=Vs,Er.toPath=function(e){return ns(e)?Rt(e,$i):ys(e)?[e]:Zn(Qi(e))},Er.toPlainObject=As,Er.transform=function(e,t,r){var n=ns(e)||ms(e);if(t=Si(t,4),null==r)if(n||hs(e)){var i=e.constructor;r=n?ns(e)?new i:[]:us(i)?Wr(ki(e)):{}}else r={};return(n?It:en)(e,(function(e,n,i){return t(r,e,n,i)})),r},Er.unary=function(e){return Mo(e,1)},Er.union=po,Er.unionBy=go,Er.unionWith=vo,Er.uniq=function(e){return e&&e.length?Hn(e):[]},Er.uniqBy=function(e,t){return e&&e.length?Hn(e,Si(t)):[]},Er.uniqWith=function(e,t){return e&&e.length?Hn(e,n,t):[]},Er.unset=function(e,t){return null==e||function(e,t){e=Ki(e,t=Hi(t,e)?[t]:zn(t));var r=$i(uo(t));return!(null!=e&&an(e,r))||delete e[r]}(e,t)},Er.unzip=_o,Er.unzipWith=yo,Er.update=function(e,t,r){return null==e?e:Mn(e,t,Kn(r))},Er.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Mn(e,t,Kn(r),i)},Er.values=Xs,Er.valuesIn=function(e){return null==e?[]:Kt(e,Gs(e))},Er.without=mo,Er.words=oa,Er.wrap=function(e,t){return Xo(t=null==t?ha:t,e)},Er.xor=Eo,Er.xorBy=wo,Er.xorWith=bo,Er.zip=So,Er.zipObject=function(e,t){return Wn(e||[],t||[],Pr)},Er.zipObjectDeep=function(e,t){return Wn(e||[],t||[],Un)},Er.zipWith=Bo,Er.entries=zs,Er.entriesIn=Vs,Er.extend=Us,Er.extendWith=Rs,ga(Er,Er),Er.add=Sa,Er.attempt=sa,Er.camelCase=Qs,Er.capitalize=$s,Er.ceil=Ba,Er.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=Is(r))==r?r:0),t!==n&&(t=(t=Is(t))==t?t:0),Gr(Is(e),t,r)},Er.clone=function(e){return Fr(e,!1,!0)},Er.cloneDeep=function(e){return Fr(e,!0,!0)},Er.cloneDeepWith=function(e,t){return Fr(e,!0,!0,t)},Er.cloneWith=function(e,t){return Fr(e,!1,!0,t)},Er.deburr=Ys,Er.divide=Ia,Er.endsWith=function(e,t,r){e=Ts(e),t=Pn(t);var i=e.length;return r=r===n?i:Gr(Ss(r),0,i),(r-=t.length)>=0&&e.indexOf(t,r)==r},Er.eq=Jo,Er.escape=function(e){return(e=Ts(e))&&X.test(e)?e.replace(z,$t):e},Er.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Er.every=function(e,t,r){var i=ns(e)?At:Xr;return r&&Pi(e,t,r)&&(t=n),i(e,Si(t,3))},Er.find=function(e,t){if(t=Si(t,3),ns(e)){var r=xt(e,t);return r>-1?e[r]:n}return Dt(e,t,zr)},Er.findIndex=function(e,t){return e&&e.length?xt(e,Si(t,3)):-1},Er.findKey=function(e,t){return Dt(e,Si(t,3),en,!0)},Er.findLast=function(e,t){if(t=Si(t,3),ns(e)){var r=xt(e,t,!0);return r>-1?e[r]:n}return Dt(e,t,Vr)},Er.findLastIndex=function(e,t){return e&&e.length?xt(e,Si(t,3),!0):-1},Er.findLastKey=function(e,t){return Dt(e,Si(t,3),tn,!0)},Er.floor=Aa,Er.forEach=Uo,Er.forEachRight=Ro,Er.forIn=function(e,t){return null==e?e:Zr(e,Si(t),Gs)},Er.forInRight=function(e,t){return null==e?e:Jr(e,Si(t),Gs)},Er.forOwn=function(e,t){return e&&en(e,Si(t))},Er.forOwnRight=function(e,t){return e&&tn(e,Si(t))},Er.get=Ds,Er.gt=es,Er.gte=ts,Er.has=function(e,t){return null!=e&&Ni(e,t,an)},Er.hasIn=xs,Er.head=io,Er.identity=ha,Er.includes=function(e,t,r,n){e=is(e)?e:Xs(e),r=r&&!n?Ss(r):0;var i=e.length;return r<0&&(r=st(i+r,0)),_s(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Pt(e,t,r)>-1},Er.indexOf=function(e,t,r){var n=e?e.length:0;return n?((r=Ss(r))<0&&(r=st(n+r,0)),Pt(e,t,r)):-1},Er.inRange=function(e,t,r){return t=Is(t)||0,r===n?(r=t,t=0):r=Is(r)||0,function(e,t,r){return e>=at(t,r)&&e<st(t,r)}(e=Is(e),t,r)},Er.invoke=Ms,Er.isArguments=rs,Er.isArray=ns,Er.isArrayBuffer=function(e){return ls(e)&&Re.call(e)==O},Er.isArrayLike=is,Er.isArrayLikeObject=os,Er.isBoolean=function(e){return!0===e||!1===e||ls(e)&&Re.call(e)==_},Er.isBuffer=ss,Er.isDate=function(e){return ls(e)&&Re.call(e)==y},Er.isElement=function(e){return!!e&&1===e.nodeType&&ls(e)&&!gs(e)},Er.isEmpty=function(e){if(is(e)&&(ns(e)||_s(e)||us(e.splice)||rs(e)||ss(e)))return!e.length;if(ls(e)){var t=Oi(e);if(t==b||t==T)return!e.size}for(var r in e)if(Te.call(e,r))return!1;return!(cr&&js(e).length)},Er.isEqual=function(e,t){return hn(e,t)},Er.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?hn(e,t,r):!!i},Er.isError=as,Er.isFinite=function(e){return"number"==typeof e&&Xe(e)},Er.isFunction=us,Er.isInteger=fs,Er.isLength=cs,Er.isMap=function(e){return ls(e)&&Oi(e)==b},Er.isMatch=function(e,t){return e===t||ln(e,t,Ii(t))},Er.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,ln(e,t,Ii(t),r)},Er.isNaN=function(e){return ds(e)&&e!=+e},Er.isNative=ps,Er.isNil=function(e){return null==e},Er.isNull=function(e){return null===e},Er.isNumber=ds,Er.isObject=hs,Er.isObjectLike=ls,Er.isPlainObject=gs,Er.isRegExp=vs,Er.isSafeInteger=function(e){return fs(e)&&e>=-9007199254740991&&e<=l},Er.isSet=function(e){return ls(e)&&Oi(e)==T},Er.isString=_s,Er.isSymbol=ys,Er.isTypedArray=ms,Er.isUndefined=function(e){return e===n},Er.isWeakMap=function(e){return ls(e)&&Oi(e)==R},Er.isWeakSet=function(e){return ls(e)&&"[object WeakSet]"==Re.call(e)},Er.join=function(e,t){return e?Qe.call(e,t):""},Er.kebabCase=Zs,Er.last=uo,Er.lastIndexOf=function(e,t,r){var i=e?e.length:0;if(!i)return-1;var o=i;if(r!==n&&(o=((o=Ss(r))<0?st(i+o,0):at(o,i-1))+1),t!=t)return Zt(e,o,!0);for(;o--;)if(e[o]===t)return o;return-1},Er.lowerCase=Js,Er.lowerFirst=ea,Er.lt=Es,Er.lte=ws,Er.max=function(e){return e&&e.length?Qr(e,ha,sn):n},Er.maxBy=function(e,t){return e&&e.length?Qr(e,Si(t),sn):n},Er.mean=function(e){return Mt(e,ha)},Er.meanBy=function(e,t){return Mt(e,Si(t))},Er.min=function(e){return e&&e.length?Qr(e,ha,gn):n},Er.minBy=function(e,t){return e&&e.length?Qr(e,Si(t),gn):n},Er.multiply=Ta,Er.nth=function(e,t){return e&&e.length?En(e,Ss(t)):n},Er.noConflict=function(){return Et._===this&&(Et._=Oe),this},Er.noop=va,Er.now=Ho,Er.pad=function(e,t,r){e=Ts(e);var n=(t=Ss(t))?ir(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return li(ze(i),r)+e+li(Ke(i),r)},Er.padEnd=function(e,t,r){e=Ts(e);var n=(t=Ss(t))?ir(e):0;return t&&n<t?e+li(t-n,r):e},Er.padStart=function(e,t,r){e=Ts(e);var n=(t=Ss(t))?ir(e):0;return t&&n<t?li(t-n,r)+e:e},Er.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),e=Ts(e).replace(ne,""),ut(e,t||(ce.test(e)?16:10))},Er.random=function(e,t,r){if(r&&"boolean"!=typeof r&&Pi(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Is(e)||0,t===n?(t=e,e=0):t=Is(t)||0),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=ft();return at(e+o*(t-e+ht("1e-"+((o+"").length-1))),t)}return Tn(e,t)},Er.reduce=function(e,t,r){var n=ns(e)?Nt:jt,i=arguments.length<3;return n(e,Si(t,4),r,i,zr)},Er.reduceRight=function(e,t,r){var n=ns(e)?Ct:jt,i=arguments.length<3;return n(e,Si(t,4),r,i,Vr)},Er.repeat=function(e,t,r){return t=(r?Pi(e,t,r):t===n)?1:Ss(t),kn(Ts(e),t)},Er.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:ct.call(t,e[1],e[2])},Er.result=function(e,t,r){var i=-1,o=(t=Hi(t,e)?[t]:zn(t)).length;for(o||(e=n,o=1);++i<o;){var s=null==e?n:e[$i(t[i])];s===n&&(i=o,s=r),e=us(s)?s.call(e):s}return e},Er.round=ka,Er.runInContext=e,Er.sample=function(e){var t=is(e)?e:Xs(e),r=t.length;return r>0?t[Tn(0,r-1)]:n},Er.size=function(e){if(null==e)return 0;if(is(e)){var t=e.length;return t&&_s(e)?ir(e):t}if(ls(e)){var r=Oi(e);if(r==b||r==T)return e.size}return js(e).length},Er.snakeCase=ta,Er.some=function(e,t,r){var i=ns(e)?Lt:Nn;return r&&Pi(e,t,r)&&(t=n),i(e,Si(t,3))},Er.sortedIndex=function(e,t){return Cn(e,t)},Er.sortedIndexBy=function(e,t,r){return Ln(e,t,Si(r))},Er.sortedIndexOf=function(e,t){var r=e?e.length:0;if(r){var n=Cn(e,t);if(n<r&&Jo(e[n],t))return n}return-1},Er.sortedLastIndex=function(e,t){return Cn(e,t,!0)},Er.sortedLastIndexBy=function(e,t,r){return Ln(e,t,Si(r),!0)},Er.sortedLastIndexOf=function(e,t){if(e?e.length:0){var r=Cn(e,t,!0)-1;if(Jo(e[r],t))return r}return-1},Er.startCase=ra,Er.startsWith=function(e,t,r){return e=Ts(e),r=Gr(Ss(r),0,e.length),e.lastIndexOf(Pn(t),r)==r},Er.subtract=Ua,Er.sum=function(e){return e&&e.length?Gt(e,ha):0},Er.sumBy=function(e,t){return e&&e.length?Gt(e,Si(t)):0},Er.template=function(e,t,r){var i=Er.templateSettings;r&&Pi(e,t,r)&&(t=n),e=Ts(e),t=Rs({},t,i,Dr);var o,s,a=Rs({},t.imports,i.imports,Dr),u=js(a),f=Kt(a,u),c=0,h=t.interpolate||_e,l="__p += '",p=we((t.escape||_e).source+"|"+h.source+"|"+(h===Y?ue:_e).source+"|"+(t.evaluate||_e).source+"|$","g"),d="//# sourceURL="+("sourceURL"in t?t.sourceURL:"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(p,(function(t,r,n,i,a,u){return n||(n=i),l+=e.slice(c,u).replace(ye,Yt),r&&(o=!0,l+="' +\n__e("+r+") +\n'"),a&&(s=!0,l+="';\n"+a+";\n__p += '"),n&&(l+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),l+="';\n";var g=t.variable;g||(l="with (obj) {\n"+l+"\n}\n"),l=(s?l.replace(F,""):l).replace(W,"$1").replace(q,"$1;"),l="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var v=sa((function(){return Function(u,d+"return "+l).apply(n,f)}));if(v.source=l,as(v))throw v;return v},Er.times=function(e,t){if((e=Ss(e))<1||e>l)return[];var r=d,n=at(e,d);t=Si(t),e-=d;for(var i=Ft(n,t);++r<e;)t(r);return i},Er.toInteger=Ss,Er.toLength=Bs,Er.toLower=function(e){return Ts(e).toLowerCase()},Er.toNumber=Is,Er.toSafeInteger=function(e){return Gr(Ss(e),-9007199254740991,l)},Er.toString=Ts,Er.toUpper=function(e){return Ts(e).toUpperCase()},Er.trim=function(e,t,r){if((e=Ts(e))&&(r||t===n))return e.replace(ne,"");if(!e||!(t=Pn(t)))return e;var i=or(e),o=or(t);return Vn(i,zt(i,o),Vt(i,o)+1).join("")},Er.trimEnd=function(e,t,r){if((e=Ts(e))&&(r||t===n))return e.replace(oe,"");if(!e||!(t=Pn(t)))return e;var i=or(e);return Vn(i,0,Vt(i,or(t))+1).join("")},Er.trimStart=function(e,t,r){if((e=Ts(e))&&(r||t===n))return e.replace(ie,"");if(!e||!(t=Pn(t)))return e;var i=or(e);return Vn(i,zt(i,or(t))).join("")},Er.truncate=function(e,t){var r=30,i="...";if(hs(t)){var o="separator"in t?t.separator:o;r="length"in t?Ss(t.length):r,i="omission"in t?Pn(t.omission):i}var s=(e=Ts(e)).length;if(et.test(e)){var a=or(e);s=a.length}if(r>=s)return e;var u=r-ir(i);if(u<1)return i;var f=a?Vn(a,0,u).join(""):e.slice(0,u);if(o===n)return f+i;if(a&&(u+=f.length-u),vs(o)){if(e.slice(u).search(o)){var c,h=f;for(o.global||(o=we(o.source,Ts(fe.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var l=c.index;f=f.slice(0,l===n?u:l)}}else if(e.indexOf(Pn(o),u)!=u){var p=f.lastIndexOf(o);p>-1&&(f=f.slice(0,p))}return f+i},Er.unescape=function(e){return(e=Ts(e))&&V.test(e)?e.replace(K,sr):e},Er.uniqueId=function(e){var t=++ke;return Ts(e)+t},Er.upperCase=na,Er.upperFirst=ia,Er.each=Uo,Er.eachRight=Ro,Er.first=io,ga(Er,function(){var e={};return en(Er,(function(t,r){Te.call(Er.prototype,r)||(e[r]=t)})),e}(),{chain:!1}),Er.VERSION="4.11.2",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Er[e].placeholder=Er})),It(["drop","take"],(function(e,t){Sr.prototype[e]=function(r){var i=this.__filtered__;if(i&&!t)return new Sr(this);r=r===n?1:st(Ss(r),0);var o=this.clone();return i?o.__takeCount__=at(r,o.__takeCount__):o.__views__.push({size:at(r,d),type:e+(o.__dir__<0?"Right":"")}),o},Sr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Sr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Si(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),It(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Sr.prototype[e]=function(){return this[r](1).value()[0]}})),It(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Sr.prototype[e]=function(){return this.__filtered__?new Sr(this):this[r](1)}})),Sr.prototype.compact=function(){return this.filter(ha)},Sr.prototype.find=function(e){return this.filter(e).head()},Sr.prototype.findLast=function(e){return this.reverse().find(e)},Sr.prototype.invokeMap=Yo((function(e,t){return"function"==typeof e?new Sr(this):this.map((function(r){return cn(r,e,t)}))})),Sr.prototype.reject=function(e){return e=Si(e,3),this.filter((function(t){return!e(t)}))},Sr.prototype.slice=function(e,t){e=Ss(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Sr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=Ss(t))<0?r.dropRight(-t):r.take(t-e)),r)},Sr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Sr.prototype.toArray=function(){return this.take(d)},en(Sr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Er[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(Er.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,u=t instanceof Sr,f=a[0],c=u||ns(t),h=function(e){var t=o.apply(Er,Ot([e],a));return i&&l?t[0]:t};c&&r&&"function"==typeof f&&1!=f.length&&(u=c=!1);var l=this.__chain__,p=!!this.__actions__.length,d=s&&!l,g=u&&!p;if(!s&&c){t=g?t:new Sr(this);var v=e.apply(t,a);return v.__actions__.push({func:Ao,args:[h],thisArg:n}),new br(v,l)}return d&&g?e.apply(this,a):(v=this.thru(h),d?i?v.value()[0]:v.value():v)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Se[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Er.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(ns(i)?i:[],e)}return this[r]((function(r){return t.apply(ns(r)?r:[],e)}))}})),en(Sr.prototype,(function(e,t){var r=Er[t];if(r){var n=r.name+"";(hr[n]||(hr[n]=[])).push({name:t,func:r})}})),hr[ui(n,2).name]=[{name:"wrapper",func:n}],Sr.prototype.clone=function(){var e=new Sr(this.__wrapped__);return e.__actions__=Zn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Zn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Zn(this.__views__),e},Sr.prototype.reverse=function(){if(this.__filtered__){var e=new Sr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Sr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=ns(e),n=t<0,o=r?e.length:0,s=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=at(t,e+s);break;case"takeRight":e=st(e,t-s)}}return{start:e,end:t}}(0,o,this.__views__),a=s.start,u=s.end,f=u-a,c=n?u:a-1,h=this.__iteratees__,l=h.length,p=0,d=at(f,this.__takeCount__);if(!r||o<i||o==f&&d==f)return Gn(e,this.__actions__);var g=[];e:for(;f--&&p<d;){for(var v=-1,_=e[c+=t];++v<l;){var y=h[v],m=y.iteratee,E=y.type,w=m(_);if(2==E)_=w;else if(!w){if(1==E)continue e;break e}}g[p++]=_}return g},Er.prototype.at=To,Er.prototype.chain=function(){return Io(this)},Er.prototype.commit=function(){return new br(this.value(),this.__chain__)},Er.prototype.next=function(){this.__values__===n&&(this.__values__=bs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Er.prototype.plant=function(e){for(var t,r=this;r instanceof wr;){var i=Zi(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},Er.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Sr){var t=e;return this.__actions__.length&&(t=new Sr(this)),(t=t.reverse()).__actions__.push({func:Ao,args:[lo],thisArg:n}),new br(t,this.__chain__)}return this.thru(lo)},Er.prototype.toJSON=Er.prototype.valueOf=Er.prototype.value=function(){return Gn(this.__wrapped__,this.__actions__)},je&&(Er.prototype[je]=function(){return this}),Er}();(yt||_t||{})._=ar,pt&&dt?(gt&&((dt.exports=ar)._=ar),pt._=ar):Et._=ar}).call(e)}(gs,gs.exports);var vs=gs.exports;!function(e,t){var r=d,n=g,i=y,o=pt,s=v.EventEmitter,a=ds,u=vs;function f(e){this._options=e||{},this.remote={}}function c(e){return"win32"===process.platform?e.replace(/\\/g,"/"):e}i.inherits(f,s),f.prototype.defaults=function(e){if(!e)return this._options;this._options=e||{}},f.prototype.parse=function(e){if(u.isString(e)){var t=e.match(/^([a-zA-Z0-9\-\.]+)(\:.*)?@([^:]+):([^:]+:)?(.*)?$/);if(!t)return{};var r={username:t[1],host:t[3]};return t[2]&&(r.password=t[2].slice(1)),6===t.length&&t[4]&&(r.port=t[4].slice(0,-1)),6===t.length&&t[5]?r.path=t[5]:5===t.length&&t[4]&&(r.path=t[4]),this.remote=r,r}return this.remote=e,e},f.prototype.sftp=function(e){if(this.__sftp)e(null,this.__sftp);else{var t=u.defaults(this.remote,this._options);if(this.__ssh)this.__ssh.connect(t);else{var r=this,n=new a;n.on("connect",(function(){r.emit("connect")})),n.on("ready",(function(){r.emit("ready"),n.sftp((function(t,n){if(t)throw t;r.__sftp=n,e(t,n)}))})),n.on("error",(function(t){r.emit("error",t),e(t)})),n.on("end",(function(){r.emit("end")})),n.on("close",(function(){r.emit("close")})),n.on("keyboard-interactive",(function(e,t,n,i,o){r.emit("keyboard-interactive",e,t,n,i,o)})),n.on("change password",(function(e,t,n){r.emit("change password",e,t,n)})),n.on("tcp connection",(function(e,t,n){r.emit("tcp connection",e,t,n)})),n.connect(t),this.__ssh=n}}},f.prototype.close=function(){this.__sftp&&(this.__sftp.end(),this.__sftp=null),this.__ssh&&(this.__ssh.end(),this.__ssh=null)},f.prototype.mkdir=function(e,t,r){u.isFunction(t)&&(r=t,t=void 0),t&&(t.mode=function(e,t){var r="0755";if("win32"===e)return r;if(t)return t.mode||r}(process.platform,t));var i=this,s=[],a=!1;this.sftp((function(u,f){if(u)return r(u);var c=function(e,r){i.emit("mkdir",e),f.mkdir(e,t,r)};o.until((function(){return a}),(function(t){f.stat(e,(function(r,i){r?(s.push(e),e=n.dirname(e)):a=!0,t()}))}),(function(e){e?r(e):o.eachSeries(s.reverse(),c,r)}))}))},f.prototype.write=function(e,t){var i=e.destination;i=c(i);var s=e.attrs,a=e.content,u=e.chunkSize||32768,f=this;this.sftp((function(h,l){if(h)return t(h);var p=function(n){var i;f.emit("write",e);var c=0,p=0;if(Buffer.isBuffer(a)){var d=[];i=parseInt((a.length-1)/u,10)+1;for(var g=0;g<i;g++)d.push(a.slice(g*u,(g+1)*u));o.eachSeries(d,(function(e,t){f.emit("transfer",e,p,i),l.write(n,e,0,e.length,c,(function(r){c+=e.length,p+=1,t(r)}))}),(function(e){l.close(n,t)}))}else{if("number"!=typeof a)throw new Error("Content should be buffer or file descriptor");i=parseInt((s.size-1)/u,10)+1;var v=new Array(i);o.eachSeries(v,(function(e,t){if(u=Math.min(u,s.size-c)){var o=new Buffer(u);r.read(a,o,0,u,c,(function(e,r,o){f.emit("transfer",o,p,i),l.write(n,o,0,o.length,c,(function(e){c+=o.length,p+=1,t(e)}))}))}else t(h)}),(function(e){l.close(n,(function(e){r.close(a,t)}))}))}};l.open(i,"w",s,(function(t,r){t?(i=c(i=n.join(i,n.basename(e.source))),e.destination=i,l.open(i,"w",s,(function(e,t){p(t)}))):p(r)}))}))},f.prototype.upload=function(e,t,i){t=c(t);var s=this;o.waterfall([function(t){r.stat(e,t)},function(i,o){if(i.isDirectory())return o(new Error("Can not upload a directory"));r.stat(n.dirname(e),(function(e,r){if(e)return o(e);s.mkdir(n.dirname(t),r,(function(e){o(e,i)}))}))},function(t,n){r.open(e,"r",(function(e,r){n(e,t,r)}))},function(r,n,i){s.write({source:e,destination:t,content:n,attrs:r},i)}],(function(e){i(e)}))},f.prototype.download=function(e,t,n){var i=this;i.sftp((function(o,s){if(o)return n(o);var a=s.createReadStream(e);a.on("error",(function(e){n(e)})),a.pipe(r.createWriteStream(t)).on("close",(function(){i.emit("read",e),n(null)})).on("error",(function(e){n(e)}))}))},(e.exports=new f).Client=f}(dt);var _s=dt.exports;!function(e,t){var r=d,n=g,i=ft(),o=pt,s=_s.Client,a=new s;(t=e.exports=a).Client=s,t.scp=function(e,t,a,u){"function"==typeof a&&(u=a,a=new s),a.on("error",u);var f=a.parse(e);f.host&&f.path?function(e,t,r,i){var o=e.parse(t);/\/$/.test(r)&&(r+=n.basename(o.path)),e.download(o.path,r,(function(){e.close(),i.apply(this,arguments)}))}(a,f,t,u):function(e,t,s,a){e.parse(s);var u=function(t,i){var s=t[0];o.eachSeries(t,(function(t,i){r.stat(t,(function(r,o){if(r)i(r);else if(o.isFile()){var a=n.relative(s,t);e.upload(t,n.join(e.remote.path,a),i)}else i()}))}),(function(t){e.on("close",(function r(){i(t),e.removeListener("close",r)})),e.close()}))};-1===t.indexOf("*")?r.stat(t,(function(r,n){r?a(r):n.isFile()?e.upload(t,e.remote.path,(function(t){e.on("close",(function r(){a(t),e.removeListener("close",r)})),e.close()})):n.isDirectory()?i(t.replace(/\/$/,"")+"/**/**",(function(e,t){e?a(e):u(t,a)})):a("unsupported")})):i(t,(function(e,t){e?a(e):u(t,a)}))}(a,e,t,u)}}(U,U.exports);var ys=t(U.exports),ms={exports:{}};var Es,ws,bs={stringReplaceAll:(e,t,r)=>{let n=e.indexOf(t);if(-1===n)return e;const i=t.length;let o=0,s="";do{s+=e.substr(o,n-o)+t+r,o=n+i,n=e.indexOf(t,o)}while(-1!==n);return s+=e.substr(o),s},stringEncaseCRLFWithFirstIndex:(e,t,r,n)=>{let i=0,o="";do{const s="\r"===e[n-1];o+=e.substr(i,(s?n-1:n)-i)+t+(s?"\r\n":"\n")+r,i=n+1,n=e.indexOf("\n",i)}while(-1!==n);return o+=e.substr(i),o}};const Ss=r,{stdout:Bs,stderr:Is}=n,{stringReplaceAll:As,stringEncaseCRLFWithFirstIndex:Ts}=bs,{isArray:ks}=Array,Us=["ansi","ansi","ansi256","ansi16m"],Rs=Object.create(null);class Os{constructor(e){return Ns(e)}}const Ns=e=>{const t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=Bs?Bs.level:0;e.level=void 0===t.level?r:t.level})(t,e),t.template=(...e)=>js(t.template,...e),Object.setPrototypeOf(t,Cs.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=Os,t.template};function Cs(e){return Ns(e)}for(const[zu,Vu]of Object.entries(Ss))Rs[zu]={get(){const e=Ps(this,xs(Vu.open,Vu.close,this._styler),this._isEmpty);return Object.defineProperty(this,zu,{value:e}),e}};Rs.visible={get(){const e=Ps(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const Ls=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const Xu of Ls)Rs[Xu]={get(){const{level:e}=this;return function(...t){const r=xs(Ss.color[Us[e]][Xu](...t),Ss.color.close,this._styler);return Ps(this,r,this._isEmpty)}}};for(const Qu of Ls){Rs["bg"+Qu[0].toUpperCase()+Qu.slice(1)]={get(){const{level:e}=this;return function(...t){const r=xs(Ss.bgColor[Us[e]][Qu](...t),Ss.bgColor.close,this._styler);return Ps(this,r,this._isEmpty)}}}}const Ds=Object.defineProperties((()=>{}),{...Rs,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),xs=(e,t,r)=>{let n,i;return void 0===r?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},Ps=(e,t,r)=>{const n=(...e)=>ks(e[0])&&ks(e[0].raw)?Hs(n,js(n,...e)):Hs(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,Ds),n._generator=e,n._styler=t,n._isEmpty=r,n},Hs=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(void 0===r)return t;const{openAll:n,closeAll:i}=r;if(-1!==t.indexOf(""))for(;void 0!==r;)t=As(t,r.close,r.open),r=r.parent;const o=t.indexOf("\n");return-1!==o&&(t=Ts(t,i,n,o)),n+t+i};let Ms;const js=(e,...t)=>{const[r]=t;if(!ks(r)||!ks(r.raw))return t.join(" ");const n=t.slice(1),i=[r.raw[0]];for(let e=1;e<r.length;e++)i.push(String(n[e-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[e]));return void 0===Ms&&(Ms=function(){if(ws)return Es;ws=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,i=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function o(e){const t="u"===e[0],r="{"===e[1];return t&&!r&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):i.get(e)||e}function s(e,t){const i=[],s=t.trim().split(/\s*,\s*/g);let a;for(const t of s){const s=Number(t);if(Number.isNaN(s)){if(!(a=t.match(r)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);i.push(a[2].replace(n,((e,t,r)=>t?o(t):r)))}else i.push(s)}return i}function a(e){t.lastIndex=0;const r=[];let n;for(;null!==(n=t.exec(e));){const e=n[1];if(n[2]){const t=s(e,n[2]);r.push([e].concat(t))}else r.push([e])}return r}function u(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const[e,t]of Object.entries(r))if(Array.isArray(t)){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=t.length>0?n[e](...t):n[e]}return n}return Es=(t,r)=>{const n=[],i=[];let s=[];if(r.replace(e,((e,r,f,c,h,l)=>{if(r)s.push(o(r));else if(c){const e=s.join("");s=[],i.push(0===n.length?e:u(t,n)(e)),n.push({inverse:f,styles:a(c)})}else if(h){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");i.push(u(t,n)(s.join(""))),s=[],n.pop()}else s.push(l)})),i.push(s.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")},Es}()),Ms(e,i.join(""))};Object.defineProperties(Cs.prototype,Rs);const Gs=Cs();Gs.supportsColor=Bs,Gs.stderr=Cs({level:Is?Is.level:0}),Gs.stderr.supportsColor=Is;var Fs=Gs,Ws={};const qs=o;var Ks=i((()=>{qs((()=>{process.stderr.write("[?25h")}),{alwaysLast:!0})}));!function(e){const t=Ks;let r=!1;e.show=(e=process.stderr)=>{e.isTTY&&(r=!1,e.write("[?25h"))},e.hide=(e=process.stderr)=>{e.isTTY&&(t(),r=!0,e.write("[?25l"))},e.toggle=(t,n)=>{void 0!==t&&(r=t),r?e.show(n):e.hide(n)}}(Ws);var zs={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","❤️ "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}};const Vs=Object.assign({},zs),Xs=Object.keys(Vs);Object.defineProperty(Vs,"random",{get(){const e=Math.floor(Math.random()*Xs.length),t=Xs[e];return Vs[t]}});var Qs=Vs,$s=()=>"win32"!==process.platform||(Boolean(process.env.CI)||Boolean(process.env.WT_SESSION)||"vscode"===process.env.TERM_PROGRAM||"xterm-256color"===process.env.TERM||"alacritty"===process.env.TERM);const Ys=Fs,Zs=$s,Js={info:Ys.blue("ℹ"),success:Ys.green("✔"),warning:Ys.yellow("⚠"),error:Ys.red("✖")},ea={info:Ys.blue("i"),success:Ys.green("√"),warning:Ys.yellow("‼"),error:Ys.red("×")};var ta=Zs()?Js:ea;const ra=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")};var na={exports:{}},ia={exports:{}};!function(e){var t=function(){function e(t,n,i,o){"object"==typeof n&&(i=n.depth,o=n.prototype,n.filter,n=n.circular);var s=[],a=[],u="undefined"!=typeof Buffer;return void 0===n&&(n=!0),void 0===i&&(i=1/0),function t(i,f){if(null===i)return null;if(0==f)return i;var c,h;if("object"!=typeof i)return i;if(e.__isArray(i))c=[];else if(e.__isRegExp(i))c=new RegExp(i.source,r(i)),i.lastIndex&&(c.lastIndex=i.lastIndex);else if(e.__isDate(i))c=new Date(i.getTime());else{if(u&&Buffer.isBuffer(i))return c=Buffer.allocUnsafe?Buffer.allocUnsafe(i.length):new Buffer(i.length),i.copy(c),c;void 0===o?(h=Object.getPrototypeOf(i),c=Object.create(h)):(c=Object.create(o),h=o)}if(n){var l=s.indexOf(i);if(-1!=l)return a[l];s.push(i),a.push(c)}for(var p in i){var d;h&&(d=Object.getOwnPropertyDescriptor(h,p)),d&&null==d.set||(c[p]=t(i[p],f-1))}return c}(t,i)}function t(e){return Object.prototype.toString.call(e)}function r(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return e.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},e.__objToStr=t,e.__isDate=function(e){return"object"==typeof e&&"[object Date]"===t(e)},e.__isArray=function(e){return"object"==typeof e&&"[object Array]"===t(e)},e.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===t(e)},e.__getRegExpFlags=r,e}();e.exports&&(e.exports=t)}(ia);var oa=ia.exports,sa=function(e,t){return e=e||{},Object.keys(t).forEach((function(r){void 0===e[r]&&(e[r]=oa(t[r]))})),e},aa=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],ua={nul:0,control:0};function fa(e,t){if("string"!=typeof e)return ca(e,t);for(var r=0,n=0;n<e.length;n++){var i=ca(e.charCodeAt(n),t);if(i<0)return-1;r+=i}return r}function ca(e,t){return 0===e?t.nul:e<32||e>=127&&e<160?t.control:function(e){var t,r=0,n=aa.length-1;if(e<aa[0][0]||e>aa[n][1])return!1;for(;n>=r;)if(t=Math.floor((r+n)/2),e>aa[t][1])r=t+1;else{if(!(e<aa[t][0]))return!0;n=t-1}return!1}(e)?0:1+(e>=4352&&(e<=4447||9001==e||9002==e||e>=11904&&e<=42191&&12351!=e||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141))}na.exports=function(e){return fa(e,ua)},na.exports.config=function(e){return e=sa(e||{},ua),function(t){return fa(t,e)}};var ha,la,pa,da,ga,va,_a=na.exports,ya={exports:{}},ma={exports:{}};function Ea(){return la?ha:(la=1,ha=b)}function wa(){if(da)return pa;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}da=1;var o=S.Buffer,s=y.inspect,a=s&&s.custom||"inspect";return pa=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var r,i,u;return r=e,i=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,i=o.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,r=i,n=a,o.prototype.copy.call(t,r,n),a+=s.data.length,s=s.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,t}},{key:a,value:function(e,r){return s(this,t(t({},r),{},{depth:0,customInspect:!1}))}}],i&&n(r.prototype,i),u&&n(r,u),Object.defineProperty(r,"prototype",{writable:!1}),e}(),pa}function ba(){if(va)return ga;function e(e,n){r(e,n),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}return va=1,ga={destroy:function(n,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,n)):process.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,(function(r){!i&&r?o._writableState?o._writableState.errorEmitted?process.nextTick(t,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,r)):process.nextTick(e,o,r):i?(process.nextTick(t,o),i(r)):process.nextTick(t,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}},ga}var Sa,Ba,Ia,Aa,Ta,ka,Ua,Ra,Oa,Na={};function Ca(){if(Sa)return Na;Sa=1;const e={};function t(t,r,n){n||(n=Error);class i extends n{constructor(e,t,n){super(function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(e,t,n))}}i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function r(e,t){if(Array.isArray(e)){const r=e.length;return 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)}`}return t("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,t,n){let i;var o,s;let a;if("string"==typeof t&&(o="not ",t.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a=`The ${e} ${i} ${r(t,"type")}`;else{const n=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a=`The "${e}" ${n} ${i} ${r(t,"type")}`}return a+=". Received type "+typeof n,a}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Na.codes=e,Na}function La(){if(Ia)return Ba;Ia=1;var e=Ca().codes.ERR_INVALID_OPT_VALUE;return Ba={getHighWaterMark:function(t,r,n,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(r,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new e(i?n:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}}function Da(){if(Ua)return ka;function t(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var r;Ua=1,ka=B,B.WritableState=b;var n={deprecate:Ta?Aa:(Ta=1,Aa=y.deprecate)},i=Ea(),o=S.Buffer,s=(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,u=ba(),f=La().getHighWaterMark,c=Ca().codes,h=c.ERR_INVALID_ARG_TYPE,l=c.ERR_METHOD_NOT_IMPLEMENTED,p=c.ERR_MULTIPLE_CALLBACK,d=c.ERR_STREAM_CANNOT_PIPE,g=c.ERR_STREAM_DESTROYED,v=c.ERR_STREAM_NULL_VALUES,_=c.ERR_STREAM_WRITE_AFTER_END,m=c.ERR_UNKNOWN_ENCODING,E=u.errorOrDestroy;function w(){}function b(e,n,i){r=r||xa(),e=e||{},"boolean"!=typeof i&&(i=n instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(R,e,t),e._writableState.errorEmitted=!0,E(e,n)):(i(n),e._writableState.errorEmitted=!0,E(e,n),R(e,t))}(e,r,n,t,i);else{var o=k(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?process.nextTick(A,e,r,o,i):A(e,r,o,i)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function B(e){var t=this instanceof(r=r||xa());if(!t&&!a.call(B,this))return new B(e);this._writableState=new b(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),i.call(this)}function I(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),R(e,t)}function T(e,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(e._writev&&n&&n.next){var i=r.bufferedRequestCount,o=new Array(i),s=r.corkedRequestsFree;s.entry=n;for(var a=0,u=!0;n;)o[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;o.allBuffers=u,I(e,r,!0,r.length,o,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;n;){var f=n.chunk,c=n.encoding,h=n.callback;if(I(e,r,!1,r.objectMode?1:f.length,f,c,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function U(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var r=k(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(U,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}return Le(B,i),b.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(b.prototype,"buffer",{get:n.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===B&&(e&&e._writableState instanceof b)}})):a=function(e){return e instanceof this},B.prototype.pipe=function(){E(this,new d)},B.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,u=!i.objectMode&&(n=e,o.isBuffer(n)||n instanceof s);return u&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),u?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=w),i.ending?function(e,t){var r=new _;E(e,r),process.nextTick(t,r)}(this,r):(u||function(e,t,r,n){var i;return null===r?i=new v:"string"==typeof r||t.objectMode||(i=new h("chunk",["string","Buffer"],r)),!i||(E(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,s){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var u=t.objectMode?1:n.length;t.length+=u;var f=t.length<t.highWaterMark;f||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else I(e,t,!1,u,n,i,s);return f}(this,i,u,e,t,r)),a},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},B.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new m(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(e,t,r){r(new l("_write()"))},B.prototype._writev=null,B.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(B.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),B.prototype.destroy=u.destroy,B.prototype._undestroy=u.undestroy,B.prototype._destroy=function(e,t){t(e)},ka}function xa(){if(Oa)return Ra;Oa=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Ra=s;var t=ou(),r=Da();Le(s,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var o=n[i];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(e){if(!(this instanceof s))return new s(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||process.nextTick(u,this)}function u(e){e.end()}return Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),Ra}var Pa,Ha,Ma,ja,Ga,Fa,Wa,qa,Ka,za,Va,Xa,Qa,$a,Ya,Za,Ja={},eu={exports:{}};function tu(){if(Ha)return Ja;Ha=1;var e=(Pa||(Pa=1,function(e,t){var r=S,n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(eu,eu.exports)),eu.exports).Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=o,this.end=s,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=a,this.end=u,n=3;break;default:return this.write=f,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function a(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function c(e){return e&&e.length?this.write(e):""}return Ja.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(i<r)return 0;var o=n(t[i]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--i<r||-2===o)return 0;if(o=n(t[i]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--i<r||-2===o)return 0;if(o=n(t[i]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},Ja}function ru(){if(ja)return Ma;ja=1;var e=Ca().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return Ma=function r(n,i,o){if("function"==typeof i)return r(n,null,i);i||(i={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||t);var s=i.readable||!1!==i.readable&&n.readable,a=i.writable||!1!==i.writable&&n.writable,u=function(){n.writable||c()},f=n._writableState&&n._writableState.finished,c=function(){a=!1,f=!0,s||o.call(n)},h=n._readableState&&n._readableState.endEmitted,l=function(){s=!1,h=!0,a||o.call(n)},p=function(e){o.call(n,e)},d=function(){var t;return s&&!h?(n._readableState&&n._readableState.ended||(t=new e),o.call(n,t)):a&&!f?(n._writableState&&n._writableState.ended||(t=new e),o.call(n,t)):void 0},g=function(){n.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(n)?a&&!n._writableState&&(n.on("end",u),n.on("close",u)):(n.on("complete",c),n.on("abort",d),n.req?g():n.on("request",g)),n.on("end",l),n.on("finish",c),!1!==i.error&&n.on("error",p),n.on("close",d),function(){n.removeListener("complete",c),n.removeListener("abort",d),n.removeListener("request",g),n.req&&n.req.removeListener("finish",c),n.removeListener("end",u),n.removeListener("close",u),n.removeListener("finish",c),n.removeListener("end",l),n.removeListener("error",p),n.removeListener("close",d)}},Ma}function nu(){if(Fa)return Ga;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Fa=1;var r=ru(),n=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),u=Symbol("handlePromise"),f=Symbol("stream");function c(e,t){return{value:e,done:t}}function h(e){var t=e[n];if(null!==t){var r=e[f].read();null!==r&&(e[a]=null,e[n]=null,e[i]=null,t(c(r,!1)))}}function l(e){process.nextTick(h,e)}var p=Object.getPrototypeOf((function(){})),d=Object.setPrototypeOf((t(e={get stream(){return this[f]},next:function(){var e=this,t=this[o];if(null!==t)return Promise.reject(t);if(this[s])return Promise.resolve(c(void 0,!0));if(this[f].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[o]?r(e[o]):t(c(void 0,!0))}))}));var r,n=this[a];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[s]?r(c(void 0,!0)):t[u](r,n)}),n)}}(n,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(c(i,!1));r=new Promise(this[u])}return this[a]=r,r}},Symbol.asyncIterator,(function(){return this})),t(e,"return",(function(){var e=this;return new Promise((function(t,r){e[f].destroy(null,(function(e){e?r(e):t(c(void 0,!0))}))}))})),e),p);return Ga=function(e){var h,p=Object.create(d,(t(h={},f,{value:e,writable:!0}),t(h,n,{value:null,writable:!0}),t(h,i,{value:null,writable:!0}),t(h,o,{value:null,writable:!0}),t(h,s,{value:e._readableState.endEmitted,writable:!0}),t(h,u,{value:function(e,t){var r=p[f].read();r?(p[a]=null,p[n]=null,p[i]=null,e(c(r,!1))):(p[n]=e,p[i]=t)},writable:!0}),h));return p[a]=null,r(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=p[i];return null!==t&&(p[a]=null,p[n]=null,p[i]=null,t(e)),void(p[o]=e)}var r=p[n];null!==r&&(p[a]=null,p[n]=null,p[i]=null,r(c(void 0,!0))),p[s]=!0})),e.on("readable",l.bind(null,p)),p},Ga}function iu(){if(qa)return Wa;function e(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,i)}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}qa=1;var n=Ca().codes.ERR_INVALID_ARG_TYPE;return Wa=function(i,o,s){var a;if(o&&"function"==typeof o.next)a=o;else if(o&&o[Symbol.asyncIterator])a=o[Symbol.asyncIterator]();else{if(!o||!o[Symbol.iterator])throw new n("iterable",["Iterable"],o);a=o[Symbol.iterator]()}var u=new i(function(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({objectMode:!0},s)),f=!1;function c(){return h.apply(this,arguments)}function h(){var t;return t=function*(){try{var e=yield a.next(),t=e.value;e.done?u.push(null):u.push(yield t)?c():f=!1}catch(e){u.destroy(e)}},h=function(){var r=this,n=arguments;return new Promise((function(i,o){var s=t.apply(r,n);function a(t){e(s,i,o,a,u,"next",t)}function u(t){e(s,i,o,a,u,"throw",t)}a(void 0)}))},h.apply(this,arguments)}return u._read=function(){f||(f=!0,c())},u},Wa}function ou(){if(za)return Ka;var t;za=1,Ka=I,I.ReadableState=B,v.EventEmitter;var r=function(e,t){return e.listeners(t).length},n=Ea(),i=S.Buffer,o=(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var s,a=y;s=a&&a.debuglog?a.debuglog("stream"):function(){};var u,f,c,h=wa(),l=ba(),p=La().getHighWaterMark,d=Ca().codes,g=d.ERR_INVALID_ARG_TYPE,_=d.ERR_STREAM_PUSH_AFTER_EOF,m=d.ERR_METHOD_NOT_IMPLEMENTED,E=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Le(I,n);var w=l.errorOrDestroy,b=["error","close","destroy","pause","resume"];function B(e,r,n){t=t||xa(),e=e||{},"boolean"!=typeof n&&(n=r instanceof t),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",n),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=tu().StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function I(e){if(t=t||xa(),!(this instanceof I))return new I(e);var r=this instanceof t;this._readableState=new B(e,this,r),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function A(e,t,r,n,a){s("readableAddChunk",t);var u,f=e._readableState;if(null===t)f.reading=!1,function(e,t){if(s("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,O(e)))}(e,f);else if(a||(u=function(e,t){var r;n=t,i.isBuffer(n)||n instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(f,t)),u)w(e,u);else if(f.objectMode||t&&t.length>0)if("string"==typeof t||f.objectMode||Object.getPrototypeOf(t)===i.prototype||(t=function(e){return i.from(e)}(t)),n)f.endEmitted?w(e,new E):T(e,f,t,!0);else if(f.ended)w(e,new _);else{if(f.destroyed)return!1;f.reading=!1,f.decoder&&!r?(t=f.decoder.write(t),f.objectMode||0!==t.length?T(e,f,t,!1):N(e,f)):T(e,f,t,!1)}else n||(f.reading=!1,N(e,f));return!f.ended&&(f.length<f.highWaterMark||0===f.length)}function T(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&R(e)),N(e,t)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),I.prototype.destroy=l.destroy,I.prototype._undestroy=l.undestroy,I.prototype._destroy=function(e,t){t(e)},I.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=i.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},I.prototype.unshift=function(e){return A(this,e,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(e){u||(u=tu().StringDecoder);var t=new u(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var k=1073741824;function U(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(s("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(O,e))}function O(e){var t=e._readableState;s("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,P(e)}function N(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(s("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){s("readable nexttick read 0"),e.read(0)}function x(e,t){s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),P(e),t.flowing&&!t.reading&&e.read(0)}function P(e){var t=e._readableState;for(s("flow",t.flowing);t.flowing&&null!==e.read(););}function H(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function M(e){var t=e._readableState;s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(j,t,e))}function j(e,t){if(s("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function G(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return I.prototype.read=function(e){s("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return s("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):R(this),null;if(0===(e=U(e,t))&&t.ended)return 0===t.length&&M(this),null;var n,i=t.needReadable;return s("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&s("length less than watermark",i=!0),t.ended||t.reading?s("reading or ended",i=!1):i&&(s("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=U(r,t))),null===(n=e>0?H(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==n&&this.emit("data",n),n},I.prototype._read=function(e){w(this,new m("_read()"))},I.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,s("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?u:g;function a(t,r){s("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,s("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",f),e.removeListener("error",l),e.removeListener("unpipe",a),n.removeListener("end",u),n.removeListener("end",g),n.removeListener("data",h),c=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function u(){s("onend"),e.end()}i.endEmitted?process.nextTick(o):n.once("end",o),e.on("unpipe",a);var f=function(e){return function(){var t=e._readableState;s("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&r(e,"data")&&(t.flowing=!0,P(e))}}(n);e.on("drain",f);var c=!1;function h(t){s("ondata");var r=e.write(t);s("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==G(i.pipes,e))&&!c&&(s("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function l(t){s("onerror",t),g(),e.removeListener("error",l),0===r(e,"error")&&w(e,t)}function p(){e.removeListener("finish",d),g()}function d(){s("onfinish"),e.removeListener("close",p),g()}function g(){s("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",l),e.once("close",p),e.once("finish",d),e.emit("pipe",n),i.flowing||(s("pipe resume"),n.resume()),e},I.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=G(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},I.prototype.on=function(e,t){var r=n.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,s("on readable",i.length,i.reading),i.length?R(this):i.reading||process.nextTick(D,this))),r},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,t){var r=n.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(L,this),r},I.prototype.removeAllListeners=function(e){var t=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(L,this),t},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(s("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(x,e,t))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(s("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(s("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<b.length;o++)e.on(b[o],this.emit.bind(this,b[o]));return this._read=function(t){s("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(I.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=nu()),f(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),I._fromList=H,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(I.from=function(e,t){return void 0===c&&(c=iu()),c(I,e,t)}),Ka}function su(){if(Xa)return Va;Xa=1,Va=a;var e=Ca().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=e.ERR_TRANSFORM_WITH_LENGTH_0,o=xa();function s(e,t){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(null===i)return this.emit("error",new r);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),i(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);o.call(this,e),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,r){f(e,t,r)}))}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new i;if(e._transformState.transforming)throw new n;return e.push(null)}return Le(a,o),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,o.prototype.push.call(this,e,t)},a.prototype._transform=function(e,r,n){n(new t("_transform()"))},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},a.prototype._destroy=function(e,t){o.prototype._destroy.call(this,e,(function(e){t(e)}))},Va}function au(){if(Za)return Ya;var e;Za=1;var t=Ca().codes,r=t.ERR_MISSING_ARGS,n=t.ERR_STREAM_DESTROYED;function i(e){if(e)throw e}function o(e){e()}function s(e,t){return e.pipe(t)}return Ya=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var f,c=function(e){return e.length?"function"!=typeof e[e.length-1]?i:e.pop():i}(a);if(Array.isArray(a[0])&&(a=a[0]),a.length<2)throw new r("streams");var h=a.map((function(t,r){var i=r<a.length-1;return function(t,r,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===e&&(e=ru()),e(t,{readable:r,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var a=!1;return function(e){if(!s&&!a)return a=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new n("pipe"))}}(t,i,r>0,(function(e){f||(f=e),e&&h.forEach(o),i||(h.forEach(o),c(f))}))}));return a.reduce(s)},Ya}!function(e,t){var r=b;"disable"===process.env.READABLE_STREAM&&r?(e.exports=r.Readable,Object.assign(e.exports,r),e.exports.Stream=r):((t=e.exports=ou()).Stream=r||t,t.Readable=t,t.Writable=Da(),t.Duplex=xa(),t.Transform=su(),t.PassThrough=function(){if($a)return Qa;$a=1,Qa=t;var e=su();function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return Le(t,e),t.prototype._transform=function(e,t,r){r(null,e)},Qa}(),t.finished=ru(),t.pipeline=au())}(ma,ma.exports);var uu=ma.exports;const{Buffer:fu}=S,cu=Symbol.for("BufferList");function hu(e){if(!(this instanceof hu))return new hu(e);hu._init.call(this,e)}hu._init=function(e){Object.defineProperty(this,cu,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},hu.prototype._new=function(e){return new hu(e)},hu.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){const n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},hu.prototype._reverseOffset=function(e){const t=e[0];let r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},hu.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},hu.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},hu.prototype.copy=function(e,t,r,n){if(("number"!=typeof r||r<0)&&(r=0),("number"!=typeof n||n>this.length)&&(n=this.length),r>=this.length)return e||fu.alloc(0);if(n<=0)return e||fu.alloc(0);const i=!!e,o=this._offset(r),s=n-r;let a=s,u=i&&t||0,f=o[1];if(0===r&&n===this.length){if(!i)return 1===this._bufs.length?this._bufs[0]:fu.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,u),u+=this._bufs[t].length;return e}if(a<=this._bufs[o[0]].length-f)return i?this._bufs[o[0]].copy(e,t,f,f+a):this._bufs[o[0]].slice(f,f+a);i||(e=fu.allocUnsafe(s));for(let t=o[0];t<this._bufs.length;t++){const r=this._bufs[t].length-f;if(!(a>r)){this._bufs[t].copy(e,u,f,f+a),u+=r;break}this._bufs[t].copy(e,u,f),u+=r,a-=r,f&&(f=0)}return e.length>u?e.slice(0,u):e},hu.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},hu.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},hu.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},hu.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},hu.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(fu.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else"number"==typeof e&&(e=e.toString()),this._appendBuffer(fu.from(e));return this},hu.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},hu.prototype.indexOf=function(e,t,r){if(void 0===r&&"string"==typeof t&&(r=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=fu.from([e]):"string"==typeof e?e=fu.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=fu.from(e.buffer,e.byteOffset,e.byteLength):fu.isBuffer(e)||(e=fu.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const n=this._offset(t);let i=n[0],o=n[1];for(;i<this._bufs.length;i++){const t=this._bufs[i];for(;o<t.length;){if(t.length-o>=e.length){const r=t.indexOf(e,o);if(-1!==r)return this._reverseOffset([i,r]);o=t.length-e.length+1}else{const t=this._reverseOffset([i,o]);if(this._match(t,e))return t;o++}}o=0}return-1},hu.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)!function(t){hu.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}}(t)}(),hu.prototype._isBufferList=function(e){return e instanceof hu||hu.isBufferList(e)},hu.isBufferList=function(e){return null!=e&&e[cu]};var lu=hu;const pu=uu.Duplex,du=lu;function gu(e){if(!(this instanceof gu))return new gu(e);if("function"==typeof e){this._callback=e;const t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",(function(e){e.on("error",t)})),this.on("unpipe",(function(e){e.removeListener("error",t)})),e=null}du._init.call(this,e),pu.call(this)}Le(gu,pu),Object.assign(gu.prototype,du.prototype),gu.prototype._new=function(e){return new gu(e)},gu.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},gu.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},gu.prototype.end=function(e){pu.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},gu.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},gu.prototype._isBufferList=function(e){return e instanceof gu||e instanceof du||gu.isBufferList(e)},gu.isBufferList=du.isBufferList,ya.exports=gu,ya.exports.BufferListStream=gu,ya.exports.BufferList=du;var vu=ya.exports;const _u=A,yu=Fs,mu=Ws,Eu=Qs,wu=ta,bu=e=>"string"==typeof e?e.replace(ra(),""):e,Su=_a,Bu=({stream:e=process.stdout}={})=>Boolean(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env)),Iu=$s,{BufferListStream:Au}=vu,Tu=Symbol("text"),ku=Symbol("prefixText");class Uu{constructor(){this.requests=0,this.mutedStream=new Au,this.mutedStream.pipe(process.stdout);const e=this;this.ourEmit=function(t,r,...n){const{stdin:i}=process;if(e.requests>0||i.emit===e.ourEmit){if("keypress"===t)return;"data"===t&&r.includes(3)&&process.emit("SIGINT"),Reflect.apply(e.oldEmit,this,[t,r,...n])}else Reflect.apply(process.stdin.emit,this,[t,r,...n])}}start(){this.requests++,1===this.requests&&this.realStart()}stop(){if(this.requests<=0)throw new Error("`stop` called more times than `start`");this.requests--,0===this.requests&&this.realStop()}realStart(){"win32"!==process.platform&&(this.rl=_u.createInterface({input:process.stdin,output:this.mutedStream}),this.rl.on("SIGINT",(()=>{0===process.listenerCount("SIGINT")?process.emit("SIGINT"):(this.rl.close(),process.kill(process.pid,"SIGINT"))})))}realStop(){"win32"!==process.platform&&(this.rl.close(),this.rl=void 0)}}let Ru;class Ou{constructor(e){Ru||(Ru=new Uu),"string"==typeof e&&(e={text:e}),this.options={text:"",color:"cyan",stream:process.stderr,discardStdin:!0,...e},this.spinner=this.options.spinner,this.color=this.options.color,this.hideCursor=!1!==this.options.hideCursor,this.interval=this.options.interval||this.spinner.interval||100,this.stream=this.options.stream,this.id=void 0,this.isEnabled="boolean"==typeof this.options.isEnabled?this.options.isEnabled:Bu({stream:this.stream}),this.isSilent="boolean"==typeof this.options.isSilent&&this.options.isSilent,this.text=this.options.text,this.prefixText=this.options.prefixText,this.linesToClear=0,this.indent=this.options.indent,this.discardStdin=this.options.discardStdin,this.isDiscardingStdin=!1}get indent(){return this._indent}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this._indent=e}_updateInterval(e){void 0!==e&&(this.interval=e)}get spinner(){return this._spinner}set spinner(e){if(this.frameIndex=0,"object"==typeof e){if(void 0===e.frames)throw new Error("The given spinner must have a `frames` property");this._spinner=e}else if(Iu())if(void 0===e)this._spinner=Eu.dots;else{if("default"===e||!Eu[e])throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this._spinner=Eu[e]}else this._spinner=Eu.line;this._updateInterval(this._spinner.interval)}get text(){return this[Tu]}set text(e){this[Tu]=e,this.updateLineCount()}get prefixText(){return this[ku]}set prefixText(e){this[ku]=e,this.updateLineCount()}get isSpinning(){return void 0!==this.id}getFullPrefixText(e=this[ku],t=" "){return"string"==typeof e?e+t:"function"==typeof e?e()+t:""}updateLineCount(){const e=this.stream.columns||80,t=this.getFullPrefixText(this.prefixText,"-");this.lineCount=0;for(const r of bu(t+"--"+this[Tu]).split("\n"))this.lineCount+=Math.max(1,Math.ceil(Su(r)/e))}get isEnabled(){return this._isEnabled&&!this.isSilent}set isEnabled(e){if("boolean"!=typeof e)throw new TypeError("The `isEnabled` option must be a boolean");this._isEnabled=e}get isSilent(){return this._isSilent}set isSilent(e){if("boolean"!=typeof e)throw new TypeError("The `isSilent` option must be a boolean");this._isSilent=e}frame(){const{frames:e}=this.spinner;let t=e[this.frameIndex];this.color&&(t=yu[this.color](t)),this.frameIndex=++this.frameIndex%e.length;return("string"==typeof this.prefixText&&""!==this.prefixText?this.prefixText+" ":"")+t+("string"==typeof this.text?" "+this.text:"")}clear(){if(!this.isEnabled||!this.stream.isTTY)return this;for(let e=0;e<this.linesToClear;e++)e>0&&this.stream.moveCursor(0,-1),this.stream.clearLine(),this.stream.cursorTo(this.indent);return this.linesToClear=0,this}render(){return this.isSilent||(this.clear(),this.stream.write(this.frame()),this.linesToClear=this.lineCount),this}start(e){return e&&(this.text=e),this.isSilent?this:this.isEnabled?(this.isSpinning||(this.hideCursor&&mu.hide(this.stream),this.discardStdin&&process.stdin.isTTY&&(this.isDiscardingStdin=!0,Ru.start()),this.render(),this.id=setInterval(this.render.bind(this),this.interval)),this):(this.text&&this.stream.write(`- ${this.text}\n`),this)}stop(){return this.isEnabled?(clearInterval(this.id),this.id=void 0,this.frameIndex=0,this.clear(),this.hideCursor&&mu.show(this.stream),this.discardStdin&&process.stdin.isTTY&&this.isDiscardingStdin&&(Ru.stop(),this.isDiscardingStdin=!1),this):this}succeed(e){return this.stopAndPersist({symbol:wu.success,text:e})}fail(e){return this.stopAndPersist({symbol:wu.error,text:e})}warn(e){return this.stopAndPersist({symbol:wu.warning,text:e})}info(e){return this.stopAndPersist({symbol:wu.info,text:e})}stopAndPersist(e={}){if(this.isSilent)return this;const t=e.prefixText||this.prefixText,r=e.text||this.text,n="string"==typeof r?" "+r:"";return this.stop(),this.stream.write(`${this.getFullPrefixText(t," ")}${e.symbol||" "}${n}\n`),this}}ms.exports=function(e){return new Ou(e)},ms.exports.promise=(e,t)=>{if("function"!=typeof e.then)throw new TypeError("Parameter `action` must be a Promise");const r=new Ou(t);return r.start(),(async()=>{try{await e,r.succeed()}catch{r.fail()}})(),r};var Nu=t(ms.exports);const Cu=await s("uploadServeConfig");T.locale("zh-cn");const Lu="pro"===process.env.VUE_APP_PACK_ENV,Du=process.env.VUE_APP_LINE_VERSION,xu=Lu&&2==+Du?Cu.host[1]:Cu.host[0],Pu=Lu?Cu.staticPath.pro:Cu.staticPath.dev,Hu=`${Cu.protocol}://${xu}/${Pu}`,Mu=a(),ju={host:xu,port:"22",locaPath:`${process.env.PWD}${Cu.locaPath}`,...Cu.serverOption,pathNmae:`${Cu.serverOption.pathNmae}${Pu}`};function Gu(e){return`<div class="gray">${T().format("lll")}</div><div class="highlight">${Cu.projectTitle}${Lu?"生产":"开发"}环境发布${e}</div><div class="normal">commitId:${Mu.commitId}</div><div class="normal">commitMsg:${Mu.commitMsg}</div><div class="normal">访问地址:${Hu}</div>`}u("本次打包信息 =>",{...Cu.baseInfo||{},serverPath:ju.pathNmae});const Fu=Nu("正在发布到"+(Lu?"生产":"开发")+"服务器..."),Wu=new(0,require("ssh2").Client);f("正在建立连接"),Wu.on("ready",(function(){if(c("已连接"),!ju.pathNmae)return c("连接已关闭"),Wu.end(),!1;Wu.exec("rm -rf "+ju.pathNmae+"/*",(function(e,t){h("已删除服务端文件"),t.on("close",(function(e,t){c("开始上传"),Fu.start(),ys.scp(ju.locaPath,{host:ju.host,port:ju.port,username:ju.username,password:ju.password,path:ju.pathNmae},(e=>{Fu.stop(),e?(p("发布失败.\n",e),k({msgtype:"textcard",textcard:{title:"发布失败",description:Gu("失败"),url:Hu,btntxt:"更多"}})):(l("Success! 成功发布到"+(Lu?"生产":"开发")+"服务器!",`访问地址====>${Hu}`),k({msgtype:"textcard",textcard:{title:"发布成功",description:Gu("成功"),url:Hu,btntxt:"更多"}})),Wu.end()}))}))}))})).connect({host:ju.host,port:ju.port,username:ju.username,password:ju.password});