From 955e174d2b73b64674f000c876504e6ca8a7f848 Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Tue, 29 Oct 2019 09:19:00 -0400 Subject: [PATCH] js: set json to true --- package-lock.json | 2 +- package.json | 2 +- quickbase.browserify.min.js | 2 +- quickbase.js | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 68b7fc70a3..38a86f087e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "quickbase", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cb3b5225f1..c6ee53e11c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "quickbase", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.1", "description": "A lightweight, very flexible QuickBase API", "keywords": [ "quickbase", diff --git a/quickbase.browserify.min.js b/quickbase.browserify.min.js index c25829f83a..107dd9aef0 100644 --- a/quickbase.browserify.min.js +++ b/quickbase.browserify.min.js @@ -12,4 +12,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -!function(){return function e(t,r,i){function a(o,s){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!s&&c)return c(o,!0);if(n)return n(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[o]={exports:{}};t[o][0].call(p.exports,function(e){return a(t[o][1][e]||e)},p,p.exports,e,t,r,i)}return r[o].exports}for(var n="function"==typeof require&&require,o=0;o%\\^`{|}]|%[0-9a-f]{2})|\{[+#.\/;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,p=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,l=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,f=/^(?:\/(?:[^~\/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~\/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(a);if(!t)return!1;var r=+t[1],i=+t[2],o=+t[3];return i>=1&&i<=12&&o>=1&&o<=(2==i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:n[i])}function b(e,t){var r=e.match(o);if(!r)return!1;var i=r[1],a=r[2],n=r[3],s=r[5];return(i<=23&&a<=59&&n<=59||23==i&&59==a&&60==n)&&(!t||s)}t.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:p,email:/^[a-z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:k,uuid:l,"json-pointer":f,"json-pointer-uri-fragment":h,"relative-json-pointer":d},m.full={date:g,time:b,"date-time":function(e){var t=e.split(v);return 2==t.length&&g(t[0])&&b(t[1],!0)},uri:function(e){return y.test(e)&&c.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@\/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@\/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:p,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&s.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:k,uuid:l,"json-pointer":f,"json-pointer-uri-fragment":h,"relative-json-pointer":d};var v=/t|\s/i;var y=/\/|:/;var w=/[^\\]\\Z/;function k(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":11}],6:[function(e,t,r){"use strict";var i=e("./resolve"),a=e("./util"),n=e("./error_classes"),o=e("fast-json-stable-stringify"),s=e("../dotjs/validate"),c=a.ucs2length,u=e("fast-deep-equal"),p=n.Validation;function l(e,t,r){for(var i=0;i=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}.call(this,t,r,v);var P=this._compilations[F.index];if(F.compiling)return P.callValidate=function e(){var t=P.validate;var r=t.apply(this,arguments);e.errors=t.errors;return r};var z=this._formats;var C=this.RULES;try{var O=B(t,r,b,v);P.validate=O;var T=P.callValidate;return T&&(T.schema=O.schema,T.errors=null,T.refs=O.refs,T.refVal=O.refVal,T.root=O.root,T.$async=O.$async,w.sourceCode&&(T.source=O.source)),O}finally{(function(e,t,r){var i=l.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}).call(this,t,r,v)}function B(t,o,l,b){var v=!o||o&&o.schema==t;if(o.schema!=r.schema)return e.call(y,t,o,l,b);var j,E=!0===t.$async,F=s({isTop:!0,schema:t,isRoot:v,baseId:b,root:o,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:n.MissingRef,RULES:C,validate:s,util:a,resolve:i,resolveRef:I,usePattern:M,useDefault:D,useCustomRule:L,opts:w,formats:z,logger:y.logger,self:y});F=g(k,d)+g(x,f)+g(S,h)+g(A,m)+F,w.processCode&&(F=w.processCode(F));try{var P=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",F);j=P(y,C,z,r,k,S,A,u,c,p),k[0]=j}catch(e){throw y.logger.error("Error compiling schema, function code:",F),e}return j.schema=t,j.errors=null,j.refs=_,j.refVal=k,j.root=v?j:o,E&&(j.$async=!0),!0===w.sourceCode&&(j.source={code:F,patterns:x,defaults:S}),j}function I(t,a,n){a=i.url(t,a);var o,s,c=_[a];if(void 0!==c)return q(o=k[c],s="refVal["+c+"]");if(!n&&r.refs){var u=r.refs[a];if(void 0!==u)return o=r.refVal[u],s=R(a,o),q(o,s)}s=R(a);var p=i.call(y,B,r,a);if(void 0===p){var l=b&&b[a];l&&(p=i.inlineRef(l,w.inlineRefs)?l:e.call(y,l,r,b,t))}if(void 0!==p)return function(e,t){var r=_[e];k[r]=t}(a,p),q(p,s);!function(e){delete _[e]}(a)}function R(e,t){var r=k.length;return k[r]=t,_[e]=r,"refVal"+r}function q(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function M(e){var t=j[e];return void 0===t&&(t=j[e]=x.length,x[t]=e),"pattern"+t}function D(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return a.toQuotedString(e);case"object":if(null===e)return"null";var t=o(e),r=E[t];return void 0===r&&(r=E[t]=S.length,S[r]=e),"default"+r}}function L(e,t,r,i){if(!1!==y._opts.validateSchema){var a=e.definition.dependencies;if(a&&!a.every(function(e){return Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have all required keywords: "+a.join(","));var n=e.definition.validateSchema;if(n){var o=n(t);if(!o){var s="keyword schema is invalid: "+y.errorsText(n.errors);if("log"!=y._opts.validateSchema)throw new Error(s);y.logger.error(s)}}}var c,u=e.definition.compile,p=e.definition.inline,l=e.definition.macro;if(u)c=u.call(y,t,r,i);else if(l)c=l.call(y,t,r,i),!1!==w.validateSchema&&y.validateSchema(c,!0);else if(p)c=p.call(y,i,e.keyword,t,r);else if(!(c=e.definition.validate))return;if(void 0===c)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var f=A.length;return A[f]=c,{code:"customRule"+f,validate:c}}}},{"../dotjs/validate":39,"./error_classes":4,"./resolve":7,"./util":11,"fast-deep-equal":158,"fast-json-stable-stringify":159}],7:[function(e,t,r){"use strict";var i=e("uri-js"),a=e("fast-deep-equal"),n=e("./util"),o=e("./schema_obj"),s=e("json-schema-traverse");function c(e,t,r){var i=this._refs[r];if("string"==typeof i){if(!this._refs[i])return c.call(this,e,t,i);i=this._refs[i]}if((i=i||this._schemas[r])instanceof o)return h(i.schema,this._opts.inlineRefs)?i.schema:i.validate||this._compile(i);var a,n,s,p=u.call(this,t,r);return p&&(a=p.schema,t=p.root,s=p.baseId),a instanceof o?n=a.validate||e.call(this,a.schema,t,void 0,s):void 0!==a&&(n=h(a,this._opts.inlineRefs)?a:e.call(this,a,t,void 0,s)),n}function u(e,t){var r=i.parse(t),a=m(r),n=d(this._getId(e.schema));if(0===Object.keys(e.schema).length||a!==n){var s=b(a),c=this._refs[s];if("string"==typeof c)return function(e,t,r){var i=u.call(this,e,t);if(i){var a=i.schema,n=i.baseId;e=i.root;var o=this._getId(a);return o&&(n=v(n,o)),l.call(this,r,n,a,e)}}.call(this,e,c,r);if(c instanceof o)c.validate||this._compile(c),e=c;else{if(!((c=this._schemas[s])instanceof o))return;if(c.validate||this._compile(c),s==b(t))return{schema:c,root:e,baseId:n};e=c}if(!e.schema)return;n=d(this._getId(e.schema))}return l.call(this,r,n,e.schema,e)}t.exports=c,c.normalizeId=b,c.fullPath=d,c.url=v,c.ids=function(e){var t=b(this._getId(e)),r={"":t},o={"":d(t,!1)},c={},u=this;return s(e,{allKeys:!0},function(e,t,s,p,l,f,h){if(""!==t){var d=u._getId(e),m=r[p],g=o[p]+"/"+l;if(void 0!==h&&(g+="/"+("number"==typeof h?h:n.escapeFragment(h))),"string"==typeof d){d=m=b(m?i.resolve(m,d):d);var v=u._refs[d];if("string"==typeof v&&(v=u._refs[v]),v&&v.schema){if(!a(e,v.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=b(g))if("#"==d[0]){if(c[d]&&!a(e,c[d]))throw new Error('id "'+d+'" resolves to more than one schema');c[d]=e}else u._refs[d]=g}r[t]=m,o[t]=g}}),c},c.inlineRef=h,c.schema=u;var p=n.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function l(e,t,r,i){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var a=e.fragment.split("/"),o=1;o=55296&&t<=56319&&a=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(n="data"+(t-i||""),!a)return n}for(var s=n,u=a.split("/"),p=0;p",v=h?">":"<",y=void 0;if(g){var w=e.util.getData(m.$data,o,e.dataPathArr),k="exclusive"+n,_="exclType"+n,x="exclIsNumber"+n,j="' + "+(A="op"+n)+" + '";a+=" var schemaExcl"+n+" = "+w+"; ",a+=" var "+k+"; var "+_+" = typeof "+(w="schemaExcl"+n)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;y=d;(S=S||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var E=a;a=S.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" "+_+" == 'number' ? ( ("+k+" = "+i+" === undefined || "+w+" "+b+"= "+i+") ? "+l+" "+v+"= "+w+" : "+l+" "+v+" "+i+" ) : ( ("+k+" = "+w+" === true) ? "+l+" "+v+"= "+i+" : "+l+" "+v+" "+i+" ) || "+l+" !== "+l+") { var op"+n+" = "+k+" ? '"+b+"' : '"+b+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=w,f=g)}else{j=b;if((x="number"==typeof m)&&f){var A="'"+j+"'";a+=" if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" ( "+i+" === undefined || "+m+" "+b+"= "+i+" ? "+l+" "+v+"= "+m+" : "+l+" "+v+" "+i+" ) || "+l+" !== "+l+") { "}else{x&&void 0===s?(k=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,v+="="):(x&&(i=Math[h?"min":"max"](m,s)),m===(!x||i)?(k=!0,y=d,u=e.errSchemaPath+"/"+d,v+="="):(k=!1,j+="="));A="'"+j+"'";a+=" if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" "+l+" "+v+" "+i+" || "+l+" !== "+l+") { "}}y=y||t,(S=S||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+k+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be "+j+" ",a+=f?"' + "+i:i+"'"),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";E=a;return a=S.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",p&&(a+=" else { "),a}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,a+="if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" "+l+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var h=t,d=d||[];d.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxItems"==t?"more":"fewer",a+=" than ",a+=f?"' + "+i+" + '":""+s,a+=" items' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var m=a;return a=d.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s;var h="maxLength"==t?">":"<";a+="if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?a+=" "+l+".length ":a+=" ucs2length("+l+") ",a+=" "+h+" "+i+") { ";var d=t,m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be ",a+="maxLength"==t?"longer":"shorter",a+=" than ",a+=f?"' + "+i+" + '":""+s,a+=" characters' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var g=a;return a=m.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,a+="if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" Object.keys("+l+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var h=t,d=d||[];d.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxProperties"==t?"more":"fewer",a+=" than ",a+=f?"' + "+i+" + '":""+s,a+=" properties' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var m=a;return a=d.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.schema[t],n=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var p="valid"+c.level,l=c.baseId,f=!0,h=a;if(h)for(var d,m=-1,g=h.length-1;m0:e.util.schemaHasRules(d,e.RULES.all))&&(f=!1,c.schema=d,c.schemaPath=n+"["+m+"]",c.errSchemaPath=o+"/"+m,i+=" "+e.validate(c)+" ",c.baseId=l,s&&(i+=" if ("+p+") { ",u+="}"));return s&&(i+=f?" if (true) { ":" "+u.slice(0,-1)+" "),i=e.util.cleanUpCode(i)}},{}],19:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f="errs__"+a,h=e.util.copy(e),d="";h.level++;var m="valid"+h.level;if(o.every(function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)})){var g=h.baseId;i+=" var "+f+" = errors; var "+l+" = false; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var v=o;if(v)for(var y,w=-1,k=v.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(i+="var "+f+" = errors;var "+l+";",y){var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+d+" = false; for (var "+m+" = 0; "+m+" < "+p+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var k=p+"["+m+"]";h.dataPathArr[g]=m;var _=e.validate(h);h.baseId=v,e.util.varOccurences(_,b)<2?i+=" "+e.util.varReplace(_,b,k)+" ":i+=" var "+b+" = "+k+"; "+_+" ",i+=" if ("+d+") break; } ",e.compositeRule=h.compositeRule=w,i+=" if (!"+d+") {"}else i+=" if ("+p+".length == 0) {";var x=x||[];x.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var j=i;return i=x.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+j+"]); ":i+=" validate.errors = ["+j+"]; return false; ":i+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",y&&(i+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i=e.util.cleanUpCode(i)}},{}],23:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a,n=" ",o=e.level,s=e.dataLevel,c=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(s||""),h="valid"+o,d="errs__"+o,m=e.opts.$data&&c&&c.$data;m?(n+=" var schema"+o+" = "+e.util.getData(c.$data,s,e.dataPathArr)+"; ",a="schema"+o):a=c;var g,b,v,y,w,k="definition"+o,_=this.definition,x="";if(m&&_.$data){w="keywordValidate"+o;var j=_.validateSchema;n+=" var "+k+" = RULES.custom['"+t+"'].definition; var "+w+" = "+k+".validate;"}else{if(!(y=e.useCustomRule(this,c,e.schema,e)))return;a="validate.schema"+u,w=y.code,g=_.compile,b=_.inline,v=_.macro}var S=w+".errors",E="i"+o,A="ruleErr"+o,F=_.async;if(F&&!e.async)throw new Error("async keyword in sync schema");if(b||v||(n+=S+" = null;"),n+="var "+d+" = errors;var "+h+";",m&&_.$data&&(x+="}",n+=" if ("+a+" === undefined) { "+h+" = true; } else { ",j&&(x+="}",n+=" "+h+" = "+k+".validateSchema("+a+"); if ("+h+") { ")),b)_.statements?n+=" "+y.validate+" ":n+=" "+h+" = "+y.validate+"; ";else if(v){var P=e.util.copy(e);x="";P.level++;var z="valid"+P.level;P.schema=y.validate,P.schemaPath="";var C=e.compositeRule;e.compositeRule=P.compositeRule=!0;var O=e.validate(P).replace(/validate\.schema/g,w);e.compositeRule=P.compositeRule=C,n+=" "+O}else{(R=R||[]).push(n),n="",n+=" "+w+".call( ",e.opts.passContext?n+="this":n+="self",g||!1===_.schema?n+=" , "+f+" ":n+=" , "+a+" , "+f+" , validate.schema"+e.schemaPath+" ",n+=" , (dataPath || '')",'""'!=e.errorPath&&(n+=" + "+e.errorPath);var T=s?"data"+(s-1||""):"parentData",B=s?e.dataPathArr[s]:"parentDataProperty",I=n+=" , "+T+" , "+B+" , rootData ) ";n=R.pop(),!1===_.errors?(n+=" "+h+" = ",F&&(n+="await "),n+=I+"; "):n+=F?" var "+(S="customErrors"+o)+" = null; try { "+h+" = await "+I+"; } catch (e) { "+h+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } ":" "+S+" = null; "+h+" = "+I+"; "}if(_.modifying&&(n+=" if ("+T+") "+f+" = "+T+"["+B+"];"),n+=""+x,_.valid)l&&(n+=" if (true) { ");else{var R;n+=" if ( ",void 0===_.valid?(n+=" !",n+=v?""+z:""+h):n+=" "+!_.valid+" ",n+=") { ",i=this.keyword,(R=R||[]).push(n),n="",(R=R||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(i||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var q=n;n=R.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+q+"]); ":n+=" validate.errors = ["+q+"]; return false; ":n+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var M=n;n=R.pop(),b?_.errors?"full"!=_.errors&&(n+=" for (var "+E+"="+d+"; "+E+"0:e.util.schemaHasRules(v,e.RULES.all))&&(i+=" "+d+" = true; if ( "+p+e.util.getProperty(k)+" !== undefined ",b&&(i+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(k)+"') "),i+=") { ",f.schema=v,f.schemaPath=s+e.util.getProperty(k),f.errSchemaPath=c+"/"+e.util.escapeFragment(k),i+=" "+e.validate(f)+" ",f.baseId=I,i+=" } ",u&&(i+=" if ("+d+") { ",h+="}"))}return u&&(i+=" "+h+" if ("+l+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],25:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f=e.opts.$data&&o&&o.$data;f&&(i+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ");var h="i"+a,d="schema"+a;f||(i+=" var "+d+" = validate.schema"+s+";"),i+="var "+l+";",f&&(i+=" if (schema"+a+" === undefined) "+l+" = true; else if (!Array.isArray(schema"+a+")) "+l+" = false; else {"),i+=l+" = false;for (var "+h+"=0; "+h+"<"+d+".length; "+h+"++) if (equal("+p+", "+d+"["+h+"])) { "+l+" = true; break; }",f&&(i+=" } "),i+=" if (!"+l+") { ";var m=m||[];m.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+a+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var g=i;return i=m.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",u&&(i+=" else { "),i}},{}],26:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||"");if(!1===e.opts.format)return u&&(i+=" if (true) { "),i;var l,f=e.opts.$data&&o&&o.$data;f?(i+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",l="schema"+a):l=o;var h=e.opts.unknownFormats,d=Array.isArray(h);if(f){i+=" var "+(m="format"+a)+" = formats["+l+"]; var "+(g="isObject"+a)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(b="formatType"+a)+" = "+g+" && "+m+".type || 'string'; if ("+g+") { ",e.async&&(i+=" var async"+a+" = "+m+".async; "),i+=" "+m+" = "+m+".validate; } if ( ",f&&(i+=" ("+l+" !== undefined && typeof "+l+" != 'string') || "),i+=" (","ignore"!=h&&(i+=" ("+l+" && !"+m+" ",d&&(i+=" && self._opts.unknownFormats.indexOf("+l+") == -1 "),i+=") || "),i+=" ("+m+" && "+b+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?i+=" (async"+a+" ? await "+m+"("+p+") : "+m+"("+p+")) ":i+=" "+m+"("+p+") ",i+=" : "+m+".test("+p+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==h)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(i+=" if (true) { "),i;if(d&&h.indexOf(o)>=0)return u&&(i+=" if (true) { "),i;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var g,b=(g="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(g){var v=!0===m.async;m=m.validate}if(b!=r)return u&&(i+=" if (true) { "),i;if(v){if(!e.async)throw new Error("async format in sync schema");i+=" if (!(await "+(y="formats"+e.util.getProperty(o)+".validate")+"("+p+"))) { "}else{i+=" if (! ";var y="formats"+e.util.getProperty(o);g&&(y+=".validate"),i+="function"==typeof m?" "+y+"("+p+") ":" "+y+".test("+p+") ",i+=") { "}}var w=w||[];w.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",i+=f?""+l:""+e.util.toQuotedString(o),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match format \"",i+=f?"' + "+l+" + '":""+e.util.escapeQuotes(o),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+s:""+e.util.toQuotedString(o),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var k=i;return i=w.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+k+"]); ":i+=" validate.errors = ["+k+"]; return false; ":i+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u&&(i+=" else { "),i}},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f="errs__"+a,h=e.util.copy(e);h.level++;var d="valid"+h.level,m=e.schema.then,g=e.schema.else,b=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),v=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0:e.util.schemaHasRules(g,e.RULES.all)),y=h.baseId;if(b||v){var w;h.createErrors=!1,h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+f+" = errors; var "+l+" = true; ";var k=e.compositeRule;e.compositeRule=h.compositeRule=!0,i+=" "+e.validate(h)+" ",h.baseId=y,h.createErrors=!0,i+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=k,b?(i+=" if ("+d+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(h)+" ",h.baseId=y,i+=" "+l+" = "+d+"; ",b&&v?i+=" var "+(w="ifClause"+a)+" = 'then'; ":w="'then'",i+=" } ",v&&(i+=" else { ")):i+=" if (!"+d+") { ",v&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(h)+" ",h.baseId=y,i+=" "+l+" = "+d+"; ",b&&v?i+=" var "+(w="ifClause"+a)+" = 'else'; ":w="'else'",i+=" } "),i+=" if (!"+l+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",u&&(i+=" else { "),i=e.util.cleanUpCode(i)}else u&&(i+=" if (true) { ");return i}},{}],28:[function(e,t,r){"use strict";t.exports={$ref:e("./ref"),allOf:e("./allOf"),anyOf:e("./anyOf"),$comment:e("./comment"),const:e("./const"),contains:e("./contains"),dependencies:e("./dependencies"),enum:e("./enum"),format:e("./format"),if:e("./if"),items:e("./items"),maximum:e("./_limit"),minimum:e("./_limit"),maxItems:e("./_limitItems"),minItems:e("./_limitItems"),maxLength:e("./_limitLength"),minLength:e("./_limitLength"),maxProperties:e("./_limitProperties"),minProperties:e("./_limitProperties"),multipleOf:e("./multipleOf"),not:e("./not"),oneOf:e("./oneOf"),pattern:e("./pattern"),properties:e("./properties"),propertyNames:e("./propertyNames"),required:e("./required"),uniqueItems:e("./uniqueItems"),validate:e("./validate")}},{"./_limit":14,"./_limitItems":15,"./_limitLength":16,"./_limitProperties":17,"./allOf":18,"./anyOf":19,"./comment":20,"./const":21,"./contains":22,"./dependencies":24,"./enum":25,"./format":26,"./if":27,"./items":29,"./multipleOf":30,"./not":31,"./oneOf":32,"./pattern":33,"./properties":34,"./propertyNames":35,"./ref":36,"./required":37,"./uniqueItems":38,"./validate":39}],29:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f="errs__"+a,h=e.util.copy(e),d="";h.level++;var m="valid"+h.level,g="i"+a,b=h.dataLevel=e.dataLevel+1,v="data"+b,y=e.baseId;if(i+="var "+f+" = errors;var "+l+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){i+=" "+l+" = "+p+".length <= "+o.length+"; ";var k=c;c=e.errSchemaPath+"/additionalItems",i+=" if (!"+l+") { ";var _=_||[];_.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var x=i;i=_.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+x+"]); ":i+=" validate.errors = ["+x+"]; return false; ":i+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c=k,u&&(d+="}",i+=" else { ")}var j=o;if(j)for(var S,E=-1,A=j.length-1;E0:e.util.schemaHasRules(S,e.RULES.all)){i+=" "+m+" = true; if ("+p+".length > "+E+") { ";var F=p+"["+E+"]";h.schema=S,h.schemaPath=s+"["+E+"]",h.errSchemaPath=c+"/"+E,h.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),h.dataPathArr[b]=E;var P=e.validate(h);h.baseId=y,e.util.varOccurences(P,v)<2?i+=" "+e.util.varReplace(P,v,F)+" ":i+=" var "+v+" = "+F+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){h.schema=w,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+p+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+p+".length; "+g+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);F=p+"["+g+"]";h.dataPathArr[b]=g;P=e.validate(h);h.baseId=y,e.util.varOccurences(P,v)<2?i+=" "+e.util.varReplace(P,v,F)+" ":i+=" var "+v+" = "+F+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+p+".length; "+g+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);F=p+"["+g+"]";h.dataPathArr[b]=g;P=e.validate(h);h.baseId=y,e.util.varOccurences(P,v)<2?i+=" "+e.util.varReplace(P,v,F)+" ":i+=" var "+v+" = "+F+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+f+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,a+="var division"+n+";if (",f&&(a+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),a+=" (division"+n+" = "+l+" / "+i+", ",e.opts.multipleOfPrecision?a+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":a+=" division"+n+" !== parseInt(division"+n+") ",a+=" ) ",f&&(a+=" ) "),a+=" ) { ";var h=h||[];h.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be multiple of ",a+=f?"' + "+i:i+"'"),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var d=a;return a=h.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+d+"]); ":a+=" validate.errors = ["+d+"]; return false; ":a+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="errs__"+a,f=e.util.copy(e);f.level++;var h="valid"+f.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=s,f.errSchemaPath=c,i+=" var "+l+" = errors; ";var d,m=e.compositeRule;e.compositeRule=f.compositeRule=!0,f.createErrors=!1,f.opts.allErrors&&(d=f.opts.allErrors,f.opts.allErrors=!1),i+=" "+e.validate(f)+" ",f.createErrors=!0,d&&(f.opts.allErrors=d),e.compositeRule=f.compositeRule=m,i+=" if ("+h+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var b=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f="errs__"+a,h=e.util.copy(e),d="";h.level++;var m="valid"+h.level,g=h.baseId,b="prevValid"+a,v="passingSchemas"+a;i+="var "+f+" = errors , "+b+" = false , "+l+" = false , "+v+" = null; ";var y=e.compositeRule;e.compositeRule=h.compositeRule=!0;var w=o;if(w)for(var k,_=-1,x=w.length-1;_0:e.util.schemaHasRules(k,e.RULES.all))?(h.schema=k,h.schemaPath=s+"["+_+"]",h.errSchemaPath=c+"/"+_,i+=" "+e.validate(h)+" ",h.baseId=g):i+=" var "+m+" = true; ",_&&(i+=" if ("+m+" && "+b+") { "+l+" = false; "+v+" = ["+v+", "+_+"]; } else { ",d+="}"),i+=" if ("+m+") { "+l+" = "+b+" = true; "+v+" = "+_+"; }";return e.compositeRule=h.compositeRule=y,i+=d+"if (!"+l+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+v+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}},{}],33:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,a+="if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),a+=" !"+(f?"(new RegExp("+i+"))":e.usePattern(s))+".test("+l+") ) { ";var h=h||[];h.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",a+=f?""+i:""+e.util.toQuotedString(s),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match pattern \"",a+=f?"' + "+i+" + '":""+e.util.escapeQuotes(s),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+e.util.toQuotedString(s),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var d=a;return a=h.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+d+"]); ":a+=" validate.errors = ["+d+"]; return false; ":a+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],34:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="errs__"+a,f=e.util.copy(e),h="";f.level++;var d="valid"+f.level,m="key"+a,g="idx"+a,b=f.dataLevel=e.dataLevel+1,v="data"+b,y="dataProperties"+a,w=Object.keys(o||{}),k=e.schema.patternProperties||{},_=Object.keys(k),x=e.schema.additionalProperties,j=w.length||_.length,S=!1===x,E="object"==typeof x&&Object.keys(x).length,A=e.opts.removeAdditional,F=S||E||A,P=e.opts.ownProperties,z=e.baseId,C=e.schema.required;if(C&&(!e.opts.$data||!C.$data)&&C.length8)i+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var T=w;if(T)for(var B=-1,I=T.length-1;B0:e.util.schemaHasRules(X,e.RULES.all)){var Y=e.util.getProperty(W),J=(K=p+Y,V&&void 0!==X.default);f.schema=X,f.schemaPath=s+Y,f.errSchemaPath=c+"/"+e.util.escapeFragment(W),f.errorPath=e.util.getPath(e.errorPath,W,e.opts.jsonPointers),f.dataPathArr[b]=e.util.toQuotedString(W);$=e.validate(f);if(f.baseId=z,e.util.varOccurences($,v)<2){$=e.util.varReplace($,v,K);var ee=K}else{ee=v;i+=" var "+v+" = "+K+"; "}if(J)i+=" "+$+" ";else{if(O&&O[W]){i+=" if ( "+ee+" === undefined ",P&&(i+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+d+" = false; ";D=e.errorPath,N=c;var te,re=e.util.escapeQuotes(W);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(D,W,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(te=te||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+re+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";U=i;i=te.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+U+"]); ":i+=" validate.errors = ["+U+"]; return false; ":i+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=N,e.errorPath=D,i+=" } else { "}else u?(i+=" if ( "+ee+" === undefined ",P&&(i+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+d+" = true; } else { "):(i+=" if ("+ee+" !== undefined ",P&&(i+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=" ) { ");i+=" "+$+" } "}}u&&(i+=" if ("+d+") { ",h+="}")}}if(_.length){var ie=_;if(ie)for(var ae,ne=-1,oe=ie.length-1;ne0:e.util.schemaHasRules(X,e.RULES.all)){f.schema=X,f.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),f.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),i+=P?" "+y+" = "+y+" || Object.keys("+p+"); for (var "+g+"=0; "+g+"<"+y+".length; "+g+"++) { var "+m+" = "+y+"["+g+"]; ":" for (var "+m+" in "+p+") { ",i+=" if ("+e.usePattern(ae)+".test("+m+")) { ",f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);K=p+"["+m+"]";f.dataPathArr[b]=m;$=e.validate(f);f.baseId=z,e.util.varOccurences($,v)<2?i+=" "+e.util.varReplace($,v,K)+" ":i+=" var "+v+" = "+K+"; "+$+" ",u&&(i+=" if (!"+d+") break; "),i+=" } ",u&&(i+=" else "+d+" = true; "),i+=" } ",u&&(i+=" if ("+d+") { ",h+="}")}}}return u&&(i+=" "+h+" if ("+l+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],35:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="errs__"+a,f=e.util.copy(e);f.level++;var h="valid"+f.level;if(i+="var "+l+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=s,f.errSchemaPath=c;var d="key"+a,m="idx"+a,g="i"+a,b="' + "+d+" + '",v="data"+(f.dataLevel=e.dataLevel+1),y="dataProperties"+a,w=e.opts.ownProperties,k=e.baseId;w&&(i+=" var "+y+" = undefined; "),i+=w?" "+y+" = "+y+" || Object.keys("+p+"); for (var "+m+"=0; "+m+"<"+y+".length; "+m+"++) { var "+d+" = "+y+"["+m+"]; ":" for (var "+d+" in "+p+") { ",i+=" var startErrs"+a+" = errors; ";var _=d,x=e.compositeRule;e.compositeRule=f.compositeRule=!0;var j=e.validate(f);f.baseId=k,e.util.varOccurences(j,v)<2?i+=" "+e.util.varReplace(j,v,_)+" ":i+=" var "+v+" = "+_+"; "+j+" ",e.compositeRule=f.compositeRule=x,i+=" if (!"+h+") { for (var "+g+"=startErrs"+a+"; "+g+"0:e.util.schemaHasRules(y,e.RULES.all))||(d[d.length]=g)}}else d=o;if(f||d.length){var w=e.errorPath,k=f||d.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(i+=" var missing"+a+"; ",k){f||(i+=" var "+h+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+a+"["+(E="i"+a)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,P,e.opts.jsonPointers)),i+=" var "+l+" = true; ",f&&(i+=" if (schema"+a+" === undefined) "+l+" = true; else if (!Array.isArray(schema"+a+")) "+l+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+h+".length; "+E+"++) { "+l+" = "+p+"["+h+"["+E+"]] !== undefined ",_&&(i+=" && Object.prototype.hasOwnProperty.call("+p+", "+h+"["+E+"]) "),i+="; if (!"+l+") break; } ",f&&(i+=" } "),i+=" if (!"+l+") { ",(F=F||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var j=i;i=F.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+j+"]); ":i+=" validate.errors = ["+j+"]; return false; ":i+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var S=d;if(S)for(var E=-1,A=S.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(d.indexOf("object")>=0||d.indexOf("array")>=0))a+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+l+"[i], "+l+"[j])) { "+f+" = false; break outer; } } } ";else{a+=" var itemIndices = {}, item; for (;i--;) { var item = "+l+"[i]; ";var g="checkDataType"+(m?"s":"");a+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(a+=" if (typeof item == 'string') item = '\"' + item; "),a+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}a+=" } ",h&&(a+=" } "),a+=" if (!"+f+") { ";var b=b||[];b.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var v=a;a=b.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",p&&(a+=" else { ")}else p&&(a+=" if (true) { ");return a}},{}],39:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i="",a=!0===e.schema.$async,n=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var s=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(s){var c="unknown keyword: "+s;if("log"!==e.opts.strictKeywords)throw new Error(c);e.logger.warn(c)}}if(e.isTop&&(i+=" var validate = ",a&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof e.schema||!n&&!e.schema.$ref){var u=e.level,p=e.dataLevel,l=e.schema["false schema"],f=e.schemaPath+e.util.getProperty("false schema"),h=e.errSchemaPath+"/false schema",d=!e.opts.allErrors,m="data"+(p||""),g="valid"+u;if(!1===e.schema){e.isTop?d=!0:i+=" var "+g+" = false; ",(X=X||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),i+=" } "):i+=" {} ";var b=i;i=X.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?i+=a?" return data; ":" validate.errors = null; return true; ":i+=" var "+g+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var v=e.isTop;u=e.level=0,p=e.dataLevel=0,m="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(y);e.logger.warn(y)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{u=e.level,m="data"+((p=e.dataLevel)||"");if(o&&(e.baseId=e.resolve.url(e.baseId,o)),a&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+u+" = errors;"}g="valid"+u,d=!e.opts.allErrors;var w="",k="",_=e.schema.type,x=Array.isArray(_);if(_&&e.opts.nullable&&!0===e.schema.nullable&&(x?-1==_.indexOf("null")&&(_=_.concat("null")):"null"!=_&&(_=[_,"null"],x=!0)),x&&1==_.length&&(_=_[0],x=!1),e.schema.$ref&&n){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(n=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),_){if(e.opts.coerceTypes)var j=e.util.coerceToTypes(e.opts.coerceTypes,_);var S=e.RULES.types[_];if(j||x||!0===S||S&&!Y(S)){f=e.schemaPath+".type",h=e.errSchemaPath+"/type",f=e.schemaPath+".type",h=e.errSchemaPath+"/type";var E=x?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[E](_,m,!0)+") { ",j){var A="dataType"+u,F="coerced"+u;i+=" var "+A+" = typeof "+m+"; ","array"==e.opts.coerceTypes&&(i+=" if ("+A+" == 'object' && Array.isArray("+m+")) "+A+" = 'array'; "),i+=" var "+F+" = undefined; ";var P="",z=j;if(z)for(var C,O=-1,T=z.length-1;O>6],a=0==(32&r);if(31==(31&r)){var n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:i,primitive:a,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var a=127&i;if(a>4)return e.error("length octect is too long");i=0;for(var n=0;n=31)return i.error("Multi-octet tag encoding unsupported");t||(a|=32);return a|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(i.length<128)return(n=new a(2))[0]=o,n[1]=i.length,this._createEncoderBuffer([n,i]);for(var c=1,u=i.length;u>=256;u>>=8)c++;(n=new a(2+c))[0]=o,n[1]=128|c;u=1+c;for(var p=i.length;p>0;u--,p>>=8)n[u]=255&p;return this._createEncoderBuffer([n,i])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new a(2*e.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var n=0;for(i=0;i=128;o>>=7)n++}var s=new a(n),c=s.length-1;for(i=e.length-1;i>=0;i--){o=e[i];for(s[c--]=127&o;(o>>=7)>0;)s[c--]=128|127&o}return this._createEncoderBuffer(s)},u.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[p(i.getFullYear()),p(i.getUTCMonth()+1),p(i.getUTCDate()),p(i.getUTCHours()),p(i.getUTCMinutes()),p(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[p(i.getFullYear()%100),p(i.getUTCMonth()+1),p(i.getUTCDate()),p(i.getUTCHours()),p(i.getUTCMinutes()),p(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!a.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new a(r)}if(a.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new a(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;o>=256;o>>=8)i++;for(o=(n=new Array(i)).length-1;o>=0;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new a(n))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){var i,a=this._baseState;if(null===a.default)return!1;var n=e.join();if(void 0===a.defaultBuffer&&(a.defaultBuffer=this._encodeValue(a.default,t,r).join()),n.length!==a.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw o("Indefinite length not supported");if(t>4)throw o("encoding too long");if(this._size-ethis._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var s=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?s:s.toString("utf8")},s.prototype.readOID=function(e){e||(e=n.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,a=0;a>0),r.join(".")},s.prototype._readTag=function(e){i.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw o("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(this.length>4)throw o("Integer too long: "+this.length);if(this.length>this._size-r)return null;this._offset=r;for(var a=this._buf[this._offset],n=0,s=0;s>0},t.exports=s},{"./errors":58,"./types":61,assert:65,"safer-buffer":315}],61:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],62:[function(e,t,r){var i=e("assert"),a=e("safer-buffer").Buffer,n=e("./types"),o=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var t,r;t=s,r=e||{},i.ok(t),i.equal(typeof t,"object"),i.ok(r),i.equal(typeof r,"object"),Object.getOwnPropertyNames(t).forEach(function(e){if(!r[e]){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i)}}),e=r,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw o(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=n.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&r>1;)r--,e<<=8;if(r>4)throw o("BER ints cannot be > 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;r-- >0;)this._buf[this._offset++]=(4278190080&e)>>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(n.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=n.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=n.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+typeof e+")");"number"!=typeof t&&(t=n.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=n.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.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))}(i,parseInt(e,10))});var a=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){a.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw o("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=n.Sequence|n.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw o("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){i.ok(void 0!==e),i.ok(void 0!==t),i.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(i.ok(e),this._size-this._offset=0;u--)if(p[u]!==l[u])return!1;for(u=p.length-1;u>=0;u--)if(s=p[u],!y(e[s],t[s],r,i))return!1;return!0}(e,t,r,i))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function k(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,i){var a;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(i=r,r=null),a=function(e){var t;try{e()}catch(e){t=e}return t}(t),i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),e&&!a&&b(a,r,"Missing expected exception"+i);var n="string"==typeof i,s=!e&&a&&!r;if((!e&&o.isError(a)&&n&&k(a,r)||s)&&b(a,r,"Got unwanted exception"+i),e&&a&&r&&!k(a,r)||!e&&a)throw a}f.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=m(g((t=this).actual),128)+" "+t.operator+" "+m(g(t.expected),128),this.generatedMessage=!0);var r=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var i=new Error;if(i.stack){var a=i.stack,n=d(r),o=a.indexOf("\n"+n);if(o>=0){var s=a.indexOf("\n",o+1);a=a.substring(s+1)}this.stack=a}}},o.inherits(f.AssertionError,Error),f.fail=b,f.ok=v,f.equal=function(e,t,r){e!=t&&b(e,t,r,"==",f.equal)},f.notEqual=function(e,t,r){e==t&&b(e,t,r,"!=",f.notEqual)},f.deepEqual=function(e,t,r){y(e,t,!1)||b(e,t,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,r){y(e,t,!0)||b(e,t,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,r){y(e,t,!1)&&b(e,t,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,r,i){y(t,r,!0)&&b(t,r,i,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,r){e!==t&&b(e,t,r,"===",f.strictEqual)},f.notStrictEqual=function(e,t,r){e===t&&b(e,t,r,"!==",f.notStrictEqual)},f.throws=function(e,t,r){_(!0,e,t,r)},f.doesNotThrow=function(e,t,r){_(!1,e,t,r)},f.ifError=function(e){if(e)throw e},f.strict=i(function e(t,r){t||b(t,!0,r,"==",e)},f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var x=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":237,"util/":68}],66:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],67:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],68:[function(e,t,r){(function(t,i){var a=/%[sdj%]/g;r.format=function(e){if(!b(e)){for(var t=[],r=0;r=n)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}}),c=i[r];r=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),d(t)?i.showHidden=t:t&&r._extend(i,t),v(i.showHidden)&&(i.showHidden=!1),v(i.depth)&&(i.depth=2),v(i.colors)&&(i.colors=!1),v(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=c),p(i,e,i.depth)}function c(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function p(e,t,i){if(e.customInspect&&t&&x(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var a=t.inspect(i,e);return b(a)||(a=p(e,a,i)),a}var n=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,t);if(n)return n;var o=Object.keys(t),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),_(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(t);if(0===o.length){if(x(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(y(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var u,w="",j=!1,S=["{","}"];(h(t)&&(j=!0,S=["[","]"]),x(t))&&(w=" [Function"+(t.name?": "+t.name:"")+"]");return y(t)&&(w=" "+RegExp.prototype.toString.call(t)),k(t)&&(w=" "+Date.prototype.toUTCString.call(t)),_(t)&&(w=" "+l(t)),0!==o.length||j&&0!=t.length?i<0?y(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=j?function(e,t,r,i,a){for(var n=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,i,a,n){var o,s,c;if((c=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),A(i,a)||(o="["+a+"]"),s||(e.seen.indexOf(c.value)<0?(s=m(r)?p(e,c.value,null):p(e,c.value,r-1)).indexOf("\n")>-1&&(s=n?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(n&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function v(e){return void 0===e}function y(e){return w(e)&&"[object RegExp]"===j(e)}function w(e){return"object"==typeof e&&null!==e}function k(e){return w(e)&&"[object Date]"===j(e)}function _(e){return w(e)&&("[object Error]"===j(e)||e instanceof Error)}function x(e){return"function"==typeof e}function j(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(v(n)&&(n=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(n)){var i=t.pid;o[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,i,t)}}else o[e]=function(){};return o[e]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=h,r.isBoolean=d,r.isNull=m,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=b,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=v,r.isRegExp=y,r.isObject=w,r.isDate=k,r.isError=_,r.isFunction=x,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":"),[e.getDate(),E[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":67,_process:263,inherits:66}],69:[function(e,t,r){var i=e("crypto"),a=e("url").parse,n=["acl","location","logging","notification","partNumber","policy","requestPayment","torrent","uploadId","uploads","versionId","versioning","versions","website"];function o(e){return"AWS "+e.key+":"+c(e)}function s(e){return i.createHmac("sha1",e.secret).update(e.message).digest("base64")}function c(e){return e.message=u(e),s(e)}function u(e){var t=e.amazonHeaders||"";return t&&(t+="\n"),[e.verb,e.md5,e.contentType,e.date?e.date.toUTCString():"",t+e.resource].join("\n")}function p(e){return"GET\n\n\n"+e.date+"\n"+e.resource}t.exports=o,t.exports.authorization=o,t.exports.hmacSha1=s,t.exports.sign=c,t.exports.signQuery=function(e){return e.message=p(e),s(e)},t.exports.stringToSign=u,t.exports.queryStringToSign=p,t.exports.canonicalizeHeaders=function(e){for(var t=[],r=Object.keys(e),i=0,a=r.length;i=0&&"us-east-1"===this.region||["cloudfront","ls","route53","iam","importexport","sts"].indexOf(this.service)>=0},f.prototype.createHost=function(){var e=this.isSingleRegion()?"":("s3"===this.service&&"us-east-1"!==this.region?"-":".")+this.region;return("ses"===this.service?"email":this.service)+e+".amazonaws.com"},f.prototype.prepareRequest=function(){this.parsePath();var e,t=this.request,r=t.headers;t.signQuery?(this.parsedPath.query=e=this.parsedPath.query||{},this.credentials.sessionToken&&(e["X-Amz-Security-Token"]=this.credentials.sessionToken),"s3"!==this.service||e["X-Amz-Expires"]||(e["X-Amz-Expires"]=86400),e["X-Amz-Date"]?this.datetime=e["X-Amz-Date"]:e["X-Amz-Date"]=this.getDateTime(),e["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",e["X-Amz-Credential"]=this.credentials.accessKeyId+"/"+this.credentialString(),e["X-Amz-SignedHeaders"]=this.signedHeaders()):(t.doNotModifyHeaders||this.isCodeCommitGit||(!t.body||r["Content-Type"]||r["content-type"]||(r["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8"),!t.body||r["Content-Length"]||r["content-length"]||(r["Content-Length"]=i.byteLength(t.body)),!this.credentials.sessionToken||r["X-Amz-Security-Token"]||r["x-amz-security-token"]||(r["X-Amz-Security-Token"]=this.credentials.sessionToken),"s3"!==this.service||r["X-Amz-Content-Sha256"]||r["x-amz-content-sha256"]||(r["X-Amz-Content-Sha256"]=p(this.request.body||"","hex")),r["X-Amz-Date"]||r["x-amz-date"]?this.datetime=r["X-Amz-Date"]||r["x-amz-date"]:r["X-Amz-Date"]=this.getDateTime()),delete r.Authorization,delete r.authorization)},f.prototype.sign=function(){return this.parsedPath||this.prepareRequest(),this.request.signQuery?this.parsedPath.query["X-Amz-Signature"]=this.signature():this.request.headers.Authorization=this.authHeader(),this.request.path=this.formatPath(),this.request},f.prototype.getDateTime=function(){if(!this.datetime){var e=this.request.headers,t=new Date(e.Date||e.date||new Date);this.datetime=t.toISOString().replace(/[:\-]|\.\d{3}/g,""),this.isCodeCommitGit&&(this.datetime=this.datetime.slice(0,-1))}return this.datetime},f.prototype.getDate=function(){return this.getDateTime().substr(0,8)},f.prototype.authHeader=function(){return["AWS4-HMAC-SHA256 Credential="+this.credentials.accessKeyId+"/"+this.credentialString(),"SignedHeaders="+this.signedHeaders(),"Signature="+this.signature()].join(", ")},f.prototype.signature=function(){var e,t,r,i=this.getDate(),a=[this.credentials.secretAccessKey,i,this.region,this.service].join(),n=c.get(a);return n||(e=u("AWS4"+this.credentials.secretAccessKey,i),t=u(e,this.region),r=u(t,this.service),n=u(r,"aws4_request"),c.set(a,n)),u(n,this.stringToSign(),"hex")},f.prototype.stringToSign=function(){return["AWS4-HMAC-SHA256",this.getDateTime(),this.credentialString(),p(this.canonicalString(),"hex")].join("\n")},f.prototype.canonicalString=function(){this.parsedPath||this.prepareRequest();var e,t=this.parsedPath.path,r=this.parsedPath.query,i=this.request.headers,a="",n="s3"!==this.service,s="s3"===this.service||this.request.doNotEncodePath,c="s3"===this.service,u="s3"===this.service;return e="s3"===this.service&&this.request.signQuery?"UNSIGNED-PAYLOAD":this.isCodeCommitGit?"":i["X-Amz-Content-Sha256"]||i["x-amz-content-sha256"]||p(this.request.body||"","hex"),r&&(a=l(o.stringify(Object.keys(r).sort().reduce(function(e,t){return t?(e[t]=Array.isArray(r[t])?u?r[t][0]:r[t].slice().sort():r[t],e):e},{})))),"/"!==t&&(n&&(t=t.replace(/\/{2,}/g,"/")),"/"!==(t=t.split("/").reduce(function(e,t){return n&&".."===t?e.pop():n&&"."===t||(s&&(t=decodeURIComponent(t)),e.push(l(encodeURIComponent(t)))),e},[]).join("/"))[0]&&(t="/"+t),c&&(t=t.replace(/%2F/g,"/"))),[this.request.method||"GET",t,a,this.canonicalHeaders()+"\n",this.signedHeaders(),e].join("\n")},f.prototype.canonicalHeaders=function(){var e=this.request.headers;return Object.keys(e).sort(function(e,t){return e.toLowerCase()=0&&(r=o.parse(e.slice(t+1)),e=e.slice(0,t)),/[^0-9A-Za-z!'()*\-._~%\/]/.test(e)&&(e=e.split("/").map(function(e){return encodeURIComponent(decodeURIComponent(e))}).join("/")),this.parsedPath={path:e,query:r}},f.prototype.formatPath=function(){var e=this.parsedPath.path,t=this.parsedPath.query;return t?(null!=t[""]&&delete t[""],e+"?"+l(o.stringify(t))):e},a.RequestSigner=f,a.sign=function(e,t){return new f(e,t).sign()}}).call(this,e("_process"),e("buffer").Buffer)},{"./lru":71,_process:263,buffer:110,crypto:121,querystring:279,url:383}],71:[function(e,t,r){function i(e){this.capacity=0|e,this.map=Object.create(null),this.list=new a}function a(){this.firstNode=null,this.lastNode=null}function n(e,t){this.key=e,this.val=t,this.prev=null,this.next=null}t.exports=function(e){return new i(e)},i.prototype.get=function(e){var t=this.map[e];if(null!=t)return this.used(t),t.val},i.prototype.set=function(e,t){var r=this.map[e];if(null!=r)r.val=t;else{if(this.capacity||this.prune(),!this.capacity)return!1;r=new n(e,t),this.map[e]=r,this.capacity--}return this.used(r),!0},i.prototype.used=function(e){this.list.moveToFront(e)},i.prototype.prune=function(){var e=this.list.pop();null!=e&&(delete this.map[e.key],this.capacity++)},a.prototype.moveToFront=function(e){this.firstNode!=e&&(this.remove(e),null==this.firstNode?(this.firstNode=e,this.lastNode=e,e.prev=null,e.next=null):(e.prev=null,e.next=this.firstNode,e.next.prev=e,this.firstNode=e))},a.prototype.pop=function(){var e=this.lastNode;return null!=e&&this.remove(e),e},a.prototype.remove=function(e){this.firstNode==e?this.firstNode=e.next:null!=e.prev&&(e.prev.next=e.next),this.lastNode==e?this.lastNode=e.prev:null!=e.next&&(e.next.prev=e.prev)}},{}],72:[function(e,t,r){"use strict";r.byteLength=function(e){var t=u(e),r=t[0],i=t[1];return 3*(r+i)/4-i},r.toByteArray=function(e){var t,r,i=u(e),o=i[0],s=i[1],c=new n(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),p=0,l=s>0?o-4:o;for(r=0;r>16&255,c[p++]=t>>8&255,c[p++]=255&t;2===s&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,c[p++]=255&t);1===s&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,c[p++]=t>>8&255,c[p++]=255&t);return c},r.fromByteArray=function(e){for(var t,r=e.length,a=r%3,n=[],o=0,s=r-a;os?s:o+16383));1===a?(t=e[r-1],n.push(i[t>>2]+i[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],n.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return n.join("")};for(var i=[],a=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function p(e,t,r){for(var a,n,o=[],s=t;s>18&63]+i[n>>12&63]+i[n>>6&63]+i[63&n]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],73:[function(e,t,r){"use strict";var i=e("tweetnacl").lowlevel.crypto_hash,a=0,n=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function o(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function s(e,t){var r,i=0;for(r=0;r<4;r++,a++)a>=t&&(a=0),i=i<<8|e[a];return i}n.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=o(this.S,t,0)^this.P[r],e[0]^=o(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},n.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;r>0;r-=2)e[1]^=o(this.S,t,0)^this.P[r],e[0]^=o(this.S,t,4)^this.P[r-1];var i=e[0];e[0]=e[1]^this.P[0],e[1]=i},n.prototype.expand0state=function(e,t){var r,i,n=new Uint32Array(2),o=new Uint8Array(n.buffer);for(r=0,a=0;r<18;r++)this.P[r]^=s(e,t);for(a=0,r=0;r<18;r+=2)this.encipher(n,o),this.P[r]=n[0],this.P[r+1]=n[1];for(r=0;r<4;r++)for(i=0;i<256;i+=2)this.encipher(n,o),this.S[r][i]=n[0],this.S[r][i+1]=n[1]},n.prototype.expandstate=function(e,t,r,i){var n,o,c=new Uint32Array(2);for(n=0,a=0;n<18;n++)this.P[n]^=s(r,i);for(n=0,a=0;n<18;n+=2)c[0]^=s(e,t),c[1]^=s(e,t),this.encipher(c),this.P[n]=c[0],this.P[n+1]=c[1];for(n=0;n<4;n++)for(o=0;o<256;o+=2)c[0]^=s(e,t),c[1]^=s(e,t),this.encipher(c),this.S[n][o]=c[0],this.S[n][o+1]=c[1];a=0},n.prototype.enc=function(e,t){for(var r=0;r>>24,r[4*i+2]=o[i]>>>16,r[4*i+1]=o[i]>>>8,r[4*i+0]=o[i]}t.exports={BLOCKS:c,HASHSIZE:u,hash:p,pbkdf:function(e,t,r,a,n,o,s){var c,l,f,h,d,m,g=new Uint8Array(64),b=new Uint8Array(64),v=new Uint8Array(u),y=new Uint8Array(u),w=new Uint8Array(a+4),k=o;if(s<1)return-1;if(0===t||0===a||0===o||o>v.byteLength*v.byteLength||a>1<<20)return-1;for(h=Math.floor((o+v.byteLength-1)/v.byteLength),f=Math.floor((o+h-1)/h),c=0;c0;m++){for(w[a+0]=m>>>24,w[a+1]=m>>>16,w[a+2]=m>>>8,w[a+3]=m,i(b,w,a+4),p(g,b,y),c=v.byteLength;c--;)v[c]=y[c];for(c=1;c=k);c++)n[d]=v[c];o-=c}return 0}}},{tweetnacl:381}],74:[function(e,t,r){(function(e,i,a){!function(e){if("object"==typeof r&&void 0!==t)t.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a;"undefined"!=typeof window?a=window:void 0!==i?a=i:"undefined"!=typeof self&&(a=self),a.Promise=e()}}(function(){var t,r,n;return function e(t,r,i){function a(o,s){if(!r[o]){if(!t[o]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(o,!0);if(n)return n(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[o]={exports:{}};t[o][0].call(p.exports,function(e){var r=t[o][1][e];return a(r||e)},p,p.exports,e,t,r,i)}return r[o].exports}for(var n="function"==typeof _dereq_&&_dereq_,o=0;o0;)u(e)}function u(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var r=e.shift(),i=e.shift();t.call(r,i)}}s.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},s.prototype.hasCustomScheduler=function(){return this._customScheduler},s.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},s.prototype.fatalError=function(t,r){r?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t)},s.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.prototype.invokeLater=function(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()},s.prototype.invoke=function(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()},s.prototype.settlePromises=function(e){this._normalQueue._pushOne(e),this._queueTick()},s.prototype._drainQueues=function(){c(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,c(this._lateQueue)},s.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},s.prototype._reset=function(){this._isTickUsed=!1},r.exports=s,r.exports.firstLineError=a},{"./queue":26,"./schedule":29}],3:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){var a=!1,n=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(n,n,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(n){a||(a=!0,e.prototype._propagateFrom=i.propagateFromFunction(),e.prototype._boundValue=i.boundValueFunction());var u=r(n),p=new e(t);p._propagateFrom(this,1);var l=this._target();if(p._setBoundTo(u),u instanceof e){var f={promiseRejectionQueued:!1,promise:p,target:l,bindingPromise:u};l._then(t,o,void 0,p,f),u._then(s,c,void 0,p,f),p._setOnCancel(u)}else p._resolveCallback(l);return p},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}},{}],4:[function(e,t,r){"use strict";var i;"undefined"!=typeof Promise&&(i=Promise);var a=e("./promise")();a.noConflict=function(){try{Promise===a&&(Promise=i)}catch(e){}return a},t.exports=a},{"./promise":22}],5:[function(e,t,r){"use strict";var i=Object.create;if(i){var a=i(null),n=i(null);a[" size"]=n[" size"]=0}t.exports=function(t){var r,i=e("./util"),a=i.canEvaluate;i.isIdentifier;function n(e,r){var a;if(null!=e&&(a=e[r]),"function"!=typeof a){var n="Object "+i.classString(e)+" has no method '"+i.toString(r)+"'";throw new t.TypeError(n)}return a}function o(e){return n(e,this.pop()).apply(e,this)}function s(e){return e[this]}function c(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(o,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if("number"==typeof e)t=c;else if(a){var i=r(e);t=null!==i?i:s}else t=s;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,r){"use strict";t.exports=function(t,r,i,a){var n=e("./util"),o=n.tryCatch,s=n.errorObj,c=t._async;t.prototype.break=t.prototype.cancel=function(){if(!a.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(n.isArray(e))for(var r=0;r=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},i.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},i.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},i.CapturedTrace=null,i.create=function(){if(t)return new i},i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var r=e.prototype._pushContext,n=e.prototype._popContext,o=e._peekContext,s=e.prototype._peekContext,c=e.prototype._promiseCreated;i.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=n,e._peekContext=o,e.prototype._peekContext=s,e.prototype._promiseCreated=c,t=!1},t=!0,e.prototype._pushContext=i.prototype._pushContext,e.prototype._popContext=i.prototype._popContext,e._peekContext=e.prototype._peekContext=a,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},i}},{}],9:[function(t,r,i){"use strict";r.exports=function(r,i,a,n){var o,s,c,u,p=r._async,l=t("./errors").Warning,f=t("./util"),h=t("./es5"),d=f.canAttachTrace,m=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,g=/\((?:timers\.js):\d+:\d+\)/,b=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,v=null,y=null,w=!1,k=!(0==f.env("BLUEBIRD_DEBUG")),_=!(0==f.env("BLUEBIRD_WARNINGS")||!k&&!f.env("BLUEBIRD_WARNINGS")),x=!(0==f.env("BLUEBIRD_LONG_STACK_TRACES")||!k&&!f.env("BLUEBIRD_LONG_STACK_TRACES")),j=0!=f.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(_||!!f.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function t(){for(var t=0;t0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(e,t,r){return K(e,t,r||this)},r.onPossiblyUnhandledRejection=function(e){var t=r._getContext();s=f.contextBind(t,e)},r.onUnhandledRejectionHandled=function(e){var t=r._getContext();o=f.contextBind(t,e)};var S=function(){};r.longStackTraces=function(){if(p.haveItemsQueued()&&!re.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!re.longStackTraces&&Q()){var e=r.prototype._captureStackTrace,t=r.prototype._attachExtraTrace,a=r.prototype._dereferenceTrace;re.longStackTraces=!0,S=function(){if(p.haveItemsQueued()&&!re.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=e,r.prototype._attachExtraTrace=t,r.prototype._dereferenceTrace=a,i.deactivateLongStackTraces(),re.longStackTraces=!1},r.prototype._captureStackTrace=N,r.prototype._attachExtraTrace=U,r.prototype._dereferenceTrace=H,i.activateLongStackTraces()}},r.hasLongStackTraces=function(){return re.longStackTraces&&Q()};var E={unhandledrejection:{before:function(){var e=f.global.onunhandledrejection;return f.global.onunhandledrejection=null,e},after:function(e){f.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=f.global.onrejectionhandled;return f.global.onrejectionhandled=null,e},after:function(e){f.global.onrejectionhandled=e}}},A=function(){var e=function(e,t){if(!e)return!f.global.dispatchEvent(t);var r;try{return r=e.before(),!f.global.dispatchEvent(t)}finally{e.after(r)}};try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var i=new CustomEvent(t,{detail:r,cancelable:!0});return h.defineProperty(i,"promise",{value:r.promise}),h.defineProperty(i,"reason",{value:r.reason}),e(E[t],i)}}if("function"==typeof Event){t=new Event("CustomEvent");return f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var i=new Event(t,{cancelable:!0});return i.detail=r,h.defineProperty(i,"promise",{value:r.promise}),h.defineProperty(i,"reason",{value:r.reason}),e(E[t],i)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,!1,!0,r),e(E[t],i)}}catch(e){}return function(){return!1}}(),F=f.isNode?function(){return e.emit.apply(e,arguments)}:f.global?function(e){var t="on"+e.toLowerCase(),r=f.global[t];return!!r&&(r.apply(f.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function P(e,t){return{promise:t}}var z={promiseCreated:P,promiseFulfilled:P,promiseRejected:P,promiseResolved:P,promiseCancelled:P,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:P},C=function(e){var t=!1;try{t=F.apply(null,arguments)}catch(e){p.throwLater(e),t=!0}var r=!1;try{r=A(e,z[e].apply(null,arguments))}catch(e){p.throwLater(e),r=!0}return r||t};function O(){return!1}function T(e,t,r){var i=this;try{e(t,r,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+f.toString(e));i._attachCancellationCallback(e)})}catch(e){return e}}function B(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?f.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function I(){return this._onCancelField}function R(e){this._onCancelField=e}function q(){this._cancellationParent=void 0,this._onCancelField=void 0}function M(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}r.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?r.longStackTraces():!e.longStackTraces&&r.hasLongStackTraces()&&S()),"warnings"in e){var t=e.warnings;re.warnings=!!t,j=re.warnings,f.isObject(t)&&"wForgottenReturn"in t&&(j=!!t.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!re.cancellation){if(p.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=q,r.prototype._propagateFrom=M,r.prototype._onCancel=I,r.prototype._setOnCancel=R,r.prototype._attachCancellationCallback=B,r.prototype._execute=T,D=M,re.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!re.monitoring?(re.monitoring=!0,r.prototype._fireEvent=C):!e.monitoring&&re.monitoring&&(re.monitoring=!1,r.prototype._fireEvent=O)),"asyncHooks"in e&&f.nodeSupportsAsyncResource){var i=re.asyncHooks,o=!!e.asyncHooks;i!==o&&(re.asyncHooks=o,o?a():n())}return r},r.prototype._fireEvent=O,r.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(e){},r.prototype._attachCancellationCallback=function(e){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(e,t){};var D=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function L(){var e=this._boundTo;return void 0!==e&&e instanceof r?e.isFulfilled()?e.value():void 0:e}function N(){this._trace=new ee(this._peekContext())}function U(e,t){if(d(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var i=V(e);f.notEnumerableProp(e,"stack",i.message+"\n"+i.stack.join("\n")),f.notEnumerableProp(e,"__stackCleaned__",!0)}}}function H(){this._trace=void 0}function K(e,t,i){if(re.warnings){var a,n=new l(e);if(t)i._attachExtraTrace(n);else if(re.longStackTraces&&(a=r._peekContext()))a.attachExtraTrace(n);else{var o=V(n);n.stack=o.message+"\n"+o.stack.join("\n")}C("warning",n)||Z(n,"",!0)}}function $(e){for(var t=[],r=0;r0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:$(t)}}function Z(e,t,r){if("undefined"!=typeof console){var i;if(f.isObject(e)){var a=e.stack;i=t+y(a,e)}else i=t+String(e);"function"==typeof c?c(i,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(i)}}function W(e,t,r,i){var a=!1;try{"function"==typeof t&&(a=!0,"rejectionHandled"===e?t(i):t(r,i))}catch(e){p.throwLater(e)}"unhandledRejection"===e?C(e,r,i)||a||Z(r,"Unhandled rejection "):C(e,i)}function G(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():f.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){if(e.length<41)return e;return e.substr(0,38)+"..."}(t)+">, no stack trace)"}function Q(){return"function"==typeof te}var X=function(){return!1},Y=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function J(e){var t=e.match(Y);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function ee(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);te(this,ee),t>32&&this.uncycle()}f.inherits(ee,Error),i.CapturedTrace=ee,ee.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},i=0,a=this;void 0!==a;++i)t.push(a),a=a._parent;for(i=(e=this._length=i)-1;i>=0;--i){var n=t[i].stack;void 0===r[n]&&(r[n]=i)}for(i=0;i0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[i]._parent=void 0,t[i]._length=1;var s=i>0?t[i-1]:this;o=0;--u)t[u]._length=c,c++;return}}}},ee.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=V(e),r=t.message,i=[t.stack],a=this;void 0!==a;)i.push($(a.stack.split("\n"))),a=a._parent;!function(e){for(var t=e[0],r=1;r=0;--s)if(i[s]===n){o=s;break}for(s=o;s>=0;--s){var c=i[s];if(t[a]!==c)break;t.pop(),a--}t=i}}(i),function(e){for(var t=0;t=0)return v=/@/,y=t,w=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){i="stack"in e}return"stack"in a||!i||"number"!=typeof Error.stackTraceLimit?(y=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?G(t):t.toString()},null):(v=e,y=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(c=function(e){console.warn(e)},f.isNode&&e.stderr.isTTY?c=function(e,t){var r=t?"":"";console.warn(r+e+"\n")}:f.isNode||"string"!=typeof(new Error).stack||(c=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var re={warnings:_,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return x&&r.longStackTraces(),{asyncHooks:function(){return re.asyncHooks},longStackTraces:function(){return re.longStackTraces},warnings:function(){return re.warnings},cancellation:function(){return re.cancellation},monitoring:function(){return re.monitoring},propagateFromFunction:function(){return D},boundValueFunction:function(){return L},checkForgottenReturns:function(e,t,r,i,a){if(void 0===e&&null!==t&&j){if(void 0!==a&&a._returnedNonUndefined())return;if(0==(65535&i._bitField))return;r&&(r+=" ");var n="",o="";if(t._trace){for(var s=t._trace.stack.split("\n"),c=$(s),u=c.length-1;u>=0;--u){var p=c[u];if(!g.test(p)){var l=p.match(b);l&&(n="at "+l[1]+":"+l[2]+":"+l[3]+" ");break}}if(c.length>0){var f=c[0];for(u=0;u0&&(o="\n"+s[u-1]);break}}}var h="a promise was created in a "+r+"handler "+n+"but was not returned from it, see http://goo.gl/rRqMUw"+o;i._warn(h,!0,t)}},setBounds:function(e,t){if(Q()){for(var r,i,a=(e.stack||"").split("\n"),n=(t.stack||"").split("\n"),o=-1,s=-1,c=0;c=s||(X=function(e){if(m.test(e))return!0;var t=J(e);return!!(t&&t.fileName===r&&o<=t.line&&t.line<=s)})}},warn:K,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),K(r)},CapturedTrace:ee,fireDomEvent:A,fireGlobalEvent:F}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(e,t,r){"use strict";t.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var i=arguments[1];i instanceof e&&i.suppressUnhandledRejections();return this.caught(r,function(){return i})}}},{}],11:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.reduce,i=e.all;function a(){return i(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(a,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,i){return r(e,i,t,0)._then(a,void 0,void 0,e,void 0)},e.mapSeries=function(e,i){return r(e,i,t,t)}}},{}],12:[function(e,t,r){"use strict";var i,a,n=e("./es5"),o=n.freeze,s=e("./util"),c=s.inherits,u=s.notEnumerableProp;function p(e,t){function r(i){if(!(this instanceof r))return new r(i);u(this,"message","string"==typeof i?i:t),u(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(r,Error),r}var l=p("Warning","warning"),f=p("CancellationError","cancellation error"),h=p("TimeoutError","timeout error"),d=p("AggregateError","aggregate error");try{i=TypeError,a=RangeError}catch(e){i=p("TypeError","type error"),a=p("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function l(){return h.call(this,this.promise._target()._settledValue())}function f(e){if(!p(this,e))return o.e=e,o}function h(e){var a=this.promise,s=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?s.call(a._boundValue()):s.call(a._boundValue(),e);if(c===i)return c;if(void 0!==c){a._setReturnedNonUndefined();var h=r(c,a);if(h instanceof t){if(null!=this.cancelPromise){if(h._isCancelled()){var d=new n("late cancellation observer");return a._attachExtraTrace(d),o.e=d,o}h.isPending()&&h._attachCancellationCallback(new u(this))}return h._then(l,f,void 0,this,void 0)}}}return a.isRejected()?(p(this),o.e=e,o):(p(this),e)}return c.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){p(this.finallyHandler)},t.prototype._passThrough=function(e,t,r,i){return"function"!=typeof e?this.then():this._then(r,i,void 0,new c(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,h,h)},t.prototype.tap=function(e){return this._passThrough(e,1,h)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,h);var i,n=new Array(r-1),o=0;for(i=0;i0&&"function"==typeof arguments[t]&&(e=arguments[t]);var i=[].slice.call(arguments);e&&i.pop();var a=new r(i).promise();return void 0!==e?a.spread(e):a}}},{"./util":36}],18:[function(e,t,r){"use strict";t.exports=function(t,r,i,a,n,o){var s=e("./util"),c=s.tryCatch,u=s.errorObj,p=t._async;function l(e,r,i,a){this.constructor$(e),this._promise._captureStackTrace();var o=t._getContext();if(this._callback=s.contextBind(o,r),this._preservedValues=a===n?new Array(this.length()):null,this._limit=i,this._inFlight=0,this._queue=[],p.invoke(this._asyncInit,this,void 0),s.isArray(e))for(var c=0;c=1?o:0,n).promise()}s.inherits(l,r),l.prototype._asyncInit=function(){this._init$(void 0,-2)},l.prototype._init=function(){},l.prototype._promiseFulfilled=function(e,r){var i=this._values,n=this.length(),s=this._preservedValues,p=this._limit;if(r<0){if(i[r=-1*r-1]=e,p>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(p>=1&&this._inFlight>=p)return i[r]=e,this._queue.push(r),!1;null!==s&&(s[r]=e);var l=this._promise,f=this._callback,h=l._boundValue();l._pushContext();var d=c(f).call(h,e,r,n),m=l._popContext();if(o.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",l),d===u)return this._reject(d.e),!0;var g=a(d,this._promise);if(g instanceof t){var b=(g=g._target())._bitField;if(0==(50397184&b))return p>=1&&this._inFlight++,i[r]=g,g._proxy(this,-1*(r+1)),!1;if(0==(33554432&b))return 0!=(16777216&b)?(this._reject(g._reason()),!0):(this._cancel(),!0);d=g._value()}i[r]=d}return++this._totalResolved>=n&&(null!==s?this._filter(i,s):this._resolve(i),!0)},l.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight1){n.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],p=arguments[2];i=o.isArray(u)?s(e).apply(p,u):s(e).call(p,u)}else i=s(e)();var l=c._popContext();return n.checkForgottenReturns(i,l,"Promise.try",c),c._resolveFromSyncValue(i),c},t.prototype._resolveFromSyncValue=function(e){e===o.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,r){"use strict";var i=e("./util"),a=i.maybeWrapAsError,n=e("./errors").OperationalError,o=e("./es5");var s=/^(?:name|message|stack|cause)$/;function c(e){var t;if(function(e){return e instanceof Error&&o.getPrototypeOf(e)===Error.prototype}(e)){(t=new n(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=o.keys(e),a=0;a1){var r,i=new Array(t-1),a=0;for(r=0;r0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+c.classString(e);arguments.length>1&&(r+=", "+c.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},T.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},T.prototype.spread=function(e){return"function"!=typeof e?n("expecting a function but got "+c.classString(e)):this.all()._then(e,void 0,void 0,k,void 0)},T.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},T.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new j(this).promise()},T.prototype.error=function(e){return this.caught(c.originatesFromRejection,e)},T.getNewLibraryCopy=r.exports,T.is=function(e){return e instanceof T},T.fromNode=T.fromCallback=function(e){var t=new T(w);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,i=O(e)(z(t,r));return i===C&&t._rejectCallback(i.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},T.all=function(e){return new j(e).promise()},T.cast=function(e){var t=x(e);return t instanceof T||((t=new T(w))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},T.resolve=T.fulfilled=T.cast,T.reject=T.rejected=function(e){var t=new T(w);return t._captureStackTrace(),t._rejectCallback(e,!0),t},T.setScheduler=function(e){if("function"!=typeof e)throw new v("expecting a function but got "+c.classString(e));return g.setScheduler(e)},T.prototype._then=function(e,t,r,i,a){var n=void 0!==a,o=n?a:new T(w),s=this._target(),u=s._bitField;n||(o._propagateFrom(this,3),o._captureStackTrace(),void 0===i&&0!=(2097152&this._bitField)&&(i=0!=(50397184&u)?this._boundValue():s===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,o));var p=h();if(0!=(50397184&u)){var l,f,d=s._settlePromiseCtx;0!=(33554432&u)?(f=s._rejectionHandler0,l=e):0!=(16777216&u)?(f=s._fulfillmentHandler0,l=t,s._unsetRejectionIsUnhandled()):(d=s._settlePromiseLateCancellationObserver,f=new y("late cancellation observer"),s._attachExtraTrace(f),l=t),g.invoke(d,s,{handler:c.contextBind(p,l),promise:o,receiver:i,value:f})}else s._addCallbacks(e,t,o,i,p);return o},T.prototype._length=function(){return 65535&this._bitField},T.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},T.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},T.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},T.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},T.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},T.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},T.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},T.prototype._isFinal=function(){return(4194304&this._bitField)>0},T.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},T.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},T.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},T.prototype._setAsyncGuaranteed=function(){if(!g.hasCustomScheduler()){var e=this._bitField;this._bitField=e|(536870912&e)>>2^134217728}},T.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},T.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==s)return void 0===t&&this._isBound()?this._boundValue():t},T.prototype._promiseAt=function(e){return this[4*e-4+2]},T.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},T.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},T.prototype._boundValue=function(){},T.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,i=e._promise0,a=e._receiverAt(0);void 0===a&&(a=s),this._addCallbacks(t,r,i,a,null)},T.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),i=e._rejectionHandlerAt(t),a=e._promiseAt(t),n=e._receiverAt(t);void 0===n&&(n=s),this._addCallbacks(r,i,a,n,null)},T.prototype._addCallbacks=function(e,t,r,i,a){var n=this._length();if(n>=65531&&(n=0,this._setLength(0)),0===n)this._promise0=r,this._receiver0=i,"function"==typeof e&&(this._fulfillmentHandler0=c.contextBind(a,e)),"function"==typeof t&&(this._rejectionHandler0=c.contextBind(a,t));else{var o=4*n-4;this[o+2]=r,this[o+3]=i,"function"==typeof e&&(this[o+0]=c.contextBind(a,e)),"function"==typeof t&&(this[o+1]=c.contextBind(a,t))}return this._setLength(n+1),n},T.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},T.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(i(),!1);var r=x(e,this);if(!(r instanceof T))return this._fulfill(e);t&&this._propagateFrom(r,2);var a=r._target();if(a!==this){var n=a._bitField;if(0==(50397184&n)){var o=this._length();o>0&&a._migrateCallback0(this);for(var s=1;s>>16)){if(e===this){var r=i();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():g.settlePromises(this),this._dereferenceTrace())}},T.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return g.fatalError(e,c.isNode);(65535&t)>0?g.settlePromises(this):this._ensurePossibleRejectionHandled()}},T.prototype._fulfillPromises=function(e,t){for(var r=1;r0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var i=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,i,e),this._fulfillPromises(t,i)}this._setLength(0)}this._clearCancellationData()},T.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&d.defineProperty(T.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),T.defer=T.pending=function(){return A.deprecated("Promise.defer","new Promise"),{promise:new T(w),resolve:B,reject:I}},c.notEnumerableProp(T,"_makeSelfResolutionError",i),t("./method")(T,w,x,n,A),t("./bind")(T,w,x,A),t("./cancel")(T,j,n,A),t("./direct_resolve")(T),t("./synchronous_inspection")(T),t("./join")(T,j,x,w,g),T.Promise=T,T.version="3.7.1",t("./call_get.js")(T),t("./generators.js")(T,n,w,x,o,A),t("./map.js")(T,j,n,x,w,A),t("./nodeify.js")(T),t("./promisify.js")(T,w),t("./props.js")(T,j,x,n),t("./race.js")(T,w,x,n),t("./reduce.js")(T,j,n,x,w,A),t("./settle.js")(T,j,A),t("./some.js")(T,j,n),t("./timers.js")(T,w,A),t("./using.js")(T,n,x,E,w,A),t("./any.js")(T),t("./each.js")(T,w),t("./filter.js")(T,w),c.toFastProperties(T),c.toFastProperties(T.prototype),R({a:1}),R({b:2}),R({c:3}),R(1),R(function(){}),R(void 0),R(!1),R(new T(w)),A.setBounds(m.firstLineError,c.lastLineError),T}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36,async_hooks:void 0}],23:[function(e,t,r){"use strict";t.exports=function(t,r,i,a,n){var o=e("./util");o.isArray;function s(e){var i=this._promise=new t(r);e instanceof t&&(i._propagateFrom(e,3),e.suppressUnhandledRejections()),i._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(s,n),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(r,n){var s=i(this._values,this._promise);if(s instanceof t){var c=(s=s._target())._bitField;if(this._values=s,0==(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,n);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=o.asArray(s)))0!==s.length?this._iterate(s):-5===n?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(n));else{var u=a("expecting an array or an iterable object but got "+o.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var a=this._promise,n=!1,o=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r=this._length){var r;if(this._isMap)r=function(e){for(var t=new n,r=e.length/2|0,i=0;i>1},t.prototype.props=function(){return l(this)},t.props=function(e){return l(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new a;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new a;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},t.settle=function(e){return i.deprecated(".settle()",".reflect()"),new n(e).promise()},t.allSettled=function(e){return new n(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,r){"use strict";t.exports=function(t,r,i){var a=e("./util"),n=e("./errors").RangeError,o=e("./errors").AggregateError,s=a.isArray,c={};function u(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function p(e,t){if((0|t)!==t||t<0)return i("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(e),a=r.promise();return r.setHowMany(t),r.init(),a}a.inherits(u,r),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=s(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(e){this._howMany=e},u.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new o,t=this.length();t0?this._reject(e):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(e){this._values.push(e)},u.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new n(t)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return p(e,t)},t.prototype.some=function(e){return p(this,e)},t._SomePromiseArray=u}},{"./errors":12,"./util":36}],32:[function(e,t,r){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},a=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},n=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},o=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return o.call(this._target())},e.prototype.isRejected=function(){return n.call(this._target())},e.prototype.isFulfilled=function(){return a.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),i.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,r){"use strict";t.exports=function(t,r){var i=e("./util"),a=i.errorObj,n=i.isObject;var o={}.hasOwnProperty;return function(e,s){if(n(e)){if(e instanceof t)return e;var c=function(e){try{return function(e){return e.then}(e)}catch(e){return a.e=e,a}}(e);if(c===a){s&&s._pushContext();var u=t.reject(c.e);return s&&s._popContext(),u}if("function"==typeof c)return function(e){try{return o.call(e,"_promise0")}catch(e){return!1}}(e)?(u=new t(r),e._then(u._fulfill,u._reject,void 0,u,null),u):function(e,n,o){var s=new t(r),c=s;o&&o._pushContext(),s._captureStackTrace(),o&&o._popContext();var u=!0,p=i.tryCatch(n).call(e,function(e){s&&(s._resolveCallback(e),s=null)},function(e){s&&(s._rejectCallback(e,u,!0),s=null)});return u=!1,s&&p===a&&(s._rejectCallback(p.e,!0,!0),s=null),c}(e,c,s)}return e}}},{"./util":36}],34:[function(e,t,r){"use strict";t.exports=function(t,r,i){var a=e("./util"),n=t.TimeoutError;function o(e){this.handle=e}o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(e){return c(+this).thenReturn(e)},c=t.delay=function(e,a){var n,c;return void 0!==a?(n=t.resolve(a)._then(s,null,null,e,void 0),i.cancellation()&&a instanceof t&&n._setOnCancel(a)):(n=new t(r),c=setTimeout(function(){n._fulfill()},+e),i.cancellation()&&n._setOnCancel(new o(c)),n._captureStackTrace()),n._setAsyncGuaranteed(),n};t.prototype.delay=function(e){return c(e,this)};function u(e){return clearTimeout(this.handle),e}function p(e){throw clearTimeout(this.handle),e}t.prototype.timeout=function(e,t){var r,s;e=+e;var c=new o(setTimeout(function(){r.isPending()&&function(e,t,r){var i;i="string"!=typeof t?t instanceof Error?t:new n("operation timed out"):new n(t),a.markAsOriginatingFromRejection(i),e._attachExtraTrace(i),e._reject(i),null!=r&&r.cancel()}(r,t,s)},e));return i.cancellation()?(s=this.then(),(r=s._then(u,p,void 0,c,void 0))._setOnCancel(c)):r=this._then(u,p,void 0,c,void 0),r}}},{"./util":36}],35:[function(e,t,r){"use strict";t.exports=function(t,r,i,a,n,o){var s=e("./util"),c=e("./errors").TypeError,u=e("./util").inherits,p=s.errorObj,l=s.tryCatch,f={};function h(e){setTimeout(function(){throw e},0)}function d(e,r){var a=0,o=e.length,s=new t(n);return function n(){if(a>=o)return s._fulfill();var c=function(e){var t=i(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(e[a++]);if(c instanceof t&&c._isDisposable()){try{c=i(c._getDisposer().tryDispose(r),e.promise)}catch(e){return h(e)}if(c instanceof t)return c._then(n,h,null,null,null)}n()}(),s}function m(e,t,r){this._data=e,this._promise=t,this._context=r}function g(e,t,r){this.constructor$(e,t,r)}function b(e){return m.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function v(e){this.length=e,this.promise=null,this[e-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():f},m.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var i=t!==f?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,i},m.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},u(g,m),g.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},v.prototype._resultCancelled=function(){for(var e=this.length,r=0;r0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new g(e,this,a());throw new c}}},{"./errors":12,"./util":36}],36:[function(t,r,a){"use strict";var n=t("./es5"),o="undefined"==typeof navigator,s={e:{}},c,u="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i?i:void 0!==this?this:null;function p(){try{var e=c;return c=null,e.apply(this,arguments)}catch(e){return s.e=e,s}}function l(e){return c=e,p}var f=function(e,t){var r={}.hasOwnProperty;function i(){for(var i in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,i)&&"$"!==i.charAt(i.length-1)&&(this[i+"$"]=t.prototype[i])}return i.prototype=t.prototype,e.prototype=new i,e.prototype};function h(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function d(e){return"function"==typeof e||"object"==typeof e&&null!==e}function m(e){return h(e)?new Error(A(e)):e}function g(e,t){var r,i=e.length,a=new Array(i+1);for(r=0;r1,i=t.length>0&&!(1===t.length&&"constructor"===t[0]),a=k.test(e+"")&&n.names(e).length>0;if(r||i||a)return!0}return!1}catch(e){return!1}}function x(e){function t(){}t.prototype=e;var r=new t;function i(){return typeof r.foo}return i(),i(),e}var j=/^[a-z$_][a-z$_0-9]*$/i;function S(e){return j.test(e)}function E(e,t,r){for(var i=new Array(e),a=0;a10||K[0]>0),H.nodeSupportsAsyncResource=H.isNode&&function(){var e=!1;try{e="function"==typeof t("async_hooks").AsyncResource.prototype.runInAsyncScope}catch(t){e=!1}return e}(),H.isNode&&H.toFastProperties(e);try{throw new Error}catch(e){H.lastLineError=e}r.exports=H},{"./es5":13,async_hooks:void 0}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{_process:263,timers:372}],75:[function(e,t,r){!function(t,r){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof t?t.exports=n:r.BN=n,n.BN=n,n.wordSize=26;try{o=e("buffer").Buffer}catch(e){}function s(e,t,r){for(var i=0,a=Math.min(e.length,r),n=t;n=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return i}function c(e,t,r,i){for(var a=0,n=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return a}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&a++,16===t?this._parseHex(e,a):this._parseBase(e,t,a),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},n.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},n.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[n]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===r)for(a=0,n=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},n.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)a=s(e,r,r+6),this.words[i]|=a<>>26-n&4194303,(n+=24)>=26&&(n-=26,i++);r+6!==t&&(a=s(e,t,r+6),this.words[i]|=a<>>26-n&4194303),this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,a=1;a<=67108863;a*=t)i++;i--,a=a/t|0;for(var n=e.length-r,o=n%i,s=Math.min(n,n-o)+r,u=0,p=r;p1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var a=0|e.words[0],n=0|t.words[0],o=a*n,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var d=u-h|0;p+=(o=(a=0|e.words[d])*(n=0|t.words[h])+l)/67108864|0,l=67108863&o}r.words[u]=0|l,c=0|p}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}n.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,n=0,o=0;o>>24-a&16777215)||o!==this.length-1?u[6-c.length]+c+r:c+r,(a+=2)>=26&&(a-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=p[e],h=l[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(h).toString(e);r=(d=d.idivn(h)).isZero()?m+r:u[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return i(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,r){var a=this.byteLength(),n=r||Math.max(1,a);i(a<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0"),this.strip();var o,s,c="le"===t,u=new e(n),p=this.clone();if(c){for(s=0;!p.isZero();s++)o=p.andln(255),p.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var a=0,n=0;n>>26;for(;0!==a&&n>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ne.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==n&&o>26,this.words[o]=67108863&t;if(0===n&&o>>13,h=0|o[1],d=8191&h,m=h>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,k=y>>>13,_=0|o[4],x=8191&_,j=_>>>13,S=0|o[5],E=8191&S,A=S>>>13,F=0|o[6],P=8191&F,z=F>>>13,C=0|o[7],O=8191&C,T=C>>>13,B=0|o[8],I=8191&B,R=B>>>13,q=0|o[9],M=8191&q,D=q>>>13,L=0|s[0],N=8191&L,U=L>>>13,H=0|s[1],K=8191&H,$=H>>>13,V=0|s[2],Z=8191&V,W=V>>>13,G=0|s[3],Q=8191&G,X=G>>>13,Y=0|s[4],J=8191&Y,ee=Y>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ae=0|s[6],ne=8191&ae,oe=ae>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,pe=0|s[8],le=8191&pe,fe=pe>>>13,he=0|s[9],de=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(l,N))|0)+((8191&(a=(a=Math.imul(l,U))+Math.imul(f,N)|0))<<13)|0;u=((n=Math.imul(f,U))+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,N),a=(a=Math.imul(d,U))+Math.imul(m,N)|0,n=Math.imul(m,U);var be=(u+(i=i+Math.imul(l,K)|0)|0)+((8191&(a=(a=a+Math.imul(l,$)|0)+Math.imul(f,K)|0))<<13)|0;u=((n=n+Math.imul(f,$)|0)+(a>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,N),a=(a=Math.imul(b,U))+Math.imul(v,N)|0,n=Math.imul(v,U),i=i+Math.imul(d,K)|0,a=(a=a+Math.imul(d,$)|0)+Math.imul(m,K)|0,n=n+Math.imul(m,$)|0;var ve=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(a=(a=a+Math.imul(l,W)|0)+Math.imul(f,Z)|0))<<13)|0;u=((n=n+Math.imul(f,W)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(w,N),a=(a=Math.imul(w,U))+Math.imul(k,N)|0,n=Math.imul(k,U),i=i+Math.imul(b,K)|0,a=(a=a+Math.imul(b,$)|0)+Math.imul(v,K)|0,n=n+Math.imul(v,$)|0,i=i+Math.imul(d,Z)|0,a=(a=a+Math.imul(d,W)|0)+Math.imul(m,Z)|0,n=n+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(a=(a=a+Math.imul(l,X)|0)+Math.imul(f,Q)|0))<<13)|0;u=((n=n+Math.imul(f,X)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,N),a=(a=Math.imul(x,U))+Math.imul(j,N)|0,n=Math.imul(j,U),i=i+Math.imul(w,K)|0,a=(a=a+Math.imul(w,$)|0)+Math.imul(k,K)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(b,Z)|0,a=(a=a+Math.imul(b,W)|0)+Math.imul(v,Z)|0,n=n+Math.imul(v,W)|0,i=i+Math.imul(d,Q)|0,a=(a=a+Math.imul(d,X)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,X)|0;var we=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(a=(a=a+Math.imul(l,ee)|0)+Math.imul(f,J)|0))<<13)|0;u=((n=n+Math.imul(f,ee)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(E,N),a=(a=Math.imul(E,U))+Math.imul(A,N)|0,n=Math.imul(A,U),i=i+Math.imul(x,K)|0,a=(a=a+Math.imul(x,$)|0)+Math.imul(j,K)|0,n=n+Math.imul(j,$)|0,i=i+Math.imul(w,Z)|0,a=(a=a+Math.imul(w,W)|0)+Math.imul(k,Z)|0,n=n+Math.imul(k,W)|0,i=i+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,X)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,X)|0,i=i+Math.imul(d,J)|0,a=(a=a+Math.imul(d,ee)|0)+Math.imul(m,J)|0,n=n+Math.imul(m,ee)|0;var ke=(u+(i=i+Math.imul(l,re)|0)|0)+((8191&(a=(a=a+Math.imul(l,ie)|0)+Math.imul(f,re)|0))<<13)|0;u=((n=n+Math.imul(f,ie)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(P,N),a=(a=Math.imul(P,U))+Math.imul(z,N)|0,n=Math.imul(z,U),i=i+Math.imul(E,K)|0,a=(a=a+Math.imul(E,$)|0)+Math.imul(A,K)|0,n=n+Math.imul(A,$)|0,i=i+Math.imul(x,Z)|0,a=(a=a+Math.imul(x,W)|0)+Math.imul(j,Z)|0,n=n+Math.imul(j,W)|0,i=i+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,X)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(b,J)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(v,J)|0,n=n+Math.imul(v,ee)|0,i=i+Math.imul(d,re)|0,a=(a=a+Math.imul(d,ie)|0)+Math.imul(m,re)|0,n=n+Math.imul(m,ie)|0;var _e=(u+(i=i+Math.imul(l,ne)|0)|0)+((8191&(a=(a=a+Math.imul(l,oe)|0)+Math.imul(f,ne)|0))<<13)|0;u=((n=n+Math.imul(f,oe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(O,N),a=(a=Math.imul(O,U))+Math.imul(T,N)|0,n=Math.imul(T,U),i=i+Math.imul(P,K)|0,a=(a=a+Math.imul(P,$)|0)+Math.imul(z,K)|0,n=n+Math.imul(z,$)|0,i=i+Math.imul(E,Z)|0,a=(a=a+Math.imul(E,W)|0)+Math.imul(A,Z)|0,n=n+Math.imul(A,W)|0,i=i+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,X)|0)+Math.imul(j,Q)|0,n=n+Math.imul(j,X)|0,i=i+Math.imul(w,J)|0,a=(a=a+Math.imul(w,ee)|0)+Math.imul(k,J)|0,n=n+Math.imul(k,ee)|0,i=i+Math.imul(b,re)|0,a=(a=a+Math.imul(b,ie)|0)+Math.imul(v,re)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(d,ne)|0,a=(a=a+Math.imul(d,oe)|0)+Math.imul(m,ne)|0,n=n+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(l,ce)|0)|0)+((8191&(a=(a=a+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((n=n+Math.imul(f,ue)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,N),a=(a=Math.imul(I,U))+Math.imul(R,N)|0,n=Math.imul(R,U),i=i+Math.imul(O,K)|0,a=(a=a+Math.imul(O,$)|0)+Math.imul(T,K)|0,n=n+Math.imul(T,$)|0,i=i+Math.imul(P,Z)|0,a=(a=a+Math.imul(P,W)|0)+Math.imul(z,Z)|0,n=n+Math.imul(z,W)|0,i=i+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,X)|0)+Math.imul(A,Q)|0,n=n+Math.imul(A,X)|0,i=i+Math.imul(x,J)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(j,J)|0,n=n+Math.imul(j,ee)|0,i=i+Math.imul(w,re)|0,a=(a=a+Math.imul(w,ie)|0)+Math.imul(k,re)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(b,ne)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(v,ne)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(d,ce)|0,a=(a=a+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,n=n+Math.imul(m,ue)|0;var je=(u+(i=i+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((n=n+Math.imul(f,fe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(M,N),a=(a=Math.imul(M,U))+Math.imul(D,N)|0,n=Math.imul(D,U),i=i+Math.imul(I,K)|0,a=(a=a+Math.imul(I,$)|0)+Math.imul(R,K)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(O,Z)|0,a=(a=a+Math.imul(O,W)|0)+Math.imul(T,Z)|0,n=n+Math.imul(T,W)|0,i=i+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,X)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,X)|0,i=i+Math.imul(E,J)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(A,J)|0,n=n+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ie)|0)+Math.imul(j,re)|0,n=n+Math.imul(j,ie)|0,i=i+Math.imul(w,ne)|0,a=(a=a+Math.imul(w,oe)|0)+Math.imul(k,ne)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(b,ce)|0,a=(a=a+Math.imul(b,ue)|0)+Math.imul(v,ce)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(d,le)|0,a=(a=a+Math.imul(d,fe)|0)+Math.imul(m,le)|0,n=n+Math.imul(m,fe)|0;var Se=(u+(i=i+Math.imul(l,de)|0)|0)+((8191&(a=(a=a+Math.imul(l,me)|0)+Math.imul(f,de)|0))<<13)|0;u=((n=n+Math.imul(f,me)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(M,K),a=(a=Math.imul(M,$))+Math.imul(D,K)|0,n=Math.imul(D,$),i=i+Math.imul(I,Z)|0,a=(a=a+Math.imul(I,W)|0)+Math.imul(R,Z)|0,n=n+Math.imul(R,W)|0,i=i+Math.imul(O,Q)|0,a=(a=a+Math.imul(O,X)|0)+Math.imul(T,Q)|0,n=n+Math.imul(T,X)|0,i=i+Math.imul(P,J)|0,a=(a=a+Math.imul(P,ee)|0)+Math.imul(z,J)|0,n=n+Math.imul(z,ee)|0,i=i+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ie)|0)+Math.imul(A,re)|0,n=n+Math.imul(A,ie)|0,i=i+Math.imul(x,ne)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(j,ne)|0,n=n+Math.imul(j,oe)|0,i=i+Math.imul(w,ce)|0,a=(a=a+Math.imul(w,ue)|0)+Math.imul(k,ce)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(b,le)|0,a=(a=a+Math.imul(b,fe)|0)+Math.imul(v,le)|0,n=n+Math.imul(v,fe)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((n=n+Math.imul(m,me)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(M,Z),a=(a=Math.imul(M,W))+Math.imul(D,Z)|0,n=Math.imul(D,W),i=i+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,X)|0)+Math.imul(R,Q)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(O,J)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(T,J)|0,n=n+Math.imul(T,ee)|0,i=i+Math.imul(P,re)|0,a=(a=a+Math.imul(P,ie)|0)+Math.imul(z,re)|0,n=n+Math.imul(z,ie)|0,i=i+Math.imul(E,ne)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(A,ne)|0,n=n+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,a=(a=a+Math.imul(x,ue)|0)+Math.imul(j,ce)|0,n=n+Math.imul(j,ue)|0,i=i+Math.imul(w,le)|0,a=(a=a+Math.imul(w,fe)|0)+Math.imul(k,le)|0,n=n+Math.imul(k,fe)|0;var Ae=(u+(i=i+Math.imul(b,de)|0)|0)+((8191&(a=(a=a+Math.imul(b,me)|0)+Math.imul(v,de)|0))<<13)|0;u=((n=n+Math.imul(v,me)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(M,Q),a=(a=Math.imul(M,X))+Math.imul(D,Q)|0,n=Math.imul(D,X),i=i+Math.imul(I,J)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,ee)|0,i=i+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ie)|0)+Math.imul(T,re)|0,n=n+Math.imul(T,ie)|0,i=i+Math.imul(P,ne)|0,a=(a=a+Math.imul(P,oe)|0)+Math.imul(z,ne)|0,n=n+Math.imul(z,oe)|0,i=i+Math.imul(E,ce)|0,a=(a=a+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,n=n+Math.imul(A,ue)|0,i=i+Math.imul(x,le)|0,a=(a=a+Math.imul(x,fe)|0)+Math.imul(j,le)|0,n=n+Math.imul(j,fe)|0;var Fe=(u+(i=i+Math.imul(w,de)|0)|0)+((8191&(a=(a=a+Math.imul(w,me)|0)+Math.imul(k,de)|0))<<13)|0;u=((n=n+Math.imul(k,me)|0)+(a>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,i=Math.imul(M,J),a=(a=Math.imul(M,ee))+Math.imul(D,J)|0,n=Math.imul(D,ee),i=i+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ie)|0)+Math.imul(R,re)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(O,ne)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(T,ne)|0,n=n+Math.imul(T,oe)|0,i=i+Math.imul(P,ce)|0,a=(a=a+Math.imul(P,ue)|0)+Math.imul(z,ce)|0,n=n+Math.imul(z,ue)|0,i=i+Math.imul(E,le)|0,a=(a=a+Math.imul(E,fe)|0)+Math.imul(A,le)|0,n=n+Math.imul(A,fe)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(a=(a=a+Math.imul(x,me)|0)+Math.imul(j,de)|0))<<13)|0;u=((n=n+Math.imul(j,me)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(M,re),a=(a=Math.imul(M,ie))+Math.imul(D,re)|0,n=Math.imul(D,ie),i=i+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(R,ne)|0,n=n+Math.imul(R,oe)|0,i=i+Math.imul(O,ce)|0,a=(a=a+Math.imul(O,ue)|0)+Math.imul(T,ce)|0,n=n+Math.imul(T,ue)|0,i=i+Math.imul(P,le)|0,a=(a=a+Math.imul(P,fe)|0)+Math.imul(z,le)|0,n=n+Math.imul(z,fe)|0;var ze=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(a=(a=a+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((n=n+Math.imul(A,me)|0)+(a>>>13)|0)+(ze>>>26)|0,ze&=67108863,i=Math.imul(M,ne),a=(a=Math.imul(M,oe))+Math.imul(D,ne)|0,n=Math.imul(D,oe),i=i+Math.imul(I,ce)|0,a=(a=a+Math.imul(I,ue)|0)+Math.imul(R,ce)|0,n=n+Math.imul(R,ue)|0,i=i+Math.imul(O,le)|0,a=(a=a+Math.imul(O,fe)|0)+Math.imul(T,le)|0,n=n+Math.imul(T,fe)|0;var Ce=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(a=(a=a+Math.imul(P,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((n=n+Math.imul(z,me)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(M,ce),a=(a=Math.imul(M,ue))+Math.imul(D,ce)|0,n=Math.imul(D,ue),i=i+Math.imul(I,le)|0,a=(a=a+Math.imul(I,fe)|0)+Math.imul(R,le)|0,n=n+Math.imul(R,fe)|0;var Oe=(u+(i=i+Math.imul(O,de)|0)|0)+((8191&(a=(a=a+Math.imul(O,me)|0)+Math.imul(T,de)|0))<<13)|0;u=((n=n+Math.imul(T,me)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(M,le),a=(a=Math.imul(M,fe))+Math.imul(D,le)|0,n=Math.imul(D,fe);var Te=(u+(i=i+Math.imul(I,de)|0)|0)+((8191&(a=(a=a+Math.imul(I,me)|0)+Math.imul(R,de)|0))<<13)|0;u=((n=n+Math.imul(R,me)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Be=(u+(i=Math.imul(M,de))|0)+((8191&(a=(a=Math.imul(M,me))+Math.imul(D,de)|0))<<13)|0;return u=((n=Math.imul(D,me))+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=be,c[2]=ve,c[3]=ye,c[4]=we,c[5]=ke,c[6]=_e,c[7]=xe,c[8]=je,c[9]=Se,c[10]=Ee,c[11]=Ae,c[12]=Fe,c[13]=Pe,c[14]=ze,c[15]=Ce,c[16]=Oe,c[17]=Te,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function d(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=f),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,a=0,n=0;n>>26)|0)>>>26,o&=67108863}r.words[n]=s,i=o,o=a}return 0!==i?r.words[n]=i:r.length--,r.strip()}(this,e,t):d(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,a,n){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=a/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i=0);var t,r=e%26,a=(e-r)/26,n=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t=0),a=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),s=67108863^67108863>>>n<o)for(this.length-=o,u=0;u=0&&(0!==p||u>=a);u--){var l=0|this.words[u];this.words[u]=p<<26-n|l>>>n,p=l&s}return c&&0!==p&&(c.words[c.length++]=p),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[a+r]=67108863&n}for(;a>26,this.words[a+r]=67108863&n;if(0===s)return this.strip();for(i(-1===s),s=0,a=0;a>26,this.words[a]=67108863&n;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),i.iushln(r),o=0|a.words[a.length-1]);var s,c=i.length-a.length;if("mod"!==t){(s=new n(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|i.words[a.length+l])+(0|i.words[a.length+l-1]);for(f=Math.min(f/o|0,67108863),i._ishlnsubmul(a,f,l);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(a,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=f)}return s&&s.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},n.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),a=e.andln(1),n=r.cmp(i);return n<0||1===a&&0===n?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,a=this.length-1;a>=0;a--)r=(t*r+(0|this.words[a]))%e;return r},n.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*t;this.words[r]=a/e|0,t=a%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),o=new n(0),s=new n(0),c=new n(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var p=r.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(p),o.isub(l)),a.iushrn(1),o.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(p),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(c)):(r.isub(t),s.isub(a),c.isub(o))}return{a:s,b:c,gcd:r.iushln(u)}},n.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new n(1),s=new n(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,p=1;0==(t.words[0]&p)&&u<26;++u,p<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var l=0,f=1;0==(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var n=t;t=r,r=n}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:ae.length)return 1;if(this.length=0;r--){var i=0|this.words[r],a=0|e.words[r];if(i!==a){ia&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new _(e)},n.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):r.strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},a(v,b),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,a=n}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return g[e]=t,t},_.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new n(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);i(!a.isZero());var s=new n(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new n(2*p*p).toRed(this);0!==this.pow(p,u).cmp(c);)p.redIAdd(c);for(var l=this.pow(p,a),f=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),d=o;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var u=t.words[i],p=c-1;p>=0;p--){var l=u>>p&1;a!==r[0]&&(a=this.sqr(a)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===i&&0===p)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}c=26}return a},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new x(e)},a(x,_),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),n=a;return a.cmp(this.m)>=0?n=a.isub(this.m):a.cmpn(0)<0&&(n=a.iadd(this.m)),n._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:77}],76:[function(e,t,r){var i;function a(e){this.rand=e}if(t.exports=function(e){return i||(i=new a(null)),i.generate(e)},t.exports.Rand=a,a.prototype.generate=function(e){return this._rand(e)},a.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^p[d>>>16&255]^l[m>>>8&255]^f[255&g]^t[b++],o=u[d>>>24]^p[m>>>16&255]^l[g>>>8&255]^f[255&h]^t[b++],s=u[m>>>24]^p[g>>>16&255]^l[h>>>8&255]^f[255&d]^t[b++],c=u[g>>>24]^p[h>>>16&255]^l[d>>>8&255]^f[255&m]^t[b++],h=n,d=o,m=s,g=c;return n=(i[h>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[b++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&h])^t[b++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[h>>>8&255]<<8|i[255&d])^t[b++],c=(i[g>>>24]<<24|i[h>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[b++],[n>>>=0,o>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],a=[[],[],[],[]],n=[[],[],[],[]],o=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,r[o]=u,i[u]=o;var p=e[o],l=e[p],f=e[l],h=257*e[u]^16843008*u;a[0][o]=h<<24|h>>>8,a[1][o]=h<<16|h>>>16,a[2][o]=h<<8|h>>>24,a[3][o]=h,h=16843009*f^65537*l^257*p^16843008*o,n[0][u]=h<<24|h>>>8,n[1][u]=h<<16|h>>>16,n[2][u]=h<<8|h>>>24,n[3][u]=h,0===o?o=s=1:(o=p^e[e[e[f^p]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:a,INV_SUB_MIX:n}}();function u(e){this._key=a(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),a=[],n=0;n>>24,o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o],o^=s[n/t|0]<<24):t>6&&n%t==4&&(o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o]),a[n]=a[n-t]^o}for(var u=[],p=0;p>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=r,this._keySchedule=a,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=i.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},u.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),n=i.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[3],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[1],12),n},u.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},t.exports.AES=u},{"safe-buffer":314}],79:[function(e,t,r){var i=e("./aes"),a=e("safe-buffer").Buffer,n=e("cipher-base"),o=e("inherits"),s=e("./ghash"),c=e("buffer-xor"),u=e("./incr32");function p(e,t,r,o){n.call(this);var c=a.alloc(4,0);this._cipher=new i.AES(t);var p=this._cipher.encryptBlock(c);this._ghash=new s(p),r=function(e,t,r){if(12===t.length)return e._finID=a.concat([t,a.from([0,0,0,1])]),a.concat([t,a.from([0,0,0,2])]);var i=new s(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(a.alloc(o,0))),i.update(a.alloc(8,0));var c=8*n,p=a.alloc(8);p.writeUIntBE(c,0,8),i.update(p),e._finID=i.state;var l=a.from(e._finID);return u(l),l}(this,r,p),this._prev=a.from(r),this._cache=a.allocUnsafe(0),this._secCache=a.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(p,n),p.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=a.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},p.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),a=0;a16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(t,!1,r.key,r.iv);return f(e,i.key,i.iv)},r.createDecipheriv=f},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":113,evp_bytestokey:155,inherits:205,"safe-buffer":314}],82:[function(e,t,r){var i=e("./modes"),a=e("./authCipher"),n=e("safe-buffer").Buffer,o=e("./streamCipher"),s=e("cipher-base"),c=e("./aes"),u=e("evp_bytestokey");function p(e,t,r){s.call(this),this._cache=new f,this._cipher=new c.AES(t),this._prev=n.from(r),this._mode=e,this._autopadding=!0}e("inherits")(p,s),p.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return n.concat(i)};var l=n.alloc(16,16);function f(){this.cache=n.allocUnsafe(0)}function h(e,t,r){var s=i[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=n.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=n.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new o(s.module,t,r):"auth"===s.type?new a(s.module,t,r):new p(s.module,t,r)}p.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},p.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=n.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=n.allocUnsafe(e),r=-1;++r>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t0;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=n(a)},o.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,a],16)),this.ghash(n([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":314}],84:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],85:[function(e,t,r){var i=e("buffer-xor");r.encrypt=function(e,t){var r=i(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var a=e._cipher.decryptBlock(t);return i(a,r)}},{"buffer-xor":109}],86:[function(e,t,r){var i=e("safe-buffer").Buffer,a=e("buffer-xor");function n(e,t,r){var n=t.length,o=a(t,e._cache);return e._cache=e._cache.slice(n),e._prev=i.concat([e._prev,r?t:o]),o}r.encrypt=function(e,t,r){for(var a,o=i.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=i.allocUnsafe(0)),!(e._cache.length<=t.length)){o=i.concat([o,n(e,t,r)]);break}a=e._cache.length,o=i.concat([o,n(e,t.slice(0,a),r)]),t=t.slice(a)}return o}},{"buffer-xor":109,"safe-buffer":314}],87:[function(e,t,r){var i=e("safe-buffer").Buffer;function a(e,t,r){for(var i,a,o=-1,s=0;++o<8;)i=t&1<<7-o?128:0,s+=(128&(a=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=n(e._prev,r?i:a);return s}function n(e,t){var r=e.length,a=-1,n=i.allocUnsafe(e.length);for(e=i.concat([e,i.from([t])]);++a>7;return n}r.encrypt=function(e,t,r){for(var n=t.length,o=i.allocUnsafe(n),s=-1;++s=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new i(a(t));return r}t.exports=n,n.getr=o}).call(this,e("buffer").Buffer)},{"bn.js":75,buffer:110,randombytes:280}],99:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":100}],100:[function(e,t,r){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],101:[function(e,t,r){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],102:[function(e,t,r){(function(r){var i=e("create-hash"),a=e("stream"),n=e("inherits"),o=e("./sign"),s=e("./verify"),c=e("./algorithms.json");function u(e){a.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function p(e){a.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){return new u(e)}function f(e){return new p(e)}Object.keys(c).forEach(function(e){c[e].id=new r(c[e].id,"hex"),c[e.toLowerCase()]=c[e]}),n(u,a.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=new r(e,t)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),i=o(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},n(p,a.Writable),p.prototype._write=function(e,t,r){this._hash.update(e),r()},p.prototype.update=function(e,t){return"string"==typeof e&&(e=new r(e,t)),this._hash.update(e),this},p.prototype.verify=function(e,t,i){"string"==typeof t&&(t=new r(t,i)),this.end();var a=this._hash.digest();return s(t,a,e,this._signType,this._tag)},t.exports={Sign:l,Verify:f,createSign:l,createVerify:f}}).call(this,e("buffer").Buffer)},{"./algorithms.json":100,"./sign":103,"./verify":104,buffer:110,"create-hash":117,inherits:205,stream:350}],103:[function(e,t,r){(function(r){var i=e("create-hmac"),a=e("browserify-rsa"),n=e("elliptic").ec,o=e("bn.js"),s=e("parse-asn1"),c=e("./curves.json");function u(e,t,a,n){if((e=new r(e.toArray())).length0&&r.ishrn(i),r}function l(e,t,a){var n,o;do{for(n=new r(0);8*n.length=t)throw new Error("invalid sig")}t.exports=function(e,t,c,u,p){var l=n(c);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=o[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new a(i),s=r.data.subjectPrivateKey.data;return n.verify(t,e,s)}(e,t,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var a=r.data.p,o=r.data.q,c=r.data.g,u=r.data.pub_key,p=n.signature.decode(e,"der"),l=p.s,f=p.r;s(l,o),s(f,o);var h=i.mont(a),d=l.invm(o);return 0===c.toRed(h).redPow(new i(t).mul(d).mod(o)).fromRed().mul(u.toRed(h).redPow(f.mul(d).mod(o)).fromRed()).mod(a).mod(o).cmp(f)}(e,t,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");t=r.concat([p,t]);for(var f=l.modulus.byteLength(),h=[1],d=0;t.length+h.length+2r.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}p.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,a(this.init_done,"close before init"),a(this.mode<=r.UNZIP),this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||s.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},p.prototype.write=function(e,t,r,i,a,n,o){return this._write(!0,e,t,r,i,a,n,o)},p.prototype.writeSync=function(e,t,r,i,a,n,o){return this._write(!1,e,t,r,i,a,n,o)},p.prototype._write=function(e,n,o,s,c,u,p,l){if(a.equal(arguments.length,8),a(this.init_done,"write before init"),a(this.mode!==r.NONE,"already finalized"),a.equal(!1,this.write_in_progress,"write already in progress"),a.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,a.equal(!1,void 0===n,"must provide flush value"),this.write_in_progress=!0,n!==r.Z_NO_FLUSH&&n!==r.Z_PARTIAL_FLUSH&&n!==r.Z_SYNC_FLUSH&&n!==r.Z_FULL_FLUSH&&n!==r.Z_FINISH&&n!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=i.alloc(0),c=0,s=0),this.strm.avail_in=c,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=l,this.strm.output=u,this.strm.next_out=p,this.flush=n,!e)return this._process(),this._checkError()?this._afterSync():void 0;var f=this;return t.nextTick(function(){f._process(),f._after()}),this},p.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},p.prototype._process=function(){var e=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=r.GUNZIP):this.mode=r.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===r.Z_DATA_ERROR&&(this.err=r.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===r.GUNZIP&&this.err===r.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},p.prototype._checkError=function(){switch(this.err){case r.Z_OK:case r.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===r.Z_FINISH)return this._error("unexpected end of file"),!1;break;case r.Z_STREAM_END:break;case r.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},p.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},p.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},p.prototype.init=function(e,t,i,n,o){a(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),a(e>=8&&e<=15,"invalid windowBits"),a(t>=-1&&t<=9,"invalid compression level"),a(i>=1&&i<=9,"invalid memlevel"),a(n===r.Z_FILTERED||n===r.Z_HUFFMAN_ONLY||n===r.Z_RLE||n===r.Z_FIXED||n===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,i,n,o),this._setDictionary()},p.prototype.params=function(){throw new Error("deflateParams Not supported")},p.prototype.reset=function(){this._reset(),this._setDictionary()},p.prototype._init=function(e,t,i,a,c){switch(this.level=e,this.windowBits=t,this.memLevel=i,this.strategy=a,this.flush=r.Z_NO_FLUSH,this.err=r.Z_OK,this.mode!==r.GZIP&&this.mode!==r.GUNZIP||(this.windowBits+=16),this.mode===r.UNZIP&&(this.windowBits+=32),this.mode!==r.DEFLATERAW&&this.mode!==r.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new n,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==r.Z_OK&&this._error("Init error"),this.dictionary=c,this.write_in_progress=!1,this.init_done=!0},p.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==r.Z_OK&&this._error("Failed to set dictionary")}},p.prototype._reset=function(){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:case r.GZIP:this.err=o.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=p}).call(this,e("_process"),e("buffer").Buffer)},{_process:263,assert:65,buffer:110,"pako/lib/zlib/constants":241,"pako/lib/zlib/deflate.js":243,"pako/lib/zlib/inflate.js":245,"pako/lib/zlib/zstream":249}],106:[function(e,t,r){(function(t){"use strict";var i=e("buffer").Buffer,a=e("stream").Transform,n=e("./binding"),o=e("util"),s=e("assert").ok,c=e("buffer").kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";n.Z_MIN_WINDOWBITS=8,n.Z_MAX_WINDOWBITS=15,n.Z_DEFAULT_WINDOWBITS=15,n.Z_MIN_CHUNK=64,n.Z_MAX_CHUNK=1/0,n.Z_DEFAULT_CHUNK=16384,n.Z_MIN_MEMLEVEL=1,n.Z_MAX_MEMLEVEL=9,n.Z_DEFAULT_MEMLEVEL=8,n.Z_MIN_LEVEL=-1,n.Z_MAX_LEVEL=9,n.Z_DEFAULT_LEVEL=n.Z_DEFAULT_COMPRESSION;for(var p=Object.keys(n),l=0;l=c?o=new RangeError(u):t=i.concat(a,n),a=[],e.close(),r(o,t)}e.on("error",function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)}),e.on("end",s),e.end(t),o()}function v(e,t){if("string"==typeof t&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function y(e){if(!(this instanceof y))return new y(e);A.call(this,e,n.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);A.call(this,e,n.INFLATE)}function k(e){if(!(this instanceof k))return new k(e);A.call(this,e,n.GZIP)}function _(e){if(!(this instanceof _))return new _(e);A.call(this,e,n.GUNZIP)}function x(e){if(!(this instanceof x))return new x(e);A.call(this,e,n.DEFLATERAW)}function j(e){if(!(this instanceof j))return new j(e);A.call(this,e,n.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);A.call(this,e,n.UNZIP)}function E(e){return e===n.Z_NO_FLUSH||e===n.Z_PARTIAL_FLUSH||e===n.Z_SYNC_FLUSH||e===n.Z_FULL_FLUSH||e===n.Z_FINISH||e===n.Z_BLOCK}function A(e,t){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||r.Z_DEFAULT_CHUNK,a.call(this,e),e.flush&&!E(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!E(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||n.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:n.Z_FINISH,e.chunkSize&&(e.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=r.Z_FILTERED&&e.strategy!=r.Z_HUFFMAN_ONLY&&e.strategy!=r.Z_RLE&&e.strategy!=r.Z_FIXED&&e.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!i.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new n.Zlib(t);var s=this;this._hadError=!1,this._handle.onerror=function(e,t){F(s),s._hadError=!0;var i=new Error(e);i.errno=t,i.code=r.codes[t],s.emit("error",i)};var c=r.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(c=e.level);var u=r.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||r.Z_DEFAULT_WINDOWBITS,c,e.memLevel||r.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=c,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function F(e,r){r&&t.nextTick(r),e._handle&&(e._handle.close(),e._handle=null)}function P(e){e.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),r.Deflate=y,r.Inflate=w,r.Gzip=k,r.Gunzip=_,r.DeflateRaw=x,r.InflateRaw=j,r.Unzip=S,r.createDeflate=function(e){return new y(e)},r.createInflate=function(e){return new w(e)},r.createDeflateRaw=function(e){return new x(e)},r.createInflateRaw=function(e){return new j(e)},r.createGzip=function(e){return new k(e)},r.createGunzip=function(e){return new _(e)},r.createUnzip=function(e){return new S(e)},r.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new y(t),e,r)},r.deflateSync=function(e,t){return v(new y(t),e)},r.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new k(t),e,r)},r.gzipSync=function(e,t){return v(new k(t),e)},r.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new x(t),e,r)},r.deflateRawSync=function(e,t){return v(new x(t),e)},r.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new S(t),e,r)},r.unzipSync=function(e,t){return v(new S(t),e)},r.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new w(t),e,r)},r.inflateSync=function(e,t){return v(new w(t),e)},r.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new _(t),e,r)},r.gunzipSync=function(e,t){return v(new _(t),e)},r.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new j(t),e,r)},r.inflateRawSync=function(e,t){return v(new j(t),e)},o.inherits(A,a),A.prototype.params=function(e,i,a){if(er.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(i!=r.Z_FILTERED&&i!=r.Z_HUFFMAN_ONLY&&i!=r.Z_RLE&&i!=r.Z_FIXED&&i!=r.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+i);if(this._level!==e||this._strategy!==i){var o=this;this.flush(n.Z_SYNC_FLUSH,function(){s(o._handle,"zlib binding closed"),o._handle.params(e,i),o._hadError||(o._level=e,o._strategy=i,a&&a())})}else t.nextTick(a)},A.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},A.prototype._flush=function(e){this._transform(i.alloc(0),"",e)},A.prototype.flush=function(e,r){var a=this,o=this._writableState;("function"==typeof e||void 0===e&&!r)&&(r=e,e=n.Z_FULL_FLUSH),o.ended?r&&t.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",function(){return a.flush(e,r)}):(this._flushFlag=e,this.write(i.alloc(0),"",r))},A.prototype.close=function(e){F(this,e),t.nextTick(P,this)},A.prototype._transform=function(e,t,r){var a,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||i.isBuffer(e)?this._handle?(s?a=this._finishFlushFlag:(a=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||n.Z_NO_FLUSH)),void this._processChunk(e,a,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},A.prototype._processChunk=function(e,t,r){var a=e&&e.length,n=this._chunkSize-this._offset,o=0,p=this,l="function"==typeof r;if(!l){var f,h=[],d=0;this.on("error",function(e){f=e}),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,a,this._buffer,this._offset,n)}while(!this._hadError&&v(m[0],m[1]));if(this._hadError)throw f;if(d>=c)throw F(this),new RangeError(u);var g=i.concat(h,d);return F(this),g}s(this._handle,"zlib binding closed");var b=this._handle.write(t,e,o,a,this._buffer,this._offset,n);function v(c,u){if(this&&(this.buffer=null,this.callback=null),!p._hadError){var f=n-u;if(s(f>=0,"have should not go down"),f>0){var m=p._buffer.slice(p._offset,p._offset+f);p._offset+=f,l?p.push(m):(h.push(m),d+=m.length)}if((0===u||p._offset>=p._chunkSize)&&(n=p._chunkSize,p._offset=0,p._buffer=i.allocUnsafe(p._chunkSize)),0===u){if(o+=a-c,a=c,!l)return!0;var g=p._handle.write(t,e,o,a,p._buffer,p._offset,p._chunkSize);return g.callback=v,void(g.buffer=e)}if(!l)return!1;r()}}b.buffer=e,b.callback=v},o.inherits(y,A),o.inherits(w,A),o.inherits(k,A),o.inherits(_,A),o.inherits(x,A),o.inherits(j,A),o.inherits(S,A)}).call(this,e("_process"))},{"./binding":105,_process:263,assert:65,buffer:110,stream:350,util:388}],107:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],108:[function(e,t,r){(function(e){!function(i){var a="object"==typeof r&&r&&!r.nodeType&&r,n="object"==typeof t&&t&&!t.nodeType&&t,o="object"==typeof e&&e;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,c,u=2147483647,p=36,l=1,f=26,h=38,d=700,m=72,g=128,b="-",v=/^xn--/,y=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=p-l,x=Math.floor,j=String.fromCharCode;function S(e){throw new RangeError(k[e])}function E(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function A(e,t){var r=e.split("@"),i="";return r.length>1&&(i=r[0]+"@",e=r[1]),i+E((e=e.replace(w,".")).split("."),t).join(".")}function F(e){for(var t,r,i=[],a=0,n=e.length;a=55296&&t<=56319&&a65535&&(t+=j((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function z(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function C(e,t,r){var i=0;for(e=r?x(e/d):e>>1,e+=x(e/t);e>_*f>>1;i+=p)e=x(e/_);return x(i+(_+1)*e/(e+h))}function O(e){var t,r,i,a,n,o,s,c,h,d,v,y=[],w=e.length,k=0,_=g,j=m;for((r=e.lastIndexOf(b))<0&&(r=0),i=0;i=128&&S("not-basic"),y.push(e.charCodeAt(i));for(a=r>0?r+1:0;a=w&&S("invalid-input"),((c=(v=e.charCodeAt(a++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:p)>=p||c>x((u-k)/o))&&S("overflow"),k+=c*o,!(c<(h=s<=j?l:s>=j+f?f:s-j));s+=p)o>x(u/(d=p-h))&&S("overflow"),o*=d;j=C(k-n,t=y.length+1,0==n),x(k/t)>u-_&&S("overflow"),_+=x(k/t),k%=t,y.splice(k++,0,_)}return P(y)}function T(e){var t,r,i,a,n,o,s,c,h,d,v,y,w,k,_,E=[];for(y=(e=F(e)).length,t=g,r=0,n=m,o=0;o=t&&vx((u-r)/(w=i+1))&&S("overflow"),r+=(s-t)*w,t=s,o=0;ou&&S("overflow"),v==t){for(c=r,h=p;!(c<(d=h<=n?l:h>=n+f?f:h-n));h+=p)_=c-d,k=p-d,E.push(j(z(d+_%k,0))),c=x(_/k);E.push(j(z(c,0))),n=C(r,w,i==a),r=0,++i}++r,++t}return E.join("")}if(s={version:"1.4.1",ucs2:{decode:F,encode:P},decode:O,encode:T,toASCII:function(e){return A(e,function(e){return y.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return A(e,function(e){return v.test(e)?O(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return s});else if(a&&n)if(t.exports==a)n.exports=s;else for(c in s)s.hasOwnProperty(c)&&(a[c]=s[c]);else i.punycode=s}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],109:[function(e,t,r){(function(e){t.exports=function(t,r){for(var i=Math.min(t.length,r.length),a=new e(i),n=0;no)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,t.prototype),r}function t(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return c(e,t,r)}function c(e,r,i){if("string"==typeof e)return function(e,r){"string"==typeof r&&""!==r||(r="utf8");if(!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var i=0|h(e,r),a=s(i),n=a.write(e,r);n!==i&&(a=a.slice(0,n));return a}(e,r);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return function(e,r,i){if(r<0||e.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function h(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===i)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(e).length;default:if(n)return a?-1:R(e).length;r=(""+r).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,r,i,a,n){if(0===e.length)return-1;if("string"==typeof i?(a=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),L(i=+i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof r&&(r=t.from(r,a)),t.isBuffer(r))return 0===r.length?-1:g(e,r,i,a,n);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,r,i):Uint8Array.prototype.lastIndexOf.call(e,r,i):g(e,[r],i,a,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,a){var n,o=1,s=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var p=-1;for(n=r;ns&&(r=s-c),n=r;n>=0;n--){for(var l=!0,f=0;fa&&(i=a):i=a;var n=t.length;i>n/2&&(i=n/2);for(var o=0;o>8,a=r%256,n.push(a),n.push(i);return n}(t,e.length-r),e,r,i)}function x(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function j(e,t,r){r=Math.min(e.length,r);for(var i=[],a=t;a239?4:u>223?3:u>191?2:1;if(a+l<=r)switch(l){case 1:u<128&&(p=u);break;case 2:128==(192&(n=e[a+1]))&&(c=(31&u)<<6|63&n)>127&&(p=c);break;case 3:n=e[a+1],o=e[a+2],128==(192&n)&&128==(192&o)&&(c=(15&u)<<12|(63&n)<<6|63&o)>2047&&(c<55296||c>57343)&&(p=c);break;case 4:n=e[a+1],o=e[a+2],s=e[a+3],128==(192&n)&&128==(192&o)&&128==(192&s)&&(c=(15&u)<<18|(63&n)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(p=c)}null===p?(p=65533,l=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|1023&p),i.push(p),a+=l}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return j(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},n&&(t.prototype[n]=t.prototype.inspect),t.prototype.compare=function(e,r,i,a,n){if(D(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=0),void 0===i&&(i=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),r<0||i>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&r>=i)return 0;if(a>=n)return-1;if(r>=i)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(a>>>=0),s=(i>>>=0)-(r>>>=0),c=Math.min(o,s),u=this.slice(a,n),p=e.slice(r,i),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function E(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;ai)&&(r=i);for(var a="",n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function C(e,r,i,a,n,o){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||re.length)throw new RangeError("Index out of range")}function O(e,t,r,i,a,n){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return t=+t,r>>>=0,n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return t=+t,r>>>=0,n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}t.prototype.slice=function(e,r){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(r=void 0===r?i:~~r)<0?(r+=i)<0&&(r=0):r>i&&(r=i),r>>=0,t>>>=0,r||z(e,t,this.length);for(var i=this[e],a=1,n=0;++n>>=0,t>>>=0,r||z(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},t.prototype.readUInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||z(e,t,this.length);for(var i=this[e],a=1,n=0;++n=(a*=128)&&(i-=Math.pow(2,8*t)),i},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||z(e,t,this.length);for(var i=t,a=1,n=this[e+--i];i>0&&(a*=256);)n+=this[e+--i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},t.prototype.readInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||z(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||z(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||z(e,4,this.length),a.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||z(e,4,this.length),a.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||z(e,8,this.length),a.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||z(e,8,this.length),a.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,i){(e=+e,t>>>=0,r>>>=0,i)||C(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,n=0;for(this[t]=255&e;++n>>=0,r>>>=0,i)||C(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,n=1;for(this[t+a]=255&e;--a>=0&&(n*=256);)this[t+a]=e/n&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*r-1);C(this,e,t,r,a-1,-a)}var n=0,o=1,s=0;for(this[t]=255&e;++n>0)-s&255;return t+r},t.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*r-1);C(this,e,t,r,a-1,-a)}var n=r-1,o=1,s=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o>>0)-s&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},t.prototype.copy=function(e,r,i,a){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),a||0===a||(a=this.length),r>=e.length&&(r=e.length),r||(r=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-r=0;--o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,a),r);return n},t.prototype.fill=function(e,r,i,a){if("string"==typeof e){if("string"==typeof r?(a=r,r=0,i=this.length):"string"==typeof i&&(a=i,i=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!t.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===e.length){var n=e.charCodeAt(0);("utf8"===a&&n<128||"latin1"===a)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(r<0||this.length>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(o=r;o55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&n.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&n.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function q(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function L(e){return e!=e}var N=function(){for(var e=new Array(256),t=0;t<16;++t)for(var r=16*t,i=0;i<16;++i)e[r+i]="0123456789abcdef"[t]+"0123456789abcdef"[i];return e}()}).call(this,e("buffer").Buffer)},{"base64-js":72,buffer:110,ieee754:204}],111:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],112:[function(e,t,r){function i(e){this.dict=e||{}}i.prototype.set=function(e,t,r){if("object"!=typeof e){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var a in e)this.set(a,e[a],t)},i.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.lengths?t=e(t):t.length=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(a())}).call(this,e("_process"))},{"./debug":123,_process:263}],123:[function(e,t,r){var i;function a(e){function t(){if(t.enabled){var e=t,a=+new Date,n=a-(i||a);e.diff=n,e.prev=i,e.curr=a,i=a;for(var o=new Array(arguments.length),s=0;s0;i--)t+=this._buffer(e,t),r+=this._flushBuffer(a,r);return t+=this._buffer(e,t),a},a.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},a.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];r=o.r28shl(r,s),a=o.r28shl(a,s),o.pc2(r,a,e.keys,n)}},u.prototype._update=function(e,t,r,i){var a=this._desState,n=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(n,s,a.tmp,0),n=a.tmp[0],s=a.tmp[1],"encrypt"===this.type?this._encrypt(a,n,s,a.tmp,0):this._decrypt(a,n,s,a.tmp,0),n=a.tmp[0],s=a.tmp[1],o.writeUInt32BE(r,n,i),o.writeUInt32BE(r,s,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,n=f}o.rip(s,n,i,a)},u.prototype._decrypt=function(e,t,r,i,a){for(var n=r,s=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],p=e.keys[c+1];o.expand(n,e.tmp,0),u^=e.tmp[0],p^=e.tmp[1];var l=o.substitute(u,p),f=n;n=(s^o.permute(l))>>>0,s=f}o.rip(n,s,i,a)}},{"../des":125,inherits:205,"minimalistic-assert":233}],129:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),a=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){i.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),a=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:a}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:a}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}a(u,o),t.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var a=this._edeState;a.ciphers[0]._update(e,t,r,i),a.ciphers[1]._update(r,i,r,i),a.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":125,inherits:205,"minimalistic-assert":233}],130:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var a=0,n=0,o=6;o>=0;o-=2){for(var s=0;s<=24;s+=8)a<<=1,a|=t>>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>>s+o&1}for(o=6;o>=0;o-=2){for(s=1;s<=25;s+=8)n<<=1,n|=t>>>s+o&1;for(s=1;s<=25;s+=8)n<<=1,n|=e>>>s+o&1}r[i+0]=a>>>0,r[i+1]=n>>>0},r.rip=function(e,t,r,i){for(var a=0,n=0,o=0;o<4;o++)for(var s=24;s>=0;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;s>=0;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;r[i+0]=a>>>0,r[i+1]=n>>>0},r.pc1=function(e,t,r,i){for(var a=0,n=0,o=7;o>=5;o--){for(var s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1;r[i+0]=a>>>0,r[i+1]=n>>>0},r.r28shl=function(e,t){return e<>>28-t};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,a){for(var n=0,o=0,s=i.length>>>1,c=0;c>>i[c]&1;for(c=s;c>>i[c]&1;r[a+0]=n>>>0,r[a+1]=o>>>0},r.expand=function(e,t,r){var i=0,a=0;i=(1&e)<<5|e>>>27;for(var n=23;n>=15;n-=4)i<<=6,i|=e>>>n&63;for(n=11;n>=3;n-=4)a|=e>>>n&63,a<<=6;a|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=a>>>0};var a=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=a[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=a[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>n[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;r.mod(p).cmp(l);)r.iadd(h)}else for(;r.mod(n).cmp(f);)r.iadd(h);if(g(d=r.shrn(1))&&g(r)&&b(d)&&b(r)&&o.test(d)&&o.test(r))return r}}},{"bn.js":75,"miller-rabin":229,randombytes:280}],134:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],135:[function(e,t,r){var i=e("crypto"),a=e("jsbn").BigInteger,n=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function o(e,t){return e.length>=t?e:o("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var s,c=e(),u=c.getN(),p=Math.floor(u.bitLength()/8);if(t)if(r){e=c.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=p)return!1;s=new a(t.toString("hex"),16)}else{var l=u.subtract(a.ONE),f=new a(i.randomBytes(u.bitLength()));s=f.mod(l).add(a.ONE),this.P=c.getG().multiply(s)}this.P&&(this.PublicKey=n.from(c.getCurve().encodeCompressedPointHex(this.P),"hex")),s&&(this.PrivateKey=n.from(o(s.toString(16),2*p),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(s);return n.from(o(t.getX().toBigInteger().toString(16),2*p),"hex")})}},{"./lib/ec.js":136,"./lib/sec.js":137,crypto:121,jsbn:210,"safer-buffer":315}],136:[function(e,t,r){var i=e("jsbn").BigInteger,a=i.prototype.Barrett;function n(e,t){this.x=t,this.q=e}function o(e,t,r,a){this.curve=e,this.x=t,this.y=r,this.z=null==a?i.ONE:a,this.zinv=null}function s(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new o(this,null,null),this.reducer=new a(this.q)}n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},n.prototype.toBigInteger=function(){return this.x},n.prototype.negate=function(){return new n(this.q,this.x.negate().mod(this.q))},n.prototype.add=function(e){return new n(this.q,this.x.add(e.toBigInteger()).mod(this.q))},n.prototype.subtract=function(e){return new n(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},n.prototype.multiply=function(e){return new n(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},n.prototype.square=function(){return new n(this.q,this.x.square().mod(this.q))},n.prototype.divide=function(e){return new n(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},o.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},o.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},o.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(i.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(i.ZERO))},o.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(i.ZERO)&&!this.y.toBigInteger().equals(i.ZERO)},o.prototype.negate=function(){return new o(this.curve,this.x,this.y.negate(),this.z)},o.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(i.ZERO.equals(r))return i.ZERO.equals(t)?this.twice():this.curve.getInfinity();var a=new i("3"),n=this.x.toBigInteger(),s=this.y.toBigInteger(),c=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),u=c.multiply(r),p=n.multiply(c),l=t.square().multiply(this.z),f=l.subtract(p.shiftLeft(1)).multiply(e.z).subtract(u).multiply(r).mod(this.curve.q),h=p.multiply(a).multiply(t).subtract(s.multiply(u)).subtract(l.multiply(t)).multiply(e.z).add(t.multiply(u)).mod(this.curve.q),d=u.multiply(this.z).multiply(e.z).mod(this.curve.q);return new o(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(h),d)},o.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new i("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),a=r.multiply(this.z),n=a.multiply(r).mod(this.curve.q),s=this.curve.a.toBigInteger(),c=t.square().multiply(e);i.ZERO.equals(s)||(c=c.add(this.z.square().multiply(s)));var u=(c=c.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(a).mod(this.curve.q),p=c.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(c.square().multiply(c)).mod(this.curve.q),l=a.square().multiply(a).shiftLeft(3).mod(this.curve.q);return new o(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(p),l)},o.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,a=r.multiply(new i("3")),n=this.negate(),o=this;for(t=a.bitLength()-2;t>0;--t){o=o.twice();var s=a.testBit(t);s!=r.testBit(t)&&(o=o.add(s?this:n))}return o},o.prototype.multiplyTwo=function(e,t,r){var i;i=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var a=this.curve.getInfinity(),n=this.add(t);i>=0;)a=a.twice(),e.testBit(i)?a=r.testBit(i)?a.add(n):a.add(this):r.testBit(i)&&(a=a.add(t)),--i;return a},s.prototype.getQ=function(){return this.q},s.prototype.getA=function(){return this.a},s.prototype.getB=function(){return this.b},s.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},s.prototype.getInfinity=function(){return this.infinity},s.prototype.fromBigInteger=function(e){return new n(this.q,e)},s.prototype.reduce=function(e){this.reducer.reduce(e)},s.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.length128&&(-1==this.q.shiftRight(e-64).intValue()&&(this.r=i.ONE.shiftLeft(e).subtract(this.q)));return this.r},n.prototype.modMult=function(e,t){return this.modReduce(e.multiply(t))},n.prototype.modReduce=function(e){if(null!=this.getR()){for(var t=q.bitLength();e.bitLength()>t+1;){var r=e.shiftRight(t),a=e.subtract(r.shiftLeft(t));this.getR().equals(i.ONE)||(r=r.multiply(this.getR())),e=r.add(a)}for(;e.compareTo(q)>=0;)e=e.subtract(q)}else e=e.mod(q);return e},n.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new n(this.q,this.x.modPow(this.q.shiftRight(2).add(i.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(i.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(i.ONE))return null;var a,o,s=t.shiftRight(2).shiftLeft(1).add(i.ONE),c=this.x,u=modDouble(modDouble(c));do{var p;do{p=new i(this.q.bitLength(),new SecureRandom)}while(p.compareTo(this.q)>=0||!p.multiply(p).subtract(u).modPow(r,this.q).equals(t));var l=this.lucasSequence(p,c,s);if(a=l[0],o=l[1],this.modMult(o,o).equals(u))return o.testBit(0)&&(o=o.add(q)),o=o.shiftRight(1),new n(q,o)}while(a.equals(i.ONE)||a.equals(t));return null},n.prototype.lucasSequence=function(e,t,r){for(var a=r.bitLength(),n=r.getLowestSetBit(),o=i.ONE,s=i.TWO,c=e,u=i.ONE,p=i.ONE,l=a-1;l>=n+1;--l)u=this.modMult(u,p),r.testBit(l)?(p=this.modMult(u,t),o=this.modMult(o,c),s=this.modReduce(c.multiply(s).subtract(e.multiply(u))),c=this.modReduce(c.multiply(c).subtract(p.shiftLeft(1)))):(p=u,o=this.modReduce(o.multiply(s).subtract(u)),c=this.modReduce(c.multiply(s).subtract(e.multiply(u))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1))));u=this.modMult(u,p),p=this.modMult(u,t),o=this.modReduce(o.multiply(s).subtract(u)),s=this.modReduce(c.multiply(s).subtract(e.multiply(u))),u=this.modMult(u,p);for(l=1;l<=n;++l)o=this.modMult(o,s),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1))),u=this.modMult(u,u);return[o,s]};r={ECCurveFp:s,ECPointFp:o,ECFieldElementFp:n};t.exports=r},{jsbn:210}],137:[function(e,t,r){var i=e("jsbn").BigInteger,a=e("./ec.js").ECCurveFp;function n(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function o(e){return new i(e,16)}function s(){var e=o("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=o("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=o("E87579C11079F43DD824993C2CEE5ED3"),s=o("FFFFFFFE0000000075A30D1B9038A115"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");return new n(u,p,s,c)}function c(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=i.ZERO,r=o("7"),s=o("0100000000000000000001B8FA16DFAB9ACA16B6B3"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");return new n(u,p,s,c)}function u(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=o("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),s=o("0100000000000000000001F4C8F927AED3CA752257"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");return new n(u,p,s,c)}function p(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=i.ZERO,r=o("3"),s=o("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");return new n(u,p,s,c)}function l(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=o("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),s=o("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");return new n(u,p,s,c)}function f(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=o("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),s=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");return new n(u,p,s,c)}function h(){var e=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=o("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),s=o("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");return new n(u,p,s,c)}n.prototype.getCurve=function(){return this.curve},n.prototype.getG=function(){return this.g},n.prototype.getN=function(){return this.n},n.prototype.getH=function(){return this.h},t.exports={secp128r1:s,secp160k1:c,secp160r1:u,secp192k1:p,secp192r1:l,secp224r1:f,secp256r1:h}},{"./ec.js":136,jsbn:210}],138:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":153,"./elliptic/curve":141,"./elliptic/curves":144,"./elliptic/ec":145,"./elliptic/eddsa":148,"./elliptic/utils":152,brorand:76}],139:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("../utils"),n=a.getNAF,o=a.getJSF,s=a.assert;function c(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),i=n(t,1),a=(1<=c;t--)u=(u<<1)+i[t];o.push(u)}for(var p=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=a;f>0;f--){for(c=0;c=0;u--){for(t=0;u>=0&&0===o[u];u--)t++;if(u>=0&&t++,c=c.dblp(t),u<0)break;var p=o[u];s(0!==p),c="affine"===e.type?p>0?c.mixedAdd(a[p-1>>1]):c.mixedAdd(a[-p-1>>1].neg()):p>0?c.add(a[p-1>>1]):c.add(a[-p-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,i,a){for(var s=this._wnafT1,c=this._wnafT2,u=this._wnafT3,p=0,l=0;l=1;l-=2){var h=l-1,d=l;if(1===s[h]&&1===s[d]){var m=[t[h],null,null,t[d]];0===t[h].y.cmp(t[d].y)?(m[1]=t[h].add(t[d]),m[2]=t[h].toJ().mixedAdd(t[d].neg())):0===t[h].y.cmp(t[d].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[d]),m[2]=t[h].add(t[d].neg())):(m[1]=t[h].toJ().mixedAdd(t[d]),m[2]=t[h].toJ().mixedAdd(t[d].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=o(r[h],r[d]);p=Math.max(b[0].length,p),u[h]=new Array(p),u[d]=new Array(p);for(var v=0;v=0;l--){for(var x=0;l>=0;){var j=!0;for(v=0;v=0&&x++,k=k.dblp(x),l<0)break;for(v=0;v0?S=c[v][E-1>>1]:E<0&&(S=c[v][-E-1>>1].neg()),k="affine"===S.type?k.mixedAdd(S):k.add(S))}}for(l=0;l=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,a=0;a":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),n=i.redAdd(t),o=n.redSub(r),s=i.redSub(t),c=a.redMul(o),u=n.redMul(s),p=a.redMul(s),l=o.redMul(n);return this.curve.point(c,u,l,p)},u.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),n=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(a)).redAdd(n);if(this.zOne)e=i.redSub(a).redSub(n).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(n)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(a).redISub(n).redMul(c),t=o.redMul(u.redSub(n)),r=o.redMul(c)}}else{var u=a.redAdd(n);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(a.redISub(n)),r=u.redMul(c)}return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),n=r.redSub(t),o=a.redSub(i),s=a.redAdd(i),c=r.redAdd(t),u=n.redMul(o),p=s.redMul(c),l=n.redMul(c),f=o.redMul(s);return this.curve.point(u,p,f,l)},u.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),a=i.redSqr(),n=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(n).redMul(o),c=a.redSub(s),u=a.redAdd(s),p=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(o),l=i.redMul(c).redMul(p);return this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(n))),r=c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(n)),r=this.curve._mulC(c).redMul(u)),this.curve.point(l,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},{"../utils":152,"./base":139,"bn.js":75,inherits:205}],141:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":139,"./edwards":140,"./mont":142,"./short":143}],142:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("inherits"),n=e("./base"),o=e("../utils");function s(e){n.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){n.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,n),t.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},a(c,n.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),a=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,a)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),n=e.x.redSub(e.z).redMul(r),o=a.redMul(i),s=t.z.redMul(n.redAdd(o).redSqr()),c=t.x.redMul(n.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var n=a.length-1;n>=0;n--)0===a[n]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":152,"./base":139,"bn.js":75,inherits:205}],143:[function(e,t,r){"use strict";var i=e("../utils"),a=e("bn.js"),n=e("inherits"),o=e("./base"),s=i.assert;function c(e){o.call(this,"short",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(t,16),this.y=new a(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function p(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(t,16),this.y=new a(r,16),this.z=new a(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}n(c,o),t.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new a(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new a(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new a(e.a,16),b:new a(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:a.mont(e),r=new a(2).toRed(t).redInvm(),i=r.redNeg(),n=new a(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,s,c,u,p,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new a(1),m=new a(0),g=new a(0),b=new a(1),v=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),p=g.sub(y.mul(d));var w=b.sub(y.mul(m));if(!i&&u.cmp(l)<0)t=c.neg(),r=d,i=u.neg(),n=p;else if(i&&2==++v)break;c=u,h=f,f=u,g=d,d=p,b=m,m=w}o=u.neg(),s=p;var k=i.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(k)>=0&&(o=t,s=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:i,b:n},{a:o,b:s}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],a=i.b.mul(e).divRound(this.n),n=r.b.neg().mul(e).divRound(this.n),o=a.mul(r.a),s=n.mul(i.a),c=a.mul(r.b),u=n.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(a).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,a=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),a=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),n=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var i=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)},u.prototype.jmulAdd=function(e,t,r){var i=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(p,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new p(this,e,t,r)},p.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},p.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},p.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),a=e.x.redMul(r),n=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(a),c=n.redSub(o);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),p=u.redMul(s),l=i.redMul(u),f=c.redSqr().redIAdd(p).redISub(l).redISub(l),h=c.redMul(l.redISub(f)).redISub(n.redMul(p)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,h,d)},p.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),a=this.y,n=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=a.redSub(n);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),p=r.redMul(c),l=s.redSqr().redIAdd(u).redISub(p).redISub(p),f=s.redMul(p.redISub(l)).redISub(a.redMul(u)),h=this.z.redMul(o);return this.curve.jpoint(l,f,h)},p.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(a),0===this.x.cmp(r))return!0}},p.prototype.inspect=function(){return this.isInfinity()?"":""},p.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":152,"./base":139,"bn.js":75,inherits:205}],144:[function(e,t,r){"use strict";var i,a=r,n=e("hash.js"),o=e("./curve"),s=e("./utils").assert;function c(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:r}),r}})}a.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"./curve":141,"./precomputed/secp256k1":151,"./utils":152,"hash.js":185}],145:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("hmac-drbg"),n=e("../utils"),o=e("../curves"),s=e("brorand"),c=n.assert,u=e("./key"),p=e("./signature");function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(c(o.hasOwnProperty(e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}t.exports=l,l.prototype.keyPair=function(e){return new u(this,e)},l.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new a({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var o=new i(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),c=e.toArray("be",o),u=new a({hash:this.hash,entropy:s,nonce:c,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new i(1)),f=0;;f++){var h=n.k?n.k(f):new i(u.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var d=this.g.mul(h);if(!d.isInfinity()){var m=d.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var b=h.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var v=(d.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),v^=1),new p({r:g,s:b,recoveryParam:v})}}}}}},l.prototype.verify=function(e,t,r,a){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,a);var n=(t=new p(t,"hex")).r,o=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,c=o.invm(this.n),u=c.mul(e).umod(this.n),l=c.mul(n).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&s.eqXToP(n):!(s=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(n)},l.prototype.recoverPubKey=function(e,t,r,a){c((3&r)===r,"The recovery param is more than two bits"),t=new p(t,a);var n=this.n,o=new i(e),s=t.r,u=t.s,l=1&r,f=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=f?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(n),d=n.sub(o).mul(h).umod(n),m=u.mul(h).umod(n);return this.g.mulAdd(d,s,m)},l.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new p(t,i)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var n;try{n=this.recoverPubKey(e,t,a)}catch(e){continue}if(n.eq(r))return a}throw new Error("Unable to find valid recovery factor")}},{"../curves":144,"../utils":152,"./key":146,"./signature":147,"bn.js":75,brorand:76,"hmac-drbg":197}],146:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("../utils").assert;function n(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}t.exports=n,n.fromPublic=function(e,t,r){return t instanceof n?t:new n(e,{pub:t,pubEnc:r})},n.fromPrivate=function(e,t,r){return t instanceof n?t:new n(e,{priv:t,privEnc:r})},n.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},n.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?a(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||a(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},n.prototype.derive=function(e){return e.mul(this.priv).getX()},n.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},n.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},n.prototype.inspect=function(){return""}},{"../utils":152,"bn.js":75}],147:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("../utils"),n=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(n(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,a=0,n=0,o=t.place;n>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}t.exports=o,o.prototype._importDER=function(e,t){e=a.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;if(c(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=c(e,r),o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var u=c(e,r);if(e.length!==u+r.place)return!1;var p=e.slice(r.place,u+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===p[0]&&128&p[1]&&(p=p.slice(1)),this.r=new i(o),this.s=new i(p),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),o=[48];return p(o,n.length),o=o.concat(n),a.encode(o,e)}},{"../utils":152,"bn.js":75}],148:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("../curves"),n=e("../utils"),o=n.assert,s=n.parseBytes,c=e("./key"),u=e("./signature");function p(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof p))return new p(e);e=a[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}t.exports=p,p.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),a=this.g.mul(i),n=this.encodePoint(a),o=this.hashInt(n,r.pubBytes(),e).mul(r.priv()),c=i.add(o).umod(this.curve.n);return this.makeSignature({R:a,S:c,Rencoded:n})},p.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),a=this.hashInt(t.Rencoded(),i.pubBytes(),e),n=this.g.mul(t.S());return t.R().add(i.pub().mul(a)).eq(n)},p.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=0;){var n;if(a.isOdd()){var o=a.andln(i-1);n=o>(i>>1)-1?(i>>1)-o:o,a.isubn(n)}else n=0;r.push(n);for(var s=0!==a.cmpn(0)&&0===a.andln(i-1)?t+1:1,c=1;c0||t.cmpn(-a)>0;){var n,o,s,c=e.andln(3)+i&3,u=t.andln(3)+a&3;3===c&&(c=-1),3===u&&(u=-1),n=0==(1&c)?0:3!=(s=e.andln(7)+i&7)&&5!==s||2!==u?c:-c,r[0].push(n),o=0==(1&u)?0:3!=(s=t.andln(7)+a&7)&&5!==s||2!==c?u:-u,r[1].push(o),2*i===n+1&&(i=1-i),2*a===o+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new a(e,"hex","le")}},{"bn.js":75,"minimalistic-assert":233,"minimalistic-crypto-utils":234}],153:[function(e,t,r){t.exports={_from:"elliptic@^6.0.0",_id:"elliptic@6.5.1",_inBundle:!1,_integrity:"sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.0.0",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.0.0",saveSpec:null,fetchSpec:"^6.0.0"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz",_shasum:"c380f5f909bf1b9b4428d028cd18d3b0efd6b52b",_spec:"elliptic@^6.0.0",_where:"W:\\projects\\git\\node-quickbase\\node_modules\\browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^3.0.4",grunt:"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.6.0",mocha:"^6.1.4"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.1"}},{}],154:[function(e,t,r){var i=Object.create||function(e){var t=function(){};return t.prototype=e,new t},a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},n=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=i(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var s,c=10;try{var u={};Object.defineProperty&&Object.defineProperty(u,"x",{value:0}),s=0===u.x}catch(e){s=!1}function p(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,a){var n,o,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]):(o=e._events=i(null),e._eventsCount=0),s){if("function"==typeof s?s=o[t]=a?[r,s]:[s,r]:a?s.unshift(r):s.push(r),!s.warned&&(n=p(e))&&n>0&&s.length>n){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",c.name,c.message)}}else s=o[t]=r,++e._eventsCount;return e}function f(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var c=new Error('Unhandled "error" event. ('+t+")");throw c.context=t,c}if(!(r=o[e]))return!1;var u="function"==typeof r;switch(i=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var i=e.length,a=g(e,i),n=0;n=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(e,t){for(var r=t,i=r+1,a=e.length;i=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],155:[function(e,t,r){var i=e("safe-buffer").Buffer,a=e("md5.js");t.exports=function(e,t,r,n){if(i.isBuffer(e)||(e=i.from(e,"binary")),t&&(i.isBuffer(t)||(t=i.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=r/8,s=i.alloc(o),c=i.alloc(n||0),u=i.alloc(0);o>0||n>0;){var p=new a;p.update(u),p.update(e),t&&p.update(t),u=p.digest();var l=0;if(o>0){var f=s.length-o;l=Math.min(o,u.length),u.copy(s,f,0,l),o-=l}if(l0){var h=c.length-n,d=Math.min(n,u.length-l);u.copy(c,h,l,l+d),n-=d}}return u.fill(0),{key:s,iv:c}}},{"md5.js":228,"safe-buffer":314}],156:[function(e,t,r){"use strict";var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},c=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,r=i.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||i.call(e,t)},u=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},p=function(e,t){if("__proto__"===t){if(!i.call(e,t))return;if(o)return o(e,t).value}return e[t]};t.exports=function e(){var t,r,i,a,n,o,l=arguments[0],f=1,h=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},f=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});f0)throw new Error("non-zero precision not supported");switch(t.match(/-/)&&(u=!0),t.match(/0/)&&(p="0"),t.match(/\+/)&&(l=!0),o){case"s":if(null==f)throw new Error("argument "+v+": attempted to print undefined or null as a string");b+=s(p,r,u,f.toString());break;case"d":f=Math.floor(f);case"f":b+=(l=l&&f>0?"+":"")+s(p,r,u,f.toString());break;case"x":b+=s(p,r,u,f.toString(16));break;case"j":0===r&&(r=10),b+=a.inspect(f,!1,r);break;case"r":b+=c(f);break;default:throw new Error("unsupported conversion: "+o)}}else b+="%";return b+=e}function o(e){var t=Array.prototype.slice.call(arguments,1);return e.write(n.apply(this,t))}function s(e,t,r,i){for(var a=i;a.length0&&!e.useChunkedEncodingByDefault){var n=this.freeSockets[i].pop();n.removeListener("error",n._onIdleError),delete n._onIdleError,e._reusedSocket=!0,e.onSocket(n)}else this.addRequestNoreuse(e,t,r)},u.prototype.removeSocket=function(e,t,r,i){var a;this.sockets[t]?-1!==(a=this.sockets[t].indexOf(e))&&this.sockets[t].splice(a,1):this.sockets[t]&&0===this.sockets[t].length&&(delete this.sockets[t],delete this.requests[t]);this.freeSockets[t]&&(-1!==(a=this.freeSockets[t].indexOf(e))&&(this.freeSockets[t].splice(a,1),0===this.freeSockets[t].length&&delete this.freeSockets[t]));this.requests[t]&&this.requests[t].length&&this.createSocket(t,r,i).emit("free")},i.inherits(p,u),p.prototype.createConnection=function(e,t,r){r="object"==typeof e?e:"object"==typeof t?t:"object"==typeof r?r:{};"number"==typeof e&&(r.port=e);"string"==typeof t&&(r.host=t);return o.connect(r)},p.prototype.addRequestNoreuse=s.prototype.addRequest},{http:351,https:203,net:107,tls:107,util:388}],161:[function(e,t,r){t.exports="object"==typeof self?self.FormData:window.FormData},{}],162:[function(e,t,r){(function(r){"use strict";var i=function(){function e(e,t){for(var r=0;r0&&(++this._nRequests,this._pending.shift().resolve()));var t=Date.now()-this.periodLength;this._times=this._times.filter(function(e){return e>=t}).sort(),this._times.length0&&(this._times.push(Date.now()),this._pending.shift().resolve()):(this._tick&&clearTimeout(this._tick),this._tick=setTimeout(function(){e._testTick()},this._times[0]-t))}},{key:"acquire",value:function(e){return a.using(this._acquire(),function(){return e?new a(e):a.resolve()})}},{key:"clear",value:function(){return this._pending.splice(0,this._pending.length)}},{key:"flush",value:function(){return a.map(this._pending.splice(0,this._pending.length),function(e){return e.resolve()})}}]),e}();void 0!==t&&t.exports?t.exports=n:"function"==typeof define&&define.amd&&define("Throttle",[],function(){return n}),void 0!==r&&"undefined"!=typeof window&&r===window&&(r.Throttle=n)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{bluebird:74}],163:[function(e,t,r){t.exports={$id:"afterRequest.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["lastAccess","eTag","hitCount"],properties:{expires:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},lastAccess:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},eTag:{type:"string"},hitCount:{type:"integer"},comment:{type:"string"}}}},{}],164:[function(e,t,r){t.exports={$id:"beforeRequest.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["lastAccess","eTag","hitCount"],properties:{expires:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},lastAccess:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},eTag:{type:"string"},hitCount:{type:"integer"},comment:{type:"string"}}}},{}],165:[function(e,t,r){t.exports={$id:"browser.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","version"],properties:{name:{type:"string"},version:{type:"string"},comment:{type:"string"}}}},{}],166:[function(e,t,r){t.exports={$id:"cache.json#",$schema:"http://json-schema.org/draft-06/schema#",properties:{beforeRequest:{oneOf:[{type:"null"},{$ref:"beforeRequest.json#"}]},afterRequest:{oneOf:[{type:"null"},{$ref:"afterRequest.json#"}]},comment:{type:"string"}}}},{}],167:[function(e,t,r){t.exports={$id:"content.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["size","mimeType"],properties:{size:{type:"integer"},compression:{type:"integer"},mimeType:{type:"string"},text:{type:"string"},encoding:{type:"string"},comment:{type:"string"}}}},{}],168:[function(e,t,r){t.exports={$id:"cookie.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},path:{type:"string"},domain:{type:"string"},expires:{type:["string","null"],format:"date-time"},httpOnly:{type:"boolean"},secure:{type:"boolean"},comment:{type:"string"}}}},{}],169:[function(e,t,r){t.exports={$id:"creator.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","version"],properties:{name:{type:"string"},version:{type:"string"},comment:{type:"string"}}}},{}],170:[function(e,t,r){t.exports={$id:"entry.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["startedDateTime","time","request","response","cache","timings"],properties:{pageref:{type:"string"},startedDateTime:{type:"string",format:"date-time",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},time:{type:"number",min:0},request:{$ref:"request.json#"},response:{$ref:"response.json#"},cache:{$ref:"cache.json#"},timings:{$ref:"timings.json#"},serverIPAddress:{type:"string",oneOf:[{format:"ipv4"},{format:"ipv6"}]},connection:{type:"string"},comment:{type:"string"}}}},{}],171:[function(e,t,r){t.exports={$id:"har.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["log"],properties:{log:{$ref:"log.json#"}}}},{}],172:[function(e,t,r){t.exports={$id:"header.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},comment:{type:"string"}}}},{}],173:[function(e,t,r){"use strict";t.exports={afterRequest:e("./afterRequest.json"),beforeRequest:e("./beforeRequest.json"),browser:e("./browser.json"),cache:e("./cache.json"),content:e("./content.json"),cookie:e("./cookie.json"),creator:e("./creator.json"),entry:e("./entry.json"),har:e("./har.json"),header:e("./header.json"),log:e("./log.json"),page:e("./page.json"),pageTimings:e("./pageTimings.json"),postData:e("./postData.json"),query:e("./query.json"),request:e("./request.json"),response:e("./response.json"),timings:e("./timings.json")}},{"./afterRequest.json":163,"./beforeRequest.json":164,"./browser.json":165,"./cache.json":166,"./content.json":167,"./cookie.json":168,"./creator.json":169,"./entry.json":170,"./har.json":171,"./header.json":172,"./log.json":174,"./page.json":175,"./pageTimings.json":176,"./postData.json":177,"./query.json":178,"./request.json":179,"./response.json":180,"./timings.json":181}],174:[function(e,t,r){t.exports={$id:"log.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["version","creator","entries"],properties:{version:{type:"string"},creator:{$ref:"creator.json#"},browser:{$ref:"browser.json#"},pages:{type:"array",items:{$ref:"page.json#"}},entries:{type:"array",items:{$ref:"entry.json#"}},comment:{type:"string"}}}},{}],175:[function(e,t,r){t.exports={$id:"page.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["startedDateTime","id","title","pageTimings"],properties:{startedDateTime:{type:"string",format:"date-time",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},id:{type:"string",unique:!0},title:{type:"string"},pageTimings:{$ref:"pageTimings.json#"},comment:{type:"string"}}}},{}],176:[function(e,t,r){t.exports={$id:"pageTimings.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",properties:{onContentLoad:{type:"number",min:-1},onLoad:{type:"number",min:-1},comment:{type:"string"}}}},{}],177:[function(e,t,r){t.exports={$id:"postData.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["mimeType"],properties:{mimeType:{type:"string"},text:{type:"string"},params:{type:"array",required:["name"],properties:{name:{type:"string"},value:{type:"string"},fileName:{type:"string"},contentType:{type:"string"},comment:{type:"string"}}},comment:{type:"string"}}}},{}],178:[function(e,t,r){t.exports={$id:"query.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},comment:{type:"string"}}}},{}],179:[function(e,t,r){t.exports={$id:"request.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["method","url","httpVersion","cookies","headers","queryString","headersSize","bodySize"],properties:{method:{type:"string"},url:{type:"string",format:"uri"},httpVersion:{type:"string"},cookies:{type:"array",items:{$ref:"cookie.json#"}},headers:{type:"array",items:{$ref:"header.json#"}},queryString:{type:"array",items:{$ref:"query.json#"}},postData:{$ref:"postData.json#"},headersSize:{type:"integer"},bodySize:{type:"integer"},comment:{type:"string"}}}},{}],180:[function(e,t,r){t.exports={$id:"response.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["status","statusText","httpVersion","cookies","headers","content","redirectURL","headersSize","bodySize"],properties:{status:{type:"integer"},statusText:{type:"string"},httpVersion:{type:"string"},cookies:{type:"array",items:{$ref:"cookie.json#"}},headers:{type:"array",items:{$ref:"header.json#"}},content:{$ref:"content.json#"},redirectURL:{type:"string"},headersSize:{type:"integer"},bodySize:{type:"integer"},comment:{type:"string"}}}},{}],181:[function(e,t,r){t.exports={$id:"timings.json#",$schema:"http://json-schema.org/draft-06/schema#",required:["send","wait","receive"],properties:{dns:{type:"number",min:-1},connect:{type:"number",min:-1},blocked:{type:"number",min:-1},send:{type:"number",min:-1},wait:{type:"number",min:-1},receive:{type:"number",min:-1},ssl:{type:"number",min:-1},comment:{type:"string"}}}},{}],182:[function(e,t,r){function i(e){this.name="HARError",this.message="validation failed",this.errors=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error("validation failed").stack}i.prototype=Error.prototype,t.exports=i},{}],183:[function(e,t,r){var i,a=e("ajv"),n=e("./error"),o=e("har-schema");function s(t,r){r=r||{};var s=(i=i||function(){var t=new a({allErrors:!0});return t.addMetaSchema(e("ajv/lib/refs/json-schema-draft-06.json")),t.addSchema(o),t}()).getSchema(t+".json");return new Promise(function(e,t){s(r)?e(r):t(new n(s.errors))})}r.afterRequest=function(e){return s("afterRequest",e)},r.beforeRequest=function(e){return s("beforeRequest",e)},r.browser=function(e){return s("browser",e)},r.cache=function(e){return s("cache",e)},r.content=function(e){return s("content",e)},r.cookie=function(e){return s("cookie",e)},r.creator=function(e){return s("creator",e)},r.entry=function(e){return s("entry",e)},r.har=function(e){return s("har",e)},r.header=function(e){return s("header",e)},r.log=function(e){return s("log",e)},r.page=function(e){return s("page",e)},r.pageTimings=function(e){return s("pageTimings",e)},r.postData=function(e){return s("postData",e)},r.query=function(e){return s("query",e)},r.request=function(e){return s("request",e)},r.response=function(e){return s("response",e)},r.timings=function(e){return s("timings",e)}},{"./error":182,ajv:1,"ajv/lib/refs/json-schema-draft-06.json":42,"har-schema":173}],184:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform;function n(e){a.call(this),this._block=i.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(n,a),n.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},n.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,t){if(function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(e)||(e=i.from(e,t));for(var r=this._block,a=0;this._blockOffset+e.length-a>=this._blockSize;){for(var n=this._blockOffset;n0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=n},{inherits:205,"safe-buffer":314,stream:350}],185:[function(e,t,r){var i=r;i.utils=e("./hash/utils"),i.common=e("./hash/common"),i.sha=e("./hash/sha"),i.ripemd=e("./hash/ripemd"),i.hmac=e("./hash/hmac"),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},{"./hash/common":186,"./hash/hmac":187,"./hash/ripemd":188,"./hash/sha":189,"./hash/utils":196}],186:[function(e,t,r){"use strict";var i=e("./utils"),a=e("minimalistic-assert");function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}r.BlockHash=n,n.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var a=0;a>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=255&e}else for(i[a++]=255&e,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,n=8;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":196}],196:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),a=e("inherits");function n(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=a,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a>6|192,r[i++]=63&o|128):n(e,a)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++a)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(a=0;a>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,a=0;i>>24,r[a+1]=n>>>16&255,r[a+2]=n>>>8&255,r[a+3]=255&n):(r[a+3]=n>>>24,r[a+2]=n>>>16&255,r[a+1]=n>>>8&255,r[a]=255&n)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,a){return e+t+r+i+a>>>0},r.sum64=function(e,t,r,i){var a=e[t],n=i+e[t+1]>>>0,o=(n>>0,e[t+1]=n},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,a,n,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,a,n,o,s){return t+i+n+s>>>0},r.sum64_5_hi=function(e,t,r,i,a,n,o,s,c,u){var p=0,l=t;return p+=(l=l+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,a,n,o,s,c,u){return t+i+n+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:205,"minimalistic-assert":233}],197:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}t.exports=o,o.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length=65&&E<=90||E>=97&&E<=122)k+=S;else{if("="!==S)throw new g("bad param format");if(0===k.length)throw new g("bad param format");w=f}break;case f:if('"'!==S)throw new g("bad param format");_="",w=h;break;case h:'"'===S?(x.params[k]=_,w=d):_+=S;break;case d:if(","!==S)throw new g("bad param format");k="",w=l;break;default:throw new Error("Invalid substate")}break;default:throw new Error("Invalid substate")}}if(x.params.headers&&""!==x.params.headers?x.params.headers=x.params.headers.split(" "):e.headers["x-date"]?x.params.headers=["x-date"]:x.params.headers=["date"],!x.scheme||"Signature"!==x.scheme)throw new g('scheme was not "Signature"');if(!x.params.keyId)throw new g("keyId was not specified");if(!x.params.algorithm)throw new g("algorithm was not specified");if(!x.params.signature)throw new g("signature was not specified");x.params.algorithm=x.params.algorithm.toLowerCase();try{c(x.params.algorithm)}catch(e){throw e instanceof s?new b(x.params.algorithm+" is not supported"):e}for(n=0;n1e3*t.clockSkew)throw new m("clock skew of "+z/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(x.params.headers.indexOf(e.toLowerCase())<0)throw new v(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(x.params.algorithm))throw new b(x.params.algorithm+" is not a supported algorithm");return x.algorithm=x.params.algorithm.toUpperCase(),x.keyId=x.params.keyId,x}}},{"./utils":201,"assert-plus":64,util:388}],200:[function(e,t,r){(function(r){var i=e("assert-plus"),a=e("crypto"),n=(e("http"),e("util")),o=e("sshpk"),s=e("jsprim"),c=e("./utils"),u=e("util").format,p=c.HASH_ALGOS,l=c.PK_ALGOS,f=c.InvalidAlgorithmError,h=c.HttpSignatureError,d=c.validateAlgorithm,m='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function g(e){h.call(this,e,g)}function b(e){h.call(this,e,b)}function v(e){i.object(e,"options");var t=[];if(void 0!==e.algorithm&&(i.string(e.algorithm,"options.algorithm"),t=d(e.algorithm)),this.rs_alg=t,void 0!==e.sign)i.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(i.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!r.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=a.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var n=e.key;if(("string"==typeof n||r.isBuffer(n))&&(n=o.parsePrivateKey(n)),i.ok(o.PrivateKey.isPrivateKey(n,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=n,i.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!l[n.type])throw new f(n.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&n.type!==t[0])throw new f("options.key must be a "+t[0].toUpperCase()+" key, was given a "+n.type.toUpperCase()+" key instead");this.rs_signer=n.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}n.inherits(g,h),n.inherits(b,h),v.prototype.writeHeader=function(e,t){if(i.string(e,"header"),e=e.toLowerCase(),i.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;this.rs_headers.length>0&&(r="\n"+r),this.rs_signer.update(r)}return t},v.prototype.writeDateHeader=function(){return this.writeHeader("date",s.rfc1123(new Date))},v.prototype.writeTarget=function(e,t){i.string(e,"method"),i.string(t,"path"),e=e.toLowerCase(),this.writeHeader("(request-target)",e+" "+t)},v.prototype.sign=function(e){if(i.func(e,"callback"),this.rs_headers.length<1)throw new Error("At least one header must be signed");var t,r;if(this.rs_signFunc){var a=this.rs_lines.join("\n"),n=this;this.rs_signFunc(a,function(a,o){if(a)e(a);else{try{i.object(o,"signature"),i.string(o.keyId,"signature.keyId"),i.string(o.algorithm,"signature.algorithm"),i.string(o.signature,"signature.signature"),t=d(o.algorithm),r=u(m,o.keyId,o.algorithm,n.rs_headers.join(" "),o.signature)}catch(t){return void e(t)}e(null,r)}})}else{try{var o=this.rs_signer.sign()}catch(t){return void e(t)}t=(this.rs_alg[0]||this.rs_key.type)+"-"+o.hashAlgorithm;var s=o.toString();r=u(m,this.rs_keyId,t,this.rs_headers.join(" "),s),e(null,r)}},t.exports={isSigner:function(e){return"object"==typeof e&&e instanceof v},createSigner:function(e){return new v(e)},signRequest:function(e,t){i.object(e,"request"),i.object(t,"options"),i.optionalString(t.algorithm,"options.algorithm"),i.string(t.keyId,"options.keyId"),i.optionalArrayOfString(t.headers,"options.headers"),i.optionalString(t.httpVersion,"options.httpVersion"),e.getHeader("Date")||e.setHeader("Date",s.rfc1123(new Date)),t.headers||(t.headers=["date"]),t.httpVersion||(t.httpVersion="1.1");var n,c=[];t.algorithm&&(t.algorithm=t.algorithm.toLowerCase(),c=d(t.algorithm));var h,v="";for(n=0;n>1,p=-7,l=r?a-1:0,f=r?-1:1,h=e[t+l];for(l+=f,n=h&(1<<-p)-1,h>>=-p,p+=s;p>0;n=256*n+e[t+l],l+=f,p-=8);for(o=n&(1<<-p)-1,n>>=-p,p+=i;p>0;o=256*o+e[t+l],l+=f,p-=8);if(0===n)n=1-u;else{if(n===c)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),n-=u}return(h?-1:1)*o*Math.pow(2,n-i)},r.write=function(e,t,r,i,a,n){var o,s,c,u=8*n-a-1,p=(1<>1,f=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:n-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=p?(s=0,o=p):o+l>=1?(s=(t*c-1)*Math.pow(2,a),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,a),o=0));a>=8;e[r+h]=255&s,h+=d,s/=256,a-=8);for(o=o<0;e[r+h]=255&o,h+=d,o/=256,u-=8);e[r+h-d]|=128*m}},{}],205:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],206:[function(e,t,r){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(i(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],207:[function(e,t,r){t.exports=n,n.strict=o,n.loose=s;var i=Object.prototype.toString,a={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function n(e){return o(e)||s(e)}function o(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function s(e){return a[i.call(e)]}},{}],208:[function(e,t,r){var i={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},{}],209:[function(e,t,r){var i=e("stream");function a(e){return e instanceof i.Stream}function n(e){return a(e)&&"function"==typeof e._read&&"object"==typeof e._readableState}function o(e){return a(e)&&"function"==typeof e._write&&"object"==typeof e._writableState}t.exports=a,t.exports.isReadable=n,t.exports.isWritable=o,t.exports.isDuplex=function(e){return n(e)&&o(e)}},{stream:350}],210:[function(e,t,r){(function(){var e;function i(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 a(){return new i(null)}var n="undefined"!=typeof navigator;n&&"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(e,t,r,i,a,n){for(var o=32767&t,s=t>>15;--n>=0;){var c=32767&this[e],u=this[e++]>>15,p=s*c+u*o;a=((c=o*c+((32767&p)<<15)+r[i]+(1073741823&a))>>>30)+(p>>>15)+s*u+(a>>>30),r[i++]=1073741823&c}return a},e=30):n&&"Netscape"!=navigator.appName?(i.prototype.am=function(e,t,r,i,a,n){for(;--n>=0;){var o=t*this[e++]+r[i]+a;a=Math.floor(o/67108864),r[i++]=67108863&o}return a},e=26):(i.prototype.am=function(e,t,r,i,a,n){for(var o=16383&t,s=t>>14;--n>=0;){var c=16383&this[e],u=this[e++]>>14,p=s*c+u*o;a=((c=o*c+((16383&p)<<14)+r[i]+a)>>28)+(p>>14)+s*u,r[i++]=268435455&c}return a},e=28),i.prototype.DB=e,i.prototype.DM=(1<>>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 d(e){this.m=e}function m(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=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 k(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function _(){}function x(e){return e}function j(e){this.r2=a(),this.q3=a(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}d.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},d.prototype.revert=function(e){return e},d.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},d.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},d.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},m.prototype.convert=function(e){var t=a();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},m.prototype.revert=function(e){var t=a();return e.copyTo(t),this.reduce(t),t},m.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,i,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)},m.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},m.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.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},i.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},i.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 a=e.length,n=!1,o=0;--a>=0;){var s=8==r?255&e[a]:l(e,a);s<0?"-"==e.charAt(a)&&(n=!0):(n=!1,0==o?this[this.t++]=s:o+r>this.DB?(this[this.t-1]|=(s&(1<>this.DB-o):this[this.t-1]|=s<=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e;)--this.t},i.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},i.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t[r+o+1]=this[r]>>a|s,s=(this[r]&n)<=0;--r)t[r]=0;t[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},i.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 i=e%this.DB,a=this.DB-i,n=(1<>i;for(var o=r+1;o>i;i>0&&(t[this.t-r-1]|=(this.s&n)<>=this.DB;if(e.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=e.s}t.s=i<0?-1:0,i<-1?t[r++]=this.DV+i:i>0&&(t[r++]=i),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),a=e.abs(),n=r.t;for(t.t=n+a.t;--n>=0;)t[n]=0;for(n=0;n=0;)e[r]=0;for(r=0;r=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()},i.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(p,s),o.lShiftTo(p,r)):(n.copyTo(s),o.copyTo(r));var l=s.t,f=s[l-1];if(0!=f){var d=f*(1<1?s[l-2]>>this.F2:0),m=this.FV/d,g=(1<=0&&(r[r.t++]=1,r.subTo(w,r)),i.ONE.dlShiftTo(l,w),w.subTo(s,s);s.t=0;){var k=r[--v]==f?this.DM:Math.floor(r[v]*m+(r[v-1]+b)*g);if((r[v]+=s.am(0,k,r,y,0,l))0&&r.rShiftTo(p,r),c<0&&i.ZERO.subTo(r,r)}}},i.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},i.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=a(),n=a(),o=t.convert(this),s=h(e)-1;for(o.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,o,r);else{var c=r;r=n,n=c}return t.revert(r)},i.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,i=(1<0)for(s>s)>0&&(a=!0,n=p(r));o>=0;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),r>0&&(a=!0),a&&(n+=p(r));return a?n:"0"},i.prototype.negate=function(){var e=a();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.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},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+h(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=a();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new d(t):new m(t),this.exp(e,r)},i.ZERO=f(0),i.ONE=f(1),_.prototype.convert=x,_.prototype.revert=x,_.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},_.prototype.sqrTo=function(e,t){e.squareTo(t)},j.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=a();return e.copyTo(t),this.reduce(t),t},j.prototype.revert=function(e){return e},j.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)},j.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},j.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var S,E,A,F=[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],P=(1<<26)/F[F.length-1];function z(){var e;e=(new Date).getTime(),E[A++]^=255&e,E[A++]^=e>>8&255,E[A++]^=e>>16&255,E[A++]^=e>>24&255,A>=q&&(A-=q)}if(i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.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),i=f(r),n=a(),o=a(),s="";for(this.divRemTo(i,n,o);n.signum()>0;)s=(r+o.intValue()).toString(e).substr(1)+s,n.divRemTo(i,n,o);return o.intValue().toString(e)+s},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),a=Math.pow(t,r),n=!1,o=0,s=0,c=0;c=r&&(this.dMultiply(a),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),n&&i.ZERO.subTo(this,this)},i.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(i.ONE.shiftLeft(e-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var a=new Array,n=7&e;a.length=1+(e>>3),t.nextBytes(a),n>0?a[0]&=(1<>=this.DB;if(e.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=e.s}t.s=i<0?-1:0,i>0?t[r++]=i:i<-1&&(t[r++]=this.DV+i),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.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]}},i.prototype.multiplyLowerTo=function(e,t,r){var i,a=Math.min(this.t+e.t,t);for(r.s=0,r.t=a;a>0;)r[--a]=0;for(i=r.t-this.t;a=0;)r[i]=0;for(i=Math.max(t-this.t,0);i0)if(0==t)r=this[0]%e;else for(var i=this.t-1;i>=0;--i)r=(t*r+this[i])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>F.length&&(e=F.length);for(var o=a(),s=0;s>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,i=this.DB-e*this.DB%8,a=0;if(e-- >0)for(i>i)!=(this.s&this.DM)>>i&&(t[a++]=r|this.s<=0;)i<8?(r=(this[e]&(1<>(i+=this.DB-8)):(r=this[e]>>(i-=8)&255,i<=0&&(i+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==a&&(128&this.s)!=(128&r)&&++a,(a>0||r!=this.s)&&(t[a++]=r);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=a();return this.bitwiseTo(e,g,t),t},i.prototype.or=function(e){var t=a();return this.bitwiseTo(e,b,t),t},i.prototype.xor=function(e){var t=a();return this.bitwiseTo(e,v,t),t},i.prototype.andNot=function(e){var t=a();return this.bitwiseTo(e,y,t),t},i.prototype.not=function(){for(var e=a(),t=0;t=this.t?0!=this.s:0!=(this[t]&1<1){var l=a();for(i.sqrTo(s[1],l);c<=p;)s[c]=a(),i.mulTo(l,s[c-2],s[c]),c+=2}var g,b,v=e.t-1,y=!0,w=a();for(n=h(e[v])-1;v>=0;){for(n>=u?g=e[v]>>n-u&p:(g=(e[v]&(1<0&&(g|=e[v-1]>>this.DB+n-u)),c=r;0==(1&g);)g>>=1,--c;if((n-=c)<0&&(n+=this.DB,--v),y)s[g].copyTo(o),y=!1;else{for(;c>1;)i.sqrTo(o,w),i.sqrTo(w,o),c-=2;c>0?i.sqrTo(o,w):(b=o,o=w,w=b),i.mulTo(w,s[g],o)}for(;v>=0&&0==(e[v]&1<=0?(r.subTo(a,r),t&&n.subTo(s,n),o.subTo(c,o)):(a.subTo(r,a),t&&s.subTo(n,s),c.subTo(o,c))}return 0!=a.compareTo(i.ONE)?i.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},i.prototype.pow=function(e){return this.exp(e,new _)},i.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 i=t;t=r,r=i}var a=t.getLowestSetBit(),n=r.getLowestSetBit();if(n<0)return t;for(a0&&(t.rShiftTo(n,t),r.rShiftTo(n,r));t.signum()>0;)(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return n>0&&r.lShiftTo(n,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=F[F.length-1]){for(t=0;t>>8,E[A++]=255&C;A=0,z()}function B(){if(null==S){for(z(),(S=new R).init(E),A=0;At.maxItems&&p("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&o.concat(function(e,t,r,n){if("object"==typeof t)for(var c in("object"!=typeof e||e instanceof Array)&&o.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(c)){var u=e[c];if(void 0===u&&i.existingOnly)continue;var p=t[c];void 0===u&&p.default&&(u=e[c]=p.default),i.coerce&&c in e&&(u=e[c]=i.coerce(u,p)),s(u,p,r,c)}for(c in e){if(e.hasOwnProperty(c)&&("_"!=c.charAt(0)||"_"!=c.charAt(1))&&t&&!t[c]&&!1===n){if(i.filter){delete e[c];continue}o.push({property:r,message:typeof u+"The property "+c+" is not defined in the schema and the schema does not allow additional properties"})}var l=t&&t[c]&&t[c].requires;!l||l in e||o.push({property:r,message:"the presence of the property "+c+" requires that "+l+" also be present"}),u=e[c],!n||t&&"object"==typeof t&&c in t||(i.coerce&&(u=e[c]=i.coerce(u,n)),s(u,n,r,c)),!a&&u&&u.$schema&&(o=o.concat(s(u,u.$schema,r,c)))}return o}(e,t.properties,r,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&p("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&p("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&p("must have a minimum value of "+t.minimum),void 0!==typeof t.maximum&&typeof e==typeof t.maximum&&t.maximum0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,a):i.push(a),~r.indexOf(n)&&(n=t.call(this,a,n))}else r.push(n);return null==e?n:e.call(this,a,n)}}(t.exports=function(e,t,r,a){return JSON.stringify(e,i(t,a),r)}).getSerialize=i},{}],214:[function(e,t,r){var i=e("assert-plus"),a=(e("util"),e("extsprintf")),n=e("verror"),o=e("json-schema");function s(e,t){return i.equal(typeof t,"string"),Object.prototype.hasOwnProperty.call(e,t)}r.deepCopy=function e(t){var r,i;var a="__deepCopy";if(t&&t[a])throw new Error("attempted deep copy of cyclic object");if(t&&t.constructor==Object){for(i in r={},t[a]=!0,t)i!=a&&(r[i]=e(t[i]));return delete t[a],r}if(t&&t.constructor==Array){for(r=[],t[a]=!0,i=0;i=0);var a=[];var n;for(n in t)e(t[n],r-1).forEach(function(e){a.push([n].concat(e))});return a},r.flattenIter=function(e,t,r){!function e(t,r,a,n){var o;var s;if(0===r)return(o=a.slice(0)).push(t),void n(o);i.ok(null!==t);i.equal(typeof t,"object");i.equal(typeof r,"number");i.ok(r>=0);for(s in t)(o=a.slice(0)).push(s),e(t[s],r-1,o,n)}(e,t,[],r)},r.validateJsonObject=O,r.validateJsonObjectJS=O,r.randElt=function(e){return i.ok(Array.isArray(e)&&e.length>0,"randElt argument must be a non-empty array"),e[Math.floor(Math.random()*e.length)]},r.extraProperties=function(e,t){i.ok("object"==typeof e&&null!==e,"obj argument must be a non-null object"),i.ok(Array.isArray(t),"allowed argument must be an array of strings");for(var r=0;r=2,"options.base >= 2"),i.ok(n.base<=36,"options.base <= 36"),i.bool(n.allowSign,"options.allowSign"),i.bool(n.allowPrefix,"options.allowPrefix"),i.bool(n.allowTrailing,"options.allowTrailing"),i.bool(n.allowImprecise,"options.allowImprecise"),i.bool(n.trimWhitespace,"options.trimWhitespace"),i.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&i.ok(!a,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var o,c=-1,u=n.base,h=1,d=0,m=0,w=e.length;if(n.trimWhitespace)for(;mp||k=h&&e<=d?e-A:e>=m&&e<=w?e-F:e>=k&&e<=E?e-P:-1}function C(e){return 32===e||e>=9&&e<=13||160===e||5760===e||6158===e||e>=8192&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e||65279===e}function O(e,t){var r=o.validate(t,e);if(0===r.errors.length)return null;var i,a,s=r.errors[0],c=s.property,u=s.message.toLowerCase();-1!=(i=u.indexOf("the property "))&&-1!=(a=u.indexOf(" is not defined in the schema and the schema does not allow additional properties"))&&(i+="the property ".length,c=""===c?u.substr(i,a-i):c+"."+u.substr(i,a-i),u="unsupported property");var p=new n.VError('property "%s": %s',c,u);return p.jsv_details=s,p}function T(e){i.ok(e[0]>=0&&e[1]>=0,"negative numbers not allowed in hrtimes"),i.ok(e[1]<1e9,"nanoseconds column overflow")}function B(e,t){T(e),T(t),i.ok(e[0]>t[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function I(e,t){return T(e),T(t),e[1]+=t[1],e[1]>=1e9&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function R(e,t,r){var i,a;if(i={},r)for(a in r)i[a]=r[a];if(e)for(a in e)i[a]=e[a];if(t)for(a in t)i[a]=t[a];return i}},{"assert-plus":64,extsprintf:157,"json-schema":212,util:388,verror:392}],215:[function(e,t,r){(function(e){var i=200,a="__lodash_hash_undefined__",n=800,o=16,s=9007199254740991,c="[object Arguments]",u="[object AsyncFunction]",p="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",d="[object Proxy]",m="[object Undefined]",g=/^\[object .+?Constructor\]$/,b=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[c]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v[p]=v["[object Map]"]=v["[object Number]"]=v[h]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1;var y="object"==typeof e&&e&&e.Object===Object&&e,w="object"==typeof self&&self&&self.Object===Object&&self,k=y||w||Function("return this")(),_="object"==typeof r&&r&&!r.nodeType&&r,x=_&&"object"==typeof t&&t&&!t.nodeType&&t,j=x&&x.exports===_,S=j&&y.process,E=function(){try{var e=x&&x.require&&x.require("util").types;return e||S&&S.binding&&S.binding("util")}catch(e){}}(),A=E&&E.isTypedArray;var F,P,z,C=Array.prototype,O=Function.prototype,T=Object.prototype,B=k["__core-js_shared__"],I=O.toString,R=T.hasOwnProperty,q=(F=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",M=T.toString,D=I.call(Object),L=RegExp("^"+I.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=j?k.Buffer:void 0,U=k.Symbol,H=k.Uint8Array,K=N?N.allocUnsafe:void 0,$=(P=Object.getPrototypeOf,z=Object,function(e){return P(z(e))}),V=Object.create,Z=T.propertyIsEnumerable,W=C.splice,G=U?U.toStringTag:void 0,Q=function(){try{var e=ke(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),X=N?N.isBuffer:void 0,Y=Math.max,J=Date.now,ee=ke(k,"Map"),te=ke(Object,"create"),re=function(){function e(){}return function(t){if(!Te(t))return{};if(V)return V(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ie(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},ae.prototype.set=function(e,t){var r=this.__data__,i=pe(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ie,map:new(ee||ae),string:new ie}},ne.prototype.delete=function(e){var t=we(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return we(this,e).get(e)},ne.prototype.has=function(e){return we(this,e).has(e)},ne.prototype.set=function(e,t){var r=we(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},oe.prototype.clear=function(){this.__data__=new ae,this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},oe.prototype.get=function(e){return this.__data__.get(e)},oe.prototype.has=function(e){return this.__data__.has(e)},oe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ae){var a=r.__data__;if(!ee||a.length-1&&e%1==0&&e0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Q?function(e,t){return Q(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:De);function Ee(e,t){return e===t||e!=e&&t!=t}var Ae=me(function(){return arguments}())?me:function(e){return Be(e)&&R.call(e,"callee")&&!Z.call(e,"callee")},Fe=Array.isArray;function Pe(e){return null!=e&&Oe(e.length)&&!Ce(e)}var ze=X||function(){return!1};function Ce(e){if(!Te(e))return!1;var t=de(e);return t==p||t==l||t==u||t==d}function Oe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Be(e){return null!=e&&"object"==typeof e}var Ie=A?function(e){return function(t){return e(t)}}(A):function(e){return Be(e)&&Oe(e.length)&&!!v[de(e)]};function Re(e){return Pe(e)?se(e,!0):be(e)}var qe,Me=(qe=function(e,t,r){ve(e,t,r)},ye(function(e,t){var r=-1,i=t.length,a=i>1?t[i-1]:void 0,n=i>2?t[2]:void 0;for(a=qe.length>3&&"function"==typeof a?(i--,a):void 0,n&&function(e,t,r){if(!Te(r))return!1;var i=typeof t;return!!("number"==i?Pe(r)&&_e(t,r.length):"string"==i&&t in r)&&Ee(r[t],e)}(t[0],t[1],n)&&(a=i<3?void 0:a,i=1),e=Object(e);++r>>32-t}function u(e,t,r,i,a,n,o){return c(e+(t&r|~t&i)+a+n|0,o)+t|0}function p(e,t,r,i,a,n,o){return c(e+(t&i|r&~i)+a+n|0,o)+t|0}function l(e,t,r,i,a,n,o){return c(e+(t^r^i)+a+n|0,o)+t|0}function f(e,t,r,i,a,n,o){return c(e+(r^(t|~i))+a+n|0,o)+t|0}i(s,a),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,a=this._c,n=this._d;r=u(r,i,a,n,e[0],3614090360,7),n=u(n,r,i,a,e[1],3905402710,12),a=u(a,n,r,i,e[2],606105819,17),i=u(i,a,n,r,e[3],3250441966,22),r=u(r,i,a,n,e[4],4118548399,7),n=u(n,r,i,a,e[5],1200080426,12),a=u(a,n,r,i,e[6],2821735955,17),i=u(i,a,n,r,e[7],4249261313,22),r=u(r,i,a,n,e[8],1770035416,7),n=u(n,r,i,a,e[9],2336552879,12),a=u(a,n,r,i,e[10],4294925233,17),i=u(i,a,n,r,e[11],2304563134,22),r=u(r,i,a,n,e[12],1804603682,7),n=u(n,r,i,a,e[13],4254626195,12),a=u(a,n,r,i,e[14],2792965006,17),r=p(r,i=u(i,a,n,r,e[15],1236535329,22),a,n,e[1],4129170786,5),n=p(n,r,i,a,e[6],3225465664,9),a=p(a,n,r,i,e[11],643717713,14),i=p(i,a,n,r,e[0],3921069994,20),r=p(r,i,a,n,e[5],3593408605,5),n=p(n,r,i,a,e[10],38016083,9),a=p(a,n,r,i,e[15],3634488961,14),i=p(i,a,n,r,e[4],3889429448,20),r=p(r,i,a,n,e[9],568446438,5),n=p(n,r,i,a,e[14],3275163606,9),a=p(a,n,r,i,e[3],4107603335,14),i=p(i,a,n,r,e[8],1163531501,20),r=p(r,i,a,n,e[13],2850285829,5),n=p(n,r,i,a,e[2],4243563512,9),a=p(a,n,r,i,e[7],1735328473,14),r=l(r,i=p(i,a,n,r,e[12],2368359562,20),a,n,e[5],4294588738,4),n=l(n,r,i,a,e[8],2272392833,11),a=l(a,n,r,i,e[11],1839030562,16),i=l(i,a,n,r,e[14],4259657740,23),r=l(r,i,a,n,e[1],2763975236,4),n=l(n,r,i,a,e[4],1272893353,11),a=l(a,n,r,i,e[7],4139469664,16),i=l(i,a,n,r,e[10],3200236656,23),r=l(r,i,a,n,e[13],681279174,4),n=l(n,r,i,a,e[0],3936430074,11),a=l(a,n,r,i,e[3],3572445317,16),i=l(i,a,n,r,e[6],76029189,23),r=l(r,i,a,n,e[9],3654602809,4),n=l(n,r,i,a,e[12],3873151461,11),a=l(a,n,r,i,e[15],530742520,16),r=f(r,i=l(i,a,n,r,e[2],3299628645,23),a,n,e[0],4096336452,6),n=f(n,r,i,a,e[7],1126891415,10),a=f(a,n,r,i,e[14],2878612391,15),i=f(i,a,n,r,e[5],4237533241,21),r=f(r,i,a,n,e[12],1700485571,6),n=f(n,r,i,a,e[3],2399980690,10),a=f(a,n,r,i,e[10],4293915773,15),i=f(i,a,n,r,e[1],2240044497,21),r=f(r,i,a,n,e[8],1873313359,6),n=f(n,r,i,a,e[15],4264355552,10),a=f(a,n,r,i,e[6],2734768916,15),i=f(i,a,n,r,e[13],1309151649,21),r=f(r,i,a,n,e[4],4149444226,6),n=f(n,r,i,a,e[11],3174756917,10),a=f(a,n,r,i,e[2],718787259,15),i=f(i,a,n,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+a|0,this._d=this._d+n|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=s},{"hash-base":184,inherits:205,"safe-buffer":314}],229:[function(e,t,r){var i=e("bn.js"),a=e("brorand");function n(e){this.rand=e||new a.Rand}t.exports=n,n.create=function(e){return new n(e)},n.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var a=new i(this.rand.generate(r))}while(a.cmp(e)>=0);return a},n.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},n.prototype.test=function(e,t,r){var a=e.bitLength(),n=i.mont(e),o=new i(1).toRed(n);t||(t=Math.max(1,a/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var u=e.shrn(c),p=s.toRed(n);t>0;t--){var l=this._randrange(new i(2),s);r&&r(l);var f=l.toRed(n).redPow(u);if(0!==f.cmp(o)&&0!==f.cmp(p)){for(var h=1;h0;t--){var p=this._randrange(new i(2),o),l=e.gcd(p);if(0!==l.cmpn(1))return l;var f=p.toRed(a).redPow(c);if(0!==f.cmp(n)&&0!==f.cmp(u)){for(var h=1;hp||u===p&&"application/"===a[c].substr(0,12)))continue}a[c]=e}}})},{"mime-db":231,path:255}],233:[function(e,t,r){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}t.exports=i,i.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},{}],234:[function(e,t,r){"use strict";var i=r;function a(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r>8,o=255&a;n?r.push(n,o):r.push(o)}return r},i.zero2=a,i.toHex=n,i.encode=function(e,t){return"hex"===t?n(e):e}},{}],235:[function(e,t,r){var i=1e3,a=60*i,n=60*a,o=24*n,s=365.25*o;function c(e,t,r){if(!(e0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*s;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*n;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?c(r=e,o,"day")||c(r,n,"hour")||c(r,a,"minute")||c(r,i,"second")||r+" ms":function(e){if(e>=o)return Math.round(e/o)+"d";if(e>=n)return Math.round(e/n)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],236:[function(e,t,r){var i=e("crypto");function a(e,t,r){return i.createHmac(r,e).update(t).digest("base64")}function n(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function o(e,t){return e>t?1:e>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{n=n+(a=a+t[i++]|0)|0}while(--o);a%=65521,n%=65521}return a|n<<16|0}},{}],241:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],242:[function(e,t,r){"use strict";var i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,a){var n=i,o=a+r;e^=-1;for(var s=a;s>>8^n[255&(e^t[s])];return-1^e}},{}],243:[function(e,t,r){"use strict";var i,a=e("../utils/common"),n=e("./trees"),o=e("./adler32"),s=e("./crc32"),c=e("./messages"),u=0,p=1,l=3,f=4,h=5,d=0,m=1,g=-2,b=-3,v=-5,y=-1,w=1,k=2,_=3,x=4,j=0,S=2,E=8,A=9,F=15,P=8,z=286,C=30,O=19,T=2*z+1,B=15,I=3,R=258,q=R+I+1,M=32,D=42,L=69,N=73,U=91,H=103,K=113,$=666,V=1,Z=2,W=3,G=4,Q=3;function X(e,t){return e.msg=c[t],t}function Y(e){return(e<<1)-(e>4?9:0)}function J(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(a.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ie(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ae(e,t){var r,i,a=e.max_chain_length,n=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-q?e.strstart-(e.w_size-q):0,u=e.window,p=e.w_mask,l=e.prev,f=e.strstart+R,h=u[n+o-1],d=u[n+o];e.prev_length>=e.good_match&&(a>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===h&&u[r]===u[n]&&u[++r]===u[n+1]){n+=2,r++;do{}while(u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&no){if(e.match_start=t,o=i,i>=s)break;h=u[n+o-1],d=u[n+o]}}}while((t=l[t&p])>c&&0!=--a);return o<=e.lookahead?o:e.lookahead}function ne(e){var t,r,i,n,c,u,p,l,f,h,d=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-q)){a.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;do{i=e.head[--t],e.head[t]=i>=d?i-d:0}while(--r);t=r=d;do{i=e.prev[--t],e.prev[t]=i>=d?i-d:0}while(--r);n+=d}if(0===e.strm.avail_in)break;if(u=e.strm,p=e.window,l=e.strstart+e.lookahead,f=n,h=void 0,(h=u.avail_in)>f&&(h=f),r=0===h?0:(u.avail_in-=h,a.arraySet(p,u.input,u.next_in,h,l),1===u.state.wrap?u.adler=o(u.adler,p,h,l):2===u.state.wrap&&(u.adler=s(u.adler,p,h,l)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-I,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=(e.ins_h<15&&(s=2,i-=16),n<1||n>A||r!==E||i<8||i>15||t<0||t>9||o<0||o>x)return X(e,g);8===i&&(i=9);var c=new ue;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ne(e),0===e.lookahead&&t===u)return V;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,te(e,!1),0===e.strm.avail_out))return V;if(e.strstart-e.block_start>=e.w_size-q&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?W:G):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),V)}),new ce(4,4,8,4,oe),new ce(4,5,16,8,oe),new ce(4,6,32,32,oe),new ce(4,4,16,16,se),new ce(8,16,32,32,se),new ce(8,16,128,128,se),new ce(8,32,128,256,se),new ce(32,128,258,1024,se),new ce(32,258,258,4096,se)],r.deflateInit=function(e,t){return fe(e,t,E,F,P,j)},r.deflateInit2=fe,r.deflateReset=le,r.deflateResetKeep=pe,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,d):g},r.deflate=function(e,t){var r,a,o,c;if(!e||!e.state||t>h||t<0)return e?X(e,g):g;if(a=e.state,!e.output||!e.input&&0!==e.avail_in||a.status===$&&t!==f)return X(e,0===e.avail_out?v:g);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===D)if(2===a.wrap)e.adler=0,re(a,31),re(a,139),re(a,8),a.gzhead?(re(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),re(a,255&a.gzhead.time),re(a,a.gzhead.time>>8&255),re(a,a.gzhead.time>>16&255),re(a,a.gzhead.time>>24&255),re(a,9===a.level?2:a.strategy>=k||a.level<2?4:0),re(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(re(a,255&a.gzhead.extra.length),re(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=s(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=L):(re(a,0),re(a,0),re(a,0),re(a,0),re(a,0),re(a,9===a.level?2:a.strategy>=k||a.level<2?4:0),re(a,Q),a.status=K);else{var b=E+(a.w_bits-8<<4)<<8;b|=(a.strategy>=k||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(b|=M),b+=31-b%31,a.status=K,ie(a,b),0!==a.strstart&&(ie(a,e.adler>>>16),ie(a,65535&e.adler)),e.adler=1}if(a.status===L)if(a.gzhead.extra){for(o=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),ee(e),o=a.pending,a.pending!==a.pending_buf_size));)re(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=N)}else a.status=N;if(a.status===N)if(a.gzhead.name){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),ee(e),o=a.pending,a.pending===a.pending_buf_size)){c=1;break}c=a.gzindexo&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),0===c&&(a.gzindex=0,a.status=U)}else a.status=U;if(a.status===U)if(a.gzhead.comment){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),ee(e),o=a.pending,a.pending===a.pending_buf_size)){c=1;break}c=a.gzindexo&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),0===c&&(a.status=H)}else a.status=H;if(a.status===H&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&ee(e),a.pending+2<=a.pending_buf_size&&(re(a,255&e.adler),re(a,e.adler>>8&255),e.adler=0,a.status=K)):a.status=K),0!==a.pending){if(ee(e),0===e.avail_out)return a.last_flush=-1,d}else if(0===e.avail_in&&Y(t)<=Y(r)&&t!==f)return X(e,v);if(a.status===$&&0!==e.avail_in)return X(e,v);if(0!==e.avail_in||0!==a.lookahead||t!==u&&a.status!==$){var y=a.strategy===k?function(e,t){for(var r;;){if(0===e.lookahead&&(ne(e),0===e.lookahead)){if(t===u)return V;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?W:G):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?V:Z}(a,t):a.strategy===_?function(e,t){for(var r,i,a,o,s=e.window;;){if(e.lookahead<=R){if(ne(e),e.lookahead<=R&&t===u)return V;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(i=s[a=e.strstart-1])===s[++a]&&i===s[++a]&&i===s[++a]){o=e.strstart+R;do{}while(i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=n._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?W:G):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?V:Z}(a,t):i[a.level].func(a,t);if(y!==W&&y!==G||(a.status=$),y===V||y===W)return 0===e.avail_out&&(a.last_flush=-1),d;if(y===Z&&(t===p?n._tr_align(a):t!==h&&(n._tr_stored_block(a,0,0,!1),t===l&&(J(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ee(e),0===e.avail_out))return a.last_flush=-1,d}return t!==f?d:a.wrap<=0?m:(2===a.wrap?(re(a,255&e.adler),re(a,e.adler>>8&255),re(a,e.adler>>16&255),re(a,e.adler>>24&255),re(a,255&e.total_in),re(a,e.total_in>>8&255),re(a,e.total_in>>16&255),re(a,e.total_in>>24&255)):(ie(a,e.adler>>>16),ie(a,65535&e.adler)),ee(e),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?d:m)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==D&&t!==L&&t!==N&&t!==U&&t!==H&&t!==K&&t!==$?X(e,g):(e.state=null,t===K?X(e,b):d):g},r.deflateSetDictionary=function(e,t){var r,i,n,s,c,u,p,l,f=t.length;if(!e||!e.state)return g;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==D||r.lookahead)return g;for(1===s&&(e.adler=o(e.adler,t,f,0)),r.wrap=0,f>=r.w_size&&(0===s&&(J(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new a.Buf8(r.w_size),a.arraySet(l,t,f-r.w_size,r.w_size,0),t=l,f=r.w_size),c=e.avail_in,u=e.next_in,p=e.input,e.avail_in=f,e.next_in=0,e.input=t,ne(r);r.lookahead>=I;){i=r.strstart,n=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>=w=y>>>24,d-=w,0===(w=y>>>16&255))E[n++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=m[(65535&y)+(h&(1<>>=w,d-=w),d<15&&(h+=S[i++]<>>=w=y>>>24,d-=w,!(16&(w=y>>>16&255))){if(0==(64&w)){y=g[(65535&y)+(h&(1<c){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,d-=w,_>(w=n-o)){if((w=_-w)>p&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,j=f,0===l){if(x+=u-w,w2;)E[n++]=j[x++],E[n++]=j[x++],E[n++]=j[x++],k-=3;k&&(E[n++]=j[x++],k>1&&(E[n++]=j[x++]))}else{x=n-_;do{E[n++]=E[x++],E[n++]=E[x++],E[n++]=E[x++],k-=3}while(k>2);k&&(E[n++]=E[x++],k>1&&(E[n++]=E[x++]))}break}}break}}while(i>3,h&=(1<<(d-=k<<3))-1,e.next_in=i,e.next_out=n,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ae(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ne(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new i.Buf32(ee),t.distcode=t.distdyn=new i.Buf32(te),t.sane=1,t.back=-1,d):b}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ne(e)):b}function se(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?b:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,oe(e))):b}function ce(e,t){var r,i;return e?(i=new ae,e.state=i,i.window=null,(r=se(e,t))!==d&&(e.state=null),r):b}var ue,pe,le=!0;function fe(e){if(le){var t;for(ue=new i.Buf32(512),pe=new i.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(u,e.lens,0,288,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(p,e.lens,0,32,pe,0,e.work,{bits:5}),le=!1}e.lencode=ue,e.lenbits=9,e.distcode=pe,e.distbits=5}function he(e,t,r,a){var n,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(i.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((n=o.wsize-o.wnext)>a&&(n=a),i.arraySet(o.window,t,r-a,n,o.wnext),(a-=n)?(i.arraySet(o.window,t,r-a,a,0),o.wnext=a,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=n(r.check,Ae,2,0),se=0,ce=0,r.mode=x;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=X;break}if((15&se)!==k){e.msg="unknown compression method",r.mode=X;break}if(ce-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=X;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?C:T,se=0,ce=0;break;case x:for(;ce<16;){if(0===ne)break e;ne--,se+=ee[re++]<>8&1),512&r.flags&&(Ae[0]=255&se,Ae[1]=se>>>8&255,r.check=n(r.check,Ae,2,0)),se=0,ce=0,r.mode=j;case j:for(;ce<32;){if(0===ne)break e;ne--,se+=ee[re++]<>>8&255,Ae[2]=se>>>16&255,Ae[3]=se>>>24&255,r.check=n(r.check,Ae,4,0)),se=0,ce=0,r.mode=S;case S:for(;ce<16;){if(0===ne)break e;ne--,se+=ee[re++]<>8),512&r.flags&&(Ae[0]=255&se,Ae[1]=se>>>8&255,r.check=n(r.check,Ae,2,0)),se=0,ce=0,r.mode=E;case E:if(1024&r.flags){for(;ce<16;){if(0===ne)break e;ne--,se+=ee[re++]<>>8&255,r.check=n(r.check,Ae,2,0)),se=0,ce=0}else r.head&&(r.head.extra=null);r.mode=A;case A:if(1024&r.flags&&((le=r.length)>ne&&(le=ne),le&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,ee,re,le,_e)),512&r.flags&&(r.check=n(r.check,ee,le,re)),ne-=le,re+=le,r.length-=le),r.length))break e;r.length=0,r.mode=F;case F:if(2048&r.flags){if(0===ne)break e;le=0;do{_e=ee[re+le++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&le>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=T;break;case C:for(;ce<32;){if(0===ne)break e;ne--,se+=ee[re++]<>>=7&ce,ce-=7&ce,r.mode=W;break}for(;ce<3;){if(0===ne)break e;ne--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(fe(r),r.mode=N,t===h){se>>>=2,ce-=2;break e}break;case 2:r.mode=M;break;case 3:e.msg="invalid block type",r.mode=X}se>>>=2,ce-=2;break;case I:for(se>>>=7&ce,ce-=7&ce;ce<32;){if(0===ne)break e;ne--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=X;break}if(r.length=65535&se,se=0,ce=0,r.mode=R,t===h)break e;case R:r.mode=q;case q:if(le=r.length){if(le>ne&&(le=ne),le>oe&&(le=oe),0===le)break e;i.arraySet(te,ee,re,le,ae),ne-=le,re+=le,oe-=le,ae+=le,r.length-=le;break}r.mode=T;break;case M:for(;ce<14;){if(0===ne)break e;ne--,se+=ee[re++]<>>=5,ce-=5,r.ndist=1+(31&se),se>>>=5,ce-=5,r.ncode=4+(15&se),se>>>=4,ce-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=X;break}r.have=0,r.mode=D;case D:for(;r.have>>=3,ce-=3}for(;r.have<19;)r.lens[Fe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,je={bits:r.lenbits},xe=s(c,r.lens,0,19,r.lencode,0,r.work,je),r.lenbits=je.bits,xe){e.msg="invalid code lengths set",r.mode=X;break}r.have=0,r.mode=L;case L:for(;r.have>>16&255,ve=65535&Ee,!((ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>>=ge,ce-=ge,r.lens[r.have++]=ve;else{if(16===ve){for(Se=ge+2;ce>>=ge,ce-=ge,0===r.have){e.msg="invalid bit length repeat",r.mode=X;break}_e=r.lens[r.have-1],le=3+(3&se),se>>>=2,ce-=2}else if(17===ve){for(Se=ge+3;ce>>=ge)),se>>>=3,ce-=3}else{for(Se=ge+7;ce>>=ge)),se>>>=7,ce-=7}if(r.have+le>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=X;break}for(;le--;)r.lens[r.have++]=_e}}if(r.mode===X)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=X;break}if(r.lenbits=9,je={bits:r.lenbits},xe=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,je),r.lenbits=je.bits,xe){e.msg="invalid literal/lengths set",r.mode=X;break}if(r.distbits=6,r.distcode=r.distdyn,je={bits:r.distbits},xe=s(p,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,je),r.distbits=je.bits,xe){e.msg="invalid distances set",r.mode=X;break}if(r.mode=N,t===h)break e;case N:r.mode=U;case U:if(ne>=6&&oe>=258){e.next_out=ae,e.avail_out=oe,e.next_in=re,e.avail_in=ne,r.hold=se,r.bits=ce,o(e,pe),ae=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ne=e.avail_in,se=r.hold,ce=r.bits,r.mode===T&&(r.back=-1);break}for(r.back=0;be=(Ee=r.lencode[se&(1<>>16&255,ve=65535&Ee,!((ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>ye)])>>>16&255,ve=65535&Ee,!(ye+(ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>>=ye,ce-=ye,r.back+=ye}if(se>>>=ge,ce-=ge,r.back+=ge,r.length=ve,0===be){r.mode=Z;break}if(32&be){r.back=-1,r.mode=T;break}if(64&be){e.msg="invalid literal/length code",r.mode=X;break}r.extra=15&be,r.mode=H;case H:if(r.extra){for(Se=r.extra;ce>>=r.extra,ce-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=K;case K:for(;be=(Ee=r.distcode[se&(1<>>16&255,ve=65535&Ee,!((ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>ye)])>>>16&255,ve=65535&Ee,!(ye+(ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>>=ye,ce-=ye,r.back+=ye}if(se>>>=ge,ce-=ge,r.back+=ge,64&be){e.msg="invalid distance code",r.mode=X;break}r.offset=ve,r.extra=15&be,r.mode=$;case $:if(r.extra){for(Se=r.extra;ce>>=r.extra,ce-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=X;break}r.mode=V;case V:if(0===oe)break e;if(le=pe-oe,r.offset>le){if((le=r.offset-le)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=X;break}le>r.wnext?(le-=r.wnext,de=r.wsize-le):de=r.wnext-le,le>r.length&&(le=r.length),me=r.window}else me=te,de=ae-r.offset,le=r.length;le>oe&&(le=oe),oe-=le,r.length-=le;do{te[ae++]=me[de++]}while(--le);0===r.length&&(r.mode=U);break;case Z:if(0===oe)break e;te[ae++]=r.length,oe--,r.mode=U;break;case W:if(r.wrap){for(;ce<32;){if(0===ne)break e;ne--,se|=ee[re++]<=1&&0===I[E];E--);if(A>E&&(A=E),0===E)return u[p++]=20971520,u[p++]=20971520,f.bits=1,0;for(S=1;S0&&(0===e||1!==E))return-1;for(R[1]=0,x=1;x<15;x++)R[x+1]=R[x]+I[x];for(j=0;j852||2===e&&C>592)return 1;for(;;){y=x-P,l[j]v?(w=q[M+l[j]],k=T[B+l[j]]):(w=96,k=0),h=1<>P)+(d-=h)]=y<<24|w<<16|k|0}while(0!==d);for(h=1<>=1;if(0!==h?(O&=h-1,O+=h):O=0,j++,0==--I[x]){if(x===E)break;x=t[r+l[j]]}if(x>A&&(O&g)!==m){for(0===P&&(P=A),b+=S,z=1<<(F=x-P);F+P852||2===e&&C>592)return 1;u[m=O&g]=A<<24|F<<16|b-p|0}}return 0!==O&&(u[b+O]=x-P<<24|64<<16|0),f.bits=A,0}},{"../utils/common":239}],247:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],248:[function(e,t,r){"use strict";var i=e("../utils/common"),a=4,n=0,o=1,s=2;function c(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,p=1,l=2,f=29,h=256,d=h+1+f,m=30,g=19,b=2*d+1,v=15,y=16,w=7,k=256,_=16,x=17,j=18,S=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=new Array(2*(d+2));c(P);var z=new Array(2*m);c(z);var C=new Array(512);c(C);var O=new Array(256);c(O);var T=new Array(f);c(T);var B,I,R,q=new Array(m);function M(e,t,r,i,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}function D(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function L(e){return e<256?C[e]:C[256+(e>>>7)]}function N(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function U(e,t,r){e.bi_valid>y-r?(e.bi_buf|=t<>y-e.bi_valid,e.bi_valid+=r-y):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function $(e,t,r){var i,a,n=new Array(v+1),o=0;for(i=1;i<=v;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){var s=e[2*a+1];0!==s&&(e[2*a]=K(n[s]++,s))}}function V(e){var t;for(t=0;t8?N(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function W(e,t,r,i){var a=2*t,n=2*r;return e[a]>1;r>=1;r--)G(e,n,r);a=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,n,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,n[2*a]=n[2*r]+n[2*i],e.depth[a]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,n[2*r+1]=n[2*i+1]=a,e.heap[1]=a++,G(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,a,n,o,s,c=t.dyn_tree,u=t.max_code,p=t.stat_desc.static_tree,l=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(n=0;n<=v;n++)e.bl_count[n]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rd&&(n=d,m++),c[2*i+1]=n,i>u||(e.bl_count[n]++,o=0,i>=h&&(o=f[i-h]),s=c[2*i],e.opt_len+=s*(n+o),l&&(e.static_len+=s*(p[2*i+1]+o)));if(0!==m){do{for(n=d-1;0===e.bl_count[n];)n--;e.bl_count[n]--,e.bl_count[n+1]+=2,e.bl_count[d]--,m-=2}while(m>0);for(n=d;0!==n;n--)for(i=e.bl_count[n];0!==i;)(a=e.heap[--r])>u||(c[2*a+1]!==n&&(e.opt_len+=(n-c[2*a+1])*c[2*a],c[2*a+1]=n),i--)}}(e,t),$(n,u,e.bl_count)}function Y(e,t,r){var i,a,n=-1,o=t[1],s=0,c=7,u=4;for(0===o&&(c=138,u=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)a=o,o=t[2*(i+1)+1],++s>=7;i0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return n;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t=3&&0===e.bl_tree[2*F[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),c=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=c&&(c=u)):c=u=r+5,r+4<=c&&-1!==t?te(e,t,r,i):e.strategy===a||u===c?(U(e,(p<<1)+(i?1:0),3),Q(e,P,z)):(U(e,(l<<1)+(i?1:0),3),function(e,t,r,i){var a;for(U(e,t-257,5),U(e,r-1,5),U(e,i-4,4),a=0;a>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(O[r]+h+1)]++,e.dyn_dtree[2*L(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){U(e,p<<1,3),H(e,k,P),function(e){16===e.bi_valid?(N(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":239}],249:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],250:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],251:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var a=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=a;var n=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=n;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var p=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=p,r.DSAparam=i.define("DSAparam",function(){this.int()});var l=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=l;var f=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":252,"asn1.js":44}],252:[function(e,t,r){"use strict";var i=e("asn1.js"),a=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),n=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(n)}),u=i.define("RDNSequence",function(){this.seqof(c)}),p=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),l=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(a),this.key("notAfter").use(a))}),f=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),h=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(p),this.key("validity").use(l),this.key("subject").use(p),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":44}],253:[function(e,t,r){var i=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,o=e("evp_bytestokey"),s=e("browserify-aes"),c=e("safe-buffer").Buffer;t.exports=function(e,t){var r,u=e.toString(),p=u.match(i);if(p){var l="aes"+p[1],f=c.from(p[2],"hex"),h=c.from(p[3].replace(/[\r\n]/g,""),"base64"),d=o(t,f.slice(0,8),parseInt(p[1],10)).key,m=[],g=s.createDecipheriv(l,d,f);m.push(g.update(h)),m.push(g.final()),r=c.concat(m)}else{var b=u.match(n);r=new c(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(a)[1],data:r}}},{"browserify-aes":80,evp_bytestokey:155,"safe-buffer":314}],254:[function(e,t,r){var i=e("./asn1"),a=e("./aesid.json"),n=e("./fixProc"),o=e("browserify-aes"),s=e("pbkdf2"),c=e("safe-buffer").Buffer;function u(e){var t;"object"!=typeof e||c.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=c.from(e));var r,u,p=n(e,t),l=p.tag,f=p.data;switch(l){case"CERTIFICATE":u=i.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=i.PublicKey.decode(f,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=i.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+l);case"ENCRYPTED PRIVATE KEY":f=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=a[e.algorithm.decrypt.cipher.algo.join(".")],u=e.algorithm.decrypt.cipher.iv,p=e.subjectPrivateKey,l=parseInt(n.split("-")[1],10)/8,f=s.pbkdf2Sync(t,r,i,l,"sha1"),h=o.createDecipheriv(n,f,u),d=[];return d.push(h.update(p)),d.push(h.final()),c.concat(d)}(f=i.EncryptedPrivateKey.decode(f,"der"),t);case"PRIVATE KEY":switch(r=(u=i.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:i.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=i.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+l);case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=i.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+l)}}t.exports=u,u.signature=i.signature},{"./aesid.json":250,"./asn1":251,"./fixProc":253,"browserify-aes":80,pbkdf2:256,"safe-buffer":314}],255:[function(e,t,r){(function(e){function t(e,t){for(var r=0,i=e.length-1;i>=0;i--){var a=e[i];"."===a?e.splice(i,1):".."===a?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;i=-1&&!a;n--){var o=n>=0?arguments[n]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,a="/"===o.charAt(0))}return(a?"/":"")+(r=t(i(r.split("/"),function(e){return!!e}),!a).join("/"))||"."},r.normalize=function(e){var n=r.isAbsolute(e),o="/"===a(e,-1);return(e=t(i(e.split("/"),function(e){return!!e}),!n).join("/"))||n||(e="."),e&&o&&(e+="/"),(n?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function i(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var a=i(e.split("/")),n=i(t.split("/")),o=Math.min(a.length,n.length),s=o,c=0;c=1;--n)if(47===(t=e.charCodeAt(n))){if(!a){i=n;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"/":e.slice(0,i)},r.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,i=-1,a=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!a){r=t+1;break}}else-1===i&&(a=!1,i=t+1);return-1===i?"":e.slice(r,i)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,i=-1,a=!0,n=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===i&&(a=!1,i=o+1),46===s?-1===t?t=o:1!==n&&(n=1):-1!==t&&(n=-1);else if(!a){r=o+1;break}}return-1===t||-1===i||0===n||1===n&&t===i-1&&t===r+1?"":e.slice(t,i)};var a="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:263}],256:[function(e,t,r){r.pbkdf2=e("./lib/async"),r.pbkdf2Sync=e("./lib/sync")},{"./lib/async":257,"./lib/sync":260}],257:[function(e,t,r){(function(r,i){var a,n=e("./precondition"),o=e("./default-encoding"),s=e("./sync"),c=e("safe-buffer").Buffer,u=i.crypto&&i.crypto.subtle,p={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function f(e,t,r,i,a){return u.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return u.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:a}},e,i<<3)}).then(function(e){return c.from(e)})}t.exports=function(e,t,h,d,m,g){"function"==typeof m&&(g=m,m=void 0);var b=p[(m=m||"sha1").toLowerCase()];if(!b||"function"!=typeof i.Promise)return r.nextTick(function(){var r;try{r=s(e,t,h,d,m)}catch(e){return g(e)}g(null,r)});if(n(e,t,h,d),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");c.isBuffer(e)||(e=c.from(e,o)),c.isBuffer(t)||(t=c.from(t,o)),function(e,t){e.then(function(e){r.nextTick(function(){t(null,e)})},function(e){r.nextTick(function(){t(e)})})}(function(e){if(i.process&&!i.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var t=f(a=a||c.alloc(8),a,10,128,e).then(function(){return!0}).catch(function(){return!1});return l[e]=t,t}(b).then(function(r){return r?f(e,t,h,d,b):s(e,t,h,d,m)}),g)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":258,"./precondition":259,"./sync":260,_process:263,"safe-buffer":314}],258:[function(e,t,r){(function(e){var r;e.browser?r="utf-8":r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";t.exports=r}).call(this,e("_process"))},{_process:263}],259:[function(e,t,r){(function(e){var r=Math.pow(2,30)-1;function i(t,r){if("string"!=typeof t&&!e.isBuffer(t))throw new TypeError(r+" must be a buffer or string")}t.exports=function(e,t,a,n){if(i(e,"Password"),i(t,"Salt"),"number"!=typeof a)throw new TypeError("Iterations not a number");if(a<0)throw new TypeError("Bad iterations");if("number"!=typeof n)throw new TypeError("Key length not a number");if(n<0||n>r||n!=n)throw new TypeError("Bad key length")}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":206}],260:[function(e,t,r){var i=e("create-hash/md5"),a=e("ripemd160"),n=e("sha.js"),o=e("./precondition"),s=e("./default-encoding"),c=e("safe-buffer").Buffer,u=c.alloc(128),p={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,t,r){var o=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new a).update(e).digest()}:"md5"===e?i:function(t){return n(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=o(t):t.length1)for(var r=1;r255)return"DOMAIN_TOO_LONG";for(var r,a=t.split("."),n=0;n63)return"LABEL_TOO_LONG";if("-"===r.charAt(0))return"LABEL_STARTS_WITH_DASH";if("-"===r.charAt(r.length-1))return"LABEL_ENDS_WITH_DASH";if(!/^[a-z0-9\-]+$/.test(r))return"LABEL_INVALID_CHARS"}},r.parse=function(e){if("string"!=typeof e)throw new TypeError("Domain name must be a string.");var t=e.slice(0).toLowerCase();"."===t.charAt(t.length-1)&&(t=t.slice(0,t.length-1));var n=a.validate(t);if(n)return{input:e,error:{message:r.errorCodes[n],code:n}};var o={input:e,tld:null,sld:null,domain:null,subdomain:null,listed:!1},s=t.split(".");if("local"===s[s.length-1])return o;var c=function(){return/xn--/.test(t)?(o.domain&&(o.domain=i.toASCII(o.domain)),o.subdomain&&(o.subdomain=i.toASCII(o.subdomain)),o):o},u=a.findRule(t);if(!u)return s.length<2?o:(o.tld=s.pop(),o.sld=s.pop(),o.domain=[o.sld,o.tld].join("."),s.length&&(o.subdomain=s.pop()),c());o.listed=!0;var p=u.suffix.split("."),l=s.slice(0,s.length-p.length);return u.exception&&l.push(p.shift()),o.tld=p.join("."),l.length?(u.wildcard&&(p.unshift(l.pop()),o.tld=p.join(".")),l.length?(o.sld=l.pop(),o.domain=[o.sld,o.tld].join("."),l.length&&(o.subdomain=l.join(".")),c()):c()):c()},r.get=function(e){return e&&r.parse(e).domain||null},r.isValid=function(e){var t=r.parse(e);return Boolean(t.domain&&t.listed)}},{"./data/rules.json":264,punycode:108}],266:[function(e,t,r){r.publicEncrypt=e("./publicEncrypt"),r.privateDecrypt=e("./privateDecrypt"),r.privateEncrypt=function(e,t){return r.publicEncrypt(e,t,!0)},r.publicDecrypt=function(e,t){return r.privateDecrypt(e,t,!0)}},{"./privateDecrypt":268,"./publicEncrypt":269}],267:[function(e,t,r){var i=e("create-hash"),a=e("safe-buffer").Buffer;function n(e){var t=a.allocUnsafe(4);return t.writeUInt32BE(e,0),t}t.exports=function(e,t){for(var r,o=a.alloc(0),s=0;o.lengthd||new o(t).cmp(h.modulus)>=0)throw new Error("decryption error");f=r?u(new o(t),h):s(t,h);var m=p.alloc(d-f.length);if(f=p.concat([m,f],d),4===l)return function(e,t){var r=e.modulus.byteLength(),i=c("sha1").update(p.alloc(0)).digest(),o=i.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,o+1),u=t.slice(o+1),l=n(s,a(u,o)),f=n(u,a(l,r-o-1));if(function(e,t){e=p.from(e),t=p.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var a=-1;for(;++a=t.length){n++;break}var o=t.slice(2,a-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&n++;o.length<8&&n++;if(n)throw new Error("decryption error");return t.slice(a)}(0,f,r);if(3===l)return f;throw new Error("unknown padding")}},{"./mgf":267,"./withPublic":270,"./xor":271,"bn.js":75,"browserify-rsa":98,"create-hash":117,"parse-asn1":254,"safe-buffer":314}],269:[function(e,t,r){var i=e("parse-asn1"),a=e("randombytes"),n=e("create-hash"),o=e("./mgf"),s=e("./xor"),c=e("bn.js"),u=e("./withPublic"),p=e("browserify-rsa"),l=e("safe-buffer").Buffer;t.exports=function(e,t,r){var f;f=e.padding?e.padding:r?1:4;var h,d=i(e);if(4===f)h=function(e,t){var r=e.modulus.byteLength(),i=t.length,u=n("sha1").update(l.alloc(0)).digest(),p=u.length,f=2*p;if(i>r-f-2)throw new Error("message too long");var h=l.alloc(r-i-f-2),d=r-p-1,m=a(p),g=s(l.concat([u,h,l.alloc(1,1),t],d),o(m,d)),b=s(m,o(g,p));return new c(l.concat([l.alloc(1),b,g],r))}(d,t);else if(1===f)h=function(e,t,r){var i,n=t.length,o=e.modulus.byteLength();if(n>o-11)throw new Error("message too long");i=r?l.alloc(o-n-3,255):function(e){var t,r=l.allocUnsafe(e),i=0,n=a(2*e),o=0;for(;i=0)throw new Error("data too long for modulus")}return r?p(h,d):u(h,d)}},{"./mgf":267,"./withPublic":270,"./xor":271,"bn.js":75,"browserify-rsa":98,"create-hash":117,"parse-asn1":254,randombytes:280,"safe-buffer":314}],270:[function(e,t,r){var i=e("bn.js"),a=e("safe-buffer").Buffer;t.exports=function(e,t){return a.from(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}},{"bn.js":75,"safe-buffer":314}],271:[function(e,t,r){t.exports=function(e,t){for(var r=e.length,i=-1;++i=0;--a){var n,o=e[a];if("[]"===o)n=(n=[]).concat(i);else{n=r.plainObjects?Object.create(null):{};var s="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,c=parseInt(s,10);!isNaN(c)&&o!==s&&String(c)===s&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(n=[])[c]=i:n[s]=i}i=n}return i}(c,t,r)}};t.exports=function(e,t){var r=t?i.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||i.isRegExp(r.delimiter)?r.delimiter:n.delimiter,r.depth="number"==typeof r.depth?r.depth:n.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:n.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:n.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:n.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:n.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:n.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:n.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:n.strictNullHandling,""===e||null==e)return r.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){for(var r={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=i.split(t.delimiter,o),c=0;c0?A+E:""}},{"./formats":272,"./utils":276}],276:[function(e,t,r){"use strict";var i=Object.prototype.hasOwnProperty,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),n=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},i=0;i=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?r+=t.charAt(i):n<128?r+=a[n]:n<2048?r+=a[192|n>>6]+a[128|63&n]:n<55296||n>=57344?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,a){if(!r)return t;if("object"!=typeof r){if(Array.isArray(t))t.push(r);else{if("object"!=typeof t)return[t,r];(a.plainObjects||a.allowPrototypes||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if("object"!=typeof t)return[t].concat(r);var o=t;return Array.isArray(t)&&!Array.isArray(r)&&(o=n(t,a)),Array.isArray(t)&&Array.isArray(r)?(r.forEach(function(r,n){i.call(t,n)?t[n]&&"object"==typeof t[n]?t[n]=e(t[n],r,a):t.push(r):t[n]=r}),t):Object.keys(r).reduce(function(t,n){var o=r[n];return i.call(t,n)?t[n]=e(t[n],o,a):t[n]=o,t},o)}}},{}],277:[function(e,t,r){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,n){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var c=1e3;n&&"number"==typeof n.maxKeys&&(c=n.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var p=0;p=0?(l=m.substr(0,g),f=m.substr(g+1)):(l=m,f=""),h=decodeURIComponent(l),d=decodeURIComponent(f),i(o,h)?a(o[h])?o[h].push(d):o[h]=[o[h],d]:o[h]=d}return o};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],278:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?n(o(e),function(o){var s=encodeURIComponent(i(o))+r;return a(e[o])?n(e[o],function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[o]))}).join(t):s?encodeURIComponent(i(s))+r+encodeURIComponent(i(e)):""};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function n(e,t){if(e.map)return e.map(t);for(var r=[],i=0;in)throw new RangeError("requested too many random bytes");var i=o.allocUnsafe(e);if(e>0)if(e>a)for(var c=0;cp||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function f(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>p||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>c)throw new RangeError("buffer too small")}function h(e,r,i,a){if(t.browser){var n=e.buffer,s=new Uint8Array(n,r,i);return u.getRandomValues(s),a?void t.nextTick(function(){a(null,e)}):e}if(!a)return o(i).copy(e,r),e;o(i,function(t,i){if(t)return a(t);i.copy(e,r),a(null,e)})}u&&u.getRandomValues||!t.browser?(r.randomFill=function(e,t,r,a){if(!(s.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)a=t,t=0,r=e.length;else if("function"==typeof r)a=r,r=e.length-t;else if("function"!=typeof a)throw new TypeError('"cb" argument must be a function');return l(t,e.length),f(r,t,e.length),h(e,t,r,a)},r.randomFillSync=function(e,t,r){void 0===t&&(t=0);if(!(s.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(t,e.length),void 0===r&&(r=e.length-t);return f(r,t,e.length),h(e,t,r)}):(r.randomFill=a,r.randomFillSync=a)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:263,randombytes:280,"safe-buffer":314}],282:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":283}],283:[function(e,t,r){"use strict";var i=e("process-nextick-args"),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var n=e("core-util-is");n.inherits=e("inherits");var o=e("./_stream_readable"),s=e("./_stream_writable");n.inherits(l,o);for(var c=a(s.prototype),u=0;u0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):k(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?k(e,o,t,!1):E(e,o)):k(e,o,t,!1))):i||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(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 j(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?a.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),z(e)}function E(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;en.length?n.length:e;if(o===n.length?a+=n:a+=n.slice(0,e),0===(e-=o)){o===n.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=n.slice(o));break}++i}return t.length-=i,a}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,a=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var n=i.data,o=e>n.length?n.length:e;if(n.copy(r,r.length-e,0,o),0===(e-=o)){o===n.length?(++a,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=n.slice(o));break}++a}return t.length-=a,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function B(e,t){for(var r=0,i=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):j(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,a=t.needReadable;return h("need readable",a),(0===t.length||t.length-e0?C(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==i&&this.emit("data",i),i},y.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(e,t){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,h("pipe count=%d opts=%j",n.pipesCount,t);var c=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?p:y;function u(t,r){h("onunpipe"),t===i&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",b),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",g),e.removeListener("unpipe",u),i.removeListener("end",p),i.removeListener("end",y),i.removeListener("data",m),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function p(){h("onend"),e.end()}n.endEmitted?a.nextTick(c):i.once("end",c),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,z(e))}}(i);e.on("drain",l);var f=!1;var d=!1;function m(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==B(n.pipes,e))&&!f&&(h("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,d=!0),i.pause())}function g(t){h("onerror",t),y(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",v),y()}function v(){h("onfinish"),e.removeListener("close",b),y()}function y(){h("unpipe"),i.unpipe(e)}return i.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",b),e.once("finish",v),e.emit("pipe",i),n.flowing||(h("pipe resume"),i.resume()),e},y.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?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var n=0;n-1?a:n.nextTick;v.WritableState=b;var u=e("core-util-is");u.inherits=e("inherits");var p={deprecate:e("util-deprecate")},l=e("./internal/streams/stream"),f=e("safe-buffer").Buffer,h=i.Uint8Array||function(){};var d,m=e("./internal/streams/destroy");function g(){}function b(t,r){s=s||e("./_stream_duplex"),t=t||{};var i=r instanceof s;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var a=t.highWaterMark,u=t.writableHighWaterMark,p=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:i&&(u||0===u)?u:p,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.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,i=r.sync,a=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,a){--t.pendingcb,r?(n.nextTick(a,i),n.nextTick(j,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(a(i),e._writableState.errorEmitted=!0,e.emit("error",i),j(e,t))}(e,r,i,t,a);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||k(e,r),i?c(w,e,r,o,a):w(e,r,o,a)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function v(t){if(s=s||e("./_stream_duplex"),!(d.call(v,this)||this instanceof s))return new v(t);this._writableState=new b(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function y(e,t,r,i,a,n,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(a,t.onwrite):e._write(a,n,t.onwrite),t.sync=!1}function w(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),j(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,a=new Array(i),n=t.corkedRequestsFree;n.entry=r;for(var s=0,c=!0;r;)a[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;a.allBuffers=c,y(e,t,!0,t.length,a,"",n.finish),t.pendingcb++,t.lastBufferedRequest=null,n.next?(t.corkedRequestsFree=n.next,n.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,p=r.encoding,l=r.callback;if(y(e,t,!1,t.objectMode?1:u.length,u,p,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),j(e,t)})}function j(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n.nextTick(x,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(v,l),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:p.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]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===v&&(e&&e._writableState instanceof b)}})):d=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,r){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,f.isBuffer(i)||i instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=g),a.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),n.nextTick(t,r)}(this,r):(s||function(e,t,r,i){var a=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),n.nextTick(i,o),a=!1),a}(this,a,e,r))&&(a.pendingcb++,o=function(e,t,r,i,a,n){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,r));return t}(t,i,a);i!==o&&(r=!0,a="buffer",i=o)}var s=t.objectMode?1:i.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,r){var i=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,r){t.ending=!0,j(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":283,"./internal/streams/destroy":289,"./internal/streams/stream":290,_process:263,"core-util-is":115,inherits:205,"process-nextick-args":262,"safe-buffer":291,timers:372,"util-deprecate":385}],288:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("util");t.exports=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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t,r,a,n=i.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=n,a=s,t.copy(r,a),s+=o.data.length,o=o.next;return n},e}(),a&&a.inspect&&a.inspect.custom&&(t.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":291,util:77}],289:[function(e,t,r){"use strict";var i=e("process-nextick-args");function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||i.nextTick(a,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(i.nextTick(a,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),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.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":262}],290:[function(e,t,r){t.exports=e("events").EventEmitter},{events:154}],291:[function(e,t,r){var i=e("buffer"),a=i.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=i:(n(i,r),r.Buffer=o),n(a,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=a(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 a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:110}],292:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":293}],293:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":283,"./lib/_stream_passthrough.js":284,"./lib/_stream_readable.js":285,"./lib/_stream_transform.js":286,"./lib/_stream_writable.js":287}],294:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":293}],295:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":287}],296:[function(e,t,r){"use strict";var i=e("../"),a=e("lodash/isArray"),n=e("lodash/isFunction"),o=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!o(e))throw new TypeError(t);if(!n(e.request))throw new TypeError(t+".request");if(!a(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");var r=i({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),s=e.request.Request.prototype.init;e.request.Request.prototype.init=function(e){return!o(e)||this._callback||this._rp_promise||r.init.call(this,e),s.apply(this,arguments)};for(var c=!1,u=0;u-1}}t.exports=function(t){var a=e.env.NO_PROXY||e.env.no_proxy||"";return"*"===a?null:""!==a&&function(e,t){var a=e.port||("https:"===e.protocol?"443":"80"),n=r(e.hostname);return t.split(",").map(i).some(function(e){var t=n.indexOf(e.hostname),r=t>-1&&t===n.length-e.hostname.length;return e.hasPort?a===e.port&&r:r})}(t,a)?null:"http:"===t.protocol?e.env.HTTP_PROXY||e.env.http_proxy||null:"https:"===t.protocol&&(e.env.HTTPS_PROXY||e.env.https_proxy||e.env.HTTP_PROXY||e.env.http_proxy)||null}}).call(this,e("_process"))},{_process:263}],304:[function(e,t,r){"use strict";var i=e("fs"),a=e("querystring"),n=e("har-validator"),o=e("extend");function s(e){this.request=e}s.prototype.reducer=function(e,t){if(void 0===e[t.name])return e[t.name]=t.value,e;var r=[e[t.name],t.value];return e[t.name]=r,e},s.prototype.prep=function(e){if(e.queryObj={},e.headersObj={},e.postData.jsonObj=!1,e.postData.paramsObj=!1,e.queryString&&e.queryString.length&&(e.queryObj=e.queryString.reduce(this.reducer,{})),e.headers&&e.headers.length&&(e.headersObj=e.headers.reduceRight(function(e,t){return e[t.name]=t.value,e},{})),e.cookies&&e.cookies.length){var t=e.cookies.map(function(e){return e.name+"="+e.value});t.length&&(e.headersObj.cookie=t.join("; "))}function r(t){return t.some(function(t){return 0===e.postData.mimeType.indexOf(t)})}if(r(["multipart/mixed","multipart/related","multipart/form-data","multipart/alternative"]))e.postData.mimeType="multipart/form-data";else if(r(["application/x-www-form-urlencoded"]))e.postData.params?(e.postData.paramsObj=e.postData.params.reduce(this.reducer,{}),e.postData.text=a.stringify(e.postData.paramsObj)):e.postData.text="";else if(r(["text/json","text/x-json","application/json","application/x-json"])&&(e.postData.mimeType="application/json",e.postData.text))try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(t){this.request.debug(t),e.postData.mimeType="text/plain"}return e},s.prototype.options=function(e){if(!e.har)return e;var t={};if(o(t,e.har),t.log&&t.log.entries&&(t=t.log.entries[0]),t.url=t.url||e.url||e.uri||e.baseUrl||"/",t.httpVersion=t.httpVersion||"HTTP/1.1",t.queryString=t.queryString||[],t.headers=t.headers||[],t.cookies=t.cookies||[],t.postData=t.postData||{},t.postData.mimeType=t.postData.mimeType||"application/octet-stream",t.bodySize=0,t.headersSize=0,t.postData.size=0,!n.request(t))return e;var r=this.prep(t);function a(e){return 0===r.postData.mimeType.indexOf(e)}return r.url&&(e.url=r.url),r.method&&(e.method=r.method),Object.keys(r.queryObj).length&&(e.qs=r.queryObj),Object.keys(r.headersObj).length&&(e.headers=r.headersObj),a("application/x-www-form-urlencoded")?e.form=r.postData.paramsObj:a("application/json")?r.postData.jsonObj&&(e.body=r.postData.jsonObj,e.json=!0):a("multipart/form-data")?(e.formData={},r.postData.params.forEach(function(t){var r={};t.fileName||t.fileName||t.contentType?(t.fileName&&!t.value?r.value=i.createReadStream(t.fileName):t.value&&(r.value=t.value),t.fileName&&(r.options={filename:t.fileName,contentType:t.contentType?t.contentType:null}),e.formData[t.name]=r):e.formData[t.name]=t.value})):r.postData.text&&(e.body=r.postData.text),e},r.Har=s},{extend:156,fs:107,"har-validator":183,querystring:279}],305:[function(e,t,r){"use strict";var i=e("crypto");r.calculateMac=function(e,t){var r="hawk.1.header\n"+t.ts+"\n"+t.nonce+"\n"+(t.method||"").toUpperCase()+"\n"+t.resource+"\n"+t.host.toLowerCase()+"\n"+t.port+"\n"+(t.hash||"")+"\n";return t.ext&&(r+=t.ext.replace("\\","\\\\").replace("\n","\\n")),r+="\n",t.app&&(r=r+t.app+"\n"+(t.dlg||"")+"\n"),i.createHmac(e.algorithm,e.key).update(r).digest("base64")},r.header=function(e,t,a){var n=a.timestamp||Math.floor((Date.now()+(a.localtimeOffsetMsec||0))/1e3),o=a.credentials;if(!(o&&o.id&&o.key&&o.algorithm))return"";if(-1===["sha1","sha256"].indexOf(o.algorithm))return"";var s,c,u,p,l,f,h={ts:n,nonce:a.nonce||(s=6,c=6*(s+1),i.randomBytes(Math.ceil(c/8)).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"").slice(0,s)),method:t,resource:e.pathname+(e.search||""),host:e.hostname,port:e.port||("http:"===e.protocol?80:443),hash:a.hash,ext:a.ext,app:a.app,dlg:a.dlg};h.hash||!a.payload&&""!==a.payload||(h.hash=(u=a.payload,p=o.algorithm,l=a.contentType,(f=i.createHash(p)).update("hawk.1.payload\n"),f.update((l?l.split(";")[0].trim().toLowerCase():"")+"\n"),f.update(u||""),f.update("\n"),f.digest("base64")));var d=r.calculateMac(o,h),m=null!==h.ext&&void 0!==h.ext&&""!==h.ext,g='Hawk id="'+o.id+'", ts="'+h.ts+'", nonce="'+h.nonce+(h.hash?'", hash="'+h.hash:"")+(m?'", ext="'+h.ext.replace(/\\/g,"\\\\").replace(/"/g,'\\"'):"")+'", mac="'+d+'"';return h.app&&(g=g+', app="'+h.app+(h.dlg?'", dlg="'+h.dlg:"")+'"'),g}},{crypto:121}],306:[function(e,t,r){(function(t,i){"use strict";var a=e("json-stringify-safe"),n=e("crypto"),o=e("safe-buffer").Buffer,s=void 0===i?t.nextTick:i;r.paramsHaveRequestBody=function(e){return e.body||e.requestBodyStream||e.json&&"boolean"!=typeof e.json||e.multipart},r.safeStringify=function(e,t){var r;try{r=JSON.stringify(e,t)}catch(i){r=a(e,t)}return r},r.md5=function(e){return n.createHash("md5").update(e).digest("hex")},r.isReadStream=function(e){return e.readable&&e.path&&e.mode},r.toBase64=function(e){return o.from(e||"","utf8").toString("base64")},r.copy=function(e){var t={};return Object.keys(e).forEach(function(r){t[r]=e[r]}),t},r.version=function(){var e=t.version.replace("v","").split(".");return{major:parseInt(e[0],10),minor:parseInt(e[1],10),patch:parseInt(e[2],10)}},r.defer=s}).call(this,e("_process"),e("timers").setImmediate)},{_process:263,crypto:121,"json-stringify-safe":213,"safe-buffer":314,timers:372}],307:[function(e,t,r){"use strict";var i=e("uuid/v4"),a=e("combined-stream"),n=e("isstream"),o=e("safe-buffer").Buffer;function s(e){this.request=e,this.boundary=i(),this.chunked=!1,this.body=null}s.prototype.isChunked=function(e){var t=this,r=!1,i=e.data||e;return i.forEach||t.request.emit("error",new Error("Argument error, options.multipart.")),void 0!==e.chunked&&(r=e.chunked),"chunked"===t.request.getHeader("transfer-encoding")&&(r=!0),r||i.forEach(function(e){void 0===e.body&&t.request.emit("error",new Error("Body attribute missing in multipart.")),n(e.body)&&(r=!0)}),r},s.prototype.setHeaders=function(e){e&&!this.request.hasHeader("transfer-encoding")&&this.request.setHeader("transfer-encoding","chunked");var t=this.request.getHeader("content-type");t&&-1!==t.indexOf("multipart")?-1!==t.indexOf("boundary")?this.boundary=t.replace(/.*boundary=([^\s;]+).*/,"$1"):this.request.setHeader("content-type",t+"; boundary="+this.boundary):this.request.setHeader("content-type","multipart/related; boundary="+this.boundary)},s.prototype.build=function(e,t){var r=this,i=t?new a:[];function n(e){return"number"==typeof e&&(e=e.toString()),t?i.append(e):i.push(o.from(e))}return r.request.preambleCRLF&&n("\r\n"),e.forEach(function(e){var t="--"+r.boundary+"\r\n";Object.keys(e).forEach(function(r){"body"!==r&&(t+=r+": "+e[r]+"\r\n")}),n(t+="\r\n"),n(e.body),n("\r\n")}),n("--"+r.boundary+"--"),r.request.postambleCRLF&&n("\r\n"),i},s.prototype.onRequest=function(e){var t=this.isChunked(e),r=e.data||e;this.setHeaders(t),this.chunked=t,this.body=this.build(r,t)},r.Multipart=s},{"combined-stream":114,isstream:209,"safe-buffer":314,"uuid/v4":391}],308:[function(e,t,r){"use strict";var i=e("url"),a=e("qs"),n=e("caseless"),o=e("uuid/v4"),s=e("oauth-sign"),c=e("crypto"),u=e("safe-buffer").Buffer;function p(e){this.request=e,this.params=null}p.prototype.buildParams=function(e,t,r,i,a,n){var c={};for(var u in e)c["oauth_"+u]=e[u];c.oauth_version||(c.oauth_version="1.0"),c.oauth_timestamp||(c.oauth_timestamp=Math.floor(Date.now()/1e3).toString()),c.oauth_nonce||(c.oauth_nonce=o().replace(/-/g,"")),c.oauth_signature_method||(c.oauth_signature_method="HMAC-SHA1");var p=c.oauth_consumer_secret||c.oauth_private_key;delete c.oauth_consumer_secret,delete c.oauth_private_key;var l=c.oauth_token_secret;delete c.oauth_token_secret;var f=c.oauth_realm;delete c.oauth_realm,delete c.oauth_transport_method;var h=t.protocol+"//"+t.host+t.pathname,d=n.parse([].concat(i,a,n.stringify(c)).join("&"));return c.oauth_signature=s.sign(c.oauth_signature_method,r,h,d,p,l),f&&(c.realm=f),c},p.prototype.buildBodyHash=function(e,t){["HMAC-SHA1","RSA-SHA1"].indexOf(e.signature_method||"HMAC-SHA1")<0&&this.request.emit("error",new Error("oauth: "+e.signature_method+" signature_method not supported with body_hash signing."));var r=c.createHash("sha1");r.update(t||"");var i=r.digest("hex");return u.from(i,"hex").toString("base64")},p.prototype.concatParams=function(e,t,r){r=r||"";var i=Object.keys(e).filter(function(e){return"realm"!==e&&"oauth_signature"!==e}).sort();return e.realm&&i.splice(0,0,"realm"),i.push("oauth_signature"),i.map(function(t){return t+"="+r+s.rfc3986(e[t])+r}).join(t)},p.prototype.onRequest=function(e){this.params=e;var t,r,o=this.request.uri||{},s=this.request.method||"",c=n(this.request.headers),u=this.request.body||"",p=this.request.qsLib||a,l=c.get("content-type")||"",f="application/x-www-form-urlencoded",h=e.transport_method||"header";l.slice(0,f.length)===f&&(l=f,t=u),o.query&&(r=o.query),"body"!==h||"POST"===s&&l===f||this.request.emit("error",new Error("oauth: transport_method of body requires POST and content-type "+f)),t||"boolean"!=typeof e.body_hash||(e.body_hash=this.buildBodyHash(e,this.request.body.toString()));var d=this.buildParams(e,o,s,r,t,p);switch(h){case"header":this.request.setHeader("Authorization","OAuth "+this.concatParams(d,",",'"'));break;case"query":var m=this.request.uri.href+=(r?"&":"?")+this.concatParams(d,"&");this.request.uri=i.parse(m),this.request.path=this.request.uri.path;break;case"body":this.request.body=(t?t+"&":"")+this.concatParams(d,"&");break;default:this.request.emit("error",new Error("oauth: transport_method invalid"))}},r.OAuth=p},{caseless:112,crypto:121,"oauth-sign":236,qs:273,"safe-buffer":314,url:383,"uuid/v4":391}],309:[function(e,t,r){"use strict";var i=e("qs"),a=e("querystring");function n(e){this.request=e,this.lib=null,this.useQuerystring=null,this.parseOptions=null,this.stringifyOptions=null}n.prototype.init=function(e){this.lib||(this.useQuerystring=e.useQuerystring,this.lib=this.useQuerystring?a:i,this.parseOptions=e.qsParseOptions||{},this.stringifyOptions=e.qsStringifyOptions||{})},n.prototype.stringify=function(e){return this.useQuerystring?this.rfc3986(this.lib.stringify(e,this.stringifyOptions.sep||null,this.stringifyOptions.eq||null,this.stringifyOptions)):this.lib.stringify(e,this.stringifyOptions)},n.prototype.parse=function(e){return this.useQuerystring?this.lib.parse(e,this.parseOptions.sep||null,this.parseOptions.eq||null,this.parseOptions):this.lib.parse(e,this.parseOptions)},n.prototype.rfc3986=function(e){return e.replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},n.prototype.unescape=a.unescape,r.Querystring=n},{qs:273,querystring:279}],310:[function(e,t,r){"use strict";var i=e("url"),a=/^https?:/;function n(e){this.request=e,this.followRedirect=!0,this.followRedirects=!0,this.followAllRedirects=!1,this.followOriginalHttpMethod=!1,this.allowRedirect=function(){return!0},this.maxRedirects=10,this.redirects=[],this.redirectsFollowed=0,this.removeRefererHeader=!1}n.prototype.onRequest=function(e){void 0!==e.maxRedirects&&(this.maxRedirects=e.maxRedirects),"function"==typeof e.followRedirect&&(this.allowRedirect=e.followRedirect),void 0!==e.followRedirect&&(this.followRedirects=!!e.followRedirect),void 0!==e.followAllRedirects&&(this.followAllRedirects=e.followAllRedirects),(this.followRedirects||this.followAllRedirects)&&(this.redirects=this.redirects||[]),void 0!==e.removeRefererHeader&&(this.removeRefererHeader=e.removeRefererHeader),void 0!==e.followOriginalHttpMethod&&(this.followOriginalHttpMethod=e.followOriginalHttpMethod)},n.prototype.redirectTo=function(e){var t=this.request,r=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var i=e.caseless.get("location");if(t.debug("redirect",i),this.followAllRedirects)r=i;else if(this.followRedirects)switch(t.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:r=i}}else if(401===e.statusCode){var a=t._auth.onResponse(e);a&&(t.setHeader("authorization",a),r=t.uri)}return r},n.prototype.onResponse=function(e){var t=this.request,r=this.redirectTo(e);if(!r||!this.allowRedirect.call(t,e))return!1;if(t.debug("redirect to",r),e.resume&&e.resume(),this.redirectsFollowed>=this.maxRedirects)return t.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+t.uri.href)),!1;this.redirectsFollowed+=1,a.test(r)||(r=i.resolve(t.uri.href,r));var n=t.uri;return t.uri=i.parse(r),t.uri.protocol!==n.protocol&&delete t.agent,this.redirects.push({statusCode:e.statusCode,redirectUri:r}),this.followAllRedirects&&"HEAD"!==t.method&&401!==e.statusCode&&307!==e.statusCode&&(t.method=this.followOriginalHttpMethod?t.method:"GET"),delete t.src,delete t.req,delete t._started,401!==e.statusCode&&307!==e.statusCode&&(delete t.body,delete t._form,t.headers&&(t.removeHeader("host"),t.removeHeader("content-type"),t.removeHeader("content-length"),t.uri.hostname!==t.originalHost.split(":")[0]&&t.removeHeader("authorization"))),this.removeRefererHeader||t.setHeader("referer",n.href),t.emit("redirect"),t.init(),!0},r.Redirect=n},{url:383}],311:[function(e,t,r){"use strict";var i=e("url"),a=e("tunnel-agent"),n=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],o=["proxy-authorization"];function s(e){this.request=e,this.proxyHeaderWhiteList=n,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}s.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},s.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=i.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,n,s,c,u=this.proxyHeaderExclusiveList.concat(o),p=this.proxyHeaderWhiteList.concat(u),l=function(e,t){var r=t.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{});return Object.keys(e).filter(function(e){return r[e.toLowerCase()]}).reduce(function(t,r){return t[r]=e[r],t},{})}(t.headers,p);l.host=(r=t.uri,n=r.port,s=r.protocol,c=r.hostname+":",c+=n||("https:"===s?"443":"80")),u.forEach(t.removeHeader,t);var f=function(e){var t=function(e,t){return["https:"===e.protocol?"https":"http","https:"===t.protocol?"Https":"Http"].join("Over")}(e.uri,e.proxy);return a[t]}(t),h=function(e,t){var r=e.proxy;return{proxy:{host:r.hostname,port:+r.port,proxyAuth:r.auth,headers:t},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol}}(t,l);return t.agent=f(h),!0},s.defaultProxyHeaderWhiteList=n,s.defaultProxyHeaderExclusiveList=o,r.Tunnel=s},{"tunnel-agent":380,url:383}],312:[function(e,t,r){(function(r){"use strict";var i=e("http"),a=e("https"),n=e("url"),o=e("util"),s=e("stream"),c=e("zlib"),u=e("aws-sign2"),p=e("aws4"),l=e("http-signature"),f=e("mime-types"),h=e("caseless"),d=e("forever-agent"),m=e("form-data"),g=e("extend"),b=e("isstream"),v=e("is-typedarray").strict,y=e("./lib/helpers"),w=e("./lib/cookies"),k=e("./lib/getProxyFromURI"),_=e("./lib/querystring").Querystring,x=e("./lib/har").Har,j=e("./lib/auth").Auth,S=e("./lib/oauth").OAuth,E=e("./lib/hawk"),A=e("./lib/multipart").Multipart,F=e("./lib/redirect").Redirect,P=e("./lib/tunnel").Tunnel,z=e("performance-now"),C=e("safe-buffer").Buffer,O=y.safeStringify,T=y.isReadStream,B=y.toBase64,I=y.defer,R=y.copy,q=y.version,M=w.jar(),D={};function L(){return{uri:this.uri,method:this.method,headers:this.headers}}function N(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:L.call(this.request)}}function U(e){e.har&&(this._har=new x(this),e=this._har.options(e)),s.Stream.call(this);var t=Object.keys(U.prototype),r=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(t,e);g(this,r),e=function(e,t){var r={};for(var i in t){var a=!(-1===e.indexOf(i)),n="function"==typeof t[i];a&&n||(r[i]=t[i])}return r}(t,e),this.readable=!0,this.writable=!0,e.method&&(this.explicitMethod=!0),this._qs=new _(this),this._auth=new j(this),this._oauth=new S(this),this._multipart=new A(this),this._redirect=new F(this),this._tunnel=new P(this),this.init(e)}function H(){U.debug&&console.error("REQUEST %s",o.format.apply(o,arguments))}o.inherits(U,s.Stream),U.debug=r.env.NODE_DEBUG&&/\brequest\b/.test(r.env.NODE_DEBUG),U.prototype.debug=H,U.prototype.init=function(e){var t=this;for(var r in e||(e={}),t.headers=t.headers?R(t.headers):{},t.headers)void 0===t.headers[r]&&delete t.headers[r];if(h.httpify(t,t.headers),t.method||(t.method=e.method||"GET"),t.localAddress||(t.localAddress=e.localAddress),t._qs.init(e),H(e),t.pool||!1===t.pool||(t.pool=D),t.dests=t.dests||[],t.__isRequestRequest=!0,!t._callback&&t.callback&&(t._callback=t.callback,t.callback=function(){t._callbackCalled||(t._callbackCalled=!0,t._callback.apply(t,arguments))},t.on("error",t.callback.bind()),t.on("complete",t.callback.bind(t,null))),!t.uri&&t.url&&(t.uri=t.url,delete t.url),t.baseUrl){if("string"!=typeof t.baseUrl)return t.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof t.uri)return t.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===t.uri.indexOf("//")||-1!==t.uri.indexOf("://"))return t.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var o=t.baseUrl.lastIndexOf("/")===t.baseUrl.length-1,s=0===t.uri.indexOf("/");o&&s?t.uri=t.baseUrl+t.uri.slice(1):o||s?t.uri=t.baseUrl+t.uri:""===t.uri?t.uri=t.baseUrl:t.uri=t.baseUrl+"/"+t.uri,delete t.baseUrl}if(!t.uri)return t.emit("error",new Error("options.uri is a required argument"));if("string"==typeof t.uri&&(t.uri=n.parse(t.uri)),t.uri.href||(t.uri.href=n.format(t.uri)),"unix:"===t.uri.protocol)return t.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===t.uri.host&&t.enableUnixSocket(),!1===t.strictSSL&&(t.rejectUnauthorized=!1),t.uri.pathname||(t.uri.pathname="/"),!(t.uri.host||t.uri.hostname&&t.uri.port||t.uri.isUnix)){var c='Invalid URI "'+n.format(t.uri)+'"';return 0===Object.keys(e).length&&(c+=". This can be caused by a crappy redirection."),t.abort(),t.emit("error",new Error(c))}if(t.hasOwnProperty("proxy")||(t.proxy=k(t.uri)),t.tunnel=t._tunnel.isEnabled(),t.proxy&&t._tunnel.setup(e),t._redirect.onRequest(e),t.setHost=!1,!t.hasHeader("host")){var u=t.originalHostHeaderName||"host";t.setHeader(u,t.uri.host),t.uri.port&&("80"===t.uri.port&&"http:"===t.uri.protocol||"443"===t.uri.port&&"https:"===t.uri.protocol)&&t.setHeader(u,t.uri.hostname),t.setHost=!0}if(t.jar(t._jar||e.jar),t.uri.port||("http:"===t.uri.protocol?t.uri.port=80:"https:"===t.uri.protocol&&(t.uri.port=443)),t.proxy&&!t.tunnel?(t.port=t.proxy.port,t.host=t.proxy.hostname):(t.port=t.uri.port,t.host=t.uri.hostname),e.form&&t.form(e.form),e.formData){var p=e.formData,l=t.form(),m=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?l.append(e,t.value,t.options):l.append(e,t)};for(var g in p)if(p.hasOwnProperty(g)){var y=p[g];if(y instanceof Array)for(var w=0;w=100&&s<200||204===s||304===s))o=e;else{var u=e.headers["content-encoding"]||"identity";u=u.trim().toLowerCase();var p={flush:c.Z_SYNC_FLUSH,finishFlush:c.Z_SYNC_FLUSH};"gzip"===u?(o=c.createGunzip(p),e.pipe(o)):"deflate"===u?(o=c.createInflate(p),e.pipe(o)):("identity"!==u&&H("ignoring unrecognized Content-Encoding "+u),o=e)}t.encoding&&(0!==t.dests.length?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):o.setEncoding(t.encoding)),t._paused&&o.pause(),t.responseContent=o,t.emit("response",e),t.dests.forEach(function(e){t.pipeDest(e)}),o.on("data",function(r){t.timing&&!t.responseStarted&&(t.responseStartTime=(new Date).getTime(),e.responseStartTime=t.responseStartTime),t._destdata=!0,t.emit("data",r)}),o.once("end",function(e){t.emit("end",e)}),o.on("error",function(e){t.emit("error",e)}),o.on("close",function(){t.emit("close")}),t.callback?t.readResponseBody(e):t.on("end",function(){t._aborted?H("aborted",t.uri.href):t.emit("complete",e)}),H("finish init function",t.uri.href)}}else{H("strict ssl error",t.uri.href);var l=e.hasOwnProperty("socket")?e.socket.authorizationError:t.uri.href+" does not support SSL";t.emit("error",new Error("SSL Error: "+l))}},U.prototype.readResponseBody=function(e){var t=this;H("reading response's body");var r=[],i=0,a=[];t.on("data",function(e){C.isBuffer(e)?e.length&&(i+=e.length,r.push(e)):a.push(e)}),t.on("end",function(){if(H("end event",t.uri.href),t._aborted)return H("aborted",t.uri.href),r=[],void(i=0);if(i?(H("has body",t.uri.href,i),e.body=C.concat(r,i),null!==t.encoding&&(e.body=e.body.toString(t.encoding)),r=[],i=0):a.length&&("utf8"===t.encoding&&a[0].length>0&&"\ufeff"===a[0][0]&&(a[0]=a[0].substring(1)),e.body=a.join("")),t._json)try{e.body=JSON.parse(e.body,t._jsonReviver)}catch(e){H("invalid JSON received",t.uri.href)}H("emitting complete",t.uri.href),void 0!==e.body||t._json||(e.body=null===t.encoding?C.alloc(0):""),t.emit("complete",e,e.body)})},U.prototype.abort=function(){this._aborted=!0,this.req?this.req.abort():this.response&&this.response.destroy(),this.emit("abort")},U.prototype.pipeDest=function(e){var t=this.response;if(e.headers&&!e.headersSent){if(t.caseless.has("content-type")){var r=t.caseless.has("content-type");e.setHeader?e.setHeader(r,t.headers[r]):e.headers[r]=t.headers[r]}if(t.caseless.has("content-length")){var i=t.caseless.has("content-length");e.setHeader?e.setHeader(i,t.headers[i]):e.headers[i]=t.headers[i]}}if(e.setHeader&&!e.headersSent){for(var a in t.headers)this.gzip&&"content-encoding"===a||e.setHeader(a,t.headers[a]);e.statusCode=t.statusCode}this.pipefilter&&this.pipefilter(t,e)},U.prototype.qs=function(e,t){var r;for(var i in r=!t&&this.uri.query?this._qs.parse(this.uri.query):{},e)r[i]=e[i];var a=this._qs.stringify(r);return""===a?this:(this.uri=n.parse(this.uri.href.split("?")[0]+"?"+a),this.url=this.uri,this.path=this.uri.path,"unix"===this.uri.host&&this.enableUnixSocket(),this)},U.prototype.form=function(e){var t=this;return e?(/^application\/x-www-form-urlencoded\b/.test(t.getHeader("content-type"))||t.setHeader("content-type","application/x-www-form-urlencoded"),t.body="string"==typeof e?t._qs.rfc3986(e.toString("utf8")):t._qs.stringify(e).toString("utf8"),t):(t._form=new m,t._form.on("error",function(e){e.message="form-data: "+e.message,t.emit("error",e),t.abort()}),t._form)},U.prototype.multipart=function(e){return this._multipart.onRequest(e),this._multipart.chunked||(this.body=this._multipart.body),this},U.prototype.json=function(e){return this.hasHeader("accept")||this.setHeader("accept","application/json"),"function"==typeof this.jsonReplacer&&(this._jsonReplacer=this.jsonReplacer),this._json=!0,"boolean"==typeof e?void 0!==this.body&&(/^application\/x-www-form-urlencoded\b/.test(this.getHeader("content-type"))?this.body=this._qs.rfc3986(this.body):this.body=O(this.body,this._jsonReplacer),this.hasHeader("content-type")||this.setHeader("content-type","application/json")):(this.body=O(e,this._jsonReplacer),this.hasHeader("content-type")||this.setHeader("content-type","application/json")),"function"==typeof this.jsonReviver&&(this._jsonReviver=this.jsonReviver),this},U.prototype.getHeader=function(e,t){var r,i;return t||(t=this.headers),Object.keys(t).forEach(function(a){a.length===e.length&&(i=new RegExp(e,"i"),a.match(i)&&(r=t[a]))}),r},U.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":"),t=e[0],r=e[1];this.socketPath=t,this.uri.pathname=r,this.uri.path=r,this.uri.host=t,this.uri.hostname=t,this.uri.isUnix=!0},U.prototype.auth=function(e,t,r,i){return this._auth.onRequest(e,t,r,i),this},U.prototype.aws=function(e,t){if(!t)return this._aws=e,this;if(4===e.sign_version||"4"===e.sign_version){var r={host:this.uri.host,path:this.uri.path,method:this.method,headers:this.headers,body:this.body};e.service&&(r.service=e.service);var i=p.sign(r,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});this.setHeader("authorization",i.headers.Authorization),this.setHeader("x-amz-date",i.headers["X-Amz-Date"]),i.headers["X-Amz-Security-Token"]&&this.setHeader("x-amz-security-token",i.headers["X-Amz-Security-Token"])}else{var a=new Date;this.setHeader("date",a.toUTCString());var n={key:e.key,secret:e.secret,verb:this.method.toUpperCase(),date:a,contentType:this.getHeader("content-type")||"",md5:this.getHeader("content-md5")||"",amazonHeaders:u.canonicalizeHeaders(this.headers)},o=this.uri.path;e.bucket&&o?n.resource="/"+e.bucket+o:e.bucket&&!o?n.resource="/"+e.bucket:!e.bucket&&o?n.resource=o:e.bucket||o||(n.resource="/"),n.resource=u.canonicalizeResource(n.resource),this.setHeader("authorization",u.authorization(n))}return this},U.prototype.httpSignature=function(e){var t=this;return l.signRequest({getHeader:function(e){return t.getHeader(e,t.headers)},setHeader:function(e,r){t.setHeader(e,r)},method:t.method,path:t.path},e),H("httpSignature authorization",t.getHeader("authorization")),t},U.prototype.hawk=function(e){this.setHeader("Authorization",E.header(this.uri,this.method,e))},U.prototype.oauth=function(e){return this._oauth.onRequest(e),this},U.prototype.jar=function(e){var t;if(0===this._redirect.redirectsFollowed&&(this.originalCookieHeader=this.getHeader("cookie")),e){var r=e&&e.getCookieString?e:M,i=this.uri.href;r&&(t=r.getCookieString(i))}else t=!1,this._disableCookies=!0;return t&&t.length&&(this.originalCookieHeader?this.setHeader("cookie",this.originalCookieHeader+"; "+t):this.setHeader("cookie",t)),this._jar=e,this},U.prototype.pipe=function(e,t){if(!this.response)return this.dests.push(e),s.Stream.prototype.pipe.call(this,e,t),e;if(this._destdata)this.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else{if(!this._ended)return s.Stream.prototype.pipe.call(this,e,t),this.pipeDest(e),e;this.emit("error",new Error("You cannot pipe after the response has been ended."))}},U.prototype.write=function(){if(!this._aborted)return this._started||this.start(),this.req?this.req.write.apply(this.req,arguments):void 0},U.prototype.end=function(e){this._aborted||(e&&this.write(e),this._started||this.start(),this.req&&this.req.end())},U.prototype.pause=function(){this.responseContent?this.responseContent.pause.apply(this.responseContent,arguments):this._paused=!0},U.prototype.resume=function(){this.responseContent?this.responseContent.resume.apply(this.responseContent,arguments):this._paused=!1},U.prototype.destroy=function(){this._ended?this.response&&this.response.destroy():this.end()},U.defaultProxyHeaderWhiteList=P.defaultProxyHeaderWhiteList.slice(),U.defaultProxyHeaderExclusiveList=P.defaultProxyHeaderExclusiveList.slice(),U.prototype.toJSON=L,t.exports=U}).call(this,e("_process"))},{"./lib/auth":301,"./lib/cookies":302,"./lib/getProxyFromURI":303,"./lib/har":304,"./lib/hawk":305,"./lib/helpers":306,"./lib/multipart":307,"./lib/oauth":308,"./lib/querystring":309,"./lib/redirect":310,"./lib/tunnel":311,_process:263,"aws-sign2":69,aws4:70,caseless:112,extend:156,"forever-agent":160,"form-data":161,http:351,"http-signature":198,https:203,"is-typedarray":207,isstream:209,"mime-types":232,"performance-now":261,"safe-buffer":314,stream:350,url:383,util:388,zlib:106}],313:[function(e,t,r){"use strict";var i=e("buffer").Buffer,a=e("inherits"),n=e("hash-base"),o=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function d(e,t){return e<>>32-t}function m(e,t,r,i,a,n,o,s){return d(e+(t^r^i)+n+o|0,s)+a|0}function g(e,t,r,i,a,n,o,s){return d(e+(t&r|~t&i)+n+o|0,s)+a|0}function b(e,t,r,i,a,n,o,s){return d(e+((t|~r)^i)+n+o|0,s)+a|0}function v(e,t,r,i,a,n,o,s){return d(e+(t&i|r&~i)+n+o|0,s)+a|0}function y(e,t,r,i,a,n,o,s){return d(e+(t^(r|~i))+n+o|0,s)+a|0}a(h,n),h.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,i=0|this._b,a=0|this._c,n=0|this._d,h=0|this._e,w=0|this._a,k=0|this._b,_=0|this._c,x=0|this._d,j=0|this._e,S=0;S<80;S+=1){var E,A;S<16?(E=m(r,i,a,n,h,e[s[S]],l[0],u[S]),A=y(w,k,_,x,j,e[c[S]],f[0],p[S])):S<32?(E=g(r,i,a,n,h,e[s[S]],l[1],u[S]),A=v(w,k,_,x,j,e[c[S]],f[1],p[S])):S<48?(E=b(r,i,a,n,h,e[s[S]],l[2],u[S]),A=b(w,k,_,x,j,e[c[S]],f[2],p[S])):S<64?(E=v(r,i,a,n,h,e[s[S]],l[3],u[S]),A=g(w,k,_,x,j,e[c[S]],f[3],p[S])):(E=y(r,i,a,n,h,e[s[S]],l[4],u[S]),A=m(w,k,_,x,j,e[c[S]],f[4],p[S])),r=h,h=n,n=d(a,10),a=i,i=E,w=j,j=x,x=d(_,10),_=k,k=A}var F=this._b+a+x|0;this._b=this._c+n+j|0,this._c=this._d+h+w|0,this._d=this._e+r+k|0,this._e=this._a+i+_|0,this._a=F},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.alloc?i.alloc(20):new i(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=h},{buffer:110,"hash-base":184,inherits:205}],314:[function(e,t,r){var i=e("buffer"),a=i.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=i:(n(i,r),r.Buffer=o),o.prototype=Object.create(a.prototype),n(a,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=a(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 a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:110}],315:[function(e,t,r){(function(r){"use strict";var i,a=e("buffer"),n=a.Buffer,o={};for(i in a)a.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(o[i]=a[i]);var s=o.Buffer={};for(i in n)n.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(s[i]=n[i]);if(o.Buffer.prototype=n.prototype,s.from&&s.from!==Uint8Array.from||(s.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 n(e,t,r)}),s.alloc||(s.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 i=n(e);return t&&0!==t.length?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i}),!o.kStringMaxLength)try{o.kStringMaxLength=r.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),t.exports=o}).call(this,e("_process"))},{_process:263,buffer:110}],316:[function(e,t,r){var i=e("safe-buffer").Buffer;function a(e,t){this._block=i.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}a.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=i.from(e,t));for(var r=this._block,a=this._blockSize,n=e.length,o=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,a=(r-i)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var n=this._hash();return e?n.toString(e):n},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=a},{"safe-buffer":314}],317:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":318,"./sha1":319,"./sha224":320,"./sha256":321,"./sha384":322,"./sha512":323}],318:[function(e,t,r){var i=e("inherits"),a=e("./hash"),n=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,a.call(this,64,56)}function u(e){return e<<30|e>>>2}function p(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}i(c,a),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,a=0|this._b,n=0|this._c,s=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var f=0;f<80;++f){var h=~~(f/20),d=0|((t=i)<<5|t>>>27)+p(h,a,n,s)+c+r[f]+o[h];c=s,s=n,n=u(a),a=i,i=d}this._a=i+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=n.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":316,inherits:205,"safe-buffer":314}],319:[function(e,t,r){var i=e("inherits"),a=e("./hash"),n=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,a.call(this,64,56)}function u(e){return e<<5|e>>>27}function p(e){return e<<30|e>>>2}function l(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}i(c,a),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,a=0|this._b,n=0|this._c,s=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=(t=r[f-3]^r[f-8]^r[f-14]^r[f-16])<<1|t>>>31;for(var h=0;h<80;++h){var d=~~(h/20),m=u(i)+l(d,a,n,s)+c+r[h]+o[d]|0;c=s,s=n,n=p(a),a=i,i=m}this._a=i+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=n.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":316,inherits:205,"safe-buffer":314}],320:[function(e,t,r){var i=e("inherits"),a=e("./sha256"),n=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,n.call(this,64,56)}i(c,a),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=c},{"./hash":316,"./sha256":321,inherits:205,"safe-buffer":314}],321:[function(e,t,r){var i=e("inherits"),a=e("./hash"),n=e("safe-buffer").Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function p(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}i(c,a),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,a=0|this._b,n=0|this._c,s=0|this._d,c=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,b=0;b<16;++b)r[b]=e.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((t=r[b-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[b-7]+h(r[b-15])+r[b-16];for(var v=0;v<64;++v){var y=g+f(c)+u(c,d,m)+o[v]+r[v]|0,w=l(i)+p(i,a,n)|0;g=m,m=d,d=c,c=s+y|0,s=n,n=a,a=i,i=y+w|0}this._a=i+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=n.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=c},{"./hash":316,inherits:205,"safe-buffer":314}],322:[function(e,t,r){var i=e("inherits"),a=e("./sha512"),n=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,n.call(this,128,112)}i(c,a),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},t.exports=c},{"./hash":316,"./sha512":323,inherits:205,"safe-buffer":314}],323:[function(e,t,r){var i=e("inherits"),a=e("./hash"),n=e("safe-buffer").Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function p(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function b(e,t){return e>>>0>>0?1:0}i(c,a),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,i=0|this._bh,a=0|this._ch,n=0|this._dh,s=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,k=0|this._bl,_=0|this._cl,x=0|this._dl,j=0|this._el,S=0|this._fl,E=0|this._gl,A=0|this._hl,F=0;F<32;F+=2)t[F]=e.readInt32BE(4*F),t[F+1]=e.readInt32BE(4*F+4);for(;F<160;F+=2){var P=t[F-30],z=t[F-30+1],C=h(P,z),O=d(z,P),T=m(P=t[F-4],z=t[F-4+1]),B=g(z,P),I=t[F-14],R=t[F-14+1],q=t[F-32],M=t[F-32+1],D=O+R|0,L=C+I+b(D,O)|0;L=(L=L+T+b(D=D+B|0,B)|0)+q+b(D=D+M|0,M)|0,t[F]=L,t[F+1]=D}for(var N=0;N<160;N+=2){L=t[N],D=t[N+1];var U=p(r,i,a),H=p(w,k,_),K=l(r,w),$=l(w,r),V=f(s,j),Z=f(j,s),W=o[N],G=o[N+1],Q=u(s,c,v),X=u(j,S,E),Y=A+Z|0,J=y+V+b(Y,A)|0;J=(J=(J=J+Q+b(Y=Y+X|0,X)|0)+W+b(Y=Y+G|0,G)|0)+L+b(Y=Y+D|0,D)|0;var ee=$+H|0,te=K+U+b(ee,$)|0;y=v,A=E,v=c,E=S,c=s,S=j,s=n+J+b(j=x+Y|0,x)|0,n=a,x=_,a=i,_=k,i=r,k=w,r=J+te+b(w=Y+ee|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+k|0,this._cl=this._cl+_|0,this._dl=this._dl+x|0,this._el=this._el+j|0,this._fl=this._fl+S|0,this._gl=this._gl+E|0,this._hl=this._hl+A|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+i+b(this._bl,k)|0,this._ch=this._ch+a+b(this._cl,_)|0,this._dh=this._dh+n+b(this._dl,x)|0,this._eh=this._eh+s+b(this._el,j)|0,this._fh=this._fh+c+b(this._fl,S)|0,this._gh=this._gh+v+b(this._gl,E)|0,this._hh=this._hh+y+b(this._hl,A)|0},c.prototype._hash=function(){var e=n.allocUnsafe(64);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},t.exports=c},{"./hash":316,inherits:205,"safe-buffer":314}],324:[function(e,t,r){var i=e("safer-buffer").Buffer,a={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};a.curve25519=a.ed25519;var n={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};n.curve25519=n.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:a,privInfo:n,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":315}],325:[function(e,t,r){t.exports=g;var i=e("assert-plus"),a=e("safer-buffer").Buffer,n=e("./algs"),o=e("crypto"),s=e("./fingerprint"),c=(e("./signature"),e("./errors")),u=(e("util"),e("./utils")),p=e("./key"),l=e("./private-key"),f=e("./identity"),h={};h.openssh=e("./formats/openssh-cert"),h.x509=e("./formats/x509"),h.pem=e("./formats/x509-pem");var d=c.CertificateParseError,m=c.InvalidAlgorithmError;function g(e){i.object(e,"options"),i.arrayOfObject(e.subjects,"options.subjects"),u.assertCompatible(e.subjects[0],f,[1,0],"options.subjects"),u.assertCompatible(e.subjectKey,p,[1,0],"options.subjectKey"),u.assertCompatible(e.issuer,f,[1,0],"options.issuer"),void 0!==e.issuerKey&&u.assertCompatible(e.issuerKey,p,[1,0],"options.issuerKey"),i.object(e.signatures,"options.signatures"),i.buffer(e.serial,"options.serial"),i.date(e.validFrom,"options.validFrom"),i.date(e.validUntil,"optons.validUntil"),i.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}g.formats=h,g.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),i.string(e,"format"),i.object(h[e],"formats[format]"),i.optionalObject(t,"options"),h[e].write(this,t)},g.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},g.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),i.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new s(t)},g.prototype.hash=function(e){if(i.string(e,"algorithm"),e=e.toLowerCase(),void 0===n.hashAlgs[e])throw new m(e);if(this._hashCache[e])return this._hashCache[e];var t=o.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t,t},g.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()0&&-1===this.issuer.purposes.indexOf("ca"))&&this.isSignedByKey(e.subjectKey))},g.prototype.getExtension=function(e){return i.string(e,"keyOrOid"),this.getExtensions().filter(function(t){return"x509"===t.format?t.oid===e:"openssh"===t.format&&t.name===e})[0]},g.prototype.getExtensions=function(){var e=[],t=this.signatures.x509;t&&t.extras&&t.extras.exts&&t.extras.exts.forEach(function(t){t.format="x509",e.push(t)});var r=this.signatures.openssh;return r&&r.exts&&r.exts.forEach(function(t){t.format="openssh",e.push(t)}),e},g.prototype.isSignedByKey=function(e){if(u.assertCompatible(e,p,[1,2],"issuerKey"),void 0!==this.issuerKey)return this.issuerKey.fingerprint("sha512").matches(e);var t=Object.keys(this.signatures)[0],r=h[t].verify(this,e);return r&&(this.issuerKey=e),r},g.prototype.signWith=function(e){u.assertCompatible(e,l,[1,2],"key");for(var t=Object.keys(h),r=!1,i=0;i0&&-1===h.indexOf("serverAuth")&&h.push("serverAuth"),m.length>0&&-1===h.indexOf("clientAuth")&&h.push("clientAuth"),(m.length>0||d.length>0)&&(-1===h.indexOf("keyAgreement")&&h.push("keyAgreement"),"rsa"===t.type&&-1===h.indexOf("encryption")&&h.push("encryption"))}var b=new g({subjects:n,issuer:n[0],subjectKey:t.toPublic(),issuerKey:t.toPublic(),signatures:{},serial:p,validFrom:o,validUntil:s,purposes:h});return b.signWith(t),b},g.create=function(e,t,r,n,o){var s;s=Array.isArray(e)?e:[e],i.arrayOfObject(s),s.forEach(function(e){u.assertCompatible(e,f,[1,0],"subject")}),u.assertCompatible(t,p,[1,0],"key"),l.isPrivateKey(t)&&(t=t.toPublic()),u.assertCompatible(r,f,[1,0],"issuer"),u.assertCompatible(n,l,[1,2],"issuer key"),i.optionalObject(o,"options"),void 0===o&&(o={}),i.optionalObject(o.validFrom,"options.validFrom"),i.optionalObject(o.validUntil,"options.validUntil");var c=o.validFrom,h=o.validUntil;if(void 0===c&&(c=new Date),void 0===h){i.optionalNumber(o.lifetime,"options.lifetime");var d=o.lifetime;void 0===d&&(d=31536e4),(h=new Date).setTime(h.getTime()+1e3*d)}i.optionalBuffer(o.serial,"options.serial");var m=o.serial;void 0===m&&(m=a.from("0000000000000001","hex"));var b=o.purposes;void 0===b&&(b=[]),-1===b.indexOf("signature")&&b.push("signature"),!0===o.ca&&(-1===b.indexOf("ca")&&b.push("ca"),-1===b.indexOf("crl")&&b.push("crl"));var v=s.filter(function(e){return"host"===e.type}),y=s.filter(function(e){return"user"===e.type});v.length>0&&-1===b.indexOf("serverAuth")&&b.push("serverAuth"),y.length>0&&-1===b.indexOf("clientAuth")&&b.push("clientAuth"),(y.length>0||v.length>0)&&(-1===b.indexOf("keyAgreement")&&b.push("keyAgreement"),"rsa"===t.type&&-1===b.indexOf("encryption")&&b.push("encryption"));var w=new g({subjects:s,issuer:r,subjectKey:t,issuerKey:n.toPublic(),signatures:{},serial:m,validFrom:c,validUntil:h,purposes:b});return w.signWith(n),w},g.parse=function(e,t,r){"string"!=typeof e&&i.buffer(e,"data"),void 0===t&&(t="auto"),i.string(t,"format"),"string"==typeof r&&(r={filename:r}),i.optionalObject(r,"options"),void 0===r&&(r={}),i.optionalString(r.filename,"options.filename"),void 0===r.filename&&(r.filename="(unnamed)"),i.object(h[t],"formats[format]");try{return h[t].read(e,r)}catch(e){throw new d(r.filename,t,e)}},g.isCertificate=function(e,t){return u.isCompatible(e,g,t)},g.prototype._sshpkApiVersion=[1,1],g._oldVersionDetect=function(e){return[1,0]}},{"./algs":324,"./errors":328,"./fingerprint":329,"./formats/openssh-cert":332,"./formats/x509":341,"./formats/x509-pem":340,"./identity":342,"./key":344,"./private-key":345,"./signature":346,"./utils":348,"assert-plus":64,crypto:121,"safer-buffer":315,util:388}],326:[function(e,t,r){t.exports={DiffieHellman:d,generateECDSA:function(e){var t=[];if(l){var r={nistp256:"prime256v1",nistp384:"secp384r1",nistp521:"secp521r1"}[e],i=a.createECDH(r);return i.generateKeys(),t.push({name:"curve",data:n.from(e)}),t.push({name:"Q",data:i.getPublicKey()}),t.push({name:"d",data:i.getPrivateKey()}),new p({type:"ecdsa",curve:e,parts:t})}var o=new m(e),s=o.getN(),c=Math.ceil((s.bitLength()+64)/8),u=new h(a.randomBytes(c)),f=s.subtract(h.ONE),d=u.mod(f).add(h.ONE),g=o.getG().multiply(d);return d=n.from(d.toByteArray()),g=n.from(o.getCurve().encodePointHex(g),"hex"),t.push({name:"curve",data:n.from(e)}),t.push({name:"Q",data:g}),t.push({name:"d",data:d}),new p({type:"ecdsa",curve:e,parts:t})},generateED25519:function(){var e=c.sign.keyPair(),t=n.from(e.secretKey),r=n.from(e.publicKey);i.strictEqual(t.length,64),i.strictEqual(r.length,32);var a=[];return a.push({name:"A",data:r}),a.push({name:"k",data:t.slice(0,32)}),new p({type:"ed25519",parts:a})}};var i=e("assert-plus"),a=e("crypto"),n=e("safer-buffer").Buffer,o=e("./algs"),s=e("./utils"),c=e("tweetnacl"),u=e("./key"),p=e("./private-key"),l=void 0!==a.createECDH,f=(e("ecc-jsbn"),e("ecc-jsbn/lib/ec")),h=e("jsbn").BigInteger;function d(e){if(s.assertCompatible(e,u,[1,4],"key"),this._isPriv=p.isPrivateKey(e,[1,3]),this._algo=e.type,this._curve=e.curve,this._key=e,"dsa"===e.type){if(!l)throw new Error("Due to bugs in the node 0.10 crypto API, node 0.12.x or later is required to use DH");this._dh=a.createDiffieHellman(e.part.p.data,void 0,e.part.g.data,void 0),this._p=e.part.p,this._g=e.part.g,this._isPriv&&this._dh.setPrivateKey(e.part.x.data),this._dh.setPublicKey(e.part.y.data)}else if("ecdsa"===e.type){if(!l)return this._ecParams=new m(this._curve),void(this._isPriv&&(this._priv=new b(this._ecParams,e.part.d.data)));var t={nistp256:"prime256v1",nistp384:"secp384r1",nistp521:"secp521r1"}[e.curve];if(this._dh=a.createECDH(t),"object"!=typeof this._dh||"function"!=typeof this._dh.setPrivateKey)return l=!1,void d.call(this,e);this._isPriv&&this._dh.setPrivateKey(e.part.d.data),this._dh.setPublicKey(e.part.Q.data)}else{if("curve25519"!==e.type)throw new Error("DH not supported for "+e.type+" keys");this._isPriv&&(s.assertCompatible(e,p,[1,5],"key"),this._priv=e.part.k.data)}}function m(e){var t=o.curves[e];i.object(t);var r=new h(t.p),a=new h(t.a),n=new h(t.b),s=new h(t.n),c=h.ONE,u=new f.ECCurveFp(r,a,n),p=u.decodePointHex(t.G.toString("hex"));this.curve=u,this.g=p,this.n=s,this.h=c}function g(e,t){this._params=e,0===t[0]&&(t=t.slice(1)),this._pub=e.getCurve().decodePointHex(t.toString("hex"))}function b(e,t){this._params=e,this._priv=new h(s.mpNormalize(t))}d.prototype.getPublicKey=function(){return this._isPriv?this._key.toPublic():this._key},d.prototype.getPrivateKey=function(){return this._isPriv?this._key:void 0},d.prototype.getKey=d.prototype.getPrivateKey,d.prototype._keyCheck=function(e,t){if(i.object(e,"key"),t||s.assertCompatible(e,p,[1,3],"key"),s.assertCompatible(e,u,[1,4],"key"),e.type!==this._algo)throw new Error("A "+e.type+" key cannot be used in "+this._algo+" Diffie-Hellman");if(e.curve!==this._curve)throw new Error("A key from the "+e.curve+" curve cannot be used with a "+this._curve+" Diffie-Hellman");"dsa"===e.type&&(i.deepEqual(e.part.p,this._p,"DSA key prime does not match"),i.deepEqual(e.part.g,this._g,"DSA key generator does not match"))},d.prototype.setKey=function(e){if(this._keyCheck(e),"dsa"===e.type)this._dh.setPrivateKey(e.part.x.data),this._dh.setPublicKey(e.part.y.data);else if("ecdsa"===e.type)l?(this._dh.setPrivateKey(e.part.d.data),this._dh.setPublicKey(e.part.Q.data)):this._priv=new b(this._ecParams,e.part.d.data);else if("curve25519"===e.type){var t=e.part.k;e.part.k||(t=e.part.r),this._priv=t.data,0===this._priv[0]&&(this._priv=this._priv.slice(1)),this._priv=this._priv.slice(0,32)}this._key=e,this._isPriv=!0},d.prototype.setPrivateKey=d.prototype.setKey,d.prototype.computeSecret=function(e){if(this._keyCheck(e,!0),!this._isPriv)throw new Error("DH exchange has not been initialized with a private key yet");var t;if("dsa"===this._algo)return this._dh.computeSecret(e.part.y.data);if("ecdsa"===this._algo)return l?this._dh.computeSecret(e.part.Q.data):(t=new g(this._ecParams,e.part.Q.data),this._priv.deriveSharedSecret(t));if("curve25519"===this._algo){for(t=e.part.A.data;0===t[0]&&t.length>32;)t=t.slice(1);var r=this._priv;i.strictEqual(t.length,32),i.strictEqual(r.length,32);var a=c.box.before(new Uint8Array(t),new Uint8Array(r));return n.from(a)}throw new Error("Invalid algorithm: "+this._algo)},d.prototype.generateKey=function(){var e,t,r=[];if("dsa"===this._algo)return this._dh.generateKeys(),r.push({name:"p",data:this._p.data}),r.push({name:"q",data:this._key.part.q.data}),r.push({name:"g",data:this._g.data}),r.push({name:"y",data:this._dh.getPublicKey()}),r.push({name:"x",data:this._dh.getPrivateKey()}),this._key=new p({type:"dsa",parts:r}),this._isPriv=!0,this._key;if("ecdsa"===this._algo){if(l)return this._dh.generateKeys(),r.push({name:"curve",data:n.from(this._curve)}),r.push({name:"Q",data:this._dh.getPublicKey()}),r.push({name:"d",data:this._dh.getPrivateKey()}),this._key=new p({type:"ecdsa",curve:this._curve,parts:r}),this._isPriv=!0,this._key;var o=this._ecParams.getN(),s=new h(a.randomBytes(o.bitLength())),u=o.subtract(h.ONE);return e=s.mod(u).add(h.ONE),t=this._ecParams.getG().multiply(e),e=n.from(e.toByteArray()),t=n.from(this._ecParams.getCurve().encodePointHex(t),"hex"),this._priv=new b(this._ecParams,e),r.push({name:"curve",data:n.from(this._curve)}),r.push({name:"Q",data:t}),r.push({name:"d",data:e}),this._key=new p({type:"ecdsa",curve:this._curve,parts:r}),this._isPriv=!0,this._key}if("curve25519"===this._algo){var f=c.box.keyPair();return e=n.from(f.secretKey),t=n.from(f.publicKey),e=n.concat([e,t]),i.strictEqual(e.length,64),i.strictEqual(t.length,32),r.push({name:"A",data:t}),r.push({name:"k",data:e}),this._key=new p({type:"curve25519",parts:r}),this._isPriv=!0,this._key}throw new Error("Invalid algorithm: "+this._algo)},d.prototype.generateKeys=d.prototype.generateKey,m.prototype.getCurve=function(){return this.curve},m.prototype.getG=function(){return this.g},m.prototype.getN=function(){return this.n},m.prototype.getH=function(){return this.h},b.prototype.deriveSharedSecret=function(e){i.ok(e instanceof g);var t=e._pub.multiply(this._priv);return n.from(t.getX().toBigInteger().toByteArray())}},{"./algs":324,"./key":344,"./private-key":345,"./utils":348,"assert-plus":64,crypto:121,"ecc-jsbn":135,"ecc-jsbn/lib/ec":136,jsbn:210,"safer-buffer":315,tweetnacl:381}],327:[function(e,t,r){t.exports={Verifier:u,Signer:p};var i=e("tweetnacl"),a=e("stream"),n=e("util"),o=e("assert-plus"),s=e("safer-buffer").Buffer,c=e("./signature");function u(e,t){if("sha512"!==t.toLowerCase())throw new Error("ED25519 only supports the use of SHA-512 hashes");this.key=e,this.chunks=[],a.Writable.call(this,{})}function p(e,t){if("sha512"!==t.toLowerCase())throw new Error("ED25519 only supports the use of SHA-512 hashes");this.key=e,this.chunks=[],a.Writable.call(this,{})}n.inherits(u,a.Writable),u.prototype._write=function(e,t,r){this.chunks.push(e),r()},u.prototype.update=function(e){"string"==typeof e&&(e=s.from(e,"binary")),this.chunks.push(e)},u.prototype.verify=function(e,t){var r;if(c.isSignature(e,[2,0])){if("ed25519"!==e.type)return!1;r=e.toBuffer("raw")}else if("string"==typeof e)r=s.from(e,"base64");else if(c.isSignature(e,[1,0]))throw new Error("signature was created by too old a version of sshpk and cannot be verified");return o.buffer(r),i.sign.detached.verify(new Uint8Array(s.concat(this.chunks)),new Uint8Array(r),new Uint8Array(this.key.part.A.data))},n.inherits(p,a.Writable),p.prototype._write=function(e,t,r){this.chunks.push(e),r()},p.prototype.update=function(e){"string"==typeof e&&(e=s.from(e,"binary")),this.chunks.push(e)},p.prototype.sign=function(){var e=i.sign.detached(new Uint8Array(s.concat(this.chunks)),new Uint8Array(s.concat([this.key.part.k.data,this.key.part.A.data]))),t=s.from(e),r=c.parse(t,"ed25519","raw");return r.hashAlgorithm="sha512",r}},{"./signature":346,"assert-plus":64,"safer-buffer":315,stream:350,tweetnacl:381,util:388}],328:[function(e,t,r){e("assert-plus");var i=e("util");function a(e,t){Error.captureStackTrace&&Error.captureStackTrace(this,a),this.name="FingerprintFormatError",this.fingerprint=e,this.format=t,this.message="Fingerprint format is not supported, or is invalid: ",void 0!==e&&(this.message+=" fingerprint = "+e),void 0!==t&&(this.message+=" format = "+t)}function n(e){Error.captureStackTrace&&Error.captureStackTrace(this,n),this.name="InvalidAlgorithmError",this.algorithm=e,this.message='Algorithm "'+e+'" is not supported'}function o(e,t,r){Error.captureStackTrace&&Error.captureStackTrace(this,o),this.name="KeyParseError",this.format=t,this.keyName=e,this.innerErr=r,this.message="Failed to parse "+e+" as a valid "+t+" format key: "+r.message}function s(e,t,r){Error.captureStackTrace&&Error.captureStackTrace(this,s),this.name="SignatureParseError",this.type=e,this.format=t,this.innerErr=r,this.message="Failed to parse the given data as a "+e+" signature in "+t+" format: "+r.message}function c(e,t,r){Error.captureStackTrace&&Error.captureStackTrace(this,c),this.name="CertificateParseError",this.format=t,this.certName=e,this.innerErr=r,this.message="Failed to parse "+e+" as a valid "+t+" format certificate: "+r.message}function u(e,t){Error.captureStackTrace&&Error.captureStackTrace(this,u),this.name="KeyEncryptedError",this.format=t,this.keyName=e,this.message="The "+t+" format key "+e+" is encrypted (password-protected), and no passphrase was provided in `options`"}i.inherits(a,Error),i.inherits(n,Error),i.inherits(o,Error),i.inherits(s,Error),i.inherits(c,Error),i.inherits(u,Error),t.exports={FingerprintFormatError:a,InvalidAlgorithmError:n,KeyParseError:o,SignatureParseError:s,KeyEncryptedError:u,CertificateParseError:c}},{"assert-plus":64,util:388}],329:[function(e,t,r){t.exports=d;var i=e("assert-plus"),a=e("safer-buffer").Buffer,n=e("./algs"),o=e("crypto"),s=e("./errors"),c=e("./key"),u=e("./private-key"),p=e("./certificate"),l=e("./utils"),f=s.FingerprintFormatError,h=s.InvalidAlgorithmError;function d(e){if(i.object(e,"options"),i.string(e.type,"options.type"),i.buffer(e.hash,"options.hash"),i.string(e.algorithm,"options.algorithm"),this.algorithm=e.algorithm.toLowerCase(),!0!==n.hashAlgs[this.algorithm])throw new h(this.algorithm);this.hash=e.hash,this.type=e.type,this.hashType=e.hashType}d.prototype.toString=function(e){switch(void 0===e&&(e="md5"===this.algorithm||"spki"===this.hashType?"hex":"base64"),i.string(e),e){case"hex":return"spki"===this.hashType?this.hash.toString("hex"):this.hash.toString("hex").replace(/(.{2})(?=.)/g,"$1:");case"base64":return"spki"===this.hashType?this.hash.toString("base64"):function(e,t){return e.toUpperCase()+":"+(r=t,r.replace(/=*$/,""));var r}(this.algorithm,this.hash.toString("base64"));default:throw new f(void 0,e)}},d.prototype.matches=function(e){i.object(e,"key or certificate"),"key"===this.type&&"ssh"!==this.hashType?(l.assertCompatible(e,c,[1,7],"key with spki"),u.isPrivateKey(e)&&l.assertCompatible(e,u,[1,6],"privatekey with spki support")):"key"===this.type?l.assertCompatible(e,c,[1,0],"key"):l.assertCompatible(e,p,[1,0],"certificate");var t=e.hash(this.algorithm,this.hashType),r=o.createHash(this.algorithm).update(t).digest("base64");return void 0===this.hash2&&(this.hash2=o.createHash(this.algorithm).update(this.hash).digest("base64")),this.hash2===r};var m=/^[A-Za-z0-9+\/=]+$/,g=/^[a-fA-F0-9]+$/;d.parse=function(e,t){var r,o,s;i.string(e,"fingerprint"),Array.isArray(t)&&(s=t,t={}),i.optionalObject(t,"options"),void 0===t&&(t={}),void 0!==t.enAlgs&&(s=t.enAlgs),void 0!==t.algorithms&&(s=t.algorithms),i.optionalArrayOfString(s,"algorithms");var c="ssh";void 0!==t.hashType&&(c=t.hashType),i.string(c,"options.hashType");var u=e.split(":");if(2==u.length){if(r=u[0].toLowerCase(),!m.test(u[1]))throw new f(e);try{o=a.from(u[1],"base64")}catch(t){throw new f(e)}}else if(u.length>2){if(r="md5","md5"===u[0].toLowerCase()&&(u=u.slice(1)),u=(u=u.map(function(t){for(;t.length<2;)t="0"+t;if(t.length>2)throw new f(e);return t})).join(""),!g.test(u)||u.length%2!=0)throw new f(e);try{o=a.from(u,"hex")}catch(t){throw new f(e)}}else{if(g.test(e))o=a.from(e,"hex");else{if(!m.test(e))throw new f(e);o=a.from(e,"base64")}switch(o.length){case 32:r="sha256";break;case 16:r="md5";break;case 20:r="sha1";break;case 64:r="sha512";break;default:throw new f(e)}void 0===t.hashType&&(c="spki")}if(void 0===r)throw new f(e);if(void 0===n.hashAlgs[r])throw new h(r);if(void 0!==s&&-1===(s=s.map(function(e){return e.toLowerCase()})).indexOf(r))throw new h(r);return new d({algorithm:r,hash:o,type:t.type||"key",hashType:c})},d.isFingerprint=function(e,t){return l.isCompatible(e,d,t)},d.prototype._sshpkApiVersion=[1,2],d._oldVersionDetect=function(e){return i.func(e.toString),i.func(e.matches),[1,0]}},{"./algs":324,"./certificate":325,"./errors":328,"./key":344,"./private-key":345,"./utils":348,"assert-plus":64,crypto:121,"safer-buffer":315}],330:[function(e,t,r){t.exports={read:function(e,t){if("string"==typeof e){if(e.trim().match(/^[-]+[ ]*BEGIN/))return n.read(e,t);if(e.match(/^\s*ssh-[a-z]/))return o.read(e,t);if(e.match(/^\s*ecdsa-/))return o.read(e,t);if(e.match(/^putty-user-key-file-2:/i))return u.read(e,t);if(l(e))return c.read(e,t);e=a.from(e,"binary")}else{if(i.buffer(e),function(e){var t=0;for(;te.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return n.read(e,t);if(function(e){var t=0;for(;t3)throw new Error("Not a valid SSH certificate line");var i=r[0],a=r[1];return g(a=o.from(a,"base64"),i)},verify:function(e,t){return!1},sign:function(e,t){void 0===e.signatures.openssh&&(e.signatures.openssh={});try{var r=y(e,!0)}catch(t){return delete e.signatures.openssh,!1}var i=e.signatures.openssh,a=void 0;"rsa"!==t.type&&"dsa"!==t.type||(a="sha1");var n=t.createSign(a);return n.write(r),i.signature=n.sign(),!0},signAsync:function(e,t,r){void 0===e.signatures.openssh&&(e.signatures.openssh={});try{var i=y(e,!0)}catch(t){return delete e.signatures.openssh,void r(t)}var a=e.signatures.openssh;t(i,function(e,t){if(e)r(e);else{try{t.toBuffer("ssh")}catch(e){return void r(e)}a.signature=t,r()}})},write:function(e,t){void 0===t&&(t={});var r=y(e),i=w(e.subjectKey)+" "+r.toString("base64");t.comment&&(i=i+" "+t.comment);return i},fromBuffer:g,toBuffer:y};var i=e("assert-plus"),a=e("../ssh-buffer"),n=e("crypto"),o=e("safer-buffer").Buffer,s=e("../algs"),c=e("../key"),u=(e("../private-key"),e("../identity")),p=e("./rfc4253"),l=e("../signature"),f=e("../utils"),h=e("../certificate");var d={user:1,host:2};Object.keys(d).forEach(function(e){d[d[e]]=e});var m=/^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;function g(e,t,r){var n=new a({buffer:e}),o=n.readString();if(void 0!==t&&o!==t)throw new Error("SSH certificate algorithm mismatch");void 0===t&&(t=o);var g={signatures:{}};g.signatures.openssh={},g.signatures.openssh.nonce=n.readBuffer();var v={},y=v.parts=[];v.type=function(e){if("ssh-rsa-cert-v01@openssh.com"===e)return"rsa";if("ssh-dss-cert-v01@openssh.com"===e)return"dsa";if(e.match(m))return"ecdsa";if("ssh-ed25519-cert-v01@openssh.com"===e)return"ed25519";throw new Error("Unsupported cert type "+e)}(t);for(var w=s.info[v.type].parts.length;y.length=1,"key must have at least one part");var k=s.info[v.type];if("ecdsa"===v.type){var _=m.exec(t);i.ok(null!==_),i.strictEqual(_[1],y[0].data.toString())}for(var x=0;x0;)v=w[--_].match(/[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);i.ok(v,"invalid PEM footer"),i.equal(u[2],v[2]);var x,j=u[2].toLowerCase();u[1]&&(i.equal(u[1],v[1],"PEM header and footer mismatch"),x=u[1].trim());w=w.slice(k,_+1);var S,E,A,F={};for(;w=w.slice(1),u=w[0].match(/^([A-Za-z0-9-]+): (.+)$/);)F[u[1].toLowerCase()]=u[2];if(w=w.slice(0,-1).join(""),e=o.from(w,"base64"),F["proc-type"]){var P=F["proc-type"].split(",");if("4"===P[0]&&"ENCRYPTED"===P[1]){if("string"==typeof t.passphrase&&(t.passphrase=o.from(t.passphrase,"utf-8")),!o.isBuffer(t.passphrase))throw new d.KeyEncryptedError(t.filename,"PEM");P=F["dek-info"].split(","),i.ok(2===P.length),S=P[0].toLowerCase(),A=o.from(P[1],"hex"),E=s.opensslKeyDeriv(S,A,t.passphrase,1).key}}if(x&&"encrypted"===x.toLowerCase()){var z,C=new a.BerReader(e);C.readSequence(),C.readSequence(),z=C.offset+C.length;var O=C.readOID();if(O!==m)throw new Error("Unsupported PEM/PKCS8 encryption scheme: "+O);C.readSequence(),C.readSequence();var T=C.offset+C.length,B=C.readOID();if(B!==g)throw new Error("Unsupported PBES2 KDF: "+B);C.readSequence();var I=C.readString(a.Ber.OctetString,!0),R=C.readInt(),q="sha1";if(C.offseth.length&&(v=h.length),g+=m.write(h.slice(b,v),g),m[g++]=10,b=v}return g+=m.write("-----END "+n+"-----\n",g),m.slice(0,g)}};var i=e("assert-plus"),a=e("asn1"),n=e("crypto"),o=e("safer-buffer").Buffer,s=(e("../algs"),e("../utils")),c=e("../key"),u=e("../private-key"),p=e("./pkcs1"),l=e("./pkcs8"),f=e("./ssh-private"),h=e("./rfc4253"),d=e("../errors"),m="1.2.840.113549.1.5.13",g="1.2.840.113549.1.5.12",b={"1.2.840.113549.3.7":"3des-cbc","2.16.840.1.101.3.4.1.2":"aes128-cbc","2.16.840.1.101.3.4.1.42":"aes256-cbc"},v={};Object.keys(b).forEach(function(e){v[b[e]]=e});var y={"1.2.840.113549.2.7":"sha1","1.2.840.113549.2.9":"sha256","1.2.840.113549.2.11":"sha512"},w={};Object.keys(y).forEach(function(e){w[y[e]]=e})},{"../algs":324,"../errors":328,"../key":344,"../private-key":345,"../utils":348,"./pkcs1":334,"./pkcs8":335,"./rfc4253":337,"./ssh-private":338,asn1:63,"assert-plus":64,crypto:121,"safer-buffer":315}],334:[function(e,t,r){t.exports={read:function(e,t){return p.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return function(e){var t=f(e,"modulus"),r=f(e,"exponent");return new c({type:"rsa",parts:[{name:"e",data:r},{name:"n",data:t}]})}(r);if("private"===t)return function(e){var t=f(e,"version");i.strictEqual(t[0],0);var r=f(e,"modulus"),a=f(e,"public exponent"),n=f(e,"private exponent"),o=f(e,"prime1"),s=f(e,"prime2"),c=f(e,"exponent1"),p=f(e,"exponent2"),l=f(e,"iqmp");return new u({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:a},{name:"d",data:n},{name:"iqmp",data:l},{name:"p",data:o},{name:"q",data:s},{name:"dmodp",data:c},{name:"dmodq",data:p}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return function(e){var t=f(e,"y"),r=f(e,"p"),i=f(e,"q"),a=f(e,"g");return new c({type:"dsa",parts:[{name:"y",data:t},{name:"p",data:r},{name:"q",data:i},{name:"g",data:a}]})}(r);if("private"===t)return function(e){var t=f(e,"version");i.strictEqual(t.readUInt8(0),0);var r=f(e,"p"),a=f(e,"q"),n=f(e,"g"),o=f(e,"y"),s=f(e,"x");return new u({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:a},{name:"g",data:n},{name:"y",data:o},{name:"x",data:s}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=f(e,"version");i.strictEqual(t.readUInt8(0),1);var r=e.readString(a.Ber.OctetString,!0);e.readSequence(160);var o=l(e);i.string(o,"a known elliptic curve"),e.readSequence(161);var c=e.readString(a.Ber.BitString,!0);c=s.ecNormalize(c);var p={type:"ecdsa",parts:[{name:"curve",data:n.from(o)},{name:"Q",data:c},{name:"d",data:r}]};return new u(p)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();i.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,u=e.readOID(),p=Object.keys(o.curves),l=0;lo.length)throw new Error("Invalid public-lines count");var h=a.from(o.slice(u,u+f).join(""),"base64"),d=n.algToKeyType(p),m=n.read(h);if(m.type!==d)throw new Error("Outer key algorithm mismatch");return m.comment=l,m},write:function(e,t){if(i.object(e),!o.isKey(e))throw new Error("Must be a public key");var r=n.keyTypeToAlg(e),s=n.write(e),c=e.comment||"",u=function(e,t){var r=[],i=0;for(;i=1,"key must have at least one part"),i.ok(e||d.atEnd(),"leftover bytes at end of key");var b=s,v=n.info[f.type];if("private"!==t&&v.parts.length===h.length||(v=n.privInfo[f.type],b=c),i.strictEqual(v.parts.length,h.length),"ecdsa"===f.type){var y=/^ecdsa-sha2-(.+)$/.exec(m);i.ok(null!==y),i.strictEqual(y[1],h[0].data.toString())}for(var w=!0,k=0;kT.length&&(q=T.length),I+=O.write(T.slice(R,q),I),O[I++]=10,R=q}return I+=O.write("-----END "+C+"-----\n",I),O.slice(0,I)}};var i,a=e("assert-plus"),n=(e("asn1"),e("safer-buffer").Buffer),o=(e("../algs"),e("../utils")),s=e("crypto"),c=(e("../key"),e("../private-key")),u=e("./pem"),p=e("./rfc4253"),l=e("../ssh-buffer"),f=e("../errors");var h="openssh-key-v1"},{"../algs":324,"../errors":328,"../key":344,"../private-key":345,"../ssh-buffer":347,"../utils":348,"./pem":333,"./rfc4253":337,asn1:63,"assert-plus":64,"bcrypt-pbkdf":73,crypto:121,"safer-buffer":315}],339:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(i.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),o=r.match(s);o||(o=r.match(c));i.ok(o,"key must match regex");var u,p=n.algToKeyType(o[1]),l=a.from(o[2],"base64"),f={};if(o[4])try{u=n.read(l)}catch(e){o=r.match(c),i.ok(o,"key must match regex"),l=a.from(o[2],"base64"),u=n.readInternal(f,"public",l)}else u=n.readInternal(f,"public",l);if(i.strictEqual(p,u.type),o[4]&&o[4].length>0)u.comment=o[4];else if(f.consumed){var h=o[2]+(o[3]?o[3]:""),d=4*Math.ceil(f.consumed/3);h=h.slice(0,d-2).replace(/[^a-zA-Z0-9+\/=]/g,"")+h.slice(d-2);var m=f.consumed%3;for(m>0&&"="!==h.slice(d-1,d)&&d--;"="===h.slice(d,d+1);)d++;var g=h.slice(d);(g=g.replace(/[\r\n]/g," ").replace(/^\s+/,"")).match(/^[a-zA-Z0-9]/)&&(u.comment=g)}return u},write:function(e,t){if(i.object(e),!o.isKey(e))throw new Error("Must be a public key");var r=[],s=n.keyTypeToAlg(e);r.push(s);var c=n.write(e);r.push(c.toString("base64")),e.comment&&r.push(e.comment);return a.from(r.join(" "))}};var i=e("assert-plus"),a=e("safer-buffer").Buffer,n=e("./rfc4253"),o=(e("../utils"),e("../key")),s=(e("../private-key"),e("./ssh-private"),/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/),c=/^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/},{"../key":344,"../private-key":345,"../utils":348,"./rfc4253":337,"./ssh-private":338,"assert-plus":64,"safer-buffer":315}],340:[function(e,t,r){var i=e("./x509");t.exports={read:function(e,t){"string"!=typeof e&&(a.buffer(e,"buf"),e=e.toString("ascii"));var r,o,s=e.trim().split(/[\r\n]+/g),c=-1;for(;!r&&c0;)o=s[--u].match(/[-]+[ ]*END CERTIFICATE[ ]*[-]+/);a.ok(o,"invalid PEM footer"),s=s.slice(c,u+1);var p={};for(;s=s.slice(1),r=s[0].match(/^([A-Za-z0-9-]+): (.+)$/);)p[r[1].toLowerCase()]=r[2];return s=s.slice(0,-1).join(""),e=n.from(s,"base64"),i.read(e,t)},verify:i.verify,sign:i.sign,write:function(e,t){var r=i.write(e,t),a=r.toString("base64"),o=a.length+a.length/64+18+16+2*"CERTIFICATE".length+10,s=n.alloc(o),c=0;c+=s.write("-----BEGIN CERTIFICATE-----\n",c);for(var u=0;ua.length&&(p=a.length),c+=s.write(a.slice(u,p),c),s[c++]=10,u=p}return c+=s.write("-----END CERTIFICATE-----\n",c),s.slice(0,c)}};var a=e("assert-plus"),n=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":324,"../certificate":325,"../identity":342,"../key":344,"../private-key":345,"../signature":346,"../utils":348,"./pem":333,"./x509":341,asn1:63,"assert-plus":64,"safer-buffer":315}],341:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=n.from(e,"binary"));i.buffer(e,"buf");var r=new a.BerReader(e);if(r.readSequence(),Math.abs(r.length-r.remain)>1)throw new Error("DER sequence does not contain whole byte stream");var f=r.offset;r.readSequence();var d=r.offset+r.length,g=d;if(r.peek()===l(0)){r.readSequence(l(0));var b=r.readInt();i.ok(b<=3,"only x.509 versions up to v3 supported")}var v={signatures:{}},y=v.signatures.x509={};y.extras={},v.serial=function(e,t){return i.strictEqual(e.peek(),a.Ber.Integer,t+" is not an Integer"),o.mpNormalize(e.readString(a.Ber.Integer,!0))}(r,"serial"),r.readSequence();var w=r.offset+r.length,_=r.readOID();if(void 0===h[_])throw new Error("unknown signature algorithm "+_);r._offset=w,v.issuer=s.parseAsn1(r),r.readSequence(),v.validFrom=m(r),v.validUntil=m(r),v.subjects=[s.parseAsn1(r)],r.readSequence(),w=r.offset+r.length,v.subjectKey=p.readPkcs8(void 0,"public",r),r._offset=w,r.peek()===l(1)&&(r.readSequence(l(1)),y.extras.issuerUniqueID=e.slice(r.offset,r.offset+r.length),r._offset+=r.length);r.peek()===l(2)&&(r.readSequence(l(2)),y.extras.subjectUniqueID=e.slice(r.offset,r.offset+r.length),r._offset+=r.length);if(r.peek()===l(3)){r.readSequence(l(3));var x=r.offset+r.length;for(r.readSequence();r.offset=60?n-1:n;r.setUTCFullYear(o,parseInt(t[2],10)-1,parseInt(t[3],10)),r.setUTCHours(parseInt(t[4],10),parseInt(t[5],10)),t[6]&&t[6].length>0&&r.setUTCSeconds(parseInt(t[6],10));return r}(e.readString(a.Ber.UTCTime));if(e.peek()===a.Ber.GeneralizedTime)return function(e){var t=e.match(x);i.ok(t);var r=new Date;r.setUTCFullYear(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10)),r.setUTCHours(parseInt(t[4],10),parseInt(t[5],10)),t[6]&&t[6].length>0&&r.setUTCSeconds(parseInt(t[6],10));return r}(e.readString(a.Ber.GeneralizedTime));throw new Error("Unsupported date format")}function g(e,t){var r,i;t.getUTCFullYear()>=2050||t.getUTCFullYear()<1950?e.writeString((i="",i+=j((r=t).getUTCFullYear(),4),i+=j(r.getUTCMonth()+1),i+=j(r.getUTCDate()),i+=j(r.getUTCHours()),i+=j(r.getUTCMinutes()),i+=j(r.getUTCSeconds()),i+="Z"),a.Ber.GeneralizedTime):e.writeString(function(e){var t="";return t+=j(e.getUTCFullYear()%100),t+=j(e.getUTCMonth()+1),t+=j(e.getUTCDate()),t+=j(e.getUTCHours()),t+=j(e.getUTCMinutes()),t+=j(e.getUTCSeconds()),t+="Z"}(t),a.Ber.UTCTime)}var b={OtherName:l(0),RFC822Name:f(1),DNSName:f(2),X400Address:l(3),DirectoryName:l(4),EDIPartyName:l(5),URI:f(6),IPAddress:f(7),OID:f(8)},v={serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",joyentDocker:"1.3.6.1.4.1.38678.1.4.1",joyentCmon:"1.3.6.1.4.1.38678.1.4.2"},y={};Object.keys(v).forEach(function(e){y[v[e]]=e});var w=["signature","identity","keyEncryption","encryption","keyAgreement","ca","crl"];function k(e,t,r){r.readSequence();var i,n,o=r.offset+r.length,c=r.readOID(),u=e.signatures.x509;switch(u.extras.exts||(u.extras.exts=[]),r.peek()===a.Ber.Boolean&&(n=r.readBoolean()),c){case d.basicConstraints:r.readSequence(a.Ber.OctetString),r.readSequence();var p=r.offset+r.length,l=!1;r.peek()===a.Ber.Boolean&&(l=r.readBoolean()),void 0===e.purposes&&(e.purposes=[]),!0===l&&e.purposes.push("ca");var f={oid:c,critical:n};r.offset0||"host"===n.type||void 0!==e.purposes&&e.purposes.length>0||r.extras&&r.extras.exts){t.startSequence(l(3)),t.startSequence();var c=[];void 0!==e.purposes&&e.purposes.length>0&&(c.push({oid:d.basicConstraints,critical:!0}),c.push({oid:d.keyUsage,critical:!0}),c.push({oid:d.extKeyUsage,critical:!0})),c.push({oid:d.altName}),r.extras&&r.extras.exts&&(c=r.extras.exts);for(var u=0;u0&&(this.cn=this.componentLookup.cn[0].value),i.optionalString(e.type,"options.type"),void 0===e.type)1===this.components.length&&this.componentLookup.cn&&1===this.componentLookup.cn.length&&this.componentLookup.cn[0].value.match(s)?(this.type="host",this.hostname=this.componentLookup.cn[0].value):this.componentLookup.dc&&this.components.length===this.componentLookup.dc.length?(this.type="host",this.hostname=this.componentLookup.dc.map(function(e){return e.value}).join(".")):this.componentLookup.uid&&this.components.length===this.componentLookup.uid.length?(this.type="user",this.uid=this.componentLookup.uid[0].value):this.componentLookup.cn&&1===this.componentLookup.cn.length&&this.componentLookup.cn[0].value.match(s)?(this.type="host",this.hostname=this.componentLookup.cn[0].value):this.componentLookup.uid&&1===this.componentLookup.uid.length?(this.type="user",this.uid=this.componentLookup.uid[0].value):this.componentLookup.mail&&1===this.componentLookup.mail.length?(this.type="email",this.email=this.componentLookup.mail[0].value):this.componentLookup.cn&&1===this.componentLookup.cn.length?(this.type="user",this.uid=this.componentLookup.cn[0].value):this.type="unknown";else if(this.type=e.type,"host"===this.type)this.hostname=e.hostname;else if("user"===this.type)this.uid=e.uid;else{if("email"!==this.type)throw new Error("Unknown type "+this.type);this.email=e.email}}Object.keys(c).forEach(function(e){u[c[e]]=e}),p.prototype.toString=function(){return this.components.map(function(e){var t=e.name.toUpperCase();t=t.replace(/=/g,"\\=");var r=e.value;return t+"="+(r=r.replace(/,/g,"\\,"))}).join(", ")},p.prototype.get=function(e,t){i.string(e,"name");var r=this.componentLookup[e];if(void 0!==r&&0!==r.length){if(!t&&r.length>1)throw new Error("Multiple values for attribute "+e);return t?r.map(function(e){return e.value}):r[0].value}},p.prototype.toArray=function(e){return this.components.map(function(e){return{name:e.name,value:e.value}})};var l=/[^a-zA-Z0-9 '(),+.\/:=?-]/,f=/[^\x00-\x7f]/;function h(e,t){if("**"===e||"**"===t)return!0;var r=e.split("."),i=t.split(".");if(r.length!==i.length)return!1;for(var a=0;a0;){var n;if(null!==(n=/^,/.exec(a)))t[++r]="",a=a.slice(n[0].length);else if(null!==(n=/^\\,/.exec(a)))t[r]+=",",a=a.slice(n[0].length);else if(null!==(n=/^\\./.exec(a)))t[r]+=n[0],a=a.slice(n[0].length);else{if(null===(n=/^[^\\,]+/.exec(a)))throw new Error("Failed to parse DN");t[r]+=n[0],a=a.slice(n[0].length)}}return new p({components:t.map(function(e){for(var t=(e=e.trim()).indexOf("=");t>0&&"\\"===e.charAt(t-1);)t=e.indexOf("=",t+1);if(-1===t)throw new Error("Failed to parse DN");return{name:e.slice(0,t).toLowerCase().replace(/\\=/g,"="),value:e.slice(t+1)}})})},p.fromArray=function(e){return i.arrayOfObject(e,"components"),e.forEach(function(e){if(i.object(e,"component"),i.string(e.name,"component.name"),!o.isBuffer(e.value)&&"string"!=typeof e.value)throw new Error("Invalid component value")}),new p({components:e})},p.parseAsn1=function(e,t){var r=[];e.readSequence(t);for(var i=e.offset+e.length;e.offset1024&&(e="sha256"),"ed25519"===this.type&&(e="sha512"),"ecdsa"===this.type&&(e=this.size<=256?"sha256":this.size<=384?"sha384":"sha512"),e},g.prototype.createVerify=function(e){if(void 0===e&&(e=this.defaultHashAlgorithm()),a.string(e,"hash algorithm"),"ed25519"===this.type&&void 0!==i)return new i.Verifier(this,e);if("curve25519"===this.type)throw new Error("Curve25519 keys are not suitable for signing or verification");var t,n,s;try{n=e.toUpperCase(),t=o.createVerify(n)}catch(e){s=e}(void 0===t||s instanceof Error&&s.message.match(/Unknown message digest/))&&(n="RSA-",n+=e.toUpperCase(),t=o.createVerify(n)),a.ok(t,"failed to create verifier");var u=t.verify.bind(t),p=this.toBuffer("pkcs8"),l=this.curve,f=this;return t.verify=function(t,i){if(c.isSignature(t,[2,0]))return t.type===f.type&&((!t.hashAlgorithm||t.hashAlgorithm===e)&&((!t.curve||"ecdsa"!==f.type||t.curve===l)&&u(p,t.toBuffer("asn1"))));if("string"==typeof t||r.isBuffer(t))return u(p,t,i);throw c.isSignature(t,[1,0])?new Error("signature was created by too old a version of sshpk and cannot be verified"):new TypeError("signature must be a string, Buffer, or Signature object")},t},g.prototype.createDiffieHellman=function(){if("rsa"===this.type)throw new Error("RSA keys do not support Diffie-Hellman");return new u(this)},g.prototype.createDH=g.prototype.createDiffieHellman,g.parse=function(e,t,r){"string"!=typeof e&&a.buffer(e,"data"),void 0===t&&(t="auto"),a.string(t,"format"),"string"==typeof r&&(r={filename:r}),a.optionalObject(r,"options"),void 0===r&&(r={}),a.optionalString(r.filename,"options.filename"),void 0===r.filename&&(r.filename="(unnamed)"),a.object(m[t],"formats[format]");try{var i=m[t].read(e,r);return i instanceof f&&(i=i.toPublic()),i.comment||(i.comment=r.filename),i}catch(e){if("KeyEncryptedError"===e.name)throw e;throw new d(r.filename,t,e)}},g.isKey=function(e,t){return l.isCompatible(e,g,t)},g.prototype._sshpkApiVersion=[1,7],g._oldVersionDetect=function(e){return a.func(e.toBuffer),a.func(e.fingerprint),e.createDH?[1,4]:e.defaultHashAlgorithm?[1,3]:e.formats.auto?[1,2]:e.formats.pkcs1?[1,1]:[1,0]}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":206,"./algs":324,"./dhe":326,"./ed-compat":327,"./errors":328,"./fingerprint":329,"./formats/auto":330,"./formats/dnssec":331,"./formats/pem":333,"./formats/pkcs1":334,"./formats/pkcs8":335,"./formats/putty":336,"./formats/rfc4253":337,"./formats/ssh":339,"./formats/ssh-private":338,"./private-key":345,"./signature":346,"./utils":348,"assert-plus":64,crypto:121}],345:[function(e,t,r){t.exports=y;var i=e("assert-plus"),a=e("safer-buffer").Buffer,n=e("./algs"),o=e("crypto"),s=(e("./fingerprint"),e("./signature")),c=e("./errors"),u=e("util"),p=e("./utils"),l=e("./dhe"),f=l.generateECDSA,h=l.generateED25519,d=e("./ed-compat"),m=e("tweetnacl"),g=e("./key"),b=(c.InvalidAlgorithmError,c.KeyParseError),v=(c.KeyEncryptedError,{});function y(e){i.object(e,"options"),g.call(this,e),this._pubCache=void 0}v.auto=e("./formats/auto"),v.pem=e("./formats/pem"),v.pkcs1=e("./formats/pkcs1"),v.pkcs8=e("./formats/pkcs8"),v.rfc4253=e("./formats/rfc4253"),v["ssh-private"]=e("./formats/ssh-private"),v.openssh=v["ssh-private"],v.ssh=v["ssh-private"],v.dnssec=e("./formats/dnssec"),u.inherits(y,g),y.formats=v,y.prototype.toBuffer=function(e,t){return void 0===e&&(e="pkcs1"),i.string(e,"format"),i.object(v[e],"formats[format]"),i.optionalObject(t,"options"),v[e].write(this,t)},y.prototype.hash=function(e,t){return this.toPublic().hash(e,t)},y.prototype.fingerprint=function(e,t){return this.toPublic().fingerprint(e,t)},y.prototype.toPublic=function(){if(this._pubCache)return this._pubCache;for(var e=n.info[this.type],t=[],r=0;r20&&0===n[0]&&(n=n.slice(1)),(u=this.part.s.data).length>20&&0===u[0]&&(u=u.slice(1)),this.hashAlgorithm&&"sha1"!==this.hashAlgorithm||n.length+u.length!==40)throw new Error("OpenSSH only supports DSA signatures with SHA1 hash");return t.writeBuffer(a.concat([n,u])),t.toBuffer()}if("ssh"===e&&"ecdsa"===this.type){var l,f=new c({});n=this.part.r.data,f.writeBuffer(n),f.writePart(this.part.s),t=new c({}),0===n[0]&&(n=n.slice(1));var h=8*n.length;return 256===h?l="nistp256":384===h?l="nistp384":528===h&&(l="nistp521"),t.writeString("ecdsa-sha2-"+l),t.writeBuffer(f.toBuffer()),t.toBuffer()}throw new Error("Invalid signature format");default:throw new Error("Invalid signature data")}},l.prototype.toString=function(e){return i.optionalString(e,"format"),this.toBuffer(e).toString("base64")},l.parse=function(e,t,r){"string"==typeof e&&(e=a.from(e,"base64")),i.buffer(e,"data"),i.string(r,"format"),i.string(t,"type");var n={};n.type=t.toLowerCase(),n.parts=[];try{switch(i.ok(e.length>0,"signature must not be empty"),n.type){case"rsa":case"ed25519":return f(e,t,r,n);case"dsa":case"ecdsa":return"asn1"===r?function(e,t,r,i){var a=new s.BerReader(e);a.readSequence();var n=a.readString(s.Ber.Integer,!0),c=a.readString(s.Ber.Integer,!0);return i.parts.push({name:"r",data:o.mpNormalize(n)}),i.parts.push({name:"s",data:o.mpNormalize(c)}),new l(i)}(e,0,0,n):"dsa"===n.type?function(e,t,r,a){if(40!=e.length){var n=new c({buffer:e}),o=n.readBuffer();"ssh-dss"===o.toString("ascii")&&(o=n.readBuffer()),i.ok(n.atEnd(),"extra trailing bytes"),i.strictEqual(o.length,40,"invalid inner length"),e=o}return a.parts.push({name:"r",data:e.slice(0,20)}),a.parts.push({name:"s",data:e.slice(20,40)}),new l(a)}(e,0,0,n):function(e,t,r,a){var n,o,s=new c({buffer:e}),u=s.readBuffer(),p=u.toString("ascii");if("ecdsa-"===p.slice(0,6)){var f=p.split("-");switch(i.strictEqual(f[0],"ecdsa"),i.strictEqual(f[1],"sha2"),a.curve=f[2],a.curve){case"nistp256":a.hashAlgo="sha256";break;case"nistp384":a.hashAlgo="sha384";break;case"nistp521":a.hashAlgo="sha512";break;default:throw new Error("Unsupported ECDSA curve: "+a.curve)}u=s.readBuffer(),i.ok(s.atEnd(),"extra trailing bytes on outer"),s=new c({buffer:u}),n=s.readPart()}else n={data:u};return o=s.readPart(),i.ok(s.atEnd(),"extra trailing bytes"),n.name="r",o.name="s",a.parts.push(n),a.parts.push(o),new l(a)}(e,0,0,n);default:throw new u(t)}}catch(e){if(e instanceof u)throw e;throw new p(t,r,e)}},l.isSignature=function(e,t){return o.isCompatible(e,l,t)},l.prototype._sshpkApiVersion=[2,1],l._oldVersionDetect=function(e){return i.func(e.toBuffer),e.hasOwnProperty("hashAlgorithm")?[2,0]:[1,0]}},{"./algs":324,"./errors":328,"./ssh-buffer":347,"./utils":348,asn1:63,"assert-plus":64,crypto:121,"safer-buffer":315}],347:[function(e,t,r){t.exports=n;var i=e("assert-plus"),a=e("safer-buffer").Buffer;function n(e){i.object(e,"options"),void 0!==e.buffer&&i.buffer(e.buffer,"options.buffer"),this._size=e.buffer?e.buffer.length:1024,this._buffer=e.buffer||a.alloc(this._size),this._offset=0}n.prototype.toBuffer=function(){return this._buffer.slice(0,this._offset)},n.prototype.atEnd=function(){return this._offset>=this._buffer.length},n.prototype.remainder=function(){return this._buffer.slice(this._offset)},n.prototype.skip=function(e){this._offset+=e},n.prototype.expand=function(){this._size*=2;var e=a.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},n.prototype.readPart=function(){return{data:this.readBuffer()}},n.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},n.prototype.readString=function(){return this.readBuffer().toString()},n.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},n.prototype.writeString=function(e){this.writeBuffer(a.from(e,"utf8"))},n.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},n.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},n.prototype.writeInt64=function(e){if(i.buffer(e,"value"),e.length>8){for(var t=e.slice(0,e.length-8),r=0;rthis._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},n.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},n.prototype.writePart=function(e){this.writeBuffer(e.data)},n.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":64,"safer-buffer":315}],348:[function(e,t,r){t.exports={bufferSplit:function(e,t){i.buffer(e),i.string(t);for(var r=[],a=0,n=0,o=0;o=t.length){var s=o+1;r.push(e.slice(a,s-n)),a=s,n=0}a<=e.length&&r.push(e.slice(a,e.length));return r},addRSAMissing:function(e){i.object(e),d(e,n,[1,1]);var t,r=new l(e.part.d.data);if(!e.part.dmodp){var a=new l(e.part.p.data),o=r.mod(a.subtract(1));t=v(o),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var s=new l(e.part.q.data),c=r.mod(s.subtract(1));t=v(c),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return i.buffer(e),i.buffer(t),i.buffer(r),e=new l(e),t=new l(t),r=new l(r),v(e.modPow(r,t))},calculateED25519Public:function(e){i.buffer(e);var t=f.sign.keyPair.fromSeed(new Uint8Array(e));return a.from(t.publicKey)},calculateX25519Public:function(e){i.buffer(e);var t=f.box.keyPair.fromSeed(new Uint8Array(e));return a.from(t.publicKey)},mpNormalize:b,mpDenormalize:function(e){i.buffer(e);for(;e.length>1&&0===e[0];)e=e.slice(1);return e},ecNormalize:function(e,t){if(i.buffer(e),0===e[0]&&4===e[1])return t?e:e.slice(1);if(4===e[0]){if(!t)return e}else{for(;0===e[0];)e=e.slice(1);if(2===e[0]||3===e[0])throw new Error("Compressed elliptic curve points are not supported");if(4!==e[0])throw new Error("Not a valid elliptic curve point");if(!t)return e}var r=a.alloc(e.length+1);return r[0]=0,e.copy(r,1),r},countZeros:function(e){var t=0,r=8;for(;th)return!1;if(i.constructor.name!==t.name)return!1;var n=i._sshpkApiVersion;void 0===n&&(n=t._oldVersionDetect(e));return!(n[0]!=r[0]||n[1]t;)i.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],a+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var m={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},g=8;function b(e){for(i.buffer(e);e.length>1&&0===e[0]&&0==(128&e[1]);)e=e.slice(1);if(128==(128&e[0])){var t=a.alloc(e.length+1);t[0]=0,e.copy(t,1),e=t}return e}function v(e){var t=a.from(e.toByteArray());return t=b(t)}},{"./algs":324,"./key":344,"./private-key":345,asn1:63,"assert-plus":64,crypto:121,"ecc-jsbn/lib/ec":136,jsbn:210,"safer-buffer":315,tweetnacl:381}],349:[function(e,t,r){"use strict";var i=/\.node$/;function a(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r)}function n(e,t){return a(t,function(r){e[r]=t[r]}),e}function o(e){a(e,function(t){i.test(t)||delete e[t]})}t.exports=function(e,t,r,i){var s=n({},e);if(o(e),r){var c=!!i.children&&i.children.slice();r();var u=[];a(e,function(e){u.push(e)}),o(e),i.children&&(i.children=c);for(var p=0;pe._pos){var n=r.substr(e._pos);if("x-user-defined"===e._charset){for(var o=a.alloc(n.length),s=0;se._pos&&(e.push(a.from(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(r)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":352,_process:263,buffer:110,inherits:205,"readable-stream":369}],355:[function(e,t,r){"use strict";var i={};function a(e,t,r){r||(r=Error);var a=function(e){var r,i;function a(r,i,a){return e.call(this,function(e,r,i){return"string"==typeof t?t:t(e,r,i)}(r,i,a))||this}return i=e,(r=a).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,a}(r);a.prototype.name=r.name,a.prototype.code=e,i[e]=a}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),a("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,a,o,s;if("string"==typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(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"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+=". Received type ".concat(typeof r)},TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],356:[function(e,t,r){(function(e){"use strict";var r=new Set;t.exports.emitExperimentalWarning=e.emitWarning?function(t){if(!r.has(t)){var i=t+" is an experimental feature. This feature could change at any time";r.add(t),e.emitWarning(i,"ExperimentalWarning")}}:function(){}}).call(this,e("_process"))},{_process:263}],357:[function(e,t,r){(function(r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=u;var a=e("./_stream_readable"),n=e("./_stream_writable");e("inherits")(u,a);for(var o=i(n.prototype),s=0;s0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),i)o.endEmitted?e.emit("error",new w):E(e,o,t,!0);else if(o.ended)e.emit("error",new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?E(e,o,t,!1):C(e,o)):E(e,o,t,!1)}else i||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=A?e=A:(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 P(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(z,e))}function z(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||e.emit("readable"),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,R(e)}function C(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){u("readable nexttick read 0"),e.read(0)}function I(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function q(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;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(D,t,e))}function D(e,t){u("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var r=0,i=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):P(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&M(this),null;var i,a=t.needReadable;return u("need readable",a),(0===t.length||t.length-e0?q(e,t):null)?(t.needReadable=!0,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==i&&this.emit("data",i),i},j.prototype._read=function(e){this.emit("error",new y("_read()"))},j.prototype.pipe=function(e,t){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,u("pipe count=%d opts=%j",a.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function s(t,r){u("onunpipe"),t===i&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",d),e.removeListener("finish",m),e.removeListener("drain",p),e.removeListener("error",h),e.removeListener("unpipe",s),i.removeListener("end",c),i.removeListener("end",g),i.removeListener("data",f),l=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function c(){u("onend"),e.end()}a.endEmitted?r.nextTick(o):i.once("end",o),e.on("unpipe",s);var p=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&n(e,"data")&&(t.flowing=!0,R(e))}}(i);e.on("drain",p);var l=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==L(a.pipes,e))&&!l&&(u("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===n(e,"error")&&e.emit("error",t)}function d(){e.removeListener("finish",m),g()}function m(){u("onfinish"),e.removeListener("close",d),g()}function g(){u("unpipe"),i.unpipe(e)}return i.on("data",f),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",h),e.once("close",d),e.once("finish",m),e.emit("pipe",i),a.flowing||(u("pipe resume"),i.resume()),e},j.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?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var n=0;n0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,u("on readable",a.length,a.reading),a.length?P(this):a.reading||r.nextTick(B,this))),i},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var i=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(T,this),i},j.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(T,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(I,e,t))}(this,e)),e.paused=!1,this},j.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var a in e.on("end",function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){(u("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(i=!0,e.pause()))}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var n=0;n<_.length;n++)e.on(_[n],this.emit.bind(this,_[n]));return this._read=function(t){u("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(j.prototype[Symbol.asyncIterator]=function(){return k("Readable[Symbol.asyncIterator]"),void 0===f&&(f=e("./internal/streams/async_iterator")),f(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),j._fromList=q,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":355,"../experimentalWarning":356,"./_stream_duplex":357,"./internal/streams/async_iterator":362,"./internal/streams/buffer_list":363,"./internal/streams/destroy":364,"./internal/streams/state":367,"./internal/streams/stream":368,_process:263,buffer:110,events:154,inherits:205,"string_decoder/":370,util:77}],360:[function(e,t,r){"use strict";t.exports=p;var i=e("../errors").codes,a=i.ERR_METHOD_NOT_IMPLEMENTED,n=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=i.ERR_TRANSFORM_WITH_LENGTH_0,c=e("./_stream_duplex");function u(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length-1))throw new k(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,r){r(new m("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,i){var a=this._writableState;return"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||function(e,t,i){t.ending=!0,z(e,t),i&&(t.finished?r.nextTick(i):e.once("finish",i));t.ended=!0,e.writable=!1}(this,a,i),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),j.prototype.destroy=l.destroy,j.prototype._undestroy=l.undestroy,j.prototype._destroy=function(e,t){t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":355,"./_stream_duplex":357,"./internal/streams/destroy":364,"./internal/streams/state":367,"./internal/streams/stream":368,_process:263,buffer:110,inherits:205,"util-deprecate":385}],362:[function(e,t,r){(function(r){"use strict";var i;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var n=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),p=Symbol("lastPromise"),l=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function d(e){var t=e[o];if(null!==t){var r=e[f].read();null!==r&&(e[p]=null,e[o]=null,e[s]=null,t(h(r,!1)))}}var m=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((a(i={get stream(){return this[f]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(t,i){r.nextTick(function(){e[c]?i(e[c]):t(h(void 0,!0))})});var i,a=this[p];if(a)i=new Promise(function(e,t){return function(r,i){e.then(function(){t[u]?r(h(void 0,!0)):t[l](r,i)},i)}}(a,this));else{var n=this[f].read();if(null!==n)return Promise.resolve(h(n,!1));i=new Promise(this[l])}return this[p]=i,i}},Symbol.asyncIterator,function(){return this}),a(i,"return",function(){var e=this;return new Promise(function(t,r){e[f].destroy(null,function(e){e?r(e):t(h(void 0,!0))})})}),i),m);t.exports=function(e){var t,i=Object.create(g,(a(t={},f,{value:e,writable:!0}),a(t,o,{value:null,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,c,{value:null,writable:!0}),a(t,u,{value:e._readableState.endEmitted,writable:!0}),a(t,l,{value:function(e,t){var r=i[f].read();r?(i[p]=null,i[o]=null,i[s]=null,e(h(r,!1))):(i[o]=e,i[s]=t)},writable:!0}),t));return i[p]=null,n(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[s];return null!==t&&(i[p]=null,i[o]=null,i[s]=null,t(e)),void(i[c]=e)}var r=i[o];null!==r&&(i[p]=null,i[o]=null,i[s]=null,r(h(void 0,!0))),i[u]=!0}),e.on("readable",function(e){r.nextTick(d,e)}.bind(null,i)),i}}).call(this,e("_process"))},{"./end-of-stream":365,_process:263}],363:[function(e,t,r){"use strict";function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("buffer").Buffer,n=e("util").inspect,o=n&&n.custom||"inspect";t.exports=function(){function e(){this.head=null,this.tail=null,this.length=0}var t=e.prototype;return t.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},t.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},t.shift=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}},t.clear=function(){this.head=this.tail=null,this.length=0},t.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},t.concat=function(e){if(0===this.length)return a.alloc(0);for(var t,r,i,n=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=n,i=s,a.prototype.copy.call(t,r,i),s+=o.data.length,o=o.next;return n},t.consume=function(e,t){var r;return ea.length?a.length:e;if(n===a.length?i+=a:i+=a.slice(0,e),0===(e-=n)){n===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(n));break}++r}return this.length-=r,i},t._getBuffer=function(e){var t=a.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0===(e-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,t},t[o]=function(e,t){return n(this,function(e){for(var t=1;t0,function(e){p||(p=e),e&&f.forEach(c),n||(f.forEach(c),l(p))})});return r.reduce(u)}},{"../../../errors":355,"./end-of-stream":365}],367:[function(e,t,r){"use strict";var i=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,a){var n=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new i(a?r:"highWaterMark",n);return Math.floor(n)}return e.objectMode?16:16384}}},{"../../../errors":355}],368:[function(e,t,r){arguments[4][290][0].apply(r,arguments)},{dup:290,events:154}],369:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":357,"./lib/_stream_passthrough.js":358,"./lib/_stream_readable.js":359,"./lib/_stream_transform.js":360,"./lib/_stream_writable.js":361,"./lib/internal/streams/end-of-stream.js":365,"./lib/internal/streams/pipeline.js":366}],370:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=i.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 n(e){var t;switch(this.encoding=function(e){var t=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}}(e);if("string"!=typeof t&&(i.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=p,this.end=l,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(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 c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=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 u(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 p(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 l(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 h(e){return e&&e.length?this.write(e):""}r.StringDecoder=n,n.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=0)return a>0&&(e.lastNeed=a-1),a;if(--i=0)return a>0&&(e.lastNeed=a-2),a;if(--i=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;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)},n.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}},{"safe-buffer":371}],371:[function(e,t,r){arguments[4][291][0].apply(r,arguments)},{buffer:110,dup:291}],372:[function(e,t,r){(function(t,i){var a=e("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,s={},c=0;function u(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=c++,i=!(arguments.length<2)&&o.call(arguments,1);return s[t]=!0,a(function(){s[t]&&(i?e.apply(null,i):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof i?i:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":263,timers:372}],373:[function(e,t,r){"use strict";var i,a=e("net"),n=e("url").parse,o=e("util"),s=e("./pubsuffix-psl"),c=e("./store").Store,u=e("./memstore").MemoryCookieStore,p=e("./pathMatch").pathMatch,l=e("../package.json").version;try{i=e("punycode")}catch(e){console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization")}var f=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/,h=/[\x00-\x1F]/,d=["\n","\r","\0"],m=/[\x20-\x3A\x3C-\x7E]+/,g=/[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/,b={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],w=2147483647e3;function k(e,t,r,i){for(var a=0;a=58)break;a++}return ar?null:i||a==e.length?parseInt(e.substr(0,a),10):null}function _(e){var t=e.split(":"),r=[0,0,0];if(3!==t.length)return null;for(var i=0;i<3;i++){var a=2==i,n=k(t[i],1,2,a);if(null===n)return null;r[i]=n}return r}function x(e){e=String(e).substr(0,3).toLowerCase();var t=b[e];return t>=0?t:null}function j(e){if(e){var t=e.split(g);if(t){for(var r=null,i=null,a=null,n=null,o=null,s=null,c=0;c=70&&s<=99?s+=1900:s>=0&&s<=69&&(s+=2e3)):o=u:n=u}if(!(null===n||null===o||null===s||null===a||n<1||n>31||s<1601||r>23||i>59||a>59))return new Date(Date.UTC(s,o,n,r,i,a))}}}function S(e){var t=e.getUTCDate();t=t>=10?t:"0"+t;var r=e.getUTCHours();r=r>=10?r:"0"+r;var i=e.getUTCMinutes();i=i>=10?i:"0"+i;var a=e.getUTCSeconds();return a=a>=10?a:"0"+a,y[e.getUTCDay()]+", "+t+" "+v[e.getUTCMonth()]+" "+e.getUTCFullYear()+" "+r+":"+i+":"+a+" GMT"}function E(e){return null==e?null:(e=e.trim().replace(/^\./,""),i&&/[^\u0001-\u007f]/.test(e)&&(e=i.toASCII(e)),e.toLowerCase())}function A(e,t,r){if(null==e||null==t)return null;if(!1!==r&&(e=E(e),t=E(t)),e==t)return!0;if(a.isIP(e))return!1;var i=e.indexOf(t);return!(i<=0)&&(e.length===t.length+i&&"."===e.substr(i-1,1))}function F(e){if(!e||"/"!==e.substr(0,1))return"/";if("/"===e)return e;var t=e.lastIndexOf("/");return 0===t?"/":e.slice(0,t)}function P(e,t){var r,i,a=(e=function(e){for(var t=0;t1;){var r=e.lastIndexOf("/");if(0===r)break;e=e.substr(0,r),t.push(e)}return t.push("/"),t},r.canonicalDomain=E},{"../package.json":379,"./memstore":374,"./pathMatch":375,"./permuteDomain":376,"./pubsuffix-psl":377,"./store":378,net:107,punycode:108,url:383,util:388}],374:[function(e,t,r){"use strict";var i=e("./store").Store,a=e("./permuteDomain").permuteDomain,n=e("./pathMatch").pathMatch,o=e("util");function s(){i.call(this),this.idx={}}o.inherits(s,i),r.MemoryCookieStore=s,s.prototype.idx=null,s.prototype.synchronous=!0,s.prototype.inspect=function(){return"{ idx: "+o.inspect(this.idx,!1,2)+" }"},o.inspect.custom&&(s.prototype[o.inspect.custom]=s.prototype.inspect),s.prototype.findCookie=function(e,t,r,i){return this.idx[e]&&this.idx[e][t]?i(null,this.idx[e][t][r]||null):i(null,void 0)},s.prototype.findCookies=function(e,t,r){var i,o=[];if(!e)return r(null,[]);i=t?function(e){Object.keys(e).forEach(function(r){if(n(t,r)){var i=e[r];for(var a in i)o.push(i[a])}})}:function(e){for(var t in e){var r=e[t];for(var i in r)o.push(r[i])}};var s=a(e)||[e],c=this.idx;s.forEach(function(e){var t=c[e];t&&i(t)}),r(null,o)},s.prototype.putCookie=function(e,t){this.idx[e.domain]||(this.idx[e.domain]={}),this.idx[e.domain][e.path]||(this.idx[e.domain][e.path]={}),this.idx[e.domain][e.path][e.key]=e,t(null)},s.prototype.updateCookie=function(e,t,r){this.putCookie(t,r)},s.prototype.removeCookie=function(e,t,r,i){this.idx[e]&&this.idx[e][t]&&this.idx[e][t][r]&&delete this.idx[e][t][r],i(null)},s.prototype.removeCookies=function(e,t,r){return this.idx[e]&&(t?delete this.idx[e][t]:delete this.idx[e]),r(null)},s.prototype.getAllCookies=function(e){var t=[],r=this.idx;Object.keys(r).forEach(function(e){Object.keys(r[e]).forEach(function(i){Object.keys(r[e][i]).forEach(function(a){null!==a&&t.push(r[e][i][a])})})}),t.sort(function(e,t){return(e.creationIndex||0)-(t.creationIndex||0)}),e(null,t)}},{"./pathMatch":375,"./permuteDomain":376,"./store":378,util:388}],375:[function(e,t,r){"use strict";r.pathMatch=function(e,t){if(t===e)return!0;if(0===e.indexOf(t)){if("/"===t.substr(-1))return!0;if("/"===e.substr(t.length,1))return!0}return!1}},{}],376:[function(e,t,r){"use strict";var i=e("./pubsuffix-psl");r.permuteDomain=function(e){var t=i.getPublicSuffix(e);if(!t)return null;if(t==e)return[e];for(var r=e.slice(0,-(t.length+1)).split(".").reverse(),a=t,n=[a];r.length;)a=r.shift()+"."+a,n.push(a);return n}},{"./pubsuffix-psl":377}],377:[function(e,t,r){"use strict";var i=e("psl");r.getPublicSuffix=function(e){return i.get(e)}},{psl:265}],378:[function(e,t,r){"use strict";function i(){}r.Store=i,i.prototype.synchronous=!1,i.prototype.findCookie=function(e,t,r,i){throw new Error("findCookie is not implemented")},i.prototype.findCookies=function(e,t,r){throw new Error("findCookies is not implemented")},i.prototype.putCookie=function(e,t){throw new Error("putCookie is not implemented")},i.prototype.updateCookie=function(e,t,r){throw new Error("updateCookie is not implemented")},i.prototype.removeCookie=function(e,t,r,i){throw new Error("removeCookie is not implemented")},i.prototype.removeCookies=function(e,t,r){throw new Error("removeCookies is not implemented")},i.prototype.getAllCookies=function(e){throw new Error("getAllCookies is not implemented (therefore jar cannot be serialized)")}},{}],379:[function(e,t,r){t.exports={_from:"tough-cookie@~2.4.3",_id:"tough-cookie@2.4.3",_inBundle:!1,_integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",_location:"/tough-cookie",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"tough-cookie@~2.4.3",name:"tough-cookie",escapedName:"tough-cookie",rawSpec:"~2.4.3",saveSpec:null,fetchSpec:"~2.4.3"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_spec:"tough-cookie@~2.4.3",_where:"W:\\projects\\git\\node-quickbase\\node_modules\\request",author:{name:"Jeremy Stashewsky",email:"jstash@gmail.com"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},bundleDependencies:!1,contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},deprecated:!1,description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},engines:{node:">=0.8"},files:["lib"],homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","cookie","cookies","set-cookie","cookiejar","jar","RFC6265","RFC2965"],license:"BSD-3-Clause",main:"./lib/cookie",name:"tough-cookie",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],380:[function(e,t,r){(function(t){"use strict";e("net");var i,a=e("tls"),n=e("http"),o=e("https"),s=e("events"),c=e("assert"),u=e("util"),p=e("safe-buffer").Buffer;function l(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||n.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",function(e,r,i){for(var a=0,n=t.requests.length;a=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},l.prototype.createConnection=function(e){var t=this;t.createSocket(e,function(r){function i(){t.emit("free",r,e.host,e.port)}function a(e){t.removeSocket(r),r.removeListener("free",i),r.removeListener("close",a),r.removeListener("agentRemove",a)}r.on("free",i),r.on("close",a),r.on("agentRemove",a),e.request.onSocket(r)})},l.prototype.createSocket=function(e,r){var a=this,n={};a.sockets.push(n);var o=h({},a.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1});o.proxyAuth&&(o.headers=o.headers||{},o.headers["Proxy-Authorization"]="Basic "+p.from(o.proxyAuth).toString("base64")),i("making CONNECT request");var s=a.request(o);function u(t,o,u){if(s.removeAllListeners(),o.removeAllListeners(),200===t.statusCode)c.equal(u.length,0),i("tunneling connection has established"),a.sockets[a.sockets.indexOf(n)]=o,r(o);else{i("tunneling socket could not be established, statusCode=%d",t.statusCode);var p=new Error("tunneling socket could not be established, statusCode="+t.statusCode);p.code="ECONNRESET",e.request.emit("error",p),a.removeSocket(n)}}s.useChunkedEncodingByDefault=!1,s.once("response",function(e){e.upgrade=!0}),s.once("upgrade",function(e,r,i){t.nextTick(function(){u(e,r,i)})}),s.once("connect",u),s.once("error",function(t){s.removeAllListeners(),i("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var r=new Error("tunneling socket could not be established, cause="+t.message);r.code="ECONNRESET",e.request.emit("error",r),a.removeSocket(n)}),s.end()},l.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},i=t.env.NODE_DEBUG&&/\btunnel\b/.test(t.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},r.debug=i}).call(this,e("_process"))},{_process:263,assert:65,events:154,http:351,https:203,net:107,"safe-buffer":314,tls:107,util:388}],381:[function(e,t,r){!function(t){"use strict";var r=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function m(e,t,r,i,a){var n,o=0;for(n=0;n>>8)-1}function g(e,t,r,i){return m(e,t,r,i,16)}function b(e,t,r,i){return m(e,t,r,i,32)}function v(e,t,r,i){!function(e,t,r,i){for(var a,n=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,p=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,k=n,_=o,x=s,j=c,S=u,E=p,A=l,F=f,P=h,z=d,C=m,O=g,T=b,B=v,I=y,R=w,q=0;q<20;q+=2)k^=(a=(T^=(a=(P^=(a=(S^=(a=k+T|0)<<7|a>>>25)+k|0)<<9|a>>>23)+S|0)<<13|a>>>19)+P|0)<<18|a>>>14,E^=(a=(_^=(a=(B^=(a=(z^=(a=E+_|0)<<7|a>>>25)+E|0)<<9|a>>>23)+z|0)<<13|a>>>19)+B|0)<<18|a>>>14,C^=(a=(A^=(a=(x^=(a=(I^=(a=C+A|0)<<7|a>>>25)+C|0)<<9|a>>>23)+I|0)<<13|a>>>19)+x|0)<<18|a>>>14,R^=(a=(O^=(a=(F^=(a=(j^=(a=R+O|0)<<7|a>>>25)+R|0)<<9|a>>>23)+j|0)<<13|a>>>19)+F|0)<<18|a>>>14,k^=(a=(j^=(a=(x^=(a=(_^=(a=k+j|0)<<7|a>>>25)+k|0)<<9|a>>>23)+_|0)<<13|a>>>19)+x|0)<<18|a>>>14,E^=(a=(S^=(a=(F^=(a=(A^=(a=E+S|0)<<7|a>>>25)+E|0)<<9|a>>>23)+A|0)<<13|a>>>19)+F|0)<<18|a>>>14,C^=(a=(z^=(a=(P^=(a=(O^=(a=C+z|0)<<7|a>>>25)+C|0)<<9|a>>>23)+O|0)<<13|a>>>19)+P|0)<<18|a>>>14,R^=(a=(I^=(a=(B^=(a=(T^=(a=R+I|0)<<7|a>>>25)+R|0)<<9|a>>>23)+T|0)<<13|a>>>19)+B|0)<<18|a>>>14;k=k+n|0,_=_+o|0,x=x+s|0,j=j+c|0,S=S+u|0,E=E+p|0,A=A+l|0,F=F+f|0,P=P+h|0,z=z+d|0,C=C+m|0,O=O+g|0,T=T+b|0,B=B+v|0,I=I+y|0,R=R+w|0,e[0]=k>>>0&255,e[1]=k>>>8&255,e[2]=k>>>16&255,e[3]=k>>>24&255,e[4]=_>>>0&255,e[5]=_>>>8&255,e[6]=_>>>16&255,e[7]=_>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=j>>>0&255,e[13]=j>>>8&255,e[14]=j>>>16&255,e[15]=j>>>24&255,e[16]=S>>>0&255,e[17]=S>>>8&255,e[18]=S>>>16&255,e[19]=S>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=F>>>0&255,e[29]=F>>>8&255,e[30]=F>>>16&255,e[31]=F>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=z>>>0&255,e[37]=z>>>8&255,e[38]=z>>>16&255,e[39]=z>>>24&255,e[40]=C>>>0&255,e[41]=C>>>8&255,e[42]=C>>>16&255,e[43]=C>>>24&255,e[44]=O>>>0&255,e[45]=O>>>8&255,e[46]=O>>>16&255,e[47]=O>>>24&255,e[48]=T>>>0&255,e[49]=T>>>8&255,e[50]=T>>>16&255,e[51]=T>>>24&255,e[52]=B>>>0&255,e[53]=B>>>8&255,e[54]=B>>>16&255,e[55]=B>>>24&255,e[56]=I>>>0&255,e[57]=I>>>8&255,e[58]=I>>>16&255,e[59]=I>>>24&255,e[60]=R>>>0&255,e[61]=R>>>8&255,e[62]=R>>>16&255,e[63]=R>>>24&255}(e,t,r,i)}function y(e,t,r,i){!function(e,t,r,i){for(var a,n=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,p=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,k=0;k<20;k+=2)n^=(a=(b^=(a=(h^=(a=(u^=(a=n+b|0)<<7|a>>>25)+n|0)<<9|a>>>23)+u|0)<<13|a>>>19)+h|0)<<18|a>>>14,p^=(a=(o^=(a=(v^=(a=(d^=(a=p+o|0)<<7|a>>>25)+p|0)<<9|a>>>23)+d|0)<<13|a>>>19)+v|0)<<18|a>>>14,m^=(a=(l^=(a=(s^=(a=(y^=(a=m+l|0)<<7|a>>>25)+m|0)<<9|a>>>23)+y|0)<<13|a>>>19)+s|0)<<18|a>>>14,w^=(a=(g^=(a=(f^=(a=(c^=(a=w+g|0)<<7|a>>>25)+w|0)<<9|a>>>23)+c|0)<<13|a>>>19)+f|0)<<18|a>>>14,n^=(a=(c^=(a=(s^=(a=(o^=(a=n+c|0)<<7|a>>>25)+n|0)<<9|a>>>23)+o|0)<<13|a>>>19)+s|0)<<18|a>>>14,p^=(a=(u^=(a=(f^=(a=(l^=(a=p+u|0)<<7|a>>>25)+p|0)<<9|a>>>23)+l|0)<<13|a>>>19)+f|0)<<18|a>>>14,m^=(a=(d^=(a=(h^=(a=(g^=(a=m+d|0)<<7|a>>>25)+m|0)<<9|a>>>23)+g|0)<<13|a>>>19)+h|0)<<18|a>>>14,w^=(a=(y^=(a=(v^=(a=(b^=(a=w+y|0)<<7|a>>>25)+w|0)<<9|a>>>23)+b|0)<<13|a>>>19)+v|0)<<18|a>>>14;e[0]=n>>>0&255,e[1]=n>>>8&255,e[2]=n>>>16&255,e[3]=n>>>24&255,e[4]=p>>>0&255,e[5]=p>>>8&255,e[6]=p>>>16&255,e[7]=p>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=l>>>0&255,e[17]=l>>>8&255,e[18]=l>>>16&255,e[19]=l>>>24&255,e[20]=f>>>0&255,e[21]=f>>>8&255,e[22]=f>>>16&255,e[23]=f>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,a,n,o){var s,c,u=new Uint8Array(16),p=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=n[c];for(;a>=64;){for(v(p,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^p[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;a-=64,t+=64,i+=64}if(a>0)for(v(p,u,o,w),c=0;c=64;){for(v(c,s,a,w),o=0;o<64;o++)e[t+o]=c[o];for(n=1,o=8;o<16;o++)n=n+(255&s[o])|0,s[o]=255&n,n>>>=8;r-=64,t+=64}if(r>0)for(v(c,s,a,w),o=0;o>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),a=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|a<<9),n=255&e[8]|(255&e[9])<<8,this.r[4]=255&(a>>>4|n<<12),this.r[5]=n>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(n>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function E(e,t,r,i,a,n){var o=new S(n);return o.update(r,i,a),o.finish(e,t),0}function A(e,t,r,i,a,n){var o=new Uint8Array(16);return E(o,0,r,i,a,n),g(e,t,o,0)}function F(e,t,r,i,a){var n;if(r<32)return-1;for(j(e,0,t,0,r,i,a),E(e,16,e,32,r-32,e),n=0;n<16;n++)e[n]=0;return 0}function P(e,t,r,i,a){var n,o=new Uint8Array(32);if(r<32)return-1;if(x(o,0,32,i,a),0!==A(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,a),n=0;n<32;n++)e[n]=0;return 0}function z(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function C(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function O(e,t,r){for(var i,a=~(r-1),n=0;n<16;n++)i=a&(e[n]^t[n]),e[n]^=i,t[n]^=i}function T(e,t){var i,a,n,o=r(),s=r();for(i=0;i<16;i++)s[i]=t[i];for(C(s),C(s),C(s),a=0;a<2;a++){for(o[0]=s[0]-65517,i=1;i<15;i++)o[i]=s[i]-65535-(o[i-1]>>16&1),o[i-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),n=o[15]>>16&1,o[14]&=65535,O(s,o,1-n)}for(i=0;i<16;i++)e[2*i]=255&s[i],e[2*i+1]=s[i]>>8}function B(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return T(r,e),T(i,t),b(r,0,i,0)}function I(e){var t=new Uint8Array(32);return T(t,e),1&t[0]}function R(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function q(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function M(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function D(e,t,r){var i,a,n=0,o=0,s=0,c=0,u=0,p=0,l=0,f=0,h=0,d=0,m=0,g=0,b=0,v=0,y=0,w=0,k=0,_=0,x=0,j=0,S=0,E=0,A=0,F=0,P=0,z=0,C=0,O=0,T=0,B=0,I=0,R=r[0],q=r[1],M=r[2],D=r[3],L=r[4],N=r[5],U=r[6],H=r[7],K=r[8],$=r[9],V=r[10],Z=r[11],W=r[12],G=r[13],Q=r[14],X=r[15];n+=(i=t[0])*R,o+=i*q,s+=i*M,c+=i*D,u+=i*L,p+=i*N,l+=i*U,f+=i*H,h+=i*K,d+=i*$,m+=i*V,g+=i*Z,b+=i*W,v+=i*G,y+=i*Q,w+=i*X,o+=(i=t[1])*R,s+=i*q,c+=i*M,u+=i*D,p+=i*L,l+=i*N,f+=i*U,h+=i*H,d+=i*K,m+=i*$,g+=i*V,b+=i*Z,v+=i*W,y+=i*G,w+=i*Q,k+=i*X,s+=(i=t[2])*R,c+=i*q,u+=i*M,p+=i*D,l+=i*L,f+=i*N,h+=i*U,d+=i*H,m+=i*K,g+=i*$,b+=i*V,v+=i*Z,y+=i*W,w+=i*G,k+=i*Q,_+=i*X,c+=(i=t[3])*R,u+=i*q,p+=i*M,l+=i*D,f+=i*L,h+=i*N,d+=i*U,m+=i*H,g+=i*K,b+=i*$,v+=i*V,y+=i*Z,w+=i*W,k+=i*G,_+=i*Q,x+=i*X,u+=(i=t[4])*R,p+=i*q,l+=i*M,f+=i*D,h+=i*L,d+=i*N,m+=i*U,g+=i*H,b+=i*K,v+=i*$,y+=i*V,w+=i*Z,k+=i*W,_+=i*G,x+=i*Q,j+=i*X,p+=(i=t[5])*R,l+=i*q,f+=i*M,h+=i*D,d+=i*L,m+=i*N,g+=i*U,b+=i*H,v+=i*K,y+=i*$,w+=i*V,k+=i*Z,_+=i*W,x+=i*G,j+=i*Q,S+=i*X,l+=(i=t[6])*R,f+=i*q,h+=i*M,d+=i*D,m+=i*L,g+=i*N,b+=i*U,v+=i*H,y+=i*K,w+=i*$,k+=i*V,_+=i*Z,x+=i*W,j+=i*G,S+=i*Q,E+=i*X,f+=(i=t[7])*R,h+=i*q,d+=i*M,m+=i*D,g+=i*L,b+=i*N,v+=i*U,y+=i*H,w+=i*K,k+=i*$,_+=i*V,x+=i*Z,j+=i*W,S+=i*G,E+=i*Q,A+=i*X,h+=(i=t[8])*R,d+=i*q,m+=i*M,g+=i*D,b+=i*L,v+=i*N,y+=i*U,w+=i*H,k+=i*K,_+=i*$,x+=i*V,j+=i*Z,S+=i*W,E+=i*G,A+=i*Q,F+=i*X,d+=(i=t[9])*R,m+=i*q,g+=i*M,b+=i*D,v+=i*L,y+=i*N,w+=i*U,k+=i*H,_+=i*K,x+=i*$,j+=i*V,S+=i*Z,E+=i*W,A+=i*G,F+=i*Q,P+=i*X,m+=(i=t[10])*R,g+=i*q,b+=i*M,v+=i*D,y+=i*L,w+=i*N,k+=i*U,_+=i*H,x+=i*K,j+=i*$,S+=i*V,E+=i*Z,A+=i*W,F+=i*G,P+=i*Q,z+=i*X,g+=(i=t[11])*R,b+=i*q,v+=i*M,y+=i*D,w+=i*L,k+=i*N,_+=i*U,x+=i*H,j+=i*K,S+=i*$,E+=i*V,A+=i*Z,F+=i*W,P+=i*G,z+=i*Q,C+=i*X,b+=(i=t[12])*R,v+=i*q,y+=i*M,w+=i*D,k+=i*L,_+=i*N,x+=i*U,j+=i*H,S+=i*K,E+=i*$,A+=i*V,F+=i*Z,P+=i*W,z+=i*G,C+=i*Q,O+=i*X,v+=(i=t[13])*R,y+=i*q,w+=i*M,k+=i*D,_+=i*L,x+=i*N,j+=i*U,S+=i*H,E+=i*K,A+=i*$,F+=i*V,P+=i*Z,z+=i*W,C+=i*G,O+=i*Q,T+=i*X,y+=(i=t[14])*R,w+=i*q,k+=i*M,_+=i*D,x+=i*L,j+=i*N,S+=i*U,E+=i*H,A+=i*K,F+=i*$,P+=i*V,z+=i*Z,C+=i*W,O+=i*G,T+=i*Q,B+=i*X,w+=(i=t[15])*R,o+=38*(_+=i*M),s+=38*(x+=i*D),c+=38*(j+=i*L),u+=38*(S+=i*N),p+=38*(E+=i*U),l+=38*(A+=i*H),f+=38*(F+=i*K),h+=38*(P+=i*$),d+=38*(z+=i*V),m+=38*(C+=i*Z),g+=38*(O+=i*W),b+=38*(T+=i*G),v+=38*(B+=i*Q),y+=38*(I+=i*X),n=(i=(n+=38*(k+=i*q))+(a=1)+65535)-65536*(a=Math.floor(i/65536)),o=(i=o+a+65535)-65536*(a=Math.floor(i/65536)),s=(i=s+a+65535)-65536*(a=Math.floor(i/65536)),c=(i=c+a+65535)-65536*(a=Math.floor(i/65536)),u=(i=u+a+65535)-65536*(a=Math.floor(i/65536)),p=(i=p+a+65535)-65536*(a=Math.floor(i/65536)),l=(i=l+a+65535)-65536*(a=Math.floor(i/65536)),f=(i=f+a+65535)-65536*(a=Math.floor(i/65536)),h=(i=h+a+65535)-65536*(a=Math.floor(i/65536)),d=(i=d+a+65535)-65536*(a=Math.floor(i/65536)),m=(i=m+a+65535)-65536*(a=Math.floor(i/65536)),g=(i=g+a+65535)-65536*(a=Math.floor(i/65536)),b=(i=b+a+65535)-65536*(a=Math.floor(i/65536)),v=(i=v+a+65535)-65536*(a=Math.floor(i/65536)),y=(i=y+a+65535)-65536*(a=Math.floor(i/65536)),w=(i=w+a+65535)-65536*(a=Math.floor(i/65536)),n=(i=(n+=a-1+37*(a-1))+(a=1)+65535)-65536*(a=Math.floor(i/65536)),o=(i=o+a+65535)-65536*(a=Math.floor(i/65536)),s=(i=s+a+65535)-65536*(a=Math.floor(i/65536)),c=(i=c+a+65535)-65536*(a=Math.floor(i/65536)),u=(i=u+a+65535)-65536*(a=Math.floor(i/65536)),p=(i=p+a+65535)-65536*(a=Math.floor(i/65536)),l=(i=l+a+65535)-65536*(a=Math.floor(i/65536)),f=(i=f+a+65535)-65536*(a=Math.floor(i/65536)),h=(i=h+a+65535)-65536*(a=Math.floor(i/65536)),d=(i=d+a+65535)-65536*(a=Math.floor(i/65536)),m=(i=m+a+65535)-65536*(a=Math.floor(i/65536)),g=(i=g+a+65535)-65536*(a=Math.floor(i/65536)),b=(i=b+a+65535)-65536*(a=Math.floor(i/65536)),v=(i=v+a+65535)-65536*(a=Math.floor(i/65536)),y=(i=y+a+65535)-65536*(a=Math.floor(i/65536)),w=(i=w+a+65535)-65536*(a=Math.floor(i/65536)),n+=a-1+37*(a-1),e[0]=n,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=p,e[6]=l,e[7]=f,e[8]=h,e[9]=d,e[10]=m,e[11]=g,e[12]=b,e[13]=v,e[14]=y,e[15]=w}function L(e,t){D(e,t,t)}function N(e,t){var i,a=r();for(i=0;i<16;i++)a[i]=t[i];for(i=253;i>=0;i--)L(a,a),2!==i&&4!==i&&D(a,a,t);for(i=0;i<16;i++)e[i]=a[i]}function U(e,t,i){var a,n,o=new Uint8Array(32),s=new Float64Array(80),u=r(),p=r(),l=r(),f=r(),h=r(),d=r();for(n=0;n<31;n++)o[n]=t[n];for(o[31]=127&t[31]|64,o[0]&=248,R(s,i),n=0;n<16;n++)p[n]=s[n],f[n]=u[n]=l[n]=0;for(u[0]=f[0]=1,n=254;n>=0;--n)O(u,p,a=o[n>>>3]>>>(7&n)&1),O(l,f,a),q(h,u,l),M(u,u,l),q(l,p,f),M(p,p,f),L(f,h),L(d,u),D(u,l,u),D(l,p,h),q(h,u,l),M(u,u,l),L(p,u),M(l,f,d),D(u,l,c),q(u,u,f),D(l,l,u),D(u,f,d),D(f,p,s),L(p,h),O(u,p,a),O(l,f,a);for(n=0;n<16;n++)s[n+16]=u[n],s[n+32]=l[n],s[n+48]=p[n],s[n+64]=f[n];var m=s.subarray(32),g=s.subarray(16);return N(m,m),D(g,g,m),T(e,g),0}function H(e,t){return U(e,t,n)}function K(e,t){return i(t,32),H(e,t)}function $(e,t,r){var i=new Uint8Array(32);return U(i,r,t),y(e,a,i,w)}S.prototype.blocks=function(e,t,r){for(var i,a,n,o,s,c,u,p,l,f,h,d,m,g,b,v,y,w,k,_=this.fin?0:2048,x=this.h[0],j=this.h[1],S=this.h[2],E=this.h[3],A=this.h[4],F=this.h[5],P=this.h[6],z=this.h[7],C=this.h[8],O=this.h[9],T=this.r[0],B=this.r[1],I=this.r[2],R=this.r[3],q=this.r[4],M=this.r[5],D=this.r[6],L=this.r[7],N=this.r[8],U=this.r[9];r>=16;)f=l=0,f+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*T,f+=(j+=8191&(i>>>13|(a=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),f+=(S+=8191&(a>>>10|(n=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*N),f+=(E+=8191&(n>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*L),l=(f+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,f&=8191,f+=(F+=s>>>1&8191)*(5*M),f+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*q),f+=(z+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*R),f+=(C+=8191&(u>>>8|(p=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*I),h=l+=(f+=(O+=p>>>5|_)*(5*B))>>>13,h+=x*B,h+=j*T,h+=S*(5*U),h+=E*(5*N),l=(h+=A*(5*L))>>>13,h&=8191,h+=F*(5*D),h+=P*(5*M),h+=z*(5*q),h+=C*(5*R),l+=(h+=O*(5*I))>>>13,h&=8191,d=l,d+=x*I,d+=j*B,d+=S*T,d+=E*(5*U),l=(d+=A*(5*N))>>>13,d&=8191,d+=F*(5*L),d+=P*(5*D),d+=z*(5*M),d+=C*(5*q),m=l+=(d+=O*(5*R))>>>13,m+=x*R,m+=j*I,m+=S*B,m+=E*T,l=(m+=A*(5*U))>>>13,m&=8191,m+=F*(5*N),m+=P*(5*L),m+=z*(5*D),m+=C*(5*M),g=l+=(m+=O*(5*q))>>>13,g+=x*q,g+=j*R,g+=S*I,g+=E*B,l=(g+=A*T)>>>13,g&=8191,g+=F*(5*U),g+=P*(5*N),g+=z*(5*L),g+=C*(5*D),b=l+=(g+=O*(5*M))>>>13,b+=x*M,b+=j*q,b+=S*R,b+=E*I,l=(b+=A*B)>>>13,b&=8191,b+=F*T,b+=P*(5*U),b+=z*(5*N),b+=C*(5*L),v=l+=(b+=O*(5*D))>>>13,v+=x*D,v+=j*M,v+=S*q,v+=E*R,l=(v+=A*I)>>>13,v&=8191,v+=F*B,v+=P*T,v+=z*(5*U),v+=C*(5*N),y=l+=(v+=O*(5*L))>>>13,y+=x*L,y+=j*D,y+=S*M,y+=E*q,l=(y+=A*R)>>>13,y&=8191,y+=F*I,y+=P*B,y+=z*T,y+=C*(5*U),w=l+=(y+=O*(5*N))>>>13,w+=x*N,w+=j*L,w+=S*D,w+=E*M,l=(w+=A*q)>>>13,w&=8191,w+=F*R,w+=P*I,w+=z*B,w+=C*T,k=l+=(w+=O*(5*U))>>>13,k+=x*U,k+=j*N,k+=S*L,k+=E*D,l=(k+=A*M)>>>13,k&=8191,k+=F*q,k+=P*R,k+=z*I,k+=C*B,x=f=8191&(l=(l=((l+=(k+=O*T)>>>13)<<2)+l|0)+(f&=8191)|0),j=h+=l>>>=13,S=d&=8191,E=m&=8191,A=g&=8191,F=b&=8191,P=v&=8191,z=y&=8191,C=w&=8191,O=k&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=j,this.h[2]=S,this.h[3]=E,this.h[4]=A,this.h[5]=F,this.h[6]=P,this.h[7]=z,this.h[8]=C,this.h[9]=O},S.prototype.finish=function(e,t){var r,i,a,n,o=new Uint16Array(10);if(this.leftover){for(n=this.leftover,this.buffer[n++]=1;n<16;n++)this.buffer[n]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,n=2;n<10;n++)this.h[n]+=r,r=this.h[n]>>>13,this.h[n]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,n=1;n<10;n++)o[n]=this.h[n]+r,r=o[n]>>>13,o[n]&=8191;for(o[9]-=8192,i=(1^r)-1,n=0;n<10;n++)o[n]&=i;for(i=~i,n=0;n<10;n++)this.h[n]=this.h[n]&i|o[n];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),a=this.h[0]+this.pad[0],this.h[0]=65535&a,n=1;n<8;n++)a=(this.h[n]+this.pad[n]|0)+(a>>>16)|0,this.h[n]=65535&a;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},S.prototype.update=function(e,t,r){var i,a;if(this.leftover){for((a=16-this.leftover)>r&&(a=r),i=0;i=16&&(a=r-r%16,this.blocks(e,t,a),t+=a,r-=a),r){for(i=0;i=128;){for(_=0;_<16;_++)x=8*_+G,z[_]=r[x+0]<<24|r[x+1]<<16|r[x+2]<<8|r[x+3],C[_]=r[x+4]<<24|r[x+5]<<16|r[x+6]<<8|r[x+7];for(_=0;_<80;_++)if(a=O,n=T,o=B,s=I,c=R,u=q,p=M,D,f=L,h=N,d=U,m=H,g=K,b=$,v=V,Z,E=65535&(S=Z),A=S>>>16,F=65535&(j=D),P=j>>>16,E+=65535&(S=(K>>>14|R<<18)^(K>>>18|R<<14)^(R>>>9|K<<23)),A+=S>>>16,F+=65535&(j=(R>>>14|K<<18)^(R>>>18|K<<14)^(K>>>9|R<<23)),P+=j>>>16,E+=65535&(S=K&$^~K&V),A+=S>>>16,F+=65535&(j=R&q^~R&M),P+=j>>>16,j=W[2*_],E+=65535&(S=W[2*_+1]),A+=S>>>16,F+=65535&j,P+=j>>>16,j=z[_%16],A+=(S=C[_%16])>>>16,F+=65535&j,P+=j>>>16,F+=(A+=(E+=65535&S)>>>16)>>>16,E=65535&(S=k=65535&E|A<<16),A=S>>>16,F=65535&(j=w=65535&F|(P+=F>>>16)<<16),P=j>>>16,E+=65535&(S=(L>>>28|O<<4)^(O>>>2|L<<30)^(O>>>7|L<<25)),A+=S>>>16,F+=65535&(j=(O>>>28|L<<4)^(L>>>2|O<<30)^(L>>>7|O<<25)),P+=j>>>16,A+=(S=L&N^L&U^N&U)>>>16,F+=65535&(j=O&T^O&B^T&B),P+=j>>>16,l=65535&(F+=(A+=(E+=65535&S)>>>16)>>>16)|(P+=F>>>16)<<16,y=65535&E|A<<16,E=65535&(S=m),A=S>>>16,F=65535&(j=s),P=j>>>16,A+=(S=k)>>>16,F+=65535&(j=w),P+=j>>>16,T=a,B=n,I=o,R=s=65535&(F+=(A+=(E+=65535&S)>>>16)>>>16)|(P+=F>>>16)<<16,q=c,M=u,D=p,O=l,N=f,U=h,H=d,K=m=65535&E|A<<16,$=g,V=b,Z=v,L=y,_%16==15)for(x=0;x<16;x++)j=z[x],E=65535&(S=C[x]),A=S>>>16,F=65535&j,P=j>>>16,j=z[(x+9)%16],E+=65535&(S=C[(x+9)%16]),A+=S>>>16,F+=65535&j,P+=j>>>16,w=z[(x+1)%16],E+=65535&(S=((k=C[(x+1)%16])>>>1|w<<31)^(k>>>8|w<<24)^(k>>>7|w<<25)),A+=S>>>16,F+=65535&(j=(w>>>1|k<<31)^(w>>>8|k<<24)^w>>>7),P+=j>>>16,w=z[(x+14)%16],A+=(S=((k=C[(x+14)%16])>>>19|w<<13)^(w>>>29|k<<3)^(k>>>6|w<<26))>>>16,F+=65535&(j=(w>>>19|k<<13)^(k>>>29|w<<3)^w>>>6),P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,z[x]=65535&F|P<<16,C[x]=65535&E|A<<16;E=65535&(S=L),A=S>>>16,F=65535&(j=O),P=j>>>16,j=e[0],A+=(S=t[0])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[0]=O=65535&F|P<<16,t[0]=L=65535&E|A<<16,E=65535&(S=N),A=S>>>16,F=65535&(j=T),P=j>>>16,j=e[1],A+=(S=t[1])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[1]=T=65535&F|P<<16,t[1]=N=65535&E|A<<16,E=65535&(S=U),A=S>>>16,F=65535&(j=B),P=j>>>16,j=e[2],A+=(S=t[2])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[2]=B=65535&F|P<<16,t[2]=U=65535&E|A<<16,E=65535&(S=H),A=S>>>16,F=65535&(j=I),P=j>>>16,j=e[3],A+=(S=t[3])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[3]=I=65535&F|P<<16,t[3]=H=65535&E|A<<16,E=65535&(S=K),A=S>>>16,F=65535&(j=R),P=j>>>16,j=e[4],A+=(S=t[4])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[4]=R=65535&F|P<<16,t[4]=K=65535&E|A<<16,E=65535&(S=$),A=S>>>16,F=65535&(j=q),P=j>>>16,j=e[5],A+=(S=t[5])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[5]=q=65535&F|P<<16,t[5]=$=65535&E|A<<16,E=65535&(S=V),A=S>>>16,F=65535&(j=M),P=j>>>16,j=e[6],A+=(S=t[6])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[6]=M=65535&F|P<<16,t[6]=V=65535&E|A<<16,E=65535&(S=Z),A=S>>>16,F=65535&(j=D),P=j>>>16,j=e[7],A+=(S=t[7])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[7]=D=65535&F|P<<16,t[7]=Z=65535&E|A<<16,G+=128,i-=128}return i}function Q(e,t,r){var i,a=new Int32Array(8),n=new Int32Array(8),o=new Uint8Array(256),s=r;for(a[0]=1779033703,a[1]=3144134277,a[2]=1013904242,a[3]=2773480762,a[4]=1359893119,a[5]=2600822924,a[6]=528734635,a[7]=1541459225,n[0]=4089235720,n[1]=2227873595,n[2]=4271175723,n[3]=1595750129,n[4]=2917565137,n[5]=725511199,n[6]=4215389547,n[7]=327033209,G(a,n,t,r),r%=128,i=0;i=0;--a)Y(e,t,i=r[a/8|0]>>(7&a)&1),X(t,e),X(e,e),Y(e,t,i)}function te(e,t){var i=[r(),r(),r(),r()];z(i[0],l),z(i[1],f),z(i[2],s),D(i[3],l,f),ee(e,i,t)}function re(e,t,a){var n,o=new Uint8Array(64),s=[r(),r(),r(),r()];for(a||i(t,32),Q(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,te(s,o),J(e,s),n=0;n<32;n++)t[n+32]=e[n];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,a,n;for(i=63;i>=32;--i){for(r=0,a=i-32,n=i-12;a>8,t[a]-=256*r;t[a]+=r,t[i]=0}for(r=0,a=0;a<32;a++)t[a]+=r-(t[31]>>4)*ie[a],r=t[a]>>8,t[a]&=255;for(a=0;a<32;a++)t[a]-=r*ie[a];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function ne(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function oe(e,t,i,a){var n,o,s=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),p=new Float64Array(64),l=[r(),r(),r(),r()];Q(s,a,32),s[0]&=248,s[31]&=127,s[31]|=64;var f=i+64;for(n=0;n=0;i--)L(a,a),1!==i&&D(a,a,t);for(i=0;i<16;i++)e[i]=a[i]}(i,i),D(i,i,n),D(i,i,c),D(i,i,c),D(e[0],i,c),L(a,e[0]),D(a,a,c),B(a,n)&&D(e[0],e[0],h),L(a,e[0]),D(a,a,c),B(a,n)?-1:(I(e[0])===t[31]>>7&&M(e[0],o,e[0]),D(e[3],e[0],e[1]),0)}function ce(e,t,i,a){var n,o=new Uint8Array(32),s=new Uint8Array(64),c=[r(),r(),r(),r()],u=[r(),r(),r(),r()];if(-1,i<64)return-1;if(se(u,a))return-1;for(n=0;n=0},t.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return re(e,t),{publicKey:e,secretKey:t}},t.sign.keyPair.fromSecretKey=function(e){if(me(e),64!==e.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),r=0;r1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,a=1;a= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,m=String.fromCharCode;function g(e){throw new RangeError(h[e])}function b(e,t){var r=e.split("@"),i="";r.length>1&&(i=r[0]+"@",e=r[1]);var a=function(e,t){for(var r=[],i=e.length;i--;)r[i]=t(e[i]);return r}((e=e.replace(f,".")).split("."),t).join(".");return i+a}function v(e){for(var t=[],r=0,i=e.length;r=55296&&a<=56319&&r>1,e+=d(e/t);e>455;i+=36)e=d(e/35);return d(i+36*e/(e+38))},k=function(e){var t,r=[],i=e.length,a=0,n=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var c=0;c=128&&g("not-basic"),r.push(e.charCodeAt(c));for(var p=s>0?s+1:0;p=i&&g("invalid-input");var m=(t=e.charCodeAt(p++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>d((u-a)/f))&&g("overflow"),a+=m*f;var b=h<=o?1:h>=o+26?26:h-o;if(md(u/v)&&g("overflow"),f*=v}var y=r.length+1;o=w(a-l,y,0==l),d(a/y)>u-n&&g("overflow"),n+=d(a/y),a%=y,r.splice(a++,0,n)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=v(e)).length,i=128,a=0,n=72,o=!0,s=!1,c=void 0;try{for(var p,l=e[Symbol.iterator]();!(o=(p=l.next()).done);o=!0){var f=p.value;f<128&&t.push(m(f))}}catch(e){s=!0,c=e}finally{try{!o&&l.return&&l.return()}finally{if(s)throw c}}var h=t.length,b=h;for(h&&t.push("-");b=i&&Ad((u-a)/F)&&g("overflow"),a+=(k-i)*F,i=k;var P=!0,z=!1,C=void 0;try{for(var O,T=e[Symbol.iterator]();!(P=(O=T.next()).done);P=!0){var B=O.value;if(Bu&&g("overflow"),B==i){for(var I=a,R=36;;R+=36){var q=R<=n?1:R>=n+26?26:R-n;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function E(e){for(var t="",r=0,i=e.length;r=194&&a<224){if(i-r>=6){var n=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&a)<<6|63&n)}else t+=e.substr(r,6);r+=6}else if(a>=224){if(i-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&a)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function A(e,t){function r(e){var r=E(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,a)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,a)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,a)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,a)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,a)),e}function F(e){return e.replace(/^0*(.*)/,"$1")||"0"}function P(e,t){var r=e.match(t.IPV4ADDRESS)||[],i=c(r,2)[1];return i?i.split(".").map(F).join("."):e}function z(e,t){var r=e.match(t.IPV6ADDRESS)||[],i=c(r,3),a=i[1],n=i[2];if(a){for(var o=a.toLowerCase().split("::").reverse(),s=c(o,2),u=s[0],p=s[1],l=p?p.split(":").map(F):[],f=u.split(":").map(F),h=t.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,m=f.length-d,g=Array(d),b=0;b1){var w=g.slice(0,v.index),k=g.slice(v.index+v.length);y=w.join(":")+"::"+k.join(":")}else y=g.join(":");return n&&(y+="%"+n),y}return e}var C=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,O=void 0==="".match(/(){0}/)[1];function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var a=e.match(C);if(a){O?(r.scheme=a[1],r.userinfo=a[3],r.host=a[4],r.port=parseInt(a[5],10),r.path=a[6]||"",r.query=a[7],r.fragment=a[8],isNaN(r.port)&&(r.port=a[5])):(r.scheme=a[1]||void 0,r.userinfo=-1!==e.indexOf("@")?a[3]:void 0,r.host=-1!==e.indexOf("//")?a[4]:void 0,r.port=parseInt(a[5],10),r.path=a[6]||"",r.query=-1!==e.indexOf("?")?a[7]:void 0,r.fragment=-1!==e.indexOf("#")?a[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?a[4]:void 0)),r.host&&(r.host=z(P(r.host,i),i)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var n=j[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||n&&n.unicodeSupport)A(r,i);else{if(r.host&&(t.domainHost||n&&n.domainHost))try{r.host=x.toASCII(r.host.replace(i.PCT_ENCODED,E).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}A(r,o)}n&&n.parse&&n.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var B=/^\.\.?\//,I=/^\/\.(\/|$)/,R=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function M(e){for(var t=[];e.length;)if(e.match(B))e=e.replace(B,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(R))e=e.replace(R,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(q);if(!r)throw new Error("Unexpected dot segment condition");var i=r[0];e=e.slice(i.length),t.push(i)}return t.join("")}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,i=[],a=j[(t.scheme||e.scheme||"").toLowerCase()];if(a&&a.serialize&&a.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||a&&a.domainHost)try{e.host=t.iri?x.toUnicode(e.host):x.toASCII(e.host.replace(r.PCT_ENCODED,E).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}A(e,r),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var n=function(e,t){var r=!1!==t.iri?s:o,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(z(P(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"==typeof e.port&&(i.push(":"),i.push(e.port.toString(10))),i.length?i.join(""):void 0}(e,t);if(void 0!==n&&("suffix"!==t.reference&&i.push("//"),i.push(n),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||a&&a.absolutePath||(c=M(c)),void 0===n&&(c=c.replace(/^\/\//,"/%2F")),i.push(c)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function L(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};return arguments[3]||(e=T(D(e,r),r),t=T(D(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=M(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=M(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=M(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=M(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function N(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,E)}var U={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},H={scheme:"https",domainHost:U.domainHost,parse:U.parse,serialize:U.serialize},K={},$="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",V="[0-9A-Fa-f]",Z=r(r("%[EFef][0-9A-Fa-f]%"+V+V+"%"+V+V)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+V+V)+"|"+r("%"+V+V)),W=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),G=new RegExp($,"g"),Q=new RegExp(Z,"g"),X=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),Y=new RegExp(t("[^]",$,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),J=Y;function ee(e){var t=E(e);return t.match(G)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var a=!1,n={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),p=["'"].concat(u),l=["%","/","?",";","#"].concat(p),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=e("querystring");function y(e,t,r){if(e&&a.isObject(e)&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}n.prototype.parse=function(e,t,r){if(!a.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),s=-1!==n&&n127?T+="x":T+=O[B];if(!T.match(h)){var R=z.slice(0,A),q=z.slice(A+1),M=O.match(d);M&&(R.push(M[1]),q.unshift(M[2])),q.length&&(y="/"+q.join(".")+y),this.hostname=R.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=i.toASCII(this.hostname));var D=this.port?":"+this.port:"",L=this.hostname||"";this.host=L+D,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[_])for(A=0,C=p.length;A0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift());return r.search=e.search,r.query=e.query,a.isNull(r.pathname)&&a.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=x.slice(-1)[0],E=(r.host||e.host||x.length>1)&&("."===S||".."===S)||""===S,A=0,F=x.length;F>=0;F--)"."===(S=x[F])?x.splice(F,1):".."===S?(x.splice(F,1),A++):A&&(x.splice(F,1),A--);if(!k&&!_)for(;A--;A)x.unshift("..");!k||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var P,z=""===x[0]||x[0]&&"/"===x[0].charAt(0);j&&(r.hostname=r.host=z?"":x.length?x.shift():"",(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift()));return(k=k||r.host&&x.length)&&!z&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),a.isNull(r.pathname)&&a.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":384,punycode:108,querystring:279}],384:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],385:[function(e,t,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],386:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],387:[function(e,t,r){arguments[4][67][0].apply(r,arguments)},{dup:67}],388:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{"./support/isBuffer":387,_process:263,dup:68,inherits:386}],389:[function(e,t,r){for(var i=[],a=0;a<256;++a)i[a]=(a+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,a=i;return[a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]]].join("")}},{}],390:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var a=new Uint8Array(16);t.exports=function(){return i(a),a}}else{var n=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},{}],391:[function(e,t,r){var i=e("./lib/rng"),a=e("./lib/bytesToUuid");t.exports=function(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||i)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[n+s]=o[s];return t||a(o)}},{"./lib/bytesToUuid":389,"./lib/rng":390}],392:[function(e,t,r){var i=e("assert-plus"),a=e("util"),n=e("extsprintf"),o=e("core-util-is").isError,s=n.sprintf;function c(e){var t,r,a,n;if(i.object(e,"args"),i.bool(e.strict,"args.strict"),i.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},a=[];else if(o(t[0]))r={cause:t[0]},a=t.slice(1);else if("object"==typeof t[0]){for(n in r={},t[0])r[n]=t[0][n];a=t.slice(1)}else i.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},a=t;return i.object(r),r.strict||e.strict||(a=a.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===a.length?"":s.apply(null,a)}}function u(){var e,t,r,a,n,s,p;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof u))return t=Object.create(u.prototype),u.apply(t,arguments),t;if((r=c({argv:e,strict:!1})).options.name&&(i.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,s=r.shortmessage,(a=r.options.cause)&&(i.ok(o(a),"cause is not an Error"),this.jse_cause=a,r.options.skipCauseMessage||(s+=": "+a.message)),this.jse_info={},r.options.info)for(p in r.options.info)this.jse_info[p]=r.options.info[p];return this.message=s,Error.call(this,s),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function p(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof p?(i=(r=c({argv:e,strict:!0})).options,u.call(this,i,"%s",r.shortmessage),this):(t=Object.create(p.prototype),p.apply(t,arguments),t)}function l(e){i.array(e,"list of errors"),i.ok(e.length>0,"must be at least one error"),this.ase_errors=e,u.call(this,{cause:e[0]},"first of %d error%s",e.length,1==e.length?"":"s")}function f(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof f?((i=(r=c({argv:e,strict:!1})).options).skipCauseMessage=!0,u.call(this,i,"%s",r.shortmessage),this):(t=Object.create(f.prototype),f.apply(t,e),t)}t.exports=u,u.VError=u,u.SError=p,u.WError=f,u.MultiError=l,a.inherits(u,Error),u.prototype.name="VError",u.prototype.toString=function(){var e=this.hasOwnProperty("name")&&this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e+=": "+this.message),e},u.prototype.cause=function(){var e=u.cause(this);return null===e?void 0:e},u.cause=function(e){return i.ok(o(e),"err must be an Error"),o(e.jse_cause)?e.jse_cause:null},u.info=function(e){var t,r,a;if(i.ok(o(e),"err must be an Error"),t=null!==(r=u.cause(e))?u.info(r):{},"object"==typeof e.jse_info&&null!==e.jse_info)for(a in e.jse_info)t[a]=e.jse_info[a];return t},u.findCauseByName=function(e,t){var r;for(i.ok(o(e),"err must be an Error"),i.string(t,"name"),i.ok(t.length>0,"name cannot be empty"),r=e;null!==r;r=u.cause(r))if(i.ok(o(r)),r.name==t)return r;return null},u.hasCauseWithName=function(e,t){return null!==u.findCauseByName(e,t)},u.fullStack=function(e){i.ok(o(e),"err must be an Error");var t=u.cause(e);return t?e.stack+"\ncaused by: "+u.fullStack(t):e.stack},u.errorFromList=function(e){return i.arrayOfObject(e,"errors"),0===e.length?null:(e.forEach(function(e){i.ok(o(e))}),1==e.length?e[0]:new l(e))},u.errorForEach=function(e,t){i.ok(o(e),"err must be an Error"),i.func(t,"func"),e instanceof l?e.errors().forEach(function(e){t(e)}):t(e)},a.inherits(p,u),a.inherits(l,u),l.prototype.name="MultiError",l.prototype.errors=function(){return this.ase_errors.slice(0)},a.inherits(f,u),f.prototype.name="WError",f.prototype.toString=function(){var e=this.hasOwnProperty("name")&&this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e+=": "+this.message),this.jse_cause&&this.jse_cause.message&&(e+="; caused by "+this.jse_cause.toString()),e},f.prototype.cause=function(e){return o(e)&&(this.jse_cause=e),this.jse_cause}},{"assert-plus":64,"core-util-is":115,extsprintf:157,util:388}],393:[function(require,module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r{const i=0+this._id;return u(i,e),s(e).then(e=>{p(i,e),t(e)}).catch(e=>{p(e),r(e)})})}getApp(e){const t=this._getBasicRequest();return t.url+="apps/"+e,this._request(t)}getAppTables(e){const t=this._getBasicRequest();return t.url+="tables?appId="+e,this._request(t)}getFields(e){const t=this._getBasicRequest();return t.url+="fields?tableId="+e,this._request(t)}getField(e,t){const r=this._getBasicRequest();return r.url+="fields/"+t+"?tableId="+e,this._request(r)}getReport(e,t){const r=this._getBasicRequest();return r.url+="reports/"+t+"?tableId="+e,this._request(r)}getTable(e){const t=this._getBasicRequest();return t.url+="tables/"+e,this._request(t)}getTableReports(e){const t=this._getBasicRequest();return t.url+="reports?tableId="+e,this._request(t)}runReport(e,t){const r=this._getBasicRequest();return r.url+="reports/"+e+"/"+t+"/run",this._request(r)}}f.Promise=c,f.className="QuickBase",f.defaults=l,f.VERSION=i,void 0!==t&&t.exports?t.exports=f:"function"==typeof define&&define.amd&&define("QuickBase",[],function(){return f}),(void 0!==r&&"undefined"!=typeof window&&r===window||void 0===r&&"undefined"!=typeof window)&&((r||window).QuickBase=f,window.location.search.match(/debug=1/i)?window.localStorage&&(window.localStorage.debug="quickbase:*"):f.Promise.config({longStackTraces:!1}))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{bluebird:74,debug:122,"generic-throttle":162,"lodash.merge":215,"request-promise":299}]},{},[395]); +!function(){return function e(t,r,i){function a(o,s){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!s&&c)return c(o,!0);if(n)return n(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[o]={exports:{}};t[o][0].call(p.exports,function(e){return a(t[o][1][e]||e)},p,p.exports,e,t,r,i)}return r[o].exports}for(var n="function"==typeof require&&require,o=0;o%\\^`{|}]|%[0-9a-f]{2})|\{[+#.\/;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,p=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,l=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,f=/^(?:\/(?:[^~\/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~\/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(a);if(!t)return!1;var r=+t[1],i=+t[2],o=+t[3];return i>=1&&i<=12&&o>=1&&o<=(2==i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:n[i])}function b(e,t){var r=e.match(o);if(!r)return!1;var i=r[1],a=r[2],n=r[3],s=r[5];return(i<=23&&a<=59&&n<=59||23==i&&59==a&&60==n)&&(!t||s)}t.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:p,email:/^[a-z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:k,uuid:l,"json-pointer":f,"json-pointer-uri-fragment":h,"relative-json-pointer":d},m.full={date:g,time:b,"date-time":function(e){var t=e.split(v);return 2==t.length&&g(t[0])&&b(t[1],!0)},uri:function(e){return y.test(e)&&c.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@\/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@\/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:p,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&s.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:k,uuid:l,"json-pointer":f,"json-pointer-uri-fragment":h,"relative-json-pointer":d};var v=/t|\s/i;var y=/\/|:/;var w=/[^\\]\\Z/;function k(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":11}],6:[function(e,t,r){"use strict";var i=e("./resolve"),a=e("./util"),n=e("./error_classes"),o=e("fast-json-stable-stringify"),s=e("../dotjs/validate"),c=a.ucs2length,u=e("fast-deep-equal"),p=n.Validation;function l(e,t,r){for(var i=0;i=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}.call(this,t,r,v);var P=this._compilations[F.index];if(F.compiling)return P.callValidate=function e(){var t=P.validate;var r=t.apply(this,arguments);e.errors=t.errors;return r};var z=this._formats;var C=this.RULES;try{var O=B(t,r,b,v);P.validate=O;var T=P.callValidate;return T&&(T.schema=O.schema,T.errors=null,T.refs=O.refs,T.refVal=O.refVal,T.root=O.root,T.$async=O.$async,w.sourceCode&&(T.source=O.source)),O}finally{(function(e,t,r){var i=l.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}).call(this,t,r,v)}function B(t,o,l,b){var v=!o||o&&o.schema==t;if(o.schema!=r.schema)return e.call(y,t,o,l,b);var j,E=!0===t.$async,F=s({isTop:!0,schema:t,isRoot:v,baseId:b,root:o,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:n.MissingRef,RULES:C,validate:s,util:a,resolve:i,resolveRef:I,usePattern:M,useDefault:D,useCustomRule:L,opts:w,formats:z,logger:y.logger,self:y});F=g(k,d)+g(x,f)+g(S,h)+g(A,m)+F,w.processCode&&(F=w.processCode(F));try{var P=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",F);j=P(y,C,z,r,k,S,A,u,c,p),k[0]=j}catch(e){throw y.logger.error("Error compiling schema, function code:",F),e}return j.schema=t,j.errors=null,j.refs=_,j.refVal=k,j.root=v?j:o,E&&(j.$async=!0),!0===w.sourceCode&&(j.source={code:F,patterns:x,defaults:S}),j}function I(t,a,n){a=i.url(t,a);var o,s,c=_[a];if(void 0!==c)return q(o=k[c],s="refVal["+c+"]");if(!n&&r.refs){var u=r.refs[a];if(void 0!==u)return o=r.refVal[u],s=R(a,o),q(o,s)}s=R(a);var p=i.call(y,B,r,a);if(void 0===p){var l=b&&b[a];l&&(p=i.inlineRef(l,w.inlineRefs)?l:e.call(y,l,r,b,t))}if(void 0!==p)return function(e,t){var r=_[e];k[r]=t}(a,p),q(p,s);!function(e){delete _[e]}(a)}function R(e,t){var r=k.length;return k[r]=t,_[e]=r,"refVal"+r}function q(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function M(e){var t=j[e];return void 0===t&&(t=j[e]=x.length,x[t]=e),"pattern"+t}function D(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return a.toQuotedString(e);case"object":if(null===e)return"null";var t=o(e),r=E[t];return void 0===r&&(r=E[t]=S.length,S[r]=e),"default"+r}}function L(e,t,r,i){if(!1!==y._opts.validateSchema){var a=e.definition.dependencies;if(a&&!a.every(function(e){return Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have all required keywords: "+a.join(","));var n=e.definition.validateSchema;if(n){var o=n(t);if(!o){var s="keyword schema is invalid: "+y.errorsText(n.errors);if("log"!=y._opts.validateSchema)throw new Error(s);y.logger.error(s)}}}var c,u=e.definition.compile,p=e.definition.inline,l=e.definition.macro;if(u)c=u.call(y,t,r,i);else if(l)c=l.call(y,t,r,i),!1!==w.validateSchema&&y.validateSchema(c,!0);else if(p)c=p.call(y,i,e.keyword,t,r);else if(!(c=e.definition.validate))return;if(void 0===c)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var f=A.length;return A[f]=c,{code:"customRule"+f,validate:c}}}},{"../dotjs/validate":39,"./error_classes":4,"./resolve":7,"./util":11,"fast-deep-equal":158,"fast-json-stable-stringify":159}],7:[function(e,t,r){"use strict";var i=e("uri-js"),a=e("fast-deep-equal"),n=e("./util"),o=e("./schema_obj"),s=e("json-schema-traverse");function c(e,t,r){var i=this._refs[r];if("string"==typeof i){if(!this._refs[i])return c.call(this,e,t,i);i=this._refs[i]}if((i=i||this._schemas[r])instanceof o)return h(i.schema,this._opts.inlineRefs)?i.schema:i.validate||this._compile(i);var a,n,s,p=u.call(this,t,r);return p&&(a=p.schema,t=p.root,s=p.baseId),a instanceof o?n=a.validate||e.call(this,a.schema,t,void 0,s):void 0!==a&&(n=h(a,this._opts.inlineRefs)?a:e.call(this,a,t,void 0,s)),n}function u(e,t){var r=i.parse(t),a=m(r),n=d(this._getId(e.schema));if(0===Object.keys(e.schema).length||a!==n){var s=b(a),c=this._refs[s];if("string"==typeof c)return function(e,t,r){var i=u.call(this,e,t);if(i){var a=i.schema,n=i.baseId;e=i.root;var o=this._getId(a);return o&&(n=v(n,o)),l.call(this,r,n,a,e)}}.call(this,e,c,r);if(c instanceof o)c.validate||this._compile(c),e=c;else{if(!((c=this._schemas[s])instanceof o))return;if(c.validate||this._compile(c),s==b(t))return{schema:c,root:e,baseId:n};e=c}if(!e.schema)return;n=d(this._getId(e.schema))}return l.call(this,r,n,e.schema,e)}t.exports=c,c.normalizeId=b,c.fullPath=d,c.url=v,c.ids=function(e){var t=b(this._getId(e)),r={"":t},o={"":d(t,!1)},c={},u=this;return s(e,{allKeys:!0},function(e,t,s,p,l,f,h){if(""!==t){var d=u._getId(e),m=r[p],g=o[p]+"/"+l;if(void 0!==h&&(g+="/"+("number"==typeof h?h:n.escapeFragment(h))),"string"==typeof d){d=m=b(m?i.resolve(m,d):d);var v=u._refs[d];if("string"==typeof v&&(v=u._refs[v]),v&&v.schema){if(!a(e,v.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=b(g))if("#"==d[0]){if(c[d]&&!a(e,c[d]))throw new Error('id "'+d+'" resolves to more than one schema');c[d]=e}else u._refs[d]=g}r[t]=m,o[t]=g}}),c},c.inlineRef=h,c.schema=u;var p=n.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function l(e,t,r,i){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var a=e.fragment.split("/"),o=1;o=55296&&t<=56319&&a=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(n="data"+(t-i||""),!a)return n}for(var s=n,u=a.split("/"),p=0;p",v=h?">":"<",y=void 0;if(g){var w=e.util.getData(m.$data,o,e.dataPathArr),k="exclusive"+n,_="exclType"+n,x="exclIsNumber"+n,j="' + "+(A="op"+n)+" + '";a+=" var schemaExcl"+n+" = "+w+"; ",a+=" var "+k+"; var "+_+" = typeof "+(w="schemaExcl"+n)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;y=d;(S=S||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var E=a;a=S.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" "+_+" == 'number' ? ( ("+k+" = "+i+" === undefined || "+w+" "+b+"= "+i+") ? "+l+" "+v+"= "+w+" : "+l+" "+v+" "+i+" ) : ( ("+k+" = "+w+" === true) ? "+l+" "+v+"= "+i+" : "+l+" "+v+" "+i+" ) || "+l+" !== "+l+") { var op"+n+" = "+k+" ? '"+b+"' : '"+b+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=w,f=g)}else{j=b;if((x="number"==typeof m)&&f){var A="'"+j+"'";a+=" if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" ( "+i+" === undefined || "+m+" "+b+"= "+i+" ? "+l+" "+v+"= "+m+" : "+l+" "+v+" "+i+" ) || "+l+" !== "+l+") { "}else{x&&void 0===s?(k=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,v+="="):(x&&(i=Math[h?"min":"max"](m,s)),m===(!x||i)?(k=!0,y=d,u=e.errSchemaPath+"/"+d,v+="="):(k=!1,j+="="));A="'"+j+"'";a+=" if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" "+l+" "+v+" "+i+" || "+l+" !== "+l+") { "}}y=y||t,(S=S||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+k+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be "+j+" ",a+=f?"' + "+i:i+"'"),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";E=a;return a=S.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",p&&(a+=" else { "),a}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,a+="if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" "+l+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var h=t,d=d||[];d.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxItems"==t?"more":"fewer",a+=" than ",a+=f?"' + "+i+" + '":""+s,a+=" items' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var m=a;return a=d.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s;var h="maxLength"==t?">":"<";a+="if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?a+=" "+l+".length ":a+=" ucs2length("+l+") ",a+=" "+h+" "+i+") { ";var d=t,m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be ",a+="maxLength"==t?"longer":"shorter",a+=" than ",a+=f?"' + "+i+" + '":""+s,a+=" characters' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var g=a;return a=m.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,a+="if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),a+=" Object.keys("+l+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var h=t,d=d||[];d.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxProperties"==t?"more":"fewer",a+=" than ",a+=f?"' + "+i+" + '":""+s,a+=" properties' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var m=a;return a=d.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.schema[t],n=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var p="valid"+c.level,l=c.baseId,f=!0,h=a;if(h)for(var d,m=-1,g=h.length-1;m0:e.util.schemaHasRules(d,e.RULES.all))&&(f=!1,c.schema=d,c.schemaPath=n+"["+m+"]",c.errSchemaPath=o+"/"+m,i+=" "+e.validate(c)+" ",c.baseId=l,s&&(i+=" if ("+p+") { ",u+="}"));return s&&(i+=f?" if (true) { ":" "+u.slice(0,-1)+" "),i=e.util.cleanUpCode(i)}},{}],19:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f="errs__"+a,h=e.util.copy(e),d="";h.level++;var m="valid"+h.level;if(o.every(function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)})){var g=h.baseId;i+=" var "+f+" = errors; var "+l+" = false; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var v=o;if(v)for(var y,w=-1,k=v.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(i+="var "+f+" = errors;var "+l+";",y){var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+d+" = false; for (var "+m+" = 0; "+m+" < "+p+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var k=p+"["+m+"]";h.dataPathArr[g]=m;var _=e.validate(h);h.baseId=v,e.util.varOccurences(_,b)<2?i+=" "+e.util.varReplace(_,b,k)+" ":i+=" var "+b+" = "+k+"; "+_+" ",i+=" if ("+d+") break; } ",e.compositeRule=h.compositeRule=w,i+=" if (!"+d+") {"}else i+=" if ("+p+".length == 0) {";var x=x||[];x.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var j=i;return i=x.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+j+"]); ":i+=" validate.errors = ["+j+"]; return false; ":i+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",y&&(i+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i=e.util.cleanUpCode(i)}},{}],23:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a,n=" ",o=e.level,s=e.dataLevel,c=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(s||""),h="valid"+o,d="errs__"+o,m=e.opts.$data&&c&&c.$data;m?(n+=" var schema"+o+" = "+e.util.getData(c.$data,s,e.dataPathArr)+"; ",a="schema"+o):a=c;var g,b,v,y,w,k="definition"+o,_=this.definition,x="";if(m&&_.$data){w="keywordValidate"+o;var j=_.validateSchema;n+=" var "+k+" = RULES.custom['"+t+"'].definition; var "+w+" = "+k+".validate;"}else{if(!(y=e.useCustomRule(this,c,e.schema,e)))return;a="validate.schema"+u,w=y.code,g=_.compile,b=_.inline,v=_.macro}var S=w+".errors",E="i"+o,A="ruleErr"+o,F=_.async;if(F&&!e.async)throw new Error("async keyword in sync schema");if(b||v||(n+=S+" = null;"),n+="var "+d+" = errors;var "+h+";",m&&_.$data&&(x+="}",n+=" if ("+a+" === undefined) { "+h+" = true; } else { ",j&&(x+="}",n+=" "+h+" = "+k+".validateSchema("+a+"); if ("+h+") { ")),b)_.statements?n+=" "+y.validate+" ":n+=" "+h+" = "+y.validate+"; ";else if(v){var P=e.util.copy(e);x="";P.level++;var z="valid"+P.level;P.schema=y.validate,P.schemaPath="";var C=e.compositeRule;e.compositeRule=P.compositeRule=!0;var O=e.validate(P).replace(/validate\.schema/g,w);e.compositeRule=P.compositeRule=C,n+=" "+O}else{(R=R||[]).push(n),n="",n+=" "+w+".call( ",e.opts.passContext?n+="this":n+="self",g||!1===_.schema?n+=" , "+f+" ":n+=" , "+a+" , "+f+" , validate.schema"+e.schemaPath+" ",n+=" , (dataPath || '')",'""'!=e.errorPath&&(n+=" + "+e.errorPath);var T=s?"data"+(s-1||""):"parentData",B=s?e.dataPathArr[s]:"parentDataProperty",I=n+=" , "+T+" , "+B+" , rootData ) ";n=R.pop(),!1===_.errors?(n+=" "+h+" = ",F&&(n+="await "),n+=I+"; "):n+=F?" var "+(S="customErrors"+o)+" = null; try { "+h+" = await "+I+"; } catch (e) { "+h+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } ":" "+S+" = null; "+h+" = "+I+"; "}if(_.modifying&&(n+=" if ("+T+") "+f+" = "+T+"["+B+"];"),n+=""+x,_.valid)l&&(n+=" if (true) { ");else{var R;n+=" if ( ",void 0===_.valid?(n+=" !",n+=v?""+z:""+h):n+=" "+!_.valid+" ",n+=") { ",i=this.keyword,(R=R||[]).push(n),n="",(R=R||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(i||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var q=n;n=R.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+q+"]); ":n+=" validate.errors = ["+q+"]; return false; ":n+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var M=n;n=R.pop(),b?_.errors?"full"!=_.errors&&(n+=" for (var "+E+"="+d+"; "+E+"0:e.util.schemaHasRules(v,e.RULES.all))&&(i+=" "+d+" = true; if ( "+p+e.util.getProperty(k)+" !== undefined ",b&&(i+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(k)+"') "),i+=") { ",f.schema=v,f.schemaPath=s+e.util.getProperty(k),f.errSchemaPath=c+"/"+e.util.escapeFragment(k),i+=" "+e.validate(f)+" ",f.baseId=I,i+=" } ",u&&(i+=" if ("+d+") { ",h+="}"))}return u&&(i+=" "+h+" if ("+l+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],25:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f=e.opts.$data&&o&&o.$data;f&&(i+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ");var h="i"+a,d="schema"+a;f||(i+=" var "+d+" = validate.schema"+s+";"),i+="var "+l+";",f&&(i+=" if (schema"+a+" === undefined) "+l+" = true; else if (!Array.isArray(schema"+a+")) "+l+" = false; else {"),i+=l+" = false;for (var "+h+"=0; "+h+"<"+d+".length; "+h+"++) if (equal("+p+", "+d+"["+h+"])) { "+l+" = true; break; }",f&&(i+=" } "),i+=" if (!"+l+") { ";var m=m||[];m.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+a+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var g=i;return i=m.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",u&&(i+=" else { "),i}},{}],26:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||"");if(!1===e.opts.format)return u&&(i+=" if (true) { "),i;var l,f=e.opts.$data&&o&&o.$data;f?(i+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",l="schema"+a):l=o;var h=e.opts.unknownFormats,d=Array.isArray(h);if(f){i+=" var "+(m="format"+a)+" = formats["+l+"]; var "+(g="isObject"+a)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(b="formatType"+a)+" = "+g+" && "+m+".type || 'string'; if ("+g+") { ",e.async&&(i+=" var async"+a+" = "+m+".async; "),i+=" "+m+" = "+m+".validate; } if ( ",f&&(i+=" ("+l+" !== undefined && typeof "+l+" != 'string') || "),i+=" (","ignore"!=h&&(i+=" ("+l+" && !"+m+" ",d&&(i+=" && self._opts.unknownFormats.indexOf("+l+") == -1 "),i+=") || "),i+=" ("+m+" && "+b+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?i+=" (async"+a+" ? await "+m+"("+p+") : "+m+"("+p+")) ":i+=" "+m+"("+p+") ",i+=" : "+m+".test("+p+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==h)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(i+=" if (true) { "),i;if(d&&h.indexOf(o)>=0)return u&&(i+=" if (true) { "),i;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var g,b=(g="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(g){var v=!0===m.async;m=m.validate}if(b!=r)return u&&(i+=" if (true) { "),i;if(v){if(!e.async)throw new Error("async format in sync schema");i+=" if (!(await "+(y="formats"+e.util.getProperty(o)+".validate")+"("+p+"))) { "}else{i+=" if (! ";var y="formats"+e.util.getProperty(o);g&&(y+=".validate"),i+="function"==typeof m?" "+y+"("+p+") ":" "+y+".test("+p+") ",i+=") { "}}var w=w||[];w.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",i+=f?""+l:""+e.util.toQuotedString(o),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match format \"",i+=f?"' + "+l+" + '":""+e.util.escapeQuotes(o),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+s:""+e.util.toQuotedString(o),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var k=i;return i=w.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+k+"]); ":i+=" validate.errors = ["+k+"]; return false; ":i+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u&&(i+=" else { "),i}},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f="errs__"+a,h=e.util.copy(e);h.level++;var d="valid"+h.level,m=e.schema.then,g=e.schema.else,b=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),v=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0:e.util.schemaHasRules(g,e.RULES.all)),y=h.baseId;if(b||v){var w;h.createErrors=!1,h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+f+" = errors; var "+l+" = true; ";var k=e.compositeRule;e.compositeRule=h.compositeRule=!0,i+=" "+e.validate(h)+" ",h.baseId=y,h.createErrors=!0,i+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=k,b?(i+=" if ("+d+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(h)+" ",h.baseId=y,i+=" "+l+" = "+d+"; ",b&&v?i+=" var "+(w="ifClause"+a)+" = 'then'; ":w="'then'",i+=" } ",v&&(i+=" else { ")):i+=" if (!"+d+") { ",v&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(h)+" ",h.baseId=y,i+=" "+l+" = "+d+"; ",b&&v?i+=" var "+(w="ifClause"+a)+" = 'else'; ":w="'else'",i+=" } "),i+=" if (!"+l+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",u&&(i+=" else { "),i=e.util.cleanUpCode(i)}else u&&(i+=" if (true) { ");return i}},{}],28:[function(e,t,r){"use strict";t.exports={$ref:e("./ref"),allOf:e("./allOf"),anyOf:e("./anyOf"),$comment:e("./comment"),const:e("./const"),contains:e("./contains"),dependencies:e("./dependencies"),enum:e("./enum"),format:e("./format"),if:e("./if"),items:e("./items"),maximum:e("./_limit"),minimum:e("./_limit"),maxItems:e("./_limitItems"),minItems:e("./_limitItems"),maxLength:e("./_limitLength"),minLength:e("./_limitLength"),maxProperties:e("./_limitProperties"),minProperties:e("./_limitProperties"),multipleOf:e("./multipleOf"),not:e("./not"),oneOf:e("./oneOf"),pattern:e("./pattern"),properties:e("./properties"),propertyNames:e("./propertyNames"),required:e("./required"),uniqueItems:e("./uniqueItems"),validate:e("./validate")}},{"./_limit":14,"./_limitItems":15,"./_limitLength":16,"./_limitProperties":17,"./allOf":18,"./anyOf":19,"./comment":20,"./const":21,"./contains":22,"./dependencies":24,"./enum":25,"./format":26,"./if":27,"./items":29,"./multipleOf":30,"./not":31,"./oneOf":32,"./pattern":33,"./properties":34,"./propertyNames":35,"./ref":36,"./required":37,"./uniqueItems":38,"./validate":39}],29:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f="errs__"+a,h=e.util.copy(e),d="";h.level++;var m="valid"+h.level,g="i"+a,b=h.dataLevel=e.dataLevel+1,v="data"+b,y=e.baseId;if(i+="var "+f+" = errors;var "+l+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){i+=" "+l+" = "+p+".length <= "+o.length+"; ";var k=c;c=e.errSchemaPath+"/additionalItems",i+=" if (!"+l+") { ";var _=_||[];_.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var x=i;i=_.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+x+"]); ":i+=" validate.errors = ["+x+"]; return false; ":i+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c=k,u&&(d+="}",i+=" else { ")}var j=o;if(j)for(var S,E=-1,A=j.length-1;E0:e.util.schemaHasRules(S,e.RULES.all)){i+=" "+m+" = true; if ("+p+".length > "+E+") { ";var F=p+"["+E+"]";h.schema=S,h.schemaPath=s+"["+E+"]",h.errSchemaPath=c+"/"+E,h.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),h.dataPathArr[b]=E;var P=e.validate(h);h.baseId=y,e.util.varOccurences(P,v)<2?i+=" "+e.util.varReplace(P,v,F)+" ":i+=" var "+v+" = "+F+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){h.schema=w,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+p+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+p+".length; "+g+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);F=p+"["+g+"]";h.dataPathArr[b]=g;P=e.validate(h);h.baseId=y,e.util.varOccurences(P,v)<2?i+=" "+e.util.varReplace(P,v,F)+" ":i+=" var "+v+" = "+F+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+p+".length; "+g+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);F=p+"["+g+"]";h.dataPathArr[b]=g;P=e.validate(h);h.baseId=y,e.util.varOccurences(P,v)<2?i+=" "+e.util.varReplace(P,v,F)+" ":i+=" var "+v+" = "+F+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+f+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,a+="var division"+n+";if (",f&&(a+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),a+=" (division"+n+" = "+l+" / "+i+", ",e.opts.multipleOfPrecision?a+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":a+=" division"+n+" !== parseInt(division"+n+") ",a+=" ) ",f&&(a+=" ) "),a+=" ) { ";var h=h||[];h.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be multiple of ",a+=f?"' + "+i:i+"'"),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var d=a;return a=h.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+d+"]); ":a+=" validate.errors = ["+d+"]; return false; ":a+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="errs__"+a,f=e.util.copy(e);f.level++;var h="valid"+f.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=s,f.errSchemaPath=c,i+=" var "+l+" = errors; ";var d,m=e.compositeRule;e.compositeRule=f.compositeRule=!0,f.createErrors=!1,f.opts.allErrors&&(d=f.opts.allErrors,f.opts.allErrors=!1),i+=" "+e.validate(f)+" ",f.createErrors=!0,d&&(f.opts.allErrors=d),e.compositeRule=f.compositeRule=m,i+=" if ("+h+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var b=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="valid"+a,f="errs__"+a,h=e.util.copy(e),d="";h.level++;var m="valid"+h.level,g=h.baseId,b="prevValid"+a,v="passingSchemas"+a;i+="var "+f+" = errors , "+b+" = false , "+l+" = false , "+v+" = null; ";var y=e.compositeRule;e.compositeRule=h.compositeRule=!0;var w=o;if(w)for(var k,_=-1,x=w.length-1;_0:e.util.schemaHasRules(k,e.RULES.all))?(h.schema=k,h.schemaPath=s+"["+_+"]",h.errSchemaPath=c+"/"+_,i+=" "+e.validate(h)+" ",h.baseId=g):i+=" var "+m+" = true; ",_&&(i+=" if ("+m+" && "+b+") { "+l+" = false; "+v+" = ["+v+", "+_+"]; } else { ",d+="}"),i+=" if ("+m+") { "+l+" = "+b+" = true; "+v+" = "+_+"; }";return e.compositeRule=h.compositeRule=y,i+=d+"if (!"+l+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+v+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}},{}],33:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,a=" ",n=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,l="data"+(o||""),f=e.opts.$data&&s&&s.$data;f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,a+="if ( ",f&&(a+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),a+=" !"+(f?"(new RegExp("+i+"))":e.usePattern(s))+".test("+l+") ) { ";var h=h||[];h.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",a+=f?""+i:""+e.util.toQuotedString(s),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match pattern \"",a+=f?"' + "+i+" + '":""+e.util.escapeQuotes(s),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+c:""+e.util.toQuotedString(s),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var d=a;return a=h.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+d+"]); ":a+=" validate.errors = ["+d+"]; return false; ":a+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",p&&(a+=" else { "),a}},{}],34:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="errs__"+a,f=e.util.copy(e),h="";f.level++;var d="valid"+f.level,m="key"+a,g="idx"+a,b=f.dataLevel=e.dataLevel+1,v="data"+b,y="dataProperties"+a,w=Object.keys(o||{}),k=e.schema.patternProperties||{},_=Object.keys(k),x=e.schema.additionalProperties,j=w.length||_.length,S=!1===x,E="object"==typeof x&&Object.keys(x).length,A=e.opts.removeAdditional,F=S||E||A,P=e.opts.ownProperties,z=e.baseId,C=e.schema.required;if(C&&(!e.opts.$data||!C.$data)&&C.length8)i+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var T=w;if(T)for(var B=-1,I=T.length-1;B0:e.util.schemaHasRules(X,e.RULES.all)){var Y=e.util.getProperty(W),J=(K=p+Y,V&&void 0!==X.default);f.schema=X,f.schemaPath=s+Y,f.errSchemaPath=c+"/"+e.util.escapeFragment(W),f.errorPath=e.util.getPath(e.errorPath,W,e.opts.jsonPointers),f.dataPathArr[b]=e.util.toQuotedString(W);$=e.validate(f);if(f.baseId=z,e.util.varOccurences($,v)<2){$=e.util.varReplace($,v,K);var ee=K}else{ee=v;i+=" var "+v+" = "+K+"; "}if(J)i+=" "+$+" ";else{if(O&&O[W]){i+=" if ( "+ee+" === undefined ",P&&(i+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+d+" = false; ";D=e.errorPath,N=c;var te,re=e.util.escapeQuotes(W);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(D,W,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(te=te||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+re+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";U=i;i=te.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+U+"]); ":i+=" validate.errors = ["+U+"]; return false; ":i+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=N,e.errorPath=D,i+=" } else { "}else u?(i+=" if ( "+ee+" === undefined ",P&&(i+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+d+" = true; } else { "):(i+=" if ("+ee+" !== undefined ",P&&(i+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=" ) { ");i+=" "+$+" } "}}u&&(i+=" if ("+d+") { ",h+="}")}}if(_.length){var ie=_;if(ie)for(var ae,ne=-1,oe=ie.length-1;ne0:e.util.schemaHasRules(X,e.RULES.all)){f.schema=X,f.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),f.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),i+=P?" "+y+" = "+y+" || Object.keys("+p+"); for (var "+g+"=0; "+g+"<"+y+".length; "+g+"++) { var "+m+" = "+y+"["+g+"]; ":" for (var "+m+" in "+p+") { ",i+=" if ("+e.usePattern(ae)+".test("+m+")) { ",f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);K=p+"["+m+"]";f.dataPathArr[b]=m;$=e.validate(f);f.baseId=z,e.util.varOccurences($,v)<2?i+=" "+e.util.varReplace($,v,K)+" ":i+=" var "+v+" = "+K+"; "+$+" ",u&&(i+=" if (!"+d+") break; "),i+=" } ",u&&(i+=" else "+d+" = true; "),i+=" } ",u&&(i+=" if ("+d+") { ",h+="}")}}}return u&&(i+=" "+h+" if ("+l+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],35:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",a=e.level,n=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),l="errs__"+a,f=e.util.copy(e);f.level++;var h="valid"+f.level;if(i+="var "+l+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=s,f.errSchemaPath=c;var d="key"+a,m="idx"+a,g="i"+a,b="' + "+d+" + '",v="data"+(f.dataLevel=e.dataLevel+1),y="dataProperties"+a,w=e.opts.ownProperties,k=e.baseId;w&&(i+=" var "+y+" = undefined; "),i+=w?" "+y+" = "+y+" || Object.keys("+p+"); for (var "+m+"=0; "+m+"<"+y+".length; "+m+"++) { var "+d+" = "+y+"["+m+"]; ":" for (var "+d+" in "+p+") { ",i+=" var startErrs"+a+" = errors; ";var _=d,x=e.compositeRule;e.compositeRule=f.compositeRule=!0;var j=e.validate(f);f.baseId=k,e.util.varOccurences(j,v)<2?i+=" "+e.util.varReplace(j,v,_)+" ":i+=" var "+v+" = "+_+"; "+j+" ",e.compositeRule=f.compositeRule=x,i+=" if (!"+h+") { for (var "+g+"=startErrs"+a+"; "+g+"0:e.util.schemaHasRules(y,e.RULES.all))||(d[d.length]=g)}}else d=o;if(f||d.length){var w=e.errorPath,k=f||d.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(i+=" var missing"+a+"; ",k){f||(i+=" var "+h+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+a+"["+(E="i"+a)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,P,e.opts.jsonPointers)),i+=" var "+l+" = true; ",f&&(i+=" if (schema"+a+" === undefined) "+l+" = true; else if (!Array.isArray(schema"+a+")) "+l+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+h+".length; "+E+"++) { "+l+" = "+p+"["+h+"["+E+"]] !== undefined ",_&&(i+=" && Object.prototype.hasOwnProperty.call("+p+", "+h+"["+E+"]) "),i+="; if (!"+l+") break; } ",f&&(i+=" } "),i+=" if (!"+l+") { ",(F=F||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var j=i;i=F.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+j+"]); ":i+=" validate.errors = ["+j+"]; return false; ":i+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var S=d;if(S)for(var E=-1,A=S.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(d.indexOf("object")>=0||d.indexOf("array")>=0))a+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+l+"[i], "+l+"[j])) { "+f+" = false; break outer; } } } ";else{a+=" var itemIndices = {}, item; for (;i--;) { var item = "+l+"[i]; ";var g="checkDataType"+(m?"s":"");a+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(a+=" if (typeof item == 'string') item = '\"' + item; "),a+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}a+=" } ",h&&(a+=" } "),a+=" if (!"+f+") { ";var b=b||[];b.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+c:""+s,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var v=a;a=b.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",p&&(a+=" else { ")}else p&&(a+=" if (true) { ");return a}},{}],39:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i="",a=!0===e.schema.$async,n=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var s=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(s){var c="unknown keyword: "+s;if("log"!==e.opts.strictKeywords)throw new Error(c);e.logger.warn(c)}}if(e.isTop&&(i+=" var validate = ",a&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof e.schema||!n&&!e.schema.$ref){var u=e.level,p=e.dataLevel,l=e.schema["false schema"],f=e.schemaPath+e.util.getProperty("false schema"),h=e.errSchemaPath+"/false schema",d=!e.opts.allErrors,m="data"+(p||""),g="valid"+u;if(!1===e.schema){e.isTop?d=!0:i+=" var "+g+" = false; ",(X=X||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),i+=" } "):i+=" {} ";var b=i;i=X.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?i+=a?" return data; ":" validate.errors = null; return true; ":i+=" var "+g+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var v=e.isTop;u=e.level=0,p=e.dataLevel=0,m="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(y);e.logger.warn(y)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{u=e.level,m="data"+((p=e.dataLevel)||"");if(o&&(e.baseId=e.resolve.url(e.baseId,o)),a&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+u+" = errors;"}g="valid"+u,d=!e.opts.allErrors;var w="",k="",_=e.schema.type,x=Array.isArray(_);if(_&&e.opts.nullable&&!0===e.schema.nullable&&(x?-1==_.indexOf("null")&&(_=_.concat("null")):"null"!=_&&(_=[_,"null"],x=!0)),x&&1==_.length&&(_=_[0],x=!1),e.schema.$ref&&n){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(n=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),_){if(e.opts.coerceTypes)var j=e.util.coerceToTypes(e.opts.coerceTypes,_);var S=e.RULES.types[_];if(j||x||!0===S||S&&!Y(S)){f=e.schemaPath+".type",h=e.errSchemaPath+"/type",f=e.schemaPath+".type",h=e.errSchemaPath+"/type";var E=x?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[E](_,m,!0)+") { ",j){var A="dataType"+u,F="coerced"+u;i+=" var "+A+" = typeof "+m+"; ","array"==e.opts.coerceTypes&&(i+=" if ("+A+" == 'object' && Array.isArray("+m+")) "+A+" = 'array'; "),i+=" var "+F+" = undefined; ";var P="",z=j;if(z)for(var C,O=-1,T=z.length-1;O>6],a=0==(32&r);if(31==(31&r)){var n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:i,primitive:a,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var a=127&i;if(a>4)return e.error("length octect is too long");i=0;for(var n=0;n=31)return i.error("Multi-octet tag encoding unsupported");t||(a|=32);return a|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(i.length<128)return(n=new a(2))[0]=o,n[1]=i.length,this._createEncoderBuffer([n,i]);for(var c=1,u=i.length;u>=256;u>>=8)c++;(n=new a(2+c))[0]=o,n[1]=128|c;u=1+c;for(var p=i.length;p>0;u--,p>>=8)n[u]=255&p;return this._createEncoderBuffer([n,i])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new a(2*e.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var n=0;for(i=0;i=128;o>>=7)n++}var s=new a(n),c=s.length-1;for(i=e.length-1;i>=0;i--){o=e[i];for(s[c--]=127&o;(o>>=7)>0;)s[c--]=128|127&o}return this._createEncoderBuffer(s)},u.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[p(i.getFullYear()),p(i.getUTCMonth()+1),p(i.getUTCDate()),p(i.getUTCHours()),p(i.getUTCMinutes()),p(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[p(i.getFullYear()%100),p(i.getUTCMonth()+1),p(i.getUTCDate()),p(i.getUTCHours()),p(i.getUTCMinutes()),p(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!a.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new a(r)}if(a.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new a(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;o>=256;o>>=8)i++;for(o=(n=new Array(i)).length-1;o>=0;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new a(n))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){var i,a=this._baseState;if(null===a.default)return!1;var n=e.join();if(void 0===a.defaultBuffer&&(a.defaultBuffer=this._encodeValue(a.default,t,r).join()),n.length!==a.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw o("Indefinite length not supported");if(t>4)throw o("encoding too long");if(this._size-ethis._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var s=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?s:s.toString("utf8")},s.prototype.readOID=function(e){e||(e=n.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,a=0;a>0),r.join(".")},s.prototype._readTag=function(e){i.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw o("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(this.length>4)throw o("Integer too long: "+this.length);if(this.length>this._size-r)return null;this._offset=r;for(var a=this._buf[this._offset],n=0,s=0;s>0},t.exports=s},{"./errors":58,"./types":61,assert:65,"safer-buffer":315}],61:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],62:[function(e,t,r){var i=e("assert"),a=e("safer-buffer").Buffer,n=e("./types"),o=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var t,r;t=s,r=e||{},i.ok(t),i.equal(typeof t,"object"),i.ok(r),i.equal(typeof r,"object"),Object.getOwnPropertyNames(t).forEach(function(e){if(!r[e]){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i)}}),e=r,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw o(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=n.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&r>1;)r--,e<<=8;if(r>4)throw o("BER ints cannot be > 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;r-- >0;)this._buf[this._offset++]=(4278190080&e)>>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(n.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=n.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=n.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+typeof e+")");"number"!=typeof t&&(t=n.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=n.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.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))}(i,parseInt(e,10))});var a=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){a.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw o("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=n.Sequence|n.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw o("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){i.ok(void 0!==e),i.ok(void 0!==t),i.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(i.ok(e),this._size-this._offset=0;u--)if(p[u]!==l[u])return!1;for(u=p.length-1;u>=0;u--)if(s=p[u],!y(e[s],t[s],r,i))return!1;return!0}(e,t,r,i))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function k(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,i){var a;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(i=r,r=null),a=function(e){var t;try{e()}catch(e){t=e}return t}(t),i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),e&&!a&&b(a,r,"Missing expected exception"+i);var n="string"==typeof i,s=!e&&a&&!r;if((!e&&o.isError(a)&&n&&k(a,r)||s)&&b(a,r,"Got unwanted exception"+i),e&&a&&r&&!k(a,r)||!e&&a)throw a}f.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=m(g((t=this).actual),128)+" "+t.operator+" "+m(g(t.expected),128),this.generatedMessage=!0);var r=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var i=new Error;if(i.stack){var a=i.stack,n=d(r),o=a.indexOf("\n"+n);if(o>=0){var s=a.indexOf("\n",o+1);a=a.substring(s+1)}this.stack=a}}},o.inherits(f.AssertionError,Error),f.fail=b,f.ok=v,f.equal=function(e,t,r){e!=t&&b(e,t,r,"==",f.equal)},f.notEqual=function(e,t,r){e==t&&b(e,t,r,"!=",f.notEqual)},f.deepEqual=function(e,t,r){y(e,t,!1)||b(e,t,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,r){y(e,t,!0)||b(e,t,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,r){y(e,t,!1)&&b(e,t,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,r,i){y(t,r,!0)&&b(t,r,i,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,r){e!==t&&b(e,t,r,"===",f.strictEqual)},f.notStrictEqual=function(e,t,r){e===t&&b(e,t,r,"!==",f.notStrictEqual)},f.throws=function(e,t,r){_(!0,e,t,r)},f.doesNotThrow=function(e,t,r){_(!1,e,t,r)},f.ifError=function(e){if(e)throw e},f.strict=i(function e(t,r){t||b(t,!0,r,"==",e)},f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var x=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":237,"util/":68}],66:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],67:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],68:[function(e,t,r){(function(t,i){var a=/%[sdj%]/g;r.format=function(e){if(!b(e)){for(var t=[],r=0;r=n)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}}),c=i[r];r=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),d(t)?i.showHidden=t:t&&r._extend(i,t),v(i.showHidden)&&(i.showHidden=!1),v(i.depth)&&(i.depth=2),v(i.colors)&&(i.colors=!1),v(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=c),p(i,e,i.depth)}function c(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function p(e,t,i){if(e.customInspect&&t&&x(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var a=t.inspect(i,e);return b(a)||(a=p(e,a,i)),a}var n=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,t);if(n)return n;var o=Object.keys(t),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),_(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(t);if(0===o.length){if(x(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(y(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var u,w="",j=!1,S=["{","}"];(h(t)&&(j=!0,S=["[","]"]),x(t))&&(w=" [Function"+(t.name?": "+t.name:"")+"]");return y(t)&&(w=" "+RegExp.prototype.toString.call(t)),k(t)&&(w=" "+Date.prototype.toUTCString.call(t)),_(t)&&(w=" "+l(t)),0!==o.length||j&&0!=t.length?i<0?y(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=j?function(e,t,r,i,a){for(var n=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,i,a,n){var o,s,c;if((c=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),A(i,a)||(o="["+a+"]"),s||(e.seen.indexOf(c.value)<0?(s=m(r)?p(e,c.value,null):p(e,c.value,r-1)).indexOf("\n")>-1&&(s=n?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(n&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function v(e){return void 0===e}function y(e){return w(e)&&"[object RegExp]"===j(e)}function w(e){return"object"==typeof e&&null!==e}function k(e){return w(e)&&"[object Date]"===j(e)}function _(e){return w(e)&&("[object Error]"===j(e)||e instanceof Error)}function x(e){return"function"==typeof e}function j(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(v(n)&&(n=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(n)){var i=t.pid;o[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,i,t)}}else o[e]=function(){};return o[e]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=h,r.isBoolean=d,r.isNull=m,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=b,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=v,r.isRegExp=y,r.isObject=w,r.isDate=k,r.isError=_,r.isFunction=x,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":"),[e.getDate(),E[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":67,_process:263,inherits:66}],69:[function(e,t,r){var i=e("crypto"),a=e("url").parse,n=["acl","location","logging","notification","partNumber","policy","requestPayment","torrent","uploadId","uploads","versionId","versioning","versions","website"];function o(e){return"AWS "+e.key+":"+c(e)}function s(e){return i.createHmac("sha1",e.secret).update(e.message).digest("base64")}function c(e){return e.message=u(e),s(e)}function u(e){var t=e.amazonHeaders||"";return t&&(t+="\n"),[e.verb,e.md5,e.contentType,e.date?e.date.toUTCString():"",t+e.resource].join("\n")}function p(e){return"GET\n\n\n"+e.date+"\n"+e.resource}t.exports=o,t.exports.authorization=o,t.exports.hmacSha1=s,t.exports.sign=c,t.exports.signQuery=function(e){return e.message=p(e),s(e)},t.exports.stringToSign=u,t.exports.queryStringToSign=p,t.exports.canonicalizeHeaders=function(e){for(var t=[],r=Object.keys(e),i=0,a=r.length;i=0&&"us-east-1"===this.region||["cloudfront","ls","route53","iam","importexport","sts"].indexOf(this.service)>=0},f.prototype.createHost=function(){var e=this.isSingleRegion()?"":("s3"===this.service&&"us-east-1"!==this.region?"-":".")+this.region;return("ses"===this.service?"email":this.service)+e+".amazonaws.com"},f.prototype.prepareRequest=function(){this.parsePath();var e,t=this.request,r=t.headers;t.signQuery?(this.parsedPath.query=e=this.parsedPath.query||{},this.credentials.sessionToken&&(e["X-Amz-Security-Token"]=this.credentials.sessionToken),"s3"!==this.service||e["X-Amz-Expires"]||(e["X-Amz-Expires"]=86400),e["X-Amz-Date"]?this.datetime=e["X-Amz-Date"]:e["X-Amz-Date"]=this.getDateTime(),e["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",e["X-Amz-Credential"]=this.credentials.accessKeyId+"/"+this.credentialString(),e["X-Amz-SignedHeaders"]=this.signedHeaders()):(t.doNotModifyHeaders||this.isCodeCommitGit||(!t.body||r["Content-Type"]||r["content-type"]||(r["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8"),!t.body||r["Content-Length"]||r["content-length"]||(r["Content-Length"]=i.byteLength(t.body)),!this.credentials.sessionToken||r["X-Amz-Security-Token"]||r["x-amz-security-token"]||(r["X-Amz-Security-Token"]=this.credentials.sessionToken),"s3"!==this.service||r["X-Amz-Content-Sha256"]||r["x-amz-content-sha256"]||(r["X-Amz-Content-Sha256"]=p(this.request.body||"","hex")),r["X-Amz-Date"]||r["x-amz-date"]?this.datetime=r["X-Amz-Date"]||r["x-amz-date"]:r["X-Amz-Date"]=this.getDateTime()),delete r.Authorization,delete r.authorization)},f.prototype.sign=function(){return this.parsedPath||this.prepareRequest(),this.request.signQuery?this.parsedPath.query["X-Amz-Signature"]=this.signature():this.request.headers.Authorization=this.authHeader(),this.request.path=this.formatPath(),this.request},f.prototype.getDateTime=function(){if(!this.datetime){var e=this.request.headers,t=new Date(e.Date||e.date||new Date);this.datetime=t.toISOString().replace(/[:\-]|\.\d{3}/g,""),this.isCodeCommitGit&&(this.datetime=this.datetime.slice(0,-1))}return this.datetime},f.prototype.getDate=function(){return this.getDateTime().substr(0,8)},f.prototype.authHeader=function(){return["AWS4-HMAC-SHA256 Credential="+this.credentials.accessKeyId+"/"+this.credentialString(),"SignedHeaders="+this.signedHeaders(),"Signature="+this.signature()].join(", ")},f.prototype.signature=function(){var e,t,r,i=this.getDate(),a=[this.credentials.secretAccessKey,i,this.region,this.service].join(),n=c.get(a);return n||(e=u("AWS4"+this.credentials.secretAccessKey,i),t=u(e,this.region),r=u(t,this.service),n=u(r,"aws4_request"),c.set(a,n)),u(n,this.stringToSign(),"hex")},f.prototype.stringToSign=function(){return["AWS4-HMAC-SHA256",this.getDateTime(),this.credentialString(),p(this.canonicalString(),"hex")].join("\n")},f.prototype.canonicalString=function(){this.parsedPath||this.prepareRequest();var e,t=this.parsedPath.path,r=this.parsedPath.query,i=this.request.headers,a="",n="s3"!==this.service,s="s3"===this.service||this.request.doNotEncodePath,c="s3"===this.service,u="s3"===this.service;return e="s3"===this.service&&this.request.signQuery?"UNSIGNED-PAYLOAD":this.isCodeCommitGit?"":i["X-Amz-Content-Sha256"]||i["x-amz-content-sha256"]||p(this.request.body||"","hex"),r&&(a=l(o.stringify(Object.keys(r).sort().reduce(function(e,t){return t?(e[t]=Array.isArray(r[t])?u?r[t][0]:r[t].slice().sort():r[t],e):e},{})))),"/"!==t&&(n&&(t=t.replace(/\/{2,}/g,"/")),"/"!==(t=t.split("/").reduce(function(e,t){return n&&".."===t?e.pop():n&&"."===t||(s&&(t=decodeURIComponent(t)),e.push(l(encodeURIComponent(t)))),e},[]).join("/"))[0]&&(t="/"+t),c&&(t=t.replace(/%2F/g,"/"))),[this.request.method||"GET",t,a,this.canonicalHeaders()+"\n",this.signedHeaders(),e].join("\n")},f.prototype.canonicalHeaders=function(){var e=this.request.headers;return Object.keys(e).sort(function(e,t){return e.toLowerCase()=0&&(r=o.parse(e.slice(t+1)),e=e.slice(0,t)),/[^0-9A-Za-z!'()*\-._~%\/]/.test(e)&&(e=e.split("/").map(function(e){return encodeURIComponent(decodeURIComponent(e))}).join("/")),this.parsedPath={path:e,query:r}},f.prototype.formatPath=function(){var e=this.parsedPath.path,t=this.parsedPath.query;return t?(null!=t[""]&&delete t[""],e+"?"+l(o.stringify(t))):e},a.RequestSigner=f,a.sign=function(e,t){return new f(e,t).sign()}}).call(this,e("_process"),e("buffer").Buffer)},{"./lru":71,_process:263,buffer:110,crypto:121,querystring:279,url:383}],71:[function(e,t,r){function i(e){this.capacity=0|e,this.map=Object.create(null),this.list=new a}function a(){this.firstNode=null,this.lastNode=null}function n(e,t){this.key=e,this.val=t,this.prev=null,this.next=null}t.exports=function(e){return new i(e)},i.prototype.get=function(e){var t=this.map[e];if(null!=t)return this.used(t),t.val},i.prototype.set=function(e,t){var r=this.map[e];if(null!=r)r.val=t;else{if(this.capacity||this.prune(),!this.capacity)return!1;r=new n(e,t),this.map[e]=r,this.capacity--}return this.used(r),!0},i.prototype.used=function(e){this.list.moveToFront(e)},i.prototype.prune=function(){var e=this.list.pop();null!=e&&(delete this.map[e.key],this.capacity++)},a.prototype.moveToFront=function(e){this.firstNode!=e&&(this.remove(e),null==this.firstNode?(this.firstNode=e,this.lastNode=e,e.prev=null,e.next=null):(e.prev=null,e.next=this.firstNode,e.next.prev=e,this.firstNode=e))},a.prototype.pop=function(){var e=this.lastNode;return null!=e&&this.remove(e),e},a.prototype.remove=function(e){this.firstNode==e?this.firstNode=e.next:null!=e.prev&&(e.prev.next=e.next),this.lastNode==e?this.lastNode=e.prev:null!=e.next&&(e.next.prev=e.prev)}},{}],72:[function(e,t,r){"use strict";r.byteLength=function(e){var t=u(e),r=t[0],i=t[1];return 3*(r+i)/4-i},r.toByteArray=function(e){var t,r,i=u(e),o=i[0],s=i[1],c=new n(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),p=0,l=s>0?o-4:o;for(r=0;r>16&255,c[p++]=t>>8&255,c[p++]=255&t;2===s&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,c[p++]=255&t);1===s&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,c[p++]=t>>8&255,c[p++]=255&t);return c},r.fromByteArray=function(e){for(var t,r=e.length,a=r%3,n=[],o=0,s=r-a;os?s:o+16383));1===a?(t=e[r-1],n.push(i[t>>2]+i[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],n.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return n.join("")};for(var i=[],a=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function p(e,t,r){for(var a,n,o=[],s=t;s>18&63]+i[n>>12&63]+i[n>>6&63]+i[63&n]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],73:[function(e,t,r){"use strict";var i=e("tweetnacl").lowlevel.crypto_hash,a=0,n=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function o(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function s(e,t){var r,i=0;for(r=0;r<4;r++,a++)a>=t&&(a=0),i=i<<8|e[a];return i}n.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=o(this.S,t,0)^this.P[r],e[0]^=o(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},n.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;r>0;r-=2)e[1]^=o(this.S,t,0)^this.P[r],e[0]^=o(this.S,t,4)^this.P[r-1];var i=e[0];e[0]=e[1]^this.P[0],e[1]=i},n.prototype.expand0state=function(e,t){var r,i,n=new Uint32Array(2),o=new Uint8Array(n.buffer);for(r=0,a=0;r<18;r++)this.P[r]^=s(e,t);for(a=0,r=0;r<18;r+=2)this.encipher(n,o),this.P[r]=n[0],this.P[r+1]=n[1];for(r=0;r<4;r++)for(i=0;i<256;i+=2)this.encipher(n,o),this.S[r][i]=n[0],this.S[r][i+1]=n[1]},n.prototype.expandstate=function(e,t,r,i){var n,o,c=new Uint32Array(2);for(n=0,a=0;n<18;n++)this.P[n]^=s(r,i);for(n=0,a=0;n<18;n+=2)c[0]^=s(e,t),c[1]^=s(e,t),this.encipher(c),this.P[n]=c[0],this.P[n+1]=c[1];for(n=0;n<4;n++)for(o=0;o<256;o+=2)c[0]^=s(e,t),c[1]^=s(e,t),this.encipher(c),this.S[n][o]=c[0],this.S[n][o+1]=c[1];a=0},n.prototype.enc=function(e,t){for(var r=0;r>>24,r[4*i+2]=o[i]>>>16,r[4*i+1]=o[i]>>>8,r[4*i+0]=o[i]}t.exports={BLOCKS:c,HASHSIZE:u,hash:p,pbkdf:function(e,t,r,a,n,o,s){var c,l,f,h,d,m,g=new Uint8Array(64),b=new Uint8Array(64),v=new Uint8Array(u),y=new Uint8Array(u),w=new Uint8Array(a+4),k=o;if(s<1)return-1;if(0===t||0===a||0===o||o>v.byteLength*v.byteLength||a>1<<20)return-1;for(h=Math.floor((o+v.byteLength-1)/v.byteLength),f=Math.floor((o+h-1)/h),c=0;c0;m++){for(w[a+0]=m>>>24,w[a+1]=m>>>16,w[a+2]=m>>>8,w[a+3]=m,i(b,w,a+4),p(g,b,y),c=v.byteLength;c--;)v[c]=y[c];for(c=1;c=k);c++)n[d]=v[c];o-=c}return 0}}},{tweetnacl:381}],74:[function(e,t,r){(function(e,i,a){!function(e){if("object"==typeof r&&void 0!==t)t.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a;"undefined"!=typeof window?a=window:void 0!==i?a=i:"undefined"!=typeof self&&(a=self),a.Promise=e()}}(function(){var t,r,n;return function e(t,r,i){function a(o,s){if(!r[o]){if(!t[o]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(o,!0);if(n)return n(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[o]={exports:{}};t[o][0].call(p.exports,function(e){var r=t[o][1][e];return a(r||e)},p,p.exports,e,t,r,i)}return r[o].exports}for(var n="function"==typeof _dereq_&&_dereq_,o=0;o0;)u(e)}function u(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var r=e.shift(),i=e.shift();t.call(r,i)}}s.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},s.prototype.hasCustomScheduler=function(){return this._customScheduler},s.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},s.prototype.fatalError=function(t,r){r?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t)},s.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.prototype.invokeLater=function(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()},s.prototype.invoke=function(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()},s.prototype.settlePromises=function(e){this._normalQueue._pushOne(e),this._queueTick()},s.prototype._drainQueues=function(){c(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,c(this._lateQueue)},s.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},s.prototype._reset=function(){this._isTickUsed=!1},r.exports=s,r.exports.firstLineError=a},{"./queue":26,"./schedule":29}],3:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){var a=!1,n=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(n,n,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(n){a||(a=!0,e.prototype._propagateFrom=i.propagateFromFunction(),e.prototype._boundValue=i.boundValueFunction());var u=r(n),p=new e(t);p._propagateFrom(this,1);var l=this._target();if(p._setBoundTo(u),u instanceof e){var f={promiseRejectionQueued:!1,promise:p,target:l,bindingPromise:u};l._then(t,o,void 0,p,f),u._then(s,c,void 0,p,f),p._setOnCancel(u)}else p._resolveCallback(l);return p},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}},{}],4:[function(e,t,r){"use strict";var i;"undefined"!=typeof Promise&&(i=Promise);var a=e("./promise")();a.noConflict=function(){try{Promise===a&&(Promise=i)}catch(e){}return a},t.exports=a},{"./promise":22}],5:[function(e,t,r){"use strict";var i=Object.create;if(i){var a=i(null),n=i(null);a[" size"]=n[" size"]=0}t.exports=function(t){var r,i=e("./util"),a=i.canEvaluate;i.isIdentifier;function n(e,r){var a;if(null!=e&&(a=e[r]),"function"!=typeof a){var n="Object "+i.classString(e)+" has no method '"+i.toString(r)+"'";throw new t.TypeError(n)}return a}function o(e){return n(e,this.pop()).apply(e,this)}function s(e){return e[this]}function c(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(o,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if("number"==typeof e)t=c;else if(a){var i=r(e);t=null!==i?i:s}else t=s;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,r){"use strict";t.exports=function(t,r,i,a){var n=e("./util"),o=n.tryCatch,s=n.errorObj,c=t._async;t.prototype.break=t.prototype.cancel=function(){if(!a.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(n.isArray(e))for(var r=0;r=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},i.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},i.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},i.CapturedTrace=null,i.create=function(){if(t)return new i},i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var r=e.prototype._pushContext,n=e.prototype._popContext,o=e._peekContext,s=e.prototype._peekContext,c=e.prototype._promiseCreated;i.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=n,e._peekContext=o,e.prototype._peekContext=s,e.prototype._promiseCreated=c,t=!1},t=!0,e.prototype._pushContext=i.prototype._pushContext,e.prototype._popContext=i.prototype._popContext,e._peekContext=e.prototype._peekContext=a,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},i}},{}],9:[function(t,r,i){"use strict";r.exports=function(r,i,a,n){var o,s,c,u,p=r._async,l=t("./errors").Warning,f=t("./util"),h=t("./es5"),d=f.canAttachTrace,m=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,g=/\((?:timers\.js):\d+:\d+\)/,b=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,v=null,y=null,w=!1,k=!(0==f.env("BLUEBIRD_DEBUG")),_=!(0==f.env("BLUEBIRD_WARNINGS")||!k&&!f.env("BLUEBIRD_WARNINGS")),x=!(0==f.env("BLUEBIRD_LONG_STACK_TRACES")||!k&&!f.env("BLUEBIRD_LONG_STACK_TRACES")),j=0!=f.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(_||!!f.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function t(){for(var t=0;t0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(e,t,r){return K(e,t,r||this)},r.onPossiblyUnhandledRejection=function(e){var t=r._getContext();s=f.contextBind(t,e)},r.onUnhandledRejectionHandled=function(e){var t=r._getContext();o=f.contextBind(t,e)};var S=function(){};r.longStackTraces=function(){if(p.haveItemsQueued()&&!re.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!re.longStackTraces&&Q()){var e=r.prototype._captureStackTrace,t=r.prototype._attachExtraTrace,a=r.prototype._dereferenceTrace;re.longStackTraces=!0,S=function(){if(p.haveItemsQueued()&&!re.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=e,r.prototype._attachExtraTrace=t,r.prototype._dereferenceTrace=a,i.deactivateLongStackTraces(),re.longStackTraces=!1},r.prototype._captureStackTrace=N,r.prototype._attachExtraTrace=U,r.prototype._dereferenceTrace=H,i.activateLongStackTraces()}},r.hasLongStackTraces=function(){return re.longStackTraces&&Q()};var E={unhandledrejection:{before:function(){var e=f.global.onunhandledrejection;return f.global.onunhandledrejection=null,e},after:function(e){f.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=f.global.onrejectionhandled;return f.global.onrejectionhandled=null,e},after:function(e){f.global.onrejectionhandled=e}}},A=function(){var e=function(e,t){if(!e)return!f.global.dispatchEvent(t);var r;try{return r=e.before(),!f.global.dispatchEvent(t)}finally{e.after(r)}};try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var i=new CustomEvent(t,{detail:r,cancelable:!0});return h.defineProperty(i,"promise",{value:r.promise}),h.defineProperty(i,"reason",{value:r.reason}),e(E[t],i)}}if("function"==typeof Event){t=new Event("CustomEvent");return f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var i=new Event(t,{cancelable:!0});return i.detail=r,h.defineProperty(i,"promise",{value:r.promise}),h.defineProperty(i,"reason",{value:r.reason}),e(E[t],i)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,!1,!0,r),e(E[t],i)}}catch(e){}return function(){return!1}}(),F=f.isNode?function(){return e.emit.apply(e,arguments)}:f.global?function(e){var t="on"+e.toLowerCase(),r=f.global[t];return!!r&&(r.apply(f.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function P(e,t){return{promise:t}}var z={promiseCreated:P,promiseFulfilled:P,promiseRejected:P,promiseResolved:P,promiseCancelled:P,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:P},C=function(e){var t=!1;try{t=F.apply(null,arguments)}catch(e){p.throwLater(e),t=!0}var r=!1;try{r=A(e,z[e].apply(null,arguments))}catch(e){p.throwLater(e),r=!0}return r||t};function O(){return!1}function T(e,t,r){var i=this;try{e(t,r,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+f.toString(e));i._attachCancellationCallback(e)})}catch(e){return e}}function B(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?f.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function I(){return this._onCancelField}function R(e){this._onCancelField=e}function q(){this._cancellationParent=void 0,this._onCancelField=void 0}function M(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}r.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?r.longStackTraces():!e.longStackTraces&&r.hasLongStackTraces()&&S()),"warnings"in e){var t=e.warnings;re.warnings=!!t,j=re.warnings,f.isObject(t)&&"wForgottenReturn"in t&&(j=!!t.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!re.cancellation){if(p.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=q,r.prototype._propagateFrom=M,r.prototype._onCancel=I,r.prototype._setOnCancel=R,r.prototype._attachCancellationCallback=B,r.prototype._execute=T,D=M,re.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!re.monitoring?(re.monitoring=!0,r.prototype._fireEvent=C):!e.monitoring&&re.monitoring&&(re.monitoring=!1,r.prototype._fireEvent=O)),"asyncHooks"in e&&f.nodeSupportsAsyncResource){var i=re.asyncHooks,o=!!e.asyncHooks;i!==o&&(re.asyncHooks=o,o?a():n())}return r},r.prototype._fireEvent=O,r.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(e){},r.prototype._attachCancellationCallback=function(e){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(e,t){};var D=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function L(){var e=this._boundTo;return void 0!==e&&e instanceof r?e.isFulfilled()?e.value():void 0:e}function N(){this._trace=new ee(this._peekContext())}function U(e,t){if(d(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var i=V(e);f.notEnumerableProp(e,"stack",i.message+"\n"+i.stack.join("\n")),f.notEnumerableProp(e,"__stackCleaned__",!0)}}}function H(){this._trace=void 0}function K(e,t,i){if(re.warnings){var a,n=new l(e);if(t)i._attachExtraTrace(n);else if(re.longStackTraces&&(a=r._peekContext()))a.attachExtraTrace(n);else{var o=V(n);n.stack=o.message+"\n"+o.stack.join("\n")}C("warning",n)||Z(n,"",!0)}}function $(e){for(var t=[],r=0;r0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:$(t)}}function Z(e,t,r){if("undefined"!=typeof console){var i;if(f.isObject(e)){var a=e.stack;i=t+y(a,e)}else i=t+String(e);"function"==typeof c?c(i,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(i)}}function W(e,t,r,i){var a=!1;try{"function"==typeof t&&(a=!0,"rejectionHandled"===e?t(i):t(r,i))}catch(e){p.throwLater(e)}"unhandledRejection"===e?C(e,r,i)||a||Z(r,"Unhandled rejection "):C(e,i)}function G(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():f.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){if(e.length<41)return e;return e.substr(0,38)+"..."}(t)+">, no stack trace)"}function Q(){return"function"==typeof te}var X=function(){return!1},Y=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function J(e){var t=e.match(Y);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function ee(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);te(this,ee),t>32&&this.uncycle()}f.inherits(ee,Error),i.CapturedTrace=ee,ee.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},i=0,a=this;void 0!==a;++i)t.push(a),a=a._parent;for(i=(e=this._length=i)-1;i>=0;--i){var n=t[i].stack;void 0===r[n]&&(r[n]=i)}for(i=0;i0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[i]._parent=void 0,t[i]._length=1;var s=i>0?t[i-1]:this;o=0;--u)t[u]._length=c,c++;return}}}},ee.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=V(e),r=t.message,i=[t.stack],a=this;void 0!==a;)i.push($(a.stack.split("\n"))),a=a._parent;!function(e){for(var t=e[0],r=1;r=0;--s)if(i[s]===n){o=s;break}for(s=o;s>=0;--s){var c=i[s];if(t[a]!==c)break;t.pop(),a--}t=i}}(i),function(e){for(var t=0;t=0)return v=/@/,y=t,w=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){i="stack"in e}return"stack"in a||!i||"number"!=typeof Error.stackTraceLimit?(y=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?G(t):t.toString()},null):(v=e,y=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(c=function(e){console.warn(e)},f.isNode&&e.stderr.isTTY?c=function(e,t){var r=t?"":"";console.warn(r+e+"\n")}:f.isNode||"string"!=typeof(new Error).stack||(c=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var re={warnings:_,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return x&&r.longStackTraces(),{asyncHooks:function(){return re.asyncHooks},longStackTraces:function(){return re.longStackTraces},warnings:function(){return re.warnings},cancellation:function(){return re.cancellation},monitoring:function(){return re.monitoring},propagateFromFunction:function(){return D},boundValueFunction:function(){return L},checkForgottenReturns:function(e,t,r,i,a){if(void 0===e&&null!==t&&j){if(void 0!==a&&a._returnedNonUndefined())return;if(0==(65535&i._bitField))return;r&&(r+=" ");var n="",o="";if(t._trace){for(var s=t._trace.stack.split("\n"),c=$(s),u=c.length-1;u>=0;--u){var p=c[u];if(!g.test(p)){var l=p.match(b);l&&(n="at "+l[1]+":"+l[2]+":"+l[3]+" ");break}}if(c.length>0){var f=c[0];for(u=0;u0&&(o="\n"+s[u-1]);break}}}var h="a promise was created in a "+r+"handler "+n+"but was not returned from it, see http://goo.gl/rRqMUw"+o;i._warn(h,!0,t)}},setBounds:function(e,t){if(Q()){for(var r,i,a=(e.stack||"").split("\n"),n=(t.stack||"").split("\n"),o=-1,s=-1,c=0;c=s||(X=function(e){if(m.test(e))return!0;var t=J(e);return!!(t&&t.fileName===r&&o<=t.line&&t.line<=s)})}},warn:K,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),K(r)},CapturedTrace:ee,fireDomEvent:A,fireGlobalEvent:F}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(e,t,r){"use strict";t.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var i=arguments[1];i instanceof e&&i.suppressUnhandledRejections();return this.caught(r,function(){return i})}}},{}],11:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.reduce,i=e.all;function a(){return i(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(a,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,i){return r(e,i,t,0)._then(a,void 0,void 0,e,void 0)},e.mapSeries=function(e,i){return r(e,i,t,t)}}},{}],12:[function(e,t,r){"use strict";var i,a,n=e("./es5"),o=n.freeze,s=e("./util"),c=s.inherits,u=s.notEnumerableProp;function p(e,t){function r(i){if(!(this instanceof r))return new r(i);u(this,"message","string"==typeof i?i:t),u(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(r,Error),r}var l=p("Warning","warning"),f=p("CancellationError","cancellation error"),h=p("TimeoutError","timeout error"),d=p("AggregateError","aggregate error");try{i=TypeError,a=RangeError}catch(e){i=p("TypeError","type error"),a=p("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function l(){return h.call(this,this.promise._target()._settledValue())}function f(e){if(!p(this,e))return o.e=e,o}function h(e){var a=this.promise,s=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?s.call(a._boundValue()):s.call(a._boundValue(),e);if(c===i)return c;if(void 0!==c){a._setReturnedNonUndefined();var h=r(c,a);if(h instanceof t){if(null!=this.cancelPromise){if(h._isCancelled()){var d=new n("late cancellation observer");return a._attachExtraTrace(d),o.e=d,o}h.isPending()&&h._attachCancellationCallback(new u(this))}return h._then(l,f,void 0,this,void 0)}}}return a.isRejected()?(p(this),o.e=e,o):(p(this),e)}return c.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){p(this.finallyHandler)},t.prototype._passThrough=function(e,t,r,i){return"function"!=typeof e?this.then():this._then(r,i,void 0,new c(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,h,h)},t.prototype.tap=function(e){return this._passThrough(e,1,h)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,h);var i,n=new Array(r-1),o=0;for(i=0;i0&&"function"==typeof arguments[t]&&(e=arguments[t]);var i=[].slice.call(arguments);e&&i.pop();var a=new r(i).promise();return void 0!==e?a.spread(e):a}}},{"./util":36}],18:[function(e,t,r){"use strict";t.exports=function(t,r,i,a,n,o){var s=e("./util"),c=s.tryCatch,u=s.errorObj,p=t._async;function l(e,r,i,a){this.constructor$(e),this._promise._captureStackTrace();var o=t._getContext();if(this._callback=s.contextBind(o,r),this._preservedValues=a===n?new Array(this.length()):null,this._limit=i,this._inFlight=0,this._queue=[],p.invoke(this._asyncInit,this,void 0),s.isArray(e))for(var c=0;c=1?o:0,n).promise()}s.inherits(l,r),l.prototype._asyncInit=function(){this._init$(void 0,-2)},l.prototype._init=function(){},l.prototype._promiseFulfilled=function(e,r){var i=this._values,n=this.length(),s=this._preservedValues,p=this._limit;if(r<0){if(i[r=-1*r-1]=e,p>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(p>=1&&this._inFlight>=p)return i[r]=e,this._queue.push(r),!1;null!==s&&(s[r]=e);var l=this._promise,f=this._callback,h=l._boundValue();l._pushContext();var d=c(f).call(h,e,r,n),m=l._popContext();if(o.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",l),d===u)return this._reject(d.e),!0;var g=a(d,this._promise);if(g instanceof t){var b=(g=g._target())._bitField;if(0==(50397184&b))return p>=1&&this._inFlight++,i[r]=g,g._proxy(this,-1*(r+1)),!1;if(0==(33554432&b))return 0!=(16777216&b)?(this._reject(g._reason()),!0):(this._cancel(),!0);d=g._value()}i[r]=d}return++this._totalResolved>=n&&(null!==s?this._filter(i,s):this._resolve(i),!0)},l.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight1){n.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],p=arguments[2];i=o.isArray(u)?s(e).apply(p,u):s(e).call(p,u)}else i=s(e)();var l=c._popContext();return n.checkForgottenReturns(i,l,"Promise.try",c),c._resolveFromSyncValue(i),c},t.prototype._resolveFromSyncValue=function(e){e===o.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,r){"use strict";var i=e("./util"),a=i.maybeWrapAsError,n=e("./errors").OperationalError,o=e("./es5");var s=/^(?:name|message|stack|cause)$/;function c(e){var t;if(function(e){return e instanceof Error&&o.getPrototypeOf(e)===Error.prototype}(e)){(t=new n(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=o.keys(e),a=0;a1){var r,i=new Array(t-1),a=0;for(r=0;r0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+c.classString(e);arguments.length>1&&(r+=", "+c.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},T.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},T.prototype.spread=function(e){return"function"!=typeof e?n("expecting a function but got "+c.classString(e)):this.all()._then(e,void 0,void 0,k,void 0)},T.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},T.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new j(this).promise()},T.prototype.error=function(e){return this.caught(c.originatesFromRejection,e)},T.getNewLibraryCopy=r.exports,T.is=function(e){return e instanceof T},T.fromNode=T.fromCallback=function(e){var t=new T(w);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,i=O(e)(z(t,r));return i===C&&t._rejectCallback(i.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},T.all=function(e){return new j(e).promise()},T.cast=function(e){var t=x(e);return t instanceof T||((t=new T(w))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},T.resolve=T.fulfilled=T.cast,T.reject=T.rejected=function(e){var t=new T(w);return t._captureStackTrace(),t._rejectCallback(e,!0),t},T.setScheduler=function(e){if("function"!=typeof e)throw new v("expecting a function but got "+c.classString(e));return g.setScheduler(e)},T.prototype._then=function(e,t,r,i,a){var n=void 0!==a,o=n?a:new T(w),s=this._target(),u=s._bitField;n||(o._propagateFrom(this,3),o._captureStackTrace(),void 0===i&&0!=(2097152&this._bitField)&&(i=0!=(50397184&u)?this._boundValue():s===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,o));var p=h();if(0!=(50397184&u)){var l,f,d=s._settlePromiseCtx;0!=(33554432&u)?(f=s._rejectionHandler0,l=e):0!=(16777216&u)?(f=s._fulfillmentHandler0,l=t,s._unsetRejectionIsUnhandled()):(d=s._settlePromiseLateCancellationObserver,f=new y("late cancellation observer"),s._attachExtraTrace(f),l=t),g.invoke(d,s,{handler:c.contextBind(p,l),promise:o,receiver:i,value:f})}else s._addCallbacks(e,t,o,i,p);return o},T.prototype._length=function(){return 65535&this._bitField},T.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},T.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},T.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},T.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},T.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},T.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},T.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},T.prototype._isFinal=function(){return(4194304&this._bitField)>0},T.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},T.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},T.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},T.prototype._setAsyncGuaranteed=function(){if(!g.hasCustomScheduler()){var e=this._bitField;this._bitField=e|(536870912&e)>>2^134217728}},T.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},T.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==s)return void 0===t&&this._isBound()?this._boundValue():t},T.prototype._promiseAt=function(e){return this[4*e-4+2]},T.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},T.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},T.prototype._boundValue=function(){},T.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,i=e._promise0,a=e._receiverAt(0);void 0===a&&(a=s),this._addCallbacks(t,r,i,a,null)},T.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),i=e._rejectionHandlerAt(t),a=e._promiseAt(t),n=e._receiverAt(t);void 0===n&&(n=s),this._addCallbacks(r,i,a,n,null)},T.prototype._addCallbacks=function(e,t,r,i,a){var n=this._length();if(n>=65531&&(n=0,this._setLength(0)),0===n)this._promise0=r,this._receiver0=i,"function"==typeof e&&(this._fulfillmentHandler0=c.contextBind(a,e)),"function"==typeof t&&(this._rejectionHandler0=c.contextBind(a,t));else{var o=4*n-4;this[o+2]=r,this[o+3]=i,"function"==typeof e&&(this[o+0]=c.contextBind(a,e)),"function"==typeof t&&(this[o+1]=c.contextBind(a,t))}return this._setLength(n+1),n},T.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},T.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(i(),!1);var r=x(e,this);if(!(r instanceof T))return this._fulfill(e);t&&this._propagateFrom(r,2);var a=r._target();if(a!==this){var n=a._bitField;if(0==(50397184&n)){var o=this._length();o>0&&a._migrateCallback0(this);for(var s=1;s>>16)){if(e===this){var r=i();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():g.settlePromises(this),this._dereferenceTrace())}},T.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return g.fatalError(e,c.isNode);(65535&t)>0?g.settlePromises(this):this._ensurePossibleRejectionHandled()}},T.prototype._fulfillPromises=function(e,t){for(var r=1;r0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var i=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,i,e),this._fulfillPromises(t,i)}this._setLength(0)}this._clearCancellationData()},T.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&d.defineProperty(T.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),T.defer=T.pending=function(){return A.deprecated("Promise.defer","new Promise"),{promise:new T(w),resolve:B,reject:I}},c.notEnumerableProp(T,"_makeSelfResolutionError",i),t("./method")(T,w,x,n,A),t("./bind")(T,w,x,A),t("./cancel")(T,j,n,A),t("./direct_resolve")(T),t("./synchronous_inspection")(T),t("./join")(T,j,x,w,g),T.Promise=T,T.version="3.7.1",t("./call_get.js")(T),t("./generators.js")(T,n,w,x,o,A),t("./map.js")(T,j,n,x,w,A),t("./nodeify.js")(T),t("./promisify.js")(T,w),t("./props.js")(T,j,x,n),t("./race.js")(T,w,x,n),t("./reduce.js")(T,j,n,x,w,A),t("./settle.js")(T,j,A),t("./some.js")(T,j,n),t("./timers.js")(T,w,A),t("./using.js")(T,n,x,E,w,A),t("./any.js")(T),t("./each.js")(T,w),t("./filter.js")(T,w),c.toFastProperties(T),c.toFastProperties(T.prototype),R({a:1}),R({b:2}),R({c:3}),R(1),R(function(){}),R(void 0),R(!1),R(new T(w)),A.setBounds(m.firstLineError,c.lastLineError),T}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36,async_hooks:void 0}],23:[function(e,t,r){"use strict";t.exports=function(t,r,i,a,n){var o=e("./util");o.isArray;function s(e){var i=this._promise=new t(r);e instanceof t&&(i._propagateFrom(e,3),e.suppressUnhandledRejections()),i._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(s,n),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(r,n){var s=i(this._values,this._promise);if(s instanceof t){var c=(s=s._target())._bitField;if(this._values=s,0==(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,n);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=o.asArray(s)))0!==s.length?this._iterate(s):-5===n?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(n));else{var u=a("expecting an array or an iterable object but got "+o.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var a=this._promise,n=!1,o=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r=this._length){var r;if(this._isMap)r=function(e){for(var t=new n,r=e.length/2|0,i=0;i>1},t.prototype.props=function(){return l(this)},t.props=function(e){return l(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new a;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new a;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},t.settle=function(e){return i.deprecated(".settle()",".reflect()"),new n(e).promise()},t.allSettled=function(e){return new n(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,r){"use strict";t.exports=function(t,r,i){var a=e("./util"),n=e("./errors").RangeError,o=e("./errors").AggregateError,s=a.isArray,c={};function u(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function p(e,t){if((0|t)!==t||t<0)return i("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(e),a=r.promise();return r.setHowMany(t),r.init(),a}a.inherits(u,r),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=s(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(e){this._howMany=e},u.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new o,t=this.length();t0?this._reject(e):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(e){this._values.push(e)},u.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new n(t)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return p(e,t)},t.prototype.some=function(e){return p(this,e)},t._SomePromiseArray=u}},{"./errors":12,"./util":36}],32:[function(e,t,r){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},a=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},n=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},o=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return o.call(this._target())},e.prototype.isRejected=function(){return n.call(this._target())},e.prototype.isFulfilled=function(){return a.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),i.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,r){"use strict";t.exports=function(t,r){var i=e("./util"),a=i.errorObj,n=i.isObject;var o={}.hasOwnProperty;return function(e,s){if(n(e)){if(e instanceof t)return e;var c=function(e){try{return function(e){return e.then}(e)}catch(e){return a.e=e,a}}(e);if(c===a){s&&s._pushContext();var u=t.reject(c.e);return s&&s._popContext(),u}if("function"==typeof c)return function(e){try{return o.call(e,"_promise0")}catch(e){return!1}}(e)?(u=new t(r),e._then(u._fulfill,u._reject,void 0,u,null),u):function(e,n,o){var s=new t(r),c=s;o&&o._pushContext(),s._captureStackTrace(),o&&o._popContext();var u=!0,p=i.tryCatch(n).call(e,function(e){s&&(s._resolveCallback(e),s=null)},function(e){s&&(s._rejectCallback(e,u,!0),s=null)});return u=!1,s&&p===a&&(s._rejectCallback(p.e,!0,!0),s=null),c}(e,c,s)}return e}}},{"./util":36}],34:[function(e,t,r){"use strict";t.exports=function(t,r,i){var a=e("./util"),n=t.TimeoutError;function o(e){this.handle=e}o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(e){return c(+this).thenReturn(e)},c=t.delay=function(e,a){var n,c;return void 0!==a?(n=t.resolve(a)._then(s,null,null,e,void 0),i.cancellation()&&a instanceof t&&n._setOnCancel(a)):(n=new t(r),c=setTimeout(function(){n._fulfill()},+e),i.cancellation()&&n._setOnCancel(new o(c)),n._captureStackTrace()),n._setAsyncGuaranteed(),n};t.prototype.delay=function(e){return c(e,this)};function u(e){return clearTimeout(this.handle),e}function p(e){throw clearTimeout(this.handle),e}t.prototype.timeout=function(e,t){var r,s;e=+e;var c=new o(setTimeout(function(){r.isPending()&&function(e,t,r){var i;i="string"!=typeof t?t instanceof Error?t:new n("operation timed out"):new n(t),a.markAsOriginatingFromRejection(i),e._attachExtraTrace(i),e._reject(i),null!=r&&r.cancel()}(r,t,s)},e));return i.cancellation()?(s=this.then(),(r=s._then(u,p,void 0,c,void 0))._setOnCancel(c)):r=this._then(u,p,void 0,c,void 0),r}}},{"./util":36}],35:[function(e,t,r){"use strict";t.exports=function(t,r,i,a,n,o){var s=e("./util"),c=e("./errors").TypeError,u=e("./util").inherits,p=s.errorObj,l=s.tryCatch,f={};function h(e){setTimeout(function(){throw e},0)}function d(e,r){var a=0,o=e.length,s=new t(n);return function n(){if(a>=o)return s._fulfill();var c=function(e){var t=i(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(e[a++]);if(c instanceof t&&c._isDisposable()){try{c=i(c._getDisposer().tryDispose(r),e.promise)}catch(e){return h(e)}if(c instanceof t)return c._then(n,h,null,null,null)}n()}(),s}function m(e,t,r){this._data=e,this._promise=t,this._context=r}function g(e,t,r){this.constructor$(e,t,r)}function b(e){return m.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function v(e){this.length=e,this.promise=null,this[e-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():f},m.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var i=t!==f?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,i},m.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},u(g,m),g.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},v.prototype._resultCancelled=function(){for(var e=this.length,r=0;r0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new g(e,this,a());throw new c}}},{"./errors":12,"./util":36}],36:[function(t,r,a){"use strict";var n=t("./es5"),o="undefined"==typeof navigator,s={e:{}},c,u="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i?i:void 0!==this?this:null;function p(){try{var e=c;return c=null,e.apply(this,arguments)}catch(e){return s.e=e,s}}function l(e){return c=e,p}var f=function(e,t){var r={}.hasOwnProperty;function i(){for(var i in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,i)&&"$"!==i.charAt(i.length-1)&&(this[i+"$"]=t.prototype[i])}return i.prototype=t.prototype,e.prototype=new i,e.prototype};function h(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function d(e){return"function"==typeof e||"object"==typeof e&&null!==e}function m(e){return h(e)?new Error(A(e)):e}function g(e,t){var r,i=e.length,a=new Array(i+1);for(r=0;r1,i=t.length>0&&!(1===t.length&&"constructor"===t[0]),a=k.test(e+"")&&n.names(e).length>0;if(r||i||a)return!0}return!1}catch(e){return!1}}function x(e){function t(){}t.prototype=e;var r=new t;function i(){return typeof r.foo}return i(),i(),e}var j=/^[a-z$_][a-z$_0-9]*$/i;function S(e){return j.test(e)}function E(e,t,r){for(var i=new Array(e),a=0;a10||K[0]>0),H.nodeSupportsAsyncResource=H.isNode&&function(){var e=!1;try{e="function"==typeof t("async_hooks").AsyncResource.prototype.runInAsyncScope}catch(t){e=!1}return e}(),H.isNode&&H.toFastProperties(e);try{throw new Error}catch(e){H.lastLineError=e}r.exports=H},{"./es5":13,async_hooks:void 0}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{_process:263,timers:372}],75:[function(e,t,r){!function(t,r){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof t?t.exports=n:r.BN=n,n.BN=n,n.wordSize=26;try{o=e("buffer").Buffer}catch(e){}function s(e,t,r){for(var i=0,a=Math.min(e.length,r),n=t;n=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return i}function c(e,t,r,i){for(var a=0,n=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return a}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&a++,16===t?this._parseHex(e,a):this._parseBase(e,t,a),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},n.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},n.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[n]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===r)for(a=0,n=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},n.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)a=s(e,r,r+6),this.words[i]|=a<>>26-n&4194303,(n+=24)>=26&&(n-=26,i++);r+6!==t&&(a=s(e,t,r+6),this.words[i]|=a<>>26-n&4194303),this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,a=1;a<=67108863;a*=t)i++;i--,a=a/t|0;for(var n=e.length-r,o=n%i,s=Math.min(n,n-o)+r,u=0,p=r;p1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var a=0|e.words[0],n=0|t.words[0],o=a*n,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var d=u-h|0;p+=(o=(a=0|e.words[d])*(n=0|t.words[h])+l)/67108864|0,l=67108863&o}r.words[u]=0|l,c=0|p}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}n.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,n=0,o=0;o>>24-a&16777215)||o!==this.length-1?u[6-c.length]+c+r:c+r,(a+=2)>=26&&(a-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=p[e],h=l[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(h).toString(e);r=(d=d.idivn(h)).isZero()?m+r:u[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return i(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,r){var a=this.byteLength(),n=r||Math.max(1,a);i(a<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0"),this.strip();var o,s,c="le"===t,u=new e(n),p=this.clone();if(c){for(s=0;!p.isZero();s++)o=p.andln(255),p.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var a=0,n=0;n>>26;for(;0!==a&&n>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ne.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==n&&o>26,this.words[o]=67108863&t;if(0===n&&o>>13,h=0|o[1],d=8191&h,m=h>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,k=y>>>13,_=0|o[4],x=8191&_,j=_>>>13,S=0|o[5],E=8191&S,A=S>>>13,F=0|o[6],P=8191&F,z=F>>>13,C=0|o[7],O=8191&C,T=C>>>13,B=0|o[8],I=8191&B,R=B>>>13,q=0|o[9],M=8191&q,D=q>>>13,L=0|s[0],N=8191&L,U=L>>>13,H=0|s[1],K=8191&H,$=H>>>13,V=0|s[2],Z=8191&V,W=V>>>13,G=0|s[3],Q=8191&G,X=G>>>13,Y=0|s[4],J=8191&Y,ee=Y>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ae=0|s[6],ne=8191&ae,oe=ae>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,pe=0|s[8],le=8191&pe,fe=pe>>>13,he=0|s[9],de=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(l,N))|0)+((8191&(a=(a=Math.imul(l,U))+Math.imul(f,N)|0))<<13)|0;u=((n=Math.imul(f,U))+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,N),a=(a=Math.imul(d,U))+Math.imul(m,N)|0,n=Math.imul(m,U);var be=(u+(i=i+Math.imul(l,K)|0)|0)+((8191&(a=(a=a+Math.imul(l,$)|0)+Math.imul(f,K)|0))<<13)|0;u=((n=n+Math.imul(f,$)|0)+(a>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,N),a=(a=Math.imul(b,U))+Math.imul(v,N)|0,n=Math.imul(v,U),i=i+Math.imul(d,K)|0,a=(a=a+Math.imul(d,$)|0)+Math.imul(m,K)|0,n=n+Math.imul(m,$)|0;var ve=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(a=(a=a+Math.imul(l,W)|0)+Math.imul(f,Z)|0))<<13)|0;u=((n=n+Math.imul(f,W)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(w,N),a=(a=Math.imul(w,U))+Math.imul(k,N)|0,n=Math.imul(k,U),i=i+Math.imul(b,K)|0,a=(a=a+Math.imul(b,$)|0)+Math.imul(v,K)|0,n=n+Math.imul(v,$)|0,i=i+Math.imul(d,Z)|0,a=(a=a+Math.imul(d,W)|0)+Math.imul(m,Z)|0,n=n+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(a=(a=a+Math.imul(l,X)|0)+Math.imul(f,Q)|0))<<13)|0;u=((n=n+Math.imul(f,X)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,N),a=(a=Math.imul(x,U))+Math.imul(j,N)|0,n=Math.imul(j,U),i=i+Math.imul(w,K)|0,a=(a=a+Math.imul(w,$)|0)+Math.imul(k,K)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(b,Z)|0,a=(a=a+Math.imul(b,W)|0)+Math.imul(v,Z)|0,n=n+Math.imul(v,W)|0,i=i+Math.imul(d,Q)|0,a=(a=a+Math.imul(d,X)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,X)|0;var we=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(a=(a=a+Math.imul(l,ee)|0)+Math.imul(f,J)|0))<<13)|0;u=((n=n+Math.imul(f,ee)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(E,N),a=(a=Math.imul(E,U))+Math.imul(A,N)|0,n=Math.imul(A,U),i=i+Math.imul(x,K)|0,a=(a=a+Math.imul(x,$)|0)+Math.imul(j,K)|0,n=n+Math.imul(j,$)|0,i=i+Math.imul(w,Z)|0,a=(a=a+Math.imul(w,W)|0)+Math.imul(k,Z)|0,n=n+Math.imul(k,W)|0,i=i+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,X)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,X)|0,i=i+Math.imul(d,J)|0,a=(a=a+Math.imul(d,ee)|0)+Math.imul(m,J)|0,n=n+Math.imul(m,ee)|0;var ke=(u+(i=i+Math.imul(l,re)|0)|0)+((8191&(a=(a=a+Math.imul(l,ie)|0)+Math.imul(f,re)|0))<<13)|0;u=((n=n+Math.imul(f,ie)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(P,N),a=(a=Math.imul(P,U))+Math.imul(z,N)|0,n=Math.imul(z,U),i=i+Math.imul(E,K)|0,a=(a=a+Math.imul(E,$)|0)+Math.imul(A,K)|0,n=n+Math.imul(A,$)|0,i=i+Math.imul(x,Z)|0,a=(a=a+Math.imul(x,W)|0)+Math.imul(j,Z)|0,n=n+Math.imul(j,W)|0,i=i+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,X)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(b,J)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(v,J)|0,n=n+Math.imul(v,ee)|0,i=i+Math.imul(d,re)|0,a=(a=a+Math.imul(d,ie)|0)+Math.imul(m,re)|0,n=n+Math.imul(m,ie)|0;var _e=(u+(i=i+Math.imul(l,ne)|0)|0)+((8191&(a=(a=a+Math.imul(l,oe)|0)+Math.imul(f,ne)|0))<<13)|0;u=((n=n+Math.imul(f,oe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(O,N),a=(a=Math.imul(O,U))+Math.imul(T,N)|0,n=Math.imul(T,U),i=i+Math.imul(P,K)|0,a=(a=a+Math.imul(P,$)|0)+Math.imul(z,K)|0,n=n+Math.imul(z,$)|0,i=i+Math.imul(E,Z)|0,a=(a=a+Math.imul(E,W)|0)+Math.imul(A,Z)|0,n=n+Math.imul(A,W)|0,i=i+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,X)|0)+Math.imul(j,Q)|0,n=n+Math.imul(j,X)|0,i=i+Math.imul(w,J)|0,a=(a=a+Math.imul(w,ee)|0)+Math.imul(k,J)|0,n=n+Math.imul(k,ee)|0,i=i+Math.imul(b,re)|0,a=(a=a+Math.imul(b,ie)|0)+Math.imul(v,re)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(d,ne)|0,a=(a=a+Math.imul(d,oe)|0)+Math.imul(m,ne)|0,n=n+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(l,ce)|0)|0)+((8191&(a=(a=a+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((n=n+Math.imul(f,ue)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,N),a=(a=Math.imul(I,U))+Math.imul(R,N)|0,n=Math.imul(R,U),i=i+Math.imul(O,K)|0,a=(a=a+Math.imul(O,$)|0)+Math.imul(T,K)|0,n=n+Math.imul(T,$)|0,i=i+Math.imul(P,Z)|0,a=(a=a+Math.imul(P,W)|0)+Math.imul(z,Z)|0,n=n+Math.imul(z,W)|0,i=i+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,X)|0)+Math.imul(A,Q)|0,n=n+Math.imul(A,X)|0,i=i+Math.imul(x,J)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(j,J)|0,n=n+Math.imul(j,ee)|0,i=i+Math.imul(w,re)|0,a=(a=a+Math.imul(w,ie)|0)+Math.imul(k,re)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(b,ne)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(v,ne)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(d,ce)|0,a=(a=a+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,n=n+Math.imul(m,ue)|0;var je=(u+(i=i+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((n=n+Math.imul(f,fe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(M,N),a=(a=Math.imul(M,U))+Math.imul(D,N)|0,n=Math.imul(D,U),i=i+Math.imul(I,K)|0,a=(a=a+Math.imul(I,$)|0)+Math.imul(R,K)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(O,Z)|0,a=(a=a+Math.imul(O,W)|0)+Math.imul(T,Z)|0,n=n+Math.imul(T,W)|0,i=i+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,X)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,X)|0,i=i+Math.imul(E,J)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(A,J)|0,n=n+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ie)|0)+Math.imul(j,re)|0,n=n+Math.imul(j,ie)|0,i=i+Math.imul(w,ne)|0,a=(a=a+Math.imul(w,oe)|0)+Math.imul(k,ne)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(b,ce)|0,a=(a=a+Math.imul(b,ue)|0)+Math.imul(v,ce)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(d,le)|0,a=(a=a+Math.imul(d,fe)|0)+Math.imul(m,le)|0,n=n+Math.imul(m,fe)|0;var Se=(u+(i=i+Math.imul(l,de)|0)|0)+((8191&(a=(a=a+Math.imul(l,me)|0)+Math.imul(f,de)|0))<<13)|0;u=((n=n+Math.imul(f,me)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(M,K),a=(a=Math.imul(M,$))+Math.imul(D,K)|0,n=Math.imul(D,$),i=i+Math.imul(I,Z)|0,a=(a=a+Math.imul(I,W)|0)+Math.imul(R,Z)|0,n=n+Math.imul(R,W)|0,i=i+Math.imul(O,Q)|0,a=(a=a+Math.imul(O,X)|0)+Math.imul(T,Q)|0,n=n+Math.imul(T,X)|0,i=i+Math.imul(P,J)|0,a=(a=a+Math.imul(P,ee)|0)+Math.imul(z,J)|0,n=n+Math.imul(z,ee)|0,i=i+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ie)|0)+Math.imul(A,re)|0,n=n+Math.imul(A,ie)|0,i=i+Math.imul(x,ne)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(j,ne)|0,n=n+Math.imul(j,oe)|0,i=i+Math.imul(w,ce)|0,a=(a=a+Math.imul(w,ue)|0)+Math.imul(k,ce)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(b,le)|0,a=(a=a+Math.imul(b,fe)|0)+Math.imul(v,le)|0,n=n+Math.imul(v,fe)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((n=n+Math.imul(m,me)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(M,Z),a=(a=Math.imul(M,W))+Math.imul(D,Z)|0,n=Math.imul(D,W),i=i+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,X)|0)+Math.imul(R,Q)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(O,J)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(T,J)|0,n=n+Math.imul(T,ee)|0,i=i+Math.imul(P,re)|0,a=(a=a+Math.imul(P,ie)|0)+Math.imul(z,re)|0,n=n+Math.imul(z,ie)|0,i=i+Math.imul(E,ne)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(A,ne)|0,n=n+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,a=(a=a+Math.imul(x,ue)|0)+Math.imul(j,ce)|0,n=n+Math.imul(j,ue)|0,i=i+Math.imul(w,le)|0,a=(a=a+Math.imul(w,fe)|0)+Math.imul(k,le)|0,n=n+Math.imul(k,fe)|0;var Ae=(u+(i=i+Math.imul(b,de)|0)|0)+((8191&(a=(a=a+Math.imul(b,me)|0)+Math.imul(v,de)|0))<<13)|0;u=((n=n+Math.imul(v,me)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(M,Q),a=(a=Math.imul(M,X))+Math.imul(D,Q)|0,n=Math.imul(D,X),i=i+Math.imul(I,J)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,ee)|0,i=i+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ie)|0)+Math.imul(T,re)|0,n=n+Math.imul(T,ie)|0,i=i+Math.imul(P,ne)|0,a=(a=a+Math.imul(P,oe)|0)+Math.imul(z,ne)|0,n=n+Math.imul(z,oe)|0,i=i+Math.imul(E,ce)|0,a=(a=a+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,n=n+Math.imul(A,ue)|0,i=i+Math.imul(x,le)|0,a=(a=a+Math.imul(x,fe)|0)+Math.imul(j,le)|0,n=n+Math.imul(j,fe)|0;var Fe=(u+(i=i+Math.imul(w,de)|0)|0)+((8191&(a=(a=a+Math.imul(w,me)|0)+Math.imul(k,de)|0))<<13)|0;u=((n=n+Math.imul(k,me)|0)+(a>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,i=Math.imul(M,J),a=(a=Math.imul(M,ee))+Math.imul(D,J)|0,n=Math.imul(D,ee),i=i+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ie)|0)+Math.imul(R,re)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(O,ne)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(T,ne)|0,n=n+Math.imul(T,oe)|0,i=i+Math.imul(P,ce)|0,a=(a=a+Math.imul(P,ue)|0)+Math.imul(z,ce)|0,n=n+Math.imul(z,ue)|0,i=i+Math.imul(E,le)|0,a=(a=a+Math.imul(E,fe)|0)+Math.imul(A,le)|0,n=n+Math.imul(A,fe)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(a=(a=a+Math.imul(x,me)|0)+Math.imul(j,de)|0))<<13)|0;u=((n=n+Math.imul(j,me)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(M,re),a=(a=Math.imul(M,ie))+Math.imul(D,re)|0,n=Math.imul(D,ie),i=i+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(R,ne)|0,n=n+Math.imul(R,oe)|0,i=i+Math.imul(O,ce)|0,a=(a=a+Math.imul(O,ue)|0)+Math.imul(T,ce)|0,n=n+Math.imul(T,ue)|0,i=i+Math.imul(P,le)|0,a=(a=a+Math.imul(P,fe)|0)+Math.imul(z,le)|0,n=n+Math.imul(z,fe)|0;var ze=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(a=(a=a+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((n=n+Math.imul(A,me)|0)+(a>>>13)|0)+(ze>>>26)|0,ze&=67108863,i=Math.imul(M,ne),a=(a=Math.imul(M,oe))+Math.imul(D,ne)|0,n=Math.imul(D,oe),i=i+Math.imul(I,ce)|0,a=(a=a+Math.imul(I,ue)|0)+Math.imul(R,ce)|0,n=n+Math.imul(R,ue)|0,i=i+Math.imul(O,le)|0,a=(a=a+Math.imul(O,fe)|0)+Math.imul(T,le)|0,n=n+Math.imul(T,fe)|0;var Ce=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(a=(a=a+Math.imul(P,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((n=n+Math.imul(z,me)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(M,ce),a=(a=Math.imul(M,ue))+Math.imul(D,ce)|0,n=Math.imul(D,ue),i=i+Math.imul(I,le)|0,a=(a=a+Math.imul(I,fe)|0)+Math.imul(R,le)|0,n=n+Math.imul(R,fe)|0;var Oe=(u+(i=i+Math.imul(O,de)|0)|0)+((8191&(a=(a=a+Math.imul(O,me)|0)+Math.imul(T,de)|0))<<13)|0;u=((n=n+Math.imul(T,me)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(M,le),a=(a=Math.imul(M,fe))+Math.imul(D,le)|0,n=Math.imul(D,fe);var Te=(u+(i=i+Math.imul(I,de)|0)|0)+((8191&(a=(a=a+Math.imul(I,me)|0)+Math.imul(R,de)|0))<<13)|0;u=((n=n+Math.imul(R,me)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Be=(u+(i=Math.imul(M,de))|0)+((8191&(a=(a=Math.imul(M,me))+Math.imul(D,de)|0))<<13)|0;return u=((n=Math.imul(D,me))+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=be,c[2]=ve,c[3]=ye,c[4]=we,c[5]=ke,c[6]=_e,c[7]=xe,c[8]=je,c[9]=Se,c[10]=Ee,c[11]=Ae,c[12]=Fe,c[13]=Pe,c[14]=ze,c[15]=Ce,c[16]=Oe,c[17]=Te,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function d(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=f),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,a=0,n=0;n>>26)|0)>>>26,o&=67108863}r.words[n]=s,i=o,o=a}return 0!==i?r.words[n]=i:r.length--,r.strip()}(this,e,t):d(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,a,n){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=a/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i=0);var t,r=e%26,a=(e-r)/26,n=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t=0),a=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),s=67108863^67108863>>>n<o)for(this.length-=o,u=0;u=0&&(0!==p||u>=a);u--){var l=0|this.words[u];this.words[u]=p<<26-n|l>>>n,p=l&s}return c&&0!==p&&(c.words[c.length++]=p),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[a+r]=67108863&n}for(;a>26,this.words[a+r]=67108863&n;if(0===s)return this.strip();for(i(-1===s),s=0,a=0;a>26,this.words[a]=67108863&n;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),i.iushln(r),o=0|a.words[a.length-1]);var s,c=i.length-a.length;if("mod"!==t){(s=new n(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|i.words[a.length+l])+(0|i.words[a.length+l-1]);for(f=Math.min(f/o|0,67108863),i._ishlnsubmul(a,f,l);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(a,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=f)}return s&&s.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},n.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),a=e.andln(1),n=r.cmp(i);return n<0||1===a&&0===n?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,a=this.length-1;a>=0;a--)r=(t*r+(0|this.words[a]))%e;return r},n.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*t;this.words[r]=a/e|0,t=a%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),o=new n(0),s=new n(0),c=new n(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var p=r.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(p),o.isub(l)),a.iushrn(1),o.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(p),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(c)):(r.isub(t),s.isub(a),c.isub(o))}return{a:s,b:c,gcd:r.iushln(u)}},n.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new n(1),s=new n(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,p=1;0==(t.words[0]&p)&&u<26;++u,p<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var l=0,f=1;0==(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var n=t;t=r,r=n}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:ae.length)return 1;if(this.length=0;r--){var i=0|this.words[r],a=0|e.words[r];if(i!==a){ia&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new _(e)},n.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):r.strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},a(v,b),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,a=n}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return g[e]=t,t},_.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new n(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);i(!a.isZero());var s=new n(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new n(2*p*p).toRed(this);0!==this.pow(p,u).cmp(c);)p.redIAdd(c);for(var l=this.pow(p,a),f=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),d=o;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var u=t.words[i],p=c-1;p>=0;p--){var l=u>>p&1;a!==r[0]&&(a=this.sqr(a)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===i&&0===p)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}c=26}return a},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new x(e)},a(x,_),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),n=a;return a.cmp(this.m)>=0?n=a.isub(this.m):a.cmpn(0)<0&&(n=a.iadd(this.m)),n._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:77}],76:[function(e,t,r){var i;function a(e){this.rand=e}if(t.exports=function(e){return i||(i=new a(null)),i.generate(e)},t.exports.Rand=a,a.prototype.generate=function(e){return this._rand(e)},a.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^p[d>>>16&255]^l[m>>>8&255]^f[255&g]^t[b++],o=u[d>>>24]^p[m>>>16&255]^l[g>>>8&255]^f[255&h]^t[b++],s=u[m>>>24]^p[g>>>16&255]^l[h>>>8&255]^f[255&d]^t[b++],c=u[g>>>24]^p[h>>>16&255]^l[d>>>8&255]^f[255&m]^t[b++],h=n,d=o,m=s,g=c;return n=(i[h>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[b++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&h])^t[b++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[h>>>8&255]<<8|i[255&d])^t[b++],c=(i[g>>>24]<<24|i[h>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[b++],[n>>>=0,o>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],a=[[],[],[],[]],n=[[],[],[],[]],o=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,r[o]=u,i[u]=o;var p=e[o],l=e[p],f=e[l],h=257*e[u]^16843008*u;a[0][o]=h<<24|h>>>8,a[1][o]=h<<16|h>>>16,a[2][o]=h<<8|h>>>24,a[3][o]=h,h=16843009*f^65537*l^257*p^16843008*o,n[0][u]=h<<24|h>>>8,n[1][u]=h<<16|h>>>16,n[2][u]=h<<8|h>>>24,n[3][u]=h,0===o?o=s=1:(o=p^e[e[e[f^p]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:a,INV_SUB_MIX:n}}();function u(e){this._key=a(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),a=[],n=0;n>>24,o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o],o^=s[n/t|0]<<24):t>6&&n%t==4&&(o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o]),a[n]=a[n-t]^o}for(var u=[],p=0;p>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=r,this._keySchedule=a,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=i.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},u.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),n=i.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[3],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[1],12),n},u.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},t.exports.AES=u},{"safe-buffer":314}],79:[function(e,t,r){var i=e("./aes"),a=e("safe-buffer").Buffer,n=e("cipher-base"),o=e("inherits"),s=e("./ghash"),c=e("buffer-xor"),u=e("./incr32");function p(e,t,r,o){n.call(this);var c=a.alloc(4,0);this._cipher=new i.AES(t);var p=this._cipher.encryptBlock(c);this._ghash=new s(p),r=function(e,t,r){if(12===t.length)return e._finID=a.concat([t,a.from([0,0,0,1])]),a.concat([t,a.from([0,0,0,2])]);var i=new s(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(a.alloc(o,0))),i.update(a.alloc(8,0));var c=8*n,p=a.alloc(8);p.writeUIntBE(c,0,8),i.update(p),e._finID=i.state;var l=a.from(e._finID);return u(l),l}(this,r,p),this._prev=a.from(r),this._cache=a.allocUnsafe(0),this._secCache=a.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(p,n),p.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=a.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},p.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),a=0;a16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(t,!1,r.key,r.iv);return f(e,i.key,i.iv)},r.createDecipheriv=f},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":113,evp_bytestokey:155,inherits:205,"safe-buffer":314}],82:[function(e,t,r){var i=e("./modes"),a=e("./authCipher"),n=e("safe-buffer").Buffer,o=e("./streamCipher"),s=e("cipher-base"),c=e("./aes"),u=e("evp_bytestokey");function p(e,t,r){s.call(this),this._cache=new f,this._cipher=new c.AES(t),this._prev=n.from(r),this._mode=e,this._autopadding=!0}e("inherits")(p,s),p.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return n.concat(i)};var l=n.alloc(16,16);function f(){this.cache=n.allocUnsafe(0)}function h(e,t,r){var s=i[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=n.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=n.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new o(s.module,t,r):"auth"===s.type?new a(s.module,t,r):new p(s.module,t,r)}p.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},p.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=n.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=n.allocUnsafe(e),r=-1;++r>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t0;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=n(a)},o.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,a],16)),this.ghash(n([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":314}],84:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],85:[function(e,t,r){var i=e("buffer-xor");r.encrypt=function(e,t){var r=i(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var a=e._cipher.decryptBlock(t);return i(a,r)}},{"buffer-xor":109}],86:[function(e,t,r){var i=e("safe-buffer").Buffer,a=e("buffer-xor");function n(e,t,r){var n=t.length,o=a(t,e._cache);return e._cache=e._cache.slice(n),e._prev=i.concat([e._prev,r?t:o]),o}r.encrypt=function(e,t,r){for(var a,o=i.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=i.allocUnsafe(0)),!(e._cache.length<=t.length)){o=i.concat([o,n(e,t,r)]);break}a=e._cache.length,o=i.concat([o,n(e,t.slice(0,a),r)]),t=t.slice(a)}return o}},{"buffer-xor":109,"safe-buffer":314}],87:[function(e,t,r){var i=e("safe-buffer").Buffer;function a(e,t,r){for(var i,a,o=-1,s=0;++o<8;)i=t&1<<7-o?128:0,s+=(128&(a=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=n(e._prev,r?i:a);return s}function n(e,t){var r=e.length,a=-1,n=i.allocUnsafe(e.length);for(e=i.concat([e,i.from([t])]);++a>7;return n}r.encrypt=function(e,t,r){for(var n=t.length,o=i.allocUnsafe(n),s=-1;++s=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new i(a(t));return r}t.exports=n,n.getr=o}).call(this,e("buffer").Buffer)},{"bn.js":75,buffer:110,randombytes:280}],99:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":100}],100:[function(e,t,r){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],101:[function(e,t,r){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],102:[function(e,t,r){(function(r){var i=e("create-hash"),a=e("stream"),n=e("inherits"),o=e("./sign"),s=e("./verify"),c=e("./algorithms.json");function u(e){a.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function p(e){a.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){return new u(e)}function f(e){return new p(e)}Object.keys(c).forEach(function(e){c[e].id=new r(c[e].id,"hex"),c[e.toLowerCase()]=c[e]}),n(u,a.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=new r(e,t)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),i=o(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},n(p,a.Writable),p.prototype._write=function(e,t,r){this._hash.update(e),r()},p.prototype.update=function(e,t){return"string"==typeof e&&(e=new r(e,t)),this._hash.update(e),this},p.prototype.verify=function(e,t,i){"string"==typeof t&&(t=new r(t,i)),this.end();var a=this._hash.digest();return s(t,a,e,this._signType,this._tag)},t.exports={Sign:l,Verify:f,createSign:l,createVerify:f}}).call(this,e("buffer").Buffer)},{"./algorithms.json":100,"./sign":103,"./verify":104,buffer:110,"create-hash":117,inherits:205,stream:350}],103:[function(e,t,r){(function(r){var i=e("create-hmac"),a=e("browserify-rsa"),n=e("elliptic").ec,o=e("bn.js"),s=e("parse-asn1"),c=e("./curves.json");function u(e,t,a,n){if((e=new r(e.toArray())).length0&&r.ishrn(i),r}function l(e,t,a){var n,o;do{for(n=new r(0);8*n.length=t)throw new Error("invalid sig")}t.exports=function(e,t,c,u,p){var l=n(c);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=o[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new a(i),s=r.data.subjectPrivateKey.data;return n.verify(t,e,s)}(e,t,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var a=r.data.p,o=r.data.q,c=r.data.g,u=r.data.pub_key,p=n.signature.decode(e,"der"),l=p.s,f=p.r;s(l,o),s(f,o);var h=i.mont(a),d=l.invm(o);return 0===c.toRed(h).redPow(new i(t).mul(d).mod(o)).fromRed().mul(u.toRed(h).redPow(f.mul(d).mod(o)).fromRed()).mod(a).mod(o).cmp(f)}(e,t,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");t=r.concat([p,t]);for(var f=l.modulus.byteLength(),h=[1],d=0;t.length+h.length+2r.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}p.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,a(this.init_done,"close before init"),a(this.mode<=r.UNZIP),this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||s.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},p.prototype.write=function(e,t,r,i,a,n,o){return this._write(!0,e,t,r,i,a,n,o)},p.prototype.writeSync=function(e,t,r,i,a,n,o){return this._write(!1,e,t,r,i,a,n,o)},p.prototype._write=function(e,n,o,s,c,u,p,l){if(a.equal(arguments.length,8),a(this.init_done,"write before init"),a(this.mode!==r.NONE,"already finalized"),a.equal(!1,this.write_in_progress,"write already in progress"),a.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,a.equal(!1,void 0===n,"must provide flush value"),this.write_in_progress=!0,n!==r.Z_NO_FLUSH&&n!==r.Z_PARTIAL_FLUSH&&n!==r.Z_SYNC_FLUSH&&n!==r.Z_FULL_FLUSH&&n!==r.Z_FINISH&&n!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=i.alloc(0),c=0,s=0),this.strm.avail_in=c,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=l,this.strm.output=u,this.strm.next_out=p,this.flush=n,!e)return this._process(),this._checkError()?this._afterSync():void 0;var f=this;return t.nextTick(function(){f._process(),f._after()}),this},p.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},p.prototype._process=function(){var e=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=r.GUNZIP):this.mode=r.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===r.Z_DATA_ERROR&&(this.err=r.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===r.GUNZIP&&this.err===r.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},p.prototype._checkError=function(){switch(this.err){case r.Z_OK:case r.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===r.Z_FINISH)return this._error("unexpected end of file"),!1;break;case r.Z_STREAM_END:break;case r.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},p.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},p.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},p.prototype.init=function(e,t,i,n,o){a(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),a(e>=8&&e<=15,"invalid windowBits"),a(t>=-1&&t<=9,"invalid compression level"),a(i>=1&&i<=9,"invalid memlevel"),a(n===r.Z_FILTERED||n===r.Z_HUFFMAN_ONLY||n===r.Z_RLE||n===r.Z_FIXED||n===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,i,n,o),this._setDictionary()},p.prototype.params=function(){throw new Error("deflateParams Not supported")},p.prototype.reset=function(){this._reset(),this._setDictionary()},p.prototype._init=function(e,t,i,a,c){switch(this.level=e,this.windowBits=t,this.memLevel=i,this.strategy=a,this.flush=r.Z_NO_FLUSH,this.err=r.Z_OK,this.mode!==r.GZIP&&this.mode!==r.GUNZIP||(this.windowBits+=16),this.mode===r.UNZIP&&(this.windowBits+=32),this.mode!==r.DEFLATERAW&&this.mode!==r.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new n,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==r.Z_OK&&this._error("Init error"),this.dictionary=c,this.write_in_progress=!1,this.init_done=!0},p.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==r.Z_OK&&this._error("Failed to set dictionary")}},p.prototype._reset=function(){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:case r.GZIP:this.err=o.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=p}).call(this,e("_process"),e("buffer").Buffer)},{_process:263,assert:65,buffer:110,"pako/lib/zlib/constants":241,"pako/lib/zlib/deflate.js":243,"pako/lib/zlib/inflate.js":245,"pako/lib/zlib/zstream":249}],106:[function(e,t,r){(function(t){"use strict";var i=e("buffer").Buffer,a=e("stream").Transform,n=e("./binding"),o=e("util"),s=e("assert").ok,c=e("buffer").kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";n.Z_MIN_WINDOWBITS=8,n.Z_MAX_WINDOWBITS=15,n.Z_DEFAULT_WINDOWBITS=15,n.Z_MIN_CHUNK=64,n.Z_MAX_CHUNK=1/0,n.Z_DEFAULT_CHUNK=16384,n.Z_MIN_MEMLEVEL=1,n.Z_MAX_MEMLEVEL=9,n.Z_DEFAULT_MEMLEVEL=8,n.Z_MIN_LEVEL=-1,n.Z_MAX_LEVEL=9,n.Z_DEFAULT_LEVEL=n.Z_DEFAULT_COMPRESSION;for(var p=Object.keys(n),l=0;l=c?o=new RangeError(u):t=i.concat(a,n),a=[],e.close(),r(o,t)}e.on("error",function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)}),e.on("end",s),e.end(t),o()}function v(e,t){if("string"==typeof t&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function y(e){if(!(this instanceof y))return new y(e);A.call(this,e,n.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);A.call(this,e,n.INFLATE)}function k(e){if(!(this instanceof k))return new k(e);A.call(this,e,n.GZIP)}function _(e){if(!(this instanceof _))return new _(e);A.call(this,e,n.GUNZIP)}function x(e){if(!(this instanceof x))return new x(e);A.call(this,e,n.DEFLATERAW)}function j(e){if(!(this instanceof j))return new j(e);A.call(this,e,n.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);A.call(this,e,n.UNZIP)}function E(e){return e===n.Z_NO_FLUSH||e===n.Z_PARTIAL_FLUSH||e===n.Z_SYNC_FLUSH||e===n.Z_FULL_FLUSH||e===n.Z_FINISH||e===n.Z_BLOCK}function A(e,t){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||r.Z_DEFAULT_CHUNK,a.call(this,e),e.flush&&!E(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!E(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||n.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:n.Z_FINISH,e.chunkSize&&(e.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=r.Z_FILTERED&&e.strategy!=r.Z_HUFFMAN_ONLY&&e.strategy!=r.Z_RLE&&e.strategy!=r.Z_FIXED&&e.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!i.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new n.Zlib(t);var s=this;this._hadError=!1,this._handle.onerror=function(e,t){F(s),s._hadError=!0;var i=new Error(e);i.errno=t,i.code=r.codes[t],s.emit("error",i)};var c=r.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(c=e.level);var u=r.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||r.Z_DEFAULT_WINDOWBITS,c,e.memLevel||r.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=c,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function F(e,r){r&&t.nextTick(r),e._handle&&(e._handle.close(),e._handle=null)}function P(e){e.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),r.Deflate=y,r.Inflate=w,r.Gzip=k,r.Gunzip=_,r.DeflateRaw=x,r.InflateRaw=j,r.Unzip=S,r.createDeflate=function(e){return new y(e)},r.createInflate=function(e){return new w(e)},r.createDeflateRaw=function(e){return new x(e)},r.createInflateRaw=function(e){return new j(e)},r.createGzip=function(e){return new k(e)},r.createGunzip=function(e){return new _(e)},r.createUnzip=function(e){return new S(e)},r.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new y(t),e,r)},r.deflateSync=function(e,t){return v(new y(t),e)},r.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new k(t),e,r)},r.gzipSync=function(e,t){return v(new k(t),e)},r.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new x(t),e,r)},r.deflateRawSync=function(e,t){return v(new x(t),e)},r.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new S(t),e,r)},r.unzipSync=function(e,t){return v(new S(t),e)},r.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new w(t),e,r)},r.inflateSync=function(e,t){return v(new w(t),e)},r.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new _(t),e,r)},r.gunzipSync=function(e,t){return v(new _(t),e)},r.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new j(t),e,r)},r.inflateRawSync=function(e,t){return v(new j(t),e)},o.inherits(A,a),A.prototype.params=function(e,i,a){if(er.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(i!=r.Z_FILTERED&&i!=r.Z_HUFFMAN_ONLY&&i!=r.Z_RLE&&i!=r.Z_FIXED&&i!=r.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+i);if(this._level!==e||this._strategy!==i){var o=this;this.flush(n.Z_SYNC_FLUSH,function(){s(o._handle,"zlib binding closed"),o._handle.params(e,i),o._hadError||(o._level=e,o._strategy=i,a&&a())})}else t.nextTick(a)},A.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},A.prototype._flush=function(e){this._transform(i.alloc(0),"",e)},A.prototype.flush=function(e,r){var a=this,o=this._writableState;("function"==typeof e||void 0===e&&!r)&&(r=e,e=n.Z_FULL_FLUSH),o.ended?r&&t.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",function(){return a.flush(e,r)}):(this._flushFlag=e,this.write(i.alloc(0),"",r))},A.prototype.close=function(e){F(this,e),t.nextTick(P,this)},A.prototype._transform=function(e,t,r){var a,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||i.isBuffer(e)?this._handle?(s?a=this._finishFlushFlag:(a=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||n.Z_NO_FLUSH)),void this._processChunk(e,a,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},A.prototype._processChunk=function(e,t,r){var a=e&&e.length,n=this._chunkSize-this._offset,o=0,p=this,l="function"==typeof r;if(!l){var f,h=[],d=0;this.on("error",function(e){f=e}),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,a,this._buffer,this._offset,n)}while(!this._hadError&&v(m[0],m[1]));if(this._hadError)throw f;if(d>=c)throw F(this),new RangeError(u);var g=i.concat(h,d);return F(this),g}s(this._handle,"zlib binding closed");var b=this._handle.write(t,e,o,a,this._buffer,this._offset,n);function v(c,u){if(this&&(this.buffer=null,this.callback=null),!p._hadError){var f=n-u;if(s(f>=0,"have should not go down"),f>0){var m=p._buffer.slice(p._offset,p._offset+f);p._offset+=f,l?p.push(m):(h.push(m),d+=m.length)}if((0===u||p._offset>=p._chunkSize)&&(n=p._chunkSize,p._offset=0,p._buffer=i.allocUnsafe(p._chunkSize)),0===u){if(o+=a-c,a=c,!l)return!0;var g=p._handle.write(t,e,o,a,p._buffer,p._offset,p._chunkSize);return g.callback=v,void(g.buffer=e)}if(!l)return!1;r()}}b.buffer=e,b.callback=v},o.inherits(y,A),o.inherits(w,A),o.inherits(k,A),o.inherits(_,A),o.inherits(x,A),o.inherits(j,A),o.inherits(S,A)}).call(this,e("_process"))},{"./binding":105,_process:263,assert:65,buffer:110,stream:350,util:388}],107:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],108:[function(e,t,r){(function(e){!function(i){var a="object"==typeof r&&r&&!r.nodeType&&r,n="object"==typeof t&&t&&!t.nodeType&&t,o="object"==typeof e&&e;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,c,u=2147483647,p=36,l=1,f=26,h=38,d=700,m=72,g=128,b="-",v=/^xn--/,y=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=p-l,x=Math.floor,j=String.fromCharCode;function S(e){throw new RangeError(k[e])}function E(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function A(e,t){var r=e.split("@"),i="";return r.length>1&&(i=r[0]+"@",e=r[1]),i+E((e=e.replace(w,".")).split("."),t).join(".")}function F(e){for(var t,r,i=[],a=0,n=e.length;a=55296&&t<=56319&&a65535&&(t+=j((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function z(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function C(e,t,r){var i=0;for(e=r?x(e/d):e>>1,e+=x(e/t);e>_*f>>1;i+=p)e=x(e/_);return x(i+(_+1)*e/(e+h))}function O(e){var t,r,i,a,n,o,s,c,h,d,v,y=[],w=e.length,k=0,_=g,j=m;for((r=e.lastIndexOf(b))<0&&(r=0),i=0;i=128&&S("not-basic"),y.push(e.charCodeAt(i));for(a=r>0?r+1:0;a=w&&S("invalid-input"),((c=(v=e.charCodeAt(a++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:p)>=p||c>x((u-k)/o))&&S("overflow"),k+=c*o,!(c<(h=s<=j?l:s>=j+f?f:s-j));s+=p)o>x(u/(d=p-h))&&S("overflow"),o*=d;j=C(k-n,t=y.length+1,0==n),x(k/t)>u-_&&S("overflow"),_+=x(k/t),k%=t,y.splice(k++,0,_)}return P(y)}function T(e){var t,r,i,a,n,o,s,c,h,d,v,y,w,k,_,E=[];for(y=(e=F(e)).length,t=g,r=0,n=m,o=0;o=t&&vx((u-r)/(w=i+1))&&S("overflow"),r+=(s-t)*w,t=s,o=0;ou&&S("overflow"),v==t){for(c=r,h=p;!(c<(d=h<=n?l:h>=n+f?f:h-n));h+=p)_=c-d,k=p-d,E.push(j(z(d+_%k,0))),c=x(_/k);E.push(j(z(c,0))),n=C(r,w,i==a),r=0,++i}++r,++t}return E.join("")}if(s={version:"1.4.1",ucs2:{decode:F,encode:P},decode:O,encode:T,toASCII:function(e){return A(e,function(e){return y.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return A(e,function(e){return v.test(e)?O(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return s});else if(a&&n)if(t.exports==a)n.exports=s;else for(c in s)s.hasOwnProperty(c)&&(a[c]=s[c]);else i.punycode=s}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],109:[function(e,t,r){(function(e){t.exports=function(t,r){for(var i=Math.min(t.length,r.length),a=new e(i),n=0;no)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,t.prototype),r}function t(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return c(e,t,r)}function c(e,r,i){if("string"==typeof e)return function(e,r){"string"==typeof r&&""!==r||(r="utf8");if(!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var i=0|h(e,r),a=s(i),n=a.write(e,r);n!==i&&(a=a.slice(0,n));return a}(e,r);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return function(e,r,i){if(r<0||e.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function h(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===i)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(e).length;default:if(n)return a?-1:R(e).length;r=(""+r).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,r,i,a,n){if(0===e.length)return-1;if("string"==typeof i?(a=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),L(i=+i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof r&&(r=t.from(r,a)),t.isBuffer(r))return 0===r.length?-1:g(e,r,i,a,n);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,r,i):Uint8Array.prototype.lastIndexOf.call(e,r,i):g(e,[r],i,a,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,a){var n,o=1,s=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var p=-1;for(n=r;ns&&(r=s-c),n=r;n>=0;n--){for(var l=!0,f=0;fa&&(i=a):i=a;var n=t.length;i>n/2&&(i=n/2);for(var o=0;o>8,a=r%256,n.push(a),n.push(i);return n}(t,e.length-r),e,r,i)}function x(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function j(e,t,r){r=Math.min(e.length,r);for(var i=[],a=t;a239?4:u>223?3:u>191?2:1;if(a+l<=r)switch(l){case 1:u<128&&(p=u);break;case 2:128==(192&(n=e[a+1]))&&(c=(31&u)<<6|63&n)>127&&(p=c);break;case 3:n=e[a+1],o=e[a+2],128==(192&n)&&128==(192&o)&&(c=(15&u)<<12|(63&n)<<6|63&o)>2047&&(c<55296||c>57343)&&(p=c);break;case 4:n=e[a+1],o=e[a+2],s=e[a+3],128==(192&n)&&128==(192&o)&&128==(192&s)&&(c=(15&u)<<18|(63&n)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(p=c)}null===p?(p=65533,l=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|1023&p),i.push(p),a+=l}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return j(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},n&&(t.prototype[n]=t.prototype.inspect),t.prototype.compare=function(e,r,i,a,n){if(D(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=0),void 0===i&&(i=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),r<0||i>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&r>=i)return 0;if(a>=n)return-1;if(r>=i)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(a>>>=0),s=(i>>>=0)-(r>>>=0),c=Math.min(o,s),u=this.slice(a,n),p=e.slice(r,i),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function E(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;ai)&&(r=i);for(var a="",n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function C(e,r,i,a,n,o){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||re.length)throw new RangeError("Index out of range")}function O(e,t,r,i,a,n){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return t=+t,r>>>=0,n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return t=+t,r>>>=0,n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}t.prototype.slice=function(e,r){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(r=void 0===r?i:~~r)<0?(r+=i)<0&&(r=0):r>i&&(r=i),r>>=0,t>>>=0,r||z(e,t,this.length);for(var i=this[e],a=1,n=0;++n>>=0,t>>>=0,r||z(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},t.prototype.readUInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||z(e,t,this.length);for(var i=this[e],a=1,n=0;++n=(a*=128)&&(i-=Math.pow(2,8*t)),i},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||z(e,t,this.length);for(var i=t,a=1,n=this[e+--i];i>0&&(a*=256);)n+=this[e+--i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},t.prototype.readInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||z(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||z(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||z(e,4,this.length),a.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||z(e,4,this.length),a.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||z(e,8,this.length),a.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||z(e,8,this.length),a.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,i){(e=+e,t>>>=0,r>>>=0,i)||C(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,n=0;for(this[t]=255&e;++n>>=0,r>>>=0,i)||C(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,n=1;for(this[t+a]=255&e;--a>=0&&(n*=256);)this[t+a]=e/n&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*r-1);C(this,e,t,r,a-1,-a)}var n=0,o=1,s=0;for(this[t]=255&e;++n>0)-s&255;return t+r},t.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*r-1);C(this,e,t,r,a-1,-a)}var n=r-1,o=1,s=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o>>0)-s&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},t.prototype.copy=function(e,r,i,a){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),a||0===a||(a=this.length),r>=e.length&&(r=e.length),r||(r=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-r=0;--o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,a),r);return n},t.prototype.fill=function(e,r,i,a){if("string"==typeof e){if("string"==typeof r?(a=r,r=0,i=this.length):"string"==typeof i&&(a=i,i=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!t.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===e.length){var n=e.charCodeAt(0);("utf8"===a&&n<128||"latin1"===a)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(r<0||this.length>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(o=r;o55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&n.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&n.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function q(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function L(e){return e!=e}var N=function(){for(var e=new Array(256),t=0;t<16;++t)for(var r=16*t,i=0;i<16;++i)e[r+i]="0123456789abcdef"[t]+"0123456789abcdef"[i];return e}()}).call(this,e("buffer").Buffer)},{"base64-js":72,buffer:110,ieee754:204}],111:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],112:[function(e,t,r){function i(e){this.dict=e||{}}i.prototype.set=function(e,t,r){if("object"!=typeof e){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var a in e)this.set(a,e[a],t)},i.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.lengths?t=e(t):t.length=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(a())}).call(this,e("_process"))},{"./debug":123,_process:263}],123:[function(e,t,r){var i;function a(e){function t(){if(t.enabled){var e=t,a=+new Date,n=a-(i||a);e.diff=n,e.prev=i,e.curr=a,i=a;for(var o=new Array(arguments.length),s=0;s0;i--)t+=this._buffer(e,t),r+=this._flushBuffer(a,r);return t+=this._buffer(e,t),a},a.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},a.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];r=o.r28shl(r,s),a=o.r28shl(a,s),o.pc2(r,a,e.keys,n)}},u.prototype._update=function(e,t,r,i){var a=this._desState,n=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(n,s,a.tmp,0),n=a.tmp[0],s=a.tmp[1],"encrypt"===this.type?this._encrypt(a,n,s,a.tmp,0):this._decrypt(a,n,s,a.tmp,0),n=a.tmp[0],s=a.tmp[1],o.writeUInt32BE(r,n,i),o.writeUInt32BE(r,s,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,n=f}o.rip(s,n,i,a)},u.prototype._decrypt=function(e,t,r,i,a){for(var n=r,s=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],p=e.keys[c+1];o.expand(n,e.tmp,0),u^=e.tmp[0],p^=e.tmp[1];var l=o.substitute(u,p),f=n;n=(s^o.permute(l))>>>0,s=f}o.rip(n,s,i,a)}},{"../des":125,inherits:205,"minimalistic-assert":233}],129:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),a=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){i.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),a=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:a}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:a}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}a(u,o),t.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var a=this._edeState;a.ciphers[0]._update(e,t,r,i),a.ciphers[1]._update(r,i,r,i),a.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":125,inherits:205,"minimalistic-assert":233}],130:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var a=0,n=0,o=6;o>=0;o-=2){for(var s=0;s<=24;s+=8)a<<=1,a|=t>>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>>s+o&1}for(o=6;o>=0;o-=2){for(s=1;s<=25;s+=8)n<<=1,n|=t>>>s+o&1;for(s=1;s<=25;s+=8)n<<=1,n|=e>>>s+o&1}r[i+0]=a>>>0,r[i+1]=n>>>0},r.rip=function(e,t,r,i){for(var a=0,n=0,o=0;o<4;o++)for(var s=24;s>=0;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;s>=0;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;r[i+0]=a>>>0,r[i+1]=n>>>0},r.pc1=function(e,t,r,i){for(var a=0,n=0,o=7;o>=5;o--){for(var s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1;r[i+0]=a>>>0,r[i+1]=n>>>0},r.r28shl=function(e,t){return e<>>28-t};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,a){for(var n=0,o=0,s=i.length>>>1,c=0;c>>i[c]&1;for(c=s;c>>i[c]&1;r[a+0]=n>>>0,r[a+1]=o>>>0},r.expand=function(e,t,r){var i=0,a=0;i=(1&e)<<5|e>>>27;for(var n=23;n>=15;n-=4)i<<=6,i|=e>>>n&63;for(n=11;n>=3;n-=4)a|=e>>>n&63,a<<=6;a|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=a>>>0};var a=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=a[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=a[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>n[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;r.mod(p).cmp(l);)r.iadd(h)}else for(;r.mod(n).cmp(f);)r.iadd(h);if(g(d=r.shrn(1))&&g(r)&&b(d)&&b(r)&&o.test(d)&&o.test(r))return r}}},{"bn.js":75,"miller-rabin":229,randombytes:280}],134:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],135:[function(e,t,r){var i=e("crypto"),a=e("jsbn").BigInteger,n=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function o(e,t){return e.length>=t?e:o("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var s,c=e(),u=c.getN(),p=Math.floor(u.bitLength()/8);if(t)if(r){e=c.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=p)return!1;s=new a(t.toString("hex"),16)}else{var l=u.subtract(a.ONE),f=new a(i.randomBytes(u.bitLength()));s=f.mod(l).add(a.ONE),this.P=c.getG().multiply(s)}this.P&&(this.PublicKey=n.from(c.getCurve().encodeCompressedPointHex(this.P),"hex")),s&&(this.PrivateKey=n.from(o(s.toString(16),2*p),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(s);return n.from(o(t.getX().toBigInteger().toString(16),2*p),"hex")})}},{"./lib/ec.js":136,"./lib/sec.js":137,crypto:121,jsbn:210,"safer-buffer":315}],136:[function(e,t,r){var i=e("jsbn").BigInteger,a=i.prototype.Barrett;function n(e,t){this.x=t,this.q=e}function o(e,t,r,a){this.curve=e,this.x=t,this.y=r,this.z=null==a?i.ONE:a,this.zinv=null}function s(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new o(this,null,null),this.reducer=new a(this.q)}n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},n.prototype.toBigInteger=function(){return this.x},n.prototype.negate=function(){return new n(this.q,this.x.negate().mod(this.q))},n.prototype.add=function(e){return new n(this.q,this.x.add(e.toBigInteger()).mod(this.q))},n.prototype.subtract=function(e){return new n(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},n.prototype.multiply=function(e){return new n(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},n.prototype.square=function(){return new n(this.q,this.x.square().mod(this.q))},n.prototype.divide=function(e){return new n(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},o.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},o.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},o.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(i.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(i.ZERO))},o.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(i.ZERO)&&!this.y.toBigInteger().equals(i.ZERO)},o.prototype.negate=function(){return new o(this.curve,this.x,this.y.negate(),this.z)},o.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(i.ZERO.equals(r))return i.ZERO.equals(t)?this.twice():this.curve.getInfinity();var a=new i("3"),n=this.x.toBigInteger(),s=this.y.toBigInteger(),c=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),u=c.multiply(r),p=n.multiply(c),l=t.square().multiply(this.z),f=l.subtract(p.shiftLeft(1)).multiply(e.z).subtract(u).multiply(r).mod(this.curve.q),h=p.multiply(a).multiply(t).subtract(s.multiply(u)).subtract(l.multiply(t)).multiply(e.z).add(t.multiply(u)).mod(this.curve.q),d=u.multiply(this.z).multiply(e.z).mod(this.curve.q);return new o(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(h),d)},o.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new i("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),a=r.multiply(this.z),n=a.multiply(r).mod(this.curve.q),s=this.curve.a.toBigInteger(),c=t.square().multiply(e);i.ZERO.equals(s)||(c=c.add(this.z.square().multiply(s)));var u=(c=c.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(a).mod(this.curve.q),p=c.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(c.square().multiply(c)).mod(this.curve.q),l=a.square().multiply(a).shiftLeft(3).mod(this.curve.q);return new o(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(p),l)},o.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,a=r.multiply(new i("3")),n=this.negate(),o=this;for(t=a.bitLength()-2;t>0;--t){o=o.twice();var s=a.testBit(t);s!=r.testBit(t)&&(o=o.add(s?this:n))}return o},o.prototype.multiplyTwo=function(e,t,r){var i;i=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var a=this.curve.getInfinity(),n=this.add(t);i>=0;)a=a.twice(),e.testBit(i)?a=r.testBit(i)?a.add(n):a.add(this):r.testBit(i)&&(a=a.add(t)),--i;return a},s.prototype.getQ=function(){return this.q},s.prototype.getA=function(){return this.a},s.prototype.getB=function(){return this.b},s.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},s.prototype.getInfinity=function(){return this.infinity},s.prototype.fromBigInteger=function(e){return new n(this.q,e)},s.prototype.reduce=function(e){this.reducer.reduce(e)},s.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.length128&&(-1==this.q.shiftRight(e-64).intValue()&&(this.r=i.ONE.shiftLeft(e).subtract(this.q)));return this.r},n.prototype.modMult=function(e,t){return this.modReduce(e.multiply(t))},n.prototype.modReduce=function(e){if(null!=this.getR()){for(var t=q.bitLength();e.bitLength()>t+1;){var r=e.shiftRight(t),a=e.subtract(r.shiftLeft(t));this.getR().equals(i.ONE)||(r=r.multiply(this.getR())),e=r.add(a)}for(;e.compareTo(q)>=0;)e=e.subtract(q)}else e=e.mod(q);return e},n.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new n(this.q,this.x.modPow(this.q.shiftRight(2).add(i.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(i.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(i.ONE))return null;var a,o,s=t.shiftRight(2).shiftLeft(1).add(i.ONE),c=this.x,u=modDouble(modDouble(c));do{var p;do{p=new i(this.q.bitLength(),new SecureRandom)}while(p.compareTo(this.q)>=0||!p.multiply(p).subtract(u).modPow(r,this.q).equals(t));var l=this.lucasSequence(p,c,s);if(a=l[0],o=l[1],this.modMult(o,o).equals(u))return o.testBit(0)&&(o=o.add(q)),o=o.shiftRight(1),new n(q,o)}while(a.equals(i.ONE)||a.equals(t));return null},n.prototype.lucasSequence=function(e,t,r){for(var a=r.bitLength(),n=r.getLowestSetBit(),o=i.ONE,s=i.TWO,c=e,u=i.ONE,p=i.ONE,l=a-1;l>=n+1;--l)u=this.modMult(u,p),r.testBit(l)?(p=this.modMult(u,t),o=this.modMult(o,c),s=this.modReduce(c.multiply(s).subtract(e.multiply(u))),c=this.modReduce(c.multiply(c).subtract(p.shiftLeft(1)))):(p=u,o=this.modReduce(o.multiply(s).subtract(u)),c=this.modReduce(c.multiply(s).subtract(e.multiply(u))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1))));u=this.modMult(u,p),p=this.modMult(u,t),o=this.modReduce(o.multiply(s).subtract(u)),s=this.modReduce(c.multiply(s).subtract(e.multiply(u))),u=this.modMult(u,p);for(l=1;l<=n;++l)o=this.modMult(o,s),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1))),u=this.modMult(u,u);return[o,s]};r={ECCurveFp:s,ECPointFp:o,ECFieldElementFp:n};t.exports=r},{jsbn:210}],137:[function(e,t,r){var i=e("jsbn").BigInteger,a=e("./ec.js").ECCurveFp;function n(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function o(e){return new i(e,16)}function s(){var e=o("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=o("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=o("E87579C11079F43DD824993C2CEE5ED3"),s=o("FFFFFFFE0000000075A30D1B9038A115"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");return new n(u,p,s,c)}function c(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=i.ZERO,r=o("7"),s=o("0100000000000000000001B8FA16DFAB9ACA16B6B3"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");return new n(u,p,s,c)}function u(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=o("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),s=o("0100000000000000000001F4C8F927AED3CA752257"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");return new n(u,p,s,c)}function p(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=i.ZERO,r=o("3"),s=o("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");return new n(u,p,s,c)}function l(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=o("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),s=o("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");return new n(u,p,s,c)}function f(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=o("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),s=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");return new n(u,p,s,c)}function h(){var e=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=o("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),s=o("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),c=i.ONE,u=new a(e,t,r),p=u.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");return new n(u,p,s,c)}n.prototype.getCurve=function(){return this.curve},n.prototype.getG=function(){return this.g},n.prototype.getN=function(){return this.n},n.prototype.getH=function(){return this.h},t.exports={secp128r1:s,secp160k1:c,secp160r1:u,secp192k1:p,secp192r1:l,secp224r1:f,secp256r1:h}},{"./ec.js":136,jsbn:210}],138:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":153,"./elliptic/curve":141,"./elliptic/curves":144,"./elliptic/ec":145,"./elliptic/eddsa":148,"./elliptic/utils":152,brorand:76}],139:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("../utils"),n=a.getNAF,o=a.getJSF,s=a.assert;function c(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),i=n(t,1),a=(1<=c;t--)u=(u<<1)+i[t];o.push(u)}for(var p=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=a;f>0;f--){for(c=0;c=0;u--){for(t=0;u>=0&&0===o[u];u--)t++;if(u>=0&&t++,c=c.dblp(t),u<0)break;var p=o[u];s(0!==p),c="affine"===e.type?p>0?c.mixedAdd(a[p-1>>1]):c.mixedAdd(a[-p-1>>1].neg()):p>0?c.add(a[p-1>>1]):c.add(a[-p-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,i,a){for(var s=this._wnafT1,c=this._wnafT2,u=this._wnafT3,p=0,l=0;l=1;l-=2){var h=l-1,d=l;if(1===s[h]&&1===s[d]){var m=[t[h],null,null,t[d]];0===t[h].y.cmp(t[d].y)?(m[1]=t[h].add(t[d]),m[2]=t[h].toJ().mixedAdd(t[d].neg())):0===t[h].y.cmp(t[d].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[d]),m[2]=t[h].add(t[d].neg())):(m[1]=t[h].toJ().mixedAdd(t[d]),m[2]=t[h].toJ().mixedAdd(t[d].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=o(r[h],r[d]);p=Math.max(b[0].length,p),u[h]=new Array(p),u[d]=new Array(p);for(var v=0;v=0;l--){for(var x=0;l>=0;){var j=!0;for(v=0;v=0&&x++,k=k.dblp(x),l<0)break;for(v=0;v0?S=c[v][E-1>>1]:E<0&&(S=c[v][-E-1>>1].neg()),k="affine"===S.type?k.mixedAdd(S):k.add(S))}}for(l=0;l=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,a=0;a":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),n=i.redAdd(t),o=n.redSub(r),s=i.redSub(t),c=a.redMul(o),u=n.redMul(s),p=a.redMul(s),l=o.redMul(n);return this.curve.point(c,u,l,p)},u.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),n=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(a)).redAdd(n);if(this.zOne)e=i.redSub(a).redSub(n).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(n)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(a).redISub(n).redMul(c),t=o.redMul(u.redSub(n)),r=o.redMul(c)}}else{var u=a.redAdd(n);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(a.redISub(n)),r=u.redMul(c)}return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),n=r.redSub(t),o=a.redSub(i),s=a.redAdd(i),c=r.redAdd(t),u=n.redMul(o),p=s.redMul(c),l=n.redMul(c),f=o.redMul(s);return this.curve.point(u,p,f,l)},u.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),a=i.redSqr(),n=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(n).redMul(o),c=a.redSub(s),u=a.redAdd(s),p=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(o),l=i.redMul(c).redMul(p);return this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(n))),r=c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(n)),r=this.curve._mulC(c).redMul(u)),this.curve.point(l,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},{"../utils":152,"./base":139,"bn.js":75,inherits:205}],141:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":139,"./edwards":140,"./mont":142,"./short":143}],142:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("inherits"),n=e("./base"),o=e("../utils");function s(e){n.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){n.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,n),t.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},a(c,n.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),a=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,a)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),n=e.x.redSub(e.z).redMul(r),o=a.redMul(i),s=t.z.redMul(n.redAdd(o).redSqr()),c=t.x.redMul(n.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var n=a.length-1;n>=0;n--)0===a[n]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":152,"./base":139,"bn.js":75,inherits:205}],143:[function(e,t,r){"use strict";var i=e("../utils"),a=e("bn.js"),n=e("inherits"),o=e("./base"),s=i.assert;function c(e){o.call(this,"short",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(t,16),this.y=new a(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function p(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(t,16),this.y=new a(r,16),this.z=new a(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}n(c,o),t.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new a(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new a(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new a(e.a,16),b:new a(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:a.mont(e),r=new a(2).toRed(t).redInvm(),i=r.redNeg(),n=new a(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,s,c,u,p,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new a(1),m=new a(0),g=new a(0),b=new a(1),v=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),p=g.sub(y.mul(d));var w=b.sub(y.mul(m));if(!i&&u.cmp(l)<0)t=c.neg(),r=d,i=u.neg(),n=p;else if(i&&2==++v)break;c=u,h=f,f=u,g=d,d=p,b=m,m=w}o=u.neg(),s=p;var k=i.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(k)>=0&&(o=t,s=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:i,b:n},{a:o,b:s}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],a=i.b.mul(e).divRound(this.n),n=r.b.neg().mul(e).divRound(this.n),o=a.mul(r.a),s=n.mul(i.a),c=a.mul(r.b),u=n.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(a).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,a=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),a=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),n=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var i=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)},u.prototype.jmulAdd=function(e,t,r){var i=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(p,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new p(this,e,t,r)},p.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},p.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},p.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),a=e.x.redMul(r),n=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(a),c=n.redSub(o);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),p=u.redMul(s),l=i.redMul(u),f=c.redSqr().redIAdd(p).redISub(l).redISub(l),h=c.redMul(l.redISub(f)).redISub(n.redMul(p)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,h,d)},p.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),a=this.y,n=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=a.redSub(n);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),p=r.redMul(c),l=s.redSqr().redIAdd(u).redISub(p).redISub(p),f=s.redMul(p.redISub(l)).redISub(a.redMul(u)),h=this.z.redMul(o);return this.curve.jpoint(l,f,h)},p.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(a),0===this.x.cmp(r))return!0}},p.prototype.inspect=function(){return this.isInfinity()?"":""},p.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":152,"./base":139,"bn.js":75,inherits:205}],144:[function(e,t,r){"use strict";var i,a=r,n=e("hash.js"),o=e("./curve"),s=e("./utils").assert;function c(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:r}),r}})}a.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"./curve":141,"./precomputed/secp256k1":151,"./utils":152,"hash.js":185}],145:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("hmac-drbg"),n=e("../utils"),o=e("../curves"),s=e("brorand"),c=n.assert,u=e("./key"),p=e("./signature");function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(c(o.hasOwnProperty(e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}t.exports=l,l.prototype.keyPair=function(e){return new u(this,e)},l.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new a({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var o=new i(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),c=e.toArray("be",o),u=new a({hash:this.hash,entropy:s,nonce:c,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new i(1)),f=0;;f++){var h=n.k?n.k(f):new i(u.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var d=this.g.mul(h);if(!d.isInfinity()){var m=d.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var b=h.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var v=(d.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),v^=1),new p({r:g,s:b,recoveryParam:v})}}}}}},l.prototype.verify=function(e,t,r,a){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,a);var n=(t=new p(t,"hex")).r,o=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,c=o.invm(this.n),u=c.mul(e).umod(this.n),l=c.mul(n).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&s.eqXToP(n):!(s=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(n)},l.prototype.recoverPubKey=function(e,t,r,a){c((3&r)===r,"The recovery param is more than two bits"),t=new p(t,a);var n=this.n,o=new i(e),s=t.r,u=t.s,l=1&r,f=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=f?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(n),d=n.sub(o).mul(h).umod(n),m=u.mul(h).umod(n);return this.g.mulAdd(d,s,m)},l.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new p(t,i)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var n;try{n=this.recoverPubKey(e,t,a)}catch(e){continue}if(n.eq(r))return a}throw new Error("Unable to find valid recovery factor")}},{"../curves":144,"../utils":152,"./key":146,"./signature":147,"bn.js":75,brorand:76,"hmac-drbg":197}],146:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("../utils").assert;function n(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}t.exports=n,n.fromPublic=function(e,t,r){return t instanceof n?t:new n(e,{pub:t,pubEnc:r})},n.fromPrivate=function(e,t,r){return t instanceof n?t:new n(e,{priv:t,privEnc:r})},n.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},n.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?a(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||a(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},n.prototype.derive=function(e){return e.mul(this.priv).getX()},n.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},n.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},n.prototype.inspect=function(){return""}},{"../utils":152,"bn.js":75}],147:[function(e,t,r){"use strict";var i=e("bn.js"),a=e("../utils"),n=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(n(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,a=0,n=0,o=t.place;n>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}t.exports=o,o.prototype._importDER=function(e,t){e=a.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;if(c(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=c(e,r),o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var u=c(e,r);if(e.length!==u+r.place)return!1;var p=e.slice(r.place,u+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===p[0]&&128&p[1]&&(p=p.slice(1)),this.r=new i(o),this.s=new i(p),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),o=[48];return p(o,n.length),o=o.concat(n),a.encode(o,e)}},{"../utils":152,"bn.js":75}],148:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("../curves"),n=e("../utils"),o=n.assert,s=n.parseBytes,c=e("./key"),u=e("./signature");function p(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof p))return new p(e);e=a[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}t.exports=p,p.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),a=this.g.mul(i),n=this.encodePoint(a),o=this.hashInt(n,r.pubBytes(),e).mul(r.priv()),c=i.add(o).umod(this.curve.n);return this.makeSignature({R:a,S:c,Rencoded:n})},p.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),a=this.hashInt(t.Rencoded(),i.pubBytes(),e),n=this.g.mul(t.S());return t.R().add(i.pub().mul(a)).eq(n)},p.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=0;){var n;if(a.isOdd()){var o=a.andln(i-1);n=o>(i>>1)-1?(i>>1)-o:o,a.isubn(n)}else n=0;r.push(n);for(var s=0!==a.cmpn(0)&&0===a.andln(i-1)?t+1:1,c=1;c0||t.cmpn(-a)>0;){var n,o,s,c=e.andln(3)+i&3,u=t.andln(3)+a&3;3===c&&(c=-1),3===u&&(u=-1),n=0==(1&c)?0:3!=(s=e.andln(7)+i&7)&&5!==s||2!==u?c:-c,r[0].push(n),o=0==(1&u)?0:3!=(s=t.andln(7)+a&7)&&5!==s||2!==c?u:-u,r[1].push(o),2*i===n+1&&(i=1-i),2*a===o+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new a(e,"hex","le")}},{"bn.js":75,"minimalistic-assert":233,"minimalistic-crypto-utils":234}],153:[function(e,t,r){t.exports={_from:"elliptic@^6.0.0",_id:"elliptic@6.5.1",_inBundle:!1,_integrity:"sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.0.0",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.0.0",saveSpec:null,fetchSpec:"^6.0.0"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz",_shasum:"c380f5f909bf1b9b4428d028cd18d3b0efd6b52b",_spec:"elliptic@^6.0.0",_where:"W:\\projects\\git\\node-quickbase\\node_modules\\browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^3.0.4",grunt:"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.6.0",mocha:"^6.1.4"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.1"}},{}],154:[function(e,t,r){var i=Object.create||function(e){var t=function(){};return t.prototype=e,new t},a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},n=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=i(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var s,c=10;try{var u={};Object.defineProperty&&Object.defineProperty(u,"x",{value:0}),s=0===u.x}catch(e){s=!1}function p(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,a){var n,o,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]):(o=e._events=i(null),e._eventsCount=0),s){if("function"==typeof s?s=o[t]=a?[r,s]:[s,r]:a?s.unshift(r):s.push(r),!s.warned&&(n=p(e))&&n>0&&s.length>n){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",c.name,c.message)}}else s=o[t]=r,++e._eventsCount;return e}function f(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var c=new Error('Unhandled "error" event. ('+t+")");throw c.context=t,c}if(!(r=o[e]))return!1;var u="function"==typeof r;switch(i=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var i=e.length,a=g(e,i),n=0;n=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(e,t){for(var r=t,i=r+1,a=e.length;i=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],155:[function(e,t,r){var i=e("safe-buffer").Buffer,a=e("md5.js");t.exports=function(e,t,r,n){if(i.isBuffer(e)||(e=i.from(e,"binary")),t&&(i.isBuffer(t)||(t=i.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=r/8,s=i.alloc(o),c=i.alloc(n||0),u=i.alloc(0);o>0||n>0;){var p=new a;p.update(u),p.update(e),t&&p.update(t),u=p.digest();var l=0;if(o>0){var f=s.length-o;l=Math.min(o,u.length),u.copy(s,f,0,l),o-=l}if(l0){var h=c.length-n,d=Math.min(n,u.length-l);u.copy(c,h,l,l+d),n-=d}}return u.fill(0),{key:s,iv:c}}},{"md5.js":228,"safe-buffer":314}],156:[function(e,t,r){"use strict";var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},c=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,r=i.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;for(t in e);return void 0===t||i.call(e,t)},u=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},p=function(e,t){if("__proto__"===t){if(!i.call(e,t))return;if(o)return o(e,t).value}return e[t]};t.exports=function e(){var t,r,i,a,n,o,l=arguments[0],f=1,h=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},f=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});f0)throw new Error("non-zero precision not supported");switch(t.match(/-/)&&(u=!0),t.match(/0/)&&(p="0"),t.match(/\+/)&&(l=!0),o){case"s":if(null==f)throw new Error("argument "+v+": attempted to print undefined or null as a string");b+=s(p,r,u,f.toString());break;case"d":f=Math.floor(f);case"f":b+=(l=l&&f>0?"+":"")+s(p,r,u,f.toString());break;case"x":b+=s(p,r,u,f.toString(16));break;case"j":0===r&&(r=10),b+=a.inspect(f,!1,r);break;case"r":b+=c(f);break;default:throw new Error("unsupported conversion: "+o)}}else b+="%";return b+=e}function o(e){var t=Array.prototype.slice.call(arguments,1);return e.write(n.apply(this,t))}function s(e,t,r,i){for(var a=i;a.length0&&!e.useChunkedEncodingByDefault){var n=this.freeSockets[i].pop();n.removeListener("error",n._onIdleError),delete n._onIdleError,e._reusedSocket=!0,e.onSocket(n)}else this.addRequestNoreuse(e,t,r)},u.prototype.removeSocket=function(e,t,r,i){var a;this.sockets[t]?-1!==(a=this.sockets[t].indexOf(e))&&this.sockets[t].splice(a,1):this.sockets[t]&&0===this.sockets[t].length&&(delete this.sockets[t],delete this.requests[t]);this.freeSockets[t]&&(-1!==(a=this.freeSockets[t].indexOf(e))&&(this.freeSockets[t].splice(a,1),0===this.freeSockets[t].length&&delete this.freeSockets[t]));this.requests[t]&&this.requests[t].length&&this.createSocket(t,r,i).emit("free")},i.inherits(p,u),p.prototype.createConnection=function(e,t,r){r="object"==typeof e?e:"object"==typeof t?t:"object"==typeof r?r:{};"number"==typeof e&&(r.port=e);"string"==typeof t&&(r.host=t);return o.connect(r)},p.prototype.addRequestNoreuse=s.prototype.addRequest},{http:351,https:203,net:107,tls:107,util:388}],161:[function(e,t,r){t.exports="object"==typeof self?self.FormData:window.FormData},{}],162:[function(e,t,r){(function(r){"use strict";var i=function(){function e(e,t){for(var r=0;r0&&(++this._nRequests,this._pending.shift().resolve()));var t=Date.now()-this.periodLength;this._times=this._times.filter(function(e){return e>=t}).sort(),this._times.length0&&(this._times.push(Date.now()),this._pending.shift().resolve()):(this._tick&&clearTimeout(this._tick),this._tick=setTimeout(function(){e._testTick()},this._times[0]-t))}},{key:"acquire",value:function(e){return a.using(this._acquire(),function(){return e?new a(e):a.resolve()})}},{key:"clear",value:function(){return this._pending.splice(0,this._pending.length)}},{key:"flush",value:function(){return a.map(this._pending.splice(0,this._pending.length),function(e){return e.resolve()})}}]),e}();void 0!==t&&t.exports?t.exports=n:"function"==typeof define&&define.amd&&define("Throttle",[],function(){return n}),void 0!==r&&"undefined"!=typeof window&&r===window&&(r.Throttle=n)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{bluebird:74}],163:[function(e,t,r){t.exports={$id:"afterRequest.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["lastAccess","eTag","hitCount"],properties:{expires:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},lastAccess:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},eTag:{type:"string"},hitCount:{type:"integer"},comment:{type:"string"}}}},{}],164:[function(e,t,r){t.exports={$id:"beforeRequest.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["lastAccess","eTag","hitCount"],properties:{expires:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},lastAccess:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},eTag:{type:"string"},hitCount:{type:"integer"},comment:{type:"string"}}}},{}],165:[function(e,t,r){t.exports={$id:"browser.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","version"],properties:{name:{type:"string"},version:{type:"string"},comment:{type:"string"}}}},{}],166:[function(e,t,r){t.exports={$id:"cache.json#",$schema:"http://json-schema.org/draft-06/schema#",properties:{beforeRequest:{oneOf:[{type:"null"},{$ref:"beforeRequest.json#"}]},afterRequest:{oneOf:[{type:"null"},{$ref:"afterRequest.json#"}]},comment:{type:"string"}}}},{}],167:[function(e,t,r){t.exports={$id:"content.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["size","mimeType"],properties:{size:{type:"integer"},compression:{type:"integer"},mimeType:{type:"string"},text:{type:"string"},encoding:{type:"string"},comment:{type:"string"}}}},{}],168:[function(e,t,r){t.exports={$id:"cookie.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},path:{type:"string"},domain:{type:"string"},expires:{type:["string","null"],format:"date-time"},httpOnly:{type:"boolean"},secure:{type:"boolean"},comment:{type:"string"}}}},{}],169:[function(e,t,r){t.exports={$id:"creator.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","version"],properties:{name:{type:"string"},version:{type:"string"},comment:{type:"string"}}}},{}],170:[function(e,t,r){t.exports={$id:"entry.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["startedDateTime","time","request","response","cache","timings"],properties:{pageref:{type:"string"},startedDateTime:{type:"string",format:"date-time",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},time:{type:"number",min:0},request:{$ref:"request.json#"},response:{$ref:"response.json#"},cache:{$ref:"cache.json#"},timings:{$ref:"timings.json#"},serverIPAddress:{type:"string",oneOf:[{format:"ipv4"},{format:"ipv6"}]},connection:{type:"string"},comment:{type:"string"}}}},{}],171:[function(e,t,r){t.exports={$id:"har.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["log"],properties:{log:{$ref:"log.json#"}}}},{}],172:[function(e,t,r){t.exports={$id:"header.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},comment:{type:"string"}}}},{}],173:[function(e,t,r){"use strict";t.exports={afterRequest:e("./afterRequest.json"),beforeRequest:e("./beforeRequest.json"),browser:e("./browser.json"),cache:e("./cache.json"),content:e("./content.json"),cookie:e("./cookie.json"),creator:e("./creator.json"),entry:e("./entry.json"),har:e("./har.json"),header:e("./header.json"),log:e("./log.json"),page:e("./page.json"),pageTimings:e("./pageTimings.json"),postData:e("./postData.json"),query:e("./query.json"),request:e("./request.json"),response:e("./response.json"),timings:e("./timings.json")}},{"./afterRequest.json":163,"./beforeRequest.json":164,"./browser.json":165,"./cache.json":166,"./content.json":167,"./cookie.json":168,"./creator.json":169,"./entry.json":170,"./har.json":171,"./header.json":172,"./log.json":174,"./page.json":175,"./pageTimings.json":176,"./postData.json":177,"./query.json":178,"./request.json":179,"./response.json":180,"./timings.json":181}],174:[function(e,t,r){t.exports={$id:"log.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["version","creator","entries"],properties:{version:{type:"string"},creator:{$ref:"creator.json#"},browser:{$ref:"browser.json#"},pages:{type:"array",items:{$ref:"page.json#"}},entries:{type:"array",items:{$ref:"entry.json#"}},comment:{type:"string"}}}},{}],175:[function(e,t,r){t.exports={$id:"page.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["startedDateTime","id","title","pageTimings"],properties:{startedDateTime:{type:"string",format:"date-time",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},id:{type:"string",unique:!0},title:{type:"string"},pageTimings:{$ref:"pageTimings.json#"},comment:{type:"string"}}}},{}],176:[function(e,t,r){t.exports={$id:"pageTimings.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",properties:{onContentLoad:{type:"number",min:-1},onLoad:{type:"number",min:-1},comment:{type:"string"}}}},{}],177:[function(e,t,r){t.exports={$id:"postData.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",optional:!0,required:["mimeType"],properties:{mimeType:{type:"string"},text:{type:"string"},params:{type:"array",required:["name"],properties:{name:{type:"string"},value:{type:"string"},fileName:{type:"string"},contentType:{type:"string"},comment:{type:"string"}}},comment:{type:"string"}}}},{}],178:[function(e,t,r){t.exports={$id:"query.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},comment:{type:"string"}}}},{}],179:[function(e,t,r){t.exports={$id:"request.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["method","url","httpVersion","cookies","headers","queryString","headersSize","bodySize"],properties:{method:{type:"string"},url:{type:"string",format:"uri"},httpVersion:{type:"string"},cookies:{type:"array",items:{$ref:"cookie.json#"}},headers:{type:"array",items:{$ref:"header.json#"}},queryString:{type:"array",items:{$ref:"query.json#"}},postData:{$ref:"postData.json#"},headersSize:{type:"integer"},bodySize:{type:"integer"},comment:{type:"string"}}}},{}],180:[function(e,t,r){t.exports={$id:"response.json#",$schema:"http://json-schema.org/draft-06/schema#",type:"object",required:["status","statusText","httpVersion","cookies","headers","content","redirectURL","headersSize","bodySize"],properties:{status:{type:"integer"},statusText:{type:"string"},httpVersion:{type:"string"},cookies:{type:"array",items:{$ref:"cookie.json#"}},headers:{type:"array",items:{$ref:"header.json#"}},content:{$ref:"content.json#"},redirectURL:{type:"string"},headersSize:{type:"integer"},bodySize:{type:"integer"},comment:{type:"string"}}}},{}],181:[function(e,t,r){t.exports={$id:"timings.json#",$schema:"http://json-schema.org/draft-06/schema#",required:["send","wait","receive"],properties:{dns:{type:"number",min:-1},connect:{type:"number",min:-1},blocked:{type:"number",min:-1},send:{type:"number",min:-1},wait:{type:"number",min:-1},receive:{type:"number",min:-1},ssl:{type:"number",min:-1},comment:{type:"string"}}}},{}],182:[function(e,t,r){function i(e){this.name="HARError",this.message="validation failed",this.errors=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error("validation failed").stack}i.prototype=Error.prototype,t.exports=i},{}],183:[function(e,t,r){var i,a=e("ajv"),n=e("./error"),o=e("har-schema");function s(t,r){r=r||{};var s=(i=i||function(){var t=new a({allErrors:!0});return t.addMetaSchema(e("ajv/lib/refs/json-schema-draft-06.json")),t.addSchema(o),t}()).getSchema(t+".json");return new Promise(function(e,t){s(r)?e(r):t(new n(s.errors))})}r.afterRequest=function(e){return s("afterRequest",e)},r.beforeRequest=function(e){return s("beforeRequest",e)},r.browser=function(e){return s("browser",e)},r.cache=function(e){return s("cache",e)},r.content=function(e){return s("content",e)},r.cookie=function(e){return s("cookie",e)},r.creator=function(e){return s("creator",e)},r.entry=function(e){return s("entry",e)},r.har=function(e){return s("har",e)},r.header=function(e){return s("header",e)},r.log=function(e){return s("log",e)},r.page=function(e){return s("page",e)},r.pageTimings=function(e){return s("pageTimings",e)},r.postData=function(e){return s("postData",e)},r.query=function(e){return s("query",e)},r.request=function(e){return s("request",e)},r.response=function(e){return s("response",e)},r.timings=function(e){return s("timings",e)}},{"./error":182,ajv:1,"ajv/lib/refs/json-schema-draft-06.json":42,"har-schema":173}],184:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform;function n(e){a.call(this),this._block=i.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(n,a),n.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},n.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,t){if(function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(e)||(e=i.from(e,t));for(var r=this._block,a=0;this._blockOffset+e.length-a>=this._blockSize;){for(var n=this._blockOffset;n0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=n},{inherits:205,"safe-buffer":314,stream:350}],185:[function(e,t,r){var i=r;i.utils=e("./hash/utils"),i.common=e("./hash/common"),i.sha=e("./hash/sha"),i.ripemd=e("./hash/ripemd"),i.hmac=e("./hash/hmac"),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},{"./hash/common":186,"./hash/hmac":187,"./hash/ripemd":188,"./hash/sha":189,"./hash/utils":196}],186:[function(e,t,r){"use strict";var i=e("./utils"),a=e("minimalistic-assert");function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}r.BlockHash=n,n.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var a=0;a>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=255&e}else for(i[a++]=255&e,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,n=8;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":196}],196:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),a=e("inherits");function n(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=a,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a>6|192,r[i++]=63&o|128):n(e,a)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++a)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(a=0;a>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,a=0;i>>24,r[a+1]=n>>>16&255,r[a+2]=n>>>8&255,r[a+3]=255&n):(r[a+3]=n>>>24,r[a+2]=n>>>16&255,r[a+1]=n>>>8&255,r[a]=255&n)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,a){return e+t+r+i+a>>>0},r.sum64=function(e,t,r,i){var a=e[t],n=i+e[t+1]>>>0,o=(n>>0,e[t+1]=n},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,a,n,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,a,n,o,s){return t+i+n+s>>>0},r.sum64_5_hi=function(e,t,r,i,a,n,o,s,c,u){var p=0,l=t;return p+=(l=l+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,a,n,o,s,c,u){return t+i+n+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:205,"minimalistic-assert":233}],197:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}t.exports=o,o.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length=65&&E<=90||E>=97&&E<=122)k+=S;else{if("="!==S)throw new g("bad param format");if(0===k.length)throw new g("bad param format");w=f}break;case f:if('"'!==S)throw new g("bad param format");_="",w=h;break;case h:'"'===S?(x.params[k]=_,w=d):_+=S;break;case d:if(","!==S)throw new g("bad param format");k="",w=l;break;default:throw new Error("Invalid substate")}break;default:throw new Error("Invalid substate")}}if(x.params.headers&&""!==x.params.headers?x.params.headers=x.params.headers.split(" "):e.headers["x-date"]?x.params.headers=["x-date"]:x.params.headers=["date"],!x.scheme||"Signature"!==x.scheme)throw new g('scheme was not "Signature"');if(!x.params.keyId)throw new g("keyId was not specified");if(!x.params.algorithm)throw new g("algorithm was not specified");if(!x.params.signature)throw new g("signature was not specified");x.params.algorithm=x.params.algorithm.toLowerCase();try{c(x.params.algorithm)}catch(e){throw e instanceof s?new b(x.params.algorithm+" is not supported"):e}for(n=0;n1e3*t.clockSkew)throw new m("clock skew of "+z/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(x.params.headers.indexOf(e.toLowerCase())<0)throw new v(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(x.params.algorithm))throw new b(x.params.algorithm+" is not a supported algorithm");return x.algorithm=x.params.algorithm.toUpperCase(),x.keyId=x.params.keyId,x}}},{"./utils":201,"assert-plus":64,util:388}],200:[function(e,t,r){(function(r){var i=e("assert-plus"),a=e("crypto"),n=(e("http"),e("util")),o=e("sshpk"),s=e("jsprim"),c=e("./utils"),u=e("util").format,p=c.HASH_ALGOS,l=c.PK_ALGOS,f=c.InvalidAlgorithmError,h=c.HttpSignatureError,d=c.validateAlgorithm,m='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function g(e){h.call(this,e,g)}function b(e){h.call(this,e,b)}function v(e){i.object(e,"options");var t=[];if(void 0!==e.algorithm&&(i.string(e.algorithm,"options.algorithm"),t=d(e.algorithm)),this.rs_alg=t,void 0!==e.sign)i.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(i.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!r.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=a.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var n=e.key;if(("string"==typeof n||r.isBuffer(n))&&(n=o.parsePrivateKey(n)),i.ok(o.PrivateKey.isPrivateKey(n,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=n,i.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!l[n.type])throw new f(n.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&n.type!==t[0])throw new f("options.key must be a "+t[0].toUpperCase()+" key, was given a "+n.type.toUpperCase()+" key instead");this.rs_signer=n.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}n.inherits(g,h),n.inherits(b,h),v.prototype.writeHeader=function(e,t){if(i.string(e,"header"),e=e.toLowerCase(),i.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;this.rs_headers.length>0&&(r="\n"+r),this.rs_signer.update(r)}return t},v.prototype.writeDateHeader=function(){return this.writeHeader("date",s.rfc1123(new Date))},v.prototype.writeTarget=function(e,t){i.string(e,"method"),i.string(t,"path"),e=e.toLowerCase(),this.writeHeader("(request-target)",e+" "+t)},v.prototype.sign=function(e){if(i.func(e,"callback"),this.rs_headers.length<1)throw new Error("At least one header must be signed");var t,r;if(this.rs_signFunc){var a=this.rs_lines.join("\n"),n=this;this.rs_signFunc(a,function(a,o){if(a)e(a);else{try{i.object(o,"signature"),i.string(o.keyId,"signature.keyId"),i.string(o.algorithm,"signature.algorithm"),i.string(o.signature,"signature.signature"),t=d(o.algorithm),r=u(m,o.keyId,o.algorithm,n.rs_headers.join(" "),o.signature)}catch(t){return void e(t)}e(null,r)}})}else{try{var o=this.rs_signer.sign()}catch(t){return void e(t)}t=(this.rs_alg[0]||this.rs_key.type)+"-"+o.hashAlgorithm;var s=o.toString();r=u(m,this.rs_keyId,t,this.rs_headers.join(" "),s),e(null,r)}},t.exports={isSigner:function(e){return"object"==typeof e&&e instanceof v},createSigner:function(e){return new v(e)},signRequest:function(e,t){i.object(e,"request"),i.object(t,"options"),i.optionalString(t.algorithm,"options.algorithm"),i.string(t.keyId,"options.keyId"),i.optionalArrayOfString(t.headers,"options.headers"),i.optionalString(t.httpVersion,"options.httpVersion"),e.getHeader("Date")||e.setHeader("Date",s.rfc1123(new Date)),t.headers||(t.headers=["date"]),t.httpVersion||(t.httpVersion="1.1");var n,c=[];t.algorithm&&(t.algorithm=t.algorithm.toLowerCase(),c=d(t.algorithm));var h,v="";for(n=0;n>1,p=-7,l=r?a-1:0,f=r?-1:1,h=e[t+l];for(l+=f,n=h&(1<<-p)-1,h>>=-p,p+=s;p>0;n=256*n+e[t+l],l+=f,p-=8);for(o=n&(1<<-p)-1,n>>=-p,p+=i;p>0;o=256*o+e[t+l],l+=f,p-=8);if(0===n)n=1-u;else{if(n===c)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),n-=u}return(h?-1:1)*o*Math.pow(2,n-i)},r.write=function(e,t,r,i,a,n){var o,s,c,u=8*n-a-1,p=(1<>1,f=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:n-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=p?(s=0,o=p):o+l>=1?(s=(t*c-1)*Math.pow(2,a),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,a),o=0));a>=8;e[r+h]=255&s,h+=d,s/=256,a-=8);for(o=o<0;e[r+h]=255&o,h+=d,o/=256,u-=8);e[r+h-d]|=128*m}},{}],205:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],206:[function(e,t,r){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(i(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],207:[function(e,t,r){t.exports=n,n.strict=o,n.loose=s;var i=Object.prototype.toString,a={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function n(e){return o(e)||s(e)}function o(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function s(e){return a[i.call(e)]}},{}],208:[function(e,t,r){var i={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},{}],209:[function(e,t,r){var i=e("stream");function a(e){return e instanceof i.Stream}function n(e){return a(e)&&"function"==typeof e._read&&"object"==typeof e._readableState}function o(e){return a(e)&&"function"==typeof e._write&&"object"==typeof e._writableState}t.exports=a,t.exports.isReadable=n,t.exports.isWritable=o,t.exports.isDuplex=function(e){return n(e)&&o(e)}},{stream:350}],210:[function(e,t,r){(function(){var e;function i(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 a(){return new i(null)}var n="undefined"!=typeof navigator;n&&"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(e,t,r,i,a,n){for(var o=32767&t,s=t>>15;--n>=0;){var c=32767&this[e],u=this[e++]>>15,p=s*c+u*o;a=((c=o*c+((32767&p)<<15)+r[i]+(1073741823&a))>>>30)+(p>>>15)+s*u+(a>>>30),r[i++]=1073741823&c}return a},e=30):n&&"Netscape"!=navigator.appName?(i.prototype.am=function(e,t,r,i,a,n){for(;--n>=0;){var o=t*this[e++]+r[i]+a;a=Math.floor(o/67108864),r[i++]=67108863&o}return a},e=26):(i.prototype.am=function(e,t,r,i,a,n){for(var o=16383&t,s=t>>14;--n>=0;){var c=16383&this[e],u=this[e++]>>14,p=s*c+u*o;a=((c=o*c+((16383&p)<<14)+r[i]+a)>>28)+(p>>14)+s*u,r[i++]=268435455&c}return a},e=28),i.prototype.DB=e,i.prototype.DM=(1<>>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 d(e){this.m=e}function m(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=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 k(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function _(){}function x(e){return e}function j(e){this.r2=a(),this.q3=a(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}d.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},d.prototype.revert=function(e){return e},d.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},d.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},d.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},m.prototype.convert=function(e){var t=a();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},m.prototype.revert=function(e){var t=a();return e.copyTo(t),this.reduce(t),t},m.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,i,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)},m.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},m.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.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},i.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},i.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 a=e.length,n=!1,o=0;--a>=0;){var s=8==r?255&e[a]:l(e,a);s<0?"-"==e.charAt(a)&&(n=!0):(n=!1,0==o?this[this.t++]=s:o+r>this.DB?(this[this.t-1]|=(s&(1<>this.DB-o):this[this.t-1]|=s<=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e;)--this.t},i.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},i.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t[r+o+1]=this[r]>>a|s,s=(this[r]&n)<=0;--r)t[r]=0;t[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},i.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 i=e%this.DB,a=this.DB-i,n=(1<>i;for(var o=r+1;o>i;i>0&&(t[this.t-r-1]|=(this.s&n)<>=this.DB;if(e.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=e.s}t.s=i<0?-1:0,i<-1?t[r++]=this.DV+i:i>0&&(t[r++]=i),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),a=e.abs(),n=r.t;for(t.t=n+a.t;--n>=0;)t[n]=0;for(n=0;n=0;)e[r]=0;for(r=0;r=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()},i.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(p,s),o.lShiftTo(p,r)):(n.copyTo(s),o.copyTo(r));var l=s.t,f=s[l-1];if(0!=f){var d=f*(1<1?s[l-2]>>this.F2:0),m=this.FV/d,g=(1<=0&&(r[r.t++]=1,r.subTo(w,r)),i.ONE.dlShiftTo(l,w),w.subTo(s,s);s.t=0;){var k=r[--v]==f?this.DM:Math.floor(r[v]*m+(r[v-1]+b)*g);if((r[v]+=s.am(0,k,r,y,0,l))0&&r.rShiftTo(p,r),c<0&&i.ZERO.subTo(r,r)}}},i.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},i.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=a(),n=a(),o=t.convert(this),s=h(e)-1;for(o.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,o,r);else{var c=r;r=n,n=c}return t.revert(r)},i.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,i=(1<0)for(s>s)>0&&(a=!0,n=p(r));o>=0;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),r>0&&(a=!0),a&&(n+=p(r));return a?n:"0"},i.prototype.negate=function(){var e=a();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.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},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+h(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=a();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new d(t):new m(t),this.exp(e,r)},i.ZERO=f(0),i.ONE=f(1),_.prototype.convert=x,_.prototype.revert=x,_.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},_.prototype.sqrTo=function(e,t){e.squareTo(t)},j.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=a();return e.copyTo(t),this.reduce(t),t},j.prototype.revert=function(e){return e},j.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)},j.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},j.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var S,E,A,F=[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],P=(1<<26)/F[F.length-1];function z(){var e;e=(new Date).getTime(),E[A++]^=255&e,E[A++]^=e>>8&255,E[A++]^=e>>16&255,E[A++]^=e>>24&255,A>=q&&(A-=q)}if(i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.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),i=f(r),n=a(),o=a(),s="";for(this.divRemTo(i,n,o);n.signum()>0;)s=(r+o.intValue()).toString(e).substr(1)+s,n.divRemTo(i,n,o);return o.intValue().toString(e)+s},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),a=Math.pow(t,r),n=!1,o=0,s=0,c=0;c=r&&(this.dMultiply(a),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),n&&i.ZERO.subTo(this,this)},i.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(i.ONE.shiftLeft(e-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var a=new Array,n=7&e;a.length=1+(e>>3),t.nextBytes(a),n>0?a[0]&=(1<>=this.DB;if(e.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=e.s}t.s=i<0?-1:0,i>0?t[r++]=i:i<-1&&(t[r++]=this.DV+i),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.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]}},i.prototype.multiplyLowerTo=function(e,t,r){var i,a=Math.min(this.t+e.t,t);for(r.s=0,r.t=a;a>0;)r[--a]=0;for(i=r.t-this.t;a=0;)r[i]=0;for(i=Math.max(t-this.t,0);i0)if(0==t)r=this[0]%e;else for(var i=this.t-1;i>=0;--i)r=(t*r+this[i])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>F.length&&(e=F.length);for(var o=a(),s=0;s>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,i=this.DB-e*this.DB%8,a=0;if(e-- >0)for(i>i)!=(this.s&this.DM)>>i&&(t[a++]=r|this.s<=0;)i<8?(r=(this[e]&(1<>(i+=this.DB-8)):(r=this[e]>>(i-=8)&255,i<=0&&(i+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==a&&(128&this.s)!=(128&r)&&++a,(a>0||r!=this.s)&&(t[a++]=r);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=a();return this.bitwiseTo(e,g,t),t},i.prototype.or=function(e){var t=a();return this.bitwiseTo(e,b,t),t},i.prototype.xor=function(e){var t=a();return this.bitwiseTo(e,v,t),t},i.prototype.andNot=function(e){var t=a();return this.bitwiseTo(e,y,t),t},i.prototype.not=function(){for(var e=a(),t=0;t=this.t?0!=this.s:0!=(this[t]&1<1){var l=a();for(i.sqrTo(s[1],l);c<=p;)s[c]=a(),i.mulTo(l,s[c-2],s[c]),c+=2}var g,b,v=e.t-1,y=!0,w=a();for(n=h(e[v])-1;v>=0;){for(n>=u?g=e[v]>>n-u&p:(g=(e[v]&(1<0&&(g|=e[v-1]>>this.DB+n-u)),c=r;0==(1&g);)g>>=1,--c;if((n-=c)<0&&(n+=this.DB,--v),y)s[g].copyTo(o),y=!1;else{for(;c>1;)i.sqrTo(o,w),i.sqrTo(w,o),c-=2;c>0?i.sqrTo(o,w):(b=o,o=w,w=b),i.mulTo(w,s[g],o)}for(;v>=0&&0==(e[v]&1<=0?(r.subTo(a,r),t&&n.subTo(s,n),o.subTo(c,o)):(a.subTo(r,a),t&&s.subTo(n,s),c.subTo(o,c))}return 0!=a.compareTo(i.ONE)?i.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},i.prototype.pow=function(e){return this.exp(e,new _)},i.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 i=t;t=r,r=i}var a=t.getLowestSetBit(),n=r.getLowestSetBit();if(n<0)return t;for(a0&&(t.rShiftTo(n,t),r.rShiftTo(n,r));t.signum()>0;)(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return n>0&&r.lShiftTo(n,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=F[F.length-1]){for(t=0;t>>8,E[A++]=255&C;A=0,z()}function B(){if(null==S){for(z(),(S=new R).init(E),A=0;At.maxItems&&p("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&o.concat(function(e,t,r,n){if("object"==typeof t)for(var c in("object"!=typeof e||e instanceof Array)&&o.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(c)){var u=e[c];if(void 0===u&&i.existingOnly)continue;var p=t[c];void 0===u&&p.default&&(u=e[c]=p.default),i.coerce&&c in e&&(u=e[c]=i.coerce(u,p)),s(u,p,r,c)}for(c in e){if(e.hasOwnProperty(c)&&("_"!=c.charAt(0)||"_"!=c.charAt(1))&&t&&!t[c]&&!1===n){if(i.filter){delete e[c];continue}o.push({property:r,message:typeof u+"The property "+c+" is not defined in the schema and the schema does not allow additional properties"})}var l=t&&t[c]&&t[c].requires;!l||l in e||o.push({property:r,message:"the presence of the property "+c+" requires that "+l+" also be present"}),u=e[c],!n||t&&"object"==typeof t&&c in t||(i.coerce&&(u=e[c]=i.coerce(u,n)),s(u,n,r,c)),!a&&u&&u.$schema&&(o=o.concat(s(u,u.$schema,r,c)))}return o}(e,t.properties,r,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&p("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&p("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&p("must have a minimum value of "+t.minimum),void 0!==typeof t.maximum&&typeof e==typeof t.maximum&&t.maximum0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,a):i.push(a),~r.indexOf(n)&&(n=t.call(this,a,n))}else r.push(n);return null==e?n:e.call(this,a,n)}}(t.exports=function(e,t,r,a){return JSON.stringify(e,i(t,a),r)}).getSerialize=i},{}],214:[function(e,t,r){var i=e("assert-plus"),a=(e("util"),e("extsprintf")),n=e("verror"),o=e("json-schema");function s(e,t){return i.equal(typeof t,"string"),Object.prototype.hasOwnProperty.call(e,t)}r.deepCopy=function e(t){var r,i;var a="__deepCopy";if(t&&t[a])throw new Error("attempted deep copy of cyclic object");if(t&&t.constructor==Object){for(i in r={},t[a]=!0,t)i!=a&&(r[i]=e(t[i]));return delete t[a],r}if(t&&t.constructor==Array){for(r=[],t[a]=!0,i=0;i=0);var a=[];var n;for(n in t)e(t[n],r-1).forEach(function(e){a.push([n].concat(e))});return a},r.flattenIter=function(e,t,r){!function e(t,r,a,n){var o;var s;if(0===r)return(o=a.slice(0)).push(t),void n(o);i.ok(null!==t);i.equal(typeof t,"object");i.equal(typeof r,"number");i.ok(r>=0);for(s in t)(o=a.slice(0)).push(s),e(t[s],r-1,o,n)}(e,t,[],r)},r.validateJsonObject=O,r.validateJsonObjectJS=O,r.randElt=function(e){return i.ok(Array.isArray(e)&&e.length>0,"randElt argument must be a non-empty array"),e[Math.floor(Math.random()*e.length)]},r.extraProperties=function(e,t){i.ok("object"==typeof e&&null!==e,"obj argument must be a non-null object"),i.ok(Array.isArray(t),"allowed argument must be an array of strings");for(var r=0;r=2,"options.base >= 2"),i.ok(n.base<=36,"options.base <= 36"),i.bool(n.allowSign,"options.allowSign"),i.bool(n.allowPrefix,"options.allowPrefix"),i.bool(n.allowTrailing,"options.allowTrailing"),i.bool(n.allowImprecise,"options.allowImprecise"),i.bool(n.trimWhitespace,"options.trimWhitespace"),i.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&i.ok(!a,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var o,c=-1,u=n.base,h=1,d=0,m=0,w=e.length;if(n.trimWhitespace)for(;mp||k=h&&e<=d?e-A:e>=m&&e<=w?e-F:e>=k&&e<=E?e-P:-1}function C(e){return 32===e||e>=9&&e<=13||160===e||5760===e||6158===e||e>=8192&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e||65279===e}function O(e,t){var r=o.validate(t,e);if(0===r.errors.length)return null;var i,a,s=r.errors[0],c=s.property,u=s.message.toLowerCase();-1!=(i=u.indexOf("the property "))&&-1!=(a=u.indexOf(" is not defined in the schema and the schema does not allow additional properties"))&&(i+="the property ".length,c=""===c?u.substr(i,a-i):c+"."+u.substr(i,a-i),u="unsupported property");var p=new n.VError('property "%s": %s',c,u);return p.jsv_details=s,p}function T(e){i.ok(e[0]>=0&&e[1]>=0,"negative numbers not allowed in hrtimes"),i.ok(e[1]<1e9,"nanoseconds column overflow")}function B(e,t){T(e),T(t),i.ok(e[0]>t[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function I(e,t){return T(e),T(t),e[1]+=t[1],e[1]>=1e9&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function R(e,t,r){var i,a;if(i={},r)for(a in r)i[a]=r[a];if(e)for(a in e)i[a]=e[a];if(t)for(a in t)i[a]=t[a];return i}},{"assert-plus":64,extsprintf:157,"json-schema":212,util:388,verror:392}],215:[function(e,t,r){(function(e){var i=200,a="__lodash_hash_undefined__",n=800,o=16,s=9007199254740991,c="[object Arguments]",u="[object AsyncFunction]",p="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",d="[object Proxy]",m="[object Undefined]",g=/^\[object .+?Constructor\]$/,b=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[c]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v[p]=v["[object Map]"]=v["[object Number]"]=v[h]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1;var y="object"==typeof e&&e&&e.Object===Object&&e,w="object"==typeof self&&self&&self.Object===Object&&self,k=y||w||Function("return this")(),_="object"==typeof r&&r&&!r.nodeType&&r,x=_&&"object"==typeof t&&t&&!t.nodeType&&t,j=x&&x.exports===_,S=j&&y.process,E=function(){try{var e=x&&x.require&&x.require("util").types;return e||S&&S.binding&&S.binding("util")}catch(e){}}(),A=E&&E.isTypedArray;var F,P,z,C=Array.prototype,O=Function.prototype,T=Object.prototype,B=k["__core-js_shared__"],I=O.toString,R=T.hasOwnProperty,q=(F=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",M=T.toString,D=I.call(Object),L=RegExp("^"+I.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=j?k.Buffer:void 0,U=k.Symbol,H=k.Uint8Array,K=N?N.allocUnsafe:void 0,$=(P=Object.getPrototypeOf,z=Object,function(e){return P(z(e))}),V=Object.create,Z=T.propertyIsEnumerable,W=C.splice,G=U?U.toStringTag:void 0,Q=function(){try{var e=ke(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),X=N?N.isBuffer:void 0,Y=Math.max,J=Date.now,ee=ke(k,"Map"),te=ke(Object,"create"),re=function(){function e(){}return function(t){if(!Te(t))return{};if(V)return V(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ie(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},ae.prototype.set=function(e,t){var r=this.__data__,i=pe(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ie,map:new(ee||ae),string:new ie}},ne.prototype.delete=function(e){var t=we(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return we(this,e).get(e)},ne.prototype.has=function(e){return we(this,e).has(e)},ne.prototype.set=function(e,t){var r=we(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},oe.prototype.clear=function(){this.__data__=new ae,this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},oe.prototype.get=function(e){return this.__data__.get(e)},oe.prototype.has=function(e){return this.__data__.has(e)},oe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ae){var a=r.__data__;if(!ee||a.length-1&&e%1==0&&e0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Q?function(e,t){return Q(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:De);function Ee(e,t){return e===t||e!=e&&t!=t}var Ae=me(function(){return arguments}())?me:function(e){return Be(e)&&R.call(e,"callee")&&!Z.call(e,"callee")},Fe=Array.isArray;function Pe(e){return null!=e&&Oe(e.length)&&!Ce(e)}var ze=X||function(){return!1};function Ce(e){if(!Te(e))return!1;var t=de(e);return t==p||t==l||t==u||t==d}function Oe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Be(e){return null!=e&&"object"==typeof e}var Ie=A?function(e){return function(t){return e(t)}}(A):function(e){return Be(e)&&Oe(e.length)&&!!v[de(e)]};function Re(e){return Pe(e)?se(e,!0):be(e)}var qe,Me=(qe=function(e,t,r){ve(e,t,r)},ye(function(e,t){var r=-1,i=t.length,a=i>1?t[i-1]:void 0,n=i>2?t[2]:void 0;for(a=qe.length>3&&"function"==typeof a?(i--,a):void 0,n&&function(e,t,r){if(!Te(r))return!1;var i=typeof t;return!!("number"==i?Pe(r)&&_e(t,r.length):"string"==i&&t in r)&&Ee(r[t],e)}(t[0],t[1],n)&&(a=i<3?void 0:a,i=1),e=Object(e);++r>>32-t}function u(e,t,r,i,a,n,o){return c(e+(t&r|~t&i)+a+n|0,o)+t|0}function p(e,t,r,i,a,n,o){return c(e+(t&i|r&~i)+a+n|0,o)+t|0}function l(e,t,r,i,a,n,o){return c(e+(t^r^i)+a+n|0,o)+t|0}function f(e,t,r,i,a,n,o){return c(e+(r^(t|~i))+a+n|0,o)+t|0}i(s,a),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,a=this._c,n=this._d;r=u(r,i,a,n,e[0],3614090360,7),n=u(n,r,i,a,e[1],3905402710,12),a=u(a,n,r,i,e[2],606105819,17),i=u(i,a,n,r,e[3],3250441966,22),r=u(r,i,a,n,e[4],4118548399,7),n=u(n,r,i,a,e[5],1200080426,12),a=u(a,n,r,i,e[6],2821735955,17),i=u(i,a,n,r,e[7],4249261313,22),r=u(r,i,a,n,e[8],1770035416,7),n=u(n,r,i,a,e[9],2336552879,12),a=u(a,n,r,i,e[10],4294925233,17),i=u(i,a,n,r,e[11],2304563134,22),r=u(r,i,a,n,e[12],1804603682,7),n=u(n,r,i,a,e[13],4254626195,12),a=u(a,n,r,i,e[14],2792965006,17),r=p(r,i=u(i,a,n,r,e[15],1236535329,22),a,n,e[1],4129170786,5),n=p(n,r,i,a,e[6],3225465664,9),a=p(a,n,r,i,e[11],643717713,14),i=p(i,a,n,r,e[0],3921069994,20),r=p(r,i,a,n,e[5],3593408605,5),n=p(n,r,i,a,e[10],38016083,9),a=p(a,n,r,i,e[15],3634488961,14),i=p(i,a,n,r,e[4],3889429448,20),r=p(r,i,a,n,e[9],568446438,5),n=p(n,r,i,a,e[14],3275163606,9),a=p(a,n,r,i,e[3],4107603335,14),i=p(i,a,n,r,e[8],1163531501,20),r=p(r,i,a,n,e[13],2850285829,5),n=p(n,r,i,a,e[2],4243563512,9),a=p(a,n,r,i,e[7],1735328473,14),r=l(r,i=p(i,a,n,r,e[12],2368359562,20),a,n,e[5],4294588738,4),n=l(n,r,i,a,e[8],2272392833,11),a=l(a,n,r,i,e[11],1839030562,16),i=l(i,a,n,r,e[14],4259657740,23),r=l(r,i,a,n,e[1],2763975236,4),n=l(n,r,i,a,e[4],1272893353,11),a=l(a,n,r,i,e[7],4139469664,16),i=l(i,a,n,r,e[10],3200236656,23),r=l(r,i,a,n,e[13],681279174,4),n=l(n,r,i,a,e[0],3936430074,11),a=l(a,n,r,i,e[3],3572445317,16),i=l(i,a,n,r,e[6],76029189,23),r=l(r,i,a,n,e[9],3654602809,4),n=l(n,r,i,a,e[12],3873151461,11),a=l(a,n,r,i,e[15],530742520,16),r=f(r,i=l(i,a,n,r,e[2],3299628645,23),a,n,e[0],4096336452,6),n=f(n,r,i,a,e[7],1126891415,10),a=f(a,n,r,i,e[14],2878612391,15),i=f(i,a,n,r,e[5],4237533241,21),r=f(r,i,a,n,e[12],1700485571,6),n=f(n,r,i,a,e[3],2399980690,10),a=f(a,n,r,i,e[10],4293915773,15),i=f(i,a,n,r,e[1],2240044497,21),r=f(r,i,a,n,e[8],1873313359,6),n=f(n,r,i,a,e[15],4264355552,10),a=f(a,n,r,i,e[6],2734768916,15),i=f(i,a,n,r,e[13],1309151649,21),r=f(r,i,a,n,e[4],4149444226,6),n=f(n,r,i,a,e[11],3174756917,10),a=f(a,n,r,i,e[2],718787259,15),i=f(i,a,n,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+a|0,this._d=this._d+n|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=s},{"hash-base":184,inherits:205,"safe-buffer":314}],229:[function(e,t,r){var i=e("bn.js"),a=e("brorand");function n(e){this.rand=e||new a.Rand}t.exports=n,n.create=function(e){return new n(e)},n.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var a=new i(this.rand.generate(r))}while(a.cmp(e)>=0);return a},n.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},n.prototype.test=function(e,t,r){var a=e.bitLength(),n=i.mont(e),o=new i(1).toRed(n);t||(t=Math.max(1,a/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var u=e.shrn(c),p=s.toRed(n);t>0;t--){var l=this._randrange(new i(2),s);r&&r(l);var f=l.toRed(n).redPow(u);if(0!==f.cmp(o)&&0!==f.cmp(p)){for(var h=1;h0;t--){var p=this._randrange(new i(2),o),l=e.gcd(p);if(0!==l.cmpn(1))return l;var f=p.toRed(a).redPow(c);if(0!==f.cmp(n)&&0!==f.cmp(u)){for(var h=1;hp||u===p&&"application/"===a[c].substr(0,12)))continue}a[c]=e}}})},{"mime-db":231,path:255}],233:[function(e,t,r){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}t.exports=i,i.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},{}],234:[function(e,t,r){"use strict";var i=r;function a(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r>8,o=255&a;n?r.push(n,o):r.push(o)}return r},i.zero2=a,i.toHex=n,i.encode=function(e,t){return"hex"===t?n(e):e}},{}],235:[function(e,t,r){var i=1e3,a=60*i,n=60*a,o=24*n,s=365.25*o;function c(e,t,r){if(!(e0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*s;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*n;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?c(r=e,o,"day")||c(r,n,"hour")||c(r,a,"minute")||c(r,i,"second")||r+" ms":function(e){if(e>=o)return Math.round(e/o)+"d";if(e>=n)return Math.round(e/n)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],236:[function(e,t,r){var i=e("crypto");function a(e,t,r){return i.createHmac(r,e).update(t).digest("base64")}function n(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function o(e,t){return e>t?1:e>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{n=n+(a=a+t[i++]|0)|0}while(--o);a%=65521,n%=65521}return a|n<<16|0}},{}],241:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],242:[function(e,t,r){"use strict";var i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,a){var n=i,o=a+r;e^=-1;for(var s=a;s>>8^n[255&(e^t[s])];return-1^e}},{}],243:[function(e,t,r){"use strict";var i,a=e("../utils/common"),n=e("./trees"),o=e("./adler32"),s=e("./crc32"),c=e("./messages"),u=0,p=1,l=3,f=4,h=5,d=0,m=1,g=-2,b=-3,v=-5,y=-1,w=1,k=2,_=3,x=4,j=0,S=2,E=8,A=9,F=15,P=8,z=286,C=30,O=19,T=2*z+1,B=15,I=3,R=258,q=R+I+1,M=32,D=42,L=69,N=73,U=91,H=103,K=113,$=666,V=1,Z=2,W=3,G=4,Q=3;function X(e,t){return e.msg=c[t],t}function Y(e){return(e<<1)-(e>4?9:0)}function J(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(a.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ie(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ae(e,t){var r,i,a=e.max_chain_length,n=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-q?e.strstart-(e.w_size-q):0,u=e.window,p=e.w_mask,l=e.prev,f=e.strstart+R,h=u[n+o-1],d=u[n+o];e.prev_length>=e.good_match&&(a>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===h&&u[r]===u[n]&&u[++r]===u[n+1]){n+=2,r++;do{}while(u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&no){if(e.match_start=t,o=i,i>=s)break;h=u[n+o-1],d=u[n+o]}}}while((t=l[t&p])>c&&0!=--a);return o<=e.lookahead?o:e.lookahead}function ne(e){var t,r,i,n,c,u,p,l,f,h,d=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-q)){a.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;do{i=e.head[--t],e.head[t]=i>=d?i-d:0}while(--r);t=r=d;do{i=e.prev[--t],e.prev[t]=i>=d?i-d:0}while(--r);n+=d}if(0===e.strm.avail_in)break;if(u=e.strm,p=e.window,l=e.strstart+e.lookahead,f=n,h=void 0,(h=u.avail_in)>f&&(h=f),r=0===h?0:(u.avail_in-=h,a.arraySet(p,u.input,u.next_in,h,l),1===u.state.wrap?u.adler=o(u.adler,p,h,l):2===u.state.wrap&&(u.adler=s(u.adler,p,h,l)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-I,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=(e.ins_h<15&&(s=2,i-=16),n<1||n>A||r!==E||i<8||i>15||t<0||t>9||o<0||o>x)return X(e,g);8===i&&(i=9);var c=new ue;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ne(e),0===e.lookahead&&t===u)return V;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,te(e,!1),0===e.strm.avail_out))return V;if(e.strstart-e.block_start>=e.w_size-q&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?W:G):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),V)}),new ce(4,4,8,4,oe),new ce(4,5,16,8,oe),new ce(4,6,32,32,oe),new ce(4,4,16,16,se),new ce(8,16,32,32,se),new ce(8,16,128,128,se),new ce(8,32,128,256,se),new ce(32,128,258,1024,se),new ce(32,258,258,4096,se)],r.deflateInit=function(e,t){return fe(e,t,E,F,P,j)},r.deflateInit2=fe,r.deflateReset=le,r.deflateResetKeep=pe,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,d):g},r.deflate=function(e,t){var r,a,o,c;if(!e||!e.state||t>h||t<0)return e?X(e,g):g;if(a=e.state,!e.output||!e.input&&0!==e.avail_in||a.status===$&&t!==f)return X(e,0===e.avail_out?v:g);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===D)if(2===a.wrap)e.adler=0,re(a,31),re(a,139),re(a,8),a.gzhead?(re(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),re(a,255&a.gzhead.time),re(a,a.gzhead.time>>8&255),re(a,a.gzhead.time>>16&255),re(a,a.gzhead.time>>24&255),re(a,9===a.level?2:a.strategy>=k||a.level<2?4:0),re(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(re(a,255&a.gzhead.extra.length),re(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=s(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=L):(re(a,0),re(a,0),re(a,0),re(a,0),re(a,0),re(a,9===a.level?2:a.strategy>=k||a.level<2?4:0),re(a,Q),a.status=K);else{var b=E+(a.w_bits-8<<4)<<8;b|=(a.strategy>=k||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(b|=M),b+=31-b%31,a.status=K,ie(a,b),0!==a.strstart&&(ie(a,e.adler>>>16),ie(a,65535&e.adler)),e.adler=1}if(a.status===L)if(a.gzhead.extra){for(o=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),ee(e),o=a.pending,a.pending!==a.pending_buf_size));)re(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=N)}else a.status=N;if(a.status===N)if(a.gzhead.name){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),ee(e),o=a.pending,a.pending===a.pending_buf_size)){c=1;break}c=a.gzindexo&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),0===c&&(a.gzindex=0,a.status=U)}else a.status=U;if(a.status===U)if(a.gzhead.comment){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),ee(e),o=a.pending,a.pending===a.pending_buf_size)){c=1;break}c=a.gzindexo&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),0===c&&(a.status=H)}else a.status=H;if(a.status===H&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&ee(e),a.pending+2<=a.pending_buf_size&&(re(a,255&e.adler),re(a,e.adler>>8&255),e.adler=0,a.status=K)):a.status=K),0!==a.pending){if(ee(e),0===e.avail_out)return a.last_flush=-1,d}else if(0===e.avail_in&&Y(t)<=Y(r)&&t!==f)return X(e,v);if(a.status===$&&0!==e.avail_in)return X(e,v);if(0!==e.avail_in||0!==a.lookahead||t!==u&&a.status!==$){var y=a.strategy===k?function(e,t){for(var r;;){if(0===e.lookahead&&(ne(e),0===e.lookahead)){if(t===u)return V;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?W:G):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?V:Z}(a,t):a.strategy===_?function(e,t){for(var r,i,a,o,s=e.window;;){if(e.lookahead<=R){if(ne(e),e.lookahead<=R&&t===u)return V;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(i=s[a=e.strstart-1])===s[++a]&&i===s[++a]&&i===s[++a]){o=e.strstart+R;do{}while(i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=n._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?W:G):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?V:Z}(a,t):i[a.level].func(a,t);if(y!==W&&y!==G||(a.status=$),y===V||y===W)return 0===e.avail_out&&(a.last_flush=-1),d;if(y===Z&&(t===p?n._tr_align(a):t!==h&&(n._tr_stored_block(a,0,0,!1),t===l&&(J(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ee(e),0===e.avail_out))return a.last_flush=-1,d}return t!==f?d:a.wrap<=0?m:(2===a.wrap?(re(a,255&e.adler),re(a,e.adler>>8&255),re(a,e.adler>>16&255),re(a,e.adler>>24&255),re(a,255&e.total_in),re(a,e.total_in>>8&255),re(a,e.total_in>>16&255),re(a,e.total_in>>24&255)):(ie(a,e.adler>>>16),ie(a,65535&e.adler)),ee(e),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?d:m)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==D&&t!==L&&t!==N&&t!==U&&t!==H&&t!==K&&t!==$?X(e,g):(e.state=null,t===K?X(e,b):d):g},r.deflateSetDictionary=function(e,t){var r,i,n,s,c,u,p,l,f=t.length;if(!e||!e.state)return g;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==D||r.lookahead)return g;for(1===s&&(e.adler=o(e.adler,t,f,0)),r.wrap=0,f>=r.w_size&&(0===s&&(J(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new a.Buf8(r.w_size),a.arraySet(l,t,f-r.w_size,r.w_size,0),t=l,f=r.w_size),c=e.avail_in,u=e.next_in,p=e.input,e.avail_in=f,e.next_in=0,e.input=t,ne(r);r.lookahead>=I;){i=r.strstart,n=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>=w=y>>>24,d-=w,0===(w=y>>>16&255))E[n++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=m[(65535&y)+(h&(1<>>=w,d-=w),d<15&&(h+=S[i++]<>>=w=y>>>24,d-=w,!(16&(w=y>>>16&255))){if(0==(64&w)){y=g[(65535&y)+(h&(1<c){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,d-=w,_>(w=n-o)){if((w=_-w)>p&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,j=f,0===l){if(x+=u-w,w2;)E[n++]=j[x++],E[n++]=j[x++],E[n++]=j[x++],k-=3;k&&(E[n++]=j[x++],k>1&&(E[n++]=j[x++]))}else{x=n-_;do{E[n++]=E[x++],E[n++]=E[x++],E[n++]=E[x++],k-=3}while(k>2);k&&(E[n++]=E[x++],k>1&&(E[n++]=E[x++]))}break}}break}}while(i>3,h&=(1<<(d-=k<<3))-1,e.next_in=i,e.next_out=n,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ae(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ne(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new i.Buf32(ee),t.distcode=t.distdyn=new i.Buf32(te),t.sane=1,t.back=-1,d):b}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ne(e)):b}function se(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?b:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,oe(e))):b}function ce(e,t){var r,i;return e?(i=new ae,e.state=i,i.window=null,(r=se(e,t))!==d&&(e.state=null),r):b}var ue,pe,le=!0;function fe(e){if(le){var t;for(ue=new i.Buf32(512),pe=new i.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(u,e.lens,0,288,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(p,e.lens,0,32,pe,0,e.work,{bits:5}),le=!1}e.lencode=ue,e.lenbits=9,e.distcode=pe,e.distbits=5}function he(e,t,r,a){var n,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(i.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((n=o.wsize-o.wnext)>a&&(n=a),i.arraySet(o.window,t,r-a,n,o.wnext),(a-=n)?(i.arraySet(o.window,t,r-a,a,0),o.wnext=a,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=n(r.check,Ae,2,0),se=0,ce=0,r.mode=x;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=X;break}if((15&se)!==k){e.msg="unknown compression method",r.mode=X;break}if(ce-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=X;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?C:T,se=0,ce=0;break;case x:for(;ce<16;){if(0===ne)break e;ne--,se+=ee[re++]<>8&1),512&r.flags&&(Ae[0]=255&se,Ae[1]=se>>>8&255,r.check=n(r.check,Ae,2,0)),se=0,ce=0,r.mode=j;case j:for(;ce<32;){if(0===ne)break e;ne--,se+=ee[re++]<>>8&255,Ae[2]=se>>>16&255,Ae[3]=se>>>24&255,r.check=n(r.check,Ae,4,0)),se=0,ce=0,r.mode=S;case S:for(;ce<16;){if(0===ne)break e;ne--,se+=ee[re++]<>8),512&r.flags&&(Ae[0]=255&se,Ae[1]=se>>>8&255,r.check=n(r.check,Ae,2,0)),se=0,ce=0,r.mode=E;case E:if(1024&r.flags){for(;ce<16;){if(0===ne)break e;ne--,se+=ee[re++]<>>8&255,r.check=n(r.check,Ae,2,0)),se=0,ce=0}else r.head&&(r.head.extra=null);r.mode=A;case A:if(1024&r.flags&&((le=r.length)>ne&&(le=ne),le&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,ee,re,le,_e)),512&r.flags&&(r.check=n(r.check,ee,le,re)),ne-=le,re+=le,r.length-=le),r.length))break e;r.length=0,r.mode=F;case F:if(2048&r.flags){if(0===ne)break e;le=0;do{_e=ee[re+le++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&le>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=T;break;case C:for(;ce<32;){if(0===ne)break e;ne--,se+=ee[re++]<>>=7&ce,ce-=7&ce,r.mode=W;break}for(;ce<3;){if(0===ne)break e;ne--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(fe(r),r.mode=N,t===h){se>>>=2,ce-=2;break e}break;case 2:r.mode=M;break;case 3:e.msg="invalid block type",r.mode=X}se>>>=2,ce-=2;break;case I:for(se>>>=7&ce,ce-=7&ce;ce<32;){if(0===ne)break e;ne--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=X;break}if(r.length=65535&se,se=0,ce=0,r.mode=R,t===h)break e;case R:r.mode=q;case q:if(le=r.length){if(le>ne&&(le=ne),le>oe&&(le=oe),0===le)break e;i.arraySet(te,ee,re,le,ae),ne-=le,re+=le,oe-=le,ae+=le,r.length-=le;break}r.mode=T;break;case M:for(;ce<14;){if(0===ne)break e;ne--,se+=ee[re++]<>>=5,ce-=5,r.ndist=1+(31&se),se>>>=5,ce-=5,r.ncode=4+(15&se),se>>>=4,ce-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=X;break}r.have=0,r.mode=D;case D:for(;r.have>>=3,ce-=3}for(;r.have<19;)r.lens[Fe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,je={bits:r.lenbits},xe=s(c,r.lens,0,19,r.lencode,0,r.work,je),r.lenbits=je.bits,xe){e.msg="invalid code lengths set",r.mode=X;break}r.have=0,r.mode=L;case L:for(;r.have>>16&255,ve=65535&Ee,!((ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>>=ge,ce-=ge,r.lens[r.have++]=ve;else{if(16===ve){for(Se=ge+2;ce>>=ge,ce-=ge,0===r.have){e.msg="invalid bit length repeat",r.mode=X;break}_e=r.lens[r.have-1],le=3+(3&se),se>>>=2,ce-=2}else if(17===ve){for(Se=ge+3;ce>>=ge)),se>>>=3,ce-=3}else{for(Se=ge+7;ce>>=ge)),se>>>=7,ce-=7}if(r.have+le>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=X;break}for(;le--;)r.lens[r.have++]=_e}}if(r.mode===X)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=X;break}if(r.lenbits=9,je={bits:r.lenbits},xe=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,je),r.lenbits=je.bits,xe){e.msg="invalid literal/lengths set",r.mode=X;break}if(r.distbits=6,r.distcode=r.distdyn,je={bits:r.distbits},xe=s(p,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,je),r.distbits=je.bits,xe){e.msg="invalid distances set",r.mode=X;break}if(r.mode=N,t===h)break e;case N:r.mode=U;case U:if(ne>=6&&oe>=258){e.next_out=ae,e.avail_out=oe,e.next_in=re,e.avail_in=ne,r.hold=se,r.bits=ce,o(e,pe),ae=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ne=e.avail_in,se=r.hold,ce=r.bits,r.mode===T&&(r.back=-1);break}for(r.back=0;be=(Ee=r.lencode[se&(1<>>16&255,ve=65535&Ee,!((ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>ye)])>>>16&255,ve=65535&Ee,!(ye+(ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>>=ye,ce-=ye,r.back+=ye}if(se>>>=ge,ce-=ge,r.back+=ge,r.length=ve,0===be){r.mode=Z;break}if(32&be){r.back=-1,r.mode=T;break}if(64&be){e.msg="invalid literal/length code",r.mode=X;break}r.extra=15&be,r.mode=H;case H:if(r.extra){for(Se=r.extra;ce>>=r.extra,ce-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=K;case K:for(;be=(Ee=r.distcode[se&(1<>>16&255,ve=65535&Ee,!((ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>ye)])>>>16&255,ve=65535&Ee,!(ye+(ge=Ee>>>24)<=ce);){if(0===ne)break e;ne--,se+=ee[re++]<>>=ye,ce-=ye,r.back+=ye}if(se>>>=ge,ce-=ge,r.back+=ge,64&be){e.msg="invalid distance code",r.mode=X;break}r.offset=ve,r.extra=15&be,r.mode=$;case $:if(r.extra){for(Se=r.extra;ce>>=r.extra,ce-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=X;break}r.mode=V;case V:if(0===oe)break e;if(le=pe-oe,r.offset>le){if((le=r.offset-le)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=X;break}le>r.wnext?(le-=r.wnext,de=r.wsize-le):de=r.wnext-le,le>r.length&&(le=r.length),me=r.window}else me=te,de=ae-r.offset,le=r.length;le>oe&&(le=oe),oe-=le,r.length-=le;do{te[ae++]=me[de++]}while(--le);0===r.length&&(r.mode=U);break;case Z:if(0===oe)break e;te[ae++]=r.length,oe--,r.mode=U;break;case W:if(r.wrap){for(;ce<32;){if(0===ne)break e;ne--,se|=ee[re++]<=1&&0===I[E];E--);if(A>E&&(A=E),0===E)return u[p++]=20971520,u[p++]=20971520,f.bits=1,0;for(S=1;S0&&(0===e||1!==E))return-1;for(R[1]=0,x=1;x<15;x++)R[x+1]=R[x]+I[x];for(j=0;j852||2===e&&C>592)return 1;for(;;){y=x-P,l[j]v?(w=q[M+l[j]],k=T[B+l[j]]):(w=96,k=0),h=1<>P)+(d-=h)]=y<<24|w<<16|k|0}while(0!==d);for(h=1<>=1;if(0!==h?(O&=h-1,O+=h):O=0,j++,0==--I[x]){if(x===E)break;x=t[r+l[j]]}if(x>A&&(O&g)!==m){for(0===P&&(P=A),b+=S,z=1<<(F=x-P);F+P852||2===e&&C>592)return 1;u[m=O&g]=A<<24|F<<16|b-p|0}}return 0!==O&&(u[b+O]=x-P<<24|64<<16|0),f.bits=A,0}},{"../utils/common":239}],247:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],248:[function(e,t,r){"use strict";var i=e("../utils/common"),a=4,n=0,o=1,s=2;function c(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,p=1,l=2,f=29,h=256,d=h+1+f,m=30,g=19,b=2*d+1,v=15,y=16,w=7,k=256,_=16,x=17,j=18,S=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=new Array(2*(d+2));c(P);var z=new Array(2*m);c(z);var C=new Array(512);c(C);var O=new Array(256);c(O);var T=new Array(f);c(T);var B,I,R,q=new Array(m);function M(e,t,r,i,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}function D(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function L(e){return e<256?C[e]:C[256+(e>>>7)]}function N(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function U(e,t,r){e.bi_valid>y-r?(e.bi_buf|=t<>y-e.bi_valid,e.bi_valid+=r-y):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function $(e,t,r){var i,a,n=new Array(v+1),o=0;for(i=1;i<=v;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){var s=e[2*a+1];0!==s&&(e[2*a]=K(n[s]++,s))}}function V(e){var t;for(t=0;t8?N(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function W(e,t,r,i){var a=2*t,n=2*r;return e[a]>1;r>=1;r--)G(e,n,r);a=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,n,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,n[2*a]=n[2*r]+n[2*i],e.depth[a]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,n[2*r+1]=n[2*i+1]=a,e.heap[1]=a++,G(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,a,n,o,s,c=t.dyn_tree,u=t.max_code,p=t.stat_desc.static_tree,l=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(n=0;n<=v;n++)e.bl_count[n]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rd&&(n=d,m++),c[2*i+1]=n,i>u||(e.bl_count[n]++,o=0,i>=h&&(o=f[i-h]),s=c[2*i],e.opt_len+=s*(n+o),l&&(e.static_len+=s*(p[2*i+1]+o)));if(0!==m){do{for(n=d-1;0===e.bl_count[n];)n--;e.bl_count[n]--,e.bl_count[n+1]+=2,e.bl_count[d]--,m-=2}while(m>0);for(n=d;0!==n;n--)for(i=e.bl_count[n];0!==i;)(a=e.heap[--r])>u||(c[2*a+1]!==n&&(e.opt_len+=(n-c[2*a+1])*c[2*a],c[2*a+1]=n),i--)}}(e,t),$(n,u,e.bl_count)}function Y(e,t,r){var i,a,n=-1,o=t[1],s=0,c=7,u=4;for(0===o&&(c=138,u=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)a=o,o=t[2*(i+1)+1],++s>=7;i0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return n;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t=3&&0===e.bl_tree[2*F[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),c=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=c&&(c=u)):c=u=r+5,r+4<=c&&-1!==t?te(e,t,r,i):e.strategy===a||u===c?(U(e,(p<<1)+(i?1:0),3),Q(e,P,z)):(U(e,(l<<1)+(i?1:0),3),function(e,t,r,i){var a;for(U(e,t-257,5),U(e,r-1,5),U(e,i-4,4),a=0;a>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(O[r]+h+1)]++,e.dyn_dtree[2*L(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){U(e,p<<1,3),H(e,k,P),function(e){16===e.bi_valid?(N(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":239}],249:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],250:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],251:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var a=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=a;var n=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=n;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var p=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=p,r.DSAparam=i.define("DSAparam",function(){this.int()});var l=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=l;var f=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":252,"asn1.js":44}],252:[function(e,t,r){"use strict";var i=e("asn1.js"),a=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),n=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(n)}),u=i.define("RDNSequence",function(){this.seqof(c)}),p=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),l=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(a),this.key("notAfter").use(a))}),f=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),h=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(p),this.key("validity").use(l),this.key("subject").use(p),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":44}],253:[function(e,t,r){var i=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,o=e("evp_bytestokey"),s=e("browserify-aes"),c=e("safe-buffer").Buffer;t.exports=function(e,t){var r,u=e.toString(),p=u.match(i);if(p){var l="aes"+p[1],f=c.from(p[2],"hex"),h=c.from(p[3].replace(/[\r\n]/g,""),"base64"),d=o(t,f.slice(0,8),parseInt(p[1],10)).key,m=[],g=s.createDecipheriv(l,d,f);m.push(g.update(h)),m.push(g.final()),r=c.concat(m)}else{var b=u.match(n);r=new c(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(a)[1],data:r}}},{"browserify-aes":80,evp_bytestokey:155,"safe-buffer":314}],254:[function(e,t,r){var i=e("./asn1"),a=e("./aesid.json"),n=e("./fixProc"),o=e("browserify-aes"),s=e("pbkdf2"),c=e("safe-buffer").Buffer;function u(e){var t;"object"!=typeof e||c.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=c.from(e));var r,u,p=n(e,t),l=p.tag,f=p.data;switch(l){case"CERTIFICATE":u=i.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=i.PublicKey.decode(f,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=i.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+l);case"ENCRYPTED PRIVATE KEY":f=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=a[e.algorithm.decrypt.cipher.algo.join(".")],u=e.algorithm.decrypt.cipher.iv,p=e.subjectPrivateKey,l=parseInt(n.split("-")[1],10)/8,f=s.pbkdf2Sync(t,r,i,l,"sha1"),h=o.createDecipheriv(n,f,u),d=[];return d.push(h.update(p)),d.push(h.final()),c.concat(d)}(f=i.EncryptedPrivateKey.decode(f,"der"),t);case"PRIVATE KEY":switch(r=(u=i.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:i.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=i.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+l);case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=i.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+l)}}t.exports=u,u.signature=i.signature},{"./aesid.json":250,"./asn1":251,"./fixProc":253,"browserify-aes":80,pbkdf2:256,"safe-buffer":314}],255:[function(e,t,r){(function(e){function t(e,t){for(var r=0,i=e.length-1;i>=0;i--){var a=e[i];"."===a?e.splice(i,1):".."===a?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;i=-1&&!a;n--){var o=n>=0?arguments[n]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,a="/"===o.charAt(0))}return(a?"/":"")+(r=t(i(r.split("/"),function(e){return!!e}),!a).join("/"))||"."},r.normalize=function(e){var n=r.isAbsolute(e),o="/"===a(e,-1);return(e=t(i(e.split("/"),function(e){return!!e}),!n).join("/"))||n||(e="."),e&&o&&(e+="/"),(n?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function i(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var a=i(e.split("/")),n=i(t.split("/")),o=Math.min(a.length,n.length),s=o,c=0;c=1;--n)if(47===(t=e.charCodeAt(n))){if(!a){i=n;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"/":e.slice(0,i)},r.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,i=-1,a=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!a){r=t+1;break}}else-1===i&&(a=!1,i=t+1);return-1===i?"":e.slice(r,i)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,i=-1,a=!0,n=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===i&&(a=!1,i=o+1),46===s?-1===t?t=o:1!==n&&(n=1):-1!==t&&(n=-1);else if(!a){r=o+1;break}}return-1===t||-1===i||0===n||1===n&&t===i-1&&t===r+1?"":e.slice(t,i)};var a="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:263}],256:[function(e,t,r){r.pbkdf2=e("./lib/async"),r.pbkdf2Sync=e("./lib/sync")},{"./lib/async":257,"./lib/sync":260}],257:[function(e,t,r){(function(r,i){var a,n=e("./precondition"),o=e("./default-encoding"),s=e("./sync"),c=e("safe-buffer").Buffer,u=i.crypto&&i.crypto.subtle,p={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function f(e,t,r,i,a){return u.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return u.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:a}},e,i<<3)}).then(function(e){return c.from(e)})}t.exports=function(e,t,h,d,m,g){"function"==typeof m&&(g=m,m=void 0);var b=p[(m=m||"sha1").toLowerCase()];if(!b||"function"!=typeof i.Promise)return r.nextTick(function(){var r;try{r=s(e,t,h,d,m)}catch(e){return g(e)}g(null,r)});if(n(e,t,h,d),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");c.isBuffer(e)||(e=c.from(e,o)),c.isBuffer(t)||(t=c.from(t,o)),function(e,t){e.then(function(e){r.nextTick(function(){t(null,e)})},function(e){r.nextTick(function(){t(e)})})}(function(e){if(i.process&&!i.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var t=f(a=a||c.alloc(8),a,10,128,e).then(function(){return!0}).catch(function(){return!1});return l[e]=t,t}(b).then(function(r){return r?f(e,t,h,d,b):s(e,t,h,d,m)}),g)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":258,"./precondition":259,"./sync":260,_process:263,"safe-buffer":314}],258:[function(e,t,r){(function(e){var r;e.browser?r="utf-8":r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";t.exports=r}).call(this,e("_process"))},{_process:263}],259:[function(e,t,r){(function(e){var r=Math.pow(2,30)-1;function i(t,r){if("string"!=typeof t&&!e.isBuffer(t))throw new TypeError(r+" must be a buffer or string")}t.exports=function(e,t,a,n){if(i(e,"Password"),i(t,"Salt"),"number"!=typeof a)throw new TypeError("Iterations not a number");if(a<0)throw new TypeError("Bad iterations");if("number"!=typeof n)throw new TypeError("Key length not a number");if(n<0||n>r||n!=n)throw new TypeError("Bad key length")}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":206}],260:[function(e,t,r){var i=e("create-hash/md5"),a=e("ripemd160"),n=e("sha.js"),o=e("./precondition"),s=e("./default-encoding"),c=e("safe-buffer").Buffer,u=c.alloc(128),p={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,t,r){var o=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new a).update(e).digest()}:"md5"===e?i:function(t){return n(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=o(t):t.length1)for(var r=1;r255)return"DOMAIN_TOO_LONG";for(var r,a=t.split("."),n=0;n63)return"LABEL_TOO_LONG";if("-"===r.charAt(0))return"LABEL_STARTS_WITH_DASH";if("-"===r.charAt(r.length-1))return"LABEL_ENDS_WITH_DASH";if(!/^[a-z0-9\-]+$/.test(r))return"LABEL_INVALID_CHARS"}},r.parse=function(e){if("string"!=typeof e)throw new TypeError("Domain name must be a string.");var t=e.slice(0).toLowerCase();"."===t.charAt(t.length-1)&&(t=t.slice(0,t.length-1));var n=a.validate(t);if(n)return{input:e,error:{message:r.errorCodes[n],code:n}};var o={input:e,tld:null,sld:null,domain:null,subdomain:null,listed:!1},s=t.split(".");if("local"===s[s.length-1])return o;var c=function(){return/xn--/.test(t)?(o.domain&&(o.domain=i.toASCII(o.domain)),o.subdomain&&(o.subdomain=i.toASCII(o.subdomain)),o):o},u=a.findRule(t);if(!u)return s.length<2?o:(o.tld=s.pop(),o.sld=s.pop(),o.domain=[o.sld,o.tld].join("."),s.length&&(o.subdomain=s.pop()),c());o.listed=!0;var p=u.suffix.split("."),l=s.slice(0,s.length-p.length);return u.exception&&l.push(p.shift()),o.tld=p.join("."),l.length?(u.wildcard&&(p.unshift(l.pop()),o.tld=p.join(".")),l.length?(o.sld=l.pop(),o.domain=[o.sld,o.tld].join("."),l.length&&(o.subdomain=l.join(".")),c()):c()):c()},r.get=function(e){return e&&r.parse(e).domain||null},r.isValid=function(e){var t=r.parse(e);return Boolean(t.domain&&t.listed)}},{"./data/rules.json":264,punycode:108}],266:[function(e,t,r){r.publicEncrypt=e("./publicEncrypt"),r.privateDecrypt=e("./privateDecrypt"),r.privateEncrypt=function(e,t){return r.publicEncrypt(e,t,!0)},r.publicDecrypt=function(e,t){return r.privateDecrypt(e,t,!0)}},{"./privateDecrypt":268,"./publicEncrypt":269}],267:[function(e,t,r){var i=e("create-hash"),a=e("safe-buffer").Buffer;function n(e){var t=a.allocUnsafe(4);return t.writeUInt32BE(e,0),t}t.exports=function(e,t){for(var r,o=a.alloc(0),s=0;o.lengthd||new o(t).cmp(h.modulus)>=0)throw new Error("decryption error");f=r?u(new o(t),h):s(t,h);var m=p.alloc(d-f.length);if(f=p.concat([m,f],d),4===l)return function(e,t){var r=e.modulus.byteLength(),i=c("sha1").update(p.alloc(0)).digest(),o=i.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,o+1),u=t.slice(o+1),l=n(s,a(u,o)),f=n(u,a(l,r-o-1));if(function(e,t){e=p.from(e),t=p.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var a=-1;for(;++a=t.length){n++;break}var o=t.slice(2,a-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&n++;o.length<8&&n++;if(n)throw new Error("decryption error");return t.slice(a)}(0,f,r);if(3===l)return f;throw new Error("unknown padding")}},{"./mgf":267,"./withPublic":270,"./xor":271,"bn.js":75,"browserify-rsa":98,"create-hash":117,"parse-asn1":254,"safe-buffer":314}],269:[function(e,t,r){var i=e("parse-asn1"),a=e("randombytes"),n=e("create-hash"),o=e("./mgf"),s=e("./xor"),c=e("bn.js"),u=e("./withPublic"),p=e("browserify-rsa"),l=e("safe-buffer").Buffer;t.exports=function(e,t,r){var f;f=e.padding?e.padding:r?1:4;var h,d=i(e);if(4===f)h=function(e,t){var r=e.modulus.byteLength(),i=t.length,u=n("sha1").update(l.alloc(0)).digest(),p=u.length,f=2*p;if(i>r-f-2)throw new Error("message too long");var h=l.alloc(r-i-f-2),d=r-p-1,m=a(p),g=s(l.concat([u,h,l.alloc(1,1),t],d),o(m,d)),b=s(m,o(g,p));return new c(l.concat([l.alloc(1),b,g],r))}(d,t);else if(1===f)h=function(e,t,r){var i,n=t.length,o=e.modulus.byteLength();if(n>o-11)throw new Error("message too long");i=r?l.alloc(o-n-3,255):function(e){var t,r=l.allocUnsafe(e),i=0,n=a(2*e),o=0;for(;i=0)throw new Error("data too long for modulus")}return r?p(h,d):u(h,d)}},{"./mgf":267,"./withPublic":270,"./xor":271,"bn.js":75,"browserify-rsa":98,"create-hash":117,"parse-asn1":254,randombytes:280,"safe-buffer":314}],270:[function(e,t,r){var i=e("bn.js"),a=e("safe-buffer").Buffer;t.exports=function(e,t){return a.from(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}},{"bn.js":75,"safe-buffer":314}],271:[function(e,t,r){t.exports=function(e,t){for(var r=e.length,i=-1;++i=0;--a){var n,o=e[a];if("[]"===o)n=(n=[]).concat(i);else{n=r.plainObjects?Object.create(null):{};var s="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,c=parseInt(s,10);!isNaN(c)&&o!==s&&String(c)===s&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(n=[])[c]=i:n[s]=i}i=n}return i}(c,t,r)}};t.exports=function(e,t){var r=t?i.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||i.isRegExp(r.delimiter)?r.delimiter:n.delimiter,r.depth="number"==typeof r.depth?r.depth:n.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:n.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:n.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:n.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:n.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:n.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:n.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:n.strictNullHandling,""===e||null==e)return r.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){for(var r={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=i.split(t.delimiter,o),c=0;c0?A+E:""}},{"./formats":272,"./utils":276}],276:[function(e,t,r){"use strict";var i=Object.prototype.hasOwnProperty,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),n=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},i=0;i=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?r+=t.charAt(i):n<128?r+=a[n]:n<2048?r+=a[192|n>>6]+a[128|63&n]:n<55296||n>=57344?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,a){if(!r)return t;if("object"!=typeof r){if(Array.isArray(t))t.push(r);else{if("object"!=typeof t)return[t,r];(a.plainObjects||a.allowPrototypes||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if("object"!=typeof t)return[t].concat(r);var o=t;return Array.isArray(t)&&!Array.isArray(r)&&(o=n(t,a)),Array.isArray(t)&&Array.isArray(r)?(r.forEach(function(r,n){i.call(t,n)?t[n]&&"object"==typeof t[n]?t[n]=e(t[n],r,a):t.push(r):t[n]=r}),t):Object.keys(r).reduce(function(t,n){var o=r[n];return i.call(t,n)?t[n]=e(t[n],o,a):t[n]=o,t},o)}}},{}],277:[function(e,t,r){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,n){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var c=1e3;n&&"number"==typeof n.maxKeys&&(c=n.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var p=0;p=0?(l=m.substr(0,g),f=m.substr(g+1)):(l=m,f=""),h=decodeURIComponent(l),d=decodeURIComponent(f),i(o,h)?a(o[h])?o[h].push(d):o[h]=[o[h],d]:o[h]=d}return o};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],278:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?n(o(e),function(o){var s=encodeURIComponent(i(o))+r;return a(e[o])?n(e[o],function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[o]))}).join(t):s?encodeURIComponent(i(s))+r+encodeURIComponent(i(e)):""};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function n(e,t){if(e.map)return e.map(t);for(var r=[],i=0;in)throw new RangeError("requested too many random bytes");var i=o.allocUnsafe(e);if(e>0)if(e>a)for(var c=0;cp||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function f(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>p||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>c)throw new RangeError("buffer too small")}function h(e,r,i,a){if(t.browser){var n=e.buffer,s=new Uint8Array(n,r,i);return u.getRandomValues(s),a?void t.nextTick(function(){a(null,e)}):e}if(!a)return o(i).copy(e,r),e;o(i,function(t,i){if(t)return a(t);i.copy(e,r),a(null,e)})}u&&u.getRandomValues||!t.browser?(r.randomFill=function(e,t,r,a){if(!(s.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)a=t,t=0,r=e.length;else if("function"==typeof r)a=r,r=e.length-t;else if("function"!=typeof a)throw new TypeError('"cb" argument must be a function');return l(t,e.length),f(r,t,e.length),h(e,t,r,a)},r.randomFillSync=function(e,t,r){void 0===t&&(t=0);if(!(s.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(t,e.length),void 0===r&&(r=e.length-t);return f(r,t,e.length),h(e,t,r)}):(r.randomFill=a,r.randomFillSync=a)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:263,randombytes:280,"safe-buffer":314}],282:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":283}],283:[function(e,t,r){"use strict";var i=e("process-nextick-args"),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var n=e("core-util-is");n.inherits=e("inherits");var o=e("./_stream_readable"),s=e("./_stream_writable");n.inherits(l,o);for(var c=a(s.prototype),u=0;u0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):k(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?k(e,o,t,!1):E(e,o)):k(e,o,t,!1))):i||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(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 j(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?a.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),z(e)}function E(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;en.length?n.length:e;if(o===n.length?a+=n:a+=n.slice(0,e),0===(e-=o)){o===n.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=n.slice(o));break}++i}return t.length-=i,a}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,a=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var n=i.data,o=e>n.length?n.length:e;if(n.copy(r,r.length-e,0,o),0===(e-=o)){o===n.length?(++a,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=n.slice(o));break}++a}return t.length-=a,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function B(e,t){for(var r=0,i=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):j(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,a=t.needReadable;return h("need readable",a),(0===t.length||t.length-e0?C(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==i&&this.emit("data",i),i},y.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(e,t){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,h("pipe count=%d opts=%j",n.pipesCount,t);var c=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?p:y;function u(t,r){h("onunpipe"),t===i&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",b),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",g),e.removeListener("unpipe",u),i.removeListener("end",p),i.removeListener("end",y),i.removeListener("data",m),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function p(){h("onend"),e.end()}n.endEmitted?a.nextTick(c):i.once("end",c),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,z(e))}}(i);e.on("drain",l);var f=!1;var d=!1;function m(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==B(n.pipes,e))&&!f&&(h("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,d=!0),i.pause())}function g(t){h("onerror",t),y(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",v),y()}function v(){h("onfinish"),e.removeListener("close",b),y()}function y(){h("unpipe"),i.unpipe(e)}return i.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",b),e.once("finish",v),e.emit("pipe",i),n.flowing||(h("pipe resume"),i.resume()),e},y.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?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var n=0;n-1?a:n.nextTick;v.WritableState=b;var u=e("core-util-is");u.inherits=e("inherits");var p={deprecate:e("util-deprecate")},l=e("./internal/streams/stream"),f=e("safe-buffer").Buffer,h=i.Uint8Array||function(){};var d,m=e("./internal/streams/destroy");function g(){}function b(t,r){s=s||e("./_stream_duplex"),t=t||{};var i=r instanceof s;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var a=t.highWaterMark,u=t.writableHighWaterMark,p=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:i&&(u||0===u)?u:p,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.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,i=r.sync,a=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,a){--t.pendingcb,r?(n.nextTick(a,i),n.nextTick(j,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(a(i),e._writableState.errorEmitted=!0,e.emit("error",i),j(e,t))}(e,r,i,t,a);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||k(e,r),i?c(w,e,r,o,a):w(e,r,o,a)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function v(t){if(s=s||e("./_stream_duplex"),!(d.call(v,this)||this instanceof s))return new v(t);this._writableState=new b(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function y(e,t,r,i,a,n,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(a,t.onwrite):e._write(a,n,t.onwrite),t.sync=!1}function w(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),j(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,a=new Array(i),n=t.corkedRequestsFree;n.entry=r;for(var s=0,c=!0;r;)a[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;a.allBuffers=c,y(e,t,!0,t.length,a,"",n.finish),t.pendingcb++,t.lastBufferedRequest=null,n.next?(t.corkedRequestsFree=n.next,n.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,p=r.encoding,l=r.callback;if(y(e,t,!1,t.objectMode?1:u.length,u,p,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),j(e,t)})}function j(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n.nextTick(x,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(v,l),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:p.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]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===v&&(e&&e._writableState instanceof b)}})):d=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,r){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,f.isBuffer(i)||i instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=g),a.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),n.nextTick(t,r)}(this,r):(s||function(e,t,r,i){var a=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),n.nextTick(i,o),a=!1),a}(this,a,e,r))&&(a.pendingcb++,o=function(e,t,r,i,a,n){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,r));return t}(t,i,a);i!==o&&(r=!0,a="buffer",i=o)}var s=t.objectMode?1:i.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,r){var i=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,r){t.ending=!0,j(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":283,"./internal/streams/destroy":289,"./internal/streams/stream":290,_process:263,"core-util-is":115,inherits:205,"process-nextick-args":262,"safe-buffer":291,timers:372,"util-deprecate":385}],288:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("util");t.exports=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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t,r,a,n=i.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=n,a=s,t.copy(r,a),s+=o.data.length,o=o.next;return n},e}(),a&&a.inspect&&a.inspect.custom&&(t.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":291,util:77}],289:[function(e,t,r){"use strict";var i=e("process-nextick-args");function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||i.nextTick(a,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(i.nextTick(a,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),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.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":262}],290:[function(e,t,r){t.exports=e("events").EventEmitter},{events:154}],291:[function(e,t,r){var i=e("buffer"),a=i.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=i:(n(i,r),r.Buffer=o),n(a,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=a(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 a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:110}],292:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":293}],293:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":283,"./lib/_stream_passthrough.js":284,"./lib/_stream_readable.js":285,"./lib/_stream_transform.js":286,"./lib/_stream_writable.js":287}],294:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":293}],295:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":287}],296:[function(e,t,r){"use strict";var i=e("../"),a=e("lodash/isArray"),n=e("lodash/isFunction"),o=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!o(e))throw new TypeError(t);if(!n(e.request))throw new TypeError(t+".request");if(!a(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");var r=i({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),s=e.request.Request.prototype.init;e.request.Request.prototype.init=function(e){return!o(e)||this._callback||this._rp_promise||r.init.call(this,e),s.apply(this,arguments)};for(var c=!1,u=0;u-1}}t.exports=function(t){var a=e.env.NO_PROXY||e.env.no_proxy||"";return"*"===a?null:""!==a&&function(e,t){var a=e.port||("https:"===e.protocol?"443":"80"),n=r(e.hostname);return t.split(",").map(i).some(function(e){var t=n.indexOf(e.hostname),r=t>-1&&t===n.length-e.hostname.length;return e.hasPort?a===e.port&&r:r})}(t,a)?null:"http:"===t.protocol?e.env.HTTP_PROXY||e.env.http_proxy||null:"https:"===t.protocol&&(e.env.HTTPS_PROXY||e.env.https_proxy||e.env.HTTP_PROXY||e.env.http_proxy)||null}}).call(this,e("_process"))},{_process:263}],304:[function(e,t,r){"use strict";var i=e("fs"),a=e("querystring"),n=e("har-validator"),o=e("extend");function s(e){this.request=e}s.prototype.reducer=function(e,t){if(void 0===e[t.name])return e[t.name]=t.value,e;var r=[e[t.name],t.value];return e[t.name]=r,e},s.prototype.prep=function(e){if(e.queryObj={},e.headersObj={},e.postData.jsonObj=!1,e.postData.paramsObj=!1,e.queryString&&e.queryString.length&&(e.queryObj=e.queryString.reduce(this.reducer,{})),e.headers&&e.headers.length&&(e.headersObj=e.headers.reduceRight(function(e,t){return e[t.name]=t.value,e},{})),e.cookies&&e.cookies.length){var t=e.cookies.map(function(e){return e.name+"="+e.value});t.length&&(e.headersObj.cookie=t.join("; "))}function r(t){return t.some(function(t){return 0===e.postData.mimeType.indexOf(t)})}if(r(["multipart/mixed","multipart/related","multipart/form-data","multipart/alternative"]))e.postData.mimeType="multipart/form-data";else if(r(["application/x-www-form-urlencoded"]))e.postData.params?(e.postData.paramsObj=e.postData.params.reduce(this.reducer,{}),e.postData.text=a.stringify(e.postData.paramsObj)):e.postData.text="";else if(r(["text/json","text/x-json","application/json","application/x-json"])&&(e.postData.mimeType="application/json",e.postData.text))try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(t){this.request.debug(t),e.postData.mimeType="text/plain"}return e},s.prototype.options=function(e){if(!e.har)return e;var t={};if(o(t,e.har),t.log&&t.log.entries&&(t=t.log.entries[0]),t.url=t.url||e.url||e.uri||e.baseUrl||"/",t.httpVersion=t.httpVersion||"HTTP/1.1",t.queryString=t.queryString||[],t.headers=t.headers||[],t.cookies=t.cookies||[],t.postData=t.postData||{},t.postData.mimeType=t.postData.mimeType||"application/octet-stream",t.bodySize=0,t.headersSize=0,t.postData.size=0,!n.request(t))return e;var r=this.prep(t);function a(e){return 0===r.postData.mimeType.indexOf(e)}return r.url&&(e.url=r.url),r.method&&(e.method=r.method),Object.keys(r.queryObj).length&&(e.qs=r.queryObj),Object.keys(r.headersObj).length&&(e.headers=r.headersObj),a("application/x-www-form-urlencoded")?e.form=r.postData.paramsObj:a("application/json")?r.postData.jsonObj&&(e.body=r.postData.jsonObj,e.json=!0):a("multipart/form-data")?(e.formData={},r.postData.params.forEach(function(t){var r={};t.fileName||t.fileName||t.contentType?(t.fileName&&!t.value?r.value=i.createReadStream(t.fileName):t.value&&(r.value=t.value),t.fileName&&(r.options={filename:t.fileName,contentType:t.contentType?t.contentType:null}),e.formData[t.name]=r):e.formData[t.name]=t.value})):r.postData.text&&(e.body=r.postData.text),e},r.Har=s},{extend:156,fs:107,"har-validator":183,querystring:279}],305:[function(e,t,r){"use strict";var i=e("crypto");r.calculateMac=function(e,t){var r="hawk.1.header\n"+t.ts+"\n"+t.nonce+"\n"+(t.method||"").toUpperCase()+"\n"+t.resource+"\n"+t.host.toLowerCase()+"\n"+t.port+"\n"+(t.hash||"")+"\n";return t.ext&&(r+=t.ext.replace("\\","\\\\").replace("\n","\\n")),r+="\n",t.app&&(r=r+t.app+"\n"+(t.dlg||"")+"\n"),i.createHmac(e.algorithm,e.key).update(r).digest("base64")},r.header=function(e,t,a){var n=a.timestamp||Math.floor((Date.now()+(a.localtimeOffsetMsec||0))/1e3),o=a.credentials;if(!(o&&o.id&&o.key&&o.algorithm))return"";if(-1===["sha1","sha256"].indexOf(o.algorithm))return"";var s,c,u,p,l,f,h={ts:n,nonce:a.nonce||(s=6,c=6*(s+1),i.randomBytes(Math.ceil(c/8)).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"").slice(0,s)),method:t,resource:e.pathname+(e.search||""),host:e.hostname,port:e.port||("http:"===e.protocol?80:443),hash:a.hash,ext:a.ext,app:a.app,dlg:a.dlg};h.hash||!a.payload&&""!==a.payload||(h.hash=(u=a.payload,p=o.algorithm,l=a.contentType,(f=i.createHash(p)).update("hawk.1.payload\n"),f.update((l?l.split(";")[0].trim().toLowerCase():"")+"\n"),f.update(u||""),f.update("\n"),f.digest("base64")));var d=r.calculateMac(o,h),m=null!==h.ext&&void 0!==h.ext&&""!==h.ext,g='Hawk id="'+o.id+'", ts="'+h.ts+'", nonce="'+h.nonce+(h.hash?'", hash="'+h.hash:"")+(m?'", ext="'+h.ext.replace(/\\/g,"\\\\").replace(/"/g,'\\"'):"")+'", mac="'+d+'"';return h.app&&(g=g+', app="'+h.app+(h.dlg?'", dlg="'+h.dlg:"")+'"'),g}},{crypto:121}],306:[function(e,t,r){(function(t,i){"use strict";var a=e("json-stringify-safe"),n=e("crypto"),o=e("safe-buffer").Buffer,s=void 0===i?t.nextTick:i;r.paramsHaveRequestBody=function(e){return e.body||e.requestBodyStream||e.json&&"boolean"!=typeof e.json||e.multipart},r.safeStringify=function(e,t){var r;try{r=JSON.stringify(e,t)}catch(i){r=a(e,t)}return r},r.md5=function(e){return n.createHash("md5").update(e).digest("hex")},r.isReadStream=function(e){return e.readable&&e.path&&e.mode},r.toBase64=function(e){return o.from(e||"","utf8").toString("base64")},r.copy=function(e){var t={};return Object.keys(e).forEach(function(r){t[r]=e[r]}),t},r.version=function(){var e=t.version.replace("v","").split(".");return{major:parseInt(e[0],10),minor:parseInt(e[1],10),patch:parseInt(e[2],10)}},r.defer=s}).call(this,e("_process"),e("timers").setImmediate)},{_process:263,crypto:121,"json-stringify-safe":213,"safe-buffer":314,timers:372}],307:[function(e,t,r){"use strict";var i=e("uuid/v4"),a=e("combined-stream"),n=e("isstream"),o=e("safe-buffer").Buffer;function s(e){this.request=e,this.boundary=i(),this.chunked=!1,this.body=null}s.prototype.isChunked=function(e){var t=this,r=!1,i=e.data||e;return i.forEach||t.request.emit("error",new Error("Argument error, options.multipart.")),void 0!==e.chunked&&(r=e.chunked),"chunked"===t.request.getHeader("transfer-encoding")&&(r=!0),r||i.forEach(function(e){void 0===e.body&&t.request.emit("error",new Error("Body attribute missing in multipart.")),n(e.body)&&(r=!0)}),r},s.prototype.setHeaders=function(e){e&&!this.request.hasHeader("transfer-encoding")&&this.request.setHeader("transfer-encoding","chunked");var t=this.request.getHeader("content-type");t&&-1!==t.indexOf("multipart")?-1!==t.indexOf("boundary")?this.boundary=t.replace(/.*boundary=([^\s;]+).*/,"$1"):this.request.setHeader("content-type",t+"; boundary="+this.boundary):this.request.setHeader("content-type","multipart/related; boundary="+this.boundary)},s.prototype.build=function(e,t){var r=this,i=t?new a:[];function n(e){return"number"==typeof e&&(e=e.toString()),t?i.append(e):i.push(o.from(e))}return r.request.preambleCRLF&&n("\r\n"),e.forEach(function(e){var t="--"+r.boundary+"\r\n";Object.keys(e).forEach(function(r){"body"!==r&&(t+=r+": "+e[r]+"\r\n")}),n(t+="\r\n"),n(e.body),n("\r\n")}),n("--"+r.boundary+"--"),r.request.postambleCRLF&&n("\r\n"),i},s.prototype.onRequest=function(e){var t=this.isChunked(e),r=e.data||e;this.setHeaders(t),this.chunked=t,this.body=this.build(r,t)},r.Multipart=s},{"combined-stream":114,isstream:209,"safe-buffer":314,"uuid/v4":391}],308:[function(e,t,r){"use strict";var i=e("url"),a=e("qs"),n=e("caseless"),o=e("uuid/v4"),s=e("oauth-sign"),c=e("crypto"),u=e("safe-buffer").Buffer;function p(e){this.request=e,this.params=null}p.prototype.buildParams=function(e,t,r,i,a,n){var c={};for(var u in e)c["oauth_"+u]=e[u];c.oauth_version||(c.oauth_version="1.0"),c.oauth_timestamp||(c.oauth_timestamp=Math.floor(Date.now()/1e3).toString()),c.oauth_nonce||(c.oauth_nonce=o().replace(/-/g,"")),c.oauth_signature_method||(c.oauth_signature_method="HMAC-SHA1");var p=c.oauth_consumer_secret||c.oauth_private_key;delete c.oauth_consumer_secret,delete c.oauth_private_key;var l=c.oauth_token_secret;delete c.oauth_token_secret;var f=c.oauth_realm;delete c.oauth_realm,delete c.oauth_transport_method;var h=t.protocol+"//"+t.host+t.pathname,d=n.parse([].concat(i,a,n.stringify(c)).join("&"));return c.oauth_signature=s.sign(c.oauth_signature_method,r,h,d,p,l),f&&(c.realm=f),c},p.prototype.buildBodyHash=function(e,t){["HMAC-SHA1","RSA-SHA1"].indexOf(e.signature_method||"HMAC-SHA1")<0&&this.request.emit("error",new Error("oauth: "+e.signature_method+" signature_method not supported with body_hash signing."));var r=c.createHash("sha1");r.update(t||"");var i=r.digest("hex");return u.from(i,"hex").toString("base64")},p.prototype.concatParams=function(e,t,r){r=r||"";var i=Object.keys(e).filter(function(e){return"realm"!==e&&"oauth_signature"!==e}).sort();return e.realm&&i.splice(0,0,"realm"),i.push("oauth_signature"),i.map(function(t){return t+"="+r+s.rfc3986(e[t])+r}).join(t)},p.prototype.onRequest=function(e){this.params=e;var t,r,o=this.request.uri||{},s=this.request.method||"",c=n(this.request.headers),u=this.request.body||"",p=this.request.qsLib||a,l=c.get("content-type")||"",f="application/x-www-form-urlencoded",h=e.transport_method||"header";l.slice(0,f.length)===f&&(l=f,t=u),o.query&&(r=o.query),"body"!==h||"POST"===s&&l===f||this.request.emit("error",new Error("oauth: transport_method of body requires POST and content-type "+f)),t||"boolean"!=typeof e.body_hash||(e.body_hash=this.buildBodyHash(e,this.request.body.toString()));var d=this.buildParams(e,o,s,r,t,p);switch(h){case"header":this.request.setHeader("Authorization","OAuth "+this.concatParams(d,",",'"'));break;case"query":var m=this.request.uri.href+=(r?"&":"?")+this.concatParams(d,"&");this.request.uri=i.parse(m),this.request.path=this.request.uri.path;break;case"body":this.request.body=(t?t+"&":"")+this.concatParams(d,"&");break;default:this.request.emit("error",new Error("oauth: transport_method invalid"))}},r.OAuth=p},{caseless:112,crypto:121,"oauth-sign":236,qs:273,"safe-buffer":314,url:383,"uuid/v4":391}],309:[function(e,t,r){"use strict";var i=e("qs"),a=e("querystring");function n(e){this.request=e,this.lib=null,this.useQuerystring=null,this.parseOptions=null,this.stringifyOptions=null}n.prototype.init=function(e){this.lib||(this.useQuerystring=e.useQuerystring,this.lib=this.useQuerystring?a:i,this.parseOptions=e.qsParseOptions||{},this.stringifyOptions=e.qsStringifyOptions||{})},n.prototype.stringify=function(e){return this.useQuerystring?this.rfc3986(this.lib.stringify(e,this.stringifyOptions.sep||null,this.stringifyOptions.eq||null,this.stringifyOptions)):this.lib.stringify(e,this.stringifyOptions)},n.prototype.parse=function(e){return this.useQuerystring?this.lib.parse(e,this.parseOptions.sep||null,this.parseOptions.eq||null,this.parseOptions):this.lib.parse(e,this.parseOptions)},n.prototype.rfc3986=function(e){return e.replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},n.prototype.unescape=a.unescape,r.Querystring=n},{qs:273,querystring:279}],310:[function(e,t,r){"use strict";var i=e("url"),a=/^https?:/;function n(e){this.request=e,this.followRedirect=!0,this.followRedirects=!0,this.followAllRedirects=!1,this.followOriginalHttpMethod=!1,this.allowRedirect=function(){return!0},this.maxRedirects=10,this.redirects=[],this.redirectsFollowed=0,this.removeRefererHeader=!1}n.prototype.onRequest=function(e){void 0!==e.maxRedirects&&(this.maxRedirects=e.maxRedirects),"function"==typeof e.followRedirect&&(this.allowRedirect=e.followRedirect),void 0!==e.followRedirect&&(this.followRedirects=!!e.followRedirect),void 0!==e.followAllRedirects&&(this.followAllRedirects=e.followAllRedirects),(this.followRedirects||this.followAllRedirects)&&(this.redirects=this.redirects||[]),void 0!==e.removeRefererHeader&&(this.removeRefererHeader=e.removeRefererHeader),void 0!==e.followOriginalHttpMethod&&(this.followOriginalHttpMethod=e.followOriginalHttpMethod)},n.prototype.redirectTo=function(e){var t=this.request,r=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var i=e.caseless.get("location");if(t.debug("redirect",i),this.followAllRedirects)r=i;else if(this.followRedirects)switch(t.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:r=i}}else if(401===e.statusCode){var a=t._auth.onResponse(e);a&&(t.setHeader("authorization",a),r=t.uri)}return r},n.prototype.onResponse=function(e){var t=this.request,r=this.redirectTo(e);if(!r||!this.allowRedirect.call(t,e))return!1;if(t.debug("redirect to",r),e.resume&&e.resume(),this.redirectsFollowed>=this.maxRedirects)return t.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+t.uri.href)),!1;this.redirectsFollowed+=1,a.test(r)||(r=i.resolve(t.uri.href,r));var n=t.uri;return t.uri=i.parse(r),t.uri.protocol!==n.protocol&&delete t.agent,this.redirects.push({statusCode:e.statusCode,redirectUri:r}),this.followAllRedirects&&"HEAD"!==t.method&&401!==e.statusCode&&307!==e.statusCode&&(t.method=this.followOriginalHttpMethod?t.method:"GET"),delete t.src,delete t.req,delete t._started,401!==e.statusCode&&307!==e.statusCode&&(delete t.body,delete t._form,t.headers&&(t.removeHeader("host"),t.removeHeader("content-type"),t.removeHeader("content-length"),t.uri.hostname!==t.originalHost.split(":")[0]&&t.removeHeader("authorization"))),this.removeRefererHeader||t.setHeader("referer",n.href),t.emit("redirect"),t.init(),!0},r.Redirect=n},{url:383}],311:[function(e,t,r){"use strict";var i=e("url"),a=e("tunnel-agent"),n=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],o=["proxy-authorization"];function s(e){this.request=e,this.proxyHeaderWhiteList=n,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}s.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},s.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=i.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,n,s,c,u=this.proxyHeaderExclusiveList.concat(o),p=this.proxyHeaderWhiteList.concat(u),l=function(e,t){var r=t.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{});return Object.keys(e).filter(function(e){return r[e.toLowerCase()]}).reduce(function(t,r){return t[r]=e[r],t},{})}(t.headers,p);l.host=(r=t.uri,n=r.port,s=r.protocol,c=r.hostname+":",c+=n||("https:"===s?"443":"80")),u.forEach(t.removeHeader,t);var f=function(e){var t=function(e,t){return["https:"===e.protocol?"https":"http","https:"===t.protocol?"Https":"Http"].join("Over")}(e.uri,e.proxy);return a[t]}(t),h=function(e,t){var r=e.proxy;return{proxy:{host:r.hostname,port:+r.port,proxyAuth:r.auth,headers:t},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol}}(t,l);return t.agent=f(h),!0},s.defaultProxyHeaderWhiteList=n,s.defaultProxyHeaderExclusiveList=o,r.Tunnel=s},{"tunnel-agent":380,url:383}],312:[function(e,t,r){(function(r){"use strict";var i=e("http"),a=e("https"),n=e("url"),o=e("util"),s=e("stream"),c=e("zlib"),u=e("aws-sign2"),p=e("aws4"),l=e("http-signature"),f=e("mime-types"),h=e("caseless"),d=e("forever-agent"),m=e("form-data"),g=e("extend"),b=e("isstream"),v=e("is-typedarray").strict,y=e("./lib/helpers"),w=e("./lib/cookies"),k=e("./lib/getProxyFromURI"),_=e("./lib/querystring").Querystring,x=e("./lib/har").Har,j=e("./lib/auth").Auth,S=e("./lib/oauth").OAuth,E=e("./lib/hawk"),A=e("./lib/multipart").Multipart,F=e("./lib/redirect").Redirect,P=e("./lib/tunnel").Tunnel,z=e("performance-now"),C=e("safe-buffer").Buffer,O=y.safeStringify,T=y.isReadStream,B=y.toBase64,I=y.defer,R=y.copy,q=y.version,M=w.jar(),D={};function L(){return{uri:this.uri,method:this.method,headers:this.headers}}function N(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:L.call(this.request)}}function U(e){e.har&&(this._har=new x(this),e=this._har.options(e)),s.Stream.call(this);var t=Object.keys(U.prototype),r=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(t,e);g(this,r),e=function(e,t){var r={};for(var i in t){var a=!(-1===e.indexOf(i)),n="function"==typeof t[i];a&&n||(r[i]=t[i])}return r}(t,e),this.readable=!0,this.writable=!0,e.method&&(this.explicitMethod=!0),this._qs=new _(this),this._auth=new j(this),this._oauth=new S(this),this._multipart=new A(this),this._redirect=new F(this),this._tunnel=new P(this),this.init(e)}function H(){U.debug&&console.error("REQUEST %s",o.format.apply(o,arguments))}o.inherits(U,s.Stream),U.debug=r.env.NODE_DEBUG&&/\brequest\b/.test(r.env.NODE_DEBUG),U.prototype.debug=H,U.prototype.init=function(e){var t=this;for(var r in e||(e={}),t.headers=t.headers?R(t.headers):{},t.headers)void 0===t.headers[r]&&delete t.headers[r];if(h.httpify(t,t.headers),t.method||(t.method=e.method||"GET"),t.localAddress||(t.localAddress=e.localAddress),t._qs.init(e),H(e),t.pool||!1===t.pool||(t.pool=D),t.dests=t.dests||[],t.__isRequestRequest=!0,!t._callback&&t.callback&&(t._callback=t.callback,t.callback=function(){t._callbackCalled||(t._callbackCalled=!0,t._callback.apply(t,arguments))},t.on("error",t.callback.bind()),t.on("complete",t.callback.bind(t,null))),!t.uri&&t.url&&(t.uri=t.url,delete t.url),t.baseUrl){if("string"!=typeof t.baseUrl)return t.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof t.uri)return t.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===t.uri.indexOf("//")||-1!==t.uri.indexOf("://"))return t.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var o=t.baseUrl.lastIndexOf("/")===t.baseUrl.length-1,s=0===t.uri.indexOf("/");o&&s?t.uri=t.baseUrl+t.uri.slice(1):o||s?t.uri=t.baseUrl+t.uri:""===t.uri?t.uri=t.baseUrl:t.uri=t.baseUrl+"/"+t.uri,delete t.baseUrl}if(!t.uri)return t.emit("error",new Error("options.uri is a required argument"));if("string"==typeof t.uri&&(t.uri=n.parse(t.uri)),t.uri.href||(t.uri.href=n.format(t.uri)),"unix:"===t.uri.protocol)return t.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===t.uri.host&&t.enableUnixSocket(),!1===t.strictSSL&&(t.rejectUnauthorized=!1),t.uri.pathname||(t.uri.pathname="/"),!(t.uri.host||t.uri.hostname&&t.uri.port||t.uri.isUnix)){var c='Invalid URI "'+n.format(t.uri)+'"';return 0===Object.keys(e).length&&(c+=". This can be caused by a crappy redirection."),t.abort(),t.emit("error",new Error(c))}if(t.hasOwnProperty("proxy")||(t.proxy=k(t.uri)),t.tunnel=t._tunnel.isEnabled(),t.proxy&&t._tunnel.setup(e),t._redirect.onRequest(e),t.setHost=!1,!t.hasHeader("host")){var u=t.originalHostHeaderName||"host";t.setHeader(u,t.uri.host),t.uri.port&&("80"===t.uri.port&&"http:"===t.uri.protocol||"443"===t.uri.port&&"https:"===t.uri.protocol)&&t.setHeader(u,t.uri.hostname),t.setHost=!0}if(t.jar(t._jar||e.jar),t.uri.port||("http:"===t.uri.protocol?t.uri.port=80:"https:"===t.uri.protocol&&(t.uri.port=443)),t.proxy&&!t.tunnel?(t.port=t.proxy.port,t.host=t.proxy.hostname):(t.port=t.uri.port,t.host=t.uri.hostname),e.form&&t.form(e.form),e.formData){var p=e.formData,l=t.form(),m=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?l.append(e,t.value,t.options):l.append(e,t)};for(var g in p)if(p.hasOwnProperty(g)){var y=p[g];if(y instanceof Array)for(var w=0;w=100&&s<200||204===s||304===s))o=e;else{var u=e.headers["content-encoding"]||"identity";u=u.trim().toLowerCase();var p={flush:c.Z_SYNC_FLUSH,finishFlush:c.Z_SYNC_FLUSH};"gzip"===u?(o=c.createGunzip(p),e.pipe(o)):"deflate"===u?(o=c.createInflate(p),e.pipe(o)):("identity"!==u&&H("ignoring unrecognized Content-Encoding "+u),o=e)}t.encoding&&(0!==t.dests.length?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):o.setEncoding(t.encoding)),t._paused&&o.pause(),t.responseContent=o,t.emit("response",e),t.dests.forEach(function(e){t.pipeDest(e)}),o.on("data",function(r){t.timing&&!t.responseStarted&&(t.responseStartTime=(new Date).getTime(),e.responseStartTime=t.responseStartTime),t._destdata=!0,t.emit("data",r)}),o.once("end",function(e){t.emit("end",e)}),o.on("error",function(e){t.emit("error",e)}),o.on("close",function(){t.emit("close")}),t.callback?t.readResponseBody(e):t.on("end",function(){t._aborted?H("aborted",t.uri.href):t.emit("complete",e)}),H("finish init function",t.uri.href)}}else{H("strict ssl error",t.uri.href);var l=e.hasOwnProperty("socket")?e.socket.authorizationError:t.uri.href+" does not support SSL";t.emit("error",new Error("SSL Error: "+l))}},U.prototype.readResponseBody=function(e){var t=this;H("reading response's body");var r=[],i=0,a=[];t.on("data",function(e){C.isBuffer(e)?e.length&&(i+=e.length,r.push(e)):a.push(e)}),t.on("end",function(){if(H("end event",t.uri.href),t._aborted)return H("aborted",t.uri.href),r=[],void(i=0);if(i?(H("has body",t.uri.href,i),e.body=C.concat(r,i),null!==t.encoding&&(e.body=e.body.toString(t.encoding)),r=[],i=0):a.length&&("utf8"===t.encoding&&a[0].length>0&&"\ufeff"===a[0][0]&&(a[0]=a[0].substring(1)),e.body=a.join("")),t._json)try{e.body=JSON.parse(e.body,t._jsonReviver)}catch(e){H("invalid JSON received",t.uri.href)}H("emitting complete",t.uri.href),void 0!==e.body||t._json||(e.body=null===t.encoding?C.alloc(0):""),t.emit("complete",e,e.body)})},U.prototype.abort=function(){this._aborted=!0,this.req?this.req.abort():this.response&&this.response.destroy(),this.emit("abort")},U.prototype.pipeDest=function(e){var t=this.response;if(e.headers&&!e.headersSent){if(t.caseless.has("content-type")){var r=t.caseless.has("content-type");e.setHeader?e.setHeader(r,t.headers[r]):e.headers[r]=t.headers[r]}if(t.caseless.has("content-length")){var i=t.caseless.has("content-length");e.setHeader?e.setHeader(i,t.headers[i]):e.headers[i]=t.headers[i]}}if(e.setHeader&&!e.headersSent){for(var a in t.headers)this.gzip&&"content-encoding"===a||e.setHeader(a,t.headers[a]);e.statusCode=t.statusCode}this.pipefilter&&this.pipefilter(t,e)},U.prototype.qs=function(e,t){var r;for(var i in r=!t&&this.uri.query?this._qs.parse(this.uri.query):{},e)r[i]=e[i];var a=this._qs.stringify(r);return""===a?this:(this.uri=n.parse(this.uri.href.split("?")[0]+"?"+a),this.url=this.uri,this.path=this.uri.path,"unix"===this.uri.host&&this.enableUnixSocket(),this)},U.prototype.form=function(e){var t=this;return e?(/^application\/x-www-form-urlencoded\b/.test(t.getHeader("content-type"))||t.setHeader("content-type","application/x-www-form-urlencoded"),t.body="string"==typeof e?t._qs.rfc3986(e.toString("utf8")):t._qs.stringify(e).toString("utf8"),t):(t._form=new m,t._form.on("error",function(e){e.message="form-data: "+e.message,t.emit("error",e),t.abort()}),t._form)},U.prototype.multipart=function(e){return this._multipart.onRequest(e),this._multipart.chunked||(this.body=this._multipart.body),this},U.prototype.json=function(e){return this.hasHeader("accept")||this.setHeader("accept","application/json"),"function"==typeof this.jsonReplacer&&(this._jsonReplacer=this.jsonReplacer),this._json=!0,"boolean"==typeof e?void 0!==this.body&&(/^application\/x-www-form-urlencoded\b/.test(this.getHeader("content-type"))?this.body=this._qs.rfc3986(this.body):this.body=O(this.body,this._jsonReplacer),this.hasHeader("content-type")||this.setHeader("content-type","application/json")):(this.body=O(e,this._jsonReplacer),this.hasHeader("content-type")||this.setHeader("content-type","application/json")),"function"==typeof this.jsonReviver&&(this._jsonReviver=this.jsonReviver),this},U.prototype.getHeader=function(e,t){var r,i;return t||(t=this.headers),Object.keys(t).forEach(function(a){a.length===e.length&&(i=new RegExp(e,"i"),a.match(i)&&(r=t[a]))}),r},U.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":"),t=e[0],r=e[1];this.socketPath=t,this.uri.pathname=r,this.uri.path=r,this.uri.host=t,this.uri.hostname=t,this.uri.isUnix=!0},U.prototype.auth=function(e,t,r,i){return this._auth.onRequest(e,t,r,i),this},U.prototype.aws=function(e,t){if(!t)return this._aws=e,this;if(4===e.sign_version||"4"===e.sign_version){var r={host:this.uri.host,path:this.uri.path,method:this.method,headers:this.headers,body:this.body};e.service&&(r.service=e.service);var i=p.sign(r,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});this.setHeader("authorization",i.headers.Authorization),this.setHeader("x-amz-date",i.headers["X-Amz-Date"]),i.headers["X-Amz-Security-Token"]&&this.setHeader("x-amz-security-token",i.headers["X-Amz-Security-Token"])}else{var a=new Date;this.setHeader("date",a.toUTCString());var n={key:e.key,secret:e.secret,verb:this.method.toUpperCase(),date:a,contentType:this.getHeader("content-type")||"",md5:this.getHeader("content-md5")||"",amazonHeaders:u.canonicalizeHeaders(this.headers)},o=this.uri.path;e.bucket&&o?n.resource="/"+e.bucket+o:e.bucket&&!o?n.resource="/"+e.bucket:!e.bucket&&o?n.resource=o:e.bucket||o||(n.resource="/"),n.resource=u.canonicalizeResource(n.resource),this.setHeader("authorization",u.authorization(n))}return this},U.prototype.httpSignature=function(e){var t=this;return l.signRequest({getHeader:function(e){return t.getHeader(e,t.headers)},setHeader:function(e,r){t.setHeader(e,r)},method:t.method,path:t.path},e),H("httpSignature authorization",t.getHeader("authorization")),t},U.prototype.hawk=function(e){this.setHeader("Authorization",E.header(this.uri,this.method,e))},U.prototype.oauth=function(e){return this._oauth.onRequest(e),this},U.prototype.jar=function(e){var t;if(0===this._redirect.redirectsFollowed&&(this.originalCookieHeader=this.getHeader("cookie")),e){var r=e&&e.getCookieString?e:M,i=this.uri.href;r&&(t=r.getCookieString(i))}else t=!1,this._disableCookies=!0;return t&&t.length&&(this.originalCookieHeader?this.setHeader("cookie",this.originalCookieHeader+"; "+t):this.setHeader("cookie",t)),this._jar=e,this},U.prototype.pipe=function(e,t){if(!this.response)return this.dests.push(e),s.Stream.prototype.pipe.call(this,e,t),e;if(this._destdata)this.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else{if(!this._ended)return s.Stream.prototype.pipe.call(this,e,t),this.pipeDest(e),e;this.emit("error",new Error("You cannot pipe after the response has been ended."))}},U.prototype.write=function(){if(!this._aborted)return this._started||this.start(),this.req?this.req.write.apply(this.req,arguments):void 0},U.prototype.end=function(e){this._aborted||(e&&this.write(e),this._started||this.start(),this.req&&this.req.end())},U.prototype.pause=function(){this.responseContent?this.responseContent.pause.apply(this.responseContent,arguments):this._paused=!0},U.prototype.resume=function(){this.responseContent?this.responseContent.resume.apply(this.responseContent,arguments):this._paused=!1},U.prototype.destroy=function(){this._ended?this.response&&this.response.destroy():this.end()},U.defaultProxyHeaderWhiteList=P.defaultProxyHeaderWhiteList.slice(),U.defaultProxyHeaderExclusiveList=P.defaultProxyHeaderExclusiveList.slice(),U.prototype.toJSON=L,t.exports=U}).call(this,e("_process"))},{"./lib/auth":301,"./lib/cookies":302,"./lib/getProxyFromURI":303,"./lib/har":304,"./lib/hawk":305,"./lib/helpers":306,"./lib/multipart":307,"./lib/oauth":308,"./lib/querystring":309,"./lib/redirect":310,"./lib/tunnel":311,_process:263,"aws-sign2":69,aws4:70,caseless:112,extend:156,"forever-agent":160,"form-data":161,http:351,"http-signature":198,https:203,"is-typedarray":207,isstream:209,"mime-types":232,"performance-now":261,"safe-buffer":314,stream:350,url:383,util:388,zlib:106}],313:[function(e,t,r){"use strict";var i=e("buffer").Buffer,a=e("inherits"),n=e("hash-base"),o=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function d(e,t){return e<>>32-t}function m(e,t,r,i,a,n,o,s){return d(e+(t^r^i)+n+o|0,s)+a|0}function g(e,t,r,i,a,n,o,s){return d(e+(t&r|~t&i)+n+o|0,s)+a|0}function b(e,t,r,i,a,n,o,s){return d(e+((t|~r)^i)+n+o|0,s)+a|0}function v(e,t,r,i,a,n,o,s){return d(e+(t&i|r&~i)+n+o|0,s)+a|0}function y(e,t,r,i,a,n,o,s){return d(e+(t^(r|~i))+n+o|0,s)+a|0}a(h,n),h.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,i=0|this._b,a=0|this._c,n=0|this._d,h=0|this._e,w=0|this._a,k=0|this._b,_=0|this._c,x=0|this._d,j=0|this._e,S=0;S<80;S+=1){var E,A;S<16?(E=m(r,i,a,n,h,e[s[S]],l[0],u[S]),A=y(w,k,_,x,j,e[c[S]],f[0],p[S])):S<32?(E=g(r,i,a,n,h,e[s[S]],l[1],u[S]),A=v(w,k,_,x,j,e[c[S]],f[1],p[S])):S<48?(E=b(r,i,a,n,h,e[s[S]],l[2],u[S]),A=b(w,k,_,x,j,e[c[S]],f[2],p[S])):S<64?(E=v(r,i,a,n,h,e[s[S]],l[3],u[S]),A=g(w,k,_,x,j,e[c[S]],f[3],p[S])):(E=y(r,i,a,n,h,e[s[S]],l[4],u[S]),A=m(w,k,_,x,j,e[c[S]],f[4],p[S])),r=h,h=n,n=d(a,10),a=i,i=E,w=j,j=x,x=d(_,10),_=k,k=A}var F=this._b+a+x|0;this._b=this._c+n+j|0,this._c=this._d+h+w|0,this._d=this._e+r+k|0,this._e=this._a+i+_|0,this._a=F},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.alloc?i.alloc(20):new i(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=h},{buffer:110,"hash-base":184,inherits:205}],314:[function(e,t,r){var i=e("buffer"),a=i.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=i:(n(i,r),r.Buffer=o),o.prototype=Object.create(a.prototype),n(a,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=a(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 a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:110}],315:[function(e,t,r){(function(r){"use strict";var i,a=e("buffer"),n=a.Buffer,o={};for(i in a)a.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(o[i]=a[i]);var s=o.Buffer={};for(i in n)n.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(s[i]=n[i]);if(o.Buffer.prototype=n.prototype,s.from&&s.from!==Uint8Array.from||(s.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 n(e,t,r)}),s.alloc||(s.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 i=n(e);return t&&0!==t.length?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i}),!o.kStringMaxLength)try{o.kStringMaxLength=r.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),t.exports=o}).call(this,e("_process"))},{_process:263,buffer:110}],316:[function(e,t,r){var i=e("safe-buffer").Buffer;function a(e,t){this._block=i.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}a.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=i.from(e,t));for(var r=this._block,a=this._blockSize,n=e.length,o=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,a=(r-i)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var n=this._hash();return e?n.toString(e):n},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=a},{"safe-buffer":314}],317:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":318,"./sha1":319,"./sha224":320,"./sha256":321,"./sha384":322,"./sha512":323}],318:[function(e,t,r){var i=e("inherits"),a=e("./hash"),n=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,a.call(this,64,56)}function u(e){return e<<30|e>>>2}function p(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}i(c,a),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,a=0|this._b,n=0|this._c,s=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var f=0;f<80;++f){var h=~~(f/20),d=0|((t=i)<<5|t>>>27)+p(h,a,n,s)+c+r[f]+o[h];c=s,s=n,n=u(a),a=i,i=d}this._a=i+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=n.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":316,inherits:205,"safe-buffer":314}],319:[function(e,t,r){var i=e("inherits"),a=e("./hash"),n=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,a.call(this,64,56)}function u(e){return e<<5|e>>>27}function p(e){return e<<30|e>>>2}function l(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}i(c,a),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,a=0|this._b,n=0|this._c,s=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=(t=r[f-3]^r[f-8]^r[f-14]^r[f-16])<<1|t>>>31;for(var h=0;h<80;++h){var d=~~(h/20),m=u(i)+l(d,a,n,s)+c+r[h]+o[d]|0;c=s,s=n,n=p(a),a=i,i=m}this._a=i+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=n.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":316,inherits:205,"safe-buffer":314}],320:[function(e,t,r){var i=e("inherits"),a=e("./sha256"),n=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,n.call(this,64,56)}i(c,a),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=c},{"./hash":316,"./sha256":321,inherits:205,"safe-buffer":314}],321:[function(e,t,r){var i=e("inherits"),a=e("./hash"),n=e("safe-buffer").Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function p(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}i(c,a),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,a=0|this._b,n=0|this._c,s=0|this._d,c=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,b=0;b<16;++b)r[b]=e.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((t=r[b-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[b-7]+h(r[b-15])+r[b-16];for(var v=0;v<64;++v){var y=g+f(c)+u(c,d,m)+o[v]+r[v]|0,w=l(i)+p(i,a,n)|0;g=m,m=d,d=c,c=s+y|0,s=n,n=a,a=i,i=y+w|0}this._a=i+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=n.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=c},{"./hash":316,inherits:205,"safe-buffer":314}],322:[function(e,t,r){var i=e("inherits"),a=e("./sha512"),n=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,n.call(this,128,112)}i(c,a),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},t.exports=c},{"./hash":316,"./sha512":323,inherits:205,"safe-buffer":314}],323:[function(e,t,r){var i=e("inherits"),a=e("./hash"),n=e("safe-buffer").Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function p(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function b(e,t){return e>>>0>>0?1:0}i(c,a),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,i=0|this._bh,a=0|this._ch,n=0|this._dh,s=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,k=0|this._bl,_=0|this._cl,x=0|this._dl,j=0|this._el,S=0|this._fl,E=0|this._gl,A=0|this._hl,F=0;F<32;F+=2)t[F]=e.readInt32BE(4*F),t[F+1]=e.readInt32BE(4*F+4);for(;F<160;F+=2){var P=t[F-30],z=t[F-30+1],C=h(P,z),O=d(z,P),T=m(P=t[F-4],z=t[F-4+1]),B=g(z,P),I=t[F-14],R=t[F-14+1],q=t[F-32],M=t[F-32+1],D=O+R|0,L=C+I+b(D,O)|0;L=(L=L+T+b(D=D+B|0,B)|0)+q+b(D=D+M|0,M)|0,t[F]=L,t[F+1]=D}for(var N=0;N<160;N+=2){L=t[N],D=t[N+1];var U=p(r,i,a),H=p(w,k,_),K=l(r,w),$=l(w,r),V=f(s,j),Z=f(j,s),W=o[N],G=o[N+1],Q=u(s,c,v),X=u(j,S,E),Y=A+Z|0,J=y+V+b(Y,A)|0;J=(J=(J=J+Q+b(Y=Y+X|0,X)|0)+W+b(Y=Y+G|0,G)|0)+L+b(Y=Y+D|0,D)|0;var ee=$+H|0,te=K+U+b(ee,$)|0;y=v,A=E,v=c,E=S,c=s,S=j,s=n+J+b(j=x+Y|0,x)|0,n=a,x=_,a=i,_=k,i=r,k=w,r=J+te+b(w=Y+ee|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+k|0,this._cl=this._cl+_|0,this._dl=this._dl+x|0,this._el=this._el+j|0,this._fl=this._fl+S|0,this._gl=this._gl+E|0,this._hl=this._hl+A|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+i+b(this._bl,k)|0,this._ch=this._ch+a+b(this._cl,_)|0,this._dh=this._dh+n+b(this._dl,x)|0,this._eh=this._eh+s+b(this._el,j)|0,this._fh=this._fh+c+b(this._fl,S)|0,this._gh=this._gh+v+b(this._gl,E)|0,this._hh=this._hh+y+b(this._hl,A)|0},c.prototype._hash=function(){var e=n.allocUnsafe(64);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},t.exports=c},{"./hash":316,inherits:205,"safe-buffer":314}],324:[function(e,t,r){var i=e("safer-buffer").Buffer,a={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};a.curve25519=a.ed25519;var n={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};n.curve25519=n.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:a,privInfo:n,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":315}],325:[function(e,t,r){t.exports=g;var i=e("assert-plus"),a=e("safer-buffer").Buffer,n=e("./algs"),o=e("crypto"),s=e("./fingerprint"),c=(e("./signature"),e("./errors")),u=(e("util"),e("./utils")),p=e("./key"),l=e("./private-key"),f=e("./identity"),h={};h.openssh=e("./formats/openssh-cert"),h.x509=e("./formats/x509"),h.pem=e("./formats/x509-pem");var d=c.CertificateParseError,m=c.InvalidAlgorithmError;function g(e){i.object(e,"options"),i.arrayOfObject(e.subjects,"options.subjects"),u.assertCompatible(e.subjects[0],f,[1,0],"options.subjects"),u.assertCompatible(e.subjectKey,p,[1,0],"options.subjectKey"),u.assertCompatible(e.issuer,f,[1,0],"options.issuer"),void 0!==e.issuerKey&&u.assertCompatible(e.issuerKey,p,[1,0],"options.issuerKey"),i.object(e.signatures,"options.signatures"),i.buffer(e.serial,"options.serial"),i.date(e.validFrom,"options.validFrom"),i.date(e.validUntil,"optons.validUntil"),i.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}g.formats=h,g.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),i.string(e,"format"),i.object(h[e],"formats[format]"),i.optionalObject(t,"options"),h[e].write(this,t)},g.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},g.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),i.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new s(t)},g.prototype.hash=function(e){if(i.string(e,"algorithm"),e=e.toLowerCase(),void 0===n.hashAlgs[e])throw new m(e);if(this._hashCache[e])return this._hashCache[e];var t=o.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t,t},g.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()0&&-1===this.issuer.purposes.indexOf("ca"))&&this.isSignedByKey(e.subjectKey))},g.prototype.getExtension=function(e){return i.string(e,"keyOrOid"),this.getExtensions().filter(function(t){return"x509"===t.format?t.oid===e:"openssh"===t.format&&t.name===e})[0]},g.prototype.getExtensions=function(){var e=[],t=this.signatures.x509;t&&t.extras&&t.extras.exts&&t.extras.exts.forEach(function(t){t.format="x509",e.push(t)});var r=this.signatures.openssh;return r&&r.exts&&r.exts.forEach(function(t){t.format="openssh",e.push(t)}),e},g.prototype.isSignedByKey=function(e){if(u.assertCompatible(e,p,[1,2],"issuerKey"),void 0!==this.issuerKey)return this.issuerKey.fingerprint("sha512").matches(e);var t=Object.keys(this.signatures)[0],r=h[t].verify(this,e);return r&&(this.issuerKey=e),r},g.prototype.signWith=function(e){u.assertCompatible(e,l,[1,2],"key");for(var t=Object.keys(h),r=!1,i=0;i0&&-1===h.indexOf("serverAuth")&&h.push("serverAuth"),m.length>0&&-1===h.indexOf("clientAuth")&&h.push("clientAuth"),(m.length>0||d.length>0)&&(-1===h.indexOf("keyAgreement")&&h.push("keyAgreement"),"rsa"===t.type&&-1===h.indexOf("encryption")&&h.push("encryption"))}var b=new g({subjects:n,issuer:n[0],subjectKey:t.toPublic(),issuerKey:t.toPublic(),signatures:{},serial:p,validFrom:o,validUntil:s,purposes:h});return b.signWith(t),b},g.create=function(e,t,r,n,o){var s;s=Array.isArray(e)?e:[e],i.arrayOfObject(s),s.forEach(function(e){u.assertCompatible(e,f,[1,0],"subject")}),u.assertCompatible(t,p,[1,0],"key"),l.isPrivateKey(t)&&(t=t.toPublic()),u.assertCompatible(r,f,[1,0],"issuer"),u.assertCompatible(n,l,[1,2],"issuer key"),i.optionalObject(o,"options"),void 0===o&&(o={}),i.optionalObject(o.validFrom,"options.validFrom"),i.optionalObject(o.validUntil,"options.validUntil");var c=o.validFrom,h=o.validUntil;if(void 0===c&&(c=new Date),void 0===h){i.optionalNumber(o.lifetime,"options.lifetime");var d=o.lifetime;void 0===d&&(d=31536e4),(h=new Date).setTime(h.getTime()+1e3*d)}i.optionalBuffer(o.serial,"options.serial");var m=o.serial;void 0===m&&(m=a.from("0000000000000001","hex"));var b=o.purposes;void 0===b&&(b=[]),-1===b.indexOf("signature")&&b.push("signature"),!0===o.ca&&(-1===b.indexOf("ca")&&b.push("ca"),-1===b.indexOf("crl")&&b.push("crl"));var v=s.filter(function(e){return"host"===e.type}),y=s.filter(function(e){return"user"===e.type});v.length>0&&-1===b.indexOf("serverAuth")&&b.push("serverAuth"),y.length>0&&-1===b.indexOf("clientAuth")&&b.push("clientAuth"),(y.length>0||v.length>0)&&(-1===b.indexOf("keyAgreement")&&b.push("keyAgreement"),"rsa"===t.type&&-1===b.indexOf("encryption")&&b.push("encryption"));var w=new g({subjects:s,issuer:r,subjectKey:t,issuerKey:n.toPublic(),signatures:{},serial:m,validFrom:c,validUntil:h,purposes:b});return w.signWith(n),w},g.parse=function(e,t,r){"string"!=typeof e&&i.buffer(e,"data"),void 0===t&&(t="auto"),i.string(t,"format"),"string"==typeof r&&(r={filename:r}),i.optionalObject(r,"options"),void 0===r&&(r={}),i.optionalString(r.filename,"options.filename"),void 0===r.filename&&(r.filename="(unnamed)"),i.object(h[t],"formats[format]");try{return h[t].read(e,r)}catch(e){throw new d(r.filename,t,e)}},g.isCertificate=function(e,t){return u.isCompatible(e,g,t)},g.prototype._sshpkApiVersion=[1,1],g._oldVersionDetect=function(e){return[1,0]}},{"./algs":324,"./errors":328,"./fingerprint":329,"./formats/openssh-cert":332,"./formats/x509":341,"./formats/x509-pem":340,"./identity":342,"./key":344,"./private-key":345,"./signature":346,"./utils":348,"assert-plus":64,crypto:121,"safer-buffer":315,util:388}],326:[function(e,t,r){t.exports={DiffieHellman:d,generateECDSA:function(e){var t=[];if(l){var r={nistp256:"prime256v1",nistp384:"secp384r1",nistp521:"secp521r1"}[e],i=a.createECDH(r);return i.generateKeys(),t.push({name:"curve",data:n.from(e)}),t.push({name:"Q",data:i.getPublicKey()}),t.push({name:"d",data:i.getPrivateKey()}),new p({type:"ecdsa",curve:e,parts:t})}var o=new m(e),s=o.getN(),c=Math.ceil((s.bitLength()+64)/8),u=new h(a.randomBytes(c)),f=s.subtract(h.ONE),d=u.mod(f).add(h.ONE),g=o.getG().multiply(d);return d=n.from(d.toByteArray()),g=n.from(o.getCurve().encodePointHex(g),"hex"),t.push({name:"curve",data:n.from(e)}),t.push({name:"Q",data:g}),t.push({name:"d",data:d}),new p({type:"ecdsa",curve:e,parts:t})},generateED25519:function(){var e=c.sign.keyPair(),t=n.from(e.secretKey),r=n.from(e.publicKey);i.strictEqual(t.length,64),i.strictEqual(r.length,32);var a=[];return a.push({name:"A",data:r}),a.push({name:"k",data:t.slice(0,32)}),new p({type:"ed25519",parts:a})}};var i=e("assert-plus"),a=e("crypto"),n=e("safer-buffer").Buffer,o=e("./algs"),s=e("./utils"),c=e("tweetnacl"),u=e("./key"),p=e("./private-key"),l=void 0!==a.createECDH,f=(e("ecc-jsbn"),e("ecc-jsbn/lib/ec")),h=e("jsbn").BigInteger;function d(e){if(s.assertCompatible(e,u,[1,4],"key"),this._isPriv=p.isPrivateKey(e,[1,3]),this._algo=e.type,this._curve=e.curve,this._key=e,"dsa"===e.type){if(!l)throw new Error("Due to bugs in the node 0.10 crypto API, node 0.12.x or later is required to use DH");this._dh=a.createDiffieHellman(e.part.p.data,void 0,e.part.g.data,void 0),this._p=e.part.p,this._g=e.part.g,this._isPriv&&this._dh.setPrivateKey(e.part.x.data),this._dh.setPublicKey(e.part.y.data)}else if("ecdsa"===e.type){if(!l)return this._ecParams=new m(this._curve),void(this._isPriv&&(this._priv=new b(this._ecParams,e.part.d.data)));var t={nistp256:"prime256v1",nistp384:"secp384r1",nistp521:"secp521r1"}[e.curve];if(this._dh=a.createECDH(t),"object"!=typeof this._dh||"function"!=typeof this._dh.setPrivateKey)return l=!1,void d.call(this,e);this._isPriv&&this._dh.setPrivateKey(e.part.d.data),this._dh.setPublicKey(e.part.Q.data)}else{if("curve25519"!==e.type)throw new Error("DH not supported for "+e.type+" keys");this._isPriv&&(s.assertCompatible(e,p,[1,5],"key"),this._priv=e.part.k.data)}}function m(e){var t=o.curves[e];i.object(t);var r=new h(t.p),a=new h(t.a),n=new h(t.b),s=new h(t.n),c=h.ONE,u=new f.ECCurveFp(r,a,n),p=u.decodePointHex(t.G.toString("hex"));this.curve=u,this.g=p,this.n=s,this.h=c}function g(e,t){this._params=e,0===t[0]&&(t=t.slice(1)),this._pub=e.getCurve().decodePointHex(t.toString("hex"))}function b(e,t){this._params=e,this._priv=new h(s.mpNormalize(t))}d.prototype.getPublicKey=function(){return this._isPriv?this._key.toPublic():this._key},d.prototype.getPrivateKey=function(){return this._isPriv?this._key:void 0},d.prototype.getKey=d.prototype.getPrivateKey,d.prototype._keyCheck=function(e,t){if(i.object(e,"key"),t||s.assertCompatible(e,p,[1,3],"key"),s.assertCompatible(e,u,[1,4],"key"),e.type!==this._algo)throw new Error("A "+e.type+" key cannot be used in "+this._algo+" Diffie-Hellman");if(e.curve!==this._curve)throw new Error("A key from the "+e.curve+" curve cannot be used with a "+this._curve+" Diffie-Hellman");"dsa"===e.type&&(i.deepEqual(e.part.p,this._p,"DSA key prime does not match"),i.deepEqual(e.part.g,this._g,"DSA key generator does not match"))},d.prototype.setKey=function(e){if(this._keyCheck(e),"dsa"===e.type)this._dh.setPrivateKey(e.part.x.data),this._dh.setPublicKey(e.part.y.data);else if("ecdsa"===e.type)l?(this._dh.setPrivateKey(e.part.d.data),this._dh.setPublicKey(e.part.Q.data)):this._priv=new b(this._ecParams,e.part.d.data);else if("curve25519"===e.type){var t=e.part.k;e.part.k||(t=e.part.r),this._priv=t.data,0===this._priv[0]&&(this._priv=this._priv.slice(1)),this._priv=this._priv.slice(0,32)}this._key=e,this._isPriv=!0},d.prototype.setPrivateKey=d.prototype.setKey,d.prototype.computeSecret=function(e){if(this._keyCheck(e,!0),!this._isPriv)throw new Error("DH exchange has not been initialized with a private key yet");var t;if("dsa"===this._algo)return this._dh.computeSecret(e.part.y.data);if("ecdsa"===this._algo)return l?this._dh.computeSecret(e.part.Q.data):(t=new g(this._ecParams,e.part.Q.data),this._priv.deriveSharedSecret(t));if("curve25519"===this._algo){for(t=e.part.A.data;0===t[0]&&t.length>32;)t=t.slice(1);var r=this._priv;i.strictEqual(t.length,32),i.strictEqual(r.length,32);var a=c.box.before(new Uint8Array(t),new Uint8Array(r));return n.from(a)}throw new Error("Invalid algorithm: "+this._algo)},d.prototype.generateKey=function(){var e,t,r=[];if("dsa"===this._algo)return this._dh.generateKeys(),r.push({name:"p",data:this._p.data}),r.push({name:"q",data:this._key.part.q.data}),r.push({name:"g",data:this._g.data}),r.push({name:"y",data:this._dh.getPublicKey()}),r.push({name:"x",data:this._dh.getPrivateKey()}),this._key=new p({type:"dsa",parts:r}),this._isPriv=!0,this._key;if("ecdsa"===this._algo){if(l)return this._dh.generateKeys(),r.push({name:"curve",data:n.from(this._curve)}),r.push({name:"Q",data:this._dh.getPublicKey()}),r.push({name:"d",data:this._dh.getPrivateKey()}),this._key=new p({type:"ecdsa",curve:this._curve,parts:r}),this._isPriv=!0,this._key;var o=this._ecParams.getN(),s=new h(a.randomBytes(o.bitLength())),u=o.subtract(h.ONE);return e=s.mod(u).add(h.ONE),t=this._ecParams.getG().multiply(e),e=n.from(e.toByteArray()),t=n.from(this._ecParams.getCurve().encodePointHex(t),"hex"),this._priv=new b(this._ecParams,e),r.push({name:"curve",data:n.from(this._curve)}),r.push({name:"Q",data:t}),r.push({name:"d",data:e}),this._key=new p({type:"ecdsa",curve:this._curve,parts:r}),this._isPriv=!0,this._key}if("curve25519"===this._algo){var f=c.box.keyPair();return e=n.from(f.secretKey),t=n.from(f.publicKey),e=n.concat([e,t]),i.strictEqual(e.length,64),i.strictEqual(t.length,32),r.push({name:"A",data:t}),r.push({name:"k",data:e}),this._key=new p({type:"curve25519",parts:r}),this._isPriv=!0,this._key}throw new Error("Invalid algorithm: "+this._algo)},d.prototype.generateKeys=d.prototype.generateKey,m.prototype.getCurve=function(){return this.curve},m.prototype.getG=function(){return this.g},m.prototype.getN=function(){return this.n},m.prototype.getH=function(){return this.h},b.prototype.deriveSharedSecret=function(e){i.ok(e instanceof g);var t=e._pub.multiply(this._priv);return n.from(t.getX().toBigInteger().toByteArray())}},{"./algs":324,"./key":344,"./private-key":345,"./utils":348,"assert-plus":64,crypto:121,"ecc-jsbn":135,"ecc-jsbn/lib/ec":136,jsbn:210,"safer-buffer":315,tweetnacl:381}],327:[function(e,t,r){t.exports={Verifier:u,Signer:p};var i=e("tweetnacl"),a=e("stream"),n=e("util"),o=e("assert-plus"),s=e("safer-buffer").Buffer,c=e("./signature");function u(e,t){if("sha512"!==t.toLowerCase())throw new Error("ED25519 only supports the use of SHA-512 hashes");this.key=e,this.chunks=[],a.Writable.call(this,{})}function p(e,t){if("sha512"!==t.toLowerCase())throw new Error("ED25519 only supports the use of SHA-512 hashes");this.key=e,this.chunks=[],a.Writable.call(this,{})}n.inherits(u,a.Writable),u.prototype._write=function(e,t,r){this.chunks.push(e),r()},u.prototype.update=function(e){"string"==typeof e&&(e=s.from(e,"binary")),this.chunks.push(e)},u.prototype.verify=function(e,t){var r;if(c.isSignature(e,[2,0])){if("ed25519"!==e.type)return!1;r=e.toBuffer("raw")}else if("string"==typeof e)r=s.from(e,"base64");else if(c.isSignature(e,[1,0]))throw new Error("signature was created by too old a version of sshpk and cannot be verified");return o.buffer(r),i.sign.detached.verify(new Uint8Array(s.concat(this.chunks)),new Uint8Array(r),new Uint8Array(this.key.part.A.data))},n.inherits(p,a.Writable),p.prototype._write=function(e,t,r){this.chunks.push(e),r()},p.prototype.update=function(e){"string"==typeof e&&(e=s.from(e,"binary")),this.chunks.push(e)},p.prototype.sign=function(){var e=i.sign.detached(new Uint8Array(s.concat(this.chunks)),new Uint8Array(s.concat([this.key.part.k.data,this.key.part.A.data]))),t=s.from(e),r=c.parse(t,"ed25519","raw");return r.hashAlgorithm="sha512",r}},{"./signature":346,"assert-plus":64,"safer-buffer":315,stream:350,tweetnacl:381,util:388}],328:[function(e,t,r){e("assert-plus");var i=e("util");function a(e,t){Error.captureStackTrace&&Error.captureStackTrace(this,a),this.name="FingerprintFormatError",this.fingerprint=e,this.format=t,this.message="Fingerprint format is not supported, or is invalid: ",void 0!==e&&(this.message+=" fingerprint = "+e),void 0!==t&&(this.message+=" format = "+t)}function n(e){Error.captureStackTrace&&Error.captureStackTrace(this,n),this.name="InvalidAlgorithmError",this.algorithm=e,this.message='Algorithm "'+e+'" is not supported'}function o(e,t,r){Error.captureStackTrace&&Error.captureStackTrace(this,o),this.name="KeyParseError",this.format=t,this.keyName=e,this.innerErr=r,this.message="Failed to parse "+e+" as a valid "+t+" format key: "+r.message}function s(e,t,r){Error.captureStackTrace&&Error.captureStackTrace(this,s),this.name="SignatureParseError",this.type=e,this.format=t,this.innerErr=r,this.message="Failed to parse the given data as a "+e+" signature in "+t+" format: "+r.message}function c(e,t,r){Error.captureStackTrace&&Error.captureStackTrace(this,c),this.name="CertificateParseError",this.format=t,this.certName=e,this.innerErr=r,this.message="Failed to parse "+e+" as a valid "+t+" format certificate: "+r.message}function u(e,t){Error.captureStackTrace&&Error.captureStackTrace(this,u),this.name="KeyEncryptedError",this.format=t,this.keyName=e,this.message="The "+t+" format key "+e+" is encrypted (password-protected), and no passphrase was provided in `options`"}i.inherits(a,Error),i.inherits(n,Error),i.inherits(o,Error),i.inherits(s,Error),i.inherits(c,Error),i.inherits(u,Error),t.exports={FingerprintFormatError:a,InvalidAlgorithmError:n,KeyParseError:o,SignatureParseError:s,KeyEncryptedError:u,CertificateParseError:c}},{"assert-plus":64,util:388}],329:[function(e,t,r){t.exports=d;var i=e("assert-plus"),a=e("safer-buffer").Buffer,n=e("./algs"),o=e("crypto"),s=e("./errors"),c=e("./key"),u=e("./private-key"),p=e("./certificate"),l=e("./utils"),f=s.FingerprintFormatError,h=s.InvalidAlgorithmError;function d(e){if(i.object(e,"options"),i.string(e.type,"options.type"),i.buffer(e.hash,"options.hash"),i.string(e.algorithm,"options.algorithm"),this.algorithm=e.algorithm.toLowerCase(),!0!==n.hashAlgs[this.algorithm])throw new h(this.algorithm);this.hash=e.hash,this.type=e.type,this.hashType=e.hashType}d.prototype.toString=function(e){switch(void 0===e&&(e="md5"===this.algorithm||"spki"===this.hashType?"hex":"base64"),i.string(e),e){case"hex":return"spki"===this.hashType?this.hash.toString("hex"):this.hash.toString("hex").replace(/(.{2})(?=.)/g,"$1:");case"base64":return"spki"===this.hashType?this.hash.toString("base64"):function(e,t){return e.toUpperCase()+":"+(r=t,r.replace(/=*$/,""));var r}(this.algorithm,this.hash.toString("base64"));default:throw new f(void 0,e)}},d.prototype.matches=function(e){i.object(e,"key or certificate"),"key"===this.type&&"ssh"!==this.hashType?(l.assertCompatible(e,c,[1,7],"key with spki"),u.isPrivateKey(e)&&l.assertCompatible(e,u,[1,6],"privatekey with spki support")):"key"===this.type?l.assertCompatible(e,c,[1,0],"key"):l.assertCompatible(e,p,[1,0],"certificate");var t=e.hash(this.algorithm,this.hashType),r=o.createHash(this.algorithm).update(t).digest("base64");return void 0===this.hash2&&(this.hash2=o.createHash(this.algorithm).update(this.hash).digest("base64")),this.hash2===r};var m=/^[A-Za-z0-9+\/=]+$/,g=/^[a-fA-F0-9]+$/;d.parse=function(e,t){var r,o,s;i.string(e,"fingerprint"),Array.isArray(t)&&(s=t,t={}),i.optionalObject(t,"options"),void 0===t&&(t={}),void 0!==t.enAlgs&&(s=t.enAlgs),void 0!==t.algorithms&&(s=t.algorithms),i.optionalArrayOfString(s,"algorithms");var c="ssh";void 0!==t.hashType&&(c=t.hashType),i.string(c,"options.hashType");var u=e.split(":");if(2==u.length){if(r=u[0].toLowerCase(),!m.test(u[1]))throw new f(e);try{o=a.from(u[1],"base64")}catch(t){throw new f(e)}}else if(u.length>2){if(r="md5","md5"===u[0].toLowerCase()&&(u=u.slice(1)),u=(u=u.map(function(t){for(;t.length<2;)t="0"+t;if(t.length>2)throw new f(e);return t})).join(""),!g.test(u)||u.length%2!=0)throw new f(e);try{o=a.from(u,"hex")}catch(t){throw new f(e)}}else{if(g.test(e))o=a.from(e,"hex");else{if(!m.test(e))throw new f(e);o=a.from(e,"base64")}switch(o.length){case 32:r="sha256";break;case 16:r="md5";break;case 20:r="sha1";break;case 64:r="sha512";break;default:throw new f(e)}void 0===t.hashType&&(c="spki")}if(void 0===r)throw new f(e);if(void 0===n.hashAlgs[r])throw new h(r);if(void 0!==s&&-1===(s=s.map(function(e){return e.toLowerCase()})).indexOf(r))throw new h(r);return new d({algorithm:r,hash:o,type:t.type||"key",hashType:c})},d.isFingerprint=function(e,t){return l.isCompatible(e,d,t)},d.prototype._sshpkApiVersion=[1,2],d._oldVersionDetect=function(e){return i.func(e.toString),i.func(e.matches),[1,0]}},{"./algs":324,"./certificate":325,"./errors":328,"./key":344,"./private-key":345,"./utils":348,"assert-plus":64,crypto:121,"safer-buffer":315}],330:[function(e,t,r){t.exports={read:function(e,t){if("string"==typeof e){if(e.trim().match(/^[-]+[ ]*BEGIN/))return n.read(e,t);if(e.match(/^\s*ssh-[a-z]/))return o.read(e,t);if(e.match(/^\s*ecdsa-/))return o.read(e,t);if(e.match(/^putty-user-key-file-2:/i))return u.read(e,t);if(l(e))return c.read(e,t);e=a.from(e,"binary")}else{if(i.buffer(e),function(e){var t=0;for(;te.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return n.read(e,t);if(function(e){var t=0;for(;t3)throw new Error("Not a valid SSH certificate line");var i=r[0],a=r[1];return g(a=o.from(a,"base64"),i)},verify:function(e,t){return!1},sign:function(e,t){void 0===e.signatures.openssh&&(e.signatures.openssh={});try{var r=y(e,!0)}catch(t){return delete e.signatures.openssh,!1}var i=e.signatures.openssh,a=void 0;"rsa"!==t.type&&"dsa"!==t.type||(a="sha1");var n=t.createSign(a);return n.write(r),i.signature=n.sign(),!0},signAsync:function(e,t,r){void 0===e.signatures.openssh&&(e.signatures.openssh={});try{var i=y(e,!0)}catch(t){return delete e.signatures.openssh,void r(t)}var a=e.signatures.openssh;t(i,function(e,t){if(e)r(e);else{try{t.toBuffer("ssh")}catch(e){return void r(e)}a.signature=t,r()}})},write:function(e,t){void 0===t&&(t={});var r=y(e),i=w(e.subjectKey)+" "+r.toString("base64");t.comment&&(i=i+" "+t.comment);return i},fromBuffer:g,toBuffer:y};var i=e("assert-plus"),a=e("../ssh-buffer"),n=e("crypto"),o=e("safer-buffer").Buffer,s=e("../algs"),c=e("../key"),u=(e("../private-key"),e("../identity")),p=e("./rfc4253"),l=e("../signature"),f=e("../utils"),h=e("../certificate");var d={user:1,host:2};Object.keys(d).forEach(function(e){d[d[e]]=e});var m=/^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;function g(e,t,r){var n=new a({buffer:e}),o=n.readString();if(void 0!==t&&o!==t)throw new Error("SSH certificate algorithm mismatch");void 0===t&&(t=o);var g={signatures:{}};g.signatures.openssh={},g.signatures.openssh.nonce=n.readBuffer();var v={},y=v.parts=[];v.type=function(e){if("ssh-rsa-cert-v01@openssh.com"===e)return"rsa";if("ssh-dss-cert-v01@openssh.com"===e)return"dsa";if(e.match(m))return"ecdsa";if("ssh-ed25519-cert-v01@openssh.com"===e)return"ed25519";throw new Error("Unsupported cert type "+e)}(t);for(var w=s.info[v.type].parts.length;y.length=1,"key must have at least one part");var k=s.info[v.type];if("ecdsa"===v.type){var _=m.exec(t);i.ok(null!==_),i.strictEqual(_[1],y[0].data.toString())}for(var x=0;x0;)v=w[--_].match(/[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);i.ok(v,"invalid PEM footer"),i.equal(u[2],v[2]);var x,j=u[2].toLowerCase();u[1]&&(i.equal(u[1],v[1],"PEM header and footer mismatch"),x=u[1].trim());w=w.slice(k,_+1);var S,E,A,F={};for(;w=w.slice(1),u=w[0].match(/^([A-Za-z0-9-]+): (.+)$/);)F[u[1].toLowerCase()]=u[2];if(w=w.slice(0,-1).join(""),e=o.from(w,"base64"),F["proc-type"]){var P=F["proc-type"].split(",");if("4"===P[0]&&"ENCRYPTED"===P[1]){if("string"==typeof t.passphrase&&(t.passphrase=o.from(t.passphrase,"utf-8")),!o.isBuffer(t.passphrase))throw new d.KeyEncryptedError(t.filename,"PEM");P=F["dek-info"].split(","),i.ok(2===P.length),S=P[0].toLowerCase(),A=o.from(P[1],"hex"),E=s.opensslKeyDeriv(S,A,t.passphrase,1).key}}if(x&&"encrypted"===x.toLowerCase()){var z,C=new a.BerReader(e);C.readSequence(),C.readSequence(),z=C.offset+C.length;var O=C.readOID();if(O!==m)throw new Error("Unsupported PEM/PKCS8 encryption scheme: "+O);C.readSequence(),C.readSequence();var T=C.offset+C.length,B=C.readOID();if(B!==g)throw new Error("Unsupported PBES2 KDF: "+B);C.readSequence();var I=C.readString(a.Ber.OctetString,!0),R=C.readInt(),q="sha1";if(C.offseth.length&&(v=h.length),g+=m.write(h.slice(b,v),g),m[g++]=10,b=v}return g+=m.write("-----END "+n+"-----\n",g),m.slice(0,g)}};var i=e("assert-plus"),a=e("asn1"),n=e("crypto"),o=e("safer-buffer").Buffer,s=(e("../algs"),e("../utils")),c=e("../key"),u=e("../private-key"),p=e("./pkcs1"),l=e("./pkcs8"),f=e("./ssh-private"),h=e("./rfc4253"),d=e("../errors"),m="1.2.840.113549.1.5.13",g="1.2.840.113549.1.5.12",b={"1.2.840.113549.3.7":"3des-cbc","2.16.840.1.101.3.4.1.2":"aes128-cbc","2.16.840.1.101.3.4.1.42":"aes256-cbc"},v={};Object.keys(b).forEach(function(e){v[b[e]]=e});var y={"1.2.840.113549.2.7":"sha1","1.2.840.113549.2.9":"sha256","1.2.840.113549.2.11":"sha512"},w={};Object.keys(y).forEach(function(e){w[y[e]]=e})},{"../algs":324,"../errors":328,"../key":344,"../private-key":345,"../utils":348,"./pkcs1":334,"./pkcs8":335,"./rfc4253":337,"./ssh-private":338,asn1:63,"assert-plus":64,crypto:121,"safer-buffer":315}],334:[function(e,t,r){t.exports={read:function(e,t){return p.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return function(e){var t=f(e,"modulus"),r=f(e,"exponent");return new c({type:"rsa",parts:[{name:"e",data:r},{name:"n",data:t}]})}(r);if("private"===t)return function(e){var t=f(e,"version");i.strictEqual(t[0],0);var r=f(e,"modulus"),a=f(e,"public exponent"),n=f(e,"private exponent"),o=f(e,"prime1"),s=f(e,"prime2"),c=f(e,"exponent1"),p=f(e,"exponent2"),l=f(e,"iqmp");return new u({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:a},{name:"d",data:n},{name:"iqmp",data:l},{name:"p",data:o},{name:"q",data:s},{name:"dmodp",data:c},{name:"dmodq",data:p}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return function(e){var t=f(e,"y"),r=f(e,"p"),i=f(e,"q"),a=f(e,"g");return new c({type:"dsa",parts:[{name:"y",data:t},{name:"p",data:r},{name:"q",data:i},{name:"g",data:a}]})}(r);if("private"===t)return function(e){var t=f(e,"version");i.strictEqual(t.readUInt8(0),0);var r=f(e,"p"),a=f(e,"q"),n=f(e,"g"),o=f(e,"y"),s=f(e,"x");return new u({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:a},{name:"g",data:n},{name:"y",data:o},{name:"x",data:s}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=f(e,"version");i.strictEqual(t.readUInt8(0),1);var r=e.readString(a.Ber.OctetString,!0);e.readSequence(160);var o=l(e);i.string(o,"a known elliptic curve"),e.readSequence(161);var c=e.readString(a.Ber.BitString,!0);c=s.ecNormalize(c);var p={type:"ecdsa",parts:[{name:"curve",data:n.from(o)},{name:"Q",data:c},{name:"d",data:r}]};return new u(p)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();i.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,u=e.readOID(),p=Object.keys(o.curves),l=0;lo.length)throw new Error("Invalid public-lines count");var h=a.from(o.slice(u,u+f).join(""),"base64"),d=n.algToKeyType(p),m=n.read(h);if(m.type!==d)throw new Error("Outer key algorithm mismatch");return m.comment=l,m},write:function(e,t){if(i.object(e),!o.isKey(e))throw new Error("Must be a public key");var r=n.keyTypeToAlg(e),s=n.write(e),c=e.comment||"",u=function(e,t){var r=[],i=0;for(;i=1,"key must have at least one part"),i.ok(e||d.atEnd(),"leftover bytes at end of key");var b=s,v=n.info[f.type];if("private"!==t&&v.parts.length===h.length||(v=n.privInfo[f.type],b=c),i.strictEqual(v.parts.length,h.length),"ecdsa"===f.type){var y=/^ecdsa-sha2-(.+)$/.exec(m);i.ok(null!==y),i.strictEqual(y[1],h[0].data.toString())}for(var w=!0,k=0;kT.length&&(q=T.length),I+=O.write(T.slice(R,q),I),O[I++]=10,R=q}return I+=O.write("-----END "+C+"-----\n",I),O.slice(0,I)}};var i,a=e("assert-plus"),n=(e("asn1"),e("safer-buffer").Buffer),o=(e("../algs"),e("../utils")),s=e("crypto"),c=(e("../key"),e("../private-key")),u=e("./pem"),p=e("./rfc4253"),l=e("../ssh-buffer"),f=e("../errors");var h="openssh-key-v1"},{"../algs":324,"../errors":328,"../key":344,"../private-key":345,"../ssh-buffer":347,"../utils":348,"./pem":333,"./rfc4253":337,asn1:63,"assert-plus":64,"bcrypt-pbkdf":73,crypto:121,"safer-buffer":315}],339:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(i.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),o=r.match(s);o||(o=r.match(c));i.ok(o,"key must match regex");var u,p=n.algToKeyType(o[1]),l=a.from(o[2],"base64"),f={};if(o[4])try{u=n.read(l)}catch(e){o=r.match(c),i.ok(o,"key must match regex"),l=a.from(o[2],"base64"),u=n.readInternal(f,"public",l)}else u=n.readInternal(f,"public",l);if(i.strictEqual(p,u.type),o[4]&&o[4].length>0)u.comment=o[4];else if(f.consumed){var h=o[2]+(o[3]?o[3]:""),d=4*Math.ceil(f.consumed/3);h=h.slice(0,d-2).replace(/[^a-zA-Z0-9+\/=]/g,"")+h.slice(d-2);var m=f.consumed%3;for(m>0&&"="!==h.slice(d-1,d)&&d--;"="===h.slice(d,d+1);)d++;var g=h.slice(d);(g=g.replace(/[\r\n]/g," ").replace(/^\s+/,"")).match(/^[a-zA-Z0-9]/)&&(u.comment=g)}return u},write:function(e,t){if(i.object(e),!o.isKey(e))throw new Error("Must be a public key");var r=[],s=n.keyTypeToAlg(e);r.push(s);var c=n.write(e);r.push(c.toString("base64")),e.comment&&r.push(e.comment);return a.from(r.join(" "))}};var i=e("assert-plus"),a=e("safer-buffer").Buffer,n=e("./rfc4253"),o=(e("../utils"),e("../key")),s=(e("../private-key"),e("./ssh-private"),/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/),c=/^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/},{"../key":344,"../private-key":345,"../utils":348,"./rfc4253":337,"./ssh-private":338,"assert-plus":64,"safer-buffer":315}],340:[function(e,t,r){var i=e("./x509");t.exports={read:function(e,t){"string"!=typeof e&&(a.buffer(e,"buf"),e=e.toString("ascii"));var r,o,s=e.trim().split(/[\r\n]+/g),c=-1;for(;!r&&c0;)o=s[--u].match(/[-]+[ ]*END CERTIFICATE[ ]*[-]+/);a.ok(o,"invalid PEM footer"),s=s.slice(c,u+1);var p={};for(;s=s.slice(1),r=s[0].match(/^([A-Za-z0-9-]+): (.+)$/);)p[r[1].toLowerCase()]=r[2];return s=s.slice(0,-1).join(""),e=n.from(s,"base64"),i.read(e,t)},verify:i.verify,sign:i.sign,write:function(e,t){var r=i.write(e,t),a=r.toString("base64"),o=a.length+a.length/64+18+16+2*"CERTIFICATE".length+10,s=n.alloc(o),c=0;c+=s.write("-----BEGIN CERTIFICATE-----\n",c);for(var u=0;ua.length&&(p=a.length),c+=s.write(a.slice(u,p),c),s[c++]=10,u=p}return c+=s.write("-----END CERTIFICATE-----\n",c),s.slice(0,c)}};var a=e("assert-plus"),n=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":324,"../certificate":325,"../identity":342,"../key":344,"../private-key":345,"../signature":346,"../utils":348,"./pem":333,"./x509":341,asn1:63,"assert-plus":64,"safer-buffer":315}],341:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=n.from(e,"binary"));i.buffer(e,"buf");var r=new a.BerReader(e);if(r.readSequence(),Math.abs(r.length-r.remain)>1)throw new Error("DER sequence does not contain whole byte stream");var f=r.offset;r.readSequence();var d=r.offset+r.length,g=d;if(r.peek()===l(0)){r.readSequence(l(0));var b=r.readInt();i.ok(b<=3,"only x.509 versions up to v3 supported")}var v={signatures:{}},y=v.signatures.x509={};y.extras={},v.serial=function(e,t){return i.strictEqual(e.peek(),a.Ber.Integer,t+" is not an Integer"),o.mpNormalize(e.readString(a.Ber.Integer,!0))}(r,"serial"),r.readSequence();var w=r.offset+r.length,_=r.readOID();if(void 0===h[_])throw new Error("unknown signature algorithm "+_);r._offset=w,v.issuer=s.parseAsn1(r),r.readSequence(),v.validFrom=m(r),v.validUntil=m(r),v.subjects=[s.parseAsn1(r)],r.readSequence(),w=r.offset+r.length,v.subjectKey=p.readPkcs8(void 0,"public",r),r._offset=w,r.peek()===l(1)&&(r.readSequence(l(1)),y.extras.issuerUniqueID=e.slice(r.offset,r.offset+r.length),r._offset+=r.length);r.peek()===l(2)&&(r.readSequence(l(2)),y.extras.subjectUniqueID=e.slice(r.offset,r.offset+r.length),r._offset+=r.length);if(r.peek()===l(3)){r.readSequence(l(3));var x=r.offset+r.length;for(r.readSequence();r.offset=60?n-1:n;r.setUTCFullYear(o,parseInt(t[2],10)-1,parseInt(t[3],10)),r.setUTCHours(parseInt(t[4],10),parseInt(t[5],10)),t[6]&&t[6].length>0&&r.setUTCSeconds(parseInt(t[6],10));return r}(e.readString(a.Ber.UTCTime));if(e.peek()===a.Ber.GeneralizedTime)return function(e){var t=e.match(x);i.ok(t);var r=new Date;r.setUTCFullYear(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10)),r.setUTCHours(parseInt(t[4],10),parseInt(t[5],10)),t[6]&&t[6].length>0&&r.setUTCSeconds(parseInt(t[6],10));return r}(e.readString(a.Ber.GeneralizedTime));throw new Error("Unsupported date format")}function g(e,t){var r,i;t.getUTCFullYear()>=2050||t.getUTCFullYear()<1950?e.writeString((i="",i+=j((r=t).getUTCFullYear(),4),i+=j(r.getUTCMonth()+1),i+=j(r.getUTCDate()),i+=j(r.getUTCHours()),i+=j(r.getUTCMinutes()),i+=j(r.getUTCSeconds()),i+="Z"),a.Ber.GeneralizedTime):e.writeString(function(e){var t="";return t+=j(e.getUTCFullYear()%100),t+=j(e.getUTCMonth()+1),t+=j(e.getUTCDate()),t+=j(e.getUTCHours()),t+=j(e.getUTCMinutes()),t+=j(e.getUTCSeconds()),t+="Z"}(t),a.Ber.UTCTime)}var b={OtherName:l(0),RFC822Name:f(1),DNSName:f(2),X400Address:l(3),DirectoryName:l(4),EDIPartyName:l(5),URI:f(6),IPAddress:f(7),OID:f(8)},v={serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",joyentDocker:"1.3.6.1.4.1.38678.1.4.1",joyentCmon:"1.3.6.1.4.1.38678.1.4.2"},y={};Object.keys(v).forEach(function(e){y[v[e]]=e});var w=["signature","identity","keyEncryption","encryption","keyAgreement","ca","crl"];function k(e,t,r){r.readSequence();var i,n,o=r.offset+r.length,c=r.readOID(),u=e.signatures.x509;switch(u.extras.exts||(u.extras.exts=[]),r.peek()===a.Ber.Boolean&&(n=r.readBoolean()),c){case d.basicConstraints:r.readSequence(a.Ber.OctetString),r.readSequence();var p=r.offset+r.length,l=!1;r.peek()===a.Ber.Boolean&&(l=r.readBoolean()),void 0===e.purposes&&(e.purposes=[]),!0===l&&e.purposes.push("ca");var f={oid:c,critical:n};r.offset0||"host"===n.type||void 0!==e.purposes&&e.purposes.length>0||r.extras&&r.extras.exts){t.startSequence(l(3)),t.startSequence();var c=[];void 0!==e.purposes&&e.purposes.length>0&&(c.push({oid:d.basicConstraints,critical:!0}),c.push({oid:d.keyUsage,critical:!0}),c.push({oid:d.extKeyUsage,critical:!0})),c.push({oid:d.altName}),r.extras&&r.extras.exts&&(c=r.extras.exts);for(var u=0;u0&&(this.cn=this.componentLookup.cn[0].value),i.optionalString(e.type,"options.type"),void 0===e.type)1===this.components.length&&this.componentLookup.cn&&1===this.componentLookup.cn.length&&this.componentLookup.cn[0].value.match(s)?(this.type="host",this.hostname=this.componentLookup.cn[0].value):this.componentLookup.dc&&this.components.length===this.componentLookup.dc.length?(this.type="host",this.hostname=this.componentLookup.dc.map(function(e){return e.value}).join(".")):this.componentLookup.uid&&this.components.length===this.componentLookup.uid.length?(this.type="user",this.uid=this.componentLookup.uid[0].value):this.componentLookup.cn&&1===this.componentLookup.cn.length&&this.componentLookup.cn[0].value.match(s)?(this.type="host",this.hostname=this.componentLookup.cn[0].value):this.componentLookup.uid&&1===this.componentLookup.uid.length?(this.type="user",this.uid=this.componentLookup.uid[0].value):this.componentLookup.mail&&1===this.componentLookup.mail.length?(this.type="email",this.email=this.componentLookup.mail[0].value):this.componentLookup.cn&&1===this.componentLookup.cn.length?(this.type="user",this.uid=this.componentLookup.cn[0].value):this.type="unknown";else if(this.type=e.type,"host"===this.type)this.hostname=e.hostname;else if("user"===this.type)this.uid=e.uid;else{if("email"!==this.type)throw new Error("Unknown type "+this.type);this.email=e.email}}Object.keys(c).forEach(function(e){u[c[e]]=e}),p.prototype.toString=function(){return this.components.map(function(e){var t=e.name.toUpperCase();t=t.replace(/=/g,"\\=");var r=e.value;return t+"="+(r=r.replace(/,/g,"\\,"))}).join(", ")},p.prototype.get=function(e,t){i.string(e,"name");var r=this.componentLookup[e];if(void 0!==r&&0!==r.length){if(!t&&r.length>1)throw new Error("Multiple values for attribute "+e);return t?r.map(function(e){return e.value}):r[0].value}},p.prototype.toArray=function(e){return this.components.map(function(e){return{name:e.name,value:e.value}})};var l=/[^a-zA-Z0-9 '(),+.\/:=?-]/,f=/[^\x00-\x7f]/;function h(e,t){if("**"===e||"**"===t)return!0;var r=e.split("."),i=t.split(".");if(r.length!==i.length)return!1;for(var a=0;a0;){var n;if(null!==(n=/^,/.exec(a)))t[++r]="",a=a.slice(n[0].length);else if(null!==(n=/^\\,/.exec(a)))t[r]+=",",a=a.slice(n[0].length);else if(null!==(n=/^\\./.exec(a)))t[r]+=n[0],a=a.slice(n[0].length);else{if(null===(n=/^[^\\,]+/.exec(a)))throw new Error("Failed to parse DN");t[r]+=n[0],a=a.slice(n[0].length)}}return new p({components:t.map(function(e){for(var t=(e=e.trim()).indexOf("=");t>0&&"\\"===e.charAt(t-1);)t=e.indexOf("=",t+1);if(-1===t)throw new Error("Failed to parse DN");return{name:e.slice(0,t).toLowerCase().replace(/\\=/g,"="),value:e.slice(t+1)}})})},p.fromArray=function(e){return i.arrayOfObject(e,"components"),e.forEach(function(e){if(i.object(e,"component"),i.string(e.name,"component.name"),!o.isBuffer(e.value)&&"string"!=typeof e.value)throw new Error("Invalid component value")}),new p({components:e})},p.parseAsn1=function(e,t){var r=[];e.readSequence(t);for(var i=e.offset+e.length;e.offset1024&&(e="sha256"),"ed25519"===this.type&&(e="sha512"),"ecdsa"===this.type&&(e=this.size<=256?"sha256":this.size<=384?"sha384":"sha512"),e},g.prototype.createVerify=function(e){if(void 0===e&&(e=this.defaultHashAlgorithm()),a.string(e,"hash algorithm"),"ed25519"===this.type&&void 0!==i)return new i.Verifier(this,e);if("curve25519"===this.type)throw new Error("Curve25519 keys are not suitable for signing or verification");var t,n,s;try{n=e.toUpperCase(),t=o.createVerify(n)}catch(e){s=e}(void 0===t||s instanceof Error&&s.message.match(/Unknown message digest/))&&(n="RSA-",n+=e.toUpperCase(),t=o.createVerify(n)),a.ok(t,"failed to create verifier");var u=t.verify.bind(t),p=this.toBuffer("pkcs8"),l=this.curve,f=this;return t.verify=function(t,i){if(c.isSignature(t,[2,0]))return t.type===f.type&&((!t.hashAlgorithm||t.hashAlgorithm===e)&&((!t.curve||"ecdsa"!==f.type||t.curve===l)&&u(p,t.toBuffer("asn1"))));if("string"==typeof t||r.isBuffer(t))return u(p,t,i);throw c.isSignature(t,[1,0])?new Error("signature was created by too old a version of sshpk and cannot be verified"):new TypeError("signature must be a string, Buffer, or Signature object")},t},g.prototype.createDiffieHellman=function(){if("rsa"===this.type)throw new Error("RSA keys do not support Diffie-Hellman");return new u(this)},g.prototype.createDH=g.prototype.createDiffieHellman,g.parse=function(e,t,r){"string"!=typeof e&&a.buffer(e,"data"),void 0===t&&(t="auto"),a.string(t,"format"),"string"==typeof r&&(r={filename:r}),a.optionalObject(r,"options"),void 0===r&&(r={}),a.optionalString(r.filename,"options.filename"),void 0===r.filename&&(r.filename="(unnamed)"),a.object(m[t],"formats[format]");try{var i=m[t].read(e,r);return i instanceof f&&(i=i.toPublic()),i.comment||(i.comment=r.filename),i}catch(e){if("KeyEncryptedError"===e.name)throw e;throw new d(r.filename,t,e)}},g.isKey=function(e,t){return l.isCompatible(e,g,t)},g.prototype._sshpkApiVersion=[1,7],g._oldVersionDetect=function(e){return a.func(e.toBuffer),a.func(e.fingerprint),e.createDH?[1,4]:e.defaultHashAlgorithm?[1,3]:e.formats.auto?[1,2]:e.formats.pkcs1?[1,1]:[1,0]}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":206,"./algs":324,"./dhe":326,"./ed-compat":327,"./errors":328,"./fingerprint":329,"./formats/auto":330,"./formats/dnssec":331,"./formats/pem":333,"./formats/pkcs1":334,"./formats/pkcs8":335,"./formats/putty":336,"./formats/rfc4253":337,"./formats/ssh":339,"./formats/ssh-private":338,"./private-key":345,"./signature":346,"./utils":348,"assert-plus":64,crypto:121}],345:[function(e,t,r){t.exports=y;var i=e("assert-plus"),a=e("safer-buffer").Buffer,n=e("./algs"),o=e("crypto"),s=(e("./fingerprint"),e("./signature")),c=e("./errors"),u=e("util"),p=e("./utils"),l=e("./dhe"),f=l.generateECDSA,h=l.generateED25519,d=e("./ed-compat"),m=e("tweetnacl"),g=e("./key"),b=(c.InvalidAlgorithmError,c.KeyParseError),v=(c.KeyEncryptedError,{});function y(e){i.object(e,"options"),g.call(this,e),this._pubCache=void 0}v.auto=e("./formats/auto"),v.pem=e("./formats/pem"),v.pkcs1=e("./formats/pkcs1"),v.pkcs8=e("./formats/pkcs8"),v.rfc4253=e("./formats/rfc4253"),v["ssh-private"]=e("./formats/ssh-private"),v.openssh=v["ssh-private"],v.ssh=v["ssh-private"],v.dnssec=e("./formats/dnssec"),u.inherits(y,g),y.formats=v,y.prototype.toBuffer=function(e,t){return void 0===e&&(e="pkcs1"),i.string(e,"format"),i.object(v[e],"formats[format]"),i.optionalObject(t,"options"),v[e].write(this,t)},y.prototype.hash=function(e,t){return this.toPublic().hash(e,t)},y.prototype.fingerprint=function(e,t){return this.toPublic().fingerprint(e,t)},y.prototype.toPublic=function(){if(this._pubCache)return this._pubCache;for(var e=n.info[this.type],t=[],r=0;r20&&0===n[0]&&(n=n.slice(1)),(u=this.part.s.data).length>20&&0===u[0]&&(u=u.slice(1)),this.hashAlgorithm&&"sha1"!==this.hashAlgorithm||n.length+u.length!==40)throw new Error("OpenSSH only supports DSA signatures with SHA1 hash");return t.writeBuffer(a.concat([n,u])),t.toBuffer()}if("ssh"===e&&"ecdsa"===this.type){var l,f=new c({});n=this.part.r.data,f.writeBuffer(n),f.writePart(this.part.s),t=new c({}),0===n[0]&&(n=n.slice(1));var h=8*n.length;return 256===h?l="nistp256":384===h?l="nistp384":528===h&&(l="nistp521"),t.writeString("ecdsa-sha2-"+l),t.writeBuffer(f.toBuffer()),t.toBuffer()}throw new Error("Invalid signature format");default:throw new Error("Invalid signature data")}},l.prototype.toString=function(e){return i.optionalString(e,"format"),this.toBuffer(e).toString("base64")},l.parse=function(e,t,r){"string"==typeof e&&(e=a.from(e,"base64")),i.buffer(e,"data"),i.string(r,"format"),i.string(t,"type");var n={};n.type=t.toLowerCase(),n.parts=[];try{switch(i.ok(e.length>0,"signature must not be empty"),n.type){case"rsa":case"ed25519":return f(e,t,r,n);case"dsa":case"ecdsa":return"asn1"===r?function(e,t,r,i){var a=new s.BerReader(e);a.readSequence();var n=a.readString(s.Ber.Integer,!0),c=a.readString(s.Ber.Integer,!0);return i.parts.push({name:"r",data:o.mpNormalize(n)}),i.parts.push({name:"s",data:o.mpNormalize(c)}),new l(i)}(e,0,0,n):"dsa"===n.type?function(e,t,r,a){if(40!=e.length){var n=new c({buffer:e}),o=n.readBuffer();"ssh-dss"===o.toString("ascii")&&(o=n.readBuffer()),i.ok(n.atEnd(),"extra trailing bytes"),i.strictEqual(o.length,40,"invalid inner length"),e=o}return a.parts.push({name:"r",data:e.slice(0,20)}),a.parts.push({name:"s",data:e.slice(20,40)}),new l(a)}(e,0,0,n):function(e,t,r,a){var n,o,s=new c({buffer:e}),u=s.readBuffer(),p=u.toString("ascii");if("ecdsa-"===p.slice(0,6)){var f=p.split("-");switch(i.strictEqual(f[0],"ecdsa"),i.strictEqual(f[1],"sha2"),a.curve=f[2],a.curve){case"nistp256":a.hashAlgo="sha256";break;case"nistp384":a.hashAlgo="sha384";break;case"nistp521":a.hashAlgo="sha512";break;default:throw new Error("Unsupported ECDSA curve: "+a.curve)}u=s.readBuffer(),i.ok(s.atEnd(),"extra trailing bytes on outer"),s=new c({buffer:u}),n=s.readPart()}else n={data:u};return o=s.readPart(),i.ok(s.atEnd(),"extra trailing bytes"),n.name="r",o.name="s",a.parts.push(n),a.parts.push(o),new l(a)}(e,0,0,n);default:throw new u(t)}}catch(e){if(e instanceof u)throw e;throw new p(t,r,e)}},l.isSignature=function(e,t){return o.isCompatible(e,l,t)},l.prototype._sshpkApiVersion=[2,1],l._oldVersionDetect=function(e){return i.func(e.toBuffer),e.hasOwnProperty("hashAlgorithm")?[2,0]:[1,0]}},{"./algs":324,"./errors":328,"./ssh-buffer":347,"./utils":348,asn1:63,"assert-plus":64,crypto:121,"safer-buffer":315}],347:[function(e,t,r){t.exports=n;var i=e("assert-plus"),a=e("safer-buffer").Buffer;function n(e){i.object(e,"options"),void 0!==e.buffer&&i.buffer(e.buffer,"options.buffer"),this._size=e.buffer?e.buffer.length:1024,this._buffer=e.buffer||a.alloc(this._size),this._offset=0}n.prototype.toBuffer=function(){return this._buffer.slice(0,this._offset)},n.prototype.atEnd=function(){return this._offset>=this._buffer.length},n.prototype.remainder=function(){return this._buffer.slice(this._offset)},n.prototype.skip=function(e){this._offset+=e},n.prototype.expand=function(){this._size*=2;var e=a.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},n.prototype.readPart=function(){return{data:this.readBuffer()}},n.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},n.prototype.readString=function(){return this.readBuffer().toString()},n.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},n.prototype.writeString=function(e){this.writeBuffer(a.from(e,"utf8"))},n.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},n.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},n.prototype.writeInt64=function(e){if(i.buffer(e,"value"),e.length>8){for(var t=e.slice(0,e.length-8),r=0;rthis._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},n.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},n.prototype.writePart=function(e){this.writeBuffer(e.data)},n.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":64,"safer-buffer":315}],348:[function(e,t,r){t.exports={bufferSplit:function(e,t){i.buffer(e),i.string(t);for(var r=[],a=0,n=0,o=0;o=t.length){var s=o+1;r.push(e.slice(a,s-n)),a=s,n=0}a<=e.length&&r.push(e.slice(a,e.length));return r},addRSAMissing:function(e){i.object(e),d(e,n,[1,1]);var t,r=new l(e.part.d.data);if(!e.part.dmodp){var a=new l(e.part.p.data),o=r.mod(a.subtract(1));t=v(o),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var s=new l(e.part.q.data),c=r.mod(s.subtract(1));t=v(c),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return i.buffer(e),i.buffer(t),i.buffer(r),e=new l(e),t=new l(t),r=new l(r),v(e.modPow(r,t))},calculateED25519Public:function(e){i.buffer(e);var t=f.sign.keyPair.fromSeed(new Uint8Array(e));return a.from(t.publicKey)},calculateX25519Public:function(e){i.buffer(e);var t=f.box.keyPair.fromSeed(new Uint8Array(e));return a.from(t.publicKey)},mpNormalize:b,mpDenormalize:function(e){i.buffer(e);for(;e.length>1&&0===e[0];)e=e.slice(1);return e},ecNormalize:function(e,t){if(i.buffer(e),0===e[0]&&4===e[1])return t?e:e.slice(1);if(4===e[0]){if(!t)return e}else{for(;0===e[0];)e=e.slice(1);if(2===e[0]||3===e[0])throw new Error("Compressed elliptic curve points are not supported");if(4!==e[0])throw new Error("Not a valid elliptic curve point");if(!t)return e}var r=a.alloc(e.length+1);return r[0]=0,e.copy(r,1),r},countZeros:function(e){var t=0,r=8;for(;th)return!1;if(i.constructor.name!==t.name)return!1;var n=i._sshpkApiVersion;void 0===n&&(n=t._oldVersionDetect(e));return!(n[0]!=r[0]||n[1]t;)i.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],a+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var m={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},g=8;function b(e){for(i.buffer(e);e.length>1&&0===e[0]&&0==(128&e[1]);)e=e.slice(1);if(128==(128&e[0])){var t=a.alloc(e.length+1);t[0]=0,e.copy(t,1),e=t}return e}function v(e){var t=a.from(e.toByteArray());return t=b(t)}},{"./algs":324,"./key":344,"./private-key":345,asn1:63,"assert-plus":64,crypto:121,"ecc-jsbn/lib/ec":136,jsbn:210,"safer-buffer":315,tweetnacl:381}],349:[function(e,t,r){"use strict";var i=/\.node$/;function a(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r)}function n(e,t){return a(t,function(r){e[r]=t[r]}),e}function o(e){a(e,function(t){i.test(t)||delete e[t]})}t.exports=function(e,t,r,i){var s=n({},e);if(o(e),r){var c=!!i.children&&i.children.slice();r();var u=[];a(e,function(e){u.push(e)}),o(e),i.children&&(i.children=c);for(var p=0;pe._pos){var n=r.substr(e._pos);if("x-user-defined"===e._charset){for(var o=a.alloc(n.length),s=0;se._pos&&(e.push(a.from(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(r)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":352,_process:263,buffer:110,inherits:205,"readable-stream":369}],355:[function(e,t,r){"use strict";var i={};function a(e,t,r){r||(r=Error);var a=function(e){var r,i;function a(r,i,a){return e.call(this,function(e,r,i){return"string"==typeof t?t:t(e,r,i)}(r,i,a))||this}return i=e,(r=a).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,a}(r);a.prototype.name=r.name,a.prototype.code=e,i[e]=a}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),a("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,a,o,s;if("string"==typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(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"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+=". Received type ".concat(typeof r)},TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],356:[function(e,t,r){(function(e){"use strict";var r=new Set;t.exports.emitExperimentalWarning=e.emitWarning?function(t){if(!r.has(t)){var i=t+" is an experimental feature. This feature could change at any time";r.add(t),e.emitWarning(i,"ExperimentalWarning")}}:function(){}}).call(this,e("_process"))},{_process:263}],357:[function(e,t,r){(function(r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=u;var a=e("./_stream_readable"),n=e("./_stream_writable");e("inherits")(u,a);for(var o=i(n.prototype),s=0;s0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),i)o.endEmitted?e.emit("error",new w):E(e,o,t,!0);else if(o.ended)e.emit("error",new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?E(e,o,t,!1):C(e,o)):E(e,o,t,!1)}else i||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=A?e=A:(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 P(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(z,e))}function z(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||e.emit("readable"),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,R(e)}function C(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){u("readable nexttick read 0"),e.read(0)}function I(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function q(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;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(D,t,e))}function D(e,t){u("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var r=0,i=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):P(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&M(this),null;var i,a=t.needReadable;return u("need readable",a),(0===t.length||t.length-e0?q(e,t):null)?(t.needReadable=!0,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==i&&this.emit("data",i),i},j.prototype._read=function(e){this.emit("error",new y("_read()"))},j.prototype.pipe=function(e,t){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,u("pipe count=%d opts=%j",a.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function s(t,r){u("onunpipe"),t===i&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",d),e.removeListener("finish",m),e.removeListener("drain",p),e.removeListener("error",h),e.removeListener("unpipe",s),i.removeListener("end",c),i.removeListener("end",g),i.removeListener("data",f),l=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function c(){u("onend"),e.end()}a.endEmitted?r.nextTick(o):i.once("end",o),e.on("unpipe",s);var p=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&n(e,"data")&&(t.flowing=!0,R(e))}}(i);e.on("drain",p);var l=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==L(a.pipes,e))&&!l&&(u("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===n(e,"error")&&e.emit("error",t)}function d(){e.removeListener("finish",m),g()}function m(){u("onfinish"),e.removeListener("close",d),g()}function g(){u("unpipe"),i.unpipe(e)}return i.on("data",f),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",h),e.once("close",d),e.once("finish",m),e.emit("pipe",i),a.flowing||(u("pipe resume"),i.resume()),e},j.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?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var n=0;n0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,u("on readable",a.length,a.reading),a.length?P(this):a.reading||r.nextTick(B,this))),i},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var i=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(T,this),i},j.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(T,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(I,e,t))}(this,e)),e.paused=!1,this},j.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var a in e.on("end",function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){(u("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(i=!0,e.pause()))}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var n=0;n<_.length;n++)e.on(_[n],this.emit.bind(this,_[n]));return this._read=function(t){u("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(j.prototype[Symbol.asyncIterator]=function(){return k("Readable[Symbol.asyncIterator]"),void 0===f&&(f=e("./internal/streams/async_iterator")),f(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),j._fromList=q,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":355,"../experimentalWarning":356,"./_stream_duplex":357,"./internal/streams/async_iterator":362,"./internal/streams/buffer_list":363,"./internal/streams/destroy":364,"./internal/streams/state":367,"./internal/streams/stream":368,_process:263,buffer:110,events:154,inherits:205,"string_decoder/":370,util:77}],360:[function(e,t,r){"use strict";t.exports=p;var i=e("../errors").codes,a=i.ERR_METHOD_NOT_IMPLEMENTED,n=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=i.ERR_TRANSFORM_WITH_LENGTH_0,c=e("./_stream_duplex");function u(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length-1))throw new k(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,r){r(new m("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,i){var a=this._writableState;return"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||function(e,t,i){t.ending=!0,z(e,t),i&&(t.finished?r.nextTick(i):e.once("finish",i));t.ended=!0,e.writable=!1}(this,a,i),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),j.prototype.destroy=l.destroy,j.prototype._undestroy=l.undestroy,j.prototype._destroy=function(e,t){t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":355,"./_stream_duplex":357,"./internal/streams/destroy":364,"./internal/streams/state":367,"./internal/streams/stream":368,_process:263,buffer:110,inherits:205,"util-deprecate":385}],362:[function(e,t,r){(function(r){"use strict";var i;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var n=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),p=Symbol("lastPromise"),l=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function d(e){var t=e[o];if(null!==t){var r=e[f].read();null!==r&&(e[p]=null,e[o]=null,e[s]=null,t(h(r,!1)))}}var m=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((a(i={get stream(){return this[f]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(t,i){r.nextTick(function(){e[c]?i(e[c]):t(h(void 0,!0))})});var i,a=this[p];if(a)i=new Promise(function(e,t){return function(r,i){e.then(function(){t[u]?r(h(void 0,!0)):t[l](r,i)},i)}}(a,this));else{var n=this[f].read();if(null!==n)return Promise.resolve(h(n,!1));i=new Promise(this[l])}return this[p]=i,i}},Symbol.asyncIterator,function(){return this}),a(i,"return",function(){var e=this;return new Promise(function(t,r){e[f].destroy(null,function(e){e?r(e):t(h(void 0,!0))})})}),i),m);t.exports=function(e){var t,i=Object.create(g,(a(t={},f,{value:e,writable:!0}),a(t,o,{value:null,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,c,{value:null,writable:!0}),a(t,u,{value:e._readableState.endEmitted,writable:!0}),a(t,l,{value:function(e,t){var r=i[f].read();r?(i[p]=null,i[o]=null,i[s]=null,e(h(r,!1))):(i[o]=e,i[s]=t)},writable:!0}),t));return i[p]=null,n(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[s];return null!==t&&(i[p]=null,i[o]=null,i[s]=null,t(e)),void(i[c]=e)}var r=i[o];null!==r&&(i[p]=null,i[o]=null,i[s]=null,r(h(void 0,!0))),i[u]=!0}),e.on("readable",function(e){r.nextTick(d,e)}.bind(null,i)),i}}).call(this,e("_process"))},{"./end-of-stream":365,_process:263}],363:[function(e,t,r){"use strict";function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("buffer").Buffer,n=e("util").inspect,o=n&&n.custom||"inspect";t.exports=function(){function e(){this.head=null,this.tail=null,this.length=0}var t=e.prototype;return t.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},t.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},t.shift=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}},t.clear=function(){this.head=this.tail=null,this.length=0},t.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},t.concat=function(e){if(0===this.length)return a.alloc(0);for(var t,r,i,n=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=n,i=s,a.prototype.copy.call(t,r,i),s+=o.data.length,o=o.next;return n},t.consume=function(e,t){var r;return ea.length?a.length:e;if(n===a.length?i+=a:i+=a.slice(0,e),0===(e-=n)){n===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(n));break}++r}return this.length-=r,i},t._getBuffer=function(e){var t=a.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0===(e-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,t},t[o]=function(e,t){return n(this,function(e){for(var t=1;t0,function(e){p||(p=e),e&&f.forEach(c),n||(f.forEach(c),l(p))})});return r.reduce(u)}},{"../../../errors":355,"./end-of-stream":365}],367:[function(e,t,r){"use strict";var i=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,a){var n=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new i(a?r:"highWaterMark",n);return Math.floor(n)}return e.objectMode?16:16384}}},{"../../../errors":355}],368:[function(e,t,r){arguments[4][290][0].apply(r,arguments)},{dup:290,events:154}],369:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":357,"./lib/_stream_passthrough.js":358,"./lib/_stream_readable.js":359,"./lib/_stream_transform.js":360,"./lib/_stream_writable.js":361,"./lib/internal/streams/end-of-stream.js":365,"./lib/internal/streams/pipeline.js":366}],370:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=i.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 n(e){var t;switch(this.encoding=function(e){var t=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}}(e);if("string"!=typeof t&&(i.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=p,this.end=l,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(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 c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=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 u(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 p(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 l(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 h(e){return e&&e.length?this.write(e):""}r.StringDecoder=n,n.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=0)return a>0&&(e.lastNeed=a-1),a;if(--i=0)return a>0&&(e.lastNeed=a-2),a;if(--i=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;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)},n.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}},{"safe-buffer":371}],371:[function(e,t,r){arguments[4][291][0].apply(r,arguments)},{buffer:110,dup:291}],372:[function(e,t,r){(function(t,i){var a=e("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,s={},c=0;function u(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=c++,i=!(arguments.length<2)&&o.call(arguments,1);return s[t]=!0,a(function(){s[t]&&(i?e.apply(null,i):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof i?i:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":263,timers:372}],373:[function(e,t,r){"use strict";var i,a=e("net"),n=e("url").parse,o=e("util"),s=e("./pubsuffix-psl"),c=e("./store").Store,u=e("./memstore").MemoryCookieStore,p=e("./pathMatch").pathMatch,l=e("../package.json").version;try{i=e("punycode")}catch(e){console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization")}var f=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/,h=/[\x00-\x1F]/,d=["\n","\r","\0"],m=/[\x20-\x3A\x3C-\x7E]+/,g=/[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/,b={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],w=2147483647e3;function k(e,t,r,i){for(var a=0;a=58)break;a++}return ar?null:i||a==e.length?parseInt(e.substr(0,a),10):null}function _(e){var t=e.split(":"),r=[0,0,0];if(3!==t.length)return null;for(var i=0;i<3;i++){var a=2==i,n=k(t[i],1,2,a);if(null===n)return null;r[i]=n}return r}function x(e){e=String(e).substr(0,3).toLowerCase();var t=b[e];return t>=0?t:null}function j(e){if(e){var t=e.split(g);if(t){for(var r=null,i=null,a=null,n=null,o=null,s=null,c=0;c=70&&s<=99?s+=1900:s>=0&&s<=69&&(s+=2e3)):o=u:n=u}if(!(null===n||null===o||null===s||null===a||n<1||n>31||s<1601||r>23||i>59||a>59))return new Date(Date.UTC(s,o,n,r,i,a))}}}function S(e){var t=e.getUTCDate();t=t>=10?t:"0"+t;var r=e.getUTCHours();r=r>=10?r:"0"+r;var i=e.getUTCMinutes();i=i>=10?i:"0"+i;var a=e.getUTCSeconds();return a=a>=10?a:"0"+a,y[e.getUTCDay()]+", "+t+" "+v[e.getUTCMonth()]+" "+e.getUTCFullYear()+" "+r+":"+i+":"+a+" GMT"}function E(e){return null==e?null:(e=e.trim().replace(/^\./,""),i&&/[^\u0001-\u007f]/.test(e)&&(e=i.toASCII(e)),e.toLowerCase())}function A(e,t,r){if(null==e||null==t)return null;if(!1!==r&&(e=E(e),t=E(t)),e==t)return!0;if(a.isIP(e))return!1;var i=e.indexOf(t);return!(i<=0)&&(e.length===t.length+i&&"."===e.substr(i-1,1))}function F(e){if(!e||"/"!==e.substr(0,1))return"/";if("/"===e)return e;var t=e.lastIndexOf("/");return 0===t?"/":e.slice(0,t)}function P(e,t){var r,i,a=(e=function(e){for(var t=0;t1;){var r=e.lastIndexOf("/");if(0===r)break;e=e.substr(0,r),t.push(e)}return t.push("/"),t},r.canonicalDomain=E},{"../package.json":379,"./memstore":374,"./pathMatch":375,"./permuteDomain":376,"./pubsuffix-psl":377,"./store":378,net:107,punycode:108,url:383,util:388}],374:[function(e,t,r){"use strict";var i=e("./store").Store,a=e("./permuteDomain").permuteDomain,n=e("./pathMatch").pathMatch,o=e("util");function s(){i.call(this),this.idx={}}o.inherits(s,i),r.MemoryCookieStore=s,s.prototype.idx=null,s.prototype.synchronous=!0,s.prototype.inspect=function(){return"{ idx: "+o.inspect(this.idx,!1,2)+" }"},o.inspect.custom&&(s.prototype[o.inspect.custom]=s.prototype.inspect),s.prototype.findCookie=function(e,t,r,i){return this.idx[e]&&this.idx[e][t]?i(null,this.idx[e][t][r]||null):i(null,void 0)},s.prototype.findCookies=function(e,t,r){var i,o=[];if(!e)return r(null,[]);i=t?function(e){Object.keys(e).forEach(function(r){if(n(t,r)){var i=e[r];for(var a in i)o.push(i[a])}})}:function(e){for(var t in e){var r=e[t];for(var i in r)o.push(r[i])}};var s=a(e)||[e],c=this.idx;s.forEach(function(e){var t=c[e];t&&i(t)}),r(null,o)},s.prototype.putCookie=function(e,t){this.idx[e.domain]||(this.idx[e.domain]={}),this.idx[e.domain][e.path]||(this.idx[e.domain][e.path]={}),this.idx[e.domain][e.path][e.key]=e,t(null)},s.prototype.updateCookie=function(e,t,r){this.putCookie(t,r)},s.prototype.removeCookie=function(e,t,r,i){this.idx[e]&&this.idx[e][t]&&this.idx[e][t][r]&&delete this.idx[e][t][r],i(null)},s.prototype.removeCookies=function(e,t,r){return this.idx[e]&&(t?delete this.idx[e][t]:delete this.idx[e]),r(null)},s.prototype.getAllCookies=function(e){var t=[],r=this.idx;Object.keys(r).forEach(function(e){Object.keys(r[e]).forEach(function(i){Object.keys(r[e][i]).forEach(function(a){null!==a&&t.push(r[e][i][a])})})}),t.sort(function(e,t){return(e.creationIndex||0)-(t.creationIndex||0)}),e(null,t)}},{"./pathMatch":375,"./permuteDomain":376,"./store":378,util:388}],375:[function(e,t,r){"use strict";r.pathMatch=function(e,t){if(t===e)return!0;if(0===e.indexOf(t)){if("/"===t.substr(-1))return!0;if("/"===e.substr(t.length,1))return!0}return!1}},{}],376:[function(e,t,r){"use strict";var i=e("./pubsuffix-psl");r.permuteDomain=function(e){var t=i.getPublicSuffix(e);if(!t)return null;if(t==e)return[e];for(var r=e.slice(0,-(t.length+1)).split(".").reverse(),a=t,n=[a];r.length;)a=r.shift()+"."+a,n.push(a);return n}},{"./pubsuffix-psl":377}],377:[function(e,t,r){"use strict";var i=e("psl");r.getPublicSuffix=function(e){return i.get(e)}},{psl:265}],378:[function(e,t,r){"use strict";function i(){}r.Store=i,i.prototype.synchronous=!1,i.prototype.findCookie=function(e,t,r,i){throw new Error("findCookie is not implemented")},i.prototype.findCookies=function(e,t,r){throw new Error("findCookies is not implemented")},i.prototype.putCookie=function(e,t){throw new Error("putCookie is not implemented")},i.prototype.updateCookie=function(e,t,r){throw new Error("updateCookie is not implemented")},i.prototype.removeCookie=function(e,t,r,i){throw new Error("removeCookie is not implemented")},i.prototype.removeCookies=function(e,t,r){throw new Error("removeCookies is not implemented")},i.prototype.getAllCookies=function(e){throw new Error("getAllCookies is not implemented (therefore jar cannot be serialized)")}},{}],379:[function(e,t,r){t.exports={_from:"tough-cookie@~2.4.3",_id:"tough-cookie@2.4.3",_inBundle:!1,_integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",_location:"/tough-cookie",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"tough-cookie@~2.4.3",name:"tough-cookie",escapedName:"tough-cookie",rawSpec:"~2.4.3",saveSpec:null,fetchSpec:"~2.4.3"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_spec:"tough-cookie@~2.4.3",_where:"W:\\projects\\git\\node-quickbase\\node_modules\\request",author:{name:"Jeremy Stashewsky",email:"jstash@gmail.com"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},bundleDependencies:!1,contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},deprecated:!1,description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},engines:{node:">=0.8"},files:["lib"],homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","cookie","cookies","set-cookie","cookiejar","jar","RFC6265","RFC2965"],license:"BSD-3-Clause",main:"./lib/cookie",name:"tough-cookie",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],380:[function(e,t,r){(function(t){"use strict";e("net");var i,a=e("tls"),n=e("http"),o=e("https"),s=e("events"),c=e("assert"),u=e("util"),p=e("safe-buffer").Buffer;function l(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||n.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",function(e,r,i){for(var a=0,n=t.requests.length;a=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},l.prototype.createConnection=function(e){var t=this;t.createSocket(e,function(r){function i(){t.emit("free",r,e.host,e.port)}function a(e){t.removeSocket(r),r.removeListener("free",i),r.removeListener("close",a),r.removeListener("agentRemove",a)}r.on("free",i),r.on("close",a),r.on("agentRemove",a),e.request.onSocket(r)})},l.prototype.createSocket=function(e,r){var a=this,n={};a.sockets.push(n);var o=h({},a.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1});o.proxyAuth&&(o.headers=o.headers||{},o.headers["Proxy-Authorization"]="Basic "+p.from(o.proxyAuth).toString("base64")),i("making CONNECT request");var s=a.request(o);function u(t,o,u){if(s.removeAllListeners(),o.removeAllListeners(),200===t.statusCode)c.equal(u.length,0),i("tunneling connection has established"),a.sockets[a.sockets.indexOf(n)]=o,r(o);else{i("tunneling socket could not be established, statusCode=%d",t.statusCode);var p=new Error("tunneling socket could not be established, statusCode="+t.statusCode);p.code="ECONNRESET",e.request.emit("error",p),a.removeSocket(n)}}s.useChunkedEncodingByDefault=!1,s.once("response",function(e){e.upgrade=!0}),s.once("upgrade",function(e,r,i){t.nextTick(function(){u(e,r,i)})}),s.once("connect",u),s.once("error",function(t){s.removeAllListeners(),i("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var r=new Error("tunneling socket could not be established, cause="+t.message);r.code="ECONNRESET",e.request.emit("error",r),a.removeSocket(n)}),s.end()},l.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},i=t.env.NODE_DEBUG&&/\btunnel\b/.test(t.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},r.debug=i}).call(this,e("_process"))},{_process:263,assert:65,events:154,http:351,https:203,net:107,"safe-buffer":314,tls:107,util:388}],381:[function(e,t,r){!function(t){"use strict";var r=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function m(e,t,r,i,a){var n,o=0;for(n=0;n>>8)-1}function g(e,t,r,i){return m(e,t,r,i,16)}function b(e,t,r,i){return m(e,t,r,i,32)}function v(e,t,r,i){!function(e,t,r,i){for(var a,n=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,p=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,k=n,_=o,x=s,j=c,S=u,E=p,A=l,F=f,P=h,z=d,C=m,O=g,T=b,B=v,I=y,R=w,q=0;q<20;q+=2)k^=(a=(T^=(a=(P^=(a=(S^=(a=k+T|0)<<7|a>>>25)+k|0)<<9|a>>>23)+S|0)<<13|a>>>19)+P|0)<<18|a>>>14,E^=(a=(_^=(a=(B^=(a=(z^=(a=E+_|0)<<7|a>>>25)+E|0)<<9|a>>>23)+z|0)<<13|a>>>19)+B|0)<<18|a>>>14,C^=(a=(A^=(a=(x^=(a=(I^=(a=C+A|0)<<7|a>>>25)+C|0)<<9|a>>>23)+I|0)<<13|a>>>19)+x|0)<<18|a>>>14,R^=(a=(O^=(a=(F^=(a=(j^=(a=R+O|0)<<7|a>>>25)+R|0)<<9|a>>>23)+j|0)<<13|a>>>19)+F|0)<<18|a>>>14,k^=(a=(j^=(a=(x^=(a=(_^=(a=k+j|0)<<7|a>>>25)+k|0)<<9|a>>>23)+_|0)<<13|a>>>19)+x|0)<<18|a>>>14,E^=(a=(S^=(a=(F^=(a=(A^=(a=E+S|0)<<7|a>>>25)+E|0)<<9|a>>>23)+A|0)<<13|a>>>19)+F|0)<<18|a>>>14,C^=(a=(z^=(a=(P^=(a=(O^=(a=C+z|0)<<7|a>>>25)+C|0)<<9|a>>>23)+O|0)<<13|a>>>19)+P|0)<<18|a>>>14,R^=(a=(I^=(a=(B^=(a=(T^=(a=R+I|0)<<7|a>>>25)+R|0)<<9|a>>>23)+T|0)<<13|a>>>19)+B|0)<<18|a>>>14;k=k+n|0,_=_+o|0,x=x+s|0,j=j+c|0,S=S+u|0,E=E+p|0,A=A+l|0,F=F+f|0,P=P+h|0,z=z+d|0,C=C+m|0,O=O+g|0,T=T+b|0,B=B+v|0,I=I+y|0,R=R+w|0,e[0]=k>>>0&255,e[1]=k>>>8&255,e[2]=k>>>16&255,e[3]=k>>>24&255,e[4]=_>>>0&255,e[5]=_>>>8&255,e[6]=_>>>16&255,e[7]=_>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=j>>>0&255,e[13]=j>>>8&255,e[14]=j>>>16&255,e[15]=j>>>24&255,e[16]=S>>>0&255,e[17]=S>>>8&255,e[18]=S>>>16&255,e[19]=S>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=F>>>0&255,e[29]=F>>>8&255,e[30]=F>>>16&255,e[31]=F>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=z>>>0&255,e[37]=z>>>8&255,e[38]=z>>>16&255,e[39]=z>>>24&255,e[40]=C>>>0&255,e[41]=C>>>8&255,e[42]=C>>>16&255,e[43]=C>>>24&255,e[44]=O>>>0&255,e[45]=O>>>8&255,e[46]=O>>>16&255,e[47]=O>>>24&255,e[48]=T>>>0&255,e[49]=T>>>8&255,e[50]=T>>>16&255,e[51]=T>>>24&255,e[52]=B>>>0&255,e[53]=B>>>8&255,e[54]=B>>>16&255,e[55]=B>>>24&255,e[56]=I>>>0&255,e[57]=I>>>8&255,e[58]=I>>>16&255,e[59]=I>>>24&255,e[60]=R>>>0&255,e[61]=R>>>8&255,e[62]=R>>>16&255,e[63]=R>>>24&255}(e,t,r,i)}function y(e,t,r,i){!function(e,t,r,i){for(var a,n=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,p=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,k=0;k<20;k+=2)n^=(a=(b^=(a=(h^=(a=(u^=(a=n+b|0)<<7|a>>>25)+n|0)<<9|a>>>23)+u|0)<<13|a>>>19)+h|0)<<18|a>>>14,p^=(a=(o^=(a=(v^=(a=(d^=(a=p+o|0)<<7|a>>>25)+p|0)<<9|a>>>23)+d|0)<<13|a>>>19)+v|0)<<18|a>>>14,m^=(a=(l^=(a=(s^=(a=(y^=(a=m+l|0)<<7|a>>>25)+m|0)<<9|a>>>23)+y|0)<<13|a>>>19)+s|0)<<18|a>>>14,w^=(a=(g^=(a=(f^=(a=(c^=(a=w+g|0)<<7|a>>>25)+w|0)<<9|a>>>23)+c|0)<<13|a>>>19)+f|0)<<18|a>>>14,n^=(a=(c^=(a=(s^=(a=(o^=(a=n+c|0)<<7|a>>>25)+n|0)<<9|a>>>23)+o|0)<<13|a>>>19)+s|0)<<18|a>>>14,p^=(a=(u^=(a=(f^=(a=(l^=(a=p+u|0)<<7|a>>>25)+p|0)<<9|a>>>23)+l|0)<<13|a>>>19)+f|0)<<18|a>>>14,m^=(a=(d^=(a=(h^=(a=(g^=(a=m+d|0)<<7|a>>>25)+m|0)<<9|a>>>23)+g|0)<<13|a>>>19)+h|0)<<18|a>>>14,w^=(a=(y^=(a=(v^=(a=(b^=(a=w+y|0)<<7|a>>>25)+w|0)<<9|a>>>23)+b|0)<<13|a>>>19)+v|0)<<18|a>>>14;e[0]=n>>>0&255,e[1]=n>>>8&255,e[2]=n>>>16&255,e[3]=n>>>24&255,e[4]=p>>>0&255,e[5]=p>>>8&255,e[6]=p>>>16&255,e[7]=p>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=l>>>0&255,e[17]=l>>>8&255,e[18]=l>>>16&255,e[19]=l>>>24&255,e[20]=f>>>0&255,e[21]=f>>>8&255,e[22]=f>>>16&255,e[23]=f>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,a,n,o){var s,c,u=new Uint8Array(16),p=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=n[c];for(;a>=64;){for(v(p,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^p[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;a-=64,t+=64,i+=64}if(a>0)for(v(p,u,o,w),c=0;c=64;){for(v(c,s,a,w),o=0;o<64;o++)e[t+o]=c[o];for(n=1,o=8;o<16;o++)n=n+(255&s[o])|0,s[o]=255&n,n>>>=8;r-=64,t+=64}if(r>0)for(v(c,s,a,w),o=0;o>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),a=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|a<<9),n=255&e[8]|(255&e[9])<<8,this.r[4]=255&(a>>>4|n<<12),this.r[5]=n>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(n>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function E(e,t,r,i,a,n){var o=new S(n);return o.update(r,i,a),o.finish(e,t),0}function A(e,t,r,i,a,n){var o=new Uint8Array(16);return E(o,0,r,i,a,n),g(e,t,o,0)}function F(e,t,r,i,a){var n;if(r<32)return-1;for(j(e,0,t,0,r,i,a),E(e,16,e,32,r-32,e),n=0;n<16;n++)e[n]=0;return 0}function P(e,t,r,i,a){var n,o=new Uint8Array(32);if(r<32)return-1;if(x(o,0,32,i,a),0!==A(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,a),n=0;n<32;n++)e[n]=0;return 0}function z(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function C(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function O(e,t,r){for(var i,a=~(r-1),n=0;n<16;n++)i=a&(e[n]^t[n]),e[n]^=i,t[n]^=i}function T(e,t){var i,a,n,o=r(),s=r();for(i=0;i<16;i++)s[i]=t[i];for(C(s),C(s),C(s),a=0;a<2;a++){for(o[0]=s[0]-65517,i=1;i<15;i++)o[i]=s[i]-65535-(o[i-1]>>16&1),o[i-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),n=o[15]>>16&1,o[14]&=65535,O(s,o,1-n)}for(i=0;i<16;i++)e[2*i]=255&s[i],e[2*i+1]=s[i]>>8}function B(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return T(r,e),T(i,t),b(r,0,i,0)}function I(e){var t=new Uint8Array(32);return T(t,e),1&t[0]}function R(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function q(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function M(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function D(e,t,r){var i,a,n=0,o=0,s=0,c=0,u=0,p=0,l=0,f=0,h=0,d=0,m=0,g=0,b=0,v=0,y=0,w=0,k=0,_=0,x=0,j=0,S=0,E=0,A=0,F=0,P=0,z=0,C=0,O=0,T=0,B=0,I=0,R=r[0],q=r[1],M=r[2],D=r[3],L=r[4],N=r[5],U=r[6],H=r[7],K=r[8],$=r[9],V=r[10],Z=r[11],W=r[12],G=r[13],Q=r[14],X=r[15];n+=(i=t[0])*R,o+=i*q,s+=i*M,c+=i*D,u+=i*L,p+=i*N,l+=i*U,f+=i*H,h+=i*K,d+=i*$,m+=i*V,g+=i*Z,b+=i*W,v+=i*G,y+=i*Q,w+=i*X,o+=(i=t[1])*R,s+=i*q,c+=i*M,u+=i*D,p+=i*L,l+=i*N,f+=i*U,h+=i*H,d+=i*K,m+=i*$,g+=i*V,b+=i*Z,v+=i*W,y+=i*G,w+=i*Q,k+=i*X,s+=(i=t[2])*R,c+=i*q,u+=i*M,p+=i*D,l+=i*L,f+=i*N,h+=i*U,d+=i*H,m+=i*K,g+=i*$,b+=i*V,v+=i*Z,y+=i*W,w+=i*G,k+=i*Q,_+=i*X,c+=(i=t[3])*R,u+=i*q,p+=i*M,l+=i*D,f+=i*L,h+=i*N,d+=i*U,m+=i*H,g+=i*K,b+=i*$,v+=i*V,y+=i*Z,w+=i*W,k+=i*G,_+=i*Q,x+=i*X,u+=(i=t[4])*R,p+=i*q,l+=i*M,f+=i*D,h+=i*L,d+=i*N,m+=i*U,g+=i*H,b+=i*K,v+=i*$,y+=i*V,w+=i*Z,k+=i*W,_+=i*G,x+=i*Q,j+=i*X,p+=(i=t[5])*R,l+=i*q,f+=i*M,h+=i*D,d+=i*L,m+=i*N,g+=i*U,b+=i*H,v+=i*K,y+=i*$,w+=i*V,k+=i*Z,_+=i*W,x+=i*G,j+=i*Q,S+=i*X,l+=(i=t[6])*R,f+=i*q,h+=i*M,d+=i*D,m+=i*L,g+=i*N,b+=i*U,v+=i*H,y+=i*K,w+=i*$,k+=i*V,_+=i*Z,x+=i*W,j+=i*G,S+=i*Q,E+=i*X,f+=(i=t[7])*R,h+=i*q,d+=i*M,m+=i*D,g+=i*L,b+=i*N,v+=i*U,y+=i*H,w+=i*K,k+=i*$,_+=i*V,x+=i*Z,j+=i*W,S+=i*G,E+=i*Q,A+=i*X,h+=(i=t[8])*R,d+=i*q,m+=i*M,g+=i*D,b+=i*L,v+=i*N,y+=i*U,w+=i*H,k+=i*K,_+=i*$,x+=i*V,j+=i*Z,S+=i*W,E+=i*G,A+=i*Q,F+=i*X,d+=(i=t[9])*R,m+=i*q,g+=i*M,b+=i*D,v+=i*L,y+=i*N,w+=i*U,k+=i*H,_+=i*K,x+=i*$,j+=i*V,S+=i*Z,E+=i*W,A+=i*G,F+=i*Q,P+=i*X,m+=(i=t[10])*R,g+=i*q,b+=i*M,v+=i*D,y+=i*L,w+=i*N,k+=i*U,_+=i*H,x+=i*K,j+=i*$,S+=i*V,E+=i*Z,A+=i*W,F+=i*G,P+=i*Q,z+=i*X,g+=(i=t[11])*R,b+=i*q,v+=i*M,y+=i*D,w+=i*L,k+=i*N,_+=i*U,x+=i*H,j+=i*K,S+=i*$,E+=i*V,A+=i*Z,F+=i*W,P+=i*G,z+=i*Q,C+=i*X,b+=(i=t[12])*R,v+=i*q,y+=i*M,w+=i*D,k+=i*L,_+=i*N,x+=i*U,j+=i*H,S+=i*K,E+=i*$,A+=i*V,F+=i*Z,P+=i*W,z+=i*G,C+=i*Q,O+=i*X,v+=(i=t[13])*R,y+=i*q,w+=i*M,k+=i*D,_+=i*L,x+=i*N,j+=i*U,S+=i*H,E+=i*K,A+=i*$,F+=i*V,P+=i*Z,z+=i*W,C+=i*G,O+=i*Q,T+=i*X,y+=(i=t[14])*R,w+=i*q,k+=i*M,_+=i*D,x+=i*L,j+=i*N,S+=i*U,E+=i*H,A+=i*K,F+=i*$,P+=i*V,z+=i*Z,C+=i*W,O+=i*G,T+=i*Q,B+=i*X,w+=(i=t[15])*R,o+=38*(_+=i*M),s+=38*(x+=i*D),c+=38*(j+=i*L),u+=38*(S+=i*N),p+=38*(E+=i*U),l+=38*(A+=i*H),f+=38*(F+=i*K),h+=38*(P+=i*$),d+=38*(z+=i*V),m+=38*(C+=i*Z),g+=38*(O+=i*W),b+=38*(T+=i*G),v+=38*(B+=i*Q),y+=38*(I+=i*X),n=(i=(n+=38*(k+=i*q))+(a=1)+65535)-65536*(a=Math.floor(i/65536)),o=(i=o+a+65535)-65536*(a=Math.floor(i/65536)),s=(i=s+a+65535)-65536*(a=Math.floor(i/65536)),c=(i=c+a+65535)-65536*(a=Math.floor(i/65536)),u=(i=u+a+65535)-65536*(a=Math.floor(i/65536)),p=(i=p+a+65535)-65536*(a=Math.floor(i/65536)),l=(i=l+a+65535)-65536*(a=Math.floor(i/65536)),f=(i=f+a+65535)-65536*(a=Math.floor(i/65536)),h=(i=h+a+65535)-65536*(a=Math.floor(i/65536)),d=(i=d+a+65535)-65536*(a=Math.floor(i/65536)),m=(i=m+a+65535)-65536*(a=Math.floor(i/65536)),g=(i=g+a+65535)-65536*(a=Math.floor(i/65536)),b=(i=b+a+65535)-65536*(a=Math.floor(i/65536)),v=(i=v+a+65535)-65536*(a=Math.floor(i/65536)),y=(i=y+a+65535)-65536*(a=Math.floor(i/65536)),w=(i=w+a+65535)-65536*(a=Math.floor(i/65536)),n=(i=(n+=a-1+37*(a-1))+(a=1)+65535)-65536*(a=Math.floor(i/65536)),o=(i=o+a+65535)-65536*(a=Math.floor(i/65536)),s=(i=s+a+65535)-65536*(a=Math.floor(i/65536)),c=(i=c+a+65535)-65536*(a=Math.floor(i/65536)),u=(i=u+a+65535)-65536*(a=Math.floor(i/65536)),p=(i=p+a+65535)-65536*(a=Math.floor(i/65536)),l=(i=l+a+65535)-65536*(a=Math.floor(i/65536)),f=(i=f+a+65535)-65536*(a=Math.floor(i/65536)),h=(i=h+a+65535)-65536*(a=Math.floor(i/65536)),d=(i=d+a+65535)-65536*(a=Math.floor(i/65536)),m=(i=m+a+65535)-65536*(a=Math.floor(i/65536)),g=(i=g+a+65535)-65536*(a=Math.floor(i/65536)),b=(i=b+a+65535)-65536*(a=Math.floor(i/65536)),v=(i=v+a+65535)-65536*(a=Math.floor(i/65536)),y=(i=y+a+65535)-65536*(a=Math.floor(i/65536)),w=(i=w+a+65535)-65536*(a=Math.floor(i/65536)),n+=a-1+37*(a-1),e[0]=n,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=p,e[6]=l,e[7]=f,e[8]=h,e[9]=d,e[10]=m,e[11]=g,e[12]=b,e[13]=v,e[14]=y,e[15]=w}function L(e,t){D(e,t,t)}function N(e,t){var i,a=r();for(i=0;i<16;i++)a[i]=t[i];for(i=253;i>=0;i--)L(a,a),2!==i&&4!==i&&D(a,a,t);for(i=0;i<16;i++)e[i]=a[i]}function U(e,t,i){var a,n,o=new Uint8Array(32),s=new Float64Array(80),u=r(),p=r(),l=r(),f=r(),h=r(),d=r();for(n=0;n<31;n++)o[n]=t[n];for(o[31]=127&t[31]|64,o[0]&=248,R(s,i),n=0;n<16;n++)p[n]=s[n],f[n]=u[n]=l[n]=0;for(u[0]=f[0]=1,n=254;n>=0;--n)O(u,p,a=o[n>>>3]>>>(7&n)&1),O(l,f,a),q(h,u,l),M(u,u,l),q(l,p,f),M(p,p,f),L(f,h),L(d,u),D(u,l,u),D(l,p,h),q(h,u,l),M(u,u,l),L(p,u),M(l,f,d),D(u,l,c),q(u,u,f),D(l,l,u),D(u,f,d),D(f,p,s),L(p,h),O(u,p,a),O(l,f,a);for(n=0;n<16;n++)s[n+16]=u[n],s[n+32]=l[n],s[n+48]=p[n],s[n+64]=f[n];var m=s.subarray(32),g=s.subarray(16);return N(m,m),D(g,g,m),T(e,g),0}function H(e,t){return U(e,t,n)}function K(e,t){return i(t,32),H(e,t)}function $(e,t,r){var i=new Uint8Array(32);return U(i,r,t),y(e,a,i,w)}S.prototype.blocks=function(e,t,r){for(var i,a,n,o,s,c,u,p,l,f,h,d,m,g,b,v,y,w,k,_=this.fin?0:2048,x=this.h[0],j=this.h[1],S=this.h[2],E=this.h[3],A=this.h[4],F=this.h[5],P=this.h[6],z=this.h[7],C=this.h[8],O=this.h[9],T=this.r[0],B=this.r[1],I=this.r[2],R=this.r[3],q=this.r[4],M=this.r[5],D=this.r[6],L=this.r[7],N=this.r[8],U=this.r[9];r>=16;)f=l=0,f+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*T,f+=(j+=8191&(i>>>13|(a=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),f+=(S+=8191&(a>>>10|(n=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*N),f+=(E+=8191&(n>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*L),l=(f+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,f&=8191,f+=(F+=s>>>1&8191)*(5*M),f+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*q),f+=(z+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*R),f+=(C+=8191&(u>>>8|(p=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*I),h=l+=(f+=(O+=p>>>5|_)*(5*B))>>>13,h+=x*B,h+=j*T,h+=S*(5*U),h+=E*(5*N),l=(h+=A*(5*L))>>>13,h&=8191,h+=F*(5*D),h+=P*(5*M),h+=z*(5*q),h+=C*(5*R),l+=(h+=O*(5*I))>>>13,h&=8191,d=l,d+=x*I,d+=j*B,d+=S*T,d+=E*(5*U),l=(d+=A*(5*N))>>>13,d&=8191,d+=F*(5*L),d+=P*(5*D),d+=z*(5*M),d+=C*(5*q),m=l+=(d+=O*(5*R))>>>13,m+=x*R,m+=j*I,m+=S*B,m+=E*T,l=(m+=A*(5*U))>>>13,m&=8191,m+=F*(5*N),m+=P*(5*L),m+=z*(5*D),m+=C*(5*M),g=l+=(m+=O*(5*q))>>>13,g+=x*q,g+=j*R,g+=S*I,g+=E*B,l=(g+=A*T)>>>13,g&=8191,g+=F*(5*U),g+=P*(5*N),g+=z*(5*L),g+=C*(5*D),b=l+=(g+=O*(5*M))>>>13,b+=x*M,b+=j*q,b+=S*R,b+=E*I,l=(b+=A*B)>>>13,b&=8191,b+=F*T,b+=P*(5*U),b+=z*(5*N),b+=C*(5*L),v=l+=(b+=O*(5*D))>>>13,v+=x*D,v+=j*M,v+=S*q,v+=E*R,l=(v+=A*I)>>>13,v&=8191,v+=F*B,v+=P*T,v+=z*(5*U),v+=C*(5*N),y=l+=(v+=O*(5*L))>>>13,y+=x*L,y+=j*D,y+=S*M,y+=E*q,l=(y+=A*R)>>>13,y&=8191,y+=F*I,y+=P*B,y+=z*T,y+=C*(5*U),w=l+=(y+=O*(5*N))>>>13,w+=x*N,w+=j*L,w+=S*D,w+=E*M,l=(w+=A*q)>>>13,w&=8191,w+=F*R,w+=P*I,w+=z*B,w+=C*T,k=l+=(w+=O*(5*U))>>>13,k+=x*U,k+=j*N,k+=S*L,k+=E*D,l=(k+=A*M)>>>13,k&=8191,k+=F*q,k+=P*R,k+=z*I,k+=C*B,x=f=8191&(l=(l=((l+=(k+=O*T)>>>13)<<2)+l|0)+(f&=8191)|0),j=h+=l>>>=13,S=d&=8191,E=m&=8191,A=g&=8191,F=b&=8191,P=v&=8191,z=y&=8191,C=w&=8191,O=k&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=j,this.h[2]=S,this.h[3]=E,this.h[4]=A,this.h[5]=F,this.h[6]=P,this.h[7]=z,this.h[8]=C,this.h[9]=O},S.prototype.finish=function(e,t){var r,i,a,n,o=new Uint16Array(10);if(this.leftover){for(n=this.leftover,this.buffer[n++]=1;n<16;n++)this.buffer[n]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,n=2;n<10;n++)this.h[n]+=r,r=this.h[n]>>>13,this.h[n]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,n=1;n<10;n++)o[n]=this.h[n]+r,r=o[n]>>>13,o[n]&=8191;for(o[9]-=8192,i=(1^r)-1,n=0;n<10;n++)o[n]&=i;for(i=~i,n=0;n<10;n++)this.h[n]=this.h[n]&i|o[n];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),a=this.h[0]+this.pad[0],this.h[0]=65535&a,n=1;n<8;n++)a=(this.h[n]+this.pad[n]|0)+(a>>>16)|0,this.h[n]=65535&a;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},S.prototype.update=function(e,t,r){var i,a;if(this.leftover){for((a=16-this.leftover)>r&&(a=r),i=0;i=16&&(a=r-r%16,this.blocks(e,t,a),t+=a,r-=a),r){for(i=0;i=128;){for(_=0;_<16;_++)x=8*_+G,z[_]=r[x+0]<<24|r[x+1]<<16|r[x+2]<<8|r[x+3],C[_]=r[x+4]<<24|r[x+5]<<16|r[x+6]<<8|r[x+7];for(_=0;_<80;_++)if(a=O,n=T,o=B,s=I,c=R,u=q,p=M,D,f=L,h=N,d=U,m=H,g=K,b=$,v=V,Z,E=65535&(S=Z),A=S>>>16,F=65535&(j=D),P=j>>>16,E+=65535&(S=(K>>>14|R<<18)^(K>>>18|R<<14)^(R>>>9|K<<23)),A+=S>>>16,F+=65535&(j=(R>>>14|K<<18)^(R>>>18|K<<14)^(K>>>9|R<<23)),P+=j>>>16,E+=65535&(S=K&$^~K&V),A+=S>>>16,F+=65535&(j=R&q^~R&M),P+=j>>>16,j=W[2*_],E+=65535&(S=W[2*_+1]),A+=S>>>16,F+=65535&j,P+=j>>>16,j=z[_%16],A+=(S=C[_%16])>>>16,F+=65535&j,P+=j>>>16,F+=(A+=(E+=65535&S)>>>16)>>>16,E=65535&(S=k=65535&E|A<<16),A=S>>>16,F=65535&(j=w=65535&F|(P+=F>>>16)<<16),P=j>>>16,E+=65535&(S=(L>>>28|O<<4)^(O>>>2|L<<30)^(O>>>7|L<<25)),A+=S>>>16,F+=65535&(j=(O>>>28|L<<4)^(L>>>2|O<<30)^(L>>>7|O<<25)),P+=j>>>16,A+=(S=L&N^L&U^N&U)>>>16,F+=65535&(j=O&T^O&B^T&B),P+=j>>>16,l=65535&(F+=(A+=(E+=65535&S)>>>16)>>>16)|(P+=F>>>16)<<16,y=65535&E|A<<16,E=65535&(S=m),A=S>>>16,F=65535&(j=s),P=j>>>16,A+=(S=k)>>>16,F+=65535&(j=w),P+=j>>>16,T=a,B=n,I=o,R=s=65535&(F+=(A+=(E+=65535&S)>>>16)>>>16)|(P+=F>>>16)<<16,q=c,M=u,D=p,O=l,N=f,U=h,H=d,K=m=65535&E|A<<16,$=g,V=b,Z=v,L=y,_%16==15)for(x=0;x<16;x++)j=z[x],E=65535&(S=C[x]),A=S>>>16,F=65535&j,P=j>>>16,j=z[(x+9)%16],E+=65535&(S=C[(x+9)%16]),A+=S>>>16,F+=65535&j,P+=j>>>16,w=z[(x+1)%16],E+=65535&(S=((k=C[(x+1)%16])>>>1|w<<31)^(k>>>8|w<<24)^(k>>>7|w<<25)),A+=S>>>16,F+=65535&(j=(w>>>1|k<<31)^(w>>>8|k<<24)^w>>>7),P+=j>>>16,w=z[(x+14)%16],A+=(S=((k=C[(x+14)%16])>>>19|w<<13)^(w>>>29|k<<3)^(k>>>6|w<<26))>>>16,F+=65535&(j=(w>>>19|k<<13)^(k>>>29|w<<3)^w>>>6),P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,z[x]=65535&F|P<<16,C[x]=65535&E|A<<16;E=65535&(S=L),A=S>>>16,F=65535&(j=O),P=j>>>16,j=e[0],A+=(S=t[0])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[0]=O=65535&F|P<<16,t[0]=L=65535&E|A<<16,E=65535&(S=N),A=S>>>16,F=65535&(j=T),P=j>>>16,j=e[1],A+=(S=t[1])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[1]=T=65535&F|P<<16,t[1]=N=65535&E|A<<16,E=65535&(S=U),A=S>>>16,F=65535&(j=B),P=j>>>16,j=e[2],A+=(S=t[2])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[2]=B=65535&F|P<<16,t[2]=U=65535&E|A<<16,E=65535&(S=H),A=S>>>16,F=65535&(j=I),P=j>>>16,j=e[3],A+=(S=t[3])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[3]=I=65535&F|P<<16,t[3]=H=65535&E|A<<16,E=65535&(S=K),A=S>>>16,F=65535&(j=R),P=j>>>16,j=e[4],A+=(S=t[4])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[4]=R=65535&F|P<<16,t[4]=K=65535&E|A<<16,E=65535&(S=$),A=S>>>16,F=65535&(j=q),P=j>>>16,j=e[5],A+=(S=t[5])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[5]=q=65535&F|P<<16,t[5]=$=65535&E|A<<16,E=65535&(S=V),A=S>>>16,F=65535&(j=M),P=j>>>16,j=e[6],A+=(S=t[6])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[6]=M=65535&F|P<<16,t[6]=V=65535&E|A<<16,E=65535&(S=Z),A=S>>>16,F=65535&(j=D),P=j>>>16,j=e[7],A+=(S=t[7])>>>16,F+=65535&j,P+=j>>>16,P+=(F+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[7]=D=65535&F|P<<16,t[7]=Z=65535&E|A<<16,G+=128,i-=128}return i}function Q(e,t,r){var i,a=new Int32Array(8),n=new Int32Array(8),o=new Uint8Array(256),s=r;for(a[0]=1779033703,a[1]=3144134277,a[2]=1013904242,a[3]=2773480762,a[4]=1359893119,a[5]=2600822924,a[6]=528734635,a[7]=1541459225,n[0]=4089235720,n[1]=2227873595,n[2]=4271175723,n[3]=1595750129,n[4]=2917565137,n[5]=725511199,n[6]=4215389547,n[7]=327033209,G(a,n,t,r),r%=128,i=0;i=0;--a)Y(e,t,i=r[a/8|0]>>(7&a)&1),X(t,e),X(e,e),Y(e,t,i)}function te(e,t){var i=[r(),r(),r(),r()];z(i[0],l),z(i[1],f),z(i[2],s),D(i[3],l,f),ee(e,i,t)}function re(e,t,a){var n,o=new Uint8Array(64),s=[r(),r(),r(),r()];for(a||i(t,32),Q(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,te(s,o),J(e,s),n=0;n<32;n++)t[n+32]=e[n];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,a,n;for(i=63;i>=32;--i){for(r=0,a=i-32,n=i-12;a>8,t[a]-=256*r;t[a]+=r,t[i]=0}for(r=0,a=0;a<32;a++)t[a]+=r-(t[31]>>4)*ie[a],r=t[a]>>8,t[a]&=255;for(a=0;a<32;a++)t[a]-=r*ie[a];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function ne(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function oe(e,t,i,a){var n,o,s=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),p=new Float64Array(64),l=[r(),r(),r(),r()];Q(s,a,32),s[0]&=248,s[31]&=127,s[31]|=64;var f=i+64;for(n=0;n=0;i--)L(a,a),1!==i&&D(a,a,t);for(i=0;i<16;i++)e[i]=a[i]}(i,i),D(i,i,n),D(i,i,c),D(i,i,c),D(e[0],i,c),L(a,e[0]),D(a,a,c),B(a,n)&&D(e[0],e[0],h),L(a,e[0]),D(a,a,c),B(a,n)?-1:(I(e[0])===t[31]>>7&&M(e[0],o,e[0]),D(e[3],e[0],e[1]),0)}function ce(e,t,i,a){var n,o=new Uint8Array(32),s=new Uint8Array(64),c=[r(),r(),r(),r()],u=[r(),r(),r(),r()];if(-1,i<64)return-1;if(se(u,a))return-1;for(n=0;n=0},t.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return re(e,t),{publicKey:e,secretKey:t}},t.sign.keyPair.fromSecretKey=function(e){if(me(e),64!==e.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),r=0;r1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,a=1;a= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,m=String.fromCharCode;function g(e){throw new RangeError(h[e])}function b(e,t){var r=e.split("@"),i="";r.length>1&&(i=r[0]+"@",e=r[1]);var a=function(e,t){for(var r=[],i=e.length;i--;)r[i]=t(e[i]);return r}((e=e.replace(f,".")).split("."),t).join(".");return i+a}function v(e){for(var t=[],r=0,i=e.length;r=55296&&a<=56319&&r>1,e+=d(e/t);e>455;i+=36)e=d(e/35);return d(i+36*e/(e+38))},k=function(e){var t,r=[],i=e.length,a=0,n=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var c=0;c=128&&g("not-basic"),r.push(e.charCodeAt(c));for(var p=s>0?s+1:0;p=i&&g("invalid-input");var m=(t=e.charCodeAt(p++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>d((u-a)/f))&&g("overflow"),a+=m*f;var b=h<=o?1:h>=o+26?26:h-o;if(md(u/v)&&g("overflow"),f*=v}var y=r.length+1;o=w(a-l,y,0==l),d(a/y)>u-n&&g("overflow"),n+=d(a/y),a%=y,r.splice(a++,0,n)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=v(e)).length,i=128,a=0,n=72,o=!0,s=!1,c=void 0;try{for(var p,l=e[Symbol.iterator]();!(o=(p=l.next()).done);o=!0){var f=p.value;f<128&&t.push(m(f))}}catch(e){s=!0,c=e}finally{try{!o&&l.return&&l.return()}finally{if(s)throw c}}var h=t.length,b=h;for(h&&t.push("-");b=i&&Ad((u-a)/F)&&g("overflow"),a+=(k-i)*F,i=k;var P=!0,z=!1,C=void 0;try{for(var O,T=e[Symbol.iterator]();!(P=(O=T.next()).done);P=!0){var B=O.value;if(Bu&&g("overflow"),B==i){for(var I=a,R=36;;R+=36){var q=R<=n?1:R>=n+26?26:R-n;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function E(e){for(var t="",r=0,i=e.length;r=194&&a<224){if(i-r>=6){var n=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&a)<<6|63&n)}else t+=e.substr(r,6);r+=6}else if(a>=224){if(i-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&a)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function A(e,t){function r(e){var r=E(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,a)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,a)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,a)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,a)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,a)),e}function F(e){return e.replace(/^0*(.*)/,"$1")||"0"}function P(e,t){var r=e.match(t.IPV4ADDRESS)||[],i=c(r,2)[1];return i?i.split(".").map(F).join("."):e}function z(e,t){var r=e.match(t.IPV6ADDRESS)||[],i=c(r,3),a=i[1],n=i[2];if(a){for(var o=a.toLowerCase().split("::").reverse(),s=c(o,2),u=s[0],p=s[1],l=p?p.split(":").map(F):[],f=u.split(":").map(F),h=t.IPV4ADDRESS.test(f[f.length-1]),d=h?7:8,m=f.length-d,g=Array(d),b=0;b1){var w=g.slice(0,v.index),k=g.slice(v.index+v.length);y=w.join(":")+"::"+k.join(":")}else y=g.join(":");return n&&(y+="%"+n),y}return e}var C=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,O=void 0==="".match(/(){0}/)[1];function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var a=e.match(C);if(a){O?(r.scheme=a[1],r.userinfo=a[3],r.host=a[4],r.port=parseInt(a[5],10),r.path=a[6]||"",r.query=a[7],r.fragment=a[8],isNaN(r.port)&&(r.port=a[5])):(r.scheme=a[1]||void 0,r.userinfo=-1!==e.indexOf("@")?a[3]:void 0,r.host=-1!==e.indexOf("//")?a[4]:void 0,r.port=parseInt(a[5],10),r.path=a[6]||"",r.query=-1!==e.indexOf("?")?a[7]:void 0,r.fragment=-1!==e.indexOf("#")?a[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?a[4]:void 0)),r.host&&(r.host=z(P(r.host,i),i)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var n=j[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||n&&n.unicodeSupport)A(r,i);else{if(r.host&&(t.domainHost||n&&n.domainHost))try{r.host=x.toASCII(r.host.replace(i.PCT_ENCODED,E).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}A(r,o)}n&&n.parse&&n.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var B=/^\.\.?\//,I=/^\/\.(\/|$)/,R=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function M(e){for(var t=[];e.length;)if(e.match(B))e=e.replace(B,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(R))e=e.replace(R,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(q);if(!r)throw new Error("Unexpected dot segment condition");var i=r[0];e=e.slice(i.length),t.push(i)}return t.join("")}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,i=[],a=j[(t.scheme||e.scheme||"").toLowerCase()];if(a&&a.serialize&&a.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||a&&a.domainHost)try{e.host=t.iri?x.toUnicode(e.host):x.toASCII(e.host.replace(r.PCT_ENCODED,E).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}A(e,r),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var n=function(e,t){var r=!1!==t.iri?s:o,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(z(P(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"==typeof e.port&&(i.push(":"),i.push(e.port.toString(10))),i.length?i.join(""):void 0}(e,t);if(void 0!==n&&("suffix"!==t.reference&&i.push("//"),i.push(n),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||a&&a.absolutePath||(c=M(c)),void 0===n&&(c=c.replace(/^\/\//,"/%2F")),i.push(c)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function L(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};return arguments[3]||(e=T(D(e,r),r),t=T(D(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=M(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=M(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=M(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=M(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function N(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,E)}var U={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},H={scheme:"https",domainHost:U.domainHost,parse:U.parse,serialize:U.serialize},K={},$="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",V="[0-9A-Fa-f]",Z=r(r("%[EFef][0-9A-Fa-f]%"+V+V+"%"+V+V)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+V+V)+"|"+r("%"+V+V)),W=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),G=new RegExp($,"g"),Q=new RegExp(Z,"g"),X=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),Y=new RegExp(t("[^]",$,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),J=Y;function ee(e){var t=E(e);return t.match(G)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var a=!1,n={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),p=["'"].concat(u),l=["%","/","?",";","#"].concat(p),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=e("querystring");function y(e,t,r){if(e&&a.isObject(e)&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}n.prototype.parse=function(e,t,r){if(!a.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),s=-1!==n&&n127?T+="x":T+=O[B];if(!T.match(h)){var R=z.slice(0,A),q=z.slice(A+1),M=O.match(d);M&&(R.push(M[1]),q.unshift(M[2])),q.length&&(y="/"+q.join(".")+y),this.hostname=R.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=i.toASCII(this.hostname));var D=this.port?":"+this.port:"",L=this.hostname||"";this.host=L+D,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[_])for(A=0,C=p.length;A0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift());return r.search=e.search,r.query=e.query,a.isNull(r.pathname)&&a.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=x.slice(-1)[0],E=(r.host||e.host||x.length>1)&&("."===S||".."===S)||""===S,A=0,F=x.length;F>=0;F--)"."===(S=x[F])?x.splice(F,1):".."===S?(x.splice(F,1),A++):A&&(x.splice(F,1),A--);if(!k&&!_)for(;A--;A)x.unshift("..");!k||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var P,z=""===x[0]||x[0]&&"/"===x[0].charAt(0);j&&(r.hostname=r.host=z?"":x.length?x.shift():"",(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift()));return(k=k||r.host&&x.length)&&!z&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),a.isNull(r.pathname)&&a.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":384,punycode:108,querystring:279}],384:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],385:[function(e,t,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],386:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],387:[function(e,t,r){arguments[4][67][0].apply(r,arguments)},{dup:67}],388:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{"./support/isBuffer":387,_process:263,dup:68,inherits:386}],389:[function(e,t,r){for(var i=[],a=0;a<256;++a)i[a]=(a+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,a=i;return[a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]]].join("")}},{}],390:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var a=new Uint8Array(16);t.exports=function(){return i(a),a}}else{var n=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},{}],391:[function(e,t,r){var i=e("./lib/rng"),a=e("./lib/bytesToUuid");t.exports=function(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||i)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[n+s]=o[s];return t||a(o)}},{"./lib/bytesToUuid":389,"./lib/rng":390}],392:[function(e,t,r){var i=e("assert-plus"),a=e("util"),n=e("extsprintf"),o=e("core-util-is").isError,s=n.sprintf;function c(e){var t,r,a,n;if(i.object(e,"args"),i.bool(e.strict,"args.strict"),i.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},a=[];else if(o(t[0]))r={cause:t[0]},a=t.slice(1);else if("object"==typeof t[0]){for(n in r={},t[0])r[n]=t[0][n];a=t.slice(1)}else i.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},a=t;return i.object(r),r.strict||e.strict||(a=a.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===a.length?"":s.apply(null,a)}}function u(){var e,t,r,a,n,s,p;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof u))return t=Object.create(u.prototype),u.apply(t,arguments),t;if((r=c({argv:e,strict:!1})).options.name&&(i.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,s=r.shortmessage,(a=r.options.cause)&&(i.ok(o(a),"cause is not an Error"),this.jse_cause=a,r.options.skipCauseMessage||(s+=": "+a.message)),this.jse_info={},r.options.info)for(p in r.options.info)this.jse_info[p]=r.options.info[p];return this.message=s,Error.call(this,s),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function p(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof p?(i=(r=c({argv:e,strict:!0})).options,u.call(this,i,"%s",r.shortmessage),this):(t=Object.create(p.prototype),p.apply(t,arguments),t)}function l(e){i.array(e,"list of errors"),i.ok(e.length>0,"must be at least one error"),this.ase_errors=e,u.call(this,{cause:e[0]},"first of %d error%s",e.length,1==e.length?"":"s")}function f(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof f?((i=(r=c({argv:e,strict:!1})).options).skipCauseMessage=!0,u.call(this,i,"%s",r.shortmessage),this):(t=Object.create(f.prototype),f.apply(t,e),t)}t.exports=u,u.VError=u,u.SError=p,u.WError=f,u.MultiError=l,a.inherits(u,Error),u.prototype.name="VError",u.prototype.toString=function(){var e=this.hasOwnProperty("name")&&this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e+=": "+this.message),e},u.prototype.cause=function(){var e=u.cause(this);return null===e?void 0:e},u.cause=function(e){return i.ok(o(e),"err must be an Error"),o(e.jse_cause)?e.jse_cause:null},u.info=function(e){var t,r,a;if(i.ok(o(e),"err must be an Error"),t=null!==(r=u.cause(e))?u.info(r):{},"object"==typeof e.jse_info&&null!==e.jse_info)for(a in e.jse_info)t[a]=e.jse_info[a];return t},u.findCauseByName=function(e,t){var r;for(i.ok(o(e),"err must be an Error"),i.string(t,"name"),i.ok(t.length>0,"name cannot be empty"),r=e;null!==r;r=u.cause(r))if(i.ok(o(r)),r.name==t)return r;return null},u.hasCauseWithName=function(e,t){return null!==u.findCauseByName(e,t)},u.fullStack=function(e){i.ok(o(e),"err must be an Error");var t=u.cause(e);return t?e.stack+"\ncaused by: "+u.fullStack(t):e.stack},u.errorFromList=function(e){return i.arrayOfObject(e,"errors"),0===e.length?null:(e.forEach(function(e){i.ok(o(e))}),1==e.length?e[0]:new l(e))},u.errorForEach=function(e,t){i.ok(o(e),"err must be an Error"),i.func(t,"func"),e instanceof l?e.errors().forEach(function(e){t(e)}):t(e)},a.inherits(p,u),a.inherits(l,u),l.prototype.name="MultiError",l.prototype.errors=function(){return this.ase_errors.slice(0)},a.inherits(f,u),f.prototype.name="WError",f.prototype.toString=function(){var e=this.hasOwnProperty("name")&&this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e+=": "+this.message),this.jse_cause&&this.jse_cause.message&&(e+="; caused by "+this.jse_cause.toString()),e},f.prototype.cause=function(e){return o(e)&&(this.jse_cause=e),this.jse_cause}},{"assert-plus":64,"core-util-is":115,extsprintf:157,util:388}],393:[function(require,module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r