!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).doip=e()}}((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-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-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: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};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){var i=h.call(this,e,t,r);return i>=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function f(e,t,r){var i=h.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function h(e,t,r){for(var i=0;i=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(!f&&"number"!=typeof s&&void 0!==s)throw new Error(t+" must be number");if(!g&&void 0!==m&&"number"!=typeof m&&"boolean"!=typeof m)throw new Error(d+" must be number or boolean");if(g){var w=e.util.getData(m.$data,o,e.dataPathArr),k="exclusive"+n,x="exclType"+n,_="exclIsNumber"+n,j="' + "+(A="op"+n)+" + '";a+=" var schemaExcl"+n+" = "+w+"; ",a+=" var "+k+"; var "+x+" = typeof "+(w="schemaExcl"+n)+"; if ("+x+" != 'boolean' && "+x+" != 'undefined' && "+x+" != '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+=" "+x+" == '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((_="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{_&&void 0===s?(k=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,v+="="):(_&&(i=Math[h?"min":"max"](m,s)),m===(!_||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;if(f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,!f&&"number"!=typeof s)throw new Error(t+" must be number");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;if(f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,!f&&"number"!=typeof s)throw new Error(t+" must be number");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;if(f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,!f&&"number"!=typeof s)throw new Error(t+" must be number");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||!1===d: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}},{}],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||!1===t: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||!1===o: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 x=e.validate(h);h.baseId=v,e.util.varOccurences(x,b)<2?i+=" "+e.util.varReplace(x,b,k)+" ":i+=" var "+b+" = "+k+"; "+x+" ",i+=" if ("+d+") break; } ",e.compositeRule=h.compositeRule=w,i+=" if (!"+d+") {"}else i+=" if ("+p+".length == 0) {";var _=_||[];_.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=_.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}},{}],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=this,x="definition"+o,_=k.definition,j="";if(m&&_.$data){w="keywordValidate"+o;var S=_.validateSchema;n+=" var "+x+" = RULES.custom['"+t+"'].definition; var "+w+" = "+x+".validate;"}else{if(!(y=e.useCustomRule(k,c,e.schema,e)))return;a="validate.schema"+u,w=y.code,g=_.compile,b=_.inline,v=_.macro}var E=w+".errors",A="i"+o,M="ruleErr"+o,P=_.async;if(P&&!e.async)throw new Error("async keyword in sync schema");if(b||v||(n+=E+" = null;"),n+="var "+d+" = errors;var "+h+";",m&&_.$data&&(j+="}",n+=" if ("+a+" === undefined) { "+h+" = true; } else { ",S&&(j+="}",n+=" "+h+" = "+x+".validateSchema("+a+"); if ("+h+") { ")),b)_.statements?n+=" "+y.validate+" ":n+=" "+h+" = "+y.validate+"; ";else if(v){var z=e.util.copy(e);j="";z.level++;var F="valid"+z.level;z.schema=y.validate,z.schemaPath="";var I=e.compositeRule;e.compositeRule=z.compositeRule=!0;var O=e.validate(z).replace(/validate\.schema/g,w);e.compositeRule=z.compositeRule=I,n+=" "+O}else{(C=C||[]).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 B=s?"data"+(s-1||""):"parentData",q=s?e.dataPathArr[s]:"parentDataProperty",T=n+=" , "+B+" , "+q+" , rootData ) ";n=C.pop(),!1===_.errors?(n+=" "+h+" = ",P&&(n+="await "),n+=T+"; "):n+=P?" var "+(E="customErrors"+o)+" = null; try { "+h+" = await "+T+"; } catch (e) { "+h+" = false; if (e instanceof ValidationError) "+E+" = e.errors; else throw e; } ":" "+E+" = null; "+h+" = "+T+"; "}if(_.modifying&&(n+=" if ("+B+") "+f+" = "+B+"["+q+"];"),n+=""+j,_.valid)l&&(n+=" if (true) { ");else{var C;n+=" if ( ",void 0===_.valid?(n+=" !",n+=v?""+F:""+h):n+=" "+!_.valid+" ",n+=") { ",i=k.keyword,(C=C||[]).push(n),n="",(C=C||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(i||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { keyword: '"+k.keyword+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should pass \""+k.keyword+"\" keyword validation' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var R=n;n=C.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+R+"]); ":n+=" validate.errors = ["+R+"]; return false; ":n+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var D=n;n=C.pop(),b?_.errors?"full"!=_.errors&&(n+=" for (var "+A+"="+d+"; "+A+"0||!1===v: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=q,i+=" } ",u&&(i+=" if ("+d+") { ",h+="}"))}return u&&(i+=" "+h+" if ("+l+" == errors) {"),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||!1===m:e.util.schemaHasRules(m,e.RULES.all)),v=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0||!1===g: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 { ")}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 x=x||[];x.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 _=i;i=x.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; 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||!1===S:e.util.schemaHasRules(S,e.RULES.all)){i+=" "+m+" = true; if ("+p+".length > "+E+") { ";var M=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,M)+" ":i+=" var "+v+" = "+M+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0||!1===w: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);M=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,M)+" ":i+=" var "+v+" = "+M+"; "+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||!1===o: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);M=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,M)+" ":i+=" var "+v+" = "+M+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+f+" == errors) {"),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;if(f?(a+=" var schema"+n+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+n):i=s,!f&&"number"!=typeof s)throw new Error(t+" must be number");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||!1===o: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,x=-1,_=w.length-1;x<_;)k=w[x+=1],(e.opts.strictKeywords?"object"==typeof k&&Object.keys(k).length>0||!1===k:e.util.schemaHasRules(k,e.RULES.all))?(h.schema=k,h.schemaPath=s+"["+x+"]",h.errSchemaPath=c+"/"+x,i+=" "+e.validate(h)+" ",h.baseId=g):i+=" var "+m+" = true; ",x&&(i+=" if ("+m+" && "+b+") { "+l+" = false; "+v+" = ["+v+", "+x+"]; } else { ",d+="}"),i+=" if ("+m+") { "+l+" = "+b+" = true; "+v+" = "+x+"; }";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||{}).filter(O),k=e.schema.patternProperties||{},x=Object.keys(k).filter(O),_=e.schema.additionalProperties,j=w.length||x.length,S=!1===_,E="object"==typeof _&&Object.keys(_).length,A=e.opts.removeAdditional,M=S||E||A,P=e.opts.ownProperties,z=e.baseId,F=e.schema.required;if(F&&(!e.opts.$data||!F.$data)&&F.length8)i+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var B=w;if(B)for(var q=-1,T=B.length-1;q0||!1===X:e.util.schemaHasRules(X,e.RULES.all)){var J=e.util.getProperty(W),ee=(K=p+J,Z&&void 0!==X.default);f.schema=X,f.schemaPath=s+J,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);V=e.validate(f);if(f.baseId=z,e.util.varOccurences(V,v)<2){V=e.util.varReplace(V,v,K);var te=K}else{te=v;i+=" var "+v+" = "+K+"; "}if(ee)i+=" "+V+" ";else{if(I&&I[W]){i+=" if ( "+te+" === undefined ",P&&(i+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+d+" = false; ";U=e.errorPath,N=c;var re,ie=e.util.escapeQuotes(W);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(U,W,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(re=re||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+ie+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+ie+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";H=i;i=re.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+H+"]); ":i+=" validate.errors = ["+H+"]; return false; ":i+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=N,e.errorPath=U,i+=" } else { "}else u?(i+=" if ( "+te+" === undefined ",P&&(i+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+d+" = true; } else { "):(i+=" if ("+te+" !== undefined ",P&&(i+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(W)+"') "),i+=" ) { ");i+=" "+V+" } "}}u&&(i+=" if ("+d+") { ",h+="}")}}if(x.length){var ae=x;if(ae)for(var ne,oe=-1,se=ae.length-1;oe0||!1===X:e.util.schemaHasRules(X,e.RULES.all)){f.schema=X,f.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),f.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),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(ne)+".test("+m+")) { ",f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);K=p+"["+m+"]";f.dataPathArr[b]=m;V=e.validate(f);f.baseId=z,e.util.varOccurences(V,v)<2?i+=" "+e.util.varReplace(V,v,K)+" ":i+=" var "+v+" = "+K+"; "+V+" ",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}},{}],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||!1===o: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 x=d,_=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,x)+" ":i+=" var "+v+" = "+x+"; "+j+" ",e.compositeRule=f.compositeRule=_,i+=" if (!"+h+") { for (var "+g+"=startErrs"+a+"; "+g+"0||!1===y: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,x=e.opts.ownProperties;if(u)if(i+=" var missing"+a+"; ",k){f||(i+=" var "+h+" = validate.schema"+s+"; ");var _="' + "+(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 ",x&&(i+=" && Object.prototype.hasOwnProperty.call("+p+", "+h+"["+E+"]) "),i+="; if (!"+l+") break; } ",f&&(i+=" } "),i+=" if (!"+l+") { ",(M=M||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+_+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+_+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var j=i;i=M.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",e.opts.strictNumbers,!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){t="false schema";var u=e.level,p=e.dataLevel,l=e.schema[t],f=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,m="data"+(p||""),g="valid"+u;if(!1===e.schema){e.isTop?d=!0:i+=" var "+g+" = false; ",(Q=Q||[]).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=Q.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!==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="",x=e.schema.type,_=Array.isArray(x);if(x&&e.opts.nullable&&!0===e.schema.nullable&&(_?-1==x.indexOf("null")&&(x=x.concat("null")):"null"!=x&&(x=[x,"null"],_=!0)),_&&1==x.length&&(x=x[0],_=!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")),x){if(e.opts.coerceTypes)var j=e.util.coerceToTypes(e.opts.coerceTypes,x);var S=e.RULES.types[x];if(j||_||!0===S||S&&!Y(S)){f=e.schemaPath+".type",h=e.errSchemaPath+"/type",f=e.schemaPath+".type",h=e.errSchemaPath+"/type";var E=_?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[E](x,m,e.opts.strictNumbers,!0)+") { ",j){var A="dataType"+u,M="coerced"+u;i+=" var "+A+" = typeof "+m+"; var "+M+" = undefined; ","array"==e.opts.coerceTypes&&(i+=" if ("+A+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+A+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+M+" = "+m+"; } "),i+=" if ("+M+" !== undefined) ; ";var P=j;if(P)for(var z,F=-1,I=P.length-1;F>6],a=0==(32&r);if(31==(31&r)){let i=r;for(r=0;128==(128&i);){if(i=e.readUInt8(t),e.isError(i))return i;r<<=7,r|=127&i}}else r&=31;return{cls:i,primitive:a,tag:r,tagStr:s.tag[r]}}function l(e,t,r){let i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;const a=127&i;if(a>4)return e.error("length octect is too long");i=0;for(let t=0;t=31)return i.error("Multi-octet tag encoding unsupported");t||(a|=32);return a|=o.tagClassByName[r||"universal"]<<6,a}(e,t,r,this.reporter);if(i.length<128){const e=a.alloc(2);return e[0]=n,e[1]=i.length,this._createEncoderBuffer([e,i])}let s=1;for(let e=i.length;e>=256;e>>=8)s++;const c=a.alloc(2+s);c[0]=n,c[1]=128|s;for(let e=1+s,t=i.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,i])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=a.alloc(2*e.length);for(let r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let i=0;for(let t=0;t=128;r>>=7)i++}const n=a.alloc(i);let o=n.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(n[o--]=127&r;(r>>=7)>0;)n[o--]=128|127&r}return this._createEncoderBuffer(n)},c.prototype._encodeTime=function(e,t){let r;const i=new Date(e);return"gentime"===t?r=[u(i.getUTCFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getUTCFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.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)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=a.from(t)}if(a.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=a.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const i=new Array(r);for(let t=i.length-1;t>=0;t--)i[t]=255&e,e>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(a.from(i))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,r){const i=this._baseState;let a;if(null===i.default)return!1;const n=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),n.length!==i.defaultBuffer.length)return!1;for(a=0;a=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":59,"./types":62,assert:66,"safer-buffer":330}],62:[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}},{}],63:[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 * @license MIT */function a(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,a=0,n=Math.min(r,i);a=0;u--)if(p[u]!==l[u])return!1;for(u=p.length-1;u>=0;u--)if(!y(e[s=p[u]],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 x(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){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=function(e){return m(g(e.actual),128)+" "+e.operator+" "+m(g(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var i=r.stack,a=d(t),n=i.indexOf("\n"+a);if(n>=0){var o=i.indexOf("\n",n+1);i=i.substring(o+1)}this.stack=i}}},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){x(!0,e,t,r)},f.doesNotThrow=function(e,t,r){x(!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 _=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":271,"util/":69}],67:[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}},{}],68:[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}},{}],69:[function(e,t,r){(function(t,i){(function(){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&&_(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)),x(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(t);if(0===o.length){if(_(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(x(t))return l(t)}var u,w="",j=!1,S=["{","}"];(h(t)&&(j=!0,S=["[","]"]),_(t))&&(w=" [Function"+(t.name?": "+t.name:"")+"]");return y(t)&&(w=" "+RegExp.prototype.toString.call(t)),k(t)&&(w=" "+Date.prototype.toUTCString.call(t)),x(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")),M(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 x(e){return w(e)&&("[object Error]"===j(e)||e instanceof Error)}function _(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=x,r.isFunction=_,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(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),E[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log("%s - %s",A(),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)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":68,_process:296,inherits:67}],70:[function(e,t,r){(function(r){(function(){"use strict";var i=e("array-filter");t.exports=function(){return i(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],(function(e){return"function"==typeof r[e]}))}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"array-filter":44}],71:[function(e,t,r){ /*! * Copyright 2010 LearnBoost * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 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},d.prototype.createHost=function(){var e=this.isSingleRegion()?"":"."+this.region;return("ses"===this.service?"email":this.service)+e+".amazonaws.com"},d.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)},d.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},d.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},d.prototype.getDate=function(){return this.getDateTime().substr(0,8)},d.prototype.authHeader=function(){return["AWS4-HMAC-SHA256 Credential="+this.credentials.accessKeyId+"/"+this.credentialString(),"SignedHeaders="+this.signedHeaders(),"Signature="+this.signature()].join(", ")},d.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")},d.prototype.stringToSign=function(){return["AWS4-HMAC-SHA256",this.getDateTime(),this.credentialString(),p(this.canonicalString(),"hex")].join("\n")},d.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,o="s3"===this.service||this.request.doNotEncodePath,s="s3"===this.service,c="s3"===this.service;if(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){var u=Object.keys(r).reduce((function(e,t){return t?(e[f(t)]=Array.isArray(r[t])&&c?r[t][0]:r[t],e):e}),{}),l=[];Object.keys(u).sort().forEach((function(e){Array.isArray(u[e])?u[e].map(f).sort().forEach((function(t){l.push(e+"="+t)})):l.push(e+"="+f(u[e]))})),a=l.join("&")}return"/"!==t&&(n&&(t=t.replace(/\/{2,}/g,"/")),"/"!==(t=t.split("/").reduce((function(e,t){return n&&".."===t?e.pop():n&&"."===t||(o&&(t=decodeURIComponent(t.replace(/\+/g," "))),e.push(f(t))),e}),[]).join("/"))[0]&&(t="/"+t),s&&(t=t.replace(/%2F/g,"/"))),[this.request.method||"GET",t,a,this.canonicalHeaders()+"\n",this.signedHeaders(),e].join("\n")},d.prototype.canonicalHeaders=function(){var e=this.request.headers;return Object.keys(e).filter((function(e){return null==h[e.toLowerCase()]})).sort((function(e,t){return e.toLowerCase()=0&&(r=o.parse(e.slice(t+1)),e=e.slice(0,t)),this.parsedPath={path:e,query:r}},d.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=d,a.sign=function(e,t){return new d(e,t).sign()}}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"./lru":73,_process:296,buffer:131,crypto:142,querystring:312,url:414}],73:[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)}},{}],74:[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=16383,s=0,c=r-a;sc?c:s+o));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},{}],75:[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:8,HASHSIZE:32,hash:c,pbkdf:function(e,t,r,a,n,o,s){var u,p,l,f,h,d,m=new Uint8Array(64),g=new Uint8Array(64),b=new Uint8Array(32),v=new Uint8Array(32),y=new Uint8Array(a+4),w=o;if(s<1)return-1;if(0===t||0===a||0===o||o>b.byteLength*b.byteLength||a>1<<20)return-1;for(f=Math.floor((o+b.byteLength-1)/b.byteLength),l=Math.floor((o+f-1)/f),u=0;u0;d++){for(y[a+0]=d>>>24,y[a+1]=d>>>16,y[a+2]=d>>>8,y[a+3]=d,i(g,y,a+4),c(m,g,v),u=b.byteLength;u--;)b[u]=v[u];for(u=1;u=w);u++)n[h]=b[u];o-=u}return 0}}},{tweetnacl:409}],76:[function(e,t,r){"use strict";const i=e("./core");class a extends Error{constructor(e,...t){let r;super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,a),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);Object.defineProperty(this,"responseBody",{get:()=>(r||(r=this.arrayBuffer()),r)}),this.headers={};for(const[t,r]of e.headers.entries())this.headers[t.toLowerCase()]=r}}t.exports=i(((e,t,r,i,n)=>async(o,s,c={})=>{o=n+(o||"");let u=new URL(o);if(i||(i={}),u.username&&(i.Authorization="Basic "+btoa(u.username+":"+u.password),u=new URL(u.protocol+"//"+u.host+u.pathname+u.search)),"https:"!==u.protocol&&"http:"!==u.protocol)throw new Error("Unknown protocol, "+u.protocol);if(s)if(s instanceof ArrayBuffer||ArrayBuffer.isView(s)||"string"==typeof s);else{if("object"!=typeof s)throw new Error("Unknown body type.");s=JSON.stringify(s),i["Content-Type"]="application/json"}c=new Headers({...i||{},...c});const p=await fetch(u,{method:t,headers:c,body:s});if(p.statusCode=p.status,!e.has(p.status))throw new a(p);return"json"===r?p.json():"buffer"===r?p.arrayBuffer():"string"===r?p.text():p}))},{"./core":77}],77:[function(e,t,r){"use strict";const i=new Set(["json","buffer","string"]);t.exports=e=>(...t)=>{const r=new Set;let a,n,o,s="";return t.forEach((e=>{if("string"==typeof e)if(e.toUpperCase()===e){if(a){throw new Error(`Can't set method to ${e}, already set to ${a}.`)}a=e}else if(e.startsWith("http:")||e.startsWith("https:"))s=e;else{if(!i.has(e))throw new Error("Unknown encoding, "+e);n=e}else if("number"==typeof e)r.add(e);else{if("object"!=typeof e)throw new Error("Unknown type: "+typeof e);if(Array.isArray(e)||e instanceof Set)e.forEach((e=>r.add(e)));else{if(o)throw new Error("Cannot set headers twice.");o=e}}})),a||(a="GET"),0===r.size&&r.add(200),e(r,a,n,o,s)}},{}],78:[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,x=0|o[4],_=8191&x,j=x>>>13,S=0|o[5],E=8191&S,A=S>>>13,M=0|o[6],P=8191&M,z=M>>>13,F=0|o[7],I=8191&F,O=F>>>13,B=0|o[8],q=8191&B,T=B>>>13,C=0|o[9],R=8191&C,D=C>>>13,U=0|s[0],L=8191&U,N=U>>>13,H=0|s[1],$=8191&H,K=H>>>13,V=0|s[2],Z=8191&V,G=V>>>13,W=0|s[3],Q=8191&W,Y=W>>>13,X=0|s[4],J=8191&X,ee=X>>>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,L))|0)+((8191&(a=(a=Math.imul(l,N))+Math.imul(f,L)|0))<<13)|0;u=((n=Math.imul(f,N))+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),a=(a=Math.imul(d,N))+Math.imul(m,L)|0,n=Math.imul(m,N);var be=(u+(i=i+Math.imul(l,$)|0)|0)+((8191&(a=(a=a+Math.imul(l,K)|0)+Math.imul(f,$)|0))<<13)|0;u=((n=n+Math.imul(f,K)|0)+(a>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,L),a=(a=Math.imul(b,N))+Math.imul(v,L)|0,n=Math.imul(v,N),i=i+Math.imul(d,$)|0,a=(a=a+Math.imul(d,K)|0)+Math.imul(m,$)|0,n=n+Math.imul(m,K)|0;var ve=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(a=(a=a+Math.imul(l,G)|0)+Math.imul(f,Z)|0))<<13)|0;u=((n=n+Math.imul(f,G)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(w,L),a=(a=Math.imul(w,N))+Math.imul(k,L)|0,n=Math.imul(k,N),i=i+Math.imul(b,$)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(v,$)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(d,Z)|0,a=(a=a+Math.imul(d,G)|0)+Math.imul(m,Z)|0,n=n+Math.imul(m,G)|0;var ye=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(a=(a=a+Math.imul(l,Y)|0)+Math.imul(f,Q)|0))<<13)|0;u=((n=n+Math.imul(f,Y)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(_,L),a=(a=Math.imul(_,N))+Math.imul(j,L)|0,n=Math.imul(j,N),i=i+Math.imul(w,$)|0,a=(a=a+Math.imul(w,K)|0)+Math.imul(k,$)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(b,Z)|0,a=(a=a+Math.imul(b,G)|0)+Math.imul(v,Z)|0,n=n+Math.imul(v,G)|0,i=i+Math.imul(d,Q)|0,a=(a=a+Math.imul(d,Y)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,Y)|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,L),a=(a=Math.imul(E,N))+Math.imul(A,L)|0,n=Math.imul(A,N),i=i+Math.imul(_,$)|0,a=(a=a+Math.imul(_,K)|0)+Math.imul(j,$)|0,n=n+Math.imul(j,K)|0,i=i+Math.imul(w,Z)|0,a=(a=a+Math.imul(w,G)|0)+Math.imul(k,Z)|0,n=n+Math.imul(k,G)|0,i=i+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,Y)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,Y)|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,L),a=(a=Math.imul(P,N))+Math.imul(z,L)|0,n=Math.imul(z,N),i=i+Math.imul(E,$)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(A,$)|0,n=n+Math.imul(A,K)|0,i=i+Math.imul(_,Z)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(j,Z)|0,n=n+Math.imul(j,G)|0,i=i+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,Y)|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 xe=(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)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,L),a=(a=Math.imul(I,N))+Math.imul(O,L)|0,n=Math.imul(O,N),i=i+Math.imul(P,$)|0,a=(a=a+Math.imul(P,K)|0)+Math.imul(z,$)|0,n=n+Math.imul(z,K)|0,i=i+Math.imul(E,Z)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(A,Z)|0,n=n+Math.imul(A,G)|0,i=i+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(j,Q)|0,n=n+Math.imul(j,Y)|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 _e=(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)+(_e>>>26)|0,_e&=67108863,i=Math.imul(q,L),a=(a=Math.imul(q,N))+Math.imul(T,L)|0,n=Math.imul(T,N),i=i+Math.imul(I,$)|0,a=(a=a+Math.imul(I,K)|0)+Math.imul(O,$)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(P,Z)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(z,Z)|0,n=n+Math.imul(z,G)|0,i=i+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(A,Q)|0,n=n+Math.imul(A,Y)|0,i=i+Math.imul(_,J)|0,a=(a=a+Math.imul(_,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(R,L),a=(a=Math.imul(R,N))+Math.imul(D,L)|0,n=Math.imul(D,N),i=i+Math.imul(q,$)|0,a=(a=a+Math.imul(q,K)|0)+Math.imul(T,$)|0,n=n+Math.imul(T,K)|0,i=i+Math.imul(I,Z)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(O,Z)|0,n=n+Math.imul(O,G)|0,i=i+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,Y)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,Y)|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(_,re)|0,a=(a=a+Math.imul(_,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(R,$),a=(a=Math.imul(R,K))+Math.imul(D,$)|0,n=Math.imul(D,K),i=i+Math.imul(q,Z)|0,a=(a=a+Math.imul(q,G)|0)+Math.imul(T,Z)|0,n=n+Math.imul(T,G)|0,i=i+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(O,Q)|0,n=n+Math.imul(O,Y)|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(_,ne)|0,a=(a=a+Math.imul(_,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(R,Z),a=(a=Math.imul(R,G))+Math.imul(D,Z)|0,n=Math.imul(D,G),i=i+Math.imul(q,Q)|0,a=(a=a+Math.imul(q,Y)|0)+Math.imul(T,Q)|0,n=n+Math.imul(T,Y)|0,i=i+Math.imul(I,J)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(O,J)|0,n=n+Math.imul(O,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(_,ce)|0,a=(a=a+Math.imul(_,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(R,Q),a=(a=Math.imul(R,Y))+Math.imul(D,Q)|0,n=Math.imul(D,Y),i=i+Math.imul(q,J)|0,a=(a=a+Math.imul(q,ee)|0)+Math.imul(T,J)|0,n=n+Math.imul(T,ee)|0,i=i+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ie)|0)+Math.imul(O,re)|0,n=n+Math.imul(O,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(_,le)|0,a=(a=a+Math.imul(_,fe)|0)+Math.imul(j,le)|0,n=n+Math.imul(j,fe)|0;var Me=(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)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,J),a=(a=Math.imul(R,ee))+Math.imul(D,J)|0,n=Math.imul(D,ee),i=i+Math.imul(q,re)|0,a=(a=a+Math.imul(q,ie)|0)+Math.imul(T,re)|0,n=n+Math.imul(T,ie)|0,i=i+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(O,ne)|0,n=n+Math.imul(O,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(_,de)|0)|0)+((8191&(a=(a=a+Math.imul(_,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(R,re),a=(a=Math.imul(R,ie))+Math.imul(D,re)|0,n=Math.imul(D,ie),i=i+Math.imul(q,ne)|0,a=(a=a+Math.imul(q,oe)|0)+Math.imul(T,ne)|0,n=n+Math.imul(T,oe)|0,i=i+Math.imul(I,ce)|0,a=(a=a+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,n=n+Math.imul(O,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(R,ne),a=(a=Math.imul(R,oe))+Math.imul(D,ne)|0,n=Math.imul(D,oe),i=i+Math.imul(q,ce)|0,a=(a=a+Math.imul(q,ue)|0)+Math.imul(T,ce)|0,n=n+Math.imul(T,ue)|0,i=i+Math.imul(I,le)|0,a=(a=a+Math.imul(I,fe)|0)+Math.imul(O,le)|0,n=n+Math.imul(O,fe)|0;var Fe=(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)+(Fe>>>26)|0,Fe&=67108863,i=Math.imul(R,ce),a=(a=Math.imul(R,ue))+Math.imul(D,ce)|0,n=Math.imul(D,ue),i=i+Math.imul(q,le)|0,a=(a=a+Math.imul(q,fe)|0)+Math.imul(T,le)|0,n=n+Math.imul(T,fe)|0;var Ie=(u+(i=i+Math.imul(I,de)|0)|0)+((8191&(a=(a=a+Math.imul(I,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((n=n+Math.imul(O,me)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(R,le),a=(a=Math.imul(R,fe))+Math.imul(D,le)|0,n=Math.imul(D,fe);var Oe=(u+(i=i+Math.imul(q,de)|0)|0)+((8191&(a=(a=a+Math.imul(q,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;var Be=(u+(i=Math.imul(R,de))|0)+((8191&(a=(a=Math.imul(R,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]=xe,c[7]=_e,c[8]=je,c[9]=Se,c[10]=Ee,c[11]=Ae,c[12]=Me,c[13]=Pe,c[14]=ze,c[15]=Fe,c[16]=Ie,c[17]=Oe,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 x(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 x(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 _(e){x.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):void 0!==r.strip?r.strip():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=4194303,i=Math.min(e.length,9),a=0;a>>22,n=o}n>>>=22,e.words[a-10]=n,0===n&&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},x.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},x.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")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.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},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new _(e)},a(_,x),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.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)},_.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)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:80}],79:[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":329}],82:[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":81,"./authCipher":82,"./modes":94,"./streamCipher":97,"cipher-base":134,evp_bytestokey:179,inherits:249,"safe-buffer":329}],85:[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":329}],87:[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)}}},{}],88:[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":130}],89:[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":130,"safe-buffer":329}],90:[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)}).call(this,e("buffer").Buffer)},{"bn.js":78,buffer:131,randombytes:313}],102:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":103}],103:[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"}}},{}],104:[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"}},{}],105:[function(e,t,r){var i=e("safe-buffer").Buffer,a=e("create-hash"),n=e("readable-stream"),o=e("inherits"),s=e("./sign"),c=e("./verify"),u=e("./algorithms.json");function p(e){n.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=a(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){n.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=a(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){return new p(e)}function h(e){return new l(e)}Object.keys(u).forEach((function(e){u[e].id=i.from(u[e].id,"hex"),u[e.toLowerCase()]=u[e]})),o(p,n.Writable),p.prototype._write=function(e,t,r){this._hash.update(e),r()},p.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},p.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),i=s(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},o(l,n.Writable),l.prototype._write=function(e,t,r){this._hash.update(e),r()},l.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},l.prototype.verify=function(e,t,r){"string"==typeof t&&(t=i.from(t,r)),this.end();var a=this._hash.digest();return c(t,a,e,this._signType,this._tag)},t.exports={Sign:f,Verify:h,createSign:f,createVerify:h}},{"./algorithms.json":103,"./sign":106,"./verify":107,"create-hash":138,inherits:249,"readable-stream":123,"safe-buffer":329}],106:[function(e,t,r){var i=e("safe-buffer").Buffer,a=e("create-hmac"),n=e("browserify-rsa"),o=e("elliptic").ec,s=e("bn.js"),c=e("parse-asn1"),u=e("./curves.json");function p(e,t,r,n){if((e=i.from(e.toArray())).length0&&r.ishrn(i),r}function f(e,t,r){var n,o;do{for(n=i.alloc(0);8*n.length=t)throw new Error("invalid sig")}t.exports=function(e,t,r,u,p){var l=o(r);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=s[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var a=new n(i),o=r.data.subjectPrivateKey.data;return a.verify(t,e,o)}(e,t,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,s=r.data.g,u=r.data.pub_key,p=o.signature.decode(e,"der"),l=p.s,f=p.r;c(l,n),c(f,n);var h=a.mont(i),d=l.invm(n);return 0===s.toRed(h).redPow(new a(t).mul(d).mod(n)).fromRed().mul(u.toRed(h).redPow(f.mul(d).mod(n)).fromRed()).mod(i).mod(n).cmp(f)}(e,t,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");t=i.concat([p,t]);for(var f=l.modulus.byteLength(),h=[1],d=0;t.length+h.length+2=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,o|=c}return i(!(240&o),"Invalid character in "+e),a}function c(e,t,r,a){for(var n=0,o=0,s=Math.min(e.length,r),c=t;c=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&o0?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},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=p}catch(e){n.prototype.inspect=p}else n.prototype.inspect=p;function p(){return(this.red?""}var l=["","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"],f=[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],h=[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];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?l[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 u=f[e],p=h[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(p).toString(e);r=(d=d.idivn(p)).isZero()?m+r:l[u-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,2)},o&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function d(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.toArrayLike=function(e,t,r){this._strip();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");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,n);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,a),o},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,a=0,n=0;a>8&255),r>16&255),6===n?(r>24&255),i=0,n=0):(i=o>>>24,n+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===n?(r>=0&&(e[r--]=o>>24&255),i=0,n=0):(i=o>>>24,n+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=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,x=0|o[4],_=8191&x,j=x>>>13,S=0|o[5],E=8191&S,A=S>>>13,M=0|o[6],P=8191&M,z=M>>>13,F=0|o[7],I=8191&F,O=F>>>13,B=0|o[8],q=8191&B,T=B>>>13,C=0|o[9],R=8191&C,D=C>>>13,U=0|s[0],L=8191&U,N=U>>>13,H=0|s[1],$=8191&H,K=H>>>13,V=0|s[2],Z=8191&V,G=V>>>13,W=0|s[3],Q=8191&W,Y=W>>>13,X=0|s[4],J=8191&X,ee=X>>>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,L))|0)+((8191&(a=(a=Math.imul(l,N))+Math.imul(f,L)|0))<<13)|0;u=((n=Math.imul(f,N))+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),a=(a=Math.imul(d,N))+Math.imul(m,L)|0,n=Math.imul(m,N);var be=(u+(i=i+Math.imul(l,$)|0)|0)+((8191&(a=(a=a+Math.imul(l,K)|0)+Math.imul(f,$)|0))<<13)|0;u=((n=n+Math.imul(f,K)|0)+(a>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,L),a=(a=Math.imul(b,N))+Math.imul(v,L)|0,n=Math.imul(v,N),i=i+Math.imul(d,$)|0,a=(a=a+Math.imul(d,K)|0)+Math.imul(m,$)|0,n=n+Math.imul(m,K)|0;var ve=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(a=(a=a+Math.imul(l,G)|0)+Math.imul(f,Z)|0))<<13)|0;u=((n=n+Math.imul(f,G)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(w,L),a=(a=Math.imul(w,N))+Math.imul(k,L)|0,n=Math.imul(k,N),i=i+Math.imul(b,$)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(v,$)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(d,Z)|0,a=(a=a+Math.imul(d,G)|0)+Math.imul(m,Z)|0,n=n+Math.imul(m,G)|0;var ye=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(a=(a=a+Math.imul(l,Y)|0)+Math.imul(f,Q)|0))<<13)|0;u=((n=n+Math.imul(f,Y)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(_,L),a=(a=Math.imul(_,N))+Math.imul(j,L)|0,n=Math.imul(j,N),i=i+Math.imul(w,$)|0,a=(a=a+Math.imul(w,K)|0)+Math.imul(k,$)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(b,Z)|0,a=(a=a+Math.imul(b,G)|0)+Math.imul(v,Z)|0,n=n+Math.imul(v,G)|0,i=i+Math.imul(d,Q)|0,a=(a=a+Math.imul(d,Y)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,Y)|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,L),a=(a=Math.imul(E,N))+Math.imul(A,L)|0,n=Math.imul(A,N),i=i+Math.imul(_,$)|0,a=(a=a+Math.imul(_,K)|0)+Math.imul(j,$)|0,n=n+Math.imul(j,K)|0,i=i+Math.imul(w,Z)|0,a=(a=a+Math.imul(w,G)|0)+Math.imul(k,Z)|0,n=n+Math.imul(k,G)|0,i=i+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,Y)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,Y)|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,L),a=(a=Math.imul(P,N))+Math.imul(z,L)|0,n=Math.imul(z,N),i=i+Math.imul(E,$)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(A,$)|0,n=n+Math.imul(A,K)|0,i=i+Math.imul(_,Z)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(j,Z)|0,n=n+Math.imul(j,G)|0,i=i+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,Y)|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 xe=(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)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,L),a=(a=Math.imul(I,N))+Math.imul(O,L)|0,n=Math.imul(O,N),i=i+Math.imul(P,$)|0,a=(a=a+Math.imul(P,K)|0)+Math.imul(z,$)|0,n=n+Math.imul(z,K)|0,i=i+Math.imul(E,Z)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(A,Z)|0,n=n+Math.imul(A,G)|0,i=i+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(j,Q)|0,n=n+Math.imul(j,Y)|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 _e=(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)+(_e>>>26)|0,_e&=67108863,i=Math.imul(q,L),a=(a=Math.imul(q,N))+Math.imul(T,L)|0,n=Math.imul(T,N),i=i+Math.imul(I,$)|0,a=(a=a+Math.imul(I,K)|0)+Math.imul(O,$)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(P,Z)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(z,Z)|0,n=n+Math.imul(z,G)|0,i=i+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(A,Q)|0,n=n+Math.imul(A,Y)|0,i=i+Math.imul(_,J)|0,a=(a=a+Math.imul(_,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(R,L),a=(a=Math.imul(R,N))+Math.imul(D,L)|0,n=Math.imul(D,N),i=i+Math.imul(q,$)|0,a=(a=a+Math.imul(q,K)|0)+Math.imul(T,$)|0,n=n+Math.imul(T,K)|0,i=i+Math.imul(I,Z)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(O,Z)|0,n=n+Math.imul(O,G)|0,i=i+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,Y)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,Y)|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(_,re)|0,a=(a=a+Math.imul(_,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(R,$),a=(a=Math.imul(R,K))+Math.imul(D,$)|0,n=Math.imul(D,K),i=i+Math.imul(q,Z)|0,a=(a=a+Math.imul(q,G)|0)+Math.imul(T,Z)|0,n=n+Math.imul(T,G)|0,i=i+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(O,Q)|0,n=n+Math.imul(O,Y)|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(_,ne)|0,a=(a=a+Math.imul(_,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(R,Z),a=(a=Math.imul(R,G))+Math.imul(D,Z)|0,n=Math.imul(D,G),i=i+Math.imul(q,Q)|0,a=(a=a+Math.imul(q,Y)|0)+Math.imul(T,Q)|0,n=n+Math.imul(T,Y)|0,i=i+Math.imul(I,J)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(O,J)|0,n=n+Math.imul(O,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(_,ce)|0,a=(a=a+Math.imul(_,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(R,Q),a=(a=Math.imul(R,Y))+Math.imul(D,Q)|0,n=Math.imul(D,Y),i=i+Math.imul(q,J)|0,a=(a=a+Math.imul(q,ee)|0)+Math.imul(T,J)|0,n=n+Math.imul(T,ee)|0,i=i+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ie)|0)+Math.imul(O,re)|0,n=n+Math.imul(O,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(_,le)|0,a=(a=a+Math.imul(_,fe)|0)+Math.imul(j,le)|0,n=n+Math.imul(j,fe)|0;var Me=(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)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,J),a=(a=Math.imul(R,ee))+Math.imul(D,J)|0,n=Math.imul(D,ee),i=i+Math.imul(q,re)|0,a=(a=a+Math.imul(q,ie)|0)+Math.imul(T,re)|0,n=n+Math.imul(T,ie)|0,i=i+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(O,ne)|0,n=n+Math.imul(O,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(_,de)|0)|0)+((8191&(a=(a=a+Math.imul(_,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(R,re),a=(a=Math.imul(R,ie))+Math.imul(D,re)|0,n=Math.imul(D,ie),i=i+Math.imul(q,ne)|0,a=(a=a+Math.imul(q,oe)|0)+Math.imul(T,ne)|0,n=n+Math.imul(T,oe)|0,i=i+Math.imul(I,ce)|0,a=(a=a+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,n=n+Math.imul(O,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(R,ne),a=(a=Math.imul(R,oe))+Math.imul(D,ne)|0,n=Math.imul(D,oe),i=i+Math.imul(q,ce)|0,a=(a=a+Math.imul(q,ue)|0)+Math.imul(T,ce)|0,n=n+Math.imul(T,ue)|0,i=i+Math.imul(I,le)|0,a=(a=a+Math.imul(I,fe)|0)+Math.imul(O,le)|0,n=n+Math.imul(O,fe)|0;var Fe=(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)+(Fe>>>26)|0,Fe&=67108863,i=Math.imul(R,ce),a=(a=Math.imul(R,ue))+Math.imul(D,ce)|0,n=Math.imul(D,ue),i=i+Math.imul(q,le)|0,a=(a=a+Math.imul(q,fe)|0)+Math.imul(T,le)|0,n=n+Math.imul(T,fe)|0;var Ie=(u+(i=i+Math.imul(I,de)|0)|0)+((8191&(a=(a=a+Math.imul(I,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((n=n+Math.imul(O,me)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(R,le),a=(a=Math.imul(R,fe))+Math.imul(D,le)|0,n=Math.imul(D,fe);var Oe=(u+(i=i+Math.imul(q,de)|0)|0)+((8191&(a=(a=a+Math.imul(q,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;var Be=(u+(i=Math.imul(R,de))|0)+((8191&(a=(a=Math.imul(R,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]=xe,c[7]=_e,c[8]=je,c[9]=Se,c[10]=Ee,c[11]=Ae,c[12]=Me,c[13]=Pe,c[14]=ze,c[15]=Fe,c[16]=Ie,c[17]=Oe,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function g(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()}function b(e,t,r){return g(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=d),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?d(this,e,t):r<1024?g(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},v.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,r+=n/67108864|0,r+=o>>>26,this.words[a]=67108863&o}return 0!==r&&(this.words[a]=r,this.length++),t?this.ineg():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&1}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.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(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.modrn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var r=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(r*a+(0|this.words[n]))%e;return t?-a:a},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var r=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*r;this.words[a]=n/e|0,r=n%e}return this._strip(),t?this.ineg():this},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 S(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 y={k256:null,p224:null,p192:null,p25519:null};function w(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 k(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function j(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(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 E(e){S.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)}w.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.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):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},a(k,w),k.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),a=0;a>>22,n=o}n>>>=22,e.words[a-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},k.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(y[e])return y[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new x;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new j}return y[e]=t,t},S.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},S.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")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.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)},S.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},S.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)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.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},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new E(e)},a(E,S),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.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)},E.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)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:80}],109:[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},{}],110:[function(e,t,r){(function(r){(function(){"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?x(e,new k):A(e,o,t,!0);else if(o.ended)x(e,new y);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?A(e,o,t,!1):I(e,o)):A(e,o,t,!1)}else i||(o.reading=!1,I(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=M?e=M:(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 z(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(F,e))}function F(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function I(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 q(e){u("readable nexttick read 0"),e.read(0)}function T(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function R(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 D(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function 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?D(this):z(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&D(this),null;var i,a=t.needReadable;return u("need readable",a),(0===t.length||t.length-e0?R(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&D(this)),null!==i&&this.emit("data",i),i},S.prototype._read=function(e){x(this,new w("_read()"))},S.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,C(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")&&x(e,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},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var 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?z(this):a.reading||r.nextTick(q,this))),i},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var i=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(B,this),i},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(B,this),t},S.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(T,e,t))}(this,e)),e.paused=!1,this},S.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},S.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&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=e("./internal/streams/async_iterator")),f(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=R,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(t,r){return void 0===h&&(h=e("./internal/streams/from")),h(S,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":109,"./_stream_duplex":110,"./internal/streams/async_iterator":115,"./internal/streams/buffer_list":116,"./internal/streams/destroy":117,"./internal/streams/from":119,"./internal/streams/state":121,"./internal/streams/stream":122,_process:296,buffer:131,events:178,inherits:249,"string_decoder/":124,util:80}],113:[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(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.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,F(e,t),i&&(t.finished?r.nextTick(i):e.once("finish",i));t.ended=!0,e.writable=!1}(this,a,i),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":109,"./_stream_duplex":110,"./internal/streams/destroy":117,"./internal/streams/state":121,"./internal/streams/stream":122,_process:296,buffer:131,inherits:249,"util-deprecate":416}],115:[function(e,t,r){(function(r){(function(){"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)))}}function m(e){r.nextTick(d,e)}var g=Object.getPrototypeOf((function(){})),b=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),g);t.exports=function(e){var t,r=Object.create(b,(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 i=r[f].read();i?(r[p]=null,r[o]=null,r[s]=null,e(h(i,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[p]=null,n(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[p]=null,r[o]=null,r[s]=null,t(e)),void(r[c]=e)}var i=r[o];null!==i&&(r[p]=null,r[o]=null,r[s]=null,i(h(void 0,!0))),r[u]=!0})),e.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":118,_process:296}],116:[function(e,t,r){"use strict";function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}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}function n(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,i,a=o.allocUnsafe(e>>>0),n=this.head,s=0;n;)t=n.data,r=a,i=s,o.prototype.copy.call(t,r,i),s+=n.data.length,n=n.next;return a}},{key:"consume",value: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}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var a=r.data,n=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,n),0==(e-=n)){n===a.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(n));break}++i}return this.length-=i,t}},{key:c,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){i||(i=e),e&&o.forEach(u),n||(o.forEach(u),a(i))}))}));return t.reduce(p)}},{"../../../errors":109,"./end-of-stream":118}],121:[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":109}],122:[function(e,t,r){t.exports=e("events").EventEmitter},{events:178}],123:[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":110,"./lib/_stream_passthrough.js":111,"./lib/_stream_readable.js":112,"./lib/_stream_transform.js":113,"./lib/_stream_writable.js":114,"./lib/internal/streams/end-of-stream.js":118,"./lib/internal/streams/pipeline.js":120}],124:[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":329}],125:[function(e,t,r){(function(t,i){(function(){"use strict";var a=e("assert"),n=e("pako/lib/zlib/zstream"),o=e("pako/lib/zlib/deflate.js"),s=e("pako/lib/zlib/inflate.js"),c=e("pako/lib/zlib/constants");for(var u in c)r[u]=c[u];r.NONE=0,r.DEFLATE=1,r.INFLATE=2,r.GZIP=3,r.GUNZIP=4,r.DEFLATERAW=5,r.INFLATERAW=6,r.UNZIP=7;function p(e){if("number"!=typeof e||er.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)}).call(this,e("_process"),e("buffer").Buffer)},{_process:296,assert:66,buffer:131,"pako/lib/zlib/constants":274,"pako/lib/zlib/deflate.js":276,"pako/lib/zlib/inflate.js":278,"pako/lib/zlib/zstream":282}],126:[function(e,t,r){(function(t){(function(){"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 x(e){if(!(this instanceof x))return new x(e);A.call(this,e,n.GUNZIP)}function _(e){if(!(this instanceof _))return new _(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){M(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 M(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=x,r.DeflateRaw=_,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 _(e)},r.createInflateRaw=function(e){return new j(e)},r.createGzip=function(e){return new k(e)},r.createGunzip=function(e){return new x(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 _(t),e,r)},r.deflateRawSync=function(e,t){return v(new _(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 x(t),e,r)},r.gunzipSync=function(e,t){return v(new x(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){M(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 M(this),new RangeError(u);var g=i.concat(h,d);return M(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(x,A),o.inherits(_,A),o.inherits(j,A),o.inherits(S,A)}).call(this)}).call(this,e("_process"))},{"./binding":125,_process:296,assert:66,buffer:131,stream:364,util:419}],127:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],128:[function(e,t,r){(function(e){(function(){!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=/^xn--/,f=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function b(e){throw new RangeError(d[e])}function v(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function y(e,t){var r=e.split("@"),i="";return r.length>1&&(i=r[0]+"@",e=r[1]),i+v((e=e.replace(h,".")).split("."),t).join(".")}function w(e){for(var t,r,i=[],a=0,n=e.length;a=55296&&t<=56319&&a65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=g(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,r){var i=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;i+=p)e=m(e/35);return m(i+36*e/(e+38))}function j(e){var t,r,i,a,n,o,s,c,l,f,h,d=[],g=e.length,v=0,y=128,w=72;for((r=e.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&b("not-basic"),d.push(e.charCodeAt(i));for(a=r>0?r+1:0;a=g&&b("invalid-input"),((c=(h=e.charCodeAt(a++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:p)>=p||c>m((u-v)/o))&&b("overflow"),v+=c*o,!(c<(l=s<=w?1:s>=w+26?26:s-w));s+=p)o>m(u/(f=p-l))&&b("overflow"),o*=f;w=_(v-n,t=d.length+1,0==n),m(v/t)>u-y&&b("overflow"),y+=m(v/t),v%=t,d.splice(v++,0,y)}return k(d)}function S(e){var t,r,i,a,n,o,s,c,l,f,h,d,v,y,k,j=[];for(d=(e=w(e)).length,t=128,r=0,n=72,o=0;o=t&&hm((u-r)/(v=i+1))&&b("overflow"),r+=(s-t)*v,t=s,o=0;ou&&b("overflow"),h==t){for(c=r,l=p;!(c<(f=l<=n?1:l>=n+26?26:l-n));l+=p)k=c-f,y=p-f,j.push(g(x(f+k%y,0))),c=m(k/y);j.push(g(x(c,0))),n=_(r,v,i==a),r=0,++i}++r,++t}return j.join("")}if(s={version:"1.4.1",ucs2:{decode:w,encode:k},decode:j,encode:S,toASCII:function(e){return y(e,(function(e){return f.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return y(e,(function(e){return l.test(e)?j(e.slice(4).toLowerCase()):e}))}},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)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],129:[function(e,t,r){arguments[4][124][0].apply(r,arguments)},{dup:124,"safe-buffer":329}],130:[function(e,t,r){(function(e){(function(){t.exports=function(t,r){for(var i=Math.min(t.length,r.length),a=new e(i),n=0;n * @license MIT */ "use strict";var t=e("base64-js"),i=e("ieee754");r.Buffer=o,r.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},r.INSPECT_MAX_BYTES=50;var a=2147483647;function n(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(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 u(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|f(e,t),i=n(r),a=i.write(e,t);a!==r&&(i=i.slice(0,a));return i}(e,t);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(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 r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return C(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(e).length;default:if(a)return i?-1:C(e).length;t=(""+t).toLowerCase(),a=!0}}function h(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.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 M(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 _(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}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,a){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),L(r=+r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=o.from(t,i)),o.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,a);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 _(e,r,i){return 0===r&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,i))}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(;it&&(e+=" ... "),""},o.prototype.compare=function(e,t,r,i,a){if(U(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||r>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=r)return 0;if(i>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var n=(a>>>=0)-(i>>>=0),s=(r>>>=0)-(t>>>=0),c=Math.min(n,s),u=this.slice(i,a),p=e.slice(t,r),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 x(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},o.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 F(e,t,r,i,a,n){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function I(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 O(e,t,r,a,n){return t=+t,r>>>=0,n||I(e,0,r,4),i.write(e,t,r,a,23,4),r+4}function B(e,t,r,a,n){return t=+t,r>>>=0,n||I(e,0,r,8),i.write(e,t,r,a,52,8),r+8}o.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=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},o.prototype.readUInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]<<8|this[e+1]},o.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]},o.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])},o.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},o.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},o.prototype.readInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.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},o.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},o.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},o.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]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||z(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||z(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||z(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||z(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,i){(e=+e,t>>>=0,r>>>=0,i)||F(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)||F(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},o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||F(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},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||F(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},o.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*r-1);F(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},o.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*r-1);F(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},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||F(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},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||F(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},o.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,i){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return a},o.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var a=e.charCodeAt(0);("utf8"===i&&a<128||"latin1"===i)&&(e=a)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n55295&&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 R(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function U(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}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":74,buffer:131,ieee754:248}],132:[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"}},{}],133:[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 * @license MIT * * The MIT License (MIT) * * Copyright (c) 2013-2018 Viacheslav Lotsmanov * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use strict";function r(t){return t instanceof e||t instanceof Date||t instanceof RegExp}function i(t){if(t instanceof e){var r=e.alloc?e.alloc(t.length):new e(t.length);return t.copy(r),r}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}function a(e){var t=[];return e.forEach((function(e,n){"object"==typeof e&&null!==e?Array.isArray(e)?t[n]=a(e):r(e)?t[n]=i(e):t[n]=o({},e):t[n]=e})),t}function n(e,t){return"__proto__"===t?void 0:e[t]}var o=t.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,s=arguments[0],c=Array.prototype.slice.call(arguments,1);return c.forEach((function(c){"object"!=typeof c||null===c||Array.isArray(c)||Object.keys(c).forEach((function(u){return t=n(s,u),(e=n(c,u))===s?void 0:"object"!=typeof e||null===e?void(s[u]=e):Array.isArray(e)?void(s[u]=a(e)):r(e)?void(s[u]=i(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(s[u]=o({},e)):void(s[u]=o(t,e))}))})),s}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:131}],144:[function(e,t,r){var i=e("stream").Stream,a=e("util");function n(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}t.exports=n,a.inherits(n,i),n.create=function(e,t){var r=new this;for(var i in t=t||{})r[i]=t[i];r.source=e;var a=e.emit;return e.emit=function(){return r._handleEmit(arguments),a.apply(e,arguments)},e.on("error",(function(){})),r.pauseStream&&e.pause(),r},Object.defineProperty(n.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),n.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},n.prototype.resume=function(){this._released||this.release(),this.source.resume()},n.prototype.pause=function(){this.source.pause()},n.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},n.prototype.pipe=function(){var e=i.prototype.pipe.apply(this,arguments);return this.resume(),e},n.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},n.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}},{stream:364,util:419}],145:[function(e,t,r){"use strict";r.utils=e("./des/utils"),r.Cipher=e("./des/cipher"),r.DES=e("./des/des"),r.CBC=e("./des/cbc"),r.EDE=e("./des/ede")},{"./des/cbc":146,"./des/cipher":147,"./des/des":148,"./des/ede":149,"./des/utils":150}],146:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),a=e("inherits"),n={};function o(e){i.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t0;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=n.r28shl(r,s),a=n.r28shl(a,s),n.pc2(r,a,e.keys,o)}},c.prototype._update=function(e,t,r,i){var a=this._desState,o=n.readUInt32BE(e,t),s=n.readUInt32BE(e,t+4);n.ip(o,s,a.tmp,0),o=a.tmp[0],s=a.tmp[1],"encrypt"===this.type?this._encrypt(a,o,s,a.tmp,0):this._decrypt(a,o,s,a.tmp,0),o=a.tmp[0],s=a.tmp[1],n.writeUInt32BE(r,o,i),n.writeUInt32BE(r,s,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=f}n.rip(s,o,i,a)},c.prototype._decrypt=function(e,t,r,i,a){for(var o=r,s=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],p=e.keys[c+1];n.expand(o,e.tmp,0),u^=e.tmp[0],p^=e.tmp[1];var l=n.substitute(u,p),f=o;o=(s^n.permute(l))>>>0,s=f}n.rip(o,s,i,a)}},{"./cipher":147,"./utils":150,inherits:249,"minimalistic-assert":268}],149:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),a=e("inherits"),n=e("./cipher"),o=e("./des");function s(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?[o.create({type:"encrypt",key:r}),o.create({type:"decrypt",key:a}),o.create({type:"encrypt",key:n})]:[o.create({type:"decrypt",key:n}),o.create({type:"encrypt",key:a}),o.create({type:"decrypt",key:r})]}function c(e){n.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}a(c,n),t.exports=c,c.create=function(e){return new c(e)},c.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)},c.prototype._pad=o.prototype._pad,c.prototype._unpad=o.prototype._unpad},{"./cipher":147,"./des":148,inherits:249,"minimalistic-assert":268}],150:[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":78,"miller-rabin":264,randombytes:313}],154:[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"}}},{}],155:[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":156,"./lib/sec.js":157,crypto:142,jsbn:257,"safer-buffer":330}],156:[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:257}],157:[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":156,jsbn:257}],158:[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":173,"./elliptic/curve":161,"./elliptic/curves":164,"./elliptic/ec":165,"./elliptic/eddsa":168,"./elliptic/utils":172,brorand:79}],159:[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),this._bitLength=this.n?this.n.bitLength():0;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,this._bitLength),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 _=0;l>=0;){var j=!0;for(v=0;v=0&&_++,k=k.dblp(_),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":172,"./base":159,"bn.js":78,inherits:249}],161:[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":159,"./edwards":160,"./mont":162,"./short":163}],162:[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":172,"./base":159,"bn.js":78,inherits:249}],163:[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":172,"./base":159,"bn.js":78,inherits:249}],164:[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":161,"./precomputed/secp256k1":171,"./utils":172,"hash.js":229}],165:[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":164,"../utils":172,"./key":166,"./signature":167,"bn.js":78,brorand:79,"hmac-drbg":241}],166:[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":172,"bn.js":78}],167:[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;var i=15&r;if(0===i||i>4)return!1;for(var a=0,n=0,o=t.place;n>>=0;return!(a<=127)&&(t.place=o,a)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>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;var n=c(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;var u=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var p=c(e,r);if(!1===p)return!1;if(e.length!==p+r.place)return!1;var l=e.slice(r.place,p+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new i(u),this.s=new i(l),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":172,"bn.js":78}],168:[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(a>>1)-1?(a>>1)-c:c,n.isubn(s)):s=0,i[o]=s,n.iushrn(1)}return i},i.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var n,o,s,c=e.andln(3)+i&3,u=t.andln(3)+a&3;if(3===c&&(c=-1),3===u&&(u=-1),0==(1&c))n=0;else n=3!==(s=e.andln(7)+i&7)&&5!==s||2!==u?c:-c;if(r[0].push(n),0==(1&u))o=0;else o=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":78,"minimalistic-assert":268,"minimalistic-crypto-utils":269}],173:[function(e,t,r){t.exports={name:"elliptic",version:"6.5.3",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],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",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny ",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^1.4.3",coveralls:"^3.0.8",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.10.3",mocha:"^6.2.2"},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"}}},{}],174:[function(e,t,r){"use strict";var i,a=TypeError,n=Object.getOwnPropertyDescriptor;if(n)try{n({},"")}catch(e){n=null}var o=function(){throw new a},s=n?function(){try{return o}catch(e){try{return n(arguments,"callee").get}catch(e){return o}}}():o,c=e("has-symbols")(),u=Object.getPrototypeOf||function(e){return e.__proto__},p=i,l=i,f=i,h=i,d="undefined"==typeof Uint8Array?i:u(Uint8Array),m={"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":c?u([][Symbol.iterator]()):i,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":l,"%AsyncFunctionPrototype%":i,"%AsyncGenerator%":i,"%AsyncGeneratorFunction%":f,"%AsyncGeneratorPrototype%":i,"%AsyncIteratorPrototype%":h&&c&&Symbol.asyncIterator?h[Symbol.asyncIterator]():i,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":"undefined"==typeof DataView?i:DataView,"%DataViewPrototype%":"undefined"==typeof DataView?i:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float32ArrayPrototype%":"undefined"==typeof Float32Array?i:Float32Array.prototype,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%Float64ArrayPrototype%":"undefined"==typeof Float64Array?i:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":i,"%GeneratorFunction%":p,"%GeneratorPrototype%":i,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int8ArrayPrototype%":"undefined"==typeof Int8Array?i:Int8Array.prototype,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int16ArrayPrototype%":"undefined"==typeof Int16Array?i:Int8Array.prototype,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%Int32ArrayPrototype%":"undefined"==typeof Int32Array?i:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c?u(u([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%JSONParse%":"object"==typeof JSON?JSON.parse:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c?u((new Map)[Symbol.iterator]()):i,"%MapPrototype%":"undefined"==typeof Map?i:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%PromisePrototype%":"undefined"==typeof Promise?i:Promise.prototype,"%PromiseProto_then%":"undefined"==typeof Promise?i:Promise.prototype.then,"%Promise_all%":"undefined"==typeof Promise?i:Promise.all,"%Promise_reject%":"undefined"==typeof Promise?i:Promise.reject,"%Promise_resolve%":"undefined"==typeof Promise?i:Promise.resolve,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c?u((new Set)[Symbol.iterator]()):i,"%SetPrototype%":"undefined"==typeof Set?i:Set.prototype,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":c?u(""[Symbol.iterator]()):i,"%StringPrototype%":String.prototype,"%Symbol%":c?Symbol:i,"%SymbolPrototype%":c?Symbol.prototype:i,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":s,"%TypedArray%":d,"%TypedArrayPrototype%":d?d.prototype:i,"%TypeError%":a,"%TypeErrorPrototype%":a.prototype,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?i:Uint8Array.prototype,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray.prototype,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?i:Uint16Array.prototype,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?i:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakMapPrototype%":"undefined"==typeof WeakMap?i:WeakMap.prototype,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%WeakSetPrototype%":"undefined"==typeof WeakSet?i:WeakSet.prototype},g=e("function-bind").call(Function.call,String.prototype.replace),b=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,v=/\\(\\)?/g,y=function(e){var t=[];return g(e,b,(function(e,r,i,a){t[t.length]=i?g(a,v,"$1"):r||e})),t},w=function(e,t){if(!(e in m))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===m[e]&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return m[e]};t.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');for(var r=y(e),i=w("%"+(r.length>0?r[0]:"")+"%",t),o=1;o=r.length){var s=n(i,r[o]);if(!t&&!(r[o]in i))throw new a("base intrinsic for "+e+" exists, but the property is not available.");i=s&&"get"in s&&!("originalValue"in s.get)?s.get:i[r[o]]}else i=i[r[o]];return i}},{"function-bind":188,"has-symbols":210}],175:[function(e,t,r){"use strict";var i=e("function-bind"),a=e("../GetIntrinsic"),n=a("%Function.prototype.apply%"),o=a("%Function.prototype.call%"),s=a("%Reflect.apply%",!0)||i.call(o,n),c=a("%Object.defineProperty%",!0);if(c)try{c({},"a",{value:1})}catch(e){c=null}t.exports=function(){return s(i,o,arguments)};var u=function(){return s(i,n,arguments)};c?c(t.exports,"apply",{value:u}):t.exports.apply=u},{"../GetIntrinsic":174,"function-bind":188}],176:[function(e,t,r){"use strict";var i=e("../GetIntrinsic"),a=e("./callBind"),n=a(i("String.prototype.indexOf"));t.exports=function(e,t){var r=i(e,!!t);return"function"==typeof r&&n(e,".prototype.")?a(r):r}},{"../GetIntrinsic":174,"./callBind":175}],177:[function(e,t,r){"use strict";var i=e("../GetIntrinsic")("%Object.getOwnPropertyDescriptor%");if(i)try{i([],"length")}catch(e){i=null}t.exports=i},{"../GetIntrinsic":174}],178:[function(e,t,r){"use strict";var i,a="object"==typeof Reflect?Reflect:null,n=a&&"function"==typeof a.apply?a.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};i=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise((function(r,i){function a(){void 0!==n&&e.removeListener("error",n),r([].slice.call(arguments))}var n;"error"!==t&&(n=function(r){e.removeListener(t,a),i(r)},e.once("error",n)),e.once(t,a)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function p(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,i){var a,n,o,s;if(u(r),void 0===(n=e._events)?(n=e._events=Object.create(null),e._eventsCount=0):(void 0!==n.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),n=e._events),o=n[t]),void 0===o)o=n[t]=r,++e._eventsCount;else if("function"==typeof o?o=n[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(a=p(e))>0&&o.length>a&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,s=c,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=f.bind(i);return a.listener=r,i.wrapFn=a,a}function d(e,t,r){var i=e._events;if(void 0===i)return[];var a=i[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=a[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,p=g(c,u);for(r=0;r=0;n--)if(r[n]===t||r[n].listener===t){o=r[n].listener,a=n;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},{}],179:[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":262,"safe-buffer":329}],180:[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:380,https:247,net:127,tls:127,util:419}],186:[function(e,t,r){t.exports="object"==typeof self?self.FormData:window.FormData},{}],187:[function(e,t,r){"use strict";var i="Function.prototype.bind called on incompatible ",a=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";t.exports=function(e){var t=this;if("function"!=typeof t||n.call(t)!==o)throw new TypeError(i+t);for(var r,s=a.call(arguments,1),c=function(){if(this instanceof r){var i=t.apply(this,s.concat(a.call(arguments)));return Object(i)===i?i:this}return t.apply(e,s.concat(a.call(arguments)))},u=Math.max(0,t.length-s.length),p=[],l=0;l=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:249,"readable-stream":227,"safe-buffer":329}],213:[function(e,t,r){arguments[4][109][0].apply(r,arguments)},{dup:109}],214:[function(e,t,r){arguments[4][110][0].apply(r,arguments)},{"./_stream_readable":216,"./_stream_writable":218,_process:296,dup:110,inherits:249}],215:[function(e,t,r){arguments[4][111][0].apply(r,arguments)},{"./_stream_transform":217,dup:111,inherits:249}],216:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{"../errors":213,"./_stream_duplex":214,"./internal/streams/async_iterator":219,"./internal/streams/buffer_list":220,"./internal/streams/destroy":221,"./internal/streams/from":223,"./internal/streams/state":225,"./internal/streams/stream":226,_process:296,buffer:131,dup:112,events:178,inherits:249,"string_decoder/":228,util:80}],217:[function(e,t,r){arguments[4][113][0].apply(r,arguments)},{"../errors":213,"./_stream_duplex":214,dup:113,inherits:249}],218:[function(e,t,r){arguments[4][114][0].apply(r,arguments)},{"../errors":213,"./_stream_duplex":214,"./internal/streams/destroy":221,"./internal/streams/state":225,"./internal/streams/stream":226,_process:296,buffer:131,dup:114,inherits:249,"util-deprecate":416}],219:[function(e,t,r){arguments[4][115][0].apply(r,arguments)},{"./end-of-stream":222,_process:296,dup:115}],220:[function(e,t,r){arguments[4][116][0].apply(r,arguments)},{buffer:131,dup:116,util:80}],221:[function(e,t,r){arguments[4][117][0].apply(r,arguments)},{_process:296,dup:117}],222:[function(e,t,r){arguments[4][118][0].apply(r,arguments)},{"../../../errors":213,dup:118}],223:[function(e,t,r){arguments[4][119][0].apply(r,arguments)},{dup:119}],224:[function(e,t,r){arguments[4][120][0].apply(r,arguments)},{"../../../errors":213,"./end-of-stream":222,dup:120}],225:[function(e,t,r){arguments[4][121][0].apply(r,arguments)},{"../../../errors":213,dup:121}],226:[function(e,t,r){arguments[4][122][0].apply(r,arguments)},{dup:122,events:178}],227:[function(e,t,r){arguments[4][123][0].apply(r,arguments)},{"./lib/_stream_duplex.js":214,"./lib/_stream_passthrough.js":215,"./lib/_stream_readable.js":216,"./lib/_stream_transform.js":217,"./lib/_stream_writable.js":218,"./lib/internal/streams/end-of-stream.js":222,"./lib/internal/streams/pipeline.js":224,dup:123}],228:[function(e,t,r){arguments[4][124][0].apply(r,arguments)},{dup:124,"safe-buffer":329}],229:[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":230,"./hash/hmac":231,"./hash/ripemd":232,"./hash/sha":233,"./hash/utils":240}],230:[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":240}],240:[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:249,"minimalistic-assert":268}],241:[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");x="",w=h;break;case h:'"'===S?(_.params[k]=x,w=d):x+=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(_.params.headers&&""!==_.params.headers?_.params.headers=_.params.headers.split(" "):e.headers["x-date"]?_.params.headers=["x-date"]:_.params.headers=["date"],!_.scheme||"Signature"!==_.scheme)throw new g('scheme was not "Signature"');if(!_.params.keyId)throw new g("keyId was not specified");if(!_.params.algorithm)throw new g("algorithm was not specified");if(!_.params.signature)throw new g("signature was not specified");_.params.algorithm=_.params.algorithm.toLowerCase();try{c(_.params.algorithm)}catch(e){throw e instanceof s?new b(_.params.algorithm+" is not supported"):e}for(n=0;n<_.params.headers.length;n++){var A=_.params.headers[n].toLowerCase();if(_.params.headers[n]=A,"request-line"===A){if(t.strict)throw new y("request-line is not a valid header with strict parsing enabled.");_.signingString+=e.method+" "+e.url+" HTTP/"+e.httpVersion}else if("(request-target)"===A)_.signingString+="(request-target): "+e.method.toLowerCase()+" "+e.url;else{var M=e.headers[A];if(void 0===M)throw new v(A+" was not in the request");_.signingString+=A+": "+M}n+1<_.params.headers.length&&(_.signingString+="\n")}if(e.headers.date||e.headers["x-date"]){a=e.headers["x-date"]?new Date(e.headers["x-date"]):new Date(e.headers.date);var P=new Date,z=Math.abs(P.getTime()-a.getTime());if(z>1e3*t.clockSkew)throw new m("clock skew of "+z/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach((function(e){if(_.params.headers.indexOf(e.toLowerCase())<0)throw new v(e+" was not a signed header")})),t.algorithms&&-1===t.algorithms.indexOf(_.params.algorithm))throw new b(_.params.algorithm+" is not a supported algorithm");return _.algorithm=_.params.algorithm.toUpperCase(),_.keyId=_.params.keyId,_}}},{"./utils":245,"assert-plus":65,util:419}],244:[function(e,t,r){(function(r){(function(){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 */ r.read=function(e,t,r,i,a){var n,o,s=8*a-i-1,c=(1<>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}},{}],249:[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}}},{}],250:[function(e,t,r){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,a=Object.prototype.toString,n=function(e){return!(i&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===a.call(e)},o=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==a.call(e)&&"[object Function]"===a.call(e.callee)},s=function(){return n(arguments)}();n.isLegacyArguments=o,t.exports=s?n:o},{}],251:[function(e,t,r){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ 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)}},{}],252:[function(e,t,r){"use strict";var i=Object.prototype.toString,a=Function.prototype.toString,n=/^\s*(?:function)?\*/,o="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,s=Object.getPrototypeOf,c=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(e){}}(),u=c?s(c):{};t.exports=function(e){return"function"==typeof e&&(!!n.test(a.call(e))||(o?s(e)===u:"[object GeneratorFunction]"===i.call(e)))}},{}],253:[function(e,t,r){"use strict";t.exports=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}},{}],254:[function(e,t,r){(function(r){(function(){"use strict";var i=e("foreach"),a=e("available-typed-arrays"),n=e("es-abstract/helpers/callBound"),o=n("Object.prototype.toString"),s=e("has-symbols")()&&"symbol"==typeof Symbol.toStringTag,c=a(),u=n("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!f&&function(e){var t=!1;return i(l,(function(r,i){if(!t)try{t=r.call(e)===i}catch(e){}})),t}(e)}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":70,"es-abstract/helpers/callBound":176,"es-abstract/helpers/getOwnPropertyDescriptor":177,foreach:184,"has-symbols":210}],255:[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)]}},{}],256:[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:364}],257:[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 h(e){this.m=e}function d(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 w(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function k(){}function x(e){return e}function _(e){this.r2=a(),this.q3=a(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}h.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},h.prototype.revert=function(e){return e},h.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},h.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},h.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},d.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},d.prototype.revert=function(e){var t=a();return e.copyTo(t),this.reduce(t),t},d.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)},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)},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]:p(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,h=s[l-1];if(0!=h){var d=h*(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]==h?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=f(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=u(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+=u(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)+f(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 h(t):new d(t),this.exp(e,r)},i.ZERO=l(0),i.ONE=l(1),k.prototype.convert=x,k.prototype.revert=x,k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},k.prototype.sqrTo=function(e,t){e.squareTo(t)},_.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},_.prototype.revert=function(e){return e},_.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)},_.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},_.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var j,S,E,A=[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],M=(1<<26)/A[A.length-1];function P(){var e;e=(new Date).getTime(),S[E++]^=255&e,S[E++]^=e>>8&255,S[E++]^=e>>16&255,S[E++]^=e>>24&255,E>=T&&(E-=T)}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=l(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),g,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)>A.length&&(e=A.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,m,t),t},i.prototype.or=function(e){var t=a();return this.bitwiseTo(e,g,t),t},i.prototype.xor=function(e){var t=a();return this.bitwiseTo(e,b,t),t},i.prototype.andNot=function(e){var t=a();return this.bitwiseTo(e,v,t),t},i.prototype.not=function(){for(var e=a(),t=0;t=this.t?0!=this.s:0!=(this[t]&1<1){var m=a();for(i.sqrTo(s[1],m);c<=p;)s[c]=a(),i.mulTo(m,s[c-2],s[c]),c+=2}var g,b,v=e.t-1,y=!0,w=a();for(n=f(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 k)},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]<=A[A.length-1]){for(t=0;t>>8,S[E++]=255&z;E=0,P()}function O(){if(null==j){for(P(),(j=new q).init(S),E=0;Et.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},{}],261:[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)}function c(e,t){if(null!==e&&"object"==typeof e){if(e.hasOwnProperty(t))return e[t];var r=t.indexOf(".");if(-1!=r){var i=t.substr(0,r);if(e.hasOwnProperty(i))return c(e[i],t.substr(r+1))}}}function u(e,t,r,a){var n,o;if(0===t)return(n=r.slice(0)).push(e),void a(n);for(o in i.ok(null!==e),i.equal(typeof e,"object"),i.equal(typeof t,"number"),i.ok(t>=0),e)(n=r.slice(0)).push(o),u(e[o],t-1,n,a)}r.deepCopy=function e(t){var r,i,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,n=[];for(a in t)e(t[a],r-1).forEach((function(e){n.push([a].concat(e))}));return n},r.flattenIter=function(e,t,r){u(e,t,[],r)},r.validateJsonObject=b,r.validateJsonObjectJS=b,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,p=1,l=0,b=0,v=e.length;if(n.trimWhitespace)for(;bf||y=48&&e<=57?e-48:e>=65&&e<=90?e-55:e>=97&&e<=122?e-87:-1}function g(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 b(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 v(e){i.ok(e[0]>=0&&e[1]>=0,"negative numbers not allowed in hrtimes"),i.ok(e[1]<1e9,"nanoseconds column overflow")}function y(e,t){v(e),v(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 w(e,t){return v(e),v(t),e[1]+=t[1],e[1]>=1e9&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function k(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":65,extsprintf:181,"json-schema":259,util:419,verror:424}],262:[function(e,t,r){"use strict";var i=e("inherits"),a=e("hash-base"),n=e("safe-buffer").Buffer,o=new Array(16);function s(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>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":212,inherits:249,"safe-buffer":329}],263:[function(e,t,r){"use strict";const i=e("is-plain-obj"),{hasOwnProperty:a}=Object.prototype,{propertyIsEnumerable:n}=Object,o=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),s=this,c={concatArrays:!1,ignoreUndefined:!1},u=e=>{const t=[];for(const r in e)a.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const i of r)n.call(e,i)&&t.push(i)}return t};function p(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return u(e).forEach((r=>{o(t,r,p(e[r]))})),t}(e):i(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return u(e).forEach((r=>{o(t,r,p(e[r]))})),t}(e):e}const l=(e,t,r,i)=>(r.forEach((r=>{void 0===t[r]&&i.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?o(e,r,f(e[r],t[r],i)):o(e,r,p(t[r])))})),e);function f(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?((e,t,r)=>{let i=e.slice(0,0),n=0;return[e,t].forEach((t=>{const s=[];for(let r=0;r!s.includes(e))),r)})),i})(e,t,r):i(t)&&i(e)?l(e,t,u(t),r):p(t)}t.exports=function(...e){const t=f(p(c),this!==s&&this||{},c);let r={_:{}};for(const a of e)if(void 0!==a){if(!i(a))throw new TypeError("`"+a+"` is not an Option Object");r=f(r,{_:a},t)}return r._}},{"is-plain-obj":253}],264:[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":266,path:288}],268:[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)}},{}],269:[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}},{}],270:[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}},{}],274:[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}},{}],275:[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}},{}],276:[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=-2,p=258,l=262,f=103,h=113,d=666;function m(e,t){return e.msg=c[t],t}function g(e){return(e<<1)-(e>4?9:0)}function b(e){for(var t=e.length;--t>=0;)e[t]=0}function v(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 y(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,v(e.strm)}function w(e,t){e.pending_buf[e.pending++]=t}function k(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function x(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-l?e.strstart-(e.w_size-l):0,u=e.window,f=e.w_mask,h=e.prev,d=e.strstart+p,m=u[n+o-1],g=u[n+o];e.prev_length>=e.good_match&&(a>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===g&&u[r+o-1]===m&&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;m=u[n+o-1],g=u[n+o]}}}while((t=h[t&f])>c&&0!=--a);return o<=e.lookahead?o:e.lookahead}function _(e){var t,r,i,n,c,u,p,f,h,d,m=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-l)){a.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=r=e.hash_size;do{i=e.head[--t],e.head[t]=i>=m?i-m:0}while(--r);t=r=m;do{i=e.prev[--t],e.prev[t]=i>=m?i-m:0}while(--r);n+=m}if(0===e.strm.avail_in)break;if(u=e.strm,p=e.window,f=e.strstart+e.lookahead,h=n,d=void 0,(d=u.avail_in)>h&&(d=h),r=0===d?0:(u.avail_in-=d,a.arraySet(p,u.input,u.next_in,d,f),1===u.state.wrap?u.adler=o(u.adler,p,d,f):2===u.state.wrap&&(u.adler=s(u.adler,p,d,f)),u.next_in+=d,u.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),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>9||8!==r||i<8||i>15||t<0||t>9||o<0||o>4)return m(e,u);8===i&&(i=9);var c=new A;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(_(e),0===e.lookahead&&0===t)return 1;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,y(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-l&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(y(e,!1),e.strm.avail_out),1)})),new E(4,4,8,4,j),new E(4,5,16,8,j),new E(4,6,32,32,j),new E(4,4,16,16,S),new E(8,16,32,32,S),new E(8,16,128,128,S),new E(8,32,128,256,S),new E(32,128,258,1024,S),new E(32,258,258,4096,S)],r.deflateInit=function(e,t){return z(e,t,8,15,8,0)},r.deflateInit2=z,r.deflateReset=P,r.deflateResetKeep=M,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?u:(e.state.gzhead=t,0):u},r.deflate=function(e,t){var r,a,o,c;if(!e||!e.state||t>5||t<0)return e?m(e,u):u;if(a=e.state,!e.output||!e.input&&0!==e.avail_in||a.status===d&&4!==t)return m(e,0===e.avail_out?-5:u);if(a.strm=e,r=a.last_flush,a.last_flush=t,42===a.status)if(2===a.wrap)e.adler=0,w(a,31),w(a,139),w(a,8),a.gzhead?(w(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)),w(a,255&a.gzhead.time),w(a,a.gzhead.time>>8&255),w(a,a.gzhead.time>>16&255),w(a,a.gzhead.time>>24&255),w(a,9===a.level?2:a.strategy>=2||a.level<2?4:0),w(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(w(a,255&a.gzhead.extra.length),w(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=69):(w(a,0),w(a,0),w(a,0),w(a,0),w(a,0),w(a,9===a.level?2:a.strategy>=2||a.level<2?4:0),w(a,3),a.status=h);else{var l=8+(a.w_bits-8<<4)<<8;l|=(a.strategy>=2||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(l|=32),l+=31-l%31,a.status=h,k(a,l),0!==a.strstart&&(k(a,e.adler>>>16),k(a,65535&e.adler)),e.adler=1}if(69===a.status)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)),v(e),o=a.pending,a.pending!==a.pending_buf_size));)w(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=73)}else a.status=73;if(73===a.status)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)),v(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=91)}else a.status=91;if(91===a.status)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)),v(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=f)}else a.status=f;if(a.status===f&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&v(e),a.pending+2<=a.pending_buf_size&&(w(a,255&e.adler),w(a,e.adler>>8&255),e.adler=0,a.status=h)):a.status=h),0!==a.pending){if(v(e),0===e.avail_out)return a.last_flush=-1,0}else if(0===e.avail_in&&g(t)<=g(r)&&4!==t)return m(e,-5);if(a.status===d&&0!==e.avail_in)return m(e,-5);if(0!==e.avail_in||0!==a.lookahead||0!==t&&a.status!==d){var x=2===a.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(_(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(a,t):3===a.strategy?function(e,t){for(var r,i,a,o,s=e.window;;){if(e.lookahead<=p){if(_(e),e.lookahead<=p&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=s[a=e.strstart-1])===s[++a]&&i===s[++a]&&i===s[++a]){o=e.strstart+p;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>=3?(r=n._tr_tally(e,1,e.match_length-3),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&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(a,t):i[a.level].func(a,t);if(3!==x&&4!==x||(a.status=d),1===x||3===x)return 0===e.avail_out&&(a.last_flush=-1),0;if(2===x&&(1===t?n._tr_align(a):5!==t&&(n._tr_stored_block(a,0,0,!1),3===t&&(b(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),v(e),0===e.avail_out))return a.last_flush=-1,0}return 4!==t?0:a.wrap<=0?1:(2===a.wrap?(w(a,255&e.adler),w(a,e.adler>>8&255),w(a,e.adler>>16&255),w(a,e.adler>>24&255),w(a,255&e.total_in),w(a,e.total_in>>8&255),w(a,e.total_in>>16&255),w(a,e.total_in>>24&255)):(k(a,e.adler>>>16),k(a,65535&e.adler)),v(e),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?0:1)},r.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==f&&t!==h&&t!==d?m(e,u):(e.state=null,t===h?m(e,-3):0):u},r.deflateSetDictionary=function(e,t){var r,i,n,s,c,p,l,f,h=t.length;if(!e||!e.state)return u;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return u;for(1===s&&(e.adler=o(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(b(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new a.Buf8(r.w_size),a.arraySet(f,t,h-r.w_size,r.w_size,0),t=f,h=r.w_size),c=e.avail_in,p=e.next_in,l=e.input,e.avail_in=h,e.next_in=0,e.input=t,_(r);r.lookahead>=3;){i=r.strstart,n=r.lookahead-2;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,x>(w=n-o)){if((w=x-w)>p&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(_=0,j=f,0===l){if(_+=u-w,w2;)E[n++]=j[_++],E[n++]=j[_++],E[n++]=j[_++],k-=3;k&&(E[n++]=j[_++],k>1&&(E[n++]=j[_++]))}else{_=n-x;do{E[n++]=E[_++],E[n++]=E[_++],E[n++]=E[_++],k-=3}while(k>2);k&&(E[n++]=E[_++],k>1&&(E[n++]=E[_++]))}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 f(){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 h(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=1,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(852),t.distcode=t.distdyn=new i.Buf32(592),t.sane=1,t.back=-1,0):c}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):c}function m(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)?c:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,d(e))):c}function g(e,t){var r,i;return e?(i=new f,e.state=i,i.window=null,0!==(r=m(e,t))&&(e.state=null),r):c}var b,v,y=!0;function w(e){if(y){var t;for(b=new i.Buf32(512),v=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(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,v,0,e.work,{bits:5}),y=!1}e.lencode=b,e.lenbits=9,e.distcode=v,e.distbits=5}function k(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,R,2,0),v=0,y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",r.mode=p;break}if(8!=(15&v)){e.msg="unknown compression method",r.mode=p;break}if(y-=4,O=8+(15&(v>>>=4)),0===r.wbits)r.wbits=O;else if(O>r.wbits){e.msg="invalid window size",r.mode=p;break}r.dmax=1<>8&1),512&r.flags&&(R[0]=255&v,R[1]=v>>>8&255,r.check=n(r.check,R,2,0)),v=0,y=0,r.mode=3;case 3:for(;y<32;){if(0===g)break e;g--,v+=f[d++]<>>8&255,R[2]=v>>>16&255,R[3]=v>>>24&255,r.check=n(r.check,R,4,0)),v=0,y=0,r.mode=4;case 4:for(;y<16;){if(0===g)break e;g--,v+=f[d++]<>8),512&r.flags&&(R[0]=255&v,R[1]=v>>>8&255,r.check=n(r.check,R,2,0)),v=0,y=0,r.mode=5;case 5:if(1024&r.flags){for(;y<16;){if(0===g)break e;g--,v+=f[d++]<>>8&255,r.check=n(r.check,R,2,0)),v=0,y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((j=r.length)>g&&(j=g),j&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,f,d,j,O)),512&r.flags&&(r.check=n(r.check,f,j,d)),g-=j,d+=j,r.length-=j),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break e;j=0;do{O=f[d+j++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O))}while(O&&j>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=u;break;case 10:for(;y<32;){if(0===g)break e;g--,v+=f[d++]<>>=7&y,y-=7&y,r.mode=27;break}for(;y<3;){if(0===g)break e;g--,v+=f[d++]<>>=1)){case 0:r.mode=14;break;case 1:if(w(r),r.mode=20,6===t){v>>>=2,y-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=p}v>>>=2,y-=2;break;case 14:for(v>>>=7&y,y-=7&y;y<32;){if(0===g)break e;g--,v+=f[d++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=p;break}if(r.length=65535&v,v=0,y=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(j=r.length){if(j>g&&(j=g),j>b&&(j=b),0===j)break e;i.arraySet(h,f,d,j,m),g-=j,d+=j,b-=j,m+=j,r.length-=j;break}r.mode=u;break;case 17:for(;y<14;){if(0===g)break e;g--,v+=f[d++]<>>=5,y-=5,r.ndist=1+(31&v),v>>>=5,y-=5,r.ncode=4+(15&v),v>>>=4,y-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=p;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,y-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,q={bits:r.lenbits},B=s(0,r.lens,0,19,r.lencode,0,r.work,q),r.lenbits=q.bits,B){e.msg="invalid code lengths set",r.mode=p;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,P=65535&C,!((A=C>>>24)<=y);){if(0===g)break e;g--,v+=f[d++]<>>=A,y-=A,r.lens[r.have++]=P;else{if(16===P){for(T=A+2;y>>=A,y-=A,0===r.have){e.msg="invalid bit length repeat",r.mode=p;break}O=r.lens[r.have-1],j=3+(3&v),v>>>=2,y-=2}else if(17===P){for(T=A+3;y>>=A)),v>>>=3,y-=3}else{for(T=A+7;y>>=A)),v>>>=7,y-=7}if(r.have+j>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=p;break}for(;j--;)r.lens[r.have++]=O}}if(r.mode===p)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=p;break}if(r.lenbits=9,q={bits:r.lenbits},B=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,q),r.lenbits=q.bits,B){e.msg="invalid literal/lengths set",r.mode=p;break}if(r.distbits=6,r.distcode=r.distdyn,q={bits:r.distbits},B=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,q),r.distbits=q.bits,B){e.msg="invalid distances set",r.mode=p;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(g>=6&&b>=258){e.next_out=m,e.avail_out=b,e.next_in=d,e.avail_in=g,r.hold=v,r.bits=y,o(e,_),m=e.next_out,h=e.output,b=e.avail_out,d=e.next_in,f=e.input,g=e.avail_in,v=r.hold,y=r.bits,r.mode===u&&(r.back=-1);break}for(r.back=0;M=(C=r.lencode[v&(1<>>16&255,P=65535&C,!((A=C>>>24)<=y);){if(0===g)break e;g--,v+=f[d++]<>z)])>>>16&255,P=65535&C,!(z+(A=C>>>24)<=y);){if(0===g)break e;g--,v+=f[d++]<>>=z,y-=z,r.back+=z}if(v>>>=A,y-=A,r.back+=A,r.length=P,0===M){r.mode=26;break}if(32&M){r.back=-1,r.mode=u;break}if(64&M){e.msg="invalid literal/length code",r.mode=p;break}r.extra=15&M,r.mode=22;case 22:if(r.extra){for(T=r.extra;y>>=r.extra,y-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;M=(C=r.distcode[v&(1<>>16&255,P=65535&C,!((A=C>>>24)<=y);){if(0===g)break e;g--,v+=f[d++]<>z)])>>>16&255,P=65535&C,!(z+(A=C>>>24)<=y);){if(0===g)break e;g--,v+=f[d++]<>>=z,y-=z,r.back+=z}if(v>>>=A,y-=A,r.back+=A,64&M){e.msg="invalid distance code",r.mode=p;break}r.offset=P,r.extra=15&M,r.mode=24;case 24:if(r.extra){for(T=r.extra;y>>=r.extra,y-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=p;break}r.mode=25;case 25:if(0===b)break e;if(j=_-b,r.offset>j){if((j=r.offset-j)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=p;break}j>r.wnext?(j-=r.wnext,S=r.wsize-j):S=r.wnext-j,j>r.length&&(j=r.length),E=r.window}else E=h,S=m-r.offset,j=r.length;j>b&&(j=b),b-=j,r.length-=j;do{h[m++]=E[S++]}while(--j);0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;h[m++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;y<32;){if(0===g)break e;g--,v|=f[d++]<=1&&0===T[A];A--);if(M>A&&(M=A),0===A)return p[l++]=20971520,p[l++]=20971520,h.bits=1,0;for(E=1;E0&&(0===e||1!==A))return-1;for(C[1]=0,j=1;j852||2===e&&I>592)return 1;for(;;){w=j-z,f[S]y?(k=R[D+f[S]],x=B[q+f[S]]):(k=96,x=0),d=1<>z)+(m-=d)]=w<<24|k<<16|x|0}while(0!==m);for(d=1<>=1;if(0!==d?(O&=d-1,O+=d):O=0,S++,0==--T[j]){if(j===A)break;j=t[r+f[S]]}if(j>M&&(O&b)!==g){for(0===z&&(z=M),v+=E,F=1<<(P=j-z);P+z852||2===e&&I>592)return 1;p[g=O&b]=M<<24|P<<16|v-l|0}}return 0!==O&&(p[v+O]=j-z<<24|64<<16|0),h.bits=M,0}},{"../utils/common":272}],280:[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"}},{}],281:[function(e,t,r){"use strict";var i=e("../utils/common");function a(e){for(var t=e.length;--t>=0;)e[t]=0}var n=256,o=286,s=30,c=15,u=[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],p=[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],l=[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],h=new Array(576);a(h);var d=new Array(60);a(d);var m=new Array(512);a(m);var g=new Array(256);a(g);var b=new Array(29);a(b);var v,y,w,k=new Array(s);function x(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 _(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function j(e){return e<256?m[e]:m[256+(e>>>7)]}function S(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function E(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function P(e,t,r){var i,a,n=new Array(16),o=0;for(i=1;i<=c;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]=M(n[s]++,s))}}function z(e){var t;for(t=0;t8?S(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 I(e,t,r,i){var a=2*t,n=2*r;return e[a]>1;r>=1;r--)O(e,n,r);a=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],O(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++,O(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,u=t.dyn_tree,p=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,m=t.stat_desc.max_length,g=0;for(n=0;n<=c;n++)e.bl_count[n]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(n=u[2*u[2*(i=e.heap[r])+1]+1]+1)>m&&(n=m,g++),u[2*i+1]=n,i>p||(e.bl_count[n]++,o=0,i>=d&&(o=h[i-d]),s=u[2*i],e.opt_len+=s*(n+o),f&&(e.static_len+=s*(l[2*i+1]+o)));if(0!==g){do{for(n=m-1;0===e.bl_count[n];)n--;e.bl_count[n]--,e.bl_count[n+1]+=2,e.bl_count[m]--,g-=2}while(g>0);for(n=m;0!==n;n--)for(i=e.bl_count[n];0!==i;)(a=e.heap[--r])>p||(u[2*a+1]!==n&&(e.opt_len+=(n-u[2*a+1])*u[2*a],u[2*a+1]=n),i--)}}(e,t),P(n,p,e.bl_count)}function T(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?(2===e.strm.data_type&&(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 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;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),a=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=a&&(a=o)):a=o=r+5,r+4<=a&&-1!==t?D(e,t,r,i):4===e.strategy||o===a?(E(e,2+(i?1:0),3),B(e,h,d)):(E(e,4+(i?1:0),3),function(e,t,r,i){var a;for(E(e,t-257,5),E(e,r-1,5),E(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*(g[r]+n+1)]++,e.dyn_dtree[2*j(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){E(e,2,3),A(e,256,h),function(e){16===e.bi_valid?(S(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":272}],282:[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}},{}],283:[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"}},{}],284:[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":285,"asn1.js":45}],285:[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":45}],286:[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=c.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(a)[1],data:r}}},{"browserify-aes":83,evp_bytestokey:179,"safe-buffer":329}],287:[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)}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)}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":283,"./asn1":284,"./fixProc":286,"browserify-aes":83,pbkdf2:289,"safe-buffer":329}],288:[function(e,t,r){(function(e){(function(){"use strict";function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var r,i="",a=0,n=-1,o=0,s=0;s<=e.length;++s){if(s2){var c=i.lastIndexOf("/");if(c!==i.length-1){-1===c?(i="",a=0):a=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),n=s,o=0;continue}}else if(2===i.length||1===i.length){i="",a=0,n=s,o=0;continue}t&&(i.length>0?i+="/..":i="..",a=2)}else i.length>0?i+="/"+e.slice(n+1,s):i=e.slice(n+1,s),a=s-n-1;n=s,o=0}else 46===r&&-1!==o?++o:o=-1}return i}var a={resolve:function(){for(var t,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var s;o>=0?s=arguments[o]:(void 0===t&&(t=e.cwd()),s=t),r(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0))}return a=i(a,!n),n?a.length>0?"/"+a:"/":a.length>0?a:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&a&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":a.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=a.resolve(e))===(t=a.resolve(t)))return"";for(var i=1;iu){if(47===t.charCodeAt(s+l))return t.slice(s+l+1);if(0===l)return t.slice(s+l)}else o>u&&(47===e.charCodeAt(i+l)?p=l:0===l&&(p=0));break}var f=e.charCodeAt(i+l);if(f!==t.charCodeAt(s+l))break;47===f&&(p=l)}var h="";for(l=i+p+1;l<=n;++l)l!==n&&47!==e.charCodeAt(l)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(s+p):(s+=p,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),i=47===t,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return-1===a?i?"/":".":i&&1===a?"//":e.slice(0,a)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var i,a=0,n=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,c=-1;for(i=e.length-1;i>=0;--i){var u=e.charCodeAt(i);if(47===u){if(!o){a=i+1;break}}else-1===c&&(o=!1,c=i+1),s>=0&&(u===t.charCodeAt(s)?-1==--s&&(n=i):(s=-1,n=c))}return a===n?n=c:-1===n&&(n=e.length),e.slice(a,n)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!o){a=i+1;break}}else-1===n&&(o=!1,n=i+1);return-1===n?"":e.slice(a,n)},extname:function(e){r(e);for(var t=-1,i=0,a=-1,n=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===a&&(n=!1,a=s+1),46===c?-1===t?t=s:1!==o&&(o=1):-1!==t&&(o=-1);else if(!n){i=s+1;break}}return-1===t||-1===a||0===o||1===o&&t===a-1&&t===i+1?"":e.slice(t,a)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+i:r+e+i:i}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var i,a=e.charCodeAt(0),n=47===a;n?(t.root="/",i=1):i=0;for(var o=-1,s=0,c=-1,u=!0,p=e.length-1,l=0;p>=i;--p)if(47!==(a=e.charCodeAt(p)))-1===c&&(u=!1,c=p+1),46===a?-1===o?o=p:1!==l&&(l=1):-1!==o&&(l=-1);else if(!u){s=p+1;break}return-1===o||-1===c||0===l||1===l&&o===c-1&&o===s+1?-1!==c&&(t.base=t.name=0===s&&n?e.slice(1,c):e.slice(s,c)):(0===s&&n?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(s,o),t.base=e.slice(s,c)),t.ext=e.slice(o,c)),s>0?t.dir=e.slice(0,s-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,t.exports=a}).call(this)}).call(this,e("_process"))},{_process:296}],289:[function(e,t,r){r.pbkdf2=e("./lib/async"),r.pbkdf2Sync=e("./lib/sync")},{"./lib/async":290,"./lib/sync":293}],290:[function(e,t,r){(function(r,i){(function(){var a,n=e("safe-buffer").Buffer,o=e("./precondition"),s=e("./default-encoding"),c=e("./sync"),u=e("./to-buffer"),p=i.crypto&&i.crypto.subtle,l={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"},f=[];function h(e,t,r,i,a){return p.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return p.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:a}},e,i<<3)})).then((function(e){return n.from(e)}))}t.exports=function(e,t,d,m,g,b){"function"==typeof g&&(b=g,g=void 0);var v=l[(g=g||"sha1").toLowerCase()];if(!v||"function"!=typeof i.Promise)return r.nextTick((function(){var r;try{r=c(e,t,d,m,g)}catch(e){return b(e)}b(null,r)}));if(o(d,m),e=u(e,s,"Password"),t=u(t,s,"Salt"),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");!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(!p||!p.importKey||!p.deriveBits)return Promise.resolve(!1);if(void 0!==f[e])return f[e];var t=h(a=a||n.alloc(8),a,10,128,e).then((function(){return!0})).catch((function(){return!1}));return f[e]=t,t}(v).then((function(r){return r?h(e,t,d,m,v):c(e,t,d,m,g)})),b)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":291,"./precondition":292,"./sync":293,"./to-buffer":294,_process:296,"safe-buffer":329}],291:[function(e,t,r){(function(e){(function(){var r;if(e.browser)r="utf-8";else if(e.version){r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";t.exports=r}).call(this)}).call(this,e("_process"))},{_process:296}],292:[function(e,t,r){var i=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>i||t!=t)throw new TypeError("Bad key length")}},{}],293:[function(e,t,r){var i=e("create-hash/md5"),a=e("ripemd160"),n=e("sha.js"),o=e("safe-buffer").Buffer,s=e("./precondition"),c=e("./default-encoding"),u=e("./to-buffer"),p=o.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,r){var s=function(e){function t(t){return n(e).update(t).digest()}function r(e){return(new a).update(e).digest()}return"rmd160"===e||"ripemd160"===e?r:"md5"===e?i:t}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=s(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":297,punycode:128}],299:[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":301,"./publicEncrypt":302}],300:[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":300,"./withPublic":303,"./xor":304,"bn.js":78,"browserify-rsa":101,"create-hash":138,"parse-asn1":287,"safe-buffer":329}],302:[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":300,"./withPublic":303,"./xor":304,"bn.js":78,"browserify-rsa":101,"create-hash":138,"parse-asn1":287,randombytes:313,"safe-buffer":329}],303:[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":78,"safe-buffer":329}],304:[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":305,"./utils":309}],309:[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)}}},{}],310:[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)}},{}],311:[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)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:296,randombytes:313,"safe-buffer":329}],315:[function(e,t,r){"use strict";var i=e("extend"),a=e("./lib/cookies"),n=e("./lib/helpers").paramsHaveRequestBody;function o(e,t,r){"function"==typeof t&&(r=t);var a={};return null!==t&&"object"==typeof t?i(a,t,{uri:e}):i(a,"string"==typeof e?{uri:e}:e),a.callback=r||a.callback,a}function s(e,t,r){if(void 0===e)throw new Error("undefined is not a valid uri or options object.");var i=o(e,t,r);if("HEAD"===i.method&&n(i))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new s.Request(i)}function c(e){var t=e.toUpperCase();return function(e,r,i){var a=o(e,r,i);return a.method=t,s(a,a.callback)}}function u(e,t,r,a){return function(n,s,c){var u=o(n,s,c),p={};return i(!0,p,t,u),p.pool=u.pool||t.pool,a&&(p.method=a.toUpperCase()),"function"==typeof r&&(e=r),e(p,p.callback)}}s.get=c("get"),s.head=c("head"),s.options=c("options"),s.post=c("post"),s.put=c("put"),s.patch=c("patch"),s.del=c("delete"),s.delete=c("delete"),s.jar=function(e){return a.jar(e)},s.cookie=function(e){return a.parse(e)},s.defaults=function(e,t){var r=this;"function"==typeof(e=e||{})&&(t=e,e={});var i=u(r,e,t);return["get","head","post","put","patch","del","delete"].forEach((function(a){i[a]=u(r[a],e,t,a)})),i.cookie=u(r.cookie,e,t),i.jar=r.jar,i.defaults=r.defaults,i},s.forever=function(e,t){var r={};return t&&i(r,t),e&&(r.agentOptions=e),r.forever=!0,s.defaults(r)},t.exports=s,s.Request=e("./request"),s.initParams=o,Object.defineProperty(s,"debug",{enumerable:!0,get:function(){return s.Request.debug},set:function(e){s.Request.debug=e}})},{"./lib/cookies":317,"./lib/helpers":321,"./request":327,extend:180}],316:[function(e,t,r){"use strict";var i=e("caseless"),a=e("uuid/v4"),n=e("./helpers"),o=n.md5,s=n.toBase64;function c(e){this.request=e,this.hasAuth=!1,this.sentAuth=!1,this.bearerToken=null,this.user=null,this.pass=null}c.prototype.basic=function(e,t,r){var i=this;if(("string"!=typeof e||void 0!==t&&"string"!=typeof t)&&i.request.emit("error",new Error("auth() received invalid user or password")),i.user=e,i.pass=t,i.hasAuth=!0,r||void 0===r){var a="Basic "+s(e+":"+(t||""));return i.sentAuth=!0,a}},c.prototype.bearer=function(e,t){var r=this;if(r.bearerToken=e,r.hasAuth=!0,t||void 0===t){"function"==typeof e&&(e=e());var i="Bearer "+(e||"");return r.sentAuth=!0,i}},c.prototype.digest=function(e,t,r){for(var i=this,n={},s=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;;){var c=s.exec(r);if(!c)break;n[c[1]]=c[2]||c[3]}var u=/(^|,)\s*auth\s*($|,)/.test(n.qop)&&"auth",p=u&&"00000001",l=u&&a().replace(/-/g,""),f=function(e,t,r,i,a,n){var s=o(t+":"+r+":"+i);return e&&"md5-sess"===e.toLowerCase()?o(s+":"+a+":"+n):s}(n.algorithm,i.user,n.realm,i.pass,n.nonce,l),h=o(e+":"+t),d=o(u?f+":"+n.nonce+":"+p+":"+l+":"+u+":"+h:f+":"+n.nonce+":"+h),m={username:i.user,realm:n.realm,nonce:n.nonce,uri:t,qop:u,response:d,nc:p,cnonce:l,algorithm:n.algorithm,opaque:n.opaque};for(var g in r=[],m)m[g]&&("qop"===g||"nc"===g||"algorithm"===g?r.push(g+"="+m[g]):r.push(g+'="'+m[g]+'"'));return r="Digest "+r.join(", "),i.sentAuth=!0,r},c.prototype.onRequest=function(e,t,r,i){var a,n=this,o=n.request;void 0===i&&void 0===e?n.request.emit("error",new Error("no auth mechanism defined")):a=void 0!==i?n.bearer(i,r):n.basic(e,t,r),a&&o.setHeader("authorization",a)},c.prototype.onResponse=function(e){var t=this,r=t.request;if(!t.hasAuth||t.sentAuth)return null;var a=i(e.headers).get("www-authenticate"),n=a&&a.split(" ")[0].toLowerCase();switch(r.debug("reauth",n),n){case"basic":return t.basic(t.user,t.pass,!0);case"bearer":return t.bearer(t.bearerToken,!0);case"digest":return t.digest(r.method,r.path,a)}},r.Auth=c},{"./helpers":321,caseless:133,"uuid/v4":422}],317:[function(e,t,r){"use strict";var i=e("tough-cookie"),a=i.Cookie,n=i.CookieJar;function o(e){this._jar=new n(e,{looseMode:!0})}r.parse=function(e){if(e&&e.uri&&(e=e.uri),"string"!=typeof e)throw new Error("The cookie function only accepts STRING as param");return a.parse(e,{loose:!0})},o.prototype.setCookie=function(e,t,r){return this._jar.setCookieSync(e,t,r||{})},o.prototype.getCookieString=function(e){return this._jar.getCookieStringSync(e)},o.prototype.getCookies=function(e){return this._jar.getCookiesSync(e)},r.jar=function(e){return new o(e)}},{"tough-cookie":401}],318:[function(e,t,r){(function(e){(function(){"use strict";function r(e){return e.replace(/^\.*/,".").toLowerCase()}function i(e){var t=(e=e.trim().toLowerCase()).split(":",2);return{hostname:r(t[0]),port:t[1],hasPort:e.indexOf(":")>-1}}t.exports=function(t){var a=e.env.NO_PROXY||e.env.no_proxy||"";return"*"===a||""!==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)}).call(this,e("_process"))},{_process:296}],319:[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.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:180,fs:127,"har-validator":209,querystring:312}],320:[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:142}],321:[function(e,t,r){(function(t,i){(function(){"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)}).call(this,e("_process"),e("timers").setImmediate)},{_process:296,crypto:142,"json-stringify-safe":260,"safe-buffer":329,timers:400}],322:[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){var t=this;e&&!t.request.hasHeader("transfer-encoding")&&t.request.setHeader("transfer-encoding","chunked");var r=t.request.getHeader("content-type");r&&-1!==r.indexOf("multipart")?-1!==r.indexOf("boundary")?t.boundary=r.replace(/.*boundary=([^\s;]+).*/,"$1"):t.request.setHeader("content-type",r+"; boundary="+t.boundary):t.request.setHeader("content-type","multipart/related; boundary="+t.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,r=t.isChunked(e),i=e.data||e;t.setHeaders(r),t.chunked=r,t.body=t.build(i,r)},r.Multipart=s},{"combined-stream":135,isstream:256,"safe-buffer":329,"uuid/v4":422}],323:[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){var t=this;t.params=e;var r,o,s=t.request.uri||{},c=t.request.method||"",u=n(t.request.headers),p=t.request.body||"",l=t.request.qsLib||a,f=u.get("content-type")||"",h="application/x-www-form-urlencoded",d=e.transport_method||"header";f.slice(0,h.length)===h&&(f=h,r=p),s.query&&(o=s.query),"body"!==d||"POST"===c&&f===h||t.request.emit("error",new Error("oauth: transport_method of body requires POST and content-type "+h)),r||"boolean"!=typeof e.body_hash||(e.body_hash=t.buildBodyHash(e,t.request.body.toString()));var m=t.buildParams(e,s,c,o,r,l);switch(d){case"header":t.request.setHeader("Authorization","OAuth "+t.concatParams(m,",",'"'));break;case"query":var g=t.request.uri.href+=(o?"&":"?")+t.concatParams(m,"&");t.request.uri=i.parse(g),t.request.path=t.request.uri.path;break;case"body":t.request.body=(r?r+"&":"")+t.concatParams(m,"&");break;default:t.request.emit("error",new Error("oauth: transport_method invalid"))}},r.OAuth=p},{caseless:133,crypto:142,"oauth-sign":270,qs:306,"safe-buffer":329,url:414,"uuid/v4":422}],324:[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:306,querystring:312}],325:[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){var t=this;void 0!==e.maxRedirects&&(t.maxRedirects=e.maxRedirects),"function"==typeof e.followRedirect&&(t.allowRedirect=e.followRedirect),void 0!==e.followRedirect&&(t.followRedirects=!!e.followRedirect),void 0!==e.followAllRedirects&&(t.followAllRedirects=e.followAllRedirects),(t.followRedirects||t.followAllRedirects)&&(t.redirects=t.redirects||[]),void 0!==e.removeRefererHeader&&(t.removeRefererHeader=e.removeRefererHeader),void 0!==e.followOriginalHttpMethod&&(t.followOriginalHttpMethod=e.followOriginalHttpMethod)},n.prototype.redirectTo=function(e){var t=this,r=t.request,i=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var a=e.caseless.get("location");if(r.debug("redirect",a),t.followAllRedirects)i=a;else if(t.followRedirects)switch(r.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:i=a}}else if(401===e.statusCode){var n=r._auth.onResponse(e);n&&(r.setHeader("authorization",n),i=r.uri)}return i},n.prototype.onResponse=function(e){var t=this,r=t.request,n=t.redirectTo(e);if(!n||!t.allowRedirect.call(r,e))return!1;if(r.debug("redirect to",n),e.resume&&e.resume(),t.redirectsFollowed>=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,a.test(n)||(n=i.resolve(r.uri.href,n));var o=r.uri;return r.uri=i.parse(n),r.uri.protocol!==o.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:n}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",o.href),r.emit("redirect"),r.init(),!0},r.Redirect=n},{url:414}],326:[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,t=e.request;return void 0!==e.tunnelOverride?e.tunnelOverride:"https:"===t.uri.protocol},s.prototype.setup=function(e){var t=this,r=t.request;if(e=e||{},"string"==typeof r.proxy&&(r.proxy=i.parse(r.proxy)),!r.proxy||!r.tunnel)return!1;e.proxyHeaderWhiteList&&(t.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(t.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var n,s,c,u=t.proxyHeaderExclusiveList.concat(o),p=t.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}),{})}(r.headers,p);l.host=(n=r.uri,s=n.port,c=n.protocol,n.hostname+":"+(s||("https:"===c?"443":"80"))),u.forEach(r.removeHeader,r);var f=function(e){var t=(r=e.uri,i=e.proxy,["https:"===r.protocol?"https":"http","https:"===i.protocol?"Https":"Http"].join("Over"));var r,i;return a[t]}(r),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}}(r,l);return r.agent=f(h),!0},s.defaultProxyHeaderWhiteList=n,s.defaultProxyHeaderExclusiveList=o,r.Tunnel=s},{"tunnel-agent":408,url:414}],327:[function(e,t,r){(function(r){(function(){"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"),x=e("./lib/querystring").Querystring,_=e("./lib/har").Har,j=e("./lib/auth").Auth,S=e("./lib/oauth").OAuth,E=e("./lib/hawk"),A=e("./lib/multipart").Multipart,M=e("./lib/redirect").Redirect,P=e("./lib/tunnel").Tunnel,z=e("performance-now"),F=e("safe-buffer").Buffer,I=y.safeStringify,O=y.isReadStream,B=y.toBase64,q=y.defer,T=y.copy,C=y.version,R=w.jar(),D={};function U(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function L(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:U.call(e.request)}}function N(e){var t=this;e.har&&(t._har=new _(t),e=t._har.options(e)),s.Stream.call(t);var r=Object.keys(N.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);g(t,i),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}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new x(t),t._auth=new j(t),t._oauth=new S(t),t._multipart=new A(t),t._redirect=new M(t),t._tunnel=new P(t),t.init(e)}function H(){N.debug&&console.error("REQUEST %s",o.format.apply(o,arguments))}o.inherits(N,s.Stream),N.debug=r.env.NODE_DEBUG&&/\brequest\b/.test(r.env.NODE_DEBUG),N.prototype.debug=H,N.prototype.init=function(e){var t=this;for(var r in e||(e={}),t.headers=t.headers?T(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))}},N.prototype.readResponseBody=function(e){var t=this;H("reading response's body");var r=[],i=0,a=[];t.on("data",(function(e){F.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=F.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?F.alloc(0):""),t.emit("complete",e,e.body)}))},N.prototype.abort=function(){var e=this;e._aborted=!0,e.req?e.req.abort():e.response&&e.response.destroy(),e.clearTimeout(),e.emit("abort")},N.prototype.pipeDest=function(e){var t=this,r=t.response;if(e.headers&&!e.headersSent){if(r.caseless.has("content-type")){var i=r.caseless.has("content-type");e.setHeader?e.setHeader(i,r.headers[i]):e.headers[i]=r.headers[i]}if(r.caseless.has("content-length")){var a=r.caseless.has("content-length");e.setHeader?e.setHeader(a,r.headers[a]):e.headers[a]=r.headers[a]}}if(e.setHeader&&!e.headersSent){for(var n in r.headers)t.gzip&&"content-encoding"===n||e.setHeader(n,r.headers[n]);e.statusCode=r.statusCode}t.pipefilter&&t.pipefilter(r,e)},N.prototype.qs=function(e,t){var r,i=this;for(var a in r=!t&&i.uri.query?i._qs.parse(i.uri.query):{},e)r[a]=e[a];var o=i._qs.stringify(r);return""===o||(i.uri=n.parse(i.uri.href.split("?")[0]+"?"+o),i.url=i.uri,i.path=i.uri.path,"unix"===i.uri.host&&i.enableUnixSocket()),i},N.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)},N.prototype.multipart=function(e){var t=this;return t._multipart.onRequest(e),t._multipart.chunked||(t.body=t._multipart.body),t},N.prototype.json=function(e){var t=this;return t.hasHeader("accept")||t.setHeader("accept","application/json"),"function"==typeof t.jsonReplacer&&(t._jsonReplacer=t.jsonReplacer),t._json=!0,"boolean"==typeof e?void 0!==t.body&&(/^application\/x-www-form-urlencoded\b/.test(t.getHeader("content-type"))?t.body=t._qs.rfc3986(t.body):t.body=I(t.body,t._jsonReplacer),t.hasHeader("content-type")||t.setHeader("content-type","application/json")):(t.body=I(e,t._jsonReplacer),t.hasHeader("content-type")||t.setHeader("content-type","application/json")),"function"==typeof t.jsonReviver&&(t._jsonReviver=t.jsonReviver),t},N.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},N.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},N.prototype.auth=function(e,t,r,i){return this._auth.onRequest(e,t,r,i),this},N.prototype.aws=function(e,t){var r=this;if(!t)return r._aws=e,r;if(4===e.sign_version||"4"===e.sign_version){var i={host:r.uri.host,path:r.uri.path,method:r.method,headers:r.headers,body:r.body};e.service&&(i.service=e.service);var a=p.sign(i,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});r.setHeader("authorization",a.headers.Authorization),r.setHeader("x-amz-date",a.headers["X-Amz-Date"]),a.headers["X-Amz-Security-Token"]&&r.setHeader("x-amz-security-token",a.headers["X-Amz-Security-Token"])}else{var n=new Date;r.setHeader("date",n.toUTCString());var o={key:e.key,secret:e.secret,verb:r.method.toUpperCase(),date:n,contentType:r.getHeader("content-type")||"",md5:r.getHeader("content-md5")||"",amazonHeaders:u.canonicalizeHeaders(r.headers)},s=r.uri.path;e.bucket&&s?o.resource="/"+e.bucket+s:e.bucket&&!s?o.resource="/"+e.bucket:!e.bucket&&s?o.resource=s:e.bucket||s||(o.resource="/"),o.resource=u.canonicalizeResource(o.resource),r.setHeader("authorization",u.authorization(o))}return r},N.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},N.prototype.hawk=function(e){var t=this;t.setHeader("Authorization",E.header(t.uri,t.method,e))},N.prototype.oauth=function(e){return this._oauth.onRequest(e),this},N.prototype.jar=function(e){var t,r=this;if(0===r._redirect.redirectsFollowed&&(r.originalCookieHeader=r.getHeader("cookie")),e){var i=e.getCookieString?e:R,a=r.uri.href;i&&(t=i.getCookieString(a))}else t=!1,r._disableCookies=!0;return t&&t.length&&(r.originalCookieHeader?r.setHeader("cookie",r.originalCookieHeader+"; "+t):r.setHeader("cookie",t)),r._jar=e,r},N.prototype.pipe=function(e,t){var r=this;if(!r.response)return r.dests.push(e),s.Stream.prototype.pipe.call(r,e,t),e;if(r._destdata)r.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else{if(!r._ended)return s.Stream.prototype.pipe.call(r,e,t),r.pipeDest(e),e;r.emit("error",new Error("You cannot pipe after the response has been ended."))}},N.prototype.write=function(){var e=this;if(!e._aborted)return e._started||e.start(),e.req?e.req.write.apply(e.req,arguments):void 0},N.prototype.end=function(e){var t=this;t._aborted||(e&&t.write(e),t._started||t.start(),t.req&&t.req.end())},N.prototype.pause=function(){var e=this;e.responseContent?e.responseContent.pause.apply(e.responseContent,arguments):e._paused=!0},N.prototype.resume=function(){var e=this;e.responseContent?e.responseContent.resume.apply(e.responseContent,arguments):e._paused=!1},N.prototype.destroy=function(){var e=this;this.clearTimeout(),e._ended?e.response&&e.response.destroy():e.end()},N.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},N.defaultProxyHeaderWhiteList=P.defaultProxyHeaderWhiteList.slice(),N.defaultProxyHeaderExclusiveList=P.defaultProxyHeaderExclusiveList.slice(),N.prototype.toJSON=U,t.exports=N}).call(this)}).call(this,e("_process"))},{"./lib/auth":316,"./lib/cookies":317,"./lib/getProxyFromURI":318,"./lib/har":319,"./lib/hawk":320,"./lib/helpers":321,"./lib/multipart":322,"./lib/oauth":323,"./lib/querystring":324,"./lib/redirect":325,"./lib/tunnel":326,_process:296,"aws-sign2":71,aws4:72,caseless:133,extend:180,"forever-agent":185,"form-data":186,http:380,"http-signature":242,https:247,"is-typedarray":255,isstream:256,"mime-types":267,"performance-now":295,"safe-buffer":329,stream:364,url:414,util:419,zlib:126}],328:[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,x=0|this._c,_=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=_,_=d(x,10),x=k,k=A}var M=this._b+a+_|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+x|0,this._a=M},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:131,"hash-base":212,inherits:249}],329:[function(e,t,r){ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ 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:131}],330:[function(e,t,r){(function(r){(function(){"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)}).call(this,e("_process"))},{_process:296,buffer:131}],331:[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":329}],332:[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":333,"./sha1":334,"./sha224":335,"./sha256":336,"./sha384":337,"./sha512":338}],333:[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":331,inherits:249,"safe-buffer":329}],334:[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":331,inherits:249,"safe-buffer":329}],335:[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":331,"./sha256":336,inherits:249,"safe-buffer":329}],336:[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":331,inherits:249,"safe-buffer":329}],337:[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":331,"./sha512":338,inherits:249,"safe-buffer":329}],338:[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,x=0|this._cl,_=0|this._dl,j=0|this._el,S=0|this._fl,E=0|this._gl,A=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var P=t[M-30],z=t[M-30+1],F=h(P,z),I=d(z,P),O=m(P=t[M-4],z=t[M-4+1]),B=g(z,P),q=t[M-14],T=t[M-14+1],C=t[M-32],R=t[M-32+1],D=I+T|0,U=F+q+b(D,I)|0;U=(U=U+O+b(D=D+B|0,B)|0)+C+b(D=D+R|0,R)|0,t[M]=U,t[M+1]=D}for(var L=0;L<160;L+=2){U=t[L],D=t[L+1];var N=p(r,i,a),H=p(w,k,x),$=l(r,w),K=l(w,r),V=f(s,j),Z=f(j,s),G=o[L],W=o[L+1],Q=u(s,c,v),Y=u(j,S,E),X=A+Z|0,J=y+V+b(X,A)|0;J=(J=(J=J+Q+b(X=X+Y|0,Y)|0)+G+b(X=X+W|0,W)|0)+U+b(X=X+D|0,D)|0;var ee=K+H|0,te=$+N+b(ee,K)|0;y=v,A=E,v=c,E=S,c=s,S=j,s=n+J+b(j=_+X|0,_)|0,n=a,_=x,a=i,x=k,i=r,k=w,r=J+te+b(w=X+ee|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+k|0,this._cl=this._cl+x|0,this._dl=this._dl+_|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,x)|0,this._dh=this._dh+n+b(this._dl,_)|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":331,inherits:249,"safe-buffer":329}],339:[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":330}],340:[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":339,"./errors":343,"./fingerprint":344,"./formats/openssh-cert":347,"./formats/x509":356,"./formats/x509-pem":355,"./identity":357,"./key":359,"./private-key":360,"./signature":361,"./utils":363,"assert-plus":65,crypto:142,"safer-buffer":330,util:419}],341:[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":339,"./key":359,"./private-key":360,"./utils":363,"assert-plus":65,crypto:142,"ecc-jsbn":155,"ecc-jsbn/lib/ec":156,jsbn:257,"safer-buffer":330,tweetnacl:409}],342:[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":361,"assert-plus":65,"safer-buffer":330,stream:364,tweetnacl:409,util:419}],343:[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":65,util:419}],344:[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"):(t=this.algorithm,r=this.hash.toString("base64"),t.toUpperCase()+":"+function(e){return e.replace(/=*$/,"")}(r));default:throw new f(void 0,e)}var t,r},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":339,"./certificate":340,"./errors":343,"./key":359,"./private-key":360,"./utils":363,"assert-plus":65,crypto:142,"safer-buffer":330}],345:[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 x=m.exec(t);i.ok(null!==x),i.strictEqual(x[1],y[0].data.toString())}for(var _=0;_0;)g=v[--w].match(/[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);i.ok(g,"invalid PEM footer"),i.equal(u[2],g[2]);var k,x=u[2].toLowerCase();u[1]&&(i.equal(u[1],g[1],"PEM header and footer mismatch"),k=u[1].trim());v=v.slice(y,w+1);var _,j,S,E={};for(;v=v.slice(1),u=v[0].match(/^([A-Za-z0-9-]+): (.+)$/);)E[u[1].toLowerCase()]=u[2];if(v=v.slice(0,-1).join(""),e=o.from(v,"base64"),E["proc-type"]){var A=E["proc-type"].split(",");if("4"===A[0]&&"ENCRYPTED"===A[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");A=E["dek-info"].split(","),i.ok(2===A.length),_=A[0].toLowerCase(),S=o.from(A[1],"hex"),j=s.opensslKeyDeriv(_,S,t.passphrase,1).key}}if(k&&"encrypted"===k.toLowerCase()){var M,P=new a.BerReader(e);P.readSequence(),P.readSequence(),M=P.offset+P.length;var z=P.readOID();if("1.2.840.113549.1.5.13"!==z)throw new Error("Unsupported PEM/PKCS8 encryption scheme: "+z);P.readSequence(),P.readSequence();var F=P.offset+P.length,I=P.readOID();if("1.2.840.113549.1.5.12"!==I)throw new Error("Unsupported PBES2 KDF: "+I);P.readSequence();var O=P.readString(a.Ber.OctetString,!0),B=P.readInt(),q="sha1";if(P.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.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"},g={};Object.keys(m).forEach((function(e){g[m[e]]=e}));var b={"1.2.840.113549.2.7":"sha1","1.2.840.113549.2.9":"sha256","1.2.840.113549.2.11":"sha512"},v={};Object.keys(b).forEach((function(e){v[b[e]]=e}))},{"../algs":339,"../errors":343,"../key":359,"../private-key":360,"../utils":363,"./pkcs1":349,"./pkcs8":350,"./rfc4253":352,"./ssh-private":353,asn1:64,"assert-plus":65,crypto:142,"safer-buffer":330}],349:[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;kI.length&&(T=I.length),B+=F.write(I.slice(q,T),B),F[B++]=10,q=T}return B+=F.write("-----END "+z+"-----\n",B),F.slice(0,B)}};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":339,"../errors":343,"../key":359,"../private-key":360,"../ssh-buffer":362,"../utils":363,"./pem":348,"./rfc4253":352,asn1:64,"assert-plus":65,"bcrypt-pbkdf":75,crypto:142,"safer-buffer":330}],354:[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);for(h=h.slice(0,d-2).replace(/[^a-zA-Z0-9+\/=]/g,"")+h.slice(d-2),f.consumed%3>0&&"="!==h.slice(d-1,d)&&d--;"="===h.slice(d,d+1);)d++;var m=h.slice(d);(m=m.replace(/[\r\n]/g," ").replace(/^\s+/,"")).match(/^[a-zA-Z0-9]/)&&(u.comment=m)}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":359,"../private-key":360,"../utils":363,"./rfc4253":352,"./ssh-private":353,"assert-plus":65,"safer-buffer":330}],355:[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="CERTIFICATE",o=r.toString("base64"),s=o.length+o.length/64+18+16+2*a.length+10,c=n.alloc(s),u=0;u+=c.write("-----BEGIN "+a+"-----\n",u);for(var p=0;po.length&&(l=o.length),u+=c.write(o.slice(p,l),u),c[u++]=10,p=l}return u+=c.write("-----END "+a+"-----\n",u),c.slice(0,u)}};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":339,"../certificate":340,"../identity":357,"../key":359,"../private-key":360,"../signature":361,"../utils":363,"./pem":348,"./x509":356,asn1:64,"assert-plus":65,"safer-buffer":330}],356:[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,m=d;if(r.peek()===l(0)){r.readSequence(l(0));var g=r.readInt();i.ok(g<=3,"only x.509 versions up to v3 supported")}var b={signatures:{}},y=b.signatures.x509={};y.extras={},b.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,k=r.readOID();if(void 0===h[k])throw new Error("unknown signature algorithm "+k);r._offset=w,b.issuer=s.parseAsn1(r),r.readSequence(),b.validFrom=v(r),b.validUntil=v(r),b.subjects=[s.parseAsn1(r)],r.readSequence(),w=r.offset+r.length,b.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(E);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 y(e,t){var r,i;t.getUTCFullYear()>=2050||t.getUTCFullYear()<1950?e.writeString((i="",i+=A((r=t).getUTCFullYear(),4),i+=A(r.getUTCMonth()+1),i+=A(r.getUTCDate()),i+=A(r.getUTCHours()),i+=A(r.getUTCMinutes()),i+=A(r.getUTCSeconds()),i+="Z"),a.Ber.GeneralizedTime):e.writeString(function(e){var t="";return t+=A(e.getUTCFullYear()%100),t+=A(e.getUTCMonth()+1),t+=A(e.getUTCDate()),t+=A(e.getUTCHours()),t+=A(e.getUTCMinutes()),t+=A(e.getUTCSeconds()),t+="Z"}(t),a.Ber.UTCTime)}var w={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)},k={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"},x={};Object.keys(k).forEach((function(e){x[k[e]]=e}));var _=["signature","identity","keyEncryption","encryption","keyAgreement","ca","crl"];function j(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 m: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:m,critical:!0}),c.push({oid:g,critical:!0}),c.push({oid:b,critical:!0})),c.push({oid:d}),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)}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":251,"./algs":339,"./dhe":341,"./ed-compat":342,"./errors":343,"./fingerprint":344,"./formats/auto":345,"./formats/dnssec":346,"./formats/pem":348,"./formats/pkcs1":349,"./formats/pkcs8":350,"./formats/putty":351,"./formats/rfc4253":352,"./formats/ssh":354,"./formats/ssh-private":353,"./private-key":360,"./signature":361,"./utils":363,"assert-plus":65,crypto:142}],360:[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"),n=(s=new c({buffer:u})).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":339,"./errors":343,"./ssh-buffer":362,"./utils":363,asn1:64,"assert-plus":65,crypto:142,"safer-buffer":330}],362:[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":65,"safer-buffer":330}],363:[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),h(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=g(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=g(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),g(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:m,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(;t3)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 d={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}};function m(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 g(e){var t=a.from(e.toByteArray());return t=m(t)}},{"./algs":339,"./key":359,"./private-key":360,asn1:64,"assert-plus":65,crypto:142,"ecc-jsbn/lib/ec":156,jsbn:257,"safer-buffer":330,tweetnacl:409}],364:[function(e,t,r){t.exports=a;var i=e("events").EventEmitter;function a(){i.call(this)}e("inherits")(a,i),a.Readable=e("readable-stream/lib/_stream_readable.js"),a.Writable=e("readable-stream/lib/_stream_writable.js"),a.Duplex=e("readable-stream/lib/_stream_duplex.js"),a.Transform=e("readable-stream/lib/_stream_transform.js"),a.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),a.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),a.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),a.Stream=a,a.prototype.pipe=function(e,t){var r=this;function a(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",a),e.on("drain",n),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",c));var o=!1;function s(){o||(o=!0,e.end())}function c(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(p(),0===i.listenerCount(this,"error"))throw e}function p(){r.removeListener("data",a),e.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",p),r.removeListener("close",p),e.removeListener("close",p)}return r.on("error",u),e.on("error",u),r.on("end",p),r.on("close",p),e.on("close",p),e.emit("pipe",r),e}},{events:178,inherits:249,"readable-stream/lib/_stream_duplex.js":366,"readable-stream/lib/_stream_passthrough.js":367,"readable-stream/lib/_stream_readable.js":368,"readable-stream/lib/_stream_transform.js":369,"readable-stream/lib/_stream_writable.js":370,"readable-stream/lib/internal/streams/end-of-stream.js":374,"readable-stream/lib/internal/streams/pipeline.js":376}],365:[function(e,t,r){arguments[4][109][0].apply(r,arguments)},{dup:109}],366:[function(e,t,r){arguments[4][110][0].apply(r,arguments)},{"./_stream_readable":368,"./_stream_writable":370,_process:296,dup:110,inherits:249}],367:[function(e,t,r){arguments[4][111][0].apply(r,arguments)},{"./_stream_transform":369,dup:111,inherits:249}],368:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{"../errors":365,"./_stream_duplex":366,"./internal/streams/async_iterator":371,"./internal/streams/buffer_list":372,"./internal/streams/destroy":373,"./internal/streams/from":375,"./internal/streams/state":377,"./internal/streams/stream":378,_process:296,buffer:131,dup:112,events:178,inherits:249,"string_decoder/":379,util:80}],369:[function(e,t,r){arguments[4][113][0].apply(r,arguments)},{"../errors":365,"./_stream_duplex":366,dup:113,inherits:249}],370:[function(e,t,r){arguments[4][114][0].apply(r,arguments)},{"../errors":365,"./_stream_duplex":366,"./internal/streams/destroy":373,"./internal/streams/state":377,"./internal/streams/stream":378,_process:296,buffer:131,dup:114,inherits:249,"util-deprecate":416}],371:[function(e,t,r){arguments[4][115][0].apply(r,arguments)},{"./end-of-stream":374,_process:296,dup:115}],372:[function(e,t,r){arguments[4][116][0].apply(r,arguments)},{buffer:131,dup:116,util:80}],373:[function(e,t,r){arguments[4][117][0].apply(r,arguments)},{_process:296,dup:117}],374:[function(e,t,r){arguments[4][118][0].apply(r,arguments)},{"../../../errors":365,dup:118}],375:[function(e,t,r){arguments[4][119][0].apply(r,arguments)},{dup:119}],376:[function(e,t,r){arguments[4][120][0].apply(r,arguments)},{"../../../errors":365,"./end-of-stream":374,dup:120}],377:[function(e,t,r){arguments[4][121][0].apply(r,arguments)},{"../../../errors":365,dup:121}],378:[function(e,t,r){arguments[4][122][0].apply(r,arguments)},{dup:122,events:178}],379:[function(e,t,r){arguments[4][124][0].apply(r,arguments)},{dup:124,"safe-buffer":329}],380:[function(e,t,r){(function(t){(function(){var i=e("./lib/request"),a=e("./lib/response"),n=e("xtend"),o=e("builtin-status-codes"),s=e("url"),c=r;c.request=function(e,r){e="string"==typeof e?s.parse(e):n(e);var a=-1===t.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||a,c=e.hostname||e.host,u=e.port,p=e.path||"/";c&&-1!==c.indexOf(":")&&(c="["+c+"]"),e.url=(c?o+"//"+c:"")+(u?":"+u:"")+p,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new i(e);return r&&l.on("response",r),l},c.get=function(e,t){var r=c.request(e,t);return r.end(),r},c.ClientRequest=i,c.IncomingMessage=a.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=o,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":382,"./lib/response":383,"builtin-status-codes":132,url:414,xtend:427}],381:[function(e,t,r){(function(e){(function(){var t;function i(){if(void 0!==t)return t;if(e.XMLHttpRequest){t=new e.XMLHttpRequest;try{t.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function a(e){var t=i();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function n(e){return"function"==typeof e}r.fetch=n(e.fetch)&&n(e.ReadableStream),r.writableStream=n(e.WritableStream),r.abortController=n(e.AbortController),r.arraybuffer=r.fetch||a("arraybuffer"),r.msstream=!r.fetch&&a("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&a("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!i()&&n(i().overrideMimeType),t=null}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],382:[function(e,t,r){(function(r,i,a){(function(){var n=e("./capability"),o=e("inherits"),s=e("./response"),c=e("readable-stream"),u=s.IncomingMessage,p=s.readyStates;var l=t.exports=function(e){var t,r=this;c.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+a.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var i=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!n.abortController)i=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!n.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return n.fetch&&t?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&e?"arraybuffer":"text"}(t,i),r._fetchTimer=null,r.on("finish",(function(){r._onFinish()}))};o(l,c.Writable),l.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===f.indexOf(r)&&(this._headers[r]={name:e,value:t})},l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},l.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},l.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,a=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(o=new Blob(e._body,{type:(a["content-type"]||{}).value||""}));var s=[];if(Object.keys(a).forEach((function(e){var t=a[e].name,r=a[e].value;Array.isArray(r)?r.forEach((function(e){s.push([t,e])})):s.push([t,r])})),"fetch"===e._mode){var c=null;if(n.abortController){var u=new AbortController;c=u.signal,e._fetchAbortController=u,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=i.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}i.fetch(e._opts.url,{method:e._opts.method,headers:s,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:c}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){i.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)}))}else{var l=e._xhr=new i.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}"responseType"in l&&(l.responseType=e._mode),"withCredentials"in l&&(l.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),s.forEach((function(e){l.setRequestHeader(e[0],e[1])})),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case p.LOADING:case p.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{l.send(o)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}}}},l.prototype._onXHRProgress=function(){var e=this;(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},l.prototype._connect=function(){var e=this;e._destroyed||(e._response=new u(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},l.prototype._write=function(e,t,r){this._body.push(e),r()},l.prototype.abort=l.prototype.destroy=function(){var e=this;e._destroyed=!0,i.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},l.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),c.Writable.prototype.end.call(this,e,t,r)},l.prototype.flushHeaders=function(){},l.prototype.setTimeout=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":381,"./response":383,_process:296,buffer:131,inherits:249,"readable-stream":398}],383:[function(e,t,r){(function(t,i,a){(function(){var n=e("./capability"),o=e("inherits"),s=e("readable-stream"),c=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=r.IncomingMessage=function(e,r,o,c){var u=this;if(s.Readable.call(u),u._mode=o,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===o){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)})),n.writableStream){var p=new WritableStream({write:function(e){return new Promise((function(t,r){u._destroyed?r():u.push(a.from(e))?t():u._resumeFetch=t}))},close:function(){i.clearTimeout(c),u._destroyed||u.push(null)},abort:function(e){u._destroyed||u.emit("error",e)}});try{return void r.body.pipeTo(p).catch((function(e){i.clearTimeout(c),u._destroyed||u.emit("error",e)}))}catch(e){}}var l=r.body.getReader();!function e(){l.read().then((function(t){if(!u._destroyed){if(t.done)return i.clearTimeout(c),void u.push(null);u.push(a.from(t.value)),e()}})).catch((function(e){i.clearTimeout(c),u._destroyed||u.emit("error",e)}))}()}else{if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(t[2])):void 0!==u.headers[r]?u.headers[r]+=", "+t[2]:u.headers[r]=t[2],u.rawHeaders.push(t[1],t[2])}})),u._charset="x-user-defined",!n.overrideMimeType){var f=u.rawHeaders["mime-type"];if(f){var h=f.match(/;\s*charset=([^;])(;|$)/);h&&(u._charset=h[1].toLowerCase())}u._charset||(u._charset="utf-8")}}};o(u,s.Readable),u.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},u.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text":if((r=t.responseText).length>e._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)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":381,_process:296,buffer:131,inherits:249,"readable-stream":398}],384:[function(e,t,r){arguments[4][109][0].apply(r,arguments)},{dup:109}],385:[function(e,t,r){arguments[4][110][0].apply(r,arguments)},{"./_stream_readable":387,"./_stream_writable":389,_process:296,dup:110,inherits:249}],386:[function(e,t,r){arguments[4][111][0].apply(r,arguments)},{"./_stream_transform":388,dup:111,inherits:249}],387:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{"../errors":384,"./_stream_duplex":385,"./internal/streams/async_iterator":390,"./internal/streams/buffer_list":391,"./internal/streams/destroy":392,"./internal/streams/from":394,"./internal/streams/state":396,"./internal/streams/stream":397,_process:296,buffer:131,dup:112,events:178,inherits:249,"string_decoder/":399,util:80}],388:[function(e,t,r){arguments[4][113][0].apply(r,arguments)},{"../errors":384,"./_stream_duplex":385,dup:113,inherits:249}],389:[function(e,t,r){arguments[4][114][0].apply(r,arguments)},{"../errors":384,"./_stream_duplex":385,"./internal/streams/destroy":392,"./internal/streams/state":396,"./internal/streams/stream":397,_process:296,buffer:131,dup:114,inherits:249,"util-deprecate":416}],390:[function(e,t,r){arguments[4][115][0].apply(r,arguments)},{"./end-of-stream":393,_process:296,dup:115}],391:[function(e,t,r){arguments[4][116][0].apply(r,arguments)},{buffer:131,dup:116,util:80}],392:[function(e,t,r){arguments[4][117][0].apply(r,arguments)},{_process:296,dup:117}],393:[function(e,t,r){arguments[4][118][0].apply(r,arguments)},{"../../../errors":384,dup:118}],394:[function(e,t,r){arguments[4][119][0].apply(r,arguments)},{dup:119}],395:[function(e,t,r){arguments[4][120][0].apply(r,arguments)},{"../../../errors":384,"./end-of-stream":393,dup:120}],396:[function(e,t,r){arguments[4][121][0].apply(r,arguments)},{"../../../errors":384,dup:121}],397:[function(e,t,r){arguments[4][122][0].apply(r,arguments)},{dup:122,events:178}],398:[function(e,t,r){arguments[4][123][0].apply(r,arguments)},{"./lib/_stream_duplex.js":385,"./lib/_stream_passthrough.js":386,"./lib/_stream_readable.js":387,"./lib/_stream_transform.js":388,"./lib/_stream_writable.js":389,"./lib/internal/streams/end-of-stream.js":393,"./lib/internal/streams/pipeline.js":395,dup:123}],399:[function(e,t,r){arguments[4][124][0].apply(r,arguments)},{dup:124,"safe-buffer":329}],400:[function(e,t,r){(function(t,i){(function(){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)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":296,timers:400}],401:[function(e,t,r){ /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ "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("./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 x(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 _(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 M(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},{"./memstore":402,"./pathMatch":403,"./permuteDomain":404,"./pubsuffix-psl":405,"./store":406,"./version":407,net:127,punycode:128,url:414,util:419}],402:[function(e,t,r){ /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ "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.removeAllCookies=function(e){return this.idx={},e(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":403,"./permuteDomain":404,"./store":406,util:419}],403:[function(e,t,r){ /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ "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}},{}],404:[function(e,t,r){ /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ "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":405}],405:[function(e,t,r){ /*! * Copyright (c) 2018, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ "use strict";var i=e("psl");r.getPublicSuffix=function(e){return i.get(e)}},{psl:298}],406:[function(e,t,r){ /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ "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.removeAllCookies=function(e){throw new Error("removeAllCookies is not implemented")},i.prototype.getAllCookies=function(e){throw new Error("getAllCookies is not implemented (therefore jar cannot be serialized)")}},{}],407:[function(e,t,r){t.exports="2.5.0"},{}],408:[function(e,t,r){(function(t){(function(){"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?r.requests.push({host:t.host,port:t.port,request:e}):r.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)}).call(this,e("_process"))},{_process:296,assert:66,events:178,http:380,https:247,net:127,"safe-buffer":329,tls:127,util:419}],409:[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,x=o,_=s,j=c,S=u,E=p,A=l,M=f,P=h,z=d,F=m,I=g,O=b,B=v,q=y,T=w,C=0;C<20;C+=2)k^=(a=(O^=(a=(P^=(a=(S^=(a=k+O|0)<<7|a>>>25)+k|0)<<9|a>>>23)+S|0)<<13|a>>>19)+P|0)<<18|a>>>14,E^=(a=(x^=(a=(B^=(a=(z^=(a=E+x|0)<<7|a>>>25)+E|0)<<9|a>>>23)+z|0)<<13|a>>>19)+B|0)<<18|a>>>14,F^=(a=(A^=(a=(_^=(a=(q^=(a=F+A|0)<<7|a>>>25)+F|0)<<9|a>>>23)+q|0)<<13|a>>>19)+_|0)<<18|a>>>14,T^=(a=(I^=(a=(M^=(a=(j^=(a=T+I|0)<<7|a>>>25)+T|0)<<9|a>>>23)+j|0)<<13|a>>>19)+M|0)<<18|a>>>14,k^=(a=(j^=(a=(_^=(a=(x^=(a=k+j|0)<<7|a>>>25)+k|0)<<9|a>>>23)+x|0)<<13|a>>>19)+_|0)<<18|a>>>14,E^=(a=(S^=(a=(M^=(a=(A^=(a=E+S|0)<<7|a>>>25)+E|0)<<9|a>>>23)+A|0)<<13|a>>>19)+M|0)<<18|a>>>14,F^=(a=(z^=(a=(P^=(a=(I^=(a=F+z|0)<<7|a>>>25)+F|0)<<9|a>>>23)+I|0)<<13|a>>>19)+P|0)<<18|a>>>14,T^=(a=(q^=(a=(B^=(a=(O^=(a=T+q|0)<<7|a>>>25)+T|0)<<9|a>>>23)+O|0)<<13|a>>>19)+B|0)<<18|a>>>14;k=k+n|0,x=x+o|0,_=_+s|0,j=j+c|0,S=S+u|0,E=E+p|0,A=A+l|0,M=M+f|0,P=P+h|0,z=z+d|0,F=F+m|0,I=I+g|0,O=O+b|0,B=B+v|0,q=q+y|0,T=T+w|0,e[0]=k>>>0&255,e[1]=k>>>8&255,e[2]=k>>>16&255,e[3]=k>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>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]=M>>>0&255,e[29]=M>>>8&255,e[30]=M>>>16&255,e[31]=M>>>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]=F>>>0&255,e[41]=F>>>8&255,e[42]=F>>>16&255,e[43]=F>>>24&255,e[44]=I>>>0&255,e[45]=I>>>8&255,e[46]=I>>>16&255,e[47]=I>>>24&255,e[48]=O>>>0&255,e[49]=O>>>8&255,e[50]=O>>>16&255,e[51]=O>>>24&255,e[52]=B>>>0&255,e[53]=B>>>8&255,e[54]=B>>>16&255,e[55]=B>>>24&255,e[56]=q>>>0&255,e[57]=q>>>8&255,e[58]=q>>>16&255,e[59]=q>>>24&255,e[60]=T>>>0&255,e[61]=T>>>8&255,e[62]=T>>>16&255,e[63]=T>>>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 M(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(_(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 F(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 I(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 O(e,t){var i,a,n,o=r(),s=r();for(i=0;i<16;i++)s[i]=t[i];for(F(s),F(s),F(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,I(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 O(r,e),O(i,t),b(r,0,i,0)}function q(e){var t=new Uint8Array(32);return O(t,e),1&t[0]}function T(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function C(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function R(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,x=0,_=0,j=0,S=0,E=0,A=0,M=0,P=0,z=0,F=0,I=0,O=0,B=0,q=0,T=r[0],C=r[1],R=r[2],D=r[3],U=r[4],L=r[5],N=r[6],H=r[7],$=r[8],K=r[9],V=r[10],Z=r[11],G=r[12],W=r[13],Q=r[14],Y=r[15];n+=(i=t[0])*T,o+=i*C,s+=i*R,c+=i*D,u+=i*U,p+=i*L,l+=i*N,f+=i*H,h+=i*$,d+=i*K,m+=i*V,g+=i*Z,b+=i*G,v+=i*W,y+=i*Q,w+=i*Y,o+=(i=t[1])*T,s+=i*C,c+=i*R,u+=i*D,p+=i*U,l+=i*L,f+=i*N,h+=i*H,d+=i*$,m+=i*K,g+=i*V,b+=i*Z,v+=i*G,y+=i*W,w+=i*Q,k+=i*Y,s+=(i=t[2])*T,c+=i*C,u+=i*R,p+=i*D,l+=i*U,f+=i*L,h+=i*N,d+=i*H,m+=i*$,g+=i*K,b+=i*V,v+=i*Z,y+=i*G,w+=i*W,k+=i*Q,x+=i*Y,c+=(i=t[3])*T,u+=i*C,p+=i*R,l+=i*D,f+=i*U,h+=i*L,d+=i*N,m+=i*H,g+=i*$,b+=i*K,v+=i*V,y+=i*Z,w+=i*G,k+=i*W,x+=i*Q,_+=i*Y,u+=(i=t[4])*T,p+=i*C,l+=i*R,f+=i*D,h+=i*U,d+=i*L,m+=i*N,g+=i*H,b+=i*$,v+=i*K,y+=i*V,w+=i*Z,k+=i*G,x+=i*W,_+=i*Q,j+=i*Y,p+=(i=t[5])*T,l+=i*C,f+=i*R,h+=i*D,d+=i*U,m+=i*L,g+=i*N,b+=i*H,v+=i*$,y+=i*K,w+=i*V,k+=i*Z,x+=i*G,_+=i*W,j+=i*Q,S+=i*Y,l+=(i=t[6])*T,f+=i*C,h+=i*R,d+=i*D,m+=i*U,g+=i*L,b+=i*N,v+=i*H,y+=i*$,w+=i*K,k+=i*V,x+=i*Z,_+=i*G,j+=i*W,S+=i*Q,E+=i*Y,f+=(i=t[7])*T,h+=i*C,d+=i*R,m+=i*D,g+=i*U,b+=i*L,v+=i*N,y+=i*H,w+=i*$,k+=i*K,x+=i*V,_+=i*Z,j+=i*G,S+=i*W,E+=i*Q,A+=i*Y,h+=(i=t[8])*T,d+=i*C,m+=i*R,g+=i*D,b+=i*U,v+=i*L,y+=i*N,w+=i*H,k+=i*$,x+=i*K,_+=i*V,j+=i*Z,S+=i*G,E+=i*W,A+=i*Q,M+=i*Y,d+=(i=t[9])*T,m+=i*C,g+=i*R,b+=i*D,v+=i*U,y+=i*L,w+=i*N,k+=i*H,x+=i*$,_+=i*K,j+=i*V,S+=i*Z,E+=i*G,A+=i*W,M+=i*Q,P+=i*Y,m+=(i=t[10])*T,g+=i*C,b+=i*R,v+=i*D,y+=i*U,w+=i*L,k+=i*N,x+=i*H,_+=i*$,j+=i*K,S+=i*V,E+=i*Z,A+=i*G,M+=i*W,P+=i*Q,z+=i*Y,g+=(i=t[11])*T,b+=i*C,v+=i*R,y+=i*D,w+=i*U,k+=i*L,x+=i*N,_+=i*H,j+=i*$,S+=i*K,E+=i*V,A+=i*Z,M+=i*G,P+=i*W,z+=i*Q,F+=i*Y,b+=(i=t[12])*T,v+=i*C,y+=i*R,w+=i*D,k+=i*U,x+=i*L,_+=i*N,j+=i*H,S+=i*$,E+=i*K,A+=i*V,M+=i*Z,P+=i*G,z+=i*W,F+=i*Q,I+=i*Y,v+=(i=t[13])*T,y+=i*C,w+=i*R,k+=i*D,x+=i*U,_+=i*L,j+=i*N,S+=i*H,E+=i*$,A+=i*K,M+=i*V,P+=i*Z,z+=i*G,F+=i*W,I+=i*Q,O+=i*Y,y+=(i=t[14])*T,w+=i*C,k+=i*R,x+=i*D,_+=i*U,j+=i*L,S+=i*N,E+=i*H,A+=i*$,M+=i*K,P+=i*V,z+=i*Z,F+=i*G,I+=i*W,O+=i*Q,B+=i*Y,w+=(i=t[15])*T,o+=38*(x+=i*R),s+=38*(_+=i*D),c+=38*(j+=i*U),u+=38*(S+=i*L),p+=38*(E+=i*N),l+=38*(A+=i*H),f+=38*(M+=i*$),h+=38*(P+=i*K),d+=38*(z+=i*V),m+=38*(F+=i*Z),g+=38*(I+=i*G),b+=38*(O+=i*W),v+=38*(B+=i*Q),y+=38*(q+=i*Y),n=(i=(n+=38*(k+=i*C))+(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 U(e,t){D(e,t,t)}function L(e,t){var i,a=r();for(i=0;i<16;i++)a[i]=t[i];for(i=253;i>=0;i--)U(a,a),2!==i&&4!==i&&D(a,a,t);for(i=0;i<16;i++)e[i]=a[i]}function N(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,T(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)I(u,p,a=o[n>>>3]>>>(7&n)&1),I(l,f,a),C(h,u,l),R(u,u,l),C(l,p,f),R(p,p,f),U(f,h),U(d,u),D(u,l,u),D(l,p,h),C(h,u,l),R(u,u,l),U(p,u),R(l,f,d),D(u,l,c),C(u,u,f),D(l,l,u),D(u,f,d),D(f,p,s),U(p,h),I(u,p,a),I(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 L(m,m),D(g,g,m),O(e,g),0}function H(e,t){return N(e,t,n)}function $(e,t){return i(t,32),H(e,t)}function K(e,t,r){var i=new Uint8Array(32);return N(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,x=this.fin?0:2048,_=this.h[0],j=this.h[1],S=this.h[2],E=this.h[3],A=this.h[4],M=this.h[5],P=this.h[6],z=this.h[7],F=this.h[8],I=this.h[9],O=this.r[0],B=this.r[1],q=this.r[2],T=this.r[3],C=this.r[4],R=this.r[5],D=this.r[6],U=this.r[7],L=this.r[8],N=this.r[9];r>=16;)f=l=0,f+=(_+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*O,f+=(j+=8191&(i>>>13|(a=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*N),f+=(S+=8191&(a>>>10|(n=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),f+=(E+=8191&(n>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*U),l=(f+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,f&=8191,f+=(M+=s>>>1&8191)*(5*R),f+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*C),f+=(z+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*T),f+=(F+=8191&(u>>>8|(p=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*q),h=l+=(f+=(I+=p>>>5|x)*(5*B))>>>13,h+=_*B,h+=j*O,h+=S*(5*N),h+=E*(5*L),l=(h+=A*(5*U))>>>13,h&=8191,h+=M*(5*D),h+=P*(5*R),h+=z*(5*C),h+=F*(5*T),l+=(h+=I*(5*q))>>>13,h&=8191,d=l,d+=_*q,d+=j*B,d+=S*O,d+=E*(5*N),l=(d+=A*(5*L))>>>13,d&=8191,d+=M*(5*U),d+=P*(5*D),d+=z*(5*R),d+=F*(5*C),m=l+=(d+=I*(5*T))>>>13,m+=_*T,m+=j*q,m+=S*B,m+=E*O,l=(m+=A*(5*N))>>>13,m&=8191,m+=M*(5*L),m+=P*(5*U),m+=z*(5*D),m+=F*(5*R),g=l+=(m+=I*(5*C))>>>13,g+=_*C,g+=j*T,g+=S*q,g+=E*B,l=(g+=A*O)>>>13,g&=8191,g+=M*(5*N),g+=P*(5*L),g+=z*(5*U),g+=F*(5*D),b=l+=(g+=I*(5*R))>>>13,b+=_*R,b+=j*C,b+=S*T,b+=E*q,l=(b+=A*B)>>>13,b&=8191,b+=M*O,b+=P*(5*N),b+=z*(5*L),b+=F*(5*U),v=l+=(b+=I*(5*D))>>>13,v+=_*D,v+=j*R,v+=S*C,v+=E*T,l=(v+=A*q)>>>13,v&=8191,v+=M*B,v+=P*O,v+=z*(5*N),v+=F*(5*L),y=l+=(v+=I*(5*U))>>>13,y+=_*U,y+=j*D,y+=S*R,y+=E*C,l=(y+=A*T)>>>13,y&=8191,y+=M*q,y+=P*B,y+=z*O,y+=F*(5*N),w=l+=(y+=I*(5*L))>>>13,w+=_*L,w+=j*U,w+=S*D,w+=E*R,l=(w+=A*C)>>>13,w&=8191,w+=M*T,w+=P*q,w+=z*B,w+=F*O,k=l+=(w+=I*(5*N))>>>13,k+=_*N,k+=j*L,k+=S*U,k+=E*D,l=(k+=A*R)>>>13,k&=8191,k+=M*C,k+=P*T,k+=z*q,k+=F*B,_=f=8191&(l=(l=((l+=(k+=I*O)>>>13)<<2)+l|0)+(f&=8191)|0),j=h+=l>>>=13,S=d&=8191,E=m&=8191,A=g&=8191,M=b&=8191,P=v&=8191,z=y&=8191,F=w&=8191,I=k&=8191,t+=16,r-=16;this.h[0]=_,this.h[1]=j,this.h[2]=S,this.h[3]=E,this.h[4]=A,this.h[5]=M,this.h[6]=P,this.h[7]=z,this.h[8]=F,this.h[9]=I},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(x=0;x<16;x++)_=8*x+W,z[x]=r[_+0]<<24|r[_+1]<<16|r[_+2]<<8|r[_+3],F[x]=r[_+4]<<24|r[_+5]<<16|r[_+6]<<8|r[_+7];for(x=0;x<80;x++)if(a=I,n=O,o=B,s=q,c=T,u=C,p=R,D,f=U,h=L,d=N,m=H,g=$,b=K,v=V,Z,E=65535&(S=Z),A=S>>>16,M=65535&(j=D),P=j>>>16,E+=65535&(S=($>>>14|T<<18)^($>>>18|T<<14)^(T>>>9|$<<23)),A+=S>>>16,M+=65535&(j=(T>>>14|$<<18)^(T>>>18|$<<14)^($>>>9|T<<23)),P+=j>>>16,E+=65535&(S=$&K^~$&V),A+=S>>>16,M+=65535&(j=T&C^~T&R),P+=j>>>16,E+=65535&(S=G[2*x+1]),A+=S>>>16,M+=65535&(j=G[2*x]),P+=j>>>16,j=z[x%16],A+=(S=F[x%16])>>>16,M+=65535&j,P+=j>>>16,M+=(A+=(E+=65535&S)>>>16)>>>16,E=65535&(S=k=65535&E|A<<16),A=S>>>16,M=65535&(j=w=65535&M|(P+=M>>>16)<<16),P=j>>>16,E+=65535&(S=(U>>>28|I<<4)^(I>>>2|U<<30)^(I>>>7|U<<25)),A+=S>>>16,M+=65535&(j=(I>>>28|U<<4)^(U>>>2|I<<30)^(U>>>7|I<<25)),P+=j>>>16,A+=(S=U&L^U&N^L&N)>>>16,M+=65535&(j=I&O^I&B^O&B),P+=j>>>16,l=65535&(M+=(A+=(E+=65535&S)>>>16)>>>16)|(P+=M>>>16)<<16,y=65535&E|A<<16,E=65535&(S=m),A=S>>>16,M=65535&(j=s),P=j>>>16,A+=(S=k)>>>16,M+=65535&(j=w),P+=j>>>16,O=a,B=n,q=o,T=s=65535&(M+=(A+=(E+=65535&S)>>>16)>>>16)|(P+=M>>>16)<<16,C=c,R=u,D=p,I=l,L=f,N=h,H=d,$=m=65535&E|A<<16,K=g,V=b,Z=v,U=y,x%16==15)for(_=0;_<16;_++)j=z[_],E=65535&(S=F[_]),A=S>>>16,M=65535&j,P=j>>>16,j=z[(_+9)%16],E+=65535&(S=F[(_+9)%16]),A+=S>>>16,M+=65535&j,P+=j>>>16,w=z[(_+1)%16],E+=65535&(S=((k=F[(_+1)%16])>>>1|w<<31)^(k>>>8|w<<24)^(k>>>7|w<<25)),A+=S>>>16,M+=65535&(j=(w>>>1|k<<31)^(w>>>8|k<<24)^w>>>7),P+=j>>>16,w=z[(_+14)%16],A+=(S=((k=F[(_+14)%16])>>>19|w<<13)^(w>>>29|k<<3)^(k>>>6|w<<26))>>>16,M+=65535&(j=(w>>>19|k<<13)^(k>>>29|w<<3)^w>>>6),P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,z[_]=65535&M|P<<16,F[_]=65535&E|A<<16;E=65535&(S=U),A=S>>>16,M=65535&(j=I),P=j>>>16,j=e[0],A+=(S=t[0])>>>16,M+=65535&j,P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[0]=I=65535&M|P<<16,t[0]=U=65535&E|A<<16,E=65535&(S=L),A=S>>>16,M=65535&(j=O),P=j>>>16,j=e[1],A+=(S=t[1])>>>16,M+=65535&j,P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[1]=O=65535&M|P<<16,t[1]=L=65535&E|A<<16,E=65535&(S=N),A=S>>>16,M=65535&(j=B),P=j>>>16,j=e[2],A+=(S=t[2])>>>16,M+=65535&j,P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[2]=B=65535&M|P<<16,t[2]=N=65535&E|A<<16,E=65535&(S=H),A=S>>>16,M=65535&(j=q),P=j>>>16,j=e[3],A+=(S=t[3])>>>16,M+=65535&j,P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[3]=q=65535&M|P<<16,t[3]=H=65535&E|A<<16,E=65535&(S=$),A=S>>>16,M=65535&(j=T),P=j>>>16,j=e[4],A+=(S=t[4])>>>16,M+=65535&j,P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[4]=T=65535&M|P<<16,t[4]=$=65535&E|A<<16,E=65535&(S=K),A=S>>>16,M=65535&(j=C),P=j>>>16,j=e[5],A+=(S=t[5])>>>16,M+=65535&j,P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[5]=C=65535&M|P<<16,t[5]=K=65535&E|A<<16,E=65535&(S=V),A=S>>>16,M=65535&(j=R),P=j>>>16,j=e[6],A+=(S=t[6])>>>16,M+=65535&j,P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[6]=R=65535&M|P<<16,t[6]=V=65535&E|A<<16,E=65535&(S=Z),A=S>>>16,M=65535&(j=D),P=j>>>16,j=e[7],A+=(S=t[7])>>>16,M+=65535&j,P+=j>>>16,P+=(M+=(A+=(E+=65535&S)>>>16)>>>16)>>>16,e[7]=D=65535&M|P<<16,t[7]=Z=65535&E|A<<16,W+=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,W(a,n,t,r),r%=128,i=0;i=0;--a)X(e,t,i=r[a/8|0]>>(7&a)&1),Y(t,e),Y(e,e),X(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--)U(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),U(a,e[0]),D(a,a,c),B(a,n)&&D(e[0],e[0],h),U(a,e[0]),D(a,a,c),B(a,n)?-1:(q(e[0])===t[31]>>7&&R(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(le),t=new Uint8Array(fe);return re(e,t),{publicKey:e,secretKey:t}},t.sign.keyPair.fromSecretKey=function(e){if(de(e),e.length!==fe)throw new Error("bad secret key size");for(var t=new Uint8Array(le),r=0;r-1;)if(r=this.buffer.slice(0,t),this.buffer=this.buffer.slice(t+a.END_LENGTH),r.length>0)try{void 0!==(r=JSON.parse(r)).event?(this.emit(r.event,r),this.emit("event",r)):void 0!==r.delete?this.emit("delete",r):void 0!==r.friends||void 0!==r.friends_str?this.emit("friends",r):this.emit("data",r)}catch(e){e.source=r,this.emit("error",e)}else this.emit("ping")}},{events:178}],411:[function(e,t,r){"use strict";var i=e("url"),a=e("./parser"),n=e("request"),o=e("deep-extend"),s=e("../package.json").version;function c(e){if(!(this instanceof c))return new c(e);this.VERSION=s,this.options=o({consumer_key:null,consumer_secret:null,access_token_key:null,access_token_secret:null,bearer_token:null,rest_base:"https://api.twitter.com/1.1",stream_base:"https://stream.twitter.com/1.1",user_stream_base:"https://userstream.twitter.com/1.1",site_stream_base:"https://sitestream.twitter.com/1.1",media_base:"https://upload.twitter.com/1.1",request_options:{headers:{Accept:"*/*",Connection:"close","User-Agent":"node-twitter/"+s}}},e);var t={oauth:{consumer_key:this.options.consumer_key,consumer_secret:this.options.consumer_secret,token:this.options.access_token_key,token_secret:this.options.access_token_secret}};this.options.bearer_token&&(t={headers:{Authorization:"Bearer "+this.options.bearer_token}}),this.request=n.defaults(o(this.options.request_options,t)),this.allow_promise="function"==typeof Promise}c.prototype.__buildEndpoint=function(e,t){var r={rest:this.options.rest_base,stream:this.options.stream_base,user_stream:this.options.user_stream_base,site_stream:this.options.site_stream_base,media:this.options.media_base},a=r.hasOwnProperty(t)?r[t]:r.rest,n=null!==i.parse(e).protocol;return n?a=e:(e.match(/^(\/)?media/)&&(a=r.media),a+="/"===e.charAt(0)?e:"/"+e),a=a.replace(/\/$/,""),n||(a+="json"!==e.split(".").pop()?".json":""),a},c.prototype.__request=function(e,t,r,i){var a="rest",n=!1;"function"==typeof r?(i=r,r={}):void 0===i&&this.allow_promise&&(n=!0),void 0!==r.base&&(a=r.base,delete r.base);var o={method:e.toLowerCase(),url:this.__buildEndpoint(t,a)};if("get"===e&&(o.qs=r),"post"===e){var s="form";void 0!==r.media&&(s="formData"),o[s]=r}if(n){var c=this;return new Promise((function(e,t){c.request(o,(function(r,i,a){if(r)return t(r);try{a=""===a?{}:JSON.parse(a)}catch(e){return t(new Error("JSON parseError with HTTP Status: "+i.statusCode+" "+i.statusMessage))}return void 0!==a.errors?t(a.errors):i.statusCode<200||i.statusCode>299?t(new Error("HTTP Error: "+i.statusCode+" "+i.statusMessage)):void e(a)}))}))}this.request(o,(function(e,t,r){if(e)return i(e,r,t);try{r=""===r?{}:JSON.parse(r)}catch(e){return i(new Error("JSON parseError with HTTP Status: "+t.statusCode+" "+t.statusMessage),r,t)}return void 0!==r.errors?i(r.errors,r,t):t.statusCode<200||t.statusCode>299?i(new Error("HTTP Error: "+t.statusCode+" "+t.statusMessage),r,t):void i(null,r,t)}))},c.prototype.get=function(e,t,r){return this.__request("get",e,t,r)},c.prototype.post=function(e,t,r){return this.__request("post",e,t,r)},c.prototype.stream=function(e,t,r){"function"==typeof t&&(r=t,t={});var i="stream";"user"!==e&&"site"!==e||(i=e+"_"+i);var n=this.__buildEndpoint(e,i),o=this.request({url:n,qs:t}),s=new a;if(s.destroy=function(){"function"==typeof o.abort?o.abort():o.socket.destroy()},o.on("response",(function(e){200!==e.statusCode?s.emit("error",new Error("Status Code: "+e.statusCode)):s.emit("response",e),e.on("data",(function(e){s.receive(e)})),e.on("error",(function(e){s.emit("error",e)})),e.on("end",(function(){s.emit("end",e)}))})),o.on("error",(function(e){s.emit("error",e)})),o.end(),"function"!=typeof r)return s;r(s)},t.exports=c},{"../package.json":412,"./parser":410,"deep-extend":143,request:315,url:414}],412:[function(e,t,r){t.exports={name:"twitter",version:"1.7.1",description:"Twitter API client library for node.js",license:"MIT",keywords:["twitter","streaming","oauth"],homepage:"https://github.com/desmondmorris/node-twitter",author:"Desmond Morris ",repository:{type:"git",url:"https://github.com/desmondmorris/node-twitter"},scripts:{test:"npm run lint && mocha",lint:"./node_modules/.bin/eslint test/*.js lib/*.js"},dependencies:{"deep-extend":"^0.5.0",request:"^2.72.0"},devDependencies:{eslint:"^3.12.0",mocha:"^3.2.0",nock:"^9.0.2"},main:"./lib/twitter"}},{}],413:[function(e,t,r){ /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ !function(e,i){i("object"==typeof r&&void 0!==t?r:e.URI=e.URI||{})}(this,(function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),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"},m=Math.floor,g=String.fromCharCode;function b(e){throw new RangeError(d[e])}function v(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(h,".")).split("."),t).join(".");return i+a}function y(e){for(var t=[],r=0,i=e.length;r=55296&&a<=56319&&r>1,e+=m(e/t);e>455;i+=p)e=m(e/35);return m(i+36*e/(e+38))},x=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&&b("not-basic"),r.push(e.charCodeAt(c));for(var l=s>0?s+1:0;l=i&&b("invalid-input");var g=(t=e.charCodeAt(l++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:p;(g>=p||g>m((u-a)/h))&&b("overflow"),a+=g*h;var v=d<=o?1:d>=o+26?26:d-o;if(gm(u/y)&&b("overflow"),h*=y}var w=r.length+1;o=k(a-f,w,0==f),m(a/w)>u-n&&b("overflow"),n+=m(a/w),a%=w,r.splice(a++,0,n)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,i=128,a=0,n=72,o=!0,s=!1,c=void 0;try{for(var l,f=e[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var h=l.value;h<128&&t.push(g(h))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var d=t.length,v=d;for(d&&t.push("-");v=i&&Mm((u-a)/P)&&b("overflow"),a+=(x-i)*P,i=x;var z=!0,F=!1,I=void 0;try{for(var O,B=e[Symbol.iterator]();!(z=(O=B.next()).done);z=!0){var q=O.value;if(qu&&b("overflow"),q==i){for(var T=a,C=p;;C+=p){var R=C<=n?1:C>=n+26?26:C-n;if(T>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 M(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 P(e,t){function r(e){var r=M(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,A).replace(t.PCT_ENCODED,a)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,A).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,A).replace(t.PCT_ENCODED,a)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,A).replace(t.PCT_ENCODED,a)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,A).replace(t.PCT_ENCODED,a)),e}function z(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],i=c(r,2)[1];return i?i.split(".").map(z).join("."):e}function I(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(z):[],f=u.split(":").map(z),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 O=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,B=void 0==="".match(/(){0}/)[1];function q(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(O);if(a){B?(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=I(F(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=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||n&&n.unicodeSupport)P(r,i);else{if(r.host&&(t.domainHost||n&&n.domainHost))try{r.host=j(r.host.replace(i.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}P(r,o)}n&&n.parse&&n.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function T(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(I(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var C=/^\.\.?\//,R=/^\/\.(\/|$)/,D=/^\/\.\.(\/|$)/,U=/^\/?(?:.|\n)*?(?=\/|$)/;function L(e){for(var t=[];e.length;)if(e.match(C))e=e.replace(C,"");else if(e.match(R))e=e.replace(R,"/");else if(e.match(D))e=e.replace(D,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(U);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 N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,i=[],a=E[(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?S(e.host):j(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}P(e,r),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var n=T(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=L(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 H(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],a={};return i||(e=q(N(e,r),r),t=q(N(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=L(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=L(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=L(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=L(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function $(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var K={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){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},V={scheme:"https",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize};function Z(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var G={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=Z(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(Z(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),i=c(r,2),a=i[0],n=i[1];e.path=a&&"/"!==a?a:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}},W={scheme:"wss",domainHost:G.domainHost,parse:G.parse,serialize:G.serialize},Q={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",X="[0-9A-Fa-f]",J=r(r("%[EFef][0-9A-Fa-f]%"+X+X+"%"+X+X)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+X+X)+"|"+r("%"+X+X)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(Y,"g"),re=new RegExp(J,"g"),ie=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),ae=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ne=ae;function oe(e){var t=M(e);return t.match(te)?t:e}var se={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?O+="x":O+=I[B];if(!O.match(h)){var T=z.slice(0,A),C=z.slice(A+1),R=I.match(d);R&&(T.push(R[1]),C.unshift(R[2])),C.length&&(y="/"+C.join(".")+y),this.hostname=T.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:"",U=this.hostname||"";this.host=U+D,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[x])for(A=0,F=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(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=_.slice(-1)[0],E=(r.host||e.host||_.length>1)&&("."===S||".."===S)||""===S,A=0,M=_.length;M>=0;M--)"."===(S=_[M])?_.splice(M,1):".."===S?(_.splice(M,1),A++):A&&(_.splice(M,1),A--);if(!k&&!x)for(;A--;A)_.unshift("..");!k||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),E&&"/"!==_.join("/").substr(-1)&&_.push("");var P,z=""===_[0]||_[0]&&"/"===_[0].charAt(0);j&&(r.hostname=r.host=z?"":_.length?_.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&&_.length)&&!z&&_.unshift(""),_.length?r.pathname=_.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":415,punycode:128,querystring:312}],415:[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}}},{}],416:[function(e,t,r){(function(e){(function(){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)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],417:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],418:[function(e,t,r){"use strict";var i=e("is-arguments"),a=e("is-generator-function"),n=e("which-typed-array"),o=e("is-typed-array");function s(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,p=s(Object.prototype.toString),l=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(c)var d=s(BigInt.prototype.valueOf);if(u)var m=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function b(e){return"[object Map]"===p(e)}function v(e){return"[object Set]"===p(e)}function y(e){return"[object WeakMap]"===p(e)}function w(e){return"[object WeakSet]"===p(e)}function k(e){return"[object ArrayBuffer]"===p(e)}function x(e){return"undefined"!=typeof ArrayBuffer&&(k.working?k(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===p(e)}function j(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}function S(e){return"[object SharedArrayBuffer]"===p(e)}function E(e){return"undefined"!=typeof SharedArrayBuffer&&(S.working?S(e):e instanceof SharedArrayBuffer)}function A(e){return g(e,l)}function M(e){return g(e,f)}function P(e){return g(e,h)}function z(e){return c&&g(e,d)}function F(e){return u&&g(e,m)}r.isArgumentsObject=i,r.isGeneratorFunction=a,r.isTypedArray=o,r.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},r.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||j(e)},r.isUint8Array=function(e){return"Uint8Array"===n(e)},r.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===n(e)},r.isUint16Array=function(e){return"Uint16Array"===n(e)},r.isUint32Array=function(e){return"Uint32Array"===n(e)},r.isInt8Array=function(e){return"Int8Array"===n(e)},r.isInt16Array=function(e){return"Int16Array"===n(e)},r.isInt32Array=function(e){return"Int32Array"===n(e)},r.isFloat32Array=function(e){return"Float32Array"===n(e)},r.isFloat64Array=function(e){return"Float64Array"===n(e)},r.isBigInt64Array=function(e){return"BigInt64Array"===n(e)},r.isBigUint64Array=function(e){return"BigUint64Array"===n(e)},b.working="undefined"!=typeof Map&&b(new Map),r.isMap=function(e){return"undefined"!=typeof Map&&(b.working?b(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),r.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),r.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),r.isWeakSet=function(e){return w(e)},k.working="undefined"!=typeof ArrayBuffer&&k(new ArrayBuffer),r.isArrayBuffer=x,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),r.isDataView=j,S.working="undefined"!=typeof SharedArrayBuffer&&S(new SharedArrayBuffer),r.isSharedArrayBuffer=E,r.isAsyncFunction=function(e){return"[object AsyncFunction]"===p(e)},r.isMapIterator=function(e){return"[object Map Iterator]"===p(e)},r.isSetIterator=function(e){return"[object Set Iterator]"===p(e)},r.isGeneratorObject=function(e){return"[object Generator]"===p(e)},r.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===p(e)},r.isNumberObject=A,r.isStringObject=M,r.isBooleanObject=P,r.isBigIntObject=z,r.isSymbolObject=F,r.isBoxedPrimitive=function(e){return A(e)||M(e)||P(e)||z(e)||F(e)},r.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(x(e)||E(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(r,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},{"is-arguments":250,"is-generator-function":252,"is-typed-array":254,"which-typed-array":426}],419:[function(e,t,r){(function(t){(function(){var i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},i=0;i=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}})),s=i[r];r=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),m(t)?i.showHidden=t:t&&r._extend(i,t),y(i.showHidden)&&(i.showHidden=!1),y(i.depth)&&(i.depth=2),y(i.colors)&&(i.colors=!1),y(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=u),l(i,e,i.depth)}function u(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function p(e,t){return e}function l(e,t,i){if(e.customInspect&&t&&j(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var a=t.inspect(i,e);return v(a)||(a=l(e,a,i)),a}var n=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(b(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(g(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 f(t);if(0===o.length){if(j(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(x(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return f(t)}var u,p="",k=!1,S=["{","}"];(d(t)&&(k=!0,S=["[","]"]),j(t))&&(p=" [Function"+(t.name?": "+t.name:"")+"]");return w(t)&&(p=" "+RegExp.prototype.toString.call(t)),x(t)&&(p=" "+Date.prototype.toUTCString.call(t)),_(t)&&(p=" "+f(t)),0!==o.length||k&&0!=t.length?i<0?w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=k?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,p,S)):S[0]+p+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(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")),P(i,a)||(o="["+a+"]"),s||(e.seen.indexOf(c.value)<0?(s=g(r)?l(e,c.value,null):l(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")),y(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 d(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function y(e){return void 0===e}function w(e){return k(e)&&"[object RegExp]"===S(e)}function k(e){return"object"==typeof e&&null!==e}function x(e){return k(e)&&"[object Date]"===S(e)}function _(e){return k(e)&&("[object Error]"===S(e)||e instanceof Error)}function j(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(e=e.toUpperCase(),!n[e])if(o.test(e)){var i=t.pid;n[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,i,t)}}else n[e]=function(){};return n[e]},r.inspect=c,c.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]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.types=e("./support/types"),r.isArray=d,r.isBoolean=m,r.isNull=g,r.isNullOrUndefined=function(e){return null==e},r.isNumber=b,r.isString=v,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=y,r.isRegExp=w,r.types.isRegExp=w,r.isObject=k,r.isDate=x,r.types.isDate=x,r.isError=_,r.types.isNativeError=_,r.isFunction=j,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 A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log("%s - %s",M(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};var z="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function F(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}r.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(z&&e[z]){var t;if("function"!=typeof(t=e[z]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,z,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,i=new Promise((function(e,i){t=e,r=i})),a=[],n=0;n>>((3&t)<<3)&255;return n}}},{}],422:[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":420,"./lib/rng":421}],423:[function(e,t,r){!function(e){"use strict";e.exports.is_uri=r,e.exports.is_http_uri=i,e.exports.is_https_uri=a,e.exports.is_web_uri=n,e.exports.isUri=r,e.exports.isHttpUri=i,e.exports.isHttpsUri=a,e.exports.isWebUri=n;var t=function(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)};function r(e){if(e&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)&&!/%[^0-9a-f]/i.test(e)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)){var r,i,a,n,o,s="",c="";if(s=(r=t(e))[1],i=r[2],a=r[3],n=r[4],o=r[5],s&&s.length&&a.length>=0){if(i&&i.length){if(0!==a.length&&!/^\//.test(a))return}else if(/^\/\//.test(a))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(s.toLowerCase()))return c+=s+":",i&&i.length&&(c+="//"+i),c+=a,n&&n.length&&(c+="?"+n),o&&o.length&&(c+="#"+o),c}}}function i(e,i){if(r(e)){var a,n,o,s,c="",u="",p="",l="";if(c=(a=t(e))[1],u=a[2],n=a[3],o=a[4],s=a[5],c){if(i){if("https"!=c.toLowerCase())return}else if("http"!=c.toLowerCase())return;if(u)return/:(\d+)$/.test(u)&&(p=u.match(/:(\d+)$/)[0],u=u.replace(/:\d+$/,"")),l+=c+":",l+="//"+u,p&&(l+=p),l+=n,o&&o.length&&(l+="?"+o),s&&s.length&&(l+="#"+s),l}}}function a(e){return i(e,!0)}function n(e){return i(e)||a(e)}}(t)},{}],424:[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":65,"core-util-is":136,extsprintf:425,util:419}],425:[function(e,t,r){(function(t){(function(){var i=e("assert"),a=e("util");function n(e){var t,r,n,s,p,l,f,h,d,m,g,b=["([^%]*)","%","(['\\-+ #0]*?)","([1-9]\\d*)?","(\\.([1-9]\\d*))?","[lhjztL]*?","([diouxXfFeEgGaAcCsSp%jr])"].join(""),v=new RegExp(b),y=Array.prototype.slice.call(arguments,1),w=e,k="",x=1,_=0;for(i.equal("string",typeof w,"first argument must be a format string");null!==(d=v.exec(w));)if(k+=d[1],w=w.substring(d[0].length),g=d[0].substring(d[1].length),m=_+d[1].length+1,_+=d[0].length,t=d[2]||"",r=d[3]||0,n=d[4]||"",p=!1,f=!1,l=" ","%"!=(s=d[6])){if(0===y.length)throw o(e,m,g,"has no matching argument (too few arguments passed)");if(h=y.shift(),x++,t.match(/[\' #]/))throw o(e,m,g,"uses unsupported flags");if(n.length>0)throw o(e,m,g,"uses non-zero precision (not supported)");switch(t.match(/-/)&&(p=!0),t.match(/0/)&&(l="0"),t.match(/\+/)&&(f=!0),s){case"s":if(null==h)throw o(e,m,g,"attempted to print undefined or null as a string (argument "+x+" to sprintf)");k+=c(l,r,p,h.toString());break;case"d":h=Math.floor(h);case"f":k+=(f=f&&h>0?"+":"")+c(l,r,p,h.toString());break;case"x":k+=c(l,r,p,h.toString(16));break;case"j":0===r&&(r=10),k+=a.inspect(h,!1,r);break;case"r":k+=u(h);break;default:throw o(e,m,g,"is not supported")}}else k+="%";return k+=w}function o(e,t,r,a){return i.equal(typeof e,"string"),i.equal(typeof r,"string"),i.equal(typeof t,"number"),i.equal(typeof a,"string"),new Error('format string "'+e+'": conversion specifier "'+r+'" at character '+t+" "+a)}function s(e){var t=Array.prototype.slice.call(arguments,1);return e.write(n.apply(this,t))}function c(e,t,r,i){for(var a=i;a.length ./dist/doip.min.js","prettier:check":"./node_modules/prettier/bin-prettier.js --check .","prettier:write":"./node_modules/prettier/bin-prettier.js --write .","license:check":"./node_modules/license-check-and-add/dist/src/cli.js check","license:add":"./node_modules/license-check-and-add/dist/src/cli.js add","license:remove":"./node_modules/license-check-and-add/dist/src/cli.js remove",docs:"docsify serve ./docs",test:"./node_modules/mocha/bin/mocha"},repository:{type:"git",url:"https://codeberg.org/keyoxide/doipjs"},homepage:"https://js.doip.rocks",keywords:["pgp","gpg","openpgp","encryption","decentralized","identity"],author:"Yarmo Mackenbach (https://yarmo.eu)",license:"Apache-2.0",browserify:{transform:["browserify-shim"]},"browserify-shim":{openpgp:"global:openpgp"}}},{}],429:[function(e,t,r){(function(t){(function(){e("path");const i=e("merge-options"),a=e("valid-url"),n="undefined"!=typeof window?window.openpgp:void 0!==t?t.openpgp:null,o=e("./serviceproviders"),s=e("./keys"),c=e("./utils");Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))));const u=(e,t,r,i,a)=>{let n;if(e.isVerified||!t)return e;if(Array.isArray(t))return t.forEach(((t,n)=>{e=u(e,t,r,i,a)})),e;if(0==r.length){switch(a){default:case"contains":n=new RegExp(i,"gi"),e.isVerified=n.test(t.replace(/\r?\n|\r|\\/g,""));break;case"equals":e.isVerified=t.replace(/\r?\n|\r|\\/g,"").toLowerCase()==i.toLowerCase();break;case"oneOf":n=new RegExp(i,"gi"),e.isVerified=n.test(t.join("|"))}return e}try{r[0]}catch(t){return e.errors.push("err_data_structure_incorrect"),e}return e=u(e,t[r[0]],r.slice(1),i,a)},p=(e,t)=>{let r={isVerified:!1,errors:[]};switch(t.proof.format){case"json":r=u(r,e,t.claim.path,c.generateClaim(t.claim.fingerprint,t.claim.format),t.claim.relation);break;case"text":re=new RegExp(c.generateClaim(t.claim.fingerprint,t.claim.format),"gi"),r.isVerified=re.test(e.replace(/\r?\n|\r/,""))}return r},l=async(e,t,r)=>{if(e instanceof n.key.Key){const t=await s.getFingerprint(e),i=(await s.getUserData(e)).map((async(e,i)=>new Promise((async(i,a)=>{try{i(await l(e.notations,t,r))}catch(e){a(e)}}))));return Promise.allSettled(i).then((e=>e.map(((e,t)=>"fulfilled"==e.status?e.value:e.reason))))}if(e instanceof Array){const i=e.map((async(e,i)=>new Promise((async(i,a)=>{try{i(await l(e,t,r))}catch(e){a(e)}}))));return Promise.allSettled(i).then((e=>e.map(((e,t)=>"fulfilled"==e.status?e.value:e.reason))))}const c=new Promise((async(n,s)=>{let c={isVerified:!1,errors:[],serviceproviderData:void 0};const u=e.replace(/^\s+|\s+$/g,"");t||(t=null);if(r=i({returnMatchesOnly:!1,proxyPolicy:"adaptive",doipProxyHostname:"proxy.keyoxide.org",twitterBearerToken:null,nitterInstance:null},r||{}),!a.isUri(u))return c.errors.push("invalid_uri"),void s(c);const l=o.match(u,r);if("returnMatchesOnly"in r&&r.returnMatchesOnly)return void n(l);let f,h,d,m,g=!1,b=0;for(;!g&&b{const t={isVerified:!1,errors:["verification_timed_out"],serviceproviderData:void 0};setTimeout((()=>{e(t)}),3e3)}));return await Promise.race([c,u])};r.verify=l}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./keys":431,"./serviceproviders":432,"./utils":449,"merge-options":263,path:288,"valid-url":423}],430:[function(e,t,r){const i=e("./claims"),a=e("./keys"),n=e("./signatures"),o=e("./serviceproviders"),s=e("./utils");r.claims=i,r.keys=a,r.signatures=n,r.serviceproviders=o,r.utils=s},{"./claims":429,"./keys":431,"./serviceproviders":432,"./signatures":448,"./utils":449}],431:[function(e,t,r){(function(t){(function(){e("path");const i=e("bent")("GET"),a=e("valid-url"),n="undefined"!=typeof window?window.openpgp:void 0!==t?t.openpgp:null,o=(e("merge-options"),(e,t)=>new Promise((async(r,i)=>{t=t?"https://"+t:"https://keys.openpgp.org";const a=new n.HKP(t),o={query:e};let s=await a.lookup(o).catch((e=>{i("Key does not exist or could not be fetched")}));s=await n.key.readArmored(s).then((e=>e.keys[0])).catch((e=>null)),s?r(s):i("Key does not exist or could not be fetched")}))),s=e=>new Promise((async(t,r)=>{const i=new n.WKD,a={email:e},o=await i.lookup(a).then((e=>e.keys[0])).catch((e=>null));o?t(o):r("Key does not exist or could not be fetched")})),c=(e,t)=>new Promise((async(e,t)=>{try{await i(opts.keyLink).then((e=>{if(200===e.status)return e})).then((e=>e.text()))}catch(e){t("Error fetching Keybase key: "+e.message)}const r=await n.key.readArmored(rawKeyContent).then((e=>e.keys[0])).catch((e=>null));r?e(r):t("Key does not exist or could not be fetched")})),u=e=>new Promise((async(t,r)=>{e||r("Invalid public key");const i=await e.primaryKey.getFingerprint(),a=await e.getPrimaryUser(),o=e.users;let s=[];o.forEach(((e,t)=>{if(s[t]={userData:{id:e.userId?e.userId.userid:null,name:e.userId?e.userId.name:null,email:e.userId?e.userId.email:null,comment:e.userId?e.userId.comment:null,isPrimary:a.index===t}},"selfCertifications"in e&&e.selfCertifications.length>0){const r=e.selfCertifications[0].rawNotations;s[t].notations=r.map((({name:e,value:t,humanReadable:r})=>{if(r&&"proof@metacode.biz"===e)return n.util.decode_utf8(t)}))}else s[t].notations=[]})),t({fingerprint:i,users:s,primaryUserIndex:a.index})}));r.fetch={uri:e=>new Promise((async(t,r)=>{a.isUri(e)||r("Invalid URI");const i=e.match(/([a-zA-Z0-9]*):([a-zA-Z0-9@._=+\-]*)(?:\:([a-zA-Z0-9@._=+\-]*))?/);switch(i[1]||r("Invalid URI"),i[1]){case"hkp":t(o(i[3]?i[3]:i[2],i[3]?i[2]:null));break;case"wkd":t(s(i[2]));break;case"kb":t(c(i[2],i.length>=4&&i[3]));break;default:r("Invalid URI protocol")}})),hkp:o,wkd:s,keybase:c,plaintext:e=>new Promise((async(t,r)=>{t((await n.key.readArmored(e)).keys[0])})),signature:(e,t)=>new Promise((async(r,i)=>{let a=await n.signature.readArmored(e);if("compressed"in a.packets[0]){a=a.packets[0];await n.stream.readToEnd(await a.packets[1].getText())}const s=a.packets[0].signersUserId,c=await a.packets[0].issuerKeyId.toHex();r(o(s||c,t))}))},r.process=u,r.getUserData=e=>new Promise((async(t,r)=>{t((await u(e)).users)})),r.getFingerprint=e=>new Promise((async(t,r)=>{t((await u(e)).fingerprint)}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{bent:76,"merge-options":263,path:288,"valid-url":423}],432:[function(e,t,r){const i=e("bent")("GET"),a=e("./utils"),n=["dns","xmpp","twitter","reddit","liberapay","hackernews","lobsters","devto","gitea","gitlab","github","mastodon","fediverse","discourse","owncast"],o={dns:e("./serviceproviders/dns"),xmpp:e("./serviceproviders/xmpp"),twitter:e("./serviceproviders/twitter"),reddit:e("./serviceproviders/reddit"),liberapay:e("./serviceproviders/liberapay"),hackernews:e("./serviceproviders/hackernews"),lobsters:e("./serviceproviders/lobsters"),devto:e("./serviceproviders/devto"),gitea:e("./serviceproviders/gitea"),gitlab:e("./serviceproviders/gitlab"),github:e("./serviceproviders/github"),mastodon:e("./serviceproviders/mastodon"),fediverse:e("./serviceproviders/fediverse"),discourse:e("./serviceproviders/discourse"),owncast:e("./serviceproviders/owncast")};r.list=n,r.data=o,r.match=(e,t)=>{let r,i=[];return n.forEach(((a,n)=>{r=o[a],r.reURI.test(e)&&i.push(r.processURI(e,t))})),i},r.directRequestHandler=(t,r)=>new Promise((async(r,a)=>{const n=t.proof.fetch?t.proof.fetch:t.proof.uri;switch(t.proof.format){case"json":i(n,null,{Accept:"application/json","User-Agent":"doipjs/"+e("../package.json").version}).then((async e=>await e.json())).then((e=>{r(e)})).catch((e=>{a(e)}));break;case"text":i(n).then((async e=>await e.text())).then((e=>{r(e)})).catch((e=>{a(e)}));break;default:a("No specified proof data format")}})),r.proxyRequestHandler=(e,t)=>new Promise((async(r,n)=>{const o=e.proof.fetch?e.proof.fetch:e.proof.uri;i(a.generateProxyURL(e.proof.format,o,t),null,{Accept:"application/json"}).then((async e=>await e.json())).then((e=>{r(e.content)})).catch((e=>{n(e)}))}))},{"../package.json":428,"./serviceproviders/devto":433,"./serviceproviders/discourse":434,"./serviceproviders/dns":435,"./serviceproviders/fediverse":436,"./serviceproviders/gitea":437,"./serviceproviders/github":438,"./serviceproviders/gitlab":439,"./serviceproviders/hackernews":440,"./serviceproviders/liberapay":441,"./serviceproviders/lobsters":442,"./serviceproviders/mastodon":443,"./serviceproviders/owncast":444,"./serviceproviders/reddit":445,"./serviceproviders/twitter":446,"./serviceproviders/xmpp":447,"./utils":449,bent:76}],433:[function(e,t,r){const i=/^https:\/\/dev\.to\/(.*)\/(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"devto"},profile:{display:r[1],uri:"https://dev.to/"+r[1],qr:null},proof:{uri:e,fetch:`https://dev.to/api/articles/${r[1]}/${r[2]}`,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["body_markdown"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://dev.to/alice/post",shouldMatch:!0},{uri:"https://dev.to/alice/post/",shouldMatch:!0},{uri:"https://domain.org/alice/post",shouldMatch:!1}]},{}],434:[function(e,t,r){const i=/^https:\/\/(.*)\/u\/(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"discourse"},profile:{display:`${r[2]}@${r[1]}`,uri:e,qr:null},proof:{uri:e,fetch:`https://${r[1]}/u/${r[2]}.json`,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["user","bio_raw"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://domain.org/u/alice",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]},{}],435:[function(e,t,r){const i=e("dns"),a=e("bent")("GET"),n=e("../utils"),o=/^dns:([a-zA-Z0-9\.\-\_]*)(?:\?(.*))?/,s=async(e,t)=>{if("resolveTxt"in i){const t=async()=>new Promise(((t,r)=>{i.resolveTxt(e.profile.display,((e,i)=>{e&&r(e),t(i)}))}));return{hostname:e.profile.display,records:{txt:await t()}}}{const t=await a(e.proof.uri,null,{Accept:"application/json"});return await t.json()}};r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"dns"},profile:{display:r[1],uri:"https://"+r[1],qr:null},proof:{uri:n.generateProxyURL("dns",r[1],t),fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"uri",path:["records","txt"],relation:"contains"},customRequestHandler:s}},r.tests=[{uri:"dns:domain.org",shouldMatch:!0},{uri:"dns:domain.org?type=TXT",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]},{"../utils":449,bent:76,dns:127}],436:[function(e,t,r){const i=/^https:\/\/(.*)\/users\/(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"fediverse"},profile:{display:`@${r[2]}@${r[1]}`,uri:e,qr:null},proof:{uri:e,fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"fingerprint",path:["summary"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://domain.org/users/alice",shouldMatch:!0},{uri:"https://domain.org/users/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]},{}],437:[function(e,t,r){const i=/^https:\/\/(.*)\/(.*)\/gitea_proof\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"gitea"},profile:{display:`${r[2]}@${r[1]}`,uri:`https://${r[1]}/${r[2]}`,qr:null},proof:{uri:e,fetch:`https://${r[1]}/api/v1/repos/${r[2]}/gitea_proof`,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["description"],relation:"equals"},customRequestHandler:null}},r.tests=[{uri:"https://domain.org/alice/gitea_proof",shouldMatch:!0},{uri:"https://domain.org/alice/gitea_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!1}]},{}],438:[function(e,t,r){const i=/^https:\/\/gist\.github\.com\/(.*)\/(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"github"},profile:{display:r[1],uri:"https://github.com/"+r[1],qr:null},proof:{uri:e,fetch:"https://api.github.com/gists/"+r[2],useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:["files","openpgp.md","content"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://gist.github.com/Alice/123456789",shouldMatch:!0},{uri:"https://gist.github.com/Alice/123456789/",shouldMatch:!0},{uri:"https://domain.org/Alice/123456789",shouldMatch:!1}]},{}],439:[function(e,t,r){const i=e("bent")("GET"),a=/^https:\/\/(.*)\/(.*)\/gitlab_proof\/?/,n=async(e,t)=>{const r=e.proof.uri.match(a),n=`https://${r[1]}/api/v4/users?username=${r[2]}`;let o;try{o=await i(n,null,{Accept:"application/json"})}catch(e){o=await i(utils.generateProxyURL("web",n,t),null,{Accept:"application/json"})}const s=(await o.json()).find((e=>e.username===r[2]));if(!s)throw new Error("No user with username "+r[2]);const c=`https://${r[1]}/api/v4/users/${s.id}/projects`;let u;try{u=await i(c,null,{Accept:"application/json"})}catch(e){u=await i(utils.generateProxyURL("web",c,t),null,{Accept:"application/json"})}const p=(await u.json()).find((e=>"gitlab_proof"===e.path));if(!p)throw new Error("No project at "+e.proof.uri);return p};r.reURI=a,r.processURI=(e,t)=>{t||(t={});const r=e.match(a);return{serviceprovider:{type:"web",name:"gitlab"},profile:{display:`${r[2]}@${r[1]}`,uri:`https://${r[1]}/${r[2]}`,qr:null},proof:{uri:e,fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:["description"],relation:"equals"},customRequestHandler:n}},r.tests=[{uri:"https://gitlab.domain.org/alice/gitlab_proof",shouldMatch:!0},{uri:"https://gitlab.domain.org/alice/gitlab_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!1}]},{bent:76}],440:[function(e,t,r){const i=/^https:\/\/news\.ycombinator\.com\/user\?id=(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"hackernews"},profile:{display:r[1],uri:e,qr:null},proof:{uri:`https://hacker-news.firebaseio.com/v0/user/${r[1]}.json`,fetch:null,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"uri",path:["about"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://news.ycombinator.com/user?id=Alice",shouldMatch:!0},{uri:"https://news.ycombinator.com/user?id=Alice/",shouldMatch:!0},{uri:"https://domain.org/user?id=Alice",shouldMatch:!1}]},{}],441:[function(e,t,r){const i=/^https:\/\/liberapay\.com\/(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"liberapay"},profile:{display:r[1],uri:e,qr:null},proof:{uri:e,fetch:`https://liberapay.com/${r[1]}/public.json`,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:["statements","content"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://liberapay.com/alice",shouldMatch:!0},{uri:"https://liberapay.com/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]},{}],442:[function(e,t,r){const i=/^https:\/\/lobste\.rs\/u\/(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"lobsters"},profile:{display:r[1],uri:e,qr:null},proof:{uri:`https://lobste.rs/u/${r[1]}.json`,fetch:null,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["about"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://lobste.rs/u/Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice/",shouldMatch:!0},{uri:"https://domain.org/u/Alice",shouldMatch:!1}]},{}],443:[function(e,t,r){const i=/^https:\/\/(.*)\/@(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"mastodon"},profile:{display:`@${r[2]}@${r[1]}`,uri:e,qr:null},proof:{uri:e,fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"fingerprint",path:["attachment","value"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://domain.org/@alice",shouldMatch:!0},{uri:"https://domain.org/@alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]},{}],444:[function(e,t,r){e("bent")("GET");const i=/^https:\/\/(.*)/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});return{serviceprovider:{type:"web",name:"owncast"},profile:{display:e.match(i)[1],uri:e,qr:null},proof:{uri:e+"/api/config",fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"fingerprint",path:["socialHandles","url"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://live.domain.org",shouldMatch:!0},{uri:"https://live.domain.org/",shouldMatch:!0},{uri:"https://domain.org/live",shouldMatch:!0},{uri:"https://domain.org/live/",shouldMatch:!0}]},{bent:76}],445:[function(e,t,r){const i=/^https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\/?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"reddit"},profile:{display:r[1],uri:"https://www.reddit.com/user/"+r[1],qr:null},proof:{uri:e,fetch:`https://www.reddit.com/user/${r[1]}/comments/${r[2]}.json`,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["data","children","data","selftext"],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"https://www.reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://www.reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://domain.org/user/Alice/comments/123456/post",shouldMatch:!1}]},{}],446:[function(e,t,r){const i=e("twitter"),a=e("../serviceproviders"),n=/^https:\/\/twitter\.com\/(.*)\/status\/([0-9]*)(?:\?.*)?/,o=async(e,t)=>{const r=e.proof.uri.match(n);if("twitterBearerToken"in t&&t.twitterBearerToken){const e=new i({bearer_token:t.twitterBearerToken});return(await e.get("statuses/show",{id:r[2]})).text}if("nitterInstance"in t&&t.nitterInstance){e.proof.fetch=`https://${t.nitterInstance}/${r[1]}/status/${r[2]}`;return await a.proxyRequestHandler(e,t)}return null};r.reURI=n,r.processURI=(e,t)=>{t||(t={});const r=e.match(n);return{serviceprovider:{type:"web",name:"twitter"},profile:{display:"@"+r[1],uri:"https://twitter.com/"+r[1],qr:null},proof:{uri:e,fetch:null,useProxy:!0,format:"text"},claim:{fingerprint:null,format:"message",path:[],relation:"contains"},customRequestHandler:o}},r.tests=[{uri:"https://twitter.com/alice/status/1234567890123456789",shouldMatch:!0},{uri:"https://twitter.com/alice/status/1234567890123456789/",shouldMatch:!0},{uri:"https://domain.org/alice/status/1234567890123456789",shouldMatch:!1}]},{"../serviceproviders":432,twitter:411}],447:[function(e,t,r){const i=e("../utils"),a=/^xmpp:([a-zA-Z0-9\.\-\_]*)@([a-zA-Z0-9\.\-\_]*)(?:\?(.*))?/;r.reURI=a,r.processURI=(e,t)=>{t||(t={});const r=e.match(a);return{serviceprovider:{type:"communication",name:"xmpp"},profile:{display:`${r[1]}@${r[2]}`,uri:e,qr:e},proof:{uri:i.generateProxyURL("xmpp",`${r[1]}@${r[2]}`,t),fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:[],relation:"contains"},customRequestHandler:null}},r.tests=[{uri:"xmpp:alice@domain.org",shouldMatch:!0},{uri:"xmpp:alice@domain.org?omemo-sid-123456789=A1B2C3D4E5F6G7H8I9",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]},{"../utils":449}],448:[function(e,t,r){(function(t){(function(){const i="undefined"!=typeof window?window.openpgp:void 0!==t?t.openpgp:null,a=(e("merge-options"),e("./claims")),n=e("./keys");r.verify=(e,t)=>new Promise((async(r,o)=>{let s,c=[];try{s=await i.cleartext.readArmored(e)}catch(e){return c.push("invalid_signature"),void o({errors:c})}const u=s.signature.packets[0].issuerKeyId.toHex(),p=s.signature.packets[0].signersUserId,l=s.signature.packets[0].preferredKeyServer||"https://keys.openpgp.org/",f=s.getText();let h,d,m=[],g=[];if(f.split("\n").forEach(((e,t)=>{const r=e.match(/^([a-zA-Z0-9]*)\=(.*)$/i);if(r)switch(r[1].toLowerCase()){case"key":m.push(r[2]);break;case"proof":g.push(r[2])}})),m.length>0)try{d=m[0],h=await n.fetch.uri(d)}catch(e){}if(!h&&p)try{d="wkd:"+p,h=await n.fetch.uri(d)}catch(e){}if(!h)try{d=`hkp:${l.match(/^(.*\:\/\/)?([^/]*)(?:\/)?$/i)[2]}:${u||p}`,h=await n.fetch.uri(d)}catch(e){return c.push("key_not_found"),void o({errors:c})}const b=h.keyPacket.getFingerprint();try{const e=await s.verify([h]);await e[0].verified}catch(e){return c.push("invalid_signature_verification"),void o({errors:c})}const v=await a.verify(g,b,t);r({errors:c,signature:{data:s.signature,issuerKeyId:u,signersUserId:p,preferredKeyServer:l},publicKey:{data:h,uri:d,fingerprint:b},text:f,claims:v})}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./claims":429,"./keys":431,"merge-options":263}],449:[function(e,t,r){r.generateProxyURL=(e,t,r)=>{if(!r||!r.doipProxyHostname)return null;let i="";return"xmpp"==e&&(i+="/DESC"),`https://${r.doipProxyHostname}/api/1/get/${e}/${encodeURIComponent(t)}${i}`},r.generateClaim=(e,t)=>{switch(t){case"uri":return"openpgp4fpr:"+e;case"message":return`[Verifying my OpenPGP key: openpgp4fpr:${e}]`;case"fingerprint":return e;default:throw new Error("No valid claim format")}}},{}]},{},[430])(430)}));