diff --git a/dist/alks.min.js b/dist/alks.min.js index 7d8e5773..d9e22999 100644 --- a/dist/alks.min.js +++ b/dist/alks.min.js @@ -1 +1 @@ -!function(global,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((global="undefined"!=typeof globalThis?globalThis:global||self).alks={})}(this,function(e){"use strict";var t=window||this;function r(r){if(r.__esModule)return r;var n=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(r).forEach(function(e){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}})}),n}var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||0s[0]&&t[1] dist/alks.min.js',build:"npm run clean && npm run compile && npm run rollup && npm run minify",lint:"prettier --write {src,test}/**/*.{ts,js,json,md}",test:"npm run build && npm run lint && npm run mocha && npm run karma",mocha:"nyc mocha test/test.js",coverage:"nyc report --reporter=text-lcov | coveralls",karma:"karma start",docs:"typedoc src/",prepare:"husky install",compile:"tsc"},files:["dist/"],repository:{type:"git",url:"https://github.com/Cox-Automotive/alks.js.git"},author:{name:"Cox Automotive",email:"paul.ofallon@coxautoinc.com",url:"https://github.com/Cox-Automotive/"},bugs:{url:"https://github.com/Cox-Automotive/alks.js/issues"},license:"MIT",engines:{node:">=8.0.0"},dependencies:{"node-fetch":"^2.6.1"},devDependencies:{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/node":"^15.0.2","@types/node-fetch":"^2.5.10",browserify:"^17.0.0",chai:"^4.3.4","chai-as-promised":"^7.1.1",coveralls:"^3.0.3",encoding:"^0.1.13",eslint:"^7.25.0","eslint-plugin-jsdoc":"^4.1.1","fetch-mock":"^7.3.1",husky:"^6.0.0",karma:"^6.3.2","karma-browserify":"^8.0.0","karma-chrome-launcher":"^3.1.0","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","lint-staged":"^11.0.0",mkdirp:"^1.0.4",mocha:"^8.3.2",nyc:"^15.1.0",prettier:"^2.3.0",rimraf:"^3.0.2",rollup:"^2.47.0","rollup-plugin-json":"^3.1.0","rollup-plugin-node-builtins":"^2.1.2","rollup-plugin-node-globals":"^1.4.0","rollup-plugin-replace":"^2.2.0",sinon:"^10.0.0",tslib:"^2.2.0",tslint:"^6.1.3",typescript:"^4.2.4","uglify-js":"^3.13.6",watchify:"^3.11.1"},prettier:{singleQuote:!0,semi:!0,arrowParens:"always",endOfLine:"lf",trailingComma:"es5"},"lint-staged":{"{src,test}/**/*.{js,ts,json,md}":["prettier --write"]}},f=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},d=[],p=[],g="undefined"!=typeof Uint8Array?Uint8Array:Array,_=!1;function m(){_=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t>18&63]+d[n>>12&63]+d[n>>6&63]+d[63&n]);return i.join("")}function b(e){var t;_||m();for(var r=e.length,n=r%3,i="",o=[],s=0,a=r-n;s>2],i+=d[t<<4&63],i+="=="):2==n&&(t=(e[r-2]<<8)+e[r-1],i+=d[t>>10],i+=d[t>>4&63],i+=d[t<<2&63],i+="="),o.push(i),o.join("")}function w(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,c=r?i-1:0,f=r?-1:1,r=e[t+c];for(c+=f,o=r&(1<<-l)-1,r>>=-l,l+=a;0>=-l,l+=n;0>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(t+=1<=s+l?c/n:c*Math.pow(2,1-l))*n&&(s++,n/=2),h<=s+l?(a=0,s=h):1<=s+l?(a=(t*n-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));8<=i;e[r+f]=255&a,f+=d,a/=256,i-=8);for(s=s<=A())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A().toString(16)+" bytes");return 0|e}function j(e){return null!=e&&e._isBuffer}function z(e,t){if(j(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var r=(e="string"!=typeof e?""+e:e).length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return X(e).length;t=(""+t).toLowerCase(),n=!0}}function I(e,t,r){var n,i,o,s=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0);(!r||r<0||n=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(j(t="string"==typeof t?T.from(t,n):t))return 0===t.length?-1:B(e,t,r,n,i);if("number"==typeof t)return t&=255,T.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):B(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function B(e,t,r,n,i){var o=1,s=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s/=o=2,a/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var h=-1,l=r;l>8,n=n%256,i.push(n),i.push(r);return i}(t,e.length-r),e,r,n)}function D(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}return function(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n"},T.prototype.compare=function(e,t,r,n,i){if(!j(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=t)return 0;if(i<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),h=e.slice(t,r),l=0;lthis.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,u=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;if((!n||i<(n=Number(n)))&&(n=i),(i=t.length)%2!=0)throw new TypeError("Invalid hex string");i/2e.length)throw new RangeError("Index out of range")}function Y(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function K(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function W(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $(e,t,r,n,i){return i||W(e,0,r,4),v(e,t,r,n,23,4),r+4}function G(e,t,r,n,i){return i||W(e,0,r,8),v(e,t,r,n,52,8),r+8}T.prototype.slice=function(e,t){var r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):r>>8):Y(this,e,t,!0),t+2},T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,2,65535,0),T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Y(this,e,t,!1),t+2},T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,4,4294967295,0),T.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):K(this,e,t,!0),t+4},T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,4,4294967295,0),T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):K(this,e,t,!1),t+4},T.prototype.writeIntLE=function(e,t,r,n){e=+e,t|=0,n||H(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},T.prototype.writeIntBE=function(e,t,r,n){e=+e,t|=0,n||H(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,o=1,s=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},T.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,1,127,-128),T.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},T.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,2,32767,-32768),T.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Y(this,e,t,!0),t+2},T.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,2,32767,-32768),T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Y(this,e,t,!1),t+2},T.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,4,2147483647,-2147483648),T.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):K(this,e,t,!0),t+4},T.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):K(this,e,t,!1),t+4},T.prototype.writeFloatLE=function(e,t,r){return $(this,e,t,!0,r)},T.prototype.writeFloatBE=function(e,t,r){return $(this,e,t,!1,r)},T.prototype.writeDoubleLE=function(e,t,r){return G(this,e,t,!0,r)},T.prototype.writeDoubleBE=function(e,t,r){return G(this,e,t,!1,r)},T.prototype.copy=function(e,t,r,n){if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var i,o=(n=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.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;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return function(e){var t;_||m();var r=e.length;if(0>16&255,i[s++]=t>>8&255,i[s++]=255&t;return 2==n?(t=p[e.charCodeAt(a)]<<2|p[e.charCodeAt(a+1)]>>4,i[s++]=255&t):1==n&&(t=p[e.charCodeAt(a)]<<10|p[e.charCodeAt(a+1)]<<4|p[e.charCodeAt(a+2)]>>2,i[s++]=t>>8&255,i[s++]=255&t),i}(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Q(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ee(e){return null!=e&&(!!e._isBuffer||te(e)||"function"==typeof(e=e).readFloatLE&&"function"==typeof e.slice&&te(e.slice(0,0)))}function te(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var re=r(Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:R,Buffer:T,SlowBuffer:function(e){return T.alloc(+(e=+e!=e?0:e))},isBuffer:ee}));function ne(){}function ie(){ie.init.call(this)}function oe(e){return void 0===e._maxListeners?ie.defaultMaxListeners:e._maxListeners}function se(e,t,r,n){var i,o;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');return(i=e._events)?(i.newListener&&(e.emit("newListener",t,r.listener||r),i=e._events),o=i[t]):(i=e._events=new ne,e._eventsCount=0),o?("function"==typeof o?o=i[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),o.warned||(n=oe(e))&&0n&&(o.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",n.emitter=e,n.type=t,n.count=o.length,n=n,"function"==typeof console.warn?console.warn(n):console.log(n))):(o=i[t]=r,++e._eventsCount),e}function ae(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function ue(e){var t=this._events;if(t){e=t[e];if("function"==typeof e)return 1;if(e)return e.length}return 0}function he(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function le(){throw new Error("setTimeout has not been defined")}function ce(){throw new Error("clearTimeout has not been defined")}ne.prototype=Object.create(null),(ie.EventEmitter=ie).usingDomains=!1,ie.prototype.domain=void 0,ie.prototype._events=void 0,ie.prototype._maxListeners=void 0,ie.defaultMaxListeners=10,ie.init=function(){this.domain=null,ie.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ne,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ie.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ie.prototype.getMaxListeners=function(){return oe(this)},ie.prototype.emit=function(e){var t,r,n,i="error"===e,o=this._events;if(o)i=i&&null==o.error;else if(!i)return!1;if(s=this.domain,i){if(i=arguments[1],s)return(i=i||new Error('Uncaught, unspecified "error" event')).domainEmitter=this,i.domain=s,i.domainThrown=!1,s.emit("error",i),!1;if(i instanceof Error)throw i;var s=new Error('Uncaught, unspecified "error" event. ('+i+")");throw s.context=i,s}if(!(t=o[e]))return!1;var a,u="function"==typeof t;switch(a=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=he(e,n),o=0;o>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Ke=T.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function We(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Ke(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Ge;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Ve;break;default:return void(this.write=$e)}this.charBuffer=new T(6),this.charReceived=0,this.charLength=0}function $e(e){return e.toString(this.encoding)}function Ge(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function Ve(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}We.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},We.prototype.end=function(e){var t,r,n="";return e&&e.length&&(n=this.write(e)),this.charReceived&&(t=this.charReceived,r=this.charBuffer,e=this.encoding,n+=r.slice(0,t).toString(e)),n},et.ReadableState=Qe;var Xe,Je=(Me(Se)&&(Se=""),Xe=(Xe="stream").toUpperCase(),Te[Xe]||(new RegExp("\\b"+Xe+"\\b","i").test(Se)?Te[Xe]=function(){var e=function(e){if(!Ue(e)){for(var t=[],r=0;rt.highWaterMark&&(t.highWaterMark=(rt<=(r=e)?r=rt:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function it(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Je("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?ve(ot,e):ot(e))}function ot(e){Je("emit readable"),e.emit("readable"),ht(e)}function st(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=o.slice(s);break}++n}return t.length-=n,i}:function(e,t){var r=T.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0===(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n).data=o.slice(s);break}++i}return t.length-=i,r})(e,t);return n}(e,t.buffer,t.decoder),r);var r}function ct(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return Je("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?ct:it)(this),null;if(0===(e=nt(e,t))&&t.ended)return 0===t.length&&ct(this),null;var n=t.needReadable;return Je("need readable",n),(0===t.length||t.length-et._pos){var n=r.substr(t._pos);if("x-user-defined"===t._charset){for(var i=new T(n.length),o=0;ot._pos&&(t.push(new T(new Uint8Array(s.result.slice(t._pos)))),t._pos=s.result.byteLength)},s.onload=function(){t.push(null)},s.readAsArrayBuffer(r)}t._xhr.readyState===Gt&&"ms-stream"!==t._mode&&t.push(null)},Re(Xt,mt);var Jt=["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","user-agent","via"];Xt.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===Jt.indexOf(r)&&(this._headers[r]={name:e,value:t})},Xt.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},Xt.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},Xt.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e,r=t._opts,n=t._headers;if("POST"!==r.method&&"PUT"!==r.method&&"PATCH"!==r.method||(e=function(){if(void 0!==Ut)return Ut;try{new f.Blob([new ArrayBuffer(1)]),Ut=!0}catch(e){Ut=!1}return Ut}()?new f.Blob(t._body.map(function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(ee(e)){for(var t=new Uint8Array(e.length),r=e.length,n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},cr=er-tr,fr=Math.floor,dr=String.fromCharCode;function pr(e){throw new RangeError(lr[e])}function gr(e,t){var r=e.split("@"),n="";return 1fr((Qt-t)/(u=r+1))&&pr("overflow"),t+=(i-d)*u,d=i,g=0;gQt&&pr("overflow"),a==d){for(o=t,s=er;!(o<(h=s<=p?tr:p+rr<=s?rr:s-p));s+=er)c.push(dr(_r(h+(l=o-h)%(h=er-h),0))),o=fr(l/h);c.push(dr(_r(o,0))),p=function(e,t,r){var n=0;for(e=r?fr(e/ir):e>>1,e+=fr(e/t);cr*rr>>1",'"',"`"," ","\r","\n","\t"]),Tr=["'"].concat(Nt),xr=["%","/","?",";","#"].concat(Tr),Or=["/","?","#"],Lr=255,Pr=/^[+a-z0-9A-Z_-]{0,63}$/,Cr=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jr={javascript:!0,"javascript:":!0},zr={javascript:!0,"javascript:":!0},Ir={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Ur(e,t,r){if(e&&Ne(e)&&e instanceof Er)return e;var n=new Er;return n.parse(e,t,r),n}function Mr(e,t,r,n){if(!Ue(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&iLr?e.hostname="":e.hostname=e.hostname.toLowerCase(),c||(e.hostname=gr(e.hostname,function(e){return ur.test(e)?"xn--"+mr(e):e}));var k=e.port?":"+e.port:"",E=e.hostname||"";e.host=E+k,e.href+=e.host,c&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!jr[S])for(d=0,p=Tr.length;d>>7)]}function jn(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function zn(e,t,r){e.bi_valid>cn-r?(e.bi_buf|=t<>cn-e.bi_valid,e.bi_valid+=r-cn):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function Mn(e,t,r){for(var n,i=new Array(ln+1),o=0,s=1;s<=ln;s++)i[s]=o=o+r[s-1]<<1;for(n=0;n<=t;n++){var a=e[2*n+1];0!==a&&(e[2*n]=Un(i[a]++,a))}}function Bn(e){for(var t=0;t>1;1<=r;r--)Dn(e,o,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Dn(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Dn(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){for(var r,n,i,o,s,a=t.dyn_tree,u=t.max_code,h=t.stat_desc.static_tree,l=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,d=t.stat_desc.max_length,p=0,g=0;g<=ln;g++)e.bl_count[g]=0;for(a[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;o>=8,e.bi_valid-=8)}function Vn(e,t,r,n){var i,o,s=0;0>>=1)if(1&t&&0!==e.dyn_ltree[2*r])return Vr;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Xr;for(r=32;r>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?$n(e,t,r,n):e.strategy===Gr||o===i?(zn(e,(tn<<1)+(n?1:0),3),Zn(e,vn,kn)):(zn(e,(rn<<1)+(n?1:0),3),function(e,t,r,n){var i;for(zn(e,t-257,5),zn(e,r-1,5),zn(e,n-4,4),i=0;i>>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*(Rn[r]+on+1)]++,e.dyn_dtree[2*Cn(t)]++),e.last_lit===e.lit_bufsize-1}function Jn(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){for(r-=s=2e3>>1:r>>>1;e[t]=r}return e}();function ei(e,t,r,n){var i=Qn,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}var ti=0,ri=1,ni=3,ii=4,oi=5,si=0,ai=1,ui=-2,hi=-3,li=-5,ci=-1,fi=1,di=2,pi=3,gi=4,_i=2,mi=8,yi=9,bi=286,wi=30,vi=19,ki=2*bi+1,Ei=15,Ri=3,Ai=258,Si=Ai+Ri+1,Ti=32,xi=42,Oi=69,Li=73,Pi=91,Ci=103,ji=113,zi=666,Ii=1,Ui=2,Mi=3,Bi=4,Ni=3;function Fi(e,t){return e.msg=qr[t],t}function Di(e){return(e<<1)-(4e.avail_out?e.avail_out:r)&&(Yr(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 Hi(e,t){Vn(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,qi(e.strm)}function Yi(e,t){e.pending_buf[e.pending++]=t}function Ki(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Wi(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-Si?e.strstart-(e.w_size-Si):0,h=e.window,l=e.w_mask,c=e.prev,f=e.strstart+Ai,d=h[o+s-1],p=h[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(h[(r=t)+s]===p&&h[r+s-1]===d&&h[r]===h[o]&&h[++r]===h[o+1]){for(o+=2,r++;h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&ou&&0!=--i);return s<=e.lookahead?s:e.lookahead}function $i(e){var t,r,n,i,o,s,a,u,h,l=e.w_size;do{if(h=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-Si)){for(Yr(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;n=e.head[--t],e.head[t]=l<=n?n-l:0,--r;);for(t=r=l;n=e.prev[--t],e.prev[t]=l<=n?n-l:0,--r;);h+=l}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,a=e.strstart+e.lookahead,u=h,h=void 0,h=o.avail_in,r=0===(h=u=Ri)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=Ri&&(e.ins_h=(e.ins_h<=Ri)if(n=Xn(e,e.strstart-e.match_start,e.match_length-Ri),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ri){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=Ri&&(e.ins_h=(e.ins_h<=Ri&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-Ri,n=Xn(e,e.strstart-1-e.prev_match,e.prev_length-Ri),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<>8&255),Yi(r,r.gzhead.time>>16&255),Yi(r,r.gzhead.time>>24&255),Yi(r,9===r.level?2:r.strategy>=di||r.level<2?4:0),Yi(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Yi(r,255&r.gzhead.extra.length),Yi(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ei(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Oi):(Yi(r,0),Yi(r,0),Yi(r,0),Yi(r,0),Yi(r,0),Yi(r,9===r.level?2:r.strategy>=di||r.level<2?4:0),Yi(r,Ni),r.status=ji)):(o=mi+(r.w_bits-8<<4)<<8,o|=(r.strategy>=di||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(o|=Ti),o+=31-o%31,r.status=ji,Ki(r,o),0!==r.strstart&&(Ki(r,e.adler>>>16),Ki(r,65535&e.adler)),e.adler=1)),r.status===Oi)if(r.gzhead.extra){for(n=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>n&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),qi(e),n=r.pending,r.pending!==r.pending_buf_size));)Yi(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Li)}else r.status=Li;if(r.status===Li)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),qi(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.gzindex=0,r.status=Pi)}else r.status=Pi;if(r.status===Pi)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),qi(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.status=Ci)}else r.status=Ci;if(r.status===Ci&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&qi(e),r.pending+2<=r.pending_buf_size&&(Yi(r,255&e.adler),Yi(r,e.adler>>8&255),e.adler=0,r.status=ji)):r.status=ji),0!==r.pending){if(qi(e),0===e.avail_out)return r.last_flush=-1,si}else if(0===e.avail_in&&Di(t)<=Di(s)&&t!==ii)return Fi(e,li);if(r.status===zi&&0!==e.avail_in)return Fi(e,li);if(0!==e.avail_in||0!==r.lookahead||t!==ti&&r.status!==zi){var s=r.strategy===di?function(e,t){for(var r;;){if(0===e.lookahead&&($i(e),0===e.lookahead)){if(t===ti)return Ii;break}if(e.match_length=0,r=Xn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Hi(e,!1),0===e.strm.avail_out))return Ii}return e.insert=0,t===ii?(Hi(e,!0),0===e.strm.avail_out?Mi:Bi):e.last_lit&&(Hi(e,!1),0===e.strm.avail_out)?Ii:Ui}(r,t):r.strategy===pi?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=Ai){if($i(e),e.lookahead<=Ai&&t===ti)return Ii;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=Ri&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ri?(r=Xn(e,1,e.match_length-Ri),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Xn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Hi(e,!1),0===e.strm.avail_out))return Ii}return e.insert=0,t===ii?(Hi(e,!0),0===e.strm.avail_out?Mi:Bi):e.last_lit&&(Hi(e,!1),0===e.strm.avail_out)?Ii:Ui}(r,t):to[r.level].func(r,t);if(s!==Mi&&s!==Bi||(r.status=zi),s===Ii||s===Mi)return 0===e.avail_out&&(r.last_flush=-1),si;if(s===Ui&&(t===ri?Gn(r):t!==oi&&($n(r,0,0,!1),t===ni&&(Zi(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),qi(e),0===e.avail_out))return r.last_flush=-1,si}return t!==ii?si:r.wrap<=0?ai:(2===r.wrap?(Yi(r,255&e.adler),Yi(r,e.adler>>8&255),Yi(r,e.adler>>16&255),Yi(r,e.adler>>24&255),Yi(r,255&e.total_in),Yi(r,e.total_in>>8&255),Yi(r,e.total_in>>16&255),Yi(r,e.total_in>>24&255)):(Ki(r,e.adler>>>16),Ki(r,65535&e.adler)),qi(e),0e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if($i(e),0===e.lookahead&&t===ti)return Ii;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Hi(e,!1),0===e.strm.avail_out))return Ii;if(e.strstart-e.block_start>=e.w_size-Si&&(Hi(e,!1),0===e.strm.avail_out))return Ii}return e.insert=0,t===ii?(Hi(e,!0),0===e.strm.avail_out?Mi:Bi):(e.strstart>e.block_start&&(Hi(e,!1),e.strm.avail_out),Ii)}),new Xi(4,4,8,4,Gi),new Xi(4,5,16,8,Gi),new Xi(4,6,32,32,Gi),new Xi(4,4,16,16,Vi),new Xi(8,16,32,32,Vi),new Xi(8,16,128,128,Vi),new Xi(8,32,128,256,Vi),new Xi(32,128,258,1024,Vi),new Xi(32,258,258,4096,Vi)],ro=30,no=12;var io=15,oo=852,so=592,ao=0,uo=1,ho=2,lo=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],co=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],fo=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],po=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function go(e,t,r,n,i,o,s,a){for(var u,h,l,c,f,d,p,g,_,m=a.bits,y=0,b=0,w=0,v=0,k=0,E=0,R=0,A=0,S=0,T=0,x=null,O=0,L=new Wr(io+1),P=new Wr(io+1),C=null,j=0,y=0;y<=io;y++)L[y]=0;for(b=0;bd?(g=C[j+s[b]],x[O+s[b]]):(g=96,0),u=1<<(p=y-R),w=h=1<>R)+(h-=u)]=p<<24|g<<16|_|0,0!==h;);for(u=1<>=1;if(0!==u?(T&=u-1,T+=u):T=0,b++,0==--L[y]){if(y===v)break;y=t[r+s[b]]}if(k>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function cs(){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 Wr(320),this.work=new Wr(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function fs(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,(t=e)&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Lo,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new $r(us),e.distcode=e.distdyn=new $r(hs),e.sane=1,e.back=-1,ko):Ao):Ao}function ds(e,t){var r,n,i;return e?(r=new cs,(e.state=r).window=null,n=t,(r=(r=e)&&r.state?(t=r.state,n<0?(i=0,n=-n):(i=1+(n>>4),n<48&&(n&=15)),n&&(n<8||15>>8&255,r.check=ei(r.check,C,2,0),l=h=0,r.mode=Po;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=os;break}if((15&h)!==Oo){e.msg="unknown compression method",r.mode=os;break}if(l-=4,k=8+(15&(h>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=os;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=ei(r.check,C,2,0)),l=h=0,r.mode=Co;case Co:for(;l<32;){if(0===a)break e;a--,h+=n[o++]<>>8&255,C[2]=h>>>16&255,C[3]=h>>>24&255,r.check=ei(r.check,C,4,0)),l=h=0,r.mode=jo;case jo:for(;l<16;){if(0===a)break e;a--,h+=n[o++]<>8),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=ei(r.check,C,2,0)),l=h=0,r.mode=zo;case zo:if(1024&r.flags){for(;l<16;){if(0===a)break e;a--,h+=n[o++]<>>8&255,r.check=ei(r.check,C,2,0)),l=h=0}else r.head&&(r.head.extra=null);r.mode=Io;case Io:if(1024&r.flags&&((d=a<(d=r.length)?a:d)&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Yr(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=ei(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=Uo;case Uo:if(2048&r.flags){if(0===a)break e;for(d=0;k=n[o+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Do;break;case No:for(;l<32;){if(0===a)break e;a--,h+=n[o++]<>>=7&l,l-=7&l,r.mode=rs;break}for(;l<3;){if(0===a)break e;a--,h+=n[o++]<>>=1)){case 0:r.mode=qo;break;case 1:if(!function(e){if(_s){var t;for(ps=new $r(512),gs=new $r(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(go(mo,e.lens,0,288,ps,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;go(yo,e.lens,0,32,gs,0,e.work,{bits:5}),_s=!1}e.lencode=ps,e.lenbits=9,e.distcode=gs,e.distbits=5}(r),r.mode=Go,t!==vo)break;h>>>=2,l-=2;break e;case 2:r.mode=Ko;break;case 3:e.msg="invalid block type",r.mode=os}h>>>=2,l-=2;break;case qo:for(h>>>=7&l,l-=7&l;l<32;){if(0===a)break e;a--,h+=n[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=os;break}if(r.length=65535&h,l=h=0,r.mode=Ho,t===vo)break e;case Ho:r.mode=Yo;case Yo:if(d=r.length){if(0===(d=u<(d=a>>=5,l-=5,r.ndist=1+(31&h),h>>>=5,l-=5,r.ncode=4+(15&h),h>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},E=go(_o,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,E){e.msg="invalid code lengths set",r.mode=os;break}r.have=0,r.mode=$o;case $o:for(;r.have>>16&255,y=65535&P,!((_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=_,l-=_,r.lens[r.have++]=y;else{if(16===y){for(A=_+2;l>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=os;break}k=r.lens[r.have-1],d=3+(3&h),h>>>=2,l-=2}else if(17===y){for(A=_+3;l>>=_)),h>>>=3,l-=3}else{for(A=_+7;l>>=_)),h>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=os;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===os)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=os;break}if(r.lenbits=9,R={bits:r.lenbits},E=go(mo,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,E){e.msg="invalid literal/lengths set",r.mode=os;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},E=go(yo,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,E){e.msg="invalid distances set",r.mode=os;break}if(r.mode=Go,t===vo)break e;case Go:r.mode=Vo;case Vo:if(6<=a&&258<=u){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=h,r.bits=l,function(e,t){var r,n,i,o,s,a,u=e.state,h=e.next_in,l=e.input,c=h+(e.avail_in-5),f=e.next_out,d=e.output,p=f-(t-e.avail_out),g=f+(e.avail_out-257),_=u.dmax,m=u.wsize,y=u.whave,b=u.wnext,w=u.window,v=u.hold,k=u.bits,E=u.lencode,R=u.distcode,A=(1<>>=n=r>>>24,k-=n,0===(n=r>>>16&255))d[f++]=65535&r;else{if(!(16&n)){if(0==(64&n)){r=E[(65535&r)+(v&(1<>>=n,k-=n),k<15&&(v+=l[h++]<>>=n=r>>>24,k-=n,!(16&(n=r>>>16&255))){if(0==(64&n)){r=R[(65535&r)+(v&(1<>>=n,k-=n,(n=f-p)>3)<<3))-1,e.next_in=h-=i,e.next_out=f,e.avail_in=h>>16&255,y=65535&P,!((_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>b)])>>>16&255,y=65535&P,!(b+(_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=b,l-=b,r.back+=b}if(h>>>=_,l-=_,r.back+=_,r.length=y,0===m){r.mode=ts;break}if(32&m){r.back=-1,r.mode=Do;break}if(64&m){e.msg="invalid literal/length code",r.mode=os;break}r.extra=15&m,r.mode=Xo;case Xo:if(r.extra){for(A=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Jo;case Jo:for(;m=(P=r.distcode[h&(1<>>16&255,y=65535&P,!((_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>b)])>>>16&255,y=65535&P,!(b+(_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=b,l-=b,r.back+=b}if(h>>>=_,l-=_,r.back+=_,64&m){e.msg="invalid distance code",r.mode=os;break}r.offset=y,r.extra=15&m,r.mode=Qo;case Qo:if(r.extra){for(A=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=os;break}r.mode=es;case es:if(0===u)break e;if(r.offset>(d=f-u)){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=os;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),g=r.window}else g=i,p=s-r.offset,d=r.length;for(u-=d=u=L.wsize?(Yr(L.window,T,x-L.wsize,L.wsize,0),L.wnext=0,L.whave=L.wsize):(S=L.wsize-L.wnext,Yr(L.window,T,x-O,S=ORs.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsRs.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelRs.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelRs.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=Rs.Z_FILTERED&&e.strategy!=Rs.Z_HUFFMAN_ONLY&&e.strategy!=Rs.Z_RLE&&e.strategy!=Rs.Z_FIXED&&e.strategy!=Rs.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!ee(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Rs.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;e=new Error(e);e.errno=t,e.code=Rs.codes[t],r.emit("error",e)};var n=Rs.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);t=Rs.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(t=e.strategy),this._binding.init(e.windowBits||Rs.Z_DEFAULT_WINDOWBITS,n,e.memLevel||Rs.Z_DEFAULT_MEMLEVEL,t,e.dictionary),this._buffer=new T(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=t,this.once("end",this.close)}Object.keys(As).forEach(function(e){As[As[e]]=e}),Re(Is,Ct),Is.prototype.params=function(e,t,r){if(eRs.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=Rs.Z_FILTERED&&t!=Rs.Z_HUFFMAN_ONLY&&t!=Rs.Z_RLE&&t!=Rs.Z_FIXED&&t!=Rs.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);var n;this._level!==e||this._strategy!==t?(n=this).flush(Rs.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())}):ve(r)},Is.prototype.reset=function(){return this._binding.reset()},Is.prototype._flush=function(e){this._transform(new T(0),"",e)},Is.prototype.flush=function(e,t){var r,n=this._writableState;"function"!=typeof e&&(void 0!==e||t)||(t=e,e=Rs.Z_FULL_FLUSH),n.ended?t&&ve(t):n.ending?t&&this.once("end",t):n.needDrain?(r=this).once("drain",function(){r.flush(t)}):(this._flushFlag=e,this.write(new T(0),"",t))},Is.prototype.close=function(e){var t;e&&ve(e),this._closed||(this._closed=!0,this._binding.close(),t=this,ve(function(){t.emit("close")}))},Is.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!ee(e))return r(new Error("invalid input"));o?n=Rs.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||Rs.Z_NO_FLUSH)),this._processChunk(e,n,r)},Is.prototype._processChunk=function(i,o,s){var a=i&&i.length,u=this._chunkSize-this._offset,h=0,l=this,c="function"==typeof s;if(!c){var t,f=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,i,h,a,this._buffer,this._offset,u)}while(!this._hadError&&p(e[0],e[1]));if(this._hadError)throw t;var r=T.concat(f,d);return this.close(),r}r=this._binding.write(o,i,h,a,this._buffer,this._offset,u);function p(e,t){if(!l._hadError){var r,n=u-t;if(!function(e,t){if(!e)throw new Error(t)}(0<=n,"have should not go down"),0=l._chunkSize)&&(u=l._chunkSize,l._offset=0,l._buffer=new T(l._chunkSize)),0===t){if(h+=a-e,a=e,!c)return!0;e=l._binding.write(o,i,h,a,l._buffer,l._offset,l._chunkSize);return e.callback=p,void(e.buffer=i)}if(!c)return!1;s()}}r.buffer=i,r.callback=p},Re(xs,Is),Re(Os,Is),Re(Ls,Is),Re(Ps,Is),Re(Cs,Is),Re(js,Is),Re(zs,Is);var Us={codes:As,createDeflate:function(e){return new xs(e)},createInflate:function(e){return new Os(e)},createDeflateRaw:function(e){return new Cs(e)},createInflateRaw:function(e){return new js(e)},createGzip:function(e){return new Ls(e)},createGunzip:function(e){return new Ps(e)},createUnzip:function(e){return new zs(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new xs(t),e,r)},deflateSync:function(e,t){return Ts(new xs(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new Ls(t),e,r)},gzipSync:function(e,t){return Ts(new Ls(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new Cs(t),e,r)},deflateRawSync:function(e,t){return Ts(new Cs(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new zs(t),e,r)},unzipSync:function(e,t){return Ts(new zs(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new Os(t),e,r)},inflateSync:function(e,t){return Ts(new Os(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new Ps(t),e,r)},gunzipSync:function(e,t){return Ts(new Ps(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new js(t),e,r)},inflateRawSync:function(e,t){return Ts(new js(t),e)},Deflate:xs,Inflate:Os,Gzip:Ls,Gunzip:Ps,DeflateRaw:Cs,InflateRaw:js,Unzip:zs,Zlib:Is};const Ms=It.Readable,Bs=Symbol("buffer"),Ns=Symbol("type");class Fs{constructor(){this[Ns]="";var e=arguments[0],t=arguments[1];const r=[];let n=0;if(e){var i=e,o=Number(i.length);for(let t=0;tn.size)return a=!0,void t(new Ds(`content size at ${n.url} over limit: ${n.size}`,"max-size"));s+=e.length,o.push(e)}}),i.on("end",function(){if(!a){clearTimeout(r);try{e(Buffer.concat(o,s))}catch(e){t(new Ds(`Could not create Buffer from response body for ${n.url}: ${e.message}`,"system",e))}}})})}function Ws(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function $s(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function Gs(e){var t,r;let n=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof It&&"function"!=typeof n.getBoundary&&(t=new Hs,r=new Hs,n.pipe(t),n.pipe(r),e[qs].body=t,n=r),n}function Vs(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":Ws(e)?"application/x-www-form-urlencoded;charset=UTF-8":$s(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof It?null:"text/plain;charset=UTF-8"}function Xs(e){const t=e.body;return null===t?0:$s(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}Ys.prototype={get body(){return this[qs].body},get bodyUsed(){return this[qs].disturbed},arrayBuffer(){return Ks.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)})},blob(){let t=this.headers&&this.headers.get("content-type")||"";return Ks.call(this).then(function(e){return Object.assign(new Fs([],{type:t.toLowerCase()}),{[Bs]:e})})},json(){var t=this;return Ks.call(this).then(function(e){try{return JSON.parse(e.toString())}catch(e){return Ys.Promise.reject(new Ds(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}})},text(){return Ks.call(this).then(function(e){return e.toString()})},buffer(){return Ks.call(this)},textConverted(){var t=this;return Ks.call(this).then(function(e){return function(e,t){if("function"!=typeof Zs)throw new Error("The package `encoding` must be installed to use the textConverted() function");t=t.get("content-type");let r="utf-8",n,i;t&&(n=/charset=([^;]*)/i.exec(t));i=e.slice(0,1024).toString(),!n&&i&&(n=/=f.follow)return c(new Ds(`maximum redirect reached at: ${f.url}`,"max-redirect")),void g();const a={headers:new ia(f.headers),follow:f.follow,counter:f.counter+1,agent:f.agent,compress:f.compress,method:f.method,body:f.body,signal:f.signal,timeout:f.timeout,size:f.size};return 303!==e.statusCode&&f.body&&null===Xs(f)?(c(new Ds("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void g()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==f.method)||(a.method="GET",a.body=void 0,a.headers.delete("content-length")),l(ka(new ma(n,a))),void g())}}e.once("end",function(){d&&d.removeEventListener("abort",_)});let i=e.pipe(new wa);const o={url:f.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:f.size,timeout:f.timeout,counter:f.counter};var s=t.get("Content-Encoding");if(!f.compress||"HEAD"===f.method||null===s||204===e.statusCode||304===e.statusCode)return p=new ca(i,o),void l(p);r={flush:Us.Z_SYNC_FLUSH,finishFlush:Us.Z_SYNC_FLUSH};if("gzip"==s||"x-gzip"==s)return i=i.pipe(Us.createGunzip(r)),p=new ca(i,o),void l(p);if("deflate"!=s&&"x-deflate"!=s){if("br"==s&&"function"==typeof Us.createBrotliDecompress)return i=i.pipe(Us.createBrotliDecompress()),p=new ca(i,o),void l(p);p=new ca(i,o),l(p)}else{const u=e.pipe(new wa);u.once("data",function(e){i=8==(15&e[0])?i.pipe(Us.createInflate()):i.pipe(Us.createInflateRaw()),p=new ca(i,o),l(p)})}}),function(e,t){const r=t.body;null===r?e.end():$s(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(n,f)}})}ka.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},ka.Promise=t.Promise;var t=r(Object.freeze({__proto__:null,default:ka,Headers:ia,Request:ma,Response:ca,FetchError:Ds})),Ea=h,Ra=Ea.__importStar(l),Aa=re;Ea.__importDefault(t);var Sa=window.fetch.bind(window);!function(e){(t=e.TrustType||(e.TrustType={})).CrossAccount="Cross Account",t.InnerAccount="Inner Account",(s=e.PseudoBoolean||(e.PseudoBoolean={}))[s.True=1]="True",s[s.False=0]="False";var t=(r.prototype.create=function(e){return new r(Ea.__assign(Ea.__assign({},this.config),e))},r.prototype.getAccounts=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAccounts",r)];case 1:return t=e.sent(),[2,Object.keys(t.accountListRole).map(function(e){return{account:e,role:t.accountListRole[e][0].role,iamKeyActive:t.accountListRole[e][0].iamKeyActive,maxKeyDuration:t.accountListRole[e][0].maxKeyDuration,skypieaAccount:t.accountListRole[e][0].skypieaAccount}})]}})})},r.prototype.getKeys=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getKeys",t)];case 1:return[2,o(e.sent(),["accessKey","secretKey","sessionToken","consoleURL"])]}})})},r.prototype.getIAMKeys=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getIAMKeys",t)];case 1:return[2,o(e.sent(),["accessKey","secretKey","sessionToken","consoleURL"])]}})})},r.prototype.getAllAWSRoleTypes=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.getDynamicValues?"allAwsRoleTypes?getDynamicValues=true":"allAwsRoleTypes",[4,this.internalFetch(t,r,"GET")];case 1:return[2,e.sent().roleTypes]}})})},r.prototype.getAWSRoleTypes=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAWSRoleTypes",r)];case 1:return t=e.sent(),[2,JSON.parse(t.roleTypes)]}})})},r.prototype.getNonServiceAWSRoleTypes=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getNonServiceAWSRoleTypes",r)];case 1:return t=e.sent(),[2,JSON.parse(t.roleTypes)]}})})},r.prototype.createRole=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("createRole",r)];case 1:return(t=e.sent()).denyArns=t.denyArns.split(","),[2,o(t,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile"])]}})})},r.prototype.createNonServiceRole=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("createNonServiceRole",r)];case 1:return(t=e.sent()).denyArns=t.denyArns.split(","),[2,o(t,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile"])]}})})},r.prototype.awsAccountRoles=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("awsAccountRoles?account="+t.account,t,"GET")];case 1:return[2,e.sent().awsRoleList]}})})},r.prototype.listAWSAccountRoles=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("listAWSAccountRoles",r)];case 1:return t=e.sent(),[2,JSON.parse(t.jsonAWSRoleList).map(function(e){return e.split("/").slice(-1)[0]})]}})})},r.prototype.getAccountRole=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAccountRole",r)];case 1:if(!(t=e.sent()).roleExists)throw new Error("Role "+r.roleName+" does not exist in this account");return[2,t.roleARN]}})})},r.prototype.deleteRole=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("deleteRole",t)];case 1:return e.sent(),[2,!0]}})})},r.prototype.addRoleMachineIdentity=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("roleMachineIdentity",t)];case 1:return[2,o(e.sent(),["machineIdentityArn"])]}})})},r.prototype.deleteRoleMachineIdentity=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("roleMachineIdentity",t,"DELETE")];case 1:return[2,o(e.sent(),["machineIdentityArn"])]}})})},r.prototype.getUserAccess=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.accountId,[4,this.internalFetch("userAccess/"+t,r,"GET")];case 1:return[2,e.sent().users]}})})},r.prototype.getUserAccessByRole=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.accountId,[4,this.internalFetch("reports/users-by-role?accountId="+t,r,"GET")];case 1:return[2,e.sent().users]}})})},r.prototype.getUserRoleAccess=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.accountId,[4,this.internalFetch("userAccess/roles/"+t,r)];case 1:return[2,e.sent().roles]}})})},r.prototype.getAccountOwners=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.accountId,[4,this.internalFetch("userAccess/owners/"+t,r,"GET")];case 1:return[2,e.sent().accountOwners]}})})},r.prototype.createAccessKeys=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("accessKeys",t)];case 1:return[2,o(e.sent(),["iamUserArn","accessKey","secretKey","addedIAMUserToGroup"])]}})})},r.prototype.deleteIAMUser=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("IAMUser",t,"DELETE")];case 1:return e.sent(),[2,!0]}})})},r.prototype.version=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("version",t,"GET")];case 1:return[2,o(e.sent(),["version"])]}})})},r.prototype.getLoginRole=function(n){return Ea.__awaiter(this,void 0,void 0,function(){var t,r;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=n.accountId,r=n.role,[4,this.internalFetch("loginRoles/id/"+t+"/"+r,n,"GET")];case 1:return[2,o(e.sent().loginRole,["account","role","iamKeyActive","maxKeyDuration"])]}})})},r.prototype.getAccessToken=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("accessToken",t)];case 1:return[2,o(e.sent(),["accessToken","expiresIn"])]}})})},r.prototype.getRefreshTokens=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("refreshTokens",t,"GET")];case 1:return[2,e.sent().refreshTokens.map(function(e){return o(e,["clientId","id","userId","value"])})]}})})},r.prototype.revoke=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("revoke",t)];case 1:return[2,"Success"==e.sent().statusMessage]}})})},r.prototype.internalFetch=function(s,a,u){return void 0===a&&(a={}),void 0===u&&(u="POST"),Ea.__awaiter(this,void 0,void 0,function(){var t,r,n,i,o;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=Ea.__assign(Ea.__assign({},this.config),a),o=Ea.__assign({},t),r={"Content-Type":"application/json","User-Agent":"AlksJS/"+Ra.version},void 0!==t.accessToken?(r.Authorization="Bearer "+t.accessToken,delete o.accessToken):void 0!==t.accessKey?(r["ALKS-STS-Access-Key"]=t.accessKey,r["ALKS-STS-Secret-Key"]=t.secretKey,r["ALKS-STS-Session-Token"]=t.sessionToken,delete o.accessKey,delete o.secretKey,delete o.sessionToken):void 0!==t.userid&&(console.error("The userid and password properties are deprecated and should be replaced with an access token"),n=function(e){void 0===e&&(e="");return Aa.Buffer.from(e).toString("base64")}(t.userid+":"+t.password),r.Authorization="Basic "+n,delete o.userid,delete o.password),t.userAgent&&(r["User-Agent"]+=" "+t.userAgent,delete o.userAgent),[4,t._fetch(t.baseUrl+"/"+s,{method:u,headers:r,body:"GET"==u?void 0:JSON.stringify(o)})];case 1:return[4,(i=e.sent()).json().catch(function(){})];case 2:if(o=e.sent(),!i.ok)throw new h(i,o);return[2,o]}})})},r);function r(e){this.config=e}e.Alks=t;var i,h=(i=Error,Ea.__extends(n,i),n);function n(e,t){var r=this,n=Array.isArray(null==t?void 0:t.errors)?t.errors:[];e.statusText&&n.unshift(e.statusText);n=n.join("; ");return(r=i.call(this,n)||this).status=e.status,r.message=n,Object.assign(r,t),r}function o(r,e){return e.reduce(function(e,t){return e[t]=r[t],e},{})}e.AlksError=h;var s=t.prototype.create.call({},{_fetch:Sa});e.create=t.prototype.create.bind(s),e.getAccounts=t.prototype.getAccounts.bind(s),e.getKeys=t.prototype.getKeys.bind(s),e.getIAMKeys=t.prototype.getIAMKeys.bind(s),e.getAllAWSRoleTypes=t.prototype.getAllAWSRoleTypes.bind(s),e.getAWSRoleTypes=t.prototype.getAWSRoleTypes.bind(s),e.getNonServiceAWSRoleTypes=t.prototype.getNonServiceAWSRoleTypes.bind(s),e.createRole=t.prototype.createRole.bind(s),e.createNonServiceRole=t.prototype.createNonServiceRole.bind(s),e.awsAccountRoles=t.prototype.awsAccountRoles.bind(s),e.listAWSAccountRoles=t.prototype.listAWSAccountRoles.bind(s),e.getAccountRole=t.prototype.getAccountRole.bind(s),e.deleteRole=t.prototype.deleteRole.bind(s),e.addRoleMachineIdentity=t.prototype.addRoleMachineIdentity.bind(s),e.deleteRoleMachineIdentity=t.prototype.deleteRoleMachineIdentity.bind(s),e.getUserAccess=t.prototype.getUserAccess.bind(s),e.getUserAccessByRole=t.prototype.getUserAccessByRole.bind(s),e.getUserRoleAccess=t.prototype.getUserRoleAccess.bind(s),e.getAccountOwners=t.prototype.getAccountOwners.bind(s),e.createAccessKeys=t.prototype.createAccessKeys.bind(s),e.deleteIAMUser=t.prototype.deleteIAMUser.bind(s),e.version=t.prototype.version.bind(s),e.getLoginRole=t.prototype.getLoginRole.bind(s),e.getAccessToken=t.prototype.getAccessToken.bind(s),e.getRefreshTokens=t.prototype.getRefreshTokens.bind(s),e.revoke=t.prototype.revoke.bind(s)}(Ta=Ta||{});var Ta=Ta;e.default=Ta,Object.defineProperty(e,"__esModule",{value:!0}),Object.assign(e,Ta)}); +!function(global,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((global="undefined"!=typeof globalThis?globalThis:global||self).alks={})}(this,function(e){"use strict";var t=window||this;function r(r){if(r.__esModule)return r;var n=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(r).forEach(function(e){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}})}),n}var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||0s[0]&&t[1] dist/alks.min.js',build:"npm run clean && npm run compile && npm run rollup && npm run minify",lint:"prettier --write {src,test}/**/*.{ts,js,json,md}",test:"npm run build && npm run lint && npm run mocha && npm run karma",mocha:"nyc mocha test/test.js",coverage:"nyc report --reporter=text-lcov | coveralls",karma:"karma start",docs:"typedoc src/",prepare:"husky install",compile:"tsc"},files:["dist/"],repository:{type:"git",url:"https://github.com/Cox-Automotive/alks.js.git"},author:{name:"Cox Automotive",email:"paul.ofallon@coxautoinc.com",url:"https://github.com/Cox-Automotive/"},bugs:{url:"https://github.com/Cox-Automotive/alks.js/issues"},license:"MIT",engines:{node:">=8.0.0"},dependencies:{"node-fetch":"^2.6.1"},devDependencies:{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/node":"^15.0.2","@types/node-fetch":"^2.5.10",browserify:"^17.0.0",chai:"^4.3.4","chai-as-promised":"^7.1.1",coveralls:"^3.0.3",encoding:"^0.1.13",eslint:"^7.25.0","eslint-plugin-jsdoc":"^4.1.1","fetch-mock":"^7.3.1",husky:"^6.0.0",karma:"^6.3.2","karma-browserify":"^8.0.0","karma-chrome-launcher":"^3.1.0","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","lint-staged":"^11.0.0",mkdirp:"^1.0.4",mocha:"^8.3.2",nyc:"^15.1.0",prettier:"^2.3.0",rimraf:"^3.0.2",rollup:"^2.47.0","rollup-plugin-json":"^3.1.0","rollup-plugin-node-builtins":"^2.1.2","rollup-plugin-node-globals":"^1.4.0","rollup-plugin-replace":"^2.2.0",sinon:"^10.0.0",tslib:"^2.2.0",tslint:"^6.1.3",typescript:"^4.2.4","uglify-js":"^3.13.6",watchify:"^3.11.1"},prettier:{singleQuote:!0,semi:!0,arrowParens:"always",endOfLine:"lf",trailingComma:"es5"},"lint-staged":{"{src,test}/**/*.{js,ts,json,md}":["prettier --write"]}},f=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},d=[],p=[],g="undefined"!=typeof Uint8Array?Uint8Array:Array,_=!1;function m(){_=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t>18&63]+d[n>>12&63]+d[n>>6&63]+d[63&n]);return i.join("")}function b(e){var t;_||m();for(var r=e.length,n=r%3,i="",o=[],s=0,a=r-n;s>2],i+=d[t<<4&63],i+="=="):2==n&&(t=(e[r-2]<<8)+e[r-1],i+=d[t>>10],i+=d[t>>4&63],i+=d[t<<2&63],i+="="),o.push(i),o.join("")}function w(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,c=r?i-1:0,f=r?-1:1,r=e[t+c];for(c+=f,o=r&(1<<-l)-1,r>>=-l,l+=a;0>=-l,l+=n;0>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(t+=1<=s+l?c/n:c*Math.pow(2,1-l))*n&&(s++,n/=2),h<=s+l?(a=0,s=h):1<=s+l?(a=(t*n-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));8<=i;e[r+f]=255&a,f+=d,a/=256,i-=8);for(s=s<=A())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A().toString(16)+" bytes");return 0|e}function j(e){return null!=e&&e._isBuffer}function z(e,t){if(j(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var r=(e="string"!=typeof e?""+e:e).length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return X(e).length;t=(""+t).toLowerCase(),n=!0}}function I(e,t,r){var n,i,o,s=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0);(!r||r<0||n=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(j(t="string"==typeof t?T.from(t,n):t))return 0===t.length?-1:B(e,t,r,n,i);if("number"==typeof t)return t&=255,T.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):B(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function B(e,t,r,n,i){var o=1,s=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s/=o=2,a/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var h=-1,l=r;l>8,n=n%256,i.push(n),i.push(r);return i}(t,e.length-r),e,r,n)}function D(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}return function(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n"},T.prototype.compare=function(e,t,r,n,i){if(!j(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=t)return 0;if(i<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),h=e.slice(t,r),l=0;lthis.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,u=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;if((!n||i<(n=Number(n)))&&(n=i),(i=t.length)%2!=0)throw new TypeError("Invalid hex string");i/2e.length)throw new RangeError("Index out of range")}function Y(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function K(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function W(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $(e,t,r,n,i){return i||W(e,0,r,4),v(e,t,r,n,23,4),r+4}function G(e,t,r,n,i){return i||W(e,0,r,8),v(e,t,r,n,52,8),r+8}T.prototype.slice=function(e,t){var r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):r>>8):Y(this,e,t,!0),t+2},T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,2,65535,0),T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Y(this,e,t,!1),t+2},T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,4,4294967295,0),T.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):K(this,e,t,!0),t+4},T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,4,4294967295,0),T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):K(this,e,t,!1),t+4},T.prototype.writeIntLE=function(e,t,r,n){e=+e,t|=0,n||H(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},T.prototype.writeIntBE=function(e,t,r,n){e=+e,t|=0,n||H(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,o=1,s=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},T.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,1,127,-128),T.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},T.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,2,32767,-32768),T.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Y(this,e,t,!0),t+2},T.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,2,32767,-32768),T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Y(this,e,t,!1),t+2},T.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,4,2147483647,-2147483648),T.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):K(this,e,t,!0),t+4},T.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||H(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):K(this,e,t,!1),t+4},T.prototype.writeFloatLE=function(e,t,r){return $(this,e,t,!0,r)},T.prototype.writeFloatBE=function(e,t,r){return $(this,e,t,!1,r)},T.prototype.writeDoubleLE=function(e,t,r){return G(this,e,t,!0,r)},T.prototype.writeDoubleBE=function(e,t,r){return G(this,e,t,!1,r)},T.prototype.copy=function(e,t,r,n){if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var i,o=(n=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.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;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return function(e){var t;_||m();var r=e.length;if(0>16&255,i[s++]=t>>8&255,i[s++]=255&t;return 2==n?(t=p[e.charCodeAt(a)]<<2|p[e.charCodeAt(a+1)]>>4,i[s++]=255&t):1==n&&(t=p[e.charCodeAt(a)]<<10|p[e.charCodeAt(a+1)]<<4|p[e.charCodeAt(a+2)]>>2,i[s++]=t>>8&255,i[s++]=255&t),i}(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Q(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ee(e){return null!=e&&(!!e._isBuffer||te(e)||"function"==typeof(e=e).readFloatLE&&"function"==typeof e.slice&&te(e.slice(0,0)))}function te(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var re=r(Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:R,Buffer:T,SlowBuffer:function(e){return T.alloc(+(e=+e!=e?0:e))},isBuffer:ee}));function ne(){}function ie(){ie.init.call(this)}function oe(e){return void 0===e._maxListeners?ie.defaultMaxListeners:e._maxListeners}function se(e,t,r,n){var i,o;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');return(i=e._events)?(i.newListener&&(e.emit("newListener",t,r.listener||r),i=e._events),o=i[t]):(i=e._events=new ne,e._eventsCount=0),o?("function"==typeof o?o=i[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),o.warned||(n=oe(e))&&0n&&(o.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",n.emitter=e,n.type=t,n.count=o.length,n=n,"function"==typeof console.warn?console.warn(n):console.log(n))):(o=i[t]=r,++e._eventsCount),e}function ae(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function ue(e){var t=this._events;if(t){e=t[e];if("function"==typeof e)return 1;if(e)return e.length}return 0}function he(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function le(){throw new Error("setTimeout has not been defined")}function ce(){throw new Error("clearTimeout has not been defined")}ne.prototype=Object.create(null),(ie.EventEmitter=ie).usingDomains=!1,ie.prototype.domain=void 0,ie.prototype._events=void 0,ie.prototype._maxListeners=void 0,ie.defaultMaxListeners=10,ie.init=function(){this.domain=null,ie.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ne,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ie.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ie.prototype.getMaxListeners=function(){return oe(this)},ie.prototype.emit=function(e){var t,r,n,i="error"===e,o=this._events;if(o)i=i&&null==o.error;else if(!i)return!1;if(s=this.domain,i){if(i=arguments[1],s)return(i=i||new Error('Uncaught, unspecified "error" event')).domainEmitter=this,i.domain=s,i.domainThrown=!1,s.emit("error",i),!1;if(i instanceof Error)throw i;var s=new Error('Uncaught, unspecified "error" event. ('+i+")");throw s.context=i,s}if(!(t=o[e]))return!1;var a,u="function"==typeof t;switch(a=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=he(e,n),o=0;o>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Ke=T.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function We(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Ke(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Ge;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Ve;break;default:return void(this.write=$e)}this.charBuffer=new T(6),this.charReceived=0,this.charLength=0}function $e(e){return e.toString(this.encoding)}function Ge(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function Ve(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}We.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},We.prototype.end=function(e){var t,r,n="";return e&&e.length&&(n=this.write(e)),this.charReceived&&(t=this.charReceived,r=this.charBuffer,e=this.encoding,n+=r.slice(0,t).toString(e)),n},et.ReadableState=Qe;var Xe,Je=(Me(Se)&&(Se=""),Xe=(Xe="stream").toUpperCase(),Te[Xe]||(new RegExp("\\b"+Xe+"\\b","i").test(Se)?Te[Xe]=function(){var e=function(e){if(!Ue(e)){for(var t=[],r=0;rt.highWaterMark&&(t.highWaterMark=(rt<=(r=e)?r=rt:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function it(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Je("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?ve(ot,e):ot(e))}function ot(e){Je("emit readable"),e.emit("readable"),ht(e)}function st(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=o.slice(s);break}++n}return t.length-=n,i}:function(e,t){var r=T.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0===(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n).data=o.slice(s);break}++i}return t.length-=i,r})(e,t);return n}(e,t.buffer,t.decoder),r);var r}function ct(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return Je("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?ct:it)(this),null;if(0===(e=nt(e,t))&&t.ended)return 0===t.length&&ct(this),null;var n=t.needReadable;return Je("need readable",n),(0===t.length||t.length-et._pos){var n=r.substr(t._pos);if("x-user-defined"===t._charset){for(var i=new T(n.length),o=0;ot._pos&&(t.push(new T(new Uint8Array(s.result.slice(t._pos)))),t._pos=s.result.byteLength)},s.onload=function(){t.push(null)},s.readAsArrayBuffer(r)}t._xhr.readyState===Gt&&"ms-stream"!==t._mode&&t.push(null)},Re(Xt,mt);var Jt=["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","user-agent","via"];Xt.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===Jt.indexOf(r)&&(this._headers[r]={name:e,value:t})},Xt.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},Xt.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},Xt.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e,r=t._opts,n=t._headers;if("POST"!==r.method&&"PUT"!==r.method&&"PATCH"!==r.method||(e=function(){if(void 0!==Ut)return Ut;try{new f.Blob([new ArrayBuffer(1)]),Ut=!0}catch(e){Ut=!1}return Ut}()?new f.Blob(t._body.map(function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(ee(e)){for(var t=new Uint8Array(e.length),r=e.length,n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},cr=er-tr,fr=Math.floor,dr=String.fromCharCode;function pr(e){throw new RangeError(lr[e])}function gr(e,t){var r=e.split("@"),n="";return 1fr((Qt-t)/(u=r+1))&&pr("overflow"),t+=(i-d)*u,d=i,g=0;gQt&&pr("overflow"),a==d){for(o=t,s=er;!(o<(h=s<=p?tr:p+rr<=s?rr:s-p));s+=er)c.push(dr(_r(h+(l=o-h)%(h=er-h),0))),o=fr(l/h);c.push(dr(_r(o,0))),p=function(e,t,r){var n=0;for(e=r?fr(e/ir):e>>1,e+=fr(e/t);cr*rr>>1",'"',"`"," ","\r","\n","\t"]),Tr=["'"].concat(Nt),xr=["%","/","?",";","#"].concat(Tr),Or=["/","?","#"],Lr=255,Pr=/^[+a-z0-9A-Z_-]{0,63}$/,Cr=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jr={javascript:!0,"javascript:":!0},zr={javascript:!0,"javascript:":!0},Ir={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Ur(e,t,r){if(e&&Ne(e)&&e instanceof Er)return e;var n=new Er;return n.parse(e,t,r),n}function Mr(e,t,r,n){if(!Ue(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&iLr?e.hostname="":e.hostname=e.hostname.toLowerCase(),c||(e.hostname=gr(e.hostname,function(e){return ur.test(e)?"xn--"+mr(e):e}));var k=e.port?":"+e.port:"",E=e.hostname||"";e.host=E+k,e.href+=e.host,c&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!jr[S])for(d=0,p=Tr.length;d>>7)]}function jn(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function zn(e,t,r){e.bi_valid>cn-r?(e.bi_buf|=t<>cn-e.bi_valid,e.bi_valid+=r-cn):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function Mn(e,t,r){for(var n,i=new Array(ln+1),o=0,s=1;s<=ln;s++)i[s]=o=o+r[s-1]<<1;for(n=0;n<=t;n++){var a=e[2*n+1];0!==a&&(e[2*n]=Un(i[a]++,a))}}function Bn(e){for(var t=0;t>1;1<=r;r--)Dn(e,o,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Dn(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Dn(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){for(var r,n,i,o,s,a=t.dyn_tree,u=t.max_code,h=t.stat_desc.static_tree,l=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,d=t.stat_desc.max_length,p=0,g=0;g<=ln;g++)e.bl_count[g]=0;for(a[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;o>=8,e.bi_valid-=8)}function Vn(e,t,r,n){var i,o,s=0;0>>=1)if(1&t&&0!==e.dyn_ltree[2*r])return Vr;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Xr;for(r=32;r>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?$n(e,t,r,n):e.strategy===Gr||o===i?(zn(e,(tn<<1)+(n?1:0),3),Zn(e,vn,kn)):(zn(e,(rn<<1)+(n?1:0),3),function(e,t,r,n){var i;for(zn(e,t-257,5),zn(e,r-1,5),zn(e,n-4,4),i=0;i>>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*(Rn[r]+on+1)]++,e.dyn_dtree[2*Cn(t)]++),e.last_lit===e.lit_bufsize-1}function Jn(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){for(r-=s=2e3>>1:r>>>1;e[t]=r}return e}();function ei(e,t,r,n){var i=Qn,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}var ti=0,ri=1,ni=3,ii=4,oi=5,si=0,ai=1,ui=-2,hi=-3,li=-5,ci=-1,fi=1,di=2,pi=3,gi=4,_i=2,mi=8,yi=9,bi=286,wi=30,vi=19,ki=2*bi+1,Ei=15,Ri=3,Ai=258,Si=Ai+Ri+1,Ti=32,xi=42,Oi=69,Li=73,Pi=91,Ci=103,ji=113,zi=666,Ii=1,Ui=2,Mi=3,Bi=4,Ni=3;function Fi(e,t){return e.msg=qr[t],t}function Di(e){return(e<<1)-(4e.avail_out?e.avail_out:r)&&(Yr(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 Hi(e,t){Vn(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,qi(e.strm)}function Yi(e,t){e.pending_buf[e.pending++]=t}function Ki(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Wi(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-Si?e.strstart-(e.w_size-Si):0,h=e.window,l=e.w_mask,c=e.prev,f=e.strstart+Ai,d=h[o+s-1],p=h[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(h[(r=t)+s]===p&&h[r+s-1]===d&&h[r]===h[o]&&h[++r]===h[o+1]){for(o+=2,r++;h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&ou&&0!=--i);return s<=e.lookahead?s:e.lookahead}function $i(e){var t,r,n,i,o,s,a,u,h,l=e.w_size;do{if(h=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-Si)){for(Yr(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;n=e.head[--t],e.head[t]=l<=n?n-l:0,--r;);for(t=r=l;n=e.prev[--t],e.prev[t]=l<=n?n-l:0,--r;);h+=l}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,a=e.strstart+e.lookahead,u=h,h=void 0,h=o.avail_in,r=0===(h=u=Ri)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=Ri&&(e.ins_h=(e.ins_h<=Ri)if(n=Xn(e,e.strstart-e.match_start,e.match_length-Ri),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ri){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=Ri&&(e.ins_h=(e.ins_h<=Ri&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-Ri,n=Xn(e,e.strstart-1-e.prev_match,e.prev_length-Ri),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<>8&255),Yi(r,r.gzhead.time>>16&255),Yi(r,r.gzhead.time>>24&255),Yi(r,9===r.level?2:r.strategy>=di||r.level<2?4:0),Yi(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Yi(r,255&r.gzhead.extra.length),Yi(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ei(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Oi):(Yi(r,0),Yi(r,0),Yi(r,0),Yi(r,0),Yi(r,0),Yi(r,9===r.level?2:r.strategy>=di||r.level<2?4:0),Yi(r,Ni),r.status=ji)):(o=mi+(r.w_bits-8<<4)<<8,o|=(r.strategy>=di||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(o|=Ti),o+=31-o%31,r.status=ji,Ki(r,o),0!==r.strstart&&(Ki(r,e.adler>>>16),Ki(r,65535&e.adler)),e.adler=1)),r.status===Oi)if(r.gzhead.extra){for(n=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>n&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),qi(e),n=r.pending,r.pending!==r.pending_buf_size));)Yi(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Li)}else r.status=Li;if(r.status===Li)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),qi(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.gzindex=0,r.status=Pi)}else r.status=Pi;if(r.status===Pi)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),qi(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(e.adler=ei(e.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.status=Ci)}else r.status=Ci;if(r.status===Ci&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&qi(e),r.pending+2<=r.pending_buf_size&&(Yi(r,255&e.adler),Yi(r,e.adler>>8&255),e.adler=0,r.status=ji)):r.status=ji),0!==r.pending){if(qi(e),0===e.avail_out)return r.last_flush=-1,si}else if(0===e.avail_in&&Di(t)<=Di(s)&&t!==ii)return Fi(e,li);if(r.status===zi&&0!==e.avail_in)return Fi(e,li);if(0!==e.avail_in||0!==r.lookahead||t!==ti&&r.status!==zi){var s=r.strategy===di?function(e,t){for(var r;;){if(0===e.lookahead&&($i(e),0===e.lookahead)){if(t===ti)return Ii;break}if(e.match_length=0,r=Xn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Hi(e,!1),0===e.strm.avail_out))return Ii}return e.insert=0,t===ii?(Hi(e,!0),0===e.strm.avail_out?Mi:Bi):e.last_lit&&(Hi(e,!1),0===e.strm.avail_out)?Ii:Ui}(r,t):r.strategy===pi?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=Ai){if($i(e),e.lookahead<=Ai&&t===ti)return Ii;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=Ri&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ri?(r=Xn(e,1,e.match_length-Ri),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Xn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Hi(e,!1),0===e.strm.avail_out))return Ii}return e.insert=0,t===ii?(Hi(e,!0),0===e.strm.avail_out?Mi:Bi):e.last_lit&&(Hi(e,!1),0===e.strm.avail_out)?Ii:Ui}(r,t):to[r.level].func(r,t);if(s!==Mi&&s!==Bi||(r.status=zi),s===Ii||s===Mi)return 0===e.avail_out&&(r.last_flush=-1),si;if(s===Ui&&(t===ri?Gn(r):t!==oi&&($n(r,0,0,!1),t===ni&&(Zi(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),qi(e),0===e.avail_out))return r.last_flush=-1,si}return t!==ii?si:r.wrap<=0?ai:(2===r.wrap?(Yi(r,255&e.adler),Yi(r,e.adler>>8&255),Yi(r,e.adler>>16&255),Yi(r,e.adler>>24&255),Yi(r,255&e.total_in),Yi(r,e.total_in>>8&255),Yi(r,e.total_in>>16&255),Yi(r,e.total_in>>24&255)):(Ki(r,e.adler>>>16),Ki(r,65535&e.adler)),qi(e),0e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if($i(e),0===e.lookahead&&t===ti)return Ii;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Hi(e,!1),0===e.strm.avail_out))return Ii;if(e.strstart-e.block_start>=e.w_size-Si&&(Hi(e,!1),0===e.strm.avail_out))return Ii}return e.insert=0,t===ii?(Hi(e,!0),0===e.strm.avail_out?Mi:Bi):(e.strstart>e.block_start&&(Hi(e,!1),e.strm.avail_out),Ii)}),new Xi(4,4,8,4,Gi),new Xi(4,5,16,8,Gi),new Xi(4,6,32,32,Gi),new Xi(4,4,16,16,Vi),new Xi(8,16,32,32,Vi),new Xi(8,16,128,128,Vi),new Xi(8,32,128,256,Vi),new Xi(32,128,258,1024,Vi),new Xi(32,258,258,4096,Vi)],ro=30,no=12;var io=15,oo=852,so=592,ao=0,uo=1,ho=2,lo=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],co=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],fo=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],po=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function go(e,t,r,n,i,o,s,a){for(var u,h,l,c,f,d,p,g,_,m=a.bits,y=0,b=0,w=0,v=0,k=0,E=0,R=0,A=0,S=0,T=0,x=null,O=0,L=new Wr(io+1),P=new Wr(io+1),C=null,j=0,y=0;y<=io;y++)L[y]=0;for(b=0;bd?(g=C[j+s[b]],x[O+s[b]]):(g=96,0),u=1<<(p=y-R),w=h=1<>R)+(h-=u)]=p<<24|g<<16|_|0,0!==h;);for(u=1<>=1;if(0!==u?(T&=u-1,T+=u):T=0,b++,0==--L[y]){if(y===v)break;y=t[r+s[b]]}if(k>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function cs(){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 Wr(320),this.work=new Wr(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function fs(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,(t=e)&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Lo,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new $r(us),e.distcode=e.distdyn=new $r(hs),e.sane=1,e.back=-1,ko):Ao):Ao}function ds(e,t){var r,n,i;return e?(r=new cs,(e.state=r).window=null,n=t,(r=(r=e)&&r.state?(t=r.state,n<0?(i=0,n=-n):(i=1+(n>>4),n<48&&(n&=15)),n&&(n<8||15>>8&255,r.check=ei(r.check,C,2,0),l=h=0,r.mode=Po;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=os;break}if((15&h)!==Oo){e.msg="unknown compression method",r.mode=os;break}if(l-=4,k=8+(15&(h>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=os;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=ei(r.check,C,2,0)),l=h=0,r.mode=Co;case Co:for(;l<32;){if(0===a)break e;a--,h+=n[o++]<>>8&255,C[2]=h>>>16&255,C[3]=h>>>24&255,r.check=ei(r.check,C,4,0)),l=h=0,r.mode=jo;case jo:for(;l<16;){if(0===a)break e;a--,h+=n[o++]<>8),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=ei(r.check,C,2,0)),l=h=0,r.mode=zo;case zo:if(1024&r.flags){for(;l<16;){if(0===a)break e;a--,h+=n[o++]<>>8&255,r.check=ei(r.check,C,2,0)),l=h=0}else r.head&&(r.head.extra=null);r.mode=Io;case Io:if(1024&r.flags&&((d=a<(d=r.length)?a:d)&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Yr(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=ei(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=Uo;case Uo:if(2048&r.flags){if(0===a)break e;for(d=0;k=n[o+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Do;break;case No:for(;l<32;){if(0===a)break e;a--,h+=n[o++]<>>=7&l,l-=7&l,r.mode=rs;break}for(;l<3;){if(0===a)break e;a--,h+=n[o++]<>>=1)){case 0:r.mode=qo;break;case 1:if(!function(e){if(_s){var t;for(ps=new $r(512),gs=new $r(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(go(mo,e.lens,0,288,ps,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;go(yo,e.lens,0,32,gs,0,e.work,{bits:5}),_s=!1}e.lencode=ps,e.lenbits=9,e.distcode=gs,e.distbits=5}(r),r.mode=Go,t!==vo)break;h>>>=2,l-=2;break e;case 2:r.mode=Ko;break;case 3:e.msg="invalid block type",r.mode=os}h>>>=2,l-=2;break;case qo:for(h>>>=7&l,l-=7&l;l<32;){if(0===a)break e;a--,h+=n[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=os;break}if(r.length=65535&h,l=h=0,r.mode=Ho,t===vo)break e;case Ho:r.mode=Yo;case Yo:if(d=r.length){if(0===(d=u<(d=a>>=5,l-=5,r.ndist=1+(31&h),h>>>=5,l-=5,r.ncode=4+(15&h),h>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},E=go(_o,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,E){e.msg="invalid code lengths set",r.mode=os;break}r.have=0,r.mode=$o;case $o:for(;r.have>>16&255,y=65535&P,!((_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=_,l-=_,r.lens[r.have++]=y;else{if(16===y){for(A=_+2;l>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=os;break}k=r.lens[r.have-1],d=3+(3&h),h>>>=2,l-=2}else if(17===y){for(A=_+3;l>>=_)),h>>>=3,l-=3}else{for(A=_+7;l>>=_)),h>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=os;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===os)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=os;break}if(r.lenbits=9,R={bits:r.lenbits},E=go(mo,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,E){e.msg="invalid literal/lengths set",r.mode=os;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},E=go(yo,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,E){e.msg="invalid distances set",r.mode=os;break}if(r.mode=Go,t===vo)break e;case Go:r.mode=Vo;case Vo:if(6<=a&&258<=u){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=h,r.bits=l,function(e,t){var r,n,i,o,s,a,u=e.state,h=e.next_in,l=e.input,c=h+(e.avail_in-5),f=e.next_out,d=e.output,p=f-(t-e.avail_out),g=f+(e.avail_out-257),_=u.dmax,m=u.wsize,y=u.whave,b=u.wnext,w=u.window,v=u.hold,k=u.bits,E=u.lencode,R=u.distcode,A=(1<>>=n=r>>>24,k-=n,0===(n=r>>>16&255))d[f++]=65535&r;else{if(!(16&n)){if(0==(64&n)){r=E[(65535&r)+(v&(1<>>=n,k-=n),k<15&&(v+=l[h++]<>>=n=r>>>24,k-=n,!(16&(n=r>>>16&255))){if(0==(64&n)){r=R[(65535&r)+(v&(1<>>=n,k-=n,(n=f-p)>3)<<3))-1,e.next_in=h-=i,e.next_out=f,e.avail_in=h>>16&255,y=65535&P,!((_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>b)])>>>16&255,y=65535&P,!(b+(_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=b,l-=b,r.back+=b}if(h>>>=_,l-=_,r.back+=_,r.length=y,0===m){r.mode=ts;break}if(32&m){r.back=-1,r.mode=Do;break}if(64&m){e.msg="invalid literal/length code",r.mode=os;break}r.extra=15&m,r.mode=Xo;case Xo:if(r.extra){for(A=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Jo;case Jo:for(;m=(P=r.distcode[h&(1<>>16&255,y=65535&P,!((_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>b)])>>>16&255,y=65535&P,!(b+(_=P>>>24)<=l);){if(0===a)break e;a--,h+=n[o++]<>>=b,l-=b,r.back+=b}if(h>>>=_,l-=_,r.back+=_,64&m){e.msg="invalid distance code",r.mode=os;break}r.offset=y,r.extra=15&m,r.mode=Qo;case Qo:if(r.extra){for(A=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=os;break}r.mode=es;case es:if(0===u)break e;if(r.offset>(d=f-u)){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=os;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),g=r.window}else g=i,p=s-r.offset,d=r.length;for(u-=d=u=L.wsize?(Yr(L.window,T,x-L.wsize,L.wsize,0),L.wnext=0,L.whave=L.wsize):(S=L.wsize-L.wnext,Yr(L.window,T,x-O,S=ORs.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsRs.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelRs.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelRs.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=Rs.Z_FILTERED&&e.strategy!=Rs.Z_HUFFMAN_ONLY&&e.strategy!=Rs.Z_RLE&&e.strategy!=Rs.Z_FIXED&&e.strategy!=Rs.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!ee(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Rs.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;e=new Error(e);e.errno=t,e.code=Rs.codes[t],r.emit("error",e)};var n=Rs.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);t=Rs.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(t=e.strategy),this._binding.init(e.windowBits||Rs.Z_DEFAULT_WINDOWBITS,n,e.memLevel||Rs.Z_DEFAULT_MEMLEVEL,t,e.dictionary),this._buffer=new T(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=t,this.once("end",this.close)}Object.keys(As).forEach(function(e){As[As[e]]=e}),Re(Is,Ct),Is.prototype.params=function(e,t,r){if(eRs.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=Rs.Z_FILTERED&&t!=Rs.Z_HUFFMAN_ONLY&&t!=Rs.Z_RLE&&t!=Rs.Z_FIXED&&t!=Rs.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);var n;this._level!==e||this._strategy!==t?(n=this).flush(Rs.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())}):ve(r)},Is.prototype.reset=function(){return this._binding.reset()},Is.prototype._flush=function(e){this._transform(new T(0),"",e)},Is.prototype.flush=function(e,t){var r,n=this._writableState;"function"!=typeof e&&(void 0!==e||t)||(t=e,e=Rs.Z_FULL_FLUSH),n.ended?t&&ve(t):n.ending?t&&this.once("end",t):n.needDrain?(r=this).once("drain",function(){r.flush(t)}):(this._flushFlag=e,this.write(new T(0),"",t))},Is.prototype.close=function(e){var t;e&&ve(e),this._closed||(this._closed=!0,this._binding.close(),t=this,ve(function(){t.emit("close")}))},Is.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!ee(e))return r(new Error("invalid input"));o?n=Rs.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||Rs.Z_NO_FLUSH)),this._processChunk(e,n,r)},Is.prototype._processChunk=function(i,o,s){var a=i&&i.length,u=this._chunkSize-this._offset,h=0,l=this,c="function"==typeof s;if(!c){var t,f=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,i,h,a,this._buffer,this._offset,u)}while(!this._hadError&&p(e[0],e[1]));if(this._hadError)throw t;var r=T.concat(f,d);return this.close(),r}r=this._binding.write(o,i,h,a,this._buffer,this._offset,u);function p(e,t){if(!l._hadError){var r,n=u-t;if(!function(e,t){if(!e)throw new Error(t)}(0<=n,"have should not go down"),0=l._chunkSize)&&(u=l._chunkSize,l._offset=0,l._buffer=new T(l._chunkSize)),0===t){if(h+=a-e,a=e,!c)return!0;e=l._binding.write(o,i,h,a,l._buffer,l._offset,l._chunkSize);return e.callback=p,void(e.buffer=i)}if(!c)return!1;s()}}r.buffer=i,r.callback=p},Re(xs,Is),Re(Os,Is),Re(Ls,Is),Re(Ps,Is),Re(Cs,Is),Re(js,Is),Re(zs,Is);var Us={codes:As,createDeflate:function(e){return new xs(e)},createInflate:function(e){return new Os(e)},createDeflateRaw:function(e){return new Cs(e)},createInflateRaw:function(e){return new js(e)},createGzip:function(e){return new Ls(e)},createGunzip:function(e){return new Ps(e)},createUnzip:function(e){return new zs(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new xs(t),e,r)},deflateSync:function(e,t){return Ts(new xs(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new Ls(t),e,r)},gzipSync:function(e,t){return Ts(new Ls(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new Cs(t),e,r)},deflateRawSync:function(e,t){return Ts(new Cs(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new zs(t),e,r)},unzipSync:function(e,t){return Ts(new zs(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new Os(t),e,r)},inflateSync:function(e,t){return Ts(new Os(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new Ps(t),e,r)},gunzipSync:function(e,t){return Ts(new Ps(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ss(new js(t),e,r)},inflateRawSync:function(e,t){return Ts(new js(t),e)},Deflate:xs,Inflate:Os,Gzip:Ls,Gunzip:Ps,DeflateRaw:Cs,InflateRaw:js,Unzip:zs,Zlib:Is};const Ms=It.Readable,Bs=Symbol("buffer"),Ns=Symbol("type");class Fs{constructor(){this[Ns]="";var e=arguments[0],t=arguments[1];const r=[];let n=0;if(e){var i=e,o=Number(i.length);for(let t=0;tn.size)return a=!0,void t(new Ds(`content size at ${n.url} over limit: ${n.size}`,"max-size"));s+=e.length,o.push(e)}}),i.on("end",function(){if(!a){clearTimeout(r);try{e(Buffer.concat(o,s))}catch(e){t(new Ds(`Could not create Buffer from response body for ${n.url}: ${e.message}`,"system",e))}}})})}function Ws(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function $s(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function Gs(e){var t,r;let n=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof It&&"function"!=typeof n.getBoundary&&(t=new Hs,r=new Hs,n.pipe(t),n.pipe(r),e[qs].body=t,n=r),n}function Vs(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":Ws(e)?"application/x-www-form-urlencoded;charset=UTF-8":$s(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof It?null:"text/plain;charset=UTF-8"}function Xs(e){const t=e.body;return null===t?0:$s(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}Ys.prototype={get body(){return this[qs].body},get bodyUsed(){return this[qs].disturbed},arrayBuffer(){return Ks.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)})},blob(){let t=this.headers&&this.headers.get("content-type")||"";return Ks.call(this).then(function(e){return Object.assign(new Fs([],{type:t.toLowerCase()}),{[Bs]:e})})},json(){var t=this;return Ks.call(this).then(function(e){try{return JSON.parse(e.toString())}catch(e){return Ys.Promise.reject(new Ds(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}})},text(){return Ks.call(this).then(function(e){return e.toString()})},buffer(){return Ks.call(this)},textConverted(){var t=this;return Ks.call(this).then(function(e){return function(e,t){if("function"!=typeof Zs)throw new Error("The package `encoding` must be installed to use the textConverted() function");t=t.get("content-type");let r="utf-8",n,i;t&&(n=/charset=([^;]*)/i.exec(t));i=e.slice(0,1024).toString(),!n&&i&&(n=/=f.follow)return c(new Ds(`maximum redirect reached at: ${f.url}`,"max-redirect")),void g();const a={headers:new ia(f.headers),follow:f.follow,counter:f.counter+1,agent:f.agent,compress:f.compress,method:f.method,body:f.body,signal:f.signal,timeout:f.timeout,size:f.size};return 303!==e.statusCode&&f.body&&null===Xs(f)?(c(new Ds("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void g()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==f.method)||(a.method="GET",a.body=void 0,a.headers.delete("content-length")),l(ka(new ma(n,a))),void g())}}e.once("end",function(){d&&d.removeEventListener("abort",_)});let i=e.pipe(new wa);const o={url:f.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:f.size,timeout:f.timeout,counter:f.counter};var s=t.get("Content-Encoding");if(!f.compress||"HEAD"===f.method||null===s||204===e.statusCode||304===e.statusCode)return p=new ca(i,o),void l(p);r={flush:Us.Z_SYNC_FLUSH,finishFlush:Us.Z_SYNC_FLUSH};if("gzip"==s||"x-gzip"==s)return i=i.pipe(Us.createGunzip(r)),p=new ca(i,o),void l(p);if("deflate"!=s&&"x-deflate"!=s){if("br"==s&&"function"==typeof Us.createBrotliDecompress)return i=i.pipe(Us.createBrotliDecompress()),p=new ca(i,o),void l(p);p=new ca(i,o),l(p)}else{const u=e.pipe(new wa);u.once("data",function(e){i=8==(15&e[0])?i.pipe(Us.createInflate()):i.pipe(Us.createInflateRaw()),p=new ca(i,o),l(p)})}}),function(e,t){const r=t.body;null===r?e.end():$s(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(n,f)}})}ka.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},ka.Promise=t.Promise;var t=r(Object.freeze({__proto__:null,default:ka,Headers:ia,Request:ma,Response:ca,FetchError:Ds})),Ea=h,Ra=Ea.__importStar(l),Aa=re;Ea.__importDefault(t);var Sa=window.fetch.bind(window);!function(e){(t=e.TrustType||(e.TrustType={})).CrossAccount="Cross Account",t.InnerAccount="Inner Account",(s=e.PseudoBoolean||(e.PseudoBoolean={}))[s.True=1]="True",s[s.False=0]="False";var t=(r.prototype.create=function(e){return new r(Ea.__assign(Ea.__assign({},this.config),e))},r.prototype.getAccounts=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAccounts",r)];case 1:return t=e.sent(),[2,Object.keys(t.accountListRole).map(function(e){return{account:e,role:t.accountListRole[e][0].role,iamKeyActive:t.accountListRole[e][0].iamKeyActive,maxKeyDuration:t.accountListRole[e][0].maxKeyDuration,skypieaAccount:t.accountListRole[e][0].skypieaAccount}})]}})})},r.prototype.getKeys=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getKeys",t)];case 1:return[2,o(e.sent(),["accessKey","secretKey","sessionToken","consoleURL"])]}})})},r.prototype.getIAMKeys=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getIAMKeys",t)];case 1:return[2,o(e.sent(),["accessKey","secretKey","sessionToken","consoleURL"])]}})})},r.prototype.getAllAWSRoleTypes=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.getDynamicValues?"allAwsRoleTypes?getDynamicValues=true":"allAwsRoleTypes",[4,this.internalFetch(t,r,"GET")];case 1:return[2,e.sent().roleTypes]}})})},r.prototype.getAWSRoleTypes=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAWSRoleTypes",r)];case 1:return t=e.sent(),[2,JSON.parse(t.roleTypes)]}})})},r.prototype.getNonServiceAWSRoleTypes=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getNonServiceAWSRoleTypes",r)];case 1:return t=e.sent(),[2,JSON.parse(t.roleTypes)]}})})},r.prototype.createRole=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("createRole",r)];case 1:return(t=e.sent()).denyArns=t.denyArns.split(","),[2,o(t,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile"])]}})})},r.prototype.createNonServiceRole=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("createNonServiceRole",r)];case 1:return(t=e.sent()).denyArns=t.denyArns.split(","),[2,o(t,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile"])]}})})},r.prototype.awsAccountRoles=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("awsAccountRoles?account="+t.account,t,"GET")];case 1:return[2,e.sent().awsRoleList]}})})},r.prototype.listAWSAccountRoles=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("listAWSAccountRoles",r)];case 1:return t=e.sent(),[2,JSON.parse(t.jsonAWSRoleList).map(function(e){return e.split("/").slice(-1)[0]})]}})})},r.prototype.getAccountRole=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAccountRole",r)];case 1:if(!(t=e.sent()).roleExists)throw new Error("Role "+r.roleName+" does not exist in this account");return[2,t.roleARN]}})})},r.prototype.deleteRole=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("deleteRole",t)];case 1:return e.sent(),[2,!0]}})})},r.prototype.addRoleMachineIdentity=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("roleMachineIdentity",t)];case 1:return[2,o(e.sent(),["machineIdentityArn"])]}})})},r.prototype.deleteRoleMachineIdentity=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("roleMachineIdentity",t,"DELETE")];case 1:return[2,o(e.sent(),["machineIdentityArn"])]}})})},r.prototype.getUserAccess=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.accountId,[4,this.internalFetch("userAccess/"+t,r,"GET")];case 1:return[2,e.sent().users]}})})},r.prototype.getUserAccessByRole=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.accountId,[4,this.internalFetch("reports/users-by-role?accountId="+t,r,"GET")];case 1:return[2,e.sent().users]}})})},r.prototype.getUserRoleAccess=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.accountId,[4,this.internalFetch("userAccess/roles/"+t,r)];case 1:return[2,e.sent().roles]}})})},r.prototype.getAccountOwners=function(r){return Ea.__awaiter(this,void 0,void 0,function(){var t;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=r.accountId,[4,this.internalFetch("userAccess/owners/"+t,r,"GET")];case 1:return[2,e.sent().accountOwners]}})})},r.prototype.createAccessKeys=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("accessKeys",t)];case 1:return[2,o(e.sent(),["iamUserArn","accessKey","secretKey","addedIAMUserToGroup"])]}})})},r.prototype.deleteIAMUser=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("IAMUser",t,"DELETE")];case 1:return e.sent(),[2,!0]}})})},r.prototype.version=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("version",t,"GET")];case 1:return[2,o(e.sent(),["version"])]}})})},r.prototype.getLoginRole=function(n){return Ea.__awaiter(this,void 0,void 0,function(){var t,r;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=n.accountId,r=n.role,[4,this.internalFetch("loginRoles/id/"+t+"/"+r,n,"GET")];case 1:return[2,o(e.sent().loginRole,["account","role","iamKeyActive","maxKeyDuration"])]}})})},r.prototype.getAccessToken=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("accessToken",t)];case 1:return[2,o(e.sent(),["accessToken","expiresIn"])]}})})},r.prototype.getRefreshTokens=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("refreshTokens",t,"GET")];case 1:return[2,e.sent().refreshTokens.map(function(e){return o(e,["clientId","id","userId","value"])})]}})})},r.prototype.revoke=function(t){return Ea.__awaiter(this,void 0,void 0,function(){return Ea.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("revoke",t)];case 1:return[2,"Success"==e.sent().statusMessage]}})})},r.prototype.internalFetch=function(s,a,u){return void 0===a&&(a={}),void 0===u&&(u="POST"),Ea.__awaiter(this,void 0,void 0,function(){var t,r,n,i,o;return Ea.__generator(this,function(e){switch(e.label){case 0:return t=Ea.__assign(Ea.__assign({},this.config),a),o=Ea.__assign({},t),r={"Content-Type":"application/json","User-Agent":"AlksJS/"+Ra.version},void 0!==t.accessToken?(r.Authorization="Bearer "+t.accessToken,delete o.accessToken):void 0!==t.accessKey?(r["ALKS-STS-Access-Key"]=t.accessKey,r["ALKS-STS-Secret-Key"]=t.secretKey,r["ALKS-STS-Session-Token"]=t.sessionToken,delete o.accessKey,delete o.secretKey,delete o.sessionToken):void 0!==t.userid&&(console.error("The userid and password properties are deprecated and should be replaced with an access token"),n=function(e){void 0===e&&(e="");return Aa.Buffer.from(e).toString("base64")}(t.userid+":"+t.password),r.Authorization="Basic "+n,delete o.userid,delete o.password),t.userAgent&&(r["User-Agent"]+=" "+t.userAgent,delete o.userAgent),[4,t._fetch(t.baseUrl+"/"+s,{method:u,headers:r,body:"GET"==u?void 0:JSON.stringify(o)})];case 1:return[4,(i=e.sent()).json().catch(function(){})];case 2:if(o=e.sent(),!i.ok)throw new h(i,o);return[2,o]}})})},r);function r(e){this.config=e}e.Alks=t;var i,h=(i=Error,Ea.__extends(n,i),n);function n(e,t){var r=this,n=Array.isArray(null==t?void 0:t.errors)?t.errors:[];e.statusText&&n.unshift(e.statusText);n=n.join("; ");return(r=i.call(this,n)||this).status=e.status,r.message=n,Object.assign(r,t),r}function o(r,e){return e.reduce(function(e,t){return e[t]=r[t],e},{})}e.AlksError=h;var s=t.prototype.create.call({},{_fetch:Sa});e.create=t.prototype.create.bind(s),e.getAccounts=t.prototype.getAccounts.bind(s),e.getKeys=t.prototype.getKeys.bind(s),e.getIAMKeys=t.prototype.getIAMKeys.bind(s),e.getAllAWSRoleTypes=t.prototype.getAllAWSRoleTypes.bind(s),e.getAWSRoleTypes=t.prototype.getAWSRoleTypes.bind(s),e.getNonServiceAWSRoleTypes=t.prototype.getNonServiceAWSRoleTypes.bind(s),e.createRole=t.prototype.createRole.bind(s),e.createNonServiceRole=t.prototype.createNonServiceRole.bind(s),e.awsAccountRoles=t.prototype.awsAccountRoles.bind(s),e.listAWSAccountRoles=t.prototype.listAWSAccountRoles.bind(s),e.getAccountRole=t.prototype.getAccountRole.bind(s),e.deleteRole=t.prototype.deleteRole.bind(s),e.addRoleMachineIdentity=t.prototype.addRoleMachineIdentity.bind(s),e.deleteRoleMachineIdentity=t.prototype.deleteRoleMachineIdentity.bind(s),e.getUserAccess=t.prototype.getUserAccess.bind(s),e.getUserAccessByRole=t.prototype.getUserAccessByRole.bind(s),e.getUserRoleAccess=t.prototype.getUserRoleAccess.bind(s),e.getAccountOwners=t.prototype.getAccountOwners.bind(s),e.createAccessKeys=t.prototype.createAccessKeys.bind(s),e.deleteIAMUser=t.prototype.deleteIAMUser.bind(s),e.version=t.prototype.version.bind(s),e.getLoginRole=t.prototype.getLoginRole.bind(s),e.getAccessToken=t.prototype.getAccessToken.bind(s),e.getRefreshTokens=t.prototype.getRefreshTokens.bind(s),e.revoke=t.prototype.revoke.bind(s)}(Ta=Ta||{});var Ta=Ta;e.default=Ta,Object.defineProperty(e,"__esModule",{value:!0}),Object.assign(e,Ta)}); diff --git a/dist/alks.umd.js b/dist/alks.umd.js index e23243cf..1621e45d 100644 --- a/dist/alks.umd.js +++ b/dist/alks.umd.js @@ -287,7 +287,7 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(tslib_es6); var name = "alks.js"; - var version = "1.12.5"; + var version = "1.12.6"; var description = "JavaScript client for the ALKS API, usable in both modern browsers and node.js"; var main = "dist/alks.cjs.js"; var types = "dist/src/alks.d.ts"; diff --git a/package-lock.json b/package-lock.json index 4b5ffdb6..1aee9bc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "alks.js", - "version": "1.12.5", + "version": "1.12.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5d4f1e84..2c47c634 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alks.js", - "version": "1.12.5", + "version": "1.12.6", "description": "JavaScript client for the ALKS API, usable in both modern browsers and node.js", "main": "dist/alks.cjs.js", "types": "dist/src/alks.d.ts",